|
|
@@ -25,15 +25,31 @@
|
|
|
<view v-if="filteredItemList.length === 0" class="no-data-tip">
|
|
|
<text>{{ searchKeyword ? '未找到相关花材' : '暂无花材' }}</text>
|
|
|
</view>
|
|
|
- <view v-for="item in filteredItemList" :key="item.id" class="show-shop_box">
|
|
|
+ <view
|
|
|
+ v-for="(item, gridIdx) in filteredItemList"
|
|
|
+ :key="flowerItemRowKey(item, gridIdx)"
|
|
|
+ class="show-shop_box"
|
|
|
+ >
|
|
|
<view class="item-detail" @click="popAddModelFn(item)">
|
|
|
- <image class="img" :src="item.cover" lazy-load="true" :lazy-load-margin="0" mode="scaleToFill" ></image>
|
|
|
+ <image
|
|
|
+ class="img"
|
|
|
+ :key="flowerItemRowKey(item, gridIdx)"
|
|
|
+ :src="item.cover"
|
|
|
+ :lazy-load="false"
|
|
|
+ mode="scaleToFill"
|
|
|
+ />
|
|
|
<view class="shop-info_price">
|
|
|
<view>
|
|
|
- <view @click.stop="quickAddItem(item)">{{item.name}}</view>
|
|
|
- <view style="display:flex;justify-content: space-between;padding-right:2upx;" @click.stop="quickAddItem(item)">
|
|
|
- <text>¥{{parseFloat(item.price)}}</text>
|
|
|
- <text>剩{{parseFloat(item.stock)}}</text>
|
|
|
+ <text
|
|
|
+ class="flower-card-name"
|
|
|
+ :key="'nm-' + flowerItemRowKey(item, gridIdx)"
|
|
|
+ @click.stop="quickAddItem(item)"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </text>
|
|
|
+ <view class="flower-card-meta" @click.stop="quickAddItem(item)">
|
|
|
+ <text>¥{{ parseFloat(item.price) }}</text>
|
|
|
+ <text>剩{{ parseFloat(item.stock) }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -152,6 +168,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ /** 与 ghsPad 一致:id + property + 行下标,避免 App 端 v-for 节点复用错位 */
|
|
|
+ flowerItemRowKey(item, index) {
|
|
|
+ const id = item && item.id != null ? item.id : 'noid'
|
|
|
+ const prop = item && item.property !== undefined && item.property !== null ? item.property : 1
|
|
|
+ return `pad-fl-${id}-${prop}-${index}`
|
|
|
+ },
|
|
|
addToClear(){
|
|
|
this.$msg('请扫码打开')
|
|
|
},
|
|
|
@@ -250,8 +272,8 @@ export default {
|
|
|
}
|
|
|
.shop-info_price {
|
|
|
position: absolute;
|
|
|
- background-color: #000000;
|
|
|
- opacity: 0.6;
|
|
|
+ /* 避免父级 opacity 在老安卓 WebView 上与文字合成异常;用纯色透明底 */
|
|
|
+ background-color: rgba(0, 0, 0, 0.6);
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
width: 100%;
|
|
|
@@ -261,14 +283,18 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
z-index: 10;
|
|
|
& > view {
|
|
|
- & > view:nth-child(1) {
|
|
|
+ & > .flower-card-name {
|
|
|
+ display: block;
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
- width:100%;
|
|
|
- font-size:9upx;
|
|
|
+ width: 100%;
|
|
|
+ font-size: 9upx;
|
|
|
}
|
|
|
- & > view:nth-child(2) {
|
|
|
- font-size:7upx;
|
|
|
+ & > .flower-card-meta {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-right: 2upx;
|
|
|
+ font-size: 7upx;
|
|
|
}
|
|
|
}
|
|
|
}
|