diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 8afe1ed..0b37600 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -49,39 +49,34 @@ - + - {{ row.name }} + {{ row.title }} - - - - - - - - - - - - - - {{item.couponName}} - - - {{ item.discountPrice*100}} - + + + + + + + + + + {{item.couponName}} + + + {{ item.discountPrice*100}} - - - + + + + + @@ -97,92 +92,6 @@ - - - - - - - - - - - - @@ -202,7 +111,6 @@ getTPigCinemaToken, getCmsContent, } from "../../../Utils/Api.js"; //您的api路径 - // import { getUserInfo } from '../../../Utils/Api.js' import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; let app = getApp(); export default { @@ -226,11 +134,6 @@ imgadres1: 'jbhed.png', imgadres2: 'jt.png', imgadres3: '', - imgadres4: 'homet.png', - imgadres5: 'homeh.png', - imgadres6: 'homed.jpg', - imgadres7: 'homek.jpg', - imgadres8: 'homejf.jpg', webUrl: '', // 轮播图片 swiperList: [{ @@ -253,30 +156,9 @@ pageNum: 1, pageSize: 6, // 分类菜单 - categoryList: [{ - id: 1, - name: '在线加油', - img: 'user/home1.png', - src: '/pages/goods/refuel/refuel' - }, - { - id: 2, - name: '电影票', - img: 'user/home2.png', - src: '/pages/tabBar/order/order' - }, - { - id: 3, - name: '肯德基', - img: 'user/home3.png', - src: '/pages/tabBar/order/order' - }, - { - id: 4, - name: '话费充值', - img: 'user/home4.png' - } + categoryList: [ ], + homeCateList:[], //切换状态 cpStuats: 1 }; @@ -299,7 +181,8 @@ this.getCouponListArea(); this.getCouponListgold(); this.getCmsContent(); - // this.getCmsAactibity(); + this.getCmsContentcmshome(); + this.getCmsContentcmsContent(); } }, onLoad() { @@ -348,6 +231,30 @@ // #endif }, methods: { + //获取首页功能 + getCmsContentcmsContent() { + let params = { + regionId: app.globalData.cityId, + categoryCode: 'CMS_HOME_CONTENT' + } + getCmsContent(params).then(res => { + if (res.return_code == '000000') { + this.homeCateList = res.return_data; + } + }); + }, + //获取首页菜单 + getCmsContentcmshome() { + let params = { + regionId: app.globalData.cityId, + categoryCode: 'CMS_HOME_NAV' + } + getCmsContent(params).then(res => { + if (res.return_code == '000000') { + this.categoryList = res.return_data; + } + }); + }, //获取弹出或者弹窗 getCmsContent() { @@ -386,7 +293,7 @@ closePopup() { this.$refs.popup.hide(); }, - + /** * 跳转外链 */ @@ -430,6 +337,8 @@ uni.hideLoading(); that.getCmsContent(); that.getCmsAactibity(); + that.getCmsContentcmshome(); + that.getCmsContentcmsContent(); }, fail() { uni.hideLoading() @@ -515,12 +424,7 @@ console.log(err); }); }, - //调整商品列表 - goGoodsList(item) { - uni.navigateTo({ - url: '../../goods/goods-list/goods-list?id=' + item - }) - }, + //搜索跳转 toSearch() { uni.navigateTo({ @@ -677,60 +581,55 @@ } }) }, - //跳转团油 - jumpTyou() { - uni.navigateTo({ - url: '/pages/goods/refuel/refuel' - }) - }, + //跳转菜单 toCategory(item) { - if (item.name == '在线加油') { + if (item.title == '在线加油') { uni.navigateTo({ - url: item.src + url: item.ext1 }) - } else if (item.name == '肯德基') { + } else if (item.title == '肯德基') { if (!app.globalData.userInfo) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } if (!app.globalData.userInfo.phone) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } uni.navigateTo({ url: '/pages/tabBar/order/order?id=1' }) - } else if (item.name == '电影票') { + } else if (item.title == '电影票') { if (!app.globalData.userInfo) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } if (!app.globalData.userInfo.phone) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } uni.navigateTo({ url: '/pages/tabBar/order/order?id=2' }) - } else if (item.name == '话费充值') { + } else if (item.title == '话费充值') { if (!app.globalData.userInfo) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } if (!app.globalData.userInfo.phone) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } @@ -750,21 +649,55 @@ jumphuafei(item) { if (!app.globalData.userInfo) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } if (!app.globalData.userInfo.phone) { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) return; } + if(item.title == '汇联通'){ + uni.navigateTo({ + url: '/pages/goods/goods-list/goods-list?id=2' + }) + return; + } + if(item.title == '在线加油'){ + uni.navigateTo({ + url: '/pages/goods/refuel/refuel' + }) + return; + } + if(item.title == '话费充值'){ + uni.navigateTo({ + url: '/pages/tabBar/order/order?id=3' + }) + return; + } + if(item.title == '电影票'){ + uni.navigateTo({ + url: '/pages/tabBar/order/order?id=2' + }) + return; + } + if(item.title == '肯德基'){ + uni.navigateTo({ + url: '/pages/tabBar/order/order?id=1' + }) + return; + } + + + }, + //调整商品列表 + goGoodsList(item) { uni.navigateTo({ - url: '/pages/tabBar/order/order?id=' + item + url: '/pages/goods/goods-list/goods-list?id=' + item }) - - } + }, }, };