|
|
@ -3,11 +3,37 @@ import { getConfig, setConfig, getCart, getToken ,getCartNumber } from "./utils/
|
|
|
|
import myconfig from "./utils/config";
|
|
|
|
import myconfig from "./utils/config";
|
|
|
|
import request from "./utils/request";
|
|
|
|
import request from "./utils/request";
|
|
|
|
import {setTabBarBadge } from'./utils/util.js'
|
|
|
|
import {setTabBarBadge } from'./utils/util.js'
|
|
|
|
|
|
|
|
import CONFIG from '@/config'
|
|
|
|
uni.$ajax = request; //挂载全局请求方法
|
|
|
|
uni.$ajax = request; //挂载全局请求方法
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
onShow() {
|
|
|
|
onShow() {
|
|
|
|
|
|
|
|
const hasLocalType = uni.getStorageSync('_SH_DPD_1')
|
|
|
|
|
|
|
|
let isDiff = false
|
|
|
|
|
|
|
|
let type = 1
|
|
|
|
|
|
|
|
if (!hasLocalType) {
|
|
|
|
|
|
|
|
isDiff = true
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (CONFIG.isPro && hasLocalType !== 1) {
|
|
|
|
|
|
|
|
isDiff = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!CONFIG.isPro && hasLocalType === 1) {
|
|
|
|
|
|
|
|
isDiff = true
|
|
|
|
|
|
|
|
type = 2
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isDiff) {
|
|
|
|
|
|
|
|
uni.clearStorageSync()
|
|
|
|
|
|
|
|
uni.setStorageSync('_SH_DPD_1', type)
|
|
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
|
|
url: '/pages/login/index1'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!getToken()) {
|
|
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
|
|
url: '/pages/login/index1'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLaunch: function () {
|
|
|
|
onLaunch: function () {
|
|
|
|
|
|
|
|
|
|
|
@ -69,12 +95,7 @@ export default {
|
|
|
|
selectedIconPath: v
|
|
|
|
selectedIconPath: v
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if (!getToken()) {
|
|
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
|
|
url: '/pages/login/index1'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 模拟获取购物车的数量 getCart
|
|
|
|
* 模拟获取购物车的数量 getCart
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -204,6 +225,9 @@ $black: #333333;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&.userbox {
|
|
|
|
&.userbox {
|
|
|
|
|
|
|
|
.userHeader {
|
|
|
|
|
|
|
|
background-color: $color;
|
|
|
|
|
|
|
|
}
|
|
|
|
.iconfont {
|
|
|
|
.iconfont {
|
|
|
|
color: $color;
|
|
|
|
color: $color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|