cblist.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="content">
  3. <view class="ss-box flex">
  4. <view class="ss-main">
  5. <view class="ss-main-icon"><image src="../../static/img/ss.png" mode=""></image></view>
  6. <input type="text" @blur="loadData()" v-model="keyworld" :placeholder="$t('cb.ssnxydbz')" />
  7. </view>
  8. <view class="ss-font" @click="navTo('/pages/user/user')">{{ $t('cb.qx') }}</view>
  9. </view>
  10. <!-- <view class="title">热门币种</view>
  11. <view class="rmbz flex">
  12. <view class="rmbz-item" v-for="(item, index) in rmlist" @click="navTo(item)">{{ item }}</view>
  13. </view> -->
  14. <view class="title">{{ $t('cb.bzlb') }}</view>
  15. <scroll-view class="swiper-box" scroll-y="true" :style="{ height: maxheight }">
  16. <view class="list" v-for="(item, index) in bilist" @click="nav(item)">
  17. <view class="list-item flex">
  18. <view class="list-item-left">
  19. <view class="list-title">{{ item.name.toUpperCase() }}</view>
  20. <view class="list-tip">{{ item.title }}</view>
  21. </view>
  22. <view class="list-item-right">
  23. <view class="kc" v-if="item.czstatus == 2">{{ $t('cb.bzccb') }}</view>
  24. <view class="back"><image src="../../static/icon/user-back.png" mode=""></image></view>
  25. </view>
  26. </view>
  27. </view>
  28. </scroll-view>
  29. </view>
  30. </template>
  31. <script>
  32. import { czcoin } from '@/api/wallet.js';
  33. export default {
  34. data() {
  35. return {
  36. keyworld: '',
  37. rmlist: ['USDT', 'BTC', 'ETH', 'TRX'],
  38. bilist: [],
  39. maxheight: ''
  40. };
  41. },
  42. onLoad() {
  43. uni.setNavigationBarTitle({ title: this.$t('cb.cblb') });
  44. },
  45. onShow() {
  46. this.loadData();
  47. },
  48. onReachBottom() {},
  49. onReady(res) {
  50. var _this = this;
  51. uni.getSystemInfo({
  52. success: resu => {
  53. const query = uni.createSelectorQuery();
  54. query.select('.swiper-box').boundingClientRect();
  55. query.exec(function(res) {
  56. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  57. console.log('打印页面的剩余高度', _this.maxheight);
  58. });
  59. },
  60. fail: res => {}
  61. });
  62. },
  63. methods: {
  64. loadData() {
  65. czcoin({ name: this.keyworld }).then(e => {
  66. console.log(e.data);
  67. this.bilist = e.data;
  68. });
  69. },
  70. navTo(url) {
  71. uni.navigateTo({
  72. url,
  73. fail() {
  74. uni.switchTab({
  75. url
  76. });
  77. }
  78. });
  79. },
  80. nav(opt) {
  81. if (opt.czstatus == 2) {
  82. return this.$api.msg('当前币种不支持充值');
  83. }
  84. uni.navigateTo({
  85. url: '/pages/transaction/cbdetail?type=' + opt.id
  86. });
  87. }
  88. }
  89. };
  90. </script>
  91. <style lang="scss">
  92. page,
  93. .content {
  94. min-height: 100%;
  95. height: auto;
  96. background: #ffffff;
  97. }
  98. .ss-box {
  99. padding: 12rpx 62rpx 10rpx 34rpx;
  100. border-bottom: 1px solid #f6f6f6;
  101. .ss-main {
  102. width: 537rpx;
  103. padding: 10rpx 0;
  104. background: #f6f6f6;
  105. border-radius: 26rpx;
  106. display: flex;
  107. justify-content: center;
  108. align-items: center;
  109. .ss-main-icon {
  110. width: 32rpx;
  111. height: 32rpx;
  112. margin-right: 20rpx;
  113. image {
  114. width: 100%;
  115. height: 100%;
  116. }
  117. }
  118. input {
  119. font-size: 20rpx;
  120. font-family: PingFang SC;
  121. font-weight: 500;
  122. color: #aaaaaa;
  123. }
  124. }
  125. .ss-font {
  126. font-size: 28rpx;
  127. font-family: PingFang SC;
  128. font-weight: 500;
  129. color: #070707;
  130. }
  131. }
  132. .title {
  133. display: inline-block;
  134. margin: 30rpx 0 0 18rpx;
  135. padding: 0 10rpx 13rpx;
  136. border-bottom: 4rpx solid #f4d03c;
  137. }
  138. .rmbz {
  139. padding: 32rpx 0;
  140. justify-content: center;
  141. .rmbz-item {
  142. width: 130rpx;
  143. height: 52rpx;
  144. border: 2rpx solid #848a8f;
  145. border-radius: 10rpx;
  146. text-align: center;
  147. line-height: 52rpx;
  148. font-size: 24rpx;
  149. font-family: PingFang SC;
  150. font-weight: 500;
  151. color: #000000;
  152. margin: 0 16rpx;
  153. }
  154. }
  155. .list {
  156. margin-top: 6rpx;
  157. padding: 0 24rpx;
  158. .list-item {
  159. padding: 42rpx 0 24rpx;
  160. .list-item-left {
  161. display: flex;
  162. align-items: center;
  163. .list-title {
  164. width: 200rpx;
  165. font-size: 28rpx;
  166. font-family: PingFang SC;
  167. font-weight: 500;
  168. color: #5d5f70;
  169. }
  170. .list-tip {
  171. font-size: 24rpx;
  172. font-family: PingFang SC;
  173. font-weight: 500;
  174. color: #5d5f70;
  175. }
  176. }
  177. .list-item-right {
  178. display: flex;
  179. align-items: center;
  180. line-height: 1;
  181. .kc {
  182. font-size: 20rpx;
  183. font-family: PingFang SC;
  184. font-weight: 500;
  185. color: #5d5f70;
  186. margin-right: 20rpx;
  187. }
  188. .back {
  189. width: 24rpx;
  190. height: 24rpx;
  191. image {
  192. width: 100%;
  193. height: 100%;
  194. }
  195. }
  196. }
  197. }
  198. }
  199. </style>