infoDetail.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="center">
  3. <view class="box">
  4. <view class="discounts">
  5. <view class="title">援助:</view>
  6. <view class="money">
  7. <text>{{ item.money * 2 || 0}}</text>
  8. </view>
  9. </view>
  10. <view class="main-box">
  11. <view class="main-title">
  12. <view class="main-title-image"><image class="image" src="../../static/icon/title.png" mode=""></image></view>
  13. <view class="main-title-font">{{item.name}}</view>
  14. </view>
  15. <view class="main">
  16. <view class="main-item" v-for="(ls, index) in revenueList">
  17. <view class="main-image"><image :src="image[index]" mode=""></image></view>
  18. <view class="main-font">
  19. <view class="textDetail-title">{{ index < 2 ? index + 1 + '度受益' : index + 1 + '度收益(黑钻VIP义工专属)' }}</view>
  20. <view class="textDetail-content">{{ ls }}</view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- <view class="earnings-box">
  26. <image src="../../static/img/index/vip.png" mode="" class="earnings"></image>
  27. <view class="text-box">
  28. <view class="textDetail" v-for="(ls, index) in revenueList">
  29. <view class="textDetail-title">{{ index < 2 ? index + 1 + '度受益' : index + 1 + '度收益(黑钻VIP义工专属)' }}</view>
  30. <view class="textDetail-content">{{ ls }}</view>
  31. </view>
  32. </view>
  33. </view> -->
  34. <!-- <view class="zhushi">
  35. <text v-if="status == '1'">说明:当前等级援助者,升级成援助组长需要援助{{ item.v2_limit * 1 }},当前援助金额{{ item.income }}</text>
  36. <text v-if="status == '2'">说明:当前等级援助组长已是最高收益</text>
  37. </view> -->
  38. </view>
  39. <view class="baodan" @click="baodan(id)" v-if="status == '0'">我要援助</view>
  40. <view class="baodan1" @click="baodan(id)" v-if="status == '1'&&item.income*1<item.v2_limit*1 && item.v2_layer != 0" >立即升级</view>
  41. <view class="baodan" @click="baodan(id)" v-if="status == '1'&&item.income*1>=item.v2_limit*1 && item.v2_layer != 0">立即升级</view>
  42. <view class="baodan" v-if="status == '2'||(status == '1' && item.v2_layer == 0)" style="background: #020202;">已完成</view>
  43. </view>
  44. </template>
  45. <script>
  46. import { mapState, mapMutations } from 'vuex';
  47. import { activitys } from '@/api/active.js';
  48. export default {
  49. data() {
  50. return {
  51. id: '',
  52. revenueList: [],
  53. item: '',
  54. status: '',
  55. image:['../../static/icon/1.png','../../static/icon/2.png','../../static/icon/3.png','../../static/icon/4.png','../../static/icon/5.png','../../static/icon/6.png','../../static/icon/7.png']
  56. };
  57. },
  58. computed: {
  59. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  60. },
  61. onLoad(option) {
  62. this.id = option.id;
  63. this.loadData();
  64. },
  65. methods: {
  66. loadData() {
  67. const obj = this;
  68. activitys({}, this.id).then(e => {
  69. console.log(e);
  70. obj.item = e.data;
  71. if (e.data.my_join) {
  72. obj.status = e.data.my_join.status;
  73. } else {
  74. obj.status = '0';
  75. obj.isU = false;
  76. }
  77. let i = e.data.v1_layer + e.data.v2_layer
  78. if (e.data.v2_layer&&(obj.status == '0'||(obj.status == '1'&&e.data.income*1<e.data.v2_limit*1))){
  79. i = e.data.v1_layer
  80. }
  81. let money = e.data.money * 1;
  82. let money1 = e.data.money * 1;
  83. let people = 1
  84. for (let j=0;j < i; j++){
  85. people = people * 5;
  86. money = money * 1 * 5;
  87. obj.revenueList[j] = people +'人x' + money1 + '元=' + this.unit(money);
  88. }
  89. });
  90. },
  91. unit(num) {
  92. let i = 0;
  93. if (num / 10000 >= 1) {
  94. i = num / 10000 + '万元';
  95. if (num / 100000000 >= 1) {
  96. i = num / 100000000 + '亿元';
  97. }
  98. } else {
  99. i = num + '元';
  100. }
  101. return i;
  102. },
  103. baodan(id) {
  104. if ((!this.userInfo.bank_card_no && !this.userInfo.bank_of_deposit) && this.userInfo.ali == null && this.userInfo.wechat == null) {
  105. console.log(this.userInfo, '11111');
  106. uni.showModal({
  107. title: '提示',
  108. content: '您当前未填写收款信息,是否前往填写',
  109. success: function(res) {
  110. if (res.confirm) {
  111. uni.navigateTo({
  112. url: '/pages/set/userinfo'
  113. });
  114. } else if (res.cancel) {
  115. console.log('用户点击取消');
  116. }
  117. }
  118. });
  119. } else {
  120. if (this.status == '1' && this.item.income < this.item.v2_limit * 1) {
  121. this.$api.msg('当前援助金额不足以升级');
  122. return;
  123. }
  124. uni.navigateTo({
  125. url: '/pages/index/info?id=' + id
  126. });
  127. }
  128. }
  129. }
  130. };
  131. </script>
  132. <style lang="scss">
  133. .center {
  134. padding-bottom: 50rpx;
  135. }
  136. .box {
  137. .discounts {
  138. margin: 0 30rpx;
  139. position: relative;
  140. padding: 20rpx;
  141. background-color: #1f2020;
  142. border-radius: 10rpx;
  143. .title {
  144. width: 100%;
  145. text-align: left;
  146. color: #e6c3a1;
  147. }
  148. .money {
  149. margin-top: 30rpx;
  150. padding-bottom: 30rpx;
  151. font-size: 32rpx;
  152. font-family: Source Han Sans CN;
  153. font-weight: bold;
  154. color: #c63535;
  155. width: 100%;
  156. text-align: center;
  157. text {
  158. font-size: 116rpx;
  159. font-family: Source Han Sans CN;
  160. font-weight: 800;
  161. color: #c63535;
  162. line-height: 115rpx;
  163. }
  164. }
  165. }
  166. .zhushi {
  167. color: #e6c3a1;
  168. padding: 20rpx 40rpx;
  169. }
  170. }
  171. .baodan {
  172. width: 452rpx;
  173. height: 80rpx;
  174. margin: 50rpx auto 0;
  175. text-align: center;
  176. line-height: 80rpx;
  177. color: #ffffff;
  178. background: #4e2c0e;
  179. font-size: 40rpx;
  180. border-radius: 10rpx;
  181. }
  182. .baodan1 {
  183. width: 452rpx;
  184. height: 80rpx;
  185. margin: 50rpx auto 0;
  186. text-align: center;
  187. line-height: 80rpx;
  188. color: #ffffff;
  189. background: #9f9f9f;
  190. font-size: 40rpx;
  191. border-radius: 10rpx;
  192. }
  193. .main-box {
  194. margin: 80rpx 30rpx 0;
  195. position: relative;
  196. padding: 20rpx;
  197. background-color: #1f2020;
  198. border-radius: 10rpx;
  199. .main-title {
  200. width: 320rpx;
  201. height: 80rpx;
  202. margin: -60rpx auto 0;
  203. border-radius: 50rpx;
  204. position: relative;
  205. .main-title-image {
  206. position: absolute;
  207. left: 0;
  208. top: 0;
  209. width: 320rpx;
  210. height: 80rpx;
  211. .image {
  212. width: 100%;
  213. height: 100%;
  214. border-radius: 50rpx;
  215. }
  216. }
  217. .main-title-font {
  218. position: relative;
  219. z-index: 100;
  220. text-align: center;
  221. line-height: 80rpx;
  222. font-size: 46rpx;
  223. font-weight: bold;
  224. color: #54300f;
  225. }
  226. }
  227. .main {
  228. padding: 40rpx 0;
  229. .main-item {
  230. margin-top: 20rpx;
  231. width: 100%;
  232. padding: 14rpx;
  233. background: #e6c3a1;
  234. position: relative;
  235. border-radius: 20rpx;
  236. .main-image {
  237. position: absolute;
  238. top: -2rpx;
  239. left: -2rpx;
  240. width: 110rpx;
  241. height: 110rpx;
  242. image {
  243. width: 100%;
  244. height: 100%;
  245. }
  246. }
  247. .main-font {
  248. font-size: 28rpx;
  249. padding-left: 80rpx;
  250. }
  251. }
  252. }
  253. }
  254. </style>