Browse Source

feat:调查问卷

guotianliang 4 years ago
parent
commit
90c248619d

+ 4 - 0
app.wxss

@@ -1,4 +1,8 @@
 /* 初始化样式 */
+page{
+  position: relative;
+  z-index: 1;
+}
 page,view,text,swiper,swiper-item,image,navigator{
   padding: 0;
   margin: 0;

+ 222 - 0
components/questionnaire/questionnaire.js

@@ -0,0 +1,222 @@
+// components/questionnaire/questionnaire.js
+import $ from '../../utils/Tool';
+import {
+  queryQuestion,
+  submitAnswer,
+  notShowQuestion
+} from "../../requests/api";
+Component({
+  /**
+   * 组件的属性列表
+   */
+  options: {
+    styleIsolation: 'shared',
+  },
+  properties: {
+
+  },
+  lifetimes: {
+    attached: function() {
+
+      this.queryDate();
+      // 在组件实例进入页面节点树时执行
+    },
+    detached: function() {
+      // 在组件实例被从页面节点树移除时执行
+    },
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    startValue:0,
+    checked:[],
+    tipsshow:false,
+    dialogRadio:'2',
+    answer:false,
+    questionDate:[],
+    firstDate:{},
+    otherDate:[],
+    submitFlag:false,
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    preventTouchMove(){
+
+    },
+    emitClose(value){
+      this.triggerEvent('surveyClose',value?{good:true}:{good:false})
+    },
+    queryDate(){
+      let data={
+        "criteria":{
+            "type":0
+        }
+     }
+      queryQuestion(data).then(res=>{
+        const [firstDate,...otherDate]= res.content;
+        otherDate.forEach(v=>{
+          v.checked=[];
+          v.remark=false;
+          v.remarkTxt="";
+        })
+        this.setData({
+          firstDate:firstDate||{},
+          otherDate:otherDate||[],
+          questionDate:res.content||[]
+        })
+      })
+    },
+    inputChange(e){
+      let {index} = e.currentTarget.dataset;
+      let mText = 'otherDate['+ index +'].remarkTxt';
+      let {value} = e.detail;
+      this.setData({
+        [mText]:value
+      })
+
+    },
+    closePage(){
+      this.setData({
+        tipsshow:true
+      })
+    },
+    starChange(event){
+      let that =this;
+      if(event.detail!==5){
+        this.setData({
+          startValue: event.detail,
+          answer:true
+        });
+      }else{
+        this.setData({
+          startValue: event.detail,
+          submitFlag:true
+        },()=>{
+          that.submitFeed();
+        });
+
+
+        // this.emitClose(true);
+      }
+
+    },
+    selectChange(event){
+      let {index} = event.currentTarget.dataset;
+      let mText = 'otherDate['+ index +'].checked';
+      let remark = 'otherDate['+ index +'].remark';
+      let flag = event.detail.includes("12");
+      let that =this;
+      this.setData({
+        [mText]: event.detail,
+        [remark]:flag
+      },()=>{
+        if(flag){
+          wx.createSelectorQuery().in(that).select('#qus_listbox').boundingClientRect(function(rect){
+            that.setData({
+              textScroll:rect.height
+            })
+          }).exec()   
+       }
+        let falg = that.data.otherDate.filter((item)=>{
+          return !item.checked.length
+        });
+        !falg.length?that.setData({submitFlag:true}):that.setData({submitFlag:false});
+      });
+    },
+    radioChange(event){
+      this.setData({
+        dialogRadio: event.detail,
+      });
+    },
+    closeDialog(){
+      this.setData({
+        tipsshow:false
+      })
+    },
+    async submitMsg(){
+      if(this.data.dialogRadio==1){
+        let {id} = $.store.get('userInfo');
+        let tenantId = $.store.get('tenantId');
+        let projectId = $.store.get('projectId');
+        let data={
+            "projectId":projectId,
+            "tenantId":tenantId,
+            "userId":id,
+          "startTime":this.data.firstDate.startTime,
+            "endTime":this.data.firstDate.endTime,
+            "isDisplay": false,
+            "seasonType":this.data.firstDate.seasonType
+        }
+
+        await notShowQuestion(data)
+      }
+      this.setData({
+        tipsshow:false
+      })
+      this.data.dialogRadio==1?this.emitClose(true):this.emitClose();
+    },
+    submitFeed(){
+      if(!this.data.submitFlag){
+        return
+      }
+      let falgRemark=true;
+      let {id,nickname,phone,userName}= $.store.get('userInfo');
+      let startTime = this.data.firstDate.startTime;
+      let endTime = this.data.firstDate.endTime;
+      let projectId= $.store.get('projectId');
+      let tenantId= $.store.get('tenantId');
+      let dateTemplate={
+          "projectId":projectId,//项目id
+          "tenantId":tenantId,
+          "seasonType":this.data.firstDate.seasonType||'Warm',//季节类型
+          "userId":id,//用户id
+          "nickName":nickname,//微信昵称
+          "phone":phone,//手机号
+          "userName":userName,//手机号
+          "type":"0",//类型 0 小程序
+          "startTime":startTime,//调查问卷开始时间
+          "endTime":endTime,//调查问卷结束时间
+      }
+      let firstDate={...dateTemplate};
+      let startIndex=5-this.data.startValue;
+      firstDate.questionId=this.data.firstDate.questionId;
+      firstDate.questionAnswerList=[{answerId: this.data.firstDate.questionAnswerList[startIndex].answerId}];
+      let data=[firstDate];
+      if(this.data.answer){
+        this.data.otherDate.forEach(item=>{
+          let otherdate={...dateTemplate};
+          otherdate.questionId=item.questionId;
+          otherdate.questionAnswerList=[];
+          item.checked.forEach(v=>{
+            let obj={};
+            obj.answerId=v;
+            if(item.remark&&v==12){
+              item.remarkTxt?(obj.remark=item.remarkTxt):(falgRemark=false);
+            }
+            otherdate.questionAnswerList.push(obj);
+          })
+          data.push(otherdate);
+        })
+      }
+      if(!falgRemark){
+        wx.showToast({
+          title:"其他选项不能为空",
+          icon:"none",
+          duration: 1000
+        })
+        return
+      }
+      submitAnswer(data).then(res=>{
+        let that =this;
+        this.setData({dialogRadio:1},()=>{
+          that.submitMsg();
+        })
+      })
+    }
+  }
+})

+ 10 - 0
components/questionnaire/questionnaire.json

@@ -0,0 +1,10 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-rate": "../../vant-weapp/dist/rate/index",
+    "van-checkbox": "../../vant-weapp/dist/checkbox/index",
+    "van-checkbox-group": "../../vant-weapp/dist/checkbox-group/index",
+    "van-radio": "../../vant-weapp/dist/radio/index",
+    "van-radio-group": "../../vant-weapp/dist/radio-group/index"
+  }
+}

