Initial Commit
This commit is contained in:
236
pages/my/applyAfter_sales/applyAfter_sales.js
Normal file
236
pages/my/applyAfter_sales/applyAfter_sales.js
Normal file
@ -0,0 +1,236 @@
|
||||
// pages/my/applyAfter_sales/applyAfter_sales.js
|
||||
const app = getApp();
|
||||
const IP = app.globalData.ip;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
photo: [],
|
||||
ipUrl: app.globalData.ipUrl,
|
||||
textarea: '',
|
||||
total: 0,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.setData({
|
||||
orderId: options.id,
|
||||
num: options.num,
|
||||
sq: options.sq,
|
||||
})
|
||||
if (options.sq == 1) {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '退货申请'
|
||||
})
|
||||
} else {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '换货申请'
|
||||
})
|
||||
}
|
||||
wx.showLoading({
|
||||
title: '加载中..',
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/order/getOrderDetail',
|
||||
method: 'GET',
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
data: {
|
||||
userId: app.globalData.userId,
|
||||
orderNumber: options.num,
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
let goods = res.data.value;
|
||||
this.setData({
|
||||
goods: goods,
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '提示!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//选择图片
|
||||
revise_img: function (e) {
|
||||
if (this.data.photo.length < 4) {
|
||||
var a = 4 - this.data.photo.length
|
||||
console.log(a)
|
||||
wx.chooseImage({
|
||||
count: a,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
console.log(res)
|
||||
for (var i = 0; i < res.tempFilePaths.length; i++) {
|
||||
wx.uploadFile({
|
||||
url: IP + '/wisdommining/api/user/img',
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: ress => {
|
||||
console.log(ress)
|
||||
var photo = this.data.photo;
|
||||
var data = JSON.parse(ress.data);
|
||||
photo.push(data.src);
|
||||
this.setData({
|
||||
photo: photo
|
||||
})
|
||||
console.log(this.data.photo)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '超过上传上限',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
textarea: function (e) {
|
||||
this.setData({
|
||||
textarea: e.detail.value,
|
||||
})
|
||||
},
|
||||
//提交
|
||||
submitBut: function () {
|
||||
var photos = this.data.photo.join(",")
|
||||
console.log(this.data.photo)
|
||||
console.log(photos)
|
||||
if (this.data.textarea == "") {
|
||||
wx.showToast({
|
||||
title: '请说明原因',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.data.photo.length == 0) {
|
||||
wx.showToast({
|
||||
title: '请上传凭证',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '确认提交申请?',
|
||||
success: s => {
|
||||
if (s.confirm) {
|
||||
wx.showLoading({
|
||||
title: '提交中',
|
||||
})
|
||||
wx.request({
|
||||
url: IP + '/wisdommining/api/order/afterSales',
|
||||
method: 'POST',
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
data: {
|
||||
orderRefund: this.data.textarea,
|
||||
orderId: parseInt(this.data.orderId),
|
||||
orderRefundImg: photos,
|
||||
status: this.data.sq == 1 ? 62 : 61
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
wx.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success',
|
||||
success() {
|
||||
setTimeout(() => {
|
||||
wx.navigateBack()
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '获取数据失败!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//长按删除
|
||||
delimg(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '是否删除?',
|
||||
showCancel: true,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
let photo = this.data.photo;
|
||||
photo.splice(index, 1);
|
||||
this.setData({
|
||||
photo: photo
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
})
|
4
pages/my/applyAfter_sales/applyAfter_sales.json
Normal file
4
pages/my/applyAfter_sales/applyAfter_sales.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "申请填写"
|
||||
}
|
51
pages/my/applyAfter_sales/applyAfter_sales.wxml
Normal file
51
pages/my/applyAfter_sales/applyAfter_sales.wxml
Normal file
@ -0,0 +1,51 @@
|
||||
<view class="goods">
|
||||
<view class="cont display_J_B" wx:for='{{goods.goodsList}}' wx:key='index'>
|
||||
<view class="cont-l">
|
||||
<image src="{{item.goodsPhoto}}"></image>
|
||||
</view>
|
||||
<view class="cont-m">
|
||||
<view class="name GStitleOne">{{item.goodsName}}</view>
|
||||
<view class="specs" wx:if="{{goods.orderPayWay!=3}}">规格:{{item.wisdGoodsSpec.specName}}</view>
|
||||
<view class="price" wx:if="{{goods.orderPayWay!=3}}">
|
||||
{{goods.orderPayWay!=2?'¥':''}}{{item.wisdGoodsSpec.specBulyPrice==null?item.wisdGoodsSpec.specPrice:item.wisdGoodsSpec.specBulyPrice}}{{goods.orderPayWay!=2?'':'积分'}}
|
||||
</view>
|
||||
<view class="price" wx:if="{{goods.orderPayWay==3}}">¥0</view>
|
||||
</view>
|
||||
<view class="cont-r">x{{item.goodsNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="aArice" wx:if="{{sq==1&&goods.orderPayWay==1}}">
|
||||
退款金额:<text>¥<text>{{goods.orderActualPay}}</text></text>
|
||||
</view>
|
||||
<view class="aArice" wx:if="{{sq==1&&goods.orderPayWay==2}}">
|
||||
退款金额:<text><text>{{goods.orderOtherPay}}积分</text></text>
|
||||
</view>
|
||||
<view class="aArice" wx:if="{{sq==1&&goods.orderPayWay==3}}">
|
||||
退款金额:<text><text>套餐券1张</text></text>
|
||||
</view>
|
||||
<view class="aArice" wx:if="{{sq==1&&(goods.orderPayWay==4||goods.orderPayWay==5)}}">
|
||||
退款金额:<text style="padding-right:50rpx;">¥<text>{{goods.orderActualPay}}</text></text>
|
||||
{{goods.orderPayWay==4?'现金券':'折扣券'}}:<text>¥<text>{{goods.orderOtherPay}}</text></text>
|
||||
</view>
|
||||
|
||||
<view class="aArice display_J_S">
|
||||
<view class="aArice-l">{{sq==1?'退货':'换货'}}说明:</view>
|
||||
<input type="text" placeholder="必填" bindinput="textarea" value="{{textarea}}" />
|
||||
</view>
|
||||
|
||||
<view class="up">
|
||||
<view class='title'>上传凭证<text>(不超过4张,长按删除)</text></view>
|
||||
<view class='photo'>
|
||||
<view class='photo_cont' wx:for="{{photo}}" catchlongtap="delimg" data-index='{{index}}' wx:key="index">
|
||||
<image src='{{item}}'></image>
|
||||
</view>
|
||||
<view class='photo_upload' catchtap='revise_img'>
|
||||
<image src='/icon/my_feedback_photo.png'></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="height100"></view>
|
||||
<view class="height100"></view>
|
||||
<view class='submit' catchtap='submitBut'>提交申请</view>
|
176
pages/my/applyAfter_sales/applyAfter_sales.wxss
Normal file
176
pages/my/applyAfter_sales/applyAfter_sales.wxss
Normal file
@ -0,0 +1,176 @@
|
||||
/* pages/my/applyAfter_sales/applyAfter_sales.wxss */
|
||||
page{
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.goods{
|
||||
width: 690rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
.cont{
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx #dcdcdc solid;
|
||||
}
|
||||
.cont:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
.cont-l image{
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
.cont-m{
|
||||
width: 400rpx;
|
||||
padding: 10rpx 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-content: space-between;
|
||||
}
|
||||
.name{
|
||||
width:100%;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.specs{
|
||||
width:100%;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.price{
|
||||
width:100%;
|
||||
font-size: 36rpx;
|
||||
color: #ff291e;
|
||||
}
|
||||
.price text{
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
margin-left: 11rpx;
|
||||
}
|
||||
.cont-r{
|
||||
display: flex;
|
||||
align-items : flex-end;
|
||||
font-size: 32rpx;
|
||||
color: #0b0b0b;
|
||||
height: 130rpx;
|
||||
}
|
||||
|
||||
.up{
|
||||
width: 690rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
margin: 0 0 30rpx 0;
|
||||
|
||||
}
|
||||
|
||||
.title text {
|
||||
font-size: 28rpx;
|
||||
color: #bababa;
|
||||
}
|
||||
|
||||
|
||||
.photo {
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.photo::after {
|
||||
display: block;
|
||||
content: "";
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.photo_all {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.photo_all>view:nth-child(4) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.photo_cont {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
float: left;
|
||||
|
||||
}
|
||||
|
||||
.photo_cont image {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
|
||||
.photo_upload {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 10rpx;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.photo_upload image {
|
||||
width: 72rpx;
|
||||
height: 52rpx;
|
||||
margin: 44rpx 34rpx;
|
||||
}
|
||||
|
||||
.submit {
|
||||
width: 690rpx;
|
||||
height: 80rpx;
|
||||
background-image: linear-gradient(-90deg,
|
||||
#ee7b1e 0%,
|
||||
#fdae03 100%);
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
color: #f0f0f0;
|
||||
position: fixed;
|
||||
bottom: 100rpx;
|
||||
left: 30rpx;
|
||||
|
||||
}
|
||||
|
||||
.aArice{
|
||||
width: 690rpx;
|
||||
padding: 0 30rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
margin: 30rpx 0;
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.aArice text{
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #ee7b1e;
|
||||
}
|
||||
.aArice text text{
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.aArice2{
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #333333;
|
||||
margin-top: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.aArice input{
|
||||
height: 100%;
|
||||
line-height: 100%;
|
||||
border: none;
|
||||
width: 500rpx;
|
||||
}
|
Reference in New Issue
Block a user