Commit 996d6872 authored by June's avatar June

fixed

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