xuqiang 4 лет назад
Родитель
Сommit
bad69f6f45

+ 2 - 3
src/main/nine-space/src/views/asset/Consignment.vue

@@ -71,10 +71,9 @@ export default {
                                 price: this.price
                             })
                             .then(res => {
-                                // console.log(res);
                                 this.$toast.success('寄售成功');
                                 setTimeout(() => {
-                                    this.$router.replace('/assetDetail?id=' + this.$route.query.id);
+                                    this.$router.go(-1);
                                 }, 1000);
                             })
                             .catch(e => {
@@ -85,7 +84,7 @@ export default {
                     })
                     .catch(e => {
                         if (e) {
-                            this.$toast('失败点击忘记密码进行修改');
+                            this.$toast('密码错误');
                         }
                     });
             } else {

+ 31 - 35
src/main/pc-space/src/views/Send.vue

@@ -41,7 +41,7 @@
                     <el-button type="info" @click="copy" size="mini" plain>复制</el-button>
                 </div>
             </div> -->
-            <el-form :model="form" ref="rules" label-width="85px" class="demo-ruleForm">
+            <el-form :model="form" :rules="rules" ref="rules" label-width="85px" class="demo-ruleForm">
                 <div class="title">请输入交易密码,验证信息</div>
                 <el-form-item prop="password">
                     <el-input
@@ -72,10 +72,13 @@
             <div class="price">
                 应付金额<span class="span">{{ gas }}</span>
             </div>
-            <div class="qrcode">
-                <vue-qrcode :value="payUrl" :options="{ width: 140, margin: 1 }" class="code"></vue-qrcode>
+            <div v-if="status == 'NOT_PAID'">
+                <div class="qrcode">
+                    <vue-qrcode :value="payUrl" :options="{ width: 140, margin: 1 }" class="code"></vue-qrcode>
+                </div>
+                <div class="qrcode-text">二维码有效时常为5分钟,请尽快支付</div>
             </div>
-            <div class="qrcode-text">二维码有效时常为5分钟,请尽快支付</div>
+
             <!-- <div class="tips">
                 <div class="text1">购买须知</div>
                 <div class="text2">
@@ -87,43 +90,45 @@
             </div> -->
         </div>
 
-        <!-- <span slot="footer" class="dialog-footer">
-            <el-button type="primary" class="pay" @click="submit">立即支付</el-button>
-        </span> -->
+        <span slot="footer" class="dialog-footer">
+            <el-button :disabled="btn" type="primary" class="pay" @click="submit">立即支付</el-button>
+        </span>
     </el-dialog>
 </template>
 
 <script>
 import vueQrcode from '@chenfengyuan/vue-qrcode';
 import resolveUrl from 'resolve-url';
+import phone from '../mixins/phone';
 export default {
     components: {
         vueQrcode
     },
     data() {
         return {
-            payMethods: 'ALIPAY',
+            payMethods: 'WEIXIN',
             show: false,
             info: [],
             checked: true,
             id: 103,
             form: { password: '' },
+            status: '',
             gas: 0,
             rules: {
                 password: { min: 6, max: 6, message: '密码长度在 6 到 6 个数字', trigger: 'blur' }
             },
             payList: [
-                // {
-                //     icon: require('../assets/alipay.png'),
-                //     name: '支付宝',
-                //     type: 'ALIPAY'
-                // },
                 {
                     icon: require('../assets/weixin.png'),
                     name: '微信',
                     type: 'WEIXIN'
                 }
                 // {
+                //     icon: require('../assets/alipay.png'),
+                //     name: '支付宝',
+                //     type: 'ALIPAY'
+                // },
+                // {
                 //     icon: require('../assets/dcep.png'),
                 //     name: 'DCEP支付',
                 //     type: 'DCEP'
@@ -140,12 +145,18 @@ export default {
         });
     },
     computed: {
+        btn() {
+            if (this.phone && this.form.password) {
+                return false;
+            } else {
+                return true;
+            }
+        },
         payUrl() {
             return resolveUrl(this.$baseUrl, '9th/payOrder/weixin_pc?id=' + this.info.id);
         }
         // payUrl() {
         //     return resolveUrl(
-        //         this.$baseUrl,
         //         'https://nfttest.9space.vip/wx/redirect?redirectUrl=https://nfttest.9space.vip/payOrder/weixin_pc?id=2006'
         //     );
         // }
@@ -166,7 +177,8 @@ export default {
                             toUserId: this.id
                         })
                         .then(res => {
-                            console.log(res);
+                            this.status = res.status;
+                            // console.log(res);
                         })
                         .catch(e => {
                             if (e) {
@@ -176,29 +188,10 @@ export default {
                 })
                 .catch(e => {
                     if (e) {
-                        this.$message('失败点击忘记密码进行修改');
+                        this.$message('交易密码错误');
                     }
                 });
         },
-        // init(info) {
-        //     this.checkLogin()
-        //         .then(() => {
-        //             this.show = true;
-        //             this.loading = true;
-        //             console.log(this.$route.query.id);
-        //             // return this.$http.get('/order/get/' + this.$route.query.id);
-        //             // return this.$http.post('/order/create?collectionId=' + info.id + '&qty=1');
-        //         })
-        //         .then(res => {
-        //             this.orderInfo = res;
-        //             this.loading = false;
-        //         })
-        //         .catch(e => {
-        //             if (e) {
-        //                 this.$message.warning(e.error);
-        //             }
-        //         });
-        // },
         copy() {
             this.$copyText(this.orderInfo.id).then(
                 e => {
@@ -241,6 +234,9 @@ export default {
 /deep/ .el-checkbox__label {
     margin-right: 20px;
 }
+/deep/ .el-form-item__error {
+    padding-left: 100px;
+}
 .qrcode {
     text-align: center;
     margin-top: 20px;

+ 16 - 12
src/main/pc-space/src/views/Submit.vue

@@ -47,9 +47,9 @@
             </div>
         </div>
 
-        <!-- <span slot="footer" class="dialog-footer">
+        <span slot="footer" class="dialog-footer">
             <el-button type="primary" class="pay" @click="submit">确认</el-button>
-        </span> -->
+        </span>
     </el-dialog>
 </template>
 
@@ -61,18 +61,19 @@ export default {
     data() {
         return {
             show: false,
-            payMethods: 'ALIPAY',
+            payMethods: 'WEIXIN',
             payList: [
-                // {
-                //     icon: require('../assets/alipay.png'),
-                //     name: '支付宝',
-                //     type: 'ALIPAY'
-                // },
                 {
                     icon: require('../assets/weixin.png'),
                     name: '微信',
                     type: 'WEIXIN'
                 }
+                // {
+                //     icon: require('../assets/alipay.png'),
+                //     name: '支付宝',
+                //     type: 'ALIPAY'
+                // },
+
                 // {
                 //     icon: require('../assets/dcep.png'),
                 //     name: 'DCEP支付',
@@ -86,11 +87,11 @@ export default {
     },
     computed: {
         payUrl() {
-            return resolveUrl(
-                this.$baseUrl,
-                'https://nfttest.9space.vip/wx/redirect?redirectUrl=https://nfttest.9space.vip/payOrder/weixin_pc?id=2006'
-            );
+            return resolveUrl('https://nfttest.9space.vip/wx/payOrder/weixin_pc?id=' + this.info.id);
         },
+        // payUrl() {
+        //     return resolveUrl(this.$baseUrl, '9th/payOrder/weixin_pc?id=' + this.info.id);
+        // },
         money() {
             if (this.info.price) {
                 return add(this.info.price, this.gas);
@@ -101,6 +102,9 @@ export default {
     },
     methods: {
         submit() {
+            console.log(this.payUrl);
+            console.log(this.info.id);
+            console.log(this.$baseUrl);
             if (this.payMethods === 'DCEP') {
                 this.wait();
             }