Commit 5b6065f4 by 张立顺

Merge branch 'dev_v4.15.9' into 'develop'

Dev v4.15.9

See merge request !28
2 parents feb3f027 abc7a286
...@@ -19,6 +19,12 @@ module.exports = { ...@@ -19,6 +19,12 @@ module.exports = {
getSMS(data) { getSMS(data) {
return api.post('dj.api.smartcarlife.sms.get.code', data) return api.post('dj.api.smartcarlife.sms.get.code', data)
}, },
/** 免登录 */
noLogin(data) {
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.sms.not.code.login', data)
},
/**手机验证码登录 /1.0.0 */ /**手机验证码登录 /1.0.0 */
smsLogin(data = {}) { smsLogin(data = {}) {
data.source = 'MINIAPP' data.source = 'MINIAPP'
......
...@@ -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 = 2
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
...@@ -65,7 +65,8 @@ const secretKey_items = { ...@@ -65,7 +65,8 @@ const secretKey_items = {
const domain_items = { const domain_items = {
// ip: 'http://192.168.2.59:8292', // ip: 'http://192.168.2.59:8292',
// ip: 'http://192.168.1.129:8392', // ip: 'http://192.168.1.129:8392',
ip: 'http://192.168.1.129:8292', // ip: 'http://192.168.1.129:8292',
ip: 'http://192.168.1.165:8292',
// ip: 'http://192.168.2.3:8292', // ip: 'http://192.168.2.3:8292',
dev: 'https://dj.dev.glsx.com.cn', dev: 'https://dj.dev.glsx.com.cn',
uat: 'https://dj.test.glsx.com.cn', uat: 'https://dj.test.glsx.com.cn',
...@@ -73,7 +74,7 @@ const domain_items = { ...@@ -73,7 +74,7 @@ const domain_items = {
prod: 'https://dj.glsx.com.cn', prod: 'https://dj.glsx.com.cn',
preRelease: 'https://dj.beta.glsx.com.cn' preRelease: 'https://dj.beta.glsx.com.cn'
} }
const target = ['ip', 'dev', 'uat', 'prod','preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
// console.log(domain_items[target[index]]); // console.log(domain_items[target[index]]);
module.exports = { module.exports = {
domain: domain_items[target[index]], domain: domain_items[target[index]],
......
{
"dependencies": {
"bignumber.js": "^9.1.1"
}
}
...@@ -13,7 +13,95 @@ Page({ ...@@ -13,7 +13,95 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.getListSelectAccount() console.log(options)
// let { noLogin } = options
let id = decodeURIComponent(options.scene).split('=')[1]
// noLogin
console.log(id)
id ? this.qrCodeScene(id) : this.getListSelectAccount()
// this.getListSelectAccount()
},
// 免登录逻辑
qrCodeScene(id) {
api
.getSceneById({
id,
channelType: 1
})
.then(res => {
// debugger
// res => {
console.log(res)
let { code, data } = res
let op = {}
if (code == '0') {
if (data) {
data.split('&').map(item => {
const [key, val] = item.split('=')
op[key] = val
})
this.setData(
{
...op
},
() => {
this.noLoginFn()
}
)
console.log(op)
}
}
// }
})
.catch(err => {})
},
noLoginFn() {
let that = this
let { noLogin } = this.data
wx.$util.showLoading()
api
.noLogin({
mobile: noLogin
})
.then(result => {
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId } = result.data
if (loginUserInfoList.length > 0) {
wx.$util.setSessionId(sessionId)
// loginUserInfoList.map
loginUserInfoList.map(item => {
if (item.userType == 2) {
item.active = true
}
return item
})
that.setData(
{
loginUserInfoList
},
() => {
that.choiceAccountLogin()
}
)
// else {
// wx.$router.reLaunch('pages.nothing')
// }
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: result.message,
showCancel: false,
confirmText: '知道了',
confirmColor: '#3582EE'
})
}
}
})
.catch(err => {
wx.hideLoading()
})
}, },
getListSelectAccount() { getListSelectAccount() {
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
...@@ -64,14 +152,13 @@ Page({ ...@@ -64,14 +152,13 @@ Page({
let { data, message } = res let { data, message } = res
if (data) { if (data) {
// wx.$util.setWebSocket() // wx.$util.setWebSocket()
wx.$util.setUserInfo(data.loginUserInfoList[0]) wx.$util.setUserInfo(data.loginUserInfoList[0])
// 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 && SCENE.path != 'pages/accountItems/accountItems') {
let { let {
path, path,
query query
......
...@@ -112,6 +112,20 @@ ...@@ -112,6 +112,20 @@
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
},
{
"name": "",
"pathName": "pages/wxLogin/wxLogin",
"query": "noLogin=15626599738",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/accountItems/accountItems",
"query": "noLogin=15626599738",
"launchMode": "default",
"scene": null
} }
] ]
} }
......
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
bignumber.js@^9.1.1:
version "9.1.1"
resolved "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6"
integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!