Commit 996d6872 authored by June's avatar June

fixed

parent 6a6e4ebd
<script>
import { mapActions } from 'vuex'
import { mapActions, mapState } from 'vuex'
import { login_wx } from '@/utils/modules/login.js'
import dayjs from 'dayjs'
import { removeStorage } from '@/lib/storage/index.js'
export default {
onLaunch: function() {
this.checkUpdate() // 检查更新
onLaunch: async function() {
this.setMobileData() // 获取系统信息和胶囊信息
this.checkUpdate() // 检查更新
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync(): {}
console.log(extConfig)
this.$store.state.user.appid = extConfig.appid
const token = this.$getStorage('token')
this.$store.state.user.token = token
this.getStoreInfo() // 这个接口一定要先获取,因为如果店铺过期,有一个接口返回-11,后续所有接口不会再发起请求
this.getStoreInfo() // 这个接口一定要先获取,因为如果店铺过期
// wx.login
login_wx()
......@@ -31,6 +29,12 @@ export default {
})
},
onShow() {
if(!this.$store.state.systemInfo.menuCalcInfo) {
this.setMobileData()
}
},
methods: {
...mapActions('systemInfo', ['setMobileData']),
...mapActions('user', ['setToken', 'setLoginStatus', 'getStoreInfo']),
......
......@@ -47,10 +47,12 @@ export default {
cTitleStyle() {
const { systemInfo, menuButtonInfo, menuCalcInfo } = this.systemInfo
const titleH = menuCalcInfo.navH - systemInfo.statusBarHeight
const v = systemInfo.system.includes('iOS') ? 'center' : 'flex-start'
const lrSpace = systemInfo.windowWidth - menuButtonInfo.right // 左右间距
const v = systemInfo.platform === 'android' ? 'flex-start' : 'center'
return `height: ${titleH}px;font-size: ${systemInfo.fontSizeSetting}px;padding: 0 ${menuCalcInfo.lrSpace}px;justify-content: ${v};margin-top: ${systemInfo.statusBarHeight}px;`
}
},
methods: {
handleBack() {
uni.navigateBack()
......
......@@ -231,10 +231,10 @@ export default {
},
onPageScroll: throttle(function(e) {
const scrollTop = e.scrollTop
if(scrollTop > 400) return
if(scrollTop > 500) return
const opacity = (scrollTop / 375).toFixed(1)
this.navBg = `rgba(255, 255, 255, ${opacity})`
}, 300),
}, 250),
methods: {
// 富文本预览事件
preview(src, e) {
......
......@@ -197,8 +197,7 @@ export default {
data() {
return {
baseUrl,
select_goods: null,
cate_data: null,
cate_data: {},
searchList: [],
navBg: "rgba(255, 255, 255, 0)",
navColor: '#fff',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment