diff --git a/App.vue b/App.vue index f2907b8..404de3f 100644 --- a/App.vue +++ b/App.vue @@ -92,10 +92,25 @@ console.log(querys); querys[key] = JSON.parse(querys[key]) }; - this['globalData']['parameters'] = { ...querys['userinfor'], ...querys['query'], timestamp:querys['timestamp']} + this['globalData']['parameters'] = { ...querys['userinfor'], ...querys['query'], timestamp:querys['timestamp']} // 小程序首页会直接进入店铺首页,首页无赋值店铺信息逻辑所再次处进入之后赋值 if(this['globalData']['parameters']?.brand_id && typeof this['globalData']['parameters']['brand_id'] != 'undefined' && typeof this['globalData']['parameters']['brand_id'] != undefined && this['globalData']['parameters']?.brand_name && typeof this['globalData']['parameters']['brand_name'] != 'undefined' && typeof this['globalData']['parameters']['brand_name'] != undefined){ store.commit('shopping/SETBRANDINFOR', { brand_id: this['globalData']['parameters']['brand_id'], brand_name:decodeURIComponent(this['globalData']['parameters']['brand_name'])}); + + // 设置店铺信息JIN + store.commit('shopping/SETSHOPDETAIL', { + city_name: this['globalData']['parameters'].cityInfor.city, + is_open: 1, + latitude: this['globalData']['parameters'].latitude, + longitude: this['globalData']['parameters'].longitude, + open_time: "07:00", + province_name: this['globalData']['parameters'].cityInfor.province, + regoin_name: null, + restaurant_address: this['globalData']['parameters'].restaurant_address, + restaurant_id: this['globalData']['parameters'].restaurant_id, + restaurant_name: this['globalData']['parameters'].restaurant_name, + special: false, + }) }; } diff --git a/components/b-rx-commodity-item/b-rx-commodity-item.vue b/components/b-rx-commodity-item/b-rx-commodity-item.vue index c75bcfe..3114cc2 100644 --- a/components/b-rx-commodity-item/b-rx-commodity-item.vue +++ b/components/b-rx-commodity-item/b-rx-commodity-item.vue @@ -7,7 +7,7 @@ - {{item['product_name']}} + {{item['product_name']}} {{item['sku']}} @@ -24,14 +24,23 @@ - + + + ¥{{item['pay_price']}} + + + ¥{{item['pay_price'] * (item['num']?item['num']:item['amount'])}} + + + ¥{{item['adj_pay'] * (item['num']?item['num']:item['amount'])}} diff --git a/components/b-rx-sku-popup/b-rx-sku-popup.vue b/components/b-rx-sku-popup/b-rx-sku-popup.vue index 130f5a8..7c35839 100644 --- a/components/b-rx-sku-popup/b-rx-sku-popup.vue +++ b/components/b-rx-sku-popup/b-rx-sku-popup.vue @@ -1,331 +1,331 @@ - - - - - + + + + + diff --git a/manifest.json b/manifest.json index a9c3cda..b5f4af8 100644 --- a/manifest.json +++ b/manifest.json @@ -71,26 +71,14 @@ "vueVersion" : "2", "h5" : { "devServer" : { + "port": 8090, "disableHostCheck" : true, "proxy" : { - "/card" : { - "target" : "https://jc.agrimedia.cn/", //目标接口域名 - - // https://jc.zdyyq.com - // "target" : "http://jc.bvcio.com/", //目标接口域名 - // "target" : "https://tshop.laimaidi.com/jc_service", //目标接口域名 - "changeOrigin" : true, //是跨域 - "secure" : true //设置支持https协议的代理 - }, - "/chwl" : { - "target" : "https://jc.agrimedia.cn/", //目标接口域名 - - // https://jc.zdyyq.com - // "target" : "http://jc.bvcio.com/", //目标接口域名 - // "target" : "https://tshop.laimaidi.com/jc_service", //目标接口域名 - "changeOrigin" : true, //是跨域 - "secure" : true //设置支持https协议的代理 - } + "/api/" : { + "target" : "https://tpoint.agrimedia.cn/", //目标接口域名 + "changeOrigin" : true, //是跨域 + "secure" : true //设置支持https协议的代理 + } }, // "/xd" : { // "target" : "https://jc.agrimedia.cn/", //目标接口域名 diff --git a/pages/restaurant/home/shop_home/components/shop-cart/shop-cart.vue b/pages/restaurant/home/shop_home/components/shop-cart/shop-cart.vue index 07588f9..fe51cf7 100644 --- a/pages/restaurant/home/shop_home/components/shop-cart/shop-cart.vue +++ b/pages/restaurant/home/shop_home/components/shop-cart/shop-cart.vue @@ -13,7 +13,8 @@ - {{RetainDecimalPoint(totalPrice)}} + + {{totalPrice}} @@ -34,9 +35,9 @@ - - {{RetainDecimalPoint(item['pay_price'] * item['num'])}} + + {{item['adj_pay'] * item['num']}} + @@ -80,7 +81,8 @@ - {{RetainDecimalPoint(totalPrice)}} + + {{totalPrice}} @@ -118,10 +120,9 @@ - - {{RetainDecimalPoint(item['adj_pay'] * item['num'])}} + + + {{item['adj_pay'] * item['num']}} @@ -169,7 +170,8 @@ - {{RetainDecimalPoint(totalPrice)}} + + {{totalPrice}} @@ -205,10 +207,9 @@ - - {{RetainDecimalPoint((item['pay_price'] * item['num']))}} + + {{(item['pay_price'] * item['num'])}} + @@ -249,7 +250,8 @@ - {{RetainDecimalPoint(totalPrice)}} + + {{totalPrice}} @@ -287,10 +289,9 @@ - - {{RetainDecimalPoint((item['adj_pay'] * item['num']))}} + + + {{(item['adj_pay'] * item['num'])}} @@ -338,7 +339,7 @@ - {{RetainDecimalPoint(totalPrice)}} + {{totalPrice}} @@ -379,7 +380,7 @@ {{RetainDecimalPoint(item['adj_pay'] * item['num'])}} + class="RX-Cart-Popup-item-commodity-infor-money-amount">{{item['adj_pay'] * item['num']}} @@ -514,7 +515,7 @@ }; console.log(item['sku'],'当前sku'); // 原价 + 加料价格 - item['adj_pay'] = (+item['pay_price']) + (+item['add_price']); + item['adj_pay'] = (+item['product_price']) + (+item['add_price']); Price += item['adj_pay'] * item['num']; newArr.push(item); console.log(this['GetCartList'][id],'是否规格商品'); @@ -534,7 +535,7 @@ // 商品加料价格 add_price: _item?.add_price?_item['add_price']:0 }; - _item['adj_pay'] = (+_item['pay_price']) + (+_item['add_price']); + _item['adj_pay'] = (+_item['product_price']) + (+_item['add_price']); Price += _item['adj_pay'] * _item['num']; this['GetCartList'][id]['Differentskulist'][i] = _item; }; diff --git a/pages/restaurant/home/shop_home/components/shop-head/shop-head.vue b/pages/restaurant/home/shop_home/components/shop-head/shop-head.vue index bce68ad..457f9fc 100644 --- a/pages/restaurant/home/shop_home/components/shop-head/shop-head.vue +++ b/pages/restaurant/home/shop_home/components/shop-head/shop-head.vue @@ -100,7 +100,7 @@ } }, mounted() { - console.log(this['GetShopInfor'],'GetShopInfor'); + console.log(this['GetShopInfor'],'GetShopInfor页面页面页面页面页面页面页面页面页面页面页面页面页面页面页面页面'); this.init(); @@ -170,7 +170,7 @@ .Shop-Head { padding: 0 30rpx; width: 100%; - height: 131rpx; + height: 150rpx; display: flex; align-items: center; justify-content: space-between; diff --git a/pages/restaurant/home/shop_home/components/shop-item/shop-item.vue b/pages/restaurant/home/shop_home/components/shop-item/shop-item.vue index 3722d57..3f3116e 100644 --- a/pages/restaurant/home/shop_home/components/shop-item/shop-item.vue +++ b/pages/restaurant/home/shop_home/components/shop-item/shop-item.vue @@ -11,18 +11,26 @@ {{item['product_name']}} - + - 原价:¥ - {{RetainDecimalPoint(item['pay_price'])}} + 原价:¥ + {{item['product_price']}} + - 补贴后价格:¥ - {{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}} + 补贴后价格:¥ + {{item['bt_price']}} + + + + + 积分: + + {{item['integral']}} @@ -46,25 +54,33 @@ - + {{item['product_name']}} - + 原价:¥ - {{RetainDecimalPoint(item['pay_price'])}} + + {{item['product_price']}} 补贴后价格:¥ - {{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}} + + {{item['bt_price']}} + + + + 积分: + + {{item['integral']}} @@ -81,18 +97,26 @@ {{item['product_name']}} - + 原价:¥ - {{RetainDecimalPoint(item['pay_price'])}} + + {{item['product_price']}} 补贴后价格:¥ - {{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}} + + {{item['bt_price']}} + + + + 积分: + + {{item['integral']}} @@ -216,12 +240,12 @@ title: '加载中...' }); let brand_id = this['BrandInfor']['brand_id'], - item = JSON.parse(JSON.stringify(this['item'])); + item = JSON.parse(JSON.stringify(this['item'])); if (this['ISSpecifications']) { // 进入选择套餐详情 / 并非单品加入商品 - if(brand_id == 1 || brand_id == 5){ + if(brand_id == 1 || brand_id == 5){ uni.hideLoading(); - this.PageShopCombo(); + this.PageShopCombo(); return; }; @@ -235,10 +259,19 @@ menuDetailsAPI(parameters).then(res => { uni.hideLoading(); // 设置默认数量 - res['data']['num'] = 1; + res['data']['num'] = 1; + + // 接口修改后数据格式问题 + // if(brand_id == 13) { + // } + res.data.pay_price = res.data.product_price * 100 + + console.log(res['data'], '接口修改后数据格式问题') + this.SetcommodityInfor(res['data']); - // 判断是什么类型店铺 - if(brand_id == 13){ + // 判断是什么类型店铺 + + if(brand_id == 13){ this.$emit('SkuPopup','b-rx-sku-popup'); }else if(brand_id == 2){ this.$emit('SkuPopup','b-nx-sku-popup'); @@ -270,7 +303,12 @@ return; }; // 该字段为前端计算使用 - this['item']['adj_pay'] = this['item']['pay_price']; + this['item']['adj_pay'] = this['item']['pay_price']; + + // 麦当劳计算 + this['item']['pay_price'] = this['item']['product_price']; + + console.log(this['item']) // 单品添加 uni.hideLoading(); this.ADD_CART({ @@ -284,7 +322,7 @@ /** * @减少/删除商品 * */ - reducecommodity() { + reducecommodity() { this.REDUCE_CART(this['item']) }, diff --git a/pages/restaurant/home/shop_home/shop_home.vue b/pages/restaurant/home/shop_home/shop_home.vue index c990284..31b3b96 100644 --- a/pages/restaurant/home/shop_home/shop_home.vue +++ b/pages/restaurant/home/shop_home/shop_home.vue @@ -18,7 +18,7 @@ class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" :scroll-into-view="itemId"> - {{item['name']}} + {{item['name']}} @@ -44,7 +44,7 @@ - + @@ -154,7 +154,8 @@ }, }, onLoad(param) { - self = this; + self = this; + console.log(param['brand_id'],'onLoad参数'); const isWechat = getApp()['globalData']['parameters']?.isWechat; console.log(isWechat,getApp()['globalData']['parameters']?.brand_id,'是否需要分享'); @@ -224,8 +225,9 @@ }, methods: { - init(param) { - console.log(param, 'param'); + init(param) { + console.log(this.GetShopInfor) + console.log('设置店铺信息', '++++++++++++++++++++++++++++++++++++++++++') // 微信小程序进入品牌详情会过跳过正常进入品牌详情前两个页面的逻辑,所以在此处将前两页的逻辑整合 // 微信跳转H5后的逻辑为必须携带token const isWechat = getApp()['globalData']['parameters']?.isWechat; @@ -269,8 +271,7 @@ brand_id, brand_name }); - - // 设置店铺信息 + data['data']['restaurant_id'] = data['data']['store_id']; data['data']['restaurant_name'] = data['data']['store_name']; this.SETSHOPDETAIL(data['data']); @@ -328,9 +329,9 @@ * */ GetMenuQuery() { let param = { - brand_id: this['BrandInfor']['brand_id'], - restaurant_id: this['GetShopInfor']['restaurant_id'], - sku: 1 + brand_id: this['BrandInfor']['brand_id'], + restaurant_id: this['GetShopInfor']['restaurant_id'], + // restaurant_id: getApp().globalData['parameters']['restaurant_id'], } menuQueryAPI(param).then(res => { this['tabbar'] = res['data']; diff --git a/pages/restaurant/order/orders-settlement/orders-settlement.vue b/pages/restaurant/order/orders-settlement/orders-settlement.vue index ccb9843..c3da4f8 100644 --- a/pages/restaurant/order/orders-settlement/orders-settlement.vue +++ b/pages/restaurant/order/orders-settlement/orders-settlement.vue @@ -47,15 +47,13 @@ - 订单详情 + 订单详情