代码拉取完成,页面将自动刷新
/**
* @Description: WoShop商城
* @Author: Parker
* @Copyright: 武汉一一零七科技有限公司©版权所有
* @Link: www.wo-shop.net
* @Contact: QQ:2487937004
*/
<script>
// #ifdef APP-PLUS
import APPUpdate from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
// #endif
export default {
data() {
return {
msg: {}
};
},
onLaunch(option) {
if(typeof(option.query.token) != 'undefined'){
uni.setStorageSync('shop_token',option.query.token);
}
// this.$store.dispatch("getShowConfig");
// #ifdef APP-PLUS
APPUpdate();
// #endif
const token = uni.getStorageSync('shop_token');
if (token) {
this.$store.commit('loginStatus', true)
this.im();
}else{
uni.closeSocket({
success() {
console.log('socket关闭成功');
},
fail(res) {
console.log(res);
}
})
// #ifdef MP-WEIXIN
uni.switchTab({
url: '/pages/tabBar/my'
});
// #endif
// #ifndef MP-WEIXIN
uni.redirectTo({
url: '/pagesB/login/login'
});
// #endif
}
// #ifdef APP-PLUS
var info = plus.push.getClientInfo();
var options = {
cover: true
};
plus.push.setAutoNotification(true);
plus.push.addEventListener(
"click",
function(msg) {
uni.navigateTo({
url: "/pagesB/message/message"
});
},
false
);
//监听在线消息事件
plus.push.addEventListener(
"receive",
function(msg) {
if (msg.payload !== "LocalMSG") {
plus.push.createMessage(msg.content, "LocalMSG", options);
}
},
false
);
// #endif
},
methods: {
},
// vue组件错误捕捉
errorCaptured(err, vm, info){
console.error('errorCaptured----', err, vm, info)
return false
},
warnHandler(err, vm, info){
console.warn('warnHandler----', err, vm, info)
return false
},
onError(e) {
console.log('监听到error')
},
onUnhandledRejection() {
console.log('监听Promise 拒绝事件', e)
// ... Promise 错误处理
},
onPageNotFound(e) {
this.$toast('当前页面不存在', e)
console.log('当前页面不存在', e);
}
};
</script>
<style lang="less">
@import "/static/css/global.css";
/* #ifndef APP-NVUE */
@import "./static/css/index.less";
@import "graceUI/graceUI.css";
@import "/static/css/iconfont.css";
/deep/ .u-subsection .u-item-text {
justify-content: center;
}
/deep/::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
uni-toast {
z-index: 100000;
}
.select.active {
background-image: url("/static/images/choosed-red.png");
}
.underLine.active {
background: rgba(250, 62, 63, 1);
}
.span weixin-parse-template {
margin: 0 !important;
}
.u-flex-1{
flex:1
}
page {
background: #F3F4F6;
}
/* #endif */
/* #ifdef H5 */
uni-page-head .uni-page-head__title {
font-weight: normal;
color: rgb(96, 98, 102);
}
/* #endif */
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。