推拿小程序前端代码仓库
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.

724 lines
17 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <view class="flex flex-column header">
  4. <view class="user">
  5. <image class="user-avatar" :src="userInfo.headImage" mode="aspectFill"></image>
  6. <view class="user-name">{{ userInfo.nickName }}</view>
  7. </view>
  8. <view class="member">
  9. <view class="flex member-overview" :class="[role ? 'is-member' : '']">
  10. <template v-if="role">
  11. <!-- todo: 缺切图 "皇冠" -->
  12. <image class="icon icon-crown" src="" mode="widthFix"></image>
  13. <template v-if="role === 'member-personal'">
  14. <image class="icon icon-role" src="@/static/image/center/icon-member-personal.png" mode="widthFix"></image>
  15. </template>
  16. <template v-else-if="role === 'member-business'">
  17. <image class="icon icon-role" src="@/static/image/center/icon-member-business.png" mode="widthFix"></image>
  18. </template>
  19. <!-- todo: 换回接口字段 -->
  20. <text class="member-tips">{{ `将于${'2026-12-12'} 到期` }}</text>
  21. </template>
  22. <template v-else>
  23. <view class="flex">
  24. <!-- todo: 缺切图 "皇冠" -->
  25. <image class="icon icon-crown" src="" mode="widthFix"></image>
  26. <!-- todo: 缺切图 "会员" -->
  27. <image class="icon icon-member" src="" mode="widthFix"></image>
  28. <text class="member-tips">成为会员可获得会员卡享受会员福利哟~</text>
  29. </view>
  30. <button plain class="btn member-btn" @click="$utils.navigateTo('/pages_order/mine/memberCenter')">立即开通</button>
  31. </template>
  32. </view>
  33. <view class="member-rights">
  34. <image class="member-rights-bg" src="@/static/image/center/member-bg.png" mode="top" ></image>
  35. <view class="flex member-rights-content">
  36. <view class="flex">
  37. <image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
  38. <view>
  39. <view class="member-rights-label">会员福利</view>
  40. <view class="member-rights-value">会员折扣</view>
  41. </view>
  42. </view>
  43. <view class="flex">
  44. <!-- todo: 缺切图 -->
  45. <image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
  46. <view>
  47. <view class="member-rights-label">会员积分</view>
  48. <view class="member-rights-value">兑换礼品</view>
  49. </view>
  50. </view>
  51. <!-- todo: 缺切图 -->
  52. <view class="flex">
  53. <image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
  54. <view>
  55. <view class="member-rights-label">会员优惠券</view>
  56. <view class="member-rights-value">满减折扣</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- todo: check -> @click="$utils.navigateTo('/pages_order/mine/withdraw') -->
  64. <view class="card flex account">
  65. <view class="flex flex-column">
  66. <view class="account-value">{{ riceInfo.balance || 0 }}<text class="account-unit"></text></view>
  67. <view class="account-label">我的余额</view>
  68. </view>
  69. <view class="flex flex-column">
  70. <!-- todo: 字段对接 -->
  71. <view class="account-value">{{ riceInfo.balance || 0 }}</view>
  72. <view class="account-label">我的积分</view>
  73. </view>
  74. <view class="flex flex-column">
  75. <view class="account-value">{{ riceInfo.canWithdraw || 0 }}<text class="account-unit"></text></view>
  76. <view class="account-label">推广佣金</view>
  77. </view>
  78. <view class="flex flex-column">
  79. <!-- todo: 字段对接 -->
  80. <view class="account-value">{{ riceInfo.balance || 0 }}<text class="account-unit"></text></view>
  81. <view class="account-label">优惠券</view>
  82. </view>
  83. </view>
  84. <view class="card fun-common">
  85. <view v-if="role === 'merchant'" class="fun-header">
  86. <cardTitle>常用功能</cardTitle>
  87. </view>
  88. <view class="fun-content fun-common-content">
  89. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/memberCenter')">
  90. <image class="fun-common-icon" src="@/static/image/center/icon-member-center.png" mode="widthFix"></image>
  91. <text class="fun-common-label">会员中心</text>
  92. </view>
  93. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/partner')">
  94. <image class="fun-common-icon" src="@/static/image/center/icon-team.png" mode="widthFix"></image>
  95. <text class="fun-common-label">我的团队</text>
  96. </view>
  97. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/promotion')">
  98. <image class="fun-common-icon" src="@/static/image/center/icon-invite.png" mode="widthFix"></image>
  99. <text class="fun-common-label">邀请好友</text>
  100. </view>
  101. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/coupon')">
  102. <image class="fun-common-icon" src="@/static/image/center/icon-coupon.png" mode="widthFix"></image>
  103. <text class="fun-common-label">优惠券</text>
  104. </view>
  105. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/voucher')">
  106. <image class="fun-common-icon" src="@/static/image/center/icon-voucher.png" mode="widthFix"></image>
  107. <text class="fun-common-label">代金券</text>
  108. </view>
  109. <!-- todo: check -> @click="openServicePopup" -->
  110. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/home/contact')">
  111. <image class="fun-common-icon" src="@/static/image/center/icon-service.png" mode="widthFix"></image>
  112. <text class="fun-common-label">联系客服</text>
  113. </view>
  114. <!-- todo: navigateTo -->
  115. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/signIn')">
  116. <image class="fun-common-icon" src="@/static/image/center/icon-sign-in.png" mode="widthFix"></image>
  117. <text class="fun-common-label">每日签到</text>
  118. </view>
  119. <!-- todo: navigateTo -->
  120. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/memberCenter')">
  121. <image class="fun-common-icon" src="@/static/image/center/icon-cooperation.png" mode="widthFix"></image>
  122. <text class="fun-common-label">商家合作</text>
  123. </view>
  124. </view>
  125. </view>
  126. <view v-if="role === 'merchant'" class="card fun-merchant">
  127. <view class="fun-header">
  128. <cardTitle>商家功能</cardTitle>
  129. </view>
  130. <view class="flex fun-content fun-merchant-content">
  131. <view class="left">
  132. <image class="left-bg" src="@/static/image/center/bg-verify.png"></image>
  133. <!-- todo: navigateTo -->
  134. <view class="flex left-content" @click="$utils.navigateTo('/pages_order/mine/memberCenter')">
  135. <text>核销明细</text>
  136. <image class="left-icon" src="@/static/image/center/icon-arrow.png" mode="widthFix"></image>
  137. </view>
  138. </view>
  139. <view class="right" @click="onScan">
  140. <image class="right-bg" src="@/static/image/center/bg-scan.png"></image>
  141. </view>
  142. </view>
  143. </view>
  144. <customerServicePopup ref="customerServicePopup" />
  145. <!-- todo: delete -->
  146. <template v-if="false">
  147. <!-- 我的服务 -->
  148. <view class="myServer">
  149. <view class="server-title">
  150. 我的服务
  151. </view>
  152. <view class="box">
  153. <view class="boxs" @click="$utils.navigateTo('/pages/index/order?type=0')">
  154. <image src="@/static/image/center/1.png" mode="aspectFill" />
  155. <view class="title">我的订单</view>
  156. </view>
  157. <view class="boxs" @click="$utils.navigateTo('/pages_order/home/contact')">
  158. <image src="@/static/image/center/3.png" mode="aspectFill" />
  159. <view class="title">联系客服</view>
  160. </view>
  161. </view>
  162. <view class="box">
  163. <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/recruit')">
  164. <image src="@/static/image/center/5.png" mode="aspectFill" />
  165. <view class="title">合伙人招募</view>
  166. </view>
  167. <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/help')">
  168. <image src="@/static/image/center/8.png" mode="aspectFill" />
  169. <view class="title">帮助与反馈</view>
  170. </view>
  171. </view>
  172. <view class="box">
  173. <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/address')">
  174. <image src="@/static/image/center/address.png" mode="aspectFill" />
  175. <view class="title">我的地址</view>
  176. </view>
  177. <view class="boxs" @click="$utils.navigateTo('/pages_order/order/giftList')">
  178. <image src="@/static/image/center/9.png" mode="aspectFill" />
  179. <view class="title">礼包列表</view>
  180. </view>
  181. <view class="boxs" @click="logout">
  182. <image src="@/static/image/center/logout.png" mode="aspectFill" />
  183. <view class="title">退出登录</view>
  184. </view>
  185. </view>
  186. </view>
  187. <!-- 广告 -->
  188. <div v-if="showAdvertising" class="ad"
  189. @click="$utils.navigateTo('/pages_order/mine/recruit')">
  190. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="true" :interval="2000"
  191. :duration="duration">
  192. <swiper-item v-for="(item, index) in adList" :key="index">
  193. <view class="swiper-main">
  194. <view @click="closeAdvertising" class="close">
  195. <image src="@/static/image/center/close.png" mode="aspectFill" class="close-img"></image>
  196. </view>
  197. <image :src="item" mode="aspectFill" class="swiper-main-img"></image>
  198. <div class="ad-tag">
  199. <image src="@/static/image/center/ad-tag.png" mode="aspectFill" class="ad-tag-img"></image>
  200. </div>
  201. </view>
  202. </swiper-item>
  203. </swiper>
  204. </div>
  205. </template>
  206. <tabber select="center" />
  207. </view>
  208. </template>
  209. <script>
  210. import cardTitle from '@/components/base/cardTitle.vue'
  211. import tabber from '@/components/base/tabbar.vue'
  212. import {
  213. mapState
  214. } from 'vuex'
  215. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  216. export default {
  217. components: {
  218. cardTitle,
  219. tabber,
  220. customerServicePopup,
  221. },
  222. computed: {
  223. ...mapState(['userInfo', 'riceInfo']),
  224. adList() {
  225. let arr = [];
  226. if (this.configList?.shop_get_image) {
  227. arr = this.configList?.shop_get_image?.split(',')
  228. }
  229. return arr
  230. }
  231. },
  232. data() {
  233. return {
  234. role: '', // member-personal | member-business | merchant
  235. vipType: ['普通会员', '黄金会员', '渠道商'],
  236. vipImage: ['vip_vip', 'vip_user', 'vip_shop'],
  237. vipList: [],
  238. showAdvertising: true,
  239. userRole: ['会员', '用户', '渠道']
  240. }
  241. },
  242. onShow() {
  243. this.$store.commit('getUserInfo')
  244. this.$store.commit('getRiceInfo')
  245. this.getMemberCardData();
  246. },
  247. methods: {
  248. clickNo() {
  249. uni.showModal({
  250. title: '暂未开放',
  251. })
  252. },
  253. logout(){
  254. uni.showModal({
  255. title: '确认退出登录吗',
  256. success : (r) => {
  257. if (r.confirm) {
  258. this.$store.commit('logout', true)
  259. }
  260. }
  261. })
  262. },
  263. //关闭广告
  264. closeAdvertising() {
  265. this.showAdvertising = false;
  266. },
  267. //获取会员卡片数据
  268. getMemberCardData() {
  269. this.$api('getRiceVipList', res => {
  270. if (res.code == 200) {
  271. this.vipList = res.result
  272. }
  273. })
  274. },
  275. openServicePopup(phone, title) {
  276. // todo
  277. this.$refs.customerServicePopup.open(phone, title)
  278. },
  279. onScan() {
  280. // todo
  281. },
  282. }
  283. }
  284. </script>
  285. <style scoped lang="scss">
  286. .page {
  287. background-color: #F5F5F5;
  288. .header {
  289. height: 550rpx;
  290. background-image: linear-gradient(#84A73F, #D8FF8F);
  291. justify-content: flex-start;
  292. position: relative;
  293. }
  294. // 佣金数据
  295. .brokerage-data {
  296. padding: 20rpx;
  297. background: white;
  298. border-radius: 20rpx;
  299. display: flex;
  300. flex-wrap: wrap;
  301. box-sizing: border-box;
  302. margin: 20rpx 20rpx 20rpx 20rpx;
  303. .brokerage,
  304. .balance {
  305. display: flex;
  306. flex-wrap: wrap;
  307. width: 50%;
  308. .brokerage-img,
  309. .balance-img {
  310. width: 50%;
  311. height: auto;
  312. }
  313. .main {
  314. display: flex;
  315. flex-direction: column;
  316. justify-content: space-around;
  317. width: 50%;
  318. box-sizing: border-box;
  319. padding: 30rpx 0rpx;
  320. .title {
  321. font-size: 34rpx;
  322. }
  323. .money {
  324. font-size: 40rpx;
  325. color: $uni-color;
  326. font-weight: bold;
  327. }
  328. }
  329. }
  330. }
  331. .brokerage-data-mt {
  332. margin-top: 50rpx;
  333. }
  334. // 我的服务
  335. .myServer {
  336. margin: 0rpx 20rpx 20rpx 20rpx;
  337. background: white;
  338. border-radius: 20rpx;
  339. padding: 30rpx 20rpx;
  340. box-sizing: border-box;
  341. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  342. .server-title {
  343. margin-bottom: 30rpx;
  344. font-size: 36rpx;
  345. font-weight: 600;
  346. color: #333;
  347. position: relative;
  348. padding-left: 20rpx;
  349. &::before {
  350. content: '';
  351. position: absolute;
  352. left: 0;
  353. top: 50%;
  354. transform: translateY(-50%);
  355. width: 8rpx;
  356. height: 32rpx;
  357. background: $uni-color;
  358. border-radius: 4rpx;
  359. }
  360. }
  361. .box {
  362. display: flex;
  363. width: 100%;
  364. margin-bottom: 30rpx;
  365. gap: 20rpx;
  366. .boxs {
  367. width: 23%;
  368. display: flex;
  369. flex-direction: column;
  370. justify-content: center;
  371. align-items: center;
  372. padding: 20rpx 0;
  373. border-radius: 16rpx;
  374. transition: all 0.3s ease;
  375. position: relative;
  376. overflow: hidden;
  377. &::after {
  378. content: '';
  379. position: absolute;
  380. top: 0;
  381. left: 0;
  382. width: 100%;
  383. height: 100%;
  384. background: rgba(227, 68, 26, 0.05);
  385. opacity: 0;
  386. transition: opacity 0.3s ease;
  387. z-index: 1;
  388. }
  389. &:active {
  390. transform: scale(0.95);
  391. &::after {
  392. opacity: 1;
  393. }
  394. }
  395. image {
  396. width: 70rpx;
  397. height: 70rpx;
  398. display: block;
  399. margin: 0rpx auto 16rpx auto;
  400. position: relative;
  401. z-index: 2;
  402. transition: transform 0.3s ease;
  403. }
  404. .title {
  405. font-size: 26rpx;
  406. color: #333;
  407. position: relative;
  408. z-index: 2;
  409. transition: color 0.3s ease;
  410. }
  411. &:active {
  412. image {
  413. transform: translateY(-4rpx);
  414. }
  415. .title {
  416. color: $uni-color;
  417. }
  418. }
  419. }
  420. &:last-child {
  421. margin-bottom: 0rpx;
  422. }
  423. }
  424. }
  425. // 广告
  426. .ad {
  427. margin: 0rpx 20rpx;
  428. .swiper {
  429. .swiper-main {
  430. position: relative;
  431. .close {
  432. position: absolute;
  433. top: 20rpx;
  434. right: 20rpx;
  435. .close-img {
  436. width: 40rpx;
  437. height: 40rpx;
  438. }
  439. }
  440. .swiper-main-img {
  441. width: 100%;
  442. height: 200rpx;
  443. border-radius: 20rpx;
  444. }
  445. .ad-tag {
  446. position: absolute;
  447. left: 20rpx;
  448. bottom: 20rpx;
  449. .ad-tag-img {
  450. width: 120rpx;
  451. height: auto;
  452. }
  453. }
  454. }
  455. }
  456. }
  457. }
  458. .user {
  459. margin-top: 123rpx;
  460. &-avatar {
  461. width: 115rpx;
  462. height: 115rpx;
  463. border-radius: 50%;
  464. }
  465. &-name {
  466. margin-top: 4rpx;
  467. color: $uni-text-color-inverse;
  468. font-size: 30rpx;
  469. }
  470. }
  471. .member {
  472. width: calc(100vw - 13rpx*2);
  473. position: absolute;
  474. bottom: 0;
  475. left: 13rpx;
  476. color: #F5F5F5;
  477. font-size: 22rpx;
  478. background-color: #2B2C30;
  479. border-top-left-radius: 20rpx;
  480. border-top-right-radius: 20rpx;
  481. &-overview {
  482. min-height: 81rpx;
  483. justify-content: space-between;
  484. &.is-member {
  485. justify-content: flex-start;
  486. }
  487. }
  488. .icon {
  489. height: auto;
  490. &-crown {
  491. width: 35rpx;
  492. margin-left: 20rpx;
  493. }
  494. &-member {
  495. width: 62rpx;
  496. }
  497. &-role {
  498. width: 156rpx;
  499. margin-right: 15rpx;
  500. }
  501. &-rights {
  502. width: 56rpx;
  503. margin-right: 11rpx;
  504. }
  505. }
  506. &-btn {
  507. padding: 9rpx 17rpx;
  508. color: #000000;
  509. font-size: 22rpx;
  510. background-image: linear-gradient(131deg, #F8EDE1, #B3997E);
  511. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  512. border-radius: 24rpx;
  513. margin-right: 18rpx;
  514. }
  515. &-tips {
  516. margin-left: 6rpx;
  517. }
  518. &-rights {
  519. background-color: #37393D;
  520. position: relative;
  521. width: 100%;
  522. height: 142rpx;
  523. box-sizing: border-box;
  524. &-bg {
  525. width: 100%;
  526. height: 100%;
  527. }
  528. &-content {
  529. position: absolute;
  530. bottom: 0;
  531. width: 100%;
  532. height: 100%;
  533. box-sizing: border-box;
  534. padding: 0 35rpx 6rpx 35rpx;
  535. justify-content: space-between;
  536. }
  537. &-label {
  538. color: #CBAD8F;
  539. font-size: 22rpx;
  540. font-weight: 700;
  541. }
  542. &-value {
  543. color: #F5F5F5;
  544. font-size: 18rpx;
  545. }
  546. }
  547. }
  548. .card {
  549. margin: 20rpx 13rpx 0 13rpx;
  550. }
  551. .account {
  552. padding: 40rpx 40rpx 23rpx 40rpx;
  553. justify-content: space-between;
  554. &-label {
  555. color: #666666;
  556. font-size: 28rpx;
  557. margin-top: 9rpx;
  558. }
  559. &-value {
  560. color: #000000;
  561. font-size: 32rpx;
  562. }
  563. &-unit {
  564. color: #666666;
  565. font-size: 18rpx;
  566. margin-left: 2rpx;
  567. }
  568. }
  569. .fun {
  570. &-header {
  571. text-align: left;
  572. padding-left: 12rpx;
  573. margin-bottom: 19rpx;
  574. /deep/ .title__view {
  575. display: inline-flex;
  576. }
  577. }
  578. &-content {
  579. margin-top: 24rpx;
  580. }
  581. &-common {
  582. padding: 30rpx 40rpx 67rpx 40rpx;
  583. &-content {
  584. display: grid;
  585. grid-template-columns: repeat(4, 1fr);
  586. grid-column-gap: 71rpx;
  587. grid-row-gap: 81rpx;
  588. }
  589. &-icon {
  590. width: 66rpx;
  591. height: auto;
  592. }
  593. &-label {
  594. color: #000000;
  595. font-size: 28rpx;
  596. margin-top: 5rpx;
  597. }
  598. }
  599. &-merchant {
  600. padding: 33rpx 30rpx 28rpx 30rpx;
  601. margin-bottom: 10rpx;
  602. &-content {
  603. justify-content: space-between;
  604. }
  605. .left {
  606. width: 198rpx;
  607. height: 139rpx;
  608. position: relative;
  609. &-bg {
  610. width: 100%;
  611. height: 100%;
  612. }
  613. &-content {
  614. position: absolute;
  615. top: 13rpx;
  616. left: 14rpx;
  617. color: $uni-text-color-inverse;
  618. font-size: 28rpx;
  619. }
  620. &-icon {
  621. width: 23rpx;
  622. height: auto;
  623. margin-left: 9rpx;
  624. }
  625. }
  626. .right {
  627. width: 429rpx;
  628. height: 164rpx;
  629. margin-top: -25rpx;
  630. &-bg {
  631. width: 100%;
  632. height: 100%;
  633. }
  634. }
  635. }
  636. }
  637. </style>