index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <v-page class="pledgeRonqi">
  3. <v-header class="" :border="false" :title="$t('pledge.e4')"
  4. :leftClick="()=>_router.replace('/pages/pledge/introduce')">
  5. <template #right>
  6. <v-link :to="{path:'/pages/pledge/order'}">
  7. <van-icon class="fn-20 pld-mt" name="orders-o" />
  8. </v-link>
  9. </template>
  10. </v-header>
  11. <view class="pledgeMain">
  12. <swiper class="lunbo" :autoplay="true" indicator-color="white">
  13. <swiper-item class="my_swipe_item" v-for="(item, idx) in pledge" :key="idx">
  14. <img width="100%" height="100%" fit="cover" :src="item.spread_img" />
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. <view class="pledgeList" v-for="(item, idx) in pledge" :key="idx">
  19. <!-- <view class="listLeft">
  20. <img class="listImg" :src="item.cover" />
  21. </view> -->
  22. <view class="listRigth" style="width: 100%;">
  23. <view class="pledgeFirstTitle pledgeListTitle" style="width: 100%;">{{item.name}}</view>
  24. <view class="pledgeListTitle d-flex justify-between align-center">
  25. <view style="flex:1">
  26. <text>{{ $t("pledge.biz") }}:</text>
  27. <text class="fgrey">{{item.coin_name}}</text>
  28. </view>
  29. </view>
  30. <view class="pledgeListTitle d-flex justify-between align-center">
  31. <view class="d-flex align-center" style="flex:1">
  32. <text>{{ $t("pledge.rate") }}:</text>
  33. <text class="fgreen">{{item.min_rate}}%~{{item.max_rate}}%</text>
  34. </view>
  35. </view>
  36. <view class="pledgeListTitle d-flex justify-between align-center">
  37. <view>
  38. <!-- <text>{{ $t("option.b3") }}:</text> -->
  39. <text>{{$t('pledge.e5')}}:</text>
  40. <text class="fgreen">{{item.min_amount}}~{{item.max_amount}}</text>
  41. </view>
  42. </view>
  43. <view class="pledgeListTitle d-flex justify-between align-center">
  44. <view class="d-flex align-center" style="flex:1">
  45. <text>{{ $t("pledge.cycle") }}:</text>
  46. <text class="fgrey">{{item.cycle}} {{$t('exchange.f0')}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="d-flex justify-end">
  51. <!-- <button v-if="item.can_buy == true" @click="dump(item.id)" class='join'>{{ $t("pledge.join")}}</button> -->
  52. <button @click="dump(item.id)"
  53. class='join'>{{ $t("pledge.join")}}</button>
  54. </view>
  55. </view>
  56. <!-- <view class="pledgeList_main" v-for="(item, idx) in pledge"
  57. :key="idx"
  58. >
  59. <view class="listLeft_logo">
  60. <img class="listImg" :src="item.cover" />
  61. </view>
  62. <view class="listRigth">
  63. <view class="pledgeFirstTitle pledgeListTitle">{{item.name}}</view>
  64. <view class="pledgeListTitle">
  65. <text>{{ $t("pledge.biz") }}:</text>
  66. <text class="fgrey">{{item.coin_name}}</text>
  67. </view>
  68. <view class="pledgeListTitle">
  69. <text>{{ $t("pledge.cycle") }}:</text>
  70. <text class="fgrey">{{item.cycle}}{{$t('exchange.f0')}}</text>
  71. </view>
  72. <view class="pledgeListTitle">
  73. <text>{{ $t("pledge.rate") }} ≈ </text>
  74. <text class="fgreen">{{item.rate}}%</text>
  75. </view>
  76. <view class="pledgeListTitle">
  77. <text>{{ $t("option.b3") }}:</text>
  78. <text class="fgreen">{{item.can_buy_num}}</text>
  79. </view>
  80. <button v-if="item.can_buy == true" @click="dump(item.id)" class='join'>{{ $t("pledge.join")}}</button>
  81. <button v-if="item.can_buy == false" class='unjoin'>{{ $t("pledge.join")}}</button>
  82. </view>
  83. </view> -->
  84. </v-page>
  85. </template>
  86. <script>
  87. import Pledge from "@/api/pledge";
  88. export default {
  89. name: "pledge",
  90. data() {
  91. return {
  92. pledge: {},
  93. };
  94. },
  95. methods: {
  96. indexData() {
  97. let data = {};
  98. let ajax = Pledge.indexList(data, {
  99. loading: true
  100. });
  101. console.log(ajax);
  102. ajax
  103. .then((res) => {
  104. this.pledge = res.data;
  105. })
  106. .catch(() => {});
  107. },
  108. dump(id) {
  109. // this.$router.push({
  110. // path: '/pages/pledge/detail?id=' + id
  111. // })
  112. uni.navigateTo({
  113. url:'/pages/pledge/detail?id=' + id
  114. })
  115. },
  116. jumpBack() {
  117. // this.$router.push({
  118. // path: '/pages/base/index'
  119. // });
  120. uni.navigateTo({
  121. url:'/pages/base/index',
  122. fail() {
  123. uni.switchTab({
  124. url:'/pages/base/index'
  125. })
  126. }
  127. })
  128. },
  129. unjoin(invit_num) {
  130. // this.$dialog
  131. // .confirm({
  132. // title: this.$t("common.tips"),
  133. // message: `${this.$t("pledge.a9")}${
  134. // invit_num
  135. // }${this.$t("pledge.b1")}${this.$t("pledge.b2")}`,
  136. // cancelButtonText: this.$t('pledge.b4'),
  137. // confirmButtonText: this.$t('pledge.b3')
  138. // })
  139. // .then(() => {
  140. // this.$router.push({
  141. // path: '/pages/invite/index'
  142. // });
  143. // })
  144. // .catch(() => {});
  145. // this.$toast(this.$t("pledge.a7"));
  146. // return;
  147. uni.navigateTo({
  148. url:'/pages/invite/index',
  149. fail() {
  150. uni.switchTab({
  151. url:'/pages/invite/index'
  152. })
  153. }
  154. })
  155. }
  156. },
  157. mounted() {
  158. this.indexData();
  159. },
  160. onLoad() {
  161. this.indexData();
  162. },
  163. destroyed() {},
  164. };
  165. </script>
  166. <style lang="scss" scoped>
  167. //50 185 450 11 =》696 750 54
  168. .pledgeList {
  169. margin-top: 30upx;
  170. background: var(--list);
  171. padding: 25upx;
  172. display: block;
  173. }
  174. .lunbo {
  175. margin: 30upx;
  176. }
  177. .listLeft {
  178. width: 185upx;
  179. height: 185upx;
  180. line-height: 400upx;
  181. display: inline-block;
  182. }
  183. .listRigth {
  184. width: 490upx;
  185. margin-left: 11upx;
  186. position: relative;
  187. display: inline-block;
  188. }
  189. .listImg {
  190. width: 100%;
  191. height: 100%;
  192. }
  193. .fgrey {
  194. color: #666666
  195. }
  196. .fgreen {
  197. color: #00A67F
  198. }
  199. .join {
  200. background: #FFC119;
  201. color: #333333;
  202. width: max-content;
  203. height: 60upx;
  204. line-height: 60upx;
  205. font-size: 26upx;
  206. font-weight: bold;
  207. padding: 0 20upx;
  208. margin: 0;
  209. }
  210. .pld-mt {
  211. margin-top: 30upx;
  212. }
  213. .unjoin {
  214. background: gray;
  215. color: #aaa;
  216. width: 145upx;
  217. height: 60upx;
  218. line-height: 60upx;
  219. font-size: 26upx;
  220. font-weight: bold;
  221. padding: 0;
  222. margin: 0;
  223. }
  224. .pledgeList_main {
  225. display: flex;
  226. display: -webkit-flex;
  227. flex-direction: row;
  228. justify-content: flex-start;
  229. align-items: center;
  230. margin-top: 30upx;
  231. padding: 25upx;
  232. background: var(--list);
  233. }
  234. .listLeft_logo {
  235. width: 185upx;
  236. height: 185upx;
  237. }
  238. </style>