edit.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="container">
  3. <view class="title">成员基本信息</view>
  4. <view class="box">
  5. 手机
  6. <view class="box_input">
  7. <input type="number" maxlength="11" placeholder="请输入手机号码" v-model="phone" />
  8. </view>
  9. </view>
  10. <view class="box">
  11. 状态
  12. <picker @change="bindPickerChange" :value="index" :range="array">
  13. <view class="box_input">
  14. {{ array[index] }}
  15. <img src="../../static/images/repairsImg/bottom.png" />
  16. </view>
  17. </picker>
  18. </view>
  19. <view class="box">
  20. 工种
  21. <picker @change="bindPickerChange2" :value="index2" :range="array2">
  22. <view class="box_input">
  23. {{ array2[index2] }}
  24. <img src="../../static/images/repairsImg/bottom.png" />
  25. </view>
  26. </picker>
  27. </view>
  28. <view class="title">接单考核时间</view>
  29. <view class="box_time">
  30. <view class="time">
  31. <input type="text" v-model="receivingTime" />
  32. <img src="../../static/images/repairsImg/clock.png" />
  33. </view>
  34. 分钟
  35. </view>
  36. <view class="title">维修考核时间</view>
  37. <view class="box_time">
  38. <view class="time">
  39. <input type="text" v-model="repairsTime" />
  40. <img src="../../static/images/repairsImg/clock.png" />
  41. </view>
  42. 分钟
  43. </view>
  44. <!-- 提交按钮区域 -->
  45. <view class="btn" @click="handleSub">确认提交</view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. // 手机号码
  53. phone: '13659864589',
  54. // 接单考核时间
  55. receivingTime: 0,
  56. // 维修考核时间
  57. repairsTime: 0,
  58. // 状态数组
  59. array: ['接单中', '停止接单', '订单饱和'],
  60. // 状态数组当前索引
  61. index: 0,
  62. // 工种数组
  63. array2: ['电工', '水工', '泥工', '空调'],
  64. // 工种数组当前索引
  65. index2: 0
  66. }
  67. },
  68. methods: {
  69. // 确认提交按钮回调
  70. handleSub() {
  71. if (!this.phone) {
  72. uni.showToast({
  73. title: '请输入手机号码',
  74. icon: 'none'
  75. })
  76. return
  77. }
  78. const rePhone = /^[1][3,4,5,7,8,9][0-9]{9}$/
  79. if (!rePhone.test(this.phone)) {
  80. uni.showToast({
  81. title: '手机号码格式有误',
  82. icon: 'none'
  83. })
  84. return
  85. }
  86. uni.showModal({
  87. title: '提示',
  88. content: '确认提交吗?',
  89. success: (res) => {
  90. if (res.confirm) {
  91. console.log(this.phone)
  92. console.log(this.array[this.index])
  93. console.log(this.array2[this.index2])
  94. console.log(this.receivingTime)
  95. console.log(this.repairsTime)
  96. uni.showToast({
  97. title: '编辑成功',
  98. icon: 'success'
  99. })
  100. setTimeout(() => {
  101. uni.navigateTo({
  102. url: '/pagesRepairs/box/box'
  103. })
  104. }, 1500)
  105. }
  106. }
  107. })
  108. },
  109. // 状态选择框选择回调
  110. bindPickerChange(e) {
  111. this.index = e.detail.value
  112. },
  113. // 工种选择框选择回调
  114. bindPickerChange2(e) {
  115. this.index2 = e.detail.value
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .container {
  122. box-sizing: border-box;
  123. padding: 0 30rpx;
  124. width: 100vw;
  125. height: 100vh;
  126. .title {
  127. display: flex;
  128. align-items: center;
  129. height: 112rpx;
  130. font-size: 36rpx;
  131. font-weight: bold;
  132. }
  133. .box {
  134. display: flex;
  135. align-items: center;
  136. margin-bottom: 30rpx;
  137. height: 94rpx;
  138. color: #808080;
  139. font-size: 32rpx;
  140. .box_input {
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. box-sizing: border-box;
  145. margin-left: 33rpx;
  146. padding: 0 33rpx;
  147. width: 542rpx;
  148. height: 94rpx;
  149. color: #000000;
  150. border-radius: 10rpx;
  151. border: 1rpx solid #cccccc;
  152. input {
  153. width: 100%;
  154. height: 100%;
  155. }
  156. img {
  157. width: 54rpx;
  158. height: 54rpx;
  159. }
  160. }
  161. }
  162. .box_time {
  163. display: flex;
  164. align-items: center;
  165. height: 100rpx;
  166. font-size: 32rpx;
  167. font-weight: bold;
  168. .time {
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. box-sizing: border-box;
  173. padding: 0 23rpx;
  174. margin-right: 25rpx;
  175. width: 237rpx;
  176. height: 68rpx;
  177. font-weight: 400;
  178. border-radius: 4rpx;
  179. border: 1rpx solid #a6a6a6;
  180. input {
  181. flex: 1;
  182. }
  183. img {
  184. width: 40rpx;
  185. height: 40rpx;
  186. }
  187. }
  188. }
  189. .btn {
  190. position: absolute;
  191. bottom: 66rpx;
  192. display: flex;
  193. justify-content: center;
  194. align-items: center;
  195. margin: auto;
  196. width: 690rpx;
  197. height: 100rpx;
  198. color: #fff;
  199. font-size: 32rpx;
  200. border-radius: 12rpx;
  201. background-color: #6fb6b8;
  202. }
  203. }
  204. </style>