hanchong 1 rok pred
rodič
commit
3e3cfedf31

+ 60 - 1
pages/sleepEvaluation/sleepEvaluation.js

@@ -108,6 +108,8 @@ Page({
 	age: '',//您的年龄
 	noSatisfiedInput: '',//让您对本次睡眠房入住体验不满意的原因是文本
 	channel: '',//您是通过什么渠道预定到的本酒店睡眠房?
+	hotel: '',//酒店
+	room: '',//房间
   },  
   
     // 处理性别选择  
@@ -258,7 +260,12 @@ Page({
 	  }); 
     },
     // 提交问卷的函数  
-    submitSurvey: function() {  
+    submitSurvey: function() {
+	  let hotelcodeTemp = '';
+	  let roomcodeTemp = '';
+	  const res = wx.getStorageSync('res')
+	  hotelcodeTemp = res && res.result.split('|')[0];
+	  roomcodeTemp = res.result.split('|')[1];
       let surveyData = {  
         gender: this.data.gender,  
         stayExper: this.data.stayExper,  
@@ -344,7 +351,59 @@ Page({
 		  // improvSleepMethodsInput: '',//您认为以下哪些因素会影响您的睡眠文本
 		  // age: '',//您的年龄
 		  // noSatisfiedInput: '',//让您对本次睡眠房入住体验不满意的原因文本
+		  // channel: '',
       // });  
     },  
+    onLoad(option){
+    	var that = this;
+    	console.log("sleepEvaluation页面");
+      // wx.clearStorage();
+      console.log('option.res='+JSON.stringify(wx.getStorageSync('res')));
+      if(!wx.getStorageSync('res') || !wx.getStorageSync('res').result){
+    	  wx.showModal({
+    	    title: '提示',
+    	    content: '请先扫描房间二维码',
+    	    showCancel: false
+    	  });
     
+    	  setTimeout(function() {
+    	      wx.reLaunch({
+    	      		url: '/pages/scan/scan',
+    	      })
+    	    }, 2000) // 设置延时时间,单位为毫秒
+      }else if(wx.getStorageSync('res').result.split('|').length != 2){
+    	  wx.showModal({
+    	    title: '提示',
+    	    content: '房间二维码不正确,请重新扫码',
+    	    showCancel: false
+    	  });
+    	  
+    	  setTimeout(function() {
+    	      wx.reLaunch({
+    	      		url: '/pages/scan/scan',
+    	      })
+    	    }, 2000) // 设置延时时间,单位为毫秒
+      }else{
+    	  let hotelTemp = '';
+    	  let roomTemp = '';
+    	  
+    	  hotelTemp = wx.getStorageSync('res').result.split('|')[0];
+    	  roomTemp = wx.getStorageSync('res').result.split('|')[1];
+		  this.setData({
+		    hotel: hotelTemp,
+		    room: roomTemp,
+		  }); 
+		}
+    },
+	/**
+	 * 生命周期函数--监听页面隐藏
+	 */
+	onHide: function() {
+	},
+	/**
+	 * 生命周期函数--监听页面卸载
+	 */
+	onUnload: function() {
+		
+	},
 });

+ 10 - 10
pages/sleepEvaluation/sleepEvaluation.wxml

@@ -38,10 +38,10 @@
      <text>4、您是通过什么渠道预定到的本酒店睡眠房?</text>  
      <radio-group bindchange="bindChannelChange">  
        <label><radio value="0">酒店散客</radio></label>  
-       <label><radio value="1">第三方平台(如携程、去哪儿网、飞猪、同程等)</radio>
-		<input type="text" placeholder="请填写第三方平台" bindinput="bindThirdPlatformsInputInput" />
+	   <label><radio value="1">朋友推荐</radio></label>
+       <label><radio value="2">第三方平台(如携程、去哪儿网、飞猪、同程等)</radio>
+		<input class="custom-input" type="text" placeholder="请填写第三方平台" bindinput="bindThirdPlatformsInputInput" />
 	   </label> 
-   	  <label><radio value="2">朋友推荐</radio></label>
      </radio-group>
    </view>
   <view class='title_1'>二、用户体验</view>
@@ -70,7 +70,7 @@
       <block wx:for="{{noSatisfiedOptions}}" wx:key="index">  
         <label wx:if="{{index<2}}"><radio value="{{item.value}}">{{item.label}}</radio></label>
   		<label wx:else><radio value="{{item.value}}">{{item.label}}</radio>
-  			<input type="text" placeholder="请填写体验不满意的原因" bindinput="bindNoSatisfiedInput" />
+  			<input class="custom-input" type="text" placeholder="请填写体验不满意的原因" bindinput="bindNoSatisfiedInput" />
   		</label>
       </block>  
     </radio-group> 
@@ -91,7 +91,7 @@
       <block wx:for="{{wayImprovementSleepOptions}}" wx:key="index">  
         <label wx:if="{{index<4}}"><radio value="{{item.value}}">{{item.label}}</radio></label>
   		<label wx:else><radio value="{{item.value}}">{{item.label}}</radio>
-  			<input type="text" placeholder="请填写帮助改善睡眠方式" bindinput="bindWayImprovementSleepInput" />
+  			<input class="custom-input" type="text" placeholder="请填写帮助改善睡眠方式" bindinput="bindWayImprovementSleepInput" />
   		</label>
       </block>  
     </radio-group> 
@@ -104,7 +104,7 @@
       <block wx:for="{{getSleepHealthOptions}}" wx:key="index">  
         <label wx:if="{{index<5}}"><checkbox value="{{item.value}}">{{item.label}}</checkbox></label> 
 		 <label wx:else><checkbox value="{{item.value}}">{{item.label}}</checkbox>
-		 	<input type="text" placeholder="请填写从哪里获取关于睡眠健康的信息" bindinput="bindGetSleepHealthInput" />
+		 	<input class="custom-input" type="text" placeholder="请填写从哪里获取关于睡眠健康的信息" bindinput="bindGetSleepHealthInput" />
 		 </label>
       </block>  
     </checkbox-group>  
@@ -116,7 +116,7 @@
       <block wx:for="{{influenceSleepOptions}}" wx:key="index">  
         <label wx:if="{{index<6}}"><checkbox value="{{item.value}}">{{item.label}}</checkbox></label> 
   		 <label wx:else><checkbox value="{{item.value}}">{{item.label}}</checkbox>
-  		 	<input type="text" placeholder="请填写影响您的睡眠因素" bindinput="bindInfluenceSleepInput" />
+  		 	<input class="custom-input" type="text" placeholder="请填写影响您的睡眠因素" bindinput="bindInfluenceSleepInput" />
   		 </label>
       </block>  
     </checkbox-group>  
@@ -128,7 +128,7 @@
       <block wx:for="{{improvSleepMethodsOptions}}" wx:key="index">  
         <label wx:if="{{index<4}}"><checkbox value="{{item.value}}">{{item.label}}</checkbox></label> 
   		 <label wx:else><checkbox value="{{item.value}}">{{item.label}}</checkbox>
-  		 	<input type="text" placeholder="请填写改善睡眠质量方法" bindinput="bindImprovSleepMethodsInput" />
+  		 	<input class="custom-input" type="text" placeholder="请填写改善睡眠质量方法" bindinput="bindImprovSleepMethodsInput" />
   		 </label>
       </block>  
     </checkbox-group>  
@@ -137,11 +137,11 @@
   <!-- 文本输入问题示例 -->  
   <view class="section">  
     <text>13. 关于本次睡眠房的入住体验,您最希望哪些方面可以进行改善优化</text>  
-    <input type="text" placeholder="请填写您的建议" bindinput="bindSuggestionInput" />  
+    <textarea class="full-width-textarea" type="text" placeholder="请填写您的建议" bindinput="bindSuggestionInput" />  
   </view>  
   
   <!-- 提交按钮 -->  
-  <button bindtap="submitSurvey">提交问卷</button>  
+  <button style="margin-top:30rpx;" bindtap="submitSurvey">提交问卷</button>  
   
   <view class="section">
     <text style="font-weight:600">感谢您的参与和支持!</text>  

+ 16 - 1
pages/sleepEvaluation/sleepEvaluation.wxss

@@ -100,4 +100,19 @@
   margin-bottom: 10px;  
 }  
   
-/* 根据需要为其他元素添加样式 */
+.full-width-textarea {  
+  width: 100%; /* 使textarea宽度占满其父容器的宽度 */  
+  border: 1px solid rgba(0, 0, 0, 0.1);   
+  border-radius: 2px; /* 可选:添加轻微的边框圆角 */  
+  padding: 10px; /* 可选:添加内边距,让文本不紧贴边框 */  
+  box-sizing: border-box; /* 确保padding不会增加textarea的总宽度 */  
+}
+
+.custom-input {  
+  width: 100%; /* 使input宽度占满其父容器的宽度 */  
+  border: none; /* 移除默认的边框 */  
+  border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* 只设置底部边框为半透明细线 */  
+  padding: 10px 0; /* 只在垂直方向上添加内边距,避免底部边框被内边距遮挡 */  
+  background-color: transparent; /* 移除背景色 */  
+  box-shadow: none; /* 移除可能的阴影效果(如果默认有的话) */  
+}