feat:合并代码 更换图片路径
This commit is contained in:
commit
ec2293bcb0
@ -1,477 +1,518 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
<div
|
||||||
<div class="searchBox_add">
|
class="searchBox"
|
||||||
<div class="emptyCommunity" @click="addCommunity"> {{ communityVal }} </div>
|
:style="{ height: localHeight + 'px', paddingTop: top + 'px' }"
|
||||||
<!-- <div class="MyCommunity" v-if="false">
|
>
|
||||||
|
<div class="searchBox_add">
|
||||||
|
<div class="emptyCommunity" @click="addCommunity">
|
||||||
|
{{ communityVal }}
|
||||||
|
</div>
|
||||||
|
<!-- <div class="MyCommunity" v-if="false">
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community/community_mycommunity.png"
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community/community_mycommunity.png"
|
||||||
mode="aspectFill"></image>
|
mode="aspectFill"></image>
|
||||||
<span>惠生活</span>
|
<span>惠生活</span>
|
||||||
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="swiperBox1">
|
<div class="swiperBox1">
|
||||||
<swiper @animationfinish="swipers" autoplay circular>
|
<swiper @animationfinish="swipers" autoplay circular>
|
||||||
<swiper-item v-for="(item, index) in bannerList" :key="index" @click="headerServerClick(item)">
|
<swiper-item
|
||||||
<image :src="item.ad_picture" mode="aspectFill" />
|
v-for="(item, index) in bannerList"
|
||||||
</swiper-item>
|
:key="index"
|
||||||
</swiper>
|
@click="headerServerClick(item)"
|
||||||
|
>
|
||||||
|
<image :src="item.ad_picture" mode="aspectFill" />
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
|
||||||
<view class="dot">
|
<view class="dot">
|
||||||
<view :class="['dotItem', currentIdx == index ? 'active' : '']" v-for="(item, index) in bannerList"
|
<view
|
||||||
:key="index">
|
:class="['dotItem', currentIdx == index ? 'active' : '']"
|
||||||
</view>
|
v-for="(item, index) in bannerList"
|
||||||
</view>
|
:key="index"
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- <div class="dot">
|
<!-- <div class="dot">
|
||||||
<div class="dotItem"></div>
|
<div class="dotItem"></div>
|
||||||
<div class="dotItem active"></div>
|
<div class="dotItem active"></div>
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="swiperBox2">
|
<div class="swiperBox2">
|
||||||
<swiper @animationfinish="swipers" autoplay circular>
|
<swiper @animationfinish="swipers" autoplay circular>
|
||||||
<swiper-item v-for="(item, index) in streamerList" :key="index" @click="headerServerClick(item)">
|
<swiper-item
|
||||||
<image :src="item.ad_picture" mode="aspectFill" />
|
v-for="(item, index) in streamerList"
|
||||||
</swiper-item>
|
:key="index"
|
||||||
</swiper>
|
@click="headerServerClick(item)"
|
||||||
</div>
|
>
|
||||||
|
<image :src="item.ad_picture" mode="aspectFill" />
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- <div class="funcList">
|
<!-- <div class="funcList">
|
||||||
<div class="funcItem" v-for="item in functionList" @click="jump(item.mini_program_url)">
|
<div class="funcItem" v-for="item in functionList" @click="jump(item.mini_program_url)">
|
||||||
<image :src="item.nav_icon"></image>
|
<image :src="item.nav_icon"></image>
|
||||||
{{ item.nav_name }}
|
{{ item.nav_name }}
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<view class="funcList">
|
<view class="funcList">
|
||||||
<u-grid :col="rowNum" :border="false">
|
<u-grid :col="rowNum" :border="false">
|
||||||
<u-grid-item v-for="(item, index) in functionList" @click="jump(item.mini_program_url)" :key="index">
|
<u-grid-item
|
||||||
<image class="grid_Pic" :src="item.nav_icon" mode=""></image>
|
v-for="(item, index) in functionList"
|
||||||
<text>{{ item.nav_name }}</text>
|
@click="jump(item.mini_program_url)"
|
||||||
</u-grid-item>
|
:key="index"
|
||||||
</u-grid>
|
>
|
||||||
</view>
|
<image class="grid_Pic" :src="item.nav_icon" mode=""></image>
|
||||||
|
<text>{{ item.nav_name }}</text>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
</view>
|
||||||
|
|
||||||
<div v-for="(item, index) in tileList" :key="index" :class="['ads', index == 0 ? 'ads_first' : '']"
|
<div
|
||||||
@click="headerServerClick(item)">
|
v-for="(item, index) in tileList"
|
||||||
<image :src="item.ad_picture" mode="aspectFill" />
|
:key="index"
|
||||||
</div>
|
:class="['ads', index == 0 ? 'ads_first' : '']"
|
||||||
|
@click="headerServerClick(item)"
|
||||||
|
>
|
||||||
|
<image :src="item.ad_picture" mode="aspectFill" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tabs">
|
<div class="tabs">
|
||||||
<div v-for="(item, index) in categoryList" :key="index"
|
<div
|
||||||
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
|
v-for="(item, index) in categoryList"
|
||||||
{{ item.category_name }}
|
:key="index"
|
||||||
</div>
|
:class="['tabItem', selectedTab === index ? 'active2' : '']"
|
||||||
</div>
|
@click="selectTab(index, item)"
|
||||||
|
>
|
||||||
|
{{ item.category_name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="newsList">
|
<div class="newsList">
|
||||||
<div class="newsItem" v-for="item in infoList" @click="detail(item)" :key="item.id">
|
<div
|
||||||
<div class="newsItem_left">
|
class="newsItem"
|
||||||
<div class="newsItem_left_tit">{{ item.title }}</div>
|
v-for="item in infoList"
|
||||||
<div class="newsItem_left_sub">{{ item.author }}</div>
|
@click="detail(item)"
|
||||||
</div>
|
:key="item.id"
|
||||||
<div class="newsItem_right">
|
>
|
||||||
<image :src="item.list_image" mode="aspectFill" />
|
<div class="newsItem_left">
|
||||||
</div>
|
<div class="newsItem_left_tit">{{ item.title }}</div>
|
||||||
</div>
|
<div class="newsItem_left_sub">{{ item.author }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="newsItem_right">
|
||||||
|
<image :src="item.list_image" mode="aspectFill" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tips">下拉加载后续10条,共计30条</div>
|
<div class="tips">下拉加载后续10条,共计30条</div>
|
||||||
|
|
||||||
<div class="bigAds" v-if="ads1Show">
|
<div class="bigAds" v-if="ads1Show">
|
||||||
<div class="bigAdsCon">
|
<div class="bigAdsCon">
|
||||||
<div class="bigAdsCon_img">
|
<div class="bigAdsCon_img">
|
||||||
<swiper @animationfinish="swipers" autoplay circular>
|
<swiper @animationfinish="swipers" autoplay circular>
|
||||||
<swiper-item v-for="(item, index) in largePopList" :key="index"
|
<swiper-item
|
||||||
@click="headerServerClick(item)">
|
v-for="(item, index) in largePopList"
|
||||||
<image :src="item.ad_picture" mode="aspectFill" />
|
:key="index"
|
||||||
</swiper-item>
|
@click="headerServerClick(item)"
|
||||||
</swiper>
|
>
|
||||||
</div>
|
<image :src="item.ad_picture" mode="aspectFill" />
|
||||||
<div class="close" @click="closeAds">
|
</swiper-item>
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png">
|
</swiper>
|
||||||
</image>
|
</div>
|
||||||
</div>
|
<div class="close" @click="closeAds">
|
||||||
</div>
|
<image
|
||||||
</div>
|
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png"
|
||||||
|
>
|
||||||
|
</image>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="bigAds" v-if="ads2Show">
|
<div class="bigAds" v-if="ads2Show">
|
||||||
<div class="bigAdsCon2">
|
<div class="bigAdsCon2">
|
||||||
<div class="bigAdsCon2_img">
|
<div class="bigAdsCon2_img">
|
||||||
<swiper :current="currentSwiperIndex" @change="onSwiperChange" @animationfinish="swipers" autoplay
|
<swiper
|
||||||
circular>
|
:current="currentSwiperIndex"
|
||||||
<swiper-item v-for="(item, index) in popList" :key="index">
|
@change="onSwiperChange"
|
||||||
<image :src="item.ad_picture" mode="aspectFill" />
|
@animationfinish="swipers"
|
||||||
</swiper-item>
|
autoplay
|
||||||
</swiper>
|
circular
|
||||||
</div>
|
>
|
||||||
<div class="AdsBtnList">
|
<swiper-item v-for="(item, index) in popList" :key="index">
|
||||||
<div class="AdsBtnItem1" @click="closeAds2">取消</div>
|
<image :src="item.ad_picture" mode="aspectFill" />
|
||||||
<div class="AdsBtnItem2" @click="onDetailClick">了解详情</div>
|
</swiper-item>
|
||||||
</div>
|
</swiper>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="AdsBtnList">
|
||||||
<nav-footer :current="1" />
|
<div class="AdsBtnItem1" @click="closeAds2">取消</div>
|
||||||
</div>
|
<div class="AdsBtnItem2" @click="onDetailClick">了解详情</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<nav-footer :current="1" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
request,
|
request,
|
||||||
picUrl,
|
picUrl,
|
||||||
uniqueByField,
|
uniqueByField,
|
||||||
menuButtonInfo,
|
menuButtonInfo,
|
||||||
NavgateTo
|
NavgateTo,
|
||||||
} from '../../../utils';
|
} from "../../../utils";
|
||||||
|
|
||||||
import {
|
|
||||||
apiArr
|
|
||||||
} from '../../../api/v2Community';
|
|
||||||
|
|
||||||
|
import { apiArr } from "../../../api/v2Community";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
communityVal: '添加我的房产',
|
communityVal: "添加我的房产",
|
||||||
picUrl,
|
picUrl,
|
||||||
top: "",
|
top: "",
|
||||||
localHeight: "",
|
localHeight: "",
|
||||||
queryPage: {
|
queryPage: {
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
page_size: 10,
|
page_size: 10,
|
||||||
},
|
},
|
||||||
communityList: [],
|
communityList: [],
|
||||||
flag: false,
|
flag: false,
|
||||||
|
|
||||||
functionList: [],
|
functionList: [],
|
||||||
|
|
||||||
ads1Show: false,
|
ads1Show: false,
|
||||||
ads2Show: false,
|
ads2Show: false,
|
||||||
|
|
||||||
bannerList: [], //轮播图广告
|
bannerList: [], //轮播图广告
|
||||||
currentIdx: 0,
|
currentIdx: 0,
|
||||||
streamerList: [], //横幅广告
|
streamerList: [], //横幅广告
|
||||||
tileList: [], //平铺广告
|
tileList: [], //平铺广告
|
||||||
largePopList: [], //巨幅弹屏广告
|
largePopList: [], //巨幅弹屏广告
|
||||||
popList: [], //弹屏广告
|
popList: [], //弹屏广告
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
infoList: [],
|
infoList: [],
|
||||||
selectedTab: 0,
|
selectedTab: 0,
|
||||||
currentAdIndex: 0,
|
currentAdIndex: 0,
|
||||||
|
|
||||||
rowNum: 0,
|
rowNum: 0,
|
||||||
colNum: 0,
|
colNum: 0,
|
||||||
|
|
||||||
page_size:10,
|
page_size: 10,
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
flag:false
|
flag: false,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
const meun = menuButtonInfo();
|
const meun = menuButtonInfo();
|
||||||
this.top = meun.top;
|
this.top = meun.top;
|
||||||
// this.top = meun.height + meun.top;
|
// this.top = meun.height + meun.top;
|
||||||
this.localHeight = meun.height;
|
this.localHeight = meun.height;
|
||||||
// this.getCommunityList()
|
// this.getCommunityList()
|
||||||
if (!uni.getStorageSync('changeCommData').id) {
|
if (!uni.getStorageSync("changeCommData").id) {
|
||||||
uni.setStorageSync("changeCommData", { name: "森呼吸二期", id: 14 })
|
uni.setStorageSync("changeCommData", { name: "森呼吸二期", id: 14 });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.communityVal = uni.getStorageSync('changeCommData').name
|
this.communityVal = uni.getStorageSync("changeCommData").name;
|
||||||
this.getfunctionNum()
|
this.getfunctionNum();
|
||||||
this.getAdvertising()
|
this.getAdvertising();
|
||||||
this.getCategoryList()
|
this.getCategoryList();
|
||||||
},
|
},
|
||||||
|
|
||||||
//上拉刷新
|
//上拉刷新
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.communityVal = uni.getStorageSync('changeCommData').name
|
this.communityVal = uni.getStorageSync("changeCommData").name;
|
||||||
this.bannerList = []
|
this.bannerList = [];
|
||||||
this.currentIdx = 0
|
this.currentIdx = 0;
|
||||||
this.streamerList = [] //横幅广告
|
this.streamerList = []; //横幅广告
|
||||||
this.tileList = [] //平铺广告
|
this.tileList = []; //平铺广告
|
||||||
this.largePopList = [] //巨幅弹屏广告
|
this.largePopList = []; //巨幅弹屏广告
|
||||||
this.popList = [] //弹屏广告
|
this.popList = []; //弹屏广告
|
||||||
this.categoryList = []
|
this.categoryList = [];
|
||||||
this.infoList = []
|
this.infoList = [];
|
||||||
this.selectedTab = 0
|
this.selectedTab = 0;
|
||||||
this.currentAdIndex = 0
|
this.currentAdIndex = 0;
|
||||||
this.getfunctionNum()
|
this.getfunctionNum();
|
||||||
this.getAdvertising()
|
this.getAdvertising();
|
||||||
this.getCategoryList()
|
this.getCategoryList();
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
|
//下拉加载
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.flag) {
|
||||||
|
this.page_num++;
|
||||||
|
this.getCategoryList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
},
|
methods: {
|
||||||
//下拉加载
|
// desc() {
|
||||||
onReachBottom() {
|
// NavgateTo("../communityDetail/index")
|
||||||
if(this.flag){
|
// },
|
||||||
this.page_num++
|
apply() {
|
||||||
this.getCategoryList()
|
NavgateTo("../applyOwer/index");
|
||||||
}
|
},
|
||||||
},
|
closeAds() {
|
||||||
|
this.ads1Show = false;
|
||||||
|
},
|
||||||
|
closeAds2() {
|
||||||
|
this.ads2Show = false;
|
||||||
|
},
|
||||||
|
jump(e) {
|
||||||
|
if (!e) {
|
||||||
|
this.NotOpen();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NavgateTo(e);
|
||||||
|
},
|
||||||
|
|
||||||
|
addCommunity() {
|
||||||
|
NavgateTo("/packages/community/myCommunity/index");
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
swipers(event) {
|
||||||
// desc() {
|
// 获取当前轮播图索引
|
||||||
// NavgateTo("../communityDetail/index")
|
this.currentIdx = event.detail.current;
|
||||||
// },
|
},
|
||||||
apply() {
|
|
||||||
NavgateTo("../applyOwer/index")
|
|
||||||
},
|
|
||||||
closeAds() {
|
|
||||||
this.ads1Show = false
|
|
||||||
},
|
|
||||||
closeAds2() {
|
|
||||||
this.ads2Show = false
|
|
||||||
},
|
|
||||||
jump(e) {
|
|
||||||
if (!e) {
|
|
||||||
this.NotOpen();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
NavgateTo(e)
|
|
||||||
},
|
|
||||||
|
|
||||||
addCommunity() {
|
async getfunctionNum() {
|
||||||
NavgateTo("/packages/community/myCommunity/index")
|
const res = await request(
|
||||||
},
|
apiArr.commInfo,
|
||||||
|
"POST",
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
slice: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.rowNum = res.nav_row_num_comm;
|
||||||
|
this.colNum = res.nav_row_total_comm;
|
||||||
|
return await this.getfunctionList();
|
||||||
|
},
|
||||||
|
|
||||||
swipers(event) {
|
async getfunctionList() {
|
||||||
// 获取当前轮播图索引
|
const res = await request(apiArr.navPage, "POST", {
|
||||||
this.currentIdx = event.detail.current;
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
},
|
page_num: 1,
|
||||||
|
page_size: 50,
|
||||||
|
});
|
||||||
|
console.log(res, "xx");
|
||||||
|
|
||||||
async getfunctionNum() {
|
// 获取 rowNum 和 colNum 的乘积
|
||||||
const res = await request(apiArr.commInfo, "POST", {}, {
|
const totalItems = this.rowNum * this.colNum;
|
||||||
slice: false
|
// 使用 slice 方法截取前 totalItems 个元素
|
||||||
});
|
this.functionList = res.rows.slice(0, totalItems).map((item) => {
|
||||||
this.rowNum = res.nav_row_num_comm
|
return {
|
||||||
this.colNum = res.nav_row_total_comm
|
...item,
|
||||||
return await this.getfunctionList()
|
nav_icon: picUrl + item.nav_icon,
|
||||||
},
|
};
|
||||||
|
});
|
||||||
|
|
||||||
async getfunctionList() {
|
console.log("functionList", this.functionList);
|
||||||
const res = await request(apiArr.navPage, "POST", {
|
},
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
|
||||||
page_num: 1,
|
|
||||||
page_size: 50
|
|
||||||
});
|
|
||||||
console.log(res, 'xx');
|
|
||||||
|
|
||||||
// 获取 rowNum 和 colNum 的乘积
|
async getAdvertising() {
|
||||||
const totalItems = this.rowNum * this.colNum;
|
const res = await request(apiArr.advPage, "POST", {
|
||||||
// 使用 slice 方法截取前 totalItems 个元素
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
this.functionList = res.rows.slice(0, totalItems).map(item => {
|
ad_position: 1,
|
||||||
return {
|
page_num: 1,
|
||||||
...item,
|
page_size: 50,
|
||||||
nav_icon: picUrl + item.nav_icon
|
});
|
||||||
};
|
this.bannerList = res.rows.map((item) => {
|
||||||
});
|
return {
|
||||||
|
...item,
|
||||||
|
ad_picture: picUrl + item.ad_picture,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
console.log('functionList', this.functionList);
|
const res2 = await request(apiArr.advPage, "POST", {
|
||||||
},
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
|
ad_position: 2,
|
||||||
|
page_num: 1,
|
||||||
|
page_size: 50,
|
||||||
|
});
|
||||||
|
this.streamerList = res2.rows.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
ad_picture: picUrl + item.ad_picture,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
async getAdvertising() {
|
const res3 = await request(apiArr.advPage, "POST", {
|
||||||
const res = await request(apiArr.advPage, "POST", {
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
ad_position: 3,
|
||||||
ad_position: 1,
|
page_num: 1,
|
||||||
page_num: 1,
|
page_size: 50,
|
||||||
page_size: 50
|
});
|
||||||
})
|
this.tileList = res3.rows.map((item) => {
|
||||||
this.bannerList = res.rows.map(item => {
|
return {
|
||||||
return {
|
...item,
|
||||||
...item,
|
ad_picture: picUrl + item.ad_picture,
|
||||||
ad_picture: picUrl + item.ad_picture
|
};
|
||||||
};
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const res2 = await request(apiArr.advPage, "POST", {
|
const res4 = await request(apiArr.advPage, "POST", {
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
ad_position: 2,
|
ad_position: 4,
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
page_size: 50
|
page_size: 50,
|
||||||
})
|
});
|
||||||
this.streamerList = res2.rows.map(item => {
|
this.largePopList = res4.rows.map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
ad_picture: picUrl + item.ad_picture
|
ad_picture: picUrl + item.ad_picture,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
this.ads1Show = res4.rows.length !== 0 ? true : false;
|
||||||
|
|
||||||
const res3 = await request(apiArr.advPage, "POST", {
|
const res5 = await request(apiArr.advPage, "POST", {
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
ad_position: 3,
|
ad_position: 5,
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
page_size: 50
|
page_size: 50,
|
||||||
})
|
});
|
||||||
this.tileList = res3.rows.map(item => {
|
this.popList = res5.rows.map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
ad_picture: picUrl + item.ad_picture
|
ad_picture: picUrl + item.ad_picture,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
this.ads2Show = res5.rows.length !== 0 ? true : false;
|
||||||
|
},
|
||||||
|
|
||||||
const res4 = await request(apiArr.advPage, "POST", {
|
headerServerClick(e) {
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
console.log("当前点击内容", e);
|
||||||
ad_position: 4,
|
if (!e.link_url) {
|
||||||
page_num: 1,
|
this.NotOpen();
|
||||||
page_size: 50
|
return;
|
||||||
})
|
}
|
||||||
this.largePopList = res4.rows.map(item => {
|
if (e.link_url) {
|
||||||
return {
|
// #ifdef APP-PLUS
|
||||||
...item,
|
uni.navigateTo({
|
||||||
ad_picture: picUrl + item.ad_picture
|
url: "/pages/webview/webview?url=" + encodeURIComponent(e.link_url),
|
||||||
};
|
});
|
||||||
});
|
// #endif
|
||||||
this.ads1Show = res4.rows.length !== 0 ? true : false;
|
|
||||||
|
|
||||||
const res5 = await request(apiArr.advPage, "POST", {
|
// #ifdef H5
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
window.open(e.link_url, "_blank");
|
||||||
ad_position: 5,
|
// #endif
|
||||||
page_num: 1,
|
|
||||||
page_size: 50
|
|
||||||
})
|
|
||||||
this.popList = res5.rows.map(item => {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
ad_picture: picUrl + item.ad_picture
|
|
||||||
};
|
|
||||||
});
|
|
||||||
this.ads2Show = res5.rows.length !== 0 ? true : false;
|
|
||||||
},
|
|
||||||
|
|
||||||
headerServerClick(e) {
|
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU
|
||||||
console.log('当前点击内容', e);
|
if (e.appid) {
|
||||||
if (!e.link_url) {
|
uni.navigateToMiniProgram({
|
||||||
this.NotOpen();
|
appId: e.appid,
|
||||||
return
|
path: e.link_url,
|
||||||
}
|
//需要传递给目标小程序的数据
|
||||||
if (e.link_url) {
|
extraData: {
|
||||||
// #ifdef APP-PLUS
|
data1: "test",
|
||||||
uni.navigateTo({
|
},
|
||||||
url: '/pages/webview/webview?url=' + encodeURIComponent(e.link_url)
|
success(res) {
|
||||||
});
|
console.log("打开成功", res);
|
||||||
// #endif
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
NavgateTo(e.link_url);
|
||||||
|
// NavgateTo('/packages/localLife/index/index')
|
||||||
|
}
|
||||||
|
// 小程序中可能需要用户手动复制链接或使用web-view
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '提示',
|
||||||
|
// content: '即将打开外部链接,请复制后在浏览器中打开: ' + e.link_url,
|
||||||
|
// confirmText: '复制链接',
|
||||||
|
// success(res) {
|
||||||
|
// if (res.confirm) {
|
||||||
|
// uni.setClipboardData({
|
||||||
|
// data: e.link_url,
|
||||||
|
// success() {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '复制成功',
|
||||||
|
// icon: 'success'
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSwiperChange(e) {
|
||||||
|
this.currentAdIndex = e.detail.current;
|
||||||
|
},
|
||||||
|
onDetailClick() {
|
||||||
|
// 获取当前显示的广告项
|
||||||
|
const currentAd = this.popList[this.currentAdIndex];
|
||||||
|
if (currentAd) {
|
||||||
|
this.headerServerClick(currentAd);
|
||||||
|
} else if (this.popList.length > 0) {
|
||||||
|
// 如果当前索引无效,默认使用第一项
|
||||||
|
this.headerServerClick(this.popList[0]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// #ifdef H5
|
NotOpen() {
|
||||||
window.open(e.link_url, '_blank');
|
uni.showModal({
|
||||||
// #endif
|
title: "提示",
|
||||||
|
content: "此功能暂未开通!",
|
||||||
|
showCancel: false,
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU
|
async getCategoryList() {
|
||||||
if (e.appid) {
|
const res = await request(apiArr.categoryPage, "POST", {
|
||||||
uni.navigateToMiniProgram({
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
appId: e.appid,
|
category_code: "",
|
||||||
path: e.link_url,
|
category_name: "",
|
||||||
//需要传递给目标小程序的数据
|
page_num: 1,
|
||||||
extraData: {
|
page_size: 30,
|
||||||
'data1': 'test'
|
});
|
||||||
},
|
this.categoryList = res.rows;
|
||||||
success(res) {
|
this.selectTab(0, res.rows[0]);
|
||||||
console.log('打开成功', res)
|
},
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
NavgateTo(e.link_url)
|
|
||||||
// NavgateTo('/packages/localLife/index/index')
|
|
||||||
}
|
|
||||||
// 小程序中可能需要用户手动复制链接或使用web-view
|
|
||||||
// uni.showModal({
|
|
||||||
// title: '提示',
|
|
||||||
// content: '即将打开外部链接,请复制后在浏览器中打开: ' + e.link_url,
|
|
||||||
// confirmText: '复制链接',
|
|
||||||
// success(res) {
|
|
||||||
// if (res.confirm) {
|
|
||||||
// uni.setClipboardData({
|
|
||||||
// data: e.link_url,
|
|
||||||
// success() {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '复制成功',
|
|
||||||
// icon: 'success'
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSwiperChange(e) {
|
|
||||||
this.currentAdIndex = e.detail.current;
|
|
||||||
},
|
|
||||||
onDetailClick() {
|
|
||||||
// 获取当前显示的广告项
|
|
||||||
const currentAd = this.popList[this.currentAdIndex];
|
|
||||||
if (currentAd) {
|
|
||||||
this.headerServerClick(currentAd);
|
|
||||||
} else if (this.popList.length > 0) {
|
|
||||||
// 如果当前索引无效,默认使用第一项
|
|
||||||
this.headerServerClick(this.popList[0]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
NotOpen() {
|
async selectTab(index, item) {
|
||||||
uni.showModal({
|
this.selectedTab = index;
|
||||||
title: '提示',
|
console.log("选中的tab:", index);
|
||||||
content: '此功能暂未开通!',
|
const res = await request(apiArr.infoPage, "POST", {
|
||||||
showCancel: false,
|
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||||
complete: (res) => {
|
announcement_category_id: item.id,
|
||||||
if (res.cancel) {
|
title: "",
|
||||||
|
category_name: "",
|
||||||
|
page_num: this.page_num,
|
||||||
|
page_size: this.page_size,
|
||||||
|
});
|
||||||
|
if (res.rows && res.rows.length == this.page_size) {
|
||||||
|
this.flag = true;
|
||||||
|
} else {
|
||||||
|
this.flag = false;
|
||||||
|
}
|
||||||
|
res.rows = res.rows.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
list_image: picUrl + item.list_image,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.infoList.splice(0, this.infoList.length);
|
||||||
|
|
||||||
}
|
this.infoList = this.infoList.concat(res.rows);
|
||||||
}
|
},
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
async getCategoryList() {
|
detail(e) {
|
||||||
const res = await request(apiArr.categoryPage, "POST", {
|
console.log(e);
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
NavgateTo("../noticeDesc/index?id=" + e.id);
|
||||||
category_code: "",
|
},
|
||||||
category_name: "",
|
},
|
||||||
page_num: 1,
|
};
|
||||||
page_size: 30
|
|
||||||
})
|
|
||||||
this.categoryList = res.rows
|
|
||||||
this.selectTab(0, res.rows[0])
|
|
||||||
},
|
|
||||||
|
|
||||||
async selectTab(index, item) {
|
|
||||||
this.selectedTab = index;
|
|
||||||
console.log('选中的tab:', index);
|
|
||||||
const res = await request(apiArr.infoPage, "POST", {
|
|
||||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
|
||||||
announcement_category_id: item.id,
|
|
||||||
title: '',
|
|
||||||
category_name: '',
|
|
||||||
page_num: this.page_num,
|
|
||||||
page_size: this.page_size,
|
|
||||||
})
|
|
||||||
if(res.rows && res.rows.length == this.page_size){
|
|
||||||
this.flag= true
|
|
||||||
}else{
|
|
||||||
this.flag= false
|
|
||||||
}
|
|
||||||
res.rows = res.rows.map(item => {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
list_image: picUrl + item.list_image,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
this.infoList = this.infoList.concat(res.rows)
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
detail(e) {
|
|
||||||
console.log(e);
|
|
||||||
NavgateTo('../noticeDesc/index?id=' + e.id)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@ -115,7 +115,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.content-section {
|
.content-section {
|
||||||
margin-bottom: 30rpx;
|
/* margin-bottom: 30rpx; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-text{
|
.section-text{
|
||||||
@ -142,7 +142,7 @@
|
|||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-bottom: 20rpx;
|
/* margin-bottom: 20rpx; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-item {
|
.category-item {
|
||||||
@ -155,6 +155,7 @@
|
|||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
margin-bottom: 12rpx;
|
margin-bottom: 12rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-name {
|
.category-name {
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
>
|
>
|
||||||
<view id="top" style="height: 1px; opacity: 0"></view>
|
<view id="top" style="height: 1px; opacity: 0"></view>
|
||||||
<image
|
<image
|
||||||
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/guanggao2.png"
|
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/guanggao4.png"
|
||||||
class="content-img"
|
class="content-img"
|
||||||
></image>
|
></image>
|
||||||
<view
|
<view
|
||||||
@ -94,16 +94,46 @@ export default {
|
|||||||
localHeight: "",
|
localHeight: "",
|
||||||
currentLocation: "衡水市桃城区",
|
currentLocation: "衡水市桃城区",
|
||||||
categories: [
|
categories: [
|
||||||
{ id: "category1", name: "家电维修" },
|
{
|
||||||
{ id: "category2", name: "数码维修" },
|
id: "category1",
|
||||||
{ id: "category3", name: "家电清洗" },
|
name: "家电维修",
|
||||||
{ id: "category4", name: "洗衣洗鞋" },
|
},
|
||||||
{ id: "category5", name: "精细擦窗" },
|
{
|
||||||
{ id: "category6", name: "家庭保姆" },
|
id: "category2",
|
||||||
{ id: "category7", name: "管道疏通" },
|
name: "数码维修",
|
||||||
{ id: "category8", name: "家庭保洁" },
|
},
|
||||||
{ id: "category9", name: "整理收纳" },
|
{
|
||||||
{ id: "category10", name: "母婴服务" },
|
id: "category3",
|
||||||
|
name: "家电清洗",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "category4",
|
||||||
|
name: "洗衣洗鞋",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "category5",
|
||||||
|
name: "精细擦窗",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "category6",
|
||||||
|
name: "家庭保姆",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "category7",
|
||||||
|
name: "管道疏通",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "category8",
|
||||||
|
name: "家庭保洁",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "category9",
|
||||||
|
name: "整理收纳",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "category10",
|
||||||
|
name: "母婴服务",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
serviceCategories: [
|
serviceCategories: [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user