积分商城积分兑换优、选择系统地址优化
parent
3d0eb10a7c
commit
442040e7fc
|
|
@ -133,8 +133,8 @@
|
|||
<!-- 展示型 -->
|
||||
<block v-if="data_list.length > 0">
|
||||
<view v-if="common_site_type == 1" :class="'cart-buy-nav oh wh-auto ' + (propSourceType == 'page' ? 'bottom-line-exclude' : '')">
|
||||
<view class="cart-exhibition-mode padding-horizontal-main">
|
||||
<button class="bg-main cr-white round wh-auto text-size-sm" type="default" @tap="exhibition_submit_event" hover-class="none">
|
||||
<view class="cart-exhibition-mode padding-horizontal-main padding-bottom-main">
|
||||
<button class="bg-main br-main cr-white round wh-auto text-size-sm" type="default" @tap="exhibition_submit_event" hover-class="none">
|
||||
<view class="dis-inline-block va-m margin-right-xl">
|
||||
<uni-icons type="phone" size="14" color="#fff" />
|
||||
</view>
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="cart-nav-submit">
|
||||
<button class="bg-main cr-white round text-size-md" type="default" @tap="buy_submit_event" :disabled="!already_valid_selected_status" hover-class="none">
|
||||
<button class="bg-main br-main cr-white round text-size-md" type="default" @tap="buy_submit_event" :disabled="!already_valid_selected_status" hover-class="none">
|
||||
{{ $t('goods-category.goods-category.44f1ww') }}<block v-if="total_num > 0">({{ total_num }})</block>
|
||||
</button>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
<text class="cr-grey text-size-xs va-m">{{ item.show_price_unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
<view class="cr-main text-size-xs"> {{ item.integral }}{{ $t('index.index.t26j9z') }}</view>
|
||||
<view class="cr-main text-size-xs"> {{ item.plugins_points_exchange_integral }}{{ $t('index.index.t26j9z') }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -141,11 +141,14 @@
|
|||
* 数据列表项
|
||||
*/
|
||||
.buy-data-item,
|
||||
.buy-data-item .right-value{
|
||||
.buy-data-item .right-value {
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.buy-data-item .right-value {
|
||||
width: calc(100% - 300rpx);
|
||||
width: calc(100% - 260rpx);
|
||||
}
|
||||
.buy-data-item .right-value .right-value-content {
|
||||
width: calc(100% - 32rpx);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -209,8 +212,8 @@
|
|||
* 门店次卡-页面选择
|
||||
*/
|
||||
.plugins-realstore-container-view .image {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
width: 34rpx;
|
||||
height: 34rpx !important;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<view class="text fr"> {{ address.province_name || '' }}{{ address.city_name || '' }}{{ address.county_name || '' }}{{ address.address || '' }} </view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="address == null" class="padding-top-xl padding-bottom-xxxl cr-grey">
|
||||
<view v-else class="padding-top-xl padding-bottom-xxxl cr-grey">
|
||||
{{ common_site_type == 0 || (common_site_type == 4 && site_model == 0) ? $t('buy.buy.6rk813') : $t('buy.buy.wq7gnb') }}
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -86,8 +86,8 @@
|
|||
<!-- 运费 -->
|
||||
<view v-if="(group.plugins_freightfee_data || null) != null && (group.plugins_freightfee_data.default || null) != null && (group.plugins_freightfee_data.fee_list || null) != null && group.plugins_freightfee_data.fee_list.length > 0" class="buy-data-item oh">
|
||||
<text class="cr-base">{{$t('buy.buy.876tgh')}}</text>
|
||||
<view class="fr cp">
|
||||
<view class="dis-inline-block va-m">
|
||||
<view class="right-value fr cp tr">
|
||||
<view class="right-value-content single-text dis-inline-block va-m">
|
||||
<picker :data-wid="group.id" @change="plugins_freightfee_change_event" :value="group.plugins_freightfee_data.default.key" :range="group.plugins_freightfee_data.fee_list" range-key="fee_name">
|
||||
<view class="cr-grey">{{ group.plugins_freightfee_data.default.fee_name }}</view>
|
||||
</picker>
|
||||
|
|
@ -100,8 +100,8 @@
|
|||
<!-- 优惠劵 -->
|
||||
<view v-if="(plugins_coupon_data || null) != null && (plugins_coupon_data[index] || null) != null && (plugins_coupon_data[index].coupon_data || null) != null && (plugins_coupon_data[index].coupon_data.coupon_list || null) != null && plugins_coupon_data[index].coupon_data.coupon_list.length > 0" class="buy-data-item oh" :data-index="index" @tap="plugins_coupon_open_event">
|
||||
<text class="cr-base">{{$t('buy.buy.45ovhs')}}</text>
|
||||
<view class="fr cp">
|
||||
<text class="cr-grey va-m">{{ (plugins_choice_coupon_value || null) != null && (plugins_choice_coupon_value[group.id] || null) != null ? plugins_choice_coupon_value[group.id] : $t('buy.buy.553mxo') }}</text>
|
||||
<view class="right-value fr cp tr">
|
||||
<text class="right-value-content single-text cr-grey va-m">{{ (plugins_choice_coupon_value || null) != null && (plugins_choice_coupon_value[group.id] || null) != null ? plugins_choice_coupon_value[group.id] : $t('buy.buy.553mxo') }}</text>
|
||||
<view class="dis-inline-block va-m lh-xs">
|
||||
<iconfont name="icon-arrow-right" color="#999"></iconfont>
|
||||
</view>
|
||||
|
|
@ -112,10 +112,10 @@
|
|||
<block v-for="(item, index2) in plugins_realstore_data[group.id]['data']" :key="index2">
|
||||
<view class="buy-data-item oh oh wh-auto">
|
||||
<text class="cr-base va-m">{{$t('buy.buy.58rs1a')}}</text>
|
||||
<image class="image circle br va-m margin-left-lg" :src="item.images" mode="aspectFill"></image>
|
||||
<text class="cr-grey va-m margin-left-xs text-size-xs">x{{ item.stock }}</text>
|
||||
<view class="fr cp tr right-value single-text" :data-index="index2" :data-groupid="group.id" @tap="plugins_realstore_open_event">
|
||||
<text class="cr-grey va-m">{{ item.tips_msg }}</text>
|
||||
<image class="image circle br va-m margin-left-xs" :src="item.images" mode="aspectFill"></image>
|
||||
<text class="cr-grey va-m margin-left-xss text-size-xs">x{{ item.stock }}</text>
|
||||
<view class="right-value fr cp tr" :data-index="index2" :data-groupid="group.id" @tap="plugins_realstore_open_event">
|
||||
<text class="right-value-content single-text cr-grey va-m">{{ item.tips_msg }}</text>
|
||||
<view class="dis-inline-block va-m lh-xs">
|
||||
<iconfont name="icon-arrow-right" color="#999"></iconfont>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -69,8 +69,11 @@
|
|||
common_user_address_platform_import_list: [],
|
||||
client_value: app.globalData.application_client_type(),
|
||||
data_list: [],
|
||||
params: null,
|
||||
is_default: 0,
|
||||
params: null,
|
||||
// 当前默认地址id
|
||||
is_default: 0,
|
||||
// 自动导入系统地址并选择
|
||||
is_auto_import_system_address_choose: 0,
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -163,27 +166,38 @@
|
|||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data.length > 0) {
|
||||
var data = res.data.data;
|
||||
var data_list = data.data || [];
|
||||
if (data_list.length > 0) {
|
||||
// 获取当前默认地址
|
||||
var is_default = 0;
|
||||
for (var i in data.data) {
|
||||
if (data.data[i]['is_default'] == 1) {
|
||||
is_default = data.data[i]['id'];
|
||||
for (var i in data_list) {
|
||||
if (data_list[i]['is_default'] == 1) {
|
||||
is_default = data_list[i]['id'];
|
||||
}
|
||||
}
|
||||
|
||||
// 设置数据
|
||||
this.setData({
|
||||
data_list: data.data,
|
||||
data_list: data_list,
|
||||
is_default: is_default,
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
|
||||
// 没有地址:当前不是选择地址自动返回模式下、是否下单选择地址、并且开启了系统地址选择则导入系统地址
|
||||
if(this.is_auto_import_system_address_choose == 0 && (this.params.is_back || 0) == 1 && this.common_user_address_platform_import_list.length > 0 && this.common_user_address_platform_import_list.indexOf(this.client_value) != -1) {
|
||||
this.setData({
|
||||
is_auto_import_system_address_choose: 1,
|
||||
});
|
||||
this.choose_system_address_event();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
|
|
@ -216,18 +230,23 @@
|
|||
if(parseInt(data.address_disable_status || 0) == 1 && (data.address_disable_msg || null) != null) {
|
||||
app.globalData.showToast(data.address_disable_msg);
|
||||
} else {
|
||||
// 存储缓存并返回
|
||||
uni.setStorage({
|
||||
key: app.globalData.data.cache_buy_user_address_select_key,
|
||||
data: data,
|
||||
});
|
||||
uni.navigateBack();
|
||||
// 存储缓存并返回
|
||||
this.address_choose_cache_save_back(data);
|
||||
}
|
||||
} else {
|
||||
// 点击复制地址
|
||||
var copy_val = this.$t('user-address.user-address.7r29v8') + data.name + '\n' + this.$t('user-address.user-address.2nmsi1') + data.tel + '\n' + this.$t('user-address.user-address.s150l6') + data.province_name + data.city_name + data.county_name + data.address;
|
||||
app.globalData.text_copy_event(copy_val);
|
||||
}
|
||||
},
|
||||
|
||||
// 地址选择存储并返回
|
||||
address_choose_cache_save_back(address) {
|
||||
uni.setStorage({
|
||||
key: app.globalData.data.cache_buy_user_address_select_key,
|
||||
data: address,
|
||||
});
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
// 获取系统地址事件
|
||||
|
|
@ -252,34 +271,41 @@
|
|||
city: res.cityName || '',
|
||||
county: res.countyName || '',
|
||||
address: res.detailInfo || '',
|
||||
};
|
||||
|
||||
// 加载获取数据
|
||||
uni.showLoading({
|
||||
title: self.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('outsystemadd', 'useraddress'),
|
||||
method: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
self.get_data_list();
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
};
|
||||
if((Object.values(data).join('') || null) != null) {
|
||||
uni.showLoading({
|
||||
title: self.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('outsystemadd', 'useraddress'),
|
||||
method: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
// 是否自动选择地址并返回
|
||||
if(self.is_auto_import_system_address_choose == 1) {
|
||||
// 存储缓存并返回
|
||||
self.address_choose_cache_save_back(res.data.data);
|
||||
} else {
|
||||
// 重新拉取列表数据
|
||||
self.get_data_list();
|
||||
}
|
||||
} else {
|
||||
app.globalData.showToast(self.$t('common.sub_error_retry_tips'));
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(self.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(self.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(self.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue