Browse Source

不是当月不允许分享调查问卷

dev
mk 2 years ago
parent
commit
674071a15a
  1. 2
      subpages/communitySelfInsp/pages/historyQuery/historyQuery.js
  2. 18
      subpages/communitySelfInsp/pages/synthesis/synthesis.js
  3. 2
      subpages/communitySelfInsp/pages/synthesis/synthesis.wxml

2
subpages/communitySelfInsp/pages/historyQuery/historyQuery.js

@ -152,7 +152,7 @@ Page({
// }) // })
// } // }
wx.navigateTo({ wx.navigateTo({
url: `/subpages/communitySelfInsp/pages/synthesis/synthesis?inspRecordId=${e.currentTarget.dataset.item.id}`, url: `/subpages/communitySelfInsp/pages/synthesis/synthesis?inspRecordId=${e.currentTarget.dataset.item.id}&monthName=${e.currentTarget.dataset.item.monthName}`,
}) })
}, },
back() { back() {

18
subpages/communitySelfInsp/pages/synthesis/synthesis.js

@ -14,14 +14,14 @@ Page({
synthesisScore:'',//综合得分 synthesisScore:'',//综合得分
inspRecordId:'',//自查表Id inspRecordId:'',//自查表Id
fontSize:'', fontSize:'',
maskStatus:false maskStatus:false,
shareFlag:false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options);
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
@ -31,6 +31,20 @@ Page({
qrCodeImgUrl:options.qrCodeImgUrl, qrCodeImgUrl:options.qrCodeImgUrl,
questionnaireUrl:options.questionnaireUrl questionnaireUrl:options.questionnaireUrl
}) })
// 获取当前日期
const currentDate = new Date();
// 获取当前月份(注意月份是从 0 到 11,所以要加 1)
const currentMonth = currentDate.getMonth() + 1;
if(currentMonth == options.monthName){
this.setData({
shareFlag:true
})
}else{
this.setData({
shareFlag:false
})
}
this.getSynthesis() this.getSynthesis()
}, },

2
subpages/communitySelfInsp/pages/synthesis/synthesis.wxml

@ -57,7 +57,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="bto_btn"> <view class="bto_btn" wx:if="{{shareFlag}}">
<button hover-class="btn-hover" class="btn_blue" open-type="share">分享给好友参与测评</button> <button hover-class="btn-hover" class="btn_blue" open-type="share">分享给好友参与测评</button>
<button bind:tap="showCodeImg" class="btn_yellow">满意度自查二维码</button> <button bind:tap="showCodeImg" class="btn_yellow">满意度自查二维码</button>
</view> </view>

Loading…
Cancel
Save