index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  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="3"></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. }
  334. .top-inner{
  335. width: 100%;
  336. height: 100%;
  337. position: absolute;
  338. top: 0;
  339. left: 0;
  340. z-index: 2;
  341. .user-info{
  342. padding: 88upx 30upx 0 30upx;
  343. display: flex;
  344. align-items: center;
  345. justify-content: space-between;
  346. .left{
  347. position: relative;
  348. display: flex;
  349. .head-img{
  350. width: 120upx;
  351. height: 120upx;
  352. border-radius: 50%;
  353. overflow: hidden;
  354. margin-right: 30upx;
  355. border: 4upx solid #FFFFFF;
  356. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  357. image{
  358. width: 100%;
  359. height: 100%;
  360. }
  361. }
  362. .name-phone{
  363. padding-top: 15upx;
  364. .name{
  365. font-size: 40upx;
  366. font-family: PingFang SC;
  367. font-weight: bold;
  368. color: #111111;
  369. line-height: 1;
  370. }
  371. .phone{
  372. font-size: 28upx;
  373. font-family: PingFang SC;
  374. font-weight: 500;
  375. color: #666666;
  376. line-height: 1;
  377. margin-top: 30upx;
  378. }
  379. }
  380. }
  381. .right{
  382. display: flex;
  383. align-items: center;
  384. justify-content: center;
  385. .msg-box{
  386. margin-left: 10upx;
  387. width: 44upx;
  388. height: 44upx;
  389. image{
  390. width: 100%;
  391. height: 100%;
  392. }
  393. }
  394. .set{
  395. width: 44upx;
  396. height: 44upx;
  397. image{
  398. width: 100%;
  399. height: 100%;
  400. }
  401. }
  402. }
  403. }
  404. .my-order{
  405. padding: 50upx 20upx 0;
  406. .inner{
  407. box-sizing: border-box;
  408. height: 245upx;
  409. // height: 105upx;
  410. background: #FFFFFF;
  411. border-radius: 16upx;
  412. padding: 40upx 30upx;
  413. display: flex;
  414. flex-direction: column;
  415. justify-content: space-between;
  416. .title-box{
  417. display: flex;
  418. align-items: center;
  419. justify-content: space-between;
  420. .title{
  421. font-size: 34upx;
  422. font-family: PingFang SC;
  423. font-weight: bold;
  424. color: #222222;
  425. line-height: 1;
  426. }
  427. .all-order{
  428. display: flex;
  429. align-items: center;
  430. .text{
  431. font-size: 26upx;
  432. font-family: PingFang SC;
  433. font-weight: 500;
  434. color: #999999;
  435. line-height: 1;
  436. margin-right: 8upx;
  437. }
  438. image{
  439. width: 14upx;
  440. height: 24upx;
  441. }
  442. }
  443. }
  444. .status-box{
  445. display: flex;
  446. align-items: center;
  447. justify-content: space-between;
  448. padding: 0 10upx;
  449. .item{
  450. display: flex;
  451. flex-direction: column;
  452. align-items: center;
  453. justify-content: center;
  454. image{
  455. width: 40upx;
  456. height: 40upx;
  457. margin-bottom: 18upx;
  458. }
  459. .text{
  460. font-size: 26upx;
  461. font-family: PingFang SC;
  462. font-weight: 500;
  463. color: #111111;
  464. line-height: 1;
  465. }
  466. }
  467. }
  468. }
  469. }
  470. }
  471. }
  472. .content{
  473. margin-top: 20upx;
  474. padding: 0 20upx;
  475. display: flex;
  476. align-items: center;
  477. justify-content: center;
  478. .used-tools{
  479. box-sizing: border-box;
  480. background: #FFFFFF;
  481. border-radius: 16upx;
  482. padding: 40upx 30upx;
  483. .title{
  484. font-size: 34upx;
  485. font-family: PingFang SC;
  486. font-weight: bold;
  487. color: #222222;
  488. line-height: 1;
  489. }
  490. .tools-list{
  491. margin-top: 50upx;
  492. display: flex;
  493. flex-wrap: wrap;
  494. width: 100%;
  495. .item{
  496. box-sizing: border-box;
  497. width: 25%;
  498. display: flex;
  499. flex-direction: column;
  500. align-items: center;
  501. justify-content: center;
  502. margin-bottom: 50upx;
  503. position: relative;
  504. image{
  505. width: 44upx;
  506. height: 44upx;
  507. }
  508. .text{
  509. font-size: 24upx;
  510. font-family: PingFang SC;
  511. font-weight: 500;
  512. color: #111111;
  513. line-height: 1;
  514. margin-top: 20upx;
  515. }
  516. .contact-btn{
  517. display: inline-block;
  518. position: absolute;
  519. top: 0;
  520. left: 0;
  521. width: 100%;
  522. height: 100%;
  523. opacity: 0;
  524. }
  525. }
  526. }
  527. }
  528. }
  529. .sub-btn{
  530. position: absolute;
  531. width: 100%;
  532. height: 100%;
  533. opacity: 0;
  534. }
  535. .like-product{
  536. padding: 0 20rpx;
  537. }
  538. .banner{
  539. padding: 20rpx 20rpx 0rpx 20rpx;
  540. // height: 200rpx;
  541. position: relative;
  542. display: flex;
  543. align-items: center;
  544. justify-content: center;
  545. image{
  546. width:100%;
  547. height: 100%;
  548. border-radius: 10rpx;
  549. }
  550. .tel_btn{
  551. width: 100%;
  552. height: 100%;
  553. top:0upx;
  554. position: absolute;
  555. opacity:0.0;
  556. }
  557. }
  558. .log-out {
  559. height: 80upx;
  560. width: 80%;
  561. background:#fff;
  562. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  563. line-height: 80upx;
  564. text-align: center;
  565. font-size: 26upx;
  566. font-family: PingFang SC;
  567. font-weight: 500;
  568. color: #018C39;
  569. margin: 0 auto;
  570. border-radius: 16upx;
  571. margin-top: 20upx;
  572. }
  573. </style>