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

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