+ 190 - 0
components/questionnaire/questionnaire.less

@@ -0,0 +1,190 @@
+.ques_page{
+    width: 686rpx;
+    // height: 379rpx;
+    background: #FFFFFF;
+    border-radius: 8px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%,-50%);
+    z-index:1100;
+    .bg_page{
+        position: relative;
+        width: 100%;
+        height: 124px;
+        z-index:11;
+        top: -27px;
+    }
+    .bg_close{
+        width: 18px;
+        height: 18px;
+        position: absolute;
+        z-index:12;
+        top: 12px;
+        right: 12px;
+    }
+    .ques_txt{
+        text{
+            color: #F54E45;
+            margin-right: 10rpx;
+        }
+        display: flex;
+        // align-items: center;
+        // margin: 40rpx 0 24rpx;
+        margin: 40rpx 0 24rpx;
+        font-size: 32rpx;
+        font-weight: 500;
+        line-height: 44rpx;
+    }
+    .ques_txt_list{
+        margin: 40rpx 0 0rpx;
+    }
+    .ques_main{
+        margin-top: -19px;
+        padding: 0 48rpx 0rpx;
+        .ques_title{
+            height: 66rpx;
+            font-size: 48rpx;
+            font-weight: 400;
+            color: #111111;
+            line-height: 66rpx;
+            text-align: center;
+        }
+        .ques_tips{
+            margin-top: 24rpx;
+            font-size: 28rpx;
+            font-weight: 400;
+            color: #666666;
+            line-height: 44rpx;
+        }
+
+        .ques_star{
+            width: 100%;
+            height: 180rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            flex-direction: column;
+            background: #EFF0F1;
+            border-radius: 4px;
+            margin-bottom: 56rpx;
+            text{
+                margin-top: 20rpx;
+                height: 40rpx;
+                font-size: 28rpx;
+                font-weight: 400;
+                color: #666666;
+                line-height: 40rpx;
+            }
+        }
+    }
+    .ques_list{
+        // height: 670rpx;
+        max-height: 450rpx;
+        box-sizing: border-box;
+        overflow: auto;
+        padding: 0 48rpx 0rpx;
+        margin-bottom:  30rpx;
+        .ques_checkbox{
+            font-size: 32rpx;
+            padding: 36rpx 0 0;
+        }
+        .txtarea{
+            width: 100%;
+            height: 240rpx;
+            margin-top: 10px;
+            padding: 24rpx;
+            border-radius: 4px;
+            font-size: 28rpx;
+            box-sizing: border-box;
+            border: 1px solid #EFF0F1;
+        }
+    }
+    .footer{
+        padding: 0 48rpx 40rpx;
+        .submit {
+
+            height: 80rpx;
+            font-size: 32rpx;
+            margin-top: 40rpx;
+            width: auto!important;
+            color: #FFFFFF;
+            background: #04B49C;
+            border-radius: 20px;
+        }
+        .submit_noactive{
+            background: #EFF0F1;
+            color: #C3C7CB;
+        }
+    }
+    .footer_active{
+        border-top: 1px solid #ececed;
+        box-shadow: 0px 6px 20px 0px rgba(43, 48, 54, 0.1);
+    }
+}
+.ques_pop{
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    background: #000000;
+    opacity: 0.2;
+    z-index:1100;
+    overflow: hidden;
+}
+.ques_pop_active{
+    z-index:1200;
+}
+.dialog_box{
+    width: 590rpx;
+    // height: 379rpx;
+    padding-top: 56rpx;
+    background: #FFFFFF;
+    border-radius: 8px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%,-50%);
+    z-index:1201;
+    .title{
+        text-align: center;
+        font-size: 18px;
+        font-weight: 500;
+        color: #1F2529;
+        line-height: 24px;
+    }
+    .content{
+        padding: 66rpx 0 66rpx 64rpx;
+        .radio_custom{
+            display: inline-flex;
+            width: 100px;
+            margin-right: 15px;
+        }
+
+    }
+    .dialog_footer{
+        height: 102rpx;
+        border-top: 1px solid #EFF0F1;
+        justify-content: space-around;
+        font-size: 16px;
+        font-weight: 500;
+        color: #1F2529;
+        .dialog_btn{
+            width: 49%;
+            height: 100%;
+        }
+        .line{
+            width: 1px;
+            background: #EFF0F1;
+            height: 100%;
+            // border-right: 1px solid #EFF0F1 ;
+        }
+    }
+}
+.radio_span{
+    color: #666666;
+}
+.radio_active{
+    color: #000000;
+}

