Commit babb1197 by 张立顺

去除console

1 parent d3d355f0
...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 1 let index = 3
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
...@@ -33,7 +33,7 @@ class Request { ...@@ -33,7 +33,7 @@ class Request {
data: { code, message }, data: { code, message },
data data
} = response } = response
// let thisPage = wx.$router.getPageInstance()
// // console.log(thisPage, 'thisPage') // // console.log(thisPage, 'thisPage')
// let { route, data: pageData } = thisPage // let { route, data: pageData } = thisPage
// if (pageData.shareQuery) { // if (pageData.shareQuery) {
...@@ -44,19 +44,23 @@ class Request { ...@@ -44,19 +44,23 @@ class Request {
// } // }
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage);
wx.hideLoading() wx.hideLoading()
wx.showModal({ if (thisPage.route != 'pages/wxLogin/wxLogin') {
title: '温馨提示', wx.showModal({
content: '登录过期,请重新登录。', title: '温馨提示',
showCancel: false, content: '登录过期,请重新登录。',
confirmText: '去登录', showCancel: false,
confirmColor: '#3582EE', confirmText: '去登录',
success(res) { confirmColor: '#3582EE',
if (res.confirm) { success(res) {
getApp().login(true) if (res.confirm) {
getApp().login(true)
}
} }
} })
}) }
} else if (code == -1) { } else if (code == -1) {
wx.showToast({ wx.showToast({
title: message || '网络请求失败', title: message || '网络请求失败',
......
...@@ -87,27 +87,40 @@ App({ ...@@ -87,27 +87,40 @@ App({
} }
} }
}) })
let { query } = options let { query } = options
// 判断对象是否满足任意一个key // 判断对象是否满足任意一个key
// console.log(query, ' query') console.log(query, ' query')
if (query && (query.scene || query.merchantId || query.type)) { if (query && (query.scene || query.merchantId || query.type)) {
options.patch = 'pages/index/index'
// 需要满 // 需要满
if (query.merchantId) { if (query.merchantId) {
// &&options.patch == 'tabIndex/pages/index/index' // options.patch == 'tabIndex/pages/index/index'
let userInfo = util.getStorageSync('dj_boutique_user_info') let userInfo = util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录 // 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) { if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null let that = this
return this.login(true) // wx.$SCENE = null
// router.reLaunch('pages.wxLogin')
wx.showModal({
title: '温馨提示',
content: '登录账号非补单对应门店,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
// getApp().login(true)
return that.login(true)
}
}
})
} }
options.patch = 'pages/index/index'
} }
if (query.type) { if (query.type) {
options.patch = 'tabWorkOrder/pages/createOrder/createOrder' options.patch = 'tabWorkOrder/pages/createOrder/createOrder'
} }
// tabIndex/pages/index/index?supplement=true
wx.$SCENE = options wx.$SCENE = options
// tabIndex/pages/index/index?supplement=true
} }
console.log(wx.$SCENE, ' wx.$SCENE') console.log(wx.$SCENE, ' wx.$SCENE')
// if (options.query.scene) // if (options.query.scene)
......
...@@ -19,7 +19,7 @@ Page({ ...@@ -19,7 +19,7 @@ Page({
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api.getListSelectAccount().then(res => { api.getListSelectAccount().then(res => {
wx.hideLoading() wx.hideLoading()
console.log(res) // console.log(res)
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
let { loginUserInfoList, sessionId } = data let { loginUserInfoList, sessionId } = data
...@@ -69,7 +69,7 @@ Page({ ...@@ -69,7 +69,7 @@ Page({
// console.log(data.loginUserInfoList[0]) // console.log(data.loginUserInfoList[0])
app.checkYqdSuper(data.loginUserInfoList[0]) app.checkYqdSuper(data.loginUserInfoList[0])
const SCENE = wx.$SCENE const SCENE = wx.$SCENE
console.log(SCENE) // console.log(SCENE)
// debugger // debugger
if (SCENE) { if (SCENE) {
let { let {
...@@ -78,7 +78,8 @@ Page({ ...@@ -78,7 +78,8 @@ Page({
// : { scene } // : { scene }
} = SCENE } = SCENE
let { target, name } = wx.$util.getSceneId(path) let { target, name } = wx.$util.getSceneId(path)
console.log(query) // console.log(query)
// console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query) wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null wx.$SCENE = null
} else { } else {
......
...@@ -174,6 +174,7 @@ Page({ ...@@ -174,6 +174,7 @@ Page({
onShow: function () { onShow: function () {
wx.hideHomeButton() wx.hideHomeButton()
this.login() this.login()
console.log(' wx.$SCENE ', wx.$SCENE );
}, },
login() { login() {
wx.$util.showLoading() wx.$util.showLoading()
......
...@@ -80,8 +80,8 @@ ...@@ -80,8 +80,8 @@
}, },
{ {
"name": "首页", "name": "首页",
"pathName": "/tabIndex/pages/index/index", "pathName": "pages/index/index",
"query": "merchantId=44209886", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
...@@ -109,6 +109,45 @@ ...@@ -109,6 +109,45 @@
{ {
"name": "门店概况", "name": "门店概况",
"pathName": "tabOperating/pages/4sOverview/4sOverview", "pathName": "tabOperating/pages/4sOverview/4sOverview",
"query": "supplement=true&merchantId=44202910",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "supplement=true&merchantId=44202910",
"launchMode": "default",
"scene": 1008,
"groupInfo": {
"groupIdx": 1,
"groupName": "测试模拟群1"
}
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "supplement=true&merchantId=44202910",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "supplement=true&merchantId=111",
"launchMode": "default",
"scene": 1008
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "/tabIndex/pages/index/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
......
...@@ -49,6 +49,7 @@ class Router { ...@@ -49,6 +49,7 @@ class Router {
if (thisPage) { if (thisPage) {
const onRoute = thisPage.onRoute const onRoute = thisPage.onRoute
thisPage.$query = this[_query] thisPage.$query = this[_query]
// console.log(this[_query]);
typeof onRoute === 'function' && onRoute(this[_query]) typeof onRoute === 'function' && onRoute(this[_query])
thisPage.showToast = util.showToast thisPage.showToast = util.showToast
thisPage.showLoading = util.showLoading thisPage.showLoading = util.showLoading
...@@ -99,8 +100,10 @@ class Router { ...@@ -99,8 +100,10 @@ class Router {
} }
checkRouter(route, events) { checkRouter(route, events) {
// console.log(route) // console.log(route)
// console.log(events);
// debugger // debugger
this[_query] = events || {} this[_query] = events || {}
// console.log(this[_query])
const [_parent, _name] = route.split('.') const [_parent, _name] = route.split('.')
let name = route let name = route
let parent = this.getPageInstance()?.__route__.split('/')[0] let parent = this.getPageInstance()?.__route__.split('/')[0]
...@@ -155,7 +158,10 @@ class Router { ...@@ -155,7 +158,10 @@ class Router {
} }
/**关闭所有页面,打开到应用内的某个页面 */ /**关闭所有页面,打开到应用内的某个页面 */
reLaunch(route, events) { reLaunch(route, events) {
// console.log(events)
// debugger
let { routerMapItem, query } = this.checkRouter(route, events) let { routerMapItem, query } = this.checkRouter(route, events)
// console.log(query, 'query')
wx.reLaunch({ wx.reLaunch({
url: `${routerMapItem.url}${query}` url: `${routerMapItem.url}${query}`
}) })
......
...@@ -281,30 +281,7 @@ Page({ ...@@ -281,30 +281,7 @@ Page({
table table
}) })
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(options)
if (options.supplement) {
this.setData({
showOrderpop: true
})
}
let today = new Date()
let startDate = today.format('yyyy-MM-dd')
let endDate = today.format('yyyy-MM-dd')
this.setData({
maxDate: new Date().format('yyyy-MM-dd'),
startDate,
endDate
})
// console.log(app.globalData.isYqdSuper)
this.setData({
isStaff: app.globalData.isStaff
})
// this.getWaitOrder()
},
setTime() { setTime() {
let _this = this let _this = this
time = setTimeout(() => { time = setTimeout(() => {
...@@ -317,7 +294,9 @@ Page({ ...@@ -317,7 +294,9 @@ Page({
// console.log('waitorder') // console.log('waitorder')
let { isStaff } = this.data let { isStaff } = this.data
// console.log('isStaff', isStaff) // console.log('isStaff', isStaff)
isStaff && let thisPage = wx.$router.getPageInstance()
console.log( thisPage.route,' thisPage.route');
thisPage.route == 'tabIndex/pages/index/index'&& isStaff &&
api api
.waitinputorder() .waitinputorder()
.then(result => { .then(result => {
...@@ -420,13 +399,45 @@ Page({ ...@@ -420,13 +399,45 @@ Page({
} }
}) })
}, },
onRoute(options) { checkShowOrderPop(options){
if (options.supplement) { let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
this.setData({ // 需要当前门店的 不是就重新登录
showOrderpop: true if (userInfo?.subLoginUser?.merchantId == options.merchantId) {
}) if (options.merchantId) {
this.setData({
showOrderpop: true
})
}
} }
}, },
onRoute(options) {
// console.log($query);
// debugger
// console.log(options,'options');
options&& this.checkShowOrderPop(options)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(options)
options&& this.checkShowOrderPop(options)
let today = new Date()
let startDate = today.format('yyyy-MM-dd')
let endDate = today.format('yyyy-MM-dd')
this.setData({
maxDate: new Date().format('yyyy-MM-dd'),
startDate,
endDate
})
// console.log(app.globalData.isYqdSuper)
this.setData({
isStaff: app.globalData.isStaff
})
// this.getWaitOrder()
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -460,13 +471,15 @@ Page({ ...@@ -460,13 +471,15 @@ Page({
onHide: function () { onHide: function () {
// console.log('onHide') // console.log('onHide')
// console.log(time) // console.log(time)
clearTimeout(time) time &&clearTimeout(time)
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () {}, onUnload: function () {
time &&clearTimeout(time)
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!