This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-02-29 21:44:22 +08:00
parent c06a2c862c
commit 6d7c1384ce
3 changed files with 216 additions and 413 deletions

View File

@ -3,8 +3,8 @@
<view style="height: var(--status-bar-height);"></view> <view style="height: var(--status-bar-height);"></view>
<view class="v-navbar"> <view class="v-navbar">
<u-navbar title="面对面收款" @rightClick="rightClick" :autoBack="true" :fixed="false" bgColor="transparent" <u-navbar title="面对面收款" :autoBack="true" :fixed="false" bgColor="transparent" leftIconColor="#fff"
leftIconColor="#fff" :titleStyle="{color:'#fff',fontWeight:'bold',fontSize:'32rpx'}"> :titleStyle="{color:'#fff',fontWeight:'bold',fontSize:'32rpx'}">
</u-navbar> </u-navbar>
</view> </view>
@ -25,7 +25,7 @@
<view class="v-con-input"> <view class="v-con-input">
<u--input type="number" maxlength="5" fontSize="23" v-model="cartForm.total_amount" placeholder="请输入金额" <u--input type="number" maxlength="5" fontSize="23" v-model="cartForm.total_amount" placeholder="请输入金额"
border="none" placeholderStyle="color:#999;font-size:30rpx"> border="none" placeholderStyle="color:#999;font-size:30rpx">
<u--text size="23" color="#303133" text="¥" slot="prefix" margin="0 3px 0 0" type="tips"></u--text> <u-text size="23" color="#303133" text="¥" slot="prefix" margin="0 3px 0 0" type="tips"></u-text>
</u-input> </u-input>
</u--input> </u--input>
</view> </view>

View File

@ -1,7 +1,7 @@
<template> <template>
<view :style="viewColor"> <view :style="viewColor">
<view style="height: var(--status-bar-height);"></view>
<view class='order-submission'> <view class='order-submission'>
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="storeinfo-wrapper"> <view class="storeinfo-wrapper">
<view class="store-item"> <view class="store-item">
@ -172,7 +172,9 @@
import { import {
orderPay orderPay
} from "@/api/payment.js"; } from "@/api/payment.js";
import { Toast } from '../../libs/uniApi'; import {
Toast
} from '../../libs/uniApi';
export default { export default {
components: { components: {
@ -407,29 +409,6 @@ import { Toast } from '../../libs/uniApi';
}, },
methods: { methods: {
/*预售协议*/
getPresellAgree: function() {
this.showProtocol = true
this.agrementTtile = '预售协议'
presellAgreement().then(res => {
this.protocol = res.data.sys_product_presell_agree;
})
},
changeIsAgree: function(e) {
this.isAgree = !this.isAgree;
},
changeIntegral: function(e) {
this.use_integral = !this.use_integral;
this.getConfirm(this.addressId);
},
showPresellAgree() {
this.getPresellAgree()
},
showCoupon() {
this.getCouponAgreement();
},
// //
// idx // idx
getPhotoClickIdx(e) { getPhotoClickIdx(e) {
@ -468,125 +447,6 @@ import { Toast } from '../../libs/uniApi';
// this.$scope.selectComponent('#address-window').getAddressList(); // this.$scope.selectComponent('#address-window').getAddressList();
}, },
//
authColse: function(e) {
this.isShowAuth = e;
},
ChangCouponsClone: function() {
this.$set(this.coupon, 'status', false);
},
changeTextareaStatus: function() {
for (let i = 0, len = this.coupon.list.length; i < len; i++) {
this.coupon.list[i].use_title = '';
this.coupon.list[i].is_use = 0;
}
this.textareaStatus = true;
this.status = 0;
this.$set(this.coupon, 'list', this.coupon.list);
},
/**
* 获取当前订单详细信息
*
*/
getConfirm: function(address_id) {
let that = this;
uni.showLoading({
title: '',
mask: true
});
getOrderConfirm({
cart_id: that.cartId.split(","),
address_id: address_id,
takes: that.take,
consumption_id: this.consumption_id,
use_coupon: that.subCoupon,
use_integral: that.use_integral,
product_type: that.product_type,
source: that.source
}).then(res => {
//
that.product_type = res.data.order_type
that.is_take = false;
that.platformConsumption = res.data.platformConsumption;
res.data.order.forEach(el => {
if (el.order.isTake == 1) that.is_take = true
el.isTake = 0
that.subCoupon[el.mer_id] = []
el.coupon.forEach(coupon => {
if (coupon.checked) {
that.subCoupon[el.mer_id].push(coupon.coupon_user_id)
}
})
})
that.subCoupon['0'] = []
if (res.data.platformCoupon?.length > 0) {
res.data.platformCoupon.forEach(el => {
if (el.checked) {
that.subCoupon[el.mer_id] = []
that.subCoupon[el.mer_id].push(el.coupon_user_id)
}
})
} else res.data.platformCoupon = [];
that.consumption_money = res.data.consumption_money;
that.$set(that.coupon, "coupon", that.plantCoupon ? res.data.platformCoupon : res.data
.order[that.couponIndex].coupon);
that.$set(that, "store_coupon_number", res.data.order[that.couponIndex].order.useCouponIds
.length);
that.$set(that, "coupon_amount", parseFloat(res.data.order[that.couponIndex].order
.coupon_price) + parseFloat(res.data.total_platform_coupon_price));
that.$set(that, "store_coupon_amount", parseFloat(res.data.order[that.couponIndex].order
.coupon_price));
that.$set(that, "plant_coupon_amount", parseFloat(res.data.total_platform_coupon_price));
that.$set(that, 'couponData', res.data);
that.$set(that, 'cartInfo', res.data.order);
that.$set(that, 'total_platform_coupon_price', res.data.total_platform_coupon_price);
that.$set(that, 'enabledPlatformCoupon', res.data.enabledPlatformCoupon);
that.$set(that, 'platformCoupon', res.data.platformCoupon);
that.$set(that, 'order_type', res.data.order_type);
that.$set(that, 'coupon_price', res.data.order_coupon_price);
that.$set(that, 'integral_count', res.data.order_total_integral);
that.$set(that, 'integral_price', res.data.order_total_integral_price);
that.$set(that, 'open_integral', res.data.openIntegral);
that.$set(that, 'use_integral', res.data.useIntegral);
that.$set(that, 'order_extend', (that.order_extend && that.order_extend.length > 0) ? that
.order_extend : res.data.order_extend);
that.totalPrice = res.data.order_price
that.orderStatus = res.data.status
that.proPrice = res.data.total_price
that.order_type = res.data.order_type
that.order_model = res.data.order_model
that.order_key = res.data.key
uni.getStorage({
key: "invoice_Data",
success: function(res) {
that.addInvoice = res.data;
if (res.data) {
that.getInvoiceDatas(res.data)
}
}
})
uni.hideLoading();
}).catch(err => {
return this.$util.Tips({
title: err
}, {
tab: 3,
url: 1
});
});
},
payItem: function(e) { payItem: function(e) {
let that = this; let that = this;
let active = e; let active = e;
@ -633,37 +493,19 @@ import { Toast } from '../../libs/uniApi';
that.animated = false; that.animated = false;
}, },
onAddress: function() {
let that = this;
if (that.addressInfo.real_name) {
that.textareaStatus = false;
that.address.address = true;
// that.pagesUrl = '/pages/users/user_address/index?cartId=' + this.cartId + '&pinkId=' + this
// .pinkId + '&couponId=' + this.couponId;
that.pagesUrl = '/pages/users/user_address_list/index'
} else {
// uni.navigateTo({
// url: `/pages/users/user_address/index?cartId=${this.cartId}`,
// });
uni.navigateTo({
url: `pages/users/user_address_list/index`,
});
}
},
payment: function(data) { payment: function(data) {
let that = this; let that = this;
createOrder(data).then(res => { createOrder(data).then(res => {
let status = res.data.status, let status = res.data.status,
orderId = res.data.result.order_id, orderId = res.data.result.order_id,
callback_key = res.data.result.pay_key, // callback_key = res.data.result.pay_key,
jsConfig = res.data.result.config, jsConfig = res.data.result.config,
// //
goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message + goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message +
'&product_type=' + that.product_type + '&source=' + that.source, '&product_type=' + that.payForm.product_type + '&source=' + that.payForm.source,
goPagesOrder = '/pages/order_details/stay?order_id=' + orderId + goPagesOrder = '/pages/order_details/stay?order_id=' + orderId +
'&credit_buy=1&product_type=' + that.product_type; '&credit_buy=1&product_type=' + that.payForm.product_type;
that.orderPay = true; that.orderPay = true;
uni.hideLoading(); uni.hideLoading();
@ -690,10 +532,6 @@ import { Toast } from '../../libs/uniApi';
break; break;
case 'alipay': case 'alipay':
case "alipayQr": case "alipayQr":
// uni.navigateTo({
// url: '/pages/order_pay_back/index?keyCode=' + callback_key + '&url=' +
// jsConfig
// })
return; return;
break; break;
// #ifndef MP // #ifndef MP
@ -889,51 +727,13 @@ import { Toast } from '../../libs/uniApi';
}); });
} }
}).catch(err => { }).catch(err => {
uni.hideLoading();
return that.$util.Tips({ return that.$util.Tips({
title: err title: err
}); });
uni.hideLoading();
}); });
}, },
isEmojiCharacter: function(substring) {
if (substring) {
for (var i = 0; i < substring.length; i++) {
var hs = substring.charCodeAt(i);
if (0xd800 <= hs && hs <= 0xdbff) {
if (substring.length > 1) {
var ls = substring.charCodeAt(i + 1);
var uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
if (0x1d000 <= uc && uc <= 0x1f77f) {
return true;
}
}
} else if (substring.length > 1) {
var ls = substring.charCodeAt(i + 1);
if (ls == 0x20e3) {
return true;
}
} else {
if (0x2100 <= hs && hs <= 0x27ff) {
return true;
} else if (0x2B05 <= hs && hs <= 0x2b07) {
return true;
} else if (0x2934 <= hs && hs <= 0x2935) {
return true;
} else if (0x3297 <= hs && hs <= 0x3299) {
return true;
} else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 ||
hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b ||
hs == 0x2b50) {
return true;
}
}
}
}
},
bindDateChange(e) {
let that = this
that.$set(that.order_extend[that.virtualIndex], 'value', e.detail.value);
},
getTime(index) { getTime(index) {
this.virtualIndex = index; this.virtualIndex = index;
}, },
@ -958,29 +758,15 @@ import { Toast } from '../../libs/uniApi';
Toast(e.message) Toast(e.message)
}) })
// #ifdef MP
openPaySubscribe().then(() => {
that.payment(this.payForm);
});
// #endif
// #ifndef MP
that.payment(this.payForm);
// #endif
// this.cartInfo.map(el => {
// if (el.isTake == 1 || el.order.isTake) {
// data.takes.push(el.mer_id)
// }
// })
// if (data.payType == 'balance' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice))
// return that.$util
// .Tips({
// title: ''
// });
// data.consumption_id = this.consumption_id;
// // #ifdef MP
// openPaySubscribe().then(() => {
// that.payment(data);
// });
// // #endif
// // #ifndef MP
// that.payment(data);
// // #endif
}, },
// //

