index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. <template>
  2. <view>
  3. <view class="top-cont">
  4. <view class="top-inner">
  5. <!-- 这里是状态栏 -->
  6. <image class="bg"
  7. src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736955760372.png" mode=""></image>
  8. <!-- #ifdef APP -->
  9. <view style="height: 80rpx;"></view>
  10. <!-- #endif -->
  11. <!-- 这里是状态栏 -->
  12. <!-- #ifndef APP -->
  13. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  14. <!-- #endif -->
  15. <view class="user-info">
  16. <view class="left">
  17. <view class="head-img">
  18. <image :src="user.avatar==null?'/static/images/detault_head.jpg':user.avatar" mode="aspectFill"></image>
  19. </view>
  20. <view class="name-phone">
  21. <view class="name">{{user.nickname}}</view>
  22. <view class="phone">{{utils.parsePhone(user.phone)}}</view>
  23. </view>
  24. </view>
  25. <view class="right">
  26. <uni-badge size="small" :text="msgNum" absolute="rightTop" type="error">
  27. <view class="set" @click="navgetTo('/pages_user/user/personInfo')">
  28. <image src="../../static/images/icon-set.png" mode=""></image>
  29. </view>
  30. </uni-badge>
  31. <uni-badge size="small" :text="msgNum" absolute="rightTop" type="error">
  32. <view class="msg-box" @click="navgetTo('/pages_user/user/message')">
  33. <image src="../../static/images/icon-msg.png" mode=""></image>
  34. </view>
  35. </uni-badge>
  36. </view>
  37. </view>
  38. <!-- 我的订单 -->
  39. <view class="my-order" >
  40. <view class="inner">
  41. <view class="title-box">
  42. <text class="title">我的订单</text>
  43. <view class="all-order" @click="showOrder('')">
  44. <text class="text">全部订单</text>
  45. <image src="../../static/images/arrow4.png" mode=""></image>
  46. </view>
  47. </view>
  48. <view class="status-box">
  49. <uni-badge size="small" :text=count0 absolute="rightTop" type="error">
  50. <view class="item" @click="showOrder('0')">
  51. <image src="../../static/images/obligation.png" mode=""></image>
  52. <text class="text">待付款</text>
  53. </view>
  54. </uni-badge>
  55. <uni-badge size="small" :text=count1 absolute="rightTop" type="error">
  56. <view class="item" @click="showOrder('1')">
  57. <image src="../../static/images/pending_shipment.png" mode=""></image>
  58. <text class="text">待发货</text>
  59. </view>
  60. </uni-badge>
  61. <uni-badge size="small" :text=count2 absolute="rightTop" type="error">
  62. <view class="item" @click="showOrder('2')">
  63. <image src="../../static/images/dai_shouhuo.png" mode=""></image>
  64. <text class="text">待收货</text>
  65. </view>
  66. </uni-badge>
  67. <view class="item" @click="showOrder('3')">
  68. <image src="../../static/images/completed.png" mode=""></image>
  69. <text class="text">已完成</text>
  70. </view>
  71. <uni-badge size="small" :text=afterSalesCount absolute="rightTop" type="error">
  72. <view class="item" @click="navgetTo('/pages_user/user/refundOrderList')">
  73. <image src="../../static/images/after_sales.png" mode=""></image>
  74. <text class="text">售后/退款</text>
  75. </view>
  76. </uni-badge>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="content" v-if="iconlist&&iconlist.length>0">
  81. <!-- 常用工具 -->
  82. <view class="used-tools">
  83. <view class="title">常用工具</view>
  84. <view class="tools-list">
  85. <!-- <view
  86. v-for="(item,index) in toolsArr"
  87. :key="index"
  88. @click="navgetTo(item.url)"
  89. :class="(toolsArr.length - index) > toolsRemain?'item':'item no-marin-bottom'">
  90. <image :src="item.img" mode=""></image>
  91. <text class="text">{{ item.name }}</text>
  92. <button v-if="item.url == ''" class="contact-btn" open-type="contact"></button>
  93. </view> -->
  94. <!-- <view class="item" @click="navgetTo('/pages_user/user/doctorOrder')">
  95. <image src="../../static/images/my_ask.png" mode=""></image>
  96. <text class="text">我的问诊</text>
  97. </view> -->
  98. <!-- <view class="item" @click="navgetTo('/pages_user/user/prescribeOrder')">
  99. <image src="../../static/images/prescription.png" mode=""></image>
  100. <text class="text">我的处方</text>
  101. </view>
  102. <view class="item" @click="navgetTo('/pages_user/user/patient')">
  103. <image src="../../static/images/management.png" mode=""></image>
  104. <text class="text">就诊人管理</text>
  105. </view> -->
  106. <view class="item" @click="navgetTo('/pages_user/user/patient')">
  107. <image :src="iconlist[9].icon" mode=""></image>
  108. <text class="text">健康档案</text>
  109. </view>
  110. <view class="item" @click="navgetTo('/pages_user/user/address')" >
  111. <image :src="iconlist[0].icon" mode=""></image>
  112. <text class="text">收货地址</text>
  113. </view>
  114. <view class="item no-marin-bottom" @click="navgetTo('/pages_user/user/integral')">
  115. <image :src="iconlist[1].icon" mode=""></image>
  116. <text class="text">积分管理</text>
  117. </view>
  118. <view class="item no-marin-bottom" @click="navgetTo('/pages_shopping/shopping/myCoupon')">
  119. <image :src="iconlist[2].icon" mode=""></image>
  120. <text class="text">优惠券</text>
  121. </view>
  122. <view class="item no-marin-bottom" @click="navgetTo('/pages_user/user/storeProductRelation')">
  123. <image :src="iconlist[3].icon" mode=""></image>
  124. <text class="text">我的足迹</text>
  125. </view>
  126. <view class="item no-marin-bottom" @click="openH5('/h5/userAgreement')">
  127. <image :src="iconlist[4].icon" mode=""></image>
  128. <text class="text">用户协议</text>
  129. </view>
  130. <view class="item no-marin-bottom align-top" @click="openH5('/h5/privacyPolicy')">
  131. <image :src="iconlist[5].icon" mode=""></image>
  132. <text class="text">隐私保护</text>
  133. </view>
  134. <view class="item no-marin-bottom">
  135. <image :src="iconlist[6].icon" mode=""></image>
  136. <text class="text">专属客服</text>
  137. <button class="contact-btn" open-type="contact"></button>
  138. </view>
  139. <view v-if="user.isPromoter==0" class="item no-marin-bottom" @click="navgetTo('/pages_user/user/userTuiAdd')">
  140. <image :src="iconlist[7].icon" mode=""></image>
  141. <text class="text">申请健康大使</text>
  142. </view>
  143. <view v-if="user.isPromoter==1" class="item no-marin-bottom" @click="navgetTo('/pages_user/user/userTui')">
  144. <image src="../../static/images/my_promotion.png" mode=""></image>
  145. <text class="text">我的推广</text>
  146. </view>
  147. <view class="item no-marin-bottom" @click="navgetTo('/pages/home/cert')">
  148. <image :src="iconlist[8].icon" mode=""></image>
  149. <text class="text">资质证书</text>
  150. </view>
  151. <view class="item no-marin-bottom" @click="toManager()">
  152. <image :src="iconlist[9].icon" mode=""></image>
  153. <text class="text">销售管理</text>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. <!-- <view class="banner">
  159. <image src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20221125/71ddd95044bb46d5b27e19a5f61cf5ab.png"></image>
  160. <view class="tel_btn" @click="callService()"></view>
  161. </view> -->
  162. <view class="banner">
  163. <image
  164. src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736956202172.jpg" mode="widthFix">
  165. </image>
  166. <view class="tel_btn" @click="callService()"></view>
  167. </view>
  168. <!-- 退出登录按钮 -->
  169. <view @tap="loginOUt" class="log-out x-c" >退出登录</view>
  170. <!-- <view class="like-product">
  171. <likeProduct ref="product" />
  172. </view> -->
  173. </view>
  174. </view>
  175. <tabbar :actindex="4"></tabbar>
  176. </view>
  177. </template>
  178. <script>
  179. import {getOrderCount} from '@/api/storeOrder'
  180. import {getUserInfo,geticon} from '@/api/user'
  181. import likeProduct from '@/components/likeProduct.vue'
  182. import tabbar from '@/components/tabbar/tabbar.vue'
  183. export default {
  184. components: {
  185. likeProduct,
  186. tabbar
  187. },
  188. data() {
  189. return {
  190. count0:0,
  191. count1:0,
  192. count2:0,
  193. afterSalesCount:0,
  194. user:{
  195. isPromoter:0,
  196. isWeixinAuth:0,
  197. phone:"",
  198. nickname:"用户昵称",
  199. avatarUrl:"/static/images/detault_head.png"
  200. },
  201. // 状态栏的高度
  202. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  203. // 消息数量
  204. msgNum: 0,
  205. iconlist:[]
  206. };
  207. },
  208. onShow() {
  209. uni.hideTabBar();
  210. // console.log("onshow")
  211. this.getUserInfo();
  212. this.getOrderCount();
  213. this.$nextTick(()=>{
  214. this.geticons()
  215. })
  216. },
  217. onReachBottom() {
  218. console.log("onReachBottom")
  219. // this.$refs.product.getGoodsProducts();
  220. },
  221. methods: {
  222. geticons(){
  223. geticon().then(res=>{
  224. this.iconlist=res.data
  225. console.log(res)
  226. })
  227. },
  228. callService(){
  229. let orderKey='5d81cf01-6f8d-4e1a-ae7a-dbc26c965b01';
  230. uni.navigateTo({
  231. url: '/pages_company/order/confirmOrder?orderKey='+orderKey
  232. })
  233. return;
  234. uni.makePhoneCall({
  235. phoneNumber:"4000717770",
  236. success:function(){
  237. console.log('拨打电话成功');
  238. },
  239. fail() {
  240. console.log('打电话失败了');
  241. }
  242. })
  243. },
  244. getOrderCount(){
  245. getOrderCount().then(
  246. res => {
  247. if(res.code==200){
  248. this.count0=res.count0;
  249. this.count1=res.count1;
  250. this.count2=res.count2;
  251. this.afterSalesCount=res.afterSalesCount;
  252. }
  253. },
  254. rej => {}
  255. );
  256. },
  257. toManager(){
  258. if(this.utils.checkCompanyUserLoginState()){
  259. uni.navigateTo({
  260. url: '/pages_company/index'
  261. })
  262. }
  263. else{
  264. uni.navigateTo({
  265. url: '/pages_company/auth/login'
  266. })
  267. }
  268. },
  269. openH5(url){
  270. var requestPath = uni.getStorageSync('requestPath');
  271. uni.setStorageSync('url',requestPath+url);
  272. uni.navigateTo({
  273. url: '../home/h5'
  274. })
  275. },
  276. getUserInfo(){
  277. getUserInfo().then(
  278. res => {
  279. if(res.code==200){
  280. if(res.user!=null){
  281. this.user=res.user;
  282. }
  283. else{
  284. this.utils.loginOut();
  285. }
  286. }else{
  287. uni.showToast({
  288. icon:'none',
  289. title: "请求失败",
  290. });
  291. }
  292. },
  293. rej => {}
  294. );
  295. },
  296. // 跳转页面
  297. navgetTo(url) {
  298. this.utils.isLogin().then(res => {
  299. if(res){
  300. uni.navigateTo({
  301. url: url
  302. })
  303. }
  304. })
  305. },
  306. // 查看订单
  307. showOrder(status) {
  308. uni.navigateTo({
  309. url: '/pages_user/user/storeOrder?status=' + status
  310. })
  311. },
  312. loginOUt(){
  313. this.utils.loginOut();
  314. this.getUserInfo();
  315. }
  316. }
  317. }
  318. </script>
  319. <style lang="scss" scoped>
  320. .top-cont{
  321. width: 100%;
  322. height: 494upx;
  323. position: relative;
  324. // background-image: url(../../static/images/personl_top_bg.png);
  325. background-repeat: repeat-x;
  326. background-size: 40upx 100%;
  327. .bg{
  328. width: 100%;
  329. height: 380rpx;
  330. position: absolute;
  331. top: 0;
  332. left: 0;
  333. z-index: -1;
  334. }
  335. .top-inner{
  336. width: 100%;
  337. // height: 100%;
  338. position: absolute;
  339. top: 0;
  340. left: 0;
  341. z-index: 2;
  342. padding-bottom: 24rpx;
  343. .user-info{
  344. padding: 88upx 30upx 0 30upx;
  345. display: flex;
  346. align-items: center;
  347. justify-content: space-between;
  348. .left{
  349. position: relative;
  350. display: flex;
  351. .head-img{
  352. width: 120upx;
  353. height: 120upx;
  354. border-radius: 50%;
  355. overflow: hidden;
  356. margin-right: 30upx;
  357. border: 4upx solid #FFFFFF;
  358. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  359. image{
  360. width: 100%;
  361. height: 100%;
  362. }
  363. }
  364. .name-phone{
  365. padding-top: 15upx;
  366. .name{
  367. font-size: 40upx;
  368. font-family: PingFang SC;
  369. font-weight: bold;
  370. color: #111111;
  371. line-height: 1;
  372. }
  373. .phone{
  374. font-size: 28upx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #666666;
  378. line-height: 1;
  379. margin-top: 30upx;
  380. }
  381. }
  382. }
  383. .right{
  384. display: flex;
  385. align-items: center;
  386. justify-content: center;
  387. .msg-box{
  388. margin-left: 10upx;
  389. width: 44upx;
  390. height: 44upx;
  391. image{
  392. width: 100%;
  393. height: 100%;
  394. }
  395. }
  396. .set{
  397. width: 44upx;
  398. height: 44upx;
  399. image{
  400. width: 100%;
  401. height: 100%;
  402. }
  403. }
  404. }
  405. }
  406. .my-order{
  407. padding: 50upx 20upx 0;
  408. .inner{
  409. box-sizing: border-box;
  410. height: 245upx;
  411. // height: 105upx;
  412. background: #FFFFFF;
  413. border-radius: 16upx;
  414. padding: 40upx 30upx;
  415. display: flex;
  416. flex-direction: column;
  417. justify-content: space-between;
  418. .title-box{
  419. display: flex;
  420. align-items: center;
  421. justify-content: space-between;
  422. .title{
  423. font-size: 34upx;
  424. font-family: PingFang SC;
  425. font-weight: bold;
  426. color: #222222;
  427. line-height: 1;
  428. }
  429. .all-order{
  430. display: flex;
  431. align-items: center;
  432. .text{
  433. font-size: 26upx;
  434. font-family: PingFang SC;
  435. font-weight: 500;
  436. color: #999999;
  437. line-height: 1;
  438. margin-right: 8upx;
  439. }
  440. image{
  441. width: 14upx;
  442. height: 24upx;
  443. }
  444. }
  445. }
  446. .status-box{
  447. display: flex;
  448. align-items: center;
  449. justify-content: space-between;
  450. padding: 0 10upx;
  451. .item{
  452. display: flex;
  453. flex-direction: column;
  454. align-items: center;
  455. justify-content: center;
  456. image{
  457. width: 40upx;
  458. height: 40upx;
  459. margin-bottom: 18upx;
  460. }
  461. .text{
  462. font-size: 26upx;
  463. font-family: PingFang SC;
  464. font-weight: 500;
  465. color: #111111;
  466. line-height: 1;
  467. }
  468. }
  469. }
  470. }
  471. }
  472. }
  473. }
  474. .content{
  475. margin-top: 20upx;
  476. padding: 0 20upx;
  477. display: flex;
  478. align-items: center;
  479. justify-content: center;
  480. .used-tools{
  481. box-sizing: border-box;
  482. background: #FFFFFF;
  483. border-radius: 16upx;
  484. padding: 40upx 30upx;
  485. .title{
  486. font-size: 34upx;
  487. font-family: PingFang SC;
  488. font-weight: bold;
  489. color: #222222;
  490. line-height: 1;
  491. }
  492. .tools-list{
  493. margin-top: 50upx;
  494. display: flex;
  495. flex-wrap: wrap;
  496. width: 100%;
  497. .item{
  498. box-sizing: border-box;
  499. width: 25%;
  500. display: flex;
  501. flex-direction: column;
  502. align-items: center;
  503. justify-content: center;
  504. margin-bottom: 50upx;
  505. position: relative;
  506. image{
  507. width: 44upx;
  508. height: 44upx;
  509. }
  510. .text{
  511. font-size: 24upx;
  512. font-family: PingFang SC;
  513. font-weight: 500;
  514. color: #111111;
  515. line-height: 1;
  516. margin-top: 20upx;
  517. }
  518. .contact-btn{
  519. display: inline-block;
  520. position: absolute;
  521. top: 0;
  522. left: 0;
  523. width: 100%;
  524. height: 100%;
  525. opacity: 0;
  526. }
  527. }
  528. }
  529. }
  530. }
  531. .sub-btn{
  532. position: absolute;
  533. width: 100%;
  534. height: 100%;
  535. opacity: 0;
  536. }
  537. .like-product{
  538. padding: 0 20rpx;
  539. }
  540. .banner{
  541. padding: 20rpx 20rpx 0rpx 20rpx;
  542. // height: 200rpx;
  543. position: relative;
  544. display: flex;
  545. align-items: center;
  546. justify-content: center;
  547. image{
  548. width:100%;
  549. height: 100%;
  550. border-radius: 10rpx;
  551. }
  552. .tel_btn{
  553. width: 100%;
  554. height: 100%;
  555. top:0upx;
  556. position: absolute;
  557. opacity:0.0;
  558. }
  559. }
  560. .log-out {
  561. height: 80upx;
  562. width: 80%;
  563. background:#fff;
  564. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  565. line-height: 80upx;
  566. text-align: center;
  567. font-size: 26upx;
  568. font-family: PingFang SC;
  569. font-weight: 500;
  570. color: #018C39;
  571. margin: 0 auto;
  572. border-radius: 16upx;
  573. margin-top: 20upx;
  574. }
  575. </style>