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

603 lines
14 KiB

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