fix: 点餐数据格式完成
This commit is contained in:
parent
361f444663
commit
6122852202
17
App.vue
17
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,
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<view class="b-rx-commodity-item-commodity-infor">
|
||||
<!-- 商品 -->
|
||||
<view class="b-rx-commodity-item-commodity-infor-name">
|
||||
{{item['product_name']}}
|
||||
{{item['product_name']}}
|
||||
</view>
|
||||
<view v-if="item['sku']" class="b-rx-commodity-item-commodity-infor-sku">
|
||||
{{item['sku']}}
|
||||
|
|
@ -24,14 +24,23 @@
|
|||
<!-- 数量 -->
|
||||
<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)">
|
||||
¥{{RetainDecimalPoint(item['pay_price'] * (item['num']?item['num']:item['amount']))}}
|
||||
¥{{RetainDecimalPoint(item['pay_price'] * (item['num']?item['num']:item['amount']))}}
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -1,331 +1,331 @@
|
|||
<template>
|
||||
<view class="b-rx-sku-popup">
|
||||
<u-popup :show="show" @close="show = false" round="20" closeable zIndex="20080">
|
||||
<view class="commodity-sku">
|
||||
<!-- 商品图 -->
|
||||
<view class="commodity-sku-cover">
|
||||
<!-- 封面 -->
|
||||
<image class="img" :src="skuinfor['product_img']" mode="widthFix"></image>
|
||||
<!-- 名称-数量 -->
|
||||
<view class="commodity-sku-cover-name">
|
||||
<view class="commodity-sku-cover-name-title" :style="{color:Brand()['ThemeColor']}">
|
||||
{{skuinfor['product_name']}}
|
||||
</view>
|
||||
<view class="commodity-sku-cover-name-cart">
|
||||
<image class="img" :src="qnyurl('reduce.png','rx')" mode="" @tap="reducequantity()"></image>
|
||||
<view class="num">
|
||||
{{skuinfor['num']}}
|
||||
</view>
|
||||
<image class="img" :src="qnyurl('add.png','rx')" mode="" @tap="Addquantity()"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 规格 -->
|
||||
<view class="commodity-sku-option" v-if="skuinfor['details']">
|
||||
<template v-for="(item,index) in skuinfor['details']['specifications']">
|
||||
<view class="commodity-sku-option-item" :key="index">
|
||||
<view class="commodity-sku-option-item-label">
|
||||
{{item['name']}}
|
||||
</view>
|
||||
<view class="commodity-sku-option-item-values">
|
||||
<template v-for="(item2,index2) in item['ingredients']">
|
||||
<view @tap="skuClick(index,index2)"
|
||||
:class="{'commodity-sku-option-item-values-activation':item2['checked']}"
|
||||
class="commodity-sku-option-item-values-item" :key="index2">
|
||||
{{item2['name']}}
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="commodity-sku-Infor">
|
||||
<view class="commodity-sku-Infor-left">
|
||||
<view class="commodity-sku-Infor-left-Price">
|
||||
<text class="text1">¥</text>
|
||||
<text class="text2">{{_amount(skuinfor['adj_pay'] * skuinfor['num'])}}</text>
|
||||
<view>{{skuinfor['sku']}}</view>
|
||||
</view>
|
||||
<view class="commodity-sku-Infor-left-sku">
|
||||
{{skutext}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- Addcommodity方法中不可设置形参,因为点击事件默认第一个参数就是点击事件的各种参数并不是形参中所设置的默认值 -->
|
||||
<!-- 所以在点击时手动传入skuinfor参数 -->
|
||||
<view class="commodity-sku-Infor-right" @tap="Addcommodity">
|
||||
加入购物车
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex';
|
||||
import mixin from '@/static/js/mixin/mixin.js'
|
||||
import restaurantmixins from '@/static/js/mixin/restaurantmixins.js'
|
||||
export default {
|
||||
mixins: [mixin, restaurantmixins],
|
||||
name: "b-rx-sku-popup",
|
||||
data() {
|
||||
return {
|
||||
// 弹框显示/隐藏
|
||||
show: false,
|
||||
// 弹框商品详情
|
||||
skuinfor: {},
|
||||
// 规格文字
|
||||
skutext: '',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
GetcommodityInfor: 'shopping/GetcommodityInfor'
|
||||
}),
|
||||
|
||||
},
|
||||
watch: {
|
||||
// 计算属性获取到的弹框详情数据不可直接修改,所以重新赋值便于修改数量
|
||||
GetcommodityInfor(value) {
|
||||
this['skuinfor'] = JSON.parse(JSON.stringify(value));
|
||||
this.skuInit();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* @添加数量
|
||||
* */
|
||||
Addquantity(num = 1) {
|
||||
this['skuinfor']['num'] += num;
|
||||
},
|
||||
/**
|
||||
* @选择规格数量减
|
||||
* */
|
||||
reducequantity(num = 1) {
|
||||
if (this['skuinfor']['num'] == 1) return;
|
||||
this['skuinfor']['num'] -= num;
|
||||
},
|
||||
|
||||
/**
|
||||
* @加入购物车
|
||||
* */
|
||||
Addcommodity() {
|
||||
let self = this;
|
||||
uni.$u.debounce(() => {
|
||||
self.ADD_CART({
|
||||
commodity: self['skuinfor'],
|
||||
quantity: self['skuinfor']['num']
|
||||
}).then(() => {
|
||||
console.log('加入成功');
|
||||
self['show'] = false;
|
||||
console.log(self['show'], 'show');
|
||||
});
|
||||
}, 800, true)
|
||||
},
|
||||
|
||||
/**
|
||||
* @筛选出当前选择的高亮规格
|
||||
* */
|
||||
skuInit() {
|
||||
let r = [];
|
||||
let t = this['skuinfor']['details']['specifications'];
|
||||
let pay = 0;
|
||||
for (let i = 0; i < t['length']; i++) {
|
||||
let item = t[i];
|
||||
r.push(...item['ingredients']);
|
||||
};
|
||||
// 规格文字
|
||||
let newarr = r.filter(item => item['checked']).map(item => item['name']);
|
||||
this['skuinfor']['sku'] = newarr.join('/');
|
||||
// 计算加料价格
|
||||
pay + r.filter(item => item['checked']).map(item => item['price']).reduce(function(previousValue, currentValue) {
|
||||
return previousValue + currentValue;
|
||||
});
|
||||
this['skuinfor']['add_price'] = pay;
|
||||
|
||||
// 实际价格
|
||||
this['skuinfor']['adj_pay'] = (+this['skuinfor']['pay_price']) + (pay * 100);
|
||||
// 查找code
|
||||
let index = -1;
|
||||
let code = '';
|
||||
outer: for (let j = 0; j < this['skuinfor']['details']['sku_infos']['length']; j++) {
|
||||
let item1 = this['skuinfor']['details']['sku_infos'][j];
|
||||
index = 0;
|
||||
code = item1['code'];
|
||||
for (let k = 0; k < item1['values']['length']; k++) {
|
||||
let item2 = item1['values'][k];
|
||||
if (newarr.indexOf(item2['spec_name']) != -1) {
|
||||
index += 1;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (index >= newarr['length']) {
|
||||
this['skuinfor']['sku_code'] = code;
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!code) this['skuinfor']['sku_code'] = this['skuinfor']['details']['sku_infos'][0]['code'];
|
||||
// this['skuinfor']['add_price'] = _newSupItemArr.flatMap(item => item)
|
||||
console.log(this['skuinfor'],'瑞幸筛选的CODE');
|
||||
},
|
||||
|
||||
/**
|
||||
* @规格选择
|
||||
* */
|
||||
skuClick(index1, index2) {
|
||||
let pay = 0;
|
||||
// 将当前点击的类型规格高亮状态改变,其他的设置为不高亮
|
||||
this['skuinfor']['details']['specifications'][index1]['ingredients'].map((item, index) => {
|
||||
if (index2 == index) {
|
||||
item['checked'] = true;
|
||||
} else {
|
||||
item['checked'] = false;
|
||||
}
|
||||
});
|
||||
this.skuInit();
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 规格弹框样式
|
||||
.commodity-sku {
|
||||
&-cover {
|
||||
// height: 560rpx;
|
||||
height: auto;
|
||||
position: relative;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&-title {
|
||||
color: #333333;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
&-name {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: #ffffff;
|
||||
padding: 10rpx 32rpx;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
|
||||
&-cart {
|
||||
flex: 1;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
font-size: 36rpx;
|
||||
align-items: center;
|
||||
|
||||
.num {
|
||||
max-width: 100rpx;
|
||||
min-width: 100rpx;
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-option {
|
||||
padding: 32rpx;
|
||||
|
||||
&-item {
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 15rpx;
|
||||
|
||||
&-label {
|
||||
min-width: 112rpx;
|
||||
height: 100%;
|
||||
color: #999999;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
|
||||
&-values {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
|
||||
&-activation {
|
||||
background: rgba(131, 172, 255, 0.3) !important;
|
||||
border: 1rpx solid #83ACFF !important;
|
||||
color: #4A6FE7 !important;
|
||||
}
|
||||
|
||||
&-item {
|
||||
min-width: 112rpx;
|
||||
height: 100%;
|
||||
line-height: 70rpx;
|
||||
background: #F7F8FA;
|
||||
border-radius: 6rpx;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
margin-right: 15rpx;
|
||||
border: 1rpx solid #F7F8FA;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-Infor {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32rpx;
|
||||
border-top: 1rpx solid rgba(102, 102, 102, 0.1);
|
||||
|
||||
&-left {
|
||||
&-Price {
|
||||
color: #FF780F;
|
||||
|
||||
.text1 {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.text2 {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&-sku {
|
||||
color: #666666;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&-right {
|
||||
width: 254rpx;
|
||||
height: 86rpx;
|
||||
background: linear-gradient(-77deg, #4A6FE7, #83ACFF);
|
||||
box-shadow: 0 6rpx 8rpx 0 rgba(74, 111, 231, 0.2300);
|
||||
border-radius: 43rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="b-rx-sku-popup">
|
||||
<u-popup :show="show" @close="show = false" round="20" closeable zIndex="20080">
|
||||
<view class="commodity-sku">
|
||||
<!-- 商品图 -->
|
||||
<view class="commodity-sku-cover">
|
||||
<!-- 封面 -->
|
||||
<image class="img" :src="skuinfor['product_img']" mode="widthFix"></image>
|
||||
<!-- 名称-数量 -->
|
||||
<view class="commodity-sku-cover-name">
|
||||
<view class="commodity-sku-cover-name-title" :style="{color:Brand()['ThemeColor']}">
|
||||
{{skuinfor['product_name']}}
|
||||
</view>
|
||||
<view class="commodity-sku-cover-name-cart">
|
||||
<image class="img" :src="qnyurl('reduce.png','rx')" mode="" @tap="reducequantity()"></image>
|
||||
<view class="num">
|
||||
{{skuinfor['num']}}
|
||||
</view>
|
||||
<image class="img" :src="qnyurl('add.png','rx')" mode="" @tap="Addquantity()"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 规格 -->
|
||||
<view class="commodity-sku-option" v-if="skuinfor['details']">
|
||||
<template v-for="(item,index) in skuinfor['details']['specifications']">
|
||||
<view class="commodity-sku-option-item" :key="index">
|
||||
<view class="commodity-sku-option-item-label">
|
||||
{{item['name']}}
|
||||
</view>
|
||||
<view class="commodity-sku-option-item-values">
|
||||
<template v-for="(item2,index2) in item['ingredients']">
|
||||
<view @tap="skuClick(index,index2)"
|
||||
:class="{'commodity-sku-option-item-values-activation':item2['checked']}"
|
||||
class="commodity-sku-option-item-values-item" :key="index2">
|
||||
{{item2['name']}}
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="commodity-sku-Infor">
|
||||
<view class="commodity-sku-Infor-left">
|
||||
<view class="commodity-sku-Infor-left-Price">
|
||||
<text class="text1">¥</text>
|
||||
<text class="text2">{{_amount(skuinfor['adj_pay'] * skuinfor['num'])}}</text>
|
||||
<view>{{skuinfor['sku']}}</view>
|
||||
</view>
|
||||
<view class="commodity-sku-Infor-left-sku">
|
||||
{{skutext}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- Addcommodity方法中不可设置形参,因为点击事件默认第一个参数就是点击事件的各种参数并不是形参中所设置的默认值 -->
|
||||
<!-- 所以在点击时手动传入skuinfor参数 -->
|
||||
<view class="commodity-sku-Infor-right" @tap="Addcommodity">
|
||||
加入购物车
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex';
|
||||
import mixin from '@/static/js/mixin/mixin.js'
|
||||
import restaurantmixins from '@/static/js/mixin/restaurantmixins.js'
|
||||
export default {
|
||||
mixins: [mixin, restaurantmixins],
|
||||
name: "b-rx-sku-popup",
|
||||
data() {
|
||||
return {
|
||||
// 弹框显示/隐藏
|
||||
show: false,
|
||||
// 弹框商品详情
|
||||
skuinfor: {},
|
||||
// 规格文字
|
||||
skutext: '',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
GetcommodityInfor: 'shopping/GetcommodityInfor'
|
||||
}),
|
||||
|
||||
},
|
||||
watch: {
|
||||
// 计算属性获取到的弹框详情数据不可直接修改,所以重新赋值便于修改数量
|
||||
GetcommodityInfor(value) {
|
||||
this['skuinfor'] = JSON.parse(JSON.stringify(value));
|
||||
this.skuInit();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* @添加数量
|
||||
* */
|
||||
Addquantity(num = 1) {
|
||||
this['skuinfor']['num'] += num;
|
||||
},
|
||||
/**
|
||||
* @选择规格数量减
|
||||
* */
|
||||
reducequantity(num = 1) {
|
||||
if (this['skuinfor']['num'] == 1) return;
|
||||
this['skuinfor']['num'] -= num;
|
||||
},
|
||||
|
||||
/**
|
||||
* @加入购物车
|
||||
* */
|
||||
Addcommodity() {
|
||||
let self = this;
|
||||
uni.$u.debounce(() => {
|
||||
self.ADD_CART({
|
||||
commodity: self['skuinfor'],
|
||||
quantity: self['skuinfor']['num']
|
||||
}).then(() => {
|
||||
console.log('加入成功');
|
||||
self['show'] = false;
|
||||
console.log(self['show'], 'show');
|
||||
});
|
||||
}, 800, true)
|
||||
},
|
||||
|
||||
/**
|
||||
* @筛选出当前选择的高亮规格
|
||||
* */
|
||||
skuInit() {
|
||||
let r = [];
|
||||
let t = this['skuinfor']['details']['specifications'];
|
||||
let pay = 0;
|
||||
for (let i = 0; i < t['length']; i++) {
|
||||
let item = t[i];
|
||||
r.push(...item['ingredients']);
|
||||
};
|
||||
// 规格文字
|
||||
let newarr = r.filter(item => item['checked']).map(item => item['name']);
|
||||
this['skuinfor']['sku'] = newarr.join('/');
|
||||
// 计算加料价格
|
||||
pay + r.filter(item => item['checked']).map(item => item['price']).reduce(function(previousValue, currentValue) {
|
||||
return previousValue + currentValue;
|
||||
});
|
||||
this['skuinfor']['add_price'] = pay;
|
||||
|
||||
// 实际价格
|
||||
this['skuinfor']['adj_pay'] = (+this['skuinfor']['pay_price']) + (pay * 100);
|
||||
// 查找code
|
||||
let index = -1;
|
||||
let code = '';
|
||||
outer: for (let j = 0; j < this['skuinfor']['details']['sku_infos']['length']; j++) {
|
||||
let item1 = this['skuinfor']['details']['sku_infos'][j];
|
||||
index = 0;
|
||||
code = item1['code'];
|
||||
for (let k = 0; k < item1['values']['length']; k++) {
|
||||
let item2 = item1['values'][k];
|
||||
if (newarr.indexOf(item2['spec_name']) != -1) {
|
||||
index += 1;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (index >= newarr['length']) {
|
||||
this['skuinfor']['sku_code'] = code;
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!code) this['skuinfor']['sku_code'] = this['skuinfor']['details']['sku_infos'][0]['code'];
|
||||
// this['skuinfor']['add_price'] = _newSupItemArr.flatMap(item => item)
|
||||
console.log(this['skuinfor'],'瑞幸筛选的CODE');
|
||||
},
|
||||
|
||||
/**
|
||||
* @规格选择
|
||||
* */
|
||||
skuClick(index1, index2) {
|
||||
let pay = 0;
|
||||
// 将当前点击的类型规格高亮状态改变,其他的设置为不高亮
|
||||
this['skuinfor']['details']['specifications'][index1]['ingredients'].map((item, index) => {
|
||||
if (index2 == index) {
|
||||
item['checked'] = true;
|
||||
} else {
|
||||
item['checked'] = false;
|
||||
}
|
||||
});
|
||||
this.skuInit();
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 规格弹框样式
|
||||
.commodity-sku {
|
||||
&-cover {
|
||||
// height: 560rpx;
|
||||
height: auto;
|
||||
position: relative;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&-title {
|
||||
color: #333333;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
&-name {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: #ffffff;
|
||||
padding: 10rpx 32rpx;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
|
||||
&-cart {
|
||||
flex: 1;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
font-size: 36rpx;
|
||||
align-items: center;
|
||||
|
||||
.num {
|
||||
max-width: 100rpx;
|
||||
min-width: 100rpx;
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-option {
|
||||
padding: 32rpx;
|
||||
|
||||
&-item {
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 15rpx;
|
||||
|
||||
&-label {
|
||||
min-width: 112rpx;
|
||||
height: 100%;
|
||||
color: #999999;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
|
||||
&-values {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
|
||||
&-activation {
|
||||
background: rgba(131, 172, 255, 0.3) !important;
|
||||
border: 1rpx solid #83ACFF !important;
|
||||
color: #4A6FE7 !important;
|
||||
}
|
||||
|
||||
&-item {
|
||||
min-width: 112rpx;
|
||||
height: 100%;
|
||||
line-height: 70rpx;
|
||||
background: #F7F8FA;
|
||||
border-radius: 6rpx;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
margin-right: 15rpx;
|
||||
border: 1rpx solid #F7F8FA;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-Infor {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32rpx;
|
||||
border-top: 1rpx solid rgba(102, 102, 102, 0.1);
|
||||
|
||||
&-left {
|
||||
&-Price {
|
||||
color: #FF780F;
|
||||
|
||||
.text1 {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.text2 {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&-sku {
|
||||
color: #666666;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&-right {
|
||||
width: 254rpx;
|
||||
height: 86rpx;
|
||||
background: linear-gradient(-77deg, #4A6FE7, #83ACFF);
|
||||
box-shadow: 0 6rpx 8rpx 0 rgba(74, 111, 231, 0.2300);
|
||||
border-radius: 43rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -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/", //目标接口域名
|
||||
|
|
|
|||
|
|
@ -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':'']">
|
||||
|
|
@ -34,9 +35,9 @@
|
|||
<!-- 价格 -->
|
||||
<view class="money">
|
||||
<view class="price">
|
||||
<text class="yang">¥</text>
|
||||
<text
|
||||
class="amount">{{RetainDecimalPoint(item['pay_price'] * item['num'])}}</text>
|
||||
<text class="yang">¥</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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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="yang">原价:¥</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="yang">补贴后价格:¥</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)">
|
||||
|
|
@ -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'])
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
<!-- 右侧商品选项 -->
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
<!-- 闭店提示 -->
|
||||
<b-load :show="close" width="196" height="169" position="absolute" color="#000000" type="close">
|
||||
</b-load>
|
||||
</b-load>
|
||||
<!-- 加载提示 -->
|
||||
<b-load :show="loading" background="rgba(0,0,0,0.05)" width="60" height="70" position="absolute" color="#FFFFFF"
|
||||
type="load">
|
||||
|
|
@ -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'];
|
||||
|
|
|
|||
|
|
@ -47,15 +47,13 @@
|
|||
|
||||
<!-- 商品列表 -->
|
||||
<view class="box_3">
|
||||
<text lines="1" class="text_5">订单详情</text>
|
||||
<text lines="1" class="text_5">订单详情</text>
|
||||
<template v-for="(item,index) in FormInfor['products']">
|
||||
<view class="Commodity-Item" @tap="ischoiceDiscount(item,index)">
|
||||
<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)">
|
||||
|
|
@ -210,52 +206,70 @@
|
|||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
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'])
|
||||
|
||||
let products = [];
|
||||
// 因为进入时暂时获取不到deepClone方法所以使用反转化
|
||||
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
|
||||
for (let i = 0; i < newobj['length']; i++) {
|
||||
let item = newobj[i];
|
||||
// 是否抵扣
|
||||
if (item['max_deduction'] > 0) {
|
||||
item['is_deduction'] = 1;
|
||||
} else {
|
||||
item['is_deduction'] = 0;
|
||||
}
|
||||
// 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'] = 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')
|
||||
})
|
||||
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']));
|
||||
for (let i = 0; i < newobj['length']; i++) {
|
||||
let item = newobj[i];
|
||||
// 是否抵扣
|
||||
if (item['max_deduction'] > 0) {
|
||||
item['is_deduction'] = 1;
|
||||
} else {
|
||||
item['is_deduction'] = 0;
|
||||
}
|
||||
// item['max_deduction'] = 300
|
||||
// 抵扣金额(用于显示)
|
||||
item['deduction_amount'] = 0;
|
||||
// 已抵扣金额(用于逻辑计算)
|
||||
item['already_deduction_amount'] = 0;
|
||||
// 接口需要提交数量
|
||||
item['amount'] = item['num'];
|
||||
// 消费卡抵扣状态(抵扣条件)
|
||||
item['Discountarrcondition'] = true;
|
||||
|
||||
// 修改数据格式
|
||||
item['pay_price'] = item['product_price'];
|
||||
|
||||
products.push(item);
|
||||
this['shoptotalnum'] += item['num'];
|
||||
};
|
||||
// 获取余额
|
||||
console.log('初始化', newobj);
|
||||
this['FormInfor']['products'] = products;
|
||||
|
||||
// 好像是查询补贴卡的
|
||||
// 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')
|
||||
// })
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -686,7 +700,8 @@
|
|||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
z-index: 10;
|
||||
padding: 20rpx 10rpx;
|
||||
|
||||
.text-group_3 {
|
||||
width: 216rpx;
|
||||
|
|
|
|||
|
|
@ -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,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;
|
||||
// })
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
}
|
||||
|
||||
// 测试标识
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
module.exports = {
|
||||
transpileDependencies: ['uview-ui']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
transpileDependencies: ['uview-ui'],
|
||||
devServer: {
|
||||
port: 5927, // 设置本地开发服务器的端口,选填
|
||||
proxy: {
|
||||
'/api': { // 拦截 /api 开头的请求
|
||||
target: 'https://tpoint.agrimedia.cn/', // 代理目标地址
|
||||
changeOrigin: true, // 是否改变请求头中的origin
|
||||
pathRewrite: {
|
||||
'^/api': '' // 重写路径,将 /api 替换为空字符串
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue