我的小区 - 公告部分接口
This commit is contained in:
parent
41b0781ad7
commit
2aa560e081
@ -9,4 +9,10 @@ export const apiArr = {
|
||||
workOrderCrudDispatch: '/api/v2/wechat/work-order-crud/dispatch', // 人员派单
|
||||
workOrderCrudAccept: '/api/v2/wechat/work-order-crud/accept', // 人员接单
|
||||
workOrderCrudUpdate: '/api/v2/wechat/work-order-crud/worker/update', // 工作人员更新工单
|
||||
|
||||
navPage: '/api/v2/wechat/community-navigation-crud/page', // 小区图标导航信息分页
|
||||
advPage: '/api/v2/wechat/community-advertisement-crud/page', // 小区广告信息分页
|
||||
|
||||
categoryPage: '/api/v2/wechat/announcement-category-crud/page', // 公告分类信息分页
|
||||
infoPage: '/api/v2/wechat/announcement-crud/page', // 公告信息分页
|
||||
};
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
NavgateTo("packages/community/myCommunity/index")
|
||||
NavgateTo("/packages/community/myCommunity/index")
|
||||
})
|
||||
},
|
||||
choseCommunity() {
|
||||
|
||||
@ -3,74 +3,68 @@
|
||||
<div class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
||||
<div class="searchBox_add">
|
||||
<div class="emptyCommunity" @click="addCommunity"> {{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"
|
||||
mode="aspectFill"></image>
|
||||
<span>惠生活</span>
|
||||
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="swiperBox1">
|
||||
<swiper>
|
||||
<swiper-item>
|
||||
<image src="http://192.168.0.172:5500/test.png"></image>
|
||||
</swiper-item>
|
||||
|
||||
<swiper-item>
|
||||
<image src="http://192.168.0.172:5500/test.png"></image>
|
||||
<swiper @animationfinish="swipers" autoplay circular>
|
||||
<swiper-item v-for="(item, index) in bannerList" :key="index" @click="headerServerClick(item)">
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<div class="dot">
|
||||
<view class="dot">
|
||||
<view :class="['dotItem', currentIdx == index ? 'active' : '']" v-for="(item, index) in bannerList"
|
||||
:key="index">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <div class="dot">
|
||||
<div class="dotItem"></div>
|
||||
<div class="dotItem active"></div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="swiperBox2">
|
||||
<swiper>
|
||||
<swiper-item>
|
||||
<image src="http://192.168.0.172:5500/com_communityNav.png"></image>
|
||||
</swiper-item>
|
||||
|
||||
<swiper-item>
|
||||
<image src="http://192.168.0.172:5500/com_communityNav.png"></image>
|
||||
<swiper @animationfinish="swipers" autoplay circular>
|
||||
<swiper-item v-for="(item, index) in streamerList" :key="index" @click="headerServerClick(item)">
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</div>
|
||||
|
||||
<div class="funcList">
|
||||
<div class="funcItem" v-for="item in functionList" @click="jump(item.link)">
|
||||
<image :src="item.url"></image>
|
||||
{{ item.name }}
|
||||
<div class="funcItem" v-for="item in functionList" @click="jump(item.mini_program_url)">
|
||||
<image :src="item.nav_icon"></image>
|
||||
{{ item.nav_name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ads">
|
||||
<image src="http://192.168.0.172:5500/com_communityNav.png" mode="aspectFill"></image>
|
||||
</div>
|
||||
|
||||
<div class="ads">
|
||||
<image src="http://192.168.0.172:5500/com_communityNav.png" mode="aspectFill"></image>
|
||||
<div v-for="(item, index) in tileList" :key="index" class="ads" @click="headerServerClick(item)">
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</div>
|
||||
|
||||
<div class="tabs">
|
||||
<div class="tabItem active2">物业公告</div>
|
||||
<div class="tabItem">天气</div>
|
||||
<div class="tabItem">放假时间</div>
|
||||
<div class="tabItem">送饭</div>
|
||||
<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 4">
|
||||
<div class="newsItem" v-for="item in infoList">
|
||||
<div class="newsItem_left">
|
||||
<div class="newsItem_left_tit">关于小区停车场治理通告</div>
|
||||
<div class="newsItem_left_sub">高尚</div>
|
||||
<div class="newsItem_left_tit">{{item.title}}</div>
|
||||
<div class="newsItem_left_sub">{{item.author}}</div>
|
||||
</div>
|
||||
<div class="newsItem_right">
|
||||
<image src="http://192.168.0.172:5500/test.png"></image>
|
||||
<image :src="item.list_image" mode="aspectFill" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -80,7 +74,12 @@
|
||||
<div class="bigAds" v-if="ads1Show">
|
||||
<div class="bigAdsCon">
|
||||
<div class="bigAdsCon_img">
|
||||
<image src="http://192.168.0.172:5500/test.png"></image>
|
||||
<swiper @animationfinish="swipers" autoplay circular>
|
||||
<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="http://192.168.0.172:5500/com_close.png"></image>
|
||||
@ -91,11 +90,15 @@
|
||||
<div class="bigAds" v-if="ads2Show">
|
||||
<div class="bigAdsCon2">
|
||||
<div class="bigAdsCon2_img">
|
||||
<image src="http://192.168.0.172:5500/test.png"></image>
|
||||
<swiper @animationfinish="swipers" autoplay circular>
|
||||
<swiper-item v-for="(item, index) in popList" :key="index">
|
||||
<image :src="item.ad_picture" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</div>
|
||||
<div class="AdsBtnList">
|
||||
<div class="AdsBtnItem1" @click="closeAds">取消</div>
|
||||
<div class="AdsBtnItem2">了解详情</div>
|
||||
<div class="AdsBtnItem1" @click="closeAds2">取消</div>
|
||||
<div class="AdsBtnItem2" @click="onDetailClick">了解详情</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -120,7 +123,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
communityVal:'添加我的房产',
|
||||
communityVal: '添加我的房产',
|
||||
picUrl,
|
||||
top: "",
|
||||
localHeight: "",
|
||||
@ -131,44 +134,33 @@
|
||||
communityList: [],
|
||||
flag: false,
|
||||
|
||||
functionList: [{
|
||||
name: "报事报修",
|
||||
link: "",
|
||||
url: "http://192.168.0.172:5500/com_homeIcon1.png",
|
||||
},
|
||||
{
|
||||
name: "物业缴费",
|
||||
link: "/packages/community/propertyPayment/index",
|
||||
url: "http://192.168.0.172:5500/com_homeIcon2.png",
|
||||
},
|
||||
{
|
||||
name: "物业公积",
|
||||
link: "/packages/community/providentFund/index",
|
||||
url: "http://192.168.0.172:5500/com_homeIcon3.png",
|
||||
},
|
||||
{
|
||||
name: "物业公积",
|
||||
link: "",
|
||||
url: "http://192.168.0.172:5500/com_homeIcon4.png",
|
||||
},
|
||||
{
|
||||
name: "物业服务",
|
||||
link: "",
|
||||
url: "http://192.168.0.172:5500/com_homeIcon5.png",
|
||||
},
|
||||
],
|
||||
functionList: [],
|
||||
|
||||
ads1Show: false,
|
||||
ads2Show: false,
|
||||
ads1Show: true,
|
||||
ads2Show: true,
|
||||
|
||||
bannerList: [], //轮播图广告
|
||||
currentIdx: 0,
|
||||
streamerList: [], //横幅广告
|
||||
tileList: [], //平铺广告
|
||||
largePopList: [], //巨幅弹屏广告
|
||||
popList: [], //弹屏广告
|
||||
|
||||
categoryList: [],
|
||||
infoList: [],
|
||||
selectedTab: 0
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
async onLoad(options) {
|
||||
const meun = menuButtonInfo();
|
||||
this.top = meun.top;
|
||||
// this.top = meun.height + meun.top;
|
||||
this.localHeight = meun.height;
|
||||
// this.getCommunityList()
|
||||
this.communityVal = uni.getStorageSync('changeCommName')
|
||||
this.communityVal = uni.getStorageSync('changeCommData').name
|
||||
await this.getfunctionList()
|
||||
this.getAdvertising()
|
||||
this.getCategoryList()
|
||||
},
|
||||
|
||||
|
||||
@ -181,6 +173,8 @@
|
||||
},
|
||||
closeAds() {
|
||||
this.ads1Show = false
|
||||
},
|
||||
closeAds2() {
|
||||
this.ads2Show = false
|
||||
},
|
||||
jump(e) {
|
||||
@ -210,6 +204,207 @@
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
swipers(event) {
|
||||
// 获取当前轮播图索引
|
||||
this.currentIdx = event.detail.current;
|
||||
},
|
||||
async getfunctionList() {
|
||||
const res = await request(apiArr.navPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.functionList = res.rows.map(item => {
|
||||
return {
|
||||
...item,
|
||||
nav_icon: picUrl + item.nav_icon
|
||||
};
|
||||
});
|
||||
console.log(this.functionList)
|
||||
},
|
||||
|
||||
async getAdvertising() {
|
||||
// bannerList
|
||||
// streamerList
|
||||
// tileList
|
||||
// largePopList
|
||||
// popList
|
||||
const res = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
ad_position: 1,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.bannerList = res.rows.map(item => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
};
|
||||
});
|
||||
|
||||
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
|
||||
};
|
||||
});
|
||||
|
||||
const res3 = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
ad_position: 3,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.tileList = res3.rows.map(item => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
};
|
||||
});
|
||||
|
||||
const res4 = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
ad_position: 4,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.largePopList = res4.rows.map(item => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
};
|
||||
});
|
||||
|
||||
const res5 = await request(apiArr.advPage, "POST", {
|
||||
community_id: Number(uni.getStorageSync('changeCommData').id),
|
||||
ad_position: 5,
|
||||
page_num: 1,
|
||||
page_size: 50
|
||||
})
|
||||
this.popList = res5.rows.map(item => {
|
||||
return {
|
||||
...item,
|
||||
ad_picture: picUrl + item.ad_picture
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
headerServerClick(e) {
|
||||
console.log('当前点击内容', e);
|
||||
if (!e.link_url) {
|
||||
this.NotOpen();
|
||||
return
|
||||
}
|
||||
if (e.link_url) {
|
||||
// #ifdef APP-PLUS
|
||||
uni.navigateTo({
|
||||
url: '/pages/webview/webview?url=' + encodeURIComponent(e.link_url)
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
window.open(e.link_url, '_blank');
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU
|
||||
if (e.appid) {
|
||||
uni.navigateToMiniProgram({
|
||||
appId: e.appid,
|
||||
path: e.link_url,
|
||||
//需要传递给目标小程序的数据
|
||||
extraData: {
|
||||
'data1': 'test'
|
||||
},
|
||||
success(res) {
|
||||
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
|
||||
}
|
||||
},
|
||||
onDetailClick() {
|
||||
// 获取当前显示的广告项
|
||||
const currentAd = this.popList[this.currentAdIndex];
|
||||
if (currentAd) {
|
||||
this.headerServerClick(currentAd);
|
||||
} else if (this.popList.length > 0) {
|
||||
// 如果当前索引无效,默认使用第一项
|
||||
this.headerServerClick(this.popList[0]);
|
||||
}
|
||||
},
|
||||
|
||||
NotOpen() {
|
||||
uni.showModal({
|
||||
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),
|
||||
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: 1,
|
||||
page_size: 10,
|
||||
})
|
||||
this.infoList = res.rows.map(item => {
|
||||
return {
|
||||
...item,
|
||||
list_image: picUrl + item.list_image,
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="communityItem_left_img">
|
||||
<image src="http://192.168.0.172:5500/test.png"></image>
|
||||
</div>
|
||||
<div class="communityItem_left_msg" @click="toUpview(item.name)">
|
||||
<div class="communityItem_left_msg" @click="toUpview(item)">
|
||||
<div class="communityItem_left_msg_tit">{{item.name}}<span>( {{item.room_owner_list.length}}
|
||||
)</span></div>
|
||||
<div class="communityItem_left_msg_msg">{{item.addr}}</div>
|
||||
@ -61,8 +61,8 @@
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
toUpview(name) {
|
||||
uni.setStorageSync('changeCommName', name);
|
||||
toUpview(item) {
|
||||
uni.setStorageSync('changeCommData', { id: item.community_id, name: item.name });
|
||||
NavgateTo("/packages/community/index/index")
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user