shish 1 年之前
父节点
当前提交
48353e5829

+ 10 - 7
ghsPad/src/mixins/product.js

@@ -349,15 +349,18 @@ export default {
 			uni.$on('listenGetScanCode',function(data){
 				that.takeItem(data.code)
 			})
-			this.getAllProduct()
+			//this.getAllProduct()
 			//console.log('000000')
 		},
-		async getAllProduct(){
-			const { data,code } = await allProduct()
-			if(code == 1){
-				this.globalAllProduct = data.list
-				//console.log('异步载入最新花材...')
-			}
+		getAllProduct(){
+			uni.showLoading({mask:false})
+			allProduct().then(res=>{
+				uni.hideLoading()
+				if(res.code == 1){
+					this.globalAllProduct = res.data.list
+					//console.log('载入最新花材...')
+				}
+			})
 		}
 	}
 }

+ 1 - 0
ghsPad/src/pages/home/components/cashConsole.vue

@@ -1,5 +1,6 @@
 <template>
 <view class="button-area">
+	<view class="active" @click="getAllProduct">扫码</view>
 	<view class="active" @click="openBox">开箱</view>
 	<view class="active" style="background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;" @click="beginSettle">批发结算</view>
 	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>

+ 10 - 7
hdPad/src/mixins/product.js

@@ -349,15 +349,18 @@ export default {
 			uni.$on('listenGetScanCode',function(data){
 				that.takeItem(data.code)
 			})
-			that.getAllProduct()
+			//that.getAllProduct()
 			//console.log('111111')
 		},
-		async getAllProduct(){
-			const { data,code } = await allProduct()
-			if(code == 1){
-				this.globalAllProduct = data.list
-				//console.log('异步载入最新花材...')
-			}
+		getAllProduct(){
+			uni.showLoading({mask:false})
+			allProduct().then(res=>{
+				uni.hideLoading()
+				if(res.code == 1){
+					this.globalAllProduct = res.data.list
+					//console.log('载入最新花材...')
+				}
+			})
 		}
 	}
 }

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

@@ -8,9 +8,8 @@
 	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #09C567;" @click="getHandOrder()" v-else>取单</view>
     <view class="active" @click="toWastage">报损</view>
 	<view class="active" @click="selectCustom()">选客</view>
+	<view class="active" @click="getAllProduct()">扫码</view>
     <view class="active" @click="clearItemFn">清空</view>
-	<view class="active" @click="logoutFn">退出</view>
-	<view class="active" @click="closeFn">关闭</view>
 
 	<view v-if="Number(customId)>0" style="position:fixed;left:32upx;bottom:66upx;width:189upx;height:20upx;line-height:5upx;font-size:13upx;background-color:white;color:#09C567;font-weight:bold;border:none;">{{customName}}</view>
 
@@ -130,21 +129,6 @@ export default {
 			this.$util.hitVoice()
 			this.$util.pageTo({url:'/pages/home/selectCustom'})
 		},
-		closeFn(){
-			// #ifdef APP-PLUS
-			let that = this
-			let type = uni.getSystemInfoSync().platform
-			switch(type){
-			case 'android':
-				plus.runtime.quit()
-				break;
-			case 'ios':
-				that.$msg('IOS暂不支持关闭')
-				break;
-			default:
-			}
-			// #endif
-		},
         addToClear(){
 			let params = {
                 hasPay: 0,
@@ -358,10 +342,6 @@ export default {
 			plus.runtime.restart()
 			// #endif
 		},
-		logoutFn(){
-			this.$util.hitVoice()
-			this.$refs.logoutRef.open()
-		},
 		delSelectItem(){
 			this.$util.hitVoice()
 		}

+ 35 - 2
hdPad/src/pages/home/components/nav.vue

@@ -34,7 +34,9 @@ export default {
         { name: "拆散", page: "/pages/home/make",flag:'selItem' },
         { name: "美团", page: "/pages/home/mt",flag:'mt' },
         { name: "散花", page: "/pages/home/sh",flag:'sh' },
-        { name: "现金", page: "/pages/home/xj",flag:'xh' }
+        { name: "现金", page: "/pages/home/xj",flag:'xh' },
+        { name: "退出", page: "/pages/home/logout",flag:'logout'},
+        { name: "关闭", page: "/pages/home/close",flag:'close'},
       ],
       device:''
     };
@@ -80,7 +82,38 @@ export default {
 		},
     goTo(item) {
       this.$util.hitVoice()
-      this.$util.pageTo({ url: item.page, type: 2 })
+
+      if(item.flag == 'close'){
+        // #ifdef APP-PLUS
+        let type = uni.getSystemInfoSync().platform
+        switch(type){
+          case 'android':
+            plus.runtime.quit()
+            break;
+          case 'ios':
+            that.$msg('IOS暂不支持关闭')
+            break;
+          default:
+        }
+        // #endif
+      }else if(item.flag == 'logout'){
+        this.$util.hitVoice()
+        uni.showModal({
+          title: '提示',
+          content: '确认退出?',
+          success: function (res){
+            if (res.confirm){ 
+              uni.clearStorage()
+              that.$store.commit("setLoginInfo", {})
+              // #ifdef APP-PLUS
+              plus.runtime.restart()
+              // #endif            
+            }
+          }
+        })
+      }else{
+        this.$util.pageTo({ url: item.page, type: 2 })
+      }
     },
   },
 };