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

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