Commit babb1197 by 张立顺

去除console

1 parent d3d355f0
......@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 1
let index = 3
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......
......@@ -33,7 +33,7 @@ class Request {
data: { code, message },
data
} = response
// let thisPage = wx.$router.getPageInstance()
// // console.log(thisPage, 'thisPage')
// let { route, data: pageData } = thisPage
// if (pageData.shareQuery) {
......@@ -44,19 +44,23 @@ class Request {
// }
if (code == 20 || code == 21) {
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage);
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: '登录过期,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
getApp().login(true)
if (thisPage.route != 'pages/wxLogin/wxLogin') {
wx.showModal({
title: '温馨提示',
content: '登录过期,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
getApp().login(true)
}
}
}
})
})
}
} else if (code == -1) {
wx.showToast({
title: message || '网络请求失败',
......
......@@ -87,27 +87,40 @@ App({
}
}
})
let { query } = options
// 判断对象是否满足任意一个key
// console.log(query, ' query')
console.log(query, ' query')
if (query && (query.scene || query.merchantId || query.type)) {
options.patch = 'pages/index/index'
// 需要满
if (query.merchantId) {
// &&options.patch == 'tabIndex/pages/index/index'
// options.patch == 'tabIndex/pages/index/index'
let userInfo = util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null
return this.login(true)
let that = this
// 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) {
options.patch = 'tabWorkOrder/pages/createOrder/createOrder'
}
// tabIndex/pages/index/index?supplement=true
wx.$SCENE = options
// tabIndex/pages/index/index?supplement=true
}
console.log(wx.$SCENE, ' wx.$SCENE')
// if (options.query.scene)
......
......@@ -19,7 +19,7 @@ Page({
wx.$util.showLoading('加载中...')
api.getListSelectAccount().then(res => {
wx.hideLoading()
console.log(res)
// console.log(res)
let { code, data, message } = res
if (code == 0) {
let { loginUserInfoList, sessionId } = data
......@@ -69,7 +69,7 @@ Page({
// console.log(data.loginUserInfoList[0])
app.checkYqdSuper(data.loginUserInfoList[0])
const SCENE = wx.$SCENE
console.log(SCENE)
// console.log(SCENE)
// debugger
if (SCENE) {
let {
......@@ -78,7 +78,8 @@ Page({
// : { scene }
} = SCENE
let { target, name } = wx.$util.getSceneId(path)
console.log(query)
// console.log(query)
// console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null
} else {
......
......@@ -174,6 +174,7 @@ Page({
onShow: function () {
wx.hideHomeButton()
this.login()
console.log(' wx.$SCENE ', wx.$SCENE );
},
login() {
wx.$util.showLoading()
......
......@@ -80,8 +80,8 @@
},
{
"name": "首页",
"pathName": "/tabIndex/pages/index/index",
"query": "merchantId=44209886",
"pathName": "pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
......@@ -109,6 +109,45 @@
{
"name": "门店概况",
"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": "",
"launchMode": "default",
"scene": null
......
......@@ -49,6 +49,7 @@ class Router {
if (thisPage) {
const onRoute = thisPage.onRoute
thisPage.$query = this[_query]
// console.log(this[_query]);
typeof onRoute === 'function' && onRoute(this[_query])
thisPage.showToast = util.showToast
thisPage.showLoading = util.showLoading
......@@ -99,8 +100,10 @@ class Router {
}
checkRouter(route, events) {
// console.log(route)
// console.log(events);
// debugger
this[_query] = events || {}
// console.log(this[_query])
const [_parent, _name] = route.split('.')
let name = route
let parent = this.getPageInstance()?.__route__.split('/')[0]
......@@ -155,7 +158,10 @@ class Router {
}
/**关闭所有页面,打开到应用内的某个页面 */
reLaunch(route, events) {
// console.log(events)
// debugger
let { routerMapItem, query } = this.checkRouter(route, events)
// console.log(query, 'query')
wx.reLaunch({
url: `${routerMapItem.url}${query}`
})
......
......@@ -281,30 +281,7 @@ Page({
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() {
let _this = this
time = setTimeout(() => {
......@@ -317,7 +294,9 @@ Page({
// console.log('waitorder')
let { isStaff } = this.data
// console.log('isStaff', isStaff)
isStaff &&
let thisPage = wx.$router.getPageInstance()
console.log( thisPage.route,' thisPage.route');
thisPage.route == 'tabIndex/pages/index/index'&& isStaff &&
api
.waitinputorder()
.then(result => {
......@@ -420,13 +399,45 @@ Page({
}
})
},
onRoute(options) {
if (options.supplement) {
this.setData({
showOrderpop: true
})
checkShowOrderPop(options){
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录
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({
onHide: function () {
// console.log('onHide')
// 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!