123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <template>
- <view class="">
- <!-- 头部 -->
- <headContent>
- <template #left>
- <reverse-back />
- </template>
- <template #content>
- <view class="haed-title">
- 选择币种
- </view>
- </template>
- <template #right>
- <view @click.stop="lookRecord()" class="head-record iconfont"></view>
- </template>
- </headContent>
- <view class="currency-box">
- <block v-for="(item , index) in currencyList" :key="`currency_${index}`">
- <view class="currency-item" @click.stop="topUp(item)">
- <image class="currency-icon" :src="item.logo" mode="aspectFit"></image>
- <text class="currency-name">{{ item.name }}</text>
- </view>
- </block>
- </view>
- </view>
- </template>
- <script>
- import reverseBack from "@/components/headModules/reverse-back.vue"
- import { Api_getQuotationNew , Api_getBiTypeList , Api_getFlashRecord , Api_getSubmit} from "@/api/index.js"
- export default {
- name: 'selectCurrency',
- components: {
- reverseBack
- },
- data() {
- return {
- currencyList: [
- // {
- // icon: require('@/static/images/bi/bi_01.png'),
- // name: 'BTC'
- // },
- // {
- // icon: require('@/static/images/bi/bi_02.png'),
- // name: 'BTC'
- // },
- // {
- // icon: require('@/static/images/bi/bi_03.png'),
- // name: 'BTC'
- // },
- // {
- // icon: require('@/static/images/bi/bi_03.png'),
- // name: 'BTC'
- // }
- ]
- };
- },
- onLoad() {
- this.getBiTypeList();
- },
-
- methods:{
- getBiTypeList(){
- uni.showLoading()
- Api_getQuotationNew().then(res => {
- console.log('Api_getBiTypeList = ' , res)
- this.currencyList = res || []
- }).catch(err => {
- console.log('Api_getBiTypeList = ' , err)
- }).finally(() => {
- uni.hideLoading()
- })
- },
- // pages/content/top-up
- topUp(item){
-
-
-
- const time = new Date().getTime();
- let key = {};
- key[`bi_${time}`] = item
- this.$setStorageSync('select' , key)
-
- let path = `/pages/content/top-up?key=${`bi_${time}`}`
-
- const pages = getCurrentPages()
- if(pages.length > 2 && pages[pages.length - 2].route === 'pages/content/top-up' ){
- console.log('pages 11 = ' , pages , pages[pages.length - 2].route)
-
- uni.redirectTo({
- url:path
- })
- }else{
- console.log('222')
- uni.navigateTo({
- url: path
- });
- }
- // uni.navigateTo({
- // url: path
- // });
- },
- // 查看充值记录
- lookRecord(){
- uni.navigateTo({
- url:'/pages/content/charge-record'
- })
- }
-
- }
- }
- </script>
- <style>
- page {
- background-color: #f5f5f5;
- }
- </style>
- <style lang="scss" scoped>
- .head-record{
- font-size: 60rpx;
- }
- .currency-box {
- width: 100%;
- padding: 40rpx $pages-padding 0;
- .currency-item{
- width: 100%;
- display: flex;
- align-items: center;
- padding: 30rpx 0;
- .currency-icon{
- width: 46rpx;
- height: 46rpx;
- flex-shrink: 0;
- }
- .currency-name{
- font-size: 28rpx;
- padding-left: 7px;
- font-weight: 700;
- }
- }
- // <view class="currency-box">
- // <block v-for="(item , index) in currencyList" :key="`currency_${index}`">
- // <view class="currency-item">
- // <image class="currency-icon" :src="item.icon" mode="aspectFit"></image>
- // <text class="currency-name">{{ item.name }}</text>
- // </view>
- // </block>
- // </view>
- }
- </style>
|