View File

@ -11,7 +11,8 @@
<text class='default t-color' <text class='default t-color'
v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street || ''}} v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street || ''}}
<text v-if='addressInfo.brigade'>{{typeof(addressInfo.brigade)=='string'?addressInfo.brigade:addressInfo.brigade.name }}{{addressInfo.detail}}</text> <text
v-if='addressInfo.brigade'>{{typeof(addressInfo.brigade)=='string'?addressInfo.brigade:addressInfo.brigade.name }}{{addressInfo.detail}}</text>
</view> </view>
</view> </view>
<navigator v-else :url="'/pages/users/user_address/index?cartId='+cartId" hover-class="none" <navigator v-else :url="'/pages/users/user_address/index?cartId='+cartId" hover-class="none"
@ -36,7 +37,9 @@
<view v-if="goods.product_type == 2"> <view v-if="goods.product_type == 2">
<view class="product-item"> <view class="product-item">
<view class="img-box"> <view class="img-box">
<image :src="(goods.productPresellAttr&&goods.productPresellAttr.image) || (goods.product&&goods.product.image)"></image> <image
:src="(goods.productPresellAttr&&goods.productPresellAttr.image) || (goods.product&&goods.product.image)">
</image>
</view> </view>
<view class="content event_content"> <view class="content event_content">
<view class="name line1"> <view class="name line1">
@ -437,7 +440,8 @@
</discountDetails> </discountDetails>
<uni-popup ref="tipsRef"> <uni-popup ref="tipsRef">
<view class="tips_popup"> <view class="tips_popup">
<image class="r_c_gb" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/9b08120240131172018671.png"></image> <image class="r_c_gb" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/9b08120240131172018671.png">
</image>
<view class="ref_content"> <view class="ref_content">
<view class="r_c_title">优惠提示</view> <view class="r_c_title">优惠提示</view>
<view class="r_c_text">当前订单金额已大于100元</view> <view class="r_c_text">当前订单金额已大于100元</view>
@ -447,7 +451,8 @@
<button class="r_c_btn2" @click="gotoCloud">前往活动</button> <button class="r_c_btn2" @click="gotoCloud">前往活动</button>
</view> </view>
</view> </view>
<image class="r_c_close" @click.stop="closeTipsRef" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/d39b4202401311747186525.png"></image> <image class="r_c_close" @click.stop="closeTipsRef"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/d39b4202401311747186525.png"></image>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
@ -1349,7 +1354,8 @@
success: (e) => { success: (e) => {
// //
let url = '/pages/order_pay_status/index?order_id=' + orderId + let url = '/pages/order_pay_status/index?order_id=' + orderId +
'&msg=支付成功' + '&product_type=' + that.product_type + '&source=' + that.source; '&msg=支付成功' + '&product_type=' + that.product_type +
'&source=' + that.source;
return that.$util.Tips({ return that.$util.Tips({
title: '支付成功', title: '支付成功',
@ -1363,7 +1369,8 @@
console.log(e, '111111111') console.log(e, '111111111')
// //
let url = '/pages/order_pay_status/index?order_id=' + orderId + let url = '/pages/order_pay_status/index?order_id=' + orderId +
'&msg=取消支付' + '&product_type=' + that.product_type + '&source=' + that.source; '&msg=取消支付' + '&product_type=' + that.product_type +
'&source=' + that.source;
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付', title: '取消支付',
}, { }, {
@ -1412,7 +1419,8 @@
fail: function(e) { fail: function(e) {
// //
let pages = '/pages/order_pay_status/index?order_id=' + let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付' + '&product_type=' + that.product_type + '&source=' + that.source; orderId + '&msg=取消支付' + '&product_type=' + that
.product_type + '&source=' + that.source;
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付' title: '取消支付'
}, { }, {
@ -1492,7 +1500,8 @@
default: default:
// //
let pages = '/pages/order_pay_status/index?order_id=' + let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付' + '&product_type=' + that.product_type + '&source=' + that.source orderId + '&msg=取消支付' + '&product_type=' + that.product_type + '&source=' +
that.source
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付' title: '取消支付'
@ -1672,8 +1681,7 @@
} }
}) })
if (data.payType == 'balance' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice)) if (data.payType == 'balance' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice))
return that.$util return that.$util.Tips({
.Tips({
title: '余额不足!' title: '余额不足!'
}); });
data.consumption_id = this.consumption_id; data.consumption_id = this.consumption_id;
@ -1725,8 +1733,7 @@
title: this.deliveryName, title: this.deliveryName,
check: true check: true
}] }]
} } else if (!item.allow_delivery && item.allow_take) {
else if (!item.allow_delivery && item.allow_take) {
this.radioList = [{ this.radioList = [{
title: '到店核销', title: '到店核销',
check: false check: false
@ -2663,6 +2670,7 @@
height: 756rpx; height: 756rpx;
overflow-y: scroll; overflow-y: scroll;
} }
.red_packet { .red_packet {
color: #ff5c2d !important; color: #ff5c2d !important;
background-color: rgba(#ff5c2d, 0.3); background-color: rgba(#ff5c2d, 0.3);
@ -2671,15 +2679,18 @@
padding-left: 20rpx; padding-left: 20rpx;
font-size: 25rpx; font-size: 25rpx;
} }
.tips_popup { .tips_popup {
width: 600rpx; width: 600rpx;
height: 450rpx; height: 450rpx;
position: relative; position: relative;
.r_c_gb { .r_c_gb {
width: 100%; width: 100%;
height: 420rpx; height: 420rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
.ref_content { .ref_content {
position: absolute; position: absolute;
left: 0; left: 0;
@ -2693,15 +2704,19 @@
justify-content: space-between; justify-content: space-between;
color: #2E2E2E; color: #2E2E2E;
font-size: 28rpx; font-size: 28rpx;
.r_c_title { .r_c_title {
font-weight: blod; font-weight: blod;
} }
.r_c_text { .r_c_text {
font-size: 26rpx; font-size: 26rpx;
} }
.r_c_btn { .r_c_btn {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
.r_c_btn1 { .r_c_btn1 {
background-color: transparent; background-color: transparent;
border: 5rpx solid #FF874C; border: 5rpx solid #FF874C;
@ -2710,6 +2725,7 @@
padding: 5rpx 28rpx; padding: 5rpx 28rpx;
border-radius: 60rpx; border-radius: 60rpx;
} }
.r_c_btn2 { .r_c_btn2 {
background-color: #FF874C; background-color: #FF874C;
border: 5rpx solid #FF874C; border: 5rpx solid #FF874C;
@ -2720,6 +2736,7 @@
} }
} }
} }
.r_c_close { .r_c_close {
position: absolute; position: absolute;
top: 0; top: 0;