Compare commits

..

No commits in common. "f588a5a0dc5019896be7cc61be90765c0b44e588" and "ac23f91ea1fb5def8472bee6a60f8c95ced0e5a5" have entirely different histories.

3 changed files with 432 additions and 504 deletions

View File

@ -1,13 +1,8 @@
<template> <template>
<div class="container"> <div class="container">
<div <div class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
class="searchBox"
:style="{ height: localHeight + 'px', paddingTop: top + 'px' }"
>
<div class="searchBox_add"> <div class="searchBox_add">
<div class="emptyCommunity" @click="addCommunity"> <div class="emptyCommunity" @click="addCommunity"> {{ communityVal }} </div>
{{ communityVal }}
</div>
<!-- <div class="MyCommunity" v-if="false"> <!-- <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>
@ -19,21 +14,14 @@
<div class="swiperBox1"> <div class="swiperBox1">
<swiper @animationfinish="swipers" autoplay circular> <swiper @animationfinish="swipers" autoplay circular>
<swiper-item <swiper-item v-for="(item, index) in bannerList" :key="index" @click="headerServerClick(item)">
v-for="(item, index) in bannerList"
:key="index"
@click="headerServerClick(item)"
>
<image :src="item.ad_picture" mode="aspectFill" /> <image :src="item.ad_picture" mode="aspectFill" />
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="dot"> <view class="dot">
<view <view :class="['dotItem', currentIdx == index ? 'active' : '']" v-for="(item, index) in bannerList"
:class="['dotItem', currentIdx == index ? 'active' : '']" :key="index">
v-for="(item, index) in bannerList"
:key="index"
>
</view> </view>
</view> </view>
@ -45,11 +33,7 @@
<div class="swiperBox2"> <div class="swiperBox2">
<swiper @animationfinish="swipers" autoplay circular> <swiper @animationfinish="swipers" autoplay circular>
<swiper-item <swiper-item v-for="(item, index) in streamerList" :key="index" @click="headerServerClick(item)">
v-for="(item, index) in streamerList"
:key="index"
@click="headerServerClick(item)"
>
<image :src="item.ad_picture" mode="aspectFill" /> <image :src="item.ad_picture" mode="aspectFill" />
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -64,44 +48,27 @@
<view class="funcList"> <view class="funcList">
<u-grid :col="rowNum" :border="false"> <u-grid :col="rowNum" :border="false">
<u-grid-item <u-grid-item v-for="(item, index) in functionList" @click="jump(item.mini_program_url)" :key="index">
v-for="(item, index) in functionList"
@click="jump(item.mini_program_url)"
:key="index"
>
<image class="grid_Pic" :src="item.nav_icon" mode=""></image> <image class="grid_Pic" :src="item.nav_icon" mode=""></image>
<text>{{ item.nav_name }}</text> <text>{{ item.nav_name }}</text>
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</view> </view>
<div <div v-for="(item, index) in tileList" :key="index" :class="['ads', index == 0 ? 'ads_first' : '']"
v-for="(item, index) in tileList" @click="headerServerClick(item)">
:key="index"
:class="['ads', index == 0 ? 'ads_first' : '']"
@click="headerServerClick(item)"
>
<image :src="item.ad_picture" mode="aspectFill" /> <image :src="item.ad_picture" mode="aspectFill" />
</div> </div>
<div class="tabs"> <div class="tabs">
<div <div v-for="(item, index) in categoryList" :key="index"
v-for="(item, index) in categoryList" :class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
:key="index"
:class="['tabItem', selectedTab === index ? 'active2' : '']"
@click="selectTab(index, item)"
>
{{ item.category_name }} {{ item.category_name }}
</div> </div>
</div> </div>
<div class="newsList"> <div class="newsList">
<div <div class="newsItem" v-for="item in infoList" @click="detail(item)" :key="item.id">
class="newsItem"
v-for="item in infoList"
@click="detail(item)"
:key="item.id"
>
<div class="newsItem_left"> <div class="newsItem_left">
<div class="newsItem_left_tit">{{ item.title }}</div> <div class="newsItem_left_tit">{{ item.title }}</div>
<div class="newsItem_left_sub">{{ item.author }}</div> <div class="newsItem_left_sub">{{ item.author }}</div>
@ -118,19 +85,14 @@
<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 <swiper-item v-for="(item, index) in largePopList" :key="index"
v-for="(item, index) in largePopList" @click="headerServerClick(item)">
:key="index"
@click="headerServerClick(item)"
>
<image :src="item.ad_picture" mode="aspectFill" /> <image :src="item.ad_picture" mode="aspectFill" />
</swiper-item> </swiper-item>
</swiper> </swiper>
</div> </div>
<div class="close" @click="closeAds"> <div class="close" @click="closeAds">
<image <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png">
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png"
>
</image> </image>
</div> </div>
</div> </div>
@ -139,13 +101,8 @@
<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 <swiper :current="currentSwiperIndex" @change="onSwiperChange" @animationfinish="swipers" autoplay
:current="currentSwiperIndex" circular>
@change="onSwiperChange"
@animationfinish="swipers"
autoplay
circular
>
<swiper-item v-for="(item, index) in popList" :key="index"> <swiper-item v-for="(item, index) in popList" :key="index">
<image :src="item.ad_picture" mode="aspectFill" /> <image :src="item.ad_picture" mode="aspectFill" />
</swiper-item> </swiper-item>
@ -167,15 +124,18 @@ import {
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: "",
@ -207,8 +167,8 @@ export default {
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();
@ -216,65 +176,67 @@ export default {
// 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() { onReachBottom() {
if(this.flag){ if(this.flag){
this.page_num++; this.page_num++
this.getCategoryList(); this.getCategoryList()
} }
}, },
methods: { methods: {
// desc() { // desc() {
// NavgateTo("../communityDetail/index") // NavgateTo("../communityDetail/index")
// }, // },
apply() { apply() {
NavgateTo("../applyOwer/index"); NavgateTo("../applyOwer/index")
}, },
closeAds() { closeAds() {
this.ads1Show = false; this.ads1Show = false
}, },
closeAds2() { closeAds2() {
this.ads2Show = false; this.ads2Show = false
}, },
jump(e) { jump(e) {
if (!e) { if (!e) {
this.NotOpen(); this.NotOpen();
return; return;
} }
NavgateTo(e); NavgateTo(e)
}, },
addCommunity() { addCommunity() {
NavgateTo("/packages/community/myCommunity/index"); NavgateTo("/packages/community/myCommunity/index")
}, },
swipers(event) { swipers(event) {
@ -283,124 +245,119 @@ export default {
}, },
async getfunctionNum() { async getfunctionNum() {
const res = await request( const res = await request(apiArr.commInfo, "POST", {}, {
apiArr.commInfo, slice: false
"POST", });
{}, this.rowNum = res.nav_row_num_comm
{ this.colNum = res.nav_row_total_comm
slice: false, return await this.getfunctionList()
}
);
this.rowNum = res.nav_row_num_comm;
this.colNum = res.nav_row_total_comm;
return await this.getfunctionList();
}, },
async getfunctionList() { async getfunctionList() {
const res = await request(apiArr.navPage, "POST", { 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_num: 1,
page_size: 50, page_size: 50
}); });
console.log(res, "xx"); console.log(res, 'xx');
// rowNum colNum // rowNum colNum
const totalItems = this.rowNum * this.colNum; const totalItems = this.rowNum * this.colNum;
// 使 slice totalItems // 使 slice totalItems
this.functionList = res.rows.slice(0, totalItems).map((item) => { this.functionList = res.rows.slice(0, totalItems).map(item => {
return { return {
...item, ...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() { async getAdvertising() {
const res = 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: 1, ad_position: 1,
page_num: 1, page_num: 1,
page_size: 50, page_size: 50
}); })
this.bannerList = res.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 res2 = await request(apiArr.advPage, "POST", {
community_id: Number(uni.getStorageSync("changeCommData").id), community_id: Number(uni.getStorageSync('changeCommData').id),
ad_position: 2, ad_position: 2,
page_num: 1, page_num: 1,
page_size: 50, page_size: 50
}); })
this.streamerList = res2.rows.map((item) => { this.streamerList = res2.rows.map(item => {
return { return {
...item, ...item,
ad_picture: picUrl + item.ad_picture, ad_picture: picUrl + item.ad_picture
}; };
}); });
const res3 = await request(apiArr.advPage, "POST", { const res3 = await request(apiArr.advPage, "POST", {
community_id: Number(uni.getStorageSync("changeCommData").id), community_id: Number(uni.getStorageSync('changeCommData').id),
ad_position: 3, ad_position: 3,
page_num: 1, page_num: 1,
page_size: 50, page_size: 50
}); })
this.tileList = res3.rows.map((item) => { this.tileList = res3.rows.map(item => {
return { return {
...item, ...item,
ad_picture: picUrl + item.ad_picture, ad_picture: picUrl + item.ad_picture
}; };
}); });
const res4 = 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: 4, ad_position: 4,
page_num: 1, page_num: 1,
page_size: 50, page_size: 50
}); })
this.largePopList = res4.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; this.ads1Show = res4.rows.length !== 0 ? true : false;
const res5 = 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: 5, ad_position: 5,
page_num: 1, page_num: 1,
page_size: 50, page_size: 50
}); })
this.popList = res5.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; this.ads2Show = res5.rows.length !== 0 ? true : false;
}, },
headerServerClick(e) { headerServerClick(e) {
console.log("当前点击内容", e); console.log('当前点击内容', e);
if (!e.link_url) { if (!e.link_url) {
this.NotOpen(); this.NotOpen();
return; return
} }
if (e.link_url) { if (e.link_url) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.navigateTo({ uni.navigateTo({
url: "/pages/webview/webview?url=" + encodeURIComponent(e.link_url), url: '/pages/webview/webview?url=' + encodeURIComponent(e.link_url)
}); });
// #endif // #endif
// #ifdef H5 // #ifdef H5
window.open(e.link_url, "_blank"); window.open(e.link_url, '_blank');
// #endif // #endif
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU // #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU
@ -410,14 +367,14 @@ export default {
path: e.link_url, path: e.link_url,
// //
extraData: { extraData: {
data1: "test", 'data1': 'test'
}, },
success(res) { success(res) {
console.log("打开成功", res); console.log('打开成功', res)
}, }
}); })
} else { } else {
NavgateTo(e.link_url); NavgateTo(e.link_url)
// NavgateTo('/packages/localLife/index/index') // NavgateTo('/packages/localLife/index/index')
} }
// 使web-view // 使web-view
@ -458,61 +415,63 @@ export default {
NotOpen() { NotOpen() {
uni.showModal({ uni.showModal({
title: "提示", title: '提示',
content: "此功能暂未开通!", content: '此功能暂未开通!',
showCancel: false, showCancel: false,
complete: (res) => { complete: (res) => {
if (res.cancel) { if (res.cancel) {
} }
}, }
}); })
}, },
async getCategoryList() { async getCategoryList() {
const res = await request(apiArr.categoryPage, "POST", { const res = await request(apiArr.categoryPage, "POST", {
community_id: Number(uni.getStorageSync("changeCommData").id), community_id: Number(uni.getStorageSync('changeCommData').id),
category_code: "", category_code: "",
category_name: "", category_name: "",
page_num: 1, page_num: 1,
page_size: 30, page_size: 30
}); })
this.categoryList = res.rows; this.categoryList = res.rows
this.selectTab(0, res.rows[0]); this.selectTab(0, res.rows[0])
}, },
async selectTab(index, item) { async selectTab(index, item) {
this.selectedTab = index; this.selectedTab = index;
console.log("选中的tab:", index); console.log('选中的tab:', index);
const res = await request(apiArr.infoPage, "POST", { 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, announcement_category_id: item.id,
title: "", title: '',
category_name: "", category_name: '',
page_num: this.page_num, page_num: this.page_num,
page_size: this.page_size, page_size: this.page_size,
}); })
if(res.rows && res.rows.length == this.page_size){ if(res.rows && res.rows.length == this.page_size){
this.flag = true; this.flag= true
}else{ }else{
this.flag = false; this.flag= false
} }
res.rows = res.rows.map((item) => { res.rows = res.rows.map(item => {
return { return {
...item, ...item,
list_image: picUrl + item.list_image, list_image: picUrl + item.list_image,
}; };
}); });
this.infoList.splice(0, this.infoList.length); this.infoList = this.infoList.concat(res.rows)
this.infoList = this.infoList.concat(res.rows);
}, },
detail(e) { detail(e) {
console.log(e); console.log(e);
NavgateTo("../noticeDesc/index?id=" + e.id); NavgateTo('../noticeDesc/index?id=' + e.id)
}, },
}, },
};
}
</script> </script>
<style> <style>

