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

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