123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603 |
- <template>
- <view class="container">
- <view class="list-box">
- <view class="list flex">
- <view class="flex_item list-item">
- <image :src="logo"></image>
- <view>{{ name }}</view>
- </view>
- <view class="flex_item list-tpl">
- <view class="content" @click="useOutClickSide"><selectss ref="easySelect" :options="moneyTypeList" :value="name" @selectOne="selectOne"></selectss></view>
- <image src="../../static/img/img23.png"></image>
- </view>
- </view>
- </view>
- <view class="image-box" >
-
-
- <view class="way-wrapper">
-
- {{item}}
- </view>
- <view class="qidai" >只支持TRC20通道</view>
- <tki-qrcode
- :cid="cid"
- ref="qrcode"
- :val="address"
- :size="size"
- :unit="unit"
- :background="background"
- :foreground="foreground"
- :pdground="pdground"
- :iconSize="iconSize"
- :lv="lv"
- :onval="onval"
- :loadMake="loadMake"
- :usingComponents="usingComponents"
- @result="qrR"
- />
-
- </view>
- <view class="from-box" >
- <view class="from-title">充币地址</view>
- <view class="flex input-tpl">
- <input class="input-box" disabled="disabled" type="text" v-model="address" />
- <view class="all" @click="copy(address)">复制</view>
- </view>
-
-
-
-
-
- <view class="text-box" style="text-indent:2em;">{{ mark }}</view>
- </view>
-
- <uni-popup ref="popup" type="center">
- <view class="popup">
- <view class="cancel flex" @click="close">
- <view></view>
- <view class="tip">x</view>
- </view>
- <view class="list-boxs">
- <view class="popup-text">绑定地址:</view>
- <view class="password"><input type="text" v-model="keysAddr" placeholder="请输入绑定地址" /></view>
- <view class="confirm-btn" @click="bd"><text>确认绑定</text></view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import { recharge, edit } from '@/api/finance.js';
- import { upload, money } from '@/api/finance.js';
- import selectss from '@/components/select.vue';
- import uniCopy from '@/js_sdk/xb-copy/uni-copy.js';
- import { moneyType } from '@/api/index.js';
- import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
- export default {
- components: {
- selectss,
- tkiQrcode
- },
- data() {
- return {
- moneyTypeList: [],
- charge: 0,
- logo: '',
- name: '',
- code: '',
- qr: '',
- address: '',
- image: '../../static/img/add.png',
- order_id: '',
- id: '',
- orderShow: false,
- mark: '',
- addr: '',
- ids: '',
- way: [],
- num: '',
- password: '',
- keysAddr: '',
- showBtn: false,
- idx: 1,
- isShow: false,
- cid: 'cid',
- size: 150,
- unit: '150',
- background: '#FFFFFF',
- foreground: '#000000',
- pdground: '#000000',
- icon: '',
- iconSize: 40,
- lv: 3,
- onval: true,
- loadMake: true,
- usingComponents: true,
- wayAddress: []
- };
- },
- onLoad(option) {
- if (option.name) {
-
- this.charge = option.charge;
- this.name = option.name;
- this.logo = option.logo;
- this.code = option.code;
- this.mark = option.mark;
- this.ids = option.ids;
- this.keysAddr = option.keysAddr;
- this.qr = option._address_qr;
- this.address = option.address
- this.ids = option.ids;
- this.addr = option.keysAddr;
-
- if (this.addr == null || this.addr == '') {
- this.showBtn = true;
- }
- }
- this.moneyType();
- },
- onShow() {
-
- },
- methods: {
-
- async moneyType() {
- let obj = this;
- moneyType({}).then(({ data }) => {
- console.log(data,'9999999999999999999999999S')
-
- let res = [];
- for(let i = 0; i< data.length ; i++) {
- if(data[i].charge == '1') {
- res[i]= data[i]
- }
- }
- obj.moneyTypeList = res;
-
- console.log(obj.moneyTypeList)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- for(let i = 0 ; i < obj.moneyTypeList.length ; i++){
- obj.charge = obj.moneyTypeList[i].charge;
- obj.logo = obj.moneyTypeList[i].LOGO;
- obj.name = obj.moneyTypeList[i].name;
- obj.code = obj.moneyTypeList[i].code;
- obj.money = obj.moneyTypeList[i].price;
- obj.address = obj.moneyTypeList[i].wallet['address']
- obj.mark = obj.moneyTypeList[i].mark;
- obj.addr = obj.moneyTypeList[i].wallet.address;
- if (obj.addr == null || obj.addr == '') {
- obj.showBtn = true;
- }
- obj.ids = obj.moneyTypeList[i].wallet.id;
-
- return
- }
-
- });
- },
-
- scImg() {
- let obj = this;
- upload({
- file: ''
- }).then(function(e) {
- if (e[0] == undefined || e[0] == '') {
- obj.$api.msg('图片上传失败!');
- } else {
- obj.image = e[0].url;
- obj.$api.msg('图片上传成功!');
- }
- });
- },
- close() {
- this.$refs.popup.close();
- },
- bd() {
- let obj = this;
- edit(
- {
- key: obj.keysAddr
- },
- obj.ids
- ).then(e => {
- obj.showBtn = false;
- obj.$api.msg(e.msg);
- obj.$refs.popup.close();
- });
- },
- bangidng() {
- let obj = this;
- obj.$refs.popup.open();
- },
- moneyList() {
- let obj = this;
- if (obj.image == '../../static/img/add.png') {
- obj.$api.msg('请上传凭证!');
- return;
- }
- money(
- {
- proof: obj.image
- },
- obj.id
- ).then(e => {
- obj.$api.msg(e.msg);
- setTimeout(function() {
- uni.switchTab({
- url: '/pages/finance/index'
- });
- }, 1000);
- });
- },
-
- copy(item) {
- let obj = this;
- let content = item;
- content = typeof content === 'string' ? content : content.toString();
- const result = uniCopy(content);
- if (result === false) {
- uni.showToast({
- title: '不支持'
- });
- } else {
- uni.showToast({
- title: '复制成功',
- icon: 'none'
- });
- }
- },
- recharge() {
- let obj = this;
- if (obj.num == '') {
- obj.$api.msg('请输入充币数量!');
- return;
- }
- recharge({
- money_type: obj.code,
- num: obj.num
- }).then(data => {
- obj.order_id = data.data.order_id;
- obj.id = data.data.id;
- obj.num = '';
- obj.$api.msg(data.msg);
- obj.orderShow = true;
- });
- },
- selectOne(options) {
- console.log("selectOne9999999999999999999",options)
- this.logo = options.LOGO;
- this.charge = options.charge;
- console.log(this.charge,'...........................')
- this.name = options.name;
- this.code = options.code;
- this.money = options.price;
-
- this.qr = options._address_qr;
- this.qr = options._address_qr;
- this.mark = options.mark;
- this.addr = options.wallet.address;
- this.ids = options.wallet.id;
-
-
- this.address = options.wallet.address
- console.log(this,'223232')
- if (options.name == 'USDT') {
- this.isShow = true;
- } else {
- this.isShow = false;
- }
- },
- useOutClickSide() {
- this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions();
- },
- sub() {
- this.idx = 2;
- this.$api.msg('敬请期待!');
- },
- gogo() {
- this.idx = 1;
- },
- qrR(res) {
- this.src = res;
- },
- creatQrcode() {
- this.$refs.qrcode._makeCode();
- },
- goway(data) {
- this.address = this.wayAddress[data]
-
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- min-height: 100%;
- background-color: #ffffff;
- .container {
- width: 100%;
- }
- }
- .list-box {
- padding: 60rpx 30rpx;
- height: 300rpx;
- background-color: #141E47;
- .list {
- background-color: #ffffff;
- border-radius: 15rpx;
- padding: 15rpx 23rpx;
- .list-item {
- font-size: 30rpx;
- font-weight: bold;
- color: #333333;
- image {
- width: 43rpx;
- height: 43rpx;
- margin-right: 15rpx;
- }
- }
- .list-tpl {
- image {
- width: 15rpx;
- height: 25rpx;
- margin-left: 20rpx;
- }
- }
- }
- }
- .image-box {
- position: relative;
- top: -100rpx;
- padding: 50rpx 0rpx;
- text-align: center;
- image {
- width: 300rpx;
- height: 300rpx;
- border-radius: 15rpx;
- }
- }
- .from-box {
- margin: 30rpx 30rpx;
- padding: 44rpx 25rpx;
- background-color: #ffffff;
- border-radius: 15rpx;
- position: relative;
- top: -180rpx;
- .from-title {
- font-size: 24rpx;
- font-weight: bold;
- color: #333333;
- }
- .input-box {
- font-size: 26rpx;
- font-weight: 500;
- color: #666666;
- margin: 35rpx 0rpx;
- width: 85%;
- }
- .all {
- font-size: 30rpx;
- font-weight: 500;
- color: #5771df;
- }
- .all-num {
- font-size: 24rpx;
- font-weight: bold;
- color: #333333;
- text {
- font-size: 26rpx;
- padding: 0rpx 10rpx;
- color: #5771df;
- }
- }
- .submit {
- background-color: #5771df;
- margin-top: 160rpx;
- margin-bottom: 80rpx;
- color: #ffffff;
- text-align: center;
- padding: 26rpx 0rpx;
- border-radius: 15rpx;
- }
- .tpl-box {
- text-align: left;
- font-size: 28rpx;
- font-weight: 500;
- color: #fb3a2f;
- margin-top: 26rpx;
- }
- }
- .add-img-item {
- text-align: center;
- width: 100%;
- padding: 80rpx 0rpx;
- .add-img {
- width: 280rpx;
- height: 280rpx;
- }
- }
- .image {
- text-align: center;
- padding: 77rpx 0rpx 36rpx 0rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #333333;
- .addr-img {
- width: 188rpx;
- height: 188rpx;
- margin-top: 18rpx;
- }
- }
- .addr-text {
- text-align: center;
- width: 500rpx;
- margin: 0rpx auto;
- line-height: 80rpx;
- color: #ffffff;
- background-color: #5771df;
- border-radius: 50rpx;
- margin-bottom: 114rpx;
- }
- .text-box {
- font-size: 24rpx;
- padding: 25rpx 0rpx;
- line-height: 50rpx;
- }
- //弹窗
- .popup {
- background-color: #ffffff;
- border-radius: 25rpx;
- font-size: 30rpx;
- .cancel {
- text-align: center;
- width: 100%;
- line-height: 60rpx;
- .tip {
- background-color: #5771df;
- color: #ffffff;
- width: 70rpx;
- height: 70rpx;
- border-top-right-radius: 25rpx;
- }
- }
- .list-boxs {
- padding: 0rpx 80rpx;
- .password {
- padding: 50rpx 0rpx;
- width: 100%;
- input {
- width: 90%;
- height: 80rpx;
- border: 2rpx solid #999999;
- padding-left: 25rpx;
- box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.27);
- border-radius: 11rpx;
- }
- }
- .confirm-btn {
- margin-left: 80rpx;
- padding-bottom: 120rpx;
- padding-top: 30rpx;
- text {
- background-color: #5771df;
- color: #ffffff;
- width: 100%;
- text-align: center;
- padding: 25rpx 90rpx;
- border-radius: 15rpx;
- }
- }
- }
- }
- .tuijianbox {
- width: 100%;
- display: flex;
- height: 40rpx;
- margin-bottom: 60rpx;
- .item {
- margin-left: 40rpx;
- font-size: 20rpx;
- position: relative;
- line-height: 40rpx;
- color: #ffffff;
- image {
- width: 150rpx;
- height: 100rpx;
- }
- }
- }
- .qidai {
- margin-bottom: 20rpx;
- width: 100%;
- font-size: 30rpx;
- text-align: center;
- color: red;
- }
- .way-wrapper {
- width: 90%;
- padding: 0 5%;
- display: flex;
- height: 40rpx;
- margin-bottom: 60rpx;
- justify-content: start;
- .way {
- width: 120rpx;
- height: 75rpx;
- line-height: 75rpx;
- text-align: center;
- border: 1px solid #7c90e3;
- border-radius: 10rpx 10rpx 10rpx 10rpx;
- color: #7c90e3;
- background-color: #eff2ff;
- font-size: 36rpx;
- font-weight: bold;
- margin-right: 30rpx;
- }
- }
- </style>
|