From 52f60fcfc348ad26185c22a074b8551429ac5149 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期六, 11 十月 2025 16:31:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/send_coupon' into send_coupon

---
 manager/src/views/seller/shop/shopDetail.vue |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 112 insertions(+), 3 deletions(-)

diff --git a/manager/src/views/seller/shop/shopDetail.vue b/manager/src/views/seller/shop/shopDetail.vue
index c6bccdb..952b59f 100644
--- a/manager/src/views/seller/shop/shopDetail.vue
+++ b/manager/src/views/seller/shop/shopDetail.vue
@@ -121,6 +121,29 @@
             </span>
           </p>
           <p class="item">
+            <span class="label">搴楅摵鏍囩锛�</span>
+            <span class="info">
+              <template v-if="tagList?.length > 0">
+              <!-- 閬嶅巻鏍囩鍒楄〃 -->
+                <span v-for="(tag, index) in tagList" :key="tag.id">
+                  {{ tag.tagName }}
+                    <button
+                      style="width: 20px; height: 20px; line-height: 1; border: none; background: #f0f0f0; border-radius: 50%; cursor: pointer; margin-left: 4px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;"
+                      @click.stop="handleDeleteTag(tag.id, index)"
+                      title="鍒犻櫎鏍囩"
+                    >
+                    脳
+                  </button>
+                  <template v-if="index !== tagList.length - 1">銆�</template>
+                </span>
+              </template>
+            <template v-else>鏆傛棤鏍囩</template>
+            </span>
+          </p>
+          <div style="display: flex;align-items: center;justify-content: center;">
+            <Button type="primary"  @click="addStoreTag(storeInfo)">鏂板鏍囩</Button>
+          </div>
+          <p class="item">
             <span class="label">搴楅摵绠�浠嬶細</span>
             <span class="info">
               {{storeInfo.storeDesc?storeInfo.storeDesc:'鏆傛湭瀹屽杽'}}
@@ -559,6 +582,22 @@
             </Row>
           </div>
         </TabPane>
+
+        <Modal
+          v-model="showModal"
+          title="鏂板鏍囩"
+          width="800"
+          :mask-closable="false"
+        >
+          <Select v-model="tagForm.storeTagId" placeholder="璇烽�夋嫨" @on-query-change="searchChange" filterable
+                  clearable style="width: 150px">
+            <Option v-for="item in tagOptions" :value="item.id" :key="item.id">{{ item.tagName }}</Option>
+          </Select>
+          <div slot="footer">
+            <Button @click="showModal = false">鍙栨秷</Button>
+            <Button type="primary" @click="handleSubmit" :loading="submitLoading">纭畾</Button>
+          </div>
+        </Modal>
       </Tabs>
     </Card>
 
@@ -566,7 +605,7 @@
 </template>
 
 <script>
-
+  import { getTag,bind,getStoreTagsById,delTagByStoreTagRefId } from "@/api/store-tag"
   import ossManage from "@/views/sys/oss-manage/ossManage";
   import * as RegExp from '@/libs/RegExp.js';
   import {getCategoryTree} from "@/api/goods";
@@ -577,15 +616,23 @@
   export default {
     name: "member",
     components: {
-
       ossManage,
     },
     data() {
       return {
+        tagOptions:[],
+        submitLoading:false,
+        tagForm:{
+          storeId:null,
+          storeTagId:"",
+        },
+        showModal:false,
         id: "",//搴楅摵id
         categories: [], //搴楅摵闈欓煶鑼冨洿
         loading: true, // 琛ㄥ崟鍔犺浇鐘舵��
-        storeInfo: {},//搴楅摵淇℃伅
+        storeInfo: {
+        },//搴楅摵淇℃伅
+        tagList:[],
         checkAllGroup: [], //閫変腑鐨勭粡钀ュ垎绫�
         selectDate: null, // 鐢宠鏃堕棿
 
@@ -846,7 +893,69 @@
       };
     },
     methods: {
+      handleDeleteTag(storeTagRefId){
+        console.log(storeTagRefId)
+        delTagByStoreTagRefId(storeTagRefId).then(res=>{
+          if (res.code === 200){
+            this.$Message.success("鍒犻櫎鎴愬姛")
+          }
+          this.getStoreTags();
+        })
+
+      },
+
+      getStoreTags(){
+        getStoreTagsById(this.id).then(res =>{
+          if (res.code === 200){
+            this.$set(this, "tagList", res.data);
+          }
+        })
+
+      },
+
+      searchChange(val){
+        this.getStoreTag(val)
+      },
+      getStoreTag(val){
+        const params = {
+          tagName: ''
+        }
+        if (val) {
+          params.tagName = val;
+        } else {
+          params.tagName = ''
+        }
+        getTag(params).then(res =>{
+          if (res.code ===200){
+            this.tagOptions = res.data
+          }
+        })
+      },
+      handleSubmit(){
+        if (this.tagForm.storeTagId === null || this.tagForm.storeTagId ===""){
+          this.$Message.error("璇烽�夋嫨鏍囩")
+         return
+        }
+        this.showModal = false;
+          bind(this.tagForm).then(res =>{
+            if (res.code === 200){
+
+          }
+          this.getStoreTags();
+            this.getStoreTag();
+        })
+
+      },
+      addStoreTag(info){
+        console.log(info)
+        this.tagForm.storeId = info.storeId;
+        this.tagForm.storeTagId = "";
+        this.showModal = true;
+      },
       init() {
+        this.getStoreTags();
+
+        this.getStoreTag();
         //鏌ュ簵閾哄熀鏈俊鎭�
         this.getStoreInfo();
         //鏌ヨ搴楅摵鍒嗙被

--
Gitblit v1.8.0