|
|
@@ -8,35 +8,37 @@
|
|
|
<view class="module-com">
|
|
|
<view class="commodity-view">
|
|
|
<view class="commodity-list">
|
|
|
- <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
|
|
|
- <!-- #ifdef APP-PLUS -->
|
|
|
- <image class="item-icon" :src="item.cover" />
|
|
|
- <!-- #endif -->
|
|
|
- <!-- #ifdef MP-WEIXIN -->
|
|
|
- <image class="item-icon" :src="item.cover" />
|
|
|
- <!-- #endif -->
|
|
|
- <view class="item-info">
|
|
|
- <view class="info-line">
|
|
|
- <text class="item-name">{{ item.itemName }}</text>
|
|
|
- <text class="item-price">
|
|
|
- <text class="unit">¥</text>
|
|
|
- <text class="price">{{ parseFloat(item.userPrice)||0 }}</text>
|
|
|
- </text>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view style="text-align:right;">
|
|
|
- <view class="open-bx" >
|
|
|
- <i class="iconfont iconjian" @click="reduceItemFn(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
|
|
|
- <text class="num" @click="showAddModelFn(item)">
|
|
|
- <text v-if="item.bigCount > 0" style="font-size:24upx;font-weight:bold;color:#3385ff;">{{ item.bigCount }}</text>
|
|
|
- <text v-if="item.smallCount > 0" style="font-size:24upx;">{{ item.smallCount }}</text>
|
|
|
+ <template v-if="!$util.isEmpty(selectList)">
|
|
|
+ <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
|
|
|
+ <!-- #ifdef APP-PLUS -->
|
|
|
+ <image class="item-icon" :src="item.cover" />
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <image class="item-icon" :src="item.cover" />
|
|
|
+ <!-- #endif -->
|
|
|
+ <view class="item-info">
|
|
|
+ <view class="info-line">
|
|
|
+ <text class="item-name">{{ item.itemName }}</text>
|
|
|
+ <text class="item-price">
|
|
|
+ <text class="unit">¥</text>
|
|
|
+ <text class="price">{{ parseFloat(item.userPrice)||0 }}</text>
|
|
|
</text>
|
|
|
- <i class="iconfont iconzeng" @click="addItemFn(item)"></i>
|
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
|
+ <view style="text-align:right;">
|
|
|
+ <view class="open-bx" >
|
|
|
+ <i class="iconfont iconjian" @click="reduceItemFn(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
|
|
|
+ <text class="num" @click="showAddModelFn(item)">
|
|
|
+ <text v-if="item.bigCount > 0" style="font-size:24upx;font-weight:bold;color:#3385ff;">{{ item.bigCount }}</text>
|
|
|
+ <text v-if="item.smallCount > 0" style="font-size:24upx;">{{ item.smallCount }}</text>
|
|
|
+ </text>
|
|
|
+ <i class="iconfont iconzeng" @click="addItemFn(item)"></i>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
<view class="summary-bar">
|
|
|
<view class="operate-view" v-if="isScanEnv" @click="removeFromSave(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
|
|
|
@@ -169,6 +171,9 @@
|
|
|
<button class="admin-button-com blue middle" @click="confirmSubmit">提交</button>
|
|
|
</view>
|
|
|
|
|
|
+ <view v-if="isScanEnv" @click="changeGet" style="width:125upx;height:125upx;display:flex;justify-content:center;align-items:center;font-size:60upx;
|
|
|
+ background:#3385ff;color:white;z-index:9999;position:fixed;bottom:140upx;right:30upx;border-radius:60upx;">{{calc=='add'?'+':'-'}}</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -310,6 +315,7 @@ export default {
|
|
|
},
|
|
|
onUnload(){
|
|
|
uni.removeStorageSync('newClient')
|
|
|
+ uni.$off('listenGetScanCode')
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["getMerchantInfo", "getLoginInfo"]),
|
|
|
@@ -323,6 +329,9 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
+ changeGet(){
|
|
|
+ this.calc = this.calc == 'add' ? 'sub' : 'add'
|
|
|
+ },
|
|
|
listenScanItem(){
|
|
|
// #ifdef APP-PLUS
|
|
|
//避免重复,每次进来先移除全局自定义事件监听器
|