13 Star 109 Fork 71

海盐芝士不加糖 / zwmall-uni

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
App.vue 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
海盐芝士不加糖 提交于 2020-07-27 14:23 . 修复已知问题
<script>
export default {
onLaunch() {
// 初始化登录信息
this.initLoginUser();
// 初始化购物车
this.initCart();
},
onPageNotFound() {
// 页面不存在时自动重定向到首页
uni.redirectTo({
url: 'pages/index'
});
},
methods: {
initLoginUser() {
let loginUser = sessionStorage.getItem('loginUser');
if (loginUser) {
loginUser = JSON.parse(loginUser);
if (loginUser.token) this.$store.commit('login', loginUser);
}
},
initCart() {
this.$cart.initCart();
}
}
}
</script>
<style lang="scss">
@import './common/styles/app.scss';
* {
outline: none;
}
body {
height: auto;
min-width: $page-width;
overflow-x: auto;
font-size: 14px;
}
a {
text-decoration: none;
}
button {
font-size: 14px;
transition: all .4s;
border-radius: 0;
&:active {
opacity: .8;
}
&:after {
border: none;
}
}
/* 图片显示模式 */
.thumb {
object-fit: contain;
}
/* 省略长文本 */
.elip {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
JavaScript
1
https://gitee.com/chengdongqing/zwmall-uni.git
git@gitee.com:chengdongqing/zwmall-uni.git
chengdongqing
zwmall-uni
zwmall-uni
master

搜索帮助