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

505 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
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="$refs.customerServicePopup.open()">
  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="$store.commit('logout')">
  127. <image src="@/static/image/center/6.png" mode="widthFix" />
  128. <view class="title">退出登录</view>
  129. </view>
  130. </view>
  131. </view>
  132. <!-- 广告 -->
  133. <div v-if="showAdvertising" class="ad">
  134. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="true" :interval="2000"
  135. :duration="duration">
  136. <swiper-item v-for="(item, index) in adList" :key="index">
  137. <view class="swiper-main">
  138. <view @click="closeAdvertising" class="close">
  139. <image src="@/static/image/center/close.png" mode="aspectFill" class="close-img"></image>
  140. </view>
  141. <image :src="item" mode="aspectFill" class="swiper-main-img"></image>
  142. <div class="ad-tag">
  143. <image src="@/static/image/center/ad-tag.png" mode="aspectFill" class="ad-tag-img"></image>
  144. </div>
  145. </view>
  146. </swiper-item>
  147. </swiper>
  148. </div>
  149. <customerServicePopup ref="customerServicePopup" />
  150. <tabber select="center" />
  151. </view>
  152. </template>
  153. <script>
  154. import tabber from '@/components/base/tabbar.vue'
  155. import {
  156. mapState
  157. } from 'vuex'
  158. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  159. export default {
  160. components: {
  161. tabber,
  162. customerServicePopup,
  163. },
  164. computed: {
  165. ...mapState(['riceInfo']),
  166. adList() {
  167. let arr = [];
  168. if (this.configList?.shop_get_image) {
  169. arr = this.configList?.shop_get_image?.split(',')
  170. }
  171. return arr
  172. }
  173. },
  174. data() {
  175. return {
  176. vipType: ['普通会员', '黄金会员', '渠道商'],
  177. vipImage: ['vip_vip', 'vip_user', 'vip_shop'],
  178. vipList: [],
  179. showAdvertising: true,
  180. userRole: ['会员', '用户', '渠道']
  181. }
  182. },
  183. onShow() {
  184. this.$store.commit('getUserInfo')
  185. this.$store.commit('getRiceInfo')
  186. this.getMemberCardData();
  187. },
  188. methods: {
  189. clickNo() {
  190. uni.showModal({
  191. title: '暂未开放',
  192. })
  193. },
  194. //关闭广告
  195. closeAdvertising() {
  196. this.showAdvertising = false;
  197. },
  198. //获取会员卡片数据
  199. getMemberCardData() {
  200. this.$api('getRiceVipList', res => {
  201. if (res.code == 200) {
  202. this.vipList = res.result
  203. }
  204. })
  205. }
  206. }
  207. }
  208. </script>
  209. <style scoped lang="scss">
  210. .page {
  211. // 头部
  212. .head {
  213. display: flex;
  214. align-items: center;
  215. padding: 60rpx 20rpx 120rpx 20rpx;
  216. background: $uni-color;
  217. .headImage {
  218. width: 130rpx;
  219. height: 130rpx;
  220. background-image: url(/static/image/center/head-img.png);
  221. background-repeat: no-repeat;
  222. background-position: 50%, 50%;
  223. background-size: 100%;
  224. overflow: hidden;
  225. border-radius: 50%;
  226. margin-right: 20rpx;
  227. image {
  228. width: 100%;
  229. height: 100%;
  230. }
  231. }
  232. .user-info {
  233. width: calc(100% - 130rpx);
  234. .user-base-info {
  235. display: flex;
  236. flex-wrap: wrap;
  237. justify-content: space-between;
  238. .user-base-top {
  239. width: 65%;
  240. display: flex;
  241. align-items: center;
  242. flex-wrap: wrap;
  243. color: white;
  244. .user-name {
  245. max-width: calc(100% - 240rpx);
  246. white-space: nowrap;
  247. text-overflow: ellipsis;
  248. overflow: hidden;
  249. font-size: 34rpx;
  250. }
  251. .member-level {
  252. margin-left: 10rpx;
  253. .level {
  254. width: 120rpx;
  255. height: 60rpx;
  256. }
  257. }
  258. .user-tag {
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. background: #000;
  263. width: 100rpx;
  264. height: 40rpx;
  265. border-radius: 20rpx;
  266. font-size: 24rpx;
  267. margin-left: 10rpx;
  268. }
  269. }
  270. .edit-user {
  271. width: 35%;
  272. display: flex;
  273. align-items: center;
  274. justify-content: flex-end;
  275. .edit-icon {
  276. width: 30rpx;
  277. height: 30rpx;
  278. }
  279. .edit-btn {
  280. color: white;
  281. margin-left: 10rpx;
  282. }
  283. }
  284. }
  285. .user-phone {
  286. color: white;
  287. font-size: 24rpx;
  288. }
  289. }
  290. }
  291. // 会员卡片
  292. .earnings {
  293. padding: 0rpx 20rpx;
  294. box-sizing: border-box;
  295. margin-top: -18%;
  296. .member-item {
  297. position: relative;
  298. .member-image {
  299. width: 100%;
  300. height: 300rpx;
  301. border-radius: 20rpx;
  302. }
  303. .member-info {
  304. position: absolute;
  305. bottom: 30rpx;
  306. left: 0rpx;
  307. display: flex;
  308. align-items: center;
  309. padding: 0rpx 40rpx;
  310. box-sizing: border-box;
  311. width: 100%;
  312. .profile-photo {
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. .pro-img {
  317. width: 60rpx;
  318. height: 60rpx;
  319. border-radius: 50%;
  320. }
  321. .open-status {
  322. color: #F8A95F;
  323. border: 1px solid #F8A95F;
  324. border-radius: 30rpx;
  325. padding: 7rpx 20rpx;
  326. margin-left: 10rpx;
  327. }
  328. }
  329. .open {
  330. font-size: 26rpx;
  331. margin-left: 20rpx;
  332. }
  333. }
  334. }
  335. }
  336. // 佣金数据
  337. .brokerage-data {
  338. padding: 20rpx;
  339. background: white;
  340. border-radius: 20rpx;
  341. display: flex;
  342. flex-wrap: wrap;
  343. box-sizing: border-box;
  344. margin: 20rpx 20rpx 20rpx 20rpx;
  345. .brokerage,
  346. .balance {
  347. display: flex;
  348. flex-wrap: wrap;
  349. width: 50%;
  350. .brokerage-img,
  351. .balance-img {
  352. width: 50%;
  353. height: auto;
  354. }
  355. .main {
  356. display: flex;
  357. flex-direction: column;
  358. justify-content: space-around;
  359. width: 50%;
  360. box-sizing: border-box;
  361. padding: 30rpx 0rpx;
  362. .title {
  363. font-size: 34rpx;
  364. }
  365. .money {
  366. font-size: 40rpx;
  367. color: #DC2828;
  368. font-weight: bold;
  369. }
  370. }
  371. }
  372. }
  373. .brokerage-data-mt {
  374. margin-top: 50rpx;
  375. }
  376. // 我的服务
  377. .myServer {
  378. margin: 0rpx 20rpx 20rpx 20rpx;
  379. background: white;
  380. border-radius: 20rpx;
  381. padding: 20rpx;
  382. box-sizing: border-box;
  383. .server-title {
  384. margin-bottom: 20rpx;
  385. font-size: 34rpx;
  386. }
  387. .box {
  388. display: flex;
  389. width: 100%;
  390. margin-bottom: 20rpx;
  391. .boxs {
  392. width: 25%;
  393. display: flex;
  394. flex-direction: column;
  395. justify-content: center;
  396. align-items: center;
  397. image {
  398. width: 60rpx;
  399. height: 60rpx;
  400. display: block;
  401. margin: 0rpx auto 10rpx auto;
  402. }
  403. }
  404. &:last-child {
  405. margin-bottom: 0rpx;
  406. }
  407. }
  408. }
  409. // 广告
  410. .ad {
  411. margin: 0rpx 20rpx;
  412. .swiper {
  413. .swiper-main {
  414. position: relative;
  415. .close {
  416. position: absolute;
  417. top: 20rpx;
  418. right: 20rpx;
  419. .close-img {
  420. width: 40rpx;
  421. height: 40rpx;
  422. }
  423. }
  424. .swiper-main-img {
  425. width: 100%;
  426. height: 200rpx;
  427. border-radius: 20rpx;
  428. }
  429. .ad-tag {
  430. position: absolute;
  431. left: 20rpx;
  432. bottom: 20rpx;
  433. .ad-tag-img {
  434. width: 120rpx;
  435. height: auto;
  436. }
  437. }
  438. }
  439. }
  440. }
  441. }
  442. </style>