混凝土运输管理微信小程序、替班
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

414 lines
10 KiB

2 weeks ago
  1. <template>
  2. <view class="content">
  3. <navbar title="施工确认" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="cr mt40">
  5. <!-- 当前工作环境 -->
  6. <view class="re-card-p32">
  7. <view class="flex-sb">
  8. <view class="re-from-label">请拍摄当前工作环境</view>
  9. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one07.png')">查看示例</view>
  10. </view>
  11. <input-image
  12. :height="456"
  13. @uploadSuccess="(data) => form.workEnvironment = data.ossUrl"
  14. />
  15. <view class="re-card-context">
  16. 需拍摄<label>车辆四周</label>照片以保证场地满足施工
  17. </view>
  18. </view>
  19. <!-- 支腿前方照片 -->
  20. <view class="re-card-p32">
  21. <view class="flex-sb">
  22. <view class="re-from-label">请拍摄支腿前方照片</view>
  23. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one11.png')">查看示例</view>
  24. </view>
  25. <input-image
  26. :height="456"
  27. @uploadSuccess="(data) => form.frontLeg = data.ossUrl"
  28. />
  29. <view class="re-card-context">
  30. 需拍摄<label>车辆支腿前方</label>照片以保证车辆交车状况
  31. </view>
  32. </view>
  33. <!-- 支腿后方照片 -->
  34. <view class="re-card-p32">
  35. <view class="flex-sb">
  36. <view class="re-from-label">请拍摄支腿后方照片</view>
  37. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one12.png')">查看示例</view>
  38. </view>
  39. <input-image
  40. :height="456"
  41. @uploadSuccess="(data) => form.backLeg = data.ossUrl"
  42. />
  43. <view class="re-card-context">
  44. 需拍摄<label>车辆支腿后方</label>照片以保证车辆交车状况
  45. </view>
  46. </view>
  47. <!-- 支腿左侧方照片 -->
  48. <view class="re-card-p32">
  49. <view class="flex-sb">
  50. <view class="re-from-label">请拍摄支腿左侧方照片</view>
  51. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one13.png')">查看示例</view>
  52. </view>
  53. <input-image
  54. :height="456"
  55. @uploadSuccess="(data) => form.leftLeg = data.ossUrl"
  56. />
  57. <view class="re-card-context">
  58. 需拍摄<label>车辆支腿左侧方</label>照片以保证车辆交车状况
  59. </view>
  60. </view>
  61. <!-- 支腿右侧方照片 -->
  62. <view class="re-card-p32">
  63. <view class="flex-sb">
  64. <view class="re-from-label">请拍摄支腿右侧方照片</view>
  65. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one14.png')">查看示例</view>
  66. </view>
  67. <input-image
  68. :height="456"
  69. @uploadSuccess="(data) => form.rightLeg = data.ossUrl"
  70. />
  71. <view class="re-card-context">
  72. 需拍摄<label>车辆支腿右侧方</label>照片以保证车辆交车状况
  73. </view>
  74. </view>
  75. <!-- 水槽照片 -->
  76. <view class="re-card-p32">
  77. <view class="flex-sb">
  78. <view class="re-from-label">请拍摄水槽照片</view>
  79. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one05.png')">查看示例</view>
  80. </view>
  81. <input-image
  82. :height="456"
  83. @uploadSuccess="(data) => form.waterTank = data.ossUrl"
  84. />
  85. <view class="re-card-context">
  86. 需拍摄<label>车辆油箱水箱</label>照片以保证车辆安全状况
  87. </view>
  88. </view>
  89. <!-- 冷却箱 -->
  90. <view class="re-card-p32">
  91. <view class="flex-sb">
  92. <view class="re-from-label">请拍摄冷却箱</view>
  93. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one07.png')">查看示例</view>
  94. </view>
  95. <input-image
  96. :height="456"
  97. @uploadSuccess="(data) => form.coolingBox = data.ossUrl"
  98. />
  99. <view class="re-card-context">
  100. 需拍摄<label>车辆冷却箱</label>照片以保证车辆安全状况
  101. </view>
  102. </view>
  103. <!-- 液压油位 -->
  104. <view class="re-card-p32">
  105. <view class="flex-sb">
  106. <view class="re-from-label">请拍摄液压油位</view>
  107. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one06.png')">查看示例</view>
  108. </view>
  109. <input-image
  110. :height="456"
  111. @uploadSuccess="(data) => form.hydraulicOil = data.ossUrl"
  112. />
  113. <view class="re-card-context">
  114. 需拍摄<label>车辆液压油位</label>照片以保证车辆安全状况
  115. </view>
  116. </view>
  117. <!-- 计时开始照片 -->
  118. <view class="re-card-p32">
  119. <view class="flex-sb">
  120. <view class="re-from-label">请拍摄计时开始照片</view>
  121. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one15.png')">查看示例</view>
  122. </view>
  123. <input-image
  124. :height="456"
  125. @uploadSuccess="(data) => form.timingStart = data.ossUrl"
  126. />
  127. <view class="re-card-context">
  128. 需拍摄<label>开始计时的照片</label>以保证您的利益
  129. </view>
  130. </view>
  131. <!-- 备注 -->
  132. <view class="re-card-p32">
  133. <view class="re-from-label">备注<label>选填</label></view>
  134. <textarea
  135. class="re-card-textarea"
  136. placeholder=" 如在施工过程中发现问题,请用文字描述。"
  137. v-model="form.remark"
  138. />
  139. </view>
  140. </view>
  141. <!-- 底部提交按钮 -->
  142. <view class="re-end-pand">
  143. <button @click="submitForm">提交保存</button>
  144. </view>
  145. <!-- 示例弹窗 -->
  146. <show-example
  147. v-if="showExample"
  148. :show="showExample"
  149. :url="exampleUrl"
  150. @close="showExample = false"
  151. />
  152. </view>
  153. </template>
  154. <script>
  155. import navbar from '@/components/base/navbar.vue'
  156. import InputImage from '@/components/base/input-image.vue'
  157. import ShowExample from '@/components/base/show-example.vue'
  158. export default {
  159. name: 'UserStep1',
  160. components: {
  161. navbar,
  162. InputImage,
  163. ShowExample
  164. },
  165. data() {
  166. return {
  167. orderId: '',
  168. showExample: false,
  169. exampleUrl: '',
  170. form: {
  171. workEnvironment: '', // 当前工作环境
  172. frontLeg: '', // 支腿前方照片
  173. backLeg: '', // 支腿后方照片
  174. leftLeg: '', // 支腿左侧方照片
  175. rightLeg: '', // 支腿右侧方照片
  176. waterTank: '', // 水槽照片
  177. coolingBox: '', // 冷却箱
  178. hydraulicOil: '', // 液压油位
  179. timingStart: '', // 计时开始照片
  180. remark: '' // 备注
  181. }
  182. }
  183. },
  184. onLoad(options) {
  185. if (options.id) {
  186. this.orderId = options.id;
  187. }
  188. },
  189. methods: {
  190. // 显示示例图片
  191. clickShowExample(url) {
  192. this.exampleUrl = url || 'https://relief.oss-cn-hangzhou.aliyuncs.com/yx.jpg';
  193. this.showExample = true;
  194. },
  195. // 提交表单
  196. submitForm() {
  197. // 验证必填项
  198. const requiredFields = [
  199. 'workEnvironment', 'frontLeg', 'backLeg', 'leftLeg',
  200. 'rightLeg', 'waterTank', 'coolingBox', 'hydraulicOil', 'timingStart'
  201. ];
  202. for (let field of requiredFields) {
  203. if (!this.form[field]) {
  204. uni.showToast({
  205. icon: 'none',
  206. title: '请按照要求拍摄上传照片'
  207. });
  208. return;
  209. }
  210. }
  211. this.doSubmit();
  212. },
  213. // 执行提交
  214. doSubmit() {
  215. // 模拟提交数据
  216. const submitData = {
  217. id: this.$utils?.generateUUID() || Date.now().toString(),
  218. status: 1,
  219. step: 2,
  220. orderId: this.orderId,
  221. ...this.form
  222. };
  223. console.log('提交数据:', submitData);
  224. // 模拟API调用
  225. uni.showLoading({
  226. title: '提交中...'
  227. });
  228. setTimeout(() => {
  229. uni.hideLoading();
  230. uni.showToast({
  231. icon: 'success',
  232. title: '提交成功'
  233. });
  234. setTimeout(() => {
  235. uni.navigateBack({
  236. delta: 1
  237. });
  238. }, 1500);
  239. }, 1000);
  240. }
  241. }
  242. }
  243. </script>
  244. <style scoped lang="scss">
  245. page {
  246. background-color: #F5F5F5;
  247. }
  248. .content {
  249. min-height: 100vh;
  250. background-color: #F5F5F5;
  251. padding-bottom: 200rpx; // 为底部按钮留出空间
  252. }
  253. .cr {
  254. min-height: calc(88vh);
  255. }
  256. .mt40 {
  257. margin-top: 40rpx;
  258. }
  259. // 卡片样式
  260. .re-card-p32 {
  261. background-color: #FFFFFF;
  262. border-radius: 20rpx;
  263. width: calc(690rpx - 64rpx);
  264. min-height: 120rpx;
  265. margin: 0 calc(50vw - 690rpx / 2);
  266. margin-bottom: 30rpx;
  267. padding: 32rpx;
  268. position: relative;
  269. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
  270. }
  271. // 弹性布局
  272. .flex-sb {
  273. display: flex;
  274. justify-content: space-between;
  275. align-items: center;
  276. margin-bottom: 24rpx;
  277. }
  278. // 标签样式
  279. .re-from-label {
  280. font-size: 28rpx;
  281. font-weight: normal;
  282. letter-spacing: 0px;
  283. color: #1c1c1c;
  284. }
  285. // 查看示例按钮
  286. .re-card-show {
  287. color: #9E9E9E;
  288. font-size: 24rpx;
  289. font-weight: normal;
  290. line-height: normal;
  291. letter-spacing: 0em;
  292. padding: 8rpx 16rpx;
  293. border: 1rpx solid #9E9E9E;
  294. border-radius: 20rpx;
  295. background-color: rgba(158, 158, 158, 0.1);
  296. transition: all 0.3s;
  297. &:active {
  298. background-color: rgba(158, 158, 158, 0.2);
  299. transform: scale(0.95);
  300. }
  301. }
  302. // 说明文字
  303. .re-card-context {
  304. font-size: 24rpx;
  305. font-weight: normal;
  306. line-height: 36rpx;
  307. letter-spacing: 0em;
  308. color: #9E9E9E;
  309. margin-top: 16rpx;
  310. label {
  311. color: #F40000;
  312. font-weight: 500;
  313. }
  314. }
  315. // 文本域样式
  316. .re-card-textarea {
  317. width: 570rpx;
  318. height: 152rpx;
  319. border-radius: 8rpx;
  320. padding: 20rpx;
  321. background: #EEEEEE;
  322. font-size: 26rpx;
  323. line-height: normal;
  324. letter-spacing: 0em;
  325. color: #0d0d0d;
  326. border: none;
  327. box-sizing: border-box;
  328. resize: none;
  329. &::placeholder {
  330. color: #999;
  331. }
  332. }
  333. // 底部按钮区域
  334. .re-end-pand {
  335. position: fixed;
  336. bottom: 0;
  337. left: 0;
  338. right: 0;
  339. width: 100vw;
  340. height: 88rpx;
  341. opacity: 1;
  342. background: #FFFFFF;
  343. box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(0, 0, 0, 0.2);
  344. padding: 30rpx 0;
  345. padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
  346. z-index: 100;
  347. button {
  348. width: 620rpx;
  349. height: 88rpx;
  350. line-height: 88rpx;
  351. border-radius: 10rpx;
  352. background: #F40000;
  353. color: #FFF;
  354. text-align: center;
  355. margin: 0 auto;
  356. font-size: 30rpx;
  357. font-weight: 400;
  358. transition: all 0.2s ease-in-out;
  359. border: none;
  360. &:active {
  361. transform: translateY(2rpx) translateX(1rpx);
  362. background: #d63031;
  363. }
  364. }
  365. }
  366. // 高亮文字
  367. .highlight {
  368. color: #F40000;
  369. font-weight: 500;
  370. }
  371. // 可选标识
  372. .optional {
  373. color: #999;
  374. font-weight: normal;
  375. }
  376. </style>