1 Star 0 Fork 490

sunhacker / mall4j商城系统Uniapp端-mall4uni

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
App.vue 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
linzj 提交于 2021-03-01 11:06 . 初始化提交
<script>
//app.js
var http = require("./utils/http.js");
var util = require('./utils/util.js')
export default {
onLaunach: function() {},
onShow: function() {
// 判断浏览器环境
var ua = navigator.userAgent.toLowerCase();
if (ua.search(/MicroMessenger/i) > -1 && !uni.getStorageSync('appType')) {
// 微信环境
uni.setStorageSync('appType', 2)
http.mpAuthLogin()
}
const state = util.getUrlKey('state')
const code = util.getUrlKey('code')
if ((state == 'needCode' || state == 'unNeedCode') && code) {
let path = window.location.href
if (path.indexOf('code=') > 0 && path.indexOf('&state=unNeedCode') > -1) {
http.mpLogin(null, code)
path = path.substring(0, path.indexOf('code=') - 1)
history.replaceState({}, '', path)
}
http.getCartCount()
}
},
globalData: {
// 定义全局请求队列
requestQueue: [],
// 是否正在进行登陆
isLanding: false,
// 购物车商品数量
totalCartCount: 0
},
methods: {
}
};
</script>
<style>
@import "./app.css";
/* 隐藏头部 */
uni-page-head {
display: none;
}
/* 轮播图指示点 */
uni-swiper .uni-swiper-dots-horizontal {
bottom: 20px !important;
}
</style>
微信
1
https://gitee.com/sunhacker/mall4uni.git
git@gitee.com:sunhacker/mall4uni.git
sunhacker
mall4uni
mall4j商城系统Uniapp端-mall4uni
master

搜索帮助