View File

@ -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,7 +155,6 @@
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
margin-bottom: 12rpx; margin-bottom: 12rpx;
border-radius: 10rpx;
} }
.category-name { .category-name {

View File

@ -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="http://localhost:8080/guanggao4.png" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
class="content-img" class="content-img"
></image> ></image>
<view <view
@ -94,67 +94,37 @@ export default {
localHeight: "", localHeight: "",
currentLocation: "衡水市桃城区", currentLocation: "衡水市桃城区",
categories: [ categories: [
{ { id: "category1", name: "家电维修" },
id: "category1", { id: "category2", name: "数码维修" },
name: "家电维修", { id: "category3", name: "家电清洗" },
}, { id: "category4", name: "洗衣洗鞋" },
{ { id: "category5", name: "精细擦窗" },
id: "category2", { id: "category6", name: "家庭保姆" },
name: "数码维修", { id: "category7", name: "管道疏通" },
}, { id: "category8", name: "家庭保洁" },
{ { id: "category9", name: "整理收纳" },
id: "category3", { id: "category10", name: "母婴服务" },
name: "家电清洗",
},
{
id: "category4",
name: "洗衣洗鞋",
},
{
id: "category5",
name: "精细擦窗",
},
{
id: "category6",
name: "家庭保姆",
},
{
id: "category7",
name: "管道疏通",
},
{
id: "category8",
name: "家庭保洁",
},
{
id: "category9",
name: "整理收纳",
},
{
id: "category10",
name: "母婴服务",
},
], ],
serviceCategories: [ serviceCategories: [
{ {
name: "家电维修", name: "家电维修",
icon: "http://localhost:8080/guanggao1.png", icon: "",
}, },
{ {
name: "数码维修", name: "数码维修",
icon: "http://localhost:8080/guanggao1.png", icon: "",
}, },
{ {
name: "电器清洗", name: "电器清洗",
icon: "http://localhost:8080/guanggao1.png", icon: "",
}, },
{ {
name: "洗衣洗鞋", name: "洗衣洗鞋",
icon: "http://localhost:8080/guanggao1.png", icon: "",
}, },
{ {
name: "精细擦窗", name: "精细擦窗",
icon: "http://localhost:8080/guanggao1.png", icon: "",
}, },
], ],
currentIndex: 0, currentIndex: 0,