fix
13404089107
8 天以前 2e90f57e7d28d6a949247ef39b487d3e75b56683
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
  <view class="content">
    <block v-if="!loading.page">
      <view class="cell">
        <view class="cell-item">
          <view class="cell-item-title">卡号</view>
          <input type="number" class="cell-item-input" v-model="kahao" placeholder="请输入卡号" />
        </view>
        <view class="cell-item">
          <view class="cell-item-title">密码</view>
          <input type="text" class="cell-item-input" v-model="password" placeholder="请输入密码"/>
        </view>
      </view>
      <view class="illustrate">
        <view>绑卡说明:</view>
        <view class="illustrate" v-html="content"></view>
      </view>
      <view class="bind-add-card">
        <button class="button" @click="submit">确定</button>
      </view>
    </block>
    <u-loading-page :loading="loading.page"></u-loading-page>
  </view>
</template>
 
<script>
  export default {
    data() {
      return {
        loading:{
          page:true,
          submit:false
        },
        content:"",
        kahao:"",
        password:""
      };
    },
    onLoad() {
      this.init()
    },
    methods:{
      init(){
        this.$apis.app.protocol({type:18,portType:1}).then(res=>{
          this.loading.page = false
          this.content = res.data.content1
        })
      },
      submit(){
        if(this.loading.submit) return
        if(!this.kahao){
          this.$toast("请输入卡号")
          return
        }
        if(!this.password){
          this.$toast("请输入密码")
          return
        }
        this.loading.submit = true
        this.$apis.user.addbinding({kahao:this.kahao,password:this.password}).then(res=>{
          this.loading.submit = false
          uni.showModal({
            content:"绑定成功,您已经成功授权该卡使用您的钱包余额饮水",
            confirmColor:"#FF2729",
            showCancel:false,
            success: () => {
              this.$navBack()
            }
          })
        }).catch(err=>{
          uni.showModal({
            // content:"绑定失败,您输入的卡号或者密码有误,请核实后重新输入",
            content:err.msg,
            confirmColor:"#FF2729",
            showCancel:false,
          })
        })
      }
    }
  }
</script>
 
<style lang="scss">
.content{
  padding: 26rpx;
  .cell{
    .cell-item{
      height: 100rpx;
      display: flex;
      align-items: center;
      border-bottom: 2rpx solid rgba(217, 217, 217, 0.4);
      .cell-item-title{
        font-size: 32rpx;
        color: #000000;
        line-height: 32rpx;
        text-align: left;
        font-style: normal;
      }
      .cell-item-input{
        flex: 1;
        text-align: right;
        padding-right: 8rpx;
      }
    }
  }
  .illustrate{
    font-size: 24rpx;
    color: rgba(0, 0, 0, 0.6);
    line-height: 44rpx;
    margin-top: 21rpx;
  }
  .bind-add-card{
    position: fixed;
    bottom: 0;
    left: 0;
    width: 750rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding-bottom: 83rpx;
    .button{
      width: 635rpx;
      height: 96rpx;
      background: #FF2729;
      border-radius: 58rpx;
      font-weight: 700;
      font-size: 35rpx;
      color: #FFFFFF;
      line-height: 48rpx;
    }
  }
}
</style>