user.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <template>
  2. <view class="box">
  3. <view class="topBox">
  4. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  5. <view class="nav" :style="{top: iStatusBarHeight + 'px'}">
  6. <view>我的</view>
  7. </view>
  8. </view>
  9. <view class="customerMes">
  10. <image :src="headImg" mode="" style="width: 120rpx;height: 120rpx;border-radius: 60rpx;"></image>
  11. <view class="mes">
  12. <view class="nick">
  13. <view class="nickName" v-if="userInfo.nickName">{{userInfo.nickName}}</view>
  14. <view class="grade" v-if="numList.levelName">{{numList.levelName}}</view>
  15. </view>
  16. <view class="phone">{{userInfo.mobilePhone}}</view>
  17. </view>
  18. </view>
  19. <view class="headerBox">
  20. <view class="quan" @click="gonavigateTo('../index/discountCard')">
  21. <view class="numStr">{{numList.count?numList.count:0}}</view>
  22. <view class="nameStr">优惠券</view>
  23. </view>
  24. <view class="quan">
  25. <view class="numStr">{{numList.totalIntegral?numList.totalIntegral:0}}</view>
  26. <view class="nameStr">积分</view>
  27. </view>
  28. <view class="quan" @click="gonavigateTo('../index/vipCard')">
  29. <view class="numStr">{{numList.cardNum?numList.cardNum:0}}</view>
  30. <view class="nameStr">会员卡</view>
  31. </view>
  32. </view>
  33. <!-- 我的订单 -->
  34. <view class="orderBox">
  35. <view class="orderTitle">我的订单</view>
  36. <view class="orderLIneBox">
  37. <view class="orderLine" @click="goorder(1)">
  38. <view class="orderImgBox">
  39. <view class="orderNum" v-show="numList.waitPurchaseSize>0">{{numList.waitPurchaseSize}}</view>
  40. <image src="../../static/img/icon_daifukuan.png" mode="" class="orderLineImg"></image>
  41. </view>
  42. <view class="orderLineTxt">待付款</view>
  43. </view>
  44. <view class="orderLine" @click="goorder(2)">
  45. <view class="orderImgBox">
  46. <view class="orderNum" v-show="numList.waitServiceSize>0">{{numList.waitServiceSize}}</view>
  47. <image src="../../static/img/icon_daifuwu.png" mode="" class="orderLineImg"></image>
  48. </view>
  49. <view class="orderLineTxt">待服务</view>
  50. </view>
  51. <view class="orderLine" @click="goorder(3)">
  52. <view class="orderImgBox">
  53. <view class="orderNum" v-show="numList.hasOverSize>0">{{numList.hasOverSize}}</view>
  54. <image src="../../static/img/icon_yiwancheng.png" mode="" class="orderLineImg"></image>
  55. </view>
  56. <view class="orderLineTxt">已完成</view>
  57. </view>
  58. <view class="orderLine" @click="goorder(0)">
  59. <view class="orderImgBox">
  60. <view class="orderNum" v-show="numList.allSize>0">{{numList.allSize}}</view>
  61. <image src="../../static/img/icon_allorder.png" mode="" class="orderLineImg"></image>
  62. </view>
  63. <view class="orderLineTxt">全部</view>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 店铺信息 -->
  68. <view class="shopBox">
  69. <view class="shopCont">
  70. <view class="shopName">{{numList.shopInfo.shopName}}</view>
  71. <view class="shopRightBox">
  72. <image src="../../static/img/icon_ditu.png" mode="" class="shopRightImg"
  73. style="margin-right: 67rpx;" @click="map"></image>
  74. <image src="../../static/img/icon_phone.png" mode="" class="shopRightImg" @click="call"></image>
  75. </view>
  76. </view>
  77. <view class="shopTime" v-if="numList.shopInfo.startTime && numList.shopInfo.endTime">{{numList.shopInfo.startTime}}-{{numList.shopInfo.endTime}}</view>
  78. <view class="address">
  79. <view class="Address">{{numList.shopInfo.provinceName}}{{numList.shopInfo.cityName}}{{numList.shopInfo.areaName}}{{numList.shopInfo.address}}
  80. </view>
  81. <view class="distance" v-if="numList.shopInfo.distance&&numList.shopInfo.distance!= '0.00'">{{numList.shopInfo.distance}}km</view>
  82. </view>
  83. </view>
  84. <!-- 我的 相关 -->
  85. <view class="rowBoxBg">
  86. <view class="rowBox" @click="gonavigateTo('../index/shopList')">
  87. <view class="leftView">
  88. <image src="../../static/img/icon_me1.png" mode="" class="liftIcon"></image>
  89. <view class="rowTitle">服务专家</view>
  90. </view>
  91. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  92. </view>
  93. <view class="rowBox" @click="gonavigateTo('./addCar/cailist')">
  94. <view class="leftView">
  95. <image src="../../static/img/icon_me2.png" mode="" class="liftIcon"></image>
  96. <view class="rowTitle">我的车库</view>
  97. </view>
  98. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  99. </view>
  100. <view class="rowBox" @click="gonavigateTo('myBespeak')">
  101. <view class="leftView">
  102. <image src="../../static/img/icon_me3.png" mode="" class="liftIcon"></image>
  103. <view class="rowTitle">我的预约</view>
  104. </view>
  105. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  106. </view>
  107. <view class="rowBox" @click="gonavigateTo('historySpend')">
  108. <view class="leftView">
  109. <image src="../../static/img/icon_me4.png" mode="" class="liftIcon"></image>
  110. <view class="rowTitle">历史消费</view>
  111. </view>
  112. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  113. </view>
  114. <view class="rowBox" @click="gonavigateTo('checkReport')">
  115. <view class="leftView">
  116. <image src="../../static/img/icon_me5.png" mode="" class="liftIcon"></image>
  117. <view class="rowTitle">车检报告</view>
  118. </view>
  119. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  120. </view>
  121. <view class="rowBox" @click="gonavigateTo('invite')">
  122. <view class="leftView">
  123. <image src="../../static/img/icon_me6.png" mode="" class="liftIcon"></image>
  124. <view class="rowTitle">分享给好友</view>
  125. </view>
  126. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  127. </view>
  128. <view class="rowBox" @click="gonavigateTo('invite')">
  129. <view class="leftView">
  130. <image src="../../static/img/icon_me7.png" mode="" class="liftIcon"></image>
  131. <view class="rowTitle">意见反馈</view>
  132. </view>
  133. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  134. </view>
  135. <view class="rowBox" @click="gonavigateTo('')">
  136. <view class="leftView">
  137. <image src="../../static/img/icon_me8.png" mode="" class="liftIcon"></image>
  138. <view class="rowTitle">清除缓存</view>
  139. </view>
  140. <image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
  141. </view>
  142. </view>
  143. <view class="signOut" @click="signOut">退出登录</view>
  144. </view>
  145. </template>
  146. <script>
  147. export default {
  148. data() {
  149. return {
  150. iStatusBarHeight: '',
  151. userInfo: '',
  152. shopData: '',
  153. numList: '',
  154. uid: '',
  155. headImg: '',
  156. location: {
  157. lng: '',
  158. lat: '',
  159. },
  160. }
  161. },
  162. onLoad(opt) {
  163. var that = this;
  164. uni.getLocation({
  165. type: 'gcj02',
  166. success: function(res) {
  167. console.log(res)
  168. that.location.lat = res.latitude
  169. that.location.lng = res.longitude
  170. that.queryMyDetail()
  171. },
  172. fail(err) {
  173. }
  174. });
  175. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  176. const wxOpenData = uni.getStorageSync("wxOpenData");
  177. if (wxOpenData) {
  178. this.headImg = wxOpenData.loginInfo.customerInfo.headImgurl;
  179. this.uid = wxOpenData.loginInfo.uid;
  180. }
  181. this.userInfo = uni.getStorageSync("userInfo")
  182. },
  183. onShow() {
  184. this.queryMyDetail();
  185. },
  186. methods: {
  187. map() {
  188. console.log("打开地图")
  189. var that = this;
  190. if (!that.location.lat || !that.location.lng) {
  191. uni.showToast({
  192. title: '该店铺未设置定位',
  193. icon: 'none',
  194. duration: 3000
  195. });
  196. } else {
  197. uni.openLocation({
  198. latitude: Number(that.location.lat),
  199. longitude: Number(that.location.lng),
  200. name: that.numList.shopInfo.shopName,
  201. address: that.numList.shopInfo.provinceName+that.numList.shopInfo.cityName+that.numList.shopInfo.areaName+that.numList.shopInfo.address,
  202. success: function() {
  203. console.log('success');
  204. },
  205. fail(err) {
  206. console.log(err)
  207. }
  208. });
  209. }
  210. },
  211. call() {
  212. uni.makePhoneCall({
  213. phoneNumber: this.userInfo.mobilePhone
  214. });
  215. },
  216. goorder(num) {
  217. uni.navigateTo({
  218. url: './myOrder/myOrder?num=' + num
  219. })
  220. },
  221. queryMyDetail() {
  222. uni.showLoading({
  223. title: '加载中'
  224. })
  225. this.$http('openreservation/getInfo', {
  226. lat: this.location.lat ? this.location.lat : '',
  227. lng: this.location.lng ? this.location.lng : '',
  228. }, 'GET').then(res => {
  229. uni.hideLoading();
  230. this.numList = res.data
  231. })
  232. },
  233. gonavigateTo(url) {
  234. uni.navigateTo({
  235. url: url
  236. })
  237. },
  238. signOut() {
  239. //uni.clearStorageSync();
  240. uni.removeStorageSync('logodata');
  241. // uni.navigateTo({
  242. // url: '../login/login'
  243. // })
  244. },
  245. },
  246. // 下拉刷新
  247. onPullDownRefresh() {
  248. this.queryMyDetail()
  249. setTimeout(function() {
  250. uni.stopPullDownRefresh();
  251. }, 1000);
  252. },
  253. }
  254. </script>
  255. <style scoped>
  256. .box {
  257. width: 100vw;
  258. min-height: 100vh;
  259. background: linear-gradient(180deg, #FFFFFF 0%, #F4F5F7 100%);
  260. padding-bottom: 60rpx;
  261. }
  262. .topBox {
  263. background: url(http://dmsphoto.66km.com.cn/thFiles/F3AB15EB-B3EC-4597-8E07-0D550032BE54.png);
  264. background-size: 100% 100%;
  265. height: 302rpx;
  266. width: 100vw;
  267. }
  268. .status_bar {
  269. width: 100vw;
  270. position: fixed;
  271. top: 0;
  272. left: 0;
  273. z-index: 999;
  274. }
  275. .nav {
  276. line-height: 44px;
  277. font-size: 34rpx;
  278. font-weight: 600;
  279. display: flex;
  280. justify-content: center;
  281. color: #333333;
  282. position: fixed;
  283. width: 100vw;
  284. left: 0;
  285. }
  286. .flex {
  287. display: flex;
  288. }
  289. .customerMes {
  290. display: flex;
  291. height: 120rpx;
  292. padding-left: 24rpx;
  293. margin-top: -120rpx;
  294. }
  295. .mes {
  296. margin: 20rpx 15rpx 0rpx;
  297. }
  298. .nick {
  299. margin-bottom: 5rpx;
  300. display: flex;
  301. justify-content: flex-start;
  302. }
  303. .nickName {
  304. font-size: 34rpx;
  305. color: #333333;
  306. font-weight: bold;
  307. }
  308. .grade {
  309. margin-left: 15rpx;
  310. font-size: 24rpx;
  311. color: #F19D01;
  312. padding: 0rpx 10rpx;
  313. border: 1rpx solid #F19D01;
  314. border-radius: 4rpx;
  315. height: 32rpx;
  316. }
  317. .phone {
  318. font-size: 24rpx;
  319. color: #666666;
  320. }
  321. .headerBox {
  322. padding: 30rpx 24rpx;
  323. display: flex;
  324. justify-content: space-around;
  325. }
  326. .quan {
  327. display: flex;
  328. flex-direction: column;
  329. align-items: center;
  330. height: 120rpx;
  331. }
  332. .numStr {
  333. font-size: 40rpx;
  334. font-weight: bold;
  335. color: #222222;
  336. line-height: 56rpx;
  337. }
  338. .nameStr {
  339. font-size: 24rpx;
  340. color: #666666;
  341. }
  342. .orderBox {
  343. margin: 0rpx 24rpx;
  344. background: #FFFFFF;
  345. padding: 30rpx 20rpx;
  346. border-radius: 10rpx;
  347. }
  348. .orderTitle {
  349. font-size: 30rpx;
  350. color: #333333;
  351. font-weight: bold;
  352. }
  353. .orderAll {
  354. display: flex;
  355. justify-content: space-between;
  356. align-items: center;
  357. }
  358. .orderLine {
  359. width: 25%;
  360. text-align: center;
  361. }
  362. .orderLineImg {
  363. width: 60rpx;
  364. height: 60rpx;
  365. }
  366. .orderLineTxt {
  367. font-size: 24rpx;
  368. color: #333333;
  369. }
  370. .orderImgBox {
  371. text-align: center;
  372. position: relative;
  373. }
  374. .orderLIneBox {
  375. display: flex;
  376. justify-content: space-between;
  377. padding-top: 30rpx;
  378. }
  379. .orderNum {
  380. line-height: 26rpx;
  381. background: #FF0000;
  382. padding: 0 8rpx;
  383. border-radius: 13rpx;
  384. color: #FFFFFF;
  385. font-size: 20rpx;
  386. position: absolute;
  387. top: -5rpx;
  388. right: 38rpx;
  389. z-index: 11;
  390. }
  391. .rightArrow {
  392. margin-right: 20rpx;
  393. width: 30rpx;
  394. height: 30rpx;
  395. }
  396. .rowBoxBg {
  397. margin: 20rpx 24rpx;
  398. margin-top: 30rpx;
  399. background: #FFFFFF;
  400. border-radius: 10rpx;
  401. }
  402. .rowBox {
  403. display: flex;
  404. justify-content: space-between;
  405. background: #FFFFFF;
  406. padding: 35rpx 0rpx;
  407. border-radius: 10rpx;
  408. align-items: center;
  409. }
  410. .leftView {
  411. display: flex;
  412. align-items: center;
  413. }
  414. .rightView {
  415. display: flex;
  416. align-items: center;
  417. }
  418. .liftIcon {
  419. width: 34rpx;
  420. height: 34rpx;
  421. margin: 0rpx 20rpx;
  422. }
  423. .rowTitle {
  424. color: #3C3C3C;
  425. font-size: 28rpx;
  426. }
  427. .signOut {
  428. width: 702rpx;
  429. height: 98rpx;
  430. background: #FFFFFF;
  431. border-radius: 10rpx;
  432. font-size: 30rpx;
  433. color: #FF3B30;
  434. line-height: 98rpx;
  435. text-align: center;
  436. margin: 40rpx 24rpx;
  437. }
  438. .shopBox {
  439. padding: 20rpx;
  440. margin: 20rpx 24rpx;
  441. background-color: #FFFFFF;
  442. border-radius: 10rpx;
  443. }
  444. .shopCont {
  445. display: flex;
  446. justify-content: space-between;
  447. align-items: center;
  448. }
  449. .shopName {
  450. font-size: 30rpx;
  451. font-weight: bold;
  452. color: #3C3C3C;
  453. line-height: 42rpx;
  454. }
  455. .shopRightBox {
  456. display: flex;
  457. justify-content: space-between;
  458. }
  459. .address {
  460. display: flex;
  461. justify-content: space-between;
  462. align-items: center;
  463. }
  464. .Address,
  465. .shopTime,
  466. .distance {
  467. color: #999999;
  468. font-size: 24rpx;
  469. padding-top: 15rpx;
  470. /* 隐藏文字显示 ...不换行 */
  471. overflow: hidden;
  472. text-overflow: ellipsis;
  473. white-space: nowrap;
  474. }
  475. .shopRightBox {}
  476. .shopRightImg {
  477. width: 44rpx;
  478. height: 45rpx;
  479. }
  480. </style>