Procházet zdrojové kódy

页面参数修改 去掉自定义导航

MS-IOHQJGHXZHQD\Administrator před 4 měsíci
rodič
revize
7be4ba8d16

+ 36 - 24
src/pages.json

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

+ 6 - 31
src/points/productDetails/applyExchange.vue

@@ -3,11 +3,11 @@
     <view>
         <scroll-view :scroll-y="true" @scroll="handleContentScroll">
             <!-- 导航栏  :leftIconColor="!isTop ? '#fff' : '#000'"-->
-            <u-navbar :placeholder="true" autoBack @click="autoBackFun">
+            <!-- <u-navbar :placeholder="true" autoBack @click="autoBackFun">
                 <view slot="center">
                     <view class="centerTitle" style="background-color: #fff;">{{ title }}</view>
                 </view>
-            </u-navbar>
+            </u-navbar> -->
 
             <view class="content">
                 <view class="productPrice">
@@ -85,37 +85,13 @@ export default {
         return {
             orderNo:null,
             orderId:null,
+            orderStatus:null,
             fileList: [],
             questionOrDiscribeValue: null,
             selectReasonValue: null,
-            title: '申请换货',
             isTop: 0,
             redemptionRulesShowPopup: false,
             selectProductShowPopup: false,
-            list: [
-                {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                    defaultAddress: '默认',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                },
-            ]
 
 
         }
@@ -126,6 +102,7 @@ export default {
             //decodeURIComponent (data) 
             if(data.orderId)this.orderId=data.orderId
             if(data.orderNo)this.orderNo=data.orderNo
+            if(data.orderStatus)this.orderStatus=data.orderStatus 
             if (data.questionOrDiscribeValue && data.questionOrDiscribeValue !== "null" && data.questionOrDiscribeValue !== "") {
                 this.questionOrDiscribeValue = data.questionOrDiscribeValue
             }
@@ -175,12 +152,10 @@ export default {
         handleContentScroll(e) {
             this.isTop = e.detail.scrollTop > 0
         },
-        //选择申请原因
+        //选择申请原因--换货
         selectApplyReasonFun(tab) {
-            //receivedStatus 1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
-            //tab 1 退款 2 换货
             uni.navigateTo({
-                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}`
+                url: `/points/productDetails/applyRefund?tab=${tab}&selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}&orderNo=${this.orderNo}&orderId=${this.orderId}&orderStatus=${this.orderStatus}`
             })
 
         },

+ 66 - 27
src/points/productDetails/applyRefund.vue

@@ -4,16 +4,16 @@
     <view>
         <scroll-view :scroll-y="true" @scroll="handleContentScroll">
             <!-- 导航栏  :leftIconColor="!isTop ? '#fff' : '#000'"-->
-            <u-navbar :placeholder="true" autoBack @click="autoBackFun">
+            <!-- <u-navbar :placeholder="true" autoBack @click="autoBackFun">
                 <view slot="center">
                     <view class="centerTitle" style="background-color: #fff;">
                         {{ receivedStatus == '1' || receivedStatus == '2' ? '申请退款' : '申请换货' }}</view>
                 </view>
-            </u-navbar>
+            </u-navbar> -->
 
             <view class="content">
-                <view v-if="tab == '1'">
-                    <view class="contentDetail">
+                <view>
+                    <view class="contentDetail" v-if="orderStatus && tab==1">
                         <view class="tip">请选择取消订单的原因(必选):</view>
                         <u-radio-group v-model="selectReason" @change="groupChange">
                             <view>
@@ -29,7 +29,7 @@
                             </view>
                         </u-radio-group>
                     </view>
-                    <view class="tip2" v-if="receivedStatus == '1'">
+                    <view class="tip2" v-if="orderStatus == 1">
                         <view class="title">温馨提示:</view>
                         <view class="textClass">
                             1.订单一旦取消,无法恢复<br>
@@ -38,7 +38,7 @@
                         </view>
                     </view>
                 </view>
-                <view v-if="tab == '2'">
+                <view v-if="orderStatus == 3 && tab==2">
                     <view class="Box">
                         <view class="questionOrDiscribe">
                             <view>问题与描述:</view>
@@ -72,7 +72,7 @@
                 <u-button :customStyle="{
                     color: '#fff',
                     background: '#03C1B8'
-                }" @click="goSubmit">{{ receivedStatus == 3 ? '确认' : '提交' }}</u-button>
+                }" @click="goSubmit">{{ orderStatus == 3 ? '确认' : '提交' }}</u-button>
 
             </view>
 
@@ -82,21 +82,21 @@
 </template>
 
 <script>
-import { afterSaleOrder } from '@/api/pointOrder'
+import { afterSaleOrder, productOrderCancel } from '@/api/pointOrder'
 import Upload from '@/components/upload/index.vue';
 export default {
     components: { Upload },
     data() {
         return {
+            tab: '1',//1 申请换货-申请原因选择  2申请换货-描述、凭证
             orderNo: null,
             orderId: null,
+            orderStatus: null,
             fileList: [],
-            tab: null,//1 退款/换货申请第一步  2 已收货-换货申请第二步
             headPhotoImg: [],
             questionOrDiscribeValue: '',
             selectReason: '',
             selectReasonValue: null,
-            receivedStatus: null,//1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
             isTop: 0,
             list: [],
             servicePromise: [
@@ -158,18 +158,30 @@ export default {
     },
     computed: {
         filteredList() {
-            if (this.receivedStatus === '1') return this.list1;
-            if (this.receivedStatus === '2') return this.list2;
+            if (this.orderStatus == 1) return this.list1;
+            if (this.orderStatus == 2) return this.list2;
             return this.list3;
         }
     },
     onLoad(data) {
+        //订单状态(0:待付款 1:待发货 2:待收货 3:已收货 4:售后中  11:取消订单)
         console.log(data, 'onLoad-applyRefund')
         if (data) {
-            this.receivedStatus = data.receivedStatus
-            this.tab = data.tab ? data.tab : null
+            if (data.tab) this.tab = data.tab
             if (data.orderId) this.orderId = data.orderId
             if (data.orderNo) this.orderNo = data.orderNo
+            if (data.orderStatus) this.orderStatus = data.orderStatus
+            if (this.orderStatus == 1 || this.orderStatus == 2) {
+                uni.setNavigationBarTitle({
+                    title: '申请退款'
+                });
+            } else if (this.orderStatus == 3) {
+                uni.setNavigationBarTitle({
+                    title: '申请换货'
+                });
+            }
+
+            if (data.servicePromise) this.servicePromise = data.servicePromise
             if (data.questionOrDiscribeValue && data.questionOrDiscribeValue !== "null") {
                 this.questionOrDiscribeValue = data.questionOrDiscribeValue
             }
@@ -194,6 +206,7 @@ export default {
 
     },
     onShow(data) {
+        console.log(this.orderStatus,this.filteredList)
         let flag = this.servicePromise.some(f => {
             return f.indexOf('7天无理由退') !== -1
         })
@@ -250,22 +263,48 @@ export default {
         //提交
         goSubmit() {
             console.log('提交 applyRefund')
-            //receivedStatus 1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
-            //tab 1 退款 2 换货
-            afterSaleOrder({ // 未收到-申请退款,已收到货-申请退款
-                orderId: this.orderId,
-                orderNo: this.orderNo,
-                applyReason: this.selectReasonValue,
-                afterSaleType: this.receivedStatus == 1 ? 3 : this.receivedStatus == 2 ? 1 : null,//1:退货 2:换  3:未收到货
-                //applyDesc:'',
-                //applyImages:'',
-            }).then(res => {
+            if (this.orderStatus == 0 || this.orderStatus == 1) { //待支付、待发货 走订单取消接口
+                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
+                        uni.navigateTo({
+                            url: `/points/productDetails/pendingPayment?orderNo=${this.orderNo}`
+                        });
+                    } else {
+                        //alert(res.data.msg)
+                        uni.showToast({
+                            title: res.data.msg,
+                            icon: 'none'
+                        })
+                    }
 
-            })
+                })
+                return
+            }
+
+            //订单状态(2:待收货 3:已收货 4:售后中)
+            if (this.orderStatus == 2) {
+                afterSaleOrder({ // 未收到-申请退款,已收到货-申请退款
+                    orderId: this.orderId,
+                    orderNo: this.orderNo,
+                    applyReason: this.selectReasonValue,
+                    afterSaleType: this.orderStatus == 2 ? 3 : null, // afterSaleType  1:退货 2:换  3:未收到货
+                    //applyDesc:'',
+                    //applyImages:'',
+                }).then(res => {
+
+                })
+            }
 
-            if (this.receivedStatus == 3) {
+            if (this.orderStatus == 3) { //换货
                 uni.navigateTo({
-                    url: `/points/productDetails/applyExchange?selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}&orderNo=${this.orderNo}&orderId=${this.orderId}`
+                    url: `/points/productDetails/applyExchange?selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}&orderNo=${this.orderNo}&orderId=${this.orderId}&orderStatus=${this.orderStatus}`
                 });
 
             }

+ 2 - 2
src/points/productDetails/index.vue

@@ -2,11 +2,11 @@
   <view class="member-content">
     <scroll-view class="sheet-content" :scroll-y="true" @scroll="handleContentScroll">
       <!-- 导航栏  :leftIconColor="!isTop ? '#fff' : '#000'"-->
-      <u-navbar :placeholder="true" autoBack>
+      <!-- <u-navbar :placeholder="true" autoBack>
         <view slot="center">
           <view class="center navbar-title" style="background-color: #fff;">商品详情</view>
         </view>
-      </u-navbar>
+      </u-navbar> -->
       <!-- 主图 -->
       <view class="mainImame">
         <ImageItem :src="$globalData.publicUrl + params.productMainImage" />

+ 2 - 27
src/points/productDetails/paymentSuccessful.vue

@@ -2,11 +2,11 @@
     <view>
         <scroll-view :scroll-y="true" @scroll="handleContentScroll">
             <!-- 导航栏  :leftIconColor="!isTop ? '#fff' : '#000'"-->
-            <u-navbar :placeholder="true" autoBack @click="autoBackFun">
+            <!-- <u-navbar :placeholder="true" autoBack @click="autoBackFun">
                 <view slot="center">
                     <view class="centerTitle" style="background-color: #fff;">{{ title }}</view>
                 </view>
-            </u-navbar>
+            </u-navbar> -->
 
             <view class="content">
                 <view class="contentBox">
@@ -71,31 +71,6 @@ export default {
             isTop: 0,
             redemptionRulesShowPopup: false,
             selectProductShowPopup: false,
-            list: [
-                {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                    defaultAddress: '默认',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                }, {
-                    addressName: '迎泽西大街86号信达国际金融中心',
-                    userName: '郭丽丽',
-                    userPhone: '16635680981',
-                },
-            ]
-
 
         }
     },

+ 26 - 23
src/points/productDetails/pendingPayment.vue

@@ -1,13 +1,13 @@
 <template>
-    <view>
+    <view v-if="orderInfo">
         <scroll-view :scroll-y="true" @scroll="handleContentScroll">
-            <u-navbar :placeholder="true" autoBack @click="autoBackFun">
+            <!-- <u-navbar :placeholder="true" autoBack @click="autoBackFun">
                 <view slot="center">
                     <view class="centerTitle" style="background-color: #fff;">{{ title }}</view>
                 </view>
-            </u-navbar>
+            </u-navbar> -->
 
-            <view class="contentBox" v-if="orderInfo">
+            <view class="contentBox" >
                 <view class="remainingTime">
                     {{ orderStatus }}
                     <text v-if="orderInfo.orderStatus == 0 && countdownText != '00:00'">{{ countdownText }}</text>
@@ -27,9 +27,6 @@
 
                     </view>
 
-                    <image style="width: 35rpx;height: 35rpx;position: absolute;right: 40rpx;top:40rpx"
-                        @click="closeSelectProduct" src="@/static/points/closeIcon.png" mode=""></image>
-
                     <view class="productPrice">
                         <view style="display:flex;">
                             <view>
@@ -111,21 +108,23 @@
                 </view>
             </view>
             <view class="buttonClass">
-                <u-button v-if="title == '待支付'" :customStyle="{
+                
+                <u-button v-if="orderInfo.orderStatus==0" :customStyle="{
                     color: '#999',
                     background: '',
                     border: '2rpx solid rgba(153, 153, 153, 1)'
                 }" @click="cancelOrderFun">取消支付</u-button>
 
-                <u-button v-if="title == '待支付'" :customStyle="{
+                <u-button v-if="orderInfo.orderStatus==0" :customStyle="{
                     color: '#fff ',
                     background: '#03C1B8'
                 }" @click="goPay">去付款</u-button>
-
-                <u-button v-if="title == '订单取消'" :customStyle="{
+               <u-button v-if="orderInfo.orderStatus==11" :customStyle="{
                     color: '#fff ',
                     background: '#03C1B8'
-                }" @click="buyAgain">再次购买</u-button>
+                }" @click="buyAgain">再次购买</u-button> 
+
+                
             </view>
 
         </scroll-view>
@@ -171,7 +170,7 @@
 
 <script>
 
-import { getPointOrderInfo,productOrderCancel, productOrderPay} from '@/api/pointOrder'
+import { getPointOrderInfo, productOrderCancel, productOrderPay } from '@/api/pointOrder'
 import { getInfo, } from '@/api/index.js';
 
 //paymentType 商品的付款类型 付款类型(1:积分 2:金额 3:积分+金额)
@@ -186,7 +185,6 @@ export default {
         return {
             selectReason: '',
             selectReasonValue: '',
-            title: '',
             cancelOrderShowPopup: false,
             countdownText: '',
             orderStatus: '', //超时未支付
@@ -234,16 +232,23 @@ export default {
             })
             this.orderInfo = res.data.data.orderInfo
             this.productInfo = res.data.data.productInfo
+            //this.orderInfo.remainSeconds = 30
             if (this.orderInfo.remainSeconds > 0 && this.orderInfo.orderStatus == 0) {
                 this.orderCountdownFun(this.orderInfo.remainSeconds)
                 this.orderStatus = '剩余时间'
-                this.title = '待支付'
+                uni.setNavigationBarTitle({
+                    title: '待支付'
+                });
             } else if (this.orderInfo.remainSeconds < 0 && this.orderInfo.orderStatus == 0) {
                 this.orderStatus = '超时未支付'
-                this.title = '订单取消'
+                uni.setNavigationBarTitle({
+                    title: '订单取消'
+                });
             } else if (this.orderInfo.orderStatus == 11) {
                 this.orderStatus = '您已取消支付'
-                this.title = '订单取消'
+                uni.setNavigationBarTitle({
+                    title: '订单取消'
+                });
             }
 
         },
@@ -254,8 +259,7 @@ export default {
                 this.countdownText = this.formatTime(remain);
                 if (remain <= 0) {
                     clearInterval(this.timer);
-                    this.orderStatus = '超时未支付'
-                    this.title = '订单取消'
+                    this.getOrderInfo()
                     this.cancelOrderShowPopup = false
                 }
             }, 1000);
@@ -272,10 +276,10 @@ export default {
         goPay() {
             if (this.orderInfo.payType == 1) {
                 //微信支付 
-                this.weixinPay(params)
+                this.weixinPay()
             } else if (this.orderInfo.payType == 2) {
                 //余额支付
-                this.nowYuyue(params)
+                this.nowYuyue()
             }
 
         },
@@ -389,8 +393,7 @@ export default {
                 if (res.data.code == 200) {
                     clearInterval(this.timer);
                     this.cancelOrderShowPopup = false
-                    this.title = '订单取消'
-                    this.orderStatus = '您已取消支付'
+                    this.getOrderInfo();
                 } else {
                     //alert(res.data.msg)
                     uni.showToast({