feat:合并代码 更换图片路径
This commit is contained in:
commit
ec2293bcb0
@ -1,8 +1,13 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
||||
<div
|
||||
class="searchBox"
|
||||
:style="{ height: localHeight + 'px', paddingTop: top + 'px' }"
|
||||
>
|
||||
<div class="searchBox_add">
|
||||
<div class="emptyCommunity" @click="addCommunity"> {{ communityVal }} </div>
|
||||
<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"
|
||||
mode="aspectFill"></image>
|
||||
@ -14,14 +19,21 @@
|
||||
|
||||
<div class="swiperBox1">
|
||||
<swiper @animationfinish="swipers" autoplay circular>
|
||||
<swiper-item v-for="(item, index) in bannerList" :key="index" @click="headerServerClick(item)">
|
||||
<swiper-item
|
||||
v-for="(item, index) in bannerList"
|
||||
:key="index"
|
||||
@click="headerServerClick(item)"
|
||||
>
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<view class="dot">
|
||||
<view :class="['dotItem', currentIdx == index ? 'active' : '']" v-for="(item, index) in bannerList"
|
||||
:key="index">
|
||||
<view
|
||||
:class="['dotItem', currentIdx == index ? 'active' : '']"
|
||||
v-for="(item, index) in bannerList"
|
||||
:key="index"
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -33,7 +45,11 @@
|
||||
|
||||
<div class="swiperBox2">
|
||||
<swiper @animationfinish="swipers" autoplay circular>
|
||||
<swiper-item v-for="(item, index) in streamerList" :key="index" @click="headerServerClick(item)">
|
||||
<swiper-item
|
||||
v-for="(item, index) in streamerList"
|
||||
:key="index"
|
||||
@click="headerServerClick(item)"
|
||||
>
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
@ -48,27 +64,44 @@
|
||||
|
||||
<view class="funcList">
|
||||
<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
|
||||
v-for="(item, index) in functionList"
|
||||
@click="jump(item.mini_program_url)"
|
||||
:key="index"
|
||||
>
|
||||
<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' : '']"
|
||||
@click="headerServerClick(item)">
|
||||
<div
|
||||
v-for="(item, index) in tileList"
|
||||
:key="index"
|
||||
:class="['ads', index == 0 ? 'ads_first' : '']"
|
||||
@click="headerServerClick(item)"
|
||||
>
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</div>
|
||||
|
||||
<div class="tabs">
|
||||
<div v-for="(item, index) in categoryList" :key="index"
|
||||
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
|
||||
<div
|
||||
v-for="(item, index) in categoryList"
|
||||
:key="index"
|
||||
:class="['tabItem', selectedTab === index ? 'active2' : '']"
|
||||
@click="selectTab(index, item)"
|
||||
>
|
||||
{{ item.category_name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="newsList">
|
||||
<div class="newsItem" v-for="item in infoList" @click="detail(item)" :key="item.id">
|
||||
<div
|
||||
class="newsItem"
|
||||
v-for="item in infoList"
|
||||
@click="detail(item)"
|
||||
:key="item.id"
|
||||
>
|
||||
<div class="newsItem_left">
|
||||
<div class="newsItem_left_tit">{{ item.title }}</div>
|
||||
<div class="newsItem_left_sub">{{ item.author }}</div>
|
||||
@ -85,14 +118,19 @@
|
||||
<div class="bigAdsCon">
|
||||
<div class="bigAdsCon_img">
|
||||
<swiper @animationfinish="swipers" autoplay circular>
|
||||
<swiper-item v-for="(item, index) in largePopList" :key="index"
|
||||
@click="headerServerClick(item)">
|
||||
<swiper-item
|
||||
v-for="(item, index) in largePopList"
|
||||
:key="index"
|
||||
@click="headerServerClick(item)"
|
||||
>
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</div>
|
||||
<div class="close" @click="closeAds">
|
||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png">
|
||||
<image
|
||||
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png"
|
||||
>
|
||||
</image>
|
||||
</div>
|
||||
</div>
|
||||
@ -101,8 +139,13 @@
|
||||
<div class="bigAds" v-if="ads2Show">
|
||||
<div class="bigAdsCon2">
|
||||
<div class="bigAdsCon2_img">
|
||||
<swiper :current="currentSwiperIndex" @change="onSwiperChange" @animationfinish="swipers" autoplay
|
||||
circular>
|
||||
<swiper
|
||||
:current="currentSwiperIndex"
|
||||
@change="onSwiperChange"
|
||||
@animationfinish="swipers"
|
||||
autoplay
|
||||
circular
|
||||
>
|
||||
<swiper-item v-for="(item, index) in popList" :key="index">
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
@ -124,18 +167,15 @@ import {
|
||||
picUrl,
|
||||
uniqueByField,
|
||||
menuButtonInfo,
|
||||
NavgateTo
|
||||
} from '../../../utils';
|
||||
|
||||
import {
|
||||
apiArr
|
||||
} from '../../../api/v2Community';
|
||||
NavgateTo,
|
||||
} from "../../../utils";
|
||||
|
||||
import { apiArr } from "../../../api/v2Community";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
communityVal: '添加我的房产',
|
||||
communityVal: "添加我的房产",
|
||||
picUrl,
|
||||
top: "",
|
||||
localHeight: "",
|
||||
@ -167,8 +207,8 @@ export default {
|
||||
|
||||
page_size: 10,
|
||||
page_num: 1,
|
||||
flag:false
|
||||
}
|
||||
flag: false,
|
||||
};
|
||||
},
|
||||
async onLoad(options) {
|
||||
const meun = menuButtonInfo();
|
||||
@ -176,67 +216,65 @@ export default {
|
||||
// this.top = meun.height + meun.top;
|
||||
this.localHeight = meun.height;
|
||||
// this.getCommunityList()
|
||||
if (!uni.getStorageSync('changeCommData').id) {
|
||||
uni.setStorageSync("changeCommData", { name: "森呼吸二期", id: 14 })
|
||||
if (!uni.getStorageSync("changeCommData").id) {
|
||||
uni.setStorageSync("changeCommData", { name: "森呼吸二期", id: 14 });
|
||||
}
|
||||
|
||||
this.communityVal = uni.getStorageSync('changeCommData').name
|
||||
this.getfunctionNum()
|
||||
this.getAdvertising()
|
||||
this.getCategoryList()
|
||||
this.communityVal = uni.getStorageSync("changeCommData").name;
|
||||
this.getfunctionNum();
|
||||
this.getAdvertising();
|
||||
this.getCategoryList();
|
||||
},
|
||||
|
||||
//上拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.communityVal = uni.getStorageSync('changeCommData').name
|
||||
this.bannerList = []
|
||||
this.currentIdx = 0
|
||||
this.streamerList = [] //横幅广告
|
||||
this.tileList = [] //平铺广告
|
||||
this.largePopList = [] //巨幅弹屏广告
|
||||
this.popList = [] //弹屏广告
|
||||
this.categoryList = []
|
||||
this.infoList = []
|
||||
this.selectedTab = 0
|
||||
this.currentAdIndex = 0
|
||||
this.getfunctionNum()
|
||||
this.getAdvertising()
|
||||
this.getCategoryList()
|
||||
this.communityVal = uni.getStorageSync("changeCommData").name;
|
||||
this.bannerList = [];
|
||||
this.currentIdx = 0;
|
||||
this.streamerList = []; //横幅广告
|
||||
this.tileList = []; //平铺广告
|
||||
this.largePopList = []; //巨幅弹屏广告
|
||||
this.popList = []; //弹屏广告
|
||||
this.categoryList = [];
|
||||
this.infoList = [];
|
||||
this.selectedTab = 0;
|
||||
this.currentAdIndex = 0;
|
||||
this.getfunctionNum();
|
||||
this.getAdvertising();
|
||||
this.getCategoryList();
|
||||
uni.stopPullDownRefresh();
|
||||
|
||||
},
|
||||
//下拉加载
|
||||
onReachBottom() {
|
||||
if (this.flag) {
|
||||
this.page_num++
|
||||
this.getCategoryList()
|
||||
this.page_num++;
|
||||
this.getCategoryList();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
// desc() {
|
||||
// NavgateTo("../communityDetail/index")
|
||||
// },
|
||||
apply() {
|
||||
NavgateTo("../applyOwer/index")
|
||||
NavgateTo("../applyOwer/index");
|
||||
},
|
||||
closeAds() {
|
||||
this.ads1Show = false
|
||||
this.ads1Show = false;
|
||||
},
|
||||
closeAds2() {
|
||||
this.ads2Show = false
|
||||
this.ads2Show = false;
|
||||
},
|
||||
jump(e) {
|
||||
if (!e) {
|
||||
this.NotOpen();
|
||||
return;
|
||||
}
|
||||
NavgateTo(e)
|
||||
NavgateTo(e);
|
||||
},
|
||||
|
||||
addCommunity() {
|
||||
NavgateTo("/packages/community/myCommunity/index")
|
||||
NavgateTo("/packages/community/myCommunity/index");
|
||||
},
|
||||
|
||||
swipers(event) {
|
||||
@ -245,119 +283,124 @@ export default {
|
||||
},
|
||||
|
||||
async getfunctionNum() {
|
||||
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()
|
||||
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();
|
||||
},
|
||||
|
||||
async getfunctionList() {
|
||||
const res = await request(apiArr.navPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
page_size: 50,
|
||||
});
|
||||
console.log(res, 'xx');
|
||||
console.log(res, "xx");
|
||||
|
||||
// 获取 rowNum 和 colNum 的乘积
|
||||
const totalItems = this.rowNum * this.colNum;
|
||||
// 使用 slice 方法截取前 totalItems 个元素
|
||||
this.functionList = res.rows.slice(0, totalItems).map(item => {
|
||||
this.functionList = res.rows.slice(0, totalItems).map((item) => {
|
||||
return {
|
||||
...item,
|
||||
nav_icon: picUrl + item.nav_icon
|
||||
nav_icon: picUrl + item.nav_icon,
|
||||
};
|
||||
});
|
||||
|
||||
console.log('functionList', this.functionList);
|
||||
console.log("functionList", this.functionList);
|
||||
},
|
||||
|
||||
async getAdvertising() {
|
||||
const res = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
ad_position: 1,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.bannerList = res.rows.map(item => {
|
||||
page_size: 50,
|
||||
});
|
||||
this.bannerList = res.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
ad_picture: picUrl + item.ad_picture,
|
||||
};
|
||||
});
|
||||
|
||||
const res2 = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
ad_position: 2,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.streamerList = res2.rows.map(item => {
|
||||
page_size: 50,
|
||||
});
|
||||
this.streamerList = res2.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
ad_picture: picUrl + item.ad_picture,
|
||||
};
|
||||
});
|
||||
|
||||
const res3 = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
ad_position: 3,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.tileList = res3.rows.map(item => {
|
||||
page_size: 50,
|
||||
});
|
||||
this.tileList = res3.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
ad_picture: picUrl + item.ad_picture,
|
||||
};
|
||||
});
|
||||
|
||||
const res4 = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
ad_position: 4,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.largePopList = res4.rows.map(item => {
|
||||
page_size: 50,
|
||||
});
|
||||
this.largePopList = res4.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
ad_picture: picUrl + item.ad_picture,
|
||||
};
|
||||
});
|
||||
this.ads1Show = res4.rows.length !== 0 ? true : false;
|
||||
|
||||
const res5 = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
ad_position: 5,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.popList = res5.rows.map(item => {
|
||||
page_size: 50,
|
||||
});
|
||||
this.popList = res5.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
ad_picture: picUrl + item.ad_picture,
|
||||
};
|
||||
});
|
||||
this.ads2Show = res5.rows.length !== 0 ? true : false;
|
||||
},
|
||||
|
||||
headerServerClick(e) {
|
||||
console.log('当前点击内容', e);
|
||||
console.log("当前点击内容", e);
|
||||
if (!e.link_url) {
|
||||
this.NotOpen();
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (e.link_url) {
|
||||
// #ifdef APP-PLUS
|
||||
uni.navigateTo({
|
||||
url: '/pages/webview/webview?url=' + encodeURIComponent(e.link_url)
|
||||
url: "/pages/webview/webview?url=" + encodeURIComponent(e.link_url),
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
window.open(e.link_url, '_blank');
|
||||
window.open(e.link_url, "_blank");
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU
|
||||
@ -367,14 +410,14 @@ export default {
|
||||
path: e.link_url,
|
||||
//需要传递给目标小程序的数据
|
||||
extraData: {
|
||||
'data1': 'test'
|
||||
data1: "test",
|
||||
},
|
||||
success(res) {
|
||||
console.log('打开成功', res)
|
||||
}
|
||||
})
|
||||
console.log("打开成功", res);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
NavgateTo(e.link_url)
|
||||
NavgateTo(e.link_url);
|
||||
// NavgateTo('/packages/localLife/index/index')
|
||||
}
|
||||
// 小程序中可能需要用户手动复制链接或使用web-view
|
||||
@ -415,63 +458,61 @@ export default {
|
||||
|
||||
NotOpen() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '此功能暂未开通!',
|
||||
title: "提示",
|
||||
content: "此功能暂未开通!",
|
||||
showCancel: false,
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
async getCategoryList() {
|
||||
const res = await request(apiArr.categoryPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
category_code: "",
|
||||
category_name: "",
|
||||
page_num: 1,
|
||||
page_size: 30
|
||||
})
|
||||
this.categoryList = res.rows
|
||||
this.selectTab(0, res.rows[0])
|
||||
page_size: 30,
|
||||
});
|
||||
this.categoryList = res.rows;
|
||||
this.selectTab(0, res.rows[0]);
|
||||
},
|
||||
|
||||
async selectTab(index, item) {
|
||||
this.selectedTab = index;
|
||||
console.log('选中的tab:', index);
|
||||
console.log("选中的tab:", index);
|
||||
const res = await request(apiArr.infoPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
community_id: Number(uni.getStorageSync("changeCommData").id),
|
||||
announcement_category_id: item.id,
|
||||
title: '',
|
||||
category_name: '',
|
||||
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
|
||||
this.flag = true;
|
||||
} else {
|
||||
this.flag= false
|
||||
this.flag = false;
|
||||
}
|
||||
res.rows = res.rows.map(item => {
|
||||
res.rows = res.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
list_image: picUrl + item.list_image,
|
||||
};
|
||||
});
|
||||
this.infoList = this.infoList.concat(res.rows)
|
||||
},
|
||||
this.infoList.splice(0, this.infoList.length);
|
||||
|
||||
this.infoList = this.infoList.concat(res.rows);
|
||||
},
|
||||
|
||||
detail(e) {
|
||||
console.log(e);
|
||||
NavgateTo('../noticeDesc/index?id=' + e.id)
|
||||
NavgateTo("../noticeDesc/index?id=" + e.id);
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
}
|
||||
|
||||
.content-section {
|
||||
margin-bottom: 30rpx;
|
||||
/* margin-bottom: 30rpx; */
|
||||
}
|
||||
|
||||
.section-text{
|
||||
@ -142,7 +142,7 @@
|
||||
gap: 20rpx;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
/* margin-bottom: 20rpx; */
|
||||
}
|
||||
|
||||
.category-item {
|
||||
@ -155,6 +155,7 @@
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-bottom: 12rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.category-name {
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
>
|
||||
<view id="top" style="height: 1px; opacity: 0"></view>
|
||||
<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"
|
||||
></image>
|
||||
<view
|
||||
@ -94,16 +94,46 @@ export default {
|
||||
localHeight: "",
|
||||
currentLocation: "衡水市桃城区",
|
||||
categories: [
|
||||
{ id: "category1", name: "家电维修" },
|
||||
{ id: "category2", 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: "母婴服务" },
|
||||
{
|
||||
id: "category1",
|
||||
name: "家电维修",
|
||||
},
|
||||
{
|
||||
id: "category2",
|
||||
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: [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user