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 @@
@@ -169,7 +170,8 @@
¥
- {{RetainDecimalPoint(totalPrice)}}
+
+ {{totalPrice}}
@@ -205,10 +207,9 @@
@@ -249,7 +250,8 @@
¥
- {{RetainDecimalPoint(totalPrice)}}
+
+ {{totalPrice}}
@@ -287,10 +289,9 @@
@@ -338,7 +339,7 @@
¥
- {{RetainDecimalPoint(totalPrice)}}
+ {{totalPrice}}
@@ -379,7 +380,7 @@
+ 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 @@
- 订单详情
+ 订单详情
-
-
-
+
可用消费补贴卡余额抵扣¥{{_amount((item['max_deduction'] != undefined?item['max_deduction']:0) * item['num'])}}
@@ -81,17 +79,15 @@
原价
- :¥{{_amount(calculationamount['prices'])}}
+
+ :¥{{calculationamount['prices']}}
实际付款
- :¥{{_amount(calculationamount['payments'])}}
+ :¥{{calculationamount['payments']}}
- 消费卡抵扣:¥{{_amount(calculationamount['Actualamounts'])}}
-
- 获得佣金:¥{{_commission(commission)}}
+
提交订单
- 可用消费补贴卡余额抵扣¥{{_amount(item['max_deduction'] * item['num'])}}
- 您余额不足,实际可抵扣¥{{_amount(item['already_deduction_amount'])}}
+ 可用消费补贴卡余额抵扣¥{{_amount(item['max_deduction'] * item['num'])}}
+ 您余额不足,实际可抵扣¥{{_amount(item['already_deduction_amount'])}}
原价:
- ¥{{_amount(calculationamount['prices'])}}
+
+ ¥{{calculationamount['prices']}}
实际付款:
- ¥{{_amount(calculationamount['payments'])}}
+
+ ¥{{calculationamount['payments']}}
消费卡抵扣:¥{{_amount(calculationamount['Actualamounts'])}}
@@ -196,45 +196,54 @@
type: 4
}).then(res => {
this.SETPHONE(res['data'])
- let products = [];
- // 因为进入时暂时获取不到deepClone方法所以使用反转化
- let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
- for (let i = 0; i < newobj['length']; i++) {
- let item = newobj[i];
- // 是否抵扣
- // if (this['amount'] == 0) {
- // item['is_deduction'] = 0;
- // } else {
- // item['is_deduction'] = 1;
- // }
- item['is_deduction'] = 1;
- // item['max_deduction'] = 300
- // 抵扣金额(用于显示)
- item['deduction_amount'] = 0;
- // 已抵扣金额(用于逻辑计算)
- item['already_deduction_amount'] = 0;
- // 接口需要提交数量
- item['amount'] = item['num'];
- // 消费卡抵扣状态(抵扣条件)
- item['Discountarrcondition'] = true;
- products.push(item);
- this['shoptotalnum'] += item['num'];
- };
- // 获取余额
- console.log('初始化');
- conWalletInfoAPI().then(res => {
- this['amount'] = res['data']['amount'];
- // this['amount'] = 76;
- this['FormInfor']['brand_id'] = this['BrandInfor']['brand_id'];
- this['FormInfor']['restaurant_id'] = this['GetShopInfor']['restaurant_id'];
- this['FormInfor']['restaurant_name'] = this['GetShopInfor']['restaurant_name'];
- this['FormInfor']['lat'] = this['GetShopInfor']['latitude'];
- this['FormInfor']['lng'] = this['GetShopInfor']['longitude'];
- this['FormInfor']['restaurant_address'] = this['GetShopInfor'][
- 'restaurant_address'];
- this['FormInfor']['products'] = products;
- })
+ this.getCart();
+ }).catch(e => {
+ this.getCart();
})
+ },
+
+ getCart() {
+ let products = [];
+ // 因为进入时暂时获取不到deepClone方法所以使用反转化
+ let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
+ for (let i = 0; i < newobj['length']; i++) {
+ let item = newobj[i];
+ // 是否抵扣
+ // if (this['amount'] == 0) {
+ // item['is_deduction'] = 0;
+ // } else {
+ // item['is_deduction'] = 1;
+ // }
+ item['is_deduction'] = 1;
+ // item['max_deduction'] = 300
+ // 抵扣金额(用于显示)
+ item['deduction_amount'] = 0;
+ // 已抵扣金额(用于逻辑计算)
+ item['already_deduction_amount'] = 0;
+ // 接口需要提交数量
+ item['amount'] = item['num'];
+ // 消费卡抵扣状态(抵扣条件)
+ item['Discountarrcondition'] = true;
+ products.push(item);
+ this['shoptotalnum'] += item['num'];
+ };
+ // 获取余额
+ console.log('初始化');
+ this['FormInfor']['products'] = products;
+ console.log(products)
+ // 好像是查询补贴卡的
+ // conWalletInfoAPI().then(res => {
+ // this['amount'] = res['data']['amount'];
+ // // this['amount'] = 76;
+ // this['FormInfor']['brand_id'] = this['BrandInfor']['brand_id'];
+ // this['FormInfor']['restaurant_id'] = this['GetShopInfor']['restaurant_id'];
+ // this['FormInfor']['restaurant_name'] = this['GetShopInfor']['restaurant_name'];
+ // this['FormInfor']['lat'] = this['GetShopInfor']['latitude'];
+ // this['FormInfor']['lng'] = this['GetShopInfor']['longitude'];
+ // this['FormInfor']['restaurant_address'] = this['GetShopInfor'][
+ // 'restaurant_address'];
+ // this['FormInfor']['products'] = products;
+ // })
},
/**
diff --git a/request/request.js b/request/request.js
index 427ebb3..3acbf64 100644
--- a/request/request.js
+++ b/request/request.js
@@ -90,7 +90,8 @@ class Request {
* @param {String} Content-Type请求类型
* @param {String} url请求地址
*/
- Request(config = {}) {
+ Request(config = {}) {
+ console.log(config, '23333')
// 是否存在url
try {
if (!config['url']) {
@@ -191,9 +192,10 @@ class Request {
//card 654321
//
// 微信跳转H5后的逻辑为必须携带token
- const isWechat = getApp()['globalData']['parameters']?.isWechat;
+ const isWechat = getApp()['globalData']['parameters']?.isWechat;
+ console.log(isWechat, '222222222')
if (isWechat) {
- config['header']['token'] = getApp()['globalData']['parameters']['token'];
+ config['header']['authori-zation'] = getApp()['globalData']['parameters']['token'];
}
// 测试标识
diff --git a/request/restaurant/index.js b/request/restaurant/index.js
index 1163bf3..42a2b27 100644
--- a/request/restaurant/index.js
+++ b/request/restaurant/index.js
@@ -15,7 +15,7 @@ export const storeCollectionListAPI = parameters => request.Request({ url: "/car
/**
* @获取用户是否关注指定店铺
*/
- export const isCollectionAPI = parameters => request.Request({ url: "/card.Restaurant/isCollection", parameters });
+ export const isCollectionAPI = parameters => request.Request({ url: "/api/client/food/isCollection", parameters, method: 'POST' });
/**
* @取消或者关注店铺
*/
@@ -23,7 +23,7 @@ export const storeCollectionListAPI = parameters => request.Request({ url: "/car
/**
* @获取店铺商品
*/
- export const menuQueryAPI = parameters => request.Request({ url: "/card.Restaurant/menuQuery", parameters });
+ export const menuQueryAPI = parameters => request.Request({ url: "/api/client/food/menuQuery", parameters, method: 'POST'});
/**
* @创建订单
*/
@@ -49,7 +49,7 @@ export const cancelOrderAPI = parameters => request.Request({ url: "/card.Restau
/**
* @获取规格
*/
-export const menuDetailsAPI = parameters => request.Request({ url: "/card.Restaurant/menuDetails", parameters });
+export const menuDetailsAPI = parameters => request.Request({ url: "/api/client/food/menuDetails", parameters, method: 'POST' });
/**
* @瑞幸/星巴克创建订单
*/
@@ -91,4 +91,4 @@ export const WXpayDIYAPI = parameters => request.Request({ url: "/card.we_chat_p
*/
export const getStoreInfoAPI = parameters => request.Request({ url: "/chwl.brand_store/getStoreInfo", parameters});
// 获取上次所用下单手机号
-export const getPhoneAPI = parameters => request.Request({ url: "/card.user_phone/getPhone", parameters});
+export const getPhoneAPI = parameters => request.Request({ url: "/api/merchant_order_foods/getLastPhone", parameters});
diff --git a/static/css/themeColor.scss b/static/css/themeColor.scss
index 2e25b30..9a9cde3 100644
--- a/static/css/themeColor.scss
+++ b/static/css/themeColor.scss
@@ -163,4 +163,19 @@
font-weight: 800;
flex-direction: column;
align-items: center;
+}
+
+
+// 规格样式
+.commodity-sku-option-item {
+ height: auto !important;
+ .commodity-sku-option-item-values-item {
+ height: 72rpx !important;
+ padding: 0rpx 20rpx !important;
+ }
+}
+
+.commodity-sku-option-item-values {
+ display: flex;
+ flex-wrap: wrap;
}
\ No newline at end of file
diff --git a/static/js/mixin/calculationamountmixin.js b/static/js/mixin/calculationamountmixin.js
index f247506..0f6e93a 100644
--- a/static/js/mixin/calculationamountmixin.js
+++ b/static/js/mixin/calculationamountmixin.js
@@ -28,7 +28,7 @@ export default {
// 消费卡抵扣金额
Actualamounts,
};
- let amount = this['amount'];
+ let amount = this['amount'];
console.log(this['FormInfor']['products'],'products');
// 取出当前勾选的商品
let Deductionarr = this['FormInfor']['products'].filter(item => {
diff --git a/store/module/shopping/index.js b/store/module/shopping/index.js
index 16685c9..420e064 100644
--- a/store/module/shopping/index.js
+++ b/store/module/shopping/index.js
@@ -269,7 +269,7 @@ export default {
}, data) {
// let add = new addMethod();
return new Promise((reslove, reject) => {
- console.log(data,'data');
+ console.log(data,'data');
data['restaurant_id'] = state['shopDetail']['restaurant_id'];
data['brand_id'] = state['BInfor']['brand_id'];
remove.Sex = {
diff --git a/vue.config.js b/vue.config.js
index 5a9f7d6..28411aa 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,3 +1,16 @@
-module.exports = {
- transpileDependencies: ['uview-ui']
-}
\ No newline at end of file
+
+module.exports = {
+ transpileDependencies: ['uview-ui'],
+ devServer: {
+ port: 5927, // 设置本地开发服务器的端口,选填
+ proxy: {
+ '/api': { // 拦截 /api 开头的请求
+ target: 'https://tpoint.agrimedia.cn/', // 代理目标地址
+ changeOrigin: true, // 是否改变请求头中的origin
+ pathRewrite: {
+ '^/api': '' // 重写路径,将 /api 替换为空字符串
+ }
+ }
+ }
+ }
+};
\ No newline at end of file