2 Star 0 Fork 0

macroswang/mshop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
App.vue 3.09 KB
一键复制 编辑 原始数据 按行查看 历史
macroswang 提交于 2023-12-27 21:57 . init
/**
* @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>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/macroswang/mshop.git
git@gitee.com:macroswang/mshop.git
macroswang
mshop
mshop
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385