敢为人鲜小程序前端代码仓库
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.

586 lines
13 KiB

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