Browse Source

新增售后整个流程

master
杜叶春 2 years ago
parent
commit
50a66d2554
  1. 4
      app.json
  2. 143
      components/uploadImages/uploadImg.js
  3. 4
      components/uploadImages/uploadImg.json
  4. 19
      components/uploadImages/uploadImg.wxml
  5. 76
      components/uploadImages/uploadImg.wxss
  6. BIN
      images/delete.png
  7. BIN
      images/gouhei.png
  8. BIN
      images/xiangji.png
  9. 43
      pages/aftersales/aftersales.js
  10. 6
      pages/aftersales/aftersales.wxml
  11. 214
      pages/aftersales/apply.js
  12. 4
      pages/aftersales/apply.json
  13. 123
      pages/aftersales/apply.wxml
  14. 310
      pages/aftersales/apply.wxss
  15. 84
      pages/aftersales/asdetail.js
  16. 4
      pages/aftersales/asdetail.json
  17. 88
      pages/aftersales/asdetail.wxml
  18. 69
      pages/aftersales/asdetail.wxss
  19. 53
      pages/aftersales/index.js
  20. 125
      pages/aftersales/index.wxml
  21. 85
      pages/aftersales/index.wxss
  22. 20
      pages/order/detail.js
  23. 6
      pages/order/detail.wxml
  24. 2
      pages/user/user.wxml
  25. 6
      pages/user/user.wxss
  26. 10
      utils/server.js

4
app.json

@ -51,7 +51,9 @@
"pages/set/password",
"pages/member/member",
"pages/aftersales/aftersales",
"pages/aftersales/index"
"pages/aftersales/index",
"pages/aftersales/apply",
"pages/aftersales/asdetail"
],
"window": {
"backgroundTextStyle": "light",

143
components/uploadImages/uploadImg.js

@ -0,0 +1,143 @@
// uploadImages/uploadImg.js
const WXAPI = require('../../utils/config.js')
Component({
/**
* 组件的属性列表
*/
properties: {
count: { //最多选择图片的张数,默认9张
type: Number,
value: 9
},
uploadUrl: { //图片上传的服务器路径
type: String,
value: ''
},
showUrl: { //图片的拼接路径
type: String,
value: ''
},
albumType: { //album 从相册选图,camera 使用相机,默认二者都有
type: String,
value: ''
},
detailPics: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
detailPics: [], //上传的结果图片集合
},
onShow() {
console.log(1)
},
/**
* 组件的方法列表
*/
methods: {
/**
* 上传详细图片
*/
uploadDetailImage: function (e) { //这里是选取图片的方法
var that = this;
var pics = [];
var detailPics = that.data.detailPics;
if (detailPics.length >= that.data.count) {
wx.showToast({
title: '最多选择' + that.data.count + '张!',
})
return;
}
wx.chooseMedia({
count: that.data.count, // 最多可以选择的图片张数,默认9
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
sourceType: that.data.albumType == '0' ? ['camera'] : ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
success: function (res) {
var imgs = res.tempFiles;
var ticket = wx.getStorageSync('ticket');
var urlArr = []
for (var i = 0; i < imgs.length; i++) {
pics.push(imgs[i])
var url = imgs[i].tempFilePath
//取得文件的后缀
var extensiton = url.substr(url.lastIndexOf('.') + 1).toLowerCase();
// 根据时间戳生成唯一的主文件名称
var mainname = '' + Date.now() + Math.ceil(Math.random() * 9999);
var uploadUrl = WXAPI.API_BASE_URL + 'Common/UploadUserFile?ticket=' + ticket + '&name=' + mainname + '.' + extensiton;
urlArr.push(uploadUrl)
}
that.uploadImg({
url: urlArr, //这里是你图片上传的接口
path: pics, //这里是选取的图片的地址数组
});
},
})
},
//多张图片上传
uploadImg: function (data) {
// console.log(this.globalData.openId)
wx.showLoading({
title: '上传中...',
mask: true,
})
var that = this,
i = data.i ? data.i : 0,
success = data.success ? data.success : 0,
fail = data.fail ? data.fail : 0;
wx.uploadFile({
url: data.url[i],
header: { 'content-type': 'multipart/form-data' },
filePath: data.path[i].tempFilePath,
name: 'image',
formData: { "openid": '1' },
success: (resp) => {
wx.hideLoading();
success++;
var info = JSON.parse(resp.data);//返回的结果,可能不同项目结果不一样
// console.log(info)
var picName = that.data.showUrl + info.data.url;
var detailPics = that.data.detailPics;
detailPics.push(picName)
that.setData({
detailPics: detailPics
})
},
fail: (res) => {
fail++;
console.log('fail:' + i + "fail:" + fail);
},
complete: () => {
i++;
if (i == data.path.length) { //当图片传完时,停止调用
console.log('执行完毕');
// console.log('成功:' + success + " 失败:" + fail);
var eventDetail = {
picsList: that.data.detailPics
} // detail对象,提供给事件监听函数
var eventOption = {} // 触发事件的选项
that.triggerEvent('event', eventDetail, eventOption)
} else { //若图片还没有传完,则继续调用函数
data.i = i;
data.success = success;
data.fail = fail;
that.uploadImg(data);
}
}
});
},
//预览图片
imagePreview: function (e) {
console.log(e.target.dataset)
var current = e.target.dataset.src;
wx.previewImage({
current: current, // 当前显示图片的http链接
urls: this.data.detailPics // 需要预览的图片http链接列表
})
},
}
})

4
components/uploadImages/uploadImg.json

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

19
components/uploadImages/uploadImg.wxml

@ -0,0 +1,19 @@
<!--uploadImages/uploadImg.wxml-->
<view class='content'>
<!-- <view class='img-box'> -->
<scroll-view class='img-box' scroll-x="true">
<view class='img-list'>
<block wx:for="{{detailPics}}" wx:key="index">
<view class='img-item'>
<image src='{{item}}' mode="aspectFill" bindtap="imagePreview" bindlongpress="longpressImg"></image>
</view>
</block>
<view class='chooseImg' bindtap='uploadDetailImage'>
<!-- <view class="weui-uploader__input-box"></view> -->
<image class="weui-uploader__input-box" src="/images/upload.png"></image>
</view>
</view>
<!-- <view class='tips'>长按对应的图片即可删除</view> -->
</scroll-view>
<!-- </view> -->
</view>

76
components/uploadImages/uploadImg.wxss

@ -0,0 +1,76 @@
/* uploadImages/uploadImg.wxss */
page {
background-color: #f1f0f5;
}
.content {
width: 100%;
background-color: #fff;
}
.img-box {
width: 100%;
margin-left: 35rpx;
margin-right: 35rpx;
}
.img-list {
display: flex;
display: -webkit-flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
/* flex-wrap: wrap; */
}
.img-item {
width: 150rpx;
text-align: left;
margin-right: 20rpx;
margin-bottom: 10rpx;
}
.img-item image {
width: 150rpx;
height: 150rpx;
}
.chooseImg {
background-color: #fff;
}
.weui-uploader__input-box {
float: left;
position: relative;
margin-right: 9px;
margin-bottom: 9px;
width: 150rpx;
height: 150rpx;
/* border: 1px solid #d9d9d9; */
}
/* .weui-uploader__input-box:after, .weui-uploader__input-box:before {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
} */
.weui-uploader__input-box:before {
width: 2px;
height: 35px;
}
.weui-uploader__input-box:after {
width: 35px;
height: 2px;
}
.tips {
color: #666;
font-size: 25rpx;
padding-bottom: 20rpx;
}

BIN
images/delete.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/gouhei.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/xiangji.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

43
pages/aftersales/aftersales.js

@ -12,6 +12,7 @@ Page({
exchange_goods_status:false,
isbatch: false,
orderType:'',
orderId: '',
},
actionSheetTap: function () {
var that = this;
@ -59,6 +60,7 @@ Page({
if (res.code == 200) {
var data = res.data
that.setData({
orderId: orderId,
order: data.list,
status: data.status,
refund_only_status: data.refund_only_status,
@ -87,7 +89,6 @@ Page({
});
return;
}
if (formId != 'the formId is a mock one') {
app.request.wxRequest({
@ -99,37 +100,13 @@ Page({
}
})
}
wx.request({
url: app.d.ceshiUrl + '&action=order&m=ReturnData',
method: 'post',
data: {
id: that.data.id,
oid: that.data.oid,
otype: that.data.otype,
re_type: that.data.tapIndex,
back_remark: remark,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: function (res) {
var status = res.data.status;
if (status == 1) {
wx.showToast({
title: res.data.succ,
success: 2000
});
wx.redirectTo({
url: '/pages/aftersales/index?currentTab=0&otype=whole',
});
} else {
wx.showToast({
title: res.data.err,
duration: 2000
});
}
},
});
},
navToApply: function(e){
console.log(e)
var type = e.currentTarget.dataset.type;
var that = this
wx.navigateTo({
url:"/pages/aftersales/apply?refund_type=" + type + "&orderId=" + that.data.orderId
})
}
})

6
pages/aftersales/aftersales.wxml

@ -19,7 +19,7 @@
</view>
<view>
<view class="return_pay" wx:if="{{refund_only_status && orderType!='MS' && orderType!='FX' && orderType!=='IN'}}" bindtap="_uni_navigateTo('refund?refund_type=2&order_details_id=' + order_details_id + '&order_anking=' + order_anking + '&rType=' + rType+'&isbatch='+isbatch)">
<view class="return_pay" wx:if="{{refund_only_status && orderType!='MS' && orderType!='FX' && orderType!=='IN'}}" data-type="2" bindtap="navToApply">
<view class="return_right">
<view class="status">
<image class="return_right_img" src="/images/tuikuan.png" />
@ -29,7 +29,7 @@
</view>
<image class="arrow" src="/images/x_right.png" />
</view>
<view class="return_pay" wx:if="{{return_refund_status && orderType!='MS' && orderType!='PM' && orderType!='FX' && orderType!=='IN'}}" bindtap="_uni_navigateTo('refund?refund_type=1&order_details_id=' + order_details_id + '&rType=' + rType+'&isbatch='+isbatch)">
<view class="return_pay" wx:if="{{return_refund_status && orderType!='MS' && orderType!='PM' && orderType!='FX' && orderType!=='IN'}}" data-type="1" bindtap="navToApply">
<view class="return_right">
<view class="status">
<image class="return_right_img" src="/images/tuihuo.png" />
@ -40,7 +40,7 @@
<image class="arrow" src="/images/x_right.png" />
</view>
<!-- 换货 -->
<view class="return_pay" wx:if="{{exchange_goods_status}}" bindtap="_uni_navigateTo('refund?refund_type=3&order_details_id=' + order_details_id + '&order_anking=' + order_anking + '&r_status=' + r_status + '&rType=' + rType+'&isbatch='+isbatch)">
<view class="return_pay" wx:if="{{exchange_goods_status}}" data-type="3" bindtap="navToApply">
<view class="return_right">
<view class="status">
<image class="return_right_img" src="/images/huanhuo.png" />

214
pages/aftersales/apply.js

@ -0,0 +1,214 @@
// pages/aftersales/apply.js
var app = getApp()
var WXAPI = require('../../utils/server.js');
Page({
/**
* 页面的初始数据
*/
data: {
refund_type: '', // 区分退款方式1退货退款,2仅退款, 3换货
order: "",
r_status: '', // 商品当前状态
content: '',
orderId: '',
srcList: [],
re_price: '',
remark: '',
return_suess: false,
order: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
this.setData({
refund_type: options.refund_type,
orderId:options.orderId
});
this.loadData(options.orderId);
},
loadData: function (orderId) {
var that = this;
WXAPI.returnMethod({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
order_details_id: orderId,
}).then(res => {
if (res.code == 200) {
var data = res.data
that.setData({
re_price: data.refund_price,
refund_price: data.refund_price,
order: data.list,
status: data.status,
refund_only_status: data.refund_only_status,
return_refund_status: data.return_refund_status,
exchange_goods_status: data.exchange_goods_status,
orderType: data.orderType
});
}
})
},
refundPriceInput: function(e) {
this.setData({
re_price: e.detail.value
})
},
chooseImage: function (e) {
var that = this;
// 选择图片
wx.chooseMedia({
count: 3, // 默认9
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var tempFiles = res.tempFiles;
var images = that.data.srcList;
if (images.length > 2) {
wx.showToast({
title: '亲!最多上传3张哦!',
icon: 'none',
duration: 2000
});
} else {
if (images) {
images = images.concat(tempFiles);
} else {
images = tempFiles;
}
that.setData({
srcList: images,
});
}
}
})
},
deleteAct: function (e) {
var index = e.currentTarget.dataset.index;
var that = this;
if (that.data.srcList.length > 0) {
that.data.srcList.splice(index, 1)
that.setData({
srcList: that.data.srcList
});
} else {
return;
}
},
remarkInput: function(e) {
this.setData({
remark: e.detail.value
})
},
confirmAct() {
var that = this
if (that.data.srcList.length == 0) {
WXAPI.returnData({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
order_details_id: that.data.orderId,
refund_amount: that.data.refund_price,
explain: that.data.remark,
type: that.data.refund_type,
refund_apply_money: that.data.re_price,
}).then(res => {
if (res.code == 200) {
var data = res.data
that.setData({
return_suess: true,
order: data
});
}
})
} else {
wx.uploadFile({
url: 'https://mall.gylservice.com/gw?api=app.order.ReturnData',
filePath: this.data.srcList[0].tempFilePath,
name: 'file',
header: {
'content-type': 'multipart/form-data'
}, // 设置请求的 header
formData: {
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
order_details_id: that.data.orderId,
refund_amount: that.data.refund_price,
explain: that.data.remark,
type: that.data.refund_type,
upload_z_num: 1,
upload_num: 0,
refund_apply_money: that.data.re_price,
}, // HTTP 请求中其他额外的 form data
success: function (res) {
console.log(res);
var data = JSON.parse(res.data)
that.setData({
return_suess: true,
order: data
});
},
fail: function (res) {
console.log(res);
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
if (this.data.return_suess == true) {
wx.navigateBack({
delta: 1
})
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

4
pages/aftersales/apply.json

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "申请售后"
}

123
pages/aftersales/apply.wxml

@ -0,0 +1,123 @@
<!--viewages/aftersales/aviewviewly.wxml-->
<view class="container">
<view wx:if="{{!return_suess}}" style="position: relative;overflow: hidden;">
<view class="order_goods">
<view class="order_two" wx:for="{{order}}" wx:key="index">
<image src="{{item.image}}" class="shopImage" />
<view class="order_two_a" bindtap="_goods(item.p_id,item.recycle,item.pluginId)">
<view class="order_p_name">{{ item.p_name }}</view>
<view class="price_num">
<view class="price">
<view class="price_symbol">¥{{item.p_price}}</view>
</view>
<view class="color_two">x{{ item.num }}</view>
</view>
<view class="color_one">{{ item.size }}</view>
</view>
</view>
</view>
<view class="refund_pay">
<view class="right_d">
<view class="right_d_view">
<view class="leftText">
<view>售后类型:</view>
</view>
<view class="rightText" wx:if="{{refund_type==2}}">仅退款</view>
<view class="rightText" wx:if="{{refund_type==1}}">退货退款</view>
<view class="rightText" wx:if="{{refund_type==3}}">换货</view>
</view>
</view>
<view wx:if="{{r_status != 3 && refund_type != 3}}">
<view class="right_d">
<view class="right_d_view">
<view class="leftText">退款金额:</view>
<view class="refund_color font_red">¥</view>
<input class="refund_color font_red" type="number" value="{{re_price}}" bindinput="refundPriceInput" />
</view>
<view class="right_d_right">
<view class="refund_color yh-refund_color">最多¥{{ refund_price }}</view>
</view>
</view>
</view>
<view wx:if="{{r_status == 3}}" style="display: flex;justify-content: start;">
<view class="leftText">
<view>退款说明:</view>
</view>
<view>ddfddf</view>
</view>
<view style="display:flex;">
<view class="leftText">
<view>{{ r_status != 3 ? ( refund_type != 3 ? '退款说明:' : '申请原因:' ) : '申请原因:' }}</view>
</view>
<view class="input">
<textarea class="input_text" rows="4" auto-height="true" placeholder="最多100字" placeholder-style="color:#b8b8b8" bindinput="remarkInput" />
<view class='words_num'>
<view>{{remark.length}}</view>/100
</view>
</view>
</view>
<view class="evaluat_imageBox">
<view class="yh-evaluat_view leftText">
<view>上传凭证:</view>
</view>
<view class="evaluat_view" wx:for="{{srcList}}" wx:key="index">
<image class="evaluat_image" src="{{item.tempFilePath}}" bindtap="touchstartAct" />
<image class="image_dele" src="/images/delete.png" data-index="{{index}}" bindtap="deleteAct" />
</view>
<view class="uploadImage" bindtap="chooseImage" data-index="{{index}}" wx:if="{{srcList.length < 3 ? true : false}}">
<image class="xiangji" src="/images/xiangji.png" />
<view class="p">最多上传3张</view>
</view>
</view>
</view>
<view class="yh-return_suess-view"></view>
<view class="bottom" bindtap="confirmAct">
<view>提交</view>
</view>
</view>
<!-- 申请成功 -->
<view class="return_end" wx:if="{{return_suess}}" style="position: relative;overflow: hidden;">
<view class="pic">
<image src="/images/gouhei.png" />
</view>
<view class="end_one">{{ refund_type != 3 ? '退款申请提交成功' : '换货申请提交成功'}}</view>
<view class="end_two">请耐心等待工作人员审核</view>
<view class="yh-return-end-view"></view>
<view class="return_message">{{ refund_type != 3 ? '退款信息' : '退货信息'}}</view>
<view class="end_msg_ul">
<view class="end_message">
<view class="end_lef">商品名称:</view>
<view class="detail">{{ order.product_title[0] }}</view>
</view>
<view class="end_message">
<view class="end_lef">订单号:</view>
<view class="detail">{{ order.sNo }}</view>
</view>
<view class="end_message">
<view class="end_lef">申请时间:</view>
<view class="detail">{{ order.time }}</view>
</view>
<view class="end_message">
<view class="end_lef">退款类型:</view>
<view class="detail">{{ refund_type == 3 ? '换货' : refund_type == 2 ? '仅退款' : '退货退款' }}</view>
</view>
<view class="end_message" wx:if="{{refund_type !== '3'}}">
<view class="end_lef">退款金额:</view>
<view class="detail">¥{{ re_price }}</view>
</view>
<view class="end_message">
<view class="end_lef">退款说明:</view>
<view class="detail">{{ remark }}</view>
</view>
<view class="end_message">
<view class="end_lef">上传凭证:</view>
<view class="evaluat_li" wx:for="{{srcList}}" wx:key="index">
<image class="evaluat_img" src="{{item}}" bindtap="touchstart" />
</view>
</view>
</view>
</view>
</view>

310
pages/aftersales/apply.wxss

@ -0,0 +1,310 @@
/* pages/aftersales/apply.wxss */
.page{
width: 100%
}
.container{
background-color: #F4F5F6;
}
.order_goods{
border-radius: 0px 0px 24rpx 24rpx;
margin-bottom:24rpx ;
}
.order_two {
display: flex;
border-radius: 0px 0px 24rpx 24rpx;
border: none;
background-color: #fff;
padding: 32rpx;
}
.shopImage{
width: 216rpx;
height: 216rpx;
border-radius: 16rpx;
margin-right: 24rpx;
}
.order_two_a {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-around;
height: 216rpx;
}
.price_num {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 32rpx;
color: #FA5151;
}
.price_num .price{
font-weight: 600;
}
.price .price_symbol{
font-size: 32rpx;
}
.order_p_name {
text-align: start;
height: auto;
margin: 0 0 20rpx 0;
font-size: 32rpx;
color: #333333;
overflow:hidden;
text-overflow:ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.color_one{
text-align: start;
max-width: 260rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 28rpx;
color: #999999;
}
.color_two {
font-size: 28rpx;
color: #999999;
}
.refund_pay {
border-radius:24rpx;
margin-left: 5rpx;
font-size: 32rpx;
color: #020202;
background-color: #fff;
}
.right_d{
display: flex;
align-items: center;
justify-content: space-between;
}
.right_d_view {
display: flex;
align-items: center;
width: 100%;
flex: 1;
}
.leftText{
width: 160rpx;
white-space: nowrap;
}
.rightText{
position: absolute;
right: 32rpx;
}
.refund_pay>view {
width:auto;
padding: 32rpx 0rpx 32rpx 0;
margin: 0 32rpx 0 32rpx ;
border-bottom: 1rpx solid #eee;
}
.uploadImage {
font-size: 24rpx;
border:1rpx dashed #CCCCCC;
/* position: relative; */
color: #333333;
width: 160rpx;
height: 160rpx;
float: left;
margin-right: 15rpx;
text-align: center;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
box-sizing: border-box;
}
.uploadImage .p {
font-size: 24rpx;
margin: 0 auto;
color: #b8b8b8;
}
.xiangji {
width: 48rpx;
height: 48rpx;
margin-bottom: 20rpx;
}
.input {
position: relative;
width: 100%;
}
.words_num{
display: flex;
position: absolute;
right: 24rpx;
bottom: 24rpx;
font-size: 28rpx;
color: #333333;
}
.words_num view{
color: #999999;
}
.input_text {
border-radius: 16rpx;
min-height: 136rpx;
font-size: 28rpx;
width: 526rpx;
box-sizing: border-box;
color:#020202;
padding:16rpx;
margin-left: 10rpx;
word-break: break-all;
border: 1rpx solid rgba(0,0,0,0.1);
}
.refund_money {
border: none;
width: 51%;
margin: 2rpx 0 0 10rpx;
}
.refund_color {
font-size: 32rpx;
color: #9D9D9D;
}
.font_red {
color: #FA5151;
}
yh-return_suess-view {
height: 150rpx;
}
.bottom {
position: fixed;
bottom: 0;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: #ffffff;
box-shadow: 0 0 0 0 rgba(0,0,0,0.2);
padding-bottom: env(safe-area-inset-bottom);
}
.bottom view{
width: 686rpx;
height: 92rpx;
font-size: 32rpx;
color: #fff;
text-align: center;
line-height: 92rpx;
border-radius: 52rpx;
margin: 20rpx;
padding:0;
background-color: #FA5151;
}
.p_name {
width: 100%;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.image_dele {
position: absolute;
top: -10rpx;
right: 0;
height: 20rpx;
width: 20rpx;
}
.evaluat_image {
height: 100%;
width: 100%;
}
.image_dele {
height: 28rpx;
width: 28rpx;
}
.evaluat_imageBox {
display: flex;
}
.evaluat_view {
float: left;
height: 150rpx;
width: 150rpx;
margin-right: 10rpx;
position: relative;
}
.evaluat_view:after {
display: block;
content: "";
clear: both;
}
/* 申请成功 */
.return_end {
font-size: 28rpx;
color: #020202;
/* background-color: white; */
}
.pic {
margin-top: 60rpx;
text-align: center;
}
.pic image {
width: 100rpx;
height: 100rpx;
margin: 0 auto;
}
.end_one {
font-size: 30rpx;
text-align: center;
margin-top: 30rpx;
}
.end_two {
font-size: 24rpx;
color: #9D9D9D;
text-align: center;
margin: 18rpx 0 60rpx 0;
}
.return_message {
padding: 30rpx;
border-bottom: 1px solid #eee;
font-size: 32rpx;
}
.end_message {
display: flex;
}
.end_message {
padding: 30rpx 30rpx 0 30rpx;
}
.end_text {
width: 450rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: right;
}
.end_lef {
text-align: justify;
width: 150rpx;
height: 39rpx;
color: #666;
}
.detail{
color: #666;
}
.yh-return-end-view {
height: 30rpx;
width: 100%;
background-color: #eee;
}

84
pages/aftersales/asdetail.js

@ -0,0 +1,84 @@
// pages/aftersales/asdetail.js
var app = getApp()
var WXAPI = require('../../utils/server.js');
Page({
/**
* 页面的初始数据
*/
data: {
info: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.loadData(options)
},
loadData: function(options){
var that = this
WXAPI.returnDetail({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
pid: options.pid,
orderDetailId: options.orderId,
}).then(res => {
if (res.code == 200) {
var data = res.data
that.setData({
info: data.info
});
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

4
pages/aftersales/asdetail.json

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "售后详情"
}

88
pages/aftersales/asdetail.wxml

@ -0,0 +1,88 @@
<!--pages/aftersales/asdetail.wxml-->
<view class="container">
<view class="status-view">
<block wx:if="{{info.type == 0}}">
<view class="statusLabel">待审核</view>
<view class='statusDesc'>您的售后申请正在审核中,请耐心等待2-3个工作日</view>
</block>
<block wx:elif="{{info.type == 1}}">
<view class="statusLabel">待回寄</view>
<view class='statusDesc'>商家已同意,请用户寄回商品</view>
</block>
<block wx:elif="{{info.type == 2}}">
<view class="statusLabel">已拒绝</view>
<view class='statusDesc'>商家拒绝退货退款</view>
</block>
<block wx:elif="{{info.type == 3}}">
<view class="statusLabel">待卖家收货</view>
<view class='statusDesc'>用户已寄出,等待商家收货</view>
</block>
<block wx:elif="{{info.type == 4}}">
<view class="statusLabel">已退款</view>
<view class='statusDesc'>收到寄回商品,同意并退款</view>
</block>
<block wx:elif="{{info.type == 5}}">
<view class="statusLabel">已拒绝</view>
<view class='statusDesc'>商家拒绝并退回商品</view>
</block>
<block wx:elif="{{info.type == 8}}">
<view class="statusLabel">已拒绝</view>
<view class='statusDesc'>商家拒绝退款</view>
</block>
<block wx:elif="{{info.type == 9}}">
<view class="statusLabel">已退款</view>
<view class='statusDesc'>商家同意并退款</view>
</block>
<block wx:elif="{{info.type == 10}}">
<view class="statusLabel">已拒绝</view>
<view class='statusDesc'>商家拒绝售后</view>
</block>
<block wx:elif="{{info.type == 11}}">
<view class="statusLabel">待收货</view>
<view class='statusDesc'>商家同意并且寄回商品</view>
</block>
<block wx:elif="{{info.type == 12}}">
<view class="statusLabel">已结束</view>
<view class='statusDesc'>售后结束</view>
</block>
</view>
<view class="yh-line"></view>
<view class="rt-product-box">
<view class="yh-block-title">
<view>售后信息</view>
</view>
<view style="height:2rpx;background-color:#F4F4F4;margin-top:30rpx;"></view>
<view class="address-row">
<view>商品名称:</view>
<view class="yh-p_name">{{info.p_name}}</view>
</view>
<view class="address-row">
<view>订单号:</view>
<view>{{info.r_sNo}}</view>
</view>
<view class="address-row">
<view>申请时间:</view>
<view>{{info.re_time}}</view>
</view>
<view class="address-row">
<view>售后类型:</view>
<view>{{info.re_type==1?'退货退款':info.re_type==3?'换货':'仅退款'}}</view>
</view>
<view class="address-row h_auto">
<view>申请原因:</view>
<view class='yx_right'>{{info.content}}</view>
</view>
<view class="address-row h_auto" wx:if="{{info.re_photo&&info.re_photo.length > 0}}">
<view>上传凭证:</view>
<view class="flex">
<view class="re_photo" wx:for="{{info.re_photo}}" wx:key='index'>
<image src="{{item}}" mode=""/>
</view>
</view>
</view>
<view class="address-row" wx:if="{{info.re_type != 3}}">
<view>退款金额:</view>
<view>¥{{info.p_price}}</view>
</view>
</view>
</view>

69
pages/aftersales/asdetail.wxss

@ -0,0 +1,69 @@
/* pages/aftersales/asdetail.wxss */
.page{
width: 100%
}
.container{
background-color: white;
}
.rt-product-box{
background-color: white;
padding: 30rpx;
}
.yh-line {
height: 20rpx;
background: #F4F4F4;
}
.yh-block-title {
display: flex;
justify-content: space-between;
}
.yh-p_name {
text-overflow: ellipsis;
white-space: nowrap;
width: 240px;
overflow: hidden;
}
.re_photo {
width: 120rpx;
height: 120rpx;
margin-right: 10rpx;
margin-top: 15rpx;
}
.re_photo image {
width: 100%;
height: 100%;
}
.address-row {
display: flex;
line-height: 40rpx;
font-size: 28rpx;
padding: 0 0rpx;
color: #666666;
margin: 20rpx 0;
}
.address-row view:first-child{
white-space: nowrap;
}
.status-view{
height: 200rpx;
width: 100%;
background-color: #FA5151;
}
.statusLabel{
position: absolute;
margin-top: 50rpx;
margin-left: 40rpx;
color: white;
font-size: 40rpx;
font-weight: bold;
}
.statusDesc{
position: absolute;
margin-top: 120rpx;
margin-left: 40rpx;
color: #bbbbbb;
font-size: 28rpx;
}

53
pages/aftersales/index.js

@ -12,8 +12,7 @@ Page({
data: {
isStatus: 'whole',
currentTab: 0,
orderList0: [],
orderList1: [],
orderList: [],
remind: '加载中',
showModalStatus: false,
address: [],
@ -38,9 +37,8 @@ Page({
var that = this;
console.log(e);
var id = e.currentTarget.dataset.index;
var orderList0 = that.data.orderList0;
var r_content = orderList0[id].r_content;
var orderList = that.data.orderList;
var r_content = orderList[id].r_content;
wx.showToast({
title: '拒绝理由:'+r_content,
icon:'none',
@ -51,8 +49,8 @@ Page({
var that = this;
console.log(e);
var id = e.currentTarget.dataset.index;
var orderList0 = that.data.orderList0;
var r_content = orderList0[id].r_content;
var orderList = that.data.orderList;
var r_content = orderList[id].r_content;
wx.showToast({
title: r_content,
icon: 'none',
@ -121,7 +119,6 @@ Page({
duration: 2000
});
}
},
bindPickerChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
@ -139,18 +136,34 @@ Page({
}).then(res => {
if (res.code == 200) {
var data = res.data
switch (that.data.currentTab) {
case 0:
that.setData({
orderList0: data.list,
});
break;
case 1:
that.setData({
orderList1: data.list,
});
break;
}
that.setData({
orderList: data.list,
});
}
})
},
//查看详情
navToAsdetail: function (e) {
var info = e.currentTarget.dataset.info
wx.navigateTo({
url:"/pages/aftersales/asdetail?orderId="+info.p_id+"&pid="+info.pid
})
},
cancelAct: function (e) {
var info = e.currentTarget.dataset.info
WXAPI.cancelLation({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
id: info.id,
}).then(res => {
if (res.code == 200) {
wx.showToast({
title: '撤销成功',
icon:'none',
duration: 2000
});
this.loadList();
}
})
},

125
pages/aftersales/index.wxml

@ -25,97 +25,48 @@
</view>
<!-- 加载页面结束 -->
<block wx:else>
<view class="swiper-tab">
<view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" data-otype="whole" bindtap="swichNav">全部</view>
<view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" data-otype="stay" bindtap="swichNav">待处理</view>
</view>
<view class="c_t60"></view>
<swiper current="{{currentTab}}" class="swiper-box" duration="300" bindchange="bindChange">
<!-- 全部 -->
<swiper-item>
<scroll-view scroll-y="true" style="height:100%;">
<view class="search_no" wx:if="{{orderList0.length < 1}}">
<view class="font_14">
<image class="scimg" src="/images/search_no.png"></image>
</view>
<text>没有可用订单/(ㄒoㄒ)/~~</text>
<scroll-view scroll-y="true" style="height:100%;">
<view class="search_no" wx:if="{{orderList.length < 1}}">
<view class="font_14">
<image class="scimg" src="/images/search_no.png"></image>
</view>
<text>没有可用订单/(ㄒoㄒ)/~~</text>
</view>
<view class="list" wx:for="{{orderList}}" wx:key="key">
<view class="top">
<view>订单号:{{item.r_sNo}}
<view class="tab_statu" style='color:#FA5151;' wx:if="{{item.r_type == 0}}">待核审</view>
<view class="tab_statu sbutt" data-id='{{item.id}}' bindtap='setModalStatus' data-status="1" wx:if="{{item.r_type == 1 || item.r_type == 11}}">待回寄></view>
<view class="tab_statu sbutt" bindtap='jujue' data-index='{{index}}' wx:if="{{item.r_type == 2 || item.r_type == 5 || item.r_type == 8 || item.r_type == 10}}">已拒绝></view>
<view class="tab_statu" style='color:#FA5151;' wx:if="{{item.r_type == 3}}">待卖家收货</view>
<view class="tab_statu" style='color:#FA5151;' wx:if="{{item.r_type == 4 || item.r_type == 9}}">已退款</view>
<view class="tab_statu" style='color:#FA5151;' wx:if="{{item.r_type == 12}}">已结束</view>
</view>
<view class="list" wx:for="{{orderList0}}" wx:key="key" >
<view class="top">
<view>订单号:{{item.r_sNo}}
<view class="tab_statu" style='color:#dd2727;' wx:if="{{item.r_type == 0}}">核审中</view>
<view class="tab_statu sbutt" data-id='{{item.id}}' bindtap='setModalStatus' data-status="1" wx:if="{{item.r_type == 1 || item.r_type == 6}}">待回寄></view>
<view class="tab_statu sbutt" bindtap='jujue' data-index='{{index}}' wx:if="{{item.r_type == 2 || item.r_type == 5}}">已拒绝></view>
<view class="tab_statu" style='color:#dd2727;' wx:if="{{item.r_type == 3}}">待卖家收货</view>
<view class="tab_statu" style='color:#dd2727;' wx:if="{{item.r_type == 4}}">已退款</view>
</view>
</view>
<navigator url="../order/detail?orderId={{item.id}}">
<view class="shop df">
<navigator url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle">
<image class="sh_slt" src="{{item.imgurl}}"></image>
</navigator>
<view class="sp_text">
<!-- <navigator style='width:70%;' url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle"> -->
<view class="sp_tit ovh1" style="color: #000;">{{item.p_name}}</view>
<view class="sp_tit ovh1" style='color:#808080'>{{item.size}}</view>
<!-- </navigator> -->
<view class="sp_jg">
<view class='guige'>¥ {{item.p_price}} </view>
<view class='guige'>x{{item.num}}</view>
</view>
</view>
</view>
</navigator>
</view>
<view class="shop df">
<image class="sh_slt" src="{{item.imgurl}}"></image>
<view class="sp_text">
<view class="sp_tit ovh1" style="color:#000;">{{item.p_name}}</view>
<view class="sp_tit ovh1" style='color:#999'>{{item.size}}</view>
</view>
</scroll-view>
</swiper-item>
<!-- 待处理 -->
<swiper-item>
<scroll-view scroll-y="true" style="height:100%;">
<view class="search_no" wx:if="{{orderList1.length < 1}}">
<view class="font_14">
<image class="scimg" src="/images/search_no.png"></image>
</view>
<text>没有可用订单/(ㄒoㄒ)/~~</text>
<view class="sp_jg">
<view class='guige' style="color:#000;">¥ {{item.p_price}} </view>
<view class='guige'>x{{item.num}}</view>
</view>
<view class="list" wx:for="{{orderList1}}" wx:key="key" >
<view class="top">
<view>订单号:{{item.r_sNo}}
<view class="tab_statu" style='color:#dd2727;' wx:if="{{item.r_type == 0}}">核审中</view>
<view class="tab_statu sbutt" data-id='{{item.id}}' bindtap='setModalStatus' data-status="1" wx:if="{{item.r_type == 1}}">待回寄></view>
<view class="tab_statu sbutt" bindtap='jujue' data-index='{{index}}' wx:if="{{item.r_type == 2 || item.r_type == 5}}">已拒绝></view>
<view class="tab_statu" style='color:#dd2727;' wx:if="{{item.r_type == 3}}">待卖家收货</view>
<view class="tab_statu" style='color:#dd2727;' wx:if="{{item.r_type == 4}}">已退款</view>
</view>
</view>
<navigator url="../order/detail?orderId={{item.id}}">
<view class="shop df">
<navigator url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle">
<image class="sh_slt" src="{{item.imgurl}}"></image>
</navigator>
<view class="sp_text">
<!-- <navigator style='width:70%;' url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle"> -->
<view class="sp_tit ovh1" style="color: #000;">{{item.p_name}}</view>
<view class="sp_tit ovh1" style='color:#808080'>颜色规格: [{{item.size}}]</view>
<!-- </navigator> -->
<view class="sp_jg">
<view class='guige'>¥ {{item.p_price}} </view>
<view class='guige'>x{{item.num}}</view>
</view>
</view>
</view>
</navigator>
</view>
<view class="bottom">
<image wx:if="{{item.re_type==2}}" src="/images/tuikuan.png" mode=""/>
<image wx:elif="{{item.re_type==1}}" src="/images/tuihuo.png" mode=""/>
<image wx:elif="{{item.re_type==3}}" src="/images/huanhuo.png" mode=""/>
<text>{{item.re_type==2?'仅退款':item.re_type==1?'退货退款':'换货'}}</text>
<view class="right">
<view class="normalBtn" bindtap="navToAsdetail" data-info="{{item}}">查看详情</view>
<view class="confirmBtn" bindtap="cancelAct" data-info="{{item}}">撤销审核</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</view>
</scroll-view>
</block>
@ -160,4 +111,4 @@
</form>
</view>
</view>
</view>
</view>

85
pages/aftersales/index.wxss

@ -1,4 +1,10 @@
/* pages/aftersales/index.wxss */
.page{
width: 100%
}
.container{
background-color: #F4F5F6;
}
.swiper-tab{
width: 100%;
border-bottom: 1px solid #eee;
@ -40,9 +46,9 @@ overflow: hidden;
width: 94%;
}
.shop{
background: #fafafa;
padding: 4%;
border-bottom:1px solid #eee;
background: white;
padding: 30rpx;
border-bottom:2rpx solid #eee;
}
.shop checkbox{
margin-top: 27px;
@ -55,11 +61,8 @@ overflow: hidden;
float: left;
}
.sp_text{
display:flex;
line-height: 20px;
width: 100%;
text-align: left;
padding-left:8px;
line-height: 50rpx;
padding-left:16rpx;
}
.sp_tit{
width: 100%;
@ -74,16 +77,58 @@ overflow: hidden;
color: #999;
}
.sp_jg{
width: 30%;
position: absolute;
right: 30rpx;
line-height: 50rpx;
overflow: hidden;
font-size: 13px;
color: #fc0628;
}
.guige{
font-size:12px;
color:#808080;
color:#999;
text-align:right;
}
.bottom{
display: flex;
align-items: center;
height: 80rpx;
background-color: white;
}
.bottom image {
margin-left: 20rpx;
width: 40rpx;
height: 40rpx;
}
.bottom text {
margin-left: 10rpx;
font-size: 26rpx;
}
.bottom .right{
display: flex;
align-items: center;
position: absolute;
right: 30rpx;
}
.normalBtn{
margin-right: 20rpx;
padding: 5rpx 22rpx;
font-size: 24rpx;
color: #FA5151;
border: 1px solid #FA5151;
height: 38rpx;
line-height: 38rpx;
border-radius: 8rpx;
}
.confirmBtn{
padding: 5rpx 22rpx;
font-size: 24rpx;
color: white;
height: 38rpx;
line-height: 38rpx;
border-radius: 8rpx;
background-color: #FA5151;
}
.dle{
color: #999;
font-size: 12px;
@ -130,7 +175,7 @@ overflow: hidden;
.c_t60{
clear: both;
height: 1px;
padding-top: 48px;
/* padding-top: 48px; */
}
.blue{
color: #42b1ff;
@ -139,7 +184,7 @@ color: #42b1ff;
margin-right: 5px;
}
.list{
border-bottom: 4px solid #eee;
border-bottom: 20rpx solid #F4F4F4;
}
.top{
padding: 2% 4%;
@ -318,16 +363,16 @@ padding: 10px;
font-size: 13px;
}
.Withdraw{
padding: 10px 0;
font-size: 13px;
display:flex;
height:25px;
padding: 10px 0;
font-size: 13px;
display:flex;
height:25px;
}
.cash{
border-bottom:1px solid #eee;
width:80%;
margin:auto;
border-bottom:1px solid #eee;
width:80%;
margin:auto;
}
.Withdraw view{
line-height:25px;
line-height:25px;
}

20
pages/order/detail.js

@ -508,23 +508,21 @@ Page({
url: "/pages/order/payment?orderId="+data.sNo+"&price="+data.z_price,
})
},
//查看售后
afterSalesCheck: function(e) {
var that = this;
var info = e.currentTarget.dataset.info
wx.navigateTo({
url:"/pages/aftersales/asdetail?orderId="+info.list[0].id+"&pid="+info.list[0].p_id
})
},
//申请售后
afterSalesOrder: function(e) {
afterSalesApply: function(e) {
var that = this;
var info = e.currentTarget.dataset.info
wx.navigateTo({
url:"/pages/aftersales/aftersales?orderId="+info.list[0].id
})
// WXAPI.orderRemind({
// accessId: app.globalData.accessId,
// storeId: 239,
// storeType: 1,
// order_id: info.id,
// }).then(res => {
// if (res.code == 200) {
// that.reloadData();
// }
// })
},
//提醒发货
orderRemind: function(e) {

6
pages/order/detail.wxml

@ -140,12 +140,14 @@
<view class="confirmBtn" bindtap="payNow" data-info="{{orderData}}">立即付款</view>
</block>
<block wx:elif="{{rstatus == 1}}">
<view class="confirmBtn" catchtap="afterSalesOrder" style="right: 225rpx;" data-info="{{orderData}}">申请售后</view>
<view class="confirmBtn" catchtap="afterSalesCheck" style="right: 225rpx;" data-info="{{orderData}}" wx:if="{{list[0].refund==false}}">查看售后</view>
<view class="confirmBtn" catchtap="afterSalesApply" style="right: 225rpx;" data-info="{{orderData}}" wx:else>申请售后</view>
<view class="confirmBtn" wx:if="{{orderData.delivery_status == 1}}" style="background-color:#ccc;color:white;border:0px;">提醒发货</view>
<view class="confirmBtn" wx:else bindtap="orderRemind" data-info="{{orderData}}">提醒发货</view>
</block>
<block wx:elif="{{rstatus == 2}}">
<view class="confirmBtn" catchtap="afterSalesOrder" style="right: 410rpx;" data-info="{{orderData}}">申请售后</view>
<view class="confirmBtn" catchtap="afterSalesCheck" style="right: 410rpx;" data-info="{{orderData}}" wx:if="{{list[0].refund==false}}">查看售后</view>
<view class="confirmBtn" catchtap="afterSalesApply" style="right: 410rpx;" data-info="{{orderData}}" wx:else>申请售后</view>
<view class="normalBtn" bindtap="orderLogistics" data-info="{{orderData}}">查看物流</view>
<view class="confirmBtn" bindtap="confirmOrder" data-info="{{orderData}}">确认收货</view>
</block>

2
pages/user/user.wxml

@ -136,7 +136,7 @@
</view>
<!-- </navigator> -->
<!-- <navigator class='list' url="../aftersales/index?currentTab=0&otype=whole"> -->
<view class="list" data-id="../aftersales/index?currentTab=0&otype=whole" catchtap="jumpgo">
<view class="list" data-id="/pages/aftersales/index" catchtap="jumpgo">
<text class='tishi' wx:if="{{th > 0}}">{{th}}</text>
<view class='dd_img'>
<image src='../../images/icons/tksh.png'></image>

6
pages/user/user.wxss

@ -62,10 +62,10 @@ page{
}
.xxnum {
position: absolute;
left: 20rpx;
bottom: 32rpx;
left: 28rpx;
bottom: 35rpx;
transform: translate(50%, -50%);
padding: 4rpx 6rpx;
padding: 4rpx 8rpx;
background-color: #f43530;
border-radius: 12rpx;
font-size: 22rpx;

10
utils/server.js

@ -214,4 +214,14 @@ module.exports = {
returnMethod: (data) => { //申请售后
return requestServer('app.order.return_method', 'post', data)
},
returnData: (data) => { //提交售后
return requestServer('app.order.ReturnData', 'post', data)
},
returnDetail: (data) => { //售后详情
return requestServer('app.order.Returndetail', 'post', data)
},
cancelLation: (data) => { //撤销售后
return requestServer('app.order.Cancellation_of_application', 'post', data)
},
}
Loading…
Cancel
Save