宜轩到家/服务到家第三版,换个颜色
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.

477 lines
9.2 KiB

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