123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <template>
- <view class="center">
- <view class="top">
- <view class="top-num" v-if="types == 'LALA'">{{ jf.toFixed(2) }}</view>
- <view class="top-font" v-if="types == 'LALA'">可转糖果</view>
- <view class="top-font" v-if="types == 'USDC'">{{ jf }}</view>
- <view class="top-font" v-if="types == 'USDC'">可转账购物积分</view>
- </view>
- <view class="main">
- <view class="main-font">收款人账户</view>
- <input class="main-input" type="text" value="" v-model="account" placeholder="请输入收款人账户" placeholder-class="main-input" />
- </view>
- <view class="main">
- <view class="main-font">收款人UID</view>
- <input class="main-input input" type="text" value="" v-model="uid" placeholder="请输入收款人UID" placeholder-class="main-input" />
- </view>
- <view class="main">
- <view class="main-font">交易密码</view>
- <input class="main-input" type="password" value="" v-model="password" placeholder="请输入交易密码" placeholder-class="main-input" />
- </view>
- <view class="main">
- <view class="main-font">转账数量</view>
- <input class="main-input" type="number" v-model="num > jf ? jf : num" placeholder="请输入转账数量" placeholder-class="main-input" />
- </view>
- <view class="btn" @click="transfer">
- 提交申请
- </view>
- </view>
- </template>
- <script>
- import { goPay,moneyLog, recharge, wallet } from '@/api/finance.js';
- import { mapState, mapMutations } from 'vuex';
- export default {
- data() {
- return {
- jf: 0, //可转账购物积分
- uid: '', //收款人UID
- account:'',//收款人账号
- password:'',//交易密码
- num: '' ,//转账数量
- types:'',
- };
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
- },
- onLoad(option) {
- if(option.type){
- this.types = option.type;
- }
- if( this.types == 'LALA' ) {
- uni.setNavigationBarTitle({
- title: "糖果转账"
- })
- }
- console.log(this.userInfo,'11111')
- wallet({}).then(({ data }) => {
- const obj = this
- const arr = Object.keys(data.back);
- console.log(arr);
- arr.forEach(e => {
- if(e == obj.types){
- obj.jf = (data.back[e].money.money*1)
- }
- });
- });
- },
- methods:{
- transfer() {
- let obj = this;
- if (obj.account == '') {
- obj.$api.msg('请输入对方账号!');
- return;
- }
- if (obj.uid == '') {
- obj.$api.msg('请输入对方UID!');
- return;
- }
- if (obj.password == '') {
- obj.$api.msg('请输入交易密码!');
- return;
- }
- if (obj.num == '') {
- obj.$api.msg('请输入转账数量!');
- return;
- }
- if (obj.uid == this.userInfo.uid){
- obj.$api.msg('请勿转账给自己!');
- return;
- }
- goPay({
- type: this.types,
- num: obj.num,
- to_uid: obj.uid,
- trade_psw: obj.password,
- to_user_account: obj.account
- }).then(data => {
- obj.num = '';
- obj.UID = '';
- obj.password = '';
- obj.account = '';
- uni.navigateTo({
- url:'/pages/money/success'
- })
- });
- },
- }
- };
- </script>
- <style lang="scss">
- page,
- .center {
- background: #f2f3f5;
- height: 100%;
- }
- .top {
- margin-top: 20rpx;
- background: #ffffff;
- padding: 30rpx 0;
- text-align: center;
- .top-num {
- font-size: 42rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .top-font {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- }
- .main {
- padding: 36rpx 24rpx;
- background-color: #ffffff;
- margin-top: 20rpx;
- .main-font {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #333333;
- }
- .input {
- margin-top: 10rpx;
- }
- .main-input {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #999999;
- }
- }
- .btn {
- text-align: center;
- margin: 120rpx auto;
- width: 670rpx;
- height: 88rpx;
- background: linear-gradient(0deg, #2E58FF, #32C6FF);
- border-radius: 10px;
- text-align: center;
- line-height: 88rpx;
- font-size: 32rpx;
- font-family: SourceHanSansCN;
- font-weight: 500;
- color: #FEFEFE;
- }
- </style>
|