editJob.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="2000"
  24. class="textarea"
  25. @input="updateWordCount"
  26. ></textarea>
  27. <!-- 字数统计 -->
  28. <view class="word-count">
  29. <text :class="{ over: wordCount > 2000 }">{{ wordCount }}</text>/2000
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 提交按钮 -->
  35. <button
  36. class="submit-btn"
  37. @click="sendToPrevPage"
  38. :disabled="wordCount > 2000"
  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. onLoad(options) {
  55. // 接收上个页面传递的公司名称参数
  56. if(options.text){
  57. this.jobDesc=options.text
  58. }
  59. },
  60. methods: {
  61. // 实时更新字数
  62. updateWordCount(e) {
  63. this.wordCount = e.detail.value.length;
  64. },
  65. // 回传数据到上一页
  66. sendToPrevPage() {
  67. // 触发全局事件,传递当前页填写的岗位描述
  68. uni.$emit("jobDescUpdated", {
  69. desc: this.jobDesc
  70. });
  71. // 返回上一页
  72. uni.navigateBack({ delta: 1 });
  73. }
  74. }
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .switch-roles {
  79. position: absolute;
  80. top: 0;
  81. left: 0;
  82. right: 0;
  83. bottom: 0;
  84. background-color: #f5f5f5;
  85. display: flex;
  86. flex-direction: column;
  87. .roles-content {
  88. flex: 1;
  89. padding: 24rpx;
  90. overflow-y: auto;
  91. .content {
  92. background: #fff;
  93. border-radius: 16rpx;
  94. padding: 30rpx;
  95. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  96. .title {
  97. font-size: 34rpx;
  98. font-weight: 600;
  99. color: #333;
  100. margin-bottom: 20rpx;
  101. padding-bottom: 15rpx;
  102. border-bottom: 1rpx solid #eee;
  103. }
  104. .desc {
  105. font-size: 24rpx;
  106. color: #666;
  107. line-height: 36rpx;
  108. margin-bottom: 28rpx;
  109. padding: 12rpx 16rpx;
  110. background: #f9f9f9;
  111. border-radius: 8rpx;
  112. }
  113. .input-container {
  114. background: #f7f7f7;
  115. border-radius: 12rpx;
  116. padding: 24rpx;
  117. .textarea {
  118. width: 100%;
  119. min-height: 280rpx;
  120. font-size: 26rpx;
  121. color: #333;
  122. line-height: 1.6;
  123. background: transparent;
  124. padding: 0;
  125. margin-bottom: 12rpx;
  126. resize: none;
  127. &::placeholder {
  128. color: #999;
  129. line-height: 1.6;
  130. }
  131. }
  132. .word-count {
  133. text-align: right;
  134. font-size: 22rpx;
  135. color: #999;
  136. .over {
  137. color: #ff4d4f;
  138. font-weight: 500;
  139. }
  140. }
  141. }
  142. }
  143. }
  144. .submit-btn {
  145. margin: 30rpx 24rpx;
  146. // padding: 22rpx 0;
  147. width: calc(100% - 48rpx);
  148. background: linear-gradient(90deg, #0d27f7, #13c1ea);
  149. color: #fff;
  150. font-size: 32rpx;
  151. font-weight: 500;
  152. border-radius: 100rpx;
  153. box-shadow: 0 4rpx 12rpx rgba(19, 193, 234, 0.3);
  154. transition: all 0.2s;
  155. &:disabled {
  156. background: #e5e5e5;
  157. color: #999;
  158. box-shadow: none;
  159. }
  160. &:active {
  161. opacity: 0.9;
  162. transform: scale(0.99);
  163. }
  164. }
  165. }
  166. </style>