| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- const LOGIN_LIST = ['pages/mine/mine']
- /*
- * 全局注入器
- */
- let page = {
- data() {
- return {
- }
- },
- computed: {
- //ios底部安全区域
- safeAreaBottom() {
- let info = uni.getSystemInfoSync()
- let safe = 20
- if (
- info && ['devtools', 'ios'].includes(info.platform) &&
- info.statusBarHeight > safe
- ) {
- return info.statusBarHeight - safe + 'px'
- }
- return 0
- }
- },
- onLoad(options) {
- },
- onShow() {
- let currentPage = this.$util.getCurrentRoute()
- if (LOGIN_LIST.includes(currentPage)) {
- this.login()
- }
- },
- methods: {
- // 登录 begin
- showLogin() {
- this.$refs.login.show()
- },
- signIn(resp) {
- //获取数据
- this.init()
- },
- async login(e) {
- if (this.$isEmpty(this.vuex_userId)) {
- this.showLogin()
- return
- }
- //获取数据
- this.init()
- //获取手机号
- if (this.$isEmpty(this.vuex_phone)) {
- this.$refs.login.showPhoneModal()
- }
- },
- // 登录 end
- },
- }
- export default page
|