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.

441 lines
8.5 KiB

8 months ago
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. couponNum: 0,
  92. collectNum: 0,
  93. copyright : '',
  94. gs_name : '',
  95. beian : ''
  96. }
  97. },
  98. onShow() {
  99. this.$store.commit('getUserInfo')
  100. this.getCouponNum()
  101. this.getCollectNum()
  102. this.getConfig()
  103. },
  104. methods: {
  105. //跳转设置页面
  106. toSetting() {
  107. uni.navigateTo({
  108. url: '/pages/mine/setting'
  109. })
  110. },
  111. //跳转收藏页面
  112. clickCollect() {
  113. uni.navigateTo({
  114. url: '/pages/mine/collect'
  115. })
  116. },
  117. //跳转优惠券页面
  118. clickCoupon() {
  119. uni.navigateTo({
  120. url: '/pages/mine/coupon'
  121. })
  122. },
  123. //跳转地址管理页面
  124. clickAddress() {
  125. uni.navigateTo({
  126. url: '/pages/mine/address'
  127. })
  128. },
  129. //跳转技师招募页面
  130. clickSettled() {
  131. uni.navigateTo({
  132. url: '/pages/mine/settled'
  133. })
  134. },
  135. //跳转我的钱包页面
  136. clickWallet() {
  137. uni.navigateTo({
  138. url: '/pages/mine/wallet'
  139. })
  140. },
  141. //跳转分销代理页面
  142. clickDistribute() {
  143. uni.navigateTo({
  144. url: '/pages/mine/distribution'
  145. })
  146. },
  147. //联系客服
  148. clickService() {
  149. if (this.phone.includes('http')) {
  150. window.open(this.phone, true)
  151. return
  152. }
  153. uni.makePhoneCall({
  154. phoneNumber: this.phone,
  155. success: () => {},
  156. fail: () => {}
  157. });
  158. },
  159. //获取优惠券数量
  160. getCouponNum() {
  161. this.$api('getCouponList', {}, res => {
  162. if (res.code == 200) {
  163. this.couponNum = res.result.total;
  164. }
  165. })
  166. },
  167. //获取收藏技师数量
  168. getCollectNum() {
  169. this.$api('getCollectList', this.queryParams, res => {
  170. if (res.code == 200) {
  171. this.collectNum = res.result.total;
  172. }
  173. })
  174. },
  175. //获取配置信息
  176. getConfig() {
  177. this.$api('getConfig', {} ,res => {
  178. if(res.code == 200){
  179. res.result.forEach(item => {
  180. if(item.keyValue == 'phone'){
  181. this.phone = this.deleteTag(item.content);
  182. }
  183. if(item.keyValue == 'copyright'){
  184. this.copyright = item.content
  185. }
  186. if(item.keyValue == 'gs_name'){
  187. this.gs_name = item.content
  188. }
  189. if(item.keyValue == 'beian'){
  190. this.beian = item.content
  191. }
  192. })
  193. }
  194. })
  195. },
  196. //删除html标签
  197. deleteTag(html){
  198. return html.replace(/<[^>]*>/g, '');
  199. },
  200. //跳转绑定手机页面
  201. toPhoneDetail(){
  202. uni.reLaunch({
  203. url : '/pages/mine/phoneDetail'
  204. })
  205. }
  206. }
  207. }
  208. </script>
  209. <style scoped>
  210. body {
  211. background-color: #f5f5f5;
  212. }
  213. .banner {
  214. width: 100%;
  215. height: calc(392rpx -160rpx);
  216. background: linear-gradient(to top right, #4899a6, #6fc6ad);
  217. }
  218. .head-div {
  219. width: calc(100vw - 72rpx);
  220. height: 268rpx;
  221. padding: 72rpx 36rpx 0;
  222. margin: 0 auto;
  223. }
  224. .nickname {
  225. font-size: 36rpx;
  226. font-family: PingFang SC, PingFang SC-Bold;
  227. font-weight: 700;
  228. text-align: left;
  229. color: #fff;
  230. line-height: 42rpx;
  231. }
  232. .days {
  233. display: flex;
  234. font-size: 20rpx;
  235. font-family: PingFang SC, PingFang SC-Regular;
  236. font-weight: 400;
  237. text-align: left;
  238. color: #fff;
  239. line-height: 28px;
  240. margin-top: 10rpx;
  241. }
  242. .bind{
  243. background: #e2e2e2;
  244. padding: 0rpx 10rpx;
  245. border-radius: 10rpx;
  246. }
  247. .one-card {
  248. width: calc(100% - 80px);
  249. height: 116px;
  250. border-radius: 16rpx;
  251. margin: -30rpx auto 0;
  252. background-color: #fff;
  253. padding: 20px;
  254. }
  255. .two-card {
  256. width: calc(100% - 60px);
  257. border-radius: 16rpx;
  258. margin: 20rpx auto;
  259. padding: 40rpx 10px;
  260. background: #ffffff;
  261. border-radius: 16px;
  262. }
  263. .title {
  264. height: 40rpx;
  265. line-height: 40rpx;
  266. font-size: 24rpx;
  267. font-family: PingFang SC, PingFang SC-Regular;
  268. font-weight: 400;
  269. text-align: center;
  270. color: #2f2e2e;
  271. margin-top: 15rpx;
  272. }
  273. .icons {
  274. width: calc(100% - 20px);
  275. height: 98rpx;
  276. padding: 30rpx 20rpx;
  277. margin-top: 30rpx;
  278. }
  279. .icon {
  280. margin: 0 32rpx;
  281. width: 48rpx;
  282. height: 48rpx;
  283. border-radius: 50%;
  284. }
  285. .head-title {
  286. font-size: 30rpx;
  287. font-family: PingFang SC, PingFang SC-Bold;
  288. color: #2f2e2e;
  289. line-height: 30rpx;
  290. margin-left: 10rpx;
  291. font-weight: 700;
  292. }
  293. .font-4 {
  294. font-size: 28rpx;
  295. font-family: PingFang SC, PingFang SC-Bold;
  296. text-align: left;
  297. color: #ffffff;
  298. text-shadow: 0 4rpx 6rpx 0 rgba(40, 170, 133, 0.81);
  299. line-height: 44rpx;
  300. position: absolute;
  301. top: 32rpx;
  302. left: 72rpx;
  303. z-index: 1;
  304. }
  305. .font-5 {
  306. font-size: 30rpx;
  307. font-family: PingFang SC, PingFang SC-Bold;
  308. text-align: left;
  309. color: #ffffff;
  310. line-height: 72rpx;
  311. text-shadow: 0 4rpx 6rpx 0 rgba(0, 0, 0, 0.16);
  312. }
  313. .button-cz {
  314. width: 200rpx;
  315. height: 58rpx;
  316. line-height: 58rpx;
  317. background: linear-gradient(182deg, #ffffff 2%, #a6fce3 88%);
  318. border-radius: 30rpx;
  319. box-shadow: 0 6rpx 12rpx 0 rgba(129, 209, 186, 0.66);
  320. font-size: 28rpx;
  321. font-family: PingFang SC, PingFang SC-Bold;
  322. font-weight: 700;
  323. text-align: center;
  324. color: #3fc791;
  325. position: absolute;
  326. top: 72rpx;
  327. right: 52rpx;
  328. z-index: 1;
  329. }
  330. .cart {
  331. width: calc(100% - 15px);
  332. background-color: #fff;
  333. position: absolute;
  334. top: 60px;
  335. left: 10px;
  336. z-index: 10;
  337. display: flex;
  338. justify-content: center;
  339. align-items: center;
  340. }
  341. .cart>view {
  342. width: calc(50% - 10px);
  343. height: 140rpx;
  344. background-color: #2f2e2e;
  345. border-radius: 20rpx;
  346. background-size: 100% 100%;
  347. box-sizing: border-box;
  348. padding: 20rpx;
  349. font-size: 26rpx;
  350. line-height: 46rpx;
  351. }
  352. .cart>view>view {}
  353. .cart>view>.info {
  354. color: #666;
  355. font-size: 20rpx;
  356. }
  357. .cart>view>view>text {
  358. font-size: 30rpx;
  359. font-weight: 600;
  360. }
  361. .collect {
  362. margin-top: 10px;
  363. background: url(/static/ms/merit.png);
  364. margin-right: 5px;
  365. }
  366. .coupon {
  367. margin-left: 5px;
  368. margin-top: 10px;
  369. background: url(/static/ms/meleft.png);
  370. }
  371. .cart-top {
  372. width: calc(100% - 20px);
  373. height: 30px;
  374. display: block;
  375. position: absolute;
  376. left: 14px;
  377. background-color: #666;
  378. top: 45px;
  379. border-radius: calc(30% + 10px);
  380. }
  381. </style>