Bläddra i källkod

Merge branch 'v2' of http://39.101.143.165:8090/wrj/GuangYuYuan-app into xueyh

xyh 4 månader sedan
förälder
incheckning
7e850a289f

+ 37 - 0
src/api/pointOrder.js

@@ -36,3 +36,40 @@ export function cancelReturn(data) {
     });
 }
 
+
+
+
+//商品下单
+export function productOrderCreate(data) {
+    return request({
+        method: 'post',
+        url: '/product/order/create',
+        data
+    });
+}
+//商品支付
+export function productOrderPay(data) {
+    return request({
+        method: 'post',
+        url: '/product/order/pay',
+        data
+    });
+}
+
+//取消订单
+export function productOrderCancel(data) {
+    return request({
+        method: 'post',
+        url: '/product/order/cancel',
+        data
+    });
+}
+//发起售后申请
+export function afterSaleOrder(data) {
+    return request({
+        method: 'post',
+        url: '/after/sale/order',
+        data
+    });
+}
+

+ 2 - 8
src/api/points.js

@@ -63,11 +63,5 @@ export function productGetById(data) {
         data
     });
 }
-//商品下单
-export function productOrderCreate(data) {
-    return request({
-        method: 'post',
-        url: '/product/order/create',
-        data
-    });
-}
+
+

+ 31 - 12
src/pages.json

@@ -550,38 +550,57 @@
 				},{
 					"path": "productDetails/index",
 					"style": {
-						"navigationBarTitleText": "商品详情",
-						"navigationStyle": "custom"
+						//"navigationBarTitleText": "商品详情",
+						"navigationStyle": "custom",
+						"app-plus": {
+     						 "titleNView": false // 关闭 App 端导航栏
+    					}
 					}
 				},{
 					"path": "productDetails/addressManagement",
 					"style": {
-						"navigationBarTitleText": "地址管理",
-						"navigationStyle": "custom"
+						//"navigationBarTitleText": "地址管理",
+						"navigationStyle": "custom",
+						"app-plus": {
+     						 "titleNView": false // 关闭 App 端导航栏
+    					}
+						
 					}
 				},{
 					"path": "productDetails/paymentSuccessful",
 					"style": {
-						"navigationBarTitleText": "兑换成功",
-						"navigationStyle": "custom"
+						//"navigationBarTitleText": "兑换成功",
+						"navigationStyle": "custom",
+						"app-plus": {
+     						 "titleNView": false // 关闭 App 端导航栏
+    					}
 					}
 				},{
 					"path": "productDetails/pendingPayment",
 					"style": {
-						"navigationBarTitleText": "待支付",
-						"navigationStyle": "custom"
+						//"navigationBarTitleText": "待支付",
+						"navigationStyle": "custom",
+						"app-plus": {
+     						 "titleNView": false // 关闭 App 端导航栏
+    					}
 					}
 				},{
 					"path": "productDetails/applyRefund",
 					"style": {
-						"navigationBarTitleText": "申请退款",
-						"navigationStyle": "custom"
+						//"navigationBarTitleText": "申请退款",
+						"navigationStyle": "custom",
+						"app-plus": {
+     						 "titleNView": false // 关闭 App 端导航栏
+    					}
 					}
 				},{
 					"path": "productDetails/applyExchange",
 					"style": {
-						"navigationBarTitleText": "申请换货",
-						"navigationStyle": "custom"
+						//"navigationBarTitleText": "申请换货",
+						"navigationStyle": "custom",
+						"app-plus": {
+     						 "titleNView": false // 关闭 App 端导航栏
+    					}
 					}
 				}
 			]

+ 35 - 8
src/pages/address/index.vue

@@ -7,7 +7,8 @@
 			<view class="main-list">
 				<u-radio-group v-model="selected" placement="column" activeColor="#0879FF" @change="onChange">
 					<template v-for="(item, i) in dataList">
-						<view class="mitem" :key="i" v-if="item.type != 2">
+						<view class="mitem" :key="i" v-if="item.type != 2" @click="selectedAddressFun(item)"
+							:style="{ border: selectedAddressId == item.id ? '1px solid rgba(3, 193, 184, 1)' : 'none' }">
 							<view class="info-box" @click="onClick(item)">
 								<view class="item-line atext">
 									<text class="name">{{ item.userName }}</text>
@@ -41,10 +42,7 @@
 
 			<!-- 底部操作栏 -->
 			<view class="footer-bar" slot="bottom">
-				<u-button
-					text="新增地址信息"
-					@click="onAdd"
-				></u-button>
+				<u-button text="新增地址信息" @click="onAdd"></u-button>
 			</view>
 		</z-paging>
 	</view>
