You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
247 lines
5.8 KiB
247 lines
5.8 KiB
2 years ago
|
// pages/aftersales/index.js
|
||
2 years ago
|
var app = getApp();
|
||
2 years ago
|
var WXAPI = require('../../utils/server.js');
|
||
2 years ago
|
function initSubMenuDisplay() {
|
||
|
return ['hidden', 'hidden', 'hidden'];
|
||
|
}
|
||
|
Page({
|
||
|
|
||
|
/**
|
||
|
* 页面的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
isStatus: 'whole',
|
||
|
currentTab: 0,
|
||
|
orderList0: [],
|
||
|
orderList1: [],
|
||
|
remind: '加载中',
|
||
|
showModalStatus: false,
|
||
|
address: [],
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad: function (options) {
|
||
|
console.log(options)
|
||
|
this.loadList();
|
||
|
},
|
||
|
//页面加载完成函数 remind: '加载中',
|
||
|
onReady: function () {
|
||
|
var that = this;
|
||
|
that.setData({
|
||
|
remind: ''
|
||
|
});
|
||
|
},
|
||
|
//拒绝提示
|
||
|
jujue: function (e) {
|
||
|
var that = this;
|
||
|
console.log(e);
|
||
|
var id = e.currentTarget.dataset.index;
|
||
|
var orderList0 = that.data.orderList0;
|
||
|
var r_content = orderList0[id].r_content;
|
||
|
|
||
|
wx.showToast({
|
||
|
title: '拒绝理由:'+r_content,
|
||
|
icon:'none',
|
||
|
duration: 4000
|
||
|
});
|
||
|
},
|
||
|
go_kd: function (e) {
|
||
|
var that = this;
|
||
|
console.log(e);
|
||
|
var id = e.currentTarget.dataset.index;
|
||
|
var orderList0 = that.data.orderList0;
|
||
|
var r_content = orderList0[id].r_content;
|
||
|
wx.showToast({
|
||
|
title: r_content,
|
||
|
icon: 'none',
|
||
|
duration: 4000
|
||
|
});
|
||
|
|
||
|
},
|
||
|
kdtj: function (e) {
|
||
|
var that = this;
|
||
|
var kdcode = e.detail.value.kdcode,
|
||
|
kdname = e.detail.value.kdname,
|
||
|
lxdh = e.detail.value.lxdh,
|
||
|
lxr = e.detail.value.lxr,
|
||
|
formId = e.detail.formId;
|
||
|
if (kdcode.length > 8 && kdname.length > 2 && lxdh.length == 11 && lxr.length > 1 ){
|
||
|
console.log('OK');
|
||
|
wx.request({
|
||
|
url: app.d.ceshiUrl + '&action=order&m=back_send',
|
||
|
method: 'post',
|
||
|
data: {
|
||
|
kdcode: kdcode,
|
||
|
kdname : kdname,
|
||
|
lxdh : lxdh,
|
||
|
lxr : lxr,
|
||
|
uid: app.globalData.userInfo.openid,
|
||
|
oid:that.data.id,
|
||
|
},
|
||
|
header: {
|
||
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||
|
},
|
||
|
success: function (res) {
|
||
|
console.log(res)
|
||
|
var status = res.data.status;
|
||
|
if (status){
|
||
|
that.setData({
|
||
|
showModalStatus: false
|
||
|
});
|
||
|
wx.showToast({
|
||
|
title: '提交成功!',
|
||
|
duration: 2000
|
||
|
});
|
||
|
that.loadList();
|
||
|
}else{
|
||
|
wx.showToast({
|
||
|
title: '提交失败!',
|
||
|
icon:'none',
|
||
|
duration: 2000
|
||
|
});
|
||
|
that.setData({
|
||
|
showModalStatus: false
|
||
|
});
|
||
|
}
|
||
|
|
||
|
},
|
||
|
fail: function () {
|
||
|
wx.showToast({
|
||
|
title: '网络异常!',
|
||
|
duration: 2000
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
}else{
|
||
|
wx.showToast({
|
||
|
title: '输入信息有误!',
|
||
|
icon: 'none',
|
||
|
duration: 2000
|
||
|
});
|
||
|
}
|
||
|
|
||
|
},
|
||
|
bindPickerChange: function (e) {
|
||
|
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||
|
this.setData({
|
||
|
index: e.detail.value
|
||
|
})
|
||
|
},
|
||
|
loadList: function(){
|
||
|
var that = this;
|
||
2 years ago
|
WXAPI.returnDataList({
|
||
|
accessId: app.globalData.accessId,
|
||
|
storeId: 239,
|
||
|
storeType: 1,
|
||
|
limit: 0
|
||
|
}).then(res => {
|
||
|
if (res.code == 200) {
|
||
|
var data = res.data
|
||
2 years ago
|
switch (that.data.currentTab) {
|
||
|
case 0:
|
||
|
that.setData({
|
||
2 years ago
|
orderList0: data.list,
|
||
2 years ago
|
});
|
||
|
break;
|
||
|
case 1:
|
||
|
that.setData({
|
||
2 years ago
|
orderList1: data.list,
|
||
2 years ago
|
});
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
2 years ago
|
})
|
||
2 years ago
|
},
|
||
|
bindChange: function (e) {
|
||
|
var that = this;
|
||
|
that.setData({ currentTab: e.detail.current });
|
||
|
},
|
||
|
swichNav: function (e) {
|
||
|
var that = this;
|
||
|
if (that.data.currentTab === e.target.dataset.current) {
|
||
|
return false;
|
||
|
} else {
|
||
|
var current = e.target.dataset.current;
|
||
|
that.setData({
|
||
|
currentTab: parseInt(current),
|
||
|
isStatus: e.target.dataset.otype,
|
||
|
});
|
||
|
that.loadList();
|
||
|
};
|
||
|
},
|
||
|
// 弹窗
|
||
|
setModalStatus: function (e) {
|
||
|
var that = this;
|
||
|
wx.request({
|
||
|
url: app.d.ceshiUrl + '&action=order&m=see_send',
|
||
|
method: 'post',
|
||
|
data: {},
|
||
|
header: {
|
||
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||
|
},
|
||
|
success: function (res) {
|
||
|
var status = res.data.status;
|
||
|
if (status){
|
||
|
var express = res.data.express;
|
||
|
var exp = [];
|
||
|
var j = 0;
|
||
|
for (j = 0; j < express.length; j++) {
|
||
|
exp[j] = express[j].kuaidi_name;
|
||
|
}
|
||
|
//返回退回信息
|
||
|
that.setData({
|
||
|
address: res.data.address,
|
||
|
name: res.data.name,
|
||
|
phone: res.data.phone,
|
||
|
express: express,
|
||
|
exp: exp,
|
||
|
});
|
||
|
|
||
|
}else{
|
||
|
wx.showToast({
|
||
|
title: '获取错误!',
|
||
|
duration: 2000
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
fail: function () {
|
||
|
wx.showToast({
|
||
|
title: '网络异常!',
|
||
|
duration: 2000
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
var id = e.currentTarget.dataset.id;
|
||
|
var animation = wx.createAnimation({
|
||
|
duration: 200,
|
||
|
timingFunction: "linear",
|
||
|
delay: 0
|
||
|
});
|
||
|
//定义点击的类型
|
||
|
this.animation = animation
|
||
|
animation.translateY(300).step();
|
||
|
this.setData({
|
||
|
animationData: animation.export(),
|
||
|
id: id
|
||
|
})
|
||
|
if (e.currentTarget.dataset.status == 1) {
|
||
|
this.setData({
|
||
|
showModalStatus: true
|
||
|
});
|
||
|
}
|
||
|
setTimeout(function () {
|
||
|
animation.translateY(0).step()
|
||
|
this.setData({
|
||
|
animationData: animation
|
||
|
})
|
||
|
if (e.currentTarget.dataset.status == 0) {
|
||
|
this.setData({
|
||
|
showModalStatus: false
|
||
|
});
|
||
|
}
|
||
|
}.bind(this), 200);
|
||
|
},
|
||
|
})
|