1808 lines
54 KiB
JavaScript
1808 lines
54 KiB
JavaScript
// pages/orderdetail/orderdetail.js
|
||
var app = getApp();
|
||
Page({
|
||
/**
|
||
* 页面的初始数据
|
||
*/
|
||
data: {
|
||
language: "",
|
||
regional: "请选择快递公司",
|
||
dateshow_1: false,
|
||
orderType: "",
|
||
order_id: "",
|
||
options: [],
|
||
columns: [],
|
||
addresseeInfo: "",
|
||
address: "",
|
||
mobile: "",
|
||
receiver: "",
|
||
order_data: "",
|
||
order_pay_id: "",
|
||
dispatch_type_id: "",
|
||
pay_type_id: "",
|
||
hotel_start: "",
|
||
hotel_end: "",
|
||
night_day: "",
|
||
hotel_name: "",
|
||
//确认发货
|
||
dialogVisible: false,
|
||
expressName: "",
|
||
numberName: "",
|
||
package_deliver: {},
|
||
showQrcode: false,
|
||
qrcode_url: "",
|
||
showDiyForm: false,
|
||
diyform: {},
|
||
jurisdiction_set: 0,
|
||
showID: "",
|
||
|
||
showBarter: false,
|
||
showBarter_value: null,
|
||
orderPayId: null,
|
||
//消费红包
|
||
showPacket: false,
|
||
shrinkPacket: false,
|
||
timer: null,
|
||
hasPacket: false,
|
||
|
||
showKefu: false,
|
||
|
||
// 话费慢充
|
||
phone_bill: {},
|
||
|
||
customForm: [],
|
||
refundShow: false, //退款原因
|
||
refundText: "",
|
||
|
||
integral: "积分",
|
||
|
||
custom_receipt_confirmation_html:"",
|
||
custom_receipt_confirmation_show:false, //自定义确认收货弹窗
|
||
custom_receipt_confirmation_btn:{}, //自定义确认收货弹窗按钮
|
||
custom_receipt_confirmation_item:{},//自定义确认收货弹窗item
|
||
|
||
electricity_bill_pro:{},
|
||
|
||
oil_recharge:{}, //油卡充值
|
||
aggregation_cps_recharge_bill:false,
|
||
//S 申请存货弹窗
|
||
inventoryApplyPopup: false, //存货申请弹窗
|
||
inventoryApplyList: [], //仓库列表
|
||
inventoryApplyRadio: null
|
||
//E 申请存货弹窗
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面加载
|
||
*/
|
||
onLoad: function (options) {
|
||
console.log("options:::::", options);
|
||
// 页面传参
|
||
if (options.scene) {
|
||
console.log("option.scene:::::", options.scene);
|
||
console.log(decodeURIComponent(options.scene));
|
||
let scene = decodeURIComponent(options.scene);
|
||
if (scene) {
|
||
var info_arr = [];
|
||
info_arr = scene.split("&");
|
||
for (let i = 0; i < info_arr.length; i++) {
|
||
let chil_arr = [];
|
||
chil_arr = info_arr[i].split("=");
|
||
console.log(chil_arr);
|
||
// 这是自提点
|
||
if (chil_arr[0] == "orderType") {
|
||
this.setData({
|
||
orderType: chil_arr[1],
|
||
});
|
||
} else {
|
||
// 这是门店
|
||
this.setData({
|
||
orderType: "store",
|
||
});
|
||
}
|
||
if (chil_arr[0] == "id") {
|
||
this.setData({
|
||
order_id: chil_arr[1],
|
||
});
|
||
} else if (chil_arr[0] == "mid") {
|
||
app._setMid(chil_arr[1]);
|
||
} else if (chil_arr[0] == "is_clerk") {
|
||
this.setData({
|
||
is_clerk: chil_arr[1],
|
||
});
|
||
} else {
|
||
console.log("error:: 核销员进入错误");
|
||
wx.hideLoading();
|
||
}
|
||
}
|
||
console.log(this.data.order_id);
|
||
}
|
||
} else {
|
||
if (options.order_id) {
|
||
this.setData({
|
||
order_id: options.order_id,
|
||
});
|
||
}
|
||
if(options.debt_shop_member_type){
|
||
this.setData({
|
||
debt_shop_member_type:options.debt_shop_member_type
|
||
})
|
||
}
|
||
if (options.orderType && options.orderType == "groups") {
|
||
this.setData({
|
||
orderType: "groups",
|
||
});
|
||
} else if (options.orderType) {
|
||
this.setData({
|
||
orderType: options.orderType,
|
||
});
|
||
} else {
|
||
this.setData({
|
||
orderType: "shop",
|
||
});
|
||
}
|
||
}
|
||
if (options.order_id) {
|
||
this.setData({
|
||
order_id: options.order_id,
|
||
});
|
||
}
|
||
let yz_basic_info = wx.getStorageSync('yz_basic_info');
|
||
this.setData({
|
||
showDiyForm: false,
|
||
vip_show:yz_basic_info.globalParameter.vip_show?yz_basic_info.globalParameter.vip_show:false
|
||
});
|
||
},
|
||
/**
|
||
* 生命周期函数--监听页面初次渲染完成
|
||
*/
|
||
onReady: function () {
|
||
let language = wx.getStorageSync("langIndex");
|
||
this.setData({ language: language.en });
|
||
const value = wx.getStorageSync("integral");
|
||
if (value) {
|
||
this.setData({
|
||
integral: value,
|
||
});
|
||
}
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面显示
|
||
*/
|
||
onShow: function () {
|
||
this.getNetData();
|
||
this.setData({
|
||
showPacket: false,
|
||
shrinkPacket: false,
|
||
timer: null,
|
||
hasPacket: false,
|
||
});
|
||
let basicinfo = wx.getStorageSync("yz_basic_info");
|
||
if (basicinfo && basicinfo.globalParameter.consume_red_packet_status == 1) {
|
||
this.checkoutConsumePacket();
|
||
}
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面隐藏
|
||
*/
|
||
onHide: function () {},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面卸载
|
||
*/
|
||
onUnload: function () {},
|
||
|
||
/**
|
||
* 页面相关事件处理函数--监听用户下拉动作
|
||
*/
|
||
onPullDownRefresh: function () {},
|
||
|
||
/**
|
||
* 页面上拉触底事件的处理函数
|
||
*/
|
||
onReachBottom: function () {},
|
||
|
||
/**
|
||
* 用户点击右上角分享
|
||
*/
|
||
onShareAppMessage: function () {},
|
||
|
||
callPhone() {
|
||
wx.makePhoneCall({
|
||
phoneNumber: this.data.service_mobile,
|
||
});
|
||
},
|
||
phoneClick({target:{dataset:{phone}}}){
|
||
wx.makePhoneCall({
|
||
phoneNumber:phone,
|
||
success(){},
|
||
fail(){}
|
||
})
|
||
},
|
||
copyMsg({target:{dataset:{msg}}}){
|
||
console.log(msg);
|
||
wx.setClipboardData({
|
||
data: msg,
|
||
success: function (res) {
|
||
wx.showToast({
|
||
title: '复制成功',
|
||
icon: 'success',
|
||
duration: 2000
|
||
});
|
||
},
|
||
fail(){
|
||
wx.showToast({
|
||
title: '复制失败',
|
||
icon: 'error',
|
||
duration: 2000
|
||
})
|
||
}
|
||
})
|
||
},
|
||
closePop() {
|
||
this.setData({
|
||
showKefu: false,
|
||
});
|
||
},
|
||
showMore(e) {
|
||
let order_sn = e.currentTarget.dataset.order.order_sn;
|
||
if (this.data.showID == order_sn) {
|
||
this.setData({
|
||
showID: "",
|
||
});
|
||
} else {
|
||
this.setData({
|
||
showID: order_sn,
|
||
});
|
||
}
|
||
},
|
||
startRotate() {
|
||
if (this.data.timer) {
|
||
clearInterval(this.data.timer);
|
||
}
|
||
this.data.timer = setInterval(() => {
|
||
this.setData({
|
||
shrinkPacket: !this.data.shrinkPacket,
|
||
});
|
||
}, 150);
|
||
},
|
||
onClickShow() {
|
||
this.setData({
|
||
showPacket: true,
|
||
});
|
||
},
|
||
onClickHide() {
|
||
this.setData({
|
||
showPacket: false,
|
||
});
|
||
},
|
||
toPacket() {
|
||
wx.navigateTo({
|
||
url: "/packageE/ConsumePacket/ConsumePacketSuccess/ConsumePacketSuccess?order_id=" + this.data.order_id.toString(),
|
||
});
|
||
},
|
||
// 消费红包
|
||
checkoutConsumePacket() {
|
||
let urlStr = app.getNetAddresss("plugin.consume-red-packet.Frontend.Modules.Packet.Controllers.has.index");
|
||
app._postNetWork({
|
||
url: urlStr,
|
||
data: {
|
||
order_id: this.data.order_id.toString().split(","),
|
||
},
|
||
success: (resdata) => {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
this.setData({
|
||
hasPacket: true,
|
||
});
|
||
this.startRotate();
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
|
||
// 获取客服
|
||
getKefu() {
|
||
let goods_id = "";
|
||
|
||
if (this.data.order_data.has_many_order_goods.length > 0) {
|
||
goods_id = this.data.order_data.has_many_order_goods[0].goods_id;
|
||
}
|
||
let urlStr = app.getNetAddresss("goods.customer-service.index");
|
||
app._postNetWork({
|
||
url: urlStr,
|
||
data: {
|
||
goods_id: goods_id,
|
||
},
|
||
success: (resdata) => {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
this.setData({
|
||
customer_open:res.data.customer_open == 0?false:true,
|
||
showKefu: true,
|
||
cservice: res.data.cservice,
|
||
service_QRcode: res.data.service_QRcode,
|
||
service_mobile: res.data.service_mobile,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
|
||
showDiy(e) {
|
||
if (e.currentTarget.dataset.from) {
|
||
for (let i = 0; i <= e.currentTarget.dataset.from.length - 1; i++) {
|
||
if (e.currentTarget.dataset.from[i].type == "diyriqi") {
|
||
e.currentTarget.dataset.from[i].content = this.timestampToTime(parseInt(e.currentTarget.dataset.from[i].content) * 1000);
|
||
}
|
||
}
|
||
this.setData({
|
||
showDiyForm: true,
|
||
diyform: e.currentTarget.dataset.from,
|
||
});
|
||
}
|
||
},
|
||
timestampToTime(timestamp) {
|
||
var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
||
let Y = date.getFullYear() + "-";
|
||
let M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
|
||
let D = this.change(date.getDate()) + " ";
|
||
let h = this.change(date.getHours()) + ":";
|
||
let m = this.change(date.getMinutes()) + ":";
|
||
let s = this.change(date.getSeconds());
|
||
return Y + M + D + h + m + s;
|
||
},
|
||
change(t) {
|
||
if (t < 10) {
|
||
return "0" + t;
|
||
} else {
|
||
return t;
|
||
}
|
||
},
|
||
onDiyFormClose() {
|
||
this.setData({
|
||
showDiyForm: false,
|
||
});
|
||
},
|
||
//获取快递公司
|
||
getCompany() {
|
||
let that = this;
|
||
let urlStr = "";
|
||
if (this.data.orderType == "supplier") {
|
||
urlStr += app.getNetAddresss("plugin.supplier.frontend.order.express-company");
|
||
} else if (this.data.orderType == "subsidiary") {
|
||
urlStr += app.getNetAddresss("plugin.subsidiary.frontend.order.express-company");
|
||
} else if (this.data.orderType == "storeMang") {
|
||
urlStr += app.getNetAddresss("plugin.shop-assistant.frontend.order.expressCompanies");
|
||
} else {
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.store.center.sendOrder");
|
||
}
|
||
urlStr += "&order_id=" + that.data.order_id;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.setData({
|
||
options: res.data.express_companies ? res.data.express_companies : [],
|
||
});
|
||
var arrayOfSquares = that.data.options.map(function (item) {
|
||
return item.name;
|
||
});
|
||
if (!app._isTextEmpty(res.data.jurisdiction_set)) {
|
||
that.setData({
|
||
jurisdiction_set: res.data.jurisdiction_set,
|
||
});
|
||
}
|
||
that.setData({
|
||
columns: arrayOfSquares,
|
||
addresseeInfo: res.data.address,
|
||
address: res.data.address.address,
|
||
mobile: res.data.address.mobile,
|
||
receiver: res.data.address.realname,
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1500,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
getNetData() {
|
||
let that = this;
|
||
let urlStr = "";
|
||
if (this.data.orderType == "cashier") {
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.Order.detail");
|
||
} else if (this.data.orderType == "store") {
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.store.order-detail");
|
||
} else if (this.data.orderType == "supplier") {
|
||
urlStr += app.getNetAddresss("plugin.supplier.frontend.order.detail");
|
||
} else if (this.data.orderType == "subsidiary") {
|
||
urlStr += app.getNetAddresss("plugin.subsidiary.frontend.order.detail");
|
||
} else if (this.data.orderType == "hotel") {
|
||
urlStr += app.getNetAddresss("plugin.hotel.frontend.hotel.detail");
|
||
} else if (this.data.orderType == "hotel_center") {
|
||
urlStr += app.getNetAddresss("plugin.hotel.frontend.hotel.center.order-detail");
|
||
} else if (this.data.orderType == "hotelcashier") {
|
||
urlStr += app.getNetAddresss("plugin.hotel.frontend.Order.detail");
|
||
} else if (this.data.orderType == "lease_toy") {
|
||
urlStr += app.getNetAddresss("plugin.lease-toy.api.order.order-detail.index");
|
||
} else if (this.data.orderType == "verifier") {
|
||
urlStr += app.getNetAddresss("plugin.package-deliver.frontend.clerk-order-detail.index"); //自提点核销员
|
||
} else if (this.data.orderType == "pdy") {
|
||
urlStr += app.getNetAddresss("plugin.package-delivery.frontend.detail.index"); //商城自提点核销员
|
||
} else if (this.data.orderType == "commission_activity") {
|
||
urlStr += app.getNetAddresss("plugin.commission-activity.api.activity-inquire.order-detail");
|
||
} else if (this.data.orderType == "groups") {
|
||
urlStr += app.getNetAddresss("plugin.fight-groups.frontend.controllers.detail.index");
|
||
} else if (this.data.orderType == "groupsBuy") {
|
||
urlStr += app.getNetAddresss("plugin.together-purchase.api.index.getTogetherData");
|
||
urlStr += "&art=orderDetail";
|
||
} else if (this.data.orderType == "grabGroup") {
|
||
urlStr += app.getNetAddresss("plugin.snatch-regiment.api.index.getSnatchData");
|
||
urlStr += "&art=orderDetail";
|
||
} else if (this.data.orderType == "pickup_card") {
|
||
urlStr += app.getNetAddresss("plugin.picking-card.frontend.detail");
|
||
} else if (this.data.orderType == "picking-card-one") {
|
||
urlStr += app.getNetAddresss("plugin.picking-card-one.frontend.detail");
|
||
} else if (this.data.orderType == "community_buying") {
|
||
urlStr += app.getNetAddresss("plugin.package-deliver.frontend.order.detail.index");
|
||
} else if(this.data.orderType == "luck-draw"){
|
||
urlStr += app.getNetAddresss("plugin.luck-draw.frontend.index.myPrizeDetail");
|
||
} else if(this.data.orderType == "newRetail"){
|
||
urlStr += app.getNetAddresss("plugin.new-retail.frontend.orderData.detail");
|
||
} else if(this.data.orderType == "zhpGroup"){
|
||
urlStr += app.getNetAddresss("plugin.zhp-group-lottery.frontend.detail.index");
|
||
} else if(this.data.orderType == "storeMang"){
|
||
urlStr += app.getNetAddresss("plugin.shop-assistant.frontend.order.order-detail");
|
||
} else if (this.data.orderType == "warehouseTakeDelivery") {
|
||
urlStr += app.getNetAddresss("plugin.warehouse.frontend.controllers.takeDelivery.order-detail");
|
||
} else if (this.data.orderType == "warehousePurchasing") {
|
||
urlStr += app.getNetAddresss("plugin.warehouse.frontend.controllers.purchasing.order-detail");
|
||
} else if(this.data.orderType == "reserve_simple"){
|
||
urlStr += app.getNetAddresss("plugin.reserve-simple.frontend.reserve-order.get-detail");
|
||
} else if (this.data.orderType == "ysSystem") {
|
||
urlStr += app.getNetAddresss("plugin.ys-system.frontend.history-order.ys-detail");
|
||
} else if (this.data.orderType == "debt"){
|
||
urlStr += app.getNetAddresss("plugin.debt-shop.frontend.order-detail.index");
|
||
urlStr += "&order_id=" + that.data.order_id;
|
||
urlStr += "&member_type=" + that.data.debt_shop_member_type;
|
||
} else {
|
||
urlStr += app.getNetAddresss("order.detail");
|
||
}
|
||
if (this.data.is_clerk) {
|
||
urlStr += "&order_id=" + that.data.order_id;
|
||
urlStr += "&is_clerk=" + that.data.is_clerk;
|
||
} else if (this.data.orderType == "commission_activity") {
|
||
urlStr += "&activity_id=" + that.data.order_id;
|
||
} else {
|
||
urlStr += "&order_id=" + that.data.order_id;
|
||
}
|
||
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
let myData = {};
|
||
let form = [];
|
||
if (that.data.orderType == "groupsBuy" || that.data.orderType == "grabGroup") {
|
||
myData = res.data.orderDetail;
|
||
} else {
|
||
myData = res.data;
|
||
}
|
||
if (myData.custom && that.data.is_clerk == 1) {
|
||
form = myData.custom.form;
|
||
}
|
||
if(myData.reserve_date){
|
||
that.setData({
|
||
reserveDate:myData.reserve_date
|
||
});
|
||
}
|
||
|
||
that.setData({
|
||
order_data: myData,
|
||
order_pay_id: myData.order_pay_id,
|
||
dispatch_type_id: myData.dispatch_type_id,
|
||
customForm: form,
|
||
custom_receipt_confirmation_html:myData.receipt_goods_notice
|
||
});
|
||
if(myData.aggregation_cps_recharge_bill && !app._isTextEmpty(myData.aggregation_cps_recharge_bill.recharge_number)){
|
||
that.setData({
|
||
aggregation_cps_recharge_bill:myData.aggregation_cps_recharge_bill.recharge_number
|
||
})
|
||
}
|
||
if(that.data.orderType == "zhpGroup"){
|
||
for(let i = 0 ;i<myData.button_models.length;i++){
|
||
if(myData.button_models[i].api == 'refund.apply.store'){
|
||
myData.button_models.splice(i,1);
|
||
}
|
||
}
|
||
console.log(myData);
|
||
that.setData({
|
||
order_data: myData,
|
||
});
|
||
}
|
||
// 话费慢充
|
||
if (myData.phone_bill) {
|
||
that.setData({
|
||
phone_bill: myData.phone_bill,
|
||
});
|
||
}
|
||
// 话费慢充pro
|
||
if (myData.phone_bill_pro) {
|
||
that.setData({
|
||
phone_bill: myData.phone_bill_pro,
|
||
});
|
||
}
|
||
// 电费充值
|
||
if (myData.electricity_bill_pro) {
|
||
that.setData({
|
||
electricity_bill_pro: myData.electricity_bill_pro,
|
||
});
|
||
}
|
||
if(myData.oil_recharge){
|
||
that.setData({
|
||
oil_recharge:myData.oil_recharge
|
||
});
|
||
}
|
||
if (myData.address_info && !myData.address_info.address) {
|
||
that.setData({
|
||
address: myData.address_info.store_address,
|
||
mobile: myData.address_info.member_mobile,
|
||
receiver: myData.address_info.member_realname,
|
||
});
|
||
} else if (myData.address_info) {
|
||
that.setData({
|
||
address: myData.address_info.address,
|
||
mobile: myData.address_info.mobile,
|
||
receiver: myData.address_info.realname,
|
||
});
|
||
} else if (myData.address) {
|
||
that.setData({
|
||
address: myData.address.address,
|
||
mobile: myData.address.mobile,
|
||
receiver: myData.address.realname,
|
||
});
|
||
}
|
||
that.setData({
|
||
pay_type_id: myData.pay_type_id,
|
||
});
|
||
if (that.data.orderType == "hotel") {
|
||
that.setData({
|
||
hotel_start: res.data.hotel_order.enter_at.split(" ")[0],
|
||
});
|
||
that.setData({
|
||
hotel_end: res.data.hotel_order.leave_at.split(" ")[0],
|
||
});
|
||
that.setData({
|
||
hotel_name: res.data.hotel_order.has_one_hotel.hotel_name,
|
||
});
|
||
that.getDays(that.data.hotel_start, that.data.hotel_end);
|
||
}
|
||
if (myData.dispatch_type_id == 8) {
|
||
that.setData({
|
||
package_deliver: myData.package_deliver,
|
||
});
|
||
}else if(myData.dispatch_type_id == 15){
|
||
that.setData({
|
||
package_deliver: myData.package_delivery,
|
||
});
|
||
}
|
||
} else {
|
||
wx.showToast({
|
||
title: res.msg,
|
||
icon: "none",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
//时间日期
|
||
getDays(strDateStart, strDateEnd) {
|
||
let strSeparator = "-"; //日期分隔符
|
||
let oDate1, oDate2, iDays;
|
||
oDate1 = strDateStart.split(strSeparator);
|
||
oDate2 = strDateEnd.split(strSeparator);
|
||
let strDateS = new Date(oDate1[0], oDate1[1] - 1, oDate1[2]);
|
||
let strDateE = new Date(oDate2[0], oDate2[1] - 1, oDate2[2]);
|
||
iDays = parseInt(Math.abs(strDateS - strDateE) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数
|
||
this.setData({
|
||
night_day: iDays,
|
||
});
|
||
},
|
||
getCpsDetail(goods){
|
||
let urlStr = app.getNetAddresss("plugin.aggregation-cps.api.web.getGoodsUrl");
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
data:{
|
||
goods_id:goods.goods_id
|
||
},
|
||
success: function(resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
wx.navigateTo({
|
||
url: res.data.another_mini_route,
|
||
icon:'none',
|
||
duration:1000
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: 'none',
|
||
title: res.msg,
|
||
duration: 1500
|
||
});
|
||
}
|
||
},
|
||
fail: function(res) {
|
||
console.log(res);
|
||
}
|
||
});
|
||
},
|
||
//跳转商品详情页面
|
||
toGoodsDetail(e) {
|
||
let goods = e.currentTarget.dataset.good;
|
||
// let isshow = e.currentTarget.dataset.isvirtual;
|
||
// let showCourse = e.currentTarget.dataset.iscourse;
|
||
if(this.data.order_data.plugin_id == '107'){
|
||
//盲盒商品不能跳转
|
||
return;
|
||
}
|
||
if(this.data.order_data.plugin_id == '150' || this.data.order_data.plugin_id == '31'){
|
||
//盲盒商品不能跳转
|
||
return;
|
||
}
|
||
if(this.data.order_data.plugin_id == '71'){
|
||
this.getCpsDetail(goods);
|
||
return;
|
||
}
|
||
if(this.data.order_data.deposit_ladder && this.data.order_data.deposit_ladder.activity_id || this.data.order_data.deposit_ladder_dj && this.data.order_data.deposit_ladder_dj.activity_id){
|
||
let activity_id = this.data.order_data.deposit_ladder && this.data.order_data.deposit_ladder.activity_id ? this.data.order_data.deposit_ladder.activity_id : this.data.order_data.deposit_ladder_dj.activity_id;
|
||
//尾款商品跳转详情
|
||
wx.navigateTo({
|
||
url: "/packageH/deposit_group/activity_index/activity_index?id=" + activity_id,
|
||
});
|
||
return;
|
||
}
|
||
if (this.data.order_data.plugin_id == 54) {
|
||
let store_id = null;
|
||
if (goods.store_id && goods.store_id != 0 && goods.store_id != "undefined") {
|
||
store_id = "/" + goods.store_id;
|
||
}
|
||
|
||
wx.navigateTo({
|
||
url: "/packageA/detail_v2/detail_v2?id=0" + store_id + "&name=group&fight_groups=" + goods.goods_id,
|
||
});
|
||
} else {
|
||
wx.navigateTo({
|
||
url: "/packageA/detail_v2/detail_v2?id=" + goods.goods_id,
|
||
});
|
||
}
|
||
|
||
// 下面的不知道这么判断干嘛 先注释
|
||
// if (isshow == 0) {
|
||
// if (showCourse == 1) {
|
||
// wx.navigateTo({
|
||
// url: "/packageA/member/course/CourseDetail/CourseDetail?goods_id=" + goods.goods_id,
|
||
// });
|
||
// } else if (showCourse == 0) {
|
||
// if (this.data.order_data.plugin_id == 32) {
|
||
// wx.navigateTo({
|
||
// url: "/packageA/detail_v2/detail_v2?id=" + goods.goods_id + "&tag=o2o&store_id=" + goods.store_id,
|
||
// });
|
||
// } else if (this.data.order_data.plugin_id == 54) {
|
||
// let store_id = null;
|
||
// if (goods.store_id && goods.store_id != 0 && goods.store_id != "undefined") {
|
||
// store_id = "/" + goods.store_id;
|
||
// }
|
||
|
||
// wx.navigateTo({
|
||
// url: "/packageA/detail_v2/detail_v2?id=0" + store_id + "&name=group&fight_groups=" + goods.goods_id,
|
||
// });
|
||
// } else {
|
||
// wx.navigateTo({
|
||
// url: "/packageA/detail_v2/detail_v2?id=" + goods.goods_id,
|
||
// });
|
||
// }
|
||
// } else {
|
||
// return;
|
||
// }
|
||
// }
|
||
},
|
||
//根据按钮值判断用途
|
||
operation(e) {
|
||
let btn = e.currentTarget.dataset.item;
|
||
let order = e.currentTarget.dataset.orderdata;
|
||
this.setData({
|
||
orderPayId: order.id,
|
||
});
|
||
if (btn.value == 8) {
|
||
this.checklogistics(order, btn);
|
||
} else if (btn.value == 12) {
|
||
this.deleteOrder(order, btn);
|
||
} else if (btn.value == 10) {
|
||
this.comment(order, btn);
|
||
} else if (btn.value == 1 || btn.value == "snatch_regiment_pay") {
|
||
this.toPay(order, btn);
|
||
} else if (btn.value == 13 || btn.value == "snatch_regiment_refund" || btn.value == '54') {
|
||
//退款
|
||
this.getTemplate(order, btn);
|
||
} else if (btn.value == 9) {
|
||
//取消订单
|
||
this.cancleOrder(order, btn);
|
||
} else if (btn.value == 5) {
|
||
//确认订单
|
||
this.confirmOrder(order, btn);
|
||
} else if (btn.value == 18) {
|
||
//退款中
|
||
this.toRefundDetail(order, btn);
|
||
} else if (btn.value == "cashierPay") {
|
||
//订单已付款
|
||
this.cashPayOrder(order, btn);
|
||
} else if (btn.value == "verification_code") {
|
||
//验证核销
|
||
this.verification(order, btn);
|
||
} else if (btn.value == 20) {
|
||
console.log("现金支付");
|
||
//现金付款
|
||
this.verificationCash(order, btn);
|
||
} else if (btn.value == 3) {
|
||
this.gotoRefund(order.id);
|
||
} else if (btn.value == 40) {
|
||
this.gotoRefundCheck(order.id);
|
||
} else if (btn.value == 4) {
|
||
this.gotoMakeSure(order.id);
|
||
} else if (btn.value == 21) {
|
||
this.shopRecord();
|
||
} else if (btn.value == 22) {
|
||
// 确认支付
|
||
this.payMoney(order, btn);
|
||
} else if (btn.value == 101) {
|
||
let _url = "/packageE/pickUpCard/pickUpCardReimburse/pickUpCardReimburse?orderid=" + order.id;
|
||
if(this.data.orderType == "picking-card-one") _url = _url + '?plugin=one';
|
||
wx.navigateTo({
|
||
url: _url
|
||
});
|
||
} else if (btn.value == 23 || btn.value == 60) {
|
||
// 确认发货
|
||
if (order.dispatch_type_id == 3) {
|
||
this.sendGoogs();
|
||
} else {
|
||
this.getCompany();
|
||
this.setData({
|
||
dialogVisible: true,
|
||
});
|
||
}
|
||
} else if (btn.value == 24 || btn.value == 61) {
|
||
//取消发货
|
||
this.deliverGoodsCancel(order, btn);
|
||
} else if (btn.value == 25) {
|
||
//确认收货
|
||
this.collectGoods(order, btn);
|
||
} else if (btn.value == 26) {
|
||
//关闭订单
|
||
this.closeOrderPay(order, btn);
|
||
} else if (btn.value == 27) {
|
||
this.evaluate(btn, order);
|
||
} else if (btn.value == 28) {
|
||
//卡密
|
||
this.truckList(btn, order);
|
||
} else if (btn.value == 41) {
|
||
//398售后
|
||
wx.navigateTo({
|
||
url: btn.api,
|
||
});
|
||
} else if (btn.value == 50) {
|
||
//发票
|
||
this.checkInvoice(btn, order);
|
||
} else if (btn.value == 51) {
|
||
//聚合cps
|
||
if (order.plugin_id == "71") {
|
||
wx.navigateTo({
|
||
url: "/packageH/cpsPwd/cpsPwd?id=" + order.id,
|
||
});
|
||
}
|
||
}else if (btn.value == 56) {
|
||
//* 门店核销
|
||
wx.navigateTo({
|
||
url: "/packageH/project_verification/MyProject/MyProject",
|
||
});
|
||
} else if (btn.value == 11) {
|
||
//酒店确认下单
|
||
this.confirmHotelOrder(btn.api, order.id);
|
||
} else if (btn.value == "coupon") {
|
||
//分享优惠券
|
||
//couponShare order_id: order.id
|
||
wx.navigateTo({
|
||
url: "/packageD/coupon_share/coupon_share?orderid=" + order.id,
|
||
});
|
||
} else if (btn.value == "lease_toy_refund" || btn.value == "package_deliver_clerk" || btn.value == "package_delivery_confirm") {
|
||
console.log("申请归还");
|
||
this.getRuruen(btn, order); //进行归还请求
|
||
} else if (btn.value == "lease_toy_apply_adopt") {
|
||
console.log("填写归还");
|
||
wx.navigateTo({
|
||
url: "/packageB/member/OrderReturn/OrderReturn?id=" + order.id,
|
||
});
|
||
} else if (btn.value == "lease_toy_return_info") {
|
||
// 归还详情
|
||
wx.navigateTo({
|
||
url: "/packageA/others/order_ruturn_info/order_ruturn_info?id=" + order.id,
|
||
});
|
||
} else if (btn.value == "package_deliver" || btn.value=="package_delivery_confirm_code" ||btn.value == "store_package_deliver" || btn.value == "reserve_simple") {
|
||
// 自提点核销
|
||
console.log("自提点核销");
|
||
this.getQrImg(btn, order);
|
||
} else if (btn.value == "snatch_regiment_barter") {
|
||
// 抢团易货兑换
|
||
this.setData({
|
||
showBarter: true,
|
||
showBarter_value: order.barter,
|
||
});
|
||
} else if(btn.value == 53){
|
||
this.getBlindBoxGoods(order.id);
|
||
} else if (btn.value == "close_reason") {
|
||
this.setData({
|
||
refundShow: true,
|
||
refundText: order.close_reason
|
||
});
|
||
} else if(btn.value == 140){
|
||
wx.navigateTo({
|
||
url:"/packageI/brand_resources/cardVoucherInfo/cardVoucherInfo?id="+order.id
|
||
});
|
||
} else if(btn.value == "city_delivery_detail"){
|
||
wx.navigateTo({
|
||
url:"/packageA/member/order/orderLogisticsDetails/orderLogisticsDetails?id="+order.id
|
||
});
|
||
} else if (btn.value == "inventory_apply") {
|
||
this.getWarehouseList_CH(); //获取仓库列表(申请存货)
|
||
} else {
|
||
this.publicMessage(btn, order);
|
||
}
|
||
},
|
||
onCloseRefundShow(){
|
||
this.setData({
|
||
refundShow: false
|
||
});
|
||
},
|
||
// 点击盲盒商品
|
||
goOrderList(item){
|
||
console.log(item);
|
||
let id = item.currentTarget.dataset.item.id;
|
||
let orderType = this.data.orderType;
|
||
wx.navigateTo({
|
||
url: '/packageA/member/orderdetail/orderdetail?order_id=' + id + '&orderType=' + orderType
|
||
});
|
||
},
|
||
// 盲盒商品弹窗
|
||
getBlindBoxGoods(){
|
||
let that = this;
|
||
let urlStr = app.getNetAddresss('plugin.blind-box.api.index.blind-box-goods');
|
||
urlStr += '&order_id=' + this.data.orderPayId;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function(resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.setData({
|
||
['blindBoxInfo.show']:true,
|
||
['blindBoxInfo.goods']:res.data.order
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: 'none',
|
||
title: res.msg,
|
||
duration: 1200
|
||
});
|
||
}
|
||
},
|
||
fail: function(res) {
|
||
console.log(res);
|
||
}
|
||
});
|
||
},
|
||
blindBoxInfoTap(e){
|
||
this.setData({
|
||
['blindBoxInfo.show']:false,
|
||
});
|
||
},
|
||
//按钮公共方法,点击提示框进行操作,确认后刷新
|
||
publicMessage(btn, order) {
|
||
let that = this;
|
||
if (!btn.api) {
|
||
return;
|
||
}
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: `确定${btn.name}?`,
|
||
success(res) {
|
||
if (res.confirm) {
|
||
let urlStr = "";
|
||
urlStr += app.getNetAddresss(btn.api);
|
||
urlStr += "&order_id=" + order.id;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.getNetData();
|
||
wx.showToast({
|
||
title: `${btn.name}成功`,
|
||
icon: "success",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
}
|
||
},
|
||
});
|
||
},
|
||
// 自提点确认核销
|
||
getQrImg(btn, order) {
|
||
let urlStr = app.getNetAddresss(btn.api);
|
||
if(btn.value == "reserve_simple"){
|
||
urlStr += "&id=" + order.id;
|
||
} else {
|
||
urlStr += "&order_id=" + order.id;
|
||
}
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: (resdata) => {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
this.setData({
|
||
showQrcode: true,
|
||
qrcode_url: res.data.qr_code_url,
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
onClose() {
|
||
this.setData({
|
||
showQrcode: false,
|
||
});
|
||
},
|
||
// 申请归还
|
||
getRuruen(btn, order) {
|
||
let urlStr = app.getNetAddresss(btn.api);
|
||
urlStr += "&order_id=" + order.id;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: (resdata) => {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
wx.showToast({
|
||
title: res.msg,
|
||
icon: "none",
|
||
duration: 1500,
|
||
});
|
||
this.getNetData();
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
//查看物流
|
||
checklogistics(item, btn) {
|
||
//logistics
|
||
if (item.is_all_send_goods == 0) {
|
||
wx.navigateTo({
|
||
url: "/packageA/member/order/logistics/logistics?id=" + item.id + "&api=" + btn.api,
|
||
});
|
||
} else {
|
||
wx.navigateTo({
|
||
url: "/packageE/multiplePackages/multiplePackages?id=" + item.id + "&api=" + btn.api,
|
||
});
|
||
}
|
||
},
|
||
//删除订单
|
||
deleteOrder(item, btn, orderidx) {
|
||
let that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确定删除此订单?",
|
||
success(res) {
|
||
if (res.confirm) {
|
||
//删除当前选中的地址
|
||
that.sentRequest(btn.api, "&order_id=" + item.id, false);
|
||
}
|
||
},
|
||
});
|
||
},
|
||
//确认发货
|
||
sendGoogs(event) {
|
||
if (!event || event.detail === "confirm") {
|
||
let that = this;
|
||
// if (that.data.expressName == '' && that.data.numberName == '') {
|
||
// wx.showToast({
|
||
// icon: 'success',
|
||
// title: '请选择快递公司和输入快递单号',
|
||
// duration: 1000
|
||
// })
|
||
// return;
|
||
// } else if (that.data.expressName == '') {
|
||
// wx.showToast({
|
||
// icon: 'success',
|
||
// title: '请选择快递公司',
|
||
// duration: 1000
|
||
// })
|
||
// return;
|
||
// } else if (that.data.numberName == '') {
|
||
// wx.showToast({
|
||
// icon: 'success',
|
||
// title: '请输入快递单号',
|
||
// duration: 1000
|
||
// })
|
||
// return;
|
||
// }
|
||
if (this.data.orderType == "supplier") {
|
||
let urlStr = "";
|
||
urlStr += app.getNetAddresss("plugin.supplier.frontend.order.send");
|
||
let json = {
|
||
order_id: that.data.orderPayId,
|
||
express_code: that.data.expressName.value,
|
||
express_company_name: that.data.expressName.name,
|
||
express_sn: that.data.numberName,
|
||
};
|
||
app._postNetWork({
|
||
url: urlStr,
|
||
showToastIn: false,
|
||
data: json,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.setData({
|
||
dialogVisible: false,
|
||
});
|
||
that.getNetData();
|
||
that.triggerEvent("stoprefresh", false);
|
||
that.triggerEvent("ConfrimOrderNotification", "pay");
|
||
wx.showToast({
|
||
icon: "success",
|
||
title: "发货成功",
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {},
|
||
});
|
||
} else if (this.data.orderType == "subsidiary"||this.data.orderType == "storeMang") {
|
||
let urlStr = "";
|
||
urlStr = app.getNetAddresss("plugin.subsidiary.frontend.order.send");
|
||
if(this.data.orderType == "storeMang"){
|
||
urlStr = app.getNetAddresss("plugin.shop-assistant.frontend.order.send");
|
||
}
|
||
let json = {
|
||
order_id: that.data.orderPayId,
|
||
express_code: that.data.expressName.value,
|
||
express_company_name: that.data.expressName.name,
|
||
express_sn: that.data.numberName,
|
||
};
|
||
app._postNetWork({
|
||
url: urlStr,
|
||
showToastIn: false,
|
||
data: json,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.setData({
|
||
dialogVisible: false,
|
||
});
|
||
that.getNetData();
|
||
that.triggerEvent("stoprefresh", false);
|
||
that.triggerEvent("ConfrimOrderNotification", "pay");
|
||
wx.showToast({
|
||
icon: "success",
|
||
title: "发货成功",
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {},
|
||
});
|
||
} else {
|
||
let urlStr = "";
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.store.center.order-operation.send");
|
||
urlStr += "&order_id=" + that.data.orderPayId;
|
||
urlStr += "&express_code=" + that.data.expressName.value;
|
||
urlStr += "&express_company_name=" + that.data.expressName.name;
|
||
urlStr += "&express_sn=" + that.data.numberName;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.triggerEvent("ConfrimOrderNotification", "pay");
|
||
that.getNetData();
|
||
wx.showToast({
|
||
icon: "success",
|
||
title: "发货成功",
|
||
duration: 1000,
|
||
});
|
||
that.setData({
|
||
dialogVisible: false,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
}
|
||
} else {
|
||
this.setData({
|
||
dialogVisible: false,
|
||
});
|
||
this.triggerEvent("stoprefresh", false);
|
||
}
|
||
},
|
||
//快递选择
|
||
seleRegional: function () {
|
||
this.setData({
|
||
dateshow_1: true,
|
||
});
|
||
},
|
||
onCancelbtn: function () {
|
||
this.setData({
|
||
dateshow_1: false,
|
||
});
|
||
},
|
||
onConfirmbtn: function (e) {
|
||
let index = e.detail.index;
|
||
let val = e.detail.value;
|
||
let array = this.data.options;
|
||
this.setData({
|
||
dateshow_1: false,
|
||
regional: val,
|
||
expressName: array[index],
|
||
});
|
||
},
|
||
sentRequest(action, params, isIndicator) {
|
||
let urlStr = app.getNetAddresss(action);
|
||
urlStr += params;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
wx.showToast({
|
||
title: res.msg,
|
||
icon: "none",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
//评价订单
|
||
comment(item, btn) {
|
||
// 跳到评价订单
|
||
//comment order: item
|
||
wx.navigateTo({
|
||
url: "/packageB/member/comment/comment?order=" + JSON.stringify(item ? item : {}),
|
||
});
|
||
},
|
||
toPay(item, btn) {
|
||
//status-2合并支付 type-1订单支付
|
||
wx.navigateTo({
|
||
url: "/packageD/buy/orderPay/orderPay?order_id=" + item.id + "&status=2" + "&api=" + btn.api,
|
||
});
|
||
},
|
||
//获取模板id
|
||
getTemplate(order, btn) {
|
||
let urlStr = app.getNetAddresss("member.member.getMiniTemplateCorrespond");
|
||
let that = this;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
data: {
|
||
small_type: 2,
|
||
},
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
let array = [];
|
||
for (let i = 0; i < res.data.length; i++) {
|
||
array.push(res.data[i].template_id);
|
||
}
|
||
that.setData({
|
||
TemplateArray: array,
|
||
});
|
||
wx.requestSubscribeMessage({
|
||
tmplIds: that.data.TemplateArray,
|
||
success(res) {
|
||
that._toRefund(order, btn);
|
||
},
|
||
fail() {
|
||
that._toRefund(order, btn);
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
title: res.msg,
|
||
icon: "none",
|
||
duration: 1500,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
//退款
|
||
_toRefund(item, btn) {
|
||
console.log(btn.value);
|
||
//refund
|
||
if(this.data.order_data.plugin_id == 107){
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/refund/refund?order_id=" + item.id + "&type=1"+'&value='+btn.value,
|
||
});
|
||
return;
|
||
}
|
||
if (btn.value == "snatch_regiment_refund") {
|
||
//抢团
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/refund/refund?order_id=" + item.id + "&type=3",
|
||
});
|
||
} else {
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/refund/refund?order_id=" + item.id + "&type=1",
|
||
});
|
||
}
|
||
},
|
||
cancleOrder(item, btn) {
|
||
var that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确定取消此订单?",
|
||
success(res) {
|
||
if (res.confirm) {
|
||
//取消当前选中的地址
|
||
that.sentRequest(btn.api, "&order_id=" + item.id, false);
|
||
}
|
||
},
|
||
});
|
||
},
|
||
//确认收货
|
||
confirmOrder(item, btn) {
|
||
if((item.plugin_id==0 || item.plugin_id==44) && this.data.custom_receipt_confirmation_html!==''){
|
||
this.setData({
|
||
custom_receipt_confirmation_btn:btn,
|
||
custom_receipt_confirmation_item:item,
|
||
custom_receipt_confirmation_show:true
|
||
});
|
||
return;
|
||
}
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "您确定收到货物?",
|
||
success:(res)=> {
|
||
if (res.confirm) {
|
||
this._confirmOrder_request(item,btn);
|
||
}
|
||
},
|
||
});
|
||
},
|
||
CustomReceiptConfirmationSend(){
|
||
this._confirmOrder_request(this.data.custom_receipt_confirmation_item,this.data.custom_receipt_confirmation_btn);
|
||
},
|
||
_confirmOrder_request(item,btn){
|
||
let urlStr = app.getNetAddresss(btn.api);
|
||
urlStr += "&order_id=" + item.id;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: (resdata) => {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
app.tips(res.msg);
|
||
if(item.is_boss){
|
||
// is_boss:true是店长,店长跳转门店订单列表页
|
||
wx.navigateTo({url: "/packageA/member/myOrder_v2/myOrder_v2?status=0&orderType=store"});
|
||
return
|
||
}
|
||
this.getNetData();
|
||
} else {
|
||
app.tips(res.msg);
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
//退款中
|
||
toRefundDetail(item, btn) {
|
||
//aftersales
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/Aftersales/Aftersales?refund_id=" + item.refund_id,
|
||
});
|
||
},
|
||
cashPayOrder(item, btn) {
|
||
let that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确定此订单已付款?",
|
||
success(res) {
|
||
if (res.confirm) {
|
||
that.sentRequest(btn.api, "&order_id=" + item.id + "&order_pay_id=" + that.data.order_pay_id, false);
|
||
}
|
||
},
|
||
});
|
||
},
|
||
verification(item, btn) {
|
||
//订单核销
|
||
//orderVerification
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/orderVerification/orderVerification?order_id=" + item.id + "&api=" + btn.api,
|
||
});
|
||
},
|
||
verificationCash(item, btn) {
|
||
let that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确定此订单已付款?",
|
||
success(res) {
|
||
if (res.confirm) {
|
||
that.HxsentRequest(btn.api, "&order_id=" + item.id + "&order_pay_id=" + that.data.order_pay_id, false);
|
||
}
|
||
},
|
||
});
|
||
},
|
||
// 确认核销
|
||
HxsentRequest(action, params, isIndicator) {
|
||
let urlStr = app.getNetAddresss(action);
|
||
urlStr += params;
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
wx.showToast({
|
||
title: res.msg,
|
||
icon: "none",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.reLaunch({
|
||
url: "/packageG/index/index",
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
},
|
||
//退还跳转
|
||
gotoRefund(val) {
|
||
wx.navigateTo({
|
||
url: "/packageB/member/OrderReturn/OrderReturn?id=" + val,
|
||
});
|
||
},
|
||
//退还跳转
|
||
gotoRefundCheck(val) {
|
||
wx.navigateTo({
|
||
url: "/packageB/member/OrderReturnCheck/OrderReturnCheck?id=" + val,
|
||
});
|
||
},
|
||
//待确定
|
||
gotoMakeSure(val) {
|
||
wx.navigateTo({
|
||
url: "/packageB/member/OrderReturnSure/OrderReturnSure?id=" + val,
|
||
});
|
||
},
|
||
//汇款记录
|
||
shopRecord(val) {
|
||
wx.navigateTo({
|
||
url: "/packageB/member/OrderRecord/OrderRecord?order_id=" + val + "&order_state=" + this.data.order_data.status_name,
|
||
});
|
||
},
|
||
//确认支付
|
||
payMoney(item, btn) {
|
||
let that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确认支付该订单?",
|
||
success:(res) =>{
|
||
if (res.confirm) {
|
||
let urlStr = "";
|
||
if (this.data.orderType == "supplier" || this.data.orderType == "subsidiary" || this.data.orderType == "storeMang") {
|
||
urlStr += app.getNetAddresss(btn.api);
|
||
urlStr += "&order_id=" + that.data.orderPayId;
|
||
} else {
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.store.center.order-operation.pay");
|
||
urlStr += "&order_id=" + that.data.orderPayId;
|
||
}
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
wx.showToast({
|
||
title: "支付成功",
|
||
icon: "success",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
}
|
||
},
|
||
});
|
||
},
|
||
//取消发货
|
||
deliverGoodsCancel(order, btn) {
|
||
let that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确定取消发货?",
|
||
success(res) {
|
||
if (res.confirm) {
|
||
let urlStr = "";
|
||
if (that.data.orderType == "supplier" || that.data.orderType == "subsidiary") {
|
||
urlStr += app.getNetAddresss(btn.api);
|
||
urlStr += "&order_id=" + order.id;
|
||
} else {
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.store.center.order-operation.cancel-send");
|
||
urlStr += "&order_id=" + order.id;
|
||
}
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.getNetData();
|
||
wx.showToast({
|
||
title: "取消发货成功",
|
||
icon: "success",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
}
|
||
},
|
||
});
|
||
},
|
||
//确认收货
|
||
collectGoods(order, btn) {
|
||
let that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确认收货?",
|
||
success:(res)=> {
|
||
if (res.confirm) {
|
||
let urlStr = "";
|
||
if (this.data.orderType == "supplier" || this.data.orderType == "subsidiary" || this.data.orderType == "storeMang") {
|
||
urlStr += app.getNetAddresss(btn.api);
|
||
urlStr += "&order_id=" + that.data.orderPayId;
|
||
} else {
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.store.center.order-operation.receive");
|
||
urlStr += "&order_id=" + that.data.orderPayId;
|
||
}
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
wx.showToast({
|
||
title: "收货成功",
|
||
icon: "success",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
}
|
||
},
|
||
});
|
||
},
|
||
//关闭订单
|
||
closeOrderPay(order, btn) {
|
||
let that = this;
|
||
wx.showModal({
|
||
title: "提示",
|
||
content: "确定关闭订单?",
|
||
success:(res)=> {
|
||
if (res.confirm) {
|
||
let urlStr = "";
|
||
if (this.data.orderType == "supplier" || this.data.orderType == "subsidiary" || this.data.orderType == "storeMang") {
|
||
urlStr += app.getNetAddresss(btn.api);
|
||
urlStr += "&order_id=" + that.data.orderPayId;
|
||
} else {
|
||
urlStr += app.getNetAddresss("plugin.store-cashier.frontend.store.center.order-operation.close");
|
||
urlStr += "&order_id=" + that.data.orderPayId;
|
||
}
|
||
app._getNetWork({
|
||
url: urlStr,
|
||
success: function (resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
wx.showToast({
|
||
title: "关闭订单成功",
|
||
icon: "success",
|
||
duration: 1500,
|
||
success: function () {
|
||
setTimeout(function () {
|
||
//要延时执行的代码
|
||
wx.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1500); //延迟时间
|
||
},
|
||
});
|
||
} else {
|
||
wx.showToast({
|
||
icon: "none",
|
||
title: res.msg,
|
||
duration: 1000,
|
||
});
|
||
}
|
||
},
|
||
fail: function (res) {
|
||
console.log(res);
|
||
},
|
||
});
|
||
}
|
||
},
|
||
});
|
||
Dialog.confirm({
|
||
title: "标题",
|
||
message: "确定关闭订单?",
|
||
})
|
||
.then(() => {
|
||
// on confirm
|
||
})
|
||
.catch(() => {
|
||
// on cancel
|
||
});
|
||
},
|
||
// 评价
|
||
evaluate(order, btn) {
|
||
//抢单评价
|
||
//DeliveryEvaluate
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/DeliveryEvaluate/DeliveryEvaluate?order_id=" + order.order_id + "&api=" + btn.api + "&name=distributor",
|
||
});
|
||
},
|
||
//卡密
|
||
truckList(btn, order) {
|
||
//TruckList
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/truckList/truckList?order_id=" + order.id,
|
||
});
|
||
},
|
||
//查看发票
|
||
checkInvoice(btn, order) {
|
||
//Invoice
|
||
wx.navigateTo({
|
||
url: "/packageD/member/myOrder/invoice/invoice?order_id=" + order.id,
|
||
});
|
||
},
|
||
confirmHotelOrder() {},
|
||
numberNamebtn(e) {
|
||
let val = e.detail.value;
|
||
this.setData({
|
||
numberName: val.trim(),
|
||
});
|
||
},
|
||
goToAdress() {
|
||
let latitude = this.data.package_deliver.lat;
|
||
let longitude = this.data.package_deliver.lng;
|
||
let store_name = this.data.package_deliver.deliver_name || this.data.package_deliver.buyer_name;
|
||
let point = app.BMapTransqqMap(parseFloat(longitude), parseFloat(latitude));
|
||
wx.openLocation({
|
||
latitude: point.lat,
|
||
longitude: point.lng,
|
||
scale: 18,
|
||
name: store_name,
|
||
});
|
||
},
|
||
|
||
// 评价,追评,查看评价按钮
|
||
evaluateOpration(e) {
|
||
let btn = e.target.dataset.btn;
|
||
let item = e.target.dataset.goods;
|
||
let order_id = e.target.dataset.order.id;
|
||
//value-0评价 value-1追加评价 value-2查看评价详情
|
||
if (btn.value == 0) {
|
||
wx.navigateTo({
|
||
url: '/packageD/member/evaluate/evaluate?order_id=' + order_id + '&id=' + item.id
|
||
});
|
||
} else if (btn.value == 1) {
|
||
wx.navigateTo({
|
||
url: '/packageD/member/addevaluate/addevaluate?order_id=' + order_id + '&item=' + JSON.stringify(item)
|
||
});
|
||
} else if (btn.value == 2) {
|
||
let options = "?order_id=" + order_id;
|
||
options = options + '&goods_id=' + item.has_one_comment.goods_id;
|
||
options = options + '&comment_id=' + item.has_one_comment.id;
|
||
options = options + '&order_goods_id=' + item.id;
|
||
wx.navigateTo({
|
||
url: '/packageD/member/CommentDetails/CommentDetails' + options
|
||
});
|
||
}
|
||
},
|
||
|
||
onChangeInventoryApplyRadio(event){
|
||
this.setData({
|
||
inventoryApplyRadio: event.detail,
|
||
});
|
||
},
|
||
// ‘申请存货’获取仓库列表
|
||
getWarehouseList_CH() {
|
||
let urlStr = app.getNetAddresss("plugin.order-inventory.frontend.index.warehouse-list");
|
||
app._postNetWork({
|
||
url: urlStr,
|
||
data: {},
|
||
success: (resdata) => {
|
||
let res = resdata.data;
|
||
if (res.result == 1) {
|
||
this.setData({
|
||
inventoryApplyList: res.data.list, //仓库列表
|
||
inventoryApplyRadio: res.data.list[0].id,
|
||
inventoryApplyPopup: true //存货申请弹窗
|
||
})
|
||
} else {
|
||
app.tips(res.msg)
|
||
}
|
||
}
|
||
});
|
||
},
|
||
// 确认已选择仓库申请仓库
|
||
confirmInventoryApply() {
|
||
let urlStr = app.getNetAddresss("plugin.order-inventory.frontend.index.inventory-apply");
|
||
app._postNetWork({
|
||
url: urlStr,
|
||
data: { warehouse_id: this.data.inventoryApplyRadio, order_id: this.data.orderPayId },
|
||
success: (resdata) => {
|
||
let res = resdata.data;
|
||
app.tips(res.msg)
|
||
if (res.result == 1) {
|
||
this.getNetData();
|
||
}
|
||
}
|
||
});
|
||
},
|
||
});
|