Browse Source

基本完成

fuwei 4 years ago
parent
commit
e2ea4c7534

+ 0 - 1
ghsPad/src/admin/home/components/select-settle.vue

@@ -62,7 +62,6 @@
             <view class="keyboard-body_box">
                 <VKeyboard
                     ref="keyboard" 
-                    :pointIsShow="false" 
                     :digital="true" 
                     :disorderly="false" 
                     @typing="typing" 

+ 48 - 25
ghsPad/src/admin/home/workbench.vue

@@ -108,6 +108,14 @@
 			>
 			<selectSettle @settleReturn="settleReturn" ref="selectSettle" :totalShop="totalShop"></selectSettle>
 		</uniPopup>
+		<uniPopup
+			:show.sync="isShowCollectMoney"
+			type="top"
+			maxHeight="90vh"
+			>
+			<collectMoney @cancel="isShowCollectMoney=false" @collectMoneyBack="collectMoneyBack"></collectMoney>
+			<!-- <selectSettle @settleReturn="settleReturn" ref="selectSettle" :totalShop="totalShop"></selectSettle> -->
+		</uniPopup>
 		<NotLogin></NotLogin>
 	</view>
 </template>
@@ -121,16 +129,26 @@ import keyboardSetFlower from '@/components/app-boardSet-flower.vue'
 import selectSettle from './components/select-settle.vue'
 import selectUser from './components/select-user.vue'
 import shopTypeSelect from './components/shopTypeSelect.vue'
