Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

jf 5 лет назад
Родитель
Сommit
a8d4064b65

+ 8 - 1
hdApp/src/pages.json

@@ -715,12 +715,19 @@
 					}
 				},
         {
-					"path": "cosNext",
+					"path": "cosNext", 
 					"style": {
 						"navigationBarTitleText": "下一步",
 						"enablePullDownRefresh": true
 					}
 				},
+        {
+					"path": "gatherPay", 
+					"style": {
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": true
+					}
+				},
         {
 					"path": "purDetails",
 					"style": {

+ 191 - 0
hdApp/src/pagesPurchase/gatherPay.vue

@@ -0,0 +1,191 @@
+<template>
+  <!-- 各种回调页面 -->
+  <div class="app-content awaitPayYe awaitPayYe">
+    <div class="callback-wrap">
+      <div class="bg_01"></div>
+      <div class="callback-blo">
+        <!-- 使用icon -->
+        <!-- 待支付 -->
+        <block>
+          <div class="icon">
+            <i class="iconfont icondaizhifu"></i>
+          </div>
+        </block>
+        <view class="wait">待确认</view>
+        <!-- 待支付 -->
+        <block>
+          <div class="price">
+            <span>¥</span>
+            <span class="app-size-36 app-bold">{{ actPrice || ''}}</span>
+          </div>
+          <div class="order-num app-color-3">订单号: {{ orderSn || ''}}</div>
+        </block>
+        <block>
+          <div class="call-one-btn">
+            <button
+              class="button-com green pay-wx"
+              @click="_wxPay"
+            >微信支付</button>
+          </div>
+        </block>
+      </div>
+    </div>
+    <!-- 键盘 -->
+    <keyboard-module
+      :show="keyShow"
+      @comfirm="hideKeyFn"
+      @clickKey="clickKeyFn"
+      :psdShow="true"
+      :type="_type"
+      @closeKey="closeKeyFn"
+    />
+    <!-- 弹窗 - 未设置支付密码 -->
+    <alert-module
+      :show="setPassModal"
+      btnText="设置"
+      btnColor="#FF2842"
+      padding="66rpx 24rpx 66rpx 24rpx"
+      @click="hideAlert"
+    >
+      <div class="go-login-module">
+        <div>请先设置支付密码!</div>
+      </div>
+    </alert-module>
+  </div>
+</template>
+
+<script>
+import { purchaseClearCreateOrder, purchaseClearWxPay, purchaseBalancePay } from "@/api/purchase/index";
+import keyboardModule from './components/keyboard'
+import AlertModule from "@/components/plugin/alert";
+import { mapGetters } from "vuex";
+import wexinPay from "@/utils/pay/wxPay";
+export default {
+  name: "callback",
+  components: {
+    keyboardModule,
+    AlertModule
+  },
+  data () {
+    return {
+      type: '',
+      keyShow: false,
+      modalForm: {
+        payPassword: ''
+      },
+      psdKey: '',
+      orderSn: '',
+      actPrice: '',
+      setPassModal: false,
+      _type: '1'
+    };
+  },
+  onLoad (options) {
+    this.getWeChat(options.id)
+  },
+  computed: {
+    ...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
+  },
+  mounted () {
+  },
+  methods: {
+    getWeChat (id) {
+      // console.log(this.options.id)
+      purchaseClearCreateOrder({ id }).then(res => {
+        this.orderSn = res.data.orderSn
+        this.actPrice = res.data.actPrice
+      }).catch(err => { console.log(err) })
+    },
+    _wxPay () {
+      purchaseClearWxPay({ orderSn: this.orderSn }).then(res => {
+        console.log(res)
+        wexinPay(res.data, this.getSuccess, this.getError)
+      }).catch(err => { console.log(err) })
+    },
+    getSuccess () {
+      uni.navigateTo({
+        url: '/pagesPurchase/particulars'
+      })
+    },
+    getError () {
+      this.$msg("支付失败!");
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  .callback-wrap {
+    padding-top: 50px;
+    // background-image: url("../../src/static/images/callback/bg.png");
+    background-repeat: no-repeat;
+    background-size: 100% auto;
+    position: relative;
+    .bg_01 {
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 100vw;
+      height: 290upx;
+      background: #3385ff;
+      border-radius: 0rpx 0rpx 83rpx 83rpx;
+      z-index: 1;
+    }
+    .callback-blo {
+      position: absolute;
+      z-index: 9;
+      left: 50%;
+      transform: translateX(-50%);
+      width: 90%;
+      margin: 0 auto;
+      padding: 70px 0;
+      background-color: #fff;
+      box-shadow: 2px 2px 16px 0px rgba(181, 181, 181, 0.29);
+      border-radius: 10px;
+      text-align: center;
+      // 使用icon
+      .icon {
+        .iconfont {
+          font-size: 170px;
+        }
+      }
+      // 一个按钮
+      .call-one-btn {
+        .button-com {
+          width: 80%;
+          padding-top: 22px;
+          padding-bottom: 22px;
+          font-size: 32px;
+          margin-top: 40px;
+        }
+      }
+    }
+  }
+}
+// 待支付 - 公共
+.awaitPayWx,
+.awaitPayYe {
+  .status-text {
+    margin-top: 22px;
+    margin-bottom: 52px;
+    color: #ffa92e;
+  }
+  .surplus {
+    margin-top: 22px;
+    margin-bottom: 38px;
+  }
+  .icon {
+    .iconfont {
+      color: #ffa92e;
+    }
+  }
+}
+// 待确认样式
+.wait {
+  color: #ffa92e;
+  font-size: 40upx;
+  font-weight: 700;
+  margin: 20upx 0;
+}
+</style>

+ 1 - 1
hdApp/src/pagesPurchase/gathering.vue

@@ -207,7 +207,7 @@ export default {
           arr.push(item.id)
         })
         uni.navigateTo({
-          url: '/pagesPurchase/wechatPay?id=' + arr.join(',')
+          url: '/pagesPurchase/gatherPay?id=' + arr.join(',')
         })
 
       }

+ 6 - 2
hdApp/src/pagesPurchase/setPsd.vue

@@ -30,7 +30,7 @@
 
 <script>
 import keyboardModule from './components/keyboard'
-import adminSetPayPassword from '@/api/admin/index'
+import { adminSetPayPassword } from '@/api/admin/index'
 export default {
   components: {
     keyboardModule,
@@ -48,7 +48,9 @@ export default {
       this.keyContent = ''
       this.Psdlist = [{ class: '' }, { class: '' }, { class: '' }, { class: '' }, { class: '' }, { class: '' }];
     },
-    hideKeyFn () { },
+    hideKeyFn () {
+      this.keyShow = false
+    },
     clickKeyFn (val) {
       console.log(val)
       this.keyContent = val
@@ -68,7 +70,9 @@ export default {
     },
     // 修改密码
     changePsd () {
+      console.log(this.keyContent.length)
       if (this.keyContent.length === 6) {
+        console.log(111111)
         adminSetPayPassword({ password: this.keyContent }).then(res => {
           console.log(res)
           uni.navigateBack({})

+ 10 - 8
hdApp/src/pagesPurchase/wechatPay.vue

@@ -87,20 +87,22 @@ export default {
       },
       psdKey: '',
       orderSn: '',
-					actPrice: '',
-					setPassModal: false,
+      actPrice: '',
+      setPassModal: false,
       _type: '1'
     };
   },
   onLoad (options) {
-  	this.orderSn = options.orderSn;
-  	this.actPrice = options.actPrice;
-    // this.getWeChat(options.orderSn)
+    this.orderSn = options.orderSn;
+    this.actPrice = options.actPrice;
     this.type = options.type
   },
   computed: {
     ...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
   },
+  mounted () {
+    this.getWeChat()
+  },
   methods: {
     // 延期支付
     postponePay () {
@@ -111,8 +113,8 @@ export default {
         })
       }).catch(err => { console.log(err) })
     },
-    // getWeChat (id) {
-    //   purchaseClearCreateOrder({ id }).then(res => {
+    // getWeChat () {
+    //   purchaseClearCreateOrder({ id: this.options.id }).then(res => {
     //     this.options = res.data
     //     this.orderSn = res.data.orderSn
     //   }).catch(err => { console.log(err) })
@@ -138,7 +140,7 @@ export default {
     },
     _balancePay () {
       console.log(this.getLoginInfo, this.getDictionariesInfo)
-      if (this.getLoginInfo.payPassword) {
+      if (!this.getLoginInfo.payPassword) {
         this.keyShow = true
       } else {
         this.setPassModal = true