feat: 0元购

This commit is contained in:
whitechiina 2025-04-01 18:01:59 +08:00
parent 39ae07670f
commit fdb7bff546
18 changed files with 123 additions and 28 deletions

View File

@ -37,7 +37,8 @@
¥{{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'])}}
<text class="now">¥{{item['user_price'] * (item['num']?item['num']:item['amount'])}}</text>
<text class="last">¥{{item['pay_price'] * (item['num']?item['num']:item['amount'])}}</text>
</view>
<view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10">
¥{{item['adj_pay'] * (item['num']?item['num']:item['amount'])}}
@ -145,6 +146,17 @@
width: 42rpx;
height: 42rpx;
}
}
.now {
font-size: 34rpx;
font-weight: bold;
}
.last {
color: gray;
text-decoration: line-through;
padding-left: 10rpx;
}
}
</style>

View File

@ -337,12 +337,11 @@
<script>
let tiem = null;
// 混入
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 {
GetorderInfoAPI,
cancelOrderAPI
getOrderDetail
} from '@/request/restaurant/index.js';
// 客服链接
import {
@ -386,10 +385,9 @@
},
methods: {
GetorderInfo() {
GetorderInfoAPI({
order_sn: this['order_sn']
getOrderDetail({
id: this['order_sn']
}).then(data => {
// data['data']['status'] = 5;
if (data['data']['status'] == this['OrderStatus0']) {
this.tiem(data['data']['status'], data['data']['createtime'])
};

View File

@ -72,7 +72,7 @@
<text lines="1" class="amount">余额:¥{{ _amount(amount)}}</text>
</view> -->
<view class="Commodity">
<text lines="1" class="quantity">商品金额</text>
<text lines="1" class="quantity">应付</text>
<text lines="1" class="amount">¥{{ calculationamount['prices'] }}</text>
</view>
@ -113,7 +113,7 @@
</view>
<view class="text-wrapper_4 itemamount">
<text lines="1" class="text_24">积分:</text>
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">¥{{computedTotal.integral}}</text>
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">{{computedTotal.integral}}</text>
</view>
@ -158,6 +158,47 @@
</view>
</view>
</template>
</u-modal>
<!-- 0元购提示信息 -->
<u-modal :show="zeroshow" title="确认订单" closeOnClickOverlay @close="zeroshow = false">
<template v-slot:default>
<view>
<view class="zero-content">
<view class="item flex">
<text>抵用券</text>
<text class="blod">{{computedTotal.broker_balance}}</text>
</view>
<view class="item flex">
<text>余额</text>
<text class="blod">{{computedTotal.coin_balance}}</text>
</view>
<view class="know">
<view class="left">
<view class="blod">
实付
</view>
<view class="point" v-if="computedTotal.integral > 0">
获得:{{computedTotal.integral}} 积分
</view>
</view>
<view class="right blod">
¥{{computedTotal.real_pay_price}}
</view>
</view>
</view>
</view>
</template>
<template v-slot:confirmButton>
<view class="confirmButton">
<view class="btn replace" @tap="zeroshow = false" :style="{border:`1rpx solid ${Brand()['ThemeColor']}`,color:Brand()['ThemeColor']}">
取消
</view>
<view class="btn confirm" @tap="surePay" :style="Brand()['customStyle']['BtnStyle'][0]">
确定
</view>
</view>
</template>
</u-modal>
</view>
</template>
@ -184,7 +225,8 @@
},
data() {
return {
show: false,
show: false,
zeroshow: false,
FormInfor: {
// 品牌id
brand_id: 0,
@ -334,15 +376,25 @@
* @结算
* */
settlement() {
if (!self['FormInfor']['phone_number'] || self['FormInfor']['phone_number']['length'] < 11 || !uni.$u.test
.mobile(self['FormInfor']['phone_number'])) {
if (!self['FormInfor']['phone_number'] || self['FormInfor']['phone_number']['length'] < 11 || !uni.$u.test.mobile(self['FormInfor']['phone_number'])) {
uni.showToast({
title: '请输入正确手机号',
icon: 'none'
})
return
}
// 判断如果是0元购提示弹窗
if (this.computedTotal.real_pay_price == 0) {
this['zeroshow'] = true
} else {
this['show'] = true;
}
this['show'] = true;
},
// 0元确认
surePay() {
this['show'] = true;
},
/**
@ -368,12 +420,19 @@
console.log(res.adta)
let redirect_url = '/pages/restaurant/order/order-details/details';
uni.hideLoading();
this.$Payment.H5TOWX_Payment({
datas: res['data'],
shopInfo: from.products,
return_url:`/pages/restaurant/order/order-details/details?order_sn=${res.data.order_sn}`
});
uni.hideLoading();
if (this.computedTotal.real_pay_price == 0) {
wx.miniProgram.navigateTo({
url: `/pages/goods/order_list/index`
});
} else {
this.$Payment.H5TOWX_Payment({
datas: res['data'],
shopInfo: from.products,
return_url:`/pages/restaurant/order/order-details/details?order_sn=${res.data.order_sn}`
});
}
// let redirect_url = '/pages/restaurant/order/order-details/details';
@ -940,5 +999,30 @@
text-align: center;
border-radius: 43rpx;
}
}
.zero-content {
display: flex;
flex-direction: column;
width: 500rpx;
.item {
width: 500rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
}
.know {
border-top: 1rpx solid gray;
padding-top: 40rpx;
width: 500rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.blod {
font-size: 34rpx;
font-weight: bold;
}
}
</style>

View File

@ -104,3 +104,4 @@ export const computedOfflineOrder = parameters => request.Request({ url: "/api/c
* @下单
*/
export const createFoodOrder = parameters => request.Request({ url: "/api/client/orders/createFoodOrder", parameters, method:'POST'});

View File

@ -130,7 +130,7 @@ export default {
});
// 计算原价
prices = this['FormInfor']['products'].map(item => {
return item['adj_pay'] * item['num']
return item['bt_price'] * item['num']
// if(this['BrandInfor']['brand_id'] == 10 || this['BrandInfor']['brand_id'] == 2){
// ;
// }else{

View File

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>消费补贴卡</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><script src="https://h5.dhcc.wang/api/apilink-native.min.js?v=20200701"></script><link rel=stylesheet href=/privilege/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/privilege/static/js/chunk-vendors.2a9d3084.js></script><script src=/privilege/static/js/index.965941ca.js></script></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><script src="https://h5.dhcc.wang/api/apilink-native.min.js?v=20200701"></script><link rel=stylesheet href=/privilege/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/privilege/static/js/chunk-vendors.2a9d3084.js></script><script src=/privilege/static/js/index.213dbfac.js></script></body></html>

View File

@ -130,7 +130,7 @@ export default {
});
// 计算原价
prices = this['FormInfor']['products'].map(item => {
return item['adj_pay'] * item['num']
return item['bt_price'] * item['num']
// if(this['BrandInfor']['brand_id'] == 10 || this['BrandInfor']['brand_id'] == 2){
// ;
// }else{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long