user_vip.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <view>
  3. <hua-page-head :pageTitle="pageTitle" :rightMenu='rightMenu' @clickMenu='clickMenu'></hua-page-head>
  4. <view class="user-vip">
  5. <!-- <view class="header">
  6. <view class="user-vip-info flex">
  7. <u-image width="110rpx" height="110rpx" border-radius="50%" :src="userInfo.avatar"></u-image>
  8. <view class="m-l-20">
  9. <view class="user-text white xxl flex">{{userInfo.nickname}}</view>
  10. <view class="flex">
  11. <view class="user-level white xs flex row-center m-t-10">当前等级:{{userInfo.level_name || "无"}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </view> -->
  16. <view class="content m-t-50">
  17. <view class="vip-swiper-container">
  18. <swiper class="swiper" style="height: 360rpx" previous-margin="30rpx" :current="currentIndex"
  19. @change="bindchange">
  20. <swiper-item v-for="(item, index) in levelList" :key="index">
  21. <view class="vip-card-item"
  22. :style="'background-image: url(' + item.background_image + ');'">
  23. <view class="flex row-between">
  24. <view class="flex grade white sm">
  25. {{item.lock_desc}}
  26. <!-- <view v-if="item.current_level_status == 1" class="flex grade white sm">当前等级</view>
  27. <view v-else-if="item.current_level_status == -1" class="flex white sm ml20">未解锁</view>
  28. <view v-else-if="item.current_level_status == 0" class="flex white sm ml20">已解锁</view> -->
  29. </view>
  30. <!-- <image class="grade-icon m-r-34" :src="item.image"></image> -->
  31. </view>
  32. <view class="flex vip-name white">
  33. <image class="grade-icon" :src="item.image"></image>
  34. <view class="bold">{{item.name}}</view>
  35. <!-- <view class="sm">{{item.tips2}}</view> -->
  36. </view>
  37. <!-- <view class="flex row-center m-l-30 m-r-30" v-if="item.diff_growth_percent">
  38. <view class="vip-progress bg-white flex">
  39. <view class="vip-progress-bar" :style="'width: ' + (item.diff_growth_percent*100) + '%'"></view>
  40. </view>
  41. </view> -->
  42. <view class="new-vip-progress" style="padding: 0 30rpx">
  43. <view class="sm " style="line-height: 36rpx" v-if="item.current_level_status == 0">
  44. {{item.tips1}}
  45. </view>
  46. <router-link to="/bundle/pages/user_growth/user_growth" class="" v-else>
  47. <view class="sm " style="line-height: 36rpx">
  48. <!-- {{item.current_level_status == 0 ? '当前高于该等级' : item.current_growth_tips}} -->
  49. {{item.tips1}}
  50. </view>
  51. <view class="progress">
  52. <u-line-progress :showPercent="false" active-color="#687B8B"
  53. :percent="item.diff_growth_percent * 100" height='4'></u-line-progress>
  54. </view>
  55. <view class="">{{item.tips2}} <u-icon name="arrow-right"></u-icon></view>
  56. </router-link>
  57. </view>
  58. </view>
  59. </swiper-item>
  60. </swiper>
  61. </view>
  62. <view class="vip-grade-rule">
  63. <view class="title ">
  64. 会员福利
  65. </view>
  66. <view class="iconbar">
  67. <view class="item">
  68. <view class="icon">
  69. <text class="iconfont">&#xe646;</text>
  70. </view>
  71. <view class="tit">
  72. 会员福利
  73. </view>
  74. </view>
  75. <view class="item">
  76. <view class="icon">
  77. <text class="iconfont">&#xe644;</text>
  78. </view>
  79. <view class="tit">
  80. 奖励现金
  81. </view>
  82. </view>
  83. <view class="item">
  84. <view class="icon">
  85. <text class="iconfont">&#xe897;</text>
  86. </view>
  87. <view class="tit">
  88. 奖励券
  89. </view>
  90. </view>
  91. </view>
  92. <view class="p-t-20">
  93. <text class="rule-content column lighter">
  94. {{growthRule}}
  95. </text>
  96. </view>
  97. </view>
  98. <!-- <view class="vip-rights">
  99. <view class="title flex">
  100. <view class="line br60"></view>
  101. <view class="xl ml20 bold">会员权益</view>
  102. </view>
  103. <view class="rights-list flex">
  104. <view v-for="(item, index) in privilegeList" :key="index" class="rights-item column-center">
  105. <image class="mb10" :src="item.image"></image>
  106. <view class="sm">{{item.name}}</view>
  107. </view>
  108. </view>
  109. </view> -->
  110. </view>
  111. </view>
  112. <loading-view v-if="!userInfo.nickname"></loading-view>
  113. </view>
  114. </template>
  115. <script>
  116. import {
  117. getLevelList
  118. } from '@/api/user';
  119. export default {
  120. data() {
  121. return {
  122. userInfo: {},
  123. currentIndex: 0,
  124. levelList: [],
  125. growthRule: "",
  126. privilegeList: [],
  127. pageTitle: '会员中心',
  128. rightMenu: "邀请",
  129. };
  130. },
  131. onLoad() {
  132. this.getLevelListFun();
  133. },
  134. methods: {
  135. bindchange(e) {
  136. let {
  137. current
  138. } = e.detail;
  139. let currentLevel = this.levelList[current];
  140. this.currentIndex = current
  141. },
  142. getLevelListFun() {
  143. getLevelList().then(res => {
  144. const {
  145. code,
  146. data
  147. } = res;
  148. if (code != 1) return;
  149. const {
  150. user,
  151. level_intro,
  152. level
  153. } = data;
  154. let index = level.findIndex(item => item.current_level_status == 1);
  155. if (index == -1) index = 0;
  156. this.userInfo = user
  157. this.growthRule = level_intro
  158. this.levelList = level
  159. this.currentIndex = index
  160. });
  161. },
  162. clickMenu() {
  163. uni.navigateTo({
  164. url: '/bundle/pages/invite_fans/invite_fans'
  165. })
  166. }
  167. }
  168. };
  169. </script>
  170. <style lang="scss">
  171. page {
  172. background: #F3F4F6;
  173. background-size: 100% auto;
  174. background-repeat: no-repeat;
  175. .user-vip {
  176. // .header {
  177. // padding-top: 40rpx;
  178. // .user-vip-info {
  179. // padding-left: 30rpx;
  180. // .user-level {
  181. // border: 1px solid white;
  182. // border-radius: 100rpx;
  183. // padding: 4rpx 20rpx;
  184. // line-height: 30rpx;
  185. // }
  186. // .user-text {
  187. // line-height: 50rpx;
  188. // font-weight: bold;
  189. // }
  190. // }
  191. // }
  192. .content {
  193. .vip-card-item {
  194. height: 340rpx;
  195. width: 690rpx;
  196. position: relative;
  197. background-size: 100% 100%;
  198. border-radius: 20rpx;
  199. overflow: hidden;
  200. .grade {
  201. line-height: 36rpx;
  202. background-color: rgba(0, 0, 0, 0.5);
  203. border-radius: 0 20rpx 0 20rpx;
  204. height: 50rpx;
  205. padding: 0 28rpx;
  206. position: absolute;
  207. right: 0;
  208. top: 0;
  209. }
  210. .user-grade {
  211. line-height: 36rpx;
  212. margin-left: 30rpx;
  213. }
  214. .grade-icon {
  215. width: 160rpx;
  216. height: 145rpx;
  217. }
  218. .vip-name {
  219. padding: 10rpx 30rpx;
  220. font-size: 46rpx;
  221. text-align: center;
  222. align-items: center;
  223. margin-top: 50rpx;
  224. margin-bottom: 80rpx;
  225. display: flex;
  226. font-family: HYk1gj;
  227. color: #5D707F;
  228. image {
  229. width: 42rpx;
  230. height: 44rpx;
  231. margin-right: 12rpx;
  232. }
  233. }
  234. .new-vip-progress {
  235. color: #5D707F;
  236. font-size: 24rpx;
  237. .progress {
  238. width: 260rpx;
  239. }
  240. }
  241. .vip-progress {
  242. height: 8rpx;
  243. border-radius: 8rpx;
  244. width: 100%;
  245. overflow: hidden;
  246. .vip-progress-bar {
  247. background-color: #f8d07c;
  248. height: 100%;
  249. }
  250. }
  251. }
  252. .vip-grade-rule {
  253. margin: 24rpx 24rpx;
  254. background-color: #fff;
  255. border-radius: 20rpx;
  256. padding: 28rpx 36rpx;
  257. .title {
  258. font-size: 32rpx;
  259. color: #040404;
  260. font-weight: bold;
  261. }
  262. .iconbar {
  263. width: 100%;
  264. display: flex;
  265. justify-content: space-between;
  266. margin: 40rpx auto;
  267. padding: 0 30rpx;
  268. .item {
  269. // flex-basis: 100%;
  270. text-align: center;
  271. .icon {
  272. width: 96rpx;
  273. height: 96rpx;
  274. color: #fff;
  275. background: linear-gradient(151deg, #CBE8FB 0%, #94B6CA 100%);
  276. border-radius: 50%;
  277. line-height: 96rpx;
  278. text-align: center;
  279. margin: 0 auto 16rpx;
  280. .iconfont {
  281. font-size: 36rpx;
  282. }
  283. }
  284. .tit {
  285. color: #616161;
  286. font-size: 24rpx;
  287. }
  288. }
  289. }
  290. }
  291. .vip-rights {
  292. margin: 24rpx 40rpx;
  293. .title {
  294. padding: 28rpx 0;
  295. .line {
  296. width: 8rpx;
  297. height: 34rpx;
  298. background-color: #f79c0c;
  299. }
  300. }
  301. .rights-item {
  302. width: 25%;
  303. padding-bottom: 30rpx;
  304. image {
  305. width: 82rpx;
  306. height: 82rpx;
  307. }
  308. }
  309. }
  310. }
  311. }
  312. }
  313. </style>