代码拉取完成,页面将自动刷新
<script>
/* eslint-disable */
import Vue from 'vue';
import {
verifyAccessToken,
wechatH5Login
} from '@/api/login'
import {
mapMutations,
mapGetters,
mapState
} from 'vuex';
// 判断是否为公众号模拟器环境
const isWechat = () => {
return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
}
// 判断公众号截取code
const getUrlParam = (name) => {
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
import qs from 'qs'
export default {
globalData: {
wxCode: '',
promo_code: ''
},
computed: {
...mapState(['accessToken']),
...mapGetters(['hasLogin'])
},
async onLaunch() {
await this.initData();
},
methods: {
...mapMutations(['setCartNum', 'setNotifyNum']),
// 数据初始化
async initData() {
uni.setTabBarStyle({
selectedColor: this.themeColor.color,
borderStyle: 'white'
});
// this.themeColor.tabList && this.themeColor.tabList.forEach((selectedIconPath, index) => {
// uni.setTabBarItem({
// index,
// selectedIconPath
// });
// });
// 获取页面设置配置
const token = uni.getStorageSync('accessToken');
// 获取系统title高度
await this.initSystemInfo();
if (token) {
await this.handleVerifyAccessToken(token);
}
if (this.$mStore.getters.hasLogin) {
// 初始化购物车数量
this.setCartNum(uni.getStorageSync('cartNum') || 0);
this.setNotifyNum(uni.getStorageSync('notifyNum') || 0);
}
// #ifdef H5
if (this.$mPayment.isWechat()) {
await this.$mPayment.wxConfigH5(window.location.href);
}
// #endif
// 如果是第一次进来
// if (!uni.getStorageSync('notFirstTimeLogin')) {
// uni.redirectTo({
// url:'/pages/agreement/agreement'
// })
// } else {
// }
},
// 初始化系统信息
initSystemInfo() {
uni.getSystemInfo({
success(e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform === 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 43;
}
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
// eslint-disable-next-line
const custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.top - e.statusBarHeight;
// #endif
// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
}
});
},
// 检验token是否有效
async handleVerifyAccessToken(token) {
// await this.$http.post(verifyAccessToken, {
// token
// }).then(r => {
// if (!r.data.token) {
// this.$mStore.commit('logout');
// }
// });
}
}
};
</script>
<style>
/* O2O模块图标 */
@import url('https://at.alicdn.com/t/font_2732414_h8u2bz5hw4l.css');
/* 图片图标 */
@import url('https://at.alicdn.com/t/font_2735316_mzelfmqgsv8.css');
@import url('https://at.alicdn.com/t/c/font_3782092_r15xer70l6.css');
</style>
<style lang="scss">
/* #ifndef APP-NVUE */
// 导入colorUI
@import '/static/css/colorui/main.css';
@import '/static/css/colorui/icon.css';
@import '/static/css/colorui/animation.css';
// 导入阿里巴巴矢量图标库
/*#ifdef MP*/
@import './static/css/iconfont/iconfont.css';
@import './static/css/iconfont/my-iconfont.css';
/*#endif*/
/*#ifndef MP*/
@import url('https://at.alicdn.com/t/font_1681579_dwilkcq6mvg.css');
//my
@import url('https://at.alicdn.com/t/font_3142217_g1kx9n8725.css');
//at.alicdn.com/t/font_2732414_u2u35yawsv9.css
/*#endif*/
@import './static/css/reset.scss';
@import './static/css/uni.scss';
@import './static/css/common.scss';
/* #endif */
page {
background-color: #f8f9fd;
}
.checkIcon {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background-color: #EBEBEB;
position: relative;
}
.checkIcon::before {
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 30rpx;
height: 30rpx;
border-radius: 50%;
border: 1rpx solid #EBEBEB;
transform: translate(-50%, -50%);
}
.checkIcon.active {
background-color: #E54D42;
}
.checkIcon.active::before {
border-color: #E54D42;
}
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。