敢为人鲜小程序前端代码仓库
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.

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