select-coin.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <uni-popup ref="popupRef" type="bottom">
  3. <view class="popup-box">
  4. <view class="title-box">
  5. <text class="title-name">选择币种</text>
  6. <image class="title-close" src="../../../static/logo.png" mode="aspectFit"></image>
  7. </view>
  8. <view class="content-box">
  9. <view class="search-box">
  10. <input class="search-input" placeholder-class="search-input-placeholder" placeholder="搜索您要的币种" />
  11. <image class="search-icon" src="../../../static/logo.png" mode="aspectFit"></image>
  12. </view>
  13. <scroll-view scroll-y class="scroll-view-list">
  14. <view class="content-item" v-for="(item , index) in selectList" @click.stop="selectItem(item)" :key="`content_${index}`">
  15. <image class="item-icon" :src="item.logo" mode="aspectFit"></image>
  16. <text class="item-text hide_1">{{item.name}}</text>
  17. </view>
  18. </scroll-view>
  19. </view>
  20. </view>
  21. </uni-popup>
  22. </template>
  23. <script>
  24. export default {
  25. name: "exchangeSelectCoin",
  26. props: {
  27. activeVal:{
  28. type:Object,
  29. default: () => {
  30. return {}
  31. }
  32. },
  33. selectList: {
  34. type: Array,
  35. default: () => []
  36. }
  37. },
  38. data() {
  39. return {
  40. contentList: [{
  41. icon: require('../../../static/icon/icon_01.png'),
  42. name: 'BTC'
  43. }, {
  44. icon: require('../../../static/icon/icon_02.png'),
  45. name: 'FIL'
  46. }, {
  47. icon: require('../../../static/icon/icon_03.png'),
  48. name: 'ETH'
  49. }, {
  50. icon: require('../../../static/icon/icon_04.png'),
  51. name: 'SHIB'
  52. }]
  53. };
  54. },
  55. mounted() {
  56. // this.$refs.popupRef.open()
  57. },
  58. methods: {
  59. open() {
  60. this.$nextTick(() => {
  61. this.$refs.popupRef.open();
  62. })
  63. },
  64. close() {
  65. this.$refs.popupRef.close();
  66. },
  67. selectItem(item){
  68. this.$emit('update:activeVal', item);
  69. this.close();
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .popup-box {
  76. width: 100%;
  77. border-radius: 50rpx 50rpx 0px 0px;
  78. background-color: #fff;
  79. .scroll-view-list{
  80. width: 100%;
  81. height: 35vh;
  82. }
  83. .title-box {
  84. width: 100%;
  85. height: 113rpx;
  86. border-radius: 50rpx 50rpx 0px 0px;
  87. background-color: #F7F7F7 !important;
  88. display: flex;
  89. justify-content: space-between;
  90. align-items: center;
  91. padding: 0 $pages-padding;
  92. .title-name {
  93. font-size: 34rpx;
  94. font-family: PingFang SC, PingFang SC-Bold;
  95. font-weight: 700;
  96. text-align: center;
  97. color: #1a1a1a;
  98. line-height: 48rpx;
  99. }
  100. .title-close {
  101. width: 25rpx;
  102. height: 25rpx;
  103. // background-color: #666666;
  104. }
  105. }
  106. .content-box {
  107. width: 100%;
  108. padding: 0 $pages-padding 20rpx;
  109. .search-box {
  110. margin: 30rpx 0 20rpx;
  111. width: 100%;
  112. height: 60rpx;
  113. display: flex;
  114. align-items: center;
  115. background-color: #dbdce0;
  116. border-radius: 30rpx;
  117. padding: 0 30rpx;
  118. // <view class="search-box">
  119. // <input class="search-input" placeholder-class="search-input-placeholder" placeholder="请输入密码"/>
  120. // <image class="search-icon" src="../../../static/logo.png" mode="aspectFit"></image>
  121. // </view>
  122. .search-input {
  123. flex: 1;
  124. height: 100%;
  125. }
  126. .search-input,
  127. .search-input-placeholder {
  128. font-size: 24rpx;
  129. font-family: PingFang SC, PingFang SC-Regular;
  130. font-weight: 400;
  131. text-align: left;
  132. color: #333333;
  133. }
  134. .search-icon {
  135. width: 38rpx;
  136. height: 38rpx;
  137. flex-shrink: 0;
  138. }
  139. }
  140. .content-item {
  141. width: 100%;
  142. height: 66rpx;
  143. display: flex;
  144. align-items: center;
  145. .item-icon {
  146. width: 46rpx;
  147. height: 46rpx;
  148. flex-shrink: 0;
  149. }
  150. .item-text {
  151. font-size: 26rpx;
  152. font-family: PingFang SC, PingFang SC-Bold;
  153. font-weight: 700;
  154. text-align: left;
  155. color: #343434;
  156. line-height: 37rpx;
  157. padding-left: 14rpx;
  158. }
  159. }
  160. }
  161. }
  162. </style>