Commit d79cc5bb by 张立顺

bug修复

1 parent 6edf27d7
import {
checkLoginUserInfo,
setRouteData,
setLoginInfo,
loginModal
} from '../lib/index'
import {
getSessionId,
} from '~/utils/cache/storageApi'
import { checkLoginUserInfo, setRouteData, setLoginInfo, loginModal } from '../lib/index'
import { getSessionId } from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
import { IMG_URL } from '~/utils/constantData'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onLoad(options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
......@@ -39,9 +27,7 @@ Page({
const appEnter = wx.getEnterOptionsSync()
if (appEnter.scene == 1037) {
if (Object.keys(appEnter.referrerInfo).length) {
const {
extraData
} = appEnter.referrerInfo
const { extraData } = appEnter.referrerInfo
if (extraData && Object.keys(extraData).length) this.phoneSmsLogin(extraData)
else this.init()
} else this.init()
......@@ -51,44 +37,31 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
init() {
wx.nextTick(() => {
const sessionId = getSessionId(),
{
url,
targetPath = url ? decodeURIComponent(url) : ''
} = this.options
{ url, targetPath = url ? decodeURIComponent(url) : '' } = this.options
let path = 'pages.index',
obj = {}
if (targetPath) obj.targetPath = targetPath
if (sessionId) {
USERAPI.checkSession().then(({
code
}) => {
USERAPI.checkSession().then(({ code }) => {
if (code == '0') {
if (targetPath) {
path = setRouteData(targetPath).url
......@@ -103,25 +76,14 @@ Page({
autoLogin(obj) {
const autoLoginObject = wx.$storage.get('auto_login_object')
if (autoLoginObject) {
const {
failureTime,
userName,
password
} = autoLoginObject
const { failureTime, userName, password } = autoLoginObject
if (Date.now() < failureTime) {
USERAPI.accountLogin({
userName,
password
}).then(async ({
data,
code,
message
}) => {
}).then(async ({ data, code, message }) => {
if (code == '0' && data.loginUserInfoList.length) {
const {
sessionId,
loginUserInfoList
} = data
const { sessionId, loginUserInfoList } = data
setLoginInfo(loginUserInfoList[0], sessionId)
} else {
try {
......@@ -142,13 +104,10 @@ Page({
phoneSmsLogin(extraData) {
console.log(extraData)
USERAPI.phoneSmsLogin({
mobile: extraData.phone,
code: extraData.smscode
}).then(({
code,
data,
message
}) => {
mobile: extraData.phone,
code: extraData.smscode
})
.then(({ code, data, message }) => {
if (code == '0') checkLoginUserInfo(data)
else {
wx.$api.showToast(message || '系统异常')
......@@ -164,4 +123,4 @@ Page({
}, 1e3)
})
}
})
\ No newline at end of file
})
......@@ -10,6 +10,13 @@ const listObj = Object.freeze([
editLabel: '商户号'
},
{
key: 'actualContactName',
label: '商户账号:'
// placeholder: '请输入您的商户账号',
// editLabel: '商户账号',
// maxLength: 20
},
{
key: 'merchantName',
label: '门店名称:',
placeholder: '请输入您的客户门店简称',
......@@ -128,12 +135,15 @@ Component({
.then(result => {
console.log(result)
let { pages, list, total } = result
console.log(list)
list = list.map(item => {
item.merchantName = item.merchantName || item.actualMerchantName
item.phone = item.phone || item.actualPhone
item.contactName = item.contactName || item.actualContactName
// || item.actualContactName
item.contactName = item.contactName || item.actualAccountName
return item
})
console.log(list)
this.setData({
customerList: pageNum == 1 ? list : [...customerList, ...list],
triggered: false,
......
......@@ -41,7 +41,7 @@
},
{
"name": "客户管理",
"pathName": "pages/mineDetail/customerManagement/customerManagement",
"pathName": "packagesList/mineDetail/pages/customerManagement",
"query": "",
"launchMode": "default",
"scene": null
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!