Commit f1131348 by liimin

refactor(packageMine): 优化地址管理页面样式和交互

- 修改地址详情页面布局和样式,提升用户体验
- 优化地址列表页面展示效果,增加默认地址功能
- 调整订单相关页面样式,统一视觉风格
- 重构部分代码结构,提高可维护性
1 parent 45ff2792
// packageMine/pages/address/detail/detail.js // packageMine/pages/address/detail/detail.js
import mapApi from '~/utils/mapapi/mapapi' import mapApi from "~/utils/mapapi/mapapi";
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/;
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
userObj: { userObj: {
receiveName: '', receiveName: "",
phoneNumber: '', phoneNumber: "",
region: [], region: [],
address: '', address: "",
isDefault: 0, isDefault: 0,
platformObj: {} platformObj: {},
} },
}, },
onLoad: function (options) { onLoad: function (options) {
if (options.id) { wx.p.router.getRouterParams(options).then((params) => {
const { id, isChooseAddress, isDefault } = params;
if (id) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '编辑收货地址' title: "编辑收货地址",
}) });
wx.p.api.mineApi.getUserAddress(options).then(data => { wx.p.api.mineApi.getUserAddress(params).then((data) => {
data = wx.p.util.clearObjNull(data) data = wx.p.util.clearObjNull(data);
data.region = [data.province, data.city, data.area] data.region = [data.province, data.city, data.area];
this.setData({ this.setData({
userObj: data userObj: data,
}) });
}) });
} }
if (options.isChooseAddress) {
this.setData({ this.setData({
isChooseAddress: true isChooseAddress,
}) });
} if (isDefault) {
if (options.isDefault) {
this.setData({ this.setData({
'userObj.isDefault': 1 "userObj.isDefault": 1,
}) });
} }
});
}, },
useLocation() { useLocation() {
let { let {
currentAddress: { currentAddress: { formatted_addresses, address_component, ad_info },
formatted_addresses, } = this.data;
address_component,
ad_info
}
} = this.data
this.setData({ this.setData({
'userObj.address': formatted_addresses.recommend, "userObj.address": formatted_addresses.recommend,
'userObj.region': [address_component.province, address_component.city, address_component.district], "userObj.region": [
'userObj.areaId': ad_info.adcode address_component.province,
}) address_component.city,
address_component.district,
],
"userObj.areaId": ad_info.adcode,
});
}, },
/**获取当前位置 */ /**获取当前位置 */
getLocation() { getLocation() {
let { let { currentAddress } = this.data;
currentAddress if (currentAddress) return;
} = this.data
if (currentAddress) return
this.setData({ this.setData({
unauthorized: false unauthorized: false,
}) });
wx.getLocation({ wx.getLocation({
type: 'gcj02' type: "gcj02",
}).then(({
latitude,
longitude
}) => {
console.log(this)
this.setData({
current: true
}) })
mapApi.detailedAdrress([latitude, longitude]).then(detail => { .then(({ latitude, longitude }) => {
console.log(this);
this.setData({ this.setData({
currentAddress: detail current: true,
}) });
}) mapApi.detailedAdrress([latitude, longitude]).then((detail) => {
}) this.setData({
.catch(err => { currentAddress: detail,
wx.p.wxApi.showToast('获取位置失败') });
});
}) })
.catch((err) => {
wx.p.wxApi.showToast("获取位置失败");
});
}, },
/**打开授权设置 */ /**打开授权设置 */
authAddress() { authAddress() {
this.setData({ this.setData({
showAuth: true showAuth: true,
}) });
}, },
/**授权失败 */ /**授权失败 */
authFail() { authFail() {
this.setData({ this.setData({
unauthorized: true unauthorized: true,
}) });
}, },
/**授权成功 */ /**授权成功 */
authSuccess() { authSuccess() {
this.getLocation() this.getLocation();
}, },
input(e) { input(e) {
let { let { target } = e.currentTarget.dataset;
target let { value } = e.detail;
} = e.currentTarget.dataset
let {
value
} = e.detail
this.setData({ this.setData({
[`userObj.${target}`]: value [`userObj.${target}`]: value,
}) });
}, },
blur(e) { blur(e) {
let { let { value } = e.detail;
value
} = e.detail
this.setData({ this.setData({
'userObj.address': value "userObj.address": value,
}) });
}, },
save() { save() {
let { let { userObj, isChooseAddress } = this.data;
userObj,
isChooseAddress
} = this.data
try { try {
Object.keys(userObj).map(key => { Object.keys(userObj).map((key) => {
if (key == 'receiveName' && !userObj[key]) throw '请输入姓名' if (key == "receiveName" && !userObj[key]) throw "请输入姓名";
if (key == 'phoneNumber') { if (key == "phoneNumber") {
if (!userObj[key]) throw '请输入手机号' if (!userObj[key]) throw "请输入手机号";
if (!phoneRex.test(userObj[key])) throw '请输入正确的手机号' if (!phoneRex.test(userObj[key])) throw "请输入正确的手机号";
} }
if (Array.isArray(userObj[key]) && !userObj[key].length) throw '请选择省市区' if (Array.isArray(userObj[key]) && !userObj[key].length)
if (key == 'address' && !userObj[key]) throw '请填写详细地址' throw "请选择省市区";
}) if (key == "address" && !userObj[key]) throw "请填写详细地址";
});
} catch (error) { } catch (error) {
wx.p.wxApi.showToast(error) wx.p.wxApi.showToast(error);
return return;
} }
let [province, city, area] = userObj.region let [province, city, area] = userObj.region;
let obj = { let obj = {
...userObj, ...userObj,
province, province,
city, city,
area area,
} };
delete obj.region delete obj.region;
let target = obj.id ? 'updateUserAddress' : 'addUserAddress' let target = obj.id ? "updateUserAddress" : "addUserAddress";
if (obj.id) { if (obj.id) {
delete obj.userId delete obj.userId;
delete obj.createTime delete obj.createTime;
delete obj.updateTime delete obj.updateTime;
} }
wx.p.api.mineApi[target](obj).then(() => { wx.p.api.mineApi[target](obj).then(() => {
wx.p.wxApi.showToast('操作成功') wx.p.wxApi.showToast("操作成功");
setTimeout(() => { setTimeout(() => {
if (isChooseAddress) { if (isChooseAddress) {
wx.p.router.back(page => { wx.p.router.back((page) => {
let contactAddress = `${province}${city}${area}${userObj.address}` let contactAddress = `${province}${city}${area}${userObj.address}`;
page.setData({ page.setData({
contactAddress, contactAddress,
contactInfo: { contactInfo: {
contactAddress, contactAddress,
contactName: userObj.receiveName, contactName: userObj.receiveName,
contactPhone: userObj.phoneNumber contactPhone: userObj.phoneNumber,
} },
}) });
}, 2) }, 2);
} else { } else {
wx.p.router.back() wx.p.router.back();
} }
}, 1.5e3) }, 1.5e3);
}) });
}, },
/**选择地区 */ /**选择地区 */
chooseArea(e) { chooseArea(e) {
let { let { value, code } = e.detail;
value, let { userObj } = this.data;
code userObj.region = [value[0], value[1], value[2]];
} = e.detail userObj.provinceId = code[0];
let { userObj.cityId = code[1];
userObj userObj.areaId = code[2];
} = this.data
userObj.region = [value[0], value[1], value[2]]
userObj.provinceId = code[0]
userObj.cityId = code[1]
userObj.areaId = code[2]
this.setData({ this.setData({
userObj userObj,
}) });
}, },
setDefault() { setDefault() {
this.setData({ this.setData({
'userObj.isDefault': this.data.userObj.isDefault == 0 ? 1 : 0 "userObj.isDefault": this.data.userObj.isDefault == 0 ? 1 : 0,
}) });
}, },
showSelect() { showSelect() {
this.setData({ this.setData({
showAreaSelect: true showAreaSelect: true,
}) });
}, },
cancelProvince() { cancelProvince() {
this.setData({ this.setData({
showAreaSelect: false showAreaSelect: false,
}) });
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
...@@ -231,5 +215,5 @@ Page({ ...@@ -231,5 +215,5 @@ Page({
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
onReachBottom: function () {},
});
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
.current { .current {
padding: var(--margin); padding: var(--margin);
background: #fff; background: #fff;
border-radius:var(--borderRadius); border-radius:24rpx;
height: 156rpx; height: 160rpx;
box-sizing: border-box; box-sizing: border-box;
.flex{ .flex{
height: 100%; height: 100%;
...@@ -39,19 +39,23 @@ ...@@ -39,19 +39,23 @@
.current .address-info .address-title { .current .address-info .address-title {
font-weight: 500; font-weight: 500;
margin-bottom: 12rpx; margin-bottom: 12rpx;
color: #282829;
font-size: 32rpx;
} }
.current .address-info .address { .current .address-info .address {
color: #656566; color: #656566;
font-size: 28rpx; font-size: 26rpx;
font-weight: 400;
} }
.current .address-btn { .current .address-btn {
font-size: 24rpx; font-size: 24rpx;
background-color: var(--themeColor); background-color: #F75454;
width: 168rpx; width: 168rpx;
height: 40rpx; height: 40rpx;
color: #fff; color: #fff;
border-radius: 12rpx;
} }
.user-info { .user-info {
...@@ -59,13 +63,14 @@ ...@@ -59,13 +63,14 @@
padding: 0 var(--margin); padding: 0 var(--margin);
background-color: #fff; background-color: #fff;
font-size: 28rpx; font-size: 28rpx;
border-radius: 24rpx;
} }
.user-info .item { .user-info .item {
min-height: 108rpx; min-height: 108rpx;
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 2rpx solid #E3E3E6; border-bottom: 2rpx solid #F0F0F0;
box-sizing: border-box; box-sizing: border-box;
padding: 26rpx 0; padding: 26rpx 0;
} }
...@@ -93,9 +98,17 @@ ...@@ -93,9 +98,17 @@
.default { .default {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 28rpx;
color: #2D2D2E; font-weight: 500;
color: #333333;
margin-top: 24rpx; margin-top: 24rpx;
border-radius: 16rpx;
background: #fff;
height: 112rpx;
padding: 0 var(--margin);
display: flex;
justify-content: space-between;
} }
.default icon { .default icon {
...@@ -104,3 +117,20 @@ ...@@ -104,3 +117,20 @@
.default-btn{ .default-btn{
margin-top: 206rpx; margin-top: 206rpx;
} }
.btn-box {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100rpx;
background-color: #fff;
}
.btn-box .btn {
margin: 6rpx calc(var(--margin) * 2);
background-color: var(--btnColor);
height: 88rpx;
font-weight: 500;
color: #fff;
font-size: 32rpx;
border-radius: 20rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
<view class="flex" bindtap="authAddress">授权获取当前位置</view> <view class="flex" bindtap="authAddress">授权获取当前位置</view>
</block> </block>
<block wx:else> <block wx:else>
<view class="flex"> <view class="flex">获取当前位置中...</view>
获取当前位置中...
</view>
</block> </block>
</block> </block>
<block wx:else> <block wx:else>
...@@ -16,7 +14,9 @@ ...@@ -16,7 +14,9 @@
<glsx-image src="mine/location.png"></glsx-image> <glsx-image src="mine/location.png"></glsx-image>
</view> </view>
<view class="address-info"> <view class="address-info">
<view class="address-title text-hide">{{currentAddress.formatted_addresses.recommend}}</view> <view class="address-title text-hide">
{{currentAddress.formatted_addresses.recommend}}
</view>
<view class="address text-hide">{{currentAddress.address}}</view> <view class="address text-hide">{{currentAddress.address}}</view>
</view> </view>
<view class="address-btn text-center" bindtap="useLocation">使用当前定位</view> <view class="address-btn text-center" bindtap="useLocation">使用当前定位</view>
...@@ -25,26 +25,20 @@ ...@@ -25,26 +25,20 @@
</view> </view>
<view class="user-info"> <view class="user-info">
<view class="item"> <view class="item">
<view class="label"> <view class="label">收货人</view>
收货人
</view>
<view class="value"> <view class="value">
<input bindblur="input" data-target="receiveName" maxlength="10" value="{{userObj.receiveName}}" type="text" placeholder="请输入姓名" placeholder-style="color:#B1B1B3;" /> <input bindblur="input" data-target="receiveName" maxlength="10" value="{{userObj.receiveName}}" type="text" placeholder="请填写收货人姓名" placeholder-style="color:#B1B1B3;" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="label"> <view class="label">手机号码</view>
手机号
</view>
<view class="value"> <view class="value">
<input bindblur="input" data-target="phoneNumber" value="{{userObj.phoneNumber}}" type="number" maxlength="11" placeholder="请输入手机号" placeholder-style="color:#B1B1B3;" /> <input bindblur="input" data-target="phoneNumber" value="{{userObj.phoneNumber}}" type="number" maxlength="11" placeholder="请填写收货人手机号" placeholder-style="color:#B1B1B3;" />
</view> </view>
</view> </view>
<picker value="{{userObj.region}}" mode="region" bindchange="chooseArea"> <picker value="{{userObj.region}}" mode="region" bindchange="chooseArea">
<view class="item"> <view class="item">
<view class="label"> <view class="label">所在地区</view>
选择地区
</view>
<view class="value " style="color:{{userObj.region.length?'':'#B1B1B3'}}"> <view class="value " style="color:{{userObj.region.length?'':'#B1B1B3'}}">
{{userObj.region[0]}} {{userObj.region[0]}}
<block wx:if="{{userObj.region.length}}"> <block wx:if="{{userObj.region.length}}">
...@@ -55,27 +49,25 @@ ...@@ -55,27 +49,25 @@
</view> </view>
</picker> </picker>
<view class="item textarea"> <view class="item textarea">
<view class="label"> <view class="label">详细地址</view>
详细地址
</view>
<view class="value"> <view class="value">
<gl-textarea value="{{userObj.address}}" bindblur="blur" customMaxLength filterEmoji maxlength="30" placeholder="小区楼栋/乡村名称"> <gl-textarea value="{{userObj.address}}" bindblur="blur" customMaxLength filterEmoji maxlength="30" placeholder="小区楼栋/乡村名称"></gl-textarea>
</gl-textarea>
</view> </view>
</view> </view>
</view> </view>
<view class="default" bindtap="setDefault"> <view class="default" bindtap="setDefault">
设为默认收货地址
<block wx:if="{{userObj.isDefault == 1}}"> <block wx:if="{{userObj.isDefault == 1}}">
<icon type="success" size="24rpx" color="#8A303A"></icon> <icon type="success" size="36rpx" color="#FB8A32"></icon>
</block> </block>
<block wx:else> <block wx:else>
<icon type="circle" size="24rpx" color="#E3E3E6"></icon> <icon type="circle" size="36rpx" color="#E3E3E6"></icon>
</block> </block>
设为默认地址
</view> </view>
<view class="default-btn" bindtap="save">保存并使用</view> <!-- <view class="default-btn" bindtap="save">保存并使用</view> -->
<view class="btn-box isFullSucreen">
<view class="btn text-center" bindtap="save">保存并使用</view>
</view>
</view> </view>
<authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize> <authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<glsx-privacy appletName="海马刀"></glsx-privacy> <glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -4,121 +4,114 @@ Page({ ...@@ -4,121 +4,114 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
addressList: [] addressList: [],
}, },
jump(e) { jump(e) {
let { let { id } = e.currentTarget.dataset,
id, { isChooseAddress, addressList } = this.data,
} = e.currentTarget.dataset, { isDefault = addressList.length == 0;
isChooseAddress, wx.p.router.go("/packageMine/pages/address/detail/detail", {
addressList,
} = this.data, isDefault = addressList.length == 0
wx.p.router.go('/packageMine/pages/address/detail/detail', {
id, id,
isChooseAddress, isChooseAddress,
isDefault isDefault,
}) });
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData(options) wx.p.router.getRouterParams(options).then((res) => {
this.setData(res);
});
}, },
chooseThis(e) { chooseThis(e) {
let { let { item } = e.currentTarget.dataset,
item { isChooseAddress } = this.data;
} = e.currentTarget.dataset, {
isChooseAddress,
} = this.data
if (isChooseAddress) { if (isChooseAddress) {
wx.p.router.back(page => { wx.p.router.back((page) => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}` const contactAddress = `${item.province}${item.city}${item.area}${item.address}`;
page.setData({ page.setData({
contactAddress, contactAddress,
contactInfo: { contactInfo: {
contactAddress, contactAddress,
contactName: item.receiveName, contactName: item.receiveName,
contactPhone: item.phoneNumber contactPhone: item.phoneNumber,
}, },
isDefault: item.isDefault == 1 isDefault: item.isDefault == 1,
}) });
}) });
} else { } else {
wx.p.router.go('/packageMine/pages/address/detail/detail', { wx.p.router.go("/packageMine/pages/address/detail/detail", {
id: item.id, id: item.id,
}) });
} }
}, },
getUserAddressList(showTips = '') { getUserAddressList(showTips = "") {
wx.showLoading() wx.showLoading();
this.setData({ this.setData({
addressList: [] addressList: [],
}) });
wx.p.api.mineApi.getUserAddressList().then(data => { wx.p.api.mineApi.getUserAddressList().then((data) => {
this.setData({ this.setData({
addressList: data addressList: data,
}) });
wx.hideLoading() wx.hideLoading();
if(showTips) wx.p.wxApi.showToast(showTips) if (showTips) wx.p.wxApi.showToast(showTips);
}) });
}, },
chooseDefault(e) { chooseDefault(e) {
let { let {
item: { item: { id, isDefault },
item,
} = e.currentTarget.dataset;
if (isDefault != 0) return;
wx.p.api.mineApi
.setUserAddressDefault({
id, id,
isDefault })
}, .then(() => {
item wx.p.wxApi.showToast("操作成功");
} = e.currentTarget.dataset let { isChooseAddress } = this.data;
if (isDefault != 0) return
wx.p.api.mineApi.setUserAddressDefault({
id
}).then(() => {
wx.p.wxApi.showToast('操作成功')
let {
isChooseAddress
} = this.data
if (isChooseAddress) { if (isChooseAddress) {
wx.p.router.back(page => { wx.p.router.back((page) => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}` const contactAddress = `${item.province}${item.city}${item.area}${item.address}`;
page.setData({ page.setData({
contactAddress, contactAddress,
contactInfo: { contactInfo: {
contactAddress, contactAddress,
contactName: item.receiveName, contactName: item.receiveName,
contactPhone: item.phoneNumber contactPhone: item.phoneNumber,
}, },
isDefault: true, isDefault: true,
}) });
}) });
} else { } else {
this.getUserAddressList('默认地址更新成功') this.getUserAddressList("默认地址更新成功");
} }
}) });
}, },
del(e) { del(e) {
let { let { id } = e.currentTarget.dataset;
id
} = e.currentTarget.dataset
wx.showModal({ wx.showModal({
title: '温馨提示', title: "温馨提示",
content: '是否删除当前地址?', content: "是否删除当前地址?",
cancelText: '否', cancelText: "否",
confirmText: '是', confirmText: "是",
confirmColor: '#F13C3D' confirmColor: "#F13C3D",
}).then(res => { }).then((res) => {
if (res.confirm) { if (res.confirm) {
wx.p.api.mineApi.delUserAddress({ wx.p.api.mineApi
id .delUserAddress({
}).then(() => { id,
wx.p.wxApi.showToast('删除成功')
setTimeout(() => {
this.getUserAddressList()
}, 1.5e3)
}) })
.then(() => {
wx.p.wxApi.showToast("删除成功");
setTimeout(() => {
this.getUserAddressList();
}, 1.5e3);
});
} }
}) });
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
...@@ -129,7 +122,7 @@ Page({ ...@@ -129,7 +122,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getUserAddressList() this.getUserAddressList();
}, },
/** /**
...@@ -150,5 +143,5 @@ Page({ ...@@ -150,5 +143,5 @@ Page({
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
onReachBottom: function () {},
});
/* packageMine/pages/address/index/index.wxss *//* packageMine/pages/address/index/index.wxss */ /* packageMine/pages/address/index/index.wxss */ /* packageMine/pages/address/index/index.wxss */
.layout{ .layout {
padding-bottom: calc(100rpx + var(--constantSafeAreaInsetBottom)); padding-bottom: calc(100rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(100rpx + var(--envSafeAreaInsetBottom)); padding-bottom: calc(100rpx + var(--envSafeAreaInsetBottom));
} }
.address-item{ .address-item {
margin: var(--margin); margin: var(--margin);
background-color: #fff; background-color: #fff;
border-radius:var(--borderRadius); border-radius: 24rpx;
min-height: 234rpx; min-height: 234rpx;
padding: 0 var(--margin); padding: 0 var(--margin);
} }
.address-item .top{ .address-item .top {
display: flex; display: flex;
align-items: center; align-items: center;
padding-top: 34rpx; padding-top: 34rpx;
justify-content: space-between; justify-content: space-between;
} }
.address-item .top .info{ .address-item .top .info {
width: calc(100% - 70rpx); width: calc(100% - 70rpx);
padding-bottom: 20rpx; padding-bottom: 20rpx;
font-size: 28rpx;
.address {
color: #282829;
font-weight: 400;
}
} }
.address-item .top .info .user{ .address-item .top .info .user {
margin-bottom: 20rpx; margin-bottom: 20rpx;
color: #0a0d14;
font-weight: 500;
} }
.address-item .top .info .user text{ .address-item .top .info .user text {
margin-left: 48rpx; margin-left: 48rpx;
color: #0a0d14;
font-weight: 400;
} }
.address-item .top .icon-box{ .address-item .top .icon-box {
width: 70rpx; width: 70rpx;
min-height: 154rpx; min-height: 154rpx;
} }
...@@ -35,9 +44,9 @@ ...@@ -35,9 +44,9 @@
width: var(--margin); width: var(--margin);
height: var(--margin); height: var(--margin);
} }
.address-item .bottom{ .address-item .bottom {
height: 78rpx; height: 78rpx;
border-top: 2rpx solid #E3E3E6; border-top: 1rpx solid #f0f0f0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -47,6 +56,7 @@ ...@@ -47,6 +56,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
height: 100%; height: 100%;
color: #6e6e7a;
} }
.address-item .bottom .del { .address-item .bottom .del {
...@@ -57,13 +67,13 @@ ...@@ -57,13 +67,13 @@
width: 100rpx; width: 100rpx;
justify-content: flex-end; justify-content: flex-end;
} }
.address-item .bottom .choose.default{ .address-item .bottom .choose.default {
color: var(--btnColor); color: var(--btnColor);
} }
.address-item .bottom .choose icon{ .address-item .bottom .choose icon {
margin-right: 20rpx; margin-right: 20rpx;
} }
.btn-box{ .btn-box {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
...@@ -71,11 +81,12 @@ ...@@ -71,11 +81,12 @@
height: 100rpx; height: 100rpx;
background-color: #fff; background-color: #fff;
} }
.btn-box .btn{ .btn-box .btn {
margin: 6rpx var(--margin); margin: 6rpx calc(var(--margin) * 2);
background-color:var(--btnColor); background-color: var(--btnColor);
height: 88rpx; height: 88rpx;
font-weight: 500;
color: #fff; color: #fff;
font-size: var(--margin); font-size: 32rpx;
border-radius:var(--borderRadius); border-radius: 20rpx;
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="choose {{item.isDefault == 1?'default':''}}" catchtap="chooseDefault" data-item="{{item}}"> <view class="choose {{item.isDefault == 1?'default':''}}" catchtap="chooseDefault" data-item="{{item}}">
<icon type="{{item.isDefault == 1?'success':'circle'}}" size="28rpx" color="{{item.isDefault == 1?'#8A303A':'#E3E3E6'}}"></icon> <icon type="{{item.isDefault == 1?'success':'circle'}}" size="32rpx" color="{{item.isDefault == 1?'#FB8A32':'#6E6E7A'}}"></icon>
默认地址 默认地址
</view> </view>
<block wx:if="{{!isChooseAddress}}"> <block wx:if="{{!isChooseAddress}}">
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
display: none; display: none;
} }
} }
.weui-actionsheet__cell:hover,
.weui-actionsheet__cell_warn { .weui-actionsheet__cell_warn {
color: var(--btnColor); color: var(--btnColor);
background: #fff9f5; background: #fff9f5;
...@@ -107,7 +108,7 @@ ...@@ -107,7 +108,7 @@
padding: 4rpx 18rpx; padding: 4rpx 18rpx;
} }
} }
.btn-box{ .btn-box {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
width: 100%; width: 100%;
} }
.item { .section {
flex: 1; flex: 1;
border: 2rpx solid #EBEBEB; border: 2rpx solid #EBEBEB;
height: 88rpx; height: 88rpx;
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
border-radius: 8rpx; border-radius: 8rpx;
overflow: hidden; overflow: hidden;
} }
.item.active{ .section.active{
border-color: var(--btnColor); border-color: var(--btnColor);
} }
.active .icon{ .active .icon{
......
<view class="type-box"> <view class="type-box">
<block wx:for="{{afterSaleList}}" wx:key="index"> <block wx:for="{{afterSaleList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}"> <view class="section text-center {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}">
{{afterType[item.value]}} {{afterType[item.value]}}
<view class="icon"> <view class="icon">
<glsx-image webp src="mine/active.png"></glsx-image> <glsx-image webp src="mine/active.png"></glsx-image>
......
...@@ -49,9 +49,10 @@ Page({ ...@@ -49,9 +49,10 @@ Page({
}); });
}, },
radioChange(e){ radioChange(e){
const value = e.currentTarget.dataset.item.value
this.setData({ this.setData({
"orderObj.reason": e.detail.value, "orderObj.reason": value,
refundReason:RefundReason.find(item => item.value == e.detail.value).text refundReason:RefundReason.find(item => item.value == value).text
}); });
}, },
noScroll() {}, noScroll() {},
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
.weui-cell__hd { .weui-cell__hd {
margin-left: 10rpx; margin-left: 10rpx;
margin-right: 20rpx; margin-right: 20rpx;
line-height: 0;
} }
&::before { &::before {
display: none; display: none;
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
.box { .box {
background: #ffffff; background: #ffffff;
border-radius: 8rpx; border-radius: 16rpx;
.box-item { .box-item {
display: flex; display: flex;
height: 100rpx; height: 100rpx;
...@@ -131,29 +132,35 @@ ...@@ -131,29 +132,35 @@
.upload-box .item { .upload-box .item {
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
background: #d8d8d8; background: #F5F5F7;
margin-bottom: 30rpx; margin-bottom: 30rpx;
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 8px;
position: relative; position: relative;
} padding: 1rpx;
.del {
.item .del {
position: absolute; position: absolute;
width: 72rpx; width: 16rpx;
height: 72rpx; height: 16rpx;
right: -32rpx; right: 2rpx;
top: -32rpx; top: -22rpx;
} .icon {
.upload-box .item .del .icon {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
}
}
.image{
border-radius: 8px;
}
} }
.upload-box .upload-item { .upload-box .upload-item {
background-color: #fff; background-color: #fff;
border: 2rpx solid #d8d8d8; border: 2rpx solid #d8d8d8;
box-sizing: border-box; box-sizing: border-box;
border: 1px dashed #c9cacc;
border-radius: 8px;
position: relative;
} }
.btn { .btn {
......
...@@ -43,20 +43,20 @@ ...@@ -43,20 +43,20 @@
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<block wx:for="{{imgUrls}}" wx:key="index"> <block wx:if="{{imgUrls.length < 5}}">
<view class="item" catchtap="previewImage" data-current="{{item}}" data-urls="{{imgUrls}}"> <view class="upload-item item text-center" bindtap="upLoad">
<image webp src="{{item}}"></image>
<view class="del text-center" catchtap="del" data-index="{{index}}">
<view class="icon"> <view class="icon">
<glsx-image webp src="mine/del.png"></glsx-image> <glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view> </view>
</view> </view>
</block> </block>
<block wx:if="{{imgUrls.length < 5}}"> <block wx:for="{{imgUrls}}" wx:key="index">
<view class="upload-item item text-center" bindtap="upLoad"> <view class="item" catchtap="previewImage" data-current="{{item}}" data-urls="{{imgUrls}}">
<image webp src="{{item}}" mode="aspectFill" class="image"></image>
<view class="del" catchtap="del" data-index="{{index}}">
<view class="icon"> <view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image> <mp-icon icon="close2" color="#D8D8D8" type="field" size="{{16}}"></mp-icon>
</view>
</view> </view>
</view> </view>
</block> </block>
...@@ -66,14 +66,12 @@ ...@@ -66,14 +66,12 @@
</view> </view>
<popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="confirmPopup"> <popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="confirmPopup">
<view class="page-section"> <view class="page-section">
<radio-group bindchange="radioChange"> <label class="weui-cell weui-check__label" wx:for="{{RefundReason}}" wx:key="{{item.value}}" bindtap="radioChange" data-item="{{item}}">
<label class="weui-cell weui-check__label" wx:for="{{RefundReason}}" wx:key="{{item.value}}">
<view class="weui-cell__hd"> <view class="weui-cell__hd">
<radio value="{{item.value}}" checked="true" color="#FC8A32" /> <icon type="{{refundReason == item.text?'success':'circle'}}" size="40rpx" color="{{refundReason == item.text?'#FB8A32':'#E3E3E6'}}"></icon>
</view> </view>
<view class="weui-cell__bd">{{item.text}}</view> <view class="weui-cell__bd">{{item.text}}</view>
</label> </label>
</radio-group>
</view> </view>
</popup> </popup>
<glsx-privacy appletName="海马刀"></glsx-privacy> <glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="info-top"> <view class="info-top">
<view class="name text-hide">{{item.orderSource == 5 ? item.activityName: i.goodsName}}</view> <view class="name text-hide">{{item.orderSource == 5 ? item.activityName: i.goodsName}}</view>
<view class="number"> <view class="number">
<mp-icon icon="close" color="black" size="{{12}}"></mp-icon>{{item.orderSource == 5 ? 1: i.goodsNumber}} <mp-icon icon="close" color="#656566" size="{{12}}"></mp-icon>{{item.orderSource == 5 ? 1: i.goodsNumber}}
</view> </view>
</view> </view>
<view class="info-bottom"> <view class="info-bottom">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!