Procházet zdrojové kódy

1. npm run dev:h5 报错解决
2. 花掌柜与花掌柜收银的客户列表添加 vip 菜单选项(当开启充值多少成为VIP时才显示)
3. 花掌柜收银代码优化与个别api重复请求修复

shizhongqi před 3 měsíci
rodič
revize
4e15f41ec0

+ 1 - 1
ghsApp/babel.config.js

@@ -47,7 +47,7 @@ module.exports = {
 		[
 			"@vue/app",
 			{
-				modules: "commonjs",
+				modules: process.env.UNI_PLATFORM === "h5" ? "auto" : "commonjs",
 				useBuiltIns: process.env.UNI_PLATFORM === "h5" ? "usage" : "entry"
 			}
 		]

+ 1 - 1
ghsPad/babel.config.js

@@ -47,7 +47,7 @@ module.exports = {
 		[
 			"@vue/app",
 			{
-				modules: "commonjs",
+				modules: process.env.UNI_PLATFORM === "h5" ? "auto" : "commonjs",
 				useBuiltIns: process.env.UNI_PLATFORM === "h5" ? "usage" : "entry"
 			}
 		]

+ 1 - 1
hdApp/babel.config.js

@@ -47,7 +47,7 @@ module.exports = {
 		[
 			"@vue/app",
 			{
-				modules: "commonjs",
+				modules: process.env.UNI_PLATFORM === "h5" ? "auto" : "commonjs",
 				useBuiltIns: process.env.UNI_PLATFORM === "h5" ? "usage" : "entry"
 			}
 		]

+ 1 - 1
hdApp/src/admin/hb/list.vue

@@ -121,8 +121,8 @@ export default {
     getHbList() {
       let status = this.tabs[this.tabIndex].status
       return hbList({ status: status, page: this.list.page, limit: this.list.pageSize, customId: this.customId }).then((res) => {
+        this.completes(res)
         for(let i = 0; i < this.tabs.length; i++){
-          this.completes(res)
           if(i == 0){
             this.tabs[i].value = Number(res.data.all) || 0
           }else if(i == 1){

+ 48 - 37
hdApp/src/admin/home/login.vue

@@ -19,10 +19,22 @@
 						<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
 					</view>
 				</template>
+				<view v-if="showAccountLogin" style="color:#999999;font-size:25upx;margin-top:60upx;">
+					<checkbox-group @change="agreeItem">
+						<label style="display:flex;align-items:center;justify-content:center;">
+							<checkbox value="1" style="transform:scale(0.8)" :checked="agree == 1" />
+							<text>
+								我已阅读并同意
+								<text style="font-weight:bold;color:#666666;" @click.stop="goToService">《服务协议》</text>
+								和
+								<text style="font-weight:bold;color:#666666;" @click.stop="goToPrivacy">《隐私政策》</text>
+							</text>
+						</label>
+					</checkbox-group>
+				</view>
 
 				<!-- #ifdef MP-WEIXIN -->
-				<view style="margin-top:55upx;" v-if="showAccountLogin==false">
-
+				<view v-if="showAccountLogin==false" style="margin-top:55upx;">
 					<view style="color:black;font-size:28upx;margin-top:30upx;">这是花店管理后台,需获取你的手机号登录后</view>
 					<view style="color:black;font-size:28upx;margin-top:15upx;">才能使用相应功能,请谅解</view>
 					<view style="color:black;font-size:28upx;margin-top:15upx;margin-bottom:30upx;">如不需要,可以点击<text style="color:#3385FF;font-size:36upx;font-weight:bold;margin-left:8upx;" @click="goBack()">拒绝使用</text></view>
@@ -31,29 +43,18 @@
 				open-type="getPhoneNumber" @getphonenumber="wxPhoneLogin">手机号一键登录</button>
 				</view>
 				<!-- #endif -->
+
 				<!-- #ifdef APP-PLUS -->
-				<view style="margin-top:55upx;" v-if="showAccountLogin==false">
+				<view v-if="showAccountLogin==false" style="margin-top:55upx;">
 					<button class="admin-button-com small blue buttonText" @click="mobileLogin">本机号码一键登录</button>
 				</view>
 				<!-- #endif -->
-				<view style="color:#999999;font-size:25upx;margin-top:60upx;" v-if="showAccountLogin">
-					<checkbox-group @change="agreeItem">
-						<label style="display:flex;align-items:center;justify-content:center;">
-							<checkbox value="1" style="transform:scale(0.8)" :checked="agree == 1" />
-							<text>
-								我已阅读并同意
-								<text style="font-weight:bold;color:#666666;" @click.stop="goToService">《服务协议》</text>
-								和
-								<text style="font-weight:bold;color:#666666;" @click.stop="goToPrivacy">《隐私政策》</text>
-							</text>
-						</label>
-					</checkbox-group>
-				</view>
-				<view style="margin-top:45upx;color:#848181;font-size:38upx;width:100%;text-align:right;padding-right:70upx;" v-if="showAccountLogin==false">
+
+				<view v-if="showAccountLogin==false" style="margin-top:45upx;color:#848181;font-size:38upx;width:100%;text-align:right;padding-right:70upx;">
 					<text style="margin-right:40upx;" @click="useAccount()">使用账号密码登录</text>
 					<text @click="register">注册账号</text>
 				</view>
-				<view style="margin-top:45upx;color:#848181;font-size:38upx;width:100%;text-align:right;padding-right:70upx;" v-else>
+				<view v-else style="margin-top:45upx;color:#848181;font-size:38upx;width:100%;text-align:right;padding-right:70upx;">
 					<text style="margin-right:40upx;" @click="useMoibleAccount()">使用手机号登录</text>
 					<text @click="register">注册账号</text>
 				</view>
@@ -72,9 +73,6 @@ import { phoneLogin,wxMobileLogin } from "@/api/auth";
 import { ghsInfo } from "@/api/ghs/index";
 export default {
 	name: "login",
-	components: {
-
-	},
 	mixins: [],
 	data() {
 		return {
@@ -84,8 +82,6 @@ export default {
 			showAccountLogin:false
 		};
 	},
-	computed: {
-	},
 	onLoad(){
 		let that = this
 		uni.getNetworkType({
@@ -157,6 +153,7 @@ export default {
 			}else{
 				this.agree = 1
 
+				// #ifdef APP-PLUS
 				//获取设备ID,并保存到storage
 				console.log('GlobalMixins -- 获取设备ID');
 				const systemInfo = uni.getSystemInfoSync();
@@ -168,6 +165,7 @@ export default {
 					this.androidGetOAID()
 				}
 				console.log('GlobalMixins -- 获取设备ID 结束');
+				// #endif
 			}
 		},
 		// 检查并提示用户阅读协议
@@ -243,15 +241,14 @@ export default {
 						if(subRes.data && subRes.data.hasNoOpenId && subRes.data.hasNoOpenId == 1){
 							that.$util.confirmModal({content:'网络异常,请刷新重试'},() => {
 
-								// #ifdef MP-WEIXIN
 								uni.clearStorage()
 								that.$store.commit("setLoginInfo", {})
+
+								// #ifdef MP-WEIXIN
 								that.$util.pageTo({url: "/admin/home/workbench",type: 3})
 								// #endif
 
 								// #ifdef APP-PLUS
-								uni.clearStorage()
-								that.$store.commit("setLoginInfo", {})
 								plus.runtime.restart()
 								// #endif
 
@@ -298,10 +295,13 @@ export default {
 								//返回上一页带参数
 								let pages = getCurrentPages();
 								let prevPage = pages[ pages.length - 2 ];
-								//修改上一页data里面的xjData
-								prevPage.$vm.backAction = 'login'
-
-							uni.navigateBack()
+								if (prevPage && prevPage.$vm) {
+									prevPage.$vm.backAction = 'login'
+									uni.navigateBack()
+								} else {
+									// H5 直接访问登录页,没有上一页,回首页
+									uni.reLaunch({ url: '/admin/home/workbench' })
+								}
 						}
 					}
 				});
@@ -371,9 +371,13 @@ export default {
 										//返回上一页带参数
 										let pages = getCurrentPages();
 										let prevPage = pages[ pages.length - 2 ];
-										//修改上一页data里面的xjData
-										prevPage.$vm.backAction = 'login'
-										uni.navigateBack()
+										if (prevPage && prevPage.$vm) {
+											prevPage.$vm.backAction = 'login'
+											uni.navigateBack()
+										} else {
+											// H5 直接访问登录页,没有上一页,回首页
+											uni.reLaunch({ url: '/admin/home/workbench' })
+										}
 
 										// #ifdef APP-PLUS
 										//保存安卓的clientId
@@ -450,6 +454,9 @@ export default {
 
 						uni.setStorageSync('token', subRes.data.token)
 						uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
+						uni.setStorageSync('reachVip', subRes.data.reachVip)
+						that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+
 						getDictionaries({ token: subRes.data.token }).then(res => {
 							if (that.$util.isEmpty(res)) {
 								return false
@@ -457,16 +464,20 @@ export default {
 							that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
 							that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
 						})
-						that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+
 						getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
 						that.setUserShopAll()
 
 						//返回上一页带参数
 						let pages = getCurrentPages();
 						let prevPage = pages[ pages.length - 2 ];
-						//修改上一页data里面的xjData
-						prevPage.$vm.backAction = 'login'
-						uni.navigateBack()
+						if (prevPage && prevPage.$vm) {
+							prevPage.$vm.backAction = 'login'
+							uni.navigateBack()
+						} else {
+							// H5 直接访问登录页,没有上一页,回首页
+							uni.reLaunch({ url: '/admin/home/workbench' })
+						}
 
 						// #ifdef APP-PLUS
 						//保存安卓的clientId

+ 3 - 2
hdApp/src/admin/home/mall.vue

@@ -442,7 +442,7 @@ export default {
           this.overview = res.data.overview
         }
       })
-      this.showShopName()
+      //this.showShopName() //多余
       this.getUnReadMsgCount()
     },
     getMallData(){
@@ -512,12 +512,13 @@ export default {
 		showShopName(){
 			currentShop().then(res => {
 				if(res.code == 1){
-          this.shopInfo = res.data?res.data:[]
+          this.shopInfo = res.data ? res.data : []
           if(this.shopInfo.avatar) {
             uni.setStorageSync('shopAvatar', this.shopInfo.avatar);
           }else{
             uni.setStorageSync('shopAvatar', '');
           }
+          uni.setStorageSync('reachVip', res.data.reachVip) //记录是否开启VIP
 				}
 			})
 		},

+ 32 - 3
hdApp/src/admin/home/member.vue

@@ -2,7 +2,7 @@
   <view class="app-main app-content">
 
     <view class="input-wrap_box">
-      <button class="admin-button-com middle blue" @click="changeSearchStyle()">{{ searchStyle==0?'尾号':'名称' }}</button>
+      <button class="admin-button-com middle" @click="changeSearchStyle()">{{ searchStyle==0?'尾号':'名称' }}<i class="iconfont iconsanjiao_xia"></i></button>
       <view class="search-container">
         <AppSearchModule placeholder="这里搜索" v-model="searchText" @input="searchFn"/>
       </view>
@@ -39,8 +39,13 @@
                     <view class="visit-time">
                       {{item.visitTime.substr(5,11)}}
 
-                      <text v-if="Number(item.balance) > 0" class="positive">余额{{ parseFloat(item.balance) }}</text>
-                      <text v-if="Number(item.balance) < 0" class="negative">-{{ parseFloat(Math.abs(item.balance)) }}</text>
+                      <block v-if="tabs[tabIndex].type != 1">
+                        <text v-if="Number(item.balance) > 0" class="positive">余额{{ parseFloat(item.balance) }}</text>
+                        <text v-if="Number(item.balance) < 0" class="negative">-{{ parseFloat(Math.abs(item.balance)) }}</text>
+                      </block>
+                      <block v-else>
+                        <text class="positive">消费{{ parseFloat(item.buyAmount) }}</text>
+                      </block>
 
                       <block v-if="item.passStatus == 1">
                         <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 10000" style="margin-left:20upx;color:green;">没有下过</text>
@@ -143,6 +148,14 @@ export default {
       uni.stopPullDownRefresh();
     }
   },
+  onShow() {
+    const reachVip = uni.getStorageSync('reachVip')
+    console.log(reachVip)
+    if (this.tabs.length < 6 && reachVip != "-1.00") {
+      // tabs 第二位加上 {name: 'VIP', value: 1, type: 5}
+      this.tabs.splice(1, 0, {name: 'VIP', value: 0, type: 5})
+    }
+  },
   methods: {
     changeSearchStyle(){
       this.searchStyle = this.searchStyle == 0 ? 1 : 0
@@ -187,6 +200,22 @@ export default {
       return getList({page:this.list.page,type:this.customType,searchText:this.searchText,searchStyle:this.searchStyle }).then(res => {
         if(res.code == 1){
           this.completes(res)
+          
+          for(let i = 0; i < this.tabs.length; i++){
+            if(this.tabs[i].type == 0){
+              this.tabs[i].value = Number(res.data.all) || 0
+            }else if(this.tabs[i].type == 1){
+              this.tabs[i].value = Number(res.data.balance) || 0
+            }else if(this.tabs[i].type == 2){
+              this.tabs[i].value = Number(res.data.buyAmount) || 0
+            }else if(this.tabs[i].type == 3){
+              this.tabs[i].value = Number(res.data.birth) || 0
+            }else if(this.tabs[i].type == 4){
+              this.tabs[i].value = Number(res.data.deleted) || 0
+            }else if(this.tabs[i].type == 5){
+              this.tabs[i].value = Number(res.data.vip) || 0
+            }
+          }
         }
       })
     }

+ 0 - 2
hdApp/src/admin/home/workbench.vue

@@ -745,8 +745,6 @@
           align-items: center;
           justify-content: center;
           display: flex;
-          // background: rgba(255,255,255,0.15);
-          // border: 1upx solid rgba(255,255,255,0.35);
         }
       }
       .function-grid--overlay {

+ 1 - 1
hdPad/babel.config.js

@@ -47,7 +47,7 @@ module.exports = {
 		[
 			"@vue/app",
 			{
-				modules: "commonjs",
+				modules: process.env.UNI_PLATFORM === "h5" ? "auto" : "commonjs",
 				useBuiltIns: process.env.UNI_PLATFORM === "h5" ? "usage" : "entry"
 			}
 		]

+ 4 - 2
hdPad/src/mixins/globalMixins.js

@@ -71,13 +71,15 @@ export default {
           if(subRes.code != 1){
             return
           }
+
 					getDictionaries({ token: subRes.data.token }).then(res => {
 						if (!that.$util.isEmpty(res)) {
               store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
-              store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+              store.commit('setMyShopInfo', { ...res.data }) //...res.data.shop, 
 						}
 					})
-          store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+
+          store.commit('setLoginInfo', { ...subRes.data }) //...subRes.data.admin, .
           this.skCustomId = subRes.data.skCustomId
           if (this.init) {
             this.init()

+ 3 - 3
hdPad/src/mixins/productContrapose.js

@@ -1,6 +1,6 @@
 import { getAllProductDataApi } from "@/api/product/index";
 import { STOCK_TYPE } from "@/utils/declare";
-import { mapGetters, mapActions } from "vuex";
+//import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util";
 export default {
 	data() {
@@ -29,10 +29,10 @@ export default {
 	},
 	onUnload() {},
 	computed: {
-		...mapGetters(["getSelectInfo","getMyShopInfo"]),
+		//...mapGetters(["getSelectInfo","getMyShopInfo"]),
 	},
 	methods: {
-		...mapActions(["setSelectInfo", "reSetSelectInfo"]),
+		//...mapActions(["setSelectInfo", "reSetSelectInfo"]),
 		async initDataContrapose(extendInfo) {
 			let params = {
 				py: this.py,

+ 3 - 3
hdPad/src/mixins/ptProductContrapose.js

@@ -1,5 +1,5 @@
 import { ptItemList } from "@/api/pt-item/index";
-import { mapGetters, mapActions } from "vuex";
+//import { mapGetters, mapActions } from "vuex";
 export default {
 	data() {
 		return {
@@ -24,10 +24,10 @@ export default {
 	},
 	onUnload() {},
 	computed: {
-		...mapGetters(["getSelectInfo","getMyShopInfo"]),
+		//...mapGetters(["getSelectInfo","getMyShopInfo"]),
 	},
 	methods: {
-		...mapActions(["setSelectInfo", "reSetSelectInfo"]),
+		//...mapActions(["setSelectInfo", "reSetSelectInfo"]),
 		async initDataContrapose(extendInfo) {
 			let params = {
 				name: this.py,

+ 11 - 7
hdPad/src/pages/home/cash.vue

@@ -61,7 +61,7 @@ import customerList from './components/customerList.vue'
 export default {
 	name: "cash",
 	components: { rightItem, consoleButton, loginComponent, leftArea, leftGroup, rightGoods, navComponent,customerList},
-	mixins: [autoUpdateApp,productMins],
+	mixins: [autoUpdateApp, productMins],
 	data() {
 		return {
 			//0成品 1花材
@@ -122,8 +122,9 @@ export default {
 			this.isLogin = 0
 		}else{
 			this.isLogin = 1
-			if(this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0){
-				this.customId =  Number(this.getMyShopInfo.defaultCustomId)
+			const shop = this.getMyShopInfo && this.getMyShopInfo.shop
+			if(shop && shop.defaultCustomId && shop.defaultCustomId > 0){
+				this.customId =  Number(shop.defaultCustomId)
 				this.customName = '快捷开单'
 				this.balance = 0
 			}
@@ -141,7 +142,8 @@ export default {
 		},
 		getMyShopInfo:{
 			handler(newValue) {
-				this.customId = newValue.defaultCustomId && newValue.defaultCustomId > 0 ? Number(newValue.defaultCustomId):0
+				const shop = newValue && newValue.shop
+				this.customId = shop && shop.defaultCustomId && shop.defaultCustomId > 0 ? Number(shop.defaultCustomId):0
 				this.customName = '快捷开单'
 				this.balance = 0
 			}
@@ -158,7 +160,8 @@ export default {
 	methods: {
 		fastCreate(){
 			this.$refs.myCustomRef.close()
-			this.customId = this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0 ? Number(this.getMyShopInfo.defaultCustomId):0
+			const shop = this.getMyShopInfo && this.getMyShopInfo.shop
+			this.customId = shop && shop.defaultCustomId && shop.defaultCustomId > 0 ? Number(shop.defaultCustomId):0
 			this.customName = '快捷开单'
 			this.balance = 0
 			this.$refs.rightItemRef.renewMyRightItem(this.customId)
@@ -166,7 +169,7 @@ export default {
 		},
 		init(){
 			//这个页面有二个这方法,不能去掉,不然会造成:全部缓存清了,点选客没有客户可选
-			this.getCustomData()
+			//this.getCustomData()
 		},
 		getCustomData(){
 			customList({ name: '',isCashier:1 }).then(res=>{
@@ -226,7 +229,8 @@ export default {
 			}, 30000)
 		},
 		updateRightItem(){
-			this.customId = this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0 ? Number(this.getMyShopInfo.defaultCustomId):0
+			const shop = this.getMyShopInfo && this.getMyShopInfo.shop
+			this.customId = shop && shop.defaultCustomId && shop.defaultCustomId > 0 ? Number(shop.defaultCustomId):0
 			this.customName = '快捷开单'
 			this.balance = 0
 			//要调用rightItemRef里的方法更新,不能这边直接请求product.js里方法更新,因为会造成扫码那块出问题,识别不到,关键词hzg_scan_right_item

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

@@ -138,7 +138,7 @@ export default {
         }
     },
 	computed: {
-		...mapGetters(["getLoginInfo","getMyShopInfo"])
+		...mapGetters(["getMyShopInfo"])
 	},
     watch:{
         changeCurrentJobType:{
@@ -155,7 +155,8 @@ export default {
         },
 		customId:{
             handler(id){
-                if(Number(this.getMyShopInfo.defaultCustomId)==Number(id)){
+                const shop = this.getMyShopInfo && this.getMyShopInfo.shop
+                if(shop && Number(shop.defaultCustomId) == Number(id)){
 					this.fastAction=1
 				}else{
 					this.fastAction=0

+ 2 - 2
hdPad/src/pages/home/components/customButton.vue

@@ -5,7 +5,7 @@
 </view>
 </template>
 <script>
-import { mapGetters } from "vuex";
+//import { mapGetters } from "vuex";
 export default {
     name:'consoleButton',
 	mixins: [],
@@ -19,7 +19,7 @@ export default {
         }
     },
 	computed: {
-		...mapGetters(["getLoginInfo","getMyShopInfo"])
+		//...mapGetters(["getLoginInfo","getMyShopInfo"])
 	},
     methods:{
     }

+ 2 - 2
hdPad/src/pages/home/components/customInfo.vue

@@ -98,7 +98,7 @@
 </template>
 <script>
 import { getDetail } from '@/api/custom'
-import { mapGetters } from "vuex";
+//import { mapGetters } from "vuex";
 import productMins from "@/mixins/product";
 export default {
 	name: "customInfo",
@@ -120,7 +120,7 @@ export default {
     },
 	mixins: [productMins],
 	computed:{
-		...mapGetters(["getMyShopInfo"]),
+		//...mapGetters(["getMyShopInfo"]),
 	},
 	watch:{
 		selectCustomId: {

+ 5 - 1
hdPad/src/pages/home/components/customList.vue

@@ -3,6 +3,7 @@
         <view class="title">列表</view>
         <view class="order-status">
             <view @tap="changeType(0)" :class="[{'checked':type===0}]">全部</view>
+            <view v-if="useVip" @tap="changeType(5)" :class="[{'checked':type===5}]">VIP</view>
             <view @tap="changeType(2)" :class="[{'checked':type===2}]">余额</view>
             <view @tap="changeType(1)" :class="[{'checked':type===1}]">消费</view>
             <view @tap="changeType(3)" :class="[{'checked':type===3}]">生日</view>
@@ -92,11 +93,14 @@ export default {
             sn:'',
             searchText: '',
             searchTimer: null,
-            searchStyle:0
+            searchStyle:0,
+            useVip:0 // 是否启用VIP
         }
     },
     created(){
         this.getCustomData()
+        const shopInfo = this.$store.getters.getMyShopInfo.shop
+        this.useVip = shopInfo.reachVip != "-1.00"
     },
     methods:{
         changeSearchStyle(){

+ 0 - 7
hdPad/src/pages/home/components/indexSon.vue

@@ -4,7 +4,6 @@
   </view>
 </template>
 <script>
-import { mapGetters } from "vuex";
 import productMins from "@/mixins/product";
 export default {
 	name: "indexSon",
@@ -19,12 +18,6 @@ export default {
 
   },
 	mixins: [productMins],
-	computed:{
-		...mapGetters(["getMyShopInfo"]),
-	},
-  mounted(){
-
-  },
   methods:{
     enter(){
 

+ 3 - 3
hdPad/src/pages/home/components/leftGroup.vue

@@ -3,9 +3,9 @@
 		<view class="title">
 			列表
 			<text style="float: right">{{
-				getMyShopInfo.shopName == "首店"
-					? getMyShopInfo.merchantName
-					: getMyShopInfo.merchantName + " " + getMyShopInfo.shopName
+				getMyShopInfo.shop.shopName == "首店"
+					? getMyShopInfo.shop.merchantName
+					: getMyShopInfo.shop.merchantName + " " + getMyShopInfo.shop.shopName
 			}}</text>
 		</view>
 		<scroll-view

+ 6 - 6
hdPad/src/pages/home/components/rightItem.vue

@@ -84,12 +84,12 @@ export default {
             default:0
         }
     },
-    mounted(){
-        let id = this.customId>0 ? this.customId : 0
-        if(id>0){
-            this.globalGetRightItem(id)
-        }
-    },
+    // mounted(){ // watch.customId 处会自动调用globalGetRightItem
+    //     let id = this.customId>0 ? this.customId : 0
+    //     if(id>0){
+    //         this.globalGetRightItem(id)
+    //     }
+    // },
 	created(){
 		this.listenScanItem()
     },

+ 4 - 4
hdPad/src/pages/home/components/workInfo.vue

@@ -79,7 +79,7 @@
     </view>
     <view class="work-item-detail">
 
-      <view class="flex-space right-detail-title" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1">每份用材
+      <view class="flex-space right-detail-title" v-if="getMyShopInfo.shop.stockModel && getMyShopInfo.shop.stockModel == 1">每份用材
         <text v-if="orderInfo.stockLock && orderInfo.stockLock == 1 && orderInfo.status == 0" style="color:red;">(不可修改)</text></view>
       <view class="flex-space right-detail-title" v-else>使用花材
         <text v-if="orderInfo.stockLock && orderInfo.stockLock == 1 && orderInfo.status == 0" style="color:red;">(不可修改)</text></view>
@@ -103,11 +103,11 @@
         </view>
       </view>
 
-      <view style="height:2vh;background-color:#EEEEEE;" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1"></view>
+      <view style="height:2vh;background-color:#EEEEEE;" v-if="getMyShopInfo.shop.stockModel && getMyShopInfo.shop.stockModel == 1"></view>
 
-      <view class="flex-space right-detail-title" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1"> 总共用材 </view>
+      <view class="flex-space right-detail-title" v-if="getMyShopInfo.shop.stockModel && getMyShopInfo.shop.stockModel == 1"> 总共用材 </view>
       
-      <view class="total-use-item" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1">
+      <view class="total-use-item" v-if="getMyShopInfo.shop.stockModel && getMyShopInfo.shop.stockModel == 1">
         <view class="commodity-list">
           <view v-for="(s, idx) in selectList" :key="idx" class="commodity-item" >
             <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.id}})" />

+ 1 - 1
hdPad/src/pages/home/custom.vue

@@ -84,7 +84,7 @@ export default {
         getCustomInfo(item){
             this.selectCustomId = Number(item.id)
             this.currentJobId = Number(item.id)
-            this.$refs.customInforRef.getCustomDetail(this.selectCustomId)
+            //this.$refs.customInforRef.getCustomDetail(this.selectCustomId)
         },
         goRecharge() {
             this.$util.hitVoice()