cblist.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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="搜索您需要的幣種" />
  7. </view>
  8. <view class="ss-font">取消</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">币种列表</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.title }}</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">不支持充币</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. onShow() {
  44. this.loadData();
  45. },
  46. onReachBottom() {},
  47. onReady(res) {
  48. var _this = this;
  49. uni.getSystemInfo({
  50. success: resu => {
  51. const query = uni.createSelectorQuery();
  52. query.select('.swiper-box').boundingClientRect();
  53. query.exec(function(res) {
  54. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  55. console.log('打印页面的剩余高度', _this.maxheight);
  56. });
  57. },
  58. fail: res => {}
  59. });
  60. },
  61. methods: {
  62. loadData() {
  63. czcoin({ name: this.keyworld }).then(e => {
  64. this.bilist = e.data;
  65. });
  66. },
  67. navTo(opt) {
  68. uni.navigateTo({
  69. url: '/pages/transaction/cbdetail?type=' + opt
  70. });
  71. },
  72. nav(opt) {
  73. if (opt.czstatus == 2) {
  74. return this.$api.msg('当前币种不支持充值');
  75. }
  76. uni.navigateTo({
  77. url: '/pages/transaction/cbdetail?type=' + opt.id
  78. });
  79. }
  80. }
  81. };
  82. </script>
  83. <style lang="scss">
  84. page,
  85. .content {
  86. min-height: 100%;
  87. height: auto;
  88. background: #ffffff;
  89. }
  90. .ss-box {
  91. padding: 12rpx 62rpx 10rpx 34rpx;
  92. border-bottom: 1px solid #f6f6f6;
  93. .ss-main {
  94. width: 537rpx;
  95. padding: 10rpx 0;
  96. background: #f6f6f6;
  97. border-radius: 26rpx;
  98. display: flex;
  99. justify-content: center;
  100. align-items: center;
  101. .ss-main-icon {
  102. width: 32rpx;
  103. height: 32rpx;
  104. image {
  105. width: 100%;
  106. height: 100%;
  107. }
  108. }
  109. input {
  110. font-size: 20rpx;
  111. font-family: PingFang SC;
  112. font-weight: 500;
  113. color: #aaaaaa;
  114. }
  115. }
  116. .ss-font {
  117. font-size: 28rpx;
  118. font-family: PingFang SC;
  119. font-weight: 500;
  120. color: #070707;
  121. }
  122. }
  123. .title {
  124. display: inline-block;
  125. margin: 30rpx 0 0 18rpx;
  126. padding: 0 10rpx 13rpx;
  127. border-bottom: 4rpx solid #f4d03c;
  128. }
  129. .rmbz {
  130. padding: 32rpx 0;
  131. justify-content: center;
  132. .rmbz-item {
  133. width: 130rpx;
  134. height: 52rpx;
  135. border: 2rpx solid #848a8f;
  136. border-radius: 10rpx;
  137. text-align: center;
  138. line-height: 52rpx;
  139. font-size: 24rpx;
  140. font-family: PingFang SC;
  141. font-weight: 500;
  142. color: #000000;
  143. margin: 0 16rpx;
  144. }
  145. }
  146. .list {
  147. margin-top: 6rpx;
  148. padding: 0 24rpx;
  149. .list-item {
  150. padding: 42rpx 0 24rpx;
  151. .list-item-left {
  152. display: flex;
  153. align-items: center;
  154. .list-title {
  155. width: 200rpx;
  156. font-size: 28rpx;
  157. font-family: PingFang SC;
  158. font-weight: 500;
  159. color: #5d5f70;
  160. }
  161. .list-tip {
  162. font-size: 24rpx;
  163. font-family: PingFang SC;
  164. font-weight: 500;
  165. color: #5d5f70;
  166. }
  167. }
  168. .list-item-right {
  169. display: flex;
  170. align-items: center;
  171. line-height: 1;
  172. .kc {
  173. font-size: 20rpx;
  174. font-family: PingFang SC;
  175. font-weight: 500;
  176. color: #5d5f70;
  177. margin-right: 20rpx;
  178. }
  179. .back {
  180. width: 24rpx;
  181. height: 24rpx;
  182. image {
  183. width: 100%;
  184. height: 100%;
  185. }
  186. }
  187. }
  188. }
  189. }
  190. </style>