cblist.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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" @click="navTo('/pages/user/user')">取消</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.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">不支持充币</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. console.log(e.data);
  65. this.bilist = e.data;
  66. });
  67. },
  68. navTo(url) {
  69. uni.navigateTo({
  70. url,
  71. fail() {
  72. uni.switchTab({
  73. url
  74. });
  75. }
  76. });
  77. },
  78. nav(opt) {
  79. if (opt.czstatus == 2) {
  80. return this.$api.msg('当前币种不支持充值');
  81. }
  82. uni.navigateTo({
  83. url: '/pages/transaction/cbdetail?type=' + opt.id
  84. });
  85. }
  86. }
  87. };
  88. </script>
  89. <style lang="scss">
  90. page,
  91. .content {
  92. min-height: 100%;
  93. height: auto;
  94. background: #ffffff;
  95. }
  96. .ss-box {
  97. padding: 12rpx 62rpx 10rpx 34rpx;
  98. border-bottom: 1px solid #f6f6f6;
  99. .ss-main {
  100. width: 537rpx;
  101. padding: 10rpx 0;
  102. background: #f6f6f6;
  103. border-radius: 26rpx;
  104. display: flex;
  105. justify-content: center;
  106. align-items: center;
  107. .ss-main-icon {
  108. width: 32rpx;
  109. height: 32rpx;
  110. margin-right: 20rpx;
  111. image {
  112. width: 100%;
  113. height: 100%;
  114. }
  115. }
  116. input {
  117. font-size: 20rpx;
  118. font-family: PingFang SC;
  119. font-weight: 500;
  120. color: #aaaaaa;
  121. }
  122. }
  123. .ss-font {
  124. font-size: 28rpx;
  125. font-family: PingFang SC;
  126. font-weight: 500;
  127. color: #070707;
  128. }
  129. }
  130. .title {
  131. display: inline-block;
  132. margin: 30rpx 0 0 18rpx;
  133. padding: 0 10rpx 13rpx;
  134. border-bottom: 4rpx solid #f4d03c;
  135. }
  136. .rmbz {
  137. padding: 32rpx 0;
  138. justify-content: center;
  139. .rmbz-item {
  140. width: 130rpx;
  141. height: 52rpx;
  142. border: 2rpx solid #848a8f;
  143. border-radius: 10rpx;
  144. text-align: center;
  145. line-height: 52rpx;
  146. font-size: 24rpx;
  147. font-family: PingFang SC;
  148. font-weight: 500;
  149. color: #000000;
  150. margin: 0 16rpx;
  151. }
  152. }
  153. .list {
  154. margin-top: 6rpx;
  155. padding: 0 24rpx;
  156. .list-item {
  157. padding: 42rpx 0 24rpx;
  158. .list-item-left {
  159. display: flex;
  160. align-items: center;
  161. .list-title {
  162. width: 200rpx;
  163. font-size: 28rpx;
  164. font-family: PingFang SC;
  165. font-weight: 500;
  166. color: #5d5f70;
  167. }
  168. .list-tip {
  169. font-size: 24rpx;
  170. font-family: PingFang SC;
  171. font-weight: 500;
  172. color: #5d5f70;
  173. }
  174. }
  175. .list-item-right {
  176. display: flex;
  177. align-items: center;
  178. line-height: 1;
  179. .kc {
  180. font-size: 20rpx;
  181. font-family: PingFang SC;
  182. font-weight: 500;
  183. color: #5d5f70;
  184. margin-right: 20rpx;
  185. }
  186. .back {
  187. width: 24rpx;
  188. height: 24rpx;
  189. image {
  190. width: 100%;
  191. height: 100%;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. </style>