下单参数页面传递优化、用户地址列表新增距离内容展示
parent
d924d2629c
commit
4b2157c82d
|
|
@ -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('当前模式不允许使用地址');
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@
|
|||
});
|
||||
|
||||
// 获取数据
|
||||
var data = {};
|
||||
var data = this.params || {};
|
||||
|
||||
// 是否有坐标
|
||||
if ((this.user_location || null) != null) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue