Commit 0aaeb43c by 张立顺

feat 跳转页面函数顺序逻辑

1 parent 1126e085
......@@ -889,7 +889,6 @@ Page({
let dateStaffPop = wx.$storage.get("dateStaffPop");
let userInfo = wx.$util.getUserInfo();
let nowDate = new Date().format("yyyy-MM-dd");
// let num = 0
let {
sceneType,
shopMerchantId: merchantId
......@@ -900,19 +899,9 @@ Page({
// let num = 0
// 当天已查询过
if (dayBoolean && flag) {
// num = dateStaffPop?.num || 0
// num = num + 1
// num = 1
resolve()
return;
}
// 当天已查询过
// if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
// // num = dateStaffPop?.num || 0
// // num = num + 1
// // num = 1
// return;
// }
api
.orderStaffValid({
......@@ -921,34 +910,8 @@ Page({
.then((result) => {
console.log(result);
if (result.data) {
// if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false;
// wx.__HAS_NOREPORT_MODAL = true;
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3) return false
this.addModalToQueue('开单预警', '您已超过三天未开单', '确定', false, 1, () => { })
// this.showNextModal()
// wx.showModal({
// title: "开单预警",
// content: "您已超过三天未开单",
// showCancel: false,
// // cancelText: '取消', // '取消
// cancelColor: "#292D33",
// confirmText: "确定",
// confirmColor: "#347BFF",
// success(res) {
// // if (res.confirm) {
// // wx.$router.go('tabWorkOrder.staffDaily', {
// // reportDate: hasNeedReport.date
// // })
// // }
// },
// complete: () => {
// // 这个延迟的目的是为了避免短时间内重复弹出
// // 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
// setTimeout(() => {
// wx.__HAS_NOREPORT_MODAL = false;
// }, 2000);
// },
// });
}
wx.$storage.set("dateStaffPop", {
date: new Date().format("yyyy-MM-dd"),
......@@ -957,12 +920,6 @@ Page({
...dateStaffPop[1]
}
});
// else {
// num = num + 1
// }
// if (result) {
// }
resolve()
})
.catch((err) => {
......@@ -1108,59 +1065,62 @@ Page({
});
}
},
onRoute(options) {
options && this.checkShowOrderPop(options);
wx.__HAS_SHOW_MODAL = false
// options && options.resetStoreList && this.get4SStoreList()
// 跳转工单/预约详情
// listStatus 0 待跟进 1已升级 2战败 3待支付
if (options?.isGoPage) {
// status 1待跟进(有inviteRecordId跳转预约详情无跳转待跟进工单页面 微信支付跳转工单确认页面)3待支付(跳转工单确认页面)constructionFlag(已施工页面)
let pageName =
options?.status == 1 && options?.pageParams?.id ?
"tabDate.detail" :
options.status == 3 ||
(options.status == 1 && options.selectPayType == 1) ?
"tabWorkOrder.confirmOrder" :
options.constructionFlag == "Y" && options.status != 10 ?
"tabWorkOrder.constructionOrderDetail" :
"tabWorkOrder.orderDetail";
wx.$router.go(
`${pageName}?id=${options?.pageParams?.id}&orderCode=${options?.pageParams?.orderCode}`, {
...options?.pageParams,
/**获取园区配置 */
async getYqStoreConfig() {
const {
merchantId: yqMerchantId
} = wx.$util.getUserInfo(), {
menu
} = this.data, {
data
} = await commonApi.getYqStoreConfig({
yqMerchantId,
});
//是否配置园区店面档案互通 Y / N
if (data) {
const culeIndex = menu.findIndex((e) => e.name == "客户线索");
if (data.customerExchangeFlag == "Y") {
if (culeIndex == -1)
menu.push({
name: "客户线索",
url: "packageEquity.clueList",
recordId: 11,
icon: "customer_clue",
tipsNum: 0,
});
this.getCustomerClueRemind();
}
);
if (data.customerExchangeFlag == "N" && culeIndex != -1)
menu.splice(culeIndex, 1);
}
// 产品需求:强制填写(04-17版本)
// this.checkDailyRecport()
// this.checkStaffOrderStatus();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
options && this.checkShowOrderPop(options);
let today = new Date();
let startDate = today.format("yyyy-MM-dd");
let endDate = today.format("yyyy-MM-dd");
let userInfo = wx.$util.getUserInfo();
this.setData({
maxDate: new Date().format("yyyy-MM-dd"),
startDate,
endDate,
isStaff: app.globalData.isStaff,
isWait: !(userInfo?.isSuper || userInfo?.loginRole == 3)
}, () => {
if (this.data.isWait) this.getStaffRemindList();
menu,
});
},
/**客户线索新增客户提醒 */
async getCustomerClueRemind() {
const {
sceneType,
shopMerchantId: merchantId
} = wx.$util.getUserInfo(), {
menu
} = this.data, {
data,
code
} = await commonApi.getCustomerClueRemind({
sceneType,
merchantId: [merchantId],
});
if (code == 0) {
const index = menu.findIndex((e) => e.name == "客户线索");
this.setData({
[`menu[${index}].tipsNum`]: data,
});
}
},
this.checkIsPadOrNot()
this.get4SStoreList();
// this.getIsBusinessSchoolEnableCurrentUser();
// 获取驻店员工目标
if (app.globalData.isStaff) this.getStaffTargetTask();
},
checkIsPadOrNot() {
wx.getRendererUserAgent({
success(res) {
......@@ -1244,12 +1204,6 @@ Page({
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.customerOnReady();
},
customerOnReady() {
let checklist = [];
......@@ -1350,6 +1304,65 @@ Page({
newMenu
});
},
onRoute(options) {
options && this.checkShowOrderPop(options);
wx.__HAS_SHOW_MODAL = false
// options && options.resetStoreList && this.get4SStoreList()
// 跳转工单/预约详情
// listStatus 0 待跟进 1已升级 2战败 3待支付
if (options?.isGoPage) {
// status 1待跟进(有inviteRecordId跳转预约详情无跳转待跟进工单页面 微信支付跳转工单确认页面)3待支付(跳转工单确认页面)constructionFlag(已施工页面)
let pageName =
options?.status == 1 && options?.pageParams?.id ?
"tabDate.detail" :
options.status == 3 ||
(options.status == 1 && options.selectPayType == 1) ?
"tabWorkOrder.confirmOrder" :
options.constructionFlag == "Y" && options.status != 10 ?
"tabWorkOrder.constructionOrderDetail" :
"tabWorkOrder.orderDetail";
wx.$router.go(
`${pageName}?id=${options?.pageParams?.id}&orderCode=${options?.pageParams?.orderCode}`, {
...options?.pageParams,
}
);
}
// 产品需求:强制填写(04-17版本)
// this.checkDailyRecport()
// this.checkStaffOrderStatus();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
options && this.checkShowOrderPop(options);
let today = new Date();
let startDate = today.format("yyyy-MM-dd");
let endDate = today.format("yyyy-MM-dd");
let userInfo = wx.$util.getUserInfo();
this.setData({
maxDate: new Date().format("yyyy-MM-dd"),
startDate,
endDate,
isStaff: app.globalData.isStaff,
isWait: !(userInfo?.isSuper || userInfo?.loginRole == 3)
}, () => {
if (this.data.isWait) this.getStaffRemindList();
});
this.checkIsPadOrNot()
this.get4SStoreList();
// this.getIsBusinessSchoolEnableCurrentUser();
// 获取驻店员工目标
if (app.globalData.isStaff) this.getStaffTargetTask();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.customerOnReady();
},
/**
* 生命周期函数--监听页面显示
......@@ -1398,60 +1411,7 @@ Page({
getApp().login(true);
}
},
/**获取园区配置 */
async getYqStoreConfig() {
const {
merchantId: yqMerchantId
} = wx.$util.getUserInfo(), {
menu
} = this.data, {
data
} = await commonApi.getYqStoreConfig({
yqMerchantId,
});
//是否配置园区店面档案互通 Y / N
if (data) {
const culeIndex = menu.findIndex((e) => e.name == "客户线索");
if (data.customerExchangeFlag == "Y") {
if (culeIndex == -1)
menu.push({
name: "客户线索",
url: "packageEquity.clueList",
recordId: 11,
icon: "customer_clue",
tipsNum: 0,
});
this.getCustomerClueRemind();
}
if (data.customerExchangeFlag == "N" && culeIndex != -1)
menu.splice(culeIndex, 1);
}
this.setData({
menu,
});
},
/**客户线索新增客户提醒 */
async getCustomerClueRemind() {
const {
sceneType,
shopMerchantId: merchantId
} = wx.$util.getUserInfo(), {
menu
} = this.data, {
data,
code
} = await commonApi.getCustomerClueRemind({
sceneType,
merchantId: [merchantId],
});
if (code == 0) {
const index = menu.findIndex((e) => e.name == "客户线索");
this.setData({
[`menu[${index}].tipsNum`]: data,
});
}
},
/**
* 生命周期函数--监听页面隐藏
*/
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!