Commit 31fa7c56 by 杨北旺

Merge branch 'V4.38.1-0422' of 192.168.3.233:saas_plus/dj-car-boutique-work-wechat into V4.38.1-0422

2 parents b501fbbc 01f4bc73
......@@ -205,6 +205,8 @@ Page({
let { code, data } = res
if (code == 0) {
if (!data) {
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({
title: '交车目标',
content: '您有未填写的交车目标,请点击前往',
......@@ -219,6 +221,11 @@ Page({
}
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
}
})
}
......@@ -354,6 +361,7 @@ Page({
changeTabBar(e) {
// let { pageShow } = this.data,
wx.__HAS_NOREPORT_MODAL = false
let tabIndex = e.detail
// console.log(pageShow[tabIndex])
this.setData({
......
......@@ -95,7 +95,7 @@ Page({
return false
},
submit() {
let { targetInfo } = this.data
let { targetInfo, approvedSource } = this.data
let emptyKey = this.checkRequired(targetInfo)
if (emptyKey) {
this.showToast(`${toastList[emptyKey]}不能为空`)
......@@ -113,7 +113,6 @@ Page({
return
}
targetInfo.targetDate = targetInfo.reportDate
delete targetInfo.reportDate
if (this.data.isSubmit) return
this.setData({
isSubmit: true
......@@ -131,15 +130,20 @@ Page({
confirmText: '我知道了',
confirmColor: '#347BFF',
success(res) {
wx.$router.back()
if (approvedSource != 3) {
wx.$router.back()
}
}
})
setTimeout(() => {
wx.$router.back()
}, 2000)
if (approvedSource != 3) {
setTimeout(() => {
wx.$router.back()
}, 2000)
}
} else {
wx.$util.showToast(message)
}
this.getDeliveryTargetWeekList()
})
},
/**
......@@ -203,7 +207,6 @@ Page({
['targetInfo.reportDate']: date,
isEditReport: false
})
console.log(this.data.targetInfo)
},
editReport() {
this.setData({
......@@ -219,25 +222,35 @@ Page({
wx.$router.back()
},
initData() {
let { targetInfo, approvedSource } = this.data
let { targetInfo, approvedSource, reportDate, timeBean } = this.data
let userInfo = wx.$util.getUserInfo()
this.setData({
timeBean: util.getWeekDayList(this.data.selectWeek, '', customerDisabled),
userInfo
})
if (!approvedSource) {
if (approvedSource != 3) {
this.setData({
targetInfo: {
...targetInfo,
staffUuid: userInfo.uuid,
staffName: userInfo.name,
staffPhone: userInfo.phone,
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
staffUuid: userInfo?.uuid,
staffName: userInfo?.name,
staffPhone: userInfo?.phone,
merchantId: userInfo?.shopMerchantId,
merchantName: userInfo?.shopMerchantName
}
})
}
this.setTargetDate()
if (reportDate) {
let index = timeBean?.weekDayList?.findIndex(val => val.date == reportDate)
if (index > -1) {
this.setData({
['timeBean.selectDay']: index,
['targetInfo.reportDate']: reportDate
})
}
} else {
this.setTargetDate()
}
this.getTargetInfo()
this.getDeliveryTargetWeekList()
},
......@@ -332,6 +345,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let {targetInfo} = this.data
if (options?.scene) {
let id = decodeURIComponent(options.scene).split('=')[1]
return this.qrCodeScene(id)
......@@ -364,6 +378,8 @@ Page({
})
},
onRoute(options) {
wx.__HAS_NOREPORT_MODAL = false
let {targetInfo} = this.data
if (options?.scene) {
let id = decodeURIComponent(options.scene).split('=')[1]
if (id) return
......@@ -382,7 +398,7 @@ Page({
}
if (options.hasOwnProperty('approvedSource')) {
this.setData({
approvedSource: `${options.approvedSource}`,
approvedSource: options.approvedSource,
merchantRange: [{ merchantName: options.merchantName, merchantId: options.merhchantid }],
targetInfo: {
...targetInfo,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!