From 9f7b52e81c7d06a290520834febfe21aeacf021c Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期三, 30 七月 2025 17:19:30 +0800 Subject: [PATCH] 商品,视频,大健康,厨神二维码 --- manager/src/views/video/VideoList.vue | 13 ++ manager/src/api/goods.js | 4 + manager/src/main.js | 1 manager/src/views/goods/goods-info/goods.vue | 102 ++++++++++++++++++++----- manager/src/views/health/HealthVideoList.vue | 46 +++++++++++ manager/src/views/kitchen/kitchenVideo.vue | 51 ++++++++++++ 6 files changed, 191 insertions(+), 26 deletions(-) diff --git a/manager/src/api/goods.js b/manager/src/api/goods.js index cab6054..11d1b40 100644 --- a/manager/src/api/goods.js +++ b/manager/src/api/goods.js @@ -225,3 +225,7 @@ export const refundPriceStatistics = (params) => { return getRequest(`/statistics/refund/order/getPrice`, params) } + +export const getGoodsFirstSkuId = (id) =>{ + return getRequest('/goods/goods/getFirstSkuId/'+id) +} diff --git a/manager/src/main.js b/manager/src/main.js index 97bfb9b..7beaa40 100644 --- a/manager/src/main.js +++ b/manager/src/main.js @@ -50,6 +50,7 @@ window.open(src, "_blank"); }; Vue.prototype.endpoint = "https://lmk-1356772813.cos.ap-chengdu.myqcloud.com" +Vue.prototype.QRcodeBaseUrl = "https://myk.9village.cn" Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app绔簩缁寸爜 if (skuId) { diff --git a/manager/src/views/goods/goods-info/goods.vue b/manager/src/views/goods/goods-info/goods.vue index 7dd86dd..66c568b 100644 --- a/manager/src/views/goods/goods-info/goods.vue +++ b/manager/src/views/goods/goods-info/goods.vue @@ -100,30 +100,31 @@ <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" @@ -161,7 +162,7 @@ </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 { @@ -171,6 +172,11 @@ name: "goods", data() { return { + showGeneralQrCode:false, + QRCodeUrl:'', + codeUrl: this.QRcodeBaseUrl+ '/scanpage/goods', + codeLoading:false, + id: "", //瑕佹搷浣滅殑id loading: true, // 琛ㄥ崟鍔犺浇鐘舵�� modalVisible: false, // 娣诲姞鎴栫紪杈戞樉绀� @@ -274,7 +280,7 @@ key: "action", align: "center", fixed: "right", - width: 150, + width: 220, render: (h, params) => { if (params.row.marketEnable == "DOWN") { return h("div", [ @@ -299,6 +305,9 @@ h( "Button", { + style: { + marginRight: "5px", + }, props: { size: "small", }, @@ -310,6 +319,20 @@ }, "鏌ョ湅" ), + h( + "Button", + { + props: { + size: "small", + }, + on: { + click: () => { + this.generalQrCode(params.row); + }, + }, + }, + "鐢熸垚浜岀淮鐮�" + ) ]); } else { return h("div", [ @@ -334,6 +357,9 @@ h( "Button", { + style: { + marginRight: "5px", + }, props: { size: "small", }, @@ -345,6 +371,21 @@ }, "鏌ョ湅" ), + h( + "Button", + { + props: { + type: "error", + size: "small", + }, + on: { + click: () => { + this.generalQrCode(params.row); + }, + }, + }, + "鐢熸垚浜岀淮鐮�" + ) ]); } }, @@ -355,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(); diff --git a/manager/src/views/health/HealthVideoList.vue b/manager/src/views/health/HealthVideoList.vue index 1ec0739..9e796d4 100644 --- a/manager/src/views/health/HealthVideoList.vue +++ b/manager/src/views/health/HealthVideoList.vue @@ -285,8 +285,30 @@ <Button type="success" size="small" style="margin-right: 5px" @click="deleteHealthVideo(row)">鍒犻櫎 </Button> + <Button type="error" size="small" style="margin-right: 5px" v-if="row.status === '1'" + @click="generalQrCode(row)">鐢熸垚浜岀淮鐮� + </Button> + </template> </Table> + <Modal + v-model="showGeneralQrCode" + title="浜岀淮鐮�" + width="800" + :mask-closable="false" + > + <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 @@ -314,12 +336,18 @@ import Editor from '@/components/editor/index.vue' import COS from 'cos-js-sdk-v5'; import {getFileKey} from "@/utils/file.js"; +import vueQr from "vue-qr"; export default { name: "VideoList", - components: {Editor}, + components: {Editor,"vue-qr": vueQr}, data() { return { + showGeneralQrCode:false, + codeUrl: this.QRcodeBaseUrl+ '/scanpage/health', + QRCodeUrl:'', + + videoDownForm: { id: '', reason: '' @@ -521,6 +549,22 @@ this.getTags('') }, methods: { + closeGeneralQrCode(){ + this.showGeneralQrCode = false; + + }, + generalQrCode(row){ + this.QRCodeUrl = ''; + this.showGeneralQrCode = true; + console.log('-------------------->',row); + //shareType鍙兘浼氭槸鍔ㄦ�佺殑锛屼細鍔犲垽鏂棰戞潵婧� + + + this.QRCodeUrl = this.codeUrl + '?shareType=health' + '&videoId='+ row.id + '%source=' + 'system'; + //TODO 鏍规嵁瑙嗛淇℃伅涓殑 锛屼綔鑰卛d鑾峰緱鐢ㄦ埛 鍒ゆ柇 鏉ユ簮 锛岀敤鎴蜂綔鑰呯殑uniid涓簄ull鍒欐槸绯荤粺涓婁紶锛屼笉涓虹┖鍒欐槸鐢ㄦ埛涓婁紶; + + // console.log(this.QRCodeUrl) + }, // 绉掕浆x鍒唜绉� formatSeconds(seconds) { if (isNaN(seconds) || seconds < 0) return '0绉�'; diff --git a/manager/src/views/kitchen/kitchenVideo.vue b/manager/src/views/kitchen/kitchenVideo.vue index c6b2b7f..9c9cc0f 100644 --- a/manager/src/views/kitchen/kitchenVideo.vue +++ b/manager/src/views/kitchen/kitchenVideo.vue @@ -287,9 +287,30 @@ <Button type="success" size="small" style="margin-right: 5px" @click="deleteHealthVideo(row)">鍒犻櫎 </Button> + <Button type="error" size="small" style="margin-right: 5px" v-if="row.status === '1'" + @click="generalQrCode(row)">鐢熸垚浜岀淮鐮� + </Button> </template> - </Table> + </Table> + <Modal + v-model="showGeneralQrCode" + title="浜岀淮鐮�" + width="800" + :mask-closable="false" + > + <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" @@ -305,6 +326,8 @@ ></Page> </Row> </Card> + + </div> </template> @@ -316,12 +339,17 @@ import COS from 'cos-js-sdk-v5'; import {getFileKey} from "@/utils/file.js"; import {getKitchenTypeAllList} from "@/api/kitchen"; +import vueQr from "vue-qr"; export default { name: "VideoList", - components: {Editor}, + components: {Editor,"vue-qr": vueQr}, data() { return { + showGeneralQrCode:false, + codeUrl: this.QRcodeBaseUrl+ '/scanpage/cook', + QRCodeUrl:'', + videoDownForm: { id: '', reason: '' @@ -554,6 +582,25 @@ this.getTypes('') }, methods: { + closeGeneralQrCode(){ + this.showGeneralQrCode = false; + }, + + generalQrCode(row){ + this.QRCodeUrl = ''; + this.showGeneralQrCode = true + console.log('-------------------->',row); + //shareType鍙兘浼氭槸鍔ㄦ�佺殑锛屼細鍔犲垽鏂棰戞潵婧� + console.log(item) + // uni.navigateTo({ + // url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}` + // }); + this.QRCodeUrl = this.codeUrl + '?shareType=cook' + '&videoId='+ row.id + '%source=' + 'system'; + //TODO 鏍规嵁瑙嗛淇℃伅涓殑 锛屼綔鑰卛d鑾峰緱鐢ㄦ埛 鍒ゆ柇 鏉ユ簮 锛岀敤鎴蜂綔鑰呯殑uniid涓簄ull鍒欐槸绯荤粺涓婁紶锛屼笉涓虹┖鍒欐槸鐢ㄦ埛涓婁紶 + + // console.log(this.QRCodeUrl) + }, + // 绉掕浆x鍒唜绉� formatSeconds(seconds) { if (isNaN(seconds) || seconds < 0) return '0绉�'; diff --git a/manager/src/views/video/VideoList.vue b/manager/src/views/video/VideoList.vue index 393b491..cd7070a 100644 --- a/manager/src/views/video/VideoList.vue +++ b/manager/src/views/video/VideoList.vue @@ -420,7 +420,7 @@ :mask-closable="false" > <vue-qr - text="https://myk.9village.cn/scanpage/recommend?shareType=videoRecommend&videoId=1948284811844190209" + :text="QRCodeUrl" :margin="0" colorDark="#000" colorLight="#fff" @@ -428,7 +428,7 @@ ></vue-qr> <div slot="footer"> <Button type="text" @click="closeGeneralQrCode">鍏抽棴</Button> - <Button type="primary" @click="generalQrCode">纭</Button> +<!-- <Button type="primary" @click="generalQrCode">纭</Button>--> </div> </Modal> <Row type="flex" justify="end" class="mt_10"> @@ -499,6 +499,9 @@ }, data() { return { + // https://myk.9village.cn/scanpage/recommend?shareType=videoRecommend&videoId=1948284811844190209 + baseQRCodeUrl: this.QRcodeBaseUrl+ '/scanpage/recommend', + QRCodeUrl:'', showGeneralQrCode:false, endpoint: '', searchGoods: '', @@ -701,9 +704,15 @@ this.getTags('') }, methods: { + closeGeneralQrCode(){ + this.showGeneralQrCode = false; + this.QRCodeUrl = ''; + }, generalQrCode(row){ this.showGeneralQrCode = true console.log('-------------------->',row); + this.QRCodeUrl = this.baseQRCodeUrl + '?shareType=videoRecommend' + '&videoId='+ row.id; + console.log(this.QRCodeUrl) }, //todo 淇濈暀鍚庣画鍙兘浼氫娇鐢� changeGoodsNum(id,index,goodsNum){ -- Gitblit v1.8.0