解决某些情况无法显示弹窗以及若干 bug

This commit is contained in:
2025-03-02 02:14:36 +08:00
parent 73ebcf34c4
commit 64e4387093
19 changed files with 116 additions and 76 deletions

View File

@ -37,7 +37,7 @@ const sendRequest = (options)=>{
return; return;
} }
if(app)app = getApp(); if(app)app = getApp();
const code = app?.globalData?.shared_user_code; const code = app?.globalData?.shared_user_code||'';
wx.navigateTo({ wx.navigateTo({
url: '/pages/login/login?shared_user_code='+code, url: '/pages/login/login?shared_user_code='+code,
}) })

View File

@ -16,7 +16,7 @@ export default {
return request.post('/api/wechat/phone-login',{ return request.post('/api/wechat/phone-login',{
login_code:wxCode, login_code:wxCode,
phone_code:phoneCode, phone_code:phoneCode,
referral_code:rCode referral_code:rCode||''
}); });
}, },
info(){ info(){

2
app.js
View File

@ -25,7 +25,7 @@ App({
return { return {
title:this.globalData.appConfig.share_card_title, title:this.globalData.appConfig.share_card_title,
imageUrl:'/assets/imgs/login/share.jpg', 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||''}`
} }
} }
} }

View File

@ -25,7 +25,10 @@ Component({
type:String, type:String,
value:'请输入内容' value:'请输入内容'
}, },
isShowCancel:true, isShowCancel:{
type:Boolean,
value:true
},
cancelButtonText:{ cancelButtonText:{
type:String, type:String,
value:'取消' value:'取消'
@ -36,7 +39,18 @@ Component({
}, },
show:{ show:{
type:Boolean, 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(); // }).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();
}
}
} }
}) })

View File

@ -1,5 +1,5 @@
<page-container show="{{show}}" position="center" class="custom-modal-view" <page-container model:show="{{show}}" position="center" class="custom-modal-view"
custom-style="background-color:transparent;left:27px;width:calc(100vw - 54px);height:200px;{{dynamicsStyle}}" custom-style="background-color:transparent;left:27px;width:calc(100vw - 54px);height:200px;{{dynamicsStyle}}"
bind:enter="enterPageContainer" bind:leave="leavePageContainer"> bind:enter="enterPageContainer" bind:leave="leavePageContainer">
<view class="modal-view-main" id="modalViewMain"> <view class="modal-view-main" id="modalViewMain">
@ -9,7 +9,7 @@
<view class="text" wx:else>{{content}}</view> <view class="text" wx:else>{{content}}</view>
</view> </view>
<view class="btns"> <view class="btns">
<button class="button cancel" plain vx:if="{{isShowCancel}}" bind:tap="cancelButtonTap">{{cancelButtonText}}</button> <button class="button cancel" plain wx:if="{{isShowCancel}}" bind:tap="cancelButtonTap">{{cancelButtonText}}</button>
<button class="button confirm" type="primary" bind:tap="okButtonTap">{{okButtonText}}</button> <button class="button confirm" type="primary" bind:tap="okButtonTap">{{okButtonText}}</button>
</view> </view>
</view> </view>

View File

@ -14,6 +14,12 @@
background-color: #fff; background-color: #fff;
padding:32rpx; padding:32rpx;
} }
.modal-view-main .content .text{
color: #666666;
font-size: 28rpx;
text-align: center;
margin:16rpx 0 40rpx 0;
}
.custom-modal-view .textarea{ .custom-modal-view .textarea{
} }

View File

@ -12,6 +12,13 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { 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({ this.setData({
webUrl:decodeURIComponent(options.url) webUrl:decodeURIComponent(options.url)
}) })

View File

@ -63,5 +63,5 @@
class="button">删除</button> class="button">删除</button>
</view> </view>
<modal-view titleText="确定删除此地址吗" show="{{isShowConfirm}}" bind:ok="deleteAddress" <modal-view titleText="确定删除此地址吗" model:show="{{isShowConfirm}}" bind:ok="deleteAddress"
cancelButtonText="再想想" okButtonText="删除"></modal-view> cancelButtonText="再想想" okButtonText="删除"></modal-view>

View File

@ -13,7 +13,9 @@ Page({
scrollViewHeight:0, scrollViewHeight:0,
lng:0, lng:0,
lat: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){ onSelectItem(event){
const pages = getCurrentPages(); const pages = getCurrentPages();
@ -41,6 +43,16 @@ Page({
this.loadList(); this.loadList();
}).catch(()=>{ }).catch(()=>{
this.loadList(); this.loadList();
});
app.getAppConfig().then((res)=>{
this.setData({
appConfig:res
})
});
app.getUserInfo().then((data)=>{
this.setData({
userInfo:data
})
}) })
}, },
refreshList(){ refreshList(){
@ -69,7 +81,6 @@ Page({
data.latitude = this.data.lat; data.latitude = this.data.lat;
} }
commonApi.community.list(data).then((data)=>{ commonApi.community.list(data).then((data)=>{
const communityList = data.items;
let currentCommunity; let currentCommunity;
data.items.map((item)=>{ data.items.map((item)=>{
if(item.distance){ 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)}`,
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -1,15 +1,20 @@
<list-view class="community-list" bind:refresh="refreshList" <view class="custom-scroll-view">
bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}" <list-view class="community-list main" bind:refresh="refreshList"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}"> bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}"
<view class="item {{item.id==currentCommunity.id?'current':''}}" wx:for="{{communityList}}" wx:key="index" loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
bind:tap="onSelectItem" data-item="{{item}}"> <view class="item {{item.id==currentCommunity.id?'current':''}}" wx:for="{{communityList}}" wx:key="index"
<view class="title"> bind:tap="onSelectItem" data-item="{{item}}">
<image class="icon" src="/assets/icon/help/house.png"/> <view class="title">
<label class="label">{{item.name}}</label> <image class="icon" src="/assets/icon/help/house.png"/>
</view> <label class="label">{{item.name}}</label>
<view class="sub-title"> </view>
<label class="key">{{item.address}}{{item.address}}</label> <view class="sub-title">
<label class="value">{{item.distance||''}}</label> <label class="key">{{item.address}}{{item.address}}</label>
<label class="value">{{item.distance||''}}</label>
</view>
</view> </view>
</list-view>
<view class="bottom-bar-v2">
<button type="primary" bind:tap="applyNewCommunity">申请开通小区</button>
</view> </view>
</list-view> </view>

View File

@ -1,15 +1,11 @@
.community-list{ .community-list{
position:absolute;
left:0;top:0;
width: 100%;
height:100vh;
} }
.community-list .item{ .community-list .item{
border-radius: 18rpx; border-radius: 18rpx;
background-color: #fff; background-color: #fff;
padding:49rpx 23rpx; padding:49rpx 23rpx;
margin:20rpx; margin:20rpx;
border: 1rpx solid #fff; border: 2rpx solid #fff;
} }
.community-list .item.current{ .community-list .item.current{
border-color: var(--main-color); border-color: var(--main-color);

View File

@ -199,15 +199,14 @@ Page({
} }
}); });
}).catch((data)=>{ }).catch((data)=>{
if(data.code==400&&data.data&&data.data.orderid){ let _setData = {
this.setData({
isShowPayModal:true,
preOrderUnPayId:data.data.orderid
})
}
this.setData({
preOrdering:false preOrdering:false
}); }
if(data.code==400&&data.data&&data.data.orderid){
_setData.isShowPayModal = true;
_setData.preOrderUnPayId = data.data.orderid;
}
this.setData(_setData);
}) })
}, },
fail(){ fail(){

View File

@ -85,7 +85,7 @@
</navigator> </navigator>
<button class="item right share" open-type="share"> <button class="item right share" open-type="share">
<image src="/assets/icon/help/share.png" class="icon"/> <image src="/assets/icon/help/share.png" class="icon"/>
<view class="title">邀请有礼</view> <view class="title">{{appConfig.share_button_title}}</view>
<view class="sub-title">赠送鸡蛋</view> <view class="sub-title">赠送鸡蛋</view>
</button> </button>
</view> </view>
@ -139,4 +139,4 @@ bind:enter="enterPageContainer" bind:leave="leavePageContainer" wx:if="{{isShowO
<button class="button" type="primary" bind:tap="getOrder" loading="{{ordering}}">确认下单</button> <button class="button" type="primary" bind:tap="getOrder" loading="{{ordering}}">确认下单</button>
</view> </view>
</page-container> </page-container>
<modal-view titleText="你有订单未支付!" okButtonText="去支付" show="{{isShowPayModal}}" wx:if="{{isShowPayModal}}" bind:ok="navToUnPayOrder"/> <modal-view titleText="你有订单未支付!" okButtonText="去支付" model:show="{{isShowPayModal}}" wx:if="{{isShowPayModal}}" bind:ok="navToUnPayOrder"/>

View File

@ -120,10 +120,12 @@
} }
.action-bar .item{ .action-bar .item{
flex:1; flex:1;
padding:34rpx 40rpx 30rpx 40rpx padding:34rpx 40rpx 30rpx 40rpx;
} }
.action-bar .share{ .action-bar .share{
background-color: #fff; background-color: #fff;
line-height: 1;
font-weight: normal;
} }
.action-bar .title{ .action-bar .title{
font-size: 28rpx; font-size: 28rpx;
@ -137,7 +139,9 @@
margin-top:20rpx; margin-top:20rpx;
} }
.action-bar .icon{ .action-bar .icon{
width:52rpx;height:52rpx; width:52rpx!important;
height:52rpx!important;
vertical-align: middle;
} }
.promotion-panel{ .promotion-panel{

View File

@ -79,4 +79,4 @@
</view> </view>
</list-view> </list-view>
<modal-view titleText="是否确认兑换该商品?" cancelButtonText="再想想" bind:ok="useCoupon" show="{{isShowUseCoupon}}"/> <modal-view titleText="是否确认兑换该商品?" content="兑换商品时,需现场工作人员操作" cancelButtonText="再想想" bind:ok="useCoupon" model:show="{{isShowUseCoupon}}"/>

View File

@ -43,8 +43,14 @@ Page({
// }); // });
}, },
applyPartnert(){ 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({ wx.navigateTo({
url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_partner_apply)}`, url: `/pages/browser/index?url=${encodeURIComponent(url)}`,
}) })
}, },
shareFriend(){ shareFriend(){

View File

@ -8,11 +8,9 @@ Page({
*/ */
data: { data: {
detail:{}, detail:{},
navbarHeight:getStatusNavBarHeight(),
communityId:'', communityId:'',
positioning:false, positioning:false,
positioningError:false, positioningError:false,
detailPosition:{},
qrcodeLoading:false qrcodeLoading:false
}, },
@ -21,14 +19,6 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
this.data.communityId = options.communityId; this.data.communityId = options.communityId;
this.setData({
navbarHeight:getStatusNavBarHeight()
})
commonApi.community.detail(this.data.communityId).then((data)=>{
this.setData({
detail:data
})
})
this.getWxGroupQrcode(); this.getWxGroupQrcode();
}, },
getWxGroupQrcode(){ getWxGroupQrcode(){
@ -41,18 +31,22 @@ Page({
positioning:false, positioning:false,
positioningError:false positioningError:false
}) })
commonApi.community.wxGroup(this.data.communityId,{latitude:data.latitude,longitude:data.longitude}).then((res)=>{ this.getDetail({latitude:data.latitude,longitude:data.longitude});
this.setData({
detailPosition:res,
qrcodeLoading:false
})
})
}).catch(()=>{ }).catch(()=>{
this.setData({ this.setData({
positioning:false, positioning:false,
qrcodeLoading:false, qrcodeLoading:false,
positioningError:true positioningError:true
}) })
this.getDetail();
})
},
getDetail(lnglat){
commonApi.community.wxGroup(this.data.communityId,lnglat||{}).then((res)=>{
this.setData({
detail:res,
qrcodeLoading:false
})
}) })
}, },
/** /**

View File

@ -11,7 +11,7 @@
<image class="icon" src="/assets/icon/my/building.png"/> <image class="icon" src="/assets/icon/my/building.png"/>
<label>服务小区</label> <label>服务小区</label>
</view> </view>
<view class="name">{{detail.name}}</view> <view class="name">{{detail.community.name}}</view>
</view> </view>
<view class="spliter"></view> <view class="spliter"></view>
</view> </view>
@ -19,7 +19,7 @@
<view class="bottom"> <view class="bottom">
<view class="qrcode-area"> <view class="qrcode-area">
<view class="weui-loading" wx:if="{{qrcodeLoading}}"></view> <view class="weui-loading" wx:if="{{qrcodeLoading}}"></view>
<view class="error" wx:elif="{{positioningError||!detailPosition.show_qrcode}}"> <view class="error" wx:elif="{{positioningError||!detail.show_qrcode}}">
<view bind:tap="getWxGroupQrcode" class="retry" wx:if="{{positioningError}}"> <view bind:tap="getWxGroupQrcode" class="retry" wx:if="{{positioningError}}">
定位失败 定位失败
</view> </view>
@ -27,9 +27,9 @@
<view>无法显示二维码</view> <view>无法显示二维码</view>
</view> </view>
<image wx:else class="image" show-menu-by-longpress <image wx:else class="image" show-menu-by-longpress
src="{{detailPosition.community.optimized_qy_group_qrcode}}"/> src="{{detail.community.optimized_qy_group_qrcode}}"/>
</view> </view>
<view class="tips" wx:if="{{detailPosition&&detailPosition.show_qrcode}}">点击图中二维码识别</view> <view class="tips" wx:if="{{detail&&detail.show_qrcode}}">点击图中二维码识别</view>
</view> </view>
</view> </view>

View File

@ -146,5 +146,5 @@
<merchant-order id="merchantOrderComponent" bind:paySuccess="paySuccess" wx:if="{{orderDetail.status==orderStatus.unpaid}}"/> <merchant-order id="merchantOrderComponent" bind:paySuccess="paySuccess" wx:if="{{orderDetail.status==orderStatus.unpaid}}"/>
<modal-view titleText="你确定取消此订单吗?" show="{{isShowCancelView}}" <modal-view titleText="你确定取消此订单吗?" model:show="{{isShowCancelView}}"
bind:ok="cancelOrder" wx:if="{{orderDetail.status==orderStatus.created}}"></modal-view> bind:ok="cancelOrder" wx:if="{{orderDetail.status==orderStatus.created}}"></modal-view>