Bladeren bron

字段整合 发起售后申请

MS-IOHQJGHXZHQD\Administrator 5 maanden geleden
bovenliggende
commit
751f2857e6

+ 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 - 24
src/api/points.js

@@ -63,27 +63,5 @@ export function productGetById(data) {
         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
-    });
-}
+
+

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

@@ -115,14 +115,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}`
       });
     }
   }

+ 20 - 5
src/points/productDetails/applyExchange.vue

@@ -77,13 +77,14 @@
 </template>
 
 <script>
-import ApplyRefund from './applyRefund.vue';
-
+import { afterSaleOrder} from '@/api/pointOrder'
 
 export default {
     components: {},
     data() {
         return {
+            orderNo:null,
+            orderId:null,
             fileList: [],
             questionOrDiscribeValue: null,
             selectReasonValue: null,
@@ -121,10 +122,11 @@ export default {
     },
     onLoad(data) {
         if (data) {
-            //console.log(data,'66666666')
+            console.log(data,'66666666')
             //decodeURIComponent (data) 
+            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
             }
 
@@ -155,6 +157,19 @@ export default {
                 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=>{
+
+            })
 
 
         },
@@ -165,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}`
             })
 
         },

+ 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}`
                 });
 
             }

+ 82 - 80
src/points/productDetails/index.vue

@@ -152,14 +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, productOrderPay } from '@/api/points'
+import { productGetById } from '@/api/points'
+import { productOrderCreate, productOrderPay } from '@/api/pointOrder'
 import { getAddrList, } from '@/api/address';
-import {
-  getInfo,
-  payoff,
-  pay,
-  getSignature,
-} from '@/api/index.js';
+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 },
@@ -219,7 +220,6 @@ export default {
     getinfo() {
       getInfo().then(res => {
         if (res.data.code == 200) {
-          console.log(res, 'res6666')
           this.dBalance = res.data.data.dBalance.toFixed(2)
         }
       })
@@ -293,9 +293,9 @@ export default {
         }
         let params = {}
         params.openId = uni.getStorageSync('wx_copenid');//用户openId
-        params.phone = this.defaultAddress.phone;//用户手机号
+        params.userPhone = this.defaultAddress.phone;//用户手机号
         params.userName = this.defaultAddress.userName;//用户名
-        params.addressName = this.defaultAddress.address + this.defaultAddress.atlasAdd;//地图地址+详细地址
+        params.userAddress = this.defaultAddress.address + this.defaultAddress.atlasAdd;//地图地址+详细地址
         params.addressId = this.defaultAddress.id;//地址ID
         params.productId = this.params.id;
         params.name = this.params.name;
@@ -331,62 +331,69 @@ export default {
     //微信支付
     weixinPay(params) {
       productOrderCreate(params).then(res => {
-        return
-        productOrderPay().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 => {
-          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('付款失败');
-              }
-            }
-          )
         })
       })
     },
@@ -406,33 +413,28 @@ export default {
         });
       } else {
         productOrderCreate(params).then(res => {
-          return
-          productOrderPay().then(res => {
-
-          })
-
-        })
-        return
-        var data = {
-          cId: this.details.cId,
-          payType: this.selectedPayment,
-          couponReceiveId: this.couponReceiveId,
-          preferential: this.preferential, //优惠金额
-          totalPrice: this.totalPrice, //总金额
-        }
-        payoff(data).then(res => {
           if (res.data.code == 200) {
-            uni.navigateTo({
-              url: '/points/productDetails/paymentSuccessful'
-            });
-          } else {
-            uni.showToast({
-              icon: 'error',
-              title: res.data.msg,
+            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,
+                })
+              }
+
             })
           }
 
         })
+
       }
     },
     //打开选择商品页

+ 96 - 107
src/points/productDetails/pendingPayment.vue

@@ -10,7 +10,7 @@
             <view class="contentBox">
                 <view class="remainingTime">
                     {{ orderStatus }}
-                    <text v-if="countdownText != '00:00'">{{ countdownText }}</text>
+                    <text v-if="orderInfo.orderStatus == 0 && countdownText != '00:00'">{{ countdownText }}</text>
                 </view>
                 <view class="content" v-if="orderInfo">
                     <view class="addressBox">
@@ -33,21 +33,27 @@
                     <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">实付价 ¥{{ orderInfo.payAmount }}元+{{ orderInfo.pointsUsed }}积分 </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>
@@ -56,7 +62,9 @@
                         <view style="height: 2rpx;background-color: #f0f0f0;margin-top: 20rpx;"> </view>
                         <view class="total">
                             <text class="text">合计:</text>
-                            <text class="price">¥ {{ orderInfo.totalAmount }}</text>
+                            <text class="price">¥ {{
+                                (orderInfo.payAmount + (orderInfo.freightAmount > 0 ? orderInfo.freightAmount : 0))
+                                }}</text>
                         </view>
                     </view>
                     <view class="weiChect">
@@ -159,18 +167,19 @@
 
     </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:取消订单)
+
+//售后状态(0:待审核 1:退款完成 2:等待用户寄回  3:等待商家收货 4:等待商家寄出  5:订单完成 6:取消售后)
 
-<script>
-import { productOrderCancel, productOrderPay } from '@/api/points'
-import { getPointOrderInfo } from '@/api/pointOrder'
-import {
-    getInfo, payoff, pay, getSignature,
-} from '@/api/index.js';
 export default {
     components: {},
     data() {
@@ -210,35 +219,41 @@ export default {
     },
 
     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.orderCountdownFun()
             this.orderInfo = res.data.data
-        },
-        //订单倒计时
-        orderCountdownFun() {
-            let remain = 10;
-            if (remain > 0) {
+            if (this.orderInfo.remainSeconds > 0 && this.orderInfo.orderStatus == 0) {
+                this.orderCountdownFun(this.orderInfo.remainSeconds)
                 this.orderStatus = '剩余时间'
                 this.title = '待支付'
-            } else {
+            } else if (this.orderInfo.remainSeconds < 0 && this.orderInfo.orderStatus == 0) {
                 this.orderStatus = '超时未支付'
                 this.title = '订单取消'
-                this.cancelOrderShowPopup = false
-                return
+            } 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.title = '订单取消'
                     this.cancelOrderShowPopup = false
                 }
             }, 1000);
@@ -253,22 +268,6 @@ export default {
 
         //去付款
         goPay() {
-            let params = {}
-            params.openId = uni.getStorageSync('wx_copenid');//用户openId
-            params.addressId = this.orderInfo.addressId;//地址ID
-            params.productId = this.orderInfo.id;
-            //params.name = this.params.name;
-            //params.productMainImage = this.params.productMainImage;
-            //params.skuId = this.selectedObj.index; //选中的SKU ID
-            //params.specNameValueLis = this.selectedObj.specNameValueList; // SKU列表(规格组合明细)
-            params.quantity = 1; //购买数量
-            params.payType = this.orderInfo.payType;//支付方式:1微信支付 2账户余额
-            params.freightAmount = this.orderInfo.freightAmount; //运费
-            params.totalAmount = this.orderInfo.totalAmount;// 总金额
-            params.payAmount = this.orderInfo.payAmount;// 支付金额
-            params.pointsUsed = this.orderInfo.pointsUsed;// 使用的积分
-            params.buyerRemark = this.orderInfo.buyerRemark;//买家备注信息
-            console.log(params, 'params')
             if (this.orderInfo.payType == 1) {
                 //微信支付 
                 this.weixinPay(params)
@@ -279,60 +278,59 @@ export default {
 
         },
         //微信支付
-        weixinPay(params) {
-            productOrderCreate(params).then(res => {
+        weixinPay() {
+            productOrderPay({
+                orderNo: this.orderInfo.orderNo, //订单编号
+                payType: this.orderInfo.payType, //支付方式:1微信支付 2:余额支付
+                totalPrice: this.orderInfo.totalAmount //订单总金额,单位:元
+            }).then(res => {
+                console.log(res, '8888888')
                 return
-                productOrderPay().then(res => {
+                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'
+                            });
 
-                })
 
-            })
-            return
-            let url = 'https://test.baoxianzhanggui.com/fragrance/'
-            payoff(params).then(res => {
-                let payConfig = JSON.parse(res.data.data)
-                getSignature(url).then(res => {
-                    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'
-                                })
-                            } else {
-                                alert('付款失败');
-                            }
+                        } else {
+                            alert('付款失败');
                         }
-                    )
-                })
+                    }
+                )
             })
         },
         //账号余额支付
@@ -350,22 +348,12 @@ export default {
                     }
                 });
             } else {
-                productOrderCreate(params).then(res => {
-                    return
-                    productOrderPay().then(res => {
-
-                    })
-
-                })
-                return
-                var data = {
-                    cId: this.details.cId,
-                    payType: this.selectedPayment,
-                    couponReceiveId: this.couponReceiveId,
-                    preferential: this.preferential, //优惠金额
-                    totalPrice: this.totalPrice, //总金额
-                }
-                payoff(data).then(res => {
+                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'
@@ -397,6 +385,7 @@ export default {
             }
             productOrderCancel(params).then(res => {
                 if (res.data.code == 200) {
+                    clearInterval(this.timer);
                     this.cancelOrderShowPopup = false
                     this.title = '订单取消'
                     this.orderStatus = '您已取消支付'