diff --git a/api/community.js b/api/community.js index f6eee9dd..7b3244ba 100644 --- a/api/community.js +++ b/api/community.js @@ -1,6 +1,7 @@ export const apiArr = { list: '/wechat/community/list', // 获取社区列表 info: '/wechat/community/info', // 获取单个社区信息 + isJoin: '/wechat/community/is-join', // 用户是否加入社区、楼宇、房间 tipsList: '/wechat/community/tips/list', // 获取全部通知列表 oneTips: '/wechat/community/tips/one', // 获取单个社区通知 apply: '/wechat/community/apply', // 申请加入小区 diff --git a/api/shopEnter.js b/api/shopEnter.js new file mode 100644 index 00000000..aace9aa4 --- /dev/null +++ b/api/shopEnter.js @@ -0,0 +1,6 @@ +export const apiArr = { + settledShop: '/wechat/shop/settled-shop', // 商家入驻 + settledDeal: '/wechat/water/dealer/settled-deal', // 经销商入驻 + settledComm: '/wechat/community/settled-comm', // 社区入驻 + getTree: '/wechat/shop/cates/get-tree', // 商家商户分类树信息 +} \ No newline at end of file diff --git a/components/areaPopup/areaPopup.vue b/components/areaPopup/areaPopup.vue index 3322e466..455a9b33 100644 --- a/components/areaPopup/areaPopup.vue +++ b/components/areaPopup/areaPopup.vue @@ -11,7 +11,6 @@ 取消 确认 - {{item.name}} @@ -84,11 +83,34 @@ mask: true }); try { - const [provRes, cityRes, distRes] = await Promise.all([ - this.getProvList(), - this.getCityList(), - this.getDistList(), - ]) + const proviceList = uni.getStorageSync('proviceList'); + const cityList = uni.getStorageSync('cityList'); + const businessList = uni.getStorageSync('businessList'); + let provRes, cityRes, distRes; + + // 有缓存数据时不进行接口数据请求 + if (proviceList || cityList || businessList) { + provRes = { + rows: proviceList + }; + cityRes = { + rows: cityList + }; + distRes = { + rows: businessList + }; + } else { + [provRes, cityRes, distRes] = await Promise.all([ + this.getProvList(), + this.getCityList(), + this.getDistList(), + ]) + // 无缓存时 缓存省市区数据 + uni.setStorageSync('proviceList',provRes.rows) + uni.setStorageSync('cityList',cityRes.rows) + uni.setStorageSync('businessList',distRes.rows) + } + uni.hideLoading(); // 默认展示第一条数据 的市区 和 城区 diff --git a/manifest.json b/manifest.json index a971ed3a..889138cc 100644 --- a/manifest.json +++ b/manifest.json @@ -73,7 +73,7 @@ "urlCheck" : false }, "usingComponents" : true, - "requiredPrivateInfos" : [ "getLocation" ], + "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ], "permission" : { "scope.userLocation" : { "desc" : "正在授权您获取当前位置信息" diff --git a/packages/aroundShop/index/index.vue b/packages/aroundShop/index/index.vue index e3c3195d..01d6c711 100644 --- a/packages/aroundShop/index/index.vue +++ b/packages/aroundShop/index/index.vue @@ -44,7 +44,8 @@ async init() { const res = await request(apiArr.getGoodsList, "POST", { page_num: this.page_num, - page_size: this.page_size + page_size: this.page_size, + type: 2 }); if (res.list) { let flag = false diff --git a/packages/community/communityDetail/index.vue b/packages/community/communityDetail/index.vue index 009e973d..40f48b92 100644 --- a/packages/community/communityDetail/index.vue +++ b/packages/community/communityDetail/index.vue @@ -44,7 +44,7 @@ - + 手机通行 @@ -145,6 +145,7 @@ ], info: {}, tipsList: [], + isJoin: false, // 是否入驻本小区 } }, onLoad (options) { @@ -154,11 +155,29 @@ }, methods: { - async init(id) { - const res = await request(apiArr.info, "POST", { + async getInfo (id) { + const res = await request(apiArr.info, "POST", { community_id: Number(id) - }); - console.log('res' ,res); + }, { silent: false }); + return res; + }, + + async getIsJoin (id) { + const res = await request(apiArr.isJoin, "POST", { + community_id: Number(id) + }, { silent: false }); + return res; + }, + + async init(id) { + uni.showLoading({ + title: '加载中', + mask: true + }) + const [res, isJoinRes] = await Promise.all([ + this.getInfo(id), + this.getIsJoin(id), + ]) const newInfo = { ...res, swiperList: res?.swiper_img ? res?.swiper_img.split(',').map((item) => picUrl+item): [], @@ -169,7 +188,8 @@ navList[1].url = `/packages/community/mycar/index?id=${Number(id)}&title=${res.name}`; this.info = newInfo; this.navList = navList; - + this.isJoin = isJoinRes.is_join; + uni.hideLoading(); uni.setNavigationBarTitle({ title: newInfo.name, }) diff --git a/packages/shopEnter/index/index.css b/packages/shopEnter/index/index.css new file mode 100644 index 00000000..8bb4bfa9 --- /dev/null +++ b/packages/shopEnter/index/index.css @@ -0,0 +1,172 @@ +.container { + background: #F9F9F9; +} + +.title { + margin-top: 30rpx; + margin-left: 20rpx; + margin-bottom: 4rpx; + font-weight: bold; + font-size: 32rpx; + color: #222222; +} + +.item { + height: 90rpx; + display: flex; + justify-content: space-between; + align-items: center; + margin: 0 48rpx 0 52rpx; + border-bottom: 1rpx solid #E6E6E6; +} + +.item_left { + display: flex; + align-items: center; +} + +.item_pic { + width: 30rpx; + height: 30rpx; +} + +.label { + font-weight: normal; + font-size: 26rpx; + color: #999999; + margin-left: 20rpx; +} + +.item_right { + display: flex; + flex: 1; + text-align: right; + justify-content: flex-end; + overflow: hidden; +} + +.input { + margin-right: 20rpx; +} + +.upload_item { + margin: 30rpx 48rpx 30rpx 52rpx; + display: flex; + border-bottom: 1rpx solid #E6E6E6; +} + +.upload_left { + display: flex; + flex-direction: column; +} + +.left_top { + display: flex; + align-items: center; +} + +.footer { + flex: 1; +} + +.item_end { + margin-left: 52rpx; + margin-right: 48rpx; +} + +.text_area { + margin-top: 20rpx; + min-height: 200rpx; +} + +.text_count { + margin-right: 48rpx; + text-align: right; + font-weight: normal; + font-size: 26rpx; + color: #999999; +} + +.radio_group { + display: flex; +} +.radio { + margin-right: 40rpx; +} +.radio:last-child { + margin-right: 0; +} +.radio text { + font-weight: normal; + font-size: 26rpx; + color: #222222; +} + +.btn { + margin: 60rpx 50rpx; + height: 80rpx; + line-height: 80rpx; + background: #FF512A; + border-radius: 100rpx 100rpx 100rpx 100rpx; + text-align: center; + font-weight: 400; + font-size: 36rpx; + color: #FFFFFF; +} +.swiper { + display: block; +} + +.swiper_item { + margin-top: 30rpx; +} +.van-uploader__preview { + margin-right: 50rpx !important; + margin-bottom: 30rpx !important; +} +.community_text { + margin-left: 20rpx; + color: #999999; + margin-right: 20rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + flex: 1; +} +.color_black { + color: #000000; +} + + + + +.white { + background: #FFFFFF; +} + +.no_border { + border-bottom: none; +} + +.margin2 { + margin-top: 20rpx; +} + +.no_margin_left { + margin-left: 0; +} + +.popup_title { + display: flex; + margin: 20rpx 30rpx 0; + justify-content: space-between; +} +.popup_label { + color: #999; +} +.color_blue { + color: #576b95; +} +.u-upload { + flex: none !important; +} \ No newline at end of file diff --git a/packages/shopEnter/index/index.vue b/packages/shopEnter/index/index.vue new file mode 100644 index 00000000..3eff590b --- /dev/null +++ b/packages/shopEnter/index/index.vue @@ -0,0 +1,1630 @@ +