xuqiang 4 years ago
parent
commit
0547dc8184

+ 15 - 0
src/main/nine-space/src/components/order/OrderInfo.vue

@@ -61,6 +61,21 @@ export default {
             this.$emit('delFn');
         },
         del() {
+            // this.Dialog.confirm({
+            //     title: '确定删除吗?',
+            //     message: '删除此记录将消失'
+            // }).then(() => {
+            //     this.$http
+            //         .post('/order/hide/', {
+            //             id: this.info.id
+            //         })
+            //         .then(() => {
+            //             this.$toast.success('删除成功');
+            //             setTimeout(() => {
+            //                 this.delInit();
+            //             }, 1000);
+            //         });
+            // });
             this.$http
                 .post('/order/hide/', {
                     id: this.info.id

+ 3 - 1
src/main/pc-space/src/views/Send.vue

@@ -111,6 +111,7 @@ export default {
             info: [],
             checked: true,
             id: 103,
+            idOrder: 1034,
             form: { password: '' },
             status: '',
             gas: 0,
@@ -153,7 +154,7 @@ export default {
             }
         },
         payUrl() {
-            return resolveUrl(this.$baseUrl, '9th/payOrder/weixin_pc?id=' + this.info.id);
+            return resolveUrl(this.$baseUrl, '9th/payOrder/weixin_pc?id=' + this.idOrder);
         }
         // payUrl() {
         //     return resolveUrl(
@@ -178,6 +179,7 @@ export default {
                         })
                         .then(res => {
                             this.status = res.status;
+                            this.idOrder = res.id;
                             // console.log(res);
                         })
                         .catch(e => {

+ 34 - 18
src/main/pc-space/src/views/Submit.vue

@@ -28,12 +28,13 @@
                         </el-radio-group>
                     </div>
                 </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 class="qrcode-text">手机微信扫描二维码下单</div> -->
                 </div>
-                <!-- <div class="qrcode-text">二维码有效时常为5分钟,请尽快支付</div> -->
-                <div class="qrcode-text">手机微信扫描二维码下单</div>
             </div>
 
             <div class="tips">
@@ -47,9 +48,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>
 
@@ -82,16 +83,19 @@ export default {
             ],
             loading: true,
             info: {},
-            gas: 0
+            gas: 0,
+            id: 0,
+            status: ''
         };
     },
     computed: {
-        payUrl() {
-            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);
+        //     return resolveUrl('https://nfttest.9space.vip/wx/payOrder/weixin_pc?id=' + this.info.id);
         // },
+        payUrl() {
+            return resolveUrl(this.$baseUrl, 'https://nfttest.9space.vip/payOrder/weixin_pc?id=' + this.id);
+        },
+        // https://nfttest.9space.vip/wx/redirect?redirectUrl=https://nfttest.9space.vip/payOrder/weixin_pc?id=2006
         money() {
             if (this.info.price) {
                 return add(this.info.price, this.gas);
@@ -102,12 +106,24 @@ export default {
     },
     methods: {
         submit() {
-            console.log(this.payUrl);
-            console.log(this.info.id);
-            console.log(this.$baseUrl);
-            if (this.payMethods === 'DCEP') {
-                this.wait();
-            }
+            // console.log(this.payUrl);
+            // console.log(this.info.id);
+            // console.log(this.$baseUrl);
+            // if (this.payMethods === 'DCEP') {
+            //     this.wait();
+            // }
+            this.$http
+                .post('/order/create?collectionId=' + this.$route.query.id + '&qty=1')
+                .then(res => {
+                    // console.log(res);
+                    this.id = res.id;
+                    this.status = res.status;
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$toast(e.error);
+                    }
+                });
         },
         init(info) {
             this.checkLogin()