|
@@ -3,7 +3,7 @@ import router from './../../utils/router'
|
|
|
import {getSetting,getLocation} from './../../utils/auth'
|
|
|
const AUTH = require('../../utils/auth')
|
|
|
import icons from "../../utils/icon"
|
|
|
-import {getPropertyData,submitAdjust,getCurrentSeason} from '../../requests/api';
|
|
|
+import {getPropertyData,submitAdjust,getCurrentSeason,queryUseranswer} from '../../requests/api';
|
|
|
import Toast from '../../vant-weapp/dist/toast/toast';
|
|
|
import {
|
|
|
userCheck,
|
|
@@ -22,6 +22,8 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ surveyShow:false,
|
|
|
+ lottieShow:true,
|
|
|
spaceDetail:null,
|
|
|
effectTime:-1,
|
|
|
statusList: icons.statusList,
|
|
@@ -97,6 +99,56 @@ Page({
|
|
|
},
|
|
|
picInitUrl:$.store.get("picInitUrl"),
|
|
|
},
|
|
|
+ // 关闭问卷
|
|
|
+ surveyClose(value){
|
|
|
+ this.setData({surveyShow:false,lottieShow:true});
|
|
|
+
|
|
|
+ if(value.detail.good){
|
|
|
+ wx.showToast({
|
|
|
+ title:"感谢您的反馈",
|
|
|
+ image:"../../static/images/bixin.png",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 检查是否需要填写问卷
|
|
|
+ async userAnswer(){
|
|
|
+ let day = new Date();
|
|
|
+ let year = day.getFullYear();
|
|
|
+ let month = day.getMonth() + 1;
|
|
|
+ month=month<10?('0'+month):month;
|
|
|
+ let today = day.getDate();
|
|
|
+ today=today<10?('0'+today):today;
|
|
|
+ let seasonType="";
|
|
|
+ const dataSeason={
|
|
|
+ projectId:$.store.get('projectId')||$.storage.get('projectId'),
|
|
|
+ date:`${year}${month}${today}`
|
|
|
+ }
|
|
|
+ await getCurrentSeason(dataSeason).then(res=>{
|
|
|
+ if(res.result=="success"){
|
|
|
+ seasonType= res.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let projectId= $.store.get('projectId');
|
|
|
+ let tenantId= $.store.get('tenantId');
|
|
|
+ let data={
|
|
|
+ "criteria":{
|
|
|
+ "userId": $.store.get('userId'),
|
|
|
+ "projectId": projectId,
|
|
|
+ "tenantId": tenantId,
|
|
|
+ "startTime": {
|
|
|
+ "$ge": `${year}${month}${today}`
|
|
|
+ },
|
|
|
+ "endTime": {
|
|
|
+ "$le":`${year}${month}${today}`
|
|
|
+ },
|
|
|
+ "seasonType": seasonType
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryUseranswer(data).then(res=>{
|
|
|
+ !res.count&&this.setData({surveyShow:true,lottieShow:false})
|
|
|
+ })
|
|
|
+ },
|
|
|
goBack(){
|
|
|
router.pop()
|
|
|
},
|
|
@@ -149,10 +201,11 @@ Page({
|
|
|
return {level,levelTxt}
|
|
|
},
|
|
|
// 检查是否过引导
|
|
|
- checkGuide(){
|
|
|
+ checkGuide(value){
|
|
|
if(this.data.spaceDetail.isClose.toString()=="true"){
|
|
|
return
|
|
|
}
|
|
|
+ ($.storage.get('guideInit')&&!$.storage.get('nextRemind')&&value)&&this.userAnswer();
|
|
|
!$.storage.get('guideInit')&&this.getPageheight();
|
|
|
this.setData({'guideInit':!$.storage.get('guideInit')})
|
|
|
},
|
|
@@ -801,7 +854,7 @@ Page({
|
|
|
(content[0].hcho||content[0].hcho==0)&&(content[0].hcholevel = this.checkLevel(content[0].hcho,"hcho"));
|
|
|
}
|
|
|
this.setData({spaceDetail:content[0]},()=>{
|
|
|
- this.checkGuide();
|
|
|
+ this.checkGuide(value);
|
|
|
this.getnowSeason();
|
|
|
// if(this.data.spaceDetail.nextOpenTime){
|
|
|
// let value = this.formatTimeall(this.data.spaceDetail.nextOpenTime);
|