worker.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <template>
  2. <view>
  3. <view class="padding-top padding-lr">
  4. <view class="flex justify-between padding-lr-sm align-center infobox">
  5. <view class="cu-avatar lg round" v-if="workerinfo!=false"
  6. :style="'background-image:url('+workerinfo.tilpic+');'"></view>
  7. <view class="workerinfo padding-left-sm">
  8. <view class="text-df padding-bottom-xs">{{workerinfo.title}}</view>
  9. <view class="text-gray text-sm flex" v-if="workerinfo.status==1">
  10. <view class="cu-capsule round margin-right-sm">
  11. <view class="cu-tag sm bg-red">
  12. <text class="cuIcon-safe"></text>
  13. </view>
  14. <view class="cu-tag sm line-red">待审核</view>
  15. </view>
  16. </view>
  17. <view class="text-gray text-sm flex" v-else>
  18. <image src="../../static/images/worker/verified.png" style="width: 120rpx;" mode="widthFix"></image>
  19. <!-- <view class="cu-capsule round margin-right-sm">
  20. <view class="cu-tag sm bg-blue">
  21. <text class="cuIcon-safe"></text>
  22. </view>
  23. <view class="cu-tag sm line-blue">已认证</view>
  24. </view> -->
  25. </view>
  26. </view>
  27. <view class="btnbox action text-right text-lg">
  28. <image src="../../static/images/worker/worker_icon1.png" class="iconimage"
  29. @tap="getShopCode" v-if="appplatform!='ios'"></image>
  30. <image src="../../static/images/worker/worker_icon2.png" class="iconimage"
  31. data-pageurl="/pages/worker/winfo" @click="goPage"></image>
  32. <!-- <text class="cuIcon cuIcon-share padding-xs round" @tap="getShopCode"></text>
  33. <text class="cuIcon cuIcon-settings padding-xs round margin-left-lg" data-pageurl="/pages/worker/winfo" @click="goPage"></text> -->
  34. </view>
  35. </view>
  36. <view class="text-center padding-top grid col-3 margin-bottom-sm">
  37. <view class="padding-tb-sm">
  38. <view class="text-xxl">{{countobj[1]}}</view>
  39. <view class="text-gray text-sm">昨日浏览</view>
  40. </view>
  41. <view class="padding-tb-sm">
  42. <view class="text-xxl">{{countobj[2]}}</view>
  43. <view class="text-gray text-sm">今日浏览</view>
  44. </view>
  45. <view class="padding-tb-sm">
  46. <view class="text-xxl">{{countobj[3]}}</view>
  47. <view class="text-gray text-sm">累计访客</view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 轮播图 -->
  52. <swiper class="screen-swiper square-dot padding-lr margin-bottom" :indicator-dots="true" :circular="true"
  53. :autoplay="true" @change="cardSwiper" interval="5000" duration="500" indicator-color="#8799a3"
  54. indicator-active-color="#0081ff">
  55. <block v-for="(item,index) in slide" :key="index">
  56. <swiper-item class="radius" @tap="pageUrl(item.stype, item.tilurl)">
  57. <image :src="item.tilpic" mode="scaleToFill"></image>
  58. </swiper-item>
  59. </block>
  60. </swiper>
  61. <!-- 导航 -->
  62. <view class="text-center solid-bottom padding-lr margin-bottom">
  63. <view class="cu-list grid col-1 no-border shadow shadow-lg radius echo-grid"
  64. style="padding: 0rpx !important;" v-if="workerinfo.wtype==1">
  65. <view class="cu-item" data-pageurl="/pages/worker/wcomform" @tap="goPage">
  66. <image src="../../static/images/worker/worker_comjobs.png" mode="scaleToFill"></image>
  67. <text>发布招聘</text>
  68. </view>
  69. <!-- <view class="cu-item" data-pageurl="/pages/mall/mall" @tap="goPage">
  70. <image :src="$getImageUrl('static/images/applet/worker_mall.png')" mode="scaleToFill"></image>
  71. <text>积分商城</text>
  72. </view> -->
  73. </view>
  74. <view class="cu-list grid col-3 no-border shadow shadow-lg radius echo-grid"
  75. style="padding: 0rpx !important;" v-else>
  76. <view class="cu-item" data-pageurl="/pages/worker/wcomform" @tap="goPage">
  77. <image src="../../static/images/worker/worker_comjobs.png" mode="scaleToFill"></image>
  78. <text>发布招聘</text>
  79. </view>
  80. <view class="cu-item" data-pageurl="/pages/demand/demandform" @tap="goPage">
  81. <image src="../../static/images/worker/worker_demand.png" mode="scaleToFill"></image>
  82. <text>发布派遣</text>
  83. </view>
  84. <view class="cu-item" data-pageurl="/pages/supply/supplyform" @tap="goPage">
  85. <image src="../../static/images/worker/worker_supply.png" mode="scaleToFill"></image>
  86. <text>发布供人</text>
  87. </view>
  88. <!-- <view class="cu-item" data-pageurl="/pages/mall/mall" @tap="goPage">
  89. <image :src="$getImageUrl('static/images/applet/worker_mall.png')" mode="scaleToFill"></image>
  90. <text>积分商城</text>
  91. </view> -->
  92. </view>
  93. </view>
  94. <view class="padding-lr-lg padding-tb-xs">
  95. <text class="text-gray">其他功能</text>
  96. </view>
  97. <view class="padding-lr margin-tb-sm">
  98. <view class="cu-list grid col-3 no-border shadow shadow-lg radius echo-grid workernav-grid">
  99. <view class="cu-item" data-pageurl="/pages/worker/wcomlist" @tap="goPage">
  100. <image src="../../static/images/worker/workernav1.png" mode="scaleToFill"></image>
  101. <text>我的招聘</text>
  102. </view>
  103. <view class="cu-item" data-pageurl="/pages/worker/invite" @tap="goPage">
  104. <image src="../../static/images/worker/workernav8.png" mode="scaleToFill"></image>
  105. <text>我的邀请</text>
  106. </view>
  107. <view v-if="workerinfo.wtype==2" class="cu-item" data-pageurl="/pages/demand/wdemandlist" @tap="goPage">
  108. <image src="../../static/images/worker/workernav3.png" mode="scaleToFill"></image>
  109. <text>派遣订单</text>
  110. </view>
  111. <view class="cu-item" data-pageurl="/pages/supply/wsupplylist" @tap="goPage" v-if="workerinfo.wtype==2">
  112. <image src="../../static/images/worker/workernav2.png" mode="scaleToFill"></image>
  113. <text>我的供人</text>
  114. </view>
  115. <view class="cu-item" data-pageurl="/pages/worker/wcomlog" @tap="goPage">
  116. <image src="../../static/images/worker/workernav6.png" mode="scaleToFill"></image>
  117. <text>招聘报名记录</text>
  118. </view>
  119. <view class="cu-item" data-pageurl="/pages/worker/wreportlist" @tap="goPage">
  120. <image src="../../static/images/worker/workernav13.png" mode="scaleToFill"></image>
  121. <text>悬赏记录</text>
  122. </view>
  123. <view class="cu-item" data-pageurl="/pages/demand/snatch" @tap="goPage" v-if="workerinfo.wtype==2">
  124. <image src="../../static/images/worker/workernav4.png" mode="scaleToFill"></image>
  125. <text>我接的派遣</text>
  126. </view>
  127. <!-- <view class="cu-item" data-pageurl="/pages/my/myintegral" @tap="goPage">
  128. <image :src="$getImageUrl('static/images/applet/workernav5.png')" mode="scaleToFill"></image>
  129. <text>我的积分</text>
  130. </view> -->
  131. <!-- <view v-if="workerinfo.wtype==1" class="cu-item" data-pageurl="/pages/worker/wupdate" @tap="goPage">
  132. <image :src="$getImageUrl('static/images/applet/workernav10.png')" mode="scaleToFill"></image>
  133. <text>升级到派遣</text>
  134. </view> -->
  135. <!--
  136. <view class="cu-item" data-pageurl="/pages/form/form?formid=3" @click="goHome">
  137. <image :src="$getImageUrl('static/images/applet/workernav7.png')" mode="scaleToFill"></image>
  138. <text>切换身份</text>
  139. </view>
  140. <view class="cu-item" data-pageurl="/pages/form/form?formid=3" @tap="goPage">
  141. <image :src="$getImageUrl('static/images/applet/workernav7.png')" mode="scaleToFill"></image>
  142. <text>申请加盟</text>
  143. </view>
  144. <view class="cu-item" data-pageurl="/pages/form/form?formid=5" @tap="goPage">
  145. <image :src="$getImageUrl('static/images/applet/workernav8.png')" mode="scaleToFill"></image>
  146. <text>工厂招聘</text>
  147. </view>
  148. -->
  149. <view class="cu-item" data-pageurl="/pages/worker/wshare" @tap="goPage" v-if="appplatform!='ios'">
  150. <image src="../../static/images/worker/workernav9.png" mode="scaleToFill"></image>
  151. <text>获客海报</text>
  152. </view>
  153. <!-- <view class="cu-item" data-pageurl="/pages/article/article" @tap="goPage">
  154. <image :src="$getImageUrl('static/images/applet/workernav11.png')" mode="scaleToFill"></image>
  155. <text>资讯中心</text>
  156. </view> -->
  157. <!-- <view class="cu-item" data-pageurl="/pages/worker/mpaccount" @tap="goPage" v-if="appplatform!='ios' && workerinfo.wtype==2">
  158. <image :src="$getImageUrl('static/images/applet/workernav12.png')" mode="scaleToFill"></image>
  159. <text>嵌入公众号</text>
  160. </view> -->
  161. </view>
  162. </view>
  163. <!-- <view class="padding-sm"></view> -->
  164. <view class="padding-lg"></view>
  165. <view class="cu-bar tabbar bg-white foot">
  166. <view class="action text-red" @tap="goNavPage('/pages/worker/worker')">
  167. <view class="cuIcon-cu-image">
  168. <image src="../../static/tabbar/windexSelected.png"></image>
  169. </view>
  170. 首页
  171. </view>
  172. <view class="action text-gray" @tap="goNavPage('/pages/demand/demand')" v-if="workerinfo.wtype==2">
  173. <view class="cuIcon-cu-image">
  174. <image src="../../static/tabbar/wdemand.png"></image>
  175. </view>
  176. 抢单大厅
  177. </view>
  178. <!-- #ifndef MP-WEIXIN -->
  179. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/video')">
  180. <view class="cuIcon-cu-image">
  181. <image src="../../static/tabbar/video.png"></image>
  182. </view>
  183. 录视频
  184. </view>
  185. <!-- #endif -->
  186. <view class="action text-gray" @tap="goNavPage('/pages/resume/resume')">
  187. <view class="cuIcon-cu-image">
  188. <image src="../../static/tabbar/resume.png"></image>
  189. </view>
  190. 简历
  191. </view>
  192. <view class="action text-gray" @tap="goNavPage('/pages/supply/supply')" v-if="workerinfo.wtype==2">
  193. <view class="cuIcon-cu-image">
  194. <image src="../../static/tabbar/wsupply.png"></image>
  195. </view>
  196. 共享用工
  197. </view>
  198. <!--
  199. <view class="action text-gray" @tap="goNavPage('/pages/worker/workerlist')">
  200. <view class="cuIcon-cu-image">
  201. <image src="../../static/tabbar/wworker.png"></image>
  202. </view>
  203. 企业1
  204. </view>
  205. -->
  206. </view>
  207. <button class="cu-btn bg-themeBtn lg shadow echo-gohome" @tap="goHome"> 切换身份 </button>
  208. <wxContact></wxContact>
  209. <view class="padding-xl"></view>
  210. <view class="cu-modal" :class="modal.name=='regworker'?'show':''" @tap="hideModal">
  211. <view class="cu-dialog picmodal" @tap.stop="">
  212. <view class="bg-img">
  213. <image mode="widthFix" style="display: block;" :src="picregworker" v-if="picregworker"></image>
  214. <view class="cu-bar justify-end text-white picmodalclose">
  215. <view class="action" @tap="hideModal">
  216. <text class="cuIcon-close "></text>
  217. </view>
  218. </view>
  219. </view>
  220. <view class="cu-bar bg-white radius">
  221. <view class="action margin-0 flex-sub solid-left" @tap="getWorkerIntegral">立即领取</view>
  222. </view>
  223. </view>
  224. </view>
  225. <!-- <view class="cu-modal" :class="modal.name=='regworker'?'show':''">
  226. <view class="cu-dialog">
  227. <view class="cu-bar bg-white justify-end">
  228. <view class="content">奖励积分</view>
  229. <view class="action" @tap="hideModal">
  230. <text class="cuIcon-close text-red"></text>
  231. </view>
  232. </view>
  233. <view class="padding-xl text-lg">
  234. <view class="solid-bottom text-xsl padding-bottom">
  235. <text class=" cuIcon-selection text-red"></text>
  236. </view>
  237. <view class="text-xl">
  238. 恭喜您,注册的劳务公司账号审核通过,获得 {{intregworker}} 积分,请点击领取...
  239. </view>
  240. </view>
  241. <view class="cu-bar bg-white justify-end">
  242. <view class="action">
  243. <button class="cu-btn" @tap="hideModal">取消</button>
  244. <button class="cu-btn bg-blue margin-left" @tap="getWorkerIntegral">立即领取</button>
  245. </view>
  246. </view>
  247. </view>
  248. </view> -->
  249. <view class="cu-modal" :class="modal.name=='shopcode'?'show':''" @tap="hideModal">
  250. <view class="cu-dialog picmodal" @tap.stop="">
  251. <view class="bg-img">
  252. <image mode="widthFix" :src="modal.shopcode" v-if="modal.shopcode"></image>
  253. <view class="cu-bar justify-end text-white picmodalclose">
  254. <view class="action" @tap="hideModal">
  255. <text class="cuIcon-close "></text>
  256. </view>
  257. </view>
  258. </view>
  259. <view class="cu-bar bg-white margin-top-xs">
  260. <view class="action margin-0 flex-sub solid-left" @tap="saveImage">保存到相册</view>
  261. </view>
  262. </view>
  263. </view>
  264. </view>
  265. </template>
  266. <script>
  267. var _this;
  268. export default {
  269. data() {
  270. return {
  271. appplatform: "",
  272. isRotate: false,
  273. userinfo: false,
  274. workerinfo: {},
  275. picregworker: "",
  276. intregworker: 0,
  277. slide: {},
  278. cardCur: 0,
  279. countobj: {
  280. tentry: 0,
  281. entry: 0
  282. },
  283. modal: {
  284. name: "",
  285. shopcode: ""
  286. }
  287. }
  288. },
  289. onLoad: function() {
  290. _this = this;
  291. //#ifdef APP-PLUS
  292. _this.appplatform = uni.getSystemInfoSync().platform;
  293. //#endif
  294. _this.userinfo = uni.getStorageSync('userinfo') || false;
  295. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  296. if (_this.workerinfo === false) {
  297. uni.reLaunch({
  298. url: "/pages/my/my"
  299. });
  300. return false;
  301. }
  302. _this.$req.ajax({
  303. path: "worker/pageworker",
  304. data: {
  305. userid: _this.userinfo.id,
  306. workerid: _this.workerinfo.id
  307. }
  308. }).then((data) => {
  309. _this.countobj = data.countobj;
  310. _this.slide = data.slide;
  311. _this.picregworker = data.picregworker;
  312. _this.intregworker = data.intregworker;
  313. if (_this.intregworker > 0) {
  314. _this.modal.name = "regworker";
  315. }
  316. _this.workerinfo = data.workerinfo;
  317. uni.setStorageSync('workerinfo', _this.workerinfo);
  318. }).catch((err) => {
  319. uni.showModal({
  320. title: '信息提示',
  321. content: err,
  322. showCancel: false
  323. });
  324. });
  325. },
  326. methods: {
  327. getWorkerIntegral: function() {
  328. if (_this.isRotate) {
  329. return false;
  330. }
  331. _this.isRotate = true;
  332. _this.$req.ajax({
  333. title: "积分发放中...",
  334. path: "worker/getworkerintegral",
  335. data: {
  336. userid: _this.userinfo.id,
  337. workerid: _this.workerinfo.id
  338. }
  339. }).then((data) => {
  340. uni.showToast({
  341. title: '积分领取成功',
  342. duration: 2000
  343. });
  344. _this.intregworker = 0;
  345. _this.modal.name = "";
  346. _this.isRotate = false;
  347. }).catch((err) => {
  348. uni.showModal({
  349. title: '温馨提示',
  350. content: err,
  351. showCancel: false
  352. });
  353. _this.isRotate = false;
  354. });
  355. },
  356. saveImage: function() {
  357. uni.downloadFile({
  358. url: _this.modal.shopcode, //仅为示例,并非真实的资源
  359. success: (res) => {
  360. if (res.statusCode === 200) {
  361. uni.saveImageToPhotosAlbum({
  362. filePath: res.tempFilePath,
  363. success: function() {
  364. uni.showModal({
  365. title: '信息提示',
  366. content: "已保存到手机相册,注意查收。",
  367. showCancel: false
  368. });
  369. }
  370. });
  371. }
  372. }
  373. });
  374. },
  375. getShopCode: function() {
  376. _this.$req.ajax({
  377. title: "微店二维码生成中...",
  378. path: "worker/getshopcode",
  379. data: {
  380. workerid: _this.workerinfo.id,
  381. parentid: _this.userinfo == false ? 0 : _this.userinfo.id
  382. }
  383. }).then((data) => {
  384. _this.modal.shopcode = data.shopcode;
  385. _this.modal.name = "shopcode";
  386. }).catch((err) => {
  387. uni.showModal({
  388. title: '温馨提示',
  389. content: err,
  390. showCancel: false
  391. });
  392. });
  393. },
  394. hideModal: function() {
  395. _this.modal.name = "";
  396. },
  397. goHome: function() {
  398. uni.setStorageSync('identityinfo', false);
  399. uni.setStorageSync('workerinfo', null);
  400. uni.reLaunch({
  401. url: "/pages/index/home"
  402. });
  403. },
  404. workerOut: function() {
  405. uni.setStorageSync('workerinfo', null);
  406. uni.reLaunch({
  407. url: "/pages/index/home"
  408. });
  409. },
  410. goNavPage: function(pageurl) {
  411. _this.userinfo = _this.checkLogin("/pages/my/my");
  412. if (_this.userinfo === false) {
  413. return false;
  414. }
  415. uni.redirectTo({
  416. url: pageurl
  417. });
  418. },
  419. goPage: function(e) {
  420. var pageurl = e.currentTarget.dataset.pageurl;
  421. uni.navigateTo({
  422. url: pageurl,
  423. fail: function() {
  424. uni.switchTab({
  425. url: pageurl
  426. });
  427. }
  428. });
  429. },
  430. cardSwiper: function(e) {
  431. _this.cardCur = e.detail.current
  432. },
  433. pageUrl: function(type, tilurl) {
  434. if (type == 1) {
  435. uni.navigateTo({
  436. url: tilurl,
  437. fail: function() {
  438. uni.switchTab({
  439. url: tilurl
  440. });
  441. }
  442. });
  443. } else {
  444. uni.navigateTo({
  445. url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(tilurl)
  446. });
  447. }
  448. },
  449. }
  450. }
  451. </script>
  452. <style>
  453. .workernav-grid image {
  454. width: 70rpx;
  455. height: 70rpx;
  456. margin-bottom: 10rpx;
  457. }
  458. .infobox {}
  459. .infobox .cu-avatar {
  460. width: 100rpx;
  461. }
  462. .infobox .workerinfo {
  463. width: 380rpx;
  464. }
  465. .infobox .btnbox {
  466. width: 190rpx;
  467. }
  468. .codebox {
  469. /* width: 690rpx;
  470. margin: 0rpx auto 0rpx auto;
  471. border-radius: 8rpx;
  472. overflow: hidden; */
  473. }
  474. .iconimage {
  475. width: 34rpx;
  476. height: 34rpx;
  477. margin-left: 30rpx;
  478. }
  479. .echo-grid image {
  480. width: 48rpx;
  481. height: 48rpx;
  482. margin-bottom: 10rpx;
  483. }
  484. .wnavbox {}
  485. .wnavbox .wcomitem {
  486. width: 340rpx !important;
  487. margin-bottom: 15rpx;
  488. }
  489. .wnavbox .wcomitem image {
  490. display: block;
  491. width: 70rpx;
  492. height: 70rpx;
  493. }
  494. .wnavbox .wcomitem .wcomtil {
  495. width: 210rpx;
  496. line-height: 90rpx;
  497. padding-left: 20rpx;
  498. color: #0081FF;
  499. font-size: 30rpx;
  500. }
  501. .picmodal {
  502. width: 640rpx;
  503. background-color: transparent;
  504. }
  505. .picmodal image {
  506. width: 100%;
  507. }
  508. .picmodal .bg-img {
  509. position: relative;
  510. }
  511. .picmodalclose {
  512. position: absolute;
  513. top: 0rpx;
  514. right: 0rpx;
  515. }
  516. .screen-swiper {
  517. min-height: 160rpx;
  518. height: 160rpx;
  519. }
  520. </style>