柒零 1 рік тому
батько
коміт
c41bec3b5a

+ 7 - 0
subpages/textStep/textStep.js

@@ -536,6 +536,13 @@ Page({
       // 睡眠质量
     }
   },
+  toPrevious() {
+    if (this.data.step > 1) {
+      this.setData({
+        step: this.data.step - 1
+      })
+    }
+  },
   toNext() {
     if (this.data.step == 1) {
       // 判断基本信息是否为空

+ 4 - 1
subpages/textStep/textStep.wxml

@@ -107,7 +107,10 @@
     </view>
   </view>
   <view class="bottom-btn-view">
-    <text class="view-res-btn" bindtap="toNext">{{step == stepTotal ? '提交' : '下一步'}}</text>
+    <view class="res-test-btn-view">
+      <text wx:if="{{step > 1}}" class="view-res-btn" bindtap="toPrevious">上一步</text>
+      <text class="view-res-btn" bindtap="toNext">{{step == stepTotal ? '提交' : '下一步'}}</text>
+    </view>
   </view>
   <van-popup wx:if="{{currentDateItem}}" show="{{ showDateDialog }}" close-on-click-overlay z-index="10086" overlay
     position="bottom" bind:close="onCloseDateDialog" custom-class="custom-date-class"

+ 9 - 0
subpages/textStep/textStep.wxss

@@ -37,10 +37,19 @@ page {
   justify-content: flex-start;
 }
 
+.res-test-btn-view {
+  margin-top: 16rpx;
+  width: 690rpx;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: center;
+}
 
 .view-res-btn {
   margin-top: 16rpx;
   width: 336rpx;
+  margin: 0 auto;
   height: 84rpx;
   background: #EFF7FF;
   text-align: center;