Procházet zdrojové kódy

Merge branch 'master' of http://192.168.3.207:10080/jianyu/jy-docs

zhangyuhan před 4 roky
rodič
revize
e6a9e3f668

+ 16 - 5
jydocs-mobile/src/views/purchase/purchase.vue

@@ -100,7 +100,6 @@ export default class extends Vue {
   btnChecked = false
   tel = ''
   regPhoneExg = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/
-  query: any
   $router: any
   $env: any
   response = {
@@ -113,8 +112,16 @@ export default class extends Vue {
     balance: ''
   }
 
+  sessioninfor = {
+    query: '',
+    balance: 0,
+    code: '',
+    payTime: '',
+    payWay: ''
+  }
+
   created () {
-    this.query = location.href.split('/')[location.href.split('/').length - 1] // 获取id
+    this.sessioninfor.query = location.href.split('/')[location.href.split('/').length - 1] // 获取id
     this.getWordInfor()
   }
 
@@ -150,7 +157,7 @@ export default class extends Vue {
 
   // 文档信息
   async getWordInfor () {
-    this.getDetails({ docId: this.query }).then((res: any) => {
+    this.getDetails({ docId: this.sessioninfor.query }).then((res: any) => {
       console.log(res)
       const item = res.data.detail
       if (res.error_code === 0) {
@@ -180,10 +187,14 @@ export default class extends Vue {
 
   // 确定兑换
   exchange () {
-    this.getDocPay({ docId: this.query, phone: this.tel }).then((res: any) => {
+    this.getDocPay({ docId: this.sessioninfor.query, phone: this.tel }).then((res: any) => {
       console.log(res)
       if (res.error_code === 0) {
-        sessionStorage.setItem('paydata', JSON.stringify(res.data))
+        this.sessioninfor.balance = res.data.balance
+        this.sessioninfor.code = res.data.code
+        this.sessioninfor.payTime = res.data.payTime
+        this.sessioninfor.payWay = res.data.payWay
+        sessionStorage.setItem('paydata', JSON.stringify(this.sessioninfor))
         this.$router.replace('/purchasesuccess/' + this.response.price)
       }
     })

+ 5 - 3
jydocs-mobile/src/views/purchase/purchasesuccess.vue

@@ -51,6 +51,7 @@ export default class extends Vue {
   $router: any
   query: any
   payinfor = {
+    docId: '', // id
     payTime: '',
     payWay: '',
     code: '',
@@ -58,7 +59,7 @@ export default class extends Vue {
   }
 
   created () {
-    this.query = location.href.split('/')[location.href.split('/').length - 1] // 获取id
+    this.query = location.href.split('/')[location.href.split('/').length - 1] // 获取num
     this.setCountDown()
     this.setSession()
   }
@@ -71,6 +72,7 @@ export default class extends Vue {
       this.payinfor.payTime = dateFormatter(paydata.payTime * 1000, 'yyyy-MM-dd')
       this.payinfor.payWay = paydata.payWay
       this.payinfor.code = paydata.code
+      this.payinfor.docId = paydata.query
     }
   }
 
@@ -86,7 +88,7 @@ export default class extends Vue {
           this.$router.replace({
             name: 'details',
             params: {
-              id: this.payinfor.code
+              id: this.payinfor.docId
             }
           })
         }
@@ -99,7 +101,7 @@ export default class extends Vue {
     this.$router.replace({
       name: 'details',
       params: {
-        id: this.payinfor.code
+        id: this.payinfor.docId
       }
     })
   }

+ 0 - 1
jydocs-pc/src/views/purchase/purchase.vue

@@ -154,7 +154,6 @@ export default {
         }
       })
     },
-
     getBool (bool) {
       if (this.checked === true && bool === true) {
         this.btnChecked = true