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

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