123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <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 iconfont2"></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|| item.currency_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 {
- pageType: '',
- currencyList: []
- };
- },
- onLoad(opt) {
- this.pageType = opt?.type;
- this.getBiTypeList();
- },
- methods: {
- getBiTypeList() {
- uni.showLoading()
- Api_getQuotationNew().then(res => {
- this.currencyList = [...res];
- // this.moreCurrency
- }).catch(err => {}).finally(() => {
- uni.hideLoading();
- })
- },
- // pages/content/top-up
- topUp(item) {
- let path = ''
- switch (this.pageType) {
- case 'addAddress':
- // 添加地址
- path = 'pages/content/add-address';
- break;
- case 'address':
- // 地址列表
- path = 'pages/content/address';
- break;
- case 'recharge':
- // 充值
- path = 'pages/content/top-up';
- break;
- case 'withdraw':
- path = 'pages/content/extract-currency';
- break;
- }
- console.log('path ', this.pageType, path)
- // let path = `/pages/content/top-up?key=${`bi_${time}`}`
- // 'pages/content/top-up'
- const pages = getCurrentPages()
- if (pages.length >= 2 && pages[pages.length - 2].route === path) {
- let prevPage = pages[pages.length - 2];
- // pages
- prevPage.$vm.currencyInfo = item;
- prevPage.$vm.setBiInfo(item)
- uni.navigateBack({
- delta: 1
- });
- } else {
- const time = new Date().getTime();
- let key = {};
- key[`bi_${time}`] = item
- this.$setStorageSync('select', key)
- path = `/${path}?key=${`bi_${time}`}`
- 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>
|