fix: 修复地区选择组件bug,房产添加切换城市功能增加
This commit is contained in:
parent
15987d83b3
commit
ffe6f6239b
39
README-zh.md
Normal file
39
README-zh.md
Normal file
@ -0,0 +1,39 @@
|
||||
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 列表区域
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ 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', // 公告信息分页
|
||||
|
||||
@ -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 });
|
||||
},
|
||||
|
||||
|
||||
|
||||
@ -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>
|
||||
@ -156,7 +156,8 @@
|
||||
dialogBoxShow: false,
|
||||
searchQuery: '',
|
||||
filteredFloorsList: [],
|
||||
searchList: []
|
||||
searchList: [],
|
||||
city: uni.getStorageSync('location'),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -166,8 +167,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 +182,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 => {
|
||||
|
||||
@ -144,6 +144,9 @@ image {
|
||||
margin: 0 auto;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.ads_first{
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
margin-top: 32rpx;
|
||||
@ -297,3 +300,9 @@ image {
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.grid_Pic {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
@ -39,14 +39,23 @@
|
||||
</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(iteitem.mini_program_urlm)" :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,7 +67,7 @@
|
||||
</div>
|
||||
|
||||
<div class="newsList">
|
||||
<div class="newsItem" v-for="item in infoList">
|
||||
<div class="newsItem" v-for="item in infoList" :key="item.id">
|
||||
<div class="newsItem_left">
|
||||
<div class="newsItem_left_tit">{{item.title}}</div>
|
||||
<div class="newsItem_left_sub">{{item.author}}</div>
|
||||
@ -185,7 +194,10 @@
|
||||
this.ads2Show = false
|
||||
},
|
||||
jump(e) {
|
||||
console.log(e);
|
||||
if(!e) {
|
||||
this.NotOpen();
|
||||
return;
|
||||
}
|
||||
NavgateTo(e)
|
||||
},
|
||||
|
||||
@ -254,7 +266,8 @@
|
||||
nav_icon: picUrl + item.nav_icon
|
||||
};
|
||||
});
|
||||
console.log(this.functionList);
|
||||
|
||||
console.log('functionList', this.functionList);
|
||||
},
|
||||
|
||||
async getAdvertising() {
|
||||
|
||||
@ -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, // 省市区
|
||||
// 无街道xx号的地方,则定位到xx街道附近 无精确到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, // 详细地址
|
||||
|
||||
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
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
@ -6689,7 +6689,7 @@ var apiArr = {
|
||||
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',
|
||||
|
||||
@ -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),
|
||||
// 详细地址
|
||||
|
||||
@ -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>
|
||||
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user