Commit 0aaeb43c by 张立顺

feat 跳转页面函数顺序逻辑

1 parent 1126e085
...@@ -889,7 +889,6 @@ Page({ ...@@ -889,7 +889,6 @@ Page({
let dateStaffPop = wx.$storage.get("dateStaffPop"); let dateStaffPop = wx.$storage.get("dateStaffPop");
let userInfo = wx.$util.getUserInfo(); let userInfo = wx.$util.getUserInfo();
let nowDate = new Date().format("yyyy-MM-dd"); let nowDate = new Date().format("yyyy-MM-dd");
// let num = 0
let { let {
sceneType, sceneType,
shopMerchantId: merchantId shopMerchantId: merchantId
...@@ -900,19 +899,9 @@ Page({ ...@@ -900,19 +899,9 @@ Page({
// let num = 0 // let num = 0
// 当天已查询过 // 当天已查询过
if (dayBoolean && flag) { if (dayBoolean && flag) {
// num = dateStaffPop?.num || 0
// num = num + 1
// num = 1
resolve() resolve()
return; return;
} }
// 当天已查询过
// if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
// // num = dateStaffPop?.num || 0
// // num = num + 1
// // num = 1
// return;
// }
api api
.orderStaffValid({ .orderStaffValid({
...@@ -921,34 +910,8 @@ Page({ ...@@ -921,34 +910,8 @@ Page({
.then((result) => { .then((result) => {
console.log(result); console.log(result);
if (result.data) { 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 if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3) return false
this.addModalToQueue('开单预警', '您已超过三天未开单', '确定', false, 1, () => { }) 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", { wx.$storage.set("dateStaffPop", {
date: new Date().format("yyyy-MM-dd"), date: new Date().format("yyyy-MM-dd"),
...@@ -957,12 +920,6 @@ Page({ ...@@ -957,12 +920,6 @@ Page({
...dateStaffPop[1] ...dateStaffPop[1]
} }
}); });
// else {
// num = num + 1
// }
// if (result) {
// }
resolve() resolve()
}) })
.catch((err) => { .catch((err) => {
...@@ -1108,59 +1065,62 @@ Page({ ...@@ -1108,59 +1065,62 @@ Page({
}); });
} }
}, },
onRoute(options) { /**获取园区配置 */
options && this.checkShowOrderPop(options); async getYqStoreConfig() {
wx.__HAS_SHOW_MODAL = false const {
// options && options.resetStoreList && this.get4SStoreList() merchantId: yqMerchantId
// 跳转工单/预约详情 } = wx.$util.getUserInfo(), {
// listStatus 0 待跟进 1已升级 2战败 3待支付 menu
if (options?.isGoPage) { } = this.data, {
// status 1待跟进(有inviteRecordId跳转预约详情无跳转待跟进工单页面 微信支付跳转工单确认页面)3待支付(跳转工单确认页面)constructionFlag(已施工页面) data
let pageName = } = await commonApi.getYqStoreConfig({
options?.status == 1 && options?.pageParams?.id ? yqMerchantId,
"tabDate.detail" : });
options.status == 3 || //是否配置园区店面档案互通 Y / N
(options.status == 1 && options.selectPayType == 1) ? if (data) {
"tabWorkOrder.confirmOrder" : const culeIndex = menu.findIndex((e) => e.name == "客户线索");
options.constructionFlag == "Y" && options.status != 10 ? if (data.customerExchangeFlag == "Y") {
"tabWorkOrder.constructionOrderDetail" : if (culeIndex == -1)
"tabWorkOrder.orderDetail"; menu.push({
wx.$router.go( name: "客户线索",
`${pageName}?id=${options?.pageParams?.id}&orderCode=${options?.pageParams?.orderCode}`, { url: "packageEquity.clueList",
...options?.pageParams, recordId: 11,
icon: "customer_clue",
tipsNum: 0,
});
this.getCustomerClueRemind();
} }
); if (data.customerExchangeFlag == "N" && culeIndex != -1)
menu.splice(culeIndex, 1);
} }
// 产品需求:强制填写(04-17版本)
// this.checkDailyRecport() this.setData({
// this.checkStaffOrderStatus(); menu,
});
}, },
/** /**客户线索新增客户提醒 */
* 生命周期函数--监听页面加载 async getCustomerClueRemind() {
*/ const {
onLoad: function (options) { sceneType,
options && this.checkShowOrderPop(options); shopMerchantId: merchantId
let today = new Date(); } = wx.$util.getUserInfo(), {
let startDate = today.format("yyyy-MM-dd"); menu
let endDate = today.format("yyyy-MM-dd"); } = this.data, {
let userInfo = wx.$util.getUserInfo(); data,
code
} = await commonApi.getCustomerClueRemind({
sceneType,
merchantId: [merchantId],
});
if (code == 0) {
const index = menu.findIndex((e) => e.name == "客户线索");
this.setData({ this.setData({
maxDate: new Date().format("yyyy-MM-dd"), [`menu[${index}].tipsNum`]: data,
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();
},
checkIsPadOrNot() { checkIsPadOrNot() {
wx.getRendererUserAgent({ wx.getRendererUserAgent({
success(res) { success(res) {
...@@ -1244,12 +1204,6 @@ Page({ ...@@ -1244,12 +1204,6 @@ Page({
} }
}); });
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.customerOnReady();
},
customerOnReady() { customerOnReady() {
let checklist = []; let checklist = [];
...@@ -1350,6 +1304,65 @@ Page({ ...@@ -1350,6 +1304,65 @@ Page({
newMenu 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({ ...@@ -1398,60 +1411,7 @@ Page({
getApp().login(true); 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!