Zory 3 days ago
parent
commit
c86ef7dea5

+ 11 - 3
src/views/manage/shop/index/components/table.vue

@@ -51,7 +51,8 @@
             <template #default="scope">
                 <el-button-group>
                     <el-button text type="success" size="small" @click="table_auth(scope.row)">授权地址</el-button>
-                    <el-button text type="warning" size="small" @click="table_qrcode(scope.row)">隐藏二维码</el-button>
+                    <el-button text type="warning" size="small" @click="table_qrcode(scope.row)" v-if="scope.row.is_hide==0">隐藏二维码</el-button>
+                    <el-button text type="primary" size="small" @click="table_qrcode(scope.row)" v-if="scope.row.is_hide==1">显示二维码</el-button>
                     <el-button text type="warning" size="small" @click="table_path(scope.row)">设置Path</el-button>
                     <el-button text type="primary" size="small" @click="table_view(scope.row)">编辑</el-button>
                     <el-button text type="danger" size="small" @click="table_del(scope.row)">删除</el-button>
@@ -88,10 +89,17 @@ export default {
             })
         },
         table_qrcode(data){
-            this.$confirm(`设置隐藏二维码后,用户通过来客下单不会显示券码的二维码,仅有【去预约】的按钮`, '提示', {
+            var msg;var hide = 2;
+            if (data.is_hide == 1) {
+                hide = 1;
+                msg = "设置显示二维码后,用户通过来客下单后可显示核销券码二维码";
+            } else {
+                msg = "设置隐藏二维码后,用户通过来客下单不会显示券码的二维码,仅有【去预约】的按钮";
+            }
+            this.$confirm(msg, '提示', {
                 type: 'warning'
             }).then(async ()=>{
-                var resp = await this.$API.store.auth.post({"id":data.id,"type":2});
+                var resp = await this.$API.store.auth.post({"id":data.id,"type":2,"val":hide});
                 if (resp.code == 0) {
                     return this.$message.error(resp.msg);
                 }

+ 21 - 0
src/views/merchant/shop/index/components/table.vue

@@ -46,6 +46,8 @@
                 <el-button-group>
                     <el-button text type="success" size="small" @click="table_auth(scope.row)">授权地址</el-button>
                     <el-button text type="warning" size="small" @click="table_path(scope.row)">设置Path</el-button>
+                    <el-button text type="warning" size="small" @click="table_qrcode(scope.row)" v-if="scope.row.is_hide==0">隐藏二维码</el-button>
+                    <el-button text type="primary" size="small" @click="table_qrcode(scope.row)" v-if="scope.row.is_hide==1">显示二维码</el-button>
                     <el-button text type="primary" size="small" @click="table_view(scope.row)">编辑</el-button>
                     <el-button text type="danger" size="small" @click="table_del(scope.row)">删除</el-button>
                 </el-button-group>
@@ -75,6 +77,25 @@ export default {
     },
     
     methods: {
+        table_qrcode(data){
+            var msg;var hide = 2;
+            if (data.is_hide == 1) {
+                hide = 1;
+                msg = "设置显示二维码后,用户通过来客下单后可显示核销券码二维码";
+            } else {
+                msg = "设置隐藏二维码后,用户通过来客下单不会显示券码的二维码,仅有【去预约】的按钮";
+            }
+            this.$confirm(msg, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var resp = await this.$API.store.auth.post({"id":data.id,"type":2,"val":hide});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(()=>{})
+        },
         table_auth(data){
             this.$nextTick(() => {
                 this.$refs.authMain.open("edit").setData(data)