shish 2 месяцев назад
Родитель
Сommit
f70354dc08

+ 34 - 1
hdPad/src/pages/home/components/console.vue

@@ -116,6 +116,9 @@ import productMins from "@/mixins/product"
 import selectPrice from './selectPrice'
 import selectPrice from './selectPrice'
 import selectNumPrice from './selectNumPrice'
 import selectNumPrice from './selectNumPrice'
 import { partItem } from '@/api/part'
 import { partItem } from '@/api/part'
+
+/** 计算器置顶:须与 selectPrice.vue 中 GATHERING_PIN_TOP_STORAGE_KEY 一致 */
+const GATHERING_PIN_TOP_STORAGE_KEY = 'hdPad_selectPrice_gatheringPinTop'
 // #ifdef APP-PLUS
 // #ifdef APP-PLUS
 let sunmiCashboxPlugin = uni.requireNativePlugin('Tellsea-SunmiCashboxPlugin')
 let sunmiCashboxPlugin = uni.requireNativePlugin('Tellsea-SunmiCashboxPlugin')
 // #endif
 // #endif
@@ -202,11 +205,38 @@ export default {
 		this.refreshHandOrderList()
 		this.refreshHandOrderList()
 	},
 	},
 	mounted(){
 	mounted(){
-
+		this.$nextTick(() => {
+			this.reopenGatheringIfPinned()
+		})
+	},
+	activated() {
+		this.$nextTick(() => {
+			this.reopenGatheringIfPinned()
+		})
 	},
 	},
 	destroyed(){
 	destroyed(){
 	},
 	},
     methods:{
     methods:{
+		_isGatheringPinnedInStorage() {
+			try {
+				const v = uni.getStorageSync(GATHERING_PIN_TOP_STORAGE_KEY)
+				return v === true || v === 1 || v === '1' || String(v) === 'true'
+			} catch (e) {
+				return false
+			}
+		},
+		/** 置顶开启时重新打开计算器弹层(不改变 storage) */
+		reopenGatheringIfPinned() {
+			if (!this._isGatheringPinnedInStorage()) {
+				return
+			}
+			this.$nextTick(() => {
+				const pop = this.$refs.gatheringRef
+				if (pop && typeof pop.open === 'function') {
+					pop.open('center')
+				}
+			})
+		},
 		openHandOrderPop(){
 		openHandOrderPop(){
 			this.$util.hitVoice()
 			this.$util.hitVoice()
 			this.refreshHandOrderList()
 			this.refreshHandOrderList()
@@ -352,6 +382,7 @@ export default {
 					}else{
 					}else{
 						this.$refs.gatheringRef.close()
 						this.$refs.gatheringRef.close()
 						uni.showToast({title: '操作成功' })
 						uni.showToast({title: '操作成功' })
+						this.reopenGatheringIfPinned()
 					}
 					}
 					if(params.cash && parseFloat(params.cash)>0){
 					if(params.cash && parseFloat(params.cash)>0){
 						this.openBox()
 						this.openBox()
@@ -371,6 +402,7 @@ export default {
 			this.customName=''
 			this.customName=''
 			//开单完成之后更新花材库存
 			//开单完成之后更新花材库存
 			this.$emit('updateRightItem')
 			this.$emit('updateRightItem')
+			this.reopenGatheringIfPinned()
 		},
 		},
 		calcFn(){
 		calcFn(){
 			this.$util.hitVoice()
 			this.$util.hitVoice()
@@ -420,6 +452,7 @@ export default {
 		cancelPay(){
 		cancelPay(){
 			this.$util.hitVoice()
 			this.$util.hitVoice()
 			this.$refs.toPayRef.close()
 			this.$refs.toPayRef.close()
+			this.reopenGatheringIfPinned()
 		},
 		},
 		cancelSettle(){
 		cancelSettle(){
 			this.$util.hitVoice()
 			this.$util.hitVoice()

+ 0 - 1
hdPad/src/pages/home/components/customerList.vue

@@ -18,7 +18,6 @@
             </view>
             </view>
         
         
             <view @click="confirmCustom(item)" class="user-list-item_box" v-for="(item) in currentCustomList" :key="item.id">
             <view @click="confirmCustom(item)" class="user-list-item_box" v-for="(item) in currentCustomList" :key="item.id">
-              <view class="vip-tag" v-if="Number(item.vip) === 1">VIP</view>
               <view class="head-box">
               <view class="head-box">
                 <view class="name">{{item.name}}</view>
                 <view class="name">{{item.name}}</view>
                 <view class="balance" v-if="Number(item.balance)>0">{{item.balance?parseFloat(item.balance):0}}</view>
                 <view class="balance" v-if="Number(item.balance)>0">{{item.balance?parseFloat(item.balance):0}}</view>

+ 71 - 1
hdPad/src/pages/home/components/selectPrice.vue

@@ -37,7 +37,15 @@
                             <text class="calc-discount-label">{{ formatDiscountZheLabel(discountZhe) }}后</text>
                             <text class="calc-discount-label">{{ formatDiscountZheLabel(discountZhe) }}后</text>
                             <text class="calc-discount-val">{{ formatMoney(stackDiscountedAmount) }}</text>
                             <text class="calc-discount-val">{{ formatMoney(stackDiscountedAmount) }}</text>
                         </view>
                         </view>
+                        <view
+                            class="gather-pin-entry"
+                            :class="{ 'gather-pin-entry--on': gatheringPinTop }"
+                            @tap.stop="toggleGatheringPin"
+                            hover-class="gather-pin-entry--hover"
+                        >
+                            <view class="iconfont iconzhiding gather-pin-entry__icon"></view>
                         </view>
                         </view>
+                    </view>
 
 
                     <view class="rcv-pay-block">
                     <view class="rcv-pay-block">
                         <view class="rcv-pay-title">收款方式</view>
                         <view class="rcv-pay-title">收款方式</view>
@@ -228,6 +236,8 @@
 const CALC_HISTORY_STORAGE_KEY = 'hdPad_selectPrice_calcHistory'
 const CALC_HISTORY_STORAGE_KEY = 'hdPad_selectPrice_calcHistory'
 const DISCOUNT_CUSTOM_STORAGE_KEY = 'hdPad_selectPrice_customDiscountZhe'
 const DISCOUNT_CUSTOM_STORAGE_KEY = 'hdPad_selectPrice_customDiscountZhe'
 const DISCOUNT_SELECTED_STORAGE_KEY = 'hdPad_selectPrice_discountZhe'
 const DISCOUNT_SELECTED_STORAGE_KEY = 'hdPad_selectPrice_discountZhe'
+/** 计算器弹层置顶:须在 console.vue 中使用同名常量 */
+const GATHERING_PIN_TOP_STORAGE_KEY = 'hdPad_selectPrice_gatheringPinTop'
 export default {
 export default {
     name: 'selectPrice',
     name: 'selectPrice',
     props: {
     props: {
@@ -276,7 +286,9 @@ export default {
                 { name: '线下支付宝', id: 1 },
                 { name: '线下支付宝', id: 1 },
                 { name: '现金', id: 4 },
                 { name: '现金', id: 4 },
                 { name: '银行卡', id: 5 }
                 { name: '银行卡', id: 5 }
-            ]
+            ],
+            /** 计算器置顶:persist 见 GATHERING_PIN_TOP_STORAGE_KEY */
+            gatheringPinTop: false
         }
         }
     },
     },
     computed: {
     computed: {
@@ -341,8 +353,33 @@ export default {
     mounted() {
     mounted() {
         this.loadCalcHistoryFromStorage()
         this.loadCalcHistoryFromStorage()
         this.loadDiscountFromStorage()
         this.loadDiscountFromStorage()
+        this.loadGatheringPinFromStorage()
     },
     },
     methods: {
     methods: {
+        loadGatheringPinFromStorage() {
+            try {
+                const v = uni.getStorageSync(GATHERING_PIN_TOP_STORAGE_KEY)
+                this.gatheringPinTop = v === true || v === 1 || v === '1' || String(v) === 'true'
+            } catch (e) {
+                this.gatheringPinTop = false
+            }
+        },
+        persistGatheringPinTop() {
+            try {
+                if (this.gatheringPinTop) {
+                    uni.setStorageSync(GATHERING_PIN_TOP_STORAGE_KEY, '1')
+                } else {
+                    uni.removeStorageSync(GATHERING_PIN_TOP_STORAGE_KEY)
+                }
+            } catch (e) {
+                console.warn('[selectPrice] persistGatheringPinTop', e)
+            }
+        },
+        toggleGatheringPin() {
+            this.tapVoice()
+            this.gatheringPinTop = !this.gatheringPinTop
+            this.persistGatheringPinTop()
+        },
         loadCalcHistoryFromStorage() {
         loadCalcHistoryFromStorage() {
             try {
             try {
                 const raw = uni.getStorageSync(CALC_HISTORY_STORAGE_KEY)
                 const raw = uni.getStorageSync(CALC_HISTORY_STORAGE_KEY)
@@ -1426,9 +1463,11 @@ export default {
         opacity: 0.9;
         opacity: 0.9;
     }
     }
     .calc-section {
     .calc-section {
+        position: relative;
         border: 1upx solid #eeeeee;
         border: 1upx solid #eeeeee;
         border-radius: 6upx;
         border-radius: 6upx;
         padding: 10upx;
         padding: 10upx;
+        padding-bottom: 52upx;
         margin-top: 0;
         margin-top: 0;
         margin-bottom: 10upx;
         margin-bottom: 10upx;
         &.calc-section-active {
         &.calc-section-active {
@@ -1436,6 +1475,37 @@ export default {
             background: #f8fff8;
             background: #f8fff8;
         }
         }
     }
     }
+    .gather-pin-entry {
+        position: absolute;
+        left: 8upx;
+        bottom: 8upx;
+        z-index: 2;
+        width: 40upx;
+        height: 40upx;
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+        justify-content: center;
+        border-radius: 8upx;
+        background: rgba(250, 250, 250, 0.98);
+        border: 1upx solid #dddddd;
+        box-sizing: border-box;
+    }
+    .gather-pin-entry--on {
+        border-color: #09c567;
+        background: rgba(240, 255, 245, 0.95);
+    }
+    .gather-pin-entry--hover {
+        opacity: 0.85;
+    }
+    .gather-pin-entry__icon {
+        font-size: 20upx;
+        color: #999999;
+        line-height: 1;
+    }
+    .gather-pin-entry--on .gather-pin-entry__icon {
+        color: #09c567;
+    }
     .calc-title {
     .calc-title {
         text-align: center;
         text-align: center;
         font-size: 13upx;
         font-size: 13upx;