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

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