+ 79 - 0
components/questionnaire/questionnaire.wxml

@@ -0,0 +1,79 @@
+<!-- 弹窗蒙层 -->
+<view class="ques_pop {{tipsshow?'ques_pop_active':''}}" catchtouchmove="preventTouchMove"></view>
+<view class="ques_page" catchtouchmove="preventTouchMove">
+    <image class="bg_page" src="../../static/images/page-bg.png" />
+    <image class="bg_close" bindtap="closePage" src="../../static/images/quesClose.png" />
+    <view class="ques_main">
+        <view class="ques_title">问卷调查</view>
+        <view class="ques_tips">感谢您参加这次问卷调查,您的每一条反馈,都促使我们做得更好!</view>
+        <!-- 询问星级 -->
+        <view wx:if="{{!answer}}">
+            <view class="ques_txt"><text>* </text>{{firstDate.questionName}}</view>
+            <view class="ques_star">
+                <van-rate  size="{{ 30 }}"
+                color="#FF8800"
+                void-color="#ffffff"
+                void-icon="star"
+                gutter="6"
+                bind:change="starChange"
+                ></van-rate>
+                <text>对环境进行星级评价</text>
+            </view>
+        </view>
+    </view>
+    <!-- 少于四颗星答题 -->
+    <scroll-view scroll-y="{{true}}" catchtouchmove="{{false}}"  scroll-top="{{textScroll}}" class="ques_list" id="ques_list" wx:if="{{answer}}" >
+         <view class="qus_listbox" id="qus_listbox">
+            <view wx:for="{{otherDate}}" :key="{{index}}">
+             <view class="ques_txt ques_txt_list"><text>* </text>{{item.questionName}}</view>
+                <van-checkbox-group  value="{{ item.checked }}" bind:change="selectChange" data-index="{{index}}">
+                    <van-checkbox wx:for="{{item.questionAnswerList}}" wx:for-item='items' custom-class="ques_checkbox"
+                    checked-color="#04b49c"
+                    shape="square"
+                    name="{{items.answerId}}"
+                    label-class="{{m1.getIncludes(item.checked,items.answerId)?'radio_active':'radio_span'}}">
+                        {{items.answerName}}
+                    </van-checkbox>
+                </van-checkbox-group>
+                <view wx:if="{{item.remark}}">
+                    <textarea placeholder="请输入"  value="{{item.remarkTxt}}" bindinput="inputChange" data-index="{{index}}" class="txtarea" maxlength="200" cursor-spacing="10"/>
+                </view>
+            </view>
+         </view>
+    </scroll-view>
+    <view class="footer footer_active" wx:if="{{answer}}">
+        <button class="submit {{!submitFlag?'submit_noactive':''}} flex_row" catchtap="submitFeed">
+            提交
+        </button>
+    </view>
+</view>
+<!-- 是否下次提醒弹窗 -->
+<view class="dialog_box" wx:if="{{tipsshow}}">
+    <view class="title">是否关闭当前问卷反馈?</view>
+    <view class="content">
+        <van-radio-group value="{{ dialogRadio }}" bind:change="radioChange">
+            <van-radio name="1" checked-color="#04B49C" custom-class="radio_custom"  icon-size="24px" label-class="{{dialogRadio==1?'radio_active':'radio_span'}}">不再提醒</van-radio>
+            <van-radio name="2" checked-color="#04B49C" custom-class="radio_custom" icon-size="24px"  label-class="{{dialogRadio==2?'radio_active':'radio_span'}}">下次提醒</van-radio>
+        </van-radio-group>
+    </view>
+    <view class="dialog_footer flex_row">
+        <view bindtap="closeDialog" class="dialog_btn flex_row">取消</view>
+        <view class="line"></view>
+        <view bindtap="submitMsg" class="dialog_btn flex_row">确定</view>
+    </view>
+</view>
+<wxs module="m1">
+var getIncludes = function(array,target) {
+  var max = false;
+  for(var i=0;i<array.length;i++){
+      if(!max){
+          if(array[i]==target){
+            max=true;
+        }
+      }
+
+  }
+  return max;
+}
+module.exports.getIncludes = getIncludes;
+</wxs>

