mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:53:27 +08:00
【优化】优化首页及自定义首页海报获取状态。
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<!--返回顶部组件-->
|
||||
<u-back-top :scroll-top="scrollTop" :duration="500"></u-back-top>
|
||||
<!--弹出框-->
|
||||
<coreshop-modal-img :show="modalShow" :src="$globalConstVars.apiFilesUrl+'/static/images/empty/reward.png'" @imgTap="imgTap" @closeTap="closeTap" />
|
||||
<coreshop-modal-img :show="modalShow" :src="indexPopupWindowImageUrl" @imgTap="imgTap" @closeTap="closeTap" />
|
||||
<!-- 登录提示 -->
|
||||
<coreshop-login-modal></coreshop-login-modal>
|
||||
</view>
|
||||
@@ -35,7 +35,6 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
swiperItems: [],
|
||||
currentIndex: 0,
|
||||
opacity: 0,
|
||||
scrollTop: 0,
|
||||
@@ -44,7 +43,9 @@
|
||||
kefupara: '', //客服传递资料
|
||||
copy: false,
|
||||
shareUrl: this.$globalConstVars.shareUrl,
|
||||
modalShow: true,
|
||||
isScorll: false,
|
||||
homeTitle: '',
|
||||
modalShow: false,
|
||||
};
|
||||
},
|
||||
updated() {
|
||||
@@ -72,11 +73,22 @@
|
||||
}
|
||||
},
|
||||
appTitle() {
|
||||
return this.$store.state.config.shopName;
|
||||
this.homeTitle = this.$store.state.config.shopName;
|
||||
return this.homeTitle || '';
|
||||
},
|
||||
// 获取店铺联系人手机号
|
||||
shopMobile() {
|
||||
return this.$store.state.config.shopMobile || 0;
|
||||
},
|
||||
modalShowData() {
|
||||
this.modalShow = this.$store.state.config.showIndexPopupWindow == 1;
|
||||
return this.$store.state.config.showIndexPopupWindow == 1;
|
||||
},
|
||||
indexPopupWindowHrefUrl() {
|
||||
return this.$store.state.config.indexPopupWindowHrefUrl;
|
||||
},
|
||||
indexPopupWindowImageUrl() {
|
||||
return this.$store.state.config.indexPopupWindowImageUrl;
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
@@ -89,18 +101,29 @@
|
||||
methods: {
|
||||
imgTap() {
|
||||
this.modalShow = false;
|
||||
uni.navigateTo({
|
||||
url: "/pages/reward/reward"
|
||||
});
|
||||
var val = this.indexPopupWindowHrefUrl;
|
||||
if (this.indexPopupWindowHrefUrl.indexOf('http') != -1) {
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE || MP
|
||||
this.$u.route('/pages/webview/webview', { src: val });
|
||||
// #endif
|
||||
} else {
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE || MP
|
||||
if (val == '/pages/index/default/default' || val == '/pages/category/index/index' || val == '/pages/index/cart/cart' || val == '/pages/index/member/member') {
|
||||
this.$u.route({ type: 'switchTab', url: val });
|
||||
return;
|
||||
} else if (val.indexOf('/pages/coupon/coupon?id=') > -1) {
|
||||
var id = val.replace('/pages/coupon/coupon?id=', "");
|
||||
this.receiveCoupon(id)
|
||||
} else {
|
||||
this.$u.route(val);
|
||||
return;
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
closeTap() {
|
||||
this.modalShow = false;
|
||||
},
|
||||
goSearch() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/search/search'
|
||||
});
|
||||
},
|
||||
// 首页初始化获取数据
|
||||
initData() {
|
||||
uni.showLoading({
|
||||
@@ -110,26 +133,6 @@
|
||||
this.$u.api.getPageConfig({ code: this.pageCode }).then(res => {
|
||||
if (res.status == true) {
|
||||
this.pageData = res.data.items;
|
||||
|
||||
if (res.data.items.length > 0) {
|
||||
for (var i = 0; i < res.data.items.length; i++) {
|
||||
if (res.data.items[i].widgetCode == 'topImgSlide') {
|
||||
var data = res.data.items[i].parameters.list;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
let moder = {
|
||||
image: data[i].image,
|
||||
bg: data[i].bg,
|
||||
opentype: 'click',
|
||||
url: '',
|
||||
title: data[i].linkType,
|
||||
linkType: data[i].linkType,
|
||||
linkValue: data[i].linkValue,
|
||||
}
|
||||
this.swiperItems.push(moder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
@@ -155,9 +158,6 @@
|
||||
}
|
||||
this.getShareUrl();
|
||||
},
|
||||
swiperChange(e) {
|
||||
this.currentIndex = e;
|
||||
},
|
||||
//在线客服
|
||||
showChat() {
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
@@ -179,13 +179,9 @@
|
||||
this.$u.api.share(data).then(res => {
|
||||
this.shareUrl = res.data
|
||||
});
|
||||
},
|
||||
taped: function (e) {
|
||||
this.showSliderInfo(this.swiperItems[e].linkType, this.swiperItems[e].linkValue);
|
||||
},
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.swiperItems = [];
|
||||
this.initData();
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
@@ -205,6 +201,7 @@
|
||||
}
|
||||
},
|
||||
onPageScroll: function (e) {
|
||||
this.isScorll = e.scrollTop > 100 ? true : false;
|
||||
this.scrollTop = e.scrollTop;
|
||||
if (e.scrollTop <= 100) {
|
||||
this.opacity = e.scrollTop / 100;
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
currentIndex: 0,
|
||||
opacity: 0,
|
||||
scrollTop: 0,
|
||||
imageUrl: '/static/images/ShareImage.png', //店铺分享图片
|
||||
pageData: [],
|
||||
pageCode: 'mobile_home', //页面布局编码
|
||||
kefupara: '', //客服传递资料
|
||||
@@ -47,19 +46,11 @@
|
||||
isScorll: false,
|
||||
homeTitle: '',
|
||||
modalShow: false,
|
||||
indexPopupWindowHrefUrl: '',
|
||||
indexPopupWindowImageUrl: '',
|
||||
|
||||
};
|
||||
},
|
||||
updated() {
|
||||
this.copy = true;
|
||||
},
|
||||
mounted() {
|
||||
this.modalShow = this.$store.state.config.showIndexPopupWindow == 1;
|
||||
this.indexPopupWindowHrefUrl = this.$store.state.config.indexPopupWindowHrefUrl;
|
||||
this.indexPopupWindowImageUrl = this.$store.state.config.indexPopupWindowImageUrl;
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
hasLogin: state => state.hasLogin,
|
||||
@@ -88,6 +79,16 @@
|
||||
// 获取店铺联系人手机号
|
||||
shopMobile() {
|
||||
return this.$store.state.config.shopMobile || 0;
|
||||
},
|
||||
modalShowData() {
|
||||
this.modalShow = this.$store.state.config.showIndexPopupWindow == 1;
|
||||
return this.$store.state.config.showIndexPopupWindow == 1;
|
||||
},
|
||||
indexPopupWindowHrefUrl() {
|
||||
return this.$store.state.config.indexPopupWindowHrefUrl;
|
||||
},
|
||||
indexPopupWindowImageUrl() {
|
||||
return this.$store.state.config.indexPopupWindowImageUrl;
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
@@ -174,7 +175,7 @@
|
||||
this.$u.api.share(data).then(res => {
|
||||
this.shareUrl = res.data
|
||||
});
|
||||
},
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.initData();
|
||||
|
||||
Reference in New Issue
Block a user