index.vue 15 KB

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