From 2f53f9c6cd929ef67facbe154f2c94a0ceafc29e Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 6 Aug 2021 11:19:53 +0800 Subject: [PATCH] no message --- app.js | 51 ++++++- pages/home/index/index.wxml | 4 +- pages/home/personal/personal.wxml | 2 +- pages/home/tab1/index.js | 184 ++++--------------------- pages/home/tab1/index.json | 2 +- pages/home/tab1/index.wxml | 20 ++- pages/home/tab1/index.wxss | 9 +- pages/home/tab2/index.js | 101 ++------------ pages/index/index.js | 222 ++++-------------------------- pages/login/index.js | 55 ++------ pages/ztbvip/index.wxss | 21 +-- 11 files changed, 153 insertions(+), 518 deletions(-) diff --git a/app.js b/app.js index 6bb01c5..f664f36 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ //app.js App({ //----------------------------------------------globalData-------------------------------------- - evn: 0,//0:开发环境,1:测试环境,2:生产环境 + evn: 1,//0:开发环境,1:测试环境,2:生产环境 tmplIds: ['SUjEgwDopCv9xkkSZ4KbS0L7XbAiVQor6GmPg14K760'], agentMsgIds: ['kG8DErWDpyzBHCFaLlSKYMF7xVy8UpgogCwV_WSNt10', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'], version: 152, @@ -12,5 +12,54 @@ App({ token: null, isIos: false, kg: 0 + }, + onShow: function() { + const updateManager = wx.getUpdateManager() + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + // console.log('updateManager>>>' + res.hasUpdate) + }) + updateManager.onUpdateReady(function () { + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + }) + if(this.globalData.Custom){ + return + } + wx.getSystemInfo({ + success: e => { + this.globalData.isIos = this.checkIos(e) + this.globalData.dev = e.platform == 'devtools' + + let custom = wx.getMenuButtonBoundingClientRect() + this.globalData.Custom = custom + // 顶部操作栏高度 + this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight + (this.globalData.isIos ? 4 : 0) + let windowHeight = e.windowHeight * (750 / e.windowWidth) + + let safeBottom = e.windowHeight - e.safeArea.bottom + if(safeBottom > e.windowHeight){ + safeBottom = 34 + } + this.globalData.safeBottom = safeBottom * (750 / e.windowWidth) + // 状态栏高度 + this.globalData.StatusBar = e.statusBarHeight * (750 / e.windowWidth) + let statusBarHeight = this.globalData.CustomBar * (750 / e.windowWidth) + this.globalData.statusBarHeight = statusBarHeight + // fragmentHeight:指的是整个页面statusBarHeight以下的高度 + this.globalData.fragmentHeight = windowHeight - statusBarHeight + this.globalData.safeFragmentHeight = windowHeight - statusBarHeight - this.globalData.safeBottom + this.globalData.windowWidth = e.windowWidth + } + }) + }, + checkIos: function (e) { + if ('ios' === e.platform) { + return true + } + if (e.system.startsWith('iOS')) { + return true + } + return false } }) \ No newline at end of file diff --git a/pages/home/index/index.wxml b/pages/home/index/index.wxml index d095703..b030d33 100644 --- a/pages/home/index/index.wxml +++ b/pages/home/index/index.wxml @@ -199,12 +199,12 @@ - + diff --git a/pages/home/personal/personal.wxml b/pages/home/personal/personal.wxml index 82dc156..79eaa1a 100644 --- a/pages/home/personal/personal.wxml +++ b/pages/home/personal/personal.wxml @@ -15,7 +15,7 @@ {{linkman || ''}} --> - + 从业身份 {{userInfo.identityTag || '点击修改从业身份'}} diff --git a/pages/home/tab1/index.js b/pages/home/tab1/index.js index 559c403..42defac 100644 --- a/pages/home/tab1/index.js +++ b/pages/home/tab1/index.js @@ -1,100 +1,26 @@ // pages/home/tab1/index.js -import { - updateUserInfo, - getBaseInfo, - postRelation -} from '../../api/ztb' -const storage = require('../../../utils/storage') +import { updateUserInfo, getBaseInfo } from '../../api/ztb' const util = require('../../../utils/util') -const math = require('../../../utils/math') -const event = require('../../../utils/event.js') const app = getApp() -Page({ +Page({ /** * 页面的初始数据 */ data: { + safeBottom: app.globalData.safeBottom, bidType: 0, - identityTag: '', - isFristLogin:false, - + identityTag: '' }, - /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.setData({ - isFristLogin:storage.get('isfirstlogin') - }) + this.setData({ safeBottom: app.globalData.safeBottom }) this.getUerInfoFct() }, toNextTab: function () { - wx.navigateTo({ - url: '/pages/home/tab2/index' - }) - }, - toMyInfo: function () { - wx.redirectTo({ - url: '/pages/index/index' - }) - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, - // 分享至朋友圈 - onShareTimeline() { - - }, - backspace: function () { - return - + wx.redirectTo({ url: '/pages/home/tab2/index' }) }, onTabChangeTop: function (e) { if (this.data.bidType == Number(e.currentTarget.dataset.index)) { @@ -102,103 +28,45 @@ Page({ } var tabIndex = Number(e.currentTarget.dataset.index) this.data.firstCategoryId = '' - this.setData({ - ['bidType']: tabIndex - }) - var model = { - identityTag: '' - } + this.setData({ ['bidType']: tabIndex }) if (this.data.bidType == 1) { - model.identityTag = '打包站' - this.submitForm(model) + this.data.identityTag = '打包站' + this.submitForm() } if (this.data.bidType == 2) { - model.identityTag = '废品站' - this.submitForm(model) + this.data.identityTag = '废品站' + this.submitForm() } if (this.data.bidType == 3) { - model.identityTag = '废纸厂' - this.submitForm(model) + this.data.identityTag = '废纸厂' + this.submitForm() } }, - submitForm: function (model) { - console.log(model) - updateUserInfo(model).then(result => { - this.data.loopRequesting = false + submitForm: function () { + this.setData({ requesting: true}) + updateUserInfo({ identityTag: this.data.identityTag }).then(result => { + this.setData({ requesting: false}) setTimeout(() => this.toNextTab(), 200) }).catch(err => { - this.data.loopRequesting = false + util.showToast(err) + this.setData({ requesting: false}) }) }, - bindblur: function (e) { - var model = { - identityTag: e.detail.value - } - this.submitForm(model) + onInput: function (e) { + this.data.identityTag = e.detail.value }, getUerInfoFct: function () { getBaseInfo().then(res => { - if(res.data.hasShowedLoginTag==false||this.data.isFristLogin){ - this.showDialog() - } if (res.data.identityTag == '打包站') { - this.setData({ - bidType: 1 - }) - + this.setData({ bidType: 1 }) } else if (res.data.identityTag == '废品站') { - this.setData({ - bidType: 2 - }) - + this.setData({ bidType: 2 }) } else if (res.data.identityTag == '造纸厂') { - this.setData({ - bidType: 3 - }) - + this.setData({ bidType: 3 }) } else { - this.setData({ - bidType: 4, - identityTag: res.data.identityTag - }) - + this.setData({ bidType: 4, identityTag: res.data.identityTag }) } }) - }, - showDialog: function(){ - this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') - var that = this - this.wuxDialog.prompt({ - resetOnClose: false, - maskClosable: false, - title: '邀请码', - // content: '联系相关业务人员获取邀请码', - placeholder: '填写业务人员邀请码(必填)', - maxlength: 6, - onConfirm(e, response) { - if(util.isEmpty(response)){ - util.showToast('请输入邀请码') - that.showDialog() - return - } - that.bindRelation(response) - }, - onCancel(){ - - } - }) - }, - bindRelation: function(code){ - wx.showLoading({ title: '处理中', mask: true }) - postRelation(code).then(result => { - //成功回调 - wx.hideLoading() - }).catch(err => { - //异常回调 - wx.hideLoading() - util.showToast(err) - this.showDialog() - }) - }, + } }) \ No newline at end of file diff --git a/pages/home/tab1/index.json b/pages/home/tab1/index.json index ff98b1d..353a2e4 100644 --- a/pages/home/tab1/index.json +++ b/pages/home/tab1/index.json @@ -1,5 +1,5 @@ { "usingComponents": { - "wux-dialog": "/components/dialog/index" + "wux-button": "/components/button/index" } } \ No newline at end of file diff --git a/pages/home/tab1/index.wxml b/pages/home/tab1/index.wxml index 8bd2724..ba32541 100644 --- a/pages/home/tab1/index.wxml +++ b/pages/home/tab1/index.wxml @@ -1,14 +1,13 @@ - - + 身份 - + HI,\n欢迎使用纸通宝\n开启一站式废纸交易 @@ -56,8 +55,15 @@ - - + + + + - \ No newline at end of file + + + + 提交 + + \ No newline at end of file diff --git a/pages/home/tab1/index.wxss b/pages/home/tab1/index.wxss index 4132b1c..204b4fb 100644 --- a/pages/home/tab1/index.wxss +++ b/pages/home/tab1/index.wxss @@ -26,15 +26,14 @@ page{ height: 258rpx; float: left; padding-left: 48rpx; - padding-top: 60rpx; + padding-top: 32rpx; font-size: 44rpx; color: #000000; font-family: PingFangSC-Medium; } .mid { - height: 150rpx; - padding-top: 100rpx; + padding-top: 48rpx; padding-left: 48rpx; font-family: PingFangSC-Medium; font-size: 36rpx; @@ -93,5 +92,7 @@ page{ padding: 22px 33px 22px 33px; } .otherInpt{ - padding-left: 48rpx; + height: 72rpx; + padding: 0rpx 24rpx; + border: 1rpx solid #f3f3f3; } \ No newline at end of file diff --git a/pages/home/tab2/index.js b/pages/home/tab2/index.js index bf24244..c6f9417 100644 --- a/pages/home/tab2/index.js +++ b/pages/home/tab2/index.js @@ -1,12 +1,8 @@ // pages/home/tab2/index.js -import { - updateUserInfo, - getBaseInfo -} from '../../api/ztb' -const storage = require('../../../utils/storage') +import { updateUserInfo, getBaseInfo } from '../../api/ztb' import regions from '../../../utils/region' -Page({ +Page({ /** * 页面的初始数据 */ @@ -35,85 +31,19 @@ Page({ this.getUerInfoFct() this.cascaderView = this.cascaderView || this.selectComponent('#wux-cascader') this.pickerView = this.pickerView || this.selectComponent('#picker-view') - }, toNextTab: function () { - wx.navigateTo({ - url: '/pages/home/tab3/index' - }) + wx.navigateTo({ url: '/pages/home/tab3/index' }) }, toMyInfo: function () { - wx.redirectTo({ - url: '/pages/index/index' - }) - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, - // 分享至朋友圈 - onShareTimeline() { - - }, - backspace: function () { - console.log('点击返回被触发2') - wx.redirectTo({ - url: '/pages/home/tab1/index' - }) - + wx.redirectTo({ url: '/pages/index/index' }) }, showRegion: function () { if (this.data.disabled) { return } this.cascaderView.showPicker(this.data.region) - this.setData({ - picking: true - }) + this.setData({ picking: true }) }, onRegionChange: function (e) { if (e.detail && e.detail.options) { @@ -124,14 +54,10 @@ Page({ this.data.form['locDistrictId'] = e.detail.value[2] this.data.form['locDistrictName'] = e.detail.options[2].label this.setData({ - picking: false - }) - this.setData({ - 'form.areaStr': e.detail.options[0].label + e.detail.options[1].label - }) - this.submitForm({ - locateCityTag: this.data.form.locCityId + picking: false, + ['form.areaStr']: e.detail.options[0].label + e.detail.options[1].label }) + this.submitForm({ locateCityTag: this.data.form.locCityId }) } }, submitForm: function (model) { @@ -145,11 +71,12 @@ Page({ }, getUerInfoFct: function () { getBaseInfo().then(res => { - this.setData({ - region: [res.data.locateCityTag.provinceId, res.data.locateCityTag.cityId, res.data.locateCityTag.districtId], - 'form.areaStr': res.data.locateCityTag.provinceName + res.data.locateCityTag.cityName - }) - console.log(this.data.region) + if(res.data.locateCityTag) { + this.setData({ + region: [res.data.locateCityTag.provinceId, res.data.locateCityTag.cityId, res.data.locateCityTag.districtId], + 'form.areaStr': res.data.locateCityTag.provinceName + res.data.locateCityTag.cityName + }) + } }) } }) \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index c8090b6..3db523a 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,24 +1,7 @@ -import { - config, - getUserInfo -} from "../api/user" -import { - zconfig, - loginToken, - getBaseInfo, - getPopupInfo, - updateUserInfo -} from "../api/ztb" -import { - pconfig -} from "../api/payment" -import { - mconfig -} from "../api/moment" -import { - sconfig, - getOrderExists -} from "../api/saas" +import { config, getUserInfo } from "../api/user" +import { zconfig, loginToken, getBaseInfo, getPopupInfo } from "../api/ztb" +import { pconfig } from "../api/payment" +import { mconfig } from "../api/moment" const util = require('../../utils/util') const event = require('../../utils/event') const storage = require('../../utils/storage') @@ -26,47 +9,19 @@ const app = getApp() Page({ data: { - TabList: [{ - index: 0, - value: 'article', - badge: 0, - name: '情报' - }, - { - index: 1, - value: 'mall', - badge: 0, - name: '交易' - }, - { - index: 2, - value: 'home', - badge: 0, - name: '我的' - } + TabList: [{ index: 0, value: 'article', badge: 0, name: '情报' }, + { index: 1, value: 'mall', badge: 0, name: '交易' }, + { index: 2, value: 'home', badge: 0, name: '我的' } ], pageIndex: 1, safeBottom: app.globalData.safeBottom, inited: false, path: null, landInfo: null, - visible: false, - - hasShowedLoginTag: false, //是否已展示过登陆标签填写页面 - isTokenHaveStatus: false, + visible: false }, /************************************** 初始化流程 ********************************************/ onLoad: function (options) { - storage.put('isTokenHaveStatus', false) - const updateManager = wx.getUpdateManager() - updateManager.onCheckForUpdate(function (res) { - // 请求完新版本信息的回调 - // console.log('updateManager>>>' + res.hasUpdate) - }) - updateManager.onUpdateReady(function () { - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 - updateManager.applyUpdate() - }) if (options.url) { this.data.path = options.url if (options.key && options.value) { @@ -74,70 +29,20 @@ Page({ } } event.on('EventMessage', this, this.onEvent) - }, - onReady: function () { - wx.showLoading({ - title: '获取中', - mask: true - }) - wx.getSystemInfo({ - success: e => { - app.globalData.isIos = this.checkIos(e) - app.globalData.dev = e.platform == 'devtools' - - let custom = wx.getMenuButtonBoundingClientRect() - app.globalData.Custom = custom - // 顶部操作栏高度 - app.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight + (app.globalData.isIos ? 4 : 0) - let windowHeight = e.windowHeight * (750 / e.windowWidth) - - let safeBottom = e.windowHeight - e.safeArea.bottom - if (safeBottom > e.windowHeight) { - safeBottom = 34 - } - app.globalData.safeBottom = safeBottom * (750 / e.windowWidth) - // 状态栏高度 - app.globalData.StatusBar = e.statusBarHeight * (750 / e.windowWidth) - let statusBarHeight = app.globalData.CustomBar * (750 / e.windowWidth) - app.globalData.statusBarHeight = statusBarHeight - // fragmentHeight:指的是整个页面statusBarHeight以下的高度 - app.globalData.fragmentHeight = windowHeight - statusBarHeight - app.globalData.safeFragmentHeight = windowHeight - statusBarHeight - app.globalData.safeBottom - app.globalData.windowWidth = e.windowWidth - - this.data.inited = true - const fheght = (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight) - 100 - event.emit('InitMessage', { - what: 8, - desc: 'Logined' - }) - this.setData({ - fragment: fheght, - safeBottom: app.globalData.safeBottom - }) - var authorization = app.globalData.token || storage.get('Authorization') - if (authorization) { - app.globalData.token = authorization - this.fetchUserInfo() - } else { - this.toIndex() - } - } - }) - }, - checkIos: function (e) { - if ('ios' === e.platform) { - return true - } - if (e.system.startsWith('iOS')) { - return true + this.data.inited = true + wx.showLoading({ title: '获取中', mask: true }) + const fheght = (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight) - 100 + this.setData({ fragment: fheght, safeBottom: app.globalData.safeBottom }) + var authorization = app.globalData.token || storage.get('Authorization') + if (authorization) { + app.globalData.token = authorization + this.fetchUserInfo() + } else { + this.toIndex() } - return false }, fetchUserInfo: function () { - config.header = { - 'Authorization': 'QNT ' + app.globalData.token - } + config.header = { 'Authorization': 'QNT ' + app.globalData.token } getUserInfo().then(result => { this.toIndex() }).catch(err => { @@ -147,15 +52,11 @@ Page({ defaultIndex: function () { this.onResume() if (this.data.path) { - wx.navigateTo({ - url: this.data.path - }) + wx.navigateTo({ url: this.data.path }) } getPopupInfo().then(result => { if (result.data) { - this.setData({ - landInfo: result.data - }) + this.setData({ landInfo: result.data }) } }) }, @@ -169,15 +70,12 @@ Page({ zconfig.header = { 'Authorization': 'QNT ' + result.data.token } pconfig.header = { 'Authorization': 'QNT ' + result.data.token } mconfig.header = { 'Authorization': 'QNT ' + result.data.token } - storage.put('isTokenHaveStatus', true) - // 登录流程完成; - if(!util.isEmpty(result.data.userToken)){ - this.handleUserToken(result.data.userToken) - return - } getBaseInfo().then(result => { app.globalData.userInfo = result.data wx.hideLoading() + if(app.globalData.userInfo.hasShowedLoginTag == false){ + wx.navigateTo({ url: '/pages/home/tab1/index' }) + } this.defaultIndex() }).catch(err => { wx.hideLoading() @@ -188,36 +86,6 @@ Page({ this.defaultIndex() }) }, - handleUserToken: function (userToken) { - sconfig.header = { - 'user-token': userToken - } - getOrderExists().then(result => { - if (Number(result.data) != 1 || !app.evn) { - getBaseInfo().then(result => { - app.globalData.userInfo = result.data - wx.hideLoading() - this.defaultIndex() - }).catch(err => { - wx.hideLoading() - this.defaultIndex() - }) - } else { - getBaseInfo().then(result => { - app.globalData.userInfo = result.data - wx.hideLoading() - wx.redirectTo({ url: '/pages/paper/index' }) - }).catch(err => { - wx.hideLoading() - wx.redirectTo({ url: '/pages/paper/index' }) - }) - } - }).catch(err => { - wx.hideLoading() - util.showToast(err) - this.defaultIndex() - }) - }, onResume: function () { var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value) if (pageView && this.data.inited) { @@ -227,9 +95,7 @@ Page({ //事件处理函数 onNavChange: function (e) { // 处理用户的登录校验 - this.setData({ - pageIndex: Number(e.currentTarget.dataset.tab) - }) + this.setData({ pageIndex: Number(e.currentTarget.dataset.tab) }) this.onResume() }, /** @@ -239,33 +105,13 @@ Page({ if (this.data.inited) { this.onResume() } - // wx.navigateTo({ url: '/pages/home/tab1/index' }) - var a=storage.get('isTokenHaveStatus') - if(a==true && app.globalData.token){ - getBaseInfo().then(result => { - this.setData({ - hasShowedLoginTag: result.data.hasShowedLoginTag - }) - if (this.data.hasShowedLoginTag == false) { - this.updateUserInfoFct({ - hasShowedLoginTag: true - }) - storage.put('isfirstlogin',true) - wx.navigateTo({ - url: '/pages/home/tab1/index' - }) - } - }) + if(app.globalData.userInfo && app.globalData.userInfo.hasShowedLoginTag == false){ + wx.navigateTo({ url: '/pages/home/tab1/index' }) } }, - updateUserInfoFct: function (model) { - updateUserInfo(model).then(result => {}) - }, onEvent: function (message) { if(message.what == 250){ this.setData({ pageIndex: 0 }) - } else if(message.what == 884){ - wx.navigateBack() } }, stopTouchMove: function (e) { @@ -273,15 +119,10 @@ Page({ }, // 弹出框的处理; onClose: function () { - this.setData({ - visible: false, - landInfo: null - }) + this.setData({ visible: false, landInfo: null }) }, onImageLoad: function () { - this.setData({ - visible: true - }) + this.setData({ visible: true }) }, onImageClick: function () { if (this.data.landInfo.redirectInfo.targetView == 'showH5') { @@ -289,10 +130,7 @@ Page({ return } util.navigateTarget(this.data.landInfo.redirectInfo) - this.setData({ - visible: false, - landInfo: null - }) + this.setData({ visible: false, landInfo: null }) }, toRule: function () { if (this.data.landInfo.ruleRedirectInfo.targetView == 'showH5') { diff --git a/pages/login/index.js b/pages/login/index.js index 17525af..fc13d45 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -21,10 +21,7 @@ import { import { mconfig } from "../api/moment" -import { - sconfig, - getOrderExists -} from "../api/saas" +import { sconfig } from "../api/saas" const storage = require('../../utils/storage') const util = require('../../utils/util') const event = require('../../utils/event') @@ -63,9 +60,7 @@ Page({ wxLogin: function () { wx.login({ success: res => { - wechatApplet({ - authCode: res.code - }).then(result => { + wechatApplet({ authCode: res.code }).then(result => { storage.put('tmpAuthToken', result.data.tmpAuthToken, 98) storage.put('isTokenHaveStatus', true) }) @@ -128,52 +123,20 @@ Page({ }, handleUserToken: function (userToken) { storage.put('userToken', userToken) - sconfig.header = { - 'user-token': userToken - } - getOrderExists().then(result => { + sconfig.header = { 'user-token': userToken } + getBaseInfo().then(result => { + app.globalData.userInfo = result.data + this.setData({ loging: false}) wx.hideLoading() - if (Number(result.data) != 1 || !app.evn) { - getBaseInfo().then(result => { - app.globalData.userInfo = result.data - this.setData({ loging: false}) - wx.hideLoading() - wx.navigateBack() - event.emit('EventMessage', { what: 888, desc: 'Logined' }) - }).catch(err => { - wx.hideLoading() - util.showToast(err) - app.globalData.token = null - storage.remove('Authorization') - config.header = null - this.setData({ loging: false}) - }) - } else { - getBaseInfo().then(result => { - app.globalData.userInfo = result.data - this.setData({ loging: false}) - wx.hideLoading() - event.emit('EventMessage', { what: 884, desc: 'Logined' }) - wx.redirectTo({ url: '/pages/paper/index' }) - }).catch(err => { - wx.hideLoading() - util.showToast(err) - app.globalData.token = null - storage.remove('Authorization') - config.header = null - this.setData({ loging: false}) - }) - } + wx.navigateBack() + event.emit('EventMessage', { what: 888, desc: 'Logined' }) }).catch(err => { wx.hideLoading() util.showToast(err) app.globalData.token = null storage.remove('Authorization') config.header = null - this.setData({ - loging: false - }) - wx.navigateBack() + this.setData({ loging: false}) }) }, changePwd: function () { diff --git a/pages/ztbvip/index.wxss b/pages/ztbvip/index.wxss index 416d176..a881921 100644 --- a/pages/ztbvip/index.wxss +++ b/pages/ztbvip/index.wxss @@ -1,14 +1,5 @@ /* pages/ztbvip/index.wxss */ - -.header-bg { - margin-top: 0px; - width: 100%; - height: 80px; - background: linear-gradient(314deg, rgba(50, 107, 250, 1) 0%, rgba(0, 138, 255, 1) 100%); - border-bottom-left-radius: 64rpx; - border-bottom-right-radius: 64rpx; -} - + .header-box { width: 700rpx; height: 335rpx; @@ -19,15 +10,7 @@ border-radius: 6px; */ } -.userinfo-avatar { - overflow: hidden; - width: 120rpx; - height: 120rpx; - border-radius: 12rpx; - border: 2px solid #fff; - box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2); -} - + .account-bg { background: linear-gradient(314deg, rgba(50, 107, 250, 1) 0%, rgba(0, 138, 255, 1) 100%); border-radius: 6px;