my.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template name="mypage">
  2. <view class="mypage">
  3. <view class="margin-bottom" style="position: relative;">
  4. <view class="padding-lr padding-top" style="z-index: 999; position: absolute; top: 0rpx; width: 100%;">
  5. <view class="bg-white radius flex justify-start padding-lr padding-tb-xl shadow shadow-lg" :style="{'background-image':'url('+$getImageUrl('static/images/applet/mytop.png')+')'}"
  6. @click="goLPage('/pages/my/myinfo')" v-if="userinfo==false">
  7. <view class="cu-avatar lg round" :style="{'background-image':'url('+$getImageUrl('static/images/applet/dfhead.jpg')+')'}"></view>
  8. <view class="padding-lr padding-top text-lg">未登录</view>
  9. </view>
  10. <view class="bg-white radius flex justify-between align-center padding-lr padding-tb-xl shadow shadow-lg" :style="{'background-image':'url('+$getImageUrl('static/images/applet/mytop.png')+')'}"
  11. v-else>
  12. <view class="flex justify-start">
  13. <view class="cu-avatar lg round margin-left" :style="'background-image:url('+userinfo.avatar+');'"></view>
  14. <view class="padding-lr padding-top-xs text-lg">
  15. <view class="padding-bottom-xs">
  16. {{userinfo.nickname}}
  17. <text class="text-sm text-red" v-if="userinfo.authstatus == 1">(未实名)</text>
  18. <text class="text-sm text-red" v-if="brokerall != null">(经纪人)</text>
  19. </view>
  20. <view class="text-sm text-gray">{{userinfo.mobile}}</view>
  21. </view>
  22. </view>
  23. <!-- <view @click="goBrokerMyentry('/pages/my/myentry')" style="font-weight:bold;color: red;">【经纪人中心】</view> -->
  24. </view>
  25. </view>
  26. <view style="height: 140rpx; width: 100%;"></view>
  27. <view class="cu-list grid col-3 no-border" style="padding-top: 120rpx;" v-if="appplatform=='ios'">
  28. <view class="cu-item text-center" @click="goLPage('/pages/my/myinfo')">
  29. <image class="myicon" :src="$getImageUrl('static/images/applet/myicon01.png')"></image>
  30. <text>基本信息</text>
  31. </view>
  32. <view class="cu-item text-center" @click="goLPage('/pages/my/myteam')">
  33. <image class="myicon" :src="$getImageUrl('static/images/applet/myicon03.png')"></image>
  34. <text>我的邀请</text>
  35. </view>
  36. <view class="cu-item text-center" @click="goLPage('/pages/mall/mall')">
  37. <image class="myicon" :src="$getImageUrl('static/images/applet/myicon04.png')"></image>
  38. <text>积分商城</text>
  39. </view>
  40. </view>
  41. <view class="cu-list grid col-3 no-border" style="padding-top: 120rpx;" v-else>
  42. <view class="cu-item text-center" @click="goLPage('/pages/my/myinfo')">
  43. <image class="myicon" :src="$getImageUrl('static/images/applet/myicon01.png')"></image>
  44. <text>基本信息</text>
  45. </view>
  46. <view class="cu-item text-center" @click="goLPage('/pages/my/mycode')">
  47. <image class="myicon" :src="$getImageUrl('static/images/applet/myicon02.png')"></image>
  48. <text>我的推广码</text>
  49. </view>
  50. <view class="cu-item text-center" @click="goLPage('/pages/my/myteam')">
  51. <image class="myicon" :src="$getImageUrl('static/images/applet/myicon03.png')"></image>
  52. <text>我的邀请</text>
  53. </view>
  54. <!-- <view class="cu-item text-center" @click="goLPage('/pages/mall/mall')">
  55. <image class="myicon" :src="$getImageUrl('static/images/applet/myicon04.png')"></image>
  56. <text>积分商城</text>
  57. </view> -->
  58. </view>
  59. </view>
  60. <view class="cu-list menu sm-border">
  61. <view class="cu-item arrow" @click="goLPage('/pages/broker/center')" v-if="brokerall != null">
  62. <view class="content">
  63. <text class="cuIcon-friend text-grey"></text>
  64. <text>经纪人中心</text>
  65. </view>
  66. </view>
  67. <view class="cu-item arrow" @click="goLPage('/pages/resident/resident')" v-if="resident != null">
  68. <view class="content">
  69. <text class="cuIcon-friend text-grey"></text>
  70. <text>驻场老师</text>
  71. </view>
  72. </view>
  73. <view class="cu-item arrow" @click="goPage('/pages/comjobs/log')">
  74. <view class="content">
  75. <text class="cuIcon-edit text-grey"></text>
  76. <text>我的报名</text>
  77. </view>
  78. <view class="action" v-if="tip_num.comjobs_num > 0">
  79. <view class="cu-tag round bg-red sm">{{tip_num.comjobs_num}}</view>
  80. </view>
  81. </view>
  82. <view class="cu-item arrow" @click="goLPage('/pages/comjobs/star')">
  83. <view class="content">
  84. <text class="cuIcon-like text-grey"></text>
  85. <text>我的收藏</text>
  86. </view>
  87. </view>
  88. <view class="cu-item arrow" @click="goLPage('/pages/resume/log')">
  89. <view class="content">
  90. <text class="cuIcon-profile text-grey"></text>
  91. <text>收到的邀请</text>
  92. </view>
  93. <view class="action" v-if="tip_num.invite_num > 0">
  94. <view class="cu-tag round bg-red sm">{{tip_num.invite_num}}</view>
  95. </view>
  96. </view>
  97. <view class="cu-item arrow" @click="goLPage('/pages/my/mybag')">
  98. <view class="content">
  99. <text class="cuIcon-moneybag text-grey"></text>
  100. <text>我的钱包</text>
  101. </view>
  102. </view>
  103. <view class="cu-item arrow" @click="goLPage('/pages/notice/notice')">
  104. <view class="content">
  105. <text class="cuIcon-punch text-grey"></text>
  106. <text>通知公告</text>
  107. </view>
  108. </view>
  109. <view class="cu-item arrow" @click="goLPage('/pages/train/joinlist')">
  110. <view class="content">
  111. <text class="cuIcon-calendar text-grey"></text>
  112. <text>培训意愿</text>
  113. </view>
  114. </view>
  115. <!-- <view class="cu-item arrow" @click="goLPage('/pages/my/myintegral')">
  116. <view class="content">
  117. <text class="cuIcon-sponsor text-grey"></text>
  118. <text>我的积分</text>
  119. </view>
  120. </view> -->
  121. <!-- <view class="cu-item arrow" @click="goPage('/pages/article/article')">
  122. <view class="content">
  123. <text class="cuIcon-news text-grey"></text>
  124. <text>政策资讯</text>
  125. </view>
  126. </view> -->
  127. <view class="cu-item arrow" @click="goLPage('/pages/my/myauth')">
  128. <view class="content">
  129. <text class="cuIcon-news text-grey"></text>
  130. <text>实名认证</text>
  131. </view>
  132. <view class="action">
  133. <text class="text-grey" v-if="userinfo.authstatus==1">待认证</text>
  134. <text class="text-grey" v-if="userinfo.authstatus==2">审核中</text>
  135. <text class="text-grey" v-if="userinfo.authstatus==3">已认证</text>
  136. </view>
  137. </view>
  138. <view class="cu-item arrow" @click="goLPage('/pages/my/task')">
  139. <view class="content">
  140. <text class="cuIcon-album text-grey"></text>
  141. <text>任务中心</text>
  142. </view>
  143. </view>
  144. <view class="cu-item arrow" @click="goHome">
  145. <view class="content">
  146. <text class="cuIcon-friend text-grey"></text>
  147. <text>我要招聘</text>
  148. </view>
  149. </view>
  150. </view>
  151. <view class="cu-list menu sm-border">
  152. <view class="cu-item arrow" @click="goLPage('/pages/my/feedback')">
  153. <view class="content">
  154. <text class="cuIcon-warn text-grey"></text>
  155. <text>意见反馈</text>
  156. </view>
  157. </view>
  158. <view class="cu-item arrow" @click="goPage('/pages/my/about')">
  159. <view class="content">
  160. <text class="cuIcon-info text-grey"></text>
  161. <text>关于我们</text>
  162. </view>
  163. </view>
  164. </view>
  165. <view class="cu-modal" :class="modalName=='workerModal'?'show':''">
  166. <view class="cu-dialog">
  167. <view class="cu-bar bg-white justify-end">
  168. <view class="content">身份切换</view>
  169. <view class="action" @tap="hideModal">
  170. <text class="cuIcon-close text-red"></text>
  171. </view>
  172. </view>
  173. <view class="padding-tb-sm">
  174. <view class="cu-list menu">
  175. <block v-if="workerall!=null">
  176. <view class="cu-item arrow" v-for="(item,index) in workerall" :key="index" @tap="goWorker" :data-index="index">
  177. <view class="content text-left">
  178. <text class="cuIcon-settings text-grey"></text>
  179. <text>{{item.title}}</text>
  180. </view>
  181. <view class="action">
  182. <text class="text-grey">
  183. <text class="margin-left text-red" v-if="item.status==1">待审核</text>
  184. <text class="margin-left text-red" v-if="item.status==4">升级审核</text>
  185. </text>
  186. </view>
  187. </view>
  188. </block>
  189. <view class="cu-item arrow" @click="goLogin(1)">
  190. <view class="content text-left">
  191. <text class="cuIcon-settings text-grey"></text>
  192. <text>个人雇主注册</text>
  193. </view>
  194. </view>
  195. <view class="cu-item arrow" @click="goLogin(2)">
  196. <view class="content text-left">
  197. <text class="cuIcon-settings text-grey"></text>
  198. <text>企业雇主注册</text>
  199. </view>
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </view>
  205. <view class="padding-sm"></view>
  206. <view class="padding-xl"></view>
  207. <view class="cu-bar tabbar bg-white foot">
  208. <view class="action text-gray" @tap="goNavPage('/pages/index/index')">
  209. <view class="cuIcon-cu-image">
  210. <image src="../../static/tabbar/index.png"></image>
  211. </view>
  212. 首页
  213. </view>
  214. <view class="action text-gray" @tap="goNavPage('/pages/comjobs/comjobs')">
  215. <view class="cuIcon-cu-image">
  216. <image src="../../static/tabbar/jobs.png"></image>
  217. </view>
  218. 招聘
  219. </view>
  220. <!-- #ifndef MP-WEIXIN -->
  221. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/videolist')">
  222. <view class="cuIcon-cu-image">
  223. <image src="../../static/tabbar/video.png"></image>
  224. </view>
  225. 微工作
  226. </view>
  227. <!-- #endif -->
  228. <view class="action text-gray" @tap="goNavPage('/pages/broker/brokerlist')">
  229. <view class="cuIcon-cu-image">
  230. <image src="../../static/tabbar/broker.png"></image>
  231. </view>
  232. 经纪人
  233. </view>
  234. <view class="action text-blue" @tap="goNavPage('/pages/my/my')">
  235. <view class="cuIcon-cu-image">
  236. <image src="../../static/tabbar/mySelected.png"></image>
  237. </view>
  238. 我的
  239. </view>
  240. </view>
  241. <button class="cu-btn bg-blue lg shadow echo-gohome" @tap="goHome"> 切换身份 </button>
  242. <wxContact></wxContact>
  243. </view>
  244. </template>
  245. <script>
  246. var _this;
  247. export default {
  248. data() {
  249. return {
  250. appplatform: "",
  251. param: {},
  252. userinfo: false,
  253. workerall: null,
  254. agentall: null,
  255. brokerall: null,
  256. modalName: null,
  257. resident: null,
  258. tip_num:
  259. {
  260. comjobs_num: 0,
  261. invite_num: 0,
  262. }
  263. }
  264. },
  265. onLoad: function() {
  266. _this = this;
  267. //#ifdef APP-PLUS
  268. _this.appplatform = uni.getSystemInfoSync().platform;
  269. //#endif
  270. },
  271. onShareAppMessage: function(res) {
  272. return {
  273. title: "个人中心",
  274. path: "/pages/my/my"
  275. }
  276. },
  277. onShow: function() {
  278. _this = this;
  279. _this.userinfo = uni.getStorageSync('userinfo') || false;
  280. _this.workerall = null;
  281. _this.agentall = null;
  282. _this.brokerall = null;
  283. if (_this.userinfo !== false) {
  284. _this.$req.ajax({
  285. path: "my/getuser",
  286. data: {
  287. userid: _this.userinfo.id
  288. }
  289. }).then((data) => {
  290. _this.param = data.param;
  291. _this.userinfo = data.user;
  292. uni.setStorageSync('userinfo', data.user);
  293. _this.workerall = data.workerall;
  294. _this.agentall = data.agentall;
  295. _this.brokerall = data.brokerall;
  296. _this.resident = data.resident;
  297. uni.setStorageSync('residentinfo', data.resident);
  298. uni.setStorageSync('brokerinfo', data.brokerall ? data.brokerall[0] : null);
  299. }).catch((err) => {
  300. uni.showModal({
  301. title: '信息提示',
  302. content: err,
  303. showCancel: false
  304. });
  305. _this.userinfo = false;
  306. uni.removeStorageSync('userinfo');
  307. });
  308. //获取提示数字
  309. _this.$req.ajax({
  310. path: "my/gettipnum",
  311. data: {
  312. userid: _this.userinfo.id
  313. }
  314. }).then((data) => {
  315. _this.tip_num = data;
  316. })
  317. }
  318. },
  319. methods: {
  320. goManage: function(e) {
  321. _this.userinfo = _this.checkLogin("/pages/my/my");
  322. if (_this.userinfo === false) {
  323. return false;
  324. }
  325. var mtype = e.currentTarget.dataset.mtype;
  326. var index = e.currentTarget.dataset.index;
  327. var pageurl = "/pages/index/index";
  328. if (mtype=='worker'){
  329. // if (_this.workerall[index].status==1){
  330. // uni.showModal({
  331. // title: '信息提示',
  332. // content: "信息审核中,请耐心等待。",
  333. // showCancel: false
  334. // });
  335. // return;
  336. // }
  337. pageurl = "/pages/worker/worker";
  338. uni.setStorageSync('workerinfo', _this.workerall[index]);
  339. }else if (mtype=='agent'){
  340. pageurl = "/pages/agent/agent";
  341. uni.setStorageSync('agentinfo', _this.agentall[index]);
  342. }else if (mtype=='broker'){
  343. pageurl = "/pages/broker/broker";
  344. uni.setStorageSync('brokerinfo', _this.brokerall[index]);
  345. }
  346. uni.navigateTo({
  347. url: pageurl,
  348. fail: function() {
  349. uni.switchTab({
  350. url: pageurl
  351. });
  352. }
  353. });
  354. },
  355. hideModal: function(e) {
  356. _this.modalName = null;
  357. },
  358. goLogin: function(wtype) {
  359. uni.setStorageSync('identityinfo', true);
  360. uni.navigateTo({
  361. url: "/pages/login/worker?wtype="+wtype
  362. });
  363. },
  364. goLPage: function(pageurl) {
  365. _this.userinfo = _this.checkLogin("/pages/my/my");
  366. if (_this.userinfo === false) {
  367. return false;
  368. }
  369. uni.navigateTo({
  370. url: pageurl,
  371. fail: function() {
  372. uni.switchTab({
  373. url: pageurl
  374. });
  375. }
  376. });
  377. },
  378. goPage: function(pageurl) {
  379. uni.navigateTo({
  380. url: pageurl,
  381. fail: function() {
  382. uni.switchTab({
  383. url: pageurl
  384. });
  385. }
  386. });
  387. },
  388. goBrokerMyentry: function(pageurl) {
  389. _this.userinfo = uni.getStorageSync('userinfo') || false;
  390. if (!_this.userinfo.brokerid){
  391. uni.showModal({
  392. title: '暂无权限',
  393. content: '您现在还不是经纪人,请先申请',
  394. success: function (res) {
  395. if (res.confirm) {
  396. uni.navigateTo({
  397. url: "/pages/broker/brokerform"
  398. });
  399. } else if (res.cancel) {
  400. console.log('用户点击取消');
  401. }
  402. }
  403. });
  404. }else{
  405. uni.navigateTo({
  406. url: pageurl,
  407. fail: function() {
  408. uni.switchTab({
  409. url: pageurl
  410. });
  411. }
  412. });
  413. }
  414. },
  415. goNavPage: function(pageurl) {
  416. uni.redirectTo({
  417. url: pageurl
  418. });
  419. },
  420. // 咨询电话
  421. makeTelephone: function(e) {
  422. var telephone = e.currentTarget.dataset.telephone;
  423. uni.makePhoneCall({
  424. phoneNumber: telephone
  425. });
  426. },
  427. loginOut: function() {
  428. uni.clearStorageSync();
  429. uni.showModal({
  430. title: '温馨提示',
  431. content: '退出成功。',
  432. showCancel: false,
  433. success: function(res) {
  434. if (res.confirm) {
  435. uni.reLaunch({
  436. url: "/pages/index/home"
  437. });
  438. }
  439. }
  440. });
  441. },
  442. goWorker: function(e) {
  443. var index = e.currentTarget.dataset.index;
  444. if (_this.workerall[index].status==1 || _this.workerall[index].status==4){
  445. uni.showModal({
  446. title: '信息提示',
  447. content: "信息审核中,请耐心等待。",
  448. showCancel: false
  449. });
  450. return;
  451. }
  452. if (_this.workerall[index].status==2 || _this.workerall[index].status==3){
  453. uni.showModal({
  454. title: '信息提示',
  455. content: "账号存在风险,请联系平台。",
  456. showCancel: false
  457. });
  458. return;
  459. }
  460. uni.setStorageSync('identityinfo', true);
  461. uni.setStorageSync('workerinfo', _this.workerall[index]);
  462. uni.reLaunch({
  463. url: "/pages/worker/worker"
  464. });
  465. },
  466. goHome: function() {
  467. _this.modalName = "workerModal";
  468. // uni.setStorageSync('identityinfo', false);
  469. // uni.setStorageSync('workerinfo', null);
  470. // uni.reLaunch({
  471. // url: "/pages/index/home"
  472. // });
  473. },
  474. }
  475. }
  476. </script>
  477. <style>
  478. /* .mytop{ padding: 30rpx 30rpx 50rpx 30rpx; background-repeat: no-repeat; background-size: 100% 100%; background-position: center; position: relative; } */
  479. </style>