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