Commit 5d8bd058 by wangzhihui

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas/mini-program/…

…points-mall into SAAS+V4.56.0-0908
2 parents 1800dbc9 3d0c0b97
Showing 33 changed files with 750 additions and 611 deletions
// packageMine/pages/address/detail/detail.js
import mapApi from '~/utils/mapapi/mapapi'
const phoneRex = /^[1]([3-9])[0-9]{9}$/
import mapApi from "~/utils/mapapi/mapapi";
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
Page({
/**
* 页面的初始数据
*/
data: {
userObj: {
receiveName: '',
phoneNumber: '',
receiveName: "",
phoneNumber: "",
region: [],
address: '',
address: "",
isDefault: 0,
platformObj: {}
}
platformObj: {},
},
},
onLoad: function (options) {
if (options.id) {
wx.setNavigationBarTitle({
title: '编辑收货地址'
})
wx.p.api.mineApi.getUserAddress(options).then(data => {
data = wx.p.util.clearObjNull(data)
data.region = [data.province, data.city, data.area]
this.setData({
userObj: data
})
})
}
if (options.isChooseAddress) {
this.setData({
isChooseAddress: true
})
}
if (options.isDefault) {
wx.p.router.getRouterParams(options).then((params) => {
const { id, isChooseAddress, isDefault } = params;
if (id) {
wx.setNavigationBarTitle({
title: "编辑收货地址",
});
wx.p.api.mineApi.getUserAddress(params).then((data) => {
data = wx.p.util.clearObjNull(data);
data.region = [data.province, data.city, data.area];
this.setData({
userObj: data,
});
});
}
this.setData({
'userObj.isDefault': 1
})
}
isChooseAddress,
});
if (isDefault) {
this.setData({
"userObj.isDefault": 1,
});
}
});
},
useLocation() {
let {
currentAddress: {
formatted_addresses,
address_component,
ad_info
}
} = this.data
currentAddress: { formatted_addresses, address_component, ad_info },
} = this.data;
this.setData({
'userObj.address': formatted_addresses.recommend,
'userObj.region': [address_component.province, address_component.city, address_component.district],
'userObj.areaId': ad_info.adcode
})
"userObj.address": formatted_addresses.recommend,
"userObj.region": [
address_component.province,
address_component.city,
address_component.district,
],
"userObj.areaId": ad_info.adcode,
});
},
/**获取当前位置 */
getLocation() {
let {
currentAddress
} = this.data
if (currentAddress) return
let { currentAddress } = this.data;
if (currentAddress) return;
this.setData({
unauthorized: false
})
unauthorized: false,
});
wx.getLocation({
type: 'gcj02'
}).then(({
latitude,
longitude
}) => {
console.log(this)
type: "gcj02",
})
.then(({ latitude, longitude }) => {
console.log(this);
this.setData({
current: true
})
mapApi.detailedAdrress([latitude, longitude]).then(detail => {
current: true,
});
mapApi.detailedAdrress([latitude, longitude]).then((detail) => {
this.setData({
currentAddress: detail
})
})
})
.catch(err => {
wx.p.wxApi.showToast('获取位置失败')
currentAddress: detail,
});
});
})
.catch((err) => {
wx.p.wxApi.showToast("获取位置失败");
});
},
/**打开授权设置 */
authAddress() {
this.setData({
showAuth: true
})
showAuth: true,
});
},
/**授权失败 */
authFail() {
this.setData({
unauthorized: true
})
unauthorized: true,
});
},
/**授权成功 */
authSuccess() {
this.getLocation()
this.getLocation();
},
input(e) {
let {
target
} = e.currentTarget.dataset
let {
value
} = e.detail
let { target } = e.currentTarget.dataset;
let { value } = e.detail;
this.setData({
[`userObj.${target}`]: value
})
[`userObj.${target}`]: value,
});
},
blur(e) {
let {
value
} = e.detail
let { value } = e.detail;
this.setData({
'userObj.address': value
})
"userObj.address": value,
});
},
save() {
let {
userObj,
isChooseAddress
} = this.data
let { userObj, isChooseAddress } = this.data;
try {
Object.keys(userObj).map(key => {
if (key == 'receiveName' && !userObj[key]) throw '请输入姓名'
if (key == 'phoneNumber') {
if (!userObj[key]) throw '请输入手机号'
if (!phoneRex.test(userObj[key])) throw '请输入正确的手机号'
Object.keys(userObj).map((key) => {
if (key == "receiveName" && !userObj[key]) throw "请输入姓名";
if (key == "phoneNumber") {
if (!userObj[key]) throw "请输入手机号";
if (!phoneRex.test(userObj[key])) throw "请输入正确的手机号";
}
if (Array.isArray(userObj[key]) && !userObj[key].length) throw '请选择省市区'
if (key == 'address' && !userObj[key]) throw '请填写详细地址'
})
if (Array.isArray(userObj[key]) && !userObj[key].length)
throw "请选择省市区";
if (key == "address" && !userObj[key]) throw "请填写详细地址";
});
} catch (error) {
wx.p.wxApi.showToast(error)
return
wx.p.wxApi.showToast(error);
return;
}
let [province, city, area] = userObj.region
let [province, city, area] = userObj.region;
let obj = {
...userObj,
province,
city,
area
}
delete obj.region
let target = obj.id ? 'updateUserAddress' : 'addUserAddress'
area,
};
delete obj.region;
let target = obj.id ? "updateUserAddress" : "addUserAddress";
if (obj.id) {
delete obj.userId
delete obj.createTime
delete obj.updateTime
delete obj.userId;
delete obj.createTime;
delete obj.updateTime;
}
wx.p.api.mineApi[target](obj).then(() => {
wx.p.wxApi.showToast('操作成功')
wx.p.wxApi.showToast("操作成功");
setTimeout(() => {
if (isChooseAddress) {
wx.p.router.back(page => {
let contactAddress = `${province}${city}${area}${userObj.address}`
wx.p.router.back((page) => {
let contactAddress = `${province}${city}${area}${userObj.address}`;
page.setData({
contactAddress,
contactInfo: {
contactAddress,
contactName: userObj.receiveName,
contactPhone: userObj.phoneNumber
}
})
}, 2)
contactPhone: userObj.phoneNumber,
},
});
}, 2);
} else {
wx.p.router.back()
wx.p.router.back();
}
}, 1.5e3)
})
}, 1.5e3);
});
},
/**选择地区 */
chooseArea(e) {
let {
value,
code
} = e.detail
let {
userObj
} = this.data
userObj.region = [value[0], value[1], value[2]]
userObj.provinceId = code[0]
userObj.cityId = code[1]
userObj.areaId = code[2]
let { value, code } = e.detail;
let { userObj } = this.data;
userObj.region = [value[0], value[1], value[2]];
userObj.provinceId = code[0];
userObj.cityId = code[1];
userObj.areaId = code[2];
this.setData({
userObj
})
userObj,
});
},
setDefault() {
this.setData({
'userObj.isDefault': this.data.userObj.isDefault == 0 ? 1 : 0
})
"userObj.isDefault": this.data.userObj.isDefault == 0 ? 1 : 0,
});
},
showSelect() {
this.setData({
showAreaSelect: true
})
showAreaSelect: true,
});
},
cancelProvince() {
this.setData({
showAreaSelect: false
})
showAreaSelect: false,
});
},
/**
* 生命周期函数--监听页面初次渲染完成
......@@ -231,5 +215,5 @@ Page({
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file
onReachBottom: function () {},
});
......@@ -8,8 +8,8 @@
.current {
padding: var(--margin);
background: #fff;
border-radius:var(--borderRadius);
height: 156rpx;
border-radius:24rpx;
height: 160rpx;
box-sizing: border-box;
.flex{
height: 100%;
......@@ -39,19 +39,23 @@
.current .address-info .address-title {
font-weight: 500;
margin-bottom: 12rpx;
color: #282829;
font-size: 32rpx;
}
.current .address-info .address {
color: #656566;
font-size: 28rpx;
font-size: 26rpx;
font-weight: 400;
}
.current .address-btn {
font-size: 24rpx;
background-color: var(--themeColor);
background-color: #F75454;
width: 168rpx;
height: 40rpx;
color: #fff;
border-radius: 12rpx;
}
.user-info {
......@@ -59,13 +63,14 @@
padding: 0 var(--margin);
background-color: #fff;
font-size: 28rpx;
border-radius: 24rpx;
}
.user-info .item {
min-height: 108rpx;
display: flex;
align-items: center;
border-bottom: 2rpx solid #E3E3E6;
border-bottom: 2rpx solid #F0F0F0;
box-sizing: border-box;
padding: 26rpx 0;
}
......@@ -93,9 +98,17 @@
.default {
display: flex;
align-items: center;
font-size: 24rpx;
color: #2D2D2E;
font-size: 28rpx;
font-weight: 500;
color: #333333;
margin-top: 24rpx;
border-radius: 16rpx;
background: #fff;
height: 112rpx;
padding: 0 var(--margin);
display: flex;
justify-content: space-between;
}
.default icon {
......@@ -103,4 +116,21 @@
}
.default-btn{
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
......@@ -5,9 +5,7 @@
<view class="flex" bindtap="authAddress">授权获取当前位置</view>
</block>
<block wx:else>
<view class="flex">
获取当前位置中...
</view>
<view class="flex">获取当前位置中...</view>
</block>
</block>
<block wx:else>
......@@ -16,7 +14,9 @@
<glsx-image src="mine/location.png"></glsx-image>
</view>
<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>
<view class="address-btn text-center" bindtap="useLocation">使用当前定位</view>
......@@ -25,26 +25,20 @@
</view>
<view class="user-info">
<view class="item">
<view class="label">
收货人
</view>
<view class="label">收货人</view>
<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 class="item">
<view class="label">
手机号
</view>
<view class="label">手机号码</view>
<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>
<picker value="{{userObj.region}}" mode="region" bindchange="chooseArea">
<view class="item">
<view class="label">
选择地区
</view>
<view class="label">所在地区</view>
<view class="value " style="color:{{userObj.region.length?'':'#B1B1B3'}}">
{{userObj.region[0]}}
<block wx:if="{{userObj.region.length}}">
......@@ -55,27 +49,25 @@
</view>
</picker>
<view class="item textarea">
<view class="label">
详细地址
</view>
<view class="label">详细地址</view>
<view class="value">
<gl-textarea value="{{userObj.address}}" bindblur="blur" customMaxLength filterEmoji maxlength="30" placeholder="小区楼栋/乡村名称">
</gl-textarea>
<gl-textarea value="{{userObj.address}}" bindblur="blur" customMaxLength filterEmoji maxlength="30" placeholder="小区楼栋/乡村名称"></gl-textarea>
</view>
</view>
</view>
<view class="default" bindtap="setDefault">
设为默认收货地址
<block wx:if="{{userObj.isDefault == 1}}">
<icon type="success" size="24rpx" color="#8A303A"></icon>
<icon type="success" size="36rpx" color="#FB8A32"></icon>
</block>
<block wx:else>
<icon type="circle" size="24rpx" color="#E3E3E6"></icon>
<icon type="circle" size="36rpx" color="#E3E3E6"></icon>
</block>
设为默认地址
</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>
<authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file
......@@ -4,121 +4,114 @@ Page({
* 页面的初始数据
*/
data: {
addressList: []
addressList: [],
},
jump(e) {
let {
id,
} = e.currentTarget.dataset, {
isChooseAddress,
addressList,
} = this.data, isDefault = addressList.length == 0
wx.p.router.go('/packageMine/pages/address/detail/detail', {
let { id } = e.currentTarget.dataset,
{ isChooseAddress, addressList } = this.data,
isDefault = addressList.length == 0;
wx.p.router.go("/packageMine/pages/address/detail/detail", {
id,
isChooseAddress,
isDefault
})
isDefault,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData(options)
wx.p.router.getRouterParams(options).then((res) => {
this.setData(res);
});
},
chooseThis(e) {
let {
item
} = e.currentTarget.dataset, {
isChooseAddress,
} = this.data
let { item } = e.currentTarget.dataset,
{ isChooseAddress } = this.data;
if (isChooseAddress) {
wx.p.router.back(page => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}`
wx.p.router.back((page) => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}`;
page.setData({
contactAddress,
contactInfo: {
contactAddress,
contactName: item.receiveName,
contactPhone: item.phoneNumber
contactPhone: item.phoneNumber,
},
isDefault: item.isDefault == 1
})
})
isDefault: item.isDefault == 1,
});
});
} else {
wx.p.router.go('/packageMine/pages/address/detail/detail', {
wx.p.router.go("/packageMine/pages/address/detail/detail", {
id: item.id,
})
});
}
},
getUserAddressList(showTips = '') {
wx.showLoading()
getUserAddressList(showTips = "") {
wx.showLoading();
this.setData({
addressList: []
})
wx.p.api.mineApi.getUserAddressList().then(data => {
addressList: [],
});
wx.p.api.mineApi.getUserAddressList().then((data) => {
this.setData({
addressList: data
})
wx.hideLoading()
if(showTips) wx.p.wxApi.showToast(showTips)
})
addressList: data,
});
wx.hideLoading();
if (showTips) wx.p.wxApi.showToast(showTips);
});
},
chooseDefault(e) {
let {
item: {
item: { id, isDefault },
item,
} = e.currentTarget.dataset;
if (isDefault != 0) return;
wx.p.api.mineApi
.setUserAddressDefault({
id,
isDefault
},
item
} = e.currentTarget.dataset
if (isDefault != 0) return
wx.p.api.mineApi.setUserAddressDefault({
id
}).then(() => {
wx.p.wxApi.showToast('操作成功')
let {
isChooseAddress
} = this.data
if (isChooseAddress) {
wx.p.router.back(page => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}`
page.setData({
contactAddress,
contactInfo: {
})
.then(() => {
wx.p.wxApi.showToast("操作成功");
let { isChooseAddress } = this.data;
if (isChooseAddress) {
wx.p.router.back((page) => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}`;
page.setData({
contactAddress,
contactName: item.receiveName,
contactPhone: item.phoneNumber
},
isDefault: true,
})
})
} else {
this.getUserAddressList('默认地址更新成功')
}
})
contactInfo: {
contactAddress,
contactName: item.receiveName,
contactPhone: item.phoneNumber,
},
isDefault: true,
});
});
} else {
this.getUserAddressList("默认地址更新成功");
}
});
},
del(e) {
let {
id
} = e.currentTarget.dataset
let { id } = e.currentTarget.dataset;
wx.showModal({
title: '温馨提示',
content: '是否删除当前地址?',
cancelText: '否',
confirmText: '是',
confirmColor: '#F13C3D'
}).then(res => {
title: "温馨提示",
content: "是否删除当前地址?",
cancelText: "否",
confirmText: "是",
confirmColor: "#F13C3D",
}).then((res) => {
if (res.confirm) {
wx.p.api.mineApi.delUserAddress({
id
}).then(() => {
wx.p.wxApi.showToast('删除成功')
setTimeout(() => {
this.getUserAddressList()
}, 1.5e3)
})
wx.p.api.mineApi
.delUserAddress({
id,
})
.then(() => {
wx.p.wxApi.showToast("删除成功");
setTimeout(() => {
this.getUserAddressList();
}, 1.5e3);
});
}
})
});
},
/**
* 生命周期函数--监听页面初次渲染完成
......@@ -129,7 +122,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getUserAddressList()
this.getUserAddressList();
},
/**
......@@ -150,5 +143,5 @@ Page({
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file
onReachBottom: function () {},
});
/* packageMine/pages/address/index/index.wxss *//* packageMine/pages/address/index/index.wxss */
.layout{
/* packageMine/pages/address/index/index.wxss */ /* packageMine/pages/address/index/index.wxss */
.layout {
padding-bottom: calc(100rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(100rpx + var(--envSafeAreaInsetBottom));
}
.address-item{
.address-item {
margin: var(--margin);
background-color: #fff;
border-radius:var(--borderRadius);
border-radius: 24rpx;
min-height: 234rpx;
padding: 0 var(--margin);
}
.address-item .top{
.address-item .top {
display: flex;
align-items: center;
padding-top: 34rpx;
justify-content: space-between;
}
.address-item .top .info{
.address-item .top .info {
width: calc(100% - 70rpx);
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;
color: #0a0d14;
font-weight: 500;
}
.address-item .top .info .user text{
.address-item .top .info .user text {
margin-left: 48rpx;
color: #0a0d14;
font-weight: 400;
}
.address-item .top .icon-box{
.address-item .top .icon-box {
width: 70rpx;
min-height: 154rpx;
}
......@@ -35,9 +44,9 @@
width: var(--margin);
height: var(--margin);
}
.address-item .bottom{
.address-item .bottom {
height: 78rpx;
border-top: 2rpx solid #E3E3E6;
border-top: 1rpx solid #f0f0f0;
display: flex;
align-items: center;
justify-content: space-between;
......@@ -47,6 +56,7 @@
display: flex;
align-items: center;
height: 100%;
color: #6e6e7a;
}
.address-item .bottom .del {
......@@ -57,13 +67,13 @@
width: 100rpx;
justify-content: flex-end;
}
.address-item .bottom .choose.default{
.address-item .bottom .choose.default {
color: var(--btnColor);
}
.address-item .bottom .choose icon{
.address-item .bottom .choose icon {
margin-right: 20rpx;
}
.btn-box{
.btn-box {
position: fixed;
bottom: 0;
left: 0;
......@@ -71,11 +81,12 @@
height: 100rpx;
background-color: #fff;
}
.btn-box .btn{
margin: 6rpx var(--margin);
background-color:var(--btnColor);
.btn-box .btn {
margin: 6rpx calc(var(--margin) * 2);
background-color: var(--btnColor);
height: 88rpx;
font-weight: 500;
color: #fff;
font-size: var(--margin);
border-radius:var(--borderRadius);
}
\ No newline at end of file
font-size: 32rpx;
border-radius: 20rpx;
}
......@@ -18,7 +18,7 @@
</view>
<view class="bottom">
<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>
<block wx:if="{{!isChooseAddress}}">
......
import {
RefundStatus,
ExpressList,
AfterSaleObj,
AddressInfo,
} from "~/constants/mine.js";
Page({
/**
* 页面的初始数据
*/
data: {
// 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过
afterSaleObj: Object.freeze(AfterSaleObj),
address: Object.freeze(AddressInfo),
addressObject: {
name: "张三",
phone: "12345678901",
address: "广东省深圳市南山区",
order: {
express_no: "",
},
expressList: Object.freeze(ExpressList),
// Mock数据用于页面展示
orderInfo: {
refundStatus: 1, // 1:待处理
......@@ -62,36 +49,8 @@ Page({
*/
onLoad: function (options) {
// this.getOrderRefundDetail(options.orderCode)
this.setData({
refund: RefundStatus.find(
(item) => item.status == this.data.orderInfo.refundStatus
),
});
},
showExpressSelector() {
this.setData({
isShowExpressSelector: true,
});
},
selectExpress(e) {
this.setData({
isShowExpressSelector: false,
});
const expressList = this.data.expressList.map((item) => {
if (item.value == e.detail.value) {
item.type = "warn";
this.setData({
express: item,
});
} else {
item.type = "";
}
return item;
});
this.setData({
expressList,
});
},
getOrderRefundDetail(orderCode) {
wx.p.wxApi.showLoading("加载中...");
wx.p.api.shopmallApi.getOrderRefundDetail(orderCode).then((data) => {
......@@ -109,6 +68,7 @@ Page({
});
});
},
confirm() {
let { orderInfo } = this.data;
console.log(orderInfo);
......@@ -117,8 +77,21 @@ Page({
orderInfo
);
},
previewImage(e) {
let params = e.currentTarget.dataset;
let params = e.detail; // 从组件传递的数据
wx.p.wxApi.previewImage(params);
},
onExpressNoInput(e) {
const { value } = e.detail;
this.setData({
"order.express_no": value,
});
},
onSubmitLogistics() {
// 提交物流信息的处理逻辑
console.log("提交物流信息");
},
});
{
"navigationBarTitleText": "售后详情",
"usingComponents": {
"content": "../index/components/Content/Content",
"mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet"
"refund-status": "./components/RefundStatus/RefundStatus",
"return-address-box": "./components/ReturnAddressBox/ReturnAddressBox",
"after-sale-info-box": "./components/AfterSaleInfoBox/AfterSaleInfoBox",
"re-submit-button": "./components/ReSubmitButton/ReSubmitButton"
}
}
\ No newline at end of file
.layout {
padding: 32rpx;
}
.status-box {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 24rpx;
.icon {
width: 80rpx;
height: 80rpx;
}
.box-info {
.title {
font-size: 40rpx;
font-weight: 500;
color: #282829;
}
.tips {
font-size: 28rpx;
font-weight: 400;
color: #656566;
}
}
margin-bottom: 32rpx;
}
.box {
border-radius: 16rpx;
background-color: #fff;
}
.mb {
margin-bottom: 24rpx;
}
// .section {
// font-size: 32rpx;
// font-weight: 400;
// color: #323233;
// height: 104rpx;
// line-height: 104rpx;
// text-align: center;
// &.active {
// color: var(--btnColor);
// background: #fff9f5;
// }
// }
.weui-actionsheet__title-text {
font-size: 32rpx;
color: #323233;
font-weight: 500;
}
.weui-actionsheet__cell {
&::before {
display: none;
}
}
.weui-actionsheet__cell_warn {
color: var(--btnColor);
background: #fff9f5;
}
.text-box {
padding: 32rpx 24rpx;
border-bottom: 2rpx solid #eff0f2;
.title {
font-weight: 600;
font-size: 32rpx;
color: #282829;
}
.form {
margin-top: 24rpx;
background: #f7f8fa;
border-radius: 12rpx;
padding: 0 32rpx;
.item {
height: 104rpx;
line-height: 104rpx;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0;
.label {
margin-right: 12rpx;
font-size: 28rpx;
color: #282829;
}
&:first-child {
border-bottom: 2rpx solid #eff0f2;
}
}
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
.copy {
background: #e8e8ea;
border-radius: 18rpx;
font-weight: 400;
font-size: 22rpx;
color: #707071;
padding: 4rpx 18rpx;
}
}
.btn-box{
display: flex;
justify-content: center;
align-items: center;
margin-top: 24rpx;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 336rpx;
height: 80rpx;
border-radius: 20rpx;
border: 2rpx solid #dcdfe6;
font-size: 24rpx;
}
.submit-btn {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
}
}
.text-box .item {
margin-bottom: 12rpx;
display: flex;
align-items: flex-start;
}
.text-box .item .label {
width: 140rpx;
}
.text-box .item .value {
color: #656566;
width: calc(100% - 150rpx);
.arrow {
margin-left: 16rpx;
width: 20rpx;
height: 20rpx;
transform: translateY(1rpx);
}
&.icon {
display: flex;
align-items: center;
justify-content: space-between;
}
}
.photo-box {
padding: 40rpx 0 28rpx 20rpx;
display: flex;
flex-wrap: wrap;
}
.photo-box .item {
width: 200rpx;
height: 200rpx;
background: #d8d8d8;
margin: 0 20rpx 20rpx 0;
}
<block wx:if="{{orderInfo}}">
<view class="layout isFullSucreen">
<view class="status-box">
<!-- 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过 -->
<view class="icon">
<glsx-image webp src="{{refund.image}}"></glsx-image>
</view>
<view class="box-info">
<view class="title">{{refund.title}}</view>
<view class="tips">{{refund.tips}}</view>
</view>
</view>
<view class="box mb">
<view class="text-box">
<view class="header">
<view class="title">商品寄回地址</view>
<view class="copy">复制</view>
</view>
<block wx:for="{{address}}" wx:key="index">
<view class="item">
<view class="label">{{item.title}}:</view>
<view class="value">
<view>{{addressObject[item.key]}}</view>
</view>
</view>
</block>
<view class="title">请填写退货物流</view>
<view class="form">
<view class="item">
<view class="label">物流公司:</view>
<view class="value icon" bindtap="showExpressSelector">
<view>{{express.text||'请选择'}}</view>
<mp-icon icon="arrow" color="#B1B1B3" size="12"></mp-icon>
</view>
</view>
<view class="item">
<view class="label">快递单号:</view>
<view class="value">
<input type="text" value="{{order.express_no}}" placeholder="请输入" placeholder-style="color: #999999;" />
</view>
</view>
</view>
<view class="btn-box">
<view class="btn submit-btn" data-order-code="{{item.orderCode}}">提交物流</view>
</view>
</view>
</view>
<view class="box">
<view class="text-box">
<view class="title">售后信息</view>
<content item="{{orderInfo}}" />
<block wx:for="{{afterSaleObj}}" wx:key="index">
<view class="item">
<view class="label">{{item.title}}:</view>
<view class="value">
<block wx:if="{{item.enum}}">{{item.enum[orderInfo[item.key]]}}</block>
<block wx:elif="{{item.isArray}}">
<block wx:for="{{orderInfo[item.key]}}" wx:key="index" wx:for-item="i">
<text>{{i}};</text>
</block>
</block>
<block wx:else>{{orderInfo[item.key] || ''}}</block>
</view>
</view>
</block>
</view>
<block wx:if="{{orderInfo.imgUrls && orderInfo.imgUrls.length}}">
<view class="photo-box">
<block wx:for="{{orderInfo.imgUrls}}" wx:key="index">
<view class="item" bindtap="previewImage" data-current="{{item}}" data-urls="{{orderInfo.imgUrls}}">
<image webp src="{{item}}"></image>
</view>
</block>
</view>
</block>
</view>
<block wx:if="{{orderInfo.refundStatus >5}}">
<view class="default-btn" bindtap="confirm">重新提交</view>
</block>
</view>
<!-- <popup show="{{showPopup}}" title="选择快递公司" bindconfirm="confirmPopup">
<view wx:for="{{expressList}}" wx:key="index" bindtap="selectExpress" data-item="{{item}}" class="section {{item.id==express.id?'active':''}}">
{{item.name}}
</view>
</popup> -->
<mp-actionSheet bindactiontap="selectExpress" show="{{isShowExpressSelector}}" actions="{{expressList}}" title="选择快递公司" >
</mp-actionSheet>
<!-- 退款状态组件 -->
<refund-status refundStatus="{{orderInfo.refundStatus}}"></refund-status>
<!-- 退货地址和物流信息组件 -->
<return-address-box />
<!-- 售后信息组件 -->
<after-sale-info-box order-info="{{orderInfo}}"></after-sale-info-box>
<!-- 重新提交按钮组件 -->
<re-submit-button wx:if="{{orderInfo.refundStatus >5}}" bindresubmit="confirm"></re-submit-button>
</view>
<mp-actionSheet bindactiontap="selectExpress" show="{{isShowExpressSelector}}" actions="{{expressList}}" title="选择快递公司"></mp-actionSheet>
</block>
\ No newline at end of file
import {
AfterSaleObj,
} from "~/constants/mine.js";
Component({
properties: {
orderInfo: {
type: Object,
value: {}
},
},
data:{
// 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过
afterSaleObj: Object.freeze(AfterSaleObj),
},
methods: {
onPreviewImage(e) {
this.triggerEvent('previewimage', {
current: e.currentTarget.dataset.current,
urls: e.currentTarget.dataset.urls
});
}
}
});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"content": "/packageMine/pages/order/index/components/Content/Content"
}
}
\ No newline at end of file
<view class="box">
<view class="text-box">
<view class="title">售后信息</view>
<content item="{{orderInfo}}" />
<block wx:for="{{afterSaleObj}}" wx:key="index">
<view class="item">
<view class="label">{{item.title}}:</view>
<view class="value">
<block wx:if="{{item.enum}}">{{item.enum[orderInfo[item.key]]}}</block>
<block wx:elif="{{item.isArray}}">
<block wx:for="{{orderInfo[item.key]}}" wx:key="index" wx:for-item="i">
<text>{{i}};</text>
</block>
</block>
<block wx:else>{{orderInfo[item.key] || ''}}</block>
</view>
</view>
</block>
</view>
<block wx:if="{{orderInfo.imgUrls && orderInfo.imgUrls.length}}">
<view class="photo-box">
<block wx:for="{{orderInfo.imgUrls}}" wx:key="index">
<view class="item" bindtap="onPreviewImage" data-current="{{item}}" data-urls="{{orderInfo.imgUrls}}">
<image webp mode="aspectFill" class="image" src="{{item}}"></image>
</view>
</block>
</view>
</block>
</view>
\ No newline at end of file
.box {
border-radius: 16rpx;
background-color: #fff;
}
.text-box {
padding: 32rpx 24rpx;
border-bottom: 2rpx solid #eff0f2;
}
.text-box .title {
font-weight: 600;
font-size: 32rpx;
color: #282829;
}
.text-box .item {
margin-bottom: 12rpx;
display: flex;
align-items: flex-start;
}
.text-box .item .label {
width: 140rpx;
}
.text-box .item .value {
color: #656566;
width: calc(100% - 150rpx);
}
.photo-box {
padding: 40rpx 0 28rpx 20rpx;
display: flex;
flex-wrap: wrap;
}
.photo-box .item {
width: 200rpx;
height: 200rpx;
background: #d8d8d8;
margin: 0 20rpx 20rpx 0;
border-radius: 16rpx;
overflow: hidden;
}
\ No newline at end of file
Component({
methods: {
onReSubmit() {
this.triggerEvent('resubmit');
}
}
});
\ No newline at end of file
<view class="default-btn" bindtap="onReSubmit">重新提交</view>
\ No newline at end of file
.default-btn {
margin: 60rpx 32rpx 0;
height: 88rpx;
background: var(--btnColor);
border-radius: 20rpx;
font-size: 32rpx;
font-weight: 500;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
import { RefundStatus } from "~/constants/mine.js";
Component({
properties: {
refundStatus: {
type: String,
value: "",
observer: function (status) {
this.updateStatus(status);
},
},
},
data: {
refund: {},
},
methods: {
updateStatus(status) {
this.setData({
refund: RefundStatus[status],
});
},
},
});
{
"component": true,
"usingComponents": {
"glsx-image": "/components/image/index"
}
}
\ No newline at end of file
<view class="status-box">
<!-- 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过 -->
<view class="icon">
<glsx-image webp src="{{refund.image}}"></glsx-image>
</view>
<view class="box-info">
<view class="title">{{refund.title}}</view>
<view class="tips">{{refund.tips}}</view>
</view>
</view>
\ No newline at end of file
.status-box {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 24rpx;
margin-bottom: 32rpx;
}
.status-box .icon {
width: 80rpx;
height: 80rpx;
}
.status-box .box-info .title {
font-size: 40rpx;
font-weight: 500;
color: #282829;
}
.status-box .box-info .tips {
font-size: 28rpx;
font-weight: 400;
color: #656566;
}
\ No newline at end of file
import { ExpressList, AddressInfo } from "~/constants/mine.js";
Component({
properties: {},
data: {
isShowExpressSelector: false,
expressList: Object.freeze(ExpressList),
address: Object.freeze(AddressInfo),
addressObject: {
name: "张三",
phone: "12345678901",
address: "广东省深圳市南山区",
},
},
methods: {
onShowExpressSelector() {
this.setData({
isShowExpressSelector: true,
});
},
onSubmitLogistics() {
this.triggerEvent("submitlogistics");
},
onSelectExpress(e) {
this.setData({
isShowExpressSelector: false,
});
const { expressList } = this.data;
const expressListUpdated = expressList.map((item) => {
if (item.value == e.detail.value) {
item.type = "warn";
this.setData({
express: item,
});
} else {
item.type = "";
}
return item;
});
this.setData({
expressList: expressListUpdated,
});
},
},
});
{
"component": true,
"usingComponents": {
"mp-icon": "weui-miniprogram/icon/icon",
"mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet"
}
}
\ No newline at end of file
<view class="box mb">
<view class="text-box">
<view class="header">
<view class="title">商品寄回地址</view>
<view class="copy">复制</view>
</view>
<block wx:for="{{address}}" wx:key="index">
<view class="item">
<view class="label">{{item.title}}:</view>
<view class="value">
<view>{{addressObject[item.key]}}</view>
</view>
</view>
</block>
<view class="title">请填写退货物流</view>
<view class="form">
<view class="item">
<view class="label">物流公司:</view>
<view class="value icon" bindtap="onShowExpressSelector">
<view>{{express.text||'请选择'}}</view>
<mp-icon icon="arrow" color="#B1B1B3" size="12"></mp-icon>
</view>
</view>
<view class="item">
<view class="label">快递单号:</view>
<view class="value">
<input type="text" value="{{expressNo}}" placeholder="请输入" placeholder-style="color: #999999;" bindinput="onExpressNoInput" />
</view>
</view>
</view>
<view class="btn-box">
<view class="btn submit-btn" bindtap="onSubmitLogistics">提交物流</view>
</view>
</view>
</view>
<mp-actionSheet bindactiontap="onSelectExpress" show="{{isShowExpressSelector}}" actions="{{expressList}}" title="选择快递公司" >
</mp-actionSheet>
\ No newline at end of file
.box {
border-radius: 16rpx;
background-color: #fff;
}
.mb {
margin-bottom: 24rpx;
}
.text-box {
padding: 32rpx 24rpx;
border-bottom: 2rpx solid #eff0f2;
}
.text-box .title {
font-weight: 600;
font-size: 32rpx;
color: #282829;
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.header .copy {
background: #e8e8ea;
border-radius: 18rpx;
font-weight: 400;
font-size: 22rpx;
color: #707071;
padding: 4rpx 18rpx;
}
.item {
margin-bottom: 12rpx;
display: flex;
align-items: flex-start;
}
.item .label {
width: 140rpx;
}
.item .value {
color: #656566;
width: calc(100% - 150rpx);
}
.item .value.icon {
display: flex;
align-items: center;
justify-content: space-between;
}
.form {
margin-top: 24rpx;
background: #f7f8fa;
border-radius: 12rpx;
padding: 0 32rpx;
}
.form .item {
height: 104rpx;
line-height: 104rpx;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0;
}
.form .item .label {
margin-right: 12rpx;
font-size: 28rpx;
color: #282829;
}
.form .item:first-child {
border-bottom: 2rpx solid #eff0f2;
}
.btn-box {
display: flex;
justify-content: center;
align-items: center;
margin-top: 24rpx;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 336rpx;
height: 80rpx;
border-radius: 20rpx;
border: 2rpx solid #dcdfe6;
font-size: 24rpx;
}
.submit-btn {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
width: 100%;
}
.item {
.section {
flex: 1;
border: 2rpx solid #EBEBEB;
height: 88rpx;
......@@ -18,7 +18,7 @@
border-radius: 8rpx;
overflow: hidden;
}
.item.active{
.section.active{
border-color: var(--btnColor);
}
.active .icon{
......
<view class="type-box">
<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]}}
<view class="icon">
<glsx-image webp src="mine/active.png"></glsx-image>
......
......@@ -49,9 +49,10 @@ Page({
});
},
radioChange(e){
const value = e.currentTarget.dataset.item.value
this.setData({
"orderObj.reason": e.detail.value,
refundReason:RefundReason.find(item => item.value == e.detail.value).text
"orderObj.reason": value,
refundReason:RefundReason.find(item => item.value == value).text
});
},
noScroll() {},
......
......@@ -23,6 +23,7 @@
.weui-cell__hd {
margin-left: 10rpx;
margin-right: 20rpx;
line-height: 0;
}
&::before {
display: none;
......@@ -32,7 +33,7 @@
.box {
background: #ffffff;
border-radius: 8rpx;
border-radius: 16rpx;
.box-item {
display: flex;
height: 100rpx;
......@@ -49,13 +50,8 @@
font-size: 28rpx;
color: #6e6e7a;
display: flex;
justify-content: center;
align-items: center;
.arrow {
margin-left: 16rpx;
width: 20rpx;
height: 20rpx;
transform: translateY(1rpx);
}
.value {
display: inline;
......@@ -136,29 +132,35 @@
.upload-box .item {
width: 200rpx;
height: 200rpx;
background: #d8d8d8;
background: #F5F5F7;
margin-bottom: 30rpx;
margin-right: 20rpx;
border-radius: 8px;
position: relative;
}
.item .del {
position: absolute;
width: 72rpx;
height: 72rpx;
right: -32rpx;
top: -32rpx;
}
.upload-box .item .del .icon {
width: 36rpx;
height: 36rpx;
padding: 1rpx;
.del {
position: absolute;
width: 16rpx;
height: 16rpx;
right: 2rpx;
top: -22rpx;
.icon {
width: 36rpx;
height: 36rpx;
}
}
.image{
border-radius: 8px;
}
}
.upload-box .upload-item {
background-color: #fff;
border: 2rpx solid #d8d8d8;
box-sizing: border-box;
border: 1px dashed #c9cacc;
border-radius: 8px;
position: relative;
}
.btn {
......
......@@ -10,7 +10,7 @@
<view class="box-item-value" bindtap="showPopup">
{{refundReason||'请选择'}}
<view class="arrow">
<glsx-image webp src="mine/mine-arrow.png"></glsx-image>
<mp-icon icon="arrow" color="#B1B1B3" size="{{10}}"></mp-icon>
</view>
</view>
</view>
......@@ -43,16 +43,6 @@
</view>
</block>
<block wx:else>
<block wx:for="{{imgUrls}}" wx:key="index">
<view class="item" catchtap="previewImage" data-current="{{item}}" data-urls="{{imgUrls}}">
<image webp src="{{item}}"></image>
<view class="del text-center" catchtap="del" data-index="{{index}}">
<view class="icon">
<glsx-image webp src="mine/del.png"></glsx-image>
</view>
</view>
</view>
</block>
<block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="upLoad">
<view class="icon">
......@@ -60,20 +50,28 @@
</view>
</view>
</block>
<block wx:for="{{imgUrls}}" wx:key="index">
<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">
<mp-icon icon="close2" color="#D8D8D8" type="field" size="{{16}}"></mp-icon>
</view>
</view>
</view>
</block>
</block>
</view>
<view class="btn text-center" bindtap="submit">提交</view>
</view>
<popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="confirmPopup">
<view class="page-section">
<radio-group bindchange="radioChange">
<label class="weui-cell weui-check__label" wx:for="{{RefundReason}}" wx:key="{{item.value}}">
<view class="weui-cell__hd">
<radio value="{{item.value}}" checked="true" color="#FC8A32" />
</view>
<view class="weui-cell__bd">{{item.text}}</view>
</label>
</radio-group>
<label class="weui-cell weui-check__label" wx:for="{{RefundReason}}" wx:key="{{item.value}}" bindtap="radioChange" data-item="{{item}}">
<view class="weui-cell__hd">
<icon type="{{refundReason == item.text?'success':'circle'}}" size="40rpx" color="{{refundReason == item.text?'#FB8A32':'#E3E3E6'}}"></icon>
</view>
<view class="weui-cell__bd">{{item.text}}</view>
</label>
</view>
</popup>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file
......@@ -9,7 +9,7 @@
<view class="info-top">
<view class="name text-hide">{{item.orderSource == 5 ? item.activityName: i.goodsName}}</view>
<view class="number">
x{{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 class="info-bottom">
......
......@@ -170,7 +170,7 @@ Component({
// 待评价订单
if (
item.orderGoods.length == 1 &&
item.orderGoods?.length == 1 &&
!hasUserInfo &&
(item.orderStatus == OrderStatus.COMPLETED ||
item.orderStatus == OrderStatus.CLOSED)
......@@ -206,7 +206,7 @@ Component({
// 待评价订单(独立情况)
if (
item.orderGoods.length == 1 &&
item.orderGoods?.length == 1 &&
!hasUserInfo &&
(item.orderStatus == OrderStatus.COMPLETED ||
item.orderStatus == OrderStatus.CLOSED)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!