vip.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. <template>
  2. <view class='member-center'>
  3. <view class='header'>
  4. <swiper class="swiper" :current="swiperIndex" previous-margin="55rpx" next-margin="55rpx"
  5. @change="swiperChange" :indicator-dots="true">
  6. <block v-for="(item, index) in distributionLevel" :key="index">
  7. <swiper-item>
  8. <view class="swiper-item" v-if="item.image" :class="{on: swiperIndex == index}"
  9. :style="{'background-image': 'url('+item.image+')'}">
  10. <view class="acea-row row-middle user-wrap">
  11. <image class="image" :src="item.icon"></image>
  12. <view class="user-msg">
  13. <view class="text">
  14. <view class="name">{{item.name}}</view>
  15. <view class="level">
  16. {{item.explain }}
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="swiper-item" v-else :class="{on: swiperIndex == index}"
  23. style="background: #333333;">
  24. <view class="acea-row row-middle user-wrap">
  25. <image class="image" :src="item.icon"></image>
  26. <view class="user-msg">
  27. <view class="text">
  28. <view class="name">{{item.name}}</view>
  29. <view class="level">
  30. {{item.explain }}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </swiper-item>
  37. </block>
  38. </swiper>
  39. </view>
  40. <view class="info" v-if="task.length != 0">
  41. <view class="info-title">
  42. 任务说明:
  43. </view>
  44. <view class="info-main">
  45. <view class="info-item flex" v-for="(item,index) in task">
  46. <view class="info-name">
  47. {{item.name}}
  48. </view>
  49. <view class="info-success" v-if="item.finish == 1">
  50. 已完成
  51. </view>
  52. <view class="info-success" v-if="item.finish != 1">
  53. {{item.task_type_title}}
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. agentLevelList,
  63. agentLevelTaskList
  64. } from '@/api/user.js';
  65. import {
  66. toLogin
  67. } from '@/libs/login.js';
  68. import {
  69. mapGetters
  70. } from "vuex";
  71. export default {
  72. data() {
  73. return {
  74. distributionLevel: [],
  75. swiperIndex: 0,
  76. task: [], //任务列表
  77. level_id: 0, //任务id,
  78. grade: 0,
  79. };
  80. },
  81. watch: {
  82. distributionLevel: function() {
  83. let that = this;
  84. if (that.distributionLevel.length > 0) {
  85. that.distributionLevel.forEach(function(item, index) {
  86. if (item.is_clear === false) {
  87. // that.swiper.slideTo(index);
  88. that.activeIndex = index;
  89. that.grade = item.grade;
  90. }
  91. });
  92. }
  93. },
  94. },
  95. onLoad() {
  96. this.agentLevelList();
  97. },
  98. methods: {
  99. agentLevelList: function() {
  100. agentLevelList().then(({
  101. data
  102. }) => {
  103. this.distributionLevel = data.list;
  104. this.level_id = this.distributionLevel[this.swiperIndex].id
  105. this.getTask();
  106. });
  107. },
  108. /**
  109. * 会员切换
  110. *
  111. */
  112. swiperChange(e) {
  113. let index = e.detail.current;
  114. this.swiperIndex = index;
  115. this.level_id = this.distributionLevel[index].id || 0;
  116. this.getTask();
  117. },
  118. /**
  119. * 获取任务要求
  120. */
  121. getTask: function() {
  122. let that = this;
  123. that.taskNum = 0
  124. agentLevelTaskList({}, this.level_id).then(res => {
  125. that.task = res.data.task
  126. });
  127. }
  128. },
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. page {
  133. background: #f5f5f5;
  134. }
  135. .swiper {
  136. width: 700rpx;
  137. margin: 0 auto;
  138. height: 285rpx;
  139. .swiper-item {
  140. height: 100%;
  141. border-radius: 6rpx;
  142. background-color: #333333;
  143. background: center/100% 100% no-repeat;
  144. transform: scale(0.9);
  145. transition: all 0.2s ease-in 0s;
  146. line-height: 1.1;
  147. &.on {
  148. transform: none;
  149. }
  150. }
  151. .user-wrap {
  152. padding-top: 20rpx;
  153. padding-left: 22rpx;
  154. line-height: 1.1;
  155. .image {
  156. width: 90rpx;
  157. height: 90rpx;
  158. border-radius: 50%;
  159. }
  160. .user-msg {
  161. margin-left: 14rpx;
  162. .text {
  163. flex: 1;
  164. display: flex;
  165. align-items: center;
  166. min-width: 0;
  167. font-size: 22rpx;
  168. color: #666666;
  169. .num {
  170. margin-right: 10rpx;
  171. margin-left: 10rpx;
  172. font-size: 30rpx;
  173. font-style: italic;
  174. }
  175. }
  176. }
  177. .name {
  178. flex: 1;
  179. overflow: hidden;
  180. white-space: nowrap;
  181. text-overflow: ellipsis;
  182. font-weight: bold;
  183. font-size: 28rpx;
  184. color: #fff;
  185. margin-right: 8rpx;
  186. }
  187. .state {
  188. position: absolute;
  189. top: 0rpx;
  190. right: 0;
  191. width: 70rpx;
  192. height: 70rpx;
  193. .lock {
  194. width: 100%;
  195. height: 100%;
  196. }
  197. }
  198. }
  199. .grow-wrap {
  200. padding-left: 34rpx;
  201. margin-top: 70rpx;
  202. font-size: 20rpx;
  203. color: #474747;
  204. display: flex;
  205. .num {
  206. margin-right: 8rpx;
  207. margin-left: 8rpx;
  208. font-size: 26rpx;
  209. }
  210. }
  211. .level {
  212. font-size: 24rpx;
  213. color: #fff;
  214. border-radius: 4rpx;
  215. border: 1px solid #fff;
  216. padding: 3rpx 8rpx;
  217. }
  218. }
  219. .member-center .header {
  220. // height: 470rpx;
  221. padding-top: 37rpx;
  222. }
  223. .member-center .header swiper {
  224. position: relative;
  225. // height: 330rpx;
  226. }
  227. .member-center .growthValue {
  228. background-color: #fff;
  229. border-radius: 16rpx;
  230. position: fixed;
  231. top: 266rpx;
  232. left: 50%;
  233. width: 560rpx;
  234. min-height: 440rpx;
  235. margin-left: -280rpx;
  236. z-index: 99;
  237. transform: translate3d(0, -200%, 0);
  238. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  239. }
  240. .member-center .growthValue.on {
  241. transform: translate3d(0, 0, 0);
  242. }
  243. .member-center .growthValue .pictrue {
  244. width: 100%;
  245. height: 257rpx;
  246. position: relative;
  247. }
  248. .member-center .growthValue .pictrue image {
  249. width: 100%;
  250. height: 100%;
  251. border-radius: 16rpx 16rpx 0 0;
  252. }
  253. .member-center .growthValue .conter {
  254. padding: 0 35rpx;
  255. font-size: 30rpx;
  256. color: #333;
  257. margin-top: 58rpx;
  258. line-height: 1.5;
  259. height: 350rpx;
  260. overflow: auto;
  261. }
  262. .member-center .growthValue .iconfont {
  263. position: absolute;
  264. font-size: 65rpx;
  265. color: #fff;
  266. bottom: -90rpx;
  267. left: 50%;
  268. transform: translateX(-50%);
  269. }
  270. .swiper .level-sty {
  271. opacity: 0.7;
  272. }
  273. .info {
  274. margin-top: 40rpx;
  275. padding: 0 20rpx;
  276. .info-title {
  277. font-size: 34rpx;
  278. }
  279. .info-main {
  280. margin-top: 40rpx;
  281. .info-item {
  282. width: 100%;
  283. padding: 10px 25rpx;
  284. border-radius: 10rpx;
  285. margin-top: 20rpx;
  286. background-color: #ffffff;
  287. box-shadow: 0 5rpx 10rpx 0 #F8F8F8;
  288. .info-name {
  289. font-size: 28rpx;
  290. }
  291. .info-success {
  292. font-size: 24rpx;
  293. color: red;
  294. }
  295. }
  296. }
  297. }
  298. </style>