混凝土运输管理微信小程序、替班
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.

341 lines
7.9 KiB

2 weeks ago
  1. <template>
  2. <view class="content">
  3. <navbar title="推荐司机" :leftClick="true" @leftClick="$utils.navigateBack" />
  4. <view class="mt20">
  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="switchToBoss">我要推荐老板</view>
  10. </view>
  11. <view class="re-card-context">
  12. 感谢您为我们推荐司机请您填写下述问题以便我们对您推荐的司机有一个整体的了解
  13. </view>
  14. </view>
  15. <!-- 表单卡片 -->
  16. <view class="re-card-p32">
  17. <!-- 司机姓名 -->
  18. <view class="re-from-line">
  19. <view class="re-from-label">您推荐的司机姓名</view>
  20. <view class="b-relative">
  21. <input
  22. maxlength="8"
  23. class="re-from-input"
  24. placeholder="请填写真实姓名"
  25. v-model="driverInfo.name"
  26. @input="onNameInput"
  27. />
  28. <image class="re-from-icon" src="/static/icons/icon01.png"></image>
  29. </view>
  30. </view>
  31. <!-- 手机号码 -->
  32. <view class="re-from-line">
  33. <view class="re-from-label">司机的手机号码</view>
  34. <view class="b-relative">
  35. <input
  36. type="number"
  37. maxlength="11"
  38. class="re-from-input"
  39. placeholder="请填写TA的常用联系方式"
  40. v-model="driverInfo.phone"
  41. @input="onPhoneInput"
  42. />
  43. <image class="re-from-icon" src="/static/icons/icon02.png"></image>
  44. </view>
  45. </view>
  46. <view class="h44"></view>
  47. <!-- 责任心评价 -->
  48. <view class="re-from-line">
  49. <view class="re-from-label">您推荐司机责任心强</view>
  50. <view class="b-relative">
  51. <radio-group @change="onResponsibilityChange">
  52. <radio class="re-radio re-width2" value="1" :checked="driverInfo.responsibility === '1'"></radio>
  53. <radio class="re-radio re-width2" value="2" :checked="driverInfo.responsibility === '2'"></radio>
  54. </radio-group>
  55. </view>
  56. </view>
  57. <!-- 技术水平评价 -->
  58. <view class="re-from-line">
  59. <view class="re-from-label">您推荐司机技术水平如何</view>
  60. <view class="b-relative">
  61. <radio-group @change="onSkillChange">
  62. <radio class="re-radio re-width3" value="1" :checked="driverInfo.skill === '1'">优秀</radio>
  63. <radio class="re-radio re-width3" value="2" :checked="driverInfo.skill === '2'">良好</radio>
  64. <radio class="re-radio re-width3" value="3" :checked="driverInfo.skill === '3'">一般</radio>
  65. </radio-group>
  66. </view>
  67. </view>
  68. <!-- 工作经验 -->
  69. <view class="re-from-line">
  70. <view class="re-from-label">您推荐司机工作经验</view>
  71. <view class="b-relative">
  72. <radio-group @change="onExperienceChange">
  73. <radio class="re-radio re-width3" value="1" :checked="driverInfo.experience === '1'">1-3</radio>
  74. <radio class="re-radio re-width3" value="2" :checked="driverInfo.experience === '2'">3-5</radio>
  75. <radio class="re-radio re-width3" value="3" :checked="driverInfo.experience === '3'">5年以上</radio>
  76. </radio-group>
  77. </view>
  78. </view>
  79. <!-- 推荐理由 -->
  80. <view class="re-from-line">
  81. <view class="re-from-label">推荐理由</view>
  82. <view class="b-relative">
  83. <textarea
  84. class="re-from-textarea"
  85. placeholder="请简述推荐理由"
  86. v-model="driverInfo.reason"
  87. maxlength="200"
  88. ></textarea>
  89. </view>
  90. </view>
  91. <!-- 您的联系方式 -->
  92. <view class="re-from-line">
  93. <view class="re-from-label">您的联系方式</view>
  94. <view class="b-relative">
  95. <input
  96. type="number"
  97. maxlength="11"
  98. class="re-from-input"
  99. placeholder="请填写您的联系电话"
  100. v-model="driverInfo.myPhone"
  101. />
  102. <image class="re-from-icon" src="/static/icons/icon02.png"></image>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. <!-- 底部提交按钮 -->
  108. <view class="re-end-pand b-fiexd">
  109. <button @click="submitRecommendation">提交推荐</button>
  110. </view>
  111. </view>
  112. </template>
  113. <script>
  114. import navbar from '@/components/base/navbar.vue'
  115. export default {
  116. name: 'UserDriver',
  117. components: {
  118. navbar
  119. },
  120. data() {
  121. return {
  122. driverInfo: {
  123. name: '',
  124. phone: '',
  125. responsibility: '1',
  126. skill: '1',
  127. experience: '1',
  128. reason: '',
  129. myPhone: ''
  130. }
  131. }
  132. },
  133. onLoad() {
  134. uni.setNavigationBarTitle({
  135. title: '推荐司机'
  136. });
  137. },
  138. methods: {
  139. switchToBoss() {
  140. uni.redirectTo({
  141. url: '/pages_order/user/enter'
  142. });
  143. },
  144. onNameInput(e) {
  145. this.driverInfo.name = e.detail.value;
  146. },
  147. onPhoneInput(e) {
  148. this.driverInfo.phone = e.detail.value;
  149. },
  150. onResponsibilityChange(e) {
  151. this.driverInfo.responsibility = e.detail.value;
  152. },
  153. onSkillChange(e) {
  154. this.driverInfo.skill = e.detail.value;
  155. },
  156. onExperienceChange(e) {
  157. this.driverInfo.experience = e.detail.value;
  158. },
  159. submitRecommendation() {
  160. // 表单验证
  161. if (!this.driverInfo.name) {
  162. uni.showToast({ title: '请输入司机姓名', icon: 'none' });
  163. return;
  164. }
  165. if (!this.driverInfo.phone) {
  166. uni.showToast({ title: '请输入司机手机号', icon: 'none' });
  167. return;
  168. }
  169. if (!/^1[3-9]\d{9}$/.test(this.driverInfo.phone)) {
  170. uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
  171. return;
  172. }
  173. if (!this.driverInfo.myPhone) {
  174. uni.showToast({ title: '请输入您的联系方式', icon: 'none' });
  175. return;
  176. }
  177. if (!/^1[3-9]\d{9}$/.test(this.driverInfo.myPhone)) {
  178. uni.showToast({ title: '请输入正确的联系方式', icon: 'none' });
  179. return;
  180. }
  181. uni.showToast({
  182. title: '推荐提交成功',
  183. icon: 'success'
  184. });
  185. setTimeout(() => {
  186. uni.navigateBack();
  187. }, 1500);
  188. }
  189. }
  190. }
  191. </script>
  192. <style scoped lang="scss">
  193. .content {
  194. padding: 20rpx;
  195. min-height: 100vh;
  196. background-color: #f5f5f5;
  197. padding-bottom: 120rpx;
  198. }
  199. .mt20 {
  200. margin-top: 20rpx;
  201. }
  202. .re-card-p32 {
  203. background-color: #fff;
  204. border-radius: 10rpx;
  205. padding: 32rpx;
  206. margin-bottom: 20rpx;
  207. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  208. }
  209. .flex-sb {
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. }
  214. .re-from-label {
  215. font-size: 30rpx;
  216. font-weight: 500;
  217. color: #333;
  218. }
  219. .re-card-show {
  220. padding: 10rpx 20rpx;
  221. background-color: #007AFF;
  222. color: #fff;
  223. border-radius: 20rpx;
  224. font-size: 24rpx;
  225. }
  226. .re-card-context {
  227. margin-top: 20rpx;
  228. font-size: 26rpx;
  229. color: #666;
  230. line-height: 1.5;
  231. }
  232. .re-from-line {
  233. margin-bottom: 40rpx;
  234. &:last-child {
  235. margin-bottom: 0;
  236. }
  237. .re-from-label {
  238. font-size: 28rpx;
  239. margin-bottom: 20rpx;
  240. }
  241. }
  242. .b-relative {
  243. position: relative;
  244. }
  245. .re-from-input {
  246. width: 100%;
  247. height: 80rpx;
  248. padding: 0 60rpx 0 20rpx;
  249. border: 1rpx solid #e0e0e0;
  250. border-radius: 8rpx;
  251. font-size: 28rpx;
  252. box-sizing: border-box;
  253. }
  254. .re-from-textarea {
  255. width: 100%;
  256. height: 120rpx;
  257. padding: 20rpx;
  258. border: 1rpx solid #e0e0e0;
  259. border-radius: 8rpx;
  260. font-size: 28rpx;
  261. box-sizing: border-box;
  262. resize: none;
  263. }
  264. .re-from-icon {
  265. position: absolute;
  266. right: 20rpx;
  267. top: 50%;
  268. transform: translateY(-50%);
  269. width: 32rpx;
  270. height: 32rpx;
  271. }
  272. .h44 {
  273. height: 44rpx;
  274. }
  275. .re-radio {
  276. margin-right: 40rpx;
  277. font-size: 28rpx;
  278. }
  279. .re-width2 {
  280. width: calc(50% - 20rpx);
  281. }
  282. .re-width3 {
  283. width: calc(33.33% - 27rpx);
  284. }
  285. .re-end-pand {
  286. position: fixed;
  287. bottom: 0;
  288. left: 0;
  289. right: 0;
  290. padding: 20rpx;
  291. background-color: #fff;
  292. border-top: 1rpx solid #f0f0f0;
  293. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  294. button {
  295. width: 100%;
  296. height: 80rpx;
  297. line-height: 80rpx;
  298. background-color: #007AFF;
  299. color: #fff;
  300. border-radius: 40rpx;
  301. font-size: 32rpx;
  302. border: none;
  303. }
  304. }
  305. .b-fiexd {
  306. position: fixed;
  307. }
  308. </style>