Commit 35a65de2 by 李伟康

售后

1 parent bff42f44
...@@ -126,8 +126,25 @@ module.exports = { ...@@ -126,8 +126,25 @@ module.exports = {
//取消付款 //取消付款
cancelPay(orderCode) { cancelPay(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.order.cancelPay',{ return api.fetch('scrm.api.shopmall.weapp.order.cancelPay', {
orderCode orderCode
}) })
}, },
/** 申请售后 */
afterSale(data) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.apply', data)
},
//申请售后待审核的订单取消售后
cancelOrder(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.cancel',{
orderCode
})
},
/** 为售后添加退货快递信息 */
addDelivery(data) {
return api.post({
method: `scrm.api.shopmall.weapp.orderRefund.addDelivery`,
...data
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -46,8 +46,7 @@ Page({ ...@@ -46,8 +46,7 @@ Page({
encoding: 'base64', //编码格式 encoding: 'base64', //编码格式
success(_res) { success(_res) {
wx.p.wxApi.showLoading('上传中...') wx.p.wxApi.showLoading('上传中...')
wx.p.api.common wx.p.api.commonApi.uploadImg({
.uploadImg({
file: `${type}@${_res.data}` file: `${type}@${_res.data}`
}) })
.then(img => { .then(img => {
......
...@@ -51,9 +51,7 @@ Page({ ...@@ -51,9 +51,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getData(orderCode => { this.getOrderRefundDetail(options.orderCode)
this.getOrderRefundDetail(orderCode)
})
}, },
getOrderRefundDetail(orderCode) { getOrderRefundDetail(orderCode) {
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
......
...@@ -81,8 +81,7 @@ Page({ ...@@ -81,8 +81,7 @@ Page({
encoding: 'base64', //编码格式 encoding: 'base64', //编码格式
success(_res) { success(_res) {
wx.p.wxApi.showLoading('上传中...') wx.p.wxApi.showLoading('上传中...')
commonApi wx.p.api.commonApi.uploadImg({
.uploadImg({
file: `${type}@${_res.data}` file: `${type}@${_res.data}`
}) })
.then(img => { .then(img => {
...@@ -113,7 +112,7 @@ Page({ ...@@ -113,7 +112,7 @@ Page({
wx.p.wxApi.showToast('申请成功!') wx.p.wxApi.showToast('申请成功!')
setTimeout(() => { setTimeout(() => {
wx.p.router.back(prevPage => { wx.p.router.back(prevPage => {
prevPage.clearData() prevPage.clearData && prevPage.clearData()
}, 2) }, 2)
}, 1.5 * 1000) }, 1.5 * 1000)
} else { } else {
......
{ {
"navigationBarTitleText": "申请售后" "navigationBarTitleText": "申请售后",
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<block wx:if="{{imgUrls.length < 1}}"> <block wx:if="{{imgUrls.length < 1}}">
<view class="one text-center" bindtap="upLoad"> <view class="one text-center" bindtap="upLoad">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mine/camera.png?v={{img_version}}"></image> <glsx-image webp src="mine/camera.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<image webp src="{{item}}"></image> <image webp src="{{item}}"></image>
<view class="del text-center" catchtap="del" data-index="{{index}}"> <view class="del text-center" catchtap="del" data-index="{{index}}">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mine/del.png?v={{img_version}}"></image> <glsx-image webp src="mine/del.png"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<block wx:if="{{imgUrls.length < 5}}"> <block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="upLoad"> <view class="upload-item item text-center" bindtap="upLoad">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mine/camera.png?v={{img_version}}"></image> <glsx-image webp src="mine/camera.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
......
...@@ -161,6 +161,7 @@ Page({ ...@@ -161,6 +161,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options,'=========')
this.setData({ this.setData({
hasUserInfo: true, hasUserInfo: true,
tabIndex: options.tabIndex, tabIndex: options.tabIndex,
...@@ -451,100 +452,5 @@ Page({ ...@@ -451,100 +452,5 @@ Page({
orderCode, orderCode,
type: 2, type: 2,
}) })
},
/**平台商城跳转 */
async jumpPlatformShop(e) {
let {
item,
url
} = e.currentTarget.dataset
if (item.afterSaleStatus && url == 'afterSaleDetail/index' && item.afterSaleStatus == 8) url = 'applySale/index'
if (url == 'applySale/index') {
const res = await this.getReturnCount(item)
if (!res.applyQty) return wx.p.wxApi.showToast('该商品不支持售后')
item.applyQty = res.applyQty
} }
wx.p.router.go(`/packageMall/pages/platformShop/${url}`, item)
},
/**平台商城取消订单*/
cancelPlatformOrder(e) {
wx.showModal({
title: '温馨提示',
content: '请问您是否要取消付款',
confirmText: '确定',
cancelText: '取消',
confirmColor: '#F13C3D',
}).then(async res => {
if (res.confirm) {
wx.p.wxApi.showLoading()
try {
const {
orderCode
} = e.currentTarget.dataset, {
code,
message
} = await wx.p.api.shopmallApi.cancelPlatformOrder({
subOrderCode: orderCode
})
wx.hideLoading()
if (code == 0) {
wx.p.wxApi.showToast('取消成功')
setTimeout(() => {
this.getOrderList()
}, 1.5e3)
} else throw message
} catch (error) {
wx.p.wxApi.showToast(error)
}
}
})
},
/**平台商城支付 */
toPayOrder(e) {
wx.p.wxApi.showLoading()
const {
orderCode
} = e.currentTarget.dataset
wx.p.api.shopmallApi.platformGoodsPayOrder({
orderCode,
paymentSource: 1
}).then(res => {
wx.hideLoading()
if (res) {
const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = res.payParams
wx.requestPayment({
timeStamp: timeStamp,
nonceStr: nonceStr,
package: packages,
signType: signType,
paySign: paySign,
success() {
wx.p.router.go('/packageMine/pages/order/complete/complete', {
success: true
})
},
fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') {
wx.p.wxApi.showToast('取消支付')
}
}
})
}
})
},
/**获取可申请的售后数量 */
getReturnCount(orderInfo) {
const PARAMS = {
subOrderCode: orderInfo.orderCode,
goodsSkuCode: orderInfo.orderGoods[0].goodsSkuCode
}
return wx.p.api.shopmallApi.platformApplyCount(PARAMS)
},
}) })
\ 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!