优化订单
This commit is contained in:
@@ -6,15 +6,14 @@
|
||||
<block v-else>
|
||||
<view v-if="goods_list.length > 0" class="page-bottom-fixed">
|
||||
<!-- 模式选择,站点类型选择 销售+自提 -->
|
||||
<view v-if="buy_site_model_list.length > 1" class="buy-site-model bg-white oh tc" :class="'count-' + buy_site_model_list.length">
|
||||
<!-- <view v-if="buy_site_model_list.length > 1" class="buy-site-model bg-white oh tc" :class="'count-' + buy_site_model_list.length">
|
||||
<block v-for="(item, index) in buy_site_model_list" :key="index">
|
||||
<view :class="'item fl cp ' + (buy_site_model_active_index == index ? 'nav-active-line cr-main' : 'cr-base')" :data-index="index" :data-value="item.value" @tap="buy_site_model_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
</view> -->
|
||||
<view class="padding-horizontal-main padding-top-main bottom-line-exclude">
|
||||
<!-- 非虚拟类型 则地址 -->
|
||||
<view v-if="buy_site_model_value != 3" class="padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mb">
|
||||
<!-- <view v-if="buy_site_model_value != 3" class="padding-horizontal-main padding-top-main border-radius-main spacing-mb" style="background-color: #DD492C">
|
||||
<view class="address arrow-right cp" @tap="address_event">
|
||||
<view v-if="address != null" class="padding-bottom-main">
|
||||
<view class="address-base">
|
||||
@@ -34,6 +33,31 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-divider spacing-mb"></view>
|
||||
</view> -->
|
||||
|
||||
<view class="address-wrap" v-if="buy_site_model_value != 3">
|
||||
<view class="top-tips">收货地址</view>
|
||||
<view class="address-info" @tap="address_event">
|
||||
<view class="info-wrap" v-if="address != null">
|
||||
<image class="icon" src="/static/icon_address.svg" mode="aspectFit"></image>
|
||||
<view class="info">
|
||||
<view class="base base1"> {{ address.province_name || '' }}{{ address.city_name || '' }}{{ address.county_name || '' }}{{ address.address || '' }} </view>
|
||||
<view class="base base2">
|
||||
<text v-if="address.alias">{{ address.alias }}</text>
|
||||
<text>{{ address.name }}</text>
|
||||
<text>{{ address.tel }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edit-btn"> 修改地址 </view>
|
||||
</view>
|
||||
<view class="no-info" v-else>
|
||||
<view class="left">
|
||||
<image class="icon" src="/static/icon_address.svg" mode="aspectFit"></image>
|
||||
<view class="t1">请添加收货地址</view>
|
||||
</view>
|
||||
<image class="arrow" src="/static/icon_arrow.svg" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 客户输入的数据 -->
|
||||
@@ -570,6 +594,8 @@
|
||||
},
|
||||
// 发起支付请求
|
||||
async onPay(order_id, payment_id = 0, payment_list) {
|
||||
console.log('发起支付请求', `${order_id}+${payment_id}+${JSON.stringify(payment_list)}`);
|
||||
|
||||
let web_openid = localStorage.getItem('web_openid');
|
||||
console.log('onPay.web_openid===', web_openid);
|
||||
if (!web_openid) {
|
||||
@@ -604,6 +630,7 @@
|
||||
});
|
||||
} else {
|
||||
// 直接走支付流程
|
||||
console.log('直接走支付流程');
|
||||
this.$refs.payment.pay_handle(order_id, payment_id, payment_list);
|
||||
}
|
||||
},
|
||||
@@ -805,6 +832,8 @@
|
||||
plugins_coin_is_valid: plugins_coin_data != null && (plugins_coin_data.accounts_list || null) != null && plugins_coin_data.accounts_list.length > 0,
|
||||
});
|
||||
|
||||
console.log('共计商品', goods_list);
|
||||
|
||||
// 非门店模式则赋值指定的类型模式
|
||||
if (this.is_first == 1) {
|
||||
if (this.buy_site_model_list.length > 0) {
|
||||
@@ -969,6 +998,8 @@
|
||||
|
||||
// 提交订单
|
||||
buy_submit_event(e) {
|
||||
console.log('提交订单111');
|
||||
|
||||
// 表单数据
|
||||
var data = this.params;
|
||||
data['address_id'] = this.address_id;
|
||||
@@ -1003,6 +1034,8 @@
|
||||
// 请求参数处理
|
||||
data = this.request_data_ext_params_merge(data);
|
||||
|
||||
console.log('提交订单222');
|
||||
|
||||
// 是否需要选择时间
|
||||
var datetime = this.buy_datetime_info || {};
|
||||
if ((datetime.is_select || false) == true) {
|
||||
@@ -1047,17 +1080,21 @@
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
console.log('成功提交订单===', res);
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
console.log('成功提交订单222===', res);
|
||||
this.buy_submit_response_handle(res.data);
|
||||
} else {
|
||||
console.log('成功提交订单333===', res);
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
this.setData({
|
||||
buy_submit_disabled_status: false,
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
fail: (err) => {
|
||||
console.log('提交订单失败===', err);
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
buy_submit_disabled_status: false,
|
||||
@@ -1069,6 +1106,7 @@
|
||||
|
||||
// 订单提交响应处理
|
||||
buy_submit_response_handle(res) {
|
||||
console.log('订单提交响应处理===', res);
|
||||
// 是否预约模式,则进入订单列表
|
||||
if (res.data.order_status == 0) {
|
||||
var self = this;
|
||||
@@ -1381,3 +1419,78 @@
|
||||
<style>
|
||||
@import './buy.css';
|
||||
</style>
|
||||
|
||||
<style scoped lang="scss">
|
||||
$color: #ff723b;
|
||||
.address-wrap {
|
||||
background-color: $color;
|
||||
padding: 0 2px 2px;
|
||||
border-radius: 6px;
|
||||
.top-tips {
|
||||
color: #fff;
|
||||
padding: 4px;
|
||||
}
|
||||
.address-info {
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
.info-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.icon {
|
||||
$size: 60upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
}
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 10px;
|
||||
.base1 {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
}
|
||||
.base2 {
|
||||
padding-top: 8px;
|
||||
color: #999;
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
}
|
||||
}
|
||||
.edit-btn {
|
||||
padding: 4px 10px;
|
||||
border: 1upx solid $color;
|
||||
color: $color;
|
||||
border-radius: 100px;
|
||||
}
|
||||
}
|
||||
.no-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.icon {
|
||||
$size: 60upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.t1 {
|
||||
font-size: 32upx;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.arrow {
|
||||
$size: 26upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user