From 64e43870932a5b3922aaaf56d25c88d3c0e48f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87?= Date: Sun, 2 Mar 2025 02:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E8=8B=A5=E5=B9=B2=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request.js | 2 +- api/user.js | 2 +- app.js | 2 +- components/modalView/index.js | 31 +++++++++++++------------- components/modalView/index.wxml | 4 ++-- components/modalView/index.wxss | 6 +++++ pages/browser/index.js | 7 ++++++ pages/help/address/edit/index.wxml | 2 +- pages/help/community/index.js | 26 +++++++++++++++++++-- pages/help/community/index.wxml | 31 +++++++++++++++----------- pages/help/community/index.wxss | 6 +---- pages/help/index/index.js | 15 ++++++------- pages/help/index/index.wxml | 4 ++-- pages/help/index/index.wxss | 8 +++++-- pages/my/coupon/index.wxml | 2 +- pages/my/index/index.js | 8 ++++++- pages/my/promation/wx-group/index.js | 26 +++++++++------------ pages/my/promation/wx-group/index.wxml | 8 +++---- pages/order/detail/index.wxml | 2 +- 19 files changed, 116 insertions(+), 76 deletions(-) diff --git a/api/request.js b/api/request.js index da68716..94d8dfc 100644 --- a/api/request.js +++ b/api/request.js @@ -37,7 +37,7 @@ const sendRequest = (options)=>{ return; } if(app)app = getApp(); - const code = app?.globalData?.shared_user_code; + const code = app?.globalData?.shared_user_code||''; wx.navigateTo({ url: '/pages/login/login?shared_user_code='+code, }) diff --git a/api/user.js b/api/user.js index 98526a5..ec02622 100644 --- a/api/user.js +++ b/api/user.js @@ -16,7 +16,7 @@ export default { return request.post('/api/wechat/phone-login',{ login_code:wxCode, phone_code:phoneCode, - referral_code:rCode + referral_code:rCode||'' }); }, info(){ diff --git a/app.js b/app.js index 74973ea..bf8decc 100644 --- a/app.js +++ b/app.js @@ -25,7 +25,7 @@ App({ return { title:this.globalData.appConfig.share_card_title, imageUrl:'/assets/imgs/login/share.jpg', - path:`/pages/help/index/index?shared_user_code=${this.globalData.userInfo.user_code}` + path:`/pages/help/index/index?shared_user_code=${this.globalData.userInfo.user_code||''}` } } } diff --git a/components/modalView/index.js b/components/modalView/index.js index 885339d..3445025 100644 --- a/components/modalView/index.js +++ b/components/modalView/index.js @@ -25,7 +25,10 @@ Component({ type:String, value:'请输入内容' }, - isShowCancel:true, + isShowCancel:{ + type:Boolean, + value:true + }, cancelButtonText:{ type:String, value:'取消' @@ -36,7 +39,18 @@ Component({ }, show:{ type:Boolean, - value:false + value:false, + observer(show){ + if(show){ + const windowInfo = wx.getWindowInfo(); + this.createSelectorQuery().select('#modalViewMain').boundingClientRect((res)=>{ + const viewHeight = res.height; + this.setData({ + dynamicsStyle:`top:${(windowInfo.windowHeight-viewHeight)/2}px;height:${viewHeight}px;` + }) + }).exec(); + } + } } }, @@ -91,18 +105,5 @@ Component({ // }) // }).exec(); // } - }, - observers:{ - show(show){ - if(show){ - const windowInfo = wx.getWindowInfo(); - this.createSelectorQuery().select('#modalViewMain').boundingClientRect((res)=>{ - const viewHeight = res.height; - this.setData({ - dynamicsStyle:`top:${(windowInfo.windowHeight-viewHeight)/2}px;height:${viewHeight}px;` - }) - }).exec(); - } - } } }) \ No newline at end of file diff --git a/components/modalView/index.wxml b/components/modalView/index.wxml index 31e04bd..a67aa41 100644 --- a/components/modalView/index.wxml +++ b/components/modalView/index.wxml @@ -1,5 +1,5 @@ - @@ -9,7 +9,7 @@ {{content}} - + diff --git a/components/modalView/index.wxss b/components/modalView/index.wxss index c6cbecb..100bc55 100644 --- a/components/modalView/index.wxss +++ b/components/modalView/index.wxss @@ -14,6 +14,12 @@ background-color: #fff; padding:32rpx; } +.modal-view-main .content .text{ + color: #666666; + font-size: 28rpx; + text-align: center; + margin:16rpx 0 40rpx 0; +} .custom-modal-view .textarea{ } diff --git a/pages/browser/index.js b/pages/browser/index.js index 960aec6..dd5b56d 100644 --- a/pages/browser/index.js +++ b/pages/browser/index.js @@ -12,6 +12,13 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { + let url = decodeURIComponent(options.url); + if(url.indexOf('?')>-1){ + url = `${url}&random=${Math.random()}` + }else{ + url = `${url}?random=${Math.random()}` + } + console.log(url); this.setData({ webUrl:decodeURIComponent(options.url) }) diff --git a/pages/help/address/edit/index.wxml b/pages/help/address/edit/index.wxml index 6600f49..36619fe 100644 --- a/pages/help/address/edit/index.wxml +++ b/pages/help/address/edit/index.wxml @@ -63,5 +63,5 @@ class="button">删除 - diff --git a/pages/help/community/index.js b/pages/help/community/index.js index a95c24a..583157c 100644 --- a/pages/help/community/index.js +++ b/pages/help/community/index.js @@ -13,7 +13,9 @@ Page({ scrollViewHeight:0, lng:0, lat:0, - pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false} + pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false}, + appConfig:{}, + userInfo:{} }, onSelectItem(event){ const pages = getCurrentPages(); @@ -41,6 +43,16 @@ Page({ this.loadList(); }).catch(()=>{ this.loadList(); + }); + app.getAppConfig().then((res)=>{ + this.setData({ + appConfig:res + }) + }); + app.getUserInfo().then((data)=>{ + this.setData({ + userInfo:data + }) }) }, refreshList(){ @@ -69,7 +81,6 @@ Page({ data.latitude = this.data.lat; } commonApi.community.list(data).then((data)=>{ - const communityList = data.items; let currentCommunity; data.items.map((item)=>{ if(item.distance){ @@ -103,6 +114,17 @@ Page({ }); }); }, + applyNewCommunity(){ + let url = this.data.appConfig.url_community_apply; + if(url.indexOf('?')>-1){ + url = `${url}&userid=${this.data.userInfo.userid}` + }else{ + url = `${url}?userid=${this.data.userInfo.userid}` + } + wx.navigateTo({ + url: `/pages/browser/index?url=${encodeURIComponent(url)}`, + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/help/community/index.wxml b/pages/help/community/index.wxml index 7c9eec7..7f91f5b 100644 --- a/pages/help/community/index.wxml +++ b/pages/help/community/index.wxml @@ -1,15 +1,20 @@ - - - - - - - - - + + + + + + + + + + + + + + - \ No newline at end of file + \ No newline at end of file diff --git a/pages/help/community/index.wxss b/pages/help/community/index.wxss index 0d2e033..ed2ffa8 100644 --- a/pages/help/community/index.wxss +++ b/pages/help/community/index.wxss @@ -1,15 +1,11 @@ .community-list{ - position:absolute; - left:0;top:0; - width: 100%; - height:100vh; } .community-list .item{ border-radius: 18rpx; background-color: #fff; padding:49rpx 23rpx; margin:20rpx; - border: 1rpx solid #fff; + border: 2rpx solid #fff; } .community-list .item.current{ border-color: var(--main-color); diff --git a/pages/help/index/index.js b/pages/help/index/index.js index 07c34e0..5c95f7c 100644 --- a/pages/help/index/index.js +++ b/pages/help/index/index.js @@ -199,15 +199,14 @@ Page({ } }); }).catch((data)=>{ - if(data.code==400&&data.data&&data.data.orderid){ - this.setData({ - isShowPayModal:true, - preOrderUnPayId:data.data.orderid - }) - } - this.setData({ + let _setData = { preOrdering:false - }); + } + if(data.code==400&&data.data&&data.data.orderid){ + _setData.isShowPayModal = true; + _setData.preOrderUnPayId = data.data.orderid; + } + this.setData(_setData); }) }, fail(){ diff --git a/pages/help/index/index.wxml b/pages/help/index/index.wxml index 9687267..7917a0b 100644 --- a/pages/help/index/index.wxml +++ b/pages/help/index/index.wxml @@ -85,7 +85,7 @@ @@ -139,4 +139,4 @@ bind:enter="enterPageContainer" bind:leave="leavePageContainer" wx:if="{{isShowO - \ No newline at end of file + \ No newline at end of file diff --git a/pages/help/index/index.wxss b/pages/help/index/index.wxss index 3bcd656..5c986b1 100644 --- a/pages/help/index/index.wxss +++ b/pages/help/index/index.wxss @@ -120,10 +120,12 @@ } .action-bar .item{ flex:1; - padding:34rpx 40rpx 30rpx 40rpx + padding:34rpx 40rpx 30rpx 40rpx; } .action-bar .share{ background-color: #fff; + line-height: 1; + font-weight: normal; } .action-bar .title{ font-size: 28rpx; @@ -137,7 +139,9 @@ margin-top:20rpx; } .action-bar .icon{ - width:52rpx;height:52rpx; + width:52rpx!important; + height:52rpx!important; + vertical-align: middle; } .promotion-panel{ diff --git a/pages/my/coupon/index.wxml b/pages/my/coupon/index.wxml index 6842126..0785337 100644 --- a/pages/my/coupon/index.wxml +++ b/pages/my/coupon/index.wxml @@ -79,4 +79,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pages/my/index/index.js b/pages/my/index/index.js index ca861ff..b7f35c5 100644 --- a/pages/my/index/index.js +++ b/pages/my/index/index.js @@ -43,8 +43,14 @@ Page({ // }); }, applyPartnert(){ + let url = this.data.appConfig.url_partner_apply; + if(url.indexOf('?')>-1){ + url = `${url}&userid=${this.data.userInfo.userid}` + }else{ + url = `${url}?userid=${this.data.userInfo.userid}` + } wx.navigateTo({ - url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_partner_apply)}`, + url: `/pages/browser/index?url=${encodeURIComponent(url)}`, }) }, shareFriend(){ diff --git a/pages/my/promation/wx-group/index.js b/pages/my/promation/wx-group/index.js index 8cf93dc..84377dc 100644 --- a/pages/my/promation/wx-group/index.js +++ b/pages/my/promation/wx-group/index.js @@ -8,11 +8,9 @@ Page({ */ data: { detail:{}, - navbarHeight:getStatusNavBarHeight(), communityId:'', positioning:false, positioningError:false, - detailPosition:{}, qrcodeLoading:false }, @@ -21,14 +19,6 @@ Page({ */ onLoad(options) { this.data.communityId = options.communityId; - this.setData({ - navbarHeight:getStatusNavBarHeight() - }) - commonApi.community.detail(this.data.communityId).then((data)=>{ - this.setData({ - detail:data - }) - }) this.getWxGroupQrcode(); }, getWxGroupQrcode(){ @@ -41,18 +31,22 @@ Page({ positioning:false, positioningError:false }) - commonApi.community.wxGroup(this.data.communityId,{latitude:data.latitude,longitude:data.longitude}).then((res)=>{ - this.setData({ - detailPosition:res, - qrcodeLoading:false - }) - }) + this.getDetail({latitude:data.latitude,longitude:data.longitude}); }).catch(()=>{ this.setData({ positioning:false, qrcodeLoading:false, positioningError:true }) + this.getDetail(); + }) + }, + getDetail(lnglat){ + commonApi.community.wxGroup(this.data.communityId,lnglat||{}).then((res)=>{ + this.setData({ + detail:res, + qrcodeLoading:false + }) }) }, /** diff --git a/pages/my/promation/wx-group/index.wxml b/pages/my/promation/wx-group/index.wxml index b596032..2342655 100644 --- a/pages/my/promation/wx-group/index.wxml +++ b/pages/my/promation/wx-group/index.wxml @@ -11,7 +11,7 @@ - {{detail.name}} + {{detail.community.name}} @@ -19,7 +19,7 @@ - + 定位失败 @@ -27,9 +27,9 @@ 无法显示二维码 + src="{{detail.community.optimized_qy_group_qrcode}}"/> - 点击图中二维码识别 + 点击图中二维码识别 \ No newline at end of file diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml index 9e2d76f..6fa8944 100644 --- a/pages/order/detail/index.wxml +++ b/pages/order/detail/index.wxml @@ -146,5 +146,5 @@ - \ No newline at end of file