珠宝小程序前端代码
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.

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