zh
小钻风 4 years ago
parent 0f1316027c
commit 8db34b8302

@ -1,81 +1,88 @@
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch')
// uni.getSystemInfo({ //
// success: function(e) { if (uni.getStorageSync("userInfo").invitationNo) {
// // #ifndef MP this.$store.commit('setinvitationNo', uni.getStorageSync("userInfo").invitationNo);
// Vue.prototype.StatusBar = e.statusBarHeight; }
// if (e.platform == 'android') { if( uni.getStorageSync("userInfo").roleLevel){
// Vue.prototype.CustomBar = e.statusBarHeight + 50; this.$store.commit('setRoleLevel', uni.getStorageSync("userInfo").roleLevel);
// } else { }
// Vue.prototype.CustomBar = e.statusBarHeight + 45; // uni.getSystemInfo({
// }; // success: function(e) {
// // #endif // // #ifndef MP
// // #ifdef MP-WEIXIN // Vue.prototype.StatusBar = e.statusBarHeight;
// Vue.prototype.StatusBar = e.statusBarHeight; // if (e.platform == 'android') {
// let custom = wx.getMenuButtonBoundingClientRect(); // Vue.prototype.CustomBar = e.statusBarHeight + 50;
// Vue.prototype.Custom = custom; // } else {
// Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight; // Vue.prototype.CustomBar = e.statusBarHeight + 45;
// // #endif // };
// // #ifdef MP-ALIPAY // // #endif
// Vue.prototype.StatusBar = e.statusBarHeight; // // #ifdef MP-WEIXIN
// Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight; // Vue.prototype.StatusBar = e.statusBarHeight;
// // #endif // let custom = wx.getMenuButtonBoundingClientRect();
// } // Vue.prototype.Custom = custom;
// }) // Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
}, // // #endif
onShow: function() { // // #ifdef MP-ALIPAY
console.log('App Show') // Vue.prototype.StatusBar = e.statusBarHeight;
}, // Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
onHide: function() { // // #endif
console.log('App Hide') // }
} // })
} },
</script> onShow: function() {
console.log('App Show')
<style lang="scss"> },
/*每个页面公共css */ onHide: function() {
@import "colorui/main.css"; console.log('App Hide')
@import "colorui/icon.css"; }
@import "uview-ui/index.scss"; }
@import "common/iconfont.css"; </script>
<style lang="scss">
page { /*每个页面公共css */
background-color: #F5F5F5; @import "colorui/main.css";
font-size: 30rpx; @import "colorui/icon.css";
} @import "uview-ui/index.scss";
@import "common/iconfont.css";
/* 全局公共样式类 */
.text-hidden {
white-space: nowrap; page {
text-overflow: ellipsis; background-color: #F5F5F5;
overflow: hidden; font-size: 30rpx;
} }
.two-line { /* 全局公共样式类 */
overflow: hidden; .text-hidden {
text-overflow: ellipsis; white-space: nowrap;
display: -webkit-box; text-overflow: ellipsis;
-webkit-line-clamp: 2; overflow: hidden;
-webkit-box-orient: vertical; }
}
.two-line {
.clear { overflow: hidden;
overflow: hidden; text-overflow: ellipsis;
} display: -webkit-box;
-webkit-line-clamp: 2;
.bg-img { -webkit-box-orient: vertical;
background-position: center; }
background-size: cover;
background-repeat: no-repeat; .clear {
background-color: #F5F5F5; overflow: hidden;
} }
image { .bg-img {
display: block; background-position: center;
height: auto; background-size: cover;
// background-color: #ffffff; background-repeat: no-repeat;
} background-color: #F5F5F5;
}
image {
display: block;
height: auto;
// background-color: #ffffff;
}
</style> </style>

