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

244 lines
8.1 KiB

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