Commit c9d893e9 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 9b0e9cc3 c5aa9070
// component/applyRefund/applyRefund.js
const app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
Component({
/**
* 组件的属性列表
......@@ -7,6 +13,10 @@ Component({
show: { // 显示标识
type: Boolean,
value: false
},
refundId : {
type: String,
value: ''
}
},
......@@ -14,7 +24,16 @@ Component({
* 组件的初始数据
*/
data: {
isSelect: false
isSelect: false,
reasonList : [],
reasonIndex : '',
code : ''
},
lifetimes:{
ready(){
this.getLogisticCompanyList();
}
},
/**
......@@ -31,9 +50,84 @@ Component({
show: false
})
},
//选择改变
bindSelectRefundReason(event){
this.setData({
reasonIndex: event.detail.value
})
},
//inpuChange
inpuChange(e){
this.setData({
code : e.detail.value
});
},
//确认发货
onTabSure(){
let param = {};
param.refundId = this.data.refundId;
let company = this.data.reasonList[this.data.reasonIndex];
if(!company){
wx.showToast({
title: '请选择物流公司',
icon: 'none'
});
},
return;
}
if (!this.data.code){
wx.showToast({
title: '请输入物流单号',
icon : 'none'
})
return ;
}
param.refundLogistic = {
"code": this.data.code,
"supplierCode": company.companyCode,
"supplierName": company.company,
};
wx.showLoading({
title: '请求中',
});
wxService.post(`/sale/refund/buyer/deliver`, param).then(res => {
const { result, data } = res.data
if (result == 0) {
wx.showToast({
title: `发货成功`,
icon: 'none'
});
this.setData({
show : false,
code : '',
reasonIndex : '',
});
this.triggerEvent('ok', true)
}
}).finally(() => {
wx.hideLoading()
})
},
//获取物流公司信息
getLogisticCompanyList(){
wxService.get(`/sale/logistics/findLogisticsCompanyList`).then(res => {
if (!res) return false
const { result, data } = res.data
if (result == 0) {
this.setData({
reasonList: data
})
}
}).finally(() => {
})
},
},
})
......@@ -4,22 +4,21 @@
<view class="modal-header">
<image class="modal-close" mode="widthFix" src="/assets/imgs/7_1_0/close.png" bindtap="hidePopup"></image>
</view>
<view class="modal-info">
<view class="modal-logistics">
<view>
<picker bindchange="bindSelectRefundReason" value="{{reasonIndex}}" range="{{reasonList}}" range-key="name" class="modal-picker">
<picker bindchange="bindSelectRefundReason" value="{{reasonIndex}}" range="{{reasonList}}" range-key="company" class="modal-picker">
<view class="picker">
当前选择:{{reasonList[reasonIndex].name}}
当前选择:{{reasonList[reasonIndex].company}}
</view>
</picker>
</view>
<view class="modal-logis-number">
<input placeholder-class="modal-placeholder" class="modal-input" placeholder="填写物流单号"></input>
<input placeholder-class="modal-placeholder" value="{{code}}" bindinput='inpuChange' class="modal-input" placeholder="填写物流单号"></input>
</view>
</view>
<view class="modal-confirm-btn">
<button class="btn btn-primary btn-lg">确认</button>
<button class="btn btn-primary btn-lg" bindtap='onTabSure'>确认</button>
</view>
</view>
</view>
......@@ -47,7 +47,8 @@ wxService.page({
subImgs: [],
status: '', // 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
no_data: true,
currentTradeId: ''
currentTradeId: '',
refundId : ''
},
/**
......@@ -345,11 +346,16 @@ wxService.page({
// },
//发货之后回调
onDeliveryOk(){
this.getRefundList(1,5);
},
//填写物流信息
tapWriteLogis() {
console.log('222')
tapWriteLogis(e) {
let refundId = e.currentTarget.dataset.id;
this.setData({
showApplyRefundModal: true
showApplyRefundModal: true,
refundId: refundId
})
},
/**
......
......@@ -172,7 +172,7 @@
当前无数据
</view>
</view>
<apply-refund show="{{showApplyRefundModal}}" />
<apply-refund show="{{showApplyRefundModal}}" refundId="{{refundId}}" bind:ok="onDeliveryOk"/>
<!--goHome-->
<go-home/>
......@@ -12,7 +12,8 @@ wxService.page({
data: {
showApplyRefundModal: false,
id: '',
refundDetail: null
refundDetail: null,
refundId : null
},
/**
......@@ -58,6 +59,10 @@ wxService.page({
}
})
},
//填写物流信息之后回调
onDeliveryOk(){
this.getRfDetail(this.data.id);
},
getRfDetail(id) {
wx.showLoading({
title: '加载中',
......@@ -92,7 +97,8 @@ wxService.page({
tapWriteLogis() {
console.log('222')
this.setData({
showApplyRefundModal: true
showApplyRefundModal: true,
refundId : this.data.id
})
}
})
\ No newline at end of file
......@@ -31,13 +31,13 @@
<view class="logistics-info">
<view class="logistics-item">
<text>物流公司</text>
<text class="company">{{refundDetail.refundLogistic.supplierCode}}</text>
<text class="company">{{refundDetail.refundLogistic.supplierName}}</text>
</view>
<view class="logistics-item">
<text>快递单号</text>
<text class="company">{{refundDetail.refundLogistic.code}}</text>
</view>
<view class="write-logistics" bindtap="tapWriteLogis">
<view class="write-logistics" bindtap="tapWriteLogis" wx:if="{{refundDetail.status == 'A'}}">
<button class="btn btn-primary btn-outline write-btn">填写物流信息</button>
</view>
</view>
......@@ -117,7 +117,7 @@
</view>
</view>
<apply-refund show="{{showApplyRefundModal}}" />
<apply-refund show="{{showApplyRefundModal}}" refundId="{{refundId}}" bind:ok="onDeliveryOk"/>
<!--goHome-->
<go-home/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment