123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <template>
- <view class="content">
- <view class="vheight"></view>
- <view class="top flex">
- <image @click="back()" class="top-icon1" src="../../static/img/cb2.png" mode=""></image>
- <image @click="navTo('/pages/user/cbRecord')" class="top-icon2" src="../../static/img/cb1.png" mode=""></image>
- </view>
- <view class="title">{{ $t('cb.cb') }}</view>
- <view class="type flex" @click="navTo('/pages/transaction/cblist')">
- <view class="type-left">{{ $t('cb.bz') }}</view>
- <view class="type-right">
- <view class="type-name">{{ info.title }}</view>
- <image class="type-icon" src="../../static/icon/user-back.png" mode=""></image>
- </view>
- </view>
- <view class="main">
- <view class="main-title">{{ $t('cb.cbwl') }}</view>
- <view class="main-list">{{ info.czline }}</view>
- <view class="main-title" style="margin-top: 20rpx;">{{ $t('cb.cbdz') }}</view>
- <view class="erweima">
- <tki-qrcode
- :cid="cid"
- ref="qrcode"
- :val="info.czaddress"
- :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="address">{{ info.czaddress }}</view>
- <view class="btn" @click="copy(info.czaddress)">{{ $t('cb.fzdz') }}</view>
- </view>
- <view class="info">
- <view class="info-item red">{{ $t('cb.zxczje') }}:{{ info.czminnum }}{{ info.title }},{{ $t('cb.xyzxje') }}</view>
- <view class="info-item">{{ $t('cb.qxzzqd') }}</view>
- <view class="info-item">{{ $t('cb.zxczje') }}:{{ info.czminnum }}{{ info.title }},{{ $t('cb.xyzxje') }}</view>
- <view class="info-item">{{ $t('cb.ndczdz') }}</view>
- <view class="info-item">{{ $t('cb.qwbqrdn') }}</view>
- </view>
- <view class="sr">
- <view class="sr-title">{{ $t('cb.zzje') }}</view>
- <view class="sr-input"><input :placeholder="$t('cb.qsrzzje')" type="number" v-model="num" /></view>
- <view class="sr-title" style="margin-top: 20rpx;">{{ $t('cb.xczzpz') }}</view>
- <view class="sr-image">
- <image :src="image" mode="" class="upload-img" @click.stop="imgsub" v-if="image"></image>
- <image src="../../static/img/add.png" class="upload-img" mode="" v-if="!image" @click.stop="imgsub"></image>
- </view>
- <view class="sr-btn" @click="submit()">{{ $t('cb.tj') }}</view>
- </view>
- </view>
- </template>
- <script>
- import { czpage, upload, paycoin } from '@/api/wallet.js';
- import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
- import uniCopy from '@/js_sdk/xb-copy/uni-copy.js';
- export default {
- data() {
- return {
- id: '',
- info: '',
- cid: 'cid',
- size: 100,
- unit: '150',
- background: '#FFFFFF',
- foreground: '#000000',
- pdground: '#000000',
- icon: '',
- iconSize: 40,
- lv: 3,
- onval: true,
- loadMake: true,
- usingComponents: true,
- num: '',
- image: '',
- image1: ''
- };
- },
- onLoad(opt) {
- this.id = opt.type;
- this.loadData();
- },
- onShow() {},
- onReachBottom() {},
- onReady() {},
- methods: {
- loadData() {
- czpage({ id: this.id }).then(e => {
- this.info = e.data;
- });
- },
- qrR(res) {
- console.log(res, '123456');
- },
- back() {
- uni.navigateBack();
- },
- navTo(url) {
- uni.navigateTo({
- url
- });
- },
- imgsub() {
- console.log(111);
- upload({
- filename: ''
- }).then(data => {
- console.log('data', data);
- this.image = data[0].src;
- this.image1 = data[0].img;
- });
- },
- 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'
- });
- }
- },
- submit() {
- console.log(222);
- if (this.num < 0) {
- return this.$api.msg(this.$t('cb.czjebnw'));
- }
- if (!this.image1) {
- return this.$api.msg(this.$t('cb.qcszzpz'));
- }
- paycoin({ cid: this.id, zznum: this.num, payimg: this.image1, coinname: this.info.title }).then(e => {
- this.num = '';
- this.image = '';
- return this.$api.msg(this.$t('cb.tjsqcg'));
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page,
- .content {
- min-height: 100%;
- height: auto;
- background: #f5f5f5;
- }
- .vheight {
- height: var(--status-bar-height);
- background: #f5f5f5;
- }
- .top {
- padding: 20rpx 40rpx;
- .top-icon1 {
- width: 52rpx;
- height: 36rpx;
- }
- .top-icon2 {
- width: 48rpx;
- height: 48rpx;
- }
- }
- .title {
- padding: 20rpx 20rpx 0;
- font-size: 52rpx;
- font-weight: 500;
- }
- .type {
- margin: 20rpx auto 0;
- width: 690rpx;
- background: #ffffff;
- border-radius: 20rpx;
- padding: 30rpx 20rpx;
- .type-left {
- font-size: 32rpx;
- color: #000;
- }
- .type-right {
- display: flex;
- align-items: center;
- .type-name {
- font-size: 36rpx;
- font-weight: bold;
- color: #fcd535;
- margin-right: 10rpx;
- }
- .type-icon {
- width: 24rpx;
- height: 24rpx;
- }
- }
- }
- .main {
- margin: 20rpx auto 0;
- width: 690rpx;
- background: #ffffff;
- border-radius: 20rpx;
- padding: 30rpx 20rpx;
- .main-title {
- font-size: 32rpx;
- color: #000;
- }
- .main-list {
- margin-top: 20rpx;
- width: 200rpx;
- height: 70rpx;
- line-height: 70rpx;
- text-align: center;
- border: 2px solid #fcd535;
- border-radius: 10rpx;
- font-size: 28rpx;
- color: #fcd535;
- }
- .erweima {
- margin-top: 40rpx;
- width: 100%;
- display: flex;
- justify-content: center;
- }
- .address {
- margin-top: 20rpx;
- width: 100%;
- text-align: center;
- font-size: 24rpx;
- color: #000;
- }
- .btn {
- width: 200rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- border-radius: 10rpx;
- border: 2px solid #fcd535;
- font-size: 28rpx;
- color: #fcd535;
- margin: 20rpx auto 0;
- }
- }
- .info {
- margin: 20rpx auto 0;
- width: 690rpx;
- background: #ffffff;
- border-radius: 20rpx;
- padding: 30rpx 20rpx;
- .info-item {
- font-size: 24rpx;
- color: #000;
- margin-bottom: 20rpx;
- }
- .red {
- color: red;
- }
- }
- .sr {
- margin: 20rpx auto 0;
- width: 690rpx;
- background: #ffffff;
- border-radius: 20rpx;
- padding: 30rpx 20rpx;
- .sr-title {
- font-size: 32rpx;
- color: #000;
- }
- .sr-input {
- display: flex;
- align-items: center;
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- background: #f5f5f5;
- border-radius: 20rpx;
- padding: 0rpx 30rpx;
- input {
- font-size: 28rpx;
- padding-left: 30rpx;
- background: #f5f5f5;
- }
- }
- .sr-image {
- display: flex;
- justify-content: center;
- margin: 20rpx;
- image {
- width: 200rpx;
- height: 200rpx;
- }
- }
- .sr-btn {
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- border-radius: 10rpx;
- margin: 20rpx auto 0;
- background: linear-gradient(to left, #eeb80d, #ffe35b);
- font-size: 28rpx;
- color: #000;
- }
- }
- </style>
|