index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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('/h5/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('/h5/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>
  167. </view>
  168. <!-- 退出登录按钮 -->
  169. <!-- <view class="log-out">退出登录</view> -->
  170. </view>
  171. <view class="banner">
  172. <image src="https://qinggetai.oss-rg-china-mainland.aliyuncs.com/qgt/20230705/786baeb728d34b6aa29ae62d0b173b19.png"></image>
  173. <view class="tel_btn" @click="callService()"></view>
  174. </view>
  175. <view class="like-product">
  176. <likeProduct ref="product" />
  177. </view>
  178. </view>
  179. </view>
  180. </view>
  181. </template>
  182. <script>
  183. import {getOrderCount} from '@/api/storeOrder'
  184. import {getUserInfo} from '@/api/user'
  185. import likeProduct from '@/components/likeProduct.vue'
  186. export default {
  187. components: {
  188. likeProduct
  189. },
  190. data() {
  191. return {
  192. count0:0,
  193. count1:0,
  194. count2:0,
  195. afterSalesCount:0,
  196. user:{
  197. isPromoter:0,
  198. isWeixinAuth:0,
  199. phone:"",
  200. nickname:"用户昵称",
  201. avatarUrl:"/static/images/detault_head.png"
  202. },
  203. // 状态栏的高度
  204. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  205. // 消息数量
  206. msgNum: 0,
  207. isShow:true
  208. };
  209. },
  210. onLoad() {
  211. console.log("onload")
  212. },
  213. onShow() {
  214. console.log("onshow")
  215. this.getUserInfo();
  216. this.getOrderCount();
  217. },
  218. onReachBottom() {
  219. console.log("onReachBottom")
  220. this.$refs.product.getGoodsProducts();
  221. },
  222. methods: {
  223. seeChange(){
  224. this.isShow=!this.isShow
  225. },
  226. callService(){
  227. uni.makePhoneCall({
  228. phoneNumber:"4000717770",
  229. success:function(){
  230. console.log('拨打电话成功');
  231. },
  232. fail() {
  233. console.log('打电话失败了');
  234. }
  235. })
  236. },
  237. getOrderCount(){
  238. getOrderCount().then(
  239. res => {
  240. if(res.code==200){
  241. this.count0=res.count0;
  242. this.count1=res.count1;
  243. this.count2=res.count2;
  244. this.afterSalesCount=res.afterSalesCount;
  245. }
  246. },
  247. rej => {}
  248. );
  249. },
  250. toManager(){
  251. // uni.navigateTo({
  252. // url: '/pages_company/index'
  253. // })
  254. if(this.utils.checkCompanyUserLoginState()){
  255. uni.navigateTo({
  256. url: '/pages_company/index'
  257. })
  258. }
  259. else{
  260. uni.navigateTo({
  261. url: '/pages_company/auth/login'
  262. })
  263. }
  264. },
  265. openH5(url){
  266. var requestPath = uni.getStorageSync('requestPath');
  267. uni.setStorageSync('url',requestPath+url);
  268. uni.navigateTo({
  269. url: '../home/h5'
  270. })
  271. },
  272. getUserInfo(){
  273. getUserInfo().then(
  274. res => {
  275. if(res.code==200){
  276. if(res.user!=null){
  277. this.user=res.user;
  278. }
  279. else{
  280. this.utils.loginOut();
  281. }
  282. }else{
  283. uni.showToast({
  284. icon:'none',
  285. title: "请求失败",
  286. });
  287. }
  288. },
  289. rej => {}
  290. );
  291. },
  292. // 跳转页面
  293. navgetTo(url) {
  294. this.utils.isLogin().then(res => {
  295. if(res){
  296. uni.navigateTo({
  297. url: url
  298. })
  299. }
  300. })
  301. },
  302. // 查看订单
  303. showOrder(status) {
  304. uni.navigateTo({
  305. url: '/pages_user/user/storeOrder?status=' + status
  306. })
  307. }
  308. }
  309. }
  310. </script>
  311. <style lang="scss">
  312. .top-cont{
  313. width: 100%;
  314. height: 494upx;
  315. position: relative;
  316. // background-image: url(../../static/images/personl_top_bg.png);
  317. // background-repeat: repeat-x;
  318. // background-size: 40upx 100%;
  319. background: linear-gradient(266deg, #CDEAFE 0%, #EBF4F9 100%);
  320. .top-inner{
  321. width: 100%;
  322. height: 100%;
  323. position: absolute;
  324. top: 0;
  325. left: 0;
  326. z-index: 2;
  327. .user-info{
  328. padding: 88upx 30upx 0 30upx;
  329. display: flex;
  330. align-items: center;
  331. justify-content: space-between;
  332. .left{
  333. position: relative;
  334. display: flex;
  335. .head-img{
  336. width: 120upx;
  337. height: 120upx;
  338. border-radius: 50%;
  339. overflow: hidden;
  340. margin-right: 30upx;
  341. border: 4upx solid #FFFFFF;
  342. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  343. image{
  344. width: 100%;
  345. height: 100%;
  346. }
  347. }
  348. .name-phone{
  349. padding-top: 15upx;
  350. .name{
  351. font-size: 40upx;
  352. font-family: PingFang SC;
  353. font-weight: bold;
  354. color: #111111;
  355. line-height: 1;
  356. }
  357. .phone{
  358. width: 220rpx;
  359. height: 48rpx;
  360. margin-top: 30upx;
  361. background: linear-gradient( 90deg, #FEA501 0%, #FECB8A 100%);
  362. border-radius: 24rpx 24rpx 24rpx 24rpx;
  363. border: 1rpx solid #FEDDB9;
  364. display: flex;
  365. align-items: center;
  366. justify-content: center;
  367. text{
  368. font-size: 24upx;
  369. font-family: PingFang SC;
  370. font-weight: 500;
  371. color: #fff;
  372. line-height: 1;
  373. margin-left: 4rpx;
  374. }
  375. }
  376. }
  377. }
  378. .right{
  379. display: flex;
  380. align-items: center;
  381. justify-content: center;
  382. .msg-box{
  383. // margin-left: 10upx;
  384. width: 48upx;
  385. height: 48upx;
  386. // image{
  387. // width: 100%;
  388. // height: 100%;
  389. // }
  390. }
  391. .set{
  392. width: 48upx;
  393. height: 48upx;
  394. margin-right: 20rpx;
  395. // image{
  396. // width: 100%;
  397. // height: 100%;
  398. // }
  399. }
  400. }
  401. }
  402. .balance{
  403. padding: 30rpx;
  404. height: 180rpx;
  405. margin: 50rpx 20rpx 0;
  406. border-radius: 16rpx 16rpx 16rpx 16rpx;
  407. background: linear-gradient( 266deg, #E83924 0%, #FEA603 100%);
  408. // background-image:url(../../static/images/balancebg.png);
  409. // background-repeat: no-repeat;
  410. // background-size: 100%;
  411. display: flex;
  412. align-items: center;
  413. justify-content: space-between;
  414. .left{
  415. display: flex;
  416. flex-direction: column;
  417. align-items: flex-start;
  418. justify-content:space-around;
  419. height: 100%;
  420. .text{
  421. font-family: PingFang SC;
  422. font-weight: 400;
  423. font-size: 26rpx;
  424. color: #FFFFFF;
  425. text-align: left;
  426. margin-right: 16rpx;
  427. }
  428. .num{
  429. font-family: Roboto, Roboto;
  430. font-weight: 500;
  431. font-size: 64rpx;
  432. color: #FFFFFF;
  433. }
  434. }
  435. .right{
  436. width: 132rpx;
  437. height: 64rpx;
  438. line-height: 64rpx;
  439. background: #FFFFFF;
  440. border-radius: 32rpx 32rpx 32rpx 32rpx;
  441. font-family: PingFang SC, PingFang SC;
  442. font-weight: 500;
  443. font-size: 26rpx;
  444. color: #FF5030;
  445. text-align: center;
  446. }
  447. }
  448. .my-order{
  449. padding: 20upx 20upx 0;
  450. .inner{
  451. box-sizing: border-box;
  452. height: 245upx;
  453. background: #FFFFFF;
  454. border-radius: 16upx;
  455. padding: 40upx 30upx;
  456. display: flex;
  457. flex-direction: column;
  458. justify-content: space-between;
  459. .title-box{
  460. display: flex;
  461. align-items: center;
  462. justify-content: space-between;
  463. .title{
  464. font-size: 36upx;
  465. font-family: PingFang SC;
  466. font-weight: bold;
  467. color: #222222;
  468. line-height: 1;
  469. }
  470. .all-order{
  471. display: flex;
  472. align-items: center;
  473. .text{
  474. font-size: 26upx;
  475. font-family: PingFang SC;
  476. font-weight: 500;
  477. color: #999999;
  478. line-height: 1;
  479. margin-right: 8upx;
  480. }
  481. // image{
  482. // width: 14upx;
  483. // height: 24upx;
  484. // }
  485. }
  486. }
  487. .status-box{
  488. display: flex;
  489. align-items: center;
  490. justify-content: space-between;
  491. padding: 0 10upx;
  492. .item{
  493. display: flex;
  494. flex-direction: column;
  495. align-items: center;
  496. justify-content: center;
  497. image{
  498. width: 48upx;
  499. height: 48upx;
  500. margin-bottom: 18upx;
  501. }
  502. .text{
  503. font-size: 26upx;
  504. font-family: PingFang SC;
  505. font-weight: 500;
  506. color: #111111;
  507. line-height: 1;
  508. }
  509. }
  510. }
  511. }
  512. }
  513. }
  514. }
  515. .content{
  516. margin-top: 20upx;
  517. padding: 0 20upx;
  518. display: flex;
  519. align-items: center;
  520. justify-content: center;
  521. .used-tools{
  522. box-sizing: border-box;
  523. background: #FFFFFF;
  524. border-radius: 16upx;
  525. padding: 40upx 30upx;
  526. .title{
  527. font-size: 36upx;
  528. font-family: PingFang SC;
  529. font-weight: bold;
  530. color: #222222;
  531. line-height: 1;
  532. }
  533. .tools-list{
  534. margin-top: 50upx;
  535. display: flex;
  536. flex-wrap: wrap;
  537. width: 100%;
  538. .item{
  539. box-sizing: border-box;
  540. width: 25%;
  541. display: flex;
  542. flex-direction: column;
  543. align-items: center;
  544. justify-content: center;
  545. margin-bottom: 50upx;
  546. position: relative;
  547. image{
  548. width: 48upx;
  549. height: 48upx;
  550. }
  551. .text{
  552. font-size: 24upx;
  553. font-family: PingFang SC;
  554. font-weight: 500;
  555. color: #333;
  556. line-height: 1;
  557. margin-top: 20upx;
  558. }
  559. .contact-btn{
  560. display: inline-block;
  561. position: absolute;
  562. top: 0;
  563. left: 0;
  564. width: 100%;
  565. height: 100%;
  566. opacity: 0;
  567. }
  568. }
  569. }
  570. }
  571. .log-out{
  572. height: 80upx;
  573. line-height: 80upx;
  574. text-align: center;
  575. font-size: 26upx;
  576. font-family: PingFang SC;
  577. font-weight: 500;
  578. color: #666666;
  579. background: #FFFFFF;
  580. border-radius: 16upx;
  581. margin-top: 20upx;
  582. }
  583. }
  584. .sub-btn{
  585. position: absolute;
  586. width: 100%;
  587. height: 100%;
  588. opacity: 0;
  589. }
  590. .like-product{
  591. padding: 0 20rpx;
  592. }
  593. .banner{
  594. padding: 20rpx 20rpx 0rpx 20rpx;
  595. height: 200rpx;
  596. position: relative;
  597. display: flex;
  598. align-items: center;
  599. justify-content: center;
  600. image{
  601. width:100%;
  602. height: 100%;
  603. border-radius: 16rpx 16rpx 16rpx 16rpx;
  604. }
  605. .tel_btn{
  606. width: 100%;
  607. height: 100%;
  608. top:0upx;
  609. position: absolute;
  610. opacity:0.0;
  611. }
  612. }
  613. </style>