From 892058812dcaa56ed97025134e1411c5de53b21d Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期三, 06 八月 2025 09:51:57 +0800 Subject: [PATCH] 优惠卷全选反选 --- manager/src/views/goods/goods-info/goods.vue | 122 +++++++++++++++++++++++++++++++++------- 1 files changed, 100 insertions(+), 22 deletions(-) diff --git a/manager/src/views/goods/goods-info/goods.vue b/manager/src/views/goods/goods-info/goods.vue index 7a5f7d3..66c568b 100644 --- a/manager/src/views/goods/goods-info/goods.vue +++ b/manager/src/views/goods/goods-info/goods.vue @@ -89,38 +89,42 @@ <template slot="goodsSlot" slot-scope="{ row }"> <div style="margin: 5px 0px; height: 80px; display: flex"> <div style=""> - <img + <img v-if="row.original" :src="row.original" style="height: 60px; margin-top: 1px; width: 60px" + /> + <video v-else + :src="row.goodsVideo" style="height: 60px; margin-top: 1px; width: 60px" /> </div> <div style="margin-left: 13px"> <div class="div-zoom"> - <a @click="linkTo(row.id, row.skuId)">{{ row.goodsName }}</a> + {{ row.goodsName }} </div> - <Poptip trigger="hover" title="鎵爜鍦ㄦ墜鏈轰腑鏌ョ湅" transfer> - <div slot="content"> - <vue-qr - :text="wapLinkTo(row.id, row.skuId)" - :margin="0" - colorDark="#000" - colorLight="#fff" - :size="150" - ></vue-qr> - </div> - <img - src="../../../assets/qrcode.svg" - class="hover-pointer" - width="20" - height="20" - alt="" - /> - </Poptip> </div> </div> </template> </Table> + <Modal + v-model="showGeneralQrCode" + title="浜岀淮鐮�" + width="800" + :mask-closable="false" + :loading="codeLoading" + > + <vue-qr + :text="QRCodeUrl" + :margin="0" + colorDark="#000" + colorLight="#fff" + :size="150" + ></vue-qr> + <div slot="footer"> + <Button type="text" @click="closeGeneralQrCode">鍏抽棴</Button> + <!-- <Button type="primary" @click="generalQrCode">纭</Button>--> + </div> + </Modal> <Row type="flex" justify="end" class="mt_10"> <Page :current="searchForm.pageNumber" @@ -158,7 +162,8 @@ </template> <script> -import { getGoodsListData, upGoods, lowGoods } from "@/api/goods"; +import { getGoodsListData, upGoods, lowGoods ,getGoodsFirstSkuId } from "@/api/goods"; +import {getSts} from '@/api/file' import vueQr from "vue-qr"; export default { components: { @@ -167,6 +172,11 @@ name: "goods", data() { return { + showGeneralQrCode:false, + QRCodeUrl:'', + codeUrl: this.QRcodeBaseUrl+ '/scanpage/goods', + codeLoading:false, + id: "", //瑕佹搷浣滅殑id loading: true, // 琛ㄥ崟鍔犺浇鐘舵�� modalVisible: false, // 娣诲姞鎴栫紪杈戞樉绀� @@ -212,6 +222,8 @@ return h("Tag", { props: { color: "orange" } }, "闆跺敭"); } else if (params.row.salesModel === "WHOLESALE") { return h("Tag", { props: { color: "magenta" } }, "鎵瑰彂"); + } else if (params.row.salesModel === "PRESALE") { + return h("Tag", { props: { color: "magenta" } }, "棰勫敭"); } else { return h("Tag", { props: { color: "volcano" } }, "鍏朵粬绫诲瀷"); } @@ -268,7 +280,7 @@ key: "action", align: "center", fixed: "right", - width: 150, + width: 220, render: (h, params) => { if (params.row.marketEnable == "DOWN") { return h("div", [ @@ -293,6 +305,9 @@ h( "Button", { + style: { + marginRight: "5px", + }, props: { size: "small", }, @@ -304,6 +319,20 @@ }, "鏌ョ湅" ), + h( + "Button", + { + props: { + size: "small", + }, + on: { + click: () => { + this.generalQrCode(params.row); + }, + }, + }, + "鐢熸垚浜岀淮鐮�" + ) ]); } else { return h("div", [ @@ -328,6 +357,9 @@ h( "Button", { + style: { + marginRight: "5px", + }, props: { size: "small", }, @@ -339,6 +371,21 @@ }, "鏌ョ湅" ), + h( + "Button", + { + props: { + type: "error", + size: "small", + }, + on: { + click: () => { + this.generalQrCode(params.row); + }, + }, + }, + "鐢熸垚浜岀淮鐮�" + ) ]); } }, @@ -349,6 +396,25 @@ }; }, methods: { + closeGeneralQrCode(){ + this.showGeneralQrCode = false; + }, + generalQrCode(row){ + this.QRCodeUrl = ''; + this.showGeneralQrCode = true + this.codeLoading = true; + + //鑾峰緱鍟嗗搧瀵瑰簲鐨勭涓�涓猻kuid + getGoodsFirstSkuId(row.id).then(res =>{ + this.codeLoading = false; + + if (res.code){ + this.QRCodeUrl = this.codeUrl + "?id="+ res.result +"&goodsId=" + row.id + } + }) + + }, + // 鍒濆鍖栨暟鎹� init() { this.getDataList(); @@ -376,6 +442,18 @@ this.loading = false; if (res.success) { this.data = res.result.records; + getSts().then(res => { + const endpoint = res.data.endpoint + this.data.forEach(item => { + if (item.goodsVideo != null && item.goodsVideo.indexOf('http')===-1) { + item.goodsVideo = endpoint + '/' + item.goodsVideo; + } + if (item.original !=null && item.original.indexOf('http') ===-1) { + item.original = endpoint + '/' + item.original; + } + }) + }) + this.total = res.result.total; } }); -- Gitblit v1.8.0