Compare commits

...

11 Commits

40 changed files with 1931 additions and 1037 deletions

View File

@ -34,7 +34,7 @@
page{
font-size: 28rpx;
padding-bottom: 120rpx;
padding-bottom: 180rpx;
}
.uicon-volume {

62
README-zh.md Normal file
View File

@ -0,0 +1,62 @@
Git 提交规范
- feat 新增功能
- fix 修复 Bug
- docs 文档更新(如 README、CHANGELOG 等)
- style 代码样式调整(如空格、格式化等,不涉及功能变更)
- refactor 代码重构(既不修复 Bug 也不新增功能)
- perf 性能优化
- test 添加或修改测试代码
- chore 构建过程或辅助工具的变动(如依赖更新、配置文件修改等)
- revert 回滚之前的提交
代码规范
- 使用v-for时必须添加:key
- 组件props必须定义类型和默认值
- 复杂逻辑必须添加注释
- 敏感信息不硬编码
- 变量/函数:小驼峰式命名 (camelCase)
- 组件/类:小驼峰式命名 (pascalCase)
- 合理使用缓存
- 避免不必要的重渲染
- 工具函数放在/utils目录
- 公共组件放在/components目录
常见 class 命名规范
- container 用于页面最外层容器
- header 头部区域
- main 主要内容区域
- footer 底部区域
- left 左侧区域
- right 右侧区域
- title 标题
- nav 导航区域
- banner 轮播图/广告 区域
- tabs 标签区域
- list 列表区域
循环调用避坑指南:
- 页面: page/shopcity/index.vue 城市选择列表页
- 背景: 城市名称列表依赖于父级城市英文首字母简写例A、B、C 循环项下的list 进行循环展示
- 场景: 城市列表点击,需要获取点击的城市信息
- 问题: 触发点击事件函数无法接收入参item
- 解决方案: 改为箭头函数 @click="() => { headerSelectMapClick(item) }"
- 原因: 查询DeepSeek给出的解释是 箭头函数创建了一个闭包,保留了 item 的引用 即使列表重新渲染,也能保持对正确 item 的引用
- 该解释是否正确 不确定 有待考量
- 示例代码
<!--
<scroll-view class="list-scroll" scroll-y :scroll-into-view="activeId" @scroll="handleScroll">
<view v-for="(group, index) in groupedData" :key="index" class="white_container" :id="'group-' + group.letter">
<view class="letter-title">{{ group.letter }}</view>
<view v-for="(item, ind) in group.list"
:key="item.id"
:class="['list-item', ind === group.list.length - 1 && 'no_border']"
@click="headerSelectMapClick(item)" // TODO问题点 为什么无法获取点击的item参数
>
{{ item.name }}
</view>
</view>
</scroll-view>
-->

View File

@ -1,38 +1,47 @@
export const apiArr = {
list: '/api/v1/wechat/community/list', // 获取社区列表
info: '/api/v1/wechat/community/info', // 获取单个社区信息
list: '/api/v1/wechat/community/list', // 获取社区列表
info: '/api/v1/wechat/community/info', // 获取单个社区信息
isJoin: '/api/v1/wechat/community/is-join', // 用户是否加入社区、楼宇、房间
tipsList: '/api/v1/wechat/community/tips/list', // 获取全部通知列表
oneTips: '/api/v1/wechat/community/tips/one', // 获取单个社区通知
apply: '/api/v1/wechat/community/apply', // 申请加入小区
getFacilityList:'/api/v1/wechat/community/facility/list', //获取楼号,
getRoomList:'/api/v1/wechat/community/room/list', //获取房间号
ownerList: '/api/v1/wechat/community/owner/list', // 获取社区业主列表
submit:"/api/v1/wechat/community/owner/feedback-create", //报修提交
getListByRepair:"/api/v1/wechat/community/owner/feedback-list",//报事报修列表
getInfoById:"/api/v1/wechat/community/owner/feedback-info", //报事报修根据id查询详情
getUserCommunity:"/api/v1/wechat/community/owner/mylist",//获取用户社区信息
tipsList: '/api/v1/wechat/community/tips/list', // 获取全部通知列表
oneTips: '/api/v1/wechat/community/tips/one', // 获取单个社区通知
apply: '/api/v1/wechat/community/apply', // 申请加入小区
getFacilityList: '/api/v1/wechat/community/facility/list', //获取楼号,
getRoomList: '/api/v1/wechat/community/room/list', //获取房间号
ownerList: '/api/v1/wechat/community/owner/list', // 获取社区业主列表
submit: "/api/v1/wechat/community/owner/feedback-create", //报修提交
getListByRepair: "/api/v1/wechat/community/owner/feedback-list",//报事报修列表
getInfoById: "/api/v1/wechat/community/owner/feedback-info", //报事报修根据id查询详情
getUserCommunity: "/api/v1/wechat/community/owner/mylist",//获取用户社区信息
get_host_info: 'https://zhsq.hshuishang.com/Miniapi/Index/get_host_info',
get_community_area_list:"https://zhsq.hshuishang.com/Miniapi/Community/get_community_area_list",
get_community_area_list: "https://zhsq.hshuishang.com/Miniapi/Community/get_community_area_list",
carList: '/api/v1/wechat/community/car/list', // 获取社区列表
addCar: '/api/v1/wechat/community/car/add', // 添加车辆
getCarList: '/api/v1/wechat/community/car/list', //获取车辆列表
deleteItem: "/api/v1/wechat/community/car/del",//删除车牌
getBanner:"/api/v1/wechat/home-page/banner-list",//获取banner图
getButton:"/api/v1/wechat/home-page/button-list",//获取button
getHotWords:"/api/v1/wechat/home-page/search-hot-word/info",//搜索热词
getAllList:"/api/v2/wechat/community/get-all-list",//获取小区信息列表
commRoomSelect:"/api/v2/wechat/community-room/comm-room-select",//房源筛选器
commInfo:"/api/v2/wechat/mpuser-crud/community-owner/info",//我的房产信息小区列表
create:"/api/v2/wechat/community-owners/create",//创建新的业主信息
getBanner: "/api/v1/wechat/home-page/banner-list",//获取banner图
getButton: "/api/v1/wechat/home-page/button-list",//获取button
getHotWords: "/api/v1/wechat/home-page/search-hot-word/info",//搜索热词
getAllList: "/api/v2/wechat/community/get-all-list",//获取小区信息列表
commRoomSelect: "/api/v2/wechat/community-room/comm-room-select",//房源筛选器
commInfo: "/api/v2/wechat/mpuser-crud/community-owner/info",//我的房产信息小区列表
create: "/api/v2/wechat/community-owners/create",//创建新的业主信息
getOrderList:"/api/v2/wechat/community-orders/get-all-list",//获取账单
getCommunityRoomList:"/api/v2/wechat/community-room/list", //获取房源列表
getUserGovenmentMoney:"/api/v2/wechat/government-housing-fund-flow-crud/user", //获取用户公积金
createPayOrder:"/api/v2/wechat/community-order-pay/create", //创建缴费
getPayOrderInfo:"/api/v2/wechat/community-order-pay/get-one", //根据缴费信息获取支付信息
getPayOrderList:"/api/v2/wechat/community-order-pay/get-page", //查询缴费记录
OrderPay:"/api/v2/wechat/community-order-pay/preorder",//预下单
};

View File

@ -2,5 +2,6 @@ export const apiArr = {
login: '/api/v1/wechat/multi-login', // 小程序登录
loginInfo: '/api/v1/wechat/mpusers/login-info', // 获取用户信息
loginGetPhone: '/api/v1/wechat/mpusers/get-phone', // 获取用户手机号
loginGetUserPhone:"/api/v2/wechat/mpusers/get-phone"
loginGetUserPhone: "/api/v2/wechat/mpusers/get-phone",
getCommunityList: '/api/v2/wechat/mpuser-crud/community-owner/info', // 我的房产信息小区列表
}

View File

@ -14,8 +14,12 @@ export const apiArr = {
navPage: '/api/v2/wechat/community-navigation-crud/page', // 小区图标导航信息分页
advPage: '/api/v2/wechat/community-advertisement-crud/page', // 小区广告信息分页
commInfo: '//api/v2/wechat/nav-display-crud/comm/info', // 小区导航设置信息详情
commInfo: '/api/v2/wechat/nav-display-crud/comm/info', // 小区导航设置信息详情
categoryPage: '/api/v2/wechat/announcement-category-crud/page', // 公告分类信息分页
infoPage: '/api/v2/wechat/announcement-crud/page', // 公告信息分页
getAnnounceInfo:"/api/v2/wechat/announcement-crud/info" ,//公告详情
getGovernmentByRoom:"/api/v2/wechat/government-housing-fund-flow-crud/room", //根据房源获取公积金信息
};

View File

@ -145,8 +145,8 @@ export default {
//
onOk() {
const { confirmProv, confirmCity, confirmDist } = this;
this.$emit('selectArea', { confirmProv, confirmCity, confirmDist });
const { confirmProv1, confirmProv, xsq, confirmCity, confirmDist } = this;
this.$emit('selectArea', { confirmProv: confirmProv1, confirmCity: xsq.ad_name ? xsq : confirmCity, confirmDist });
},

View File

@ -0,0 +1,385 @@
page {
background-color: #F6F6FA;
}
.container {
display: flex;
flex-direction: column;
min-height: calc(100vh - 120rpx);
width: 100%;
}
.searchBox {
display: flex;
align-items: center;
padding: 0 20rpx;
/* margin-top: 35rpx; */
justify-content: space-between;
background-color: #fff;
}
.searchBox_add {
display: flex;
align-items: center;
font-weight: 400;
font-size: 30rpx;
color: #000000;
}
.searchBox_add image {
width: 30rpx;
height: 30rpx;
margin-right: 16rpx;
}
.myRealEstate {
font-weight: 700;
padding-top: 36rpx;
font-weight: normal;
font-size: 36rpx;
color: #222222;
text-align: center;
background-color: #fff;
padding-bottom: 27rpx;
}
.myRealEstate .btn {
width: 600rpx;
height: 90rpx;
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: normal;
font-size: 36rpx;
color: #FFFFFF;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 30rpx;
}
.nearby {
padding: 0 20rpx;
margin-top: 20rpx;
background-color: #fff;
padding-top: 20rpx;
box-sizing: border-box;
flex: 1;
}
.nearbyTit {
display: flex;
justify-content: space-between;
}
.nearbyTit_left {
font-size: 36rpx;
color: #222222;
font-weight: 700;
}
.nearbyTit_right {
font-size: 26rpx;
color: #999999;
display: flex;
align-items: center;
}
.nearbyTit_right image {
width: 30rpx;
height: 30rpx;
}
.empty {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: normal;
font-size: 28rpx;
color: #999999;
margin-top: 110rpx;
width: 100%;
}
.empty image {
width: 366rpx;
height: 226rpx;
margin-bottom: 27rpx;
}
.communityItem {
border-bottom: 1rpx solid #EBEBEB;
margin-top: 32rpx;
}
.communityItem_msg {
font-size: 26rpx;
color: #999999;
margin-top: 20rpx;
padding-bottom: 30rpx;
}
.communityItem_Box {
display: flex;
}
.communityItem_Box_left {
width: 180rpx;
overflow: hidden;
height: 180rpx;
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-right: 20rpx;
}
.communityItem_Box_left image {
width: 100%;
height: 100%;
}
.communityItem_Box_right {
flex: 1;
}
.communityItem_Box_right_tit {
font-size: 32rpx;
color: #222222;
margin-bottom: 8rpx;
}
.communityItem_Box_right_com {
font-size: 26rpx;
color: #555555;
margin-top: 8rpx;
height: 72rpx;
line-height: 36rpx;
-webkit-line-clamp: 2;
/* 限制显示 2 行 */
-webkit-box-orient: vertical;
/* 垂直排列 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
display: -webkit-box;
}
.communityItem_Box_right_msg {
margin-top: 14rpx;
}
.communityItem_Box_right_msg_right {
width: 140rpx;
height: 40rpx;
background: #FF370B;
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-size: 26rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
.communityItem_Box_right_msg {
display: flex;
align-items: center;
justify-content: space-between;
}
.communityItem_Box_right_msg_left {
display: flex;
align-items: center;
}
.communityItem_Box_right_msg_left1 {
width: 110rpx;
height: 40rpx;
background: rgba(255, 81, 42, 0.1);
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #555555;
margin-right: 20rpx;
}
.communityItem_Box_right_msg_left1 image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.communityItem_Box_right_msg_left2 {
width: 110rpx;
height: 40rpx;
background: #FFF2DA;
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #555555;
}
.communityItem_Box_right_msg_left2 image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.myRealEstateEmpty {
display: flex;
}
.myRealEstates {
width: 710rpx;
height: 200rpx;
margin: 0 auto;
position: relative;
}
.myRealEstates image {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
z-index: 1;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.name {
font-size: 50rpx;
color: #FFFFFF;
text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.6);
text-align: center;
position: relative;
z-index: 2;
padding-top: 24rpx;
}
.Visitor {
font-weight: normal;
font-size: 24rpx;
color: #FFFFFF;
width: 380rpx;
display: flex;
align-items: center;
justify-content: center;
height: 52rpx;
margin: 0 auto;
margin-top: 30rpx;
position: relative;
z-index: 2;
background: rgba(0, 0, 0, 0.3);
border-radius: 10rpx 10rpx 10rpx 10rpx;
}
.tabList {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx;
box-sizing: border-box;
width: 100%;
font-weight: normal;
font-size: 30rpx;
color: #222222;
background-color: #f6f6fa;
}
.active {
position: relative;
color: #222222;
font-weight: 700;
}
.active::after {
content: '';
width: 52rpx;
height: 22rpx;
background: url(https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_active.png);
background-size: cover;
position: absolute;
left: 50%;
bottom: -20rpx;
transform: translateX(-50%);
}
.ConList{
background-color: #fff;
}
.ConItem {
display: flex;
padding: 30rpx 0;
margin: 0 20rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #EBEBEB;;
}
.ConItem_left {
width: 180rpx;
height: 160rpx;
margin-right: 20rpx;
}
.ConItem_right {
flex: 1;
}
.ConItem_right_tit {
font-size: 32rpx;
color: #222222;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ConItem_right_time {
font-size: 26rpx;
color: #999999;
margin-top: 10rpx;
}
.ConItem_right_msg {
display: flex;
align-items: center;
margin-top: 30rpx;
}
.ConItem_right_msg2 {
font-weight: normal;
font-size: 24rpx;
color: #FFFFFF;
width: 80rpx;
height: 36rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #FFFFFF;
border-radius: 5rpx 5rpx 5rpx 5rpx;
background: #FF370B;
margin-right: 13rpx;
}
.ConItem_right_msg1 {
width: 80rpx;
height: 36rpx;
background: #D9D9D9;
border-radius: 5rpx 5rpx 5rpx 5rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #222222;
}

View File

@ -0,0 +1,98 @@
<template>
<view class="container">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add">
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
</view>
</view>
<div class="myRealEstate">
<div class="myRealEstates">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communityNav.png" mode="aspectFill"></image>
<div class="name">滏阳锦苑</div>
<div class="Visitor">访客身份 点击立即入驻本社区</div>
</div>
</div>
<div class="tabList">
<div @click="changeTab(0)" :class="active == 0 ? 'active' : ''">全部公告</div>
<div @click="changeTab(1)" :class="active == 1 ? 'active' : ''">安全消防</div>
<div @click="changeTab(2)" :class="active == 2 ? 'active' : ''">小区通知</div>
<div @click="changeTab(3)" :class="active == 3 ? 'active' : ''">社区活动</div>
<div @click="changeTab(4)" :class="active == 4 ? 'active' : ''">党建</div>
</div>
<div class="ConList">
<div class="ConItem" v-for="item in 3" @click="desc">
<div class="ConItem_left">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_act2Img.png" mode="aspectFill"></image>
</div>
<div class="ConItem_right">
<div class="ConItem_right_tit">关于小区停车场治理通告</div>
<div class="ConItem_right_time">2025年5月27日 11:14:29</div>
<div class="ConItem_right_msg">
<div class="ConItem_right_msg2">
最新
</div>
<div class="ConItem_right_msg1">
置顶
</div>
</div>
</div>
</div>
</div>
</view>
</template>
<script>
import {
request,
picUrl,
uniqueByField,
menuButtonInfo,
NavgateTo
} from '../../../utils';
import {
apiArr
} from '../../../api/community';
export default {
data() {
return {
top: "",
localHeight: "",
active: 0
}
},
onLoad(options) {
const meun = menuButtonInfo();
this.top = meun.top;
// this.top = meun.height + meun.top;
this.localHeight = meun.height;
},
methods: {
changeTab(index) {
this.active = index;
},
back() {
uni.navigateBack({
delta: 1
});
},
desc(){
NavgateTo('../noticeDesc/index');
},
},
}
</script>
<style>
@import url("./index.css");
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="currentAdd">
<div class="currentAdd_left">河北省衡水市桃城区</div>
<div class="currentAdd_left">{{city.region}}</div>
<div class="currentAdd_right" @click="changeAddress">
切换城市
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_choseAddress.png"></image>
@ -14,14 +14,15 @@
<image @click="searchByName" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"></image>
</div>
<!-- @click="chooseCommunity(item)" -->
<div class="communityList">
<div class="communityItem" v-for="item in communityList">
<div class="communityItem" v-for="item in communityList" :key="item.community_id" @click="nextStep(item)">
<div class="communityItem_left">
<div class="communityItem_tit">{{item.name}}</div>
<div class="communityItem_address">{{item.addr}}</div>
</div>
<div class="communityItem_right">
<image @click="nextStep(item)" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communityMore.png"></image>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communityMore.png"></image>
</div>
</div>
</div>
@ -156,7 +157,9 @@
dialogBoxShow: false,
searchQuery: '',
filteredFloorsList: [],
searchList: []
searchList: [],
city: uni.getStorageSync('location'),
currentCommunity:""
}
},
methods: {
@ -166,8 +169,13 @@
close() {
this.show = false
},
selectArea(e1) {
console.log(e1);
selectArea(val) {
console.log(val);
this.city = {
region: val.confirmDist.ad_name.split(',').join(''),
...val.confirmDist
}
this.searchByName();
this.show = false
},
async searchByName() {
@ -176,7 +184,7 @@
community_id: '',
name: this.communityName,
comm_code: '',
ad_code: uni.getStorageSync('ad_code'),
ad_code: this.city.ad_code ? this.city.ad_code : uni.getStorageSync('ad_code'),
page_num: this.page_num,
page_size: this.page_size
}).then(res => {
@ -185,7 +193,6 @@
})
},
async nextStep(item) {
console.log(item)
this.communityId = item.community_id ? item.community_id : this.communityId;
this.facilityName = this.facilityName ? this.facilityName : item.label;
this.fName = this.step == 4 ? this.fName : (this.facilityName ? item.label : '')
@ -243,7 +250,23 @@
//
NavgateTo(fullPath);
}
},
//
chooseCommunity(e){
this.currentCommunity = e
this.getRoomSelect()
},
//
getRoomSelect(){
request(apiArr.commRoomSelect,"POST",{
community_ids:this.currentCommunity.community_id,
}).then(res=>{
console.log(res);
this.step = 2
})
},
},
onLoad(options) {

View File

@ -144,6 +144,9 @@ image {
margin: 0 auto;
margin-top: 40rpx;
}
.ads_first{
margin-top: 0;
}
.tabs {
margin-top: 32rpx;
@ -296,4 +299,10 @@ image {
justify-content: center;
font-size: 36rpx;
color: #FFFFFF;
}
.grid_Pic {
width: 100rpx;
height: 100rpx;
margin-bottom: 16rpx;
}

View File

@ -2,7 +2,7 @@
<div class="container">
<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>
@ -39,14 +39,24 @@
</swiper>
</div>
<div class="funcList">
<!-- <div class="funcList">
<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> -->
<div v-for="(item, index) in tileList" :key="index" class="ads" @click="headerServerClick(item)">
<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">
<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)">
<image :src="item.ad_picture" mode="aspectFill" />
</div>
@ -58,10 +68,10 @@
</div>
<div class="newsList">
<div class="newsItem" v-for="item in infoList">
<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>
<div class="newsItem_left_tit">{{ item.title }}</div>
<div class="newsItem_left_sub">{{ item.author }}</div>
</div>
<div class="newsItem_right">
<image :src="item.list_image" mode="aspectFill" />
@ -109,348 +119,361 @@
</template>
<script>
import {
request,
picUrl,
uniqueByField,
menuButtonInfo,
NavgateTo
} from '../../../utils';
import {
request,
picUrl,
uniqueByField,
menuButtonInfo,
NavgateTo
} from '../../../utils';
import {
apiArr
} from '../../../api/v2Community';
import {
apiArr
} from '../../../api/v2Community';
export default {
data() {
return {
communityVal: '添加我的房产',
picUrl,
top: "",
localHeight: "",
queryPage: {
page_num: 1,
page_size: 10,
},
communityList: [],
flag: false,
export default {
data() {
return {
communityVal: '添加我的房产',
picUrl,
top: "",
localHeight: "",
queryPage: {
page_num: 1,
page_size: 10,
},
communityList: [],
flag: false,
functionList: [],
functionList: [],
ads1Show: false,
ads2Show: false,
ads1Show: false,
ads2Show: false,
bannerList: [], //广
currentIdx: 0,
streamerList: [], //广
tileList: [], //广
largePopList: [], //广
popList: [], //广
bannerList: [], //广
currentIdx: 0,
streamerList: [], //广
tileList: [], //广
largePopList: [], //广
popList: [], //广
categoryList: [],
infoList: [],
selectedTab: 0,
currentAdIndex: 0,
categoryList: [],
infoList: [],
selectedTab: 0,
rowNum: 0,
colNum: 0,
currentAdIndex: 0,
page_size:10,
page_num:1,
flag:false
}
},
async onLoad(options) {
const meun = menuButtonInfo();
this.top = meun.top;
// this.top = meun.height + meun.top;
this.localHeight = meun.height;
// this.getCommunityList()
if (!uni.getStorageSync('changeCommData').id) {
uni.setStorageSync("changeCommData", { name: "森呼吸二期", id: 14 })
}
rowNum: 0,
colNum: 0,
}
},
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('changeCommData').name
await this.getfunctionNum()
this.getAdvertising()
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()
uni.stopPullDownRefresh();
},
//
onReachBottom() {
if(this.flag){
this.page_num++
this.getCategoryList()
}
},
methods: {
// desc() {
// NavgateTo("../communityDetail/index")
// },
apply() {
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: {
desc() {
NavgateTo("../communityDetail/index")
},
apply() {
NavgateTo("../applyOwer/index")
},
closeAds() {
this.ads1Show = false
},
closeAds2() {
this.ads2Show = false
},
jump(e) {
console.log(e);
NavgateTo(e)
},
swipers(event) {
//
this.currentIdx = event.detail.current;
},
addCommunity() {
NavgateTo("/packages/community/myCommunity/index")
},
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()
},
// getCommunityList() {
// let that = this
// request(apiArr.getCommunityList, 'POST', {
// page_num: that.queryPage.page_num,
// page_size: that.queryPage.page_size,
// user_id:""
// }).then(res => {
// console.log(res)
// if (res.rows.length == that.queryPage.page_size) {
// that.queryPage.page_num++
// that.flag = true
// that.communityList = that.communityList.concat(res.rows)
// }else{
// that.flag = false
// that.communityList = that.communityList.concat(res.rows)
// }
// })
// },
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
});
console.log(res, 'xx');
async getfunctionNum() {
const res = await request(apiArr.commInfo, "POST", {}, {
slice: false
// rowNum colNum
const totalItems = this.rowNum * this.colNum;
// 使 slice totalItems
this.functionList = res.rows.slice(0, totalItems).map(item => {
return {
...item,
nav_icon: picUrl + item.nav_icon
};
});
console.log('functionList', this.functionList);
},
async getAdvertising() {
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
};
});
this.ads1Show = res4.rows.length !== 0 ? true : false;
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
};
});
this.ads2Show = res5.rows.length !== 0 ? true : false;
},
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)
});
this.rowNum = res.nav_row_num_comm
this.colNum = res.nav_row_total_comm
return await this.getfunctionList()
},
// #endif
// 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 getfunctionList() {
const res = await request(apiArr.navPage, "POST", {
community_id: Number(uni.getStorageSync('changeCommData').id),
page_num: 1,
page_size: 50
});
// rowNum colNum
const totalItems = this.rowNum * this.colNum;
// 使 slice totalItems
this.functionList = res.rows.slice(0, totalItems).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
};
});
this.ads1Show = res4.rows.length !== 0 ? true : false;
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
};
});
this.ads2Show = res5.rows.length !== 0 ? true : false;
},
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
}
},
onSwiperChange(e) {
this.currentAdIndex = e.detail.current;
},
onDetailClick() {
console.log('1111');
// 广
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) {
// #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)
}
}
})
},
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,
};
});
})
} 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() {
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: 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>
<style>
@import url("./index.css");
@import url("./index.css");
</style>

View File

@ -1,25 +1,30 @@
<template>
<view class="container">
<view class="empty" v-if="false">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_newEmpty.png" alt="" />
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_newEmpty.png"
alt="" />
没有添加任何房产
</view>
<div class="communityList">
<div class="communityItem" v-for="item in communityList">
<div class="communityItem" v-for="item in communityList" :key="item.community_id"
@click="choseCommunity(item)">
<div class="communityItem_left">
<div class="communityItem_left_img">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/test.png"></image>
<image :src="item.pic" mode="aspectFill"></image>
</div>
<div class="communityItem_left_msg" @click="toUpview(item)">
<div class="communityItem_left_msg_tit">{{item.name}}<span> {{item.room_owner_list.length}}
<div class="communityItem_left_msg">
<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>
<div class="communityItem_left_msg_msg">{{ item.addr }}</div>
</div>
</div>
<div class="communityItem_right">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"></image>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"
v-if="item.community_id != currentCommunity.id"></image>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
v-if="item.community_id == currentCommunity.id"></image>
</div>
</div>
</div>
@ -29,52 +34,66 @@
</template>
<script>
import {
request,
NavgateTo,
isPhone
} from '../../../utils';
import {
apiArr
} from '../../../api/community';
export default {
data() {
return {
communityList: [],
page_num: 1,
page_size: 10,
}
import {
request,
NavgateTo,
isPhone,
picUrl
} from '../../../utils';
import {
apiArr
} from '../../../api/community';
export default {
data() {
return {
communityList: [],
page_num: 1,
page_size: 10,
currentCommunity: {}
}
},
methods: {
addCommunity() {
NavgateTo("/packages/community/addCommunity/index")
},
methods: {
addCommunity() {
NavgateTo("/packages/community/addCommunity/index")
},
async getList() {
await request(apiArr.commInfo, "POST", {
user_id: uni.getStorageSync('userId'),
longitude: uni.getStorageSync('location').lng,
latitude: uni.getStorageSync('location').lat,
page_num: this.page_num,
page_size: this.page_size
}).then(res => {
this.communityList = res.rows
console.log(res)
})
},
toUpview(item) {
uni.setStorageSync('changeCommData', { id: item.community_id, name: item.name });
NavgateTo("/packages/community/index/index")
}
async getList() {
await request(apiArr.commInfo, "POST", {
user_id: uni.getStorageSync('userId'),
longitude: uni.getStorageSync('location').lng,
latitude: uni.getStorageSync('location').lat,
page_num: this.page_num,
page_size: this.page_size
}).then(res => {
res.rows.forEach(item => {
item.pic = item.pic.startsWith('http') ? item.pic : picUrl + item.pic
});
this.communityList = res.rows
})
},
// toUpview(item) {
// uni.setStorageSync('changeCommData', { id: item.community_id, name: item.name });
// NavgateTo("/packages/community/index/index")
// },
onLoad(options) {
this.getList();
choseCommunity(e) {
this.currentCommunity = e
uni.setStorageSync('changeCommData', { id: e.community_id, name: e.name });
uni.setStorageSync('currentCommunityAddr',e.addr);
NavgateTo("/packages/community/index/index")
},
},
onReachBottom() {},
}
onLoad(options) {
this.currentCommunity = uni.getStorageSync('changeCommData')
console.log(this.currentCommunity, 'currentCommunity');
this.getList();
},
onReachBottom() { },
}
</script>
<style>
@import url("./index.css");
@import url("./index.css");
</style>

View File

@ -6,18 +6,11 @@
</view>
</view>
<div class="myRealEstate">
<div class="myRealEstates">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communityNav.png" mode="aspectFill"></image>
<div class="name">滏阳锦苑</div>
<div class="Visitor">访客身份 点击立即入驻本社区</div>
</div>
</div>
<div class="Tit">再生资源回收让我们一起行动起来</div>
<div class="subTit">衡水繁花似锦物业管理有限公司 2025年6月6日10:37:27</div>
<div class="Tit">{{Info.title}}</div>
<div class="subTit">{{Info.author}} {{Info.publish_time}}</div>
<div class="Con">
再生资源回收是一项对我们社会和小区都有益的活动通过回收再利用废纸废金属废塑料废玻璃和废电子产品等再生资源我们不仅可以保护环境还能为我们的小区带来诸多好处
<rich-text :nodes="Info.content"></rich-text>
</div>
</view>
@ -25,15 +18,16 @@
</template>
<script>
import {
request,
picUrl,
uniqueByField,
menuButtonInfo
} from '../../../utils';
import {
request,
picUrl,
uniqueByField,
menuButtonInfo,
NavgateTo
} from '../../../utils';
import {
apiArr
} from '../../../api/community';
} from '../../../api/v2Community';
export default {
@ -41,7 +35,8 @@ export default {
return {
top: "",
localHeight: "",
active: 0
id:"",
Info:""
}
},
onLoad(options) {
@ -49,12 +44,20 @@ export default {
this.top = meun.top;
// this.top = meun.height + meun.top;
this.localHeight = meun.height;
this.id = options.id
this.getInfo()
},
methods: {
changeTab(index) {
this.active = index;
//
getInfo(){
request(apiArr.getAnnounceInfo,"POST",{
id:Number(this.id)
}).then(res=>{
console.log(res);
this.Info = res
})
},
back() {
uni.navigateBack({

View File

@ -293,7 +293,9 @@ image {
color: #FF370B;
font-weight: 700;
}
.sucess{
color: #222222;
}
.boxshadow {
background: rgba(0, 0, 0, 0.16);

View File

@ -8,12 +8,13 @@
<div class="community">
<div class="community_left">
<image mode="aspectFill" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/test.png" alt="" />
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/test.png" alt="" />
</div>
<div class="community_right" @click="changeShow">
<div class="community_right_text">
<div class="community_right_text1">世纪名城1号楼1单元101室</div>
<div class="community_right_text2">衡水市上海公馆6A</div>
<div class="community_right_text1">{{ currentRoom.name }}</div>
<div class="community_right_text2">{{ currentCommunityAddr }}</div>
</div>
<div class="community_right_more">
<u-icon bold color="#999999" size="30" name="arrow-right" @click="back"></u-icon>
@ -34,11 +35,11 @@
<div class="homeMoney_box_left2">可抵扣账户金额</div>
</div>
<div class="homeMoney_box_right">
<div class="homeMoney_box_right1"><span></span>9735.00</div>
<div class="homeMoney_box_right2">
<div class="homeMoney_box_right1"><span></span>{{ balanceMoney }}</div>
<div class="homeMoney_box_right2" @click="more">
查看详情
<div style="margin-left: 12rpx;">
<u-icon bold color="#894B11" size="30" name="arrow-right" @click="back"></u-icon>
<u-icon bold color="#894B11" size="30" name="arrow-right" ></u-icon>
</div>
</div>
</div>
@ -46,29 +47,32 @@
</div>
<div class="payList" v-if="active == 0">
<div class="payItem" v-for="item in 1">
<div class="payItem" v-for="(item, index) in Bill" :key="index">
<div class="payItem_tit">
<div class="payItem_left">
<checkbox value="1"></checkbox>
<div style="margin-left: 24rpx;">2025</div>
<checkbox :checked="item.check" @click="checkChange(item, index)"></checkbox>
<div style="margin-left: 24rpx;">{{ item.order_date }}</div>
</div>
<div class="payItem_right">
<span></span>
4900.00
{{ item.unpaid_amount }}
<p>未缴</p>
<div style="margin-left: 40rpx;">
<u-icon bold color="#894B11" size="30" name="arrow-down" @click="back"></u-icon>
<u-icon bold color="#894B11" size="30" name="arrow-up" @click="back" v-if="false"></u-icon>
<div style="margin-left: 40rpx;" @click="changeCheck(item, index)">
<u-icon bold color="#894B11" size="30" name="arrow-down" v-if="!item.more"></u-icon>
<u-icon bold color="#894B11" size="30" name="arrow-up" v-if="item.more"></u-icon>
</div>
</div>
</div>
<div class="payItem_List" v-for="item in 0">
<checkbox value="1"></checkbox>
<div class="Item_time">2025</div>
<div class="Item_type">车位管理费</div>
<div class="Item_money">4500.00</div>
<div class="Item_status">未付款</div>
<div class="payItem_List" v-for="(items, indes) in item.community_order_rows" v-if="item.more"
:key="items.order_id">
<checkbox :checked="items.check" @click="itemsCheckChange(items, indes, index)"></checkbox>
<div class="Item_time" v-if="items.billing_cycle == 1">{{ items.order_date }}</div>
<div class="Item_time" v-if="items.billing_cycle == 2">{{ items.order_datetime }}</div>
<div class="Item_type">{{ items.community_fee_type.type_name }}</div>
<div class="Item_money">{{ items.money }}</div>
<div class="Item_status" v-if="items.status == 0">未付款</div>
<div class="Item_status sucess" v-if="items.status == 1">已付款</div>
</div>
</div>
</div>
@ -78,7 +82,9 @@
<div class="PayTypeItem">
<div class="PayTypeItem_left">
<div class="PayTypeItem_img">
<image mode="aspectFill" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png" alt="" />
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
alt="" />
</div>
<div class="PayTypeItem_con">
<div class="PayTypeItem_con_tit">微信支付</div>
@ -87,14 +93,16 @@
</div>
<div class="PayTypeItem_right">
<radio></radio>
<radio :checked="payType == 1" @click="changePayType(1)"></radio>
</div>
</div>
<div class="line3"></div>
<div class="PayTypeItem">
<div class="PayTypeItem_left">
<div class="PayTypeItem_img">
<image mode="aspectFill" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png" alt="" />
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png"
alt="" />
</div>
<div class="PayTypeItem_con">
<div class="PayTypeItem_con_tit">物业公积金支付</div>
@ -103,7 +111,7 @@
</div>
<div class="PayTypeItem_right">
<radio></radio>
<radio :checked="payType == 2" @click="changePayType(2)"></radio>
</div>
</div>
</div>
@ -112,46 +120,46 @@
<div class="bottom_left">
<span>合计</span>
<p></p>
4900.00
{{ currentMoney }}
</div>
<div class="bottom_right">
<div class="bottom_right" @click="OrderPay">
立即支付
</div>
</div>
<div class="payHisList" v-if="active == 1">
<div class="payHisItem" v-for="item in 3">
<div class="payHisItem" v-for="item in payOrderList" :key="item.id">
<div class="row">
<div class="row_label">缴费金额</div>
<div class="row_con1">53.1</div>
<div class="row_con1">{{ item.money }}</div>
</div>
<div class="row">
<div class="row_label2">刚刚</div>
<div class="row_con2">2025-06-06 18:10支付</div>
<div class="row_label2"></div>
<div class="row_con2">{{ item.pay_time }}支付</div>
</div>
<div class="line4"></div>
<div class="row">
<div class="row_label">绑定房源</div>
<div class="row_con3">
<div class="row_con3_1">6个账单</div>
<div class="row_con3_1">{{ item.community_order.length }}个账单</div>
<div class="row_con3_2">明细可从收据查看</div>
</div>
</div>
<div class="row">
<div class="row_label">应缴费金额</div>
<div class="row_con4">4704.00</div>
<div class="row_con4">{{ item.money }}</div>
</div>
<div class="row">
<div class="row_label">物业费公积金抵扣金额</div>
<div class="row_con4">-4704.00</div>
<div class="row_con4">-{{ item.reduction_money }}</div>
</div>
<div class="row">
<div class="row_label">缴费单号</div>
<div class="row_con4">25061700200003 </div>
<div class="row_con4">{{ item.order_pay_no }} </div>
</div>
<div class="line4"></div>
<div class="Receipt">收据</div>
@ -168,8 +176,8 @@
</div>
<div class="lines"></div>
<div class="communityList">
<div class="communityItem" v-for="item in 8">
<div class="communityItem_text">2323世纪名城1号楼1单元101室</div>
<div class="communityItem" v-for="item in roomList" :key="item.room_id">
<div class="communityItem_text">{{ item.facility_name }}{{ item.floor }} {{ item.number }}</div>
<div class="communityItem_radio">
<radio></radio>
</div>
@ -188,11 +196,13 @@
<span></span>4900.00
</div>
<div class="lines"></div>
<div class="BanlenceList">
<div class="banlenceItem">
<div class="banlenceItem_left">
<image mode="aspectFill" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png" alt="" />
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
alt="" />
微信支付
</div>
<div class="banlenceItem_right">
@ -202,7 +212,9 @@
<div class="line3"></div>
<div class="banlenceItem">
<div class="banlenceItem_left">
<image mode="aspectFill" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png" alt="" />
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png"
alt="" />
物业公积金支付
</div>
<div class="banlenceItem_right">
@ -229,6 +241,7 @@ import {
picUrl,
uniqueByField,
menuButtonInfo,
formatDate,
NavgateTo
} from '../../../utils';
import {
@ -241,9 +254,24 @@ export default {
return {
top: "",
localHeight: "",
active: 1,
active: 0,
show: false,
show2: false,
roomList: [],
currentRoom: {},
currentCommunity: "", //
currentCommunityAddr: "", //
Bill: "", //
balanceMoney: "",//
currentMoney: 0, //
payType: '1',
payInfoId: "",//id
page_size: 10,
page_num: 1,
payOrderList: [],
flag: false,
}
},
onLoad(options) {
@ -251,12 +279,20 @@ export default {
this.top = meun.top;
// this.top = meun.height + meun.top;
this.localHeight = meun.height;
this.currentCommunity = uni.getStorageSync('changeCommData')
this.currentCommunityAddr = uni.getStorageSync("currentCommunityAddr")
this.getRoomSelect()
this.getUserGovenmentMoney()
},
methods: {
changeTab(index) {
this.active = index;
if (index == 1) {
this.page_num = 1
this.getPayList()
}
},
back() {
uni.navigateBack({
@ -269,6 +305,179 @@ export default {
changeShow2() {
this.show2 = !this.show
},
//
getRoomSelect() {
request(apiArr.getCommunityRoomList, 'POST', {
community_id: this.currentCommunity.id,
page_num: 1,
page_size: 50
}).then(res => {
this.roomList = res.rows
this.currentRoom = this.roomList[0]
this.getOrderList()
})
},
//
async getUserGovenmentMoney() {
request(apiArr.getUserGovenmentMoney, "POST", {}).then(res => {
console.log(res, '公积金');
this.balanceMoney = res.balance_after
})
},
//
async getOrderList() {
await request(apiArr.getOrderList, 'POST', {
room_id: this.currentRoom.room_id,
page_num: 1,
page_size: 50
}).then(res => {
console.log(res, '账单');
res.rows.forEach(item => {
item.check = false
item.more = false
item.community_order_rows.forEach(ite => {
ite.check = false
})
});
this.Bill = res.rows
})
},
//
changeCheck(e, index) {
this.Bill[index].more = !this.Bill[index].more
},
//
checkChange(e, index) {
this.Bill[index].check = !this.Bill[index].check
this.Bill[index].community_order_rows.forEach(item => {
if (this.Bill[index].check) {
item.check = true
} else {
item.check = false
}
})
//
let money = 0
this.Bill.forEach(item => {
item.community_order_rows.forEach(ite => {
if (ite.check) {
money += ite.money
}
})
})
this.currentMoney = money
},
//
itemsCheckChange(e, indes, index) {
this.Bill[index].community_order_rows[indes].check = !this.Bill[index].community_order_rows[indes].check
//
let isAll = this.Bill[index].community_order_rows.every(item => {
return item.check
})
if (isAll) {
this.Bill[index].check = true
} else {
this.Bill[index].check = false
}
//Billcommunity_order_rows
let money = 0
this.Bill.forEach(item => {
item.community_order_rows.forEach(ite => {
if (ite.check) {
money += ite.money
}
})
})
this.currentMoney = money
},
//
changePayType(e) {
this.payType = e
},
//
async createPay() {
let order_ids = []
this.Bill.forEach(item => {
item.community_order_rows.forEach(items => {
if (items.check) {
order_ids.push(items.order_id)
}
})
})
let name_mini = ''
if(this.payType == 1){
name_mini = '微信'
}else{
name_mini = '物业公积金'
}
if(!this.currentMoney){
return uni.showToast({
title: '请选择账单',
duration: 2000
});
}
await request(apiArr.createPayOrder, "POST", {
order_ids: order_ids,
community_id: this.currentCommunity.id,
room_id: this.currentRoom.room_id,
pay_user_id: uni.getStorageSync('userId'),
user_name: uni.getStorageSync('nickName'),
pay_user_name: uni.getStorageSync('nickName'),
//
pay_time: formatDate(new Date()),
money: this.currentMoney,
name_mini
}).then(res => {
console.log(res);
this.payInfoId = res.id
this.getPayInfo()
})
},
//
async getPayInfo() {
await request(apiArr.getPayOrderInfo, "POST", { order_pay_id: 6}).then(res => {
this.OrderPay()
})
},
//
async OrderPay(){
// this.payInfoId
await request(apiArr.OrderPay, "POST", { order_pay_id: 6}).then(res => {
console.log(res);
})
},
//
getPayList() {
request(apiArr.getPayOrderList, "POST",
{
room_id: this.currentRoom.room_id,
page_num: this.page_num,
page_size: this.page_size
}).then(res => {
console.log(res);
let flag = false
if (res.rows && res.rows.length == this.page_size) {
flag = true
} else {
flag = false
}
this.flag = flag
this.payOrderList = this.payOrderList.concat(res.rows)
})
},
//
more(){
NavgateTo("../providentFund/index")
},
},

View File

@ -13,14 +13,17 @@
</view>
</view>
<view class="main">
<view class="person_info" v-for="(item,index) in list" :key="index">
<view class="person_info" v-for="(item,index) in list.owners" :key="index">
<view class="item">
<view class="label">姓名</view>
<view class="desc">{{ item.name }}</view>
</view>
<view class="item">
<view class="label">身份</view>
<view class="desc">{{ item.identity }}</view>
<view class="desc" v-if="item.type == 1">业主</view>
<view class="desc" v-if="item.type == 2">家属</view>
<view class="desc" v-if="item.type == 3">租户</view>
<view class="desc" v-if="item.type == 4">访客</view>
</view>
<view class="item">
<view class="label">手机号</view>
@ -28,7 +31,7 @@
</view>
<view class="item">
<view class="label">房产总数</view>
<view class="desc">{{ item.houseNum }}</view>
<view class="desc">{{ item.count_of_rooms }}</view>
</view>
<view class="item">
<view class="label fix">
@ -39,7 +42,7 @@
<view class="angle"></view>
</view>
</view>
<view class="desc">{{item.fund}}</view>
<view class="desc">{{item.property_fund_balance}}</view>
</view>
</view>
</view>
@ -50,7 +53,7 @@
<view class="header">
<view></view>
<view class="title">选择房源</view>
<view class="close">取消</view>
<view class="close" @click="close">取消</view>
</view>
<view class="line"></view>
<view class="main">
@ -96,74 +99,23 @@ export default {
desc: '物业公积金可通用至您加入的所有房产,任一房产的物业相关费用均可用该物业公积金抵扣。',
defaultName: '',
list: [
{
name: '高尚',
identity: '业主',
mobile: '15931111111',
houseNum: '9',
fund: '50.00',
popupShow: false
},
{
name: '李明',
identity: '家属',
mobile: '15931111122',
houseNum: '6',
fund: '50.00',
popupShow: false
},
{
name: '王五',
identity: '租户',
mobile: '15931111316',
houseNum: '2',
fund: '50.00',
popupShow: false
}
],
houseList: [
{
name: '2323世纪名城1号楼1单元101室',
checked: false,
},
{
name: '2323世纪名城1号楼1单元102室',
checked: false,
},
{
name: '2323世纪名城1号楼1单元103室',
checked: false,
},
{
name: '2323世纪名城1号楼1单元104室',
checked: false,
},
{
name: '2323世纪名城1号楼1单元105室',
checked: false,
},
{
name: '2323世纪名城1号楼1单元201室',
checked: false,
},
{
name: '2323世纪名城1号楼1单元202室',
checked: false,
},
{
name: '2323世纪名城1号楼1单元203室',
checked: false,
},
]
],
roomList:[]
}
},
onLoad(options) {
async onLoad(options) {
this.defaultName = {
...this.houseList[0],
checked: true
};
const meun = menuButtonInfo();
this.top = meun.height + meun.top;
await this.getRoomList()
await this.getInfo()
},
@ -174,10 +126,12 @@ export default {
checked: true
};
this.show = false;
this.getInfo()
},
//
headerSwitchClick() {
this.show = true;
const newRes = this.houseList.map(item => {
const newRes = this.roomList.map(item => {
if (item.name === this.defaultName.name) {
return {
...item,
@ -192,14 +146,37 @@ export default {
console.log('newResnewRes', newRes);
this.houseList = newRes;
},
//
headerIconClick(ind) {
this.list[ind].popupShow = !this.list[ind].popupShow
this.list.owners[ind].popupShow = !this.list.owners[ind].popupShow
},
close() {
this.show = false;
},
async getRoomList(){
await request(apiArr.getCommunityList,"POST",{
page_num:1,
page_size:50,
community_id:uni.getStorageSync("changeCommData").id
}).then(res=>{
res.rows.forEach(item=>{
item.checked = false
})
this.roomList = res.rows
this.defaultName = res.rows[0]
})
},
async getInfo(){
await request(apiArr.getGovernmentByRoom,"POST",{
room_id:this.defaultName.room_id
}).then(res=>{
res.owners.forEach(item => {
item.popupShow = false
});
this.list = res
})
},
},
}
</script>

View File

@ -167,4 +167,23 @@ page {
justify-content: center;
margin: 0 auto;
margin-top: 200rpx;
}
}
.empty {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: normal;
font-size: 28rpx;
color: #999999;
margin-top: 110rpx;
width: 100%;
}
.empty image {
width: 366rpx;
height: 226rpx;
margin-bottom: 27rpx;
}

View File

@ -1,18 +1,9 @@
<template>
<view class="box">
<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="searchBox_left">
<u-icon
bold
color="#000"
size="40"
name="arrow-left"
@click="back"
></u-icon>
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
</div>
<div class="searchBox_mid">我的报修</div>
<div class="searchBox_right"></div>
@ -20,33 +11,21 @@
</div>
<div class="tabList">
<div
:class="active == 1 ? 'tab active' : 'tab'"
@click="headerTabsClick(1)"
>
待指派 <span>({{awaitingNumb}})</span>
<div :class="active == 1 ? 'tab active' : 'tab'" @click="headerTabsClick(1)">
待指派 <span>({{ awaitingNumb }})</span>
</div>
<div
:class="active == 2 ? 'tab active' : 'tab'"
@click="headerTabsClick(2)"
>
<div :class="active == 2 ? 'tab active' : 'tab'" @click="headerTabsClick(2)">
进行中 <span>({{ underwayNum }})</span>
</div>
<div
:class="active == 4 ? 'tab active' : 'tab'"
@click="headerTabsClick(4)"
>
<div :class="active == 4 ? 'tab active' : 'tab'" @click="headerTabsClick(4)">
已作废 <span>({{ discardNum }})</span>
</div>
<div
:class="active == 3 ? 'tab active' : 'tab'"
@click="headerTabsClick(3)"
>
<div :class="active == 3 ? 'tab active' : 'tab'" @click="headerTabsClick(3)">
已完成 <span>({{ doneNum }})</span>
</div>
</div>
<div class="orderList" v-for="(item, index) in list" :key="index">
<div v-if="list.length !== 0" class="orderList" v-for="(item, index) in list" :key="index">
<div class="orderItem" @click="handlerDetailClick(item.id)">
<div :class="['orderItemTit', statusType[item.status].style]">
<div class="orderItemTit_left">工单编号{{ item.order_code }}</div>
@ -90,6 +69,12 @@
</div>
</div>
<div v-if="list.length == 0" class="empty">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_nearbyList_empty.png"
mode="aspectFill"></image>
暂无数据
</div>
<div class="addBtn" @click="oneRepair">在线报修</div>
</view>
</template>
@ -107,11 +92,11 @@ export default {
page_size: 10,
flag: false, //
list: [], //
awaitingNumb: '', //
underwayNum: '', //
doneNum: '', //
discardNum: '', //
//
awaitingNumb: '', //
underwayNum: '', //
doneNum: '', //
discardNum: '', //
//
statusType: {
1: {
desc: "待指派",
@ -151,18 +136,18 @@ export default {
this.page_num = 1;
this.getTabsList();
},
async init() {
const [awaitingNumb, underwayNum, doneNum, discardNum] = await Promise.all([
this.awaitingRes(),
this.underwayRes(),
this.doneRes(),
this.discardRes(),
]);
this.awaitingNumb = awaitingNumb;
this.underwayNum = underwayNum;
this.discardNum = discardNum;
this.doneNum = doneNum;
},
async init() {
const [awaitingNumb, underwayNum, doneNum, discardNum] = await Promise.all([
this.awaitingRes(),
this.underwayRes(),
this.doneRes(),
this.discardRes(),
]);
this.awaitingNumb = awaitingNumb;
this.underwayNum = underwayNum;
this.discardNum = discardNum;
this.doneNum = doneNum;
},
async getTabsList() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: this.active,
@ -182,42 +167,42 @@ export default {
this.page_num = this.page_num + 1;
}
},
//
async awaitingRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
//
async awaitingRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 1,
page_num: this.page_num,
page_size: this.page_size,
});
return res.total;
},
//
async underwayRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
return res.total;
},
//
async underwayRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 2,
page_num: this.page_num,
page_size: this.page_size,
});
return res.total;
},
//
async discardRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
return res.total;
},
//
async discardRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 3,
page_num: this.page_num,
page_size: this.page_size,
});
return res.total;
},
//
async doneRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
return res.total;
},
//
async doneRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 4,
page_num: this.page_num,
page_size: this.page_size,
});
return res.total;
},
return res.total;
},
back() {
uni.navigateBack({
@ -231,13 +216,21 @@ export default {
this.top = meun.top;
this.localHeight = meun.height;
this.init();
this.getTabsList();
this.getTabsList();
},
onReachBottom() {
if (this.flag) {
this.init();
}
},
onPullDownRefresh() {
this.list = [];
this.flag = false;
this.page_num = 1;
this.getTabsList();
uni.stopPullDownRefresh();
},
};
</script>

View File

@ -139,7 +139,8 @@
"navigationStyle": "custom",
"usingComponents": {
"nav-footer": "/components/nav/nav"
}
},
"enablePullDownRefresh": true
}
},
{
@ -183,7 +184,7 @@
{
"path": "noticeDesc/index",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "公告详情",
"navigationStyle": "custom"
}
},
@ -212,7 +213,8 @@
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#F9F9F9"
"navigationBarBackgroundColor": "#F9F9F9",
"enablePullDownRefresh":true
}
},
{

View File

@ -27,7 +27,7 @@
<!-- 宫格列表 -->
<view class="tabList">
<u-grid col="5" :border="false">
<u-grid :col="rowNum" :border="false">
<u-grid-item v-for="(item, index) in tabList" @click="headerServerClick(item)" :key="index">
<image class="grid_Pic" :src="item.icon_src" mode=""></image>
<text>{{ item.title }}</text>
@ -191,6 +191,7 @@ export default {
// xx
let preciseLocation = {
cityName: address_component.city, //
region: address_component.province + address_component.city + address_component.district, //
// xxxx xx
district: address_component.district + `${address_component.street_number ? address_component.street_number : address_component.street}`, //
address: address_component.city + address_component.district + address_component.street_number, //
@ -474,9 +475,9 @@ export default {
}
},
onReachBottom() {
async onReachBottom() {
if (this.flag) {
const res = this.getHomeBottom();
const res = await this.getHomeBottom();
this.bottomList = this.bottomList.concat(res);
} else {
uni.showToast({

View File

@ -5,8 +5,8 @@
<view class="login-tip" style="font-size: 40rpx; color: #000000;">欢迎来到榴园社区</view>
<view v-if="loginChannel === 'android' || loginChannel === 'ios'" class="app_login">
<input class="input" type="number" maxlength="11" data-name="userId" @input='headerInputClick' :value="userId"
placeholder="请输入手机号" />
<input class="input" type="number" maxlength="11" data-name="userId" @input='headerInputClick'
:value="userId" placeholder="请输入手机号" />
<input class="input" password data-name="passWord" @input='headerInputClick' :value="passWord"
placeholder="请输入密码" />
<view class="tips">未注册用户填写手机号后点击登录即可无需输入密码</view>
@ -14,15 +14,12 @@
</view>
<view v-if="loginChannel === 'mp-weixin'" class="">
<view class="login-tip" style="font-size: 28rpx; color: #555555; margin-top: 30rpx;">为了更好的体验申请获取您的公开信息</view>
<view class="login-tip" style="font-size: 28rpx; color: #555555; margin-top: 30rpx;">为了更好的体验申请获取您的公开信息
</view>
<view class="login-tip" style="font-size: 28rpx; color: #555555; margin-top: 14rpx;">头像昵称等</view>
<view class="login-button">
<button
class="login-btn"
open-type="getPhoneNumber"
@click="headerLoginClick"
@getphonenumber="getPhoneNumber"
>
<button class="login-btn" open-type="getPhoneNumber" @click="headerLoginClick"
@getphonenumber="getPhoneNumber">
授权登录
</button>
</view>
@ -37,203 +34,219 @@
</template>
<script>
import { apiArr } from '../../api/login';
import { apiArr as apiArr2 } from '../../api/v2User';
import { request } from '../../utils';
export default {
data() {
return {
isLogin: false,
loginChannel: '', //
userId: '',
passWord: '',
}
import { apiArr } from '../../api/login';
import { apiArr as apiArr2 } from '../../api/v2User';
import { request } from '../../utils';
export default {
data() {
return {
isLogin: false,
loginChannel: '', //
userId: '',
passWord: '',
}
},
methods: {
headerInputClick(e) {
const { name } = e.currentTarget.dataset;
const { value } = e.detail;
this[name] = value
},
methods: {
headerInputClick(e) {
const { name } = e.currentTarget.dataset;
const { value } = e.detail;
this[name] = value
},
headerLoginClick() {
let that = this
uni.showLoading({
title: '登录中...',
mask: true
});
if (this.loginChannel === 'android' || this.loginChannel === 'ios') {
this.appLogin();
return;
}
headerLoginClick() {
let that = this
uni.showLoading({
title: '登录中...',
mask: true
});
if (this.loginChannel === 'android' || this.loginChannel === 'ios') {
this.appLogin();
return;
uni.login({
onlyAuthorize: true,
success: (res) => {
request(apiArr.login, 'POST', {
code: res.code,
phone: '',
password: '',
}, { silent: false }).then((loginRes) => {
//
uni.setStorageSync('ctoken', loginRes.token);
uni.setStorageSync('is_deal', loginRes.is_deal);
uni.setStorageSync('is_dev', loginRes.is_dev);
uni.setStorageSync('is_shop', loginRes.is_shop);
//
request(apiArr.loginInfo, 'POST', {
token: loginRes.token
}, { silent: false }).then((res2) => {
if (res2.error) return;
// userId 使
uni.setStorageSync('userId', res2.user_id);
uni.setStorageSync('openId', res2.open_id);
uni.setStorageSync('shopId', res2.wshop_id);
this.isLogin = true;
that.getUserInfo();
that.getCommunityList();
})
}, (err) => {
uni.hideLoading();
console.log('登录接口错误', err);
})
}
})
},
uni.login({
onlyAuthorize: true,
success: (res) => {
request(apiArr.login, 'POST', {
code: res.code,
phone: '',
password: '',
}, { silent: false }).then((loginRes) => {
//
uni.setStorageSync('ctoken', loginRes.token);
uni.setStorageSync('is_deal', loginRes.is_deal);
uni.setStorageSync('is_dev', loginRes.is_dev);
uni.setStorageSync('is_shop', loginRes.is_shop);
//
request(apiArr.loginInfo, 'POST', {
token: loginRes.token
}, { silent: false } ).then((res2) => {
if (res2.error) return;
// userId 使
uni.setStorageSync('userId', res2.user_id);
uni.setStorageSync('openId', res2.open_id);
uni.setStorageSync('shopId', res2.wshop_id);
this.isLogin = true;
that.getUserInfo()
})
}, (err) => {
uni.hideLoading();
console.log('登录接口错误', err);
//
getPhoneNumber(event) {
console.log('小程序登录获取手机号', event);
const { isLogin } = this;
// uni.setStorageSync('phone', '18332119617');
// this.tohome();
// return
if (event.detail.errMsg === "getPhoneNumber:ok") {
request(apiArr.loginGetUserPhone, 'POST', {
code: event.detail.code
}, { silent: false }).then((res) => {
uni.hideLoading();
if (isLogin) {
uni.setStorageSync('phone', res.phone);
uni.showToast({
title: '登录成功',
icon: 'success',
mask: true,
duration: 2000,
success: () => {
setTimeout(() => {
this.tohome();
}, 2000)
}
});
} else {
uni.showToast({
title: '登录失败',
icon: 'error',
mask: true,
duration: 2000,
})
}
})
},
} else {
uni.hideLoading();
uni.removeStorageSync('ctoken');
uni.removeStorageSync('userId');
uni.removeStorageSync('openId');
uni.removeStorageSync('phone');
uni.removeStorageSync('is_deal');
uni.removeStorageSync('is_dev');
uni.removeStorageSync('is_shop');
uni.removeStorageSync('shopId');
uni.removeStorageSync('order_dispatch_permission');
uni.removeStorageSync('nickName');
uni.removeStorageSync('changeCommData');
console.error('用户拒绝授权:', event.detail.errMsg);
}
},
//
getPhoneNumber(event) {
console.log('小程序登录获取手机号', event);
const { isLogin } = this;
// uni.setStorageSync('phone', '18332119617');
// this.tohome();
// return
if (event.detail.errMsg === "getPhoneNumber:ok") {
request(apiArr.loginGetUserPhone, 'POST', {
code: event.detail.code
}, { silent: false }).then((res) => {
uni.hideLoading();
if (isLogin) {
uni.setStorageSync('phone', res.phone);
uni.showToast({
title: '登录成功',
icon: 'success',
mask: true,
duration: 2000,
success: () => {
setTimeout(() => {
this.tohome();
}, 2000)
}
});
} else {
uni.showToast({
title: '登录失败',
icon: 'error',
mask: true,
duration: 2000,
})
getUserInfo() {
request(apiArr2.getUserInfo, "POST", {
user_id: uni.getStorageSync('userId')
}, { silent: false }).then(res => {
const { community_worker } = res;
uni.setStorageSync('order_dispatch_permission', community_worker && community_worker[0].order_dispatch_permission == 1 || false);
uni.setStorageSync('nickName', res.nick_name);
console.log(res)
})
},
//
getCommunityList() {
request(apiArr.getCommunityList, 'POST', {
latitude: uni.getStorageSync('location').lat,
longitude: uni.getStorageSync('location').lng,
page_num: 1,
page_size: 10,
}, { silent: false }).then((res3) => {
const { rows: [{}] } = res3;
uni.setStorageSync("changeCommData",{ name: rows[0].name, id: rows[0].community_id })
})
},
// app
async appLogin() {
try {
const loginRes = await request(apiArr.login, 'POST', {
code: '',
phone: this.userId,
password: this.passWord
}, { silent: false });
uni.setStorageSync('ctoken', loginRes.token);
uni.setStorageSync('is_deal', loginRes.is_deal);
uni.setStorageSync('is_dev', loginRes.is_dev);
uni.setStorageSync('is_shop', loginRes.is_shop);
//
const loginInfoRes = await request(apiArr.loginInfo, 'POST', {
token: loginRes.token
}, { slient: false });
uni.setStorageSync('userId', loginInfoRes.user_id);
uni.setStorageSync('openId', loginInfoRes.open_id);
uni.setStorageSync('shopId', loginInfoRes.wshop_id);
uni.setStorageSync('phone', this.userId); // app
this.isLogin = true;
uni.hideLoading();
if (loginRes.msg) {
uni.showModal({
title: '提示',
content: loginRes.msg,
showCancel: false,
complete: (res) => {
if (res.confirm) {
this.tohome();
}
}
})
} else {
uni.hideLoading();
uni.removeStorageSync('ctoken');
uni.removeStorageSync('userId');
uni.removeStorageSync('openId');
uni.removeStorageSync('phone');
uni.removeStorageSync('is_deal');
uni.removeStorageSync('is_dev');
uni.removeStorageSync('is_shop');
uni.removeStorageSync('shopId');
uni.removeStorageSync('order_dispatch_permission');
console.error('用户拒绝授权:', event.detail.errMsg);
this.tohome();
}
},
getUserInfo(){
request(apiArr2.getUserInfo,"POST",{
user_id:uni.getStorageSync('userId')
}).then(res=>{
console.log('111111', res);
const { community_worker } = res;
uni.setStorageSync('order_dispatch_permission', community_worker && community_worker[0].order_dispatch_permission == 1 || false);
console.log(res)
})
},
// app
async appLogin() {
try {
const loginRes = await request(apiArr.login, 'POST', {
code: '',
phone: this.userId,
password: this.passWord
}, { silent: false });
uni.setStorageSync('ctoken', loginRes.token);
uni.setStorageSync('is_deal', loginRes.is_deal);
uni.setStorageSync('is_dev', loginRes.is_dev);
uni.setStorageSync('is_shop', loginRes.is_shop);
//
const loginInfoRes = await request(apiArr.loginInfo, 'POST', {
token: loginRes.token
}, { slient: false });
uni.setStorageSync('userId', loginInfoRes.user_id);
uni.setStorageSync('openId', loginInfoRes.open_id);
uni.setStorageSync('shopId', loginInfoRes.wshop_id);
uni.setStorageSync('phone', this.userId); // app
this.isLogin = true;
uni.hideLoading();
if (loginRes.msg) {
uni.showModal({
title: '提示',
content: loginRes.msg,
showCancel: false,
complete: (res) => {
if (res.confirm) {
this.tohome();
}
}
})
} else {
this.tohome();
}
} catch (error) {
uni.hideLoading();
//TODO handle the exception
console.log('app登录异常', error);
}
},
//
tohome: function() {
// console.log(123);
uni.redirectTo({
url: '/pages/index/index'
});
} catch (error) {
uni.hideLoading();
//TODO handle the exception
console.log('app登录异常', error);
}
},
onLoad() {
const systemInfo = uni.getSystemInfoSync();
console.log('platformplatform', systemInfo)
// this.loginChannel = systemInfo.osName;
// return;
if (systemInfo.uniPlatform === 'mp-weixin') {
this.loginChannel = systemInfo.uniPlatform;
} else {
this.loginChannel = systemInfo.osName;
}
//
tohome: function () {
// console.log(123);
uni.redirectTo({
url: '/pages/index/index'
});
}
},
onLoad() {
const systemInfo = uni.getSystemInfoSync();
console.log('platformplatform', systemInfo)
// this.loginChannel = systemInfo.osName;
// return;
if (systemInfo.uniPlatform === 'mp-weixin') {
this.loginChannel = systemInfo.uniPlatform;
} else {
this.loginChannel = systemInfo.osName;
}
}
}
</script>
<style>
@import url("./login.css");
@import url("./login.css");
</style>

View File

@ -67,11 +67,12 @@
<!-- 字母标题 -->
<view class="letter-title">{{ group.letter }}</view>
<!-- 列表项 -->
<!-- TODO: 小程序编译避坑指南 -->
<view
v-for="(item, ind) in group.list"
:key="item.id"
:class="['list-item', ind === group.list.length - 1 && 'no_border']"
@click="headerSelectMapClick(item)"
@click="() => { headerSelectMapClick(item) }"
>
{{ item.name }}
</view>
@ -164,9 +165,10 @@ export default {
},
methods: {
headerSelectMapClick(item) {
console.log('1111 this', this);
console.log("地图选点", item);
const lat = Number(item.lat);
const long = Number(item.long);
const lat = Number(item.lat) || 0;
const long = Number(item.long) || 0;
uni.chooseLocation({
latitude: lat,
longitude: long,
@ -222,6 +224,7 @@ export default {
}, 500),
groupData(item) {
console.log('123. item', item);
const map = {};
this.letters.forEach((letter) => {
map[letter] = {
@ -235,6 +238,7 @@ export default {
map[items.letters].list.push(items);
}
});
console.log('11111111', map)
//
this.groupedData = Object.values(map).filter(

View File

@ -45,7 +45,7 @@
</view>
<view class="center">
<view class="gold_container">
<view class="gold_container" @click="headerGoldClick">
<view class="gold_title">
<span class="gold">金币</span> <span class="monenyt">0</span> | <span class="price">价值0.00</span> <u-icon size="30" name="arrow-right" />
</view>
@ -294,12 +294,14 @@
//
handleCommunityClick(){
NavgateTo('/packages/community/index/index')
this.NotOpen();
// NavgateTo('/packages/community/index/index')
},
//
handleApplyOwnerClick(){
NavgateTo(`/packages/community/index/index?types=2`)
this.NotOpen();
// NavgateTo(`/packages/community/index/index?types=2`)
},
//
@ -309,7 +311,12 @@
//
handleMeApplyClick() {
NavgateTo(`/packages/community/ownerList/index`)
this.NotOpen();
// NavgateTo(`/packages/community/ownerList/index`)
},
headerGoldClick() {
this.NotOpen();
// NavgateTo(`/packages/community/ownerList/index`)
},
//

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2841,7 +2841,7 @@ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/inte
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validateEmail = exports.uploadVideo = exports.upload = exports.uniqueByField = exports.request = exports.picUrl = exports.menuButtonInfo = exports.isPhone = exports.getProviderPromise = exports.floatCalculate = exports.debounce = exports.calculateDistance = exports.NavgateTo = void 0;
exports.validateEmail = exports.uploadVideo = exports.upload = exports.uniqueByField = exports.request = exports.picUrl = exports.menuButtonInfo = exports.isPhone = exports.getProviderPromise = exports.formatDate = exports.floatCalculate = exports.debounce = exports.calculateDistance = exports.NavgateTo = void 0;
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@ -3253,7 +3253,22 @@ var debounce = function debounce(fn) {
}, delay);
};
};
/**
* 格式化日期
* @param {date} 时间戳
*/
exports.debounce = debounce;
var formatDate = function formatDate(date) {
var year = date.getFullYear();
var month = String(date.getMonth() + 1).padStart(2, '0');
var day = String(date.getDate()).padStart(2, '0');
var hours = String(date.getHours()).padStart(2, '0');
var minutes = String(date.getMinutes()).padStart(2, '0');
var seconds = String(date.getSeconds()).padStart(2, '0');
return "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes, ":").concat(seconds);
};
exports.formatDate = formatDate;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
@ -3327,7 +3342,22 @@ var apiArr = {
commInfo: "/api/v2/wechat/mpuser-crud/community-owner/info",
//我的房产信息小区列表
create: "/api/v2/wechat/community-owners/create" //创建新的业主信息
create: "/api/v2/wechat/community-owners/create",
//创建新的业主信息
getOrderList: "/api/v2/wechat/community-orders/get-all-list",
//获取账单
getCommunityRoomList: "/api/v2/wechat/community-room/list",
//获取房源列表
getUserGovenmentMoney: "/api/v2/wechat/government-housing-fund-flow-crud/user",
//获取用户公积金
createPayOrder: "/api/v2/wechat/community-order-pay/create",
//创建缴费
getPayOrderInfo: "/api/v2/wechat/community-order-pay/get-one",
//根据缴费信息获取支付信息
getPayOrderList: "/api/v2/wechat/community-order-pay/get-page",
//查询缴费记录
OrderPay: "/api/v2/wechat/community-order-pay/preorder" //预下单
};
exports.apiArr = apiArr;
@ -6689,9 +6719,14 @@ var apiArr = {
advPage: '/api/v2/wechat/community-advertisement-crud/page',
// 小区广告信息分页
commInfo: '/api/v2/wechat/nav-display-crud/comm/info',
// 小区导航设置信息详情
categoryPage: '/api/v2/wechat/announcement-category-crud/page',
// 公告分类信息分页
infoPage: '/api/v2/wechat/announcement-crud/page' // 公告信息分页
infoPage: '/api/v2/wechat/announcement-crud/page',
// 公告信息分页
getAnnounceInfo: "/api/v2/wechat/announcement-crud/info" //公告详情
};
exports.apiArr = apiArr;

View File

@ -351,6 +351,8 @@ var _default = {
preciseLocation = {
cityName: address_component.city,
// 市区
region: address_component.province + address_component.city + address_component.district,
// 省市区
// 无街道xx号的地方则定位到xx街道附近 无精确到xx号
district: address_component.district + "".concat(address_component.street_number ? address_component.street_number : address_component.street),
// 详细地址

View File

@ -1 +1 @@
<block wx:if="{{loading}}"><view class="container" style="{{'margin-top:'+(top+'px')+';'}}"><view class="white_container"><view class="searchBox" style="{{'height:'+(localHeight+'px')+';'}}"><view data-event-opts="{{[['tap',[['map',['$event']]]]]}}" class="searchBox_add" bindtap="__e"><image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Index_add.png" mode="widthFix"></image><view>{{''+(currentCity.cityName||'选择城市')+''}}</view></view></view><view class="swiper"><swiper autoplay="{{true}}" circular="{{true}}" data-event-opts="{{[['animationfinish',[['swipers',['$event']]]]]}}" bindanimationfinish="__e"><block wx:for="{{bannerList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><swiper-item data-event-opts="{{[['tap',[['headerServerClick',['$0'],[[['bannerList','',index]]]]]]]}}" bindtap="__e"><image src="{{item.pic_src}}" mode="aspectFill"></image></swiper-item></block></swiper><view class="cirList"><block wx:for="{{bannerList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{['cir',currentIdx==index?'active':'']}}"></view></block></view></view><view class="tabList"><u-grid vue-id="8dd740cc-1" col="5" border="{{false}}" bind:__l="__l" vue-slots="{{['default']}}"><block wx:for="{{tabList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><u-grid-item bind:click="__e" vue-id="{{('8dd740cc-2-'+index)+','+('8dd740cc-1')}}" data-event-opts="{{[['^click',[['headerServerClick',['$0'],[[['tabList','',index]]]]]]]}}" bind:__l="__l" vue-slots="{{['default']}}"><image class="grid_Pic" src="{{item.icon_src}}" mode></image><text>{{item.title}}</text></u-grid-item></block></u-grid></view></view><view class="white_container margin_top20 padding_bottom32"><block wx:if="{{!currentCity.district}}"><view class="Tit">定位错误 未知区域</view></block><block wx:else><view class="Tit"><view class="local">{{currentCity.district}}</view>附近<view class="Tit_desc">公积金补贴商户</view></view></block><view class="serverList"><view class="serverList_left"><swiper><block wx:for="{{homeLeftList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><swiper-item><image src="{{item.pic_src}}" alt mode="aspectFit"></image></swiper-item></block></swiper></view><view class="serverList_right"><block wx:for="{{homeRightList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['headerServerClick',['$0'],[[['homeRightList','',index]]]]]]]}}" class="{{['serverItem','serverItem'+(index+1)]}}" bindtap="__e"><view class="serverTit">{{item.title}}</view><image src="{{item.pic_src}}" mode></image></view></block></view></view><view data-event-opts="{{[['tap',[['headershopEnterClick',['$event']]]]]}}" class="merchant" bindtap="__e">商户申请入驻</view></view><view class="white_container margin_top20 main padding_bottom32"><block wx:for="{{bottomList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><image class="list_pic" src="{{item.pic_src}}" mode></image></block></view><block wx:if="{{flag}}"><view class="more">{{"下拉加载后续10条共计"+bottomTotal+"条"}}</view></block><nav-footer vue-id="8dd740cc-3" data-com-type="wx" bind:__l="__l"></nav-footer></view></block>
<block wx:if="{{loading}}"><view class="container" style="{{'margin-top:'+(top+'px')+';'}}"><view class="white_container"><view class="searchBox" style="{{'height:'+(localHeight+'px')+';'}}"><view data-event-opts="{{[['tap',[['map',['$event']]]]]}}" class="searchBox_add" bindtap="__e"><image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Index_add.png" mode="widthFix"></image><view>{{''+(currentCity.cityName||'选择城市')+''}}</view></view></view><view class="swiper"><swiper autoplay="{{true}}" circular="{{true}}" data-event-opts="{{[['animationfinish',[['swipers',['$event']]]]]}}" bindanimationfinish="__e"><block wx:for="{{bannerList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><swiper-item data-event-opts="{{[['tap',[['headerServerClick',['$0'],[[['bannerList','',index]]]]]]]}}" bindtap="__e"><image src="{{item.pic_src}}" mode="aspectFill"></image></swiper-item></block></swiper><view class="cirList"><block wx:for="{{bannerList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{['cir',currentIdx==index?'active':'']}}"></view></block></view></view><view class="tabList"><u-grid vue-id="8dd740cc-1" col="{{rowNum}}" border="{{false}}" bind:__l="__l" vue-slots="{{['default']}}"><block wx:for="{{tabList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><u-grid-item bind:click="__e" vue-id="{{('8dd740cc-2-'+index)+','+('8dd740cc-1')}}" data-event-opts="{{[['^click',[['headerServerClick',['$0'],[[['tabList','',index]]]]]]]}}" bind:__l="__l" vue-slots="{{['default']}}"><image class="grid_Pic" src="{{item.icon_src}}" mode></image><text>{{item.title}}</text></u-grid-item></block></u-grid></view></view><view class="white_container margin_top20 padding_bottom32"><block wx:if="{{!currentCity.district}}"><view class="Tit">定位错误 未知区域</view></block><block wx:else><view class="Tit"><view class="local">{{currentCity.district}}</view>附近<view class="Tit_desc">公积金补贴商户</view></view></block><view class="serverList"><view class="serverList_left"><swiper><block wx:for="{{homeLeftList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><swiper-item><image src="{{item.pic_src}}" alt mode="aspectFit"></image></swiper-item></block></swiper></view><view class="serverList_right"><block wx:for="{{homeRightList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['headerServerClick',['$0'],[[['homeRightList','',index]]]]]]]}}" class="{{['serverItem','serverItem'+(index+1)]}}" bindtap="__e"><view class="serverTit">{{item.title}}</view><image src="{{item.pic_src}}" mode></image></view></block></view></view><view data-event-opts="{{[['tap',[['headershopEnterClick',['$event']]]]]}}" class="merchant" bindtap="__e">商户申请入驻</view></view><view class="white_container margin_top20 main padding_bottom32"><block wx:for="{{bottomList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><image class="list_pic" src="{{item.pic_src}}" mode></image></block></view><block wx:if="{{flag}}"><view class="more">{{"下拉加载后续10条共计"+bottomTotal+"条"}}</view></block><nav-footer vue-id="8dd740cc-3" data-com-type="wx" bind:__l="__l"></nav-footer></view></block>

View File

@ -3,25 +3,5 @@
"projectname": "uniapp-ZHSQ",
"setting": {
"compileHotReLoad": true
},
"condition": {
"miniprogram": {
"list": [
{
"name": "packages/community/oneRepair/index",
"pathName": "packages/community/oneRepair/index",
"query": "",
"scene": null,
"launchMode": "default"
},
{
"name": "packages/community/index/index",
"pathName": "packages/community/index/index",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
}
}

View File

@ -10,24 +10,24 @@ export const picUrl = 'https://test.hshuishang.com'; // 图片地址前缀
* @param {Boolean} options.isLogin - 是否需要校验登录态默认为 true
*/
export const NavgateTo = (path, options = {}) => {
const { isLogin = true } = options;
const ctoken = uni.getStorageSync('ctoken');
const { isLogin = true } = options;
const ctoken = uni.getStorageSync('ctoken');
if (isLogin) {
if (!ctoken) {
uni.redirectTo({ url: '/pages/login/login' })
return
} else {
if(path == '1'){
if (!ctoken) {
uni.redirectTo({ url: '/pages/login/login' })
return
} else {
if (path == '1') {
uni.navigateBack({
delta: 1
})
delta: 1
})
return
}
uni.navigateTo({
url: path
});
return;
}
uni.navigateTo({
url: path
});
return;
}
}
uni.navigateTo({ url: path })
}
@ -45,25 +45,25 @@ export const NavgateTo = (path, options = {}) => {
export const request = (url, method = 'POST', data = {}, options = {}) => {
const { silent = true, nested = false } = options;
const { silent = true, nested = false } = options;
let ctoken = null;
if (options.token) {
ctoken = options.token;
} else {
ctoken = uni.getStorageSync('ctoken'); // 后续接口强依赖强校验该字段
}
if (silent) {
uni.showLoading({
title: '加载中',
mask: true
})
};
let params = {
user_id: uni.getStorageSync('userId'),
...data,
}
let ctoken = null;
if (options.token) {
ctoken = options.token;
} else {
ctoken = uni.getStorageSync('ctoken'); // 后续接口强依赖强校验该字段
}
if (silent) {
uni.showLoading({
title: '加载中',
mask: true
})
};
let params = {
user_id: uni.getStorageSync('userId'),
...data,
}
return new Promise((resolve, reject) => {
uni.request({
url: RequsetUrl + url,
@ -71,67 +71,67 @@ export const request = (url, method = 'POST', data = {}, options = {}) => {
data: params,
header: {
'Content-Type': 'application/json',
'Authorization': ctoken,
'Authorization': ctoken,
// ...header,
},
success: (res) => {
// console.log('请求成功,接口返参', res);
if (res.statusCode == 401 || (res.statusCode == 500 && res.data.msg == "效验令牌失败")) {
uni.showModal({
title: '提示',
content: '请登录后查看',
confirmText:"去登陆",
complete: (res) => {
if (res.cancel) {
uni.hideLoading();
uni.redirectTo({
url: '/pages/index/index'
});
return
}
if (res.confirm) {
uni.redirectTo({
url: '/pages/login/login',
})
}
}
})
return
}
// console.log('请求成功,接口返参', res);
if (res.statusCode == 401 || (res.statusCode == 500 && res.data.msg == "效验令牌失败")) {
uni.showModal({
title: '提示',
content: '请登录后查看',
confirmText: "去登陆",
complete: (res) => {
if (res.cancel) {
uni.hideLoading();
uni.redirectTo({
url: '/pages/index/index'
});
return
}
if (res.confirm) {
uni.redirectTo({
url: '/pages/login/login',
})
}
}
})
return
}
if (res.statusCode === 200) {
if (silent) {
uni.hideLoading();
}
if (options?.nested) {
let data = {
...res.data,
}
resolve(data); // 请求成功
return;
}
if (silent) {
uni.hideLoading();
}
if (options?.nested) {
let data = {
...res.data,
}
resolve(data); // 请求成功
return;
}
resolve(res.data.data); // 请求成功
} else {
console.log('走到这列');
uni.hideLoading();
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
console.log('走到这列');
uni.hideLoading();
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
reject({
code: res.statusCode,
message: res.data.msg || '请求失败',
data: res.data,
data: res.data,
});
}
},
fail: (err) => {
uni.hideLoading();
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
uni.hideLoading();
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
reject({
code: -1,
message: '接口异常,请稍后重试',
@ -149,11 +149,11 @@ export const request = (url, method = 'POST', data = {}, options = {}) => {
* @returns {Boolean} 手机号是否正确
*/
export const isPhone = (option) => {
if(option.length != 11){
if (option.length != 11) {
return false
}
if (!(/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(option))) {
return false
return false
} else {
return true
}
@ -167,46 +167,46 @@ export const isPhone = (option) => {
* @returns {number} - 运算结果
*/
export const floatCalculate = (num1, num2, operator) => {
// 获取小数位数
function getPrecision(num) {
const str = num.toString();
const decimalIndex = str.indexOf('.');
return decimalIndex === -1 ? 0 : str.length - decimalIndex - 1;
}
// 计算放大倍数
const precision1 = getPrecision(num1);
const precision2 = getPrecision(num2);
const maxPrecision = Math.max(precision1, precision2);
const factor = Math.pow(10, maxPrecision);
// 将数字转换为整数
const intNum1 = Math.round(num1 * factor);
const intNum2 = Math.round(num2 * factor);
// 根据运算符进行计算
let result;
switch (operator) {
case '+':
result = (intNum1 + intNum2) / factor;
break;
case '-':
result = (intNum1 - intNum2) / factor;
break;
case '*':
result = (intNum1 * intNum2) / (factor * factor);
break;
case '/':
result = intNum1 / intNum2;
break;
case '+=':
result = (intNum1 + intNum2) / factor;
break;
default:
throw new Error('不支持的运算符');
}
return result;
// 获取小数位数
function getPrecision(num) {
const str = num.toString();
const decimalIndex = str.indexOf('.');
return decimalIndex === -1 ? 0 : str.length - decimalIndex - 1;
}
// 计算放大倍数
const precision1 = getPrecision(num1);
const precision2 = getPrecision(num2);
const maxPrecision = Math.max(precision1, precision2);
const factor = Math.pow(10, maxPrecision);
// 将数字转换为整数
const intNum1 = Math.round(num1 * factor);
const intNum2 = Math.round(num2 * factor);
// 根据运算符进行计算
let result;
switch (operator) {
case '+':
result = (intNum1 + intNum2) / factor;
break;
case '-':
result = (intNum1 - intNum2) / factor;
break;
case '*':
result = (intNum1 * intNum2) / (factor * factor);
break;
case '/':
result = intNum1 / intNum2;
break;
case '+=':
result = (intNum1 + intNum2) / factor;
break;
default:
throw new Error('不支持的运算符');
}
return result;
}
/**
@ -221,11 +221,11 @@ export const upload = (filename, fn) => {
})
uni.uploadFile({
url: RequsetUrl + '/api/v1/public/upload-image',
url: RequsetUrl + '/api/v1/public/upload-image',
filePath: filename,
name: 'image',
formData: {
'uid': uni.getStorageSync('uid'),
'uid': uni.getStorageSync('uid'),
},
success: (f) => {
uni.hideLoading();
@ -239,7 +239,7 @@ export const upload = (filename, fn) => {
icon: 'none'
})
},
complete: () => {}
complete: () => { }
});
}
@ -255,11 +255,11 @@ export const uploadVideo = (filename, fn) => {
mask: true
})
uni.uploadFile({
url: RequsetUrl + '/api/v1/public/upload-video',
url: RequsetUrl + '/api/v1/public/upload-video',
filePath: filename,
name: 'file',
formData: {
'uid': uni.getStorageSync('uid'),
'uid': uni.getStorageSync('uid'),
},
success: (f) => {
uni.hideLoading();
@ -273,7 +273,7 @@ export const uploadVideo = (filename, fn) => {
icon: 'none'
})
},
complete: () => {}
complete: () => { }
});
}
@ -285,47 +285,47 @@ export const uploadVideo = (filename, fn) => {
* @param {string} lon2 第二个点的经度
* @returns {number} 距离
*/
export const calculateDistance = (lat1, lon1, lat2, lon2)=>{
// 将经纬度转换为弧度
const toRad = (value) => (value * Math.PI) / 180;
export const calculateDistance = (lat1, lon1, lat2, lon2) => {
// 将经纬度转换为弧度
const toRad = (value) => (value * Math.PI) / 180;
const R = 6371; // 地球半径(单位:千米)
const dLat = toRad(lat2 - lat1);
const dLon = toRad(lon2 - lon1);
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = R * c; // 最终距离(单位:千米)
return distance;
}
const R = 6371; // 地球半径(单位:千米)
const dLat = toRad(lat2 - lat1);
const dLon = toRad(lon2 - lon1);
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = R * c; // 最终距离(单位:千米)
return distance;
}
//
export const menuButtonInfo = () => {
const systemInfo = uni.getSystemInfoSync();
const platform = systemInfo.platform;
if (platform === 'ios') {
// TODO: ios待测试
return {
height: systemInfo.statusBarHeight,
top: 44,
};
}
if (platform === 'android') {
return {
height: systemInfo.statusBarHeight,
top: 44, // 自定义导航栏默认高度
};
}
if (systemInfo.uniPlatform === 'mp-weixin') {
// 微信小程序、支付宝小程序等,平台标识以 'mp-' 开头
return uni.getMenuButtonBoundingClientRect()
} else {
return 'Unknown';
}
const systemInfo = uni.getSystemInfoSync();
const platform = systemInfo.platform;
if (platform === 'ios') {
// TODO: ios待测试
return {
height: systemInfo.statusBarHeight,
top: 44,
};
}
if (platform === 'android') {
return {
height: systemInfo.statusBarHeight,
top: 44, // 自定义导航栏默认高度
};
}
if (systemInfo.uniPlatform === 'mp-weixin') {
// 微信小程序、支付宝小程序等,平台标识以 'mp-' 开头
return uni.getMenuButtonBoundingClientRect()
} else {
return 'Unknown';
}
}
/**
@ -334,38 +334,38 @@ export const menuButtonInfo = () => {
* @returns {Promise} 返回一个Promise对象
*/
export const getProviderPromise = (opt) => {
return new Promise((resolve, reject) => {
uni.getProvider({
service: opt,
success: (res) => {
console.log('获取支付服务提供商成功:', res.provider);
resolve(res.provider);
},
fail: (err) => {
console.error('获取支付服务提供商失败:', err);
reject(err);
}
});
return new Promise((resolve, reject) => {
uni.getProvider({
service: opt,
success: (res) => {
console.log('获取支付服务提供商成功:', res.provider);
resolve(res.provider);
},
fail: (err) => {
console.error('获取支付服务提供商失败:', err);
reject(err);
}
});
});
}
//数组去重
export const uniqueByField = (arr, field) => {
const seen = {};
return arr.filter(item => {
const key = item[field];
return seen.hasOwnProperty(key) ? false : (seen[key] = true);
});
const seen = {};
return arr.filter(item => {
const key = item[field];
return seen.hasOwnProperty(key) ? false : (seen[key] = true);
});
}
// 校验邮箱地址是否合法
export const validateEmail = (email) => {
export const validateEmail = (email) => {
// 正则表达式验证邮箱格式
const regex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
if (!regex.test(email)) {
return false;
}
return true
}
@ -378,16 +378,16 @@ export const validateEmail = (email) => {
*/
export const debounce = (fn, delay = 300, immediate = false) => {
let timer = null;
return function(...args) {
return function (...args) {
const context = this;
if (timer) clearTimeout(timer);
if (immediate && !timer) {
fn.apply(context, args);
}
timer = setTimeout(() => {
if (!immediate) {
fn.apply(context, args);
@ -398,3 +398,17 @@ export const debounce = (fn, delay = 300, immediate = false) => {
}
/**
* 格式化日期
* @param {date} 时间戳
*/
export const formatDate = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}