+ 181 - 0
components/questionnaire/questionnaire.wxss

@@ -0,0 +1,181 @@
+.ques_page {
+  width: 686rpx;
+  background: #FFFFFF;
+  border-radius: 8px;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 1100;
+}
+.ques_page .bg_page {
+  position: relative;
+  width: 100%;
+  height: 124px;
+  z-index: 11;
+  top: -27px;
+}
+.ques_page .bg_close {
+  width: 18px;
+  height: 18px;
+  position: absolute;
+  z-index: 12;
+  top: 12px;
+  right: 12px;
+}
+.ques_page .ques_txt {
+  display: flex;
+  margin: 40rpx 0 24rpx;
+  font-size: 32rpx;
+  font-weight: 500;
+  line-height: 44rpx;
+}
+.ques_page .ques_txt text {
+  color: #F54E45;
+  margin-right: 10rpx;
+}
+.ques_page .ques_txt_list {
+  margin: 40rpx 0 0rpx;
+}
+.ques_page .ques_main {
+  margin-top: -19px;
+  padding: 0 48rpx 0rpx;
+}
+.ques_page .ques_main .ques_title {
+  height: 66rpx;
+  font-size: 48rpx;
+  font-weight: 400;
+  color: #111111;
+  line-height: 66rpx;
+  text-align: center;
+}
+.ques_page .ques_main .ques_tips {
+  margin-top: 24rpx;
+  font-size: 28rpx;
+  font-weight: 400;
+  color: #666666;
+  line-height: 44rpx;
+}
+.ques_page .ques_main .ques_star {
+  width: 100%;
+  height: 180rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+  background: #EFF0F1;
+  border-radius: 4px;
+  margin-bottom: 56rpx;
+}
+.ques_page .ques_main .ques_star text {
+  margin-top: 20rpx;
+  height: 40rpx;
+  font-size: 28rpx;
+  font-weight: 400;
+  color: #666666;
+  line-height: 40rpx;
+}
+.ques_page .ques_list {
+  max-height: 450rpx;
+  box-sizing: border-box;
+  overflow: auto;
+  padding: 0 48rpx 0rpx;
+  margin-bottom: 30rpx;
+}
+.ques_page .ques_list .ques_checkbox {
+  font-size: 32rpx;
+  padding: 36rpx 0 0;
+}
+.ques_page .ques_list .txtarea {
+  width: 100%;
+  height: 240rpx;
+  margin-top: 10px;
+  padding: 24rpx;
+  border-radius: 4px;
+  font-size: 28rpx;
+  box-sizing: border-box;
+  border: 1px solid #EFF0F1;
+}
+.ques_page .footer {
+  padding: 0 48rpx 40rpx;
+}
+.ques_page .footer .submit {
+  height: 80rpx;
+  font-size: 32rpx;
+  margin-top: 40rpx;
+  width: auto!important;
+  color: #FFFFFF;
+  background: #04B49C;
+  border-radius: 20px;
+}
+.ques_page .footer .submit_noactive {
+  background: #EFF0F1;
+  color: #C3C7CB;
+}
+.ques_page .footer_active {
+  border-top: 1px solid #ececed;
+  box-shadow: 0px 6px 20px 0px rgba(43, 48, 54, 0.1);
+}
+.ques_pop {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  top: 0;
+  left: 0;
+  background: #000000;
+  opacity: 0.2;
+  z-index: 1100;
+  overflow: hidden;
+}
+.ques_pop_active {
+  z-index: 1200;
+}
+.dialog_box {
+  width: 590rpx;
+  padding-top: 56rpx;
+  background: #FFFFFF;
+  border-radius: 8px;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 1201;
+}
+.dialog_box .title {
+  text-align: center;
+  font-size: 18px;
+  font-weight: 500;
+  color: #1F2529;
+  line-height: 24px;
+}
+.dialog_box .content {
+  padding: 66rpx 0 66rpx 64rpx;
+}
+.dialog_box .content .radio_custom {
+  display: inline-flex;
+  width: 100px;
+  margin-right: 15px;
+}
+.dialog_box .dialog_footer {
+  height: 102rpx;
+  border-top: 1px solid #EFF0F1;
+  justify-content: space-around;
+  font-size: 16px;
+  font-weight: 500;
+  color: #1F2529;
+}
+.dialog_box .dialog_footer .dialog_btn {
+  width: 49%;
+  height: 100%;
+}
+.dialog_box .dialog_footer .line {
+  width: 1px;
+  background: #EFF0F1;
+  height: 100%;
+}
+.radio_span {
+  color: #666666;
+}
+.radio_active {
+  color: #000000;
+}

