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

359 lines
8.3 KiB

2 weeks ago
  1. <template>
  2. <view class="content">
  3. <navbar title="推荐老板" leftClick @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="switchToDriver">我要推荐司机</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="bossInfo.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="bossInfo.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="onSalaryChange">
  52. <radio class="re-radio re-width2" value="1" :checked="bossInfo.salary === '1'"></radio>
  53. <radio class="re-radio re-width2" value="2" :checked="bossInfo.salary === '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="onAttitudeChange">
  62. <radio class="re-radio re-width3" value="1" :checked="bossInfo.attitude === '1'">很好</radio>
  63. <radio class="re-radio re-width3" value="2" :checked="bossInfo.attitude === '2'">一般</radio>
  64. <radio class="re-radio re-width3" value="3" :checked="bossInfo.attitude === '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="onScaleChange">
  73. <radio class="re-radio re-width3" value="1" :checked="bossInfo.scale === '1'">大型</radio>
  74. <radio class="re-radio re-width3" value="2" :checked="bossInfo.scale === '2'">中型</radio>
  75. <radio class="re-radio re-width3" value="3" :checked="bossInfo.scale === '3'">小型</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. <input
  84. class="re-from-input"
  85. placeholder="请填写公司名称"
  86. v-model="bossInfo.companyName"
  87. />
  88. <image class="re-from-icon" src="/static/icons/icon01.png"></image>
  89. </view>
  90. </view>
  91. <!-- 推荐理由 -->
  92. <view class="re-from-line">
  93. <view class="re-from-label">推荐理由</view>
  94. <view class="b-relative">
  95. <textarea
  96. class="re-from-textarea"
  97. placeholder="请简述推荐理由"
  98. v-model="bossInfo.reason"
  99. maxlength="200"
  100. ></textarea>
  101. </view>
  102. </view>
  103. <!-- 您的联系方式 -->
  104. <view class="re-from-line">
  105. <view class="re-from-label">您的联系方式</view>
  106. <view class="b-relative">
  107. <input
  108. type="number"
  109. maxlength="11"
  110. class="re-from-input"
  111. placeholder="请填写您的联系电话"
  112. v-model="bossInfo.myPhone"
  113. />
  114. <image class="re-from-icon" src="/static/icons/icon02.png"></image>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <!-- 底部提交按钮 -->
  120. <view class="re-end-pand b-fiexd">
  121. <button @click="submitRecommendation">提交推荐</button>
  122. </view>
  123. </view>
  124. </template>
  125. <script>
  126. import navbar from '@/components/base/navbar.vue'
  127. export default {
  128. components: {
  129. navbar
  130. },
  131. name: 'UserEnter',
  132. data() {
  133. return {
  134. bossInfo: {
  135. name: '',
  136. phone: '',
  137. salary: '2',
  138. attitude: '1',
  139. scale: '2',
  140. companyName: '',
  141. reason: '',
  142. myPhone: ''
  143. }
  144. }
  145. },
  146. onLoad() {
  147. uni.setNavigationBarTitle({
  148. title: '推荐老板'
  149. });
  150. },
  151. methods: {
  152. switchToDriver() {
  153. uni.redirectTo({
  154. url: '/pages_order/user/driver'
  155. });
  156. },
  157. onNameInput(e) {
  158. this.bossInfo.name = e.detail.value;
  159. },
  160. onPhoneInput(e) {
  161. this.bossInfo.phone = e.detail.value;
  162. },
  163. onSalaryChange(e) {
  164. this.bossInfo.salary = e.detail.value;
  165. },
  166. onAttitudeChange(e) {
  167. this.bossInfo.attitude = e.detail.value;
  168. },
  169. onScaleChange(e) {
  170. this.bossInfo.scale = e.detail.value;
  171. },
  172. submitRecommendation() {
  173. // 表单验证
  174. if (!this.bossInfo.name) {
  175. uni.showToast({ title: '请输入老板姓名', icon: 'none' });
  176. return;
  177. }
  178. if (!this.bossInfo.phone) {
  179. uni.showToast({ title: '请输入老板手机号', icon: 'none' });
  180. return;
  181. }
  182. if (!/^1[3-9]\d{9}$/.test(this.bossInfo.phone)) {
  183. uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
  184. return;
  185. }
  186. if (!this.bossInfo.companyName) {
  187. uni.showToast({ title: '请输入公司名称', icon: 'none' });
  188. return;
  189. }
  190. if (!this.bossInfo.myPhone) {
  191. uni.showToast({ title: '请输入您的联系方式', icon: 'none' });
  192. return;
  193. }
  194. if (!/^1[3-9]\d{9}$/.test(this.bossInfo.myPhone)) {
  195. uni.showToast({ title: '请输入正确的联系方式', icon: 'none' });
  196. return;
  197. }
  198. uni.showToast({
  199. title: '推荐提交成功',
  200. icon: 'success'
  201. });
  202. setTimeout(() => {
  203. uni.navigateBack();
  204. }, 1500);
  205. }
  206. }
  207. }
  208. </script>
  209. <style scoped lang="scss">
  210. .content {
  211. padding: 20rpx;
  212. min-height: 100vh;
  213. background-color: #f5f5f5;
  214. padding-bottom: 120rpx;
  215. }
  216. .mt20 {
  217. margin-top: 20rpx;
  218. }
  219. .re-card-p32 {
  220. background-color: #fff;
  221. border-radius: 10rpx;
  222. padding: 32rpx;
  223. margin-bottom: 20rpx;
  224. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  225. }
  226. .flex-sb {
  227. display: flex;
  228. justify-content: space-between;
  229. align-items: center;
  230. }
  231. .re-from-label {
  232. font-size: 30rpx;
  233. font-weight: 500;
  234. color: #333;
  235. }
  236. .re-card-show {
  237. padding: 10rpx 20rpx;
  238. background-color: #007AFF;
  239. color: #fff;
  240. border-radius: 20rpx;
  241. font-size: 24rpx;
  242. }
  243. .re-card-context {
  244. margin-top: 20rpx;
  245. font-size: 26rpx;
  246. color: #666;
  247. line-height: 1.5;
  248. }
  249. .re-from-line {
  250. margin-bottom: 40rpx;
  251. &:last-child {
  252. margin-bottom: 0;
  253. }
  254. .re-from-label {
  255. font-size: 28rpx;
  256. margin-bottom: 20rpx;
  257. }
  258. }
  259. .b-relative {
  260. position: relative;
  261. }
  262. .re-from-input {
  263. width: 100%;
  264. height: 80rpx;
  265. padding: 0 60rpx 0 20rpx;
  266. border: 1rpx solid #e0e0e0;
  267. border-radius: 8rpx;
  268. font-size: 28rpx;
  269. box-sizing: border-box;
  270. }
  271. .re-from-textarea {
  272. width: 100%;
  273. height: 120rpx;
  274. padding: 20rpx;
  275. border: 1rpx solid #e0e0e0;
  276. border-radius: 8rpx;
  277. font-size: 28rpx;
  278. box-sizing: border-box;
  279. resize: none;
  280. }
  281. .re-from-icon {
  282. position: absolute;
  283. right: 20rpx;
  284. top: 50%;
  285. transform: translateY(-50%);
  286. width: 32rpx;
  287. height: 32rpx;
  288. }
  289. .h44 {
  290. height: 44rpx;
  291. }
  292. .re-radio {
  293. margin-right: 40rpx;
  294. font-size: 28rpx;
  295. }
  296. .re-width2 {
  297. width: calc(50% - 20rpx);
  298. }
  299. .re-width3 {
  300. width: calc(33.33% - 27rpx);
  301. }
  302. .re-end-pand {
  303. position: fixed;
  304. bottom: 0;
  305. left: 0;
  306. right: 0;
  307. padding: 20rpx;
  308. background-color: #fff;
  309. border-top: 1rpx solid #f0f0f0;
  310. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  311. button {
  312. width: 100%;
  313. height: 80rpx;
  314. line-height: 80rpx;
  315. background-color: #007AFF;
  316. color: #fff;
  317. border-radius: 40rpx;
  318. font-size: 32rpx;
  319. border: none;
  320. }
  321. }
  322. .b-fiexd {
  323. position: fixed;
  324. }
  325. </style>