| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <template>
- <view class="content">
- <view class="row-box">
- <view class="title">转出金额</view>
- <view class="row">
- <text class="tit">¥</text>
- <input class="input" type="number" v-model="money" placeholder="请输入充值金额" placeholder-class="placeholder" />
- </view>
- </view>
- <button class="add-btn up" :class="{ 'active-bg': payLoding }" @click="!payLoding ? confirm() : ''">转出</button>
- </view>
- </template>
- <script>
- import { getMoneyStyle } from '@/utils/rocessor.js';
- // #ifdef APP-PLUS
- import { rechargeRoutine } from '@/api/wallet.js';
- // #endif
- // #ifdef H5
- import { rechargeWechat } from '@/api/wallet.js';
- // #endif
- // #ifdef MP
- import { rechargeRoutine } from '@/api/wallet.js';
- // #endif
- import { mapState } from 'vuex';
- export default {
- filters: {
- getMoneyStyle
- },
- data() {
- return {
- type: 'weixin',
- money: '', //充值金额
- payLoding: false //是否加载中
- };
- },
- onLoad(options) {},
- computed: {
- // #ifdef H5
- ...mapState(['weichatObj'])
- // #endif
- },
- methods: {
- // 跳转
- navTo(url) {
- uni.navigateTo({
- url: url
- });
- },
- // 切换选中对象
- tabRadio(e) {
- this.type = e;
- console.log(this.type,'this.type')
- },
- // 提交
- confirm() {
- let obj = this;
- obj.payLoding = true;
- console.log(obj.money);
- if ( obj.money == '') {
- this.$api.msg('金额不能为空');
- obj.payLoding = false;
- return
- }
- // #ifdef APP-PLUS
- rechargeRoutine({
- price: this.money,
- from: this.type,
- type: 1,
- }).then(e => {
- this.$api.msg('转入余额成功');
- })
- .catch(e => {
- obj.payLoding = false;
- });
- // #endif
-
- // #ifdef H5
- rechargeWechat({
- price: this.money,
- from: this.type,
- type: 1,
- }).then(e => {
- this.$api.msg('转入余额成功');
- })
- .catch(e => {
- obj.payLoding = false;
- });
- // #endif
-
- // #ifdef MP
- rechargeRoutine({
- price: this.money,
- from: this.type,
- type: 1,
- }).then(e => {
- this.$api.msg('转入余额成功');
- })
- .catch(e => {
- obj.payLoding = false;
- });
- // #endif
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- height: 100%;
- }
- .add-btn {
- &.modified {
- color: $base-color;
- }
- &.up {
- background:$base-color;
- color: #fff;
- }
- display: flex;
- align-items: center;
- justify-content: center;
- width: 560rpx;
- height: 80rpx;
- margin: 0 auto;
- margin-top: 60rpx;
- font-size: $font-lg;
- border-radius: 40rpx;
- }
- .row-box {
- border-top: 1px solid #EEEEEE;
- padding: 20rpx 30rpx;
- background: #fff;
- .title {
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- }
- .row {
- display: flex;
- align-items: center;
- position: relative;
- height: 80rpx;
- .tit {
- flex-shrink: 0;
- width: 40rpx;
- font-size: 30rpx;
- color: $font-color-dark;
- }
- .input {
- flex: 1;
- font-size: 30rpx;
- color: $font-color-dark;
- }
- .iconlocation {
- font-size: 36rpx;
- color: $font-color-light;
- }
- .buttom {
- color: $font-color;
- font-size: $font-base;
- }
- }
- }
- .list {
- padding:0 30rpx;
- margin-top: 20rpx;
- background-color: #ffffff;
- .box {
- display: flex;
- align-items: center;
- width: 100%;
- height: 100rpx;
- border-bottom: 1px solid $border-color-light;
- }
- .box1{
- display: flex;
- align-items: center;
- width: 100%;
- height: 100rpx;
- }
- .icon {
- font-size: 48rpx;
- padding-right: 20rpx;
- }
- .iconweixin1 {
- color: #18bf16;
- }
- .iconzhifubao {
- color: #08aaec;
- }
- .title-box {
- flex-grow: 1;
- text-align: left;
- .title {
- font-size: $font-base + 2rpx;
- color: #333333;
- }
- /* .node {
- font-size: $font-base;
- color: #333333;
- } */
- }
- image {
- width: 25rpx;
- height: 25rpx;
- }
- }
- /deep/ .uni-radio-input {
- width: 45rpx;
- height: 45rpx;
- }
- .active-bg {
- background-color: $color-gray !important;
- }
- </style>
|