Преглед на файлове

商家审核添加修改入口

2662043119@qq.com преди 1 година
родител
ревизия
c8936c0a72
променени са 2 файла, в които са добавени 41 реда и са изтрити 9 реда
  1. 29 8
      src/pagesC/settledMerchant/addShop.vue
  2. 12 1
      src/pagesC/settledMerchant/myBusiness.vue

+ 29 - 8
src/pagesC/settledMerchant/addShop.vue

@@ -151,6 +151,7 @@ export default {
                 street: "",
             },
             userAddress: "",
+            submitType: 0, //0新增 1修改
         };
     },
     methods: {
@@ -159,14 +160,26 @@ export default {
             this.$refs.form.validate().then((res) => {
                 let da = Object.assign({},this.formData);
                 da.discount = this.$h.Div(da.discount, 100);
-                post("v1/merchant/apply",da).then(res=>{
-                    if (res.code == 0) {
-                        that.$toast("提交成功,请关注审核状态")
-                        setTimeout(() => {
-                            uni.navigateBack({ delta: 1 })
-                        }, 1500);
-                    }
-                })
+                if(this.submitType == 1){
+                    post("v1/merchant/edit",{ ...res,shop_id: this.formData.id }).then(res=>{
+                        if (res.code == 0) {
+                            that.$toast("修改成功,请关注审核状态")
+                            setTimeout(() => {
+                                uni.navigateBack({ delta: 1 })
+                            }, 1500);
+                        }
+                    })
+                }else{
+                    post("v1/merchant/apply",da).then(res=>{
+                        if (res.code == 0) {
+                            that.$toast("提交成功,请关注审核状态")
+                            setTimeout(() => {
+                                uni.navigateBack({ delta: 1 })
+                            }, 1500);
+                        }
+                    })
+                }
+                
             })
             .catch((err) => {
                 console.log("表单错误信息:", err);
@@ -202,6 +215,14 @@ export default {
         this.$refs.form.setRules(this.rules);
     },
     onLoad(da) {
+        if (da && da.id) {
+            this.submitType = 1
+            post("v1/merchant/shopInfo", { shop_id: da.id }).then((res) => {
+                if (res.code == 0) {
+                    this.formData = res.data;
+                }
+            });
+        }
         this.getLocation()
         this.getTypeDesc()
     },

+ 12 - 1
src/pagesC/settledMerchant/myBusiness.vue

@@ -30,6 +30,9 @@
                 <div class="p1" v-if="i.remark">
                     <div class="remark">审核结果:{{i.remark || ""}}</div>
                 </div>
+                <div class="btn" v-if="i.status == 3">
+                    <button class="button" size="mini" type="primary" @click="goto('/pagesC/settledMerchant/addShop',{id:i.id})">修改</button>
+                </div>
             </div>
         </div>
         <empty v-else/>
@@ -87,9 +90,13 @@ export default {
         }
     },
     onLoad(da) {
+        // this.getList()
+    },
+    onShow() {
+        this.list = []
+        this.Query.page = 1
         this.getList()
     },
-    onShow() {},
     mounted() {},
     onReachBottom() {
         if (this.Query.page < this.pageData.last_page) this.getList();
@@ -168,5 +175,9 @@ export default {
             margin-top: 6rpx;
         }
     }
+    .btn{
+        display: flex;
+        margin-top: 30rpx;
+    }
 }
 </style>