You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

463 lines
9.0 KiB

8 months ago
8 months ago
  1. <template>
  2. <view class="content">
  3. <view class="banner">
  4. <view class="head-div flex">
  5. <view style="width: 118rpx;height: 118rpx;">
  6. <image style="width: 118rpx;height: 118rpx;border-radius: 50%;" :src="userInfo.headImage"></image>
  7. </view>
  8. <view style="padding: 10rpx 34rpx;">
  9. <view class="nickname">{{ userInfo.nickName }}</view>
  10. <view class="days">
  11. 手机号
  12. <view class="phone">{{ userInfo.phone }}</view>
  13. </view>
  14. </view>
  15. </view>
  16. <view style="position: absolute; top: 96rpx;right: 32rpx;" @click="toSetting">
  17. <image src="/static/icons/icon8.png" mode="aspectFit" style="width: 32rpx; height: 32rpx"></image>
  18. </view>
  19. </view>
  20. <view class="one-card b-relative">
  21. <view style="position: absolute; top: -65rpx;left: 50%;z-index: 9;
  22. transform: translate(-50%);">
  23. <image style="width: 605rpx;height: 200rpx;margin-left: 8px;" src="/static/ms/tx.png"></image>
  24. <view class="font-4">
  25. <view>账号余额</view>
  26. <view class="font-5">
  27. <span style="font-size: 32rpx;margin-right: 10rpx">¥</span>
  28. {{ userInfo.price }}
  29. </view>
  30. </view>
  31. <view class="button-cz" @click="clickWallet">立即充值</view>
  32. </view>
  33. <view class="cart-top">
  34. </view>
  35. <view class="cart">
  36. <view class="collect" @click="clickCollect">
  37. <view class="tx">
  38. 我的收藏
  39. </view>
  40. <view class="info">
  41. {{ collectNum }}
  42. </view>
  43. </view>
  44. <view class="coupon" @click="clickCoupon">
  45. <view class="tx">
  46. 我的优惠劵
  47. </view>
  48. <view class="info">
  49. {{ couponNum }}
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="two-card">
  55. <view class="flex">
  56. <view style="width: 10rpx;height: 30rpx;background: #4a9ca6;border-radius: 6rpx;" />
  57. <view class="head-title">常用功能</view>
  58. </view>
  59. <view class="flex flex-sb icons">
  60. <view @click="clickAddress">
  61. <image class="icon" src="/static/icons/m1.png" />
  62. <view class="title">地址管理</view>
  63. </view>
  64. <view @click="clickSettled">
  65. <image class="icon" src="/static/icons/m2.png" />
  66. <view class="title">技师入驻</view>
  67. </view>
  68. <view @click="clickService">
  69. <image class="icon" src="/static/icons/m3.png" />
  70. <view class="title">联系客服</view>
  71. </view>
  72. <view @click="clickDistribute">
  73. <image class="icon" src="/static/icons/m4.png" />
  74. <view class="title">分销代理</view>
  75. </view>
  76. </view>
  77. </view>
  78. <view style="text-align: center;color: #aaa;padding: 20px;line-height: 22px;">
  79. {{ copyright }}
  80. <br />
  81. {{ gs_name }}
  82. <br />
  83. {{ beian }}
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. userInfo: {},
  92. couponNum: 0,
  93. collectNum: 0,
  94. copyright : '',
  95. gs_name : '',
  96. beian : ''
  97. }
  98. },
  99. onShow() {
  100. this.getUserInfo()
  101. this.getCouponNum()
  102. this.getCollectNum()
  103. this.getConfig()
  104. },
  105. methods: {
  106. //获取用户信息
  107. getUserInfo() {
  108. this.$api('getUserInfo', {}, res => {
  109. if (res.code == 200) {
  110. this.userInfo = res.result;
  111. if(!res.result.phone){ //用户未绑定手机
  112. this.toPhoneDetail()
  113. }
  114. }
  115. if (res.code == 500 && res.message === '操作失败,用户不存在!') {
  116. localStorage.removeItem('token')
  117. localStorage.removeItem('userInfo')
  118. uni.navigateTo({
  119. url: '/pages/login/login'
  120. })
  121. }
  122. })
  123. },
  124. //跳转设置页面
  125. toSetting() {
  126. uni.navigateTo({
  127. url: '/pages/mine/setting'
  128. })
  129. },
  130. //跳转收藏页面
  131. clickCollect() {
  132. uni.navigateTo({
  133. url: '/pages/mine/collect'
  134. })
  135. },
  136. //跳转优惠券页面
  137. clickCoupon() {
  138. uni.navigateTo({
  139. url: '/pages/mine/coupon'
  140. })
  141. },
  142. //跳转地址管理页面
  143. clickAddress() {
  144. uni.navigateTo({
  145. url: '/pages/mine/address'
  146. })
  147. },
  148. //跳转技师招募页面
  149. clickSettled() {
  150. uni.navigateTo({
  151. url: '/pages/mine/settled'
  152. })
  153. },
  154. //跳转我的钱包页面
  155. clickWallet() {
  156. uni.navigateTo({
  157. url: '/pages/mine/wallet'
  158. })
  159. },
  160. //跳转分销代理页面
  161. clickDistribute() {
  162. uni.navigateTo({
  163. url: '/pages/mine/distribution'
  164. })
  165. },
  166. //联系客服
  167. clickService() {
  168. if (this.phone.includes('http')) {
  169. window.open(this.phone, true)
  170. return
  171. }
  172. uni.makePhoneCall({
  173. phoneNumber: this.phone,
  174. success: () => {},
  175. fail: () => {}
  176. });
  177. },
  178. //获取优惠券数量
  179. getCouponNum() {
  180. this.$api('getCouponList', {}, res => {
  181. if (res.code == 200) {
  182. this.couponNum = res.result.total;
  183. }
  184. })
  185. },
  186. //获取收藏技师数量
  187. getCollectNum() {
  188. this.$api('getCollectList', this.queryParams, res => {
  189. if (res.code == 200) {
  190. this.collectNum = res.result.total;
  191. }
  192. })
  193. },
  194. //获取配置信息
  195. getConfig() {
  196. this.$api('getConfig', {} ,res => {
  197. if(res.code == 200){
  198. res.result.forEach(item => {
  199. if(item.keyValue == 'phone'){
  200. this.phone = this.deleteTag(item.content);
  201. }
  202. if(item.keyValue == 'copyright'){
  203. this.copyright = item.content
  204. }
  205. if(item.keyValue == 'gs_name'){
  206. this.gs_name = item.content
  207. }
  208. if(item.keyValue == 'beian'){
  209. this.beian = item.content
  210. }
  211. })
  212. }
  213. })
  214. },
  215. //删除html标签
  216. deleteTag(html){
  217. return html.replace(/<[^>]*>/g, '');
  218. },
  219. //跳转绑定手机页面
  220. toPhoneDetail(){
  221. uni.reLaunch({
  222. url : '/pages/mine/phoneDetail'
  223. })
  224. }
  225. }
  226. }
  227. </script>
  228. <style scoped>
  229. body {
  230. background-color: #f5f5f5;
  231. }
  232. .banner {
  233. width: 100%;
  234. height: calc(392rpx -160rpx);
  235. background: linear-gradient(to top right, #4899a6, #6fc6ad);
  236. }
  237. .head-div {
  238. width: calc(100vw - 72rpx);
  239. height: 268rpx;
  240. padding: 72rpx 36rpx 0;
  241. margin: 0 auto;
  242. }
  243. .nickname {
  244. font-size: 36rpx;
  245. font-family: PingFang SC, PingFang SC-Bold;
  246. font-weight: 700;
  247. text-align: left;
  248. color: #fff;
  249. line-height: 42rpx;
  250. }
  251. .days {
  252. display: flex;
  253. font-size: 20rpx;
  254. font-family: PingFang SC, PingFang SC-Regular;
  255. font-weight: 400;
  256. text-align: left;
  257. color: #fff;
  258. line-height: 28px;
  259. margin-top: 10rpx;
  260. }
  261. .bind{
  262. background: #e2e2e2;
  263. padding: 0rpx 10rpx;
  264. border-radius: 10rpx;
  265. }
  266. .one-card {
  267. width: calc(100% - 80px);
  268. height: 116px;
  269. border-radius: 16rpx;
  270. margin: -30rpx auto 0;
  271. background-color: #fff;
  272. padding: 20px;
  273. }
  274. .two-card {
  275. width: calc(100% - 60px);
  276. border-radius: 16rpx;
  277. margin: 20rpx auto;
  278. padding: 40rpx 10px;
  279. background: #ffffff;
  280. border-radius: 16px;
  281. }
  282. .title {
  283. height: 40rpx;
  284. line-height: 40rpx;
  285. font-size: 24rpx;
  286. font-family: PingFang SC, PingFang SC-Regular;
  287. font-weight: 400;
  288. text-align: center;
  289. color: #2f2e2e;
  290. margin-top: 15rpx;
  291. }
  292. .icons {
  293. width: calc(100% - 20px);
  294. height: 98rpx;
  295. padding: 30rpx 20rpx;
  296. margin-top: 30rpx;
  297. }
  298. .icon {
  299. margin: 0 32rpx;
  300. width: 48rpx;
  301. height: 48rpx;
  302. border-radius: 50%;
  303. }
  304. .head-title {
  305. font-size: 30rpx;
  306. font-family: PingFang SC, PingFang SC-Bold;
  307. color: #2f2e2e;
  308. line-height: 30rpx;
  309. margin-left: 10rpx;
  310. font-weight: 700;
  311. }
  312. .font-4 {
  313. font-size: 28rpx;
  314. font-family: PingFang SC, PingFang SC-Bold;
  315. text-align: left;
  316. color: #ffffff;
  317. text-shadow: 0 4rpx 6rpx 0 rgba(40, 170, 133, 0.81);
  318. line-height: 44rpx;
  319. position: absolute;
  320. top: 32rpx;
  321. left: 72rpx;
  322. z-index: 1;
  323. }
  324. .font-5 {
  325. font-size: 30rpx;
  326. font-family: PingFang SC, PingFang SC-Bold;
  327. text-align: left;
  328. color: #ffffff;
  329. line-height: 72rpx;
  330. text-shadow: 0 4rpx 6rpx 0 rgba(0, 0, 0, 0.16);
  331. }
  332. .button-cz {
  333. width: 200rpx;
  334. height: 58rpx;
  335. line-height: 58rpx;
  336. background: linear-gradient(182deg, #ffffff 2%, #a6fce3 88%);
  337. border-radius: 30rpx;
  338. box-shadow: 0 6rpx 12rpx 0 rgba(129, 209, 186, 0.66);
  339. font-size: 28rpx;
  340. font-family: PingFang SC, PingFang SC-Bold;
  341. font-weight: 700;
  342. text-align: center;
  343. color: #3fc791;
  344. position: absolute;
  345. top: 72rpx;
  346. right: 52rpx;
  347. z-index: 1;
  348. }
  349. .cart {
  350. width: calc(100% - 15px);
  351. background-color: #fff;
  352. position: absolute;
  353. top: 60px;
  354. left: 10px;
  355. z-index: 10;
  356. display: flex;
  357. justify-content: center;
  358. align-items: center;
  359. }
  360. .cart>view {
  361. width: calc(50% - 10px);
  362. height: 140rpx;
  363. background-color: #2f2e2e;
  364. border-radius: 20rpx;
  365. background-size: 100% 100%;
  366. box-sizing: border-box;
  367. padding: 20rpx;
  368. font-size: 26rpx;
  369. line-height: 46rpx;
  370. }
  371. .cart>view>view {}
  372. .cart>view>.info {
  373. color: #666;
  374. font-size: 20rpx;
  375. }
  376. .cart>view>view>text {
  377. font-size: 30rpx;
  378. font-weight: 600;
  379. }
  380. .collect {
  381. margin-top: 10px;
  382. background: url(/static/ms/merit.png);
  383. margin-right: 5px;
  384. }
  385. .coupon {
  386. margin-left: 5px;
  387. margin-top: 10px;
  388. background: url(/static/ms/meleft.png);
  389. }
  390. .cart-top {
  391. width: calc(100% - 20px);
  392. height: 30px;
  393. display: block;
  394. position: absolute;
  395. left: 14px;
  396. background-color: #666;
  397. top: 45px;
  398. border-radius: calc(30% + 10px);
  399. }
  400. </style>