+ 1 - 1
pages/auth/index.js

@@ -59,7 +59,7 @@ Page({
     const data={};
     data.phone = $.store.get('phoneNumber');
     data.openId =$.store.get('openId') ||$.storage.get('openId');
-    console.log($.store.get('openId') ,$.storage.get('openId'),"$.storage.get('openId')")
+    // console.log($.store.get('openId') ,$.storage.get('openId'),"$.storage.get('openId')")
     const {nickName} = $.store.get('userInfo')
     data.nickname=nickName;
     // data.userName=app.globalData.userInfo.nickName;

+ 60 - 3
pages/index/index.js

@@ -11,11 +11,15 @@ import {
   spaceTop,
   getWeather,
   deleteSpaceAdjust,
+  queryUseranswer,
+  getCurrentSeason,
   powerCheck,
   openSpace,
 } from "../../requests/api";
 Page({
   data: {
+    surveyShow:false, //是否显示调查问卷
+    lottieShow:true, //是否显示lottie组件
     meauList: [{
         id: 1,
         title: '扫码调节',
@@ -59,11 +63,62 @@ Page({
       projectid:e.currentTarget.dataset.projectid})
     }
   },
+  // 关闭问卷
+  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})
+    })
+  },
    // 检查是否过引导
   checkGuide(){
     if(!this.data.tenantName){
       return
     }
+    this.userAnswer();
     !$.storage.get('guideUser')&&this.getPageheight();
     this.setData({'guideUser':!$.storage.get('guideUser')})
   },
