|
|
@@ -1,7 +1,20 @@
|
|
|
<template>
|
|
|
<view v-if="isShow">
|
|
|
<view :class="(about.greyTheme==1?' grayTheme':'')">
|
|
|
- <view class="ddflex" style="margin: 0 60rpx;">
|
|
|
+ <view style="width: 100%;">
|
|
|
+ <view v-for="(item, index) in contact" :key="index">
|
|
|
+ <!-- 弹窗广告 -->
|
|
|
+ <view v-if="bannerList&&bannerList.length>0">
|
|
|
+ <banner v-if="item == 'ad' && bannerShow" :bannerList="bannerList" :url="site" :web="url"
|
|
|
+ :config="about" :couponList="[]" :officeList="[]"
|
|
|
+ :districtTemplate="districtTemplate"></banner>
|
|
|
+ </view>
|
|
|
+ <district v-if="item == 'king_kong_district' && districtShow" :url="site" :web="url"
|
|
|
+ :districtTemplate="districtTemplate"></district>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="ddflex" style="margin: 0 60rpx;">
|
|
|
<view class="fflex">
|
|
|
<image style="width: 86rpx;height: 86rpx;margin: 0 auto 20rpx;" src="/static/images/rmhd.png"></image>
|
|
|
<view style="font-size: 24rpx;color: #302222;text-align: center;">热门活动</view>
|
|
|
@@ -14,7 +27,7 @@
|
|
|
<image style="width: 86rpx;height: 86rpx;margin: 0 auto 20rpx;" src="/static/images/zxzq.png"></image>
|
|
|
<view style="font-size: 24rpx;color: #302222;text-align: center;">赠险专区</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="act-list" v-if="pageList && pageList.length > 0">
|
|
|
<view class="li" v-for="(item, index) in pageList" :key="index" @click="toActivity(item)">
|
|
|
<view class="imgbox"><image :src="item.pic" mode="aspectFill"></image></view>
|
|
|
@@ -57,8 +70,14 @@ const api = require('../../utils/api.js');
|
|
|
const util = require('../../utils/util.js');
|
|
|
const app = getApp();
|
|
|
import foot from '../../components/nav-bar/index';
|
|
|
+import banner from '../../template/banner/banner';
|
|
|
+import district from '../../template/king_kong_district/king_kong_district';
|
|
|
export default {
|
|
|
- components: { foot },
|
|
|
+ components: {
|
|
|
+ foot,
|
|
|
+ banner,
|
|
|
+ district
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
picUrlss: req.public.picUrls,
|
|
|
@@ -71,10 +90,25 @@ export default {
|
|
|
},
|
|
|
isLogin: false,
|
|
|
userinfovip: {},
|
|
|
- about:''
|
|
|
+ about:'',
|
|
|
+
|
|
|
+ bannerShow: false,
|
|
|
+ bannerList: [],
|
|
|
+ districtShow:false,
|
|
|
+ districtTemplate: {},
|
|
|
+ homeTemplate: [],//首页栏目配置
|
|
|
+ templateType: {
|
|
|
+ module_ad: 'ad',
|
|
|
+ //广告
|
|
|
+ module_type_district: 'type_district',
|
|
|
+ //分类导航
|
|
|
+ module_king_kong_district: 'king_kong_district', //金刚区
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {},
|
|
|
+ onLoad() {
|
|
|
+ this.getHomeTemplateConfig()
|
|
|
+ },
|
|
|
async onShow() {
|
|
|
this.about = await req.getsysConfig()
|
|
|
this.isLogin = req.isAuth();
|
|
|
@@ -103,6 +137,74 @@ export default {
|
|
|
url: url
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ // 自定义
|
|
|
+ getHomeTemplateConfig() {
|
|
|
+ let _ts = this;
|
|
|
+ let page = 'matchIndex';
|
|
|
+ req.getRequest(
|
|
|
+ '/api/template/getTemplate', {
|
|
|
+ page: page
|
|
|
+ },
|
|
|
+ data => {
|
|
|
+ let arr = [];
|
|
|
+ data.forEach(it => {
|
|
|
+ arr.push(it.module);
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ contact: [...new Set(arr)],
|
|
|
+ contactShow: false
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ homeTemplate: data
|
|
|
+ });
|
|
|
+
|
|
|
+ this.getRqeDatas();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ async getRqeDatas() {
|
|
|
+ let that = this; //多门店
|
|
|
+ // 金刚区
|
|
|
+ let district = that.homeTemplate.filter(it => it.module == that.templateType
|
|
|
+ .module_king_kong_district);
|
|
|
+ if (district && district.length > 0 && district[0].state == 0) {
|
|
|
+ let data = district[0];
|
|
|
+ data.content = JSON.parse(district[0].content);
|
|
|
+ that.districtTemplate = data;
|
|
|
+ that.districtShow = true;
|
|
|
+ }
|
|
|
+ //顶部banner
|
|
|
+ let ad = that.homeTemplate.filter(it => it.module == that.templateType.module_ad);
|
|
|
+ if (ad && ad.length > 0 && ad[0].state == 0) {
|
|
|
+ await that.getBannerList(ad[0].module, ad[0].contentId);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ getBannerList(module, contentId) {
|
|
|
+ //banner图
|
|
|
+ let that = this;
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ req.getRequest(
|
|
|
+ '/api/banner', {
|
|
|
+ groupId: contentId
|
|
|
+ },
|
|
|
+ data => {
|
|
|
+ if (module == that.templateType.module_ad) {
|
|
|
+ that.setData({
|
|
|
+ bannerList: data,
|
|
|
+ bannerShow: true
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.setData({
|
|
|
+ popAdList: data[0]
|
|
|
+ });
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
getPageList(isShow) {
|
|
|
if (!this.isLoad) return false;
|