index.vue 14 KB

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