textStep.wxml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <!--subpages/textStep/textStep.wxml-->
  2. <view>
  3. <van-nav-bar title="" left-text="" leftArrow custom-class="nav-bar" bind:click-left="leftBack"></van-nav-bar>
  4. <text class="page-title">{{testTitle}}</text>
  5. <view class="progressBar-box">
  6. <view class="progressBar-bg">
  7. <view class="progressBar-progress" style="{{'width:calc(100% / '+stepTotal+' * '+step+');'}}"></view>
  8. </view>
  9. <text class="progressBar-progressText">{{step}}</text>
  10. <text class="progressBar-progressTotal">/{{stepTotal}}</text>
  11. </view>
  12. <!-- 报告第一步 确认基本信息 -->
  13. <view wx:if="{{step == 1}}" class="w-card">
  14. <view class="base-title-view">
  15. <view class="base-title-line" />
  16. <text class="base-title">您的性别</text>
  17. </view>
  18. <view class="v1">
  19. <view data-id="1" bindtap="checkGender">
  20. <image wx:if="{{gender == 1}}" src="/subpages/images//testRes/ic_test_man_check.png"></image>
  21. <image wx:else src="/subpages/images//testRes/ic_test_man.png"></image>
  22. </view>
  23. <view data-id="2" bindtap="checkGender">
  24. <image wx:if="{{gender == 2}}" src="/subpages/images//testRes/ic_test_women_check.png"></image>
  25. <image wx:else src="/subpages/images//testRes/ic_test_women.png"></image>
  26. </view>
  27. </view>
  28. <view class="v2">
  29. <view class="v3">
  30. <text class="t1">您的年龄</text>
  31. <view class="v4">
  32. <van-field model:value="{{ age }}" placeholder="" inputAlign="center" type="number" maxlength="4"
  33. custom-style="border-bottom:2rpx solid #EEEEEE;font-size:40rpx;font-weight:600;" />
  34. <text class="t2">岁</text>
  35. </view>
  36. </view>
  37. <view class="v3">
  38. <text class="t1">您的身高</text>
  39. <view class="v4">
  40. <van-field model:value="{{ height }}" placeholder="" inputAlign="center" type="number" maxlength="4"
  41. custom-style="border-bottom:2rpx solid #EEEEEE;font-size:40rpx;font-weight:600;" />
  42. <text class="t2">厘米</text>
  43. </view>
  44. </view>
  45. <view class="v3" style="margin-bottom: 20rpx;">
  46. <text class="t1">您的体重</text>
  47. <view class="v4">
  48. <van-field model:value="{{ weight }}" placeholder="" inputAlign="center" type="number" maxlength="4"
  49. custom-style="border-bottom:2rpx solid #EEEEEE;font-size:40rpx;font-weight:600;" />
  50. <text class="t2">公斤</text>
  51. </view>
  52. </view>
  53. <view class="v3">
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 报告其他步骤 -->
  58. <view wx:else>
  59. <wxs module="jstools" src="/subpages/wxs/includes.wxs"></wxs>
  60. <view class="w-card" wx:for="{{type == 'sleep' ? sleepData : physiqueData}}" wx:key="index"
  61. wx:if="{{index == step - 2}}">
  62. <view class="base-title-view">
  63. <view class="base-title-line" />
  64. <text class="base-title">{{item.title}}</text>
  65. </view>
  66. <scroll-view type="list" scroll-y style="max-height: calc(100vh - 670rpx)">
  67. <view>
  68. <view wx:if="{{item.type == 'checkbox'}}" class="options">
  69. <text wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
  70. class="{{jstools.includes(item.value,subItem.value) ? 'option option.active' :'option' }}"
  71. data-index="{{index}}" data-subindex="{{subIndex}}" bindtap="handleCheckBox">{{subItem.label}}</text>
  72. </view>
  73. <view wx:elif="{{item.type == 'date'}}" class="options-date">
  74. <view wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
  75. class="{{item.value.length ? 'option option-date option.active' :'option option-date' }}"
  76. data-index="{{index}}" data-subindex="{{subIndex}}" data-item="{{item}}" bindtap="handleSelectDate">
  77. <text style="flex: 1;">{{subItem.label}}</text>
  78. <text>{{item.value}}</text>
  79. <van-icon name="arrow" />
  80. </view>
  81. </view>
  82. <view wx:if="{{item.type == 'radio'}}" class="options">
  83. <view wx:if="{{item.subTitle}}"
  84. style="display: flex;flex-direction: row;margin-left: 40rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
  85. <text class="t1">{{item.subTitle}}</text>
  86. </view>
  87. <text wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
  88. class="{{item.value == subItem.value ? 'option option.active' :'option' }}" data-index="{{index}}"
  89. data-subindex="{{subIndex}}" bindtap="handleRadioBox">{{subItem.label}}</text>
  90. </view>
  91. <view wx:if="{{item.type == 'radio&input'}}" class="options">
  92. <text wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
  93. class="{{item.value == subItem.value ? 'option option.active' :'option' }}" data-index="{{index}}"
  94. data-subindex="{{subIndex}}" bindtap="handleRadioBox">{{subItem.label}}</text>
  95. <view wx:if="{{item.subTitle}}"
  96. style="display: flex;flex-direction: row;margin-left: 40rpx;margin-top: 20rpx;margin-bottom: 10rpx;align-items: center;">
  97. <text class="t1">{{item.subTitle}}</text>
  98. <van-field model:value="{{ inputValue }}" placeholder="请输入" inputAlign="left"
  99. custom-style="border-bottom:2rpx solid #EEEEEE;font-size:28rpx;margin-left: 30rpx;" />
  100. </view>
  101. </view>
  102. </view>
  103. </scroll-view>
  104. </view>
  105. </view>
  106. <view class="bottom-btn-view">
  107. <text class="view-res-btn" bindtap="toNext">{{step == stepTotal ? '提交' : '下一步'}}</text>
  108. </view>
  109. <van-popup wx:if="{{currentDateItem}}" show="{{ showDateDialog }}" close-on-click-overlay z-index="10086" overlay
  110. position="bottom" bind:close="onCloseDateDialog" custom-class="custom-date-class"
  111. bind:click-overlay="onCloseDateDialog">
  112. <van-datetime-picker type="time" formatter="{{ formatter }}" title="{{currentDateItem.label}}"
  113. value="{{ currentDate }}" min-hour="0" max-hour="23" bind:confirm="onDateInput" bind:cancel="onCloseDateDialog"
  114. toolbar-class="toolbar-class" />
  115. </van-popup>
  116. </view>