第一次提交

This commit is contained in:
2023-02-18 16:24:17 +08:00
parent dceb736e33
commit 53aeac7bfe
1270 changed files with 45215 additions and 0 deletions

View File

@@ -0,0 +1,455 @@
//获取应用实例
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
resp:{
"erro": 0,
"infro": {
"address": "陕西省西安市雁塔区长延居底商2层",
"charge_phone": "13772530001",
"goods_name": "【十亿补贴】【水光补水】嗨体水光【水光套餐】5ml 抗衰美白 嫩肤补水",
"id": "19fdf93c85c2f9f393a59bb8d64c3948",
"index_img": "https://www.zoowoo.net/uploadnv/2022/02/09/164437226246602.png",
"mechanism_name": "西安蜜芽购科技有限公司",
"num": "1",
"order_id": "2022021514543285003305",
"total_money": "0.01",
"wechat_logo": "https://www.zoowoo.net/uploadnv/2022/02/08/164430729380625.png"
},
"msg": "查询成功",
"refund": {}
},
dingdan_msg:false,
goods_id:'',
type:'',
fileListtwo: [],
reason:[],
id:'',
refund_remark:'',
voucher_img:'',
mengceng:false,
refund_box:false,
refund_id:'',
refund_name:'请选择',
goods_img:[],
list:[
{
text:'不喜欢/不想要',
},
{
text:'商品信息与描述不符'
},
{
text:'买多/买错/计划有变'
},
{
text:'更换其他项目、购买了其他项目'
},
{
text:'没有时间/个人原因'
},
{
text:'其他原因'
}
]
},
afterReadtwo(event) {
var that = this;
const { file } = event.detail;
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
wx.uploadFile({
url: app.buildUrl("/app/Goddesswechat/uploadImg"),
filePath: file.url,
name: 'file',
formData: {
uid:app.getCache('uid'),
token:app.getCache('token'),
file:file.url
},
success: (res)=> {
var resp = res.data;
var rstObj = JSON.parse(resp); //字符串转为对象
if(rstObj.erro==0){
app.console(rstObj.file_path+'cccccccc')
// 上传完成需要更新 fileList
const { fileListtwo = [] } = that.data;
fileListtwo.push({ ...file, url: rstObj.file_path ,name:rstObj.file_name});
that.setData({
fileListtwo,
voucher_img:rstObj.file_path
});
}else{
wx.showToast({ title: rstObj.msg, icon: 'none' });
return;
}
},
});
},
deletetwo(event){
app.console(event.detail.index+"================="+222),
this.data.fileListtwo.splice([event.detail.index],1)
this.setData({fileListtwo:this.data.fileListtwo});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options.type)
console.log(options.id)
//详情显示
if(options.type==2){
this.setData({
id:options.id,
type:2
})
this.refundOderInfor()
}
//退款编辑
if(options.type==3){
this.setData({
id:options.id,
type:3
})
this.refundOderInfor()
}
//退款驳回
if(options.type==1){
this.setData({
id:options.id,
type:1
})
this.refundOderInfor()
}
//待退款
if(options.type==4){
this.setData({
id:options.id,
type:4
})
this.refundOderInfor()
}
this.getRefundReason()
},
select(){
this.setData({
refund_box:true,
mengceng:true
})
},
mengceng(){
this.isok()
},
isok(){
this.setData({
refund_box:false,
mengceng:false
})
},
commit(){
//假逻辑
setTimeout(function () {
//要延时执行的代码
wx.switchTab({
url: '/pages/order/order',
});
}, 2000) //延迟时间 这里是2秒
var that = this;
that.data.fileListtwo.forEach(item => {
app.console('长度=item================'+item)
const { goods_img = [] } = that.data;
goods_img.push(item.url);
that.setData({ goods_img });
}),
wx.request({
url: app.buildUrl("/app/Goddesswechat/submitRefund"),
header: app.getRequestHeader(),
method:'POST',
data: {
version_number: app.globalData.version_number,
uid:wx.getStorageSync('uid'),
token:wx.getStorageSync('token'),
id:this.data.id,
refund_id:this.data.refund_id,
refund_remark:this.data.refund_remark,
voucher_img:that.data.goods_img,
},
success: function (res) {
var resp = res.data;
console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
if(resp.erro==0){
wx.showToast({ title: resp.msg, icon: 'none' });
setTimeout(function () {
//要延时执行的代码
wx.switchTab({
url: '/pages/order/order',
});
}, 2000) //延迟时间 这里是2秒
}else{
wx.showToast({ title: resp.msg, icon: 'none' });
}
}
});
},
onClickLeft() {
wx.navigateBack()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// this.refundOderInfor();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
//退款订单详情
refundOderInfor: function () {
var that = this;
wx.request({
url: app.buildUrl("/app/Goddesswechat/refundOderInfor"),
header: app.getRequestHeader(),
method:'POST',
data: {
version_number: this.data.version_number,
uid:wx.getStorageSync('uid'),
token:wx.getStorageSync('token'),
id:this.data.id
},
success: function (res) {
var resp = res.data;
console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
console.log(resp.erro+"=================dddddddddddddddddddddddddddddddddddddddddddd")
if(resp.erro==0){
that.setData({
infro:resp.infro
});
}
}
});
},
radioChange(e) {
console.log('radio发生change事件携带value值为', e.detail.value)
this.setData({
refund_id:e.detail.value
})
const reason = this.data.reason
for (let i = 0, len = reason.length; i < len; ++i) {
reason[i].checked = reason[i].value === e.detail.value
}
this.setData({
reason
})
this.data.reason.forEach(item => {
if(this.data.refund_id==item.id){
this.setData({ refund_name:item.reason });
}
})
console.log('radio发生change事件携带value值为', this.data.refund_name)
this.isok()
},
//后台设置的退款原因
getRefundReason: function () {
var that = this;
//假数据
var resp = {
"erro": 0,
"msg": "查询成功",
"reason": [
{
"id": "2",
"reason": "预约不到"
},
{
"id": "4",
"reason": "商品信息与描述不符"
},
{
"id": "6",
"reason": "以各种理由拒绝服务"
},
{
"id": "8",
"reason": "服务态度差,不友好"
},
{
"id": "9",
"reason": "没有时间"
},
{
"id": "10",
"reason": "买多/买错/计划有变"
},
{
"id": "12",
"reason": "更换其他项目/购买了其他项目"
},
{
"id": "13",
"reason": "其他原因"
}
]
};
console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
if(resp.erro==0){
that.setData({
reason:resp.reason
});
}
// wx.request({
// url: app.buildUrl("/app/Goddesswechat/getRefundReason"),
// header: app.getRequestHeader(),
// method:'POST',
// data: {
// version_number: app.globalData.version_number,
// uid:wx.getStorageSync('uid'),
// token:wx.getStorageSync('token'),
// },
// success: function (res) {
// var resp = res.data;
// console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
// if(resp.erro==0){
// that.setData({
// reason:resp.reason
// });
// }
// }
// });
},
//退款订单信息
refundOderInfor: function () {
var that = this;
if(this.data.resp.erro==0){
if(that.data.type==3){
that.setData({
infro:this.data.resp.infro,
});
}else{
that.setData({
infro:this.data.resp.infro,
refund:this.data.resp.refund,
refund_remark:this.data.resp.refund.refund_remark,
goods_img:this.data.resp.refund.voucher_img,
refund_id:this.data.resp.refund.refund_id
});
}
that.data.reason.forEach(item => {
if(that.data.refund_id==item.id){
that.setData({ refund_name:item.reason });
}
})
if(that.data.goods_img.length>0){
that.data.goods_img.forEach(item => {
app.console('长度=item================'+item)
const { fileListtwo = [] } = that.data;
fileListtwo.push({ url: item });
that.setData({ fileListtwo });
})
that.setData({
goods_img:[]
})
}
}
// wx.request({
// url: app.buildUrl("/app/Goddesswechat/refundOderInfor"),
// header: app.getRequestHeader(),
// method:'POST',
// data: {
// version_number: app.globalData.version_number,
// uid:wx.getStorageSync('uid'),
// token:wx.getStorageSync('token'),
// id:this.data.id
// },
// success: function (res) {
// var resp = res.data;
// if(resp.erro==0){
// if(that.data.type==3){
// that.setData({
// infro:resp.infro,
// });
// }else{
// that.setData({
// infro:resp.infro,
// refund:resp.refund,
// refund_remark:resp.refund.refund_remark,
// goods_img:resp.refund.voucher_img,
// refund_id:resp.refund.refund_id
// });
// }
// that.data.reason.forEach(item => {
// if(that.data.refund_id==item.id){
// that.setData({ refund_name:item.reason });
// }
// })
// if(that.data.goods_img.length>0){
// that.data.goods_img.forEach(item => {
// app.console('长度=item================'+item)
// const { fileListtwo = [] } = that.data;
// fileListtwo.push({ url: item });
// that.setData({ fileListtwo });
// })
// that.setData({
// goods_img:[]
// })
// }
// }
// }
// });
},
})

