This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-03-14 15:32:01 +08:00
parent 011cd2663f
commit 28d9667b4e
2 changed files with 778 additions and 441 deletions

File diff suppressed because one or more lines are too long

View File

@ -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() {
@ -144,7 +156,8 @@
}); });
}, },
fail: function(res) { fail: function(res) {
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({ if (res.errMsg == 'chooseAddress:cancel') return that.$util
.Tips({
title: '取消选择' title: '取消选择'
}); });
}, },
@ -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,6 +300,11 @@
if (address == undefined) return that.$util.Tips({ if (address == undefined) return that.$util.Tips({
title: '您删除的地址不存在!' title: '您删除的地址不存在!'
}); });
uni.showModal({
title: "提示",
content: "您确定要删除当前地址吗?",
success(res) {
if (res.confirm) {
delAddress(address.address_id).then(res => { delAddress(address.address_id).then(res => {
that.$util.Tips({ that.$util.Tips({
title: '删除成功', title: '删除成功',
@ -298,6 +318,14 @@
title: err 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
}) })
} }
@ -344,59 +373,72 @@
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,26 +460,32 @@
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;
} }