解决某些情况无法显示弹窗以及若干 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;
}
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,
})

View File

@ -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(){

2
app.js
View File

@ -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||''}`
}
}
}

View File

@ -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();
}
}
}
})

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}}"
bind:enter="enterPageContainer" bind:leave="leavePageContainer">
<view class="modal-view-main" id="modalViewMain">
@ -9,7 +9,7 @@
<view class="text" wx:else>{{content}}</view>
</view>
<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>
</view>
</view>

View File

@ -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{
}

View File

@ -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)
})

View File

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

View File

@ -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)}`,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

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

View File

@ -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);

View File

@ -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(){

View File

@ -85,7 +85,7 @@
</navigator>
<button class="item right share" open-type="share">
<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>
</button>
</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>
</view>
</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{
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{

View File

@ -79,4 +79,4 @@
</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(){
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(){

View File

@ -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
})
})
},
/**

View File

@ -11,7 +11,7 @@
<image class="icon" src="/assets/icon/my/building.png"/>
<label>服务小区</label>
</view>
<view class="name">{{detail.name}}</view>
<view class="name">{{detail.community.name}}</view>
</view>
<view class="spliter"></view>
</view>
@ -19,7 +19,7 @@
<view class="bottom">
<view class="qrcode-area">
<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>
@ -27,9 +27,9 @@
<view>无法显示二维码</view>
</view>
<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 class="tips" wx:if="{{detailPosition&&detailPosition.show_qrcode}}">点击图中二维码识别</view>
<view class="tips" wx:if="{{detail&&detail.show_qrcode}}">点击图中二维码识别</view>
</view>
</view>

View File

@ -146,5 +146,5 @@
<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>