Bläddra i källkod

字段修改 页面支付修改

MS-IOHQJGHXZHQD\Administrator 4 månader sedan
förälder
incheckning
7fb400fc84

+ 2 - 0
src/points/order/orderDetails.vue

@@ -152,11 +152,13 @@ export default {
         uni.navigateTo({
           url: `/points/productDetails/applyExchange?afterSalesType=${this.afterSalesType}&receiptStatus=${this.receiptStatus}&orderNo=${this.orderInfo.orderNo}&orderId=${this.orderInfo.id}&orderStatus=${this.orderInfo.orderStatus}`
         });
+        this.afterSalesShow = false
         return
       }
       uni.navigateTo({
         url: `/points/productDetails/applyRefund?afterSalesType=${this.afterSalesType}&receiptStatus=${this.receiptStatus}&orderNo=${this.orderInfo.orderNo}&orderId=${this.orderInfo.id}&orderStatus=${this.orderInfo.orderStatus}`
       });
+      this.afterSalesShow = false
     },
     //获取售后时间
     getafterTime() {

+ 1 - 1
src/points/productDetails/applyExchange.vue

@@ -167,7 +167,7 @@ export default {
                 applyImages: this.fileList.map(m => m.url).join(','),
             }).then(res => {
                 if (res.data.code == 200) {
-                    uni.navigateTo({
+                    uni.redirectTo({
                         url: '/points/order/orderDetails?orderNo=' + this.orderNo,
                     });
                 } else {

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

@@ -287,10 +287,10 @@ export default {
                     //applyImages:'',
                 }).then(res => {
                     if (res.data.code == 200) {
-                        uni.navigateTo({
+                        uni.redirectTo({
                             url: '/points/order/orderDetails?orderNo=' + this.orderNo,
                         });
-                    }else{
+                    } else {
                         uni.$u.toast(res.data.msg)
                     }
 

+ 52 - 55
src/points/productDetails/index.vue

@@ -149,6 +149,7 @@
 </template>
 
 <script>
+import wx from 'weixin-js-sdk';
 import ImageItem from "@/components/swiper/components/image.vue";
 import RedemptionRules from "./components/redemptionRules.vue";
 import SelectProduct from "./components/selectProduct.vue";
@@ -182,6 +183,7 @@ export default {
       orderRemarks: null,
       addressList: [],
       dBalance: 0.00,
+      wxconfig: {},
 
 
     }
@@ -330,6 +332,7 @@ export default {
     },
     //微信支付
     weixinPay(params) {
+      let url = 'https://city.baoxianzhanggui.com/fragrance/'
       productOrderCreate(params).then(res => {
         if (res.data.code == 200) {
           productOrderPay({
@@ -337,64 +340,58 @@ export default {
             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('付款失败');
+            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?orderNo=' + this.orderNo
+                    });
+                  } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
+                    uni.showToast({
+                      title: '已取消支付',
+                      icon: 'none'
+                    })
+                    uni.navigateTo({
+                      url: '/points/productDetails/pendingPayment?orderNo=' + this.orderNo
+                    });
+
+
+                  } 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 => {
+              )
 
+            })
 
-        })
+          })
+        }
       })
     },
     //账号余额支付

+ 20 - 9
src/points/productDetails/paymentSuccessful.vue

@@ -16,7 +16,7 @@
                                 src="@/static/points/successIcon.png" mode=""></image>
                         </view>
                         <view class="payStatus"> 商品兑换成功</view>
-                        <view class="promiseSeedTime">我们将在3个工作日寄出 </view>
+                        <view class="promiseSeedTime">我们将在{{orderInfo.deliveryTime}}个小时内寄出 </view>
                     </view>
                     <view style="height: 2rpx;background-color: #f0f0f0;margin-top: 40rpx;"> </view>
 
@@ -27,11 +27,11 @@
                                 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>
 
@@ -60,9 +60,7 @@
 </template>
 
 <script>
-import ApplyRefund from './applyRefund.vue';
-
-
+import { getPointOrderInfo, } from '@/api/pointOrder'
 export default {
     components: {},
     data() {
@@ -71,11 +69,17 @@ export default {
             isTop: 0,
             redemptionRulesShowPopup: false,
             selectProductShowPopup: false,
+            orderNo: null,
+            orderInfo: null,
+            productInfo: null,
 
         }
     },
     onLoad(data) {
-
+        if (data.orderNo) {
+            this.orderNo = data.orderNo
+            this.getOrderInfo();
+        }
     },
     onShow() {
 
@@ -86,7 +90,14 @@ export default {
     },
 
     methods: {
-
+        async getOrderInfo() {
+            const res = await getPointOrderInfo({
+                orderNo: this.orderNo,
+                openId: uni.getStorageSync('wx_copenid')
+            })
+            this.orderInfo = res.data.data.orderInfo
+            this.productInfo = res.data.data.productInfo
+        },
         handleContentScroll(e) {
             this.isTop = e.detail.scrollTop > 0
         },

+ 56 - 56
src/points/productDetails/pendingPayment.vue

@@ -7,7 +7,7 @@
                 </view>
             </u-navbar> -->
 
-            <view class="contentBox" >
+            <view class="contentBox">
                 <view class="remainingTime">
                     {{ orderStatus }}
                     <text v-if="orderInfo.orderStatus == 0 && countdownText != '00:00'">{{ countdownText }}</text>
@@ -61,7 +61,7 @@
                             <text class="text">合计:</text>
                             <text class="price">¥ {{
                                 (orderInfo.payAmount + (orderInfo.freightAmount > 0 ? orderInfo.freightAmount : 0))
-                                }}</text>
+                            }}</text>
                         </view>
                     </view>
                     <view class="weiChect">
@@ -108,23 +108,23 @@
                 </view>
             </view>
             <view class="buttonClass">
-                
-                <u-button v-if="orderInfo.orderStatus==0" :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="orderInfo.orderStatus==0" :customStyle="{
+                <u-button v-if="orderInfo.orderStatus == 0" :customStyle="{
                     color: '#fff ',
                     background: '#03C1B8'
                 }" @click="goPay">去付款</u-button>
-               <u-button v-if="orderInfo.orderStatus==11" :customStyle="{
+                <u-button v-if="orderInfo.orderStatus == 11" :customStyle="{
                     color: '#fff ',
                     background: '#03C1B8'
-                }" @click="buyAgain">再次购买</u-button> 
+                }" @click="buyAgain">再次购买</u-button>
+
 
-                
             </view>
 
         </scroll-view>
@@ -169,9 +169,9 @@
 </template>
 
 <script>
-
+import wx from 'weixin-js-sdk';
 import { getPointOrderInfo, productOrderCancel, productOrderPay } from '@/api/pointOrder'
-import { getInfo, } from '@/api/index.js';
+import { getInfo, getSignature } from '@/api/index.js';
 
 //paymentType 商品的付款类型 付款类型(1:积分 2:金额 3:积分+金额)
 
@@ -200,6 +200,7 @@ export default {
             orderNo: '',
             orderInfo: null,
             productInfo: null,
+            wxconfig: {},
         }
     },
     onLoad(data) {
@@ -285,58 +286,57 @@ export default {
         },
         //微信支付
         weixinPay() {
+            let url = 'https://city.baoxianzhanggui.com/fragrance/'
             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('付款失败');
+                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?orderNo=' + this.orderNo
+                                });
+                            } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
+                                uni.showToast({
+                                    title: '已取消支付',
+                                    icon: 'none'
+                                })
+
+                            } else {
+                                alert('付款失败');
+                            }
                         }
-                    }
-                )
+                    )
+
+                })
             })
         },
         //账号余额支付