worker.vue 17 KB

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