mine.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <view>
  3. <u-navbar back-text="我的" back-icon-size="0" :customBack="customBack" back-icon-color="#ffffff"
  4. :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <view class="top">
  6. <view class="photo">
  7. <u-avatar :src="src"></u-avatar>
  8. </view>
  9. <!-- <view class="login">
  10. 请登录
  11. </view> -->
  12. <!-- 已登录 -->
  13. <view class="logined">
  14. <view class="name" >
  15. <template v-if="userInfo&&userInfo.id">
  16. 你好,{{userInfo.realName?userInfo.realName:'用户'+userInfo.id.slice(0,3)}}
  17. </template>
  18. <template v-else>
  19. 未登录
  20. </template>
  21. <view class="img-box" v-if="userInfo.status==1">
  22. <img src="@/assets/img/riFill-shield-user-fill@1x.png" alt="">
  23. </view>
  24. </view>
  25. <view class="tel">
  26. <template v-if="userInfo&&userInfo.id">
  27. {{userInfo.phone.slice(0,3)}}****{{userInfo.phone.slice(-4)}}
  28. </template>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 求职信息 -->
  33. <view class="card card1">
  34. <view class="title">
  35. 求职信息
  36. </view>
  37. <u-grid :col="3" :border="false">
  38. <u-grid-item @click="gotoMyJobInformation">
  39. <view class="icon">
  40. <img src="@/assets/img/riLine-folder-user-line@1x.png" alt="">
  41. </view>
  42. <view class="grid-text">求职信息</view>
  43. </u-grid-item>
  44. <u-grid-item @click="gotoUrl('pages/packages/mine/myJobInformation/myRegistration?c=0')">
  45. <view class="icon">
  46. <img src="@/assets/img/riLine-todo-line@1x.png" alt="">
  47. </view>
  48. <view class="grid-text">我的报名</view>
  49. </u-grid-item>
  50. <u-grid-item @click="gotoUrl('pages/packages/mine/myJobInformation/myRegistration?c=1')">
  51. <u-badge count="1" size="mini" :offset="[28,34]"></u-badge>
  52. <view class="icon">
  53. <img src="@/assets/img/riLine-mail-star-line@1x.png" alt="">
  54. </view>
  55. <view class="grid-text">收到邀请</view>
  56. </u-grid-item>
  57. </u-grid>
  58. </view>
  59. <!-- 用工服务 -->
  60. <view class="card ">
  61. <view class="title">
  62. 用工服务
  63. </view>
  64. <u-grid :col="4" :border="false">
  65. <u-grid-item @click="gotoUrl('pages/packages/mine/employmentService/laborManagement/laborManagement')">
  66. <view class="icon">
  67. <img src="@/assets/img/riLine-folder-2-line@1x.png" alt="">
  68. </view>
  69. <view class="grid-text">用工管理</view>
  70. </u-grid-item>
  71. <u-grid-item @click="gotoUrl('pages/packages/mine/employmentService/receiveRegistration?c=0')">
  72. <view class="icon">
  73. <img src="@/assets/img/riLine-inbox-archive-line@1x.png" alt="">
  74. </view>
  75. <view class="grid-text">收到报名</view>
  76. </u-grid-item>
  77. <u-grid-item @click="gotoUrl('pages/packages/mine/employmentService/receiveRegistration?c=1')">
  78. <view class="icon">
  79. <img src="@/assets/img/riLine-time-line@1x.png" alt="">
  80. </view>
  81. <view class="grid-text">邀请记录</view>
  82. </u-grid-item>
  83. <u-grid-item @click="toShareEmployment">
  84. <view class="icon">
  85. <img src="@/assets/img/riLine-service-line@1x.png" alt="">
  86. </view>
  87. <view class="grid-text">共享用工</view>
  88. </u-grid-item>
  89. </u-grid>
  90. </view>
  91. <!-- 其他服务 -->
  92. <view class="card ">
  93. <view class="title">
  94. 其他服务
  95. </view>
  96. <u-grid :col="3" :border="false">
  97. <u-grid-item @click="toAuthentication">
  98. <img v-if="userInfo.status==1||(userInfo.enterpriseInfo&&userInfo.enterpriseInfo.status==1)" src="@/assets/img/riFill-checkbox-circle-fill@1x.png" class="checked">
  99. <img v-else src="@/assets/img/riFill-error-warning-fill@1x.png" class="badge-icon"></img>
  100. <view class="icon">
  101. <img src="@/assets/img/riLine-shield-user-line@1x.png" alt="">
  102. </view>
  103. <view class="grid-text">实名认证</view>
  104. </u-grid-item>
  105. <u-grid-item @click="showPhoneMethod">
  106. <view class="icon">
  107. <img src="@/assets/img/riLine-customer-service-line@1x.png" alt="">
  108. </view>
  109. <view class="grid-text">联系客服</view>
  110. </u-grid-item>
  111. <!-- <u-grid-item>
  112. <view class="icon">
  113. <img src="@/assets/img/riLine-logout-box-r-line@1x.png" alt="">
  114. </view>
  115. <view class="grid-text">退出登录</view>
  116. </u-grid-item> -->
  117. </u-grid>
  118. </view>
  119. <!-- 登录弹窗 -->
  120. <u-popup v-model="show" mode="center" :closeable="true" @close="close" >
  121. <view class="title">
  122. 登录荆开零工驿站
  123. </view>
  124. <view >
  125. <button class="login-btn" @click="decryptPhoneNumberH5"
  126. open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber" >
  127. <u-icon name="weixin-fill" size="46"></u-icon> <text>微信用户一键登录</text>
  128. </button>
  129. </view>
  130. <view class="radio" v-if="false">
  131. <!-- <radio></radio>
  132. <view class="agreement">
  133. 阅读并同意<text style="color: #2795FD">《用户隐私协议》</text>
  134. </view> -->
  135. <u-radio-group v-model="value">
  136. <u-radio active-color="red">阅读并同意<text style="color: #2795FD">《用户隐私协议》</text></u-radio>
  137. </u-radio-group>
  138. </view>
  139. </u-popup>
  140. <u-modal v-model="showPhone" @confirm="confirmPhone" :confirm-text="confirmText" confirm-color="#606266" :show-cancel-button="true" ref="uModal"
  141. :asyncClose="true" title="客服电话" :content="content" :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
  142. <tabbar :current="4"></tabbar>
  143. </view>
  144. </template>
  145. <script>
  146. import * as API from '@/apis/pagejs/tab.js'
  147. import * as API_weixin from '@/apis/weixin.js'
  148. import tabbar from "@/components/Tabbar.vue"
  149. export default {
  150. components: {
  151. tabbar
  152. },
  153. data() {
  154. return {
  155. src: '',
  156. show:false,
  157. value: 'false',
  158. userInfo:{},
  159. showPhone:false,
  160. confirmText: '拨打电话',
  161. content:""
  162. }
  163. },
  164. onLoad() {
  165. this.findByOpenId();
  166. },
  167. methods: {
  168. gotoMyJobInformation(){
  169. //zkx 需要认证
  170. uni.navigateTo({
  171. url:"/pages/packages/mine/myJobInformation/myJobInformation"
  172. })
  173. },
  174. confirmPhone(){
  175. this.showPhone = false;
  176. uni.makePhoneCall({
  177. phoneNumber:this.content //仅为示例
  178. });
  179. },
  180. showPhoneMethod(){
  181. if(this.content==""){
  182. uni.showLoading({
  183. title: "加载中",
  184. mask: true,
  185. })
  186. API_weixin.findValueByName({
  187. name:'客服电话'
  188. }).then((res) => {
  189. this.content=res.data
  190. uni.hideLoading();
  191. this.showPhone=true;
  192. }).catch(error => {
  193. this.showPhone=false;
  194. uni.hideLoading();
  195. })
  196. }else{
  197. this.showPhone=true;
  198. }
  199. },
  200. findByOpenId(){
  201. uni.showLoading({
  202. title: "加载中",
  203. mask: true,
  204. })
  205. API_weixin.findByOpenId({
  206. openId:this.carhelp.getOpenId(),
  207. noerror:true
  208. }).then((res) => {
  209. this.carhelp.setPersonInfo(res.data.regUser );
  210. this.carhelp.setToken(res.data.token);
  211. this.carhelp.setPersonInfoPlus(res.data);
  212. this.userInfo=res.data.regUser;
  213. this.src=this.userInfo.photo
  214. uni.hideLoading();
  215. this.show=false;
  216. }).catch(error => {
  217. console.log("11111")
  218. this.userInfo={};
  219. uni.hideLoading();
  220. this.show=true;
  221. // uni.showToast({
  222. // title: error
  223. // })
  224. //this.getPhone()
  225. })
  226. },
  227. close(){
  228. // #ifdef MP-WEIXIN
  229. if(this.userInfo.id){
  230. }else{
  231. uni.reLaunch({
  232. url:"/"
  233. })
  234. }
  235. // #endif
  236. },
  237. decryptPhoneNumberH5(){
  238. // #ifdef H5
  239. this.show=false
  240. var _this=this
  241. uni.showModal({
  242. title: '输入手机号测试',
  243. editable: true,
  244. //content: '这是一个模态弹窗',
  245. success: function(res) {
  246. if (res.confirm) {
  247. API.createUser({
  248. phone:res.content,
  249. openId:_this.carhelp.getOpenId()
  250. }).then((res2) => {
  251. _this.findByOpenId()
  252. }).catch(error2 => {
  253. uni.showToast({
  254. title: error2
  255. })
  256. })
  257. } else if (res.cancel) {
  258. console.log('用户点击取消');
  259. }
  260. }
  261. });
  262. // #endif
  263. },
  264. decryptPhoneNumber(e){
  265. console.log(e.detail.code)
  266. uni.showLoading({
  267. title: "加载中",
  268. mask: true,
  269. })
  270. API_weixin.findUserPhoneNumber(e.detail.code).then((res) => {
  271. console.log(res)
  272. API.createUser({
  273. phone:res.data,
  274. openId:this.carhelp.getOpenId()
  275. }).then((res2) => {
  276. this.findByOpenId()
  277. }).catch(error2 => {
  278. uni.showToast({
  279. title: error2
  280. })
  281. })
  282. }).catch(error => {
  283. uni.showToast({
  284. title: error
  285. })
  286. //this.getPhone()
  287. })
  288. },
  289. customBack(){
  290. },
  291. toAuthentication() {
  292. uni.navigateTo({
  293. url: '/pages/packages/mine/otherServices/authentication'
  294. })
  295. },
  296. toShareEmployment() {
  297. uni.navigateTo({
  298. url: '/pages/packages/mine/employmentService/shareEmployment'
  299. })
  300. }
  301. }
  302. }
  303. </script>
  304. <style>
  305. page {
  306. background: #F0F0F2;
  307. padding-bottom: 150px;
  308. }
  309. </style>
  310. <style lang="scss" scoped>
  311. .top{
  312. display: flex;
  313. align-items: center;
  314. padding: 40rpx 32rpx 88rpx;
  315. background:url(@/assets/img/mineCover.png),linear-gradient(180deg, rgba(39,149,253,1) 0%,rgba(118,182,255,1) 100%);
  316. background-repeat:no-repeat;
  317. background-position: right;
  318. .photo{
  319. /deep/.u-avatar{
  320. width: 120rpx !important;
  321. height: 120rpx !important;
  322. box-shadow: 0px 1px 3px 0px rgba(39, 149, 253, 100);
  323. border: 2px solid rgba(255, 255, 255, 1);
  324. }
  325. }
  326. .login{
  327. color: rgba(255, 255, 255, 1);
  328. font-size: 40rpx;
  329. text-align: left;
  330. font-family: 'PingFangSC-medium';
  331. margin-left: 24rpx;
  332. }
  333. .logined{
  334. color: rgba(255, 255, 255, 1);
  335. margin-left: 24rpx;
  336. .name{
  337. font-size: 40rpx;
  338. font-family: 'PingFangSC-medium';
  339. display: flex;
  340. align-items: center;
  341. .img-box{
  342. margin-left: 8rpx;
  343. overflow: hidden;
  344. img{
  345. width: 40rpx;
  346. height: 40rpx;
  347. vertical-align: middle;
  348. z-index: 999;
  349. position: relative;
  350. }
  351. }
  352. }
  353. .tel{
  354. margin-top: 8rpx;
  355. font-size: 32rpx;
  356. }
  357. }
  358. }
  359. .card1{
  360. margin-top: -32rpx !important;
  361. }
  362. .card{
  363. background-color: #fff;
  364. border-radius: 12px;
  365. margin: 32rpx ;
  366. padding: 32rpx;
  367. /deep/.u-grid-item{
  368. width: 25% !important;
  369. }
  370. .title{
  371. color: rgba(16, 16, 16, 1);
  372. font-size: 40rpx;
  373. margin-bottom: 20rpx;
  374. }
  375. .grid-text{
  376. color: rgba(51, 51, 51, 1);
  377. margin-top: 8rpx;
  378. }
  379. .icon{
  380. width: 56rpx;
  381. height: 56rpx;
  382. img{
  383. width: 100%;
  384. height: 100%;
  385. }
  386. }
  387. .badge-icon {
  388. position: absolute;
  389. top: 24rpx;
  390. right: 40rpx;
  391. width: 30rpx;
  392. height: 30rpx;
  393. }
  394. .checked{
  395. position: absolute;
  396. bottom: 72rpx;
  397. right: 40rpx;
  398. width: 30rpx;
  399. height: 30rpx;
  400. }
  401. }
  402. // 弹窗
  403. /deep/.u-mode-center-box{
  404. width: 560rpx !important;
  405. border-radius: 12px;
  406. padding: 80rpx 48rpx;
  407. display: flex;
  408. .title{
  409. color: rgba(16, 16, 16, 1);
  410. font-size: 36rpx;
  411. font-family: 'PingFangSC-medium';
  412. }
  413. .login-btn{
  414. background-color: rgba(0, 188, 99, 1);
  415. color: #fff;
  416. padding: 8rpx 70rpx;
  417. margin-top: 56rpx;
  418. margin-bottom: 16rpx;
  419. border-radius: 8px;
  420. display: flex;
  421. font-size: 32rpx;
  422. text{
  423. margin-left: 8rpx;
  424. }
  425. }
  426. .radio {
  427. display: inline-block;
  428. width: 100%;
  429. display: flex;
  430. justify-content: center;
  431. font-size: 24rpx;
  432. color: #777777;
  433. margin-left: 20rpx;
  434. .uni-radio-input{
  435. width: 24rpx;
  436. height: 24rpx;
  437. }
  438. .uni-radio-input-checked:before{
  439. font-size: 24rpx;
  440. background-color: rgb(0, 122, 255);
  441. border-color: rgb(0, 122, 255);
  442. }
  443. }
  444. }
  445. </style>