|
@@ -6,7 +6,7 @@
|
|
<view class="list-scroll-view" id="top">
|
|
<view class="list-scroll-view" id="top">
|
|
<view class="one">
|
|
<view class="one">
|
|
<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
|
|
<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
|
|
- <swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
|
|
|
|
|
|
+ <swiper-item class="list" v-for="(item,index) in info.file" :key="index">
|
|
<image class="image" :src="item.url" mode="aspectFit">
|
|
<image class="image" :src="item.url" mode="aspectFit">
|
|
</image>
|
|
</image>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
@@ -92,27 +92,7 @@
|
|
shop: {},
|
|
shop: {},
|
|
// 数量
|
|
// 数量
|
|
num: 1,
|
|
num: 1,
|
|
- barList: [{
|
|
|
|
- name: '首页',
|
|
|
|
- route: 'pages/home/index',
|
|
|
|
- normal: require('@/static/shouye.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: '微店',
|
|
|
|
- route: 'pages/store/index',
|
|
|
|
- normal: require('@/static/store.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: '购物车',
|
|
|
|
- route: 'pages/market/index',
|
|
|
|
- normal: require('@/static/market.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: '我的',
|
|
|
|
- route: 'pages/my/index',
|
|
|
|
- normal: require('@/static/my.png'),
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ barList: [],
|
|
buttonGroup: [{
|
|
buttonGroup: [{
|
|
text: '兑换',
|
|
text: '兑换',
|
|
backgroundColor: 'linear-gradient(90deg, #6A5ACD, #6A5ACD)',
|
|
backgroundColor: 'linear-gradient(90deg, #6A5ACD, #6A5ACD)',
|
|
@@ -132,7 +112,6 @@
|
|
onShow: async function() {
|
|
onShow: async function() {
|
|
const that = this;
|
|
const that = this;
|
|
await that.searchConfig();
|
|
await that.searchConfig();
|
|
- // 监听用户是否登录
|
|
|
|
await that.watchLogin();
|
|
await that.watchLogin();
|
|
await that.search();
|
|
await that.search();
|
|
},
|
|
},
|
|
@@ -154,19 +133,7 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //主菜单跳转
|
|
|
|
- toPath(e) {
|
|
|
|
- if (e && e.route) uni.reLaunch({
|
|
|
|
- url: `/${e.route}`
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 菜单展开
|
|
|
|
- toMenu() {
|
|
|
|
- const that = this;
|
|
|
|
- that.menu = !that.menu
|
|
|
|
- },
|
|
|
|
- // 计算高度
|
|
|
|
- handleScroll(e) {
|
|
|
|
|
|
+ watchLogin() {
|
|
const that = this;
|
|
const that = this;
|
|
uni.getStorage({
|
|
uni.getStorage({
|
|
key: 'token',
|
|
key: 'token',
|
|
@@ -191,7 +158,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- //立即兑换
|
|
|
|
|
|
+ //立即兑换弹框打开
|
|
buttonClick(e) {
|
|
buttonClick(e) {
|
|
const that = this;
|
|
const that = this;
|
|
that.$refs.popup.open();
|
|
that.$refs.popup.open();
|
|
@@ -239,9 +206,14 @@
|
|
// 计算高度
|
|
// 计算高度
|
|
handleScroll(e) {
|
|
handleScroll(e) {
|
|
const that = this;
|
|
const that = this;
|
|
- let scrollTop = e.detail.scrollTop;
|
|
|
|
- that.isShow = scrollTop > 500;
|
|
|
|
- that.topItem = '';
|
|
|
|
|
|
+ uni.getStorage({
|
|
|
|
+ key: 'token',
|
|
|
|
+ success: function(res) {
|
|
|
|
+ let user = that.$jwt(res.data);
|
|
|
|
+ if (user) that.$set(that, `user`, user);
|
|
|
|
+ },
|
|
|
|
+ fail: function(err) {}
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 返回顶部
|
|
// 返回顶部
|
|
backTop() {
|
|
backTop() {
|
|
@@ -258,7 +230,7 @@
|
|
if (e && e.route) uni.reLaunch({
|
|
if (e && e.route) uni.reLaunch({
|
|
url: `/${e.route}`
|
|
url: `/${e.route}`
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|