+import collectMoney from '@/components/collect-money.vue'
 import { createCreateOrder, wastageCreateOrder } from '@/api/home/index'
 export default {
 	name: "workbench",
-	components: { NotLogin,uniPopup,selectUser,shopTypeSelect,keyboardSetFlower,selectSettle },
+	components: { 
+		NotLogin,
+		uniPopup,
+		selectUser,
+		shopTypeSelect,
+		keyboardSetFlower,
+		selectSettle,
+		collectMoney 
+		},
 	mixins: [productMins,autoUpdateMixins],
 	data() {
 		return {
 			isShowFllowNum: false,
 			isShowUser: false,
 			isShowSettle: false,
+			isShowCollectMoney: false,
 			shopList:[],
 			currenSelectShop:{},
 			selectItem: {},
@@ -155,30 +173,32 @@ export default {
 	},
 	onShow() {
 	},
+	mounted(){
+	},
 	watch:{
-			shopList(){
-			if(this.$util.isEmpty(this.shopList)) {
-					this.totalShop = {
-							bigUnit: 0,
-							smallUnit:0,
-							totalPrice: 0
-						}
-					}
-				this.totalShop =	this.shopList.reduce((total,val)=>{
-							// 0 大单位 1小单位
-							if(val.unitType === 0) {
-								total.bigUnit = total.bigUnit + (val.currentNum *1)
-							}else {
-								total.smallUnit = total.smallUnit +(1*val.currentNum)
-							}
-								total.totalPrice = total.totalPrice +  (1*val.currentNum) * (val.currentUnitPrice*1)
-							return total
-					},{
+		shopList(){
+		if(this.$util.isEmpty(this.shopList)) {
+				this.totalShop = {
 						bigUnit: 0,
 						smallUnit:0,
 						totalPrice: 0
-					})
-			}
+					}
+				}
+			this.totalShop =	this.shopList.reduce((total,val)=>{
+						// 0 大单位 1小单位
+						if(val.unitType === 0) {
+							total.bigUnit = total.bigUnit + (val.currentNum *1)
+						}else {
+							total.smallUnit = total.smallUnit +(1*val.currentNum)
+						}
+							total.totalPrice = total.totalPrice +  (1*val.currentNum) * (val.currentUnitPrice*1)
+						return total
+				},{
+					bigUnit: 0,
+					smallUnit:0,
+					totalPrice: 0
+				})
+		}
 	},
 	methods: {
 		// 结算创建订单
@@ -205,6 +225,7 @@ export default {
 					remark:''
 				})
 				this.isShowSettle = false
+				this.isShowCollectMoney = true
 				this.$msg('订单创建成功')
 			}catch(err) {
 				console.log(err)
@@ -267,9 +288,8 @@ export default {
 			if(this.$util.isEmpty(this.selectCurrentActiveItem)) {
 					this.$msg('请选择要删除的商品')
 			}
-		let index =	this.shopList.findIndex(i=>this.selectCurrentActiveItem.id === i.id)
-		this.shopList = this.shopList.filter(i=>this.selectCurrentActiveItem.id !== i.id)
-		// this.selectCurrentActiveItem
+			let index =	this.shopList.findIndex(i=>this.selectCurrentActiveItem.id === i.id)
+			this.shopList = this.shopList.filter(i=>this.selectCurrentActiveItem.id !== i.id)
 		},
 		selectItemChange(item){
 		    this.selectItem = {
@@ -277,13 +297,16 @@ export default {
 		        currentUnit:item.bigUnit,
 		        currentUnitPrice:item.property==1?item.bigPrice:item.price,
 		        currentNum: 0,
-										unitType: 0
+				unitType: 0
 		    }
 		    this.isShowFllowNum = true
 		},
 		enterReturn(item){
 			this.isShowFllowNum = false
 			this.shopList.push(item)
+		},
+		collectMoneyBack(price){
+			console.log(price)
 		}
 	}
 };

+ 2 - 2
ghsPad/src/components/app-boardSet-flower.vue

@@ -48,12 +48,12 @@
 
 <script>
     import VKeyboard from '@/components/plugin/vKeyboard/VKeyboard.vue'
-    import keyboardModule from '@/components/keyboard.vue'
+    // import keyboardModule from '@/components/keyboard.vue'
     export default {
         name:'keyboardSetFlower',
         components:{
             VKeyboard,
-            keyboardModule
+            // keyboardModule
         },
         props:{
             selectItem:{

+ 145 - 0
ghsPad/src/components/collect-money.vue

@@ -0,0 +1,145 @@
+<template>
+    <view class="app-collect_money">
+        <template v-if="step===0">
+            <view class="price-box">
+                <view class="title">金额</view>
+                <input  disabled type="text" v-model="price">
+            </view>
+            <view class="keyboard-body_box">
+                <VKeyboard
+                    ref="keyboard"
+                    :digital="true"
+                    :disorderly="false"
+                    @typing="typing"
+                    @enter="enter">
+                </VKeyboard>
+            </view>
+        </template>
+        <template v-else>
+            <view class="collect-code_box">
+                <image
+                    class="img"
+                    src="../static/images/common/business-sale.png"
+                    mode="scaleToFill"
+                />
+                <view class="btn-default result">查询结果</view>
+                <view @click="cancel" class="btn-default">取消</view>
+            </view>
+        </template>
+    </view>
+</template>
+
+<script>
+    import VKeyboard from '@/components/plugin/vKeyboard/VKeyboard.vue'
+    export default {
+        name:'collectMoney',
+        components:{
+            VKeyboard
+        },
+        props:{
+            step:{
+                type:Number,
+                default: 1  // 0 金额 // 付款码
+            }
+        },
+        data(){
+            return {
+                price: 0,
+                
+            }
+        },
+        mounted(){
+            if(this.step === 0) {
+                this.activeKeyboard()
+            }   
+        },
+        methods:{
+            //键盘方法
+			activeKeyboard() {
+				this.$refs.keyboard.activate();
+			},
+            typing(e) {
+				if (e.backspace) {
+					if (this.price.length > 0) {
+						this.price = this.price.substring(0, this.price.length - 1);
+					}
+				}else {
+                    if(this.price == 0|| this.$util.isEmpty(this.price)) {
+                        this.price = e.char
+                    }else {
+                        this.price += e.char;
+                    }
+				}
+			},
+			enter() {
+                this.$emit('collectMoneyBack', this.price)
+			},
+            cancel(){
+                this.$emit('cancel')
+            }
+        },
+        watch:{
+           step(){
+                 if(this.step === 0) {
+                    this.activeKeyboard()
+                }  
+           } 
+        }
+    }
+</script>
+
+<style lang="scss" scoped>
+    .app-collect_money {
+        background-color: #ffffff;
+        margin: 0 auto;
+        border-radius: 5rpx;
+        padding: 10rpx;
+        // overflow: hidden;
+        overflow-y: auto;
+        display: flex;
+        height: 90vh;
+        flex-direction: column;
+        box-sizing: border-box;
+        & .price-box {
+            min-height: 100rpx;
+            & > .title {
+                text-align: center;
+                font-size: 14rpx;
+                padding: 5rpx 0;
+                
+            }
+            & > input {
+                text-align: center;
+                line-height: 40rpx;
+                height: 40rpx;
+                font-size: 14rpx;
+            }
+        }
+        & .keyboard-body_box {
+            flex: 1;
+        }
+        & .collect-code_box {
+            height: 100%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            flex-direction: column;
+            & > .img {
+                width: 100rpx;
+                height: 100rpx;
+            }
+            & .btn-default {
+                height: 40rpx;
+                width: 100rpx;
+                text-align: center;
+                line-height: 40rpx;
+                border: 1px solid #eee;
+                font-size: 14rpx;
+                color: #333333;
+            }
+            & > .result {
+                margin: 30rpx 0;
+            }
+        }
+    }
+</style>