下单参数页面传递优化、用户地址列表新增距离内容展示

master
gongfuxiang 2022-04-06 00:10:48 +08:00
parent d924d2629c
commit 4b2157c82d
3 changed files with 19 additions and 6 deletions

View File

@ -708,14 +708,26 @@
},
//
address_event(e) {
address_event(e) {
//
var json = this.params || null;
if(json != null) {
var params = '&'+Object.keys(json).map(function(key) {
var temp_val = (json[key] === undefined || json[key] === null) ? '' : json[key];
return encodeURIComponent(key) + '=' + encodeURIComponent(temp_val);
}).join('&');
} else {
var params = '';
}
//
if (this.common_site_type == 0 || this.common_site_type == 4 && this.site_model == 0) {
uni.navigateTo({
url: '/pages/user-address/user-address?is_back=1'
url: '/pages/user-address/user-address?is_back=1'+params
});
} else if (this.common_site_type == 2 || this.common_site_type == 4 && this.site_model == 2) {
uni.navigateTo({
url: '/pages/extraction-address/extraction-address?is_back=1&is_buy=1'
url: '/pages/extraction-address/extraction-address?is_back=1&is_buy=1'+params
});
} else {
app.globalData.showToast('当前模式不允许使用地址');

View File

@ -167,7 +167,7 @@
});
//
var data = {};
var data = this.params || {};
//
if ((this.user_location || null) != null) {

View File

@ -12,7 +12,8 @@
<view class="address oh padding-bottom-lg">
<image class="item-icon fl margin-top-xs" :src="common_static_url+'map-icon.png'" mode="widthFix"></image>
<view class="text fr">
{{item.province_name || ''}}{{item.city_name || ''}}{{item.county_name || ''}}{{item.address || ''}}
<text>{{item.province_name || ''}}{{item.city_name || ''}}{{item.county_name || ''}}{{item.address || ''}}</text>
<text v-if="((item.distance_value || null) != null && (item.distance_unit || null) != null)" class="cr-grey margin-left-lg fr">距离<text class="cr-base">{{item.distance_value}}</text>{{item.distance_unit}}</text>
</view>
</view>
</view>
@ -132,7 +133,7 @@
uni.request({
url: app.globalData.get_request_url("index", "useraddress"),
method: "POST",
data: {},
data: this.params,
dataType: "json",
success: res => {
uni.hideLoading();