feat(gloabl): 列表商品展示使用封面图字段cover

This commit is contained in:
woody 2025-06-06 11:25:12 +08:00
parent e4b055b75a
commit bc1ea11e37
10 changed files with 813 additions and 718 deletions

View File

@ -34,7 +34,11 @@
:key="item.pkWares"
@click="handleProductClick(item)"
>
<image :src="item.cover1" class="product-image" mode="aspectFill" />
<image
:src="item.cover || item.cover1"
class="product-image"
mode="aspectFill"
/>
<view class="product-info">
<view class="product-name">{{ item.waresName }}</view>
<view class="product-price-row">

View File

@ -129,7 +129,7 @@
<view class="popList_i" v-for="item in tableData" :key="item.pkId">
<u-checkbox :name="item.pkId"> </u-checkbox>
<view class="popList_ii">
<img :src="item.cover1" alt="" />
<img :src="item.cover || item.cover1" alt="" />
<view>
<view>{{ item.waresName }}</view>
<view>{{ item.waresCode }}</view>

View File

@ -1,35 +1,32 @@
<!--
* @Descripttion:
* @version:
* @Descripttion:
* @version:
* @Author: kBank
* @Date: 2022-12-13 15:02:12
-->
<template>
<view>
<!-- 海报 -->
<view class="popup"
v-show="popShow">
<view class="all"
id="qrCodeDiv"
ref="qrCodeDiv">
<canvas :style="{ width: canvasW + 'px', height: canvasH + 'px' }"
canvas-id="myCanvas"
id="myCanvas"></canvas>
<view class="popup" v-show="popShow">
<view class="all" id="qrCodeDiv" ref="qrCodeDiv">
<canvas
:style="{ width: canvasW + 'px', height: canvasH + 'px' }"
canvas-id="myCanvas"
id="myCanvas"
></canvas>
</view>
<view class="btn"
@click="savePosterPath()">保存到手机</view>
<view class="btn" @click="savePosterPath()">保存到手机</view>
</view>
<!-- 模态框 -->
<view class="mask"
v-show="popShow"
@tap="popShow = false"></view>
<view class="mask" v-show="popShow" @tap="popShow = false"></view>
<!-- 底部弹框 -->
<u-action-sheet :actions="list"
:closeOnClickOverlay="true"
@close="closeIsShow"
@select="selectClick"
:show="isShow"></u-action-sheet>
<u-action-sheet
:actions="list"
:closeOnClickOverlay="true"
@close="closeIsShow"
@select="selectClick"
:show="isShow"
></u-action-sheet>
</view>
</template>
@ -68,11 +65,11 @@ export default {
},
toShare(item) {
let pkId = item.pkId
this.goodImg = item.cover1
this.goodImg = item.cover || item.cover1
qrCode({
codeType: 1,
waresId: pkId,
}).then((res) => {
}).then(res => {
this.postImg = res.data
this.toCanvas()
// this.popShow = true
@ -90,7 +87,7 @@ export default {
ctx.drawImage(imgBg, 0, 0, this.canvasW, this.canvasH) //
ctx.drawImage(imggoodList, 95, 175, 130, 130)
ctx.drawImage(imgPost, 239, 392, 65, 65)
ctx.draw(true, (ret) => {})
ctx.draw(true, ret => {})
}, 100)
},
//
@ -98,7 +95,7 @@ export default {
return new Promise((reslove, reject) => {
uni.getImageInfo({
src: img,
success: (res) => {
success: res => {
reslove(res.path)
},
})
@ -122,7 +119,7 @@ export default {
uni.showModal({
title: '授权提示',
content: '是否允许获取保存相册权限',
success: (res) => {
success: res => {
if (res.confirm) {
//
uni.openSetting({
@ -154,32 +151,35 @@ export default {
saveLocal() {
console.log('d')
// canvas
uni.canvasToTempFilePath({
canvasId: 'myCanvas',
success: function (res) {
console.log('res', res)
// //
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
console.log('save success')
uni.showToast({
title: '已保存在本地相册',
icon: 'none',
})
},
fail: function () {
uni.showToast({
title: '保存失败',
icon: 'none',
})
},
})
uni.canvasToTempFilePath(
{
canvasId: 'myCanvas',
success: function (res) {
console.log('res', res)
// //
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
console.log('save success')
uni.showToast({
title: '已保存在本地相册',
icon: 'none',
})
},
fail: function () {
uni.showToast({
title: '保存失败',
icon: 'none',
})
},
})
},
fail: function (err) {
console.log('err', err)
},
},
fail: function (err) {
console.log('err', err)
},
},this)
this
)
},
},
}
@ -242,4 +242,4 @@ export default {
background: rgba(0, 0, 0, 80%);
overflow: hidden;
}
</style>
</style>

View File

@ -83,7 +83,7 @@
></view>
<view class="goods-flex-s">
<view class="goods-img">
<image :src="item.cover1"></image>
<image :src="item.cover || item.cover1"></image>
</view>
<view class="padding_s goods-info">
<view class="goods-name">{{ item.waresName }}</view>

View File

@ -270,7 +270,7 @@
>
<view class="goodList_i">
<view class="goodList_it">
<img :src="item.cover1" class="cover" alt="" />
<img :src="item.cover || item.cover1" class="cover" alt="" />
<view class="goodList_ir">
<view class="goodList_ib">
<view class="tit1">
@ -621,7 +621,7 @@ export default {
achieveAmount: 0,
price: 0,
priceAmount: 0,
cover1: item.cover1,
cover1: item.cover || item.cover1,
energySilo: 1,
}
})

View File

@ -753,7 +753,7 @@ export default {
achieveAmount: 0,
price: 0,
priceAmount: 0,
cover1: item.cover1,
cover1: item.cover || item.cover1,
energySilo: 1,
}
})

View File

@ -28,7 +28,7 @@
</view>
<view class="list_flex" style="margin-top: 20rpx;" v-for="aitem,aindex in item.waresOrderList">
<view class="center_left">
<image class="center_img" :src="aitem.cover1" mode=""></image>
<image class="center_img" :src="aitem.cover || aitem.cover1" mode=""></image>
<view class="center_title">{{aitem.waresName}}</view>
</view>
<view class="center_right">
@ -495,4 +495,4 @@
}
}
</style>
</style>

View File

@ -1,6 +1,6 @@
<!--
* @Descripttion:
* @version:
* @Descripttion:
* @version:
* @Author: kBank
* @Date: 2022-11-21 15:11:22
-->
@ -11,16 +11,18 @@
<view>{{ zoneList[0].label }}</view>
</view> -->
<view class="goods">
<view class="goods_item"
v-for="item in goodsList"
:key="item.pkId"
@tap="goDetails(item)">
<img :src="item.cover1"
class="goodImg"
alt="">
<view
class="goods_item"
v-for="item in goodsList"
:key="item.pkId"
@tap="goDetails(item)"
>
<img :src="item.cover || item.cover1" class="goodImg" alt="" />
<view class="goods_item_bom">
<view class="tit1_flex">
<view class="tit2">{{ item.waresPrice | numberToCurrency | isLocal }}</view>
<view class="tit2">{{
item.waresPrice | numberToCurrency | isLocal
}}</view>
<!-- <img class="shareImg"
:src="shareImg"
@click.stop="openImg(item)"
@ -28,29 +30,31 @@
</view>
<view class="disFlex">
<view class="tit3">
<span class="qzbq"
v-if="item.prefixLabelTarget != undefined">[{{ item.prefixLabelTarget.label }}]</span>
<span class="qzbq" v-if="item.prefixLabelTarget != undefined"
>[{{ item.prefixLabelTarget.label }}]</span
>
<span>{{ item.waresName }}</span>
</view>
</view>
<view class="disFlex">
<view class="tit4">
{{'销量'}}:{{ item.sales | numberToCurrency |seles}}
{{ '销量' }}:{{ item.sales | numberToCurrency | seles }}
</view>
<view class="tit4"
style="margin-left:10px">{{'业绩'}}:{{ item.waresAchieve | numberToCurrency}}
<view class="tit4" style="margin-left: 10px"
>{{ '业绩' }}:{{ item.waresAchieve | numberToCurrency }}
</view>
</view>
<!-- <view class="addCar">{{ '加入购物车' }}</view> -->
<view class="md">
<img v-for="ctem in item.sellingLabelList"
v-show="item.sellingLabelList"
:key="ctem.pkId"
:src="ctem.labelImage||''"
alt="">
<img
v-for="ctem in item.sellingLabelList"
v-show="item.sellingLabelList"
:key="ctem.pkId"
:src="ctem.labelImage || ''"
alt=""
/>
</view>
</view>
</view>
</view>
</view>
@ -69,17 +73,15 @@ export default {
computed: {
...mapGetters(['user']),
},
filters:{
seles(value){
if(value>999){
return 999 + '+'
}else{
return value
}
}
filters: {
seles(value) {
if (value > 999) {
return 999 + '+'
} else {
return value
}
},
},
data() {
return {
title: '',
@ -156,9 +158,9 @@ export default {
.getAllGoods({
specialArea: this.specialArea,
})
.then((res) => {
.then(res => {
this.goodsList = res.data
this.goodsList.forEach((item) => {
this.goodsList.forEach(item => {
if (item.waresName.length > 8) {
item.waresName = item.waresName.substring(0, 8) + '...'
}
@ -171,9 +173,9 @@ export default {
source: this.source,
productCategory: this.productCategory,
})
.then((res) => {
.then(res => {
this.goodsList = res.rows
this.goodsList.forEach((item) => {
this.goodsList.forEach(item => {
if (item.waresName.length > 8) {
item.waresName = item.waresName.substring(0, 8) + '...'
}
@ -191,10 +193,12 @@ export default {
min-height: 94vh;
}
.index_header {
background: #f9f9f9;;
background: #f9f9f9;
height: 330rpx;
font-size: 18px;
font-family: PingFang SC-Semibold, PingFang SC;
font-family:
PingFang SC-Semibold,
PingFang SC;
font-weight: 600;
color: #333333;
text-align: center;
@ -243,7 +247,9 @@ export default {
// width: 120rpx;
text-align: center;
font-size: 14px;
font-family: PingFang SC-Semibold, PingFang SC;
font-family:
PingFang SC-Semibold,
PingFang SC;
font-weight: 600;
color: #ed1d25;
margin-right: 28rpx;
@ -341,7 +347,9 @@ export default {
border: 1px solid #f33131;
border-radius: 6px;
font-size: 12px;
font-family: PingFang SC-Semibold, PingFang SC;
font-family:
PingFang SC-Semibold,
PingFang SC;
font-weight: 600;
color: #f33131;
text-align: center;

View File

@ -157,7 +157,7 @@
<view class="popList_i" v-for="item in tableData" :key="item.pkId">
<u-checkbox :name="item.pkId"> </u-checkbox>
<view class="popList_ii">
<img :src="item.cover1" alt="" />
<img :src="item.cover || item.cover1" alt="" />
<view>
<view>{{ item.waresName }}</view>
<view>{{ item.waresCode }}</view>

File diff suppressed because it is too large Load Diff