shish 2 ay önce
ebeveyn
işleme
481d3840c5

+ 2 - 3
ghsPad/src/pages/home/components/rightGoods.vue

@@ -14,7 +14,7 @@
                     <image class="img" :key="goodsItemRowKey(item, goodsIdx)" :src="item.smallCover" :lazy-load="false" mode="scaleToFill" ></image>
                     <image class="img" :key="goodsItemRowKey(item, goodsIdx)" :src="item.smallCover" :lazy-load="false" mode="scaleToFill" ></image>
                     <view class="shop-info_price">
                     <view class="shop-info_price">
                         <view>
                         <view>
-                            <text class="goods-card-name" :key="'gn-' + item.id + '-' + goodsIdx">{{ item.name }}</text>
+                            <text class="goods-card-name" :key="'gn-' + goodsItemRowKey(item, goodsIdx)">{{ item.name }}</text>
                             <view class="goods-card-meta" >
                             <view class="goods-card-meta" >
                                 <text>¥{{parseFloat(item.price)}}</text>
                                 <text>¥{{parseFloat(item.price)}}</text>
                                 <text>剩{{parseFloat(item.stock)}}</text>
                                 <text>剩{{parseFloat(item.stock)}}</text>
@@ -233,8 +233,7 @@ export default {
                     }
                     }
                     .shop-info_price {
                     .shop-info_price {
                         position: absolute;
                         position: absolute;
-                        background-color: #000000;
-                        opacity: 0.6;
+                        background-color: rgba(0, 0, 0, 0.6);
                         bottom: 0;
                         bottom: 0;
                         left: 0;
                         left: 0;
                         width: 100%;
                         width: 100%;

+ 2 - 3
ghsPad/src/pages/home/components/rightItem.vue

@@ -44,7 +44,7 @@
                     <view v-if="item.variety == 1" class="variety-badge"></view>
                     <view v-if="item.variety == 1" class="variety-badge"></view>
                     <view class="shop-info_price">
                     <view class="shop-info_price">
                         <view>
                         <view>
-                            <text class="flower-card-name" :key="'nm-' + item.id + '-' + flowerIdx" @click.stop="quickAddItem(item)">{{ item.name }}</text>
+                            <text class="flower-card-name" :key="'nm-' + flowerItemRowKey(item, flowerIdx)" @click.stop="quickAddItem(item)">{{ item.name }}</text>
                             <view class="flower-card-meta" @click.stop="quickAddItem(item)">
                             <view class="flower-card-meta" @click.stop="quickAddItem(item)">
                                 <text>¥{{parseFloat(item.price)}}</text>
                                 <text>¥{{parseFloat(item.price)}}</text>
                                 <text v-if="Number(item.reachNumDiscount)>0 && Number(item.reachNum)>0" style="color:#FFEB3B;">{{ item.reachNum }}↓{{ item.reachNumDiscount?parseFloat(item.reachNumDiscount):0 }}</text>
                                 <text v-if="Number(item.reachNumDiscount)>0 && Number(item.reachNum)>0" style="color:#FFEB3B;">{{ item.reachNum }}↓{{ item.reachNumDiscount?parseFloat(item.reachNumDiscount):0 }}</text>
@@ -305,8 +305,7 @@ export default {
                 }
                 }
                 .shop-info_price {
                 .shop-info_price {
                     position: absolute;
                     position: absolute;
-                    background-color: #000000;
-                    opacity: 0.6;
+                    background-color: rgba(0, 0, 0, 0.6);
                     bottom: 0;
                     bottom: 0;
                     left: 0;
                     left: 0;
                     width: 100%;
                     width: 100%;

+ 29 - 10
hdPad/src/pages/home/components/rightGoods.vue

@@ -12,15 +12,25 @@
                 scroll-y="true"
                 scroll-y="true"
                 @scrolltolower="reachBottom"
                 @scrolltolower="reachBottom"
             >
             >
-                <view v-for="item in list.data" :key="item.id" class="show-shop_box">
+                <view
+                    v-for="(item, gridIdx) in list.data"
+                    :key="goodsItemRowKey(item, gridIdx)"
+                    class="show-shop_box"
+                >
                     <view class="item-detail" @click="popAddModelFn(item)">
                     <view class="item-detail" @click="popAddModelFn(item)">
-                        <image class="img" :src="item.smallCover" lazy-load="true" :lazy-load-margin="0" mode="scaleToFill" ></image>
+                        <image
+                            class="img"
+                            :key="goodsItemRowKey(item, gridIdx)"
+                            :src="item.smallCover"
+                            :lazy-load="false"
+                            mode="scaleToFill"
+                        />
                         <view class="shop-info_price">
                         <view class="shop-info_price">
                             <view>
                             <view>
-                                <view>{{item.name}}</view>
-                                <view style="display:flex;justify-content: space-between;padding-right:2upx;">
-                                    <text>¥{{parseFloat(item.price)}}</text>
-                                    <text>剩{{parseFloat(item.stock)}}</text>
+                                <text class="goods-card-name" :key="'gn-' + goodsItemRowKey(item, gridIdx)">{{ item.name }}</text>
+                                <view class="goods-card-meta">
+                                    <text>¥{{ parseFloat(item.price) }}</text>
+                                    <text>剩{{ parseFloat(item.stock) }}</text>
                                 </view>
                                 </view>
                             </view>
                             </view>
                         </view>
                         </view>
@@ -110,6 +120,12 @@ export default {
         }
         }
     },
     },
     methods:{
     methods:{
+        /** 与 ghsPad 一致:稳定行 key,减轻 App 端名图不同步 */
+        goodsItemRowKey(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-gd-${id}-${prop}-${index}`
+        },
         addToClear(){
         addToClear(){
             this.$msg('请扫码打开')
             this.$msg('请扫码打开')
         },
         },
@@ -245,8 +261,7 @@ export default {
                     }
                     }
                     .shop-info_price {
                     .shop-info_price {
                         position: absolute;
                         position: absolute;
-                        background-color: #000000;
-                        opacity: 0.6;
+                        background-color: rgba(0, 0, 0, 0.6);
                         bottom: 0;
                         bottom: 0;
                         left: 0;
                         left: 0;
                         width: 100%;
                         width: 100%;
@@ -256,14 +271,18 @@ export default {
                         box-sizing: border-box;
                         box-sizing: border-box;
                         z-index: 10;
                         z-index: 10;
                         & > view {
                         & > view {
-                            & > view:nth-child(1) {
+                            & > .goods-card-name {
+                                display: block;
                                 overflow: hidden;
                                 overflow: hidden;
                                 text-overflow: ellipsis;
                                 text-overflow: ellipsis;
                                 white-space: nowrap;
                                 white-space: nowrap;
                                 width: 90%;
                                 width: 90%;
                                 font-size: 9upx;
                                 font-size: 9upx;
                             }
                             }
-                            & > view:nth-child(2) {
+                            & > .goods-card-meta {
+                                display: flex;
+                                justify-content: space-between;
+                                padding-right: 2upx;
                                 font-size: 7upx;
                                 font-size: 7upx;
                             }
                             }
                         }
                         }

+ 39 - 13
hdPad/src/pages/home/components/rightItem.vue

@@ -25,15 +25,31 @@
             <view v-if="filteredItemList.length === 0" class="no-data-tip">
             <view v-if="filteredItemList.length === 0" class="no-data-tip">
                 <text>{{ searchKeyword ? '未找到相关花材' : '暂无花材' }}</text>
                 <text>{{ searchKeyword ? '未找到相关花材' : '暂无花材' }}</text>
             </view>
             </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)">
                 <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 class="shop-info_price">
                         <view>
                         <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>
                         </view>
                     </view>
                     </view>
@@ -152,6 +168,12 @@ export default {
         }
         }
     },
     },
     methods:{
     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(){
         addToClear(){
             this.$msg('请扫码打开')
             this.$msg('请扫码打开')
         },
         },
@@ -250,8 +272,8 @@ export default {
                 }
                 }
                 .shop-info_price {
                 .shop-info_price {
                     position: absolute;
                     position: absolute;
-                    background-color: #000000;
-                    opacity: 0.6;
+                    /* 避免父级 opacity 在老安卓 WebView 上与文字合成异常;用纯色透明底 */
+                    background-color: rgba(0, 0, 0, 0.6);
                     bottom: 0;
                     bottom: 0;
                     left: 0;
                     left: 0;
                     width: 100%;
                     width: 100%;
@@ -261,14 +283,18 @@ export default {
                     box-sizing: border-box;
                     box-sizing: border-box;
                     z-index: 10;
                     z-index: 10;
                     & > view {
                     & > view {
-                        & > view:nth-child(1) {
+                        & > .flower-card-name {
+                            display: block;
                             overflow: hidden;
                             overflow: hidden;
                             white-space: nowrap;
                             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;
                         }
                         }
                     }
                     }
                 }
                 }