shish 4 лет назад
Родитель
Сommit
07c7558c21
2 измененных файлов с 37 добавлено и 5 удалено
  1. 6 2
      hdPad/src/pages/home/components/console.vue
  2. 31 3
      hdPad/src/pages/home/components/selectPrice.vue

+ 6 - 2
hdPad/src/pages/home/components/console.vue

@@ -141,12 +141,16 @@ export default {
 		confirmSelectPrice(params){
 		confirmSelectPrice(params){
 			uni.showLoading({mask:true})
 			uni.showLoading({mask:true})
 			//isCashier=1时收银台播放 总金额139元,请扫码付款
 			//isCashier=1时收银台播放 总金额139元,请扫码付款
-			createOrder({orderName:params.name,lsGoodsPrice:params.price,modifyPrice:params.price,isCashier:1}).then(res=>{
+			createOrder({orderName:params.name,lsGoodsPrice:params.price,modifyPrice:params.price,isCashier:1,hasPay:params.hasPay,payWay:params.payWay}).then(res=>{
 				uni.hideLoading()
 				uni.hideLoading()
 				if(res.code == 1){
 				if(res.code == 1){
+					if(res.data.status == 1){
+						this.$refs.toPayRef.open('center')
+					}else{
+						uni.showToast({title: '操作成功' })
+					}
 					this.$refs.gatheringRef.close()
 					this.$refs.gatheringRef.close()
 					this.orderId = res.data.id
 					this.orderId = res.data.id
-					this.$refs.toPayRef.open('center')
 				}
 				}
 			})
 			})
 		},
 		},

+ 31 - 3
hdPad/src/pages/home/components/selectPrice.vue

@@ -12,6 +12,11 @@
             </view>
             </view>
             <input class="goods-name" v-model="name" placeholder="商品名称(选填)" placeholder-class="grey-color" />
             <input class="goods-name" v-model="name" placeholder="商品名称(选填)" placeholder-class="grey-color" />
 
 
+            <view class="pay-style">
+                <button :class="[hasPay===0?'selected':'']" @click="changeWay(0)">扫码</button>
+                <button :class="[hasPay===1?'selected':'']" @click="changeWay(1)">现金</button>
+            </view>
+
         </view>
         </view>
         <view class="keyboard-body_box">
         <view class="keyboard-body_box">
          <VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancel"> </VKeyboard>
          <VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancel"> </VKeyboard>
@@ -28,13 +33,18 @@ export default {
             price:0,
             price:0,
             //0未全选 1全选
             //0未全选 1全选
             checkType:1,
             checkType:1,
-            name:''
+            name:'',
+            hasPay:0,
+            payWay:4
         };
         };
     },
     },
     mounted(){
     mounted(){
         this.activeKeyboard()
         this.activeKeyboard()
     },
     },
     methods: {
     methods: {
+        changeWay(val){
+            this.hasPay = val
+        },
         checkCurrent(n){
         checkCurrent(n){
             this.checkType = 1
             this.checkType = 1
         },
         },
@@ -68,18 +78,36 @@ export default {
                 this.$msg('请填写金额')
                 this.$msg('请填写金额')
                 return
                 return
             }
             }
-            this.$emit('confirmSelectPrice', {price:this.price,name:this.name})
+            this.$emit('confirmSelectPrice', {price:this.price,name:this.name,hasPay:this.hasPay,payWay:this.payWay})
         }
         }
     }
     }
 }
 }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+.pay-style{
+    text-align:center;
+    margin-top:10upx;
+    button {
+        width:80upx;
+        height:30upx;
+        font-size:12upx;
+        display:inline-block;
+        color:#777575;
+    }
+    button:first-child{
+        margin-right:8upx;
+    }
+    .selected{
+        color:#3385FF;
+        border:1upx solid #3385FF;
+    }
+}
 .grey-color{
 .grey-color{
     color:#d1cfcf;
     color:#d1cfcf;
 }
 }
 .boardset-flowert {
 .boardset-flowert {
     width:34vw;
     width:34vw;
-    height: 80vh;
+    height: 90vh;
     background-color: #ffffff;
     background-color: #ffffff;
     margin: 0 auto;
     margin: 0 auto;
     border-radius: 5upx;
     border-radius: 5upx;