抖音版适配

master
yujialong 6 months ago
parent eadeccee20
commit 0f1a67fa54
  1. 24
      apis/request.js
  2. 10
      pages.json
  3. 11
      pages/index/index.vue
  4. 5
      pages/workbench/workbench.vue

@ -1,5 +1,6 @@
import config from '@/config/request' import config from '@/config/request'
let HTTP_COUNT = 0 // loading次数 let HTTP_COUNT = 0 // loading次数
let logouted = 0
const request = options => { const request = options => {
HTTP_COUNT++ HTTP_COUNT++
@ -29,18 +30,21 @@ const request = options => {
if (status === 200) { if (status === 200) {
resolve(data) resolve(data)
} else if (status == 401) { } else if (status == 401) {
if (!logouted) {
// 登录过期 // 登录过期
uni.clearStorageSync() // uni.clearStorageSync()
uni.showToast({ // uni.showToast({
title: message, // title: message,
icon: 'none' // icon: 'none'
}) // })
setTimeout(() => { // setTimeout(() => {
uni.navigateTo({ // uni.navigateTo({
url: '../login/login' // url: '../login/login'
}) // })
}, 1500) // }, 1500)
reject(data) reject(data)
logouted = 1
}
} else if (status == 10028 || status == 10014) { // 用户不存在 } else if (status == 10028 || status == 10014) { // 用户不存在
resolve(data) resolve(data)
} else if (!status) { } else if (!status) {

@ -1,18 +1,18 @@
{ {
"pages": [ "pages": [
{ {
"path" : "pages/login/login", "path" : "pages/index/index",
"style" : "style" :
{ {
"navigationBarTitleText": "登录", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/index/index", "path" : "pages/login/login",
"style" : "style" :
{ {
"navigationStyle": "custom", "navigationBarTitleText": "登录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -275,7 +275,7 @@
"current": 0, //list "current": 0, //list
"list": [{ "list": [{
"name": "test", // "name": "test", //
"path": "pages/login/login" // "path": "pages/index/index" //
}] }]
}, },
"globalStyle": { "globalStyle": {

@ -112,8 +112,14 @@
onShow() { onShow() {
this.keyword = '' this.keyword = ''
this.per = true this.per = true
//
if (uni.getStorageSync('token')) {
this.getInfo() this.getInfo()
this.getShopCart() this.getShopCart()
} else {
this.getTags()
this.getProducts()
}
}, },
methods: { methods: {
// //
@ -126,7 +132,7 @@
}, },
// //
getAuth() { getAuth() {
uni.getStorageSync('token') && getUserRolesPermissionMenu({ getUserRolesPermissionMenu({
teamId: this.list.find(e => e.teamId == this.teamId).partnerClassificationId, teamId: this.list.find(e => e.teamId == this.teamId).partnerClassificationId,
platformId: 4 platformId: 4
}).then(({ permissionMenu }) => { }).then(({ permissionMenu }) => {
@ -323,6 +329,9 @@
.all { .all {
font-size: 24rpx; font-size: 24rpx;
border-radius: 20px; border-radius: 20px;
&::after {
border: none;
}
} }
.block { .block {
margin: 20rpx 0; margin: 20rpx 0;

@ -147,12 +147,13 @@
marketingServiceCharge: 0, marketingServiceCharge: 0,
projectBenefit: 0, projectBenefit: 0,
}, },
headerTop: 0 headerTop: '8px',
} }
}, },
onShow() { onShow() {
// #ifdef MP-WEIXIN
this.headerTop = uni.getMenuButtonBoundingClientRect().top + 8 + 'px' this.headerTop = uni.getMenuButtonBoundingClientRect().top + 8 + 'px'
console.log(44, this.headerTop) // #endif
this.per = true this.per = true
this.getInfo() this.getInfo()
}, },

Loading…
Cancel
Save