浏览代码

入住体验开发

hanchong 1 年之前
父节点
当前提交
e0448e6a2f

+ 90 - 27
pages/sleepEvaluation/sleepEvaluation.js

@@ -21,6 +21,7 @@ Page({
 	  { value: '1', label: '对睡眠帮助较小' },
 	  { value: '2', label: '其他原因(请详细说明)' },
 	],
+	career:'',
 	careerInput:'',
     stayExperOptions: [  
       { value: '0', label: '非常好' },  
@@ -29,14 +30,15 @@ Page({
 	  { value: '3', label: '较差' }, 
 	  { value: '4', label: '非常差' }, 
     ],  
+	stayExper:'',
     comfortOptions: [  
-      { value: 'veryComfortable', label: '非常舒适' },  
-      { value: 'comfortable', label: '舒适' },  
+      { value: '0', label: '非常舒适' },  
+      { value: '1', label: '舒适' },  
       // ... 其他选项  
     ],  
     improvementOptions: [  
-      { value: 'comfort', label: '舒适度' },  
-      { value: 'functionality', label: '功能性' },  
+      { value: '0', label: '舒适度' },  
+      { value: '1', label: '功能性' },  
       // ... 其他选项  
     ], 
 	 //哪些方式来帮助改善睡眠
@@ -80,7 +82,13 @@ Page({
 	  { value: '5', label: '心理问题(如焦虑、抑郁等)' },
 	  { value: '6', label: '其他(请注明)' },
 	],
-    stayExperOptions: '',  
+	improvSleepMethodsOptions: [
+	  { value: '0', label: '听轻音乐' },  
+	  { value: '1', label: '喝热牛奶' },  
+	  { value: '2', label: '进行放松训练(如深呼吸、冥想等)' }, 
+	  { value: '3', label: '使用助眠药物' }, 
+	  { value: '4', label: '其他(请注明)' }, 
+	],
     sleepEnvironmentComfort: '',  
     productComfort: '',  
 	improvementAreas: [], // 使用数组来存储多选答案  
@@ -93,7 +101,13 @@ Page({
 	wayImprovementSleepInput: '',//请填写帮助改善睡眠方式文本
 	getSleepHealth: [],// 从哪里获取关于睡眠健康的信息
 	getSleepHealthInput: '',//您通常从哪里获取关于睡眠健康的信息文本
+	influenceSleep: [],//您认为以下哪些因素会影响您的睡眠
 	influenceSleepInput: '',//您认为以下哪些因素会影响您的睡眠文本
+	improvSleepMethods: [],//您认为以下哪些因素会影响您的睡眠
+	improvSleepMethodsInput: '',//您认为以下哪些因素会影响您的睡眠文本
+	age: '',//您的年龄
+	noSatisfiedInput: '',//让您对本次睡眠房入住体验不满意的原因是文本
+	channel: '',//您是通过什么渠道预定到的本酒店睡眠房?
   },  
   
     // 处理性别选择  
@@ -106,7 +120,7 @@ Page({
     // 处理入住体验的选择  
     bindStayExperOptions: function(e) {  
       this.setData({  
-        stayExperOptions: e.detail.value  
+        stayExper: e.detail.value  
       });  
     },  
     
@@ -127,31 +141,42 @@ Page({
     // 处理改进空间的多选问题  
     bindImprovementAreas: function(e) {  
       this.setData({  
-        improvementAreas: e.detail.value // 直接将选中项的值数组设置为data中的improvementAreas  
+        improvementAreas: e.detail.value   
       });  
     },  
-    
+    bindChannelChange: function(e) {  
+	  this.setData({  
+	    channel: e.detail.value   
+	  });  
+	},
 	// 改善睡眠
 	bindImprovementSleep: function(e) {  
 	  this.setData({  
-	    improvementSleep: e.detail.value // 直接将选中项的值数组设置为data中的improvementAreas  
+	    improvementSleep: e.detail.value   
 	  });  
 	}, 
 	
 	// 改善睡眠
 	bindGetSleepHealth: function(e) {  
 	  this.setData({  
-	    getSleepHealth: e.detail.value // 直接将选中项的值数组设置为data中的improvementAreas  
+	    getSleepHealth: e.detail.value   
 	  });  
 	}, 
 	
 	//您认为以下哪些因素会影响您的睡眠
 	bindInfluenceSleep: function(e) {
 	  this.setData({  
-	    influenceSleep: e.detail.value // 直接将选中项的值数组设置为data中的improvementAreas  
+	    influenceSleep: e.detail.value   
 	  });  
 	}, 
 	
+	//您通常使用什么方法来改善睡眠质量
+	bindImprovSleepMethods: function(e) {
+	  this.setData({  
+	    improvSleepMethods: e.detail.value   
+	  });  
+	},
+	
 	// 体验不满意的原因
 	bindNoSatisfiedChange: function(e) {  
 	  this.setData({  
@@ -159,10 +184,21 @@ Page({
 	  });  
 	},  
 	
+	bindCareerChange: function(e) {  
+	  this.setData({  
+	    career: e.detail.value  
+	  });  
+	},
+	bindAgeChange: function(e) {  
+	  this.setData({  
+	    age: e.detail.value  
+	  });  
+	},
+	
 	// 哪些方面的多选问题
 	bindSatisfied: function(e) {  
 	  this.setData({
-	    satisfied: e.detail.value // 直接将选中项的值数组设置为data中的improvementAreas  
+	    satisfied: e.detail.value   
 	  });  
 	},
 	
@@ -172,29 +208,36 @@ Page({
 	    wayImprovementSleep: e.detail.value  
 	  });  
 	},  
-	
-	
-    // 处理文本输入的建议  
+	bindNoSatisfiedInput: function(e) {  
+      this.setData({  
+        noSatisfiedInput: e.detail.value  
+      });  
+    }, 
     bindCareerInputInput: function(e) {  
       this.setData({  
         careerInput: e.detail.value  
       });  
     },  
 	
-	// 处理文本输入的建议
 	bindGetSleepHealthInput: function(e) {  
 	  this.setData({  
 	    getSleepHealthInput: e.detail.value  
 	  });  
 	},  
 	
-	// 处理文本输入的建议
+	
 	bindInfluenceSleepInput: function(e) {  
 	  this.setData({  
 	    influenceSleepInput: e.detail.value  
 	  });  
 	}, 
 	
+	bindImprovSleepMethodsInput: function(e) {  
+	  this.setData({  
+	    improvSleepMethodsInput: e.detail.value  
+	  });  
+	}, 
+	
 	// 方式来帮助改善睡眠文本输入
 	bindWayImprovementSleepInput: function(e) {  
 	  this.setData({  
@@ -218,21 +261,28 @@ Page({
     submitSurvey: function() {  
       let surveyData = {  
         gender: this.data.gender,  
-        stayExperOptions: this.data.stayExperOptions,  
+        stayExper: this.data.stayExper,  
         sleepEnvironmentComfort: this.data.sleepEnvironmentComfort,  
         productComfort: this.data.productComfort,  
         improvementAreas: this.data.improvementAreas, 
 		satisfied: this.data.satisfied, 
         suggestion: this.data.suggestion,  
+		career: this.data.career,
 		careerInput: this.data.careerInput, 
 		thirdPlatformsInput: this.data.thirdPlatformsInput, 
 		noSatisfied: this.data.noSatisfied,
+		noSatisfiedInput: this.data.noSatisfiedInput,
 		improvementSleep: this.data.improvementSleep,
 		wayImprovementSleep: this.data.wayImprovementSleep,
 		wayImprovementSleepInput: this.data.wayImprovementSleepInput,
 		getSleepHealth: this.data.getSleepHealth,
+		bindGetSleepHealthInput: this.data.bindGetSleepHealthInput,
+		influenceSleep: this.data.influenceSleep,
 		influenceSleepInput: this.data.influenceSleepInput,
-		
+		improvSleepMethods: this.data.improvSleepMethods,
+		improvSleepMethodsInput: this.data.improvSleepMethodsInput,
+		age: this.data.age,
+		channel: this.data.channel,
       };  
     
       // 将surveyData发送到服务器  
@@ -273,14 +323,27 @@ Page({
     
 	  // 清空表单:  
       // this.setData({  
-      //   gender: '',  
-      //   stayExperOptions: '',  
-	  //   sleepEnvironmentComfort: '', 
-	  //   productComfort: '', 
-	  //   improvementAreas: [],   
-	  //   satisfied: [],   
-	  //   suggestion: '',   
-      //   // ... 重置其他数据  
+		  // gender: '', 
+		  // careerInput:'',
+		  // stayExper:'',
+		  // sleepEnvironmentComfort: '',  
+		  // productComfort: '',  
+		  // improvementAreas: [], // 使用数组来存储多选答案  
+		  // ImprovementSleep: [],//哪些方式来帮助改善睡眠
+		  // satisfied: [],// 哪些方面让您比较满意
+		  // suggestion: '', // 文本输入的建议
+		  // thirdPlatformsInput: '',//填写第三方平台
+		  // noSatisfied: '',//体验不满意的原因
+		  // wayImprovementSleep: '',//哪些方式来帮助改善睡眠
+		  // wayImprovementSleepInput: '',//请填写帮助改善睡眠方式文本
+		  // getSleepHealth: [],// 从哪里获取关于睡眠健康的信息
+		  // getSleepHealthInput: '',//您通常从哪里获取关于睡眠健康的信息文本
+		  // influenceSleep: [],//您认为以下哪些因素会影响您的睡眠
+		  // influenceSleepInput: '',//您认为以下哪些因素会影响您的睡眠文本
+		  // improvSleepMethods: [],//您认为以下哪些因素会影响您的睡眠
+		  // improvSleepMethodsInput: '',//您认为以下哪些因素会影响您的睡眠文本
+		  // age: '',//您的年龄
+		  // noSatisfiedInput: '',//让您对本次睡眠房入住体验不满意的原因文本
       // });  
     },  
     

+ 22 - 40
pages/sleepEvaluation/sleepEvaluation.wxml

@@ -2,13 +2,13 @@
   <!-- 基本信息 -->  
   <view class='title'>服务满意度调查问卷</view>
   <view class="section">
-    <text>指导语:</text>  
+    <text style="font-weight:600">指导语:</text>  
     <text>您好!非常感谢您在百忙之中填写这份问卷。为了更好地了解您的入住体验,并根据您的建议进行持续完善。我们特此开展此次调查。请您根据自己的实际情况如实回答,所有数据将严格保密,仅用于研究分析。本问卷大约需要5-10分钟时间,请您耐心完成。您的意见对于我们而言至关重要。</text> 
   </view> 
   <view class='title_1'>一、基本信息</view>
   <view class="section">
     <text>1.您的年龄:</text>  
-    <radio-group bindchange="bindGenderChange">
+    <radio-group bindchange="bindAgeChange">
       <block wx:for="{{ageOptions}}" wx:key="index">  
         <label><radio value="{{item.value}}">{{item.label}}</radio></label>  
       </block>  
@@ -16,7 +16,7 @@
   </view>
   <view class="section">
     <text>2.您的职业:</text>  
-    <radio-group bindchange="bindGenderChange">
+    <radio-group bindchange="bindCareerChange">
       <block wx:for="{{careerOptions}}" wx:key="index">  
         <label wx:if="{{index<5}}"><radio value="{{item.value}}">{{item.label}}</radio></label>
 		<label wx:else><radio value="{{item.value}}">{{item.label}}</radio>
@@ -25,7 +25,7 @@
       </block>  
     </radio-group> 
   </view>
-  <view class="section">  
+  <view class="section_age">  
     <text>3.您的性别:</text>  
     <radio-group bindchange="bindGenderChange">  
       <label><radio value="0">男</radio></label>  
@@ -35,8 +35,8 @@
   </view> 
    
    <view class="section">
-     <text>3.您是通过什么渠道预定到的本酒店睡眠房?</text>  
-     <radio-group bindchange="bindGenderChange">  
+     <text>4、您是通过什么渠道预定到的本酒店睡眠房?</text>  
+     <radio-group bindchange="bindChannelChange">  
        <label><radio value="0">酒店散客</radio></label>  
        <label><radio value="1">第三方平台(如携程、去哪儿网、飞猪、同程等)</radio>
 		<input type="text" placeholder="请填写第三方平台" bindinput="bindThirdPlatformsInputInput" />
@@ -76,7 +76,6 @@
     </radio-group> 
   </view>
   
-  <!-- 多选问题示例 -->
   <view class="section">  
     <text>8、您通常采取什么措施来改善睡眠?(多选)</text>  
     <checkbox-group bindchange="bindImprovementSleep">  
@@ -104,7 +103,7 @@
     <checkbox-group bindchange="bindGetSleepHealth">  
       <block wx:for="{{getSleepHealthOptions}}" wx:key="index">  
         <label wx:if="{{index<5}}"><checkbox value="{{item.value}}">{{item.label}}</checkbox></label> 
-		 <label wx:else><radio value="{{item.value}}">{{item.label}}</radio>
+		 <label wx:else><checkbox value="{{item.value}}">{{item.label}}</checkbox>
 		 	<input type="text" placeholder="请填写从哪里获取关于睡眠健康的信息" bindinput="bindGetSleepHealthInput" />
 		 </label>
       </block>  
@@ -114,47 +113,30 @@
   <view class="section">
     <text>11、您认为以下哪些因素会影响您的睡眠?(多选)</text>  
     <checkbox-group bindchange="bindInfluenceSleep">  
-      <block wx:for="{{influenceSleep}}" wx:key="index">  
+      <block wx:for="{{influenceSleepOptions}}" wx:key="index">  
         <label wx:if="{{index<6}}"><checkbox value="{{item.value}}">{{item.label}}</checkbox></label> 
-  		 <label wx:else><radio value="{{item.value}}">{{item.label}}</radio>
+  		 <label wx:else><checkbox value="{{item.value}}">{{item.label}}</checkbox>
   		 	<input type="text" placeholder="请填写影响您的睡眠因素" bindinput="bindInfluenceSleepInput" />
   		 </label>
       </block>  
     </checkbox-group>  
   </view>  
-  
-  <view class="section">  
-    <text>您对睡眠环境的温度、湿度感觉如何?</text>  
-    <radio-group bindchange="bindSleepEnvironmentComfort">  
-      <block wx:for="{{comfortOptions}}" wx:key="index">  
-        <label><radio value="{{item.value}}">{{item.label}}</radio></label>  
-      </block>  
-    </radio-group>  
-  </view>  
-  
-  <!-- 睡眠产品/服务评价 -->  
-  <view class="section">  
-    <text>如果您使用了我们的睡眠产品(如床垫、枕头等),请对其舒适度进行评价:</text>  
-    <radio-group bindchange="bindProductComfort">  
-      <block wx:for="{{comfortOptions}}" wx:key="index">  
-        <label><radio value="{{item.value}}">{{item.label}}</radio></label>  
-      </block>  
-    </radio-group>  
-  </view>  
-  
-  <!-- 多选问题示例 -->  
-  <view class="section">  
-    <text>您认为我们的睡眠产品/服务在哪些方面还有改进空间?(可多选)</text>  
-    <checkbox-group bindchange="bindImprovementAreas">  
-      <block wx:for="{{improvementOptions}}" wx:key="index">  
-        <label><checkbox value="{{item.value}}">{{item.label}}</checkbox></label>  
+	
+  <view class="section">
+    <text>12、您通常使用什么方法来改善睡眠质量?(多选)</text>  
+    <checkbox-group bindchange="bindImprovSleepMethods">  
+      <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" />
+  		 </label>
       </block>  
     </checkbox-group>  
-  </view>  
-  
+  </view> 	
+  <view class='title_1'>四、其他意见和建议</view>
   <!-- 文本输入问题示例 -->  
   <view class="section">  
-    <text>您有什么具体的建议或意见,希望我们未来能够改进或增加哪些服务/产品?</text>  
+    <text>13. 关于本次睡眠房的入住体验,您最希望哪些方面可以进行改善优化</text>  
     <input type="text" placeholder="请填写您的建议" bindinput="bindSuggestionInput" />  
   </view>  
   
@@ -162,7 +144,7 @@
   <button bindtap="submitSurvey">提交问卷</button>  
   
   <view class="section">
-    <text>感谢您的参与和支持!</text>  
+    <text style="font-weight:600">感谢您的参与和支持!</text>  
     <text>通过这份问卷,我们可以更好地了解受访者的睡眠状况及其影响因素,从而为他们提供更有效的改善建议。希望您能如实填写,以便我们为您提供更好的服务。</text> 
   </view> 
   

+ 8 - 3
pages/sleepEvaluation/sleepEvaluation.wxss

@@ -3,13 +3,18 @@
 /* 通用样式 */  
 .container {  
   width: 100%;  
-  padding: 20px;
+  padding: 20rpx;
   text-align: left; 
 }  
 
 .section {  
-  margin-bottom: 15px;  
-  margin-top: 25px;  
+  margin-bottom: 15rpx;  
+  margin-top: 25rpx;  
+}
+.section_age {  
+  margin-bottom: 15rpx;  
+  margin-top: 25rpx; 
+  margin-right:355rpx;
 }
 
 .title {