@@ -73,7 +128,7 @@ Page({
       this.setData({'guideUser':false});
   },
    // 获取容器高度
-  getPageheight:function(){
+  getPageheight(){
     let that =this;
     wx.createSelectorQuery().select('#j_page').boundingClientRect(function(rect){
       that.setData({'pageHight':rect.height})
@@ -188,7 +243,7 @@ Page({
   },
   getTenant(res) {
     // 存入全局
-
+    $.store.set('userInfo',res.content);
     return new Promise(async (resolve,reject)=>{
       !$.store.get('openId')&&$.store.set("openId",res.content.openId);
       !$.store.get('userId')&&$.store.set("userId",res.content.id);
@@ -483,7 +538,9 @@ Page({
         formList:false
       },()=>{
         this.getData();
-        this.getWeatherNum();})
+        this.getWeatherNum();
+        this.userAnswer();
+      })
     }
     if($.store.get('changeTenantId')){
       await this.remoteCheck();

+ 2 - 1
pages/index/index.json

@@ -1,7 +1,8 @@
 {
   "usingComponents": {
     "van-swipe-cell": "../../vant-weapp/dist/swipe-cell/index",
-    "van-toast": "../../vant-weapp/dist/toast/index"
+    "van-toast": "../../vant-weapp/dist/toast/index",
+    "questionnaire": "../../components/questionnaire/questionnaire"
   },
   "navigationStyle":"custom",
   "enablePullDownRefresh": true,

+ 24 - 0
pages/index/index.less

@@ -5,6 +5,18 @@ page{
     width: 100%;
     flex-direction: column;
 }
+// .pagecontainer{
+//     position: absolute;
+//     width: 686rpx;
+//     // height: 379rpx;
+//     background: #FFFFFF;
+//     border-radius: 8px;
+//     position: absolute;
+//     top: 50%;
+//     left: 50%;
+//     transform: translate(-50%,-50%);
+//     z-index:999
+// }
 .header-title{
     // padding:0 34rpx;
     padding:0 26rpx;
@@ -400,6 +412,18 @@ page{
     border-radius: 0px 0px 4px 4px;
     border-top:1px solid #F5F6F7;
 }
+.footer_box_active{
+    border-top:1px solid #c7c8c8;
+}
+.footer_box_pop{
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    background: #000000;
+    opacity: 0.2;
+}
 .spacedetail{
     display: flex;
     flex-direction: row;

+ 4 - 2
pages/index/index.wxml

@@ -56,7 +56,7 @@
                             <text class="spacename">{{item.localName}}</text>
                             <view class="spacestate flex_row">
                                 <text>{{item.state}}</text>
-                                <view><lottie id="lottie{{item.id}}" animationData="{{statusList[item.stateId].canvasDate}}" width="25" height="25"/></view>
+                                <view hidden="{{!lottieShow}}"><lottie id="lottie{{item.id}}" animationData="{{statusList[item.stateId].canvasDate}}" width="25" height="25"/></view>
                             </view>
                         </view>
                         <view class="msg_right" catchtap="toDetail" data-istemp="{{true}}" data-spaceid="{{item.id}}" data-projectid="{{item.projectId}}">
@@ -96,7 +96,8 @@
     <view class='placeholder-view' hidden="{{cardList&&cardList.length<=1}}"></view>
 </view>
 
-<cover-view class="footer_box" wx:if="{{logined&&tenants}}">
+<cover-view class="footer_box {{surveyShow?'footer_box_active':''}}" wx:if="{{logined&&tenants}}">
+    <cover-view class="footer_box_pop" wx:if="{{surveyShow}}"></cover-view>
     <cover-view class="spacedetail" wx:for="{{meauList}}" wx:key="{{index}}" bindtap="meauClick" data-index="{{item.id}}">
         <cover-view class="item_img">
             <cover-image src="{{item.imgSrc}}" mode="aspectFill"></cover-image>
@@ -107,3 +108,4 @@
         </cover-view>
     </cover-view>
 </cover-view>
+<questionnaire class="pagecontainer" wx:if="{{surveyShow}}" bind:surveyClose="surveyClose"></questionnaire>

+ 12 - 0
pages/index/index.wxss

@@ -378,6 +378,18 @@ page {
   border-radius: 0px 0px 4px 4px;
   border-top: 1px solid #F5F6F7;
 }
+.footer_box_active {
+  border-top: 1px solid #c7c8c8;
+}
+.footer_box_pop {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  top: 0;
+  left: 0;
+  background: #000000;
+  opacity: 0.2;
+}
 .spacedetail {
   display: flex;
   flex-direction: row;

+ 7 - 1
project.config.json

@@ -16,19 +16,25 @@
     "autoAudits": false,
     "showShadowRootInWxmlPanel": true,
     "scopeDataCheck": false,
+    "uglifyFileName": false,
     "checkInvalidKey": true,
     "checkSiteMap": true,
     "uploadWithSourceMap": true,
-    "useMultiFrameRuntime": false,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": true,
     "useApiHook": true,
+    "useApiHostProcess": false,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
       "outputPath": ""
     },
+    "enableEngineNative": false,
+    "bundle": false,
     "useIsolateContext": true,
     "useCompilerModule": true,
     "userConfirmedUseCompilerModuleSwitch": false,
+    "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": true

+ 16 - 0
requests/api.js

@@ -117,6 +117,18 @@ function contactTenant(data){
 function getTransfrom(data){
   return http.get('/duoduo-service/custom-service/custom/getSeasonBySeasonDate',data,test)
 }
+function queryQuestion(data){
+  return http.post('/server/question/queryQuestion',data,test)
+}
+function queryUseranswer(data){
+  return http.post('/server/question/queryShowQuestion',data,test)
+}
+function submitAnswer(data){
+  return http.post('/server/question/saveUserQuestion',data,test)
+}
+function notShowQuestion(data){
+  return http.post('/server/question/notShowQuestion',data,test)
+}
 module.exports = {
   getopenId, // 获取到openId
   getuserPhone, // 获取用户电话
@@ -150,4 +162,8 @@ module.exports = {
   getCurrentSeason, //获取当前季节类型
   contactTenant, //建立租户关系
   getTransfrom, // 查询冬转夏 夏转东
+  queryQuestion, //查询调查问卷问题和答案
+  queryUseranswer, //查询用户是否要填写问卷
+  submitAnswer,  //提交问卷答案
+  notShowQuestion, //不再展示问卷
 }

+ 1 - 2
requests/http.js

@@ -1,6 +1,6 @@
 import $ from "../utils/Tool.js"
 
-// const test = "http://172.16.36.245:50009";
+// const test = "http://192.168.12.20:50009"; //192.168.12.20 172.16.36.245
 const API_BASE_URL = "https://duoduoenv.sagacloud.cn";
 function get(url, data = {},testenv){
   let _url;
@@ -23,7 +23,6 @@ function get(url, data = {},testenv){
         'content-type': 'application/json'
       },
       success: function success(request) {
-        console.log(request)
         resolve(request.data);
       },
       fail: function fail(error) {

BIN
static/images/bixin.png


BIN
static/images/page-bg.png


BIN
static/images/quesClose.png