wujianwei
2026-03-09 d830ca5b00f2628e666c591a7e500c15fef21ee2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<template>
  <view class="promise-container">
    <!-- 头部导航 -->
    <Nav title="签署承诺书" customBack="pages/beReferred/index"></Nav>
 
    <!-- 提示信息 -->
    <view class="tip-box">
      <text class="tip-text">发车前,您需要签署以下文件:</text>
      <text class="progress-text">(当前进度{{numberFrom.number}}/2)</text>
      <u-icon name="close" size="24" color="#999" class="close-btn" @click="onCloseTip"></u-icon>
    </view>
 
    <!-- 承诺书列表 -->
    <view class="promise-list">
      <view class="promise-item" @click="goToSign(1)">
        <view class="item-left">
          <text class="item-title">货车司机出车前健康承诺书</text>
          <text class="item-status">({{numberFrom.status}})</text>
        </view>
        <u-icon name="arrow-right" size="24" color="#ccc"></u-icon>
      </view>
 
      <view class="promise-item" @click="goToSign(2)">
        <view class="item-left">
          <text class="item-title">遵纪守法承诺书</text>
          <text class="item-status">({{numberFrom.status}})</text>
        </view>
        <u-icon name="arrow-right" size="24" color="#ccc"></u-icon>
      </view>
    </view>
 
    <!-- 底部按钮 -->
    <view class="bottom-btn-group">
      <u-button class="confirm-btn" @click="onCancel" text="取消"></u-button>
      <!-- <u-button class="confirm-btn" >发车</u-button> -->
      <!-- <u-button class="confirm-btn" @click="submitForm" :disabled="signStatus" type="primary" text="发车"></u-button> -->
    </view>
  </view>
</template>
 
<script>
export default {
  data() {
    return {
      // 可根据实际签署情况修改状态
      signStatus: true, 
      numberFrom: {
        number:0,
        status:'未完成'
      },
      receivedForm: {}
    };
  },
  
    onLoad(options) {
      if(options.uploadIshow=='true'){
        this.numberFrom= {
         number:2,
         status:'完成'
        }
     }else {
        this.numberFrom= {
         number:0,
         status:'未完成'
        }
     }
    },
  methods: {
    // 返回上一页
    onBack() {
      uni.navigateBack({
        delta: 1
      });
    },
 
    // 关闭提示框
    onCloseTip() {
      // 实际项目中可隐藏提示框
      //   this.$refs.tipBox.style.display = 'none';
    },
 
    // 前往签署页面
    goToSign(index) {
      if (index === 1) {
        uni.navigateTo({
          url: `/pages/acknowledgement/index`
        });
        return;
      } else if (index == 2) {
        uni.navigateTo({
          url: `/pages/observeLaw/index`
        });
      }
 
    },
 
    // 取消操作
    onCancel() {
      uni.navigateBack({
        delta: 1
      });
    },
    submitForm() {
      /* 获取 */
      const form = uni.getStorageSync("signContractForm");
      console.log("提交的表单数据:", form);
      // 在这里可以添加提交表单数据的逻辑
        // 2. 读取后清除缓存(避免数据残留,按需选择)
      // uni.removeStorageSync("signContractForm");
      uni.$u.toast('表单已提交');
    },
   
  },
 
 
};
</script>
 
<style scoped>
.promise-container {
  width: 100%;
  min-height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
}
 
/* 导航栏样式 */
.nav-bar {
  height: 88rpx;
  background-color: #fff;
  display: flex;
  align-items: center;
  padding: 0 30rpx;
  border-bottom: 1rpx solid #eee;
}
 
.back-btn {
  width: 40rpx;
  height: 40rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}
 
.nav-title {
  flex: 1;
  text-align: center;
  font-size: 36rpx;
  font-weight: 500;
  color: #333;
}
 
/* 提示框样式 */
.tip-box {
  background-color: #fffbe6;
  border-radius: 16rpx;
  padding: 24rpx 30rpx;
  margin: 20rpx;
  display: flex;
  align-items: center;
  position: relative;
}
 
.tip-text {
  font-size: 28rpx;
  color: #fa8c16;
  line-height: 1.5;
}
 
.progress-text {
  font-size: 28rpx;
  color: #fa8c16;
  margin-left: 10rpx;
}
 
.close-btn {
  position: absolute;
  right: 24rpx;
  top: 50%;
  transform: translateY(-50%);
}
 
/* 承诺书列表样式 */
.promise-list {
  flex: 1;
  margin-top: 10rpx;
}
 
.promise-item {
  background-color: #fff;
  height: 120rpx;
  display: flex;
  align-items: center;
  padding: 0 30rpx;
  border-bottom: 1rpx solid #f5f5f5;
  justify-content: space-between;
}
 
.item-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
 
.item-title {
  font-size: 32rpx;
  color: #333;
  margin-bottom: 8rpx;
}
 
.item-status {
  font-size: 26rpx;
  color: #ff4d4f;
}
 
/* 底部按钮样式 */
.bottom-btn-group {
  padding: 30rpx;
  background-color: #fff;
  display: flex;
  gap: 20rpx;
}
 
.cancel-btn {
  flex: 1;
  height: 96rpx;
  line-height: 96rpx;
  font-size: 32rpx;
  background-color: #f5f5f5;
  color: #333;
  border-radius: 16rpx;
}
 
.confirm-btn {
  flex: 1;
  height: 96rpx;
  line-height: 96rpx;
  font-size: 32rpx;
  background-color: #1677ff;
  color: #fff;
  border-radius: 16rpx;
}
 
/* 禁用状态样式 */
.confirm-btn[disabled] {
  background-color: #8ec5fc;
  opacity: 0.6;
}
</style>