| | |
| | | </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:'暂未完善'}} |
| | |
| | | </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> |
| | | |
| | |
| | | </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"; |
| | |
| | | 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, // 申请时间 |
| | | |
| | |
| | | }; |
| | | }, |
| | | 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(); |
| | | //查询店铺分类 |