1
This commit is contained in:
parent
011cd2663f
commit
28d9667b4e
File diff suppressed because one or more lines are too long
@ -8,7 +8,9 @@
|
|||||||
<view class='item' v-for="(item,index) in addressList" :key="index">
|
<view class='item' v-for="(item,index) in addressList" :key="index">
|
||||||
<view class='address' @click='goOrder(item.address_id)'>
|
<view class='address' @click='goOrder(item.address_id)'>
|
||||||
<view class='consignee'>收货人:{{item.real_name}}<text class='phone'>{{item.phone}}</text></view>
|
<view class='consignee'>收货人:{{item.real_name}}<text class='phone'>{{item.phone}}</text></view>
|
||||||
<view>收货地址:{{item.province || ''}}{{item.city || ''}}{{item.district || ''}}{{item.street || ''}}{{item.detail || ''}}</view>
|
<view>
|
||||||
|
收货地址:{{item.province || ''}}{{item.city || ''}}{{item.district || ''}}{{item.street || ''}}{{item.detail || ''}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='operation acea-row row-between-wrapper'>
|
<view class='operation acea-row row-between-wrapper'>
|
||||||
<!-- #ifndef MP -->
|
<!-- #ifndef MP -->
|
||||||
@ -22,7 +24,8 @@
|
|||||||
</radio>
|
</radio>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class='acea-row row-middle'>
|
<view class='acea-row row-middle'>
|
||||||
<view @click='editAddress(item.address_id)'><text class='iconfont icon-bianji'></text>编辑</view>
|
<view @click='editAddress(item.address_id)'><text class='iconfont icon-bianji'></text>编辑
|
||||||
|
</view>
|
||||||
<view @click='delAddress(index)'><text class='iconfont icon-shanchu'></text>删除</view>
|
<view @click='delAddress(index)'><text class='iconfont icon-shanchu'></text>删除</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -38,7 +41,8 @@
|
|||||||
<view>暂无地址</view>
|
<view>暂无地址</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='footer acea-row row-between-wrapper'>
|
<view class='footer acea-row row-between-wrapper'>
|
||||||
<view class='addressBnt b-color on' @click='addAddress'><text class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
|
<view class='addressBnt b-color on' @click='addAddress'><text
|
||||||
|
class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -57,7 +61,9 @@
|
|||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
const jweixin = require('@/plugin/jweixin-module/index.js')
|
const jweixin = require('@/plugin/jweixin-module/index.js')
|
||||||
// #endif
|
// #endif
|
||||||
import {getWechatConfig} from '@/api/public.js'
|
import {
|
||||||
|
getWechatConfig
|
||||||
|
} from '@/api/public.js'
|
||||||
import {
|
import {
|
||||||
getAddressList,
|
getAddressList,
|
||||||
setAddressDefault,
|
setAddressDefault,
|
||||||
@ -65,9 +71,15 @@
|
|||||||
editAddress,
|
editAddress,
|
||||||
postAddress
|
postAddress
|
||||||
} from '@/api/user.js';
|
} from '@/api/user.js';
|
||||||
import { mapGetters } from "vuex";
|
import {
|
||||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
mapGetters
|
||||||
import { toLogin } from '@/libs/login.js';
|
} from "vuex";
|
||||||
|
import {
|
||||||
|
HTTP_REQUEST_URL
|
||||||
|
} from '@/config/app';
|
||||||
|
import {
|
||||||
|
toLogin
|
||||||
|
} from '@/libs/login.js';
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
@ -81,7 +93,7 @@
|
|||||||
loadTitle: '加载更多',
|
loadTitle: '加载更多',
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
wxConfig:{},
|
wxConfig: {},
|
||||||
domain: HTTP_REQUEST_URL,
|
domain: HTTP_REQUEST_URL,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -93,7 +105,7 @@
|
|||||||
this.couponId = options.couponId || 0;
|
this.couponId = options.couponId || 0;
|
||||||
this.getAddressList(true);
|
this.getAddressList(true);
|
||||||
} else {
|
} else {
|
||||||
toLogin()
|
toLogin()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
@ -114,7 +126,7 @@
|
|||||||
success: function(res) {
|
success: function(res) {
|
||||||
uni.chooseAddress({
|
uni.chooseAddress({
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log(res,'res')
|
console.log(res, 'res')
|
||||||
let addressP = {};
|
let addressP = {};
|
||||||
addressP.province = res.provinceName;
|
addressP.province = res.provinceName;
|
||||||
addressP.city = res.cityName;
|
addressP.city = res.cityName;
|
||||||
@ -126,10 +138,10 @@
|
|||||||
// post_code: res.postalCode,
|
// post_code: res.postalCode,
|
||||||
phone: res.telNumber,
|
phone: res.telNumber,
|
||||||
detail: res.detailInfo,
|
detail: res.detailInfo,
|
||||||
province:res.provinceName,
|
province: res.provinceName,
|
||||||
district:res.countyName,
|
district: res.countyName,
|
||||||
city:res.cityName,
|
city: res.cityName,
|
||||||
city_id:''
|
city_id: ''
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: "添加成功",
|
title: "添加成功",
|
||||||
@ -144,9 +156,10 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: function(res) {
|
fail: function(res) {
|
||||||
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({
|
if (res.errMsg == 'chooseAddress:cancel') return that.$util
|
||||||
title: '取消选择'
|
.Tips({
|
||||||
});
|
title: '取消选择'
|
||||||
|
});
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -186,7 +199,7 @@
|
|||||||
detail: res.detailInfo,
|
detail: res.detailInfo,
|
||||||
post_code: res.postalCode,
|
post_code: res.postalCode,
|
||||||
is_default: 1,
|
is_default: 1,
|
||||||
city_id:""
|
city_id: ""
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
@ -273,9 +286,11 @@
|
|||||||
this.pinkId = '';
|
this.pinkId = '';
|
||||||
this.couponId = '';
|
this.couponId = '';
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/user_address/index?id=' + id + '&cartId=' + cartId + '&pinkId=' + pinkId + '&couponId=' +couponId
|
url: '/pages/users/user_address/index?id=' + id + '&cartId=' + cartId + '&pinkId=' +
|
||||||
|
pinkId + '&couponId=' + couponId
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除地址
|
* 删除地址
|
||||||
*/
|
*/
|
||||||
@ -285,19 +300,32 @@
|
|||||||
if (address == undefined) return that.$util.Tips({
|
if (address == undefined) return that.$util.Tips({
|
||||||
title: '您删除的地址不存在!'
|
title: '您删除的地址不存在!'
|
||||||
});
|
});
|
||||||
delAddress(address.address_id).then(res => {
|
uni.showModal({
|
||||||
that.$util.Tips({
|
title: "提示",
|
||||||
title: '删除成功',
|
content: "您确定要删除当前地址吗?",
|
||||||
icon: 'success'
|
success(res) {
|
||||||
}, function() {
|
if (res.confirm) {
|
||||||
that.addressList.splice(index, 1);
|
delAddress(address.address_id).then(res => {
|
||||||
that.$set(that, 'addressList', that.addressList);
|
that.$util.Tips({
|
||||||
});
|
title: '删除成功',
|
||||||
}).catch(err => {
|
icon: 'success'
|
||||||
return that.$util.Tips({
|
}, function() {
|
||||||
title: err
|
that.addressList.splice(index, 1);
|
||||||
});
|
that.$set(that, 'addressList', that.addressList);
|
||||||
});
|
});
|
||||||
|
}).catch(err => {
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: err
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
that.$util.Tips({
|
||||||
|
title: '您已取消!',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 新增地址
|
* 新增地址
|
||||||
@ -326,7 +354,8 @@
|
|||||||
this.pinkId = '';
|
this.pinkId = '';
|
||||||
this.couponId = '';
|
this.couponId = '';
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/users/order_confirm/index?is_address=1&cartId=' + cartId + '&addressId=' + id + '&pinkId=' +
|
url: '/pages/users/order_confirm/index?is_address=1&cartId=' + cartId + '&addressId=' +
|
||||||
|
id + '&pinkId=' +
|
||||||
pinkId + '&couponId=' + couponId
|
pinkId + '&couponId=' + couponId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -341,62 +370,75 @@
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/deep/radio .wx-radio-input.wx-radio-input-checked,
|
/deep/radio .wx-radio-input.wx-radio-input-checked,
|
||||||
/deep/uni-radio .uni-radio-input.uni-radio-input-checked {
|
/deep/uni-radio .uni-radio-input.uni-radio-input-checked {
|
||||||
border: 1px solid var(--view-theme)!important;
|
border: 1px solid var(--view-theme) !important;
|
||||||
background-color: var(--view-theme)!important;
|
background-color: var(--view-theme) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management.fff {
|
.address-management.fff {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .line {
|
.address-management .line {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 3rpx;
|
height: 3rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .line image {
|
.address-management .line image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item {
|
.address-management .item {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
margin-bottom: 12rpx;
|
margin-bottom: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item .address {
|
.address-management .item .address {
|
||||||
padding: 30rpx 0;
|
padding: 30rpx 0;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item .address .consignee {
|
.address-management .item .address .consignee {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 8rpx;
|
margin-bottom: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item .address .consignee .phone {
|
.address-management .item .address .consignee .phone {
|
||||||
margin-left: 25rpx;
|
margin-left: 25rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item .operation {
|
.address-management .item .operation {
|
||||||
height: 83rpx;
|
height: 83rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.b-color {
|
.b-color {
|
||||||
background-color: var(--view-theme);
|
background-color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item .operation .radio text {
|
.address-management .item .operation .radio text {
|
||||||
margin-left: 13rpx;
|
margin-left: 13rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item .operation .iconfont {
|
.address-management .item .operation .iconfont {
|
||||||
color: #2c2c2c;
|
color: #2c2c2c;
|
||||||
font-size: 35rpx;
|
font-size: 35rpx;
|
||||||
vertical-align: -2rpx;
|
vertical-align: -2rpx;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .item .operation .iconfont.icon-shanchu {
|
.address-management .item .operation .iconfont.icon-shanchu {
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
font-size: 38rpx;
|
font-size: 38rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .footer {
|
.address-management .footer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -408,6 +450,7 @@
|
|||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .footer .addressBnt {
|
.address-management .footer .addressBnt {
|
||||||
width: 330rpx;
|
width: 330rpx;
|
||||||
height: 76rpx;
|
height: 76rpx;
|
||||||
@ -417,27 +460,33 @@
|
|||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .footer .addressBnt.on {
|
.address-management .footer .addressBnt.on {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .footer .addressBnt .iconfont {
|
.address-management .footer .addressBnt .iconfont {
|
||||||
font-size: 35rpx;
|
font-size: 35rpx;
|
||||||
margin-right: 8rpx;
|
margin-right: 8rpx;
|
||||||
vertical-align: -1rpx;
|
vertical-align: -1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-management .footer .addressBnt.wxbnt {
|
.address-management .footer .addressBnt.wxbnt {
|
||||||
background-color: #fe960f;
|
background-color: #fe960f;
|
||||||
}
|
}
|
||||||
.noCommodity{
|
|
||||||
|
.noCommodity {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-top: none;
|
border-top: none;
|
||||||
margin-top: 15vh;
|
margin-top: 15vh;
|
||||||
}
|
}
|
||||||
.noCommodity .pictrue{
|
|
||||||
|
.noCommodity .pictrue {
|
||||||
height: 305rpx;
|
height: 305rpx;
|
||||||
}
|
}
|
||||||
.noCommodity view{
|
|
||||||
|
.noCommodity view {
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
x
Reference in New Issue
Block a user