index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. <template>
  2. <view>
  3. <view class="top-cont">
  4. <image class="bg" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/images/top_bg.png" mode="widthFix"></image>
  5. <view class="top-inner">
  6. <!-- 这里是状态栏 -->
  7. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  8. <view class="user-info">
  9. <view class="left">
  10. <view class="head-img">
  11. <image :src="user.avatar==null?'https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/images/my_heads_icon64.png':user.avatar" mode="aspectFill"></image>
  12. </view>
  13. <view class="name-phone">
  14. <view class="x-f">
  15. <view class="name" v-if="isLogin">{{user.doctorName||'用户'}}</view>
  16. <view class="name" v-else>请先登录</view>
  17. <text>{{user.mobile?utils.parsePhone(user.mobile):''}}</text>
  18. </view>
  19. <!-- <view class="phone">
  20. <image class="w32 h32" src="../../static/images/company/phone_icon16.png" mode=""></image>
  21. <text>{{user.phone?utils.parsePhone(user.phone):'-'}}</text>
  22. </view> -->
  23. <view class="vip" v-if="user.status==1">
  24. <image class="w24 h24" src="../../static/image/icon_v.png" mode=""></image>
  25. 已认证
  26. </view>
  27. </view>
  28. </view>
  29. <view class="right">
  30. <view class="set" @click="navgetTo('/pages_user/personInfo')">
  31. <image class="w48 h48" src="../../static/image/right_arrow_black_icon24.png" mode=""></image>
  32. </view>
  33. <!-- <uni-badge size="small" :text="msgNum" absolute="rightTop" type="error">
  34. <view class="set" @click="navgetTo('/pages_user/user/personInfo')">
  35. <image class="w48 h48" src="../../static/images/user/center_set_icon.png" mode=""></image>
  36. </view>
  37. </uni-badge>
  38. <uni-badge size="small" :text="msgNum" absolute="rightTop" type="error">
  39. <view class="msg-box" @click="navgetTo('/pages_user/user/message')">
  40. <image class="w48 h48" src="../../static/images/user/center_new_icon.png" mode=""></image>
  41. </view>
  42. </uni-badge> -->
  43. <!-- <uni-badge size="small" absolute="rightTop" type="error">
  44. <view class="msg-box ml10" @click="navgetTo('/pages_user/user/complaint')">
  45. <u-icon name="edit-pen" color="#222426" size="28"></u-icon>
  46. </view>
  47. </uni-badge> -->
  48. </view>
  49. </view>
  50. <view v-if="user.status==0" class="vipbox" @click="goVip">
  51. <image src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/images/img_renzheng.png" mode="widthFix"></image>
  52. </view>
  53. <view class="content">
  54. <view class="task-list">
  55. <view class="item" v-for="(item,index) in tabs" :key="index" @click="openLink(item)">
  56. <view class="left">
  57. <image :src="item.icon" mode=""></image>
  58. <view class="title-l">{{item.name}}</view>
  59. </view>
  60. <view class="right">
  61. <!-- <view class="num" v-if="item.num!==0">{{item.num}}</view> -->
  62. <image src="@/static/image/icon_my_more.png" mode=""></image>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 退出登录按钮 -->
  67. <view v-if="isLogin" class="log-out" @click="logOut">退出登录</view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import {getOrderCount} from '@/api/storeOrder'
  75. import {getUserInfo} from '@/api/user'
  76. export default {
  77. data() {
  78. return {
  79. count0:0,
  80. count1:0,
  81. count2:0,
  82. afterSalesCount:0,
  83. tabs:[
  84. {name:'我的积分',num:12,icon:'/static/image/icon_my_points.png',url:'/pages_user/points'},
  85. {name:'服务单确认',num:3,icon:'/static/image/icon_my_servicelist.png',url:'/pages_user/serviceOrder'},
  86. {name:'银行卡',num:8,icon:'/static/image/icon_my_card.png',url:'/pages_user/bankCard'},
  87. {name:'设置密码',num:0,icon:'/static/image/icon_my_password.png',url:'/pages_user/forgetPassword'},
  88. {name:'用户协议',num:0,icon:'/static/image/icon_my_useragreement.png',url:'/web/userAgreement'},
  89. ],
  90. user:{
  91. isPromoter:0,
  92. isWeixinAuth:0,
  93. phone:"",
  94. nickname:"用户昵称",
  95. avatarUrl:"/static/images/detault_head.png"
  96. },
  97. // 状态栏的高度
  98. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  99. // 消息数量
  100. msgNum: 0,
  101. isLogin: false,
  102. isShow:true,
  103. UserInfo: uni.getStorageSync('AppToken')
  104. };
  105. },
  106. onLoad() {
  107. console.log("onload")
  108. },
  109. onShow() {
  110. console.log("onshow")
  111. this.isLogin = uni.getStorageSync('AppToken')
  112. if(this.isLogin){
  113. this.getUserInfo();
  114. }else{
  115. uni.navigateTo({
  116. url: '/pages/auth/login'
  117. })
  118. }
  119. },
  120. onReachBottom() {
  121. console.log("onReachBottom")
  122. //this.$refs.product.getGoodsProducts();
  123. },
  124. methods: {
  125. seeChange(){
  126. this.isShow=!this.isShow
  127. },
  128. callService(){
  129. uni.makePhoneCall({
  130. phoneNumber:"4000717770",
  131. success:function(){
  132. console.log('拨打电话成功');
  133. },
  134. fail() {
  135. console.log('打电话失败了');
  136. }
  137. })
  138. },
  139. getOrderCount(){
  140. getOrderCount().then(
  141. res => {
  142. if(res.code==200){
  143. this.count0=res.count0;
  144. this.count1=res.count1;
  145. this.count2=res.count2;
  146. this.afterSalesCount=res.afterSalesCount;
  147. }
  148. },
  149. rej => {}
  150. );
  151. },
  152. logOut(){
  153. uni.showModal({
  154. title:"提示",
  155. content:"确认退出登录吗?",
  156. showCancel:true,
  157. cancelText:'取消',
  158. confirmText:'确定',
  159. success:res=>{
  160. if(res.confirm){
  161. //uni.setStorageSync('CompanyUserToken',null);
  162. uni.removeStorageSync('AppToken',null);
  163. uni.removeStorageSync('userInfo',null);
  164. uni.$emit('refreshLogin');
  165. uni.navigateTo({
  166. url: '/pages/auth/login'
  167. })
  168. }else{
  169. }
  170. }
  171. })
  172. },
  173. goVip(){
  174. uni.navigateTo({
  175. url: '/pages_user/certification'
  176. })
  177. },
  178. openLink(item){
  179. if(item.name=='用户协议'){
  180. this.openH5()
  181. return;
  182. }
  183. uni.navigateTo({
  184. url: item.url
  185. })
  186. // this.utils.isLogin().then(res => {
  187. // if(res){
  188. // uni.navigateTo({
  189. // url: url+'?userId='+this.user.userId
  190. // })
  191. // }
  192. // })
  193. },
  194. toManager(){
  195. // uni.navigateTo({
  196. // url: '/pages_company/index'
  197. // })
  198. if(this.utils.checkCompanyUserLoginState()){
  199. uni.navigateTo({
  200. url: '/pages_company/index'
  201. })
  202. }
  203. else{
  204. uni.navigateTo({
  205. url: '/pages_company/auth/login'
  206. })
  207. }
  208. },
  209. openH5(url){
  210. var requestPath = uni.getStorageSync('requestPath');
  211. uni.setStorageSync('url',requestPath+url);
  212. uni.navigateTo({
  213. url: '../home/web'
  214. })
  215. },
  216. getUserInfo(){
  217. getUserInfo().then(
  218. res => {
  219. if(res.code==200){
  220. if(res.data!=null){
  221. this.user=res.data;
  222. }
  223. else{
  224. this.utils.loginOut();
  225. }
  226. }else{
  227. uni.showToast({
  228. icon:'none',
  229. title: "请求失败",
  230. });
  231. }
  232. },
  233. rej => {}
  234. );
  235. },
  236. // 跳转页面
  237. navgetTo(url) {
  238. if(this.isLogin){
  239. uni.navigateTo({
  240. url: url+'?userId='+this.user.userId
  241. })
  242. }else{
  243. uni.navigateTo({
  244. url: '/pages/auth/login'
  245. })
  246. }
  247. },
  248. // 查看订单
  249. showOrder(status) {
  250. uni.navigateTo({
  251. url: '/pages_user/user/storeOrder?status=' + status
  252. })
  253. }
  254. }
  255. }
  256. </script>
  257. <style lang="scss">
  258. .top-cont{
  259. width: 100%;
  260. height: 600rpx;
  261. position: relative;
  262. // background-image: url(../../static/image/top_bg.svg);
  263. // background-repeat:no-repeat;
  264. // background-size:100%;
  265. .bg{
  266. width: 100%;
  267. position: absolute;
  268. top: 0;
  269. left: 0;
  270. }
  271. .top-inner{
  272. width: 100%;
  273. height: 100%;
  274. position: absolute;
  275. top: 0;
  276. left: 0;
  277. z-index: 2;
  278. .user-info{
  279. padding: 88upx 30upx 32upx 30upx;
  280. display: flex;
  281. align-items: center;
  282. justify-content: space-between;
  283. .left{
  284. position: relative;
  285. display: flex;
  286. .head-img{
  287. width: 112upx;
  288. height: 112upx;
  289. border-radius: 50%;
  290. overflow: hidden;
  291. margin-right: 32upx;
  292. border: 4upx solid #FFFFFF;
  293. //box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  294. image{
  295. width: 100%;
  296. height: 100%;
  297. }
  298. }
  299. .name-phone{
  300. // padding-top: 15upx;
  301. display: flex;
  302. align-items: flex-start;
  303. flex-direction: column;
  304. justify-content: space-around;
  305. .name{
  306. font-size: 40upx;
  307. font-family: PingFang SC;
  308. font-weight: bold;
  309. color: #111111;
  310. line-height: 1;
  311. }
  312. text{
  313. font-family: PingFang SC, PingFang SC;
  314. font-weight: 600;
  315. font-size: 28rpx;
  316. }
  317. .phone{
  318. width: 220rpx;
  319. height: 48rpx;
  320. margin-top: 30upx;
  321. background: linear-gradient( 90deg, #FEA501 0%, #FECB8A 100%);
  322. border-radius: 24rpx 24rpx 24rpx 24rpx;
  323. border: 1rpx solid #FEDDB9;
  324. display: flex;
  325. align-items: center;
  326. justify-content: center;
  327. text{
  328. font-size: 24upx;
  329. font-family: PingFang SC;
  330. font-weight: 500;
  331. color: #fff;
  332. line-height: 1;
  333. margin-left: 4rpx;
  334. }
  335. }
  336. .vip{
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. width: 120rpx;
  341. height: 40rpx;
  342. background: linear-gradient( 90deg, #FFEBAA 0%, #FFD45D 100%);
  343. border-radius: 38rpx 38rpx 38rpx 38rpx;
  344. font-family: PingFang SC, PingFang SC;
  345. font-weight: 500;
  346. font-size: 20rpx;
  347. color: #694511;
  348. }
  349. }
  350. }
  351. .right{
  352. display: flex;
  353. align-items: center;
  354. justify-content: center;
  355. .msg-box{
  356. // margin-left: 10upx;
  357. width: 48upx;
  358. height: 48upx;
  359. // image{
  360. // width: 100%;
  361. // height: 100%;
  362. // }
  363. }
  364. .set{
  365. width: 48rpx;
  366. height: 48rpx;
  367. // margin-right: 20rpx;
  368. // image{
  369. // width: 100%;
  370. // height: 100%;
  371. // }
  372. }
  373. }
  374. }
  375. .balance{
  376. padding: 30rpx;
  377. height: 180rpx;
  378. margin: 50rpx 20rpx 0;
  379. border-radius: 16rpx 16rpx 16rpx 16rpx;
  380. background: linear-gradient( 266deg, #E83924 0%, #FEA603 100%);
  381. // background-image:url(../../static/images/balancebg.png);
  382. // background-repeat: no-repeat;
  383. // background-size: 100%;
  384. display: flex;
  385. align-items: center;
  386. justify-content: space-between;
  387. .left{
  388. display: flex;
  389. flex-direction: column;
  390. align-items: flex-start;
  391. justify-content:space-around;
  392. height: 100%;
  393. .text{
  394. font-family: PingFang SC;
  395. font-weight: 400;
  396. font-size: 26rpx;
  397. color: #FFFFFF;
  398. text-align: left;
  399. margin-right: 16rpx;
  400. }
  401. .num{
  402. font-family: Roboto, Roboto;
  403. font-weight: 500;
  404. font-size: 64rpx;
  405. color: #FFFFFF;
  406. }
  407. }
  408. .right{
  409. width: 132rpx;
  410. height: 64rpx;
  411. line-height: 64rpx;
  412. background: #FFFFFF;
  413. border-radius: 32rpx 32rpx 32rpx 32rpx;
  414. font-family: PingFang SC, PingFang SC;
  415. font-weight: 500;
  416. font-size: 26rpx;
  417. color: #FF5030;
  418. text-align: center;
  419. }
  420. }
  421. .my-order{
  422. padding: 20upx 20upx 0;
  423. .inner{
  424. box-sizing: border-box;
  425. height: 245upx;
  426. background: #FFFFFF;
  427. border-radius: 16upx;
  428. padding: 40upx 30upx;
  429. display: flex;
  430. flex-direction: column;
  431. justify-content: space-between;
  432. .title-box{
  433. display: flex;
  434. align-items: center;
  435. justify-content: space-between;
  436. .title{
  437. font-size: 36upx;
  438. font-family: PingFang SC;
  439. font-weight: bold;
  440. color: #222222;
  441. line-height: 1;
  442. }
  443. .all-order{
  444. display: flex;
  445. align-items: center;
  446. .text{
  447. font-size: 26upx;
  448. font-family: PingFang SC;
  449. font-weight: 500;
  450. color: #999999;
  451. line-height: 1;
  452. margin-right: 8upx;
  453. }
  454. // image{
  455. // width: 14upx;
  456. // height: 24upx;
  457. // }
  458. }
  459. }
  460. .status-box{
  461. display: flex;
  462. align-items: center;
  463. justify-content: space-between;
  464. padding: 0 10upx;
  465. .item{
  466. display: flex;
  467. flex-direction: column;
  468. align-items: center;
  469. justify-content: center;
  470. image{
  471. width: 48upx;
  472. height: 48upx;
  473. margin-bottom: 18upx;
  474. }
  475. .text{
  476. font-size: 26upx;
  477. font-family: PingFang SC;
  478. font-weight: 500;
  479. color: #111111;
  480. line-height: 1;
  481. }
  482. }
  483. }
  484. }
  485. }
  486. }
  487. }
  488. .vipbox{
  489. margin-top: 24upx;
  490. padding: 0 24upx;
  491. image{
  492. width: 100%;
  493. }
  494. }
  495. .content{
  496. margin-top: 24upx;
  497. padding: 0 24upx;
  498. // display: flex;
  499. align-items: center;
  500. justify-content: center;
  501. .task-list{
  502. // padding: 24rpx;
  503. display: flex;
  504. align-items: center;
  505. flex-direction: column;
  506. justify-content: flex-start;
  507. width: 100%;
  508. box-sizing: border-box;
  509. border-radius: 24rpx;
  510. background: #FFFFFF;
  511. .item{
  512. width: 100%;
  513. display: flex;
  514. align-items: center;
  515. justify-content: space-between;
  516. padding:28rpx 24rpx;
  517. box-sizing: border-box;
  518. // margin-bottom: 24rpx;
  519. .left{
  520. display: flex;
  521. align-items: center;
  522. justify-content: center;
  523. image{
  524. width: 48rpx;
  525. height: 48rpx;
  526. margin-right: 32rpx;
  527. }
  528. .title-l{
  529. font-family: PingFang SC, PingFang SC;
  530. font-weight: 400;
  531. font-size: 32rpx;
  532. color: #333333;
  533. }
  534. }
  535. .right{
  536. display: flex;
  537. align-items: center;
  538. .num{
  539. text-align: center;
  540. width: 50rpx;
  541. height: 36rpx;
  542. line-height: 36rpx;
  543. background: rgba(56,139,255,0.16);
  544. border-radius: 34rpx 34rpx 34rpx 34rpx;
  545. font-family: PingFang SC, PingFang SC;
  546. font-weight: 400;
  547. font-size: 24rpx;
  548. color: #388BFF;
  549. }
  550. image{
  551. width: 32rpx;
  552. height: 32rpx;
  553. margin-left: 12rpx;
  554. }
  555. }
  556. }
  557. }
  558. .used-tools{
  559. box-sizing: border-box;
  560. background: #FFFFFF;
  561. border-radius: 16upx;
  562. padding: 40upx 30upx;
  563. .title{
  564. font-size: 36upx;
  565. font-family: PingFang SC;
  566. font-weight: bold;
  567. color: #222222;
  568. line-height: 1;
  569. }
  570. .tools-list{
  571. margin-top: 50upx;
  572. display: flex;
  573. flex-wrap: wrap;
  574. width: 100%;
  575. .item{
  576. box-sizing: border-box;
  577. width: 25%;
  578. display: flex;
  579. flex-direction: column;
  580. align-items: center;
  581. justify-content: center;
  582. margin-bottom: 50upx;
  583. position: relative;
  584. image{
  585. width: 48upx;
  586. height: 48upx;
  587. }
  588. .text{
  589. font-size: 24upx;
  590. font-family: PingFang SC;
  591. font-weight: 500;
  592. color: #333;
  593. line-height: 1;
  594. margin-top: 20upx;
  595. }
  596. .contact-btn{
  597. display: inline-block;
  598. position: absolute;
  599. top: 0;
  600. left: 0;
  601. width: 100%;
  602. height: 100%;
  603. opacity: 0;
  604. }
  605. }
  606. }
  607. }
  608. .log-out{
  609. height: 88upx;
  610. line-height: 88upx;
  611. text-align: center;
  612. font-family: PingFang SC, PingFang SC;
  613. font-weight: 500;
  614. font-size: 28rpx;
  615. color: #666666;
  616. background: #FFFFFF;
  617. border-radius: 16upx;
  618. margin-top: 52upx;
  619. }
  620. }
  621. .sub-btn{
  622. position: absolute;
  623. width: 100%;
  624. height: 100%;
  625. opacity: 0;
  626. }
  627. .like-product{
  628. padding: 0 20rpx;
  629. }
  630. .banner{
  631. padding: 20rpx 20rpx 0rpx 20rpx;
  632. height: 200rpx;
  633. position: relative;
  634. display: flex;
  635. align-items: center;
  636. justify-content: center;
  637. image{
  638. width:100%;
  639. height: 100%;
  640. border-radius: 16rpx 16rpx 16rpx 16rpx;
  641. }
  642. .tel_btn{
  643. width: 100%;
  644. height: 100%;
  645. top:0upx;
  646. position: absolute;
  647. opacity:0.0;
  648. }
  649. }
  650. </style>