View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"van-nav-bar":"/miniprogram/miniprogram_npm/@vant/weapp/nav-bar/index",
"van-uploader": "/miniprogram/miniprogram_npm/@vant/weapp/uploader/index"
},
"navigationBarTitleText": "订单详情"
}

View File

@@ -0,0 +1,142 @@
<view style=" height:340rpx;position: relative;background: #ffffff;margin-top:8rpx;">
<view style="height:66rpx;padding: 0 24rpx;">
<text class="time_msg"></text>
<text wx:if="{{infro.status==1}}" class="status_msg">未核销</text>
<text wx:if="{{infro.status==2}}" class="status_msg">已核销</text>
</view>
<view class="details_box">
<image src="../image/userimg.png" style="width:230rpx;height:230rpx;"></image>
<view style="margin-left: 31rpx;">
<view class="title">{{"专业陪护服务"}}</view>
<view class="detail_number">数量x{{infro.num}}</view>
<view class="money">实付款:<text
style="font-size: 30rpx;color: #FF4A4A;font-family: PingFang SC;font-weight: bold;">¥{{infro.total_money}}</text></view>
</view>
</view>
</view>
<view class="contact" wx:if="{{infro.status==2}}">
<view style="margin-bottom: 30rpx;">
<text class="information_title">核销时间</text>
<text class="information_title" style="position: absolute;right: 0rpx;">{{infro.jurisdiction_time}}</text>
</view>
<view style="margin-bottom: 30rpx;">
<text class="information_title">操作人</text>
<text class="information_title" style="position: absolute;right: 0rpx;display: flex;">{{infro.jurisdiction_name}}</text>
</view>
</view>
<view wx:if="{{type==2}}" style=" height:161rpx;position: relative;background: #ffffff;margin-top:8rpx;" >
<view style="padding-top: 22rpx;margin-left: 24rpx;">
<text class="" style="color: #DB1F2B;font-size: 38rpx;font-weight: bold;">退款成功</text>
</view>
<view style="margin-left: 24rpx;">
<text style="font-size: 24rpx;color: #686868;margin-top: 18rpx;">退款金额已原路返回</text>
</view>
</view>
<view wx:if="{{type==1}}" style=" height:161rpx;position: relative;background: #ffffff;margin-top:8rpx;" >
<view style="padding-top: 22rpx;margin-left: 24rpx;">
<text class="" style="color: #DB1F2B;font-size: 38rpx;font-weight: bold;">退款失败,请修改申请</text>
</view>
<view style="margin-left: 24rpx;">
<text style="font-size: 24rpx;color: #686868;margin-top: 18rpx;">失败原因:请重新填写您的退款申请</text>
</view>
</view>
<view wx:if="{{type==3||type==2||type==1||type==4}}" class="informationtwo">
<!-- <view class="contact_title" style="height: 10rpx; font-size: 10rpx;font-weight: bold;line-height: 36rpx;color: #333333;">
</view> -->
<view style="margin-bottom: 30rpx; border-bottom: 1rpx solid #eee;line-height: 88rpx;">
<text class="information_title">退款原因:</text>
<text class="information_title" style="width: 300rpx;">{{refund_name}}</text>
<text class="information_title" wx:if="{{type==3||type==1}}" style=" position: absolute;right: 24rpx;" bindtap="select">请选择></text>
</view>
<view style="margin-bottom: -30rpx;">
<text class="information_title">退款金额:</text>
<text class="information_title" style="color:#FF4A4A;">¥{{infro.total_money}}</text>
</view>
<view style="margin-bottom: 30rpx; border-bottom: 1rpx solid #eee;line-height: 78rpx;">
<text class="information_title" style="font-size: 20rpx;">不可修改最多¥99</text>
</view>
<view style="margin-bottom: 30rpx;">
<text class="information_title">退款说明:</text>
<text class="information_title">选填</text>
</view>
<!-- <view class="peisong-way" style="margin-bottom: 30rpx;">
<input model:value="{{refund_remark}}" style="font-size: 26rpx;padding-left: 19rpx;padding-top: 19rpxx;" placeholder="填写补充说明,有利于您的售后哦~"/>
<view class="textarea-wrp">
<textarea auto-focus="true" style="height: 228rpx;" />
</view>
</view> -->
<view class="textarea-wrp">
<textarea model:value="{{refund_remark}}"style="font-size: 26rpx;height: 228rpx;background-color: #F6F6F6;" maxlength="-1" placeholder="填写补充说明,有利于您的售后哦~" />
</view>
<!-- <view style="margin-bottom: 30rpx;">
<text class="information_title">上传凭证</text>
</view> -->
<!-- <view class="row-box">
<van-uploader file-list="{{fileListtwo}}"max-count="3" deletable="{{ true }}" bind:after-read="afterReadtwo" bind:delete="deletetwo"/>
</view>
<view wx:if="{{type==1||type==2||type==3||type==4}}" style="margin-bottom: 30rpx; line-height: 88rpx;">
<text class="information_title">订单编号:</text>
<text class="information_title" style="width: 400rpx;position: absolute;">{{infro.order_id}}</text>
</view> -->
<view wx:if="{{type==1||type==2||type==4}}" style="margin-bottom: 30rpx;">
<text class="information_title">申请时间:</text>
<text class="information_title" style="width: 400rpx;position: absolute;">{{refund.check_time}}</text>
</view>
</view>
<view wx:if="{{type==3}}" style="font-size: 26rpx;color: #7B7B7B;margin-top: 26rpx;text-align: center;">退款申请提交后,支付款项将原路退回</view>
<view wx:if="{{type==3}}" style="font-size: 26rpx;color: #7B7B7B;text-align: center;">退款时间1-5个工作日</view>
<view wx:if="{{type==3}}" class="addperson" bindtap="addperson" style="margin-top: 77rpx;">
<view class="text" style="background-color: #FF4C00;border-radius: 85px;margin-bottom: 48rpx;"bindtap="commit">提交申请</view>
</view>
<view wx:if="{{type==1}}" class="addperson" bindtap="addperson" style="margin-top: 77rpx;">
<view class="text" style="background-color: #FF4C00;border-radius: 85px;margin-bottom: 48rpx;"bindtap="commit">修改申请</view>
</view>
<!-- 蒙层 -->
<view class="mengceng" wx:if="{{mengceng}}" bindtap="mengceng"></view>
<!-- 退款弹窗 -->
<view wx:if="{{refund_box}}" class="refund_box" style="z-index: 2;">
<view class="gang" bindtap="gang"></view>
<view class="refund_title">
退款原因</view>
<scroll-view scroll-y style="height: 700rpx;">
<radio-group bindchange="radioChange">
<view wx:for="{{reason}}" class="list_box">
<view>{{item.reason}}</view>
<view>
<radio value="{{item.id}}" checked=""/>
</view>
</view>
</radio-group>
<view style="height:50rpx;"></view>
</scroll-view>
<!-- <button type="primary" plain="true" style="margin-bottom:20rpx" bindtap="isok">完成</button> -->
</view>