@@ -63,19 +61,37 @@ export default {
 			query: {},
 			dataList: [],
 			selected: '',
+			selectedAddressId: null,
 		}
 	},
 	computed: {
-		
+
 	},
 	onLoad(query) {
 		this.query = query;
+		//商品详情页传过来的id
+		if (query.selectedAddressId) {
+			this.selectedAddressId = query.selectedAddressId
+
+		}
 	},
 	onShow() {
 		this.canReset && this.$refs.paging.reload();
 		this.canReset = true;
 	},
 	methods: {
+		//选择地址
+		selectedAddressFun(item) {
+			//只有商品详情页传过来id,才能点击选择
+			if (this.selectedAddressId) {
+				this.selectedAddressId = item.id
+				let pages = getCurrentPages();
+				let prevPage = pages[pages.length - 2];
+				// 传参
+				prevPage.$vm.selectedAddressId = this.selectedAddressId;
+			}
+
+		},
 		// 获取数据
 		queryList(pageNo, pageSize) {
 			let params = {
@@ -171,37 +187,46 @@ export default {
 	display: flex;
 	flex-direction: column;
 }
+
 .main-list {
 	flex: 1;
 	padding: 24rpx;
+
 	.mitem {
 		padding: 20rpx;
 		margin-bottom: 24rpx;
 		background: #FFFFFF;
-		box-shadow: 0 4rpx 16rpx 0 rgba(176,176,176,0.05);;
+		box-shadow: 0 4rpx 16rpx 0 rgba(176, 176, 176, 0.05);
+		;
 		border-radius: 12rpx;
+
 		.item-line {
 			display: flex;
 			align-items: center;
 		}
+
 		.info-box {
 			flex: 1;
+
 			.atext {
 				font-weight: 400;
 				font-size: 30rpx;
 				color: #333;
 			}
+
 			.btext {
 				font-weight: 400;
 				font-size: 28rpx;
 				color: #2F3437;
 				margin-top: 12rpx;
 			}
+
 			.name {
 				font-weight: 500;
 				margin-right: 10rpx;
 			}
 		}
+
 		.actions {
 			font-weight: 400;
 			font-size: 28rpx;
@@ -209,19 +234,21 @@ export default {
 			display: flex;
 			align-items: center;
 			justify-content: space-between;
+
 			.right {
 				gap: 24rpx;
 				display: flex;
 				align-items: center;
 			}
 		}
+
 		.default {
 			font-weight: 400;
 			font-size: 28rpx;
 			color: #F35031;
 			margin-left: 20rpx;
 			padding: 2rpx 12rpx;
-			background: rgba(243,80,49,0.1);
+			background: rgba(243, 80, 49, 0.1);
 			border-radius: 8rpx;
 		}
 	}

+ 1 - 1
src/points/components/product-list/product-list.vue

@@ -234,7 +234,7 @@ export default {
     // 处理兑换
     handleExchange(product) {
       uni.navigateTo({
-        url: '/points/productDetails/index?id=10'
+        url: `/points/productDetails/index?id=${product.id}`
       });
       console.log('兑换商品:', product)
     },

+ 3 - 3
src/points/order/orderDetails.vue

@@ -130,14 +130,14 @@ export default {
         tab = 1
       } else if (this.receiptStatus == "received" && this.afterSalesType == "exchange") {
         uni.navigateTo({
-          url: '/points/productDetails/applyExchange'
+          url: `/points/productDetails/applyExchange?orderNo=${this.orderInfo.orderNo}&orderId=${this.orderInfo.id}`
         });
         return
       }
       //receivedStatus 1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
       //tab 1 退款 2 换货
-      uni.navigateTo({
-        url: `/points/productDetails/applyRefund?receivedStatus=${receivedStatus}&tab=${tab}`
+      uni.navigateTo({ 
+        url: `/points/productDetails/applyRefund?receivedStatus=${receivedStatus}&tab=${tab}&orderNo=${this.orderInfo.orderNo}&orderId=${this.orderInfo.id}`
       });
     }
   }

+ 8 - 1
src/points/order/orderList.vue

@@ -67,7 +67,14 @@ export default {
       this.page++
       this.getListOrder(true)
     },
-    viewDetail(order){
+    viewDetail(order) {
+      //payStatus": 0 未支付, 1已支付
+      if (order.payStatus==0) { //跳转到待支付页面
+        uni.navigateTo({
+          url: `/points/productDetails/pendingPayment?orderNo=${order.orderNo}`
+        });
+        return
+      }
       uni.navigateTo({
         url: '/points/order/orderDetails?orderNo=' + order.orderNo,
       });

+ 37 - 16
src/points/productDetails/applyExchange.vue

@@ -25,7 +25,7 @@
                 </view>
                 <view class="mustInput">
                     <u--form>
-                        <u-form-item required="true" label="申请原因" label-width="58" prop="selectReasonValue">
+                        <u-form-item required label="申请原因" label-width="58" prop="selectReasonValue">
                             <view class="tip">
                                 <view :style="{ color: selectReasonValue ? '#333' : '#999' }">{{
                                     selectReasonValue !== null ? selectReasonValue : '请选择申请原因' }}</view>
@@ -35,9 +35,10 @@
                             </view>
                         </u-form-item>
 
-                        <u-form-item required="true" label="问题描述/凭证" label-width="86" prop="selectReasonValue">
+                        <u-form-item required label="问题描述/凭证" label-width="86" prop="selectReasonValue">
                             <view class="tip">
-                                <view>{{ questionOrDiscribeValue ? questionOrDiscribeValue : '请您务必上传描述和凭证' }}</view>
+                                <view :style="{ color: questionOrDiscribeValue ? '#333' : '#999' }" class="questionOrDiscribeValue">
+                                    {{ questionOrDiscribeValue ? questionOrDiscribeValue : '请您务必上传描述和凭证' }}</view>
                                 <image style="width: 28rpx;height: 28rpx;margin-left: 8rpx;"
                                     @click="selectApplyReasonFun('2')" src="@/static/points/Keyboard_arrow_rifht.png"
                                     mode=""></image>
@@ -76,15 +77,16 @@
 </template>
 
 <script>
-import ApplyRefund from './applyRefund.vue';
-
+import { afterSaleOrder} from '@/api/pointOrder'
 
 export default {
     components: {},
     data() {
         return {
+            orderNo:null,
+            orderId:null,
             fileList: [],
-            questionOrDiscribeValue: '',
+            questionOrDiscribeValue: null,
             selectReasonValue: null,
             title: '申请换货',
             isTop: 0,
@@ -120,9 +122,11 @@ export default {
     },
     onLoad(data) {
         if (data) {
-            //console.log(data,'66666666')
+            console.log(data,'66666666')
             //decodeURIComponent (data) 
-            if (data.questionOrDiscribeValue && data.questionOrDiscribeValue !== "null") {
+            if(data.orderId)this.orderId=data.orderId
+            if(data.orderNo)this.orderNo=data.orderNo
+            if (data.questionOrDiscribeValue && data.questionOrDiscribeValue !== "null" && data.questionOrDiscribeValue !== "") {
                 this.questionOrDiscribeValue = data.questionOrDiscribeValue
             }
 
@@ -145,18 +149,27 @@ export default {
         //console.log("滚动距离为:" + e.scrollTop);
         this.isTop = e.scrollTop;
     },
-    onReady() {
-        // 页面加载完成后为表单设置规则
-        this.$refs.uForm.setRules(this.rules);
-    },
 
     methods: {
         //提交
         async goSubmit() {
-            if (this.receivedStatus || this.selectReasonValue || this.fileList.length === 0) {
-                uni.$u.toast('请选择申请原因\n或\n请上传描述/凭证')
-               
+            if (!this.selectReasonValue || !this.questionOrDiscribeValue || this.fileList.length === 0) {
+                uni.$u.toast('请选择申请原因\n或\n请上传描述/凭证')  
+                return
             }
+            //receivedStatus 1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
+            //tab 1 退款 2 换货
+            afterSaleOrder({ //换货
+                orderId:this.orderId,
+                orderNo:this.orderNo,
+                receiptStatus:2,//1:未收货 2:已收货
+                applyReason:this.selectReasonValue,
+                afterSaleType:2,//1:退货 2:换货
+                applyDesc:this.questionOrDiscribeValue,
+                applyImages:this.fileList.map(m=>m.url).join(','),
+            }).then(res=>{
+
+            })
 
 
         },
@@ -167,7 +180,7 @@ export default {
         //选择申请原因
         selectApplyReasonFun(tab) {
             uni.navigateTo({
-                url: `/points/productDetails/applyRefund?receivedStatus=3&tab=${tab}&selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}`
+                url: `/points/productDetails/applyRefund?receivedStatus=3&tab=${tab}&selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}&orderNo=${this.orderNo}&orderId=${this.orderId}`
             })
 
         },
@@ -270,6 +283,14 @@ export default {
         .u-form-item__body__right {
             flex: none;
         }
+        .questionOrDiscribeValue{
+            width: 400rpx;
+            white-space:nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            text-align: right;
+
+        }
 
         .title {
             font-weight: 400;

+ 62 - 20
src/points/productDetails/applyRefund.vue

@@ -82,11 +82,14 @@
 </template>
 
 <script>
+import { afterSaleOrder} from '@/api/pointOrder'
 import Upload from '@/components/upload/index.vue';
 export default {
     components: { Upload },
     data() {
         return {
+            orderNo:null,
+            orderId:null,
             fileList: [],
             tab: null,//1 退款/换货申请第一步  2 已收货-换货申请第二步
             headPhotoImg: [],
@@ -96,22 +99,27 @@ export default {
             receivedStatus: null,//1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
             isTop: 0,
             list: [],
+            servicePromise:[
+                "假一赔三",
+                "7天无理由退换",
+                "破损包退换"
+            ],
             //未收到,申请退款
             list1: [
                 {
                     title: '平台原因',
                     data: [
-                        { value: '1', text: '商家无货联系我取消订单' },
-                        { value: '2', text: '商家无法按承诺时效送达' },
-                        { value: '3', text: '商家其他原因联系我取消订单' },
+                        { value: '1', text: '商家无货联系我取消订单',show:true},
+                        { value: '2', text: '商家无法按承诺时效送达' ,show:true},
+                        { value: '3', text: '商家其他原因联系我取消订单' ,show:true},
                     ]
                 }, {
                     title: '个人原因',
                     data: [
-                        { value: '4', text: '不想要' },
-                        { value: '5', text: '商品错选 / 多选' },
-                        { value: '6', text: '地址信息填写错误' },
-                        { value: '7', text: '7天无理由退货' },
+                        { value: '4', text: '不想要' ,show:true},
+                        { value: '5', text: '商品错选 / 多选' ,show:true},
+                        { value: '6', text: '地址信息填写错误' ,show:true},
+                        { value: '7', text: '7天无理由退货' ,show:true},
                     ]
                 }
             ],
@@ -120,13 +128,13 @@ export default {
                 {
                     title: '',
                     data: [
-                        { value: '1', text: '买错/买多/不想要' },
-                        { value: '2', text: '买错/买多/不想要' },
-                        { value: '3', text: '商品与页面描述不符' },
-                        { value: '4', text: '商品与页面描述不符' },
-                        { value: '5', text: '发错货' },
-                        { value: '6', text: '少件/未收到货' },
-                        { value: '7', text: '7天无理由退货' },
+                        { value: '1', text: '买错/买多/不想要' ,show:true},
+                        { value: '2', text: '商品质量问题' ,show:true},
+                        { value: '3', text: '商品与页面描述不符' ,show:true},
+                        { value: '4', text: '商品/包装破损' ,show:true},
+                        { value: '5', text: '发错货' ,show:true},
+                        { value: '6', text: '少件/未收到货' ,show:true},
+                        { value: '7', text: '7天无理由退货' ,show:true},
                     ]
                 }
             ],
@@ -156,19 +164,21 @@ export default {
         }
     },
     onLoad(data) {
-        console.log(data, 'onLoad')
+        console.log(data, 'onLoad-applyRefund')
         if (data) {
             this.receivedStatus = data.receivedStatus
             this.tab = data.tab ? data.tab : null
+            if(data.orderId)this.orderId=data.orderId
+            if(data.orderNo)this.orderNo=data.orderNo
             if (data.questionOrDiscribeValue && data.questionOrDiscribeValue !== "null") {
                 this.questionOrDiscribeValue = data.questionOrDiscribeValue
             }
 
-            if (data.fileList && data.fileList!=="[]") {
+            if (data.fileList && data.fileList !== "[]") {
                 this.fileList = JSON.parse(data.fileList)
                 console.log(this.fileList, 'this.fileList')
             }
-            if (data.selectReasonValue && data.questionOrDiscribeValue !== "null") {
+            if (data.selectReasonValue && data.selectReasonValue !== "null") {
                 this.selectReasonValue = data.selectReasonValue
                 this.filteredList.map(m => {
                     m.data.forEach(e => {
@@ -184,8 +194,27 @@ export default {
 
     },
     onShow(data) {
-
-        console.log(data, 'onShow')
+        let flag=this.servicePromise.some(f=>{
+            return f.indexOf('7天无理由退')!==-1
+        })
+        if(!flag){
+            this.list2.map(m=>{
+                m.data.forEach(e=>{
+                    if(e.text.indexOf('7天无理由退')==-1){
+                       e.show=false
+                    }
+                    
+                })
+            })
+            this.list1.map(m=>{
+                m.data.forEach(e=>{
+                    if(e.text.indexOf('7天无理由退')==-1){
+                       e.show=false
+                    }
+                    
+                })
+            })
+        }
 
 
     },
@@ -218,10 +247,23 @@ export default {
         //提交
         goSubmit() {
             console.log('提交 applyRefund')
+            //receivedStatus 1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
+            //tab 1 退款 2 换货
+            afterSaleOrder({ // 未收到-申请退款,已收到货-申请退款
+                orderId:this.orderId,
+                orderNo:this.orderNo,
+                receiptStatus:this.receivedStatus,//1:未收货 2:已收货
+                applyReason:this.selectReasonValue,
+                afterSaleType:this.tab,//1:退货 2:换货
+                //applyDesc:'',
+                //applyImages:'',
+            }).then(res=>{
+
+            })
 
             if (this.receivedStatus == 3) {
                 uni.navigateTo({
-                    url: `/points/productDetails/applyExchange?selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}`
+                    url: `/points/productDetails/applyExchange?selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}&orderNo=${this.orderNo}&orderId=${this.orderId}`
                 });
 
             }

+ 23 - 11
src/points/productDetails/components/selectProduct.vue

@@ -3,9 +3,10 @@
         <image style="width: 35rpx;height: 35rpx;position: absolute;right: 40rpx;top:40rpx" @click="closeSelectProduct"
             src="@/static/points/closeIcon.png" mode=""></image>
         <view class="addressBox">
-            <uni-icons class="icon location icon-cuo" type="location" size="20" @tap=""></uni-icons>
-            <text class="name">张三</text>
-            <text class="address">山西省太原市小店区营盘街道某某小区</text>
+            <image style="width: 40rpx;height: 40rpx;" src="@/static/points/addressIcon.png" mode=""></image>
+
+            <text class="name" v-if="defaultAddress">{{ defaultAddress.userName }}</text>
+            <text class="address" v-if="defaultAddress">{{ defaultAddress.address + defaultAddress.atlasAdd }}</text>
             <image style="width: 28rpx;height: 28rpx;position: absolute;right: 0;" @click="addressSelectFun"
                 src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
 
@@ -69,7 +70,7 @@
 
         </view>
         <!--支付方式 -->
-        <u-radio-group class="nodeClass" v-model="selectPayMeth" @change="groupChange">
+        <u-radio-group v-if="selectPayMeth" class="nodeClass" v-model="selectPayMeth">
             <view style="width: 100%;">
                 <view style="display: flex;justify-content: space-between;width: 100%;">
                     <view style="display: flex;">
@@ -123,11 +124,16 @@ export default {
         params: {
             type: Object,
             default: {}
-        }
+        },
+        defaultAddress: {
+            type: Object,
+            default: {}
+        },
+        
     },
     data() {
         return {
-            orderRemarks:'',
+            orderRemarks: '',
             selectPayMeth: '1',
             reasonRefusal: '',
             showPopup: false,
@@ -160,7 +166,9 @@ export default {
 
     methods: {
         //
-        onShowFun(selectedObj) {
+        onShowFun(selectedObj, orderRemarks, selectPayMeth) {
+            if (orderRemarks) this.orderRemarks = orderRemarks
+            if (selectPayMeth) this.selectPayMeth = selectPayMeth
             if (selectedObj) {
                 this.selectedObj = JSON.parse(JSON.stringify(selectedObj))
             } else {
@@ -180,8 +188,8 @@ export default {
         },
         //立即兑换
         redeemNowFun() {
-             this.$emit('redeemNowFun', this.selectedObj ? JSON.parse(JSON.stringify(this.selectedObj)) : null)
-    
+            this.$emit('redeemNowFun', this.selectedObj ? JSON.parse(JSON.stringify(this.selectedObj)) : null, this.selectPayMeth, this.orderRemarks)
+
 
         },
         //点击选规则
@@ -213,12 +221,12 @@ export default {
         },
         //关闭选择商品页
         closeSelectProduct() {
-            this.$emit('closeSelectProduct', this.selectedObj ? JSON.parse(JSON.stringify(this.selectedObj)) : null)
+            this.$emit('closeSelectProduct', this.selectedObj ? JSON.parse(JSON.stringify(this.selectedObj)) : null, this.selectPayMeth, this.orderRemarks)
         },
         //去我的地址页面
         addressSelectFun() {
             uni.navigateTo({
-                url: '/points/productDetails/addressManagement'
+                url:`/pages/address/index?selectedAddressId=${this.defaultAddress.id}`
             });
         }
 
@@ -259,6 +267,10 @@ export default {
             text-align: left;
             font-style: normal;
             text-transform: none;
+            width: 460rpx;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
         }
     }
 

+ 258 - 92
src/points/productDetails/index.vue

@@ -4,7 +4,7 @@
       <!-- 导航栏  :leftIconColor="!isTop ? '#fff' : '#000'"-->
       <u-navbar :placeholder="true" autoBack>
         <view slot="center">
-          <view class="center" style="background-color: #fff;">商品详情</view>
+          <view class="center navbar-title" style="background-color: #fff;">商品详情</view>
         </view>
       </u-navbar>
       <!-- 主图 -->
@@ -43,30 +43,30 @@
         <!-- 第二行text -->
         <view class="seconedRow">
           <view class="specClass">
-            <view v-if="!selectedObj"
-              style="display: flex;align-items: center;justify-content:space-between;width: 100%;">
-              <view style="color: #666666;">选择</view>
-              <image style="width: 28rpx;height: 28rpx;" @click="selectProductShowFun"
-                src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
-            </view>
-            <view v-if="selectedObj"
-              style="display: flex;align-items: center;justify-content: space-between;width: 100%;">
+            <view style="display: flex;align-items: center;justify-content: space-between;width: 100%;">
               <view style="display: flex;align-items: center;">
                 <text style="color: #666666;">规格</text>
-                <ImageItem class="imgClass" :src="$globalData.publicUrl + selectedObj.image" />
+                <ImageItem v-if="selectedObj" class="imgClass" :src="$globalData.publicUrl + selectedObj.image" />
               </view>
-              <view style="display: flex;align-items: center;">
-                <text style="color: #666666;margin-right: 8rpx;">已选:{{ selectedObj.specValueText }}</text>
-                <image style="width: 28rpx;height: 28rpx;" @click="selectProductShowFun"
-                  src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
+              <view style="display: flex;align-items: center;position: relative;">
+                <text v-if="selectedObj" style="color: #666666;margin-right: 30rpx;">已选:{{
+                  selectedObj.specValueText }}</text>
+                <text v-else style="color: #999;margin-right: 30rpx;">选择商品</text>
+                <span style="position: absolute;right: 0;top: 1rpx;">
+                  <image style="width: 28rpx;height: 28rpx;" @click="selectProductShowFun"
+                    src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
+                </span>
               </view>
             </view>
 
           </view>
           <view class="arriveAddressClass">
             <text style="color: #666666;margin-right: 24rpx;">送至</text>
-            <text>山西省太原市万柏林区</text>
-            <span style="position: absolute;right: 0;">
+            <text v-if="defaultAddress"
+              style="width: 520rpx;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;">
+              {{ defaultAddress.address }}</text>
+            <text v-else style="color: #999;position: absolute;right: 30rpx;">添加收货地址</text>
+            <span style="position: absolute;right: 0;top: 1rpx;">
               <image style="width: 28rpx;height: 28rpx;" @click="addressSelectFun"
                 src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
             </span>
@@ -93,11 +93,11 @@
           <view class="title">
             兑换须知
             <span style="position: absolute;right: 24rpx;">
-              <image style="width: 28rpx;height: 28rpx;" @click="clichFun"
-                src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
+              <!-- <image style="width: 28rpx;height: 28rpx;" @click="clichFun"
+                src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image> -->
             </span>
           </view>
-          <view class="text">
+          <view class="text" style="-webkit-line-clamp: 8;">
             1、会员可凭上述积分兑换“广誉源会员定制玻璃杯”一个; <br>
             2、双层曲线杯身在隔热防烫的同时,让您的手掌体验一次美妙的抓握感; <br>
             3、积分兑换商品不支持质量问题外的退换货服务,请您先确认后签收;<br>
@@ -105,12 +105,12 @@
           </view>
         </view>
         <!-- 平台须知 -->
-        <view class="niticeClass">
+        <view class="niticeClass" style="margin-bottom: 30rpx;">
           <view class="title">平台说明
 
             <span style="position: absolute;right: 24rpx;">
-              <image style="width: 28rpx;height: 28rpx;" @click="clichFun"
-                src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
+              <!-- <image style="width: 28rpx;height: 28rpx;" @click="clichFun"
+                src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image> -->
             </span>
 
           </view>
@@ -134,9 +134,10 @@
       <u-popup :show="redemptionRulesShowPopup" mode="bottom" @close="redemptionRulesShowPopup = false" round="20">
         <RedemptionRules ref="redemptionRulesRef"></RedemptionRules>
       </u-popup>
-      <u-popup :show="selectProductShowPopup" mode="bottom" round="10">
-        <SelectProduct :params="params" ref="selectProductRef" @redeemNowFun="redeemNowFun"
-          @closeSelectProduct="closeSelectProduct"></SelectProduct>
+      <u-popup :z-index="999" :show="selectProductShowPopup" mode="bottom" round="10">
+        <SelectProduct :params="params" ref="selectProductRef" :defaultAddress="defaultAddress"
+          @redeemNowFun="redeemNowFun" @closeSelectProduct="closeSelectProduct">
+        </SelectProduct>
       </u-popup>
 
     </scroll-view>
@@ -151,7 +152,15 @@
 import ImageItem from "@/components/swiper/components/image.vue";
 import RedemptionRules from "./components/redemptionRules.vue";
 import SelectProduct from "./components/selectProduct.vue";
-import { productGetById, productOrderCreate } from '@/api/points'
+import { productGetById } from '@/api/points'
+import { productOrderCreate, productOrderPay } from '@/api/pointOrder'
+import { getAddrList, } from '@/api/address';
+import { getInfo, getSignature } from '@/api/index.js';
+//paymentType 商品的付款类型 付款类型(1:积分 2:金额 3:积分+金额)
+
+//订单状态(0:待付款 1:待发货 2:待收货 3:已收货 4:售后中  11:取消订单)
+
+//售后状态(0:待审核 1:退款完成 2:等待用户寄回  3:等待商家收货 4:等待商家寄出  5:订单完成 6:取消售后)
 
 export default {
   components: { ImageItem, RedemptionRules, SelectProduct },
@@ -167,19 +176,35 @@ export default {
         { name: '7天无理由退换', icon: '/static/points/Group2.png', isShow: false },
         { name: '破损包退换', icon: '/static/points/return7.png', isShow: false },
       ],
-      selectedObj: null
+      selectedObj: null,
+      defaultAddress: null,
+      selectPayMeth: null, //1 微信支付 2 余额
+      orderRemarks: null,
+      addressList: [],
+      dBalance: 0.00,
 
 
     }
   },
-  onLoad(id) {
-    if (id) {
-      this.productGetByIdFun(id)
+  onLoad(data) {
+    console.log(data, '66666')
+    if (data.id) {
+      this.productGetByIdFun(data.id)
+      this.getAddrListFun()
+      this.getinfo()
     }
 
   },
   onShow() {
-
+    //选择地址后传回的地址id
+    if (this.selectedAddressId) {
+      if (this.selectedAddressId !== this.defaultAddress.id) {
+        this.defaultAddress = this.addressList.find(item => {
+          if (item.id == this.selectedAddressId)
+            return item
+        });
+      }
+    }
   },
   onPageScroll(e) {
     //console.log("滚动距离为:" + e.scrollTop);
@@ -190,9 +215,36 @@ export default {
     handleContentScroll(e) {
       this.isTop = e.detail.scrollTop > 0
     },
+
+    //账户余额
+    getinfo() {
+      getInfo().then(res => {
+        if (res.data.code == 200) {
+          this.dBalance = res.data.data.dBalance.toFixed(2)
+        }
+      })
+    },
+    //查询默认地址
+    getAddrListFun() {
+      let params = {
+        current: 1,
+        size: 100,
+        openId: uni.getStorageSync('wx_copenid'),
+      }
+      getAddrList(params).then(res => {
+        if (res.data.code === 200) {
+          this.addressList = res.data.data
+          this.defaultAddress = res.data.data.find(item => {
+            if (item.type == 1)
+              return item
+          });
+        }
+      });
+    },
+
     //查询商品详情
     productGetByIdFun(id) {
-      productGetById({ id: 19 }).then(res => {
+      productGetById({ id: id }).then(res => {
         if (res.data.code === 200) {
           this.params = Object.assign({}, res.data.data)
           //this.selectedObj = this.params.specComboVOList[0]
@@ -215,95 +267,197 @@ export default {
       this.redemptionRulesShowPopup = true
     },
     //立即兑换
-    redeemNowFun(selectedObj) {
+    redeemNowFun(selectedObj, selectPayMeth, orderRemarks) {
       if (selectedObj) this.selectedObj = selectedObj
+      if (selectPayMeth) this.selectPayMeth = selectPayMeth
+      if (orderRemarks) this.orderRemarks = orderRemarks
+
+      // if (this.remainingTime == 0) {
+      // 	uni.showToast({
+      // 		title: '订单已过期',
+      // 		icon: 'none'
+      // 	})
+      // 	return;
+      // 
+      // uni.navigateTo({
+      //   url: '/points/productDetails/pendingPayment'
+      // });
+
       if (this.selectedObj) {
+        if (this.selectPayMeth == null) {
+          uni.showToast({
+            title: '请选择支付方式',
+            icon: 'none'
+          })
+          return
+        }
         let params = {}
-        ////用户openId
-        params.openId = uni.getStorageSync('wx_copenid');
-        //地址ID
-        params.addressId = '11';
+        params.openId = uni.getStorageSync('wx_copenid');//用户openId
+        params.userPhone = this.defaultAddress.phone;//用户手机号
+        params.userName = this.defaultAddress.userName;//用户名
+        params.userAddress = this.defaultAddress.address + this.defaultAddress.atlasAdd;//地图地址+详细地址
+        params.addressId = this.defaultAddress.id;//地址ID
         params.productId = this.params.id;
         params.name = this.params.name;
         params.productMainImage = this.params.productMainImage;
-        //选中的SKU ID
-        params.skuId = this.selectedObj.index;
-        // SKU列表(规格组合明细)
-        params.specNameValueLis = this.selectedObj.specNameValueList;
-        ////购买数量
-        params.quantity = 1;
-        ////支付方式:1微信支付 2账户余额
-        params.payType = Number(this.$refs.selectProductRef.selectPayMeth);
-        //运费
-        params.freightAmount = this.params.freight;
-        // 总金额
-        params.totalAmount = this.selectedObj.originPrice;
-        // 支付金额
-        params.payAmount = this.selectedObj.priceMoney;
-        // 使用的积分
-        params.pointsUsed = this.selectedObj.pricePoint;
-        //买家备注信息
-        params.buyerRemark = this.$refs.selectProductRef.orderRemarks;
-        uni.navigateTo({
-          url: '/points/productDetails/paymentSuccessful'
-        });
+        params.skuId = this.selectedObj.skuId; //选中的SKU ID
+        params.specNameValueLis = this.selectedObj.specNameValueList; // SKU列表(规格组合明细)
+        params.quantity = 1; //购买数量
+        params.payType = Number(this.selectPayMeth);//支付方式:1微信支付 2账户余额
+        params.freightAmount = this.params.freight; //运费
+        params.totalAmount = (this.selectedObj.priceMoney + (this.params.freight > 0 ? this.params.freight : 0));// 支付金额+运费=总金额
+        params.payAmount = this.selectedObj.priceMoney;// 支付金额
+        params.pointsUsed = this.selectedObj.pricePoint;// 使用的积分
+        params.buyerRemark = this.orderRemarks;//买家备注信息
         console.log(params, 'params')
-        return
-        
-        
-        productOrderCreate(params).then(res => {
-          
-          uni.requestPayment({
-            "provider": "wxpay",
-            "orderInfo": {},
-            success(res) { },
-            fail(e) { }
-          })
-          // uni.navigateTo({
-          //   url: '/points/productDetails/paymentSuccessful'
-          // });
-        })
+        console.log(this.params, 'this.params')
+
+        if (this.selectPayMeth == 1) {
+          //微信支付 
+          this.weixinPay(params)
+        } else if (this.selectPayMeth == 2) {
+          //余额支付
+          this.nowYuyue(params)
+        }
 
       } else {
         this.selectProductShowPopup = true
         this.$nextTick(() => {
-          this.$refs.selectProductRef.onShowFun(this.selectedObj)
+          this.$refs.selectProductRef.onShowFun(this.selectedObj, this.orderRemarks, this.selectPayMeth)
         });
       }
 
     },
+    //微信支付
+    weixinPay(params) {
+      productOrderCreate(params).then(res => {
+        if (res.data.code == 200) {
+          productOrderPay({
+            orderNo: res.data.data, //订单编号
+            payType: params.payType, //支付方式:1微信支付 2:余额支付
+            totalPrice: params.totalAmount //订单总金额,单位:元
+          }).then(res => {
+            console.log(res,'8888888')
+            return
+            this.wxconfig = res.data
+            wx.config({
+              beta: true,
+              debug: false,
+              appId: this.wxconfig.appId, // 公众号ID 
+              // appId: uni.getAppBaseInfo().host.appId, // 公众号ID 
+              timestamp: this.wxconfig.timestamp, // 时间戳,自1970年以来的秒数
+              nonceStr: this.wxconfig.nonceStr, // 随机串
+              signature: this.wxconfig.sign, // 微信签名方式
+              jsApiList: ['getBrandWCPayRequest']
+            });
+            var vm = this
+            wx.invoke('getBrandWCPayRequest',
+              // 下面参数内容都是后台返回的
+              {
+                'appId': payConfig.appid, // 公众号名称,由商户传入
+                'timeStamp': payConfig.timeStamp, // 时间戳
+                'nonceStr': payConfig.nonceStr, // 随机串
+                'package': payConfig.package, // 预支付id
+                'signType': payConfig.signType, // 微信签名方式
+                'paySign': payConfig.paySign, // 微信签名
+              },
+              function (res) {
+                // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
+
+                // JSON.stringify(res);
+                if (res.err_msg == "get_brand_wcpay_request:ok") {
+                  uni.navigateTo({
+                    url: '/points/productDetails/paymentSuccessful'
+                  });
+                } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
+                  uni.showToast({
+                    title: '已取消支付',
+                    icon: 'none'
+                  })
+                  uni.navigateTo({
+                    url: '/points/productDetails/pendingPayment'
+                  });
+
+
+                } else {
+                  alert('付款失败');
+                }
+              }
+            )
+          })
+        }
+      })
+      return
+      let url = 'https://test.baoxianzhanggui.com/fragrance/'
+      payoff(params).then(res => {
+        let payConfig = JSON.parse(res.data.data)
+        getSignature(url).then(res => {
+
+
+        })
+      })
+    },
+    //账号余额支付
+    nowYuyue(params) {
+      if (parseInt(this.dBalance) < parseInt(this.selectedObj.priceMoney)) {
+        uni.showModal({
+          title: '账户余额不足',
+          content: '请充值',
+          success: function (res) {
+            if (res.confirm) {
+              uni.navigateTo({
+                url: '../../pages/my/pay?name=充值'
+              })
+            } else if (res.cancel) { }
+          }
+        });
+      } else {
+        productOrderCreate(params).then(res => {
+          if (res.data.code == 200) {
+            productOrderPay({
+              orderNo: res.data.data, //订单编号
+              payType: params.payType, //支付方式:1微信支付 2:余额支付
+              totalPrice: params.totalAmount //订单总金额,单位:元
+            }).then(res => {
+              if (res.data.code == 200) {
+                uni.navigateTo({
+                  url: '/points/productDetails/paymentSuccessful'
+                });
+              } else {
+                uni.showToast({
+                  icon: 'error',
+                  title: res.data.msg,
+                })
+              }
+
+            })
+          }
+
+        })
+
+      }
+    },
     //打开选择商品页
     selectProductShowFun() {
       this.selectProductShowPopup = true
       this.$nextTick(() => {
-        this.$refs.selectProductRef.onShowFun(this.selectedObj)
+        this.$refs.selectProductRef.onShowFun(this.selectedObj, this.orderRemarks, this.selectPayMeth)
       });
     },
     //关闭选择商品页
-    closeSelectProduct(selectedObj) {
-      if (selectedObj) {
-        this.selectedObj = selectedObj
-      }
+    closeSelectProduct(selectedObj, selectPayMeth, orderRemarks) {
+      if (selectedObj) this.selectedObj = selectedObj
+      if (selectPayMeth) this.selectPayMeth = selectPayMeth
+      if (orderRemarks) this.orderRemarks = orderRemarks
       this.selectProductShowPopup = false
     },
-    //去我的地址页面
+    //去我的地址页面 /points/productDetails/addressManagement
     addressSelectFun() {
       uni.navigateTo({
-        url: '/points/productDetails/addressManagement'
+        url: `/pages/address/index?selectedAddressId=${this.defaultAddress.id}`
       });
     },
 
-    //导航栏返回按钮
-    leftClick() {
-      uni.navigateTo({
-        url: `pages/member/center`
-      })
-      // /let str = uni.$u.queryParams(params);
-      // uni.navigateTo({
-      // 	url: `/packageA/pages/shop/coupon/couponDetail${str}`
-      // });
-    },
-
   }
 }
 </script>
@@ -314,6 +468,15 @@ export default {
   height: 456rpx;
 }
 
+::v-deep .u-popup {
+
+  .u-transition,
+  .u-fade-enter-to,
+  .u-fade-enter-active {
+    z-index: 999 !important;
+  }
+}
+
 .footer-bar {
   .u-button {
     height: 84rpx;
@@ -333,6 +496,8 @@ export default {
   background-color: #F5F8F8;
   padding: 24rpx 32rpx 0 32rpx;
   font-family: PingFang SC, PingFang SC;
+  margin-bottom: 150rpx;
+  border: 1px solid rgb(255, 255, 255);
 
   .firstRow {
     background-color: #fff;
@@ -437,6 +602,7 @@ export default {
     .arriveAddressClass {
       margin-top: 32rpx;
       position: relative;
+      display: flex;
     }
 
     .addressTextClass {

+ 293 - 68
src/points/productDetails/pendingPayment.vue

@@ -10,18 +10,18 @@
             <view class="contentBox">
                 <view class="remainingTime">
                     {{ orderStatus }}
+                    <text v-if="orderInfo.orderStatus == 0 && countdownText != '00:00'">{{ countdownText }}</text>
                 </view>
-                <view class="content">
+                <view class="content" v-if="orderInfo">
                     <view class="addressBox">
-                        <image style="width: 45rpx;height: 40rpx;" @click="addressSelectFun"
-                            src="@/static/points/addressIcon.png" mode=""></image>
+                        <image style="width: 40rpx;height: 40rpx;" src="@/static/points/addressIcon.png" mode="">
+                        </image>
                         <view style="margin-left: 16rpx;">
                             <view class="name">
-                                张三 <text>
-                                    15032624563</text>
+                                {{ orderInfo.receiverName }} <text>{{ orderInfo.receiverPhone }}</text>
                             </view>
                             <view class="address">
-                                山西省太原市小店区营盘街道某某小区1号楼1单元101
+                                {{ orderInfo.addressName }}
                             </view>
                         </view>
 
@@ -33,52 +33,76 @@
                     <view class="productPrice">
                         <view style="display:flex;">
                             <view>
-                                <image style="width: 120rpx;height: 120rpx;" src="@/static/points/closeIcon.png"
-                                    mode="">
+                                <image style="width: 120rpx;height: 120rpx;"
+                                    :src="$globalData.publicUrl + orderInfo.skuImage" mode="">
                                 </image>
                             </view>
                             <view
                                 style="margin-left: 24rpx;display: flex;flex-direction: column;justify-content: space-between;">
-                                <view class="productName">广誉源会员定制玻璃杯 </view>
-                                <view class="spec">已选:大号,白色 </view>
-                                <view class="price">实付价 ¥10元+1000积分 </view>
+                                <view class="productName">{{ orderInfo.productName }} </view>
+                                <view class="spec">已选:{{ skuSpecFun(orderInfo.skuSpec) }} </view>
+                                <view class="price">{{ orderInfo.paymentType == 1 ? orderInfo.pointsUsed + '积分' :
+                                    orderInfo.paymentType == 2 ? '¥' + orderInfo.payAmount + '元' :
+                                        orderInfo.paymentType == 3 ? '¥' + orderInfo.payAmount + '元' + '+' +
+                                            orderInfo.pointsUsed + '积分' : null }}</view>
 
                             </view>
                         </view>
                         <view class="productPrice1">
                             <view class="text">商品金额</view>
-                            <view class="price">¥10 +1000积分</view>
+                            <view class="price">{{ orderInfo.paymentType == 1 ? orderInfo.pointsUsed + '积分' :
+                                orderInfo.paymentType == 2 ? '¥' + orderInfo.payAmount + '元' :
+                                    orderInfo.paymentType == 3 ? '¥' + orderInfo.payAmount + '元' + '+' +
+                                        orderInfo.pointsUsed + '积分' : null }}</view>
                         </view>
                         <view class="shippingFee">
                             <view class="text">运费</view>
-                            <view class="text">¥0</view>
+                            <view class="text">¥{{ orderInfo.freightAmount }}</view>
                         </view>
                         <view style="height: 2rpx;background-color: #f0f0f0;margin-top: 20rpx;"> </view>
                         <view class="total">
                             <text class="text">合计:</text>
-                            <text class="price">¥ 10</text>
+                            <text class="price">¥ {{
+                                (orderInfo.payAmount + (orderInfo.freightAmount > 0 ? orderInfo.freightAmount : 0))
+                                }}</text>
                         </view>
                     </view>
                     <view class="weiChect">
-                        <view class="text">微信支付</view>
-                        <view class="text">微信支付</view>
+                        <view style="display: flex;">
+                            <image v-if="orderInfo.payType == '1'" style="width: 40rpx;height: 40rpx;"
+                                src="@/static/points/weiXin.png" mode="">
+                            </image>
+                            <image v-if="orderInfo.payType == '2'" style="width: 40rpx;height: 40rpx;"
+                                src="@/static/points/yue.png" mode="">
+                            </image>
+                            <view class="text" style="color: #333;margin-left: 16rpx;">{{ orderInfo.payType == '1' ?
+                                '微信支付' :
+                                '余额支付' }}
+                            </view>
+
+                        </view>
+                        <view>
+                            <u-radio-group v-model="orderInfo.payType">
+                                <u-radio activeColor="#03C1B8 " :name=orderInfo.payType style="margin: 0;"></u-radio>
+                            </u-radio-group>
+                        </view>
                     </view>
                     <view class="orderInfo">
                         <view class="item">
                             <view class="text">订单编号</view>
-                            <view class="text1">246453782748937746</view>
+                            <view class="text1">{{ orderInfo.orderNo }}</view>
                         </view>
                         <view class="item">
                             <view class="text">下单时间</view>
-                            <view class="text1">2025-09-14 17:21:55</view>
+                            <view class="text1">{{ orderInfo.createTime }}</view>
                         </view>
                         <view class="item">
                             <view class="text">支付方式</view>
-                            <view class="text1">现金</view>
+                            <view class="text1">{{ orderInfo.payType == 1 ? '微信' : '余额' }}</view>
                         </view>
                         <view class="item">
                             <view class="text">订单备注</view>
-                            <view class="text1">无</view>
+                            <view class="text1">{{ orderInfo.buyerRemark ? orderInfo.buyerRemark : '' }}</view>
                         </view>
 
                     </view>
@@ -89,18 +113,19 @@
             <view class="buttonClass">
                 <u-button v-if="title == '待支付'" :customStyle="{
                     color: '#999',
-                    background: ''
+                    background: '',
+                    border: '2rpx solid rgba(153, 153, 153, 1)'
                 }" @click="cancelOrderFun">取消支付</u-button>
 
                 <u-button v-if="title == '待支付'" :customStyle="{
                     color: '#fff ',
                     background: '#03C1B8'
-                }" @click="checkOrder">去付款</u-button>
+                }" @click="goPay">去付款</u-button>
 
                 <u-button v-if="title == '订单取消'" :customStyle="{
                     color: '#fff ',
                     background: '#03C1B8'
-                }" @click="checkOrder">再次购买</u-button>
+                }" @click="buyAgain">再次购买</u-button>
             </view>
 
         </scroll-view>
@@ -108,14 +133,10 @@
 
         <!-- 取消订单 <u-line></u-line>-->
         <u-popup :show="cancelOrderShowPopup" mode="bottom" round="10">
-            <view class="content">
-
-            </view>
-
             <view class="popup-con">
                 <!-- 标题 -->
                 <view class="popup-text">
-                    <text>取消订单</text>
+                    <text class="title">取消订单</text>
                     <text @click="cancelOrderShowPopup = false">取消</text>
                 </view>
                 <!-- 项目列表 -->
@@ -124,20 +145,8 @@
                     <u-radio-group v-model="selectReason" @change="groupChange">
 
                         <view style="padding: 0 20rpx 24rpx 20rpx;">
-                            <view class="radioBox">
-                                <u-radio activeColor="#03C1B8 " name='1'></u-radio>买错了/不想要
-                            </view>
-                            <view class="radioBox">
-                                <u-radio activeColor="#03C1B8 " name='2'></u-radio> 商品无货
-                            </view>
-                            <view class="radioBox">
-                                <u-radio activeColor="#03C1B8 " name='3'></u-radio> 商品信息填写错误
-                            </view>
-                            <view class="radioBox">
-                                <u-radio activeColor="#03C1B8 " name='4'></u-radio> 地址信息填写错误
-                            </view>
-                            <view class="radioBox">
-                                <u-radio activeColor="#03C1B8 " name='5'></u-radio> 其他原因
+                            <view class="radioBox" v-for="item in selectReasonList">
+                                <u-radio activeColor="#03C1B8 " :name=item.value></u-radio>{{ item.text }}
                             </view>
                         </view>
                     </u-radio-group>
@@ -145,9 +154,10 @@
                 </view>
                 <view class="popupButtonClass">
                     <u-button :customStyle="{
-                        color: '#999',
-                        background: '#eee'
-                    }" @click="cancelOrderSubmit">提交</u-button>
+                        color: selectReason ? '#fff' : '#999',
+                        background: selectReason ? '#03C1B8' : '#eee'
+                    }" @click="cancelOrderSubmit">{{ selectReason ? '提交' : '请先选择原因' }}</u-button>
+
                 </view>
             </view>
 
@@ -157,55 +167,260 @@
 
     </view>
 
+</template>
 
+<script>
 
+import { getPointOrderInfo,productOrderCancel, productOrderPay} from '@/api/pointOrder'
+import { getInfo, } from '@/api/index.js';
 
+//paymentType 商品的付款类型 付款类型(1:积分 2:金额 3:积分+金额)
 
-</template>
+//订单状态(0:待付款 1:待发货 2:待收货 3:已收货 4:售后中  11:取消订单)
 
-<script>
+//售后状态(0:待审核 1:退款完成 2:等待用户寄回  3:等待商家收货 4:等待商家寄出  5:订单完成 6:取消售后)
 
 export default {
     components: {},
     data() {
         return {
-            selectReason:'',
-            title: '待支付',
+            selectReason: '',
+            selectReasonValue: '',
+            title: '',
             cancelOrderShowPopup: false,
-            orderStatus: '剩余时间 14:59', //超时未支付
-
-
-
+            countdownText: '',
+            orderStatus: '', //超时未支付
+            selectReasonList: [
+                { value: '1', text: '买错了/不想要' },
+                { value: '2', text: '商品无货' },
+                { value: '3', text: '商品信息填写错误' },
+                { value: '4', text: '地址信息填写错误' },
+                { value: '5', text: '其他原因' },
+            ],
+            dBalance: 0.00,
+            timer: null, // 定时器
+            orderNo: '',
+            orderInfo: null
         }
     },
     onLoad(data) {
-
+        if (data.orderNo) {
+            this.orderNo = data.orderNo
+            this.getOrderInfo();
+        }
     },
     onShow() {
 
     },
     onPageScroll() {
+    },
+    async mounted() {
+
     },
 
     methods: {
+        //规则组装
+        skuSpecFun(skuSpec) {
+            if (!skuSpec) return ''
+            return JSON.parse(skuSpec).map(e => e.specValue).join(',')
+
+        },
+        //获取订单详情
+        async getOrderInfo() {
+            const res = await getPointOrderInfo({
+                orderNo: this.orderNo,
+                openId: uni.getStorageSync('wx_copenid')
+            })
+            this.orderInfo = res.data.data
+            if (this.orderInfo.remainSeconds > 0 && this.orderInfo.orderStatus == 0) {
+                this.orderCountdownFun(this.orderInfo.remainSeconds)
+                this.orderStatus = '剩余时间'
+                this.title = '待支付'
+            } else if (this.orderInfo.remainSeconds < 0 && this.orderInfo.orderStatus == 0) {
+                this.orderStatus = '超时未支付'
+                this.title = '订单取消'
+            } else if (this.orderInfo.orderStatus == 11) {
+                this.orderStatus = '您已取消支付'
+                this.title = '订单取消'
+            }
+
+        },
+        //订单倒计时
+        orderCountdownFun(remain) {
+            this.timer = setInterval(() => {
+                remain--;
+                this.countdownText = this.formatTime(remain);
+                if (remain <= 0) {
+                    clearInterval(this.timer);
+                    this.orderStatus = '超时未支付'
+                    this.title = '订单取消'
+                    this.cancelOrderShowPopup = false
+                }
+            }, 1000);
+        },
+        // 时间格式化:秒 → mm:ss(00:00)
+        formatTime(seconds) {
+            if (seconds <= 0) return '00:00';
+            const m = Math.floor(seconds / 60).toString().padStart(2, '0');
+            const s = (seconds % 60).toString().padStart(2, '0');
+            return `${m}:${s}`;
+        },
+
+        //去付款
+        goPay() {
+            if (this.orderInfo.payType == 1) {
+                //微信支付 
+                this.weixinPay(params)
+            } else if (this.orderInfo.payType == 2) {
+                //余额支付
+                this.nowYuyue(params)
+            }
+
+        },
+        //微信支付
+        weixinPay() {
+            productOrderPay({
+                orderNo: this.orderInfo.orderNo, //订单编号
+                payType: this.orderInfo.payType, //支付方式:1微信支付 2:余额支付
+                totalPrice: this.orderInfo.totalAmount //订单总金额,单位:元
+            }).then(res => {
+                console.log(res, '8888888')
+                return
+                this.wxconfig = res.data
+                wx.config({
+                    beta: true,
+                    debug: false,
+                    appId: this.wxconfig.appId, // 公众号ID 
+                    // appId: uni.getAppBaseInfo().host.appId, // 公众号ID 
+                    timestamp: this.wxconfig.timestamp, // 时间戳,自1970年以来的秒数
+                    nonceStr: this.wxconfig.nonceStr, // 随机串
+                    signature: this.wxconfig.sign, // 微信签名方式
+                    jsApiList: ['getBrandWCPayRequest']
+                });
+                var vm = this
+                wx.invoke('getBrandWCPayRequest',
+                    // 下面参数内容都是后台返回的
+                    {
+                        'appId': payConfig.appid, // 公众号名称,由商户传入
+                        'timeStamp': payConfig.timeStamp, // 时间戳
+                        'nonceStr': payConfig.nonceStr, // 随机串
+                        'package': payConfig.package, // 预支付id
+                        'signType': payConfig.signType, // 微信签名方式
+                        'paySign': payConfig.paySign, // 微信签名
+                    },
+                    function (res) {
+                        // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
+
+                        // JSON.stringify(res);
+                        if (res.err_msg == "get_brand_wcpay_request:ok") {
+                            uni.navigateTo({
+                                url: '/points/productDetails/paymentSuccessful'
+                            });
+                        } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
+                            uni.showToast({
+                                title: '已取消支付',
+                                icon: 'none'
+                            })
+                            uni.navigateTo({
+                                url: '/points/productDetails/pendingPayment'
+                            });
+
+
+                        } else {
+                            alert('付款失败');
+                        }
+                    }
+                )
+            })
+        },
+        //账号余额支付
+        nowYuyue(params) {
+            if (parseInt(this.dBalance) < parseInt(10)) {
+                uni.showModal({
+                    title: '账户余额不足',
+                    content: '请充值',
+                    success: function (res) {
+                        if (res.confirm) {
+                            uni.navigateTo({
+                                url: 'pages/my/pay?name=充值'
+                            })
+                        } else if (res.cancel) { }
+                    }
+                });
+            } else {
+                productOrderPay({
+                    orderNo: this.orderInfo.orderNo, //订单编号
+                    payType: this.orderInfo.payType, //支付方式:1微信支付 2:余额支付
+                    totalPrice: this.orderInfo.totalAmount //订单总金额,单位:元
+                }).then(res => {
+                    console.log(res, '8888888')
+                    if (res.data.code == 200) {
+                        uni.navigateTo({
+                            url: '/points/productDetails/paymentSuccessful'
+                        });
+                    } else {
+                        uni.showToast({
+                            icon: 'error',
+                            title: res.data.msg,
+                        })
+                    }
+
+                })
+            }
+        },
+        //查询账户余额
+        getinfo() {
+            getInfo().then(res => {
+                if (res.data.code == 200) {
+                    this.dBalance = res.data.data.dBalance.toFixed(2)
+                }
+            })
+        },
         //取消订单提交按钮
         cancelOrderSubmit() {
-            this.cancelOrderShowPopup = false
-            this.title = '订单取消'
-            this.orderStatus = '您已取消支付'
+            let params = {
+                openId: uni.getStorageSync('wx_copenid'),
+                orderNo: this.orderNo,
+                cancelReason: this.selectReasonValue,
+            }
+            productOrderCancel(params).then(res => {
+                if (res.data.code == 200) {
+                    clearInterval(this.timer);
+                    this.cancelOrderShowPopup = false
+                    this.title = '订单取消'
+                    this.orderStatus = '您已取消支付'
+                } else {
+                    //alert(res.data.msg)
+                    uni.showToast({
+                        title: res.data.msg,
+                        icon: 'none'
+                    })
+                }
+
+            })
+        },
+        //点击单选按钮
+        groupChange(val) {
+            this.selectReason = val
+            this.selectReasonList.forEach(item => {
+                if (item.value == val) {
+                    this.selectReasonValue = item.text
+                }
+
+            });
         },
         //关闭取消订单选择页
         closeCancelOrderFun() {
             this.cancelOrderShowPopup = false
         },
-        //取消订单
+        //取消订单按钮
         cancelOrderFun() {
             this.cancelOrderShowPopup = true
         },
-        //去我的地址页面
-        addressSelectFun() {
+        //再次购买
+        buyAgain() {
             uni.navigateTo({
-                url: '/points/productDetails/addressManagement'
+                url: `/points/productDetails/index?id=${this.orderInfo.id}`
             });
         }
 
@@ -231,6 +446,7 @@ export default {
     align-items: center;
     justify-content: flex-end;
     font-family: PingFang SC, PingFang SC;
+    margin-top: 20rpx;
 
     button {
         width: 168rpx;
@@ -239,7 +455,7 @@ export default {
         height: 56rpx;
         line-height: 40rpx;
         border-radius: 98rpx 98rpx 98rpx 98rpx;
-        border: 2rpx solid #03C1B8;
+
         font-size: 26rpx;
         padding: 0 0 10rpx 0;
         margin: 0 32rpx 0 0;
@@ -267,7 +483,7 @@ export default {
 }
 
 .content {
-    padding: 24rpx 32rpx 0 32rpx;
+    padding: 24rpx 32rpx 30rpx 32rpx;
     font-family: PingFang SC, PingFang SC;
     border-radius: 20rpx 20rpx 0 0;
 
@@ -276,7 +492,6 @@ export default {
         padding: 24rpx 32rpx;
         display: flex;
         align-items: flex-start;
-        height: 176rpx;
         background: #FFFFFF;
         border-radius: 20rpx 20rpx 20rpx 20rpx;
 
@@ -436,8 +651,7 @@ export default {
         height: 268rpx;
         background: #FFFFFF;
         border-radius: 16rpx 16rpx 16rpx 16rpx;
-        padding: 26rpx 24rpx 2rpx 24rpx;
-        margin-bottom: 30rpx;
+        padding: 26rpx 24rpx 0 24rpx;
 
         .item {
             display: flex;
@@ -474,7 +688,8 @@ export default {
     font-size: 27rpx;
     color: #666666;
     background: #F5F8F8;
-    padding: 15rpx 40rpx 40rpx 40rpx;
+    padding: 40rpx;
+    border-radius: 20rpx 20rpx 0 0;
 
     .popup-text {
         font-weight: bold;
@@ -487,6 +702,15 @@ export default {
         justify-content: space-between;
         position: relative;
 
+        .title {
+            padding-bottom: 10rpx;
+            background-image: url("@/static/points/cancelOrderBg.png");
+            background-size: 100%;
+            background-repeat: no-repeat;
+            background-position: center bottom;
+            /* 水平居中、垂直靠下 */
+        }
+
         text:last-of-type {
             font-weight: 400;
             font-size: 28rpx;
@@ -548,7 +772,8 @@ export default {
         button {
             align-items: center;
             border-radius: 98rpx 98rpx 98rpx 98rpx;
-            font-size: 26rpx;
+            font-size: 32rpx;
+            font-weight: 500;
         }
     }
 }