sleepEvaluation.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. const baseUrl = "https://fare.somnisix.top/";
  2. const authorization = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijk5YzI3MjI2LTdkOWQtNDhiOC1hYjlhLWM4YjVjYWZiZGNkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.zITQOINFkHs19_1RAgHS4I9YMaVxVq0Dsn3t6r_K7rv3rXvJy0sMtodejIMi_PNa_m4uQYxnU-6k3wC2LZht_Q";
  3. const api = "system/sleepEvaluation";
  4. Page({
  5. data: {
  6. activeIcon: "/subpages/icons/ic_selected_radio.svg",
  7. normalIcon: "/subpages/icons/ic_radio.svg",
  8. activeColor: "color:#0BC3AA;",
  9. normalColor: "color:#666666;",
  10. ageOptions: [
  11. { value: '0', label: '20岁以下' },
  12. { value: '1', label: '20-29岁' },
  13. { value: '2', label: '30-39岁' },
  14. { value: '3', label: '40-49岁' },
  15. { value: '4', label: '50岁以上' },
  16. ],
  17. careerOptions: [
  18. { value: '0', label: '学生' },
  19. { value: '1', label: '上班族' },
  20. { value: '2', label: '自由职业者' },
  21. { value: '3', label: '企业经营者' },
  22. { value: '4', label: '政府、事业等单位人员' },
  23. { value: '5', label: '其他(请注明)' },
  24. ],
  25. noSatisfiedOptions: [
  26. { value: '0', label: '设备操作有困难' },
  27. { value: '1', label: '对睡眠帮助较小' },
  28. { value: '2', label: '都满意' },
  29. { value: '3', label: '其他原因(请详细说明)' },
  30. ],
  31. career: '',
  32. careerInput: '',
  33. stayExperOptions: [
  34. { value: '0', label: '非常好' },
  35. { value: '1', label: '较好' },
  36. { value: '2', label: '一般' },
  37. { value: '3', label: '较差' },
  38. { value: '4', label: '非常差' },
  39. ],
  40. stayExper: '',
  41. comfortOptions: [
  42. { value: '0', label: '非常舒适' },
  43. { value: '1', label: '舒适' },
  44. // ... 其他选项
  45. ],
  46. improvementOptions: [
  47. { value: '0', label: '舒适度' },
  48. { value: '1', label: '功能性' },
  49. // ... 其他选项
  50. ],
  51. //哪些方式来帮助改善睡眠
  52. improvementSleepOptions: [
  53. { value: '0', label: '调整作息时间' },
  54. { value: '1', label: '锻炼' },
  55. { value: '2', label: '使用助眠产品(如香薰、耳塞、眼罩等)' },
  56. { value: '3', label: '冥想或深呼吸' },
  57. { value: '4', label: '寻求医疗帮助' },
  58. { value: '5', label: '不采取措施' },
  59. ],
  60. //哪些方面让您比较满意
  61. satisfiedOptions: [
  62. { value: '0', label: '便捷的设备操作' },
  63. { value: '1', label: '适宜的睡眠环境' },
  64. { value: '2', label: '人性化的睡眠监测' },
  65. { value: '3', label: '体贴的睡眠辅助设施(如助眠视频、音乐等)' },
  66. ],
  67. wayImprovementSleepOptions: [
  68. { value: '0', label: '监测睡眠质量和提供反馈' },
  69. { value: '1', label: '自动调整睡眠环境(如温度、光线)' },
  70. { value: '2', label: '提供个性化的睡眠建议' },
  71. { value: '3', label: '远程医疗咨询或诊断' },
  72. { value: '4', label: '其他[请在此区域内作答]' },
  73. ],
  74. getSleepHealthOptions: [
  75. { value: '0', label: '互联网' },
  76. { value: '1', label: '社交媒体' },
  77. { value: '2', label: '书籍或杂志' },
  78. { value: '3', label: '医疗专业人士' },
  79. { value: '4', label: '朋友或家人' },
  80. { value: '5', label: '其他[请在此区域内作答]' },
  81. ],
  82. influenceSleepOptions: [
  83. { value: '0', label: '工作压力' },
  84. { value: '1', label: '生活压力' },
  85. { value: '2', label: '环境噪音' },
  86. { value: '3', label: '光线过亮' },
  87. { value: '4', label: '身体不适(如疼痛、消化不良等)' },
  88. { value: '5', label: '心理问题(如焦虑、抑郁等)' },
  89. { value: '6', label: '其他(请注明)' },
  90. ],
  91. improvSleepMethodsOptions: [
  92. { value: '0', label: '听轻音乐' },
  93. { value: '1', label: '喝热牛奶' },
  94. { value: '2', label: '进行放松训练(如深呼吸、冥想等)' },
  95. { value: '3', label: '使用助眠药物' },
  96. { value: '4', label: '其他(请注明)' },
  97. ],
  98. gender: '',
  99. sleepEnvironmentComfort: '',
  100. productComfort: '',
  101. improvementAreas: [], // 使用数组来存储多选答案
  102. ImprovementSleep: [],//哪些方式来帮助改善睡眠
  103. improvementSleep: [],
  104. satisfied: [],// 哪些方面让您比较满意
  105. suggestion: '', // 文本输入的建议
  106. thirdPlatformsInput: '',//填写第三方平台
  107. noSatisfied: [],//体验不满意的原因
  108. wayImprovementSleep: [],//哪些方式来帮助改善睡眠
  109. wayImprovementSleepInput: '',//请填写帮助改善睡眠方式文本
  110. getSleepHealth: [],// 从哪里获取关于睡眠健康的信息
  111. getSleepHealthInput: '',//您通常从哪里获取关于睡眠健康的信息文本
  112. influenceSleep: [],//您认为以下哪些因素会影响您的睡眠
  113. influenceSleepInput: '',//您认为以下哪些因素会影响您的睡眠文本
  114. improvSleepMethods: [],//您认为以下哪些因素会影响您的睡眠
  115. improvSleepMethodsInput: '',//您认为以下哪些因素会影响您的睡眠文本
  116. age: '',//您的年龄
  117. noSatisfiedInput: '',//让您对本次睡眠房入住体验不满意的原因是文本
  118. channel: '',//您是通过什么渠道预定到的本酒店睡眠房?
  119. hotel: '',//酒店
  120. room: '',//房间
  121. mInputId: ''//自动滚动用的
  122. },
  123. // 处理性别选择
  124. bindGenderChange: function (e) {
  125. this.setData({
  126. gender: e.detail
  127. });
  128. },
  129. // 处理入住体验的选择
  130. bindStayExperOptions: function (e) {
  131. this.setData({
  132. stayExper: e.detail
  133. });
  134. },
  135. // 处理睡眠环境舒适度(温度、湿度)的选择
  136. bindSleepEnvironmentComfort: function (e) {
  137. this.setData({
  138. sleepEnvironmentComfort: e.detail.value
  139. });
  140. },
  141. // 处理睡眠产品舒适度的选择
  142. bindProductComfort: function (e) {
  143. this.setData({
  144. productComfort: e.detail.value
  145. });
  146. },
  147. // 处理改进空间的多选问题
  148. bindImprovementAreas: function (e) {
  149. this.setData({
  150. improvementAreas: e.detail.value
  151. });
  152. },
  153. bindChannelChange: function (e) {
  154. this.setData({
  155. channel: e.detail
  156. });
  157. },
  158. // 改善睡眠
  159. bindImprovementSleep: function (e) {
  160. this.setData({
  161. improvementSleep: e.detail
  162. });
  163. },
  164. // 改善睡眠
  165. bindGetSleepHealth: function (e) {
  166. this.setData({
  167. getSleepHealth: e.detail
  168. });
  169. },
  170. //您认为以下哪些因素会影响您的睡眠
  171. bindInfluenceSleep: function (e) {
  172. this.setData({
  173. influenceSleep: e.detail
  174. });
  175. },
  176. //您通常使用什么方法来改善睡眠质量
  177. bindImprovSleepMethods: function (e) {
  178. this.setData({
  179. improvSleepMethods: e.detail
  180. });
  181. },
  182. // 体验不满意的原因
  183. bindNoSatisfiedChange: function (e) {
  184. this.setData({
  185. noSatisfied: e.detail
  186. });
  187. },
  188. bindCareerChange: function (e) {
  189. this.setData({
  190. career: e.detail
  191. });
  192. },
  193. bindAgeChange: function (e) {
  194. this.setData({
  195. age: e.detail
  196. });
  197. },
  198. // 哪些方面的多选问题
  199. bindSatisfied: function (e) {
  200. console.log(e)
  201. this.setData({
  202. satisfied: e.detail
  203. });
  204. },
  205. // 哪些方式来帮助改善睡眠
  206. bindWayImprovementSleep: function (e) {
  207. this.setData({
  208. wayImprovementSleep: e.detail
  209. });
  210. },
  211. bindNoSatisfiedInput: function (e) {
  212. this.setData({
  213. noSatisfiedInput: e.detail.value
  214. });
  215. },
  216. bindCareerInputInput: function (e) {
  217. this.setData({
  218. careerInput: e.detail.value
  219. });
  220. },
  221. bindGetSleepHealthInput: function (e) {
  222. this.setData({
  223. getSleepHealthInput: e.detail.value
  224. });
  225. },
  226. bindInfluenceSleepInput: function (e) {
  227. this.setData({
  228. influenceSleepInput: e.detail.value
  229. });
  230. },
  231. bindImprovSleepMethodsInput: function (e) {
  232. this.setData({
  233. improvSleepMethodsInput: e.detail.value
  234. });
  235. },
  236. // 方式来帮助改善睡眠文本输入
  237. bindWayImprovementSleepInput: function (e) {
  238. this.setData({
  239. wayImprovementSleepInput: e.detail.value
  240. });
  241. },
  242. bindThirdPlatformsInputInput: function (e) {
  243. this.setData({
  244. thirdPlatformsInput: e.detail.value
  245. });
  246. },
  247. // 职业填写
  248. bindSuggestionInput: function (e) {
  249. this.setData({
  250. suggestion: e.detail.value
  251. });
  252. },
  253. checkBoxInputValue(e) {
  254. var valueList = e.currentTarget.dataset.list || [];
  255. var value = e.currentTarget.dataset.name;
  256. var type = e.currentTarget.dataset.type;
  257. const that = this;
  258. setTimeout(() => {
  259. if (type == "wayImprovementSleep") {
  260. var tempList = that.data.wayImprovementSleep
  261. if (!tempList || (Array.isArray(tempList) && (!tempList.length || !tempList.includes(value)))) {
  262. valueList[valueList.length ] = value
  263. that.setData({
  264. wayImprovementSleep: valueList
  265. })
  266. }
  267. } else if (type == "getSleepHealth") {
  268. var tempList = that.data.getSleepHealth
  269. if (!tempList || (Array.isArray(tempList) && (!tempList.length || !tempList.includes(value)))) {
  270. valueList[valueList.length] = value
  271. that.setData({
  272. getSleepHealth: valueList
  273. })
  274. }
  275. } else if (type == "influenceSleep") {
  276. var tempList = that.data.influenceSleep
  277. if (!tempList || (Array.isArray(tempList) && (!tempList.length || !tempList.includes(value)))) {
  278. valueList[valueList.length] = value
  279. that.setData({
  280. influenceSleep: valueList
  281. })
  282. }
  283. } else if (type == "improvSleepMethods") {
  284. var tempList = that.data.improvSleepMethods
  285. if (!tempList || (Array.isArray(tempList) && (!tempList.length || !tempList.includes(value)))) {
  286. valueList[valueList.length] = value
  287. that.setData({
  288. improvSleepMethods: valueList
  289. })
  290. }
  291. }
  292. }, 150);
  293. // careerInput: this.data.careerInput,
  294. // thirdPlatformsInput: this.data.thirdPlatformsInput,
  295. // noSatisfied: this.data.noSatisfied,
  296. // noSatisfiedInput: this.data.noSatisfiedInput,
  297. // wayImprovementSleep: this.data.wayImprovementSleep,
  298. // wayImprovementSleepInput: this.data.wayImprovementSleepInput,
  299. // getSleepHealth: this.data.getSleepHealth,
  300. // getSleepHealthInput: this.data.getSleepHealthInput,
  301. // influenceSleep: this.data.influenceSleep,
  302. // influenceSleepInput: this.data.influenceSleepInput,
  303. // improvSleepMethods: this.data.improvSleepMethods,
  304. // improvSleepMethodsInput: this.data.improvSleepMethodsInput,
  305. },
  306. // 提交问卷的函数
  307. submitSurvey: function () {
  308. let surveyData = {
  309. hotel: this.data.hotel,
  310. room: this.data.room,
  311. gender: this.data.gender,
  312. stayExper: this.data.stayExper,
  313. sleepEnvironmentComfort: this.data.sleepEnvironmentComfort,
  314. productComfort: this.data.productComfort,
  315. improvementAreas: this.data.improvementAreas,
  316. satisfied: this.data.satisfied,
  317. suggestion: this.data.suggestion,
  318. career: this.data.career,
  319. careerInput: this.data.careerInput,//1
  320. thirdPlatformsInput: this.data.thirdPlatformsInput,//2
  321. noSatisfied: this.data.noSatisfied,
  322. noSatisfiedInput: this.data.noSatisfiedInput,//3
  323. improvementSleep: this.data.improvementSleep,
  324. wayImprovementSleep: this.data.wayImprovementSleep,
  325. wayImprovementSleepInput: this.data.wayImprovementSleepInput,//4
  326. getSleepHealth: this.data.getSleepHealth,
  327. getSleepHealthInput: this.data.getSleepHealthInput,//5
  328. influenceSleep: this.data.influenceSleep,
  329. influenceSleepInput: this.data.influenceSleepInput,//6
  330. improvSleepMethods: this.data.improvSleepMethods,
  331. improvSleepMethodsInput: this.data.improvSleepMethodsInput,//7
  332. age: this.data.age,
  333. channel: this.data.channel,
  334. };
  335. let checkList = {
  336. age: this.data.age,
  337. career: this.data.career,
  338. gender: this.data.gender,
  339. channel: this.data.channel,
  340. stayExper: this.data.stayExper,
  341. satisfied: this.data.satisfied,
  342. noSatisfied: this.data.noSatisfied,
  343. improvementSleep: this.data.improvementSleep,
  344. wayImprovementSleep: this.data.wayImprovementSleep,
  345. getSleepHealth: this.data.getSleepHealth,
  346. influenceSleep: this.data.influenceSleep,
  347. improvSleepMethods: this.data.improvSleepMethods,
  348. suggestion: this.data.suggestion,
  349. // sleepEnvironmentComfort: this.data.sleepEnvironmentComfort,
  350. // productComfort: this.data.productComfort,
  351. // improvementAreas: this.data.improvementAreas,
  352. // thirdPlatformsInput: this.data.thirdPlatformsInput,
  353. }
  354. let checkInputList = [
  355. {
  356. name:"career",
  357. type: "radio",
  358. checkList: this.data.career,
  359. checkValue: "5",
  360. checkInput: this.data.careerInput
  361. }, {
  362. name: "channel",
  363. type: "radio",
  364. checkList: this.data.channel,
  365. checkValue: "2",
  366. checkInput: this.data.thirdPlatformsInput
  367. }, {
  368. name: "noSatisfied",
  369. type: "radio",
  370. checkList: this.data.noSatisfied,
  371. checkValue: "3",
  372. checkInput: this.data.noSatisfiedInput
  373. }, {
  374. name: "wayImprovementSleep",
  375. type: "checkbox",
  376. checkList: this.data.wayImprovementSleep,
  377. checkValue: "4",
  378. checkInput: this.data.wayImprovementSleepInput
  379. }, {
  380. name: "getSleepHealth",
  381. type: "checkbox",
  382. checkList: this.data.getSleepHealth,
  383. checkValue: "5",
  384. checkInput: this.data.getSleepHealthInput
  385. }, {
  386. name: "influenceSleep",
  387. type: "checkbox",
  388. checkList: this.data.influenceSleep,
  389. checkValue: "6",
  390. checkInput: this.data.influenceSleepInput
  391. }, {
  392. name: "improvSleepMethods",
  393. type: "checkbox",
  394. checkList: this.data.improvSleepMethods,
  395. checkValue: "4",
  396. checkInput: this.data.improvSleepMethodsInput
  397. }
  398. ]
  399. var isFinish = true;
  400. var emptyKey = "";
  401. const that = this;
  402. for (const key in checkList) {
  403. if (checkList.hasOwnProperty(key)) {
  404. const element = checkList[key];
  405. if (!element || (Array.isArray(element) && element.length <= 0)) { // 检查属性值是否为空
  406. // 这里可以添加更复杂的判断,比如仅针对字符串检查是否为空字符串
  407. // if (typeof obj[key] === 'string' && obj[key].trim() === '') {
  408. isFinish = false;
  409. emptyKey = key;
  410. wx.showModal({
  411. title: '无法提交',
  412. content: '您还有部分题目未完成,请检查后重新提交',
  413. showCancel: false,
  414. confirmColor: '#0BC3AA',
  415. confirmText: "好的",
  416. success(res) {
  417. console.log(emptyKey.toString());
  418. that.setData({
  419. mInputId: emptyKey.toString()
  420. })
  421. }
  422. })
  423. return; // 停止循环
  424. }
  425. }
  426. }
  427. for (let i = 0; i < checkInputList.length; i++) {
  428. const element = checkInputList[i];
  429. if ((element.type == 'checkbox' && Array.isArray(element.checkList) && element.checkList.includes(element.checkValue) && !element.checkInput) || (element.type == 'radio' && element.checkList == element.checkValue && !element.checkInput) ) { // 检查属性值是否为空
  430. // 这里可以添加更复杂的判断,比如仅针对字符串检查是否为空字符串
  431. // if (typeof obj[key] === 'string' && obj[key].trim() === '') {
  432. isFinish = false;
  433. emptyKey = element.name;
  434. wx.showModal({
  435. title: '无法提交',
  436. content: '您还有部分题目未完成,请检查后重新提交',
  437. showCancel: false,
  438. confirmColor: '#0BC3AA',
  439. confirmText: "好的",
  440. success(res) {
  441. console.log(emptyKey.toString());
  442. that.setData({
  443. mInputId: emptyKey.toString()
  444. })
  445. }
  446. })
  447. return; // 停止循环
  448. }
  449. }
  450. if (!isFinish) {
  451. wx.showModal({
  452. title: '无法提交',
  453. content: '您还有部分题目未完成,请检查后重新提交',
  454. showCancel: false,
  455. confirmColor: '#0BC3AA',
  456. confirmText: "好的",
  457. success(res) {
  458. console.log(emptyKey.toString());
  459. that.setData({
  460. mInputId: emptyKey.toString()
  461. })
  462. }
  463. })
  464. return;
  465. }
  466. // 将surveyData发送到服务器
  467. console.log('提交的问卷数据:', surveyData);
  468. //后边会提交到数据库
  469. // wx.request({
  470. // url: `${aipushApi}/getdatefromsn`, //
  471. // method: 'POST',
  472. // header: {
  473. // 'content-type': 'application/json', // 默认值
  474. // 'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
  475. // },
  476. // data:{
  477. //     "surveyData":surveyData,"token":"token_push"
  478. // },
  479. // success(res) {
  480. // wx.showToast({
  481. // title: '问卷提交成功',
  482. // icon: 'success',
  483. // duration: 2000
  484. // });
  485. // },
  486. // fail: function (error) {
  487. // console.error('error', error);
  488. // } ,
  489. // complete: function (e) {
  490. // }
  491. // });
  492. wx.showToast({
  493. title: '问卷提交成功',
  494. icon: 'success',
  495. duration: 2000,
  496. success() {
  497. setTimeout(() => {
  498. wx.navigateBack()
  499. }, 1500);
  500. }
  501. });
  502. // 清空表单:
  503. // this.setData({
  504. // gender: '',
  505. // careerInput:'',
  506. // stayExper:'',
  507. // sleepEnvironmentComfort: '',
  508. // productComfort: '',
  509. // improvementAreas: [], // 使用数组来存储多选答案
  510. // ImprovementSleep: [],//哪些方式来帮助改善睡眠
  511. // satisfied: [],// 哪些方面让您比较满意
  512. // suggestion: '', // 文本输入的建议
  513. // thirdPlatformsInput: '',//填写第三方平台
  514. // noSatisfied: '',//体验不满意的原因
  515. // wayImprovementSleep: '',//哪些方式来帮助改善睡眠
  516. // wayImprovementSleepInput: '',//请填写帮助改善睡眠方式文本
  517. // getSleepHealth: [],// 从哪里获取关于睡眠健康的信息
  518. // getSleepHealthInput: '',//您通常从哪里获取关于睡眠健康的信息文本
  519. // influenceSleep: [],//您认为以下哪些因素会影响您的睡眠
  520. // influenceSleepInput: '',//您认为以下哪些因素会影响您的睡眠文本
  521. // improvSleepMethods: [],//您认为以下哪些因素会影响您的睡眠
  522. // improvSleepMethodsInput: '',//您认为以下哪些因素会影响您的睡眠文本
  523. // age: '',//您的年龄
  524. // noSatisfiedInput: '',//让您对本次睡眠房入住体验不满意的原因文本
  525. // channel: '',
  526. // });
  527. },
  528. onLoad(option) {
  529. var that = this;
  530. console.log("sleepEvaluation页面");
  531. // wx.clearStorage();
  532. console.log('option.res=' + JSON.stringify(wx.getStorageSync('res')));
  533. if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
  534. wx.showModal({
  535. title: '提示',
  536. content: '请先扫描房间二维码',
  537. showCancel: false
  538. });
  539. setTimeout(function () {
  540. wx.reLaunch({
  541. url: '/pages/scan/scan',
  542. })
  543. }, 2000) // 设置延时时间,单位为毫秒
  544. } else if (wx.getStorageSync('res').result.split('|').length != 2) {
  545. wx.showModal({
  546. title: '提示',
  547. content: '房间二维码不正确,请重新扫码',
  548. showCancel: false
  549. });
  550. setTimeout(function () {
  551. wx.reLaunch({
  552. url: '/pages/scan/scan',
  553. })
  554. }, 2000) // 设置延时时间,单位为毫秒
  555. } else {
  556. // const expiresAt = wx.getStorageSync('scanResultExpiresAt');
  557. // const now = Date.now()
  558. // if (expiresAt || expiresAt < now) {
  559. // // 扫码结果已过期
  560. // wx.showToast({
  561. // title: '扫码结果失效或已过期,请重新扫码',
  562. // icon: 'none'
  563. // });
  564. // // 清除过期的扫码结果
  565. // wx.removeStorageSync('scanResultExpiresAt');
  566. // setTimeout(function() {
  567. // wx.reLaunch({
  568. // url: '/pages/scan/scan',
  569. // })
  570. // }, 2000) // 设置延时时间,单位为毫秒
  571. // }else{
  572. // //续期
  573. // wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000)
  574. // }
  575. let hotelTemp = '';
  576. let roomTemp = '';
  577. hotelTemp = wx.getStorageSync('res').result.split('|')[0];
  578. roomTemp = wx.getStorageSync('res').result.split('|')[1];
  579. this.setData({
  580. hotel: hotelTemp,
  581. room: roomTemp,
  582. });
  583. }
  584. },
  585. /**
  586. * 生命周期函数--监听页面隐藏
  587. */
  588. onHide: function () {
  589. },
  590. /**
  591. * 生命周期函数--监听页面卸载
  592. */
  593. onUnload: function () {
  594. },
  595. });