fix: 点餐数据格式完成

This commit is contained in:
whitechiina 2025-03-30 14:35:27 +08:00
parent 361f444663
commit 6122852202
16 changed files with 627 additions and 521 deletions

15
App.vue
View File

@ -96,6 +96,21 @@
// ,
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,
})
};
}

View File

@ -24,7 +24,7 @@
<!-- 数量 -->
<view class="quantity">
<!-- 订单列表中的商品数据价格是后台计算过的所以直接使用就行了original_price属性之后订单数据才会返回 -->
<view class="num" v-if="item['original_price']">
<!-- <view class="num" v-if="item['original_price']">
{{RetainDecimalPoint(item['pay_price'])}}
</view>
<view class="num" v-else-if="!item['original_price'] && (BrandInfor['brand_id'] == 13 || BrandInfor['brand_id'] == 1)">
@ -32,6 +32,15 @@
</view>
<view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10">
{{RetainDecimalPoint(item['adj_pay'] * (item['num']?item['num']:item['amount']))}}
</view> -->
<view class="num" v-if="item['original_price']">
{{item['pay_price']}}
</view>
<view class="num" v-else-if="!item['original_price'] && (BrandInfor['brand_id'] == 13 || BrandInfor['brand_id'] == 1)">
{{item['pay_price'] * (item['num']?item['num']:item['amount'])}}
</view>
<view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10">
{{item['adj_pay'] * (item['num']?item['num']:item['amount'])}}
</view>
</view>
</view>

View File

@ -71,23 +71,11 @@
"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", //
"/api/" : {
"target" : "https://tpoint.agrimedia.cn/", //
"changeOrigin" : true, //
"secure" : true //https
}

View File

@ -13,7 +13,8 @@
</view>
<view class="price">
<text class="yang"></text>
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
<text class="amount">{{totalPrice}}</text>
</view>
</view>
<view class="right" @tap="create" :class="[Shoplength > 0?'right2':'']">
@ -35,8 +36,8 @@
<view class="money">
<view class="price">
<text class="yang"></text>
<text
class="amount">{{RetainDecimalPoint(item['pay_price'] * item['num'])}}</text>
<text class="amount">{{item['adj_pay'] * item['num']}}</text>
<!-- <text class="amount">{{RetainDecimalPoint(item['pay_price'] * item['num'])}}</text> -->
</view>
</view>
<!-- 数量 -->
@ -80,7 +81,8 @@
</view>
<view class="NX-Cart-left-price">
<text class="yang"></text>
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
<text class="amount">{{totalPrice}}</text>
</view>
</view>
<view class="NX-Cart-right" @tap="create" :class="[Shoplength > 0?'right2':'']">
@ -118,10 +120,9 @@
<!-- 价格 -->
<view class="NX-Cart-Popup-item-commodity-infor-money">
<view class="NX-Cart-Popup-item-commodity-infor-money-price">
<text
class="NX-Cart-Popup-item-commodity-infor-money-yang"></text>
<text
class="NX-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint(item['adj_pay'] * item['num'])}}</text>
<text class="NX-Cart-Popup-item-commodity-infor-money-yang"></text>
<!-- <text class="NX-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint(item['adj_pay'] * item['num'])}}</text> -->
<text class="NX-Cart-Popup-item-commodity-infor-money-amount">{{item['adj_pay'] * item['num']}}</text>
</view>
</view>
</view>
@ -169,7 +170,8 @@
</view>
<view class="MDL-Cart-left-price">
<text class="yang"></text>
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
<text class="amount">{{totalPrice}}</text>
</view>
</view>
<view class="MDL-Cart-right theme-Union-Class-5-1" @tap="create" :class="[Shoplength > 0?'right2':'']">
@ -205,10 +207,9 @@
<!-- 价格 -->
<view class="MDL-Cart-Popup-item-commodity-infor-money">
<view class="MDL-Cart-Popup-item-commodity-infor-money-price">
<text
class="MDL-Cart-Popup-item-commodity-infor-money-yang"></text>
<text
class="MDL-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint((item['pay_price'] * item['num']))}}</text>
<text class="MDL-Cart-Popup-item-commodity-infor-money-yang"></text>
<text class="MDL-Cart-Popup-item-commodity-infor-money-amount">{{(item['pay_price'] * item['num'])}}</text>
<!-- <text class="MDL-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint((item['pay_price'] * item['num']))}}</text> -->
</view>
</view>
</view>
@ -249,7 +250,8 @@
</view>
<view class="XBK-Cart-left-price">
<text class="yang"></text>
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
<text class="amount">{{totalPrice}}</text>
</view>
</view>
<view class="XBK-Cart-right" @tap="create" :class="[Shoplength > 0?'right2':'']">
@ -287,10 +289,9 @@
<!-- 价格 -->
<view class="XBK-Cart-Popup-item-commodity-infor-money">
<view class="XBK-Cart-Popup-item-commodity-infor-money-price">
<text
class="XBK-Cart-Popup-item-commodity-infor-money-yang"></text>
<text
class="XBK-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint((item['adj_pay'] * item['num']))}}</text>
<text class="XBK-Cart-Popup-item-commodity-infor-money-yang"></text>
<!-- <text class="XBK-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint((item['adj_pay'] * item['num']))}}</text> -->
<text class="XBK-Cart-Popup-item-commodity-infor-money-amount">{{(item['adj_pay'] * item['num'])}}</text>
</view>
</view>
</view>
@ -338,7 +339,7 @@
</view>
<view class="RX-Cart-left-price">
<text class="yang"></text>
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
<text class="amount">{{totalPrice}}</text>
</view>
</view>
<view class="RX-Cart-right" @tap="create" :class="[Shoplength > 0?'right2':'']">
@ -379,7 +380,7 @@
<text
class="RX-Cart-Popup-item-commodity-infor-money-yang"></text>
<text
class="RX-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint(item['adj_pay'] * item['num'])}}</text>
class="RX-Cart-Popup-item-commodity-infor-money-amount">{{item['adj_pay'] * item['num']}}</text>
</view>
</view>
</view>
@ -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;
};

View File

@ -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;

View File

@ -11,18 +11,26 @@
{{item['product_name']}}
</view>
<!-- 补贴金额 -->
<view class="shop_home-commodity-infor-discount shop_home-commodity-infor-bottom">
<!-- <view class="shop_home-commodity-infor-discount shop_home-commodity-infor-bottom">
最高补贴{{RetainDecimalPoint(item['max_deduction'])}}
</view>
</view> -->
<!-- 价格 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">原价:</text>
<text class="price">{{RetainDecimalPoint(item['pay_price'])}}</text>
<text class="price">{{item['product_price']}}</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'])}}</text> -->
</view>
<!-- 优惠补贴后的价格 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">补贴后价格:</text>
<text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text>
<text class="price">{{item['bt_price']}}</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text> -->
</view>
<!-- 积分 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">积分:</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text> -->
<text class="price">{{item['integral']}}</text>
</view>
<!-- 该商品为套餐商品并且套餐中有可选商品则显示为选规格 -->
<view class="shop_home-commodity-infor-cart-sku" v-if="ISSpecifications" @tap="$u.debounce(Addcommodity, 800,true)">
@ -46,25 +54,33 @@
</view>
</view>
</view>
<!-- 星巴克 -->
<!-- 星巴克/瑞幸 -->
<view class="shop_home-commodity-infor" v-if="BrandInfor['brand_id'] == 10 || BrandInfor['brand_id'] == 13">
<!-- 商品标题 -->
<view class="shop_home-commodity-infor-title shop_home-commodity-infor-bottom">
{{item['product_name']}}
</view>
<!-- 补贴金额 -->
<view class="shop_home-commodity-infor-discount shop_home-commodity-infor-bottom">
<!-- <view class="shop_home-commodity-infor-discount shop_home-commodity-infor-bottom">
最高补贴{{RetainDecimalPoint(item['max_deduction'])}}
</view>
</view> -->
<!-- 价格 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">原价:</text>
<text class="price">{{RetainDecimalPoint(item['pay_price'])}}</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'])}}</text> -->
<text class="price">{{item['product_price']}}</text>
</view>
<!-- 优惠补贴后的价格 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">补贴后价格:</text>
<text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text> -->
<text class="price">{{item['bt_price']}}</text>
</view>
<!-- 积分 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">积分:</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text> -->
<text class="price">{{item['integral']}}</text>
</view>
<!-- 选规格 -->
<view class="shop_home-commodity-infor-cart-sku" @tap="$u.debounce(Addcommodity, 800,true)">
@ -81,18 +97,26 @@
{{item['product_name']}}
</view>
<!-- 补贴金额 -->
<view class="shop_home-commodity-infor-discount shop_home-commodity-infor-bottom">
<!-- <view class="shop_home-commodity-infor-discount shop_home-commodity-infor-bottom">
最高补贴{{RetainDecimalPoint(item['max_deduction'])}}
</view>
</view> -->
<!-- 价格 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">原价:</text>
<text class="price">{{RetainDecimalPoint(item['pay_price'])}}</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'])}}</text> -->
<text class="price">{{item['product_price']}}</text>
</view>
<!-- 优惠补贴后的价格 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">补贴后价格:</text>
<text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text> -->
<text class="price">{{item['bt_price']}}</text>
</view>
<!-- 积分 -->
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
<text class="yang">积分:</text>
<!-- <text class="price">{{RetainDecimalPoint(item['pay_price'] - item['max_deduction'])}}</text> -->
<text class="price">{{item['integral']}}</text>
</view>
<!-- 选规格 -->
<view v-if="ISSpecifications" class="shop_home-commodity-infor-cart-sku" @tap="$u.debounce(Addcommodity, 800,true)">
@ -236,8 +260,17 @@
uni.hideLoading();
//
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){
this.$emit('SkuPopup','b-rx-sku-popup');
}else if(brand_id == 2){
@ -271,6 +304,11 @@
};
// 使
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({

View File

@ -18,7 +18,7 @@
class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" :scroll-into-view="itemId">
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item['name']}}</text>
<text class="u-line-1" style="padding: 0rpx 20rpx">{{item['name']}}</text>
</view>
</scroll-view>
<!-- 右侧商品选项 -->
@ -155,6 +155,7 @@
},
onLoad(param) {
self = this;
console.log(param['brand_id'],'onLoad参数');
const isWechat = getApp()['globalData']['parameters']?.isWechat;
console.log(isWechat,getApp()['globalData']['parameters']?.brand_id,'是否需要分享');
@ -225,7 +226,8 @@
methods: {
init(param) {
console.log(param, 'param');
console.log(this.GetShopInfor)
console.log('设置店铺信息', '++++++++++++++++++++++++++++++++++++++++++')
// ,
// H5token
const isWechat = getApp()['globalData']['parameters']?.isWechat;
@ -270,7 +272,6 @@
brand_name
});
//
data['data']['restaurant_id'] = data['data']['store_id'];
data['data']['restaurant_name'] = data['data']['store_name'];
this.SETSHOPDETAIL(data['data']);
@ -330,7 +331,7 @@
let param = {
brand_id: this['BrandInfor']['brand_id'],
restaurant_id: this['GetShopInfor']['restaurant_id'],
sku: 1
// restaurant_id: getApp().globalData['parameters']['restaurant_id'],
}
menuQueryAPI(param).then(res => {
this['tabbar'] = res['data'];

View File

@ -53,9 +53,7 @@
<b-rx-commodity-item :item="item" :key='index'></b-rx-commodity-item>
<!-- 优惠 -->
<view class="discount" v-if="item['max_deduction'] && item['max_deduction'] > 0">
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox':item['is_deduction']?true:false}">
</view>
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox':item['is_deduction']?true:false}"></view>
<view>
<view class="Deduction-amount">
可用消费补贴卡余额抵扣{{_amount((item['max_deduction'] != undefined?item['max_deduction']:0) * item['num'])}}
@ -81,17 +79,15 @@
<view class="text-group_3">
<view class="text-wrapper_4 itemamount">
<text lines="1" class="text_24">原价</text>
<text lines="1" class="text_25"
:style="{color:Brand()['ThemeColor']}">{{_amount(calculationamount['prices'])}}</text>
<!-- <text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">{{_amount(calculationamount['prices'])}}</text> -->
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">{{calculationamount['prices']}}</text>
</view>
<view class="text-wrapper_4 itemamount">
<text lines="1" class="text_24">实际付款</text>
<text lines="1" class="text_25"
:style="{color:Brand()['ThemeColor']}">{{_amount(calculationamount['payments'])}}</text>
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">{{calculationamount['payments']}}</text>
</view>
<view lines="1" class="text_26 itemamount">消费卡抵扣{{_amount(calculationamount['Actualamounts'])}}
</view>
<view lines="1" class="text_27 itemamount">获得佣金{{_commission(commission)}}</view>
<!-- <view lines="1" class="text_26 itemamount">消费卡抵扣{{_amount(calculationamount['Actualamounts'])}}</view>
<view lines="1" class="text_27 itemamount">获得佣金{{_commission(commission)}}</view> -->
</view>
<text lines="1" class="text_28">提交订单</text>
<button class="button_1" :style="Brand()['customStyle']['BtnStyle'][0]" @tap="$u.debounce(settlement, 500)">
@ -211,13 +207,25 @@
},
methods: {
init() {
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
console.log(newobj);
//
getPhoneAPI({
brand_id: this['BrandInfor']['brand_id'],
type:4
}).then(res=>{
this.SETPHONE(res['data'])
this.SETPHONE(res['data'].phone)
console.log('获取手机号', res.data.phone)
this.getCart();
}).catch(e => {
console.log(e)
this.getCart();
})
},
getCart() {
let products = [];
// deepClone使
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
@ -238,24 +246,30 @@
item['amount'] = item['num'];
// ()
item['Discountarrcondition'] = true;
//
item['pay_price'] = item['product_price'];
products.push(item);
this['shoptotalnum'] += item['num'];
};
//
console.log('初始化');
conWalletInfoAPI().then(res => {
this['amount'] = res['data']['amount'];
// this['amount'] = 4076;
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'];
console.log('初始化', newobj);
this['FormInfor']['products'] = products;
console.log(this['FormInfor'], 'FormInfor')
})
})
//
// conWalletInfoAPI().then(res => {
// this['amount'] = res['data']['amount'];
// // this['amount'] = 4076;
// 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;
// console.log(this['FormInfor'], 'FormInfor')
// })
},
/**
@ -687,6 +701,7 @@
bottom: 0;
left: 0;
z-index: 10;
padding: 20rpx 10rpx;
.text-group_3 {
width: 216rpx;

View File

@ -21,17 +21,16 @@
<text lines="1" class="text_6">{{item['product_name']}}</text>
<view class="text-wrapper_1">
<text lines="1" class="text_7">¥</text>
<text lines="1" class="text_8">{{_amount(item['adj_pay'] * item['num'])}}</text>
<!-- <text lines="1" class="text_8">{{_amount(item['adj_pay'] * item['num'])}}</text> -->
<text lines="1" class="text_8">{{item['adj_pay'] * item['num']}}</text>
</view>
<text lines="1" class="text_9">×{{item['num']}}</text>
</view>
<view class="section_5">
<view class="text-group_1">
<text lines="1"
class="text_14">可用消费补贴卡余额抵扣{{_amount(item['max_deduction'] * item['num'])}}</text>
<text lines="1" class="text_15" v-if="item['Discountarrcondition']"
:class="`themeColor-${BrandInfor['brand_id']}`">您余额不足实际可抵扣{{_amount(item['already_deduction_amount'])}}</text>
<text lines="1" class="text_14">可用消费补贴卡余额抵扣{{_amount(item['max_deduction'] * item['num'])}}</text>
<text lines="1" class="text_15" v-if="item['Discountarrcondition']" :class="`themeColor-${BrandInfor['brand_id']}`">您余额不足实际可抵扣{{_amount(item['already_deduction_amount'])}}</text>
</view>
<!-- 肯德基 -->
<view class="triangle" v-if="BrandInfor['brand_id'] == 1" :style="{'--color':'#C63836'}"
@ -100,12 +99,13 @@
<view class="text-group_3">
<view class="text-wrapper_4 itemamount">
<text lines="1" class="text_24">原价</text>
<text lines="1" class="text_24">{{_amount(calculationamount['prices'])}}</text>
<!-- <text lines="1" class="text_24">{{_amount(calculationamount['prices'])}}</text> -->
<text lines="1" class="text_24">{{calculationamount['prices']}}</text>
</view>
<view class="text-wrapper_4 itemamount">
<text lines="1" class="text_24">实际付款</text>
<text lines="1" class="text_25"
:class="[`themeColor-${BrandInfor['brand_id']}`]">{{_amount(calculationamount['payments'])}}</text>
<!-- <text lines="1" class="text_25" :class="[`themeColor-${BrandInfor['brand_id']}`]">{{_amount(calculationamount['payments'])}}</text> -->
<text lines="1" class="text_25" :class="[`themeColor-${BrandInfor['brand_id']}`]">{{calculationamount['payments']}}</text>
</view>
<view lines="1" class="text_26 itemamount">
消费卡抵扣{{_amount(calculationamount['Actualamounts'])}}
@ -196,6 +196,13 @@
type: 4
}).then(res => {
this.SETPHONE(res['data'])
this.getCart();
}).catch(e => {
this.getCart();
})
},
getCart() {
let products = [];
// deepClone使
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
@ -222,19 +229,21 @@
};
//
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;
})
})
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;
// })
},
/**

View File

@ -91,6 +91,7 @@ class Request {
* @param {String} url请求地址
*/
Request(config = {}) {
console.log(config, '23333')
// 是否存在url
try {
if (!config['url']) {
@ -192,8 +193,9 @@ class Request {
//
// 微信跳转H5后的逻辑为必须携带token
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'];
}
// 测试标识

View File

@ -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});

View File

@ -164,3 +164,18 @@
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;
}

View File

@ -1,3 +1,16 @@
module.exports = {
transpileDependencies: ['uview-ui']
}
transpileDependencies: ['uview-ui'],
devServer: {
port: 5927, // 设置本地开发服务器的端口,选填
proxy: {
'/api': { // 拦截 /api 开头的请求
target: 'https://tpoint.agrimedia.cn/', // 代理目标地址
changeOrigin: true, // 是否改变请求头中的origin
pathRewrite: {
'^/api': '' // 重写路径,将 /api 替换为空字符串
}
}
}
}
};