用工小程序前端代码
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.

272 lines
9.2 KiB

11 months ago
9 months ago
11 months ago
11 months ago
11 months ago
9 months ago
11 months ago
9 months ago
11 months ago
8 months ago
11 months ago
8 months ago
11 months ago
8 months ago
11 months ago
8 months ago
9 months ago
11 months ago
11 months ago
11 months ago
9 months ago
9 months ago
11 months ago
9 months ago
11 months ago
9 months ago
11 months ago
9 months ago
11 months ago
11 months ago
8 months ago
1 month ago
1 month ago
1 month ago
8 months ago
8 months ago
11 months ago
  1. <template>
  2. <view class="se-p-40">
  3. <view class="se-fs-36 se-c-black se-fw-6 se-py-20">
  4. {{items.title}}
  5. </view>
  6. <!-- <view class="se-fs-26 se-c-orange se-fw-6 ">
  7. {{items.salaryMin}} - {{items.salaryMax}}/
  8. </view> -->
  9. <!-- 添加日薪月薪展示 -->
  10. <view class="se-flex se-flex-h-sb se-py-20 se-b-b">
  11. <view class="se-flex se-flex-v-c">
  12. <text class="se-fs-32 se-c-text-sub">试工日薪</text>
  13. <text class="se-fs-40 se-c-orange se-fw-6">{{ items.salaryDay }}</text>
  14. </view>
  15. <view class="se-flex se-flex-v-c">
  16. <text class="se-fs-32 se-c-text-sub">月薪</text>
  17. <text class="se-fs-40 se-c-orange se-fw-6">{{items.salaryMin}} - {{items.salaryMax}}</text>
  18. </view>
  19. </view>
  20. <!-- 添加试工时间显示 -->
  21. <view class="se-py-20 se-b-b" v-if="items.startTime && items.endTime">
  22. <view class="se-fs-32 se-c-black se-fw-6 se-pb-10">
  23. 试工时间
  24. </view>
  25. <view class="se-flex se-flex-v">
  26. <view class="se-fs-28 se-c-text-sub se-pb-5">
  27. <text>开始时间</text>
  28. <text class="se-c-black">{{ formatTime(items.startTime) }}</text>
  29. </view>
  30. <view class="se-fs-28 se-c-text-sub">
  31. <text>结束时间</text>
  32. <text class="se-c-black">{{ formatTime(items.endTime) }}</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="se-flex se-flex-v se-py-20">
  37. <view class="se-fs-24 se-c-text">
  38. <text>{{items.address}}</text>
  39. <!-- <text class="se-ml-20">不限</text> -->
  40. </view>
  41. <view class="se-fs-24 se-c-99 se-pt-20">
  42. 该职位位于{{items.createTime}}发布
  43. </view>
  44. </view>
  45. <view class="se-flex se-flex-h-sb se-py-40 se-b-b">
  46. <view class="se-flex">
  47. <view>
  48. <image class="se-a-80 se-br-p-50 se-bgc-f5" :src="items.employAuthenticationPerson.image" mode=""></image>
  49. </view>
  50. <view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
  51. <text class="se-fw-6 se-c-black se-fs-30">{{items.employAuthenticationCompany.name}}</text>
  52. <text class="se-fs-24 se-c-text-third">{{items.employAuthenticationCompany.company}}</text>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="se-py-40 se-b-b">
  57. <view class="se-fs-36 se-c-black">
  58. 工作地址
  59. </view>
  60. <view class="se-fs-24 se-c-66 se-pt-10 se-flex se-flex-h" @click="openAddress()">
  61. <text>{{items.address}}</text>
  62. <u-icon name="arrow-right"></u-icon>
  63. </view>
  64. </view>
  65. <view class="se-py-40 se-b-b">
  66. <view class="se-fs-36 se-c-black">
  67. 职位详情
  68. </view>
  69. <view class="se-pt-20">
  70. <text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5" v-if="items.payType != null && items.payType != undefined">
  71. <template v-if="items.payType == 0">提前支付</template>
  72. <template v-else>先试用后支付</template>
  73. </text>
  74. <text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5" v-if="items.categoryOne">{{items.categoryOne}}</text>
  75. <text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5" v-if="items.categoryTwo">{{items.categoryTwo}}</text>
  76. <!-- <text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5">水泥搬运</text> -->
  77. </view>
  78. </view>
  79. <view class="se-fs-24 se-pt-20 se-pb-20 se-lh-40">
  80. <text class="se-fs-24 se-c-text-third">岗位要求</text>
  81. <u-parse :content="items.details"></u-parse>
  82. </view>
  83. <view class="se-px-20 se-pt-20">
  84. <view class="se-px-20 se-pb-80 se-fs-20 se-flex">
  85. <view @click="onPayment"
  86. class="se-mx-10 se-flex-1 se-br-40 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-28 se-c-white se-bgc-orange">
  87. <text>立即应聘</text>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. getTaskById,orderTask,addOrderWork
  96. } from "@/common/api.js"
  97. export default{
  98. data(){
  99. return{
  100. id:"",
  101. items:{},
  102. }
  103. },
  104. onLoad(options) {
  105. console.info(options)
  106. this.id = options.id
  107. this.onTask()
  108. },
  109. methods:{
  110. onTask(){
  111. let that = this
  112. getTaskById({id:that.id}).then(response=>{
  113. console.info('getTaskById',response);
  114. that.items = response.result
  115. }).catch(error=>{
  116. })
  117. },
  118. formatTime(timeStr) {
  119. if (!timeStr) return '';
  120. // 将时间字符串转换为更友好的格式
  121. const date = new Date(timeStr);
  122. const year = date.getFullYear();
  123. const month = String(date.getMonth() + 1).padStart(2, '0');
  124. const day = String(date.getDate()).padStart(2, '0');
  125. const hours = String(date.getHours()).padStart(2, '0');
  126. const minutes = String(date.getMinutes()).padStart(2, '0');
  127. return `${year}-${month}-${day} ${hours}:${minutes}`;
  128. },
  129. onPayment(){
  130. uni.showLoading({
  131. title: '加载中'
  132. })
  133. // 检查个人认证状态
  134. this.$store.dispatch('onPersonalAuth', {
  135. success: (person) => {
  136. // 个人认证通过,继续检查简历状态
  137. this.$store.dispatch('onResumeComplete', {
  138. success: (resume) => {
  139. this.addOrderWork()
  140. },
  141. fail: (resume) => {
  142. uni.hideLoading()
  143. // 简历未完成
  144. uni.showModal({
  145. title: '提示',
  146. content: '请先完成简历信息,才能接单',
  147. showCancel: false,
  148. confirmText: '去完善',
  149. success: (res) => {
  150. if (res.confirm) {
  151. uni.navigateTo({
  152. url: '/pages_subpack/resume/index'
  153. })
  154. }
  155. }
  156. })
  157. }
  158. })
  159. },
  160. fail: (person) => {
  161. uni.hideLoading()
  162. // 个人认证未通过
  163. uni.showModal({
  164. title: '提示',
  165. content: '请先完成个人认证,审核通过后才能接单',
  166. showCancel: false,
  167. confirmText: '去认证',
  168. success: (res) => {
  169. if (res.confirm) {
  170. uni.navigateTo({
  171. url: '/pages_subpack/person/index'
  172. })
  173. }
  174. }
  175. })
  176. }
  177. })
  178. },
  179. addOrderWork(){
  180. // 简历已完成,执行接单操作
  181. addOrderWork({id:this.id}).then(response=>{
  182. uni.hideLoading()
  183. console.log("下单成功");
  184. // 根据订单状态决定是否跳转到支付页面
  185. if (response.result) {
  186. // uni.navigateTo({
  187. // url:"/pages_subpack/payment/index?id="+response.result.id
  188. // })
  189. uni.navigateTo({
  190. url:"/pages_subpack/order-detail/index?orderId="+response.result.id
  191. })
  192. } else {
  193. // 状态不为0时不跳转,可以显示提示信息
  194. uni.showToast({
  195. title: '操作完成',
  196. icon: 'success'
  197. })
  198. }
  199. }).catch(error=>{
  200. console.log(error);
  201. uni.hideLoading()
  202. // 处理错误情况
  203. if (error.result && error.result.id) {
  204. // 根据订单状态决定跳转
  205. // if (error.result.status == 0) {
  206. setTimeout(()=>{
  207. // if(error.result.orderStatusSeek == 'Y'){
  208. uni.navigateTo({
  209. url:"/pages_subpack/order-detail/index?orderId="+error.result.id
  210. })
  211. // }else{
  212. // uni.navigateTo({
  213. // url:"/pages_subpack/payment/index?id="+error.result.id
  214. // })
  215. // }
  216. }, 800);
  217. // } else {
  218. // // 显示错误信息
  219. // uni.showToast({
  220. // title: error.message || '操作失败',
  221. // icon: 'none'
  222. // })
  223. // }
  224. } else {
  225. uni.showToast({
  226. title: error.message || '操作失败',
  227. icon: 'none'
  228. })
  229. }
  230. })
  231. },
  232. openAddress(){
  233. let that = this
  234. console.info(that.items.latitude)
  235. console.info(that.items.longitude)
  236. wx.openLocation({
  237. latitude: Number(that.items.latitude),
  238. longitude: Number(that.items.longitude),
  239. name: that.items.title,
  240. address: that.items.address,
  241. scale: 12,
  242. success: function(res) {
  243. console.log(JSON.stringify(res));
  244. },
  245. fail: function(res) {
  246. console.log(`openLocation fail:${JSON.stringify(res)}`);
  247. }
  248. })
  249. // uni.openLocation({
  250. // latitude: 30.492121,
  251. // longitude: 114.410324,
  252. // name: "保利国际中心",
  253. // address: "武汉市洪山区关山大道",
  254. // scale: 12,
  255. // success: function(res) {
  256. // console.log(JSON.stringify(res));
  257. // },
  258. // fail: function(res) {
  259. // console.log(`openLocation fail:${JSON.stringify(res)}`);
  260. // }
  261. // })
  262. }
  263. }
  264. }
  265. </script>
  266. <style>
  267. page{
  268. background-color: #ffffff;
  269. }
  270. </style>