View File

@@ -0,0 +1,271 @@
/* pages/orderdetail/orderdetail.wxss */
page {
background: #e5e5e5;
}
.time_msg {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 66rpx;
color: #5B5B5B;
opacity: 1;
float: left;
}
.status_msg {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 66rpx;
color: #FF6A6A;
opacity: 1;
float: right;
}
.details_box {
display: flex;
padding: 0 24rpx;
padding-bottom: 32rpx;
}
.title {
width: 430rpx;
height: 86rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
line-height: 44rpx;
color: #222222;
opacity: 1;
margin-top: 16rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.detail_number {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 37rpx;
color: #B4B4B4;
opacity: 1;
margin-top: 11rpx;
}
.money {
margin-top: 18rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 37rpx;
color: #B4B4B4;
opacity: 1;
}
.detail_btn {
margin-top: 20rpx;
margin-right: 30rpx;
float: right;
/* position: absolute; */
/* bottom: 22rpx;
right: 24rpx; */
/* min-width: 140rpx; */
height: 57rpx;
/* background: #000; */
border: 1rpx solid #FF4A4A;
border-radius: 34rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 57rpx;
color: #FF4A4A;
opacity: 1;
text-align: center;
/* padding: 0 31rpx; */
}
.contact {
height: 167rpx;
background: #fff;
margin-top: 8rpx;
padding: 0 24rpx;
}
.contact_title {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
opacity: 1;
position: relative;
top: 13rpx;
margin-bottom:36rpx;
}
.information {
background: #fff;
height: 539rpx;
margin-top: 8rpx;
padding: 0 24rpx;
}
.informationtwo {
background: #fff;
height: 1050rpx;
margin-top: 8rpx;
padding: 0 24rpx;
}
.information_title {
font-size: 26rpx;
color: #686868;
}
.information_titlee {
font-size: 26rpx;
color: #686868;
position: absolute;right: 24rpx;
}
.mengceng {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000;
opacity: 0.7;
}
.qxdd {
position: fixed;
left: 95rpx;
bottom: 50%;
width: 560rpx;
height: 247rpx;
background: #fff;
border-radius: 20rpx;
}
.msg_btn {
width: 50%;
line-height: 85rpx;
text-align: center;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #4A4A4A;
opacity: 1;
}
.msg_title {
height: 161rpx;
line-height: 161rpx;
text-align: center;
font-size: 28rpx;
color: #4A4A4A;
font-family: PingFang SC;
font-weight: 500;
border-bottom: 1px solid #EBEBEB;
}
.erweima_tanchang {
position: fixed;
left: 95rpx;
bottom: 40%;
width: 560rpx;
height: 446rpx;
background: #fff;
border-radius: 20rpx;
text-align: center;
}
.refund_box {
position: fixed;
background: #fff;
bottom: 0;
width: 100%;
border-radius: 40rpx 40rpx 0px 0px;
/* text-align: center; */
}
.gang {
width: 102rpx;
height: 8rpx;
background: #CCCCCC;
border-radius: 103rpx;
margin: 0 auto;
margin-top: 23rpx;
margin-bottom: 15rpx;
}
.refund_title {
font-size: 34rpx;
font-family: PingFang SC;
font-weight: bold;
line-height: 48rpx;
color: #2D2D2F;
opacity: 1;
margin-bottom: 5rpx;
text-align: center;
}
.list_box {
margin: 0 41rpx 0 25rpx;
display: flex;
justify-content: space-between;
height: 102rpx;
line-height: 102rpx;
border-bottom: 1rpx solid #E8E8E8;
}
.peisong-way{
width: 695rpx;
height: 228rpx;
background: #F6F6F6;
margin-right: 31rpx;
opacity: 1;
border-radius: 0px
}
.addperson{
width: 100%;height: 100rpx;opacity: 1;display: flex; align-items: center; justify-content: center;
}
.text{
font-size: 28rpx;font-family: PingFang SC;color: #FFFFFF;
opacity: 1;width: 50%;display:flex;justify-content: center; align-items: center;
height: 100rpx;
}
.mengceng {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000;
opacity: 0.7;
}
.textarea-wrp {
padding: 0 0rpx;
background-color: #fff;
height: 228rpx;
}
.page-section{
width: 100%;
margin-bottom: 60rpx;
}
textarea {
width: 700rpx;
padding: 25rpx 0;
}