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

720 lines
17 KiB

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