123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <style lang="scss">
- .bank-list{
- background: #fff;
- border-radius: 10px;
- margin: 10px;
-
- .item {
- border-bottom: 1px solid #f1f1f1;
- padding: 32rpx 28rpx;
- .icon{width: 40rpx;height: 40rpx;margin-right: 25rpx;}
- .name{font-weight: 500;font-size: 26rpx;color: #333333;}
- .bank_name{font-weight: 500;font-size: 26rpx;color: #999999;}
- .pev{width: 40rpx;height: 40rpx;}
- }
- }
- </style>
- <template>
- <view class="app-body">
- <view class="bank-list">
-
- <view class="item fx-r" @tap="tapOpen" data-url="save/bank">
- <image class="icon" src="/static/img/bank_bank.png"></image>
- <view class="name">银行卡</view>
- <view class="fx-g1"></view>
- <view class="bank_name">{{ getBank(3) || '未添加' }}</view>
- <image class="pev" src="/static/img/ic_next.png"></image>
- </view>
-
- <view class="item fx-r" @tap="tapOpen" data-url="save/alipay">
- <image class="icon" src="/static/img/bank_alipay.png"></image>
- <view class="name">支付宝</view>
- <view class="fx-g1"></view>
- <view class="bank_name">{{ getBank(2) || '未添加' }}</view>
- <image class="pev" src="/static/img/ic_next.png"></image>
- </view>
-
- <view class="item fx-r" @tap="tapOpen" data-url="save/weixin">
- <image class="icon" src="/static/img/bank_weixin.png"></image>
- <view class="name">微信</view>
- <view class="fx-g1"></view>
- <view class="bank_name">{{ getBank(1) || '未添加' }}</view>
- <image class="pev" src="/static/img/ic_next.png"></image>
- </view>
-
-
- </view>
-
- </view>
- </template>
- <script>
- import {mapState,mapMutations} from 'vuex';
- export default {
- computed: mapState(['user']),
- data() {
- return {
- data : [],
- isFirst : false
- }
- },
- onShow() {
- this.getData();
- },
- methods: {
-
- onEvent:function(type,data){
- this.getData();
- },
- getData:function(){
- this
- .request
- .post("getBank")
- .then(res=>{
- if(res.code == 200) {
- this.data = res.data
- this.isFirst = true;
- } else {
- this.utils.Tip(res.msg);
- }
- })
- .catch(err=>{
- this.utils.Tip(res.msg);
- });
- },
- tapBack: function() {
- uni.navigateBack();
- },
-
- getBank:function(type) {
- for(let i in this.data) {
- if(this.data[i].type == type) {
- return this.data[i].name;
- }
- }
-
- return null;
- },
-
-
- tapOpen: function(ev) {
- let url = ev.currentTarget.dataset.url
- uni.navigateTo({
- url: url
- });
- }
-
-
- }
- }
- </script>
|