Commit 8e11953c by liimin

refactor(order): 重构售后服务页面

- 移除冗余代码和不必要的组件
- 优化页面结构和样式
- 引入新的组件来提升用户体验
- 删除未使用的弹窗和输入框相关代码
- 调整订单详情页面布局
1 parent 3d0c0b97
...@@ -10,10 +10,6 @@ Page({ ...@@ -10,10 +10,6 @@ Page({
imgUrls: [], imgUrls: [],
RefundReason: Object.freeze(RefundReason), RefundReason: Object.freeze(RefundReason),
}, },
previewImage(e) {
let params = e.currentTarget.dataset;
wx.p.wxApi.previewImage(params);
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -28,16 +24,6 @@ Page({ ...@@ -28,16 +24,6 @@ Page({
}); });
}); });
}, },
showPopup() {
this.setData({
showPopup: true,
});
},
confirmPopup() {
this.setData({
showPopup: false,
});
},
input(e) { input(e) {
this.setData({ this.setData({
"orderObj.remark": e.detail.value, "orderObj.remark": e.detail.value,
...@@ -45,37 +31,22 @@ Page({ ...@@ -45,37 +31,22 @@ Page({
}, },
changeRefundCount(e) { changeRefundCount(e) {
this.setData({ this.setData({
"orderObj.refundCount": e.detail "orderObj.refundCount": e.detail.value
}); });
}, },
radioChange(e){ radioChange(e){
const value = e.currentTarget.dataset.item.value const value = e.detail.item.value
this.setData({ this.setData({
"orderObj.reason": value, "orderObj.reason": value,
refundReason:RefundReason.find(item => item.value == value).text
}); });
}, },
noScroll() {},
showRefundCount() { showRefundCount() {
this.setData({ this.setData({
showRefundCount: true, showRefundCount: true,
}); });
}, },
blur(e) {
const rex = /^(([1-9]{1}\d*)|(0{1}))(\.\d{2})$/;
console.log(e);
let { value } = e.detail;
let { maxPrice } = this.data;
if (value > maxPrice) value = maxPrice;
if (value < 0) value = 0;
if (!rex.test(value)) value = maxPrice;
this.setData({
"orderObj.refundPrice": Number(value).toFixed(2),
showPriceInput: false,
});
},
del(e) { del(e) {
let { index } = e.currentTarget.dataset; let { index } = e.detail;
let { imgUrls } = this.data; let { imgUrls } = this.data;
imgUrls.splice(index, 1); imgUrls.splice(index, 1);
this.setData({ this.setData({
...@@ -129,33 +100,4 @@ Page({ ...@@ -129,33 +100,4 @@ Page({
} }
}); });
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
}); });
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
"navigationBarTitleText": "申请售后", "navigationBarTitleText": "申请售后",
"usingComponents": { "usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea", "gl-textarea": "/components/GlTextarea/GlTextarea",
"afterSale_step_one":"../afterSale_step_one/afterSale_step_one", "afterSale_step_one": "/packageMine/pages/order/afterSale_step_one/afterSale_step_one",
"Stepper": "/components/Stepper/Stepper" "refund-info-box": "./components/RefundInfoBox/RefundInfoBox",
"description-box": "./components/DescriptionBox/DescriptionBox",
"image-upload-box": "./components/ImageUploadBox/ImageUploadBox"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,26 +10,6 @@ ...@@ -10,26 +10,6 @@
color: #1b233d; color: #1b233d;
} }
.page-section {
max-height: calc(100%);
overflow: hidden;
overflow-y: scroll;
.weui-cell {
height: 88rpx;
line-height: 88rpx;
font-size: 28rpx;
color: #333435;
box-sizing: border-box;
.weui-cell__hd {
margin-left: 10rpx;
margin-right: 20rpx;
line-height: 0;
}
&::before {
display: none;
}
}
}
.box { .box {
background: #ffffff; background: #ffffff;
...@@ -73,12 +53,6 @@ ...@@ -73,12 +53,6 @@
} }
} }
.type {
height: 104rpx;
background: #eff0f2;
border-radius: 8rpx;
font-size: 40rpx;
}
.description { .description {
height: 460rpx; height: 460rpx;
...@@ -86,83 +60,6 @@ ...@@ -86,83 +60,6 @@
padding: 28rpx 32rpx; padding: 28rpx 32rpx;
} }
.price-box {
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin: 24rpx 0 8rpx;
box-sizing: border-box;
padding: 0 32rpx;
}
.price-box .value {
font-size: 24rpx;
color: var(--btnColor);
display: flex;
align-items: center;
}
.price-box .value .price {
margin-right: 28rpx;
font-size: 36rpx;
}
.upload-box {
min-height: 260rpx;
box-sizing: border-box;
padding: 30rpx 0 0 22rpx;
}
.upload-box .one {
width: 100%;
height: 260rpx;
}
.upload-box.flex {
display: flex;
flex-wrap: wrap;
}
.upload-box .icon {
width: 84rpx;
height: 64rpx;
}
.upload-box .item {
width: 200rpx;
height: 200rpx;
background: #F5F5F7;
margin-bottom: 30rpx;
margin-right: 20rpx;
border-radius: 8px;
position: relative;
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 { .btn {
margin: 48rpx 16rpx; margin: 48rpx 16rpx;
height: 80rpx; height: 80rpx;
...@@ -173,22 +70,3 @@ ...@@ -173,22 +70,3 @@
color: #fff; color: #fff;
} }
.price-input-box {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: rgba(0, 0, 0, 0.7);
}
.price-input {
width: 100%;
height: 72rpx;
background-color: #fff;
box-sizing: border-box;
padding: 0 40rpx;
display: flex;
align-items: center;
}
...@@ -4,74 +4,31 @@ ...@@ -4,74 +4,31 @@
<afterSale_step_one /> <afterSale_step_one />
<!-- </view> --> <!-- </view> -->
<view class="title">申请退货退款</view> <view class="title">申请退货退款</view>
<view class="box">
<view class="box-item"> <!-- 退款信息组件 -->
<text class="box-item-title">退款原因</text> <refund-info-box
<view class="box-item-value" bindtap="showPopup"> refund-count="{{orderObj.refundCount}}"
{{refundReason||'请选择'}} max-refund-count="{{maxRefundCount}}"
<view class="arrow"> refund-price="{{orderObj.refundPrice}}"
<mp-icon icon="arrow" color="#B1B1B3" size="{{10}}"></mp-icon> show-refund-count="{{showRefundCount}}"
</view> bindconfirmpopup="confirmPopup"
</view> bindchangerefundcount="changeRefundCount"
</view> bindradiochange="radioChange">
<view class="box-item"> </refund-info-box>
<text class="box-item-title">数量</text>
<view class="box-item-value">
<view class="value" bindtap="showRefundCount" wx:if="{{!showRefundCount}}">
<view class="price">{{orderObj.refundCount}}件</view>
修改数量
</view>
<Stepper wx:else count="{{orderObj.refundCount}}" min="1" max="{{maxRefundCount}}" bindchange="changeRefundCount" data-index="{{index}}"></Stepper>
</view>
</view>
<view class="box-item">
<text class="box-item-title">退款金额</text>
<view class="refund">{{orderObj.refundPrice}}积分</view>
</view>
</view>
<view class="title">申请描述</view> <view class="title">申请描述</view>
<!-- 描述信息组件 -->
<view class="description box"> <view class="description box">
<gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{orderObj.remark}}" bindinput="input" showWordLimit customMaxLength></gl-textarea> <gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{remark}}" bindinput="input" showWordLimit customMaxLength></gl-textarea>
</view> </view>
<view class="title">上传图片</view> <view class="title">上传图片</view>
<view class="upload-box box flex">
<block wx:if="{{imgUrls.length < 1}}"> <!-- 图片上传组件 -->
<view class="one text-center" bindtap="upLoad"> <image-upload-box img-urls="{{imgUrls}}" bindpreviewimage="previewImage" binddel="del" bindupload="upLoad"></image-upload-box>
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
<block wx:else>
<block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="upLoad">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</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 class="btn text-center" bindtap="submit">提交</view>
</view> </view>
<popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="confirmPopup">
<view class="page-section">
<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> <glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
Component({
properties: {
remark: {
type: String,
value: ''
}
},
methods: {
onInput(e) {
this.triggerEvent('input', { value: e.detail.value });
}
}
});
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea"
}
}
\ No newline at end of file \ No newline at end of file
<view class="description box">
<gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{remark}}" bindinput="onInput" showWordLimit customMaxLength></gl-textarea>
</view>
\ No newline at end of file \ No newline at end of file
.description {
height: 460rpx;
box-sizing: border-box;
padding: 28rpx 32rpx;
}
.box {
background: #ffffff;
border-radius: 16rpx;
}
\ No newline at end of file \ No newline at end of file
Component({
properties: {
imgUrls: {
type: Array,
value: []
}
},
methods: {
previewImage(e) {
let params = e.currentTarget.dataset;
wx.p.wxApi.previewImage(params);
},
onDel(e) {
this.triggerEvent('del', { index: e.currentTarget.dataset.index });
},
onUpload() {
this.triggerEvent('upload');
}
}
});
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"glsx-image": "/components/image/index",
"mp-icon": "weui-miniprogram/icon/icon"
}
}
\ No newline at end of file \ No newline at end of file
<view class="upload-box box flex">
<block wx:if="{{imgUrls.length < 1}}">
<view class="one text-center" bindtap="onUpload">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
<block wx:else>
<block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="onUpload">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</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="onDel" data-index="{{index}}">
<view class="icon">
<mp-icon icon="close2" color="#D8D8D8" type="field" size="{{16}}"></mp-icon>
</view>
</view>
</view>
</block>
</block>
</view>
\ No newline at end of file \ No newline at end of file
.upload-box {
min-height: 260rpx;
box-sizing: border-box;
padding: 30rpx 0 0 22rpx;
}
.upload-box .one {
width: 100%;
height: 260rpx;
}
.upload-box.flex {
display: flex;
flex-wrap: wrap;
}
.upload-box .icon {
width: 84rpx;
height: 64rpx;
}
.upload-box .item {
width: 200rpx;
height: 200rpx;
background: #F5F5F7;
margin-bottom: 30rpx;
margin-right: 20rpx;
border-radius: 8px;
position: relative;
padding: 1rpx;
}
.upload-box .item .del {
position: absolute;
width: 16rpx;
height: 16rpx;
right: 2rpx;
top: -22rpx;
}
.upload-box .item .del .icon {
width: 36rpx;
height: 36rpx;
}
.upload-box .item .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;
}
.box {
background: #ffffff;
border-radius: 16rpx;
}
\ No newline at end of file \ No newline at end of file
import { RefundReason } from "~/constants/mine.js";
Component({
properties: {
refundCount: {
type: Number,
value: 0,
},
maxRefundCount: {
type: Number,
value: 0,
},
refundPrice: {
type: String,
value: "",
},
showRefundCount: {
type: Boolean,
value: false,
},
},
data: {
showPopup: false,
index: 0,
RefundReasonList: Object.freeze(RefundReason),
},
methods: {
onShowPopup() {
this.setData({
showPopup: true,
});
},
onConfirmPopup() {
this.setData({
showPopup: false,
});
this.triggerEvent("confirmpopup");
},
onShowRefundCount() {
this.setData({
showRefundCount: true,
});
},
onChangeRefundCount(e) {
this.triggerEvent("changerefundcount", { value: e.detail });
},
onRadioChange(e) {
const item = e.currentTarget.dataset.item;
this.setData({
refundReason: RefundReason.find((item) => item.value == value).text,
});
this.triggerEvent("radiochange", { item });
},
},
});
{
"component": true,
"usingComponents": {
"popup": "/components/Popup/Popup",
"mp-icon": "weui-miniprogram/icon/icon",
"Stepper": "/components/Stepper/Stepper"
}
}
\ No newline at end of file \ No newline at end of file
.box {
background: #ffffff;
border-radius: 16rpx;
}
.box .box-item {
display: flex;
height: 100rpx;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
}
.box .box-item .box-item-title {
font-weight: 500;
font-size: 28rpx;
color: #333;
}
.box .box-item .box-item-value {
font-weight: 400;
font-size: 28rpx;
color: #6e6e7a;
display: flex;
}
.box .box-item .box-item-value .arrow {
margin-left: 16rpx;
}
.box .box-item .box-item-value .value {
display: inline;
font-weight: 400;
font-size: 24rpx;
color: var(--themeColor);
}
.box .box-item .box-item-value .price {
display: inline;
color: #1b233d;
margin-right: 20rpx;
}
.box .box-item .refund {
color: var(--themeColor);
font-size: 36rpx;
font-weight: 700;
}
.page-section {
max-height: calc(100%);
overflow: hidden;
overflow-y: scroll;
padding: 0 20rpx;
.weui-cell {
height: 88rpx;
line-height: 88rpx;
font-size: 28rpx;
color: #333435;
box-sizing: border-box;
display: flex;
align-items: center;
.weui-cell__hd {
margin-left: 10rpx;
margin-right: 20rpx;
line-height: 0;
}
&::before {
display: none;
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="box">
<view class="box-item">
<text class="box-item-title">退款原因</text>
<view class="box-item-value" bindtap="onShowPopup">
{{refundReason||'请选择'}}
<view class="arrow">
<mp-icon icon="arrow" color="#B1B1B3" size="{{10}}"></mp-icon>
</view>
</view>
</view>
<view class="box-item">
<text class="box-item-title">数量</text>
<view class="box-item-value">
<view class="value" bindtap="onShowRefundCount" wx:if="{{!showRefundCount}}">
<view class="price">{{refundCount}}件</view>
修改数量
</view>
<Stepper wx:else count="{{refundCount}}" min="1" max="{{maxRefundCount}}" bindchange="onChangeRefundCount" data-index="{{index}}"></Stepper>
</view>
</view>
<view class="box-item">
<text class="box-item-title">退款金额</text>
<view class="refund">{{refundPrice}}积分</view>
</view>
</view>
<popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="onConfirmPopup">
<view class="page-section">
<label class="weui-cell weui-check__label" wx:for="{{RefundReasonList}}" wx:key="{{item.value}}" bindtap="onRadioChange" 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>
\ No newline at end of file \ No newline at end of file
...@@ -92,54 +92,5 @@ ...@@ -92,54 +92,5 @@
<view class="price sum"><text class="unit">¥</text>{{orderInfo.payPrice}}</view> <view class="price sum"><text class="unit">¥</text>{{orderInfo.payPrice}}</view>
</view> </view>
</view> </view>
<!-- deliveryType 结算方式(1:到店核销,2:快递发货) -->
<block wx:if="{{orderInfo.deliveryType == 1 && qr && !orderInfo.relatedUserCoupon}}">
<view class="box">
<view class="title">核销码</view>
<view class="qr-box">
<view class="qr">
<image webp src="{{qr}}"></image>
</view>
<view class="code">{{orderInfo.orderVerification.verificationCode}}</view>
<view class="tips">请将核销码拿给店员,避免泄露给他人</view>
</view>
</view>
</block>
<view class="box" wx:if="{{orderInfo.relatedUserCoupon}}">
<view class="title">关联优惠券</view>
<block wx:for="{{couponsList}}" wx:key="index">
<view class="box_wrapper">
<glsx-image webp src="mine/coupon/{{item.usedAmount == 0?'':'un-'}}coupon-{{item.discountType}}.png" class="bg"></glsx-image>
<view class="info flex">
<view class="{{item.discountType==4 || item.discountType==7 ? '':'left_icon_box'}}">
<view wx:if="{{item.discountType==3}}" class="left_text_one left_text_two {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">
<text class="price_icon">¥</text>
<text>{{item.denomination}}</text>
</view>
<view wx:if="{{item.discountType==2}}" class="left_text_one left_text_two {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">
<text class="anText">{{item.discountIntensity / 100}}</text>
<text class="discount">折</text>
</view>
</view>
<view class="main_box {{item.discountType==4 || item.discountType==7 ? 'leftMargin':''}}">
<view class="title_text {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">{{item.couponName}}</view>
<view wx:if="{{item.useType==0 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">不限次数</view>
<view wx:if="{{item.useType==1 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">可用{{item.useAmount}}次</view>
<view wx:if="{{item.useType==2 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">{{item.useLimitDays}}天可用{{item.useAmount}}次</view>
<view wx:if="{{item.useBarriers==1 && item.discountType!=4}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">无门槛</view>
<view wx:if="{{item.useBarriers==2 && item.discountType!=4}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">满{{item.full}}元可用</view>
<view wx:if="{{item.effectiveType==3}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">永久有效</view>
<view wx:if="{{item.effectiveType==2}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">有效至{{item.receiveEndTime}}</view>
</view>
<block wx:if="{{!hideBtn}}">
<view wx:if="{{item.usedAmount==0}}" class="box_btn box_btn_color" bind:tap="toDetail">去使用</view>
<view wx:if="{{item.usedAmount==1}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
<view wx:if="{{item.usedAmount==2}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
</block>
</view>
</view>
</block>
</view>
</view> </view>
</block> </block>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!