@ -310,10 +310,7 @@
text: "设置", text: "设置",
page: "/pages/settings/settings" page: "/pages/settings/settings"
} }
], ],
roleLevel: 500, roleLevel: 500,
showTipModel: false, showTipModel: false,
info: {}, info: {},
@ -328,9 +325,15 @@
orderNum: 0 orderNum: 0
} }
}; };
},
created() {
this.$store.commit('setIsLogin')
this.isLogin = this.$store.state.isLogin
console.log(this.$store.state.isLogin)
this.roleLevel = this.$store.state.roleLevel
}, },
onLoad() { onLoad() {
if (uni.getStorageSync("auth").token) { if (this.isLogin) {
this.getUserInfo() this.getUserInfo()
this.getTotalEarning() this.getTotalEarning()
} }
@ -347,9 +350,7 @@
*/ */
}, },
onShow() { onShow() {
console.log(uni.getStorageSync("auth")) if (this.isLogin) {
if (uni.getStorageSync("auth").token) {
this.isLogin = true
this.userInfo.nickname = uni.getStorageSync("userInfo").nickname this.userInfo.nickname = uni.getStorageSync("userInfo").nickname
this.userInfo.headImgUrl = uni.getStorageSync("userInfo").headImgUrl this.userInfo.headImgUrl = uni.getStorageSync("userInfo").headImgUrl
this.myIncome() this.myIncome()

@ -1,58 +1,66 @@
import Vue from "vue" //引入vue import Vue from "vue" //引入vue
import Vuex from "vuex" // 引入vuex import Vuex from "vuex" // 引入vuex
Vue.use(Vuex) // 让vue使用vuex Vue.use(Vuex) // 让vue使用vuex
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
selectCity:"",//城市信息 selectCity: "", //城市信息
preOrderMsg: {},//预购订单信息 preOrderMsg: {}, //预购订单信息
returnGoodsMsg:{},//售后商品信息 returnGoodsMsg: {}, //售后商品信息
logisticsDetail:[],//物流信息 logisticsDetail: [], //物流信息
userInfo:{},//邀请人的信息 userInfo: {}, //邀请人的信息
videoDetail:{},//小视频详情 videoDetail: {}, //小视频详情
invitationNo: '' ,// 本人邀请码 invitationNo: '', // 本人邀请码
roleLevel:500,//用户等级默认设置会员 invite: '', // 别人的邀请码
invite: '' ,// 别人的邀请码 url: null, // 跳转到登录页面时原地址
url: null, // 跳转到登录页面时原地址 roleLevel: 500, //用户等级默认设置会员
}, isLogin: false,
mutations: { },
setRoleLevel(state, val){ mutations: {
state.roleLevel = val setIsLogin(state) {
}, if (uni.getStorageSync("auth").token) {
changeCity(state, name) { state.isLogin = true
state.selectCity = name } else {
}, state.isLogin = false
updatePreOrderMsg(state, obj) { }
let newObj = Object.assign({}, obj) },
state.preOrderMsg = newObj setRoleLevel(state, val) {
}, state.roleLevel = val
setReturnGoodsMsg(state,obj){ },
let newObj = Object.assign({}, obj) changeCity(state, name) {
state.returnGoodsMsg = newObj state.selectCity = name
}, },
setLogisticsDetail(state,arr){ updatePreOrderMsg(state, obj) {
let newArr = arr let newObj = Object.assign({}, obj)
state.logisticsDetail = newArr state.preOrderMsg = newObj
}, },
setUserInfo(state,obj){ setReturnGoodsMsg(state, obj) {
let newObj = Object.assign({}, obj) let newObj = Object.assign({}, obj)
state.userInfo = newObj state.returnGoodsMsg = newObj
}, },
setVideoDetail(state,obj){ setLogisticsDetail(state, arr) {
let newObj = Object.assign({}, obj) let newArr = arr
state.videoDetail = newObj state.logisticsDetail = newArr
}, },
setinvitationNo(state,val){ setUserInfo(state, obj) {
state.invitationNo = val let newObj = Object.assign({}, obj)
}, state.userInfo = newObj
setinvite(state,val){ },
state.invite = val setVideoDetail(state, obj) {
}, let newObj = Object.assign({}, obj)
setUrl(state, val) { state.videoDetail = newObj
state.url = val },
}, setinvitationNo(state, val) {
removeUrl(state) { state.invitationNo = val
state.url = null },
} setinvite(state, val) {
} state.invite = val
}) },
setUrl(state, val) {
state.url = val
},
removeUrl(state) {
state.url = null
}
}
})
export default store export default store

Loading…
Cancel
Save