xuqiang 4 年之前
父節點
當前提交
783f51c737

+ 28 - 24
src/main/nine-space/src/views/Mine.vue

@@ -37,30 +37,34 @@
                         <div class="text1">{{ userInfo.followers }}</div>
                         <div class="text2">粉丝</div>
                     </div>
-                    <van-button
-                        plain
-                        color="#939599"
-                        size="mini"
-                        :icon="require('../assets/renzheng_icon_pre.png')"
-                        round
-                        @click="$router.push('/verifiedSuc')"
-                        v-if="authStatus === '已认证' && org == false"
-                        class="verid"
-                    >
-                        {{ authStatus }}
-                    </van-button>
-                    <van-button
-                        plain
-                        color="#939599"
-                        size="mini"
-                        :icon="require('../assets/renzheng_icon_pre.png')"
-                        round
-                        @click="$router.push('/EnterpriseAuthentication')"
-                        v-if="authStatus === '已认证' && org == true"
-                        class="verid"
-                    >
-                        {{ authStatus }}
-                    </van-button>
+                    <div v-if="org === false">
+                        <van-button
+                            plain
+                            color="#939599"
+                            size="mini"
+                            :icon="require('../assets/renzheng_icon_pre.png')"
+                            round
+                            @click="$router.push('/verifiedSuc')"
+                            v-if="authStatus === '已认证'"
+                            class="verid"
+                        >
+                            {{ authStatus }}
+                        </van-button>
+                    </div>
+                    <div v-if="org">
+                        <van-button
+                            plain
+                            color="#939599"
+                            size="mini"
+                            :icon="require('../assets/renzheng_icon_pre.png')"
+                            round
+                            @click="$router.push('/EnterpriseAuthentication')"
+                            v-if="authStatus === '已认证'"
+                            class="verid"
+                        >
+                            {{ authStatus }}
+                        </van-button>
+                    </div>
                     <van-button
                         plain
                         color="#939599"

+ 29 - 24
src/main/nine-space/src/views/asset/Consignment.vue

@@ -59,30 +59,35 @@ export default {
     },
     methods: {
         submit() {
-            this.$http
-                .post('/user/verifyTradeCode', {
-                    tradeCode: this.password
-                })
-                .then(() => {
-                    this.$http
-                        .post('/asset/consignment', {
-                            id: this.$route.query.id,
-                            price: this.price
-                        })
-                        .then(res => {
-                            console.log(res);
-                        })
-                        .catch(e => {
-                            if (e) {
-                                this.$toast(e.error);
-                            }
-                        });
-                })
-                .catch(e => {
-                    if (e) {
-                        this.$toast(e.error);
-                    }
-                });
+            // console.log(this.$route.query.id);
+            if (this.price != '') {
+                this.$http
+                    .post('/user/verifyTradeCode', {
+                        tradeCode: this.password
+                    })
+                    .then(() => {
+                        this.$http
+                            .post('/asset/consignment', {
+                                id: this.$route.query.id,
+                                price: this.price
+                            })
+                            .then(res => {
+                                console.log(res);
+                            })
+                            .catch(e => {
+                                if (e) {
+                                    this.$toast(e.error);
+                                }
+                            });
+                    })
+                    .catch(e => {
+                        if (e) {
+                            this.$toast('失败点击忘记密码进行修改');
+                        }
+                    });
+            } else {
+                this.$toast('请输入价格');
+            }
         }
     }
 };

+ 31 - 4
src/main/nine-space/src/views/asset/Detail.vue

@@ -119,7 +119,7 @@
         </div> -->
         <div class="btn van-safe-area-bottom" ref="btn">
             <div class="btns1">
-                <div @click="$router.push('/giveSearch?id' + info.id)">
+                <div @click="$router.push('/giveSearch?id=' + info.id)">
                     <img
                         class="img"
                         src="https://9space-2021.oss-cn-shenzhen.aliyuncs.com/image/2021-11-09-15-17-04hsdZwERv.png"
@@ -130,9 +130,10 @@
                 <van-button class="btn1" type="primary" block round @click="Exhibition">{{
                     info.publicShow ? '取消展示' : '公开展示'
                 }}</van-button>
-                <van-button type="primary" block round @click="$router.push('/Consignment?id' + info.id)"
-                    >寄售上架</van-button
-                >
+                <!-- $router.push('/Consignment?id=' + info.id) -->
+                <van-button type="primary" block round @click="Consignment">{{
+                    info.consignment ? '取消寄售' : '寄售上架'
+                }}</van-button>
             </div>
         </div>
 
@@ -199,6 +200,32 @@ export default {
         this.getProduct();
     },
     methods: {
+        Consignment() {
+            if (!this.info.publicShow) {
+                Dialog.confirm({
+                    title: '寄售上架',
+                    message: '确定寄售上架吗?'
+                }).then(() => {
+                    this.$router.push('/Consignment?id=' + this.info.id);
+                });
+                // .then(res => {
+                //     this.getProduct();
+                //     this.$message.success('展示成功');
+                // });
+            } else {
+                Dialog.confirm({
+                    title: '取消寄售',
+                    message: '确定取消寄售吗?'
+                })
+                    .then(() => {
+                        return this.$http.post(`/asset/cancelConsignment?id=${this.info.id}`);
+                    })
+                    .then(res => {
+                        this.getProduct();
+                        this.$message.success('取消寄售');
+                    });
+            }
+        },
         Exhibition() {
             if (!this.info.publicShow) {
                 Dialog.confirm({