editJob.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="switch-roles">
  3. <nav-bar
  4. title="岗位描述"
  5. color="#000"
  6. background="#fff"
  7. border-bottom="true"
  8. ></nav-bar>
  9. <view class="roles-content">
  10. <view class="content">
  11. <view class="title">岗位描述</view>
  12. <!-- 提示文本 -->
  13. <view class="desc">
  14. 请填写岗位信息(工作内容、任务要求等),请勿包含联系方式、特殊符号或违规内容,否则可能导致账号封禁。
  15. </view>
  16. <!-- 输入区域 -->
  17. <view class="input-container">
  18. <textarea
  19. v-model="jobDesc"
  20. placeholder="1. 工作内容:例如负责客户对接、日常运营等
  21. 2. 任务要求:例如本科以上学历、熟练使用Excel等
  22. 3. 其他说明:例如周末双休、五险一金等"
  23. maxlength="500"
  24. class="textarea"
  25. @input="updateWordCount"
  26. ></textarea>
  27. <!-- 字数统计 -->
  28. <view class="word-count">
  29. <text :class="{ over: wordCount > 500 }">{{ wordCount }}</text>/500
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 提交按钮 -->
  35. <button
  36. class="submit-btn"
  37. @click="sendToPrevPage"
  38. :disabled="wordCount > 500"
  39. >
  40. 确定
  41. </button>
  42. </view>
  43. </template>
  44. <script>
  45. import navBar from "@/components/nav-bar/index.vue";
  46. export default {
  47. components: { navBar },
  48. data() {
  49. return {
  50. jobDesc: "", // 当前页填写的岗位描述
  51. wordCount: 0 // 字数统计
  52. };
  53. },
  54. methods: {
  55. // 实时更新字数
  56. updateWordCount(e) {
  57. this.wordCount = e.detail.value.length;
  58. },
  59. // 回传数据到上一页
  60. sendToPrevPage() {
  61. // 触发全局事件,传递当前页填写的岗位描述
  62. uni.$emit("jobDescUpdated", {
  63. desc: this.jobDesc
  64. });
  65. // 返回上一页
  66. uni.navigateBack({ delta: 1 });
  67. }
  68. }
  69. };
  70. </script>
  71. <style lang="scss" scoped>
  72. .switch-roles {
  73. position: absolute;
  74. top: 0;
  75. left: 0;
  76. right: 0;
  77. bottom: 0;
  78. background-color: #f5f5f5;
  79. display: flex;
  80. flex-direction: column;
  81. .roles-content {
  82. flex: 1;
  83. padding: 24rpx;
  84. overflow-y: auto;
  85. .content {
  86. background: #fff;
  87. border-radius: 16rpx;
  88. padding: 30rpx;
  89. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  90. .title {
  91. font-size: 34rpx;
  92. font-weight: 600;
  93. color: #333;
  94. margin-bottom: 20rpx;
  95. padding-bottom: 15rpx;
  96. border-bottom: 1rpx solid #eee;
  97. }
  98. .desc {
  99. font-size: 24rpx;
  100. color: #666;
  101. line-height: 36rpx;
  102. margin-bottom: 28rpx;
  103. padding: 12rpx 16rpx;
  104. background: #f9f9f9;
  105. border-radius: 8rpx;
  106. }
  107. .input-container {
  108. background: #f7f7f7;
  109. border-radius: 12rpx;
  110. padding: 24rpx;
  111. .textarea {
  112. width: 100%;
  113. min-height: 280rpx;
  114. font-size: 26rpx;
  115. color: #333;
  116. line-height: 1.6;
  117. background: transparent;
  118. padding: 0;
  119. margin-bottom: 12rpx;
  120. resize: none;
  121. &::placeholder {
  122. color: #999;
  123. line-height: 1.6;
  124. }
  125. }
  126. .word-count {
  127. text-align: right;
  128. font-size: 22rpx;
  129. color: #999;
  130. .over {
  131. color: #ff4d4f;
  132. font-weight: 500;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. .submit-btn {
  139. margin: 30rpx 24rpx;
  140. padding: 22rpx 0;
  141. width: calc(100% - 48rpx);
  142. background: linear-gradient(90deg, #0d27f7, #13c1ea);
  143. color: #fff;
  144. font-size: 32rpx;
  145. font-weight: 500;
  146. border-radius: 100rpx;
  147. box-shadow: 0 4rpx 12rpx rgba(19, 193, 234, 0.3);
  148. transition: all 0.2s;
  149. &:disabled {
  150. background: #e5e5e5;
  151. color: #999;
  152. box-shadow: none;
  153. }
  154. &:active {
  155. opacity: 0.9;
  156. transform: scale(0.99);
  157. }
  158. }
  159. }
  160. </style>