worker.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/worker/worker_icon1.png')" class="iconimage"
  29. @tap="getShopCode" v-if="appplatform!='ios'"></image>
  30. <image :src="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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/outjoblist" @tap="goPage" v-if="workerinfo.wtype==2">
  150. <image :src="$getImageUrl('static/images/applet/worker/workernav1.png')" mode="scaleToFill"></image>
  151. <text>省外招聘</text>
  152. </view>
  153. <view class="cu-item" data-pageurl="/pages/worker/wshare" @tap="goPage" v-if="appplatform!='ios'">
  154. <image :src="$getImageUrl('static/images/applet/worker/workernav9.png')" mode="scaleToFill"></image>
  155. <text>获客海报</text>
  156. </view>
  157. <!-- <view class="cu-item" data-pageurl="/pages/article/article" @tap="goPage">
  158. <image :src="$getImageUrl('static/images/applet/workernav11.png')" mode="scaleToFill"></image>
  159. <text>资讯中心</text>
  160. </view> -->
  161. <!-- <view class="cu-item" data-pageurl="/pages/worker/mpaccount" @tap="goPage" v-if="appplatform!='ios' && workerinfo.wtype==2">
  162. <image :src="$getImageUrl('static/images/applet/workernav12.png')" mode="scaleToFill"></image>
  163. <text>嵌入公众号</text>
  164. </view> -->
  165. </view>
  166. </view>
  167. <!-- <view class="padding-sm"></view> -->
  168. <view class="padding-lg"></view>
  169. <view class="cu-bar tabbar bg-white foot">
  170. <view class="action text-red" @tap="goNavPage('/pages/worker/worker')">
  171. <view class="cuIcon-cu-image">
  172. <image src="../../static/tabbar/windexSelected.png"></image>
  173. </view>
  174. 首页
  175. </view>
  176. <view class="action text-gray" @tap="goNavPage('/pages/demand/demand')" v-if="workerinfo.wtype==2">
  177. <view class="cuIcon-cu-image">
  178. <image src="../../static/tabbar/wdemand.png"></image>
  179. </view>
  180. 抢单大厅
  181. </view>
  182. <!-- #ifndef MP-WEIXIN -->
  183. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/video')">
  184. <view class="cuIcon-cu-image">
  185. <image src="../../static/tabbar/video.png"></image>
  186. </view>
  187. 录视频
  188. </view>
  189. <!-- #endif -->
  190. <view class="action text-gray" @tap="goNavPage('/pages/resume/resume')">
  191. <view class="cuIcon-cu-image">
  192. <image src="../../static/tabbar/resume.png"></image>
  193. </view>
  194. 简历
  195. </view>
  196. <view class="action text-gray" @tap="goNavPage('/pages/supply/supply')" v-if="workerinfo.wtype==2">
  197. <view class="cuIcon-cu-image">
  198. <image src="../../static/tabbar/wsupply.png"></image>
  199. </view>
  200. 共享用工
  201. </view>
  202. <!--
  203. <view class="action text-gray" @tap="goNavPage('/pages/worker/workerlist')">
  204. <view class="cuIcon-cu-image">
  205. <image src="../../static/tabbar/wworker.png"></image>
  206. </view>
  207. 企业1
  208. </view>
  209. -->
  210. </view>
  211. <button class="cu-btn bg-themeBtn lg shadow echo-gohome" @tap="goHome"> 切换身份 </button>
  212. <wxContact></wxContact>
  213. <view class="padding-xl"></view>
  214. <view class="cu-modal" :class="modal.name=='regworker'?'show':''" @tap="hideModal">
  215. <view class="cu-dialog picmodal" @tap.stop="">
  216. <view class="bg-img">
  217. <image mode="widthFix" style="display: block;" :src="picregworker" v-if="picregworker"></image>
  218. <view class="cu-bar justify-end text-white picmodalclose">
  219. <view class="action" @tap="hideModal">
  220. <text class="cuIcon-close "></text>
  221. </view>
  222. </view>
  223. </view>
  224. <view class="cu-bar bg-white radius">
  225. <view class="action margin-0 flex-sub solid-left" @tap="getWorkerIntegral">立即领取</view>
  226. </view>
  227. </view>
  228. </view>
  229. <!-- <view class="cu-modal" :class="modal.name=='regworker'?'show':''">
  230. <view class="cu-dialog">
  231. <view class="cu-bar bg-white justify-end">
  232. <view class="content">奖励积分</view>
  233. <view class="action" @tap="hideModal">
  234. <text class="cuIcon-close text-red"></text>
  235. </view>
  236. </view>
  237. <view class="padding-xl text-lg">
  238. <view class="solid-bottom text-xsl padding-bottom">
  239. <text class=" cuIcon-selection text-red"></text>
  240. </view>
  241. <view class="text-xl">
  242. 恭喜您,注册的劳务公司账号审核通过,获得 {{intregworker}} 积分,请点击领取...
  243. </view>
  244. </view>
  245. <view class="cu-bar bg-white justify-end">
  246. <view class="action">
  247. <button class="cu-btn" @tap="hideModal">取消</button>
  248. <button class="cu-btn bg-blue margin-left" @tap="getWorkerIntegral">立即领取</button>
  249. </view>
  250. </view>
  251. </view>
  252. </view> -->
  253. <view class="cu-modal" :class="modal.name=='shopcode'?'show':''" @tap="hideModal">
  254. <view class="cu-dialog picmodal" @tap.stop="">
  255. <view class="bg-img">
  256. <image mode="widthFix" :src="modal.shopcode" v-if="modal.shopcode"></image>
  257. <view class="cu-bar justify-end text-white picmodalclose">
  258. <view class="action" @tap="hideModal">
  259. <text class="cuIcon-close "></text>
  260. </view>
  261. </view>
  262. </view>
  263. <view class="cu-bar bg-white margin-top-xs">
  264. <view class="action margin-0 flex-sub solid-left" @tap="saveImage">保存到相册</view>
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </template>
  270. <script>
  271. var _this;
  272. export default {
  273. data() {
  274. return {
  275. appplatform: "",
  276. isRotate: false,
  277. userinfo: false,
  278. workerinfo: {},
  279. picregworker: "",
  280. intregworker: 0,
  281. slide: {},
  282. cardCur: 0,
  283. countobj: {
  284. tentry: 0,
  285. entry: 0
  286. },
  287. modal: {
  288. name: "",
  289. shopcode: ""
  290. }
  291. }
  292. },
  293. onLoad: function() {
  294. _this = this;
  295. //#ifdef APP-PLUS
  296. _this.appplatform = uni.getSystemInfoSync().platform;
  297. //#endif
  298. _this.userinfo = uni.getStorageSync('userinfo') || false;
  299. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  300. if (_this.workerinfo === false) {
  301. uni.reLaunch({
  302. url: "/pages/my/my"
  303. });
  304. return false;
  305. }
  306. _this.$req.ajax({
  307. path: "worker/pageworker",
  308. data: {
  309. userid: _this.userinfo.id,
  310. workerid: _this.workerinfo.id
  311. }
  312. }).then((data) => {
  313. _this.countobj = data.countobj;
  314. _this.slide = data.slide;
  315. _this.picregworker = data.picregworker;
  316. _this.intregworker = data.intregworker;
  317. if (_this.intregworker > 0) {
  318. _this.modal.name = "regworker";
  319. }
  320. _this.workerinfo = data.workerinfo;
  321. uni.setStorageSync('workerinfo', _this.workerinfo);
  322. }).catch((err) => {
  323. uni.showModal({
  324. title: '信息提示',
  325. content: err,
  326. showCancel: false
  327. });
  328. });
  329. },
  330. methods: {
  331. getWorkerIntegral: function() {
  332. if (_this.isRotate) {
  333. return false;
  334. }
  335. _this.isRotate = true;
  336. _this.$req.ajax({
  337. title: "积分发放中...",
  338. path: "worker/getworkerintegral",
  339. data: {
  340. userid: _this.userinfo.id,
  341. workerid: _this.workerinfo.id
  342. }
  343. }).then((data) => {
  344. uni.showToast({
  345. title: '积分领取成功',
  346. duration: 2000
  347. });
  348. _this.intregworker = 0;
  349. _this.modal.name = "";
  350. _this.isRotate = false;
  351. }).catch((err) => {
  352. uni.showModal({
  353. title: '温馨提示',
  354. content: err,
  355. showCancel: false
  356. });
  357. _this.isRotate = false;
  358. });
  359. },
  360. saveImage: function() {
  361. uni.downloadFile({
  362. url: _this.modal.shopcode, //仅为示例,并非真实的资源
  363. success: (res) => {
  364. if (res.statusCode === 200) {
  365. uni.saveImageToPhotosAlbum({
  366. filePath: res.tempFilePath,
  367. success: function() {
  368. uni.showModal({
  369. title: '信息提示',
  370. content: "已保存到手机相册,注意查收。",
  371. showCancel: false
  372. });
  373. }
  374. });
  375. }
  376. }
  377. });
  378. },
  379. getShopCode: function() {
  380. _this.$req.ajax({
  381. title: "微店二维码生成中...",
  382. path: "worker/getshopcode",
  383. data: {
  384. workerid: _this.workerinfo.id,
  385. parentid: _this.userinfo == false ? 0 : _this.userinfo.id
  386. }
  387. }).then((data) => {
  388. _this.modal.shopcode = data.shopcode;
  389. _this.modal.name = "shopcode";
  390. }).catch((err) => {
  391. uni.showModal({
  392. title: '温馨提示',
  393. content: err,
  394. showCancel: false
  395. });
  396. });
  397. },
  398. hideModal: function() {
  399. _this.modal.name = "";
  400. },
  401. goHome: function() {
  402. uni.setStorageSync('identityinfo', false);
  403. uni.setStorageSync('workerinfo', null);
  404. uni.reLaunch({
  405. url: "/pages/index/home"
  406. });
  407. },
  408. workerOut: function() {
  409. uni.setStorageSync('workerinfo', null);
  410. uni.reLaunch({
  411. url: "/pages/index/home"
  412. });
  413. },
  414. goNavPage: function(pageurl) {
  415. _this.userinfo = _this.checkLogin("/pages/my/my");
  416. if (_this.userinfo === false) {
  417. return false;
  418. }
  419. uni.redirectTo({
  420. url: pageurl
  421. });
  422. },
  423. goPage: function(e) {
  424. var pageurl = e.currentTarget.dataset.pageurl;
  425. uni.navigateTo({
  426. url: pageurl,
  427. fail: function() {
  428. uni.switchTab({
  429. url: pageurl
  430. });
  431. }
  432. });
  433. },
  434. cardSwiper: function(e) {
  435. _this.cardCur = e.detail.current
  436. },
  437. pageUrl: function(type, tilurl) {
  438. if (type == 1) {
  439. uni.navigateTo({
  440. url: tilurl,
  441. fail: function() {
  442. uni.switchTab({
  443. url: tilurl
  444. });
  445. }
  446. });
  447. } else {
  448. uni.navigateTo({
  449. url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(tilurl)
  450. });
  451. }
  452. },
  453. }
  454. }
  455. </script>
  456. <style>
  457. .workernav-grid image {
  458. width: 70rpx;
  459. height: 70rpx;
  460. margin-bottom: 10rpx;
  461. }
  462. .infobox {}
  463. .infobox .cu-avatar {
  464. width: 100rpx;
  465. }
  466. .infobox .workerinfo {
  467. width: 380rpx;
  468. }
  469. .infobox .btnbox {
  470. width: 190rpx;
  471. }
  472. .codebox {
  473. /* width: 690rpx;
  474. margin: 0rpx auto 0rpx auto;
  475. border-radius: 8rpx;
  476. overflow: hidden; */
  477. }
  478. .iconimage {
  479. width: 34rpx;
  480. height: 34rpx;
  481. margin-left: 30rpx;
  482. }
  483. .echo-grid image {
  484. width: 48rpx;
  485. height: 48rpx;
  486. margin-bottom: 10rpx;
  487. }
  488. .wnavbox {}
  489. .wnavbox .wcomitem {
  490. width: 340rpx !important;
  491. margin-bottom: 15rpx;
  492. }
  493. .wnavbox .wcomitem image {
  494. display: block;
  495. width: 70rpx;
  496. height: 70rpx;
  497. }
  498. .wnavbox .wcomitem .wcomtil {
  499. width: 210rpx;
  500. line-height: 90rpx;
  501. padding-left: 20rpx;
  502. color: #0081FF;
  503. font-size: 30rpx;
  504. }
  505. .picmodal {
  506. width: 640rpx;
  507. background-color: transparent;
  508. }
  509. .picmodal image {
  510. width: 100%;
  511. }
  512. .picmodal .bg-img {
  513. position: relative;
  514. }
  515. .picmodalclose {
  516. position: absolute;
  517. top: 0rpx;
  518. right: 0rpx;
  519. }
  520. .screen-swiper {
  521. min-height: 160rpx;
  522. height: 160rpx;
  523. }
  524. </style>