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.

458 lines
8.9 KiB

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. uni.makePhoneCall({
  169. phoneNumber: this.phone,
  170. success: () => {},
  171. fail: () => {}
  172. });
  173. },
  174. //获取优惠券数量
  175. getCouponNum() {
  176. this.$api('getCouponList', {}, res => {
  177. if (res.code == 200) {
  178. this.couponNum = res.result.total;
  179. }
  180. })
  181. },
  182. //获取收藏技师数量
  183. getCollectNum() {
  184. this.$api('getCollectList', this.queryParams, res => {
  185. if (res.code == 200) {
  186. this.collectNum = res.result.total;
  187. }
  188. })
  189. },
  190. //获取配置信息
  191. getConfig() {
  192. this.$api('getConfig', {} ,res => {
  193. if(res.code == 200){
  194. res.result.forEach(item => {
  195. if(item.keyValue == 'phone'){
  196. this.phone = this.deleteTag(item.content);
  197. }
  198. if(item.keyValue == 'copyright'){
  199. this.copyright = item.content
  200. }
  201. if(item.keyValue == 'gs_name'){
  202. this.gs_name = item.content
  203. }
  204. if(item.keyValue == 'beian'){
  205. this.beian = item.content
  206. }
  207. })
  208. }
  209. })
  210. },
  211. //删除html标签
  212. deleteTag(html){
  213. return html.replace(/<[^>]*>/g, '');
  214. },
  215. //跳转绑定手机页面
  216. toPhoneDetail(){
  217. uni.reLaunch({
  218. url : '/pages/mine/phoneDetail'
  219. })
  220. }
  221. }
  222. }
  223. </script>
  224. <style scoped>
  225. body {
  226. background-color: #f5f5f5;
  227. }
  228. .banner {
  229. width: 100%;
  230. height: calc(392rpx -160rpx);
  231. background: linear-gradient(to top right, #4899a6, #6fc6ad);
  232. }
  233. .head-div {
  234. width: calc(100vw - 72rpx);
  235. height: 268rpx;
  236. padding: 72rpx 36rpx 0;
  237. margin: 0 auto;
  238. }
  239. .nickname {
  240. font-size: 36rpx;
  241. font-family: PingFang SC, PingFang SC-Bold;
  242. font-weight: 700;
  243. text-align: left;
  244. color: #fff;
  245. line-height: 42rpx;
  246. }
  247. .days {
  248. display: flex;
  249. font-size: 20rpx;
  250. font-family: PingFang SC, PingFang SC-Regular;
  251. font-weight: 400;
  252. text-align: left;
  253. color: #fff;
  254. line-height: 28px;
  255. margin-top: 10rpx;
  256. }
  257. .bind{
  258. background: #e2e2e2;
  259. padding: 0rpx 10rpx;
  260. border-radius: 10rpx;
  261. }
  262. .one-card {
  263. width: calc(100% - 80px);
  264. height: 116px;
  265. border-radius: 16rpx;
  266. margin: -30rpx auto 0;
  267. background-color: #fff;
  268. padding: 20px;
  269. }
  270. .two-card {
  271. width: calc(100% - 60px);
  272. border-radius: 16rpx;
  273. margin: 20rpx auto;
  274. padding: 40rpx 10px;
  275. background: #ffffff;
  276. border-radius: 16px;
  277. }
  278. .title {
  279. height: 40rpx;
  280. line-height: 40rpx;
  281. font-size: 24rpx;
  282. font-family: PingFang SC, PingFang SC-Regular;
  283. font-weight: 400;
  284. text-align: center;
  285. color: #2f2e2e;
  286. margin-top: 15rpx;
  287. }
  288. .icons {
  289. width: calc(100% - 20px);
  290. height: 98rpx;
  291. padding: 30rpx 20rpx;
  292. margin-top: 30rpx;
  293. }
  294. .icon {
  295. margin: 0 32rpx;
  296. width: 48rpx;
  297. height: 48rpx;
  298. border-radius: 50%;
  299. }
  300. .head-title {
  301. font-size: 30rpx;
  302. font-family: PingFang SC, PingFang SC-Bold;
  303. color: #2f2e2e;
  304. line-height: 30rpx;
  305. margin-left: 10rpx;
  306. font-weight: 700;
  307. }
  308. .font-4 {
  309. font-size: 28rpx;
  310. font-family: PingFang SC, PingFang SC-Bold;
  311. text-align: left;
  312. color: #ffffff;
  313. text-shadow: 0 4rpx 6rpx 0 rgba(40, 170, 133, 0.81);
  314. line-height: 44rpx;
  315. position: absolute;
  316. top: 32rpx;
  317. left: 72rpx;
  318. z-index: 1;
  319. }
  320. .font-5 {
  321. font-size: 30rpx;
  322. font-family: PingFang SC, PingFang SC-Bold;
  323. text-align: left;
  324. color: #ffffff;
  325. line-height: 72rpx;
  326. text-shadow: 0 4rpx 6rpx 0 rgba(0, 0, 0, 0.16);
  327. }
  328. .button-cz {
  329. width: 200rpx;
  330. height: 58rpx;
  331. line-height: 58rpx;
  332. background: linear-gradient(182deg, #ffffff 2%, #a6fce3 88%);
  333. border-radius: 30rpx;
  334. box-shadow: 0 6rpx 12rpx 0 rgba(129, 209, 186, 0.66);
  335. font-size: 28rpx;
  336. font-family: PingFang SC, PingFang SC-Bold;
  337. font-weight: 700;
  338. text-align: center;
  339. color: #3fc791;
  340. position: absolute;
  341. top: 72rpx;
  342. right: 52rpx;
  343. z-index: 1;
  344. }
  345. .cart {
  346. width: calc(100% - 15px);
  347. background-color: #fff;
  348. position: absolute;
  349. top: 60px;
  350. left: 10px;
  351. z-index: 10;
  352. display: flex;
  353. justify-content: center;
  354. align-items: center;
  355. }
  356. .cart>view {
  357. width: calc(50% - 10px);
  358. height: 140rpx;
  359. background-color: #2f2e2e;
  360. border-radius: 20rpx;
  361. background-size: 100% 100%;
  362. box-sizing: border-box;
  363. padding: 20rpx;
  364. font-size: 26rpx;
  365. line-height: 46rpx;
  366. }
  367. .cart>view>view {}
  368. .cart>view>.info {
  369. color: #666;
  370. font-size: 20rpx;
  371. }
  372. .cart>view>view>text {
  373. font-size: 30rpx;
  374. font-weight: 600;
  375. }
  376. .collect {
  377. margin-top: 10px;
  378. background: url(/static/ms/merit.png);
  379. margin-right: 5px;
  380. }
  381. .coupon {
  382. margin-left: 5px;
  383. margin-top: 10px;
  384. background: url(/static/ms/meleft.png);
  385. }
  386. .cart-top {
  387. width: calc(100% - 20px);
  388. height: 30px;
  389. display: block;
  390. position: absolute;
  391. left: 14px;
  392. background-color: #666;
  393. top: 45px;
  394. border-radius: calc(30% + 10px);
  395. }
  396. </style>