GradeDescription.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view class="Distribution">
  3. <view class="top-view">
  4. <view class="lever-view clearfix">
  5. <view class="lever-view-left float_left">
  6. <image class="user-avator" :src="avator" mode="aspectFill"></image>
  7. <text>{{ gradeName }}</text>
  8. </view>
  9. </view>
  10. <!-- -->
  11. <!-- <scroll-view class="Grade-view" :scroll-left="scroll_left_num" scroll-x @scroll="scrollGrade">
  12. <view style="display: inline-block;width: 280rpx;"></view>
  13. <view class="Grade-li" v-for="(item, index) in grade_list" :key="index">
  14. <view class="Grade-icon ibonfont ibonhuodaofukuan"></view>
  15. <view class="Grade-text">{{ item.name }}</view>
  16. </view>
  17. <view style="display: inline-block;width: 300rpx;"></view>
  18. </scroll-view> -->
  19. <swiper class="Grade-swiper" @change="gradeChange" :indicator-dots="false" :autoplay="false">
  20. <swiper-item class="left_item"></swiper-item>
  21. <swiper-item class="left_item"></swiper-item>
  22. <swiper-item class="Grade-item" v-for="(item, index) in grade_list" :key="index">
  23. <view class="Grade-li" :class="[grade_on === index ? 'Grade-on' : '']">
  24. <view class="Grade-icon ibonfont ibonhuiyuan"></view>
  25. <view class="Grade-text">{{ item.name }}</view>
  26. </view>
  27. </swiper-item>
  28. </swiper>
  29. <view class="ibonfont ibonxiangshangjiantou top-jt-icon"></view>
  30. </view>
  31. <view class="money-ratio-view">
  32. <view class="money-ratio-tit">{{ text_set.commission || '佣金' }}比例</view>
  33. <view class="money-ratio-ul">
  34. <view class="money-ratio-li clearfix">
  35. <view class="float_left m-label">
  36. <text class="ibonfont ibonhuodaofukuan"></text>
  37. <text class="m-label-text">{{ text_set.level_one || '一级' }}{{ text_set.commission || '佣金' }}比例</text>
  38. </view>
  39. <view class="float_right m-value">{{ grade_detail.oneRate }}%</view>
  40. </view>
  41. <view class="money-ratio-li clearfix">
  42. <view class="float_left m-label">
  43. <text class="ibonfont ibonhuodaofukuan"></text>
  44. <text class="m-label-text">{{ text_set.level_two || '二级' }}{{ text_set.commission || '佣金' }}比例</text>
  45. </view>
  46. <view class="float_right m-value">{{ grade_detail.twoRate }}%</view>
  47. </view>
  48. <view class="money-ratio-li clearfix">
  49. <view class="float_left m-label">
  50. <text class="ibonfont ibonhuodaofukuan"></text>
  51. <text class="m-label-text">{{ text_set.level_three || '三级' }}{{ text_set.commission || '佣金' }}比例</text>
  52. </view>
  53. <view class="float_right m-value">{{ grade_detail.threeRate }}%</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="up-term" v-if="grade_detail.upgradeConditionInfo.length">
  58. <view class="up-term-tit">
  59. <text>升级条件</text>
  60. <text class="fu-tit">(满足以下条件可升级)</text>
  61. </view>
  62. <view class="up-term-ul">
  63. <view class="up-term-li clearfix" v-for="(item, index) in grade_detail.upgradeConditionInfo" :key="index">
  64. <view class="float_left">
  65. <text>{{ item.name }}达到</text>
  66. <text class="money-u-num">{{ item.value }}</text>
  67. <text v-if="item.name.indexOf('额') > -1">元</text>
  68. <text v-else-if="item.name.indexOf('人') > -1">人</text>
  69. <text v-else>个</text>
  70. </view>
  71. <view class="float_right">
  72. <view class="status-btn" v-if="!item.status">未完成</view>
  73. <view class="status-btn status-ac-btn" v-else>已完成</view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import { getAvator } from '@/access/common.js';
  82. export default {
  83. data() {
  84. return {
  85. avator: '',
  86. scroll_left_num: 0,
  87. text_set: {},
  88. grade_list: [],
  89. gradeName: '',
  90. grade_detail: {
  91. upgradeConditionInfo: [],
  92. oneRate: '',
  93. twoRate: '',
  94. threeRate: ''
  95. },
  96. grade_on: 0
  97. };
  98. },
  99. onLoad(options) {
  100. uni.setNavigationBarColor({
  101. frontColor: '#ffffff',
  102. backgroundColor: '#fe582e'
  103. });
  104. this.avator = getAvator();
  105. this.text_set = this.$store.state.distributionTextSet;
  106. this.getAllGrade();
  107. this.gradeName = options.gradeName;
  108. },
  109. methods: {
  110. scrollGrade(e) {
  111. const scrollLeft = e.detail.scrollLeft;
  112. // console.log(Math.round(scrollLeft / 50)* 100);
  113. // console.log(scrollLeft);
  114. // this.scroll_left_num = Math.round(scrollLeft / 50) * 100;
  115. },
  116. gradeChange(e) {
  117. console.log(e);
  118. this.grade_on = e.detail.current;
  119. this.grade_detail = this.grade_list[this.grade_on];
  120. },
  121. async getAllGrade() {
  122. this.$u.api.getAllGrade().then(({data})=>{
  123. this.grade_list = data;
  124. this.grade_detail = data[0];
  125. });
  126. }
  127. }
  128. };
  129. </script>
  130. <style lang="scss">
  131. .top-view {
  132. color: #ffffff;
  133. background-color: #fe582e;
  134. position: relative;
  135. .top-jt-icon {
  136. position: absolute;
  137. bottom: -14upx;
  138. line-height: 36upx;
  139. height: 36upx;
  140. font-size: 36upx;
  141. color: #fff;
  142. left: 50%;
  143. transform: translateX(-18upx);
  144. }
  145. .lever-view {
  146. padding: 30upx 24upx;
  147. .lever-view-left {
  148. font-size: 22upx;
  149. font-weight: bold;
  150. line-height: 38upx;
  151. height: 42upx;
  152. padding-right: 16upx;
  153. border-radius: 22upx;
  154. background-color: rgba($color: #ffffff, $alpha: 0.3);
  155. text {
  156. transform: translateY(4upx);
  157. display: inline-block;
  158. }
  159. .user-avator {
  160. margin-right: 8upx;
  161. width: 42upx;
  162. height: 42upx;
  163. border-radius: 100%;
  164. vertical-align: middle;
  165. transform: translateY(-2upx);
  166. }
  167. }
  168. }
  169. .Grade-swiper {
  170. height: 200rpx;
  171. .Grade-item {
  172. width: 150upx !important;
  173. }
  174. .left_item {
  175. width: 150upx !important;
  176. }
  177. .Grade-li {
  178. width: 150upx;
  179. text-align: center;
  180. font-size: 24upx;
  181. opacity: 0.6;
  182. .Grade-icon {
  183. width: 60upx;
  184. height: 60upx;
  185. line-height: 60upx;
  186. font-size: 40upx;
  187. margin-bottom: 30upx;
  188. display: block;
  189. border: 1upx solid #FFFFFF;
  190. border-radius: 100%;
  191. margin: 0 auto 20upx;
  192. }
  193. }
  194. .Grade-on {
  195. opacity: 1;
  196. .Grade-icon{
  197. background-color: #FFFFFF;
  198. color: #fe582e;
  199. }
  200. }
  201. }
  202. .Grade-view {
  203. padding: 50upx 0;
  204. white-space: nowrap;
  205. width: 100%;
  206. .Grade-li {
  207. display: inline-block;
  208. width: 200upx;
  209. text-align: center;
  210. font-size: 24upx;
  211. opacity: 0.6;
  212. .Grade-icon {
  213. font-size: 60upx;
  214. margin-bottom: 30upx;
  215. }
  216. }
  217. .Grade-on {
  218. opacity: 1;
  219. }
  220. }
  221. }
  222. .money-ratio-view {
  223. padding: 0 40upx;
  224. .money-ratio-tit {
  225. line-height: 100upx;
  226. font-size: 32upx;
  227. }
  228. .money-ratio-ul {
  229. border-radius: 10upx;
  230. background-color: #fbf4e2;
  231. color: #9b7953;
  232. .money-ratio-li {
  233. padding: 0 40upx;
  234. line-height: 100upx;
  235. border-bottom: 1upx solid #fff;
  236. .ibonhuodaofukuan {
  237. color: #d8a96c;
  238. margin-right: 20upx;
  239. }
  240. .m-value {
  241. font-size: 32upx;
  242. }
  243. }
  244. }
  245. }
  246. .up-term {
  247. padding: 0 40rpx;
  248. .up-term-tit {
  249. line-height: 100upx;
  250. font-size: 32upx;
  251. .fu-tit {
  252. font-size: 24upx;
  253. color: #666;
  254. font-weight: 300;
  255. }
  256. }
  257. .up-term-ul {
  258. background-color: #fff;
  259. border-radius: 10upx;
  260. box-shadow: 0 0 10upx 4upx #f5f5f5;
  261. .up-term-li {
  262. line-height: 100upx;
  263. padding: 0 24upx;
  264. border-bottom: 1px solid #f5f5f5;
  265. .money-u-num {
  266. color: #d83d1f;
  267. font-weight: 300;
  268. margin-left: 10upx;
  269. margin-right: 10upx;
  270. }
  271. .status-btn {
  272. background-color: #fef0f0;
  273. color: #fa3534;
  274. padding: 6upx 20upx;
  275. font-size: 24upx;
  276. border-radius: 32upx;
  277. line-height: 32upx;
  278. display: inline-block;
  279. }
  280. .status-ac-btn{
  281. color: #999999;
  282. background-color: #f4f4f4;
  283. }
  284. &:last-child {
  285. border-bottom: 0 none;
  286. }
  287. }
  288. }
  289. }
  290. </style>