fix: 点餐数据格式完成
This commit is contained in:
parent
361f444663
commit
6122852202
17
App.vue
17
App.vue
|
|
@ -92,10 +92,25 @@
|
||||||
console.log(querys);
|
console.log(querys);
|
||||||
querys[key] = JSON.parse(querys[key])
|
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){
|
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'])});
|
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">
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<view class="b-rx-commodity-item-commodity-infor-name">
|
<view class="b-rx-commodity-item-commodity-infor-name">
|
||||||
{{item['product_name']}}
|
{{item['product_name']}}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item['sku']" class="b-rx-commodity-item-commodity-infor-sku">
|
<view v-if="item['sku']" class="b-rx-commodity-item-commodity-infor-sku">
|
||||||
{{item['sku']}}
|
{{item['sku']}}
|
||||||
|
|
@ -24,14 +24,23 @@
|
||||||
<!-- 数量 -->
|
<!-- 数量 -->
|
||||||
<view class="quantity">
|
<view class="quantity">
|
||||||
<!-- 订单列表中的商品数据价格是后台计算过的所以直接使用就行了original_price属性之后订单数据才会返回 -->
|
<!-- 订单列表中的商品数据价格是后台计算过的所以直接使用就行了original_price属性之后订单数据才会返回 -->
|
||||||
<view class="num" v-if="item['original_price']">
|
<!-- <view class="num" v-if="item['original_price']">
|
||||||
¥{{RetainDecimalPoint(item['pay_price'])}}
|
¥{{RetainDecimalPoint(item['pay_price'])}}
|
||||||
</view>
|
</view>
|
||||||
<view class="num" v-else-if="!item['original_price'] && (BrandInfor['brand_id'] == 13 || BrandInfor['brand_id'] == 1)">
|
<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>
|
||||||
<view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10">
|
<view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10">
|
||||||
¥{{RetainDecimalPoint(item['adj_pay'] * (item['num']?item['num']:item['amount']))}}
|
¥{{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>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -1,331 +1,331 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="b-rx-sku-popup">
|
<view class="b-rx-sku-popup">
|
||||||
<u-popup :show="show" @close="show = false" round="20" closeable zIndex="20080">
|
<u-popup :show="show" @close="show = false" round="20" closeable zIndex="20080">
|
||||||
<view class="commodity-sku">
|
<view class="commodity-sku">
|
||||||
<!-- 商品图 -->
|
<!-- 商品图 -->
|
||||||
<view class="commodity-sku-cover">
|
<view class="commodity-sku-cover">
|
||||||
<!-- 封面 -->
|
<!-- 封面 -->
|
||||||
<image class="img" :src="skuinfor['product_img']" mode="widthFix"></image>
|
<image class="img" :src="skuinfor['product_img']" mode="widthFix"></image>
|
||||||
<!-- 名称-数量 -->
|
<!-- 名称-数量 -->
|
||||||
<view class="commodity-sku-cover-name">
|
<view class="commodity-sku-cover-name">
|
||||||
<view class="commodity-sku-cover-name-title" :style="{color:Brand()['ThemeColor']}">
|
<view class="commodity-sku-cover-name-title" :style="{color:Brand()['ThemeColor']}">
|
||||||
{{skuinfor['product_name']}}
|
{{skuinfor['product_name']}}
|
||||||
</view>
|
</view>
|
||||||
<view class="commodity-sku-cover-name-cart">
|
<view class="commodity-sku-cover-name-cart">
|
||||||
<image class="img" :src="qnyurl('reduce.png','rx')" mode="" @tap="reducequantity()"></image>
|
<image class="img" :src="qnyurl('reduce.png','rx')" mode="" @tap="reducequantity()"></image>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
{{skuinfor['num']}}
|
{{skuinfor['num']}}
|
||||||
</view>
|
</view>
|
||||||
<image class="img" :src="qnyurl('add.png','rx')" mode="" @tap="Addquantity()"></image>
|
<image class="img" :src="qnyurl('add.png','rx')" mode="" @tap="Addquantity()"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 规格 -->
|
<!-- 规格 -->
|
||||||
<view class="commodity-sku-option" v-if="skuinfor['details']">
|
<view class="commodity-sku-option" v-if="skuinfor['details']">
|
||||||
<template v-for="(item,index) in skuinfor['details']['specifications']">
|
<template v-for="(item,index) in skuinfor['details']['specifications']">
|
||||||
<view class="commodity-sku-option-item" :key="index">
|
<view class="commodity-sku-option-item" :key="index">
|
||||||
<view class="commodity-sku-option-item-label">
|
<view class="commodity-sku-option-item-label">
|
||||||
{{item['name']}}
|
{{item['name']}}
|
||||||
</view>
|
</view>
|
||||||
<view class="commodity-sku-option-item-values">
|
<view class="commodity-sku-option-item-values">
|
||||||
<template v-for="(item2,index2) in item['ingredients']">
|
<template v-for="(item2,index2) in item['ingredients']">
|
||||||
<view @tap="skuClick(index,index2)"
|
<view @tap="skuClick(index,index2)"
|
||||||
:class="{'commodity-sku-option-item-values-activation':item2['checked']}"
|
:class="{'commodity-sku-option-item-values-activation':item2['checked']}"
|
||||||
class="commodity-sku-option-item-values-item" :key="index2">
|
class="commodity-sku-option-item-values-item" :key="index2">
|
||||||
{{item2['name']}}
|
{{item2['name']}}
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<view class="commodity-sku-Infor">
|
<view class="commodity-sku-Infor">
|
||||||
<view class="commodity-sku-Infor-left">
|
<view class="commodity-sku-Infor-left">
|
||||||
<view class="commodity-sku-Infor-left-Price">
|
<view class="commodity-sku-Infor-left-Price">
|
||||||
<text class="text1">¥</text>
|
<text class="text1">¥</text>
|
||||||
<text class="text2">{{_amount(skuinfor['adj_pay'] * skuinfor['num'])}}</text>
|
<text class="text2">{{_amount(skuinfor['adj_pay'] * skuinfor['num'])}}</text>
|
||||||
<view>{{skuinfor['sku']}}</view>
|
<view>{{skuinfor['sku']}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="commodity-sku-Infor-left-sku">
|
<view class="commodity-sku-Infor-left-sku">
|
||||||
{{skutext}}
|
{{skutext}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- Addcommodity方法中不可设置形参,因为点击事件默认第一个参数就是点击事件的各种参数并不是形参中所设置的默认值 -->
|
<!-- Addcommodity方法中不可设置形参,因为点击事件默认第一个参数就是点击事件的各种参数并不是形参中所设置的默认值 -->
|
||||||
<!-- 所以在点击时手动传入skuinfor参数 -->
|
<!-- 所以在点击时手动传入skuinfor参数 -->
|
||||||
<view class="commodity-sku-Infor-right" @tap="Addcommodity">
|
<view class="commodity-sku-Infor-right" @tap="Addcommodity">
|
||||||
加入购物车
|
加入购物车
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapGetters
|
mapGetters
|
||||||
} from 'vuex';
|
} from 'vuex';
|
||||||
import mixin from '@/static/js/mixin/mixin.js'
|
import mixin from '@/static/js/mixin/mixin.js'
|
||||||
import restaurantmixins from '@/static/js/mixin/restaurantmixins.js'
|
import restaurantmixins from '@/static/js/mixin/restaurantmixins.js'
|
||||||
export default {
|
export default {
|
||||||
mixins: [mixin, restaurantmixins],
|
mixins: [mixin, restaurantmixins],
|
||||||
name: "b-rx-sku-popup",
|
name: "b-rx-sku-popup",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 弹框显示/隐藏
|
// 弹框显示/隐藏
|
||||||
show: false,
|
show: false,
|
||||||
// 弹框商品详情
|
// 弹框商品详情
|
||||||
skuinfor: {},
|
skuinfor: {},
|
||||||
// 规格文字
|
// 规格文字
|
||||||
skutext: '',
|
skutext: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
GetcommodityInfor: 'shopping/GetcommodityInfor'
|
GetcommodityInfor: 'shopping/GetcommodityInfor'
|
||||||
}),
|
}),
|
||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 计算属性获取到的弹框详情数据不可直接修改,所以重新赋值便于修改数量
|
// 计算属性获取到的弹框详情数据不可直接修改,所以重新赋值便于修改数量
|
||||||
GetcommodityInfor(value) {
|
GetcommodityInfor(value) {
|
||||||
this['skuinfor'] = JSON.parse(JSON.stringify(value));
|
this['skuinfor'] = JSON.parse(JSON.stringify(value));
|
||||||
this.skuInit();
|
this.skuInit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* @添加数量
|
* @添加数量
|
||||||
* */
|
* */
|
||||||
Addquantity(num = 1) {
|
Addquantity(num = 1) {
|
||||||
this['skuinfor']['num'] += num;
|
this['skuinfor']['num'] += num;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @选择规格数量减
|
* @选择规格数量减
|
||||||
* */
|
* */
|
||||||
reducequantity(num = 1) {
|
reducequantity(num = 1) {
|
||||||
if (this['skuinfor']['num'] == 1) return;
|
if (this['skuinfor']['num'] == 1) return;
|
||||||
this['skuinfor']['num'] -= num;
|
this['skuinfor']['num'] -= num;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @加入购物车
|
* @加入购物车
|
||||||
* */
|
* */
|
||||||
Addcommodity() {
|
Addcommodity() {
|
||||||
let self = this;
|
let self = this;
|
||||||
uni.$u.debounce(() => {
|
uni.$u.debounce(() => {
|
||||||
self.ADD_CART({
|
self.ADD_CART({
|
||||||
commodity: self['skuinfor'],
|
commodity: self['skuinfor'],
|
||||||
quantity: self['skuinfor']['num']
|
quantity: self['skuinfor']['num']
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.log('加入成功');
|
console.log('加入成功');
|
||||||
self['show'] = false;
|
self['show'] = false;
|
||||||
console.log(self['show'], 'show');
|
console.log(self['show'], 'show');
|
||||||
});
|
});
|
||||||
}, 800, true)
|
}, 800, true)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @筛选出当前选择的高亮规格
|
* @筛选出当前选择的高亮规格
|
||||||
* */
|
* */
|
||||||
skuInit() {
|
skuInit() {
|
||||||
let r = [];
|
let r = [];
|
||||||
let t = this['skuinfor']['details']['specifications'];
|
let t = this['skuinfor']['details']['specifications'];
|
||||||
let pay = 0;
|
let pay = 0;
|
||||||
for (let i = 0; i < t['length']; i++) {
|
for (let i = 0; i < t['length']; i++) {
|
||||||
let item = t[i];
|
let item = t[i];
|
||||||
r.push(...item['ingredients']);
|
r.push(...item['ingredients']);
|
||||||
};
|
};
|
||||||
// 规格文字
|
// 规格文字
|
||||||
let newarr = r.filter(item => item['checked']).map(item => item['name']);
|
let newarr = r.filter(item => item['checked']).map(item => item['name']);
|
||||||
this['skuinfor']['sku'] = newarr.join('/');
|
this['skuinfor']['sku'] = newarr.join('/');
|
||||||
// 计算加料价格
|
// 计算加料价格
|
||||||
pay + r.filter(item => item['checked']).map(item => item['price']).reduce(function(previousValue, currentValue) {
|
pay + r.filter(item => item['checked']).map(item => item['price']).reduce(function(previousValue, currentValue) {
|
||||||
return previousValue + currentValue;
|
return previousValue + currentValue;
|
||||||
});
|
});
|
||||||
this['skuinfor']['add_price'] = pay;
|
this['skuinfor']['add_price'] = pay;
|
||||||
|
|
||||||
// 实际价格
|
// 实际价格
|
||||||
this['skuinfor']['adj_pay'] = (+this['skuinfor']['pay_price']) + (pay * 100);
|
this['skuinfor']['adj_pay'] = (+this['skuinfor']['pay_price']) + (pay * 100);
|
||||||
// 查找code
|
// 查找code
|
||||||
let index = -1;
|
let index = -1;
|
||||||
let code = '';
|
let code = '';
|
||||||
outer: for (let j = 0; j < this['skuinfor']['details']['sku_infos']['length']; j++) {
|
outer: for (let j = 0; j < this['skuinfor']['details']['sku_infos']['length']; j++) {
|
||||||
let item1 = this['skuinfor']['details']['sku_infos'][j];
|
let item1 = this['skuinfor']['details']['sku_infos'][j];
|
||||||
index = 0;
|
index = 0;
|
||||||
code = item1['code'];
|
code = item1['code'];
|
||||||
for (let k = 0; k < item1['values']['length']; k++) {
|
for (let k = 0; k < item1['values']['length']; k++) {
|
||||||
let item2 = item1['values'][k];
|
let item2 = item1['values'][k];
|
||||||
if (newarr.indexOf(item2['spec_name']) != -1) {
|
if (newarr.indexOf(item2['spec_name']) != -1) {
|
||||||
index += 1;
|
index += 1;
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (index >= newarr['length']) {
|
if (index >= newarr['length']) {
|
||||||
this['skuinfor']['sku_code'] = code;
|
this['skuinfor']['sku_code'] = code;
|
||||||
break outer;
|
break outer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (!code) this['skuinfor']['sku_code'] = this['skuinfor']['details']['sku_infos'][0]['code'];
|
if (!code) this['skuinfor']['sku_code'] = this['skuinfor']['details']['sku_infos'][0]['code'];
|
||||||
// this['skuinfor']['add_price'] = _newSupItemArr.flatMap(item => item)
|
// this['skuinfor']['add_price'] = _newSupItemArr.flatMap(item => item)
|
||||||
console.log(this['skuinfor'],'瑞幸筛选的CODE');
|
console.log(this['skuinfor'],'瑞幸筛选的CODE');
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @规格选择
|
* @规格选择
|
||||||
* */
|
* */
|
||||||
skuClick(index1, index2) {
|
skuClick(index1, index2) {
|
||||||
let pay = 0;
|
let pay = 0;
|
||||||
// 将当前点击的类型规格高亮状态改变,其他的设置为不高亮
|
// 将当前点击的类型规格高亮状态改变,其他的设置为不高亮
|
||||||
this['skuinfor']['details']['specifications'][index1]['ingredients'].map((item, index) => {
|
this['skuinfor']['details']['specifications'][index1]['ingredients'].map((item, index) => {
|
||||||
if (index2 == index) {
|
if (index2 == index) {
|
||||||
item['checked'] = true;
|
item['checked'] = true;
|
||||||
} else {
|
} else {
|
||||||
item['checked'] = false;
|
item['checked'] = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.skuInit();
|
this.skuInit();
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// 规格弹框样式
|
// 规格弹框样式
|
||||||
.commodity-sku {
|
.commodity-sku {
|
||||||
&-cover {
|
&-cover {
|
||||||
// height: 560rpx;
|
// height: 560rpx;
|
||||||
height: auto;
|
height: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-name {
|
&-name {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
padding: 10rpx 32rpx;
|
padding: 10rpx 32rpx;
|
||||||
background-color: rgba(255, 255, 255, 0.5);
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
|
||||||
&-cart {
|
&-cart {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
max-width: 100rpx;
|
max-width: 100rpx;
|
||||||
min-width: 100rpx;
|
min-width: 100rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
width: 42rpx;
|
width: 42rpx;
|
||||||
height: 42rpx;
|
height: 42rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-option {
|
&-option {
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
margin-bottom: 15rpx;
|
margin-bottom: 15rpx;
|
||||||
|
|
||||||
&-label {
|
&-label {
|
||||||
min-width: 112rpx;
|
min-width: 112rpx;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-values {
|
&-values {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|
||||||
&-activation {
|
&-activation {
|
||||||
background: rgba(131, 172, 255, 0.3) !important;
|
background: rgba(131, 172, 255, 0.3) !important;
|
||||||
border: 1rpx solid #83ACFF !important;
|
border: 1rpx solid #83ACFF !important;
|
||||||
color: #4A6FE7 !important;
|
color: #4A6FE7 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
min-width: 112rpx;
|
min-width: 112rpx;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
background: #F7F8FA;
|
background: #F7F8FA;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
border: 1rpx solid #F7F8FA;
|
border: 1rpx solid #F7F8FA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-Infor {
|
&-Infor {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
border-top: 1rpx solid rgba(102, 102, 102, 0.1);
|
border-top: 1rpx solid rgba(102, 102, 102, 0.1);
|
||||||
|
|
||||||
&-left {
|
&-left {
|
||||||
&-Price {
|
&-Price {
|
||||||
color: #FF780F;
|
color: #FF780F;
|
||||||
|
|
||||||
.text1 {
|
.text1 {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text2 {
|
.text2 {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-sku {
|
&-sku {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-right {
|
&-right {
|
||||||
width: 254rpx;
|
width: 254rpx;
|
||||||
height: 86rpx;
|
height: 86rpx;
|
||||||
background: linear-gradient(-77deg, #4A6FE7, #83ACFF);
|
background: linear-gradient(-77deg, #4A6FE7, #83ACFF);
|
||||||
box-shadow: 0 6rpx 8rpx 0 rgba(74, 111, 231, 0.2300);
|
box-shadow: 0 6rpx 8rpx 0 rgba(74, 111, 231, 0.2300);
|
||||||
border-radius: 43rpx;
|
border-radius: 43rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 86rpx;
|
line-height: 86rpx;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -71,26 +71,14 @@
|
||||||
"vueVersion" : "2",
|
"vueVersion" : "2",
|
||||||
"h5" : {
|
"h5" : {
|
||||||
"devServer" : {
|
"devServer" : {
|
||||||
|
"port": 8090,
|
||||||
"disableHostCheck" : true,
|
"disableHostCheck" : true,
|
||||||
"proxy" : {
|
"proxy" : {
|
||||||
"/card" : {
|
"/api/" : {
|
||||||
"target" : "https://jc.agrimedia.cn/", //目标接口域名
|
"target" : "https://tpoint.agrimedia.cn/", //目标接口域名
|
||||||
|
"changeOrigin" : true, //是跨域
|
||||||
// https://jc.zdyyq.com
|
"secure" : true //设置支持https协议的代理
|
||||||
// "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协议的代理
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// "/xd" : {
|
// "/xd" : {
|
||||||
// "target" : "https://jc.agrimedia.cn/", //目标接口域名
|
// "target" : "https://jc.agrimedia.cn/", //目标接口域名
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<text class="yang">¥</text>
|
<text class="yang">¥</text>
|
||||||
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
|
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
|
||||||
|
<text class="amount">{{totalPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right" @tap="create" :class="[Shoplength > 0?'right2':'']">
|
<view class="right" @tap="create" :class="[Shoplength > 0?'right2':'']">
|
||||||
|
|
@ -34,9 +35,9 @@
|
||||||
<!-- 价格 -->
|
<!-- 价格 -->
|
||||||
<view class="money">
|
<view class="money">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<text class="yang">¥</text>
|
<text class="yang">¥</text>
|
||||||
<text
|
<text class="amount">{{item['adj_pay'] * item['num']}}</text>
|
||||||
class="amount">{{RetainDecimalPoint(item['pay_price'] * item['num'])}}</text>
|
<!-- <text class="amount">{{RetainDecimalPoint(item['pay_price'] * item['num'])}}</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 数量 -->
|
<!-- 数量 -->
|
||||||
|
|
@ -80,7 +81,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="NX-Cart-left-price">
|
<view class="NX-Cart-left-price">
|
||||||
<text class="yang">¥</text>
|
<text class="yang">¥</text>
|
||||||
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
|
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
|
||||||
|
<text class="amount">{{totalPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="NX-Cart-right" @tap="create" :class="[Shoplength > 0?'right2':'']">
|
<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">
|
||||||
<view class="NX-Cart-Popup-item-commodity-infor-money-price">
|
<view class="NX-Cart-Popup-item-commodity-infor-money-price">
|
||||||
<text
|
<text class="NX-Cart-Popup-item-commodity-infor-money-yang">¥</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
|
<text class="NX-Cart-Popup-item-commodity-infor-money-amount">{{item['adj_pay'] * item['num']}}</text>
|
||||||
class="NX-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint(item['adj_pay'] * item['num'])}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -169,7 +170,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="MDL-Cart-left-price">
|
<view class="MDL-Cart-left-price">
|
||||||
<text class="yang">¥</text>
|
<text class="yang">¥</text>
|
||||||
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
|
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
|
||||||
|
<text class="amount">{{totalPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="MDL-Cart-right theme-Union-Class-5-1" @tap="create" :class="[Shoplength > 0?'right2':'']">
|
<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">
|
||||||
<view class="MDL-Cart-Popup-item-commodity-infor-money-price">
|
<view class="MDL-Cart-Popup-item-commodity-infor-money-price">
|
||||||
<text
|
<text class="MDL-Cart-Popup-item-commodity-infor-money-yang">¥</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
|
<!-- <text class="MDL-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint((item['pay_price'] * item['num']))}}</text> -->
|
||||||
class="MDL-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint((item['pay_price'] * item['num']))}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -249,7 +250,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="XBK-Cart-left-price">
|
<view class="XBK-Cart-left-price">
|
||||||
<text class="yang">¥</text>
|
<text class="yang">¥</text>
|
||||||
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
|
<!-- <text class="amount">{{RetainDecimalPoint(totalPrice)}}</text> -->
|
||||||
|
<text class="amount">{{totalPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="XBK-Cart-right" @tap="create" :class="[Shoplength > 0?'right2':'']">
|
<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">
|
||||||
<view class="XBK-Cart-Popup-item-commodity-infor-money-price">
|
<view class="XBK-Cart-Popup-item-commodity-infor-money-price">
|
||||||
<text
|
<text class="XBK-Cart-Popup-item-commodity-infor-money-yang">¥</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
|
<text class="XBK-Cart-Popup-item-commodity-infor-money-amount">{{(item['adj_pay'] * item['num'])}}</text>
|
||||||
class="XBK-Cart-Popup-item-commodity-infor-money-amount">{{RetainDecimalPoint((item['adj_pay'] * item['num']))}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -338,7 +339,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="RX-Cart-left-price">
|
<view class="RX-Cart-left-price">
|
||||||
<text class="yang">¥</text>
|
<text class="yang">¥</text>
|
||||||
<text class="amount">{{RetainDecimalPoint(totalPrice)}}</text>
|
<text class="amount">{{totalPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="RX-Cart-right" @tap="create" :class="[Shoplength > 0?'right2':'']">
|
<view class="RX-Cart-right" @tap="create" :class="[Shoplength > 0?'right2':'']">
|
||||||
|
|
@ -379,7 +380,7 @@
|
||||||
<text
|
<text
|
||||||
class="RX-Cart-Popup-item-commodity-infor-money-yang">¥</text>
|
class="RX-Cart-Popup-item-commodity-infor-money-yang">¥</text>
|
||||||
<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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -514,7 +515,7 @@
|
||||||
};
|
};
|
||||||
console.log(item['sku'],'当前sku');
|
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'];
|
Price += item['adj_pay'] * item['num'];
|
||||||
newArr.push(item);
|
newArr.push(item);
|
||||||
console.log(this['GetCartList'][id],'是否规格商品');
|
console.log(this['GetCartList'][id],'是否规格商品');
|
||||||
|
|
@ -534,7 +535,7 @@
|
||||||
// 商品加料价格
|
// 商品加料价格
|
||||||
add_price: _item?.add_price?_item['add_price']:0
|
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'];
|
Price += _item['adj_pay'] * _item['num'];
|
||||||
this['GetCartList'][id]['Differentskulist'][i] = _item;
|
this['GetCartList'][id]['Differentskulist'][i] = _item;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this['GetShopInfor'],'GetShopInfor');
|
console.log(this['GetShopInfor'],'GetShopInfor页面页面页面页面页面页面页面页面页面页面页面页面页面页面页面页面');
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@
|
||||||
.Shop-Head {
|
.Shop-Head {
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 131rpx;
|
height: 150rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,26 @@
|
||||||
{{item['product_name']}}
|
{{item['product_name']}}
|
||||||
</view>
|
</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'])}}元
|
最高补贴{{RetainDecimalPoint(item['max_deduction'])}}元
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 价格 -->
|
<!-- 价格 -->
|
||||||
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
||||||
<text class="yang">原价:¥</text>
|
<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>
|
||||||
<!-- 优惠补贴后的价格 -->
|
<!-- 优惠补贴后的价格 -->
|
||||||
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
||||||
<text class="yang">补贴后价格:¥</text>
|
<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>
|
||||||
<!-- 该商品为套餐商品并且套餐中有可选商品则显示为选规格 -->
|
<!-- 该商品为套餐商品并且套餐中有可选商品则显示为选规格 -->
|
||||||
<view class="shop_home-commodity-infor-cart-sku" v-if="ISSpecifications" @tap="$u.debounce(Addcommodity, 800,true)">
|
<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>
|
||||||
</view>
|
</view>
|
||||||
<!-- 星巴克 -->
|
<!-- 星巴克/瑞幸 -->
|
||||||
<view class="shop_home-commodity-infor" v-if="BrandInfor['brand_id'] == 10 || BrandInfor['brand_id'] == 13">
|
<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">
|
<view class="shop_home-commodity-infor-title shop_home-commodity-infor-bottom">
|
||||||
{{item['product_name']}}
|
{{item['product_name']}}
|
||||||
</view>
|
</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'])}}元
|
最高补贴{{RetainDecimalPoint(item['max_deduction'])}}元
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 价格 -->
|
<!-- 价格 -->
|
||||||
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
||||||
<text class="yang">原价:¥</text>
|
<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>
|
||||||
<!-- 优惠补贴后的价格 -->
|
<!-- 优惠补贴后的价格 -->
|
||||||
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
||||||
<text class="yang">补贴后价格:¥</text>
|
<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>
|
||||||
<!-- 选规格 -->
|
<!-- 选规格 -->
|
||||||
<view class="shop_home-commodity-infor-cart-sku" @tap="$u.debounce(Addcommodity, 800,true)">
|
<view class="shop_home-commodity-infor-cart-sku" @tap="$u.debounce(Addcommodity, 800,true)">
|
||||||
|
|
@ -81,18 +97,26 @@
|
||||||
{{item['product_name']}}
|
{{item['product_name']}}
|
||||||
</view>
|
</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'])}}元
|
最高补贴{{RetainDecimalPoint(item['max_deduction'])}}元
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 价格 -->
|
<!-- 价格 -->
|
||||||
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
||||||
<text class="yang">原价:¥</text>
|
<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>
|
||||||
<!-- 优惠补贴后的价格 -->
|
<!-- 优惠补贴后的价格 -->
|
||||||
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
<view class="shop_home-commodity-infor-price shop_home-commodity-infor-bottom">
|
||||||
<text class="yang">补贴后价格:¥</text>
|
<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>
|
||||||
<!-- 选规格 -->
|
<!-- 选规格 -->
|
||||||
<view v-if="ISSpecifications" class="shop_home-commodity-infor-cart-sku" @tap="$u.debounce(Addcommodity, 800,true)">
|
<view v-if="ISSpecifications" class="shop_home-commodity-infor-cart-sku" @tap="$u.debounce(Addcommodity, 800,true)">
|
||||||
|
|
@ -216,12 +240,12 @@
|
||||||
title: '加载中...'
|
title: '加载中...'
|
||||||
});
|
});
|
||||||
let brand_id = this['BrandInfor']['brand_id'],
|
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 (this['ISSpecifications']) {
|
||||||
// 进入选择套餐详情 / 并非单品加入商品
|
// 进入选择套餐详情 / 并非单品加入商品
|
||||||
if(brand_id == 1 || brand_id == 5){
|
if(brand_id == 1 || brand_id == 5){
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.PageShopCombo();
|
this.PageShopCombo();
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -235,10 +259,19 @@
|
||||||
menuDetailsAPI(parameters).then(res => {
|
menuDetailsAPI(parameters).then(res => {
|
||||||
uni.hideLoading();
|
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']);
|
this.SetcommodityInfor(res['data']);
|
||||||
// 判断是什么类型店铺
|
// 判断是什么类型店铺
|
||||||
if(brand_id == 13){
|
|
||||||
|
if(brand_id == 13){
|
||||||
this.$emit('SkuPopup','b-rx-sku-popup');
|
this.$emit('SkuPopup','b-rx-sku-popup');
|
||||||
}else if(brand_id == 2){
|
}else if(brand_id == 2){
|
||||||
this.$emit('SkuPopup','b-nx-sku-popup');
|
this.$emit('SkuPopup','b-nx-sku-popup');
|
||||||
|
|
@ -270,7 +303,12 @@
|
||||||
return;
|
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();
|
uni.hideLoading();
|
||||||
this.ADD_CART({
|
this.ADD_CART({
|
||||||
|
|
@ -284,7 +322,7 @@
|
||||||
/**
|
/**
|
||||||
* @减少/删除商品
|
* @减少/删除商品
|
||||||
* */
|
* */
|
||||||
reducecommodity() {
|
reducecommodity() {
|
||||||
this.REDUCE_CART(this['item'])
|
this.REDUCE_CART(this['item'])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" :scroll-into-view="itemId">
|
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"
|
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item"
|
||||||
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
|
: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>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<!-- 右侧商品选项 -->
|
<!-- 右侧商品选项 -->
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
<!-- 闭店提示 -->
|
<!-- 闭店提示 -->
|
||||||
<b-load :show="close" width="196" height="169" position="absolute" color="#000000" type="close">
|
<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"
|
<b-load :show="loading" background="rgba(0,0,0,0.05)" width="60" height="70" position="absolute" color="#FFFFFF"
|
||||||
type="load">
|
type="load">
|
||||||
|
|
@ -154,7 +154,8 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(param) {
|
onLoad(param) {
|
||||||
self = this;
|
self = this;
|
||||||
|
|
||||||
console.log(param['brand_id'],'onLoad参数');
|
console.log(param['brand_id'],'onLoad参数');
|
||||||
const isWechat = getApp()['globalData']['parameters']?.isWechat;
|
const isWechat = getApp()['globalData']['parameters']?.isWechat;
|
||||||
console.log(isWechat,getApp()['globalData']['parameters']?.brand_id,'是否需要分享');
|
console.log(isWechat,getApp()['globalData']['parameters']?.brand_id,'是否需要分享');
|
||||||
|
|
@ -224,8 +225,9 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init(param) {
|
init(param) {
|
||||||
console.log(param, 'param');
|
console.log(this.GetShopInfor)
|
||||||
|
console.log('设置店铺信息', '++++++++++++++++++++++++++++++++++++++++++')
|
||||||
// 微信小程序进入品牌详情会过跳过正常进入品牌详情前两个页面的逻辑,所以在此处将前两页的逻辑整合
|
// 微信小程序进入品牌详情会过跳过正常进入品牌详情前两个页面的逻辑,所以在此处将前两页的逻辑整合
|
||||||
// 微信跳转H5后的逻辑为必须携带token
|
// 微信跳转H5后的逻辑为必须携带token
|
||||||
const isWechat = getApp()['globalData']['parameters']?.isWechat;
|
const isWechat = getApp()['globalData']['parameters']?.isWechat;
|
||||||
|
|
@ -269,8 +271,7 @@
|
||||||
brand_id,
|
brand_id,
|
||||||
brand_name
|
brand_name
|
||||||
});
|
});
|
||||||
|
|
||||||
// 设置店铺信息
|
|
||||||
data['data']['restaurant_id'] = data['data']['store_id'];
|
data['data']['restaurant_id'] = data['data']['store_id'];
|
||||||
data['data']['restaurant_name'] = data['data']['store_name'];
|
data['data']['restaurant_name'] = data['data']['store_name'];
|
||||||
this.SETSHOPDETAIL(data['data']);
|
this.SETSHOPDETAIL(data['data']);
|
||||||
|
|
@ -328,9 +329,9 @@
|
||||||
* */
|
* */
|
||||||
GetMenuQuery() {
|
GetMenuQuery() {
|
||||||
let param = {
|
let param = {
|
||||||
brand_id: this['BrandInfor']['brand_id'],
|
brand_id: this['BrandInfor']['brand_id'],
|
||||||
restaurant_id: this['GetShopInfor']['restaurant_id'],
|
restaurant_id: this['GetShopInfor']['restaurant_id'],
|
||||||
sku: 1
|
// restaurant_id: getApp().globalData['parameters']['restaurant_id'],
|
||||||
}
|
}
|
||||||
menuQueryAPI(param).then(res => {
|
menuQueryAPI(param).then(res => {
|
||||||
this['tabbar'] = res['data'];
|
this['tabbar'] = res['data'];
|
||||||
|
|
|
||||||
|
|
@ -47,15 +47,13 @@
|
||||||
|
|
||||||
<!-- 商品列表 -->
|
<!-- 商品列表 -->
|
||||||
<view class="box_3">
|
<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']">
|
<template v-for="(item,index) in FormInfor['products']">
|
||||||
<view class="Commodity-Item" @tap="ischoiceDiscount(item,index)">
|
<view class="Commodity-Item" @tap="ischoiceDiscount(item,index)">
|
||||||
<b-rx-commodity-item :item="item" :key='index'></b-rx-commodity-item>
|
<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="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 class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox':item['is_deduction']?true:false}"></view>
|
||||||
|
|
||||||
</view>
|
|
||||||
<view>
|
<view>
|
||||||
<view class="Deduction-amount">
|
<view class="Deduction-amount">
|
||||||
可用消费补贴卡余额抵扣¥{{_amount((item['max_deduction'] != undefined?item['max_deduction']:0) * item['num'])}}
|
可用消费补贴卡余额抵扣¥{{_amount((item['max_deduction'] != undefined?item['max_deduction']:0) * item['num'])}}
|
||||||
|
|
@ -81,17 +79,15 @@
|
||||||
<view class="text-group_3">
|
<view class="text-group_3">
|
||||||
<view class="text-wrapper_4 itemamount">
|
<view class="text-wrapper_4 itemamount">
|
||||||
<text lines="1" class="text_24">原价</text>
|
<text lines="1" class="text_24">原价</text>
|
||||||
<text lines="1" class="text_25"
|
<!-- <text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">:¥{{_amount(calculationamount['prices'])}}</text> -->
|
||||||
:style="{color:Brand()['ThemeColor']}">:¥{{_amount(calculationamount['prices'])}}</text>
|
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">:¥{{calculationamount['prices']}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-wrapper_4 itemamount">
|
<view class="text-wrapper_4 itemamount">
|
||||||
<text lines="1" class="text_24">实际付款</text>
|
<text lines="1" class="text_24">实际付款</text>
|
||||||
<text lines="1" class="text_25"
|
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">:¥{{calculationamount['payments']}}</text>
|
||||||
:style="{color:Brand()['ThemeColor']}">:¥{{_amount(calculationamount['payments'])}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view lines="1" class="text_26 itemamount">消费卡抵扣:¥{{_amount(calculationamount['Actualamounts'])}}
|
<!-- <view lines="1" class="text_26 itemamount">消费卡抵扣:¥{{_amount(calculationamount['Actualamounts'])}}</view>
|
||||||
</view>
|
<view lines="1" class="text_27 itemamount">获得佣金:¥{{_commission(commission)}}</view> -->
|
||||||
<view lines="1" class="text_27 itemamount">获得佣金:¥{{_commission(commission)}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<text lines="1" class="text_28">提交订单</text>
|
<text lines="1" class="text_28">提交订单</text>
|
||||||
<button class="button_1" :style="Brand()['customStyle']['BtnStyle'][0]" @tap="$u.debounce(settlement, 500)">
|
<button class="button_1" :style="Brand()['customStyle']['BtnStyle'][0]" @tap="$u.debounce(settlement, 500)">
|
||||||
|
|
@ -210,52 +206,70 @@
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
|
||||||
|
console.log(newobj);
|
||||||
|
|
||||||
// 获取当前品牌上次下单手机号
|
// 获取当前品牌上次下单手机号
|
||||||
getPhoneAPI({
|
getPhoneAPI({
|
||||||
brand_id: this['BrandInfor']['brand_id'],
|
brand_id: this['BrandInfor']['brand_id'],
|
||||||
type:4
|
type:4
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
this.SETPHONE(res['data'])
|
this.SETPHONE(res['data'].phone)
|
||||||
|
console.log('获取手机号', res.data.phone)
|
||||||
let products = [];
|
|
||||||
// 因为进入时暂时获取不到deepClone方法所以使用反转化
|
this.getCart();
|
||||||
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
|
}).catch(e => {
|
||||||
for (let i = 0; i < newobj['length']; i++) {
|
console.log(e)
|
||||||
let item = newobj[i];
|
this.getCart();
|
||||||
// 是否抵扣
|
|
||||||
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')
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
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;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
padding: 20rpx 10rpx;
|
||||||
|
|
||||||
.text-group_3 {
|
.text-group_3 {
|
||||||
width: 216rpx;
|
width: 216rpx;
|
||||||
|
|
|
||||||
|
|
@ -21,17 +21,16 @@
|
||||||
<text lines="1" class="text_6">{{item['product_name']}}</text>
|
<text lines="1" class="text_6">{{item['product_name']}}</text>
|
||||||
<view class="text-wrapper_1">
|
<view class="text-wrapper_1">
|
||||||
<text lines="1" class="text_7">¥</text>
|
<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>
|
</view>
|
||||||
<text lines="1" class="text_9">×{{item['num']}}</text>
|
<text lines="1" class="text_9">×{{item['num']}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="section_5">
|
<view class="section_5">
|
||||||
<view class="text-group_1">
|
<view class="text-group_1">
|
||||||
<text lines="1"
|
<text lines="1" class="text_14">可用消费补贴卡余额抵扣¥{{_amount(item['max_deduction'] * item['num'])}}</text>
|
||||||
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_15" v-if="item['Discountarrcondition']"
|
|
||||||
:class="`themeColor-${BrandInfor['brand_id']}`">您余额不足,实际可抵扣¥{{_amount(item['already_deduction_amount'])}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 肯德基 -->
|
<!-- 肯德基 -->
|
||||||
<view class="triangle" v-if="BrandInfor['brand_id'] == 1" :style="{'--color':'#C63836'}"
|
<view class="triangle" v-if="BrandInfor['brand_id'] == 1" :style="{'--color':'#C63836'}"
|
||||||
|
|
@ -100,12 +99,13 @@
|
||||||
<view class="text-group_3">
|
<view class="text-group_3">
|
||||||
<view class="text-wrapper_4 itemamount">
|
<view class="text-wrapper_4 itemamount">
|
||||||
<text lines="1" class="text_24">原价:</text>
|
<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>
|
||||||
<view class="text-wrapper_4 itemamount">
|
<view class="text-wrapper_4 itemamount">
|
||||||
<text lines="1" class="text_24">实际付款:</text>
|
<text lines="1" class="text_24">实际付款:</text>
|
||||||
<text lines="1" class="text_25"
|
<!-- <text lines="1" class="text_25" :class="[`themeColor-${BrandInfor['brand_id']}`]">¥{{_amount(calculationamount['payments'])}}</text> -->
|
||||||
: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>
|
||||||
<view lines="1" class="text_26 itemamount">
|
<view lines="1" class="text_26 itemamount">
|
||||||
消费卡抵扣:¥{{_amount(calculationamount['Actualamounts'])}}
|
消费卡抵扣:¥{{_amount(calculationamount['Actualamounts'])}}
|
||||||
|
|
@ -196,45 +196,54 @@
|
||||||
type: 4
|
type: 4
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.SETPHONE(res['data'])
|
this.SETPHONE(res['data'])
|
||||||
let products = [];
|
this.getCart();
|
||||||
// 因为进入时暂时获取不到deepClone方法所以使用反转化
|
}).catch(e => {
|
||||||
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
|
this.getCart();
|
||||||
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;
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
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} Content-Type请求类型
|
||||||
* @param {String} url请求地址
|
* @param {String} url请求地址
|
||||||
*/
|
*/
|
||||||
Request(config = {}) {
|
Request(config = {}) {
|
||||||
|
console.log(config, '23333')
|
||||||
// 是否存在url
|
// 是否存在url
|
||||||
try {
|
try {
|
||||||
if (!config['url']) {
|
if (!config['url']) {
|
||||||
|
|
@ -191,9 +192,10 @@ class Request {
|
||||||
//card 654321
|
//card 654321
|
||||||
//
|
//
|
||||||
// 微信跳转H5后的逻辑为必须携带token
|
// 微信跳转H5后的逻辑为必须携带token
|
||||||
const isWechat = getApp()['globalData']['parameters']?.isWechat;
|
const isWechat = getApp()['globalData']['parameters']?.isWechat;
|
||||||
|
console.log(isWechat, '222222222')
|
||||||
if (isWechat) {
|
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 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;
|
font-weight: 800;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
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,
|
Actualamounts,
|
||||||
};
|
};
|
||||||
let amount = this['amount'];
|
let amount = this['amount'];
|
||||||
console.log(this['FormInfor']['products'],'products');
|
console.log(this['FormInfor']['products'],'products');
|
||||||
// 取出当前勾选的商品
|
// 取出当前勾选的商品
|
||||||
let Deductionarr = this['FormInfor']['products'].filter(item => {
|
let Deductionarr = this['FormInfor']['products'].filter(item => {
|
||||||
|
|
|
||||||
|
|
@ -269,7 +269,7 @@ export default {
|
||||||
}, data) {
|
}, data) {
|
||||||
// let add = new addMethod();
|
// let add = new addMethod();
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((reslove, reject) => {
|
||||||
console.log(data,'data');
|
console.log(data,'data');
|
||||||
data['restaurant_id'] = state['shopDetail']['restaurant_id'];
|
data['restaurant_id'] = state['shopDetail']['restaurant_id'];
|
||||||
data['brand_id'] = state['BInfor']['brand_id'];
|
data['brand_id'] = state['BInfor']['brand_id'];
|
||||||
remove.Sex = {
|
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