diff --git a/framework/0-conf.js b/framework/0-conf.js index 409f63a..71ffc4b 100644 --- a/framework/0-conf.js +++ b/framework/0-conf.js @@ -19,9 +19,9 @@ const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService' // const baseUrl = 'https://cashier.sxczgkj.cn/cashierService'// 线上 // const baseUrlwws = 'wss://cashier.sxczgkj.cn/cashierService' // 线上 // const baseUrl = 'http://192.168.2.42:9888/cashierService'// 测试-w -// const baseUrlwws ='ws://192.168.2.42:9888/cashierService' // 测试-w +const baseUrlwws ='wss://192.168.2.42:9999/cashierService' // 测试-w const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService'// 测试 -const baseUrlwws ='wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试 +// const baseUrlwws ='wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试 // #endif diff --git a/manifest.json b/manifest.json index 036b818..64b255c 100644 --- a/manifest.json +++ b/manifest.json @@ -56,7 +56,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wxc2bb94c0ddda1032", + "appid" : "wxd88fffa983758a30", "setting" : { "urlCheck" : false, "minified" : true, diff --git a/pages/index/components/todaylist.vue b/pages/index/components/todaylist.vue index b80ecec..f5cf27a 100644 --- a/pages/index/components/todaylist.vue +++ b/pages/index/components/todaylist.vue @@ -15,7 +15,7 @@ - + - + diff --git a/pages/index/drinks.vue b/pages/index/drinks.vue index 5be53c1..3b6e2a9 100644 --- a/pages/index/drinks.vue +++ b/pages/index/drinks.vue @@ -155,12 +155,12 @@ uni.getStorage({ key: 'itemData', success: function(res) { - console.log(res.data,'数据'); _this.type = res.data.value _this.distiricttopCommon() - setTimeout(() => { + // setTimeout(() => { _this.GetTop() - }, 1000) + // _this.init_fn() + // }, 1000) } }); // this.type = e.value @@ -170,7 +170,19 @@ // }, 1000) }, onShow() { - this.init_fn() + let _this = this + uni.getStorage({ + key: 'itemData', + success: function(res) { + _this.type = res.data.value + _this.distiricttopCommon() + // setTimeout(() => { + // _this.GetTop() + _this.init_fn() + // }, 1000) + } + }); + // this.init_fn() }, computed: { HeighT() { //手机类型的尺寸 diff --git a/pages/index/index.vue b/pages/index/index.vue index ee506fb..120ddba 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -93,7 +93,7 @@ - + diff --git a/pages/member/list.vue b/pages/member/list.vue index 3238807..0985707 100644 --- a/pages/member/list.vue +++ b/pages/member/list.vue @@ -40,8 +40,13 @@ size: 10, //页容量 status: 'loadmore', }, + userId:null } }, + onLoad() { + this.userId = uni.cache.get('userInfo').id + // this.paygetShopByMember() + }, onShow() { this.paygetShopByMember() }, diff --git a/pages/order_detail/index.vue b/pages/order_detail/index.vue index 9e8e885..20667bf 100644 --- a/pages/order_detail/index.vue +++ b/pages/order_detail/index.vue @@ -220,6 +220,7 @@ }, onLoad(e) { // console.log(e, 140) + this.$store.dispatch("set_shopid"); //获取shapid let res = JSON.parse(e.tableId) this.listinfo.detailList = res this.listinfo.amount = e.amount // 算完了的价格 @@ -266,10 +267,9 @@ } }, async getAount() { - console.log(uni.cache.get('userInfo'), '余额中userId不显示打印') let res = await this.api.shopUserInfo({ // shopId:店铺ID - "shopId": uni.cache.get('shopUser'), + "shopId": this.$store.state.shopId, "userId": uni.cache.get('userInfo').id, }) if (res.code == 0) { @@ -342,7 +342,7 @@ "isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用), "isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买) "productId": '', //商品id - "shopId": uni.cache.get('shopUser'), + "shopId": this.$store.state.shopId, "userId": uni.cache.get('userInfo').id, // tableId:uni.cache.get('tableCode') } @@ -365,7 +365,7 @@ "isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用), "isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买) "productId": '', //商品id - "shopId": uni.cache.get('shopUser'), + "shopId": this.$store.state.shopId, "userId": uni.cache.get('userInfo').id, // tableId:uni.cache.get('tableCode') } diff --git a/pages/order_detail/order_detail.vue b/pages/order_detail/order_detail.vue index 78cdbad..2664ccb 100644 --- a/pages/order_detail/order_detail.vue +++ b/pages/order_detail/order_detail.vue @@ -234,13 +234,15 @@ this.ispws = false }, onLoad(e) { + this.listinfo = JSON.parse(e.tablelist) // 获取余额 - this.getAount() + // this.getAount() // 获取用户信息,判断是否设置支付密码 this.getuserinfo() }, onShow() { + // this.$store.dispatch("set_shopid"); //获取shapid this.getAount() this.getuserinfo() }, @@ -267,10 +269,9 @@ } }, async getAount() { - console.log(uni.cache.get('userInfo'), '余额中userId不显示打印') let res = await this.api.shopUserInfo({ // shopId:店铺ID - "shopId": uni.cache.get('shopUser'), + "shopId": this.$store.state.shopId, "userId": uni.cache.get('userInfo').id, }) if (res.code == 0) { @@ -343,7 +344,7 @@ "isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用), "isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买) "productId": '', //商品id - "shopId": uni.cache.get('shopUser'), + "shopId": this.$store.state.shopId, "userId": uni.cache.get('userInfo').id, // tableId:uni.cache.get('tableCode') } @@ -366,7 +367,7 @@ "isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用), "isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买) "productId": '', //商品id - "shopId": uni.cache.get('shopUser'), + "shopId": this.$store.state.shopId, "userId": uni.cache.get('userInfo').id, // tableId:uni.cache.get('tableCode') } diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index d1ff40f..0dc888a 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -60,7 +60,7 @@ - + @@ -272,7 +272,7 @@ } this.countScrollTitle(e.scrollTop); }, - onLoad(e) { + onLoad(e) { if (e.q) { let tableCode = this.getQueryString(decodeURIComponent(e.q), 'code') uni.cache.set('tableCode', tableCode) @@ -280,7 +280,7 @@ } if (!uni.cache.get('token') && uni.cache.get('tableCode')) { uni.reLaunch({ - url: '/pages/login/login?type=' + 0 + url: '/pages/login/login?types=' + 0 }); } uni.$on('message', this.getMessage) @@ -292,10 +292,16 @@ this.socketSendMsg({ //定义socket数据传参 "type": "close", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”, }) + console.log(this.socketTicket, '关闭长连接') this.socketTicket.Close() uni.$off('message') }, onShow() { + // console.log(this.socketTicket,'进入页面') + // if (this.socketTicket) { + // this.socketTicket.Close() + // uni.$off('message') + // } // uni.onNetworkStatusChange((res) => { //监听网络状态变化 // if (!res.isConnected) { // // 检查网络是否连接 @@ -305,6 +311,7 @@ // } // }); setTimeout(() => { + console.log('调试1') if (uni.cache.get('token') && uni.cache.get('tableCode')) { this.productqueryShopIdByTableCode() //获取shop User id } @@ -388,14 +395,16 @@ case 'addcart': this.cartLists = msg if (msg.data.length != 0) { + let nums = 0 msg.data.forEach((item, index, arr) => { //初始化skuidname的数据 选择第一个 if (item.skuId == this.skuidsearch) { - this.$set(this, 'amountcartNumber', item.number) - } + nums = item.number + } // else { // this.$set(this, 'amountcartNumber', 0) // } }) + this.$set(this, 'amountcartNumber', nums) } else { this.$set(this, 'amountcartNumber', 0) } @@ -528,7 +537,7 @@ return res }) this.specifications.tagSnap.forEach((val, index, arr) => { //初始化skuidname的数据 选择第一个 - console.log(val.children[0],'skuidnam是否为空1') + console.log(val.children[0], 'skuidnam是否为空1') this.skuidname.push(val.children[0]) }) try { @@ -541,7 +550,7 @@ } }, async morloe(e, index, index1, item) { - console.log(index,'skuidnam是否为空2') + console.log(index, 'skuidnam是否为空2') this.specifications.tagSnap[index]['start'] = index1 this.skuidname.splice(index, 1, e) //替换skuidname的数据 this.hodgepodge(item, 2) @@ -605,6 +614,7 @@ "shopId": uni.cache.get('shopUser'), "userId": uni.cache.get('userInfo').id, } + this.$store.dispatch("set_shopid"); //获取shapid uni.$u.debounce(this.socketSendMsg(data), 500) }, orderfoodindex() { diff --git a/pages/product/placeOrder.vue b/pages/product/placeOrder.vue index fb43144..1bdc09c 100644 --- a/pages/product/placeOrder.vue +++ b/pages/product/placeOrder.vue @@ -109,6 +109,7 @@ payPassword }, onLoad(e) { + this.$store.dispatch("set_shopid"); //获取shapid this.getInfo(e.id) this.orderIds = e.id this.amount = uni.cache.get('userInfo').amount @@ -131,7 +132,7 @@ async getAount() { let res = await this.api.shopUserInfo({ // shopId:店铺ID - "shopId": this.info.shopId, + "shopId": this.$store.state.shopId, "userId": uni.cache.get('userInfo').id }) if (res.code == 0) { diff --git a/store/index.js b/store/index.js index fab0761..82c400c 100644 --- a/store/index.js +++ b/store/index.js @@ -18,7 +18,7 @@ const store = new Vuex.Store({ bottompadding: "", heightBar: '' }, - + shopId: null }, getters: { is_login(state) { @@ -35,8 +35,12 @@ const store = new Vuex.Store({ //二次修改后的值 或者过滤的 return state.info; }, + }, mutations: { + SET_SHOPID(state, data) { + state.shopId = data; + }, SET_STATUS_BAR(state, data) { state.BarHeight.statusBar = data; }, @@ -57,7 +61,16 @@ const store = new Vuex.Store({ }, }, actions: { - + set_shopid: async ({ + commit + }, data) => { + let res = await Api.productqueryShopIdByTableCode({ + code: uni.cache.get('tableCode') + }) + if (res.code == 0) { + commit('SET_SHOPID', res.data) + } + }, HeightActions({ commit }) { @@ -95,8 +108,8 @@ const store = new Vuex.Store({ // #ifdef APP-PLUS console.log('app-plus', e) statusBar = e.statusBarHeight - heightBar = e.statusBarHeight - customBar = e.statusBarHeight + heightBar = e.statusBarHeight + customBar = e.statusBarHeight bottomPadding = (e.screenHeight - e.safeArea.bottom) // customBar = 0 // #endif