index.vue 19 KB

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