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

520 lines
12 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
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
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
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
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
5 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
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
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"
  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="widthFix" />
  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="widthFix" />
  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="widthFix" />
  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="widthFix" />
  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="widthFix" />
  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="widthFix" />
  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="widthFix" />
  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="widthFix" />
  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/5.png" mode="widthFix" />
  124. <view class="title">我的地址</view>
  125. </view>
  126. <view class="boxs" @click="$utils.navigateTo('/pages_order/order/giftList')">
  127. <image src="@/static/image/center/6.png" mode="widthFix" />
  128. <view class="title">礼包列表</view>
  129. </view>
  130. <view class="boxs" @click="logout">
  131. <image src="@/static/image/center/6.png" mode="widthFix" />
  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. }
  187. },
  188. onShow() {
  189. this.$store.commit('getUserInfo')
  190. this.$store.commit('getRiceInfo')
  191. this.getMemberCardData();
  192. },
  193. methods: {
  194. clickNo() {
  195. uni.showModal({
  196. title: '暂未开放',
  197. })
  198. },
  199. logout(){
  200. uni.showModal({
  201. title: '确认退出登录吗',
  202. success : (r) => {
  203. if (r.confirm) {
  204. this.$store.commit('logout', true)
  205. }
  206. }
  207. })
  208. },
  209. //关闭广告
  210. closeAdvertising() {
  211. this.showAdvertising = false;
  212. },
  213. //获取会员卡片数据
  214. getMemberCardData() {
  215. this.$api('getRiceVipList', res => {
  216. if (res.code == 200) {
  217. this.vipList = res.result
  218. }
  219. })
  220. }
  221. }
  222. }
  223. </script>
  224. <style scoped lang="scss">
  225. .page {
  226. // 头部
  227. .head {
  228. display: flex;
  229. align-items: center;
  230. padding: 60rpx 20rpx 120rpx 20rpx;
  231. background: $uni-color;
  232. .headImage {
  233. width: 130rpx;
  234. height: 130rpx;
  235. background-image: url(/static/image/center/head-img.png);
  236. background-repeat: no-repeat;
  237. background-position: 50%, 50%;
  238. background-size: 100%;
  239. overflow: hidden;
  240. border-radius: 50%;
  241. margin-right: 20rpx;
  242. image {
  243. width: 100%;
  244. height: 100%;
  245. }
  246. }
  247. .user-info {
  248. width: calc(100% - 130rpx);
  249. .user-base-info {
  250. display: flex;
  251. flex-wrap: wrap;
  252. justify-content: space-between;
  253. .user-base-top {
  254. width: 65%;
  255. display: flex;
  256. align-items: center;
  257. flex-wrap: wrap;
  258. color: white;
  259. .user-name {
  260. max-width: calc(100% - 240rpx);
  261. white-space: nowrap;
  262. text-overflow: ellipsis;
  263. overflow: hidden;
  264. font-size: 34rpx;
  265. }
  266. .member-level {
  267. margin-left: 10rpx;
  268. .level {
  269. width: 120rpx;
  270. height: 60rpx;
  271. }
  272. }
  273. .user-tag {
  274. display: flex;
  275. align-items: center;
  276. justify-content: center;
  277. background: #000;
  278. width: 100rpx;
  279. height: 40rpx;
  280. border-radius: 20rpx;
  281. font-size: 24rpx;
  282. margin-left: 10rpx;
  283. }
  284. }
  285. .edit-user {
  286. width: 35%;
  287. display: flex;
  288. align-items: center;
  289. justify-content: flex-end;
  290. .edit-icon {
  291. width: 30rpx;
  292. height: 30rpx;
  293. }
  294. .edit-btn {
  295. color: white;
  296. margin-left: 10rpx;
  297. }
  298. }
  299. }
  300. .user-phone {
  301. color: white;
  302. font-size: 24rpx;
  303. }
  304. }
  305. }
  306. // 会员卡片
  307. .earnings {
  308. padding: 0rpx 20rpx;
  309. box-sizing: border-box;
  310. margin-top: -18%;
  311. .member-item {
  312. position: relative;
  313. .member-image {
  314. width: 100%;
  315. height: 300rpx;
  316. border-radius: 20rpx;
  317. }
  318. .member-info {
  319. position: absolute;
  320. bottom: 30rpx;
  321. left: 0rpx;
  322. display: flex;
  323. align-items: center;
  324. padding: 0rpx 40rpx;
  325. box-sizing: border-box;
  326. width: 100%;
  327. .profile-photo {
  328. display: flex;
  329. justify-content: center;
  330. align-items: center;
  331. .pro-img {
  332. width: 60rpx;
  333. height: 60rpx;
  334. border-radius: 50%;
  335. }
  336. .open-status {
  337. color: #F8A95F;
  338. border: 1px solid #F8A95F;
  339. border-radius: 30rpx;
  340. padding: 7rpx 20rpx;
  341. margin-left: 10rpx;
  342. }
  343. }
  344. .open {
  345. font-size: 26rpx;
  346. margin-left: 20rpx;
  347. }
  348. }
  349. }
  350. }
  351. // 佣金数据
  352. .brokerage-data {
  353. padding: 20rpx;
  354. background: white;
  355. border-radius: 20rpx;
  356. display: flex;
  357. flex-wrap: wrap;
  358. box-sizing: border-box;
  359. margin: 20rpx 20rpx 20rpx 20rpx;
  360. .brokerage,
  361. .balance {
  362. display: flex;
  363. flex-wrap: wrap;
  364. width: 50%;
  365. .brokerage-img,
  366. .balance-img {
  367. width: 50%;
  368. height: auto;
  369. }
  370. .main {
  371. display: flex;
  372. flex-direction: column;
  373. justify-content: space-around;
  374. width: 50%;
  375. box-sizing: border-box;
  376. padding: 30rpx 0rpx;
  377. .title {
  378. font-size: 34rpx;
  379. }
  380. .money {
  381. font-size: 40rpx;
  382. color: $uni-color;
  383. font-weight: bold;
  384. }
  385. }
  386. }
  387. }
  388. .brokerage-data-mt {
  389. margin-top: 50rpx;
  390. }
  391. // 我的服务
  392. .myServer {
  393. margin: 0rpx 20rpx 20rpx 20rpx;
  394. background: white;
  395. border-radius: 20rpx;
  396. padding: 20rpx;
  397. box-sizing: border-box;
  398. .server-title {
  399. margin-bottom: 20rpx;
  400. font-size: 34rpx;
  401. }
  402. .box {
  403. display: flex;
  404. width: 100%;
  405. margin-bottom: 20rpx;
  406. .boxs {
  407. width: 25%;
  408. display: flex;
  409. flex-direction: column;
  410. justify-content: center;
  411. align-items: center;
  412. image {
  413. width: 60rpx;
  414. height: 60rpx;
  415. display: block;
  416. margin: 0rpx auto 10rpx auto;
  417. }
  418. }
  419. &:last-child {
  420. margin-bottom: 0rpx;
  421. }
  422. }
  423. }
  424. // 广告
  425. .ad {
  426. margin: 0rpx 20rpx;
  427. .swiper {
  428. .swiper-main {
  429. position: relative;
  430. .close {
  431. position: absolute;
  432. top: 20rpx;
  433. right: 20rpx;
  434. .close-img {
  435. width: 40rpx;
  436. height: 40rpx;
  437. }
  438. }
  439. .swiper-main-img {
  440. width: 100%;
  441. height: 200rpx;
  442. border-radius: 20rpx;
  443. }
  444. .ad-tag {
  445. position: absolute;
  446. left: 20rpx;
  447. bottom: 20rpx;
  448. .ad-tag-img {
  449. width: 120rpx;
  450. height: auto;
  451. }
  452. }
  453. }
  454. }
  455. }
  456. }
  457. </style>