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
135
136
137
138
139
140
141
142
143
144
145
<template>
  <view class="content">
    <view class="title">已发送至手机</view>
    <view class="phone">{{userInfo.phone}}</view>
    <view class="retry" @click="getCode">重新发送 <text v-if="s">({{s}})</text></view>
    <u-code-input :maxlength="4" v-model="code" size="115rpx" color="#000000" fontSize="65rpx"></u-code-input>
    <view class="bind-add-card">
      <button class="button" @click="finish">确定</button>
    </view>
    <u-modal :show="reportLostShow" confirmColor="#FF2729" width="590rpx" :zoom="false" @confirm="reportLostClose">
      <view class="reportLost-text">{{modalContent}}</view>
    </u-modal>
  </view>
</template>
 
<script>
  import {
    mapState,
    mapMutations
  } from 'vuex'
  export default {
    data() {
      return {
        code:"",
        phone:"",
        s:0,
        reportLostShow:false,
        userInfo:{},
        modalContent:"挂失成功,您可以在卡管理中申请重新找回卡,从而继续使用",
        id:0,
        t:1,
        loading:true,
        title:""
      };
    },
    onLoad(o) {
      if(o.title){
        uni.setNavigationBarTitle({
          title:o.title
        })
        this.title = o.title
      }
      if(o.id){
        this.id = o.id
      }
      if(o.t){
        this.t = o.t
      }
      this.init()
    },
    methods:{
      init(){
        this.$apis.user.getUserInfo().then(res=>{
          this.loading = false
          this.userInfo = res.data
          this.getCode()
        })
      },
      getCode(){
        if(this.s >= 1){
          return
        }
        this.$apis.login.getCode({phone:this.userInfo.phone,type:6}).then(res=>{
          this.$toast(res.msg)
          this.s = 60
          let timer = setInterval(()=>{
            if(this.s <= 1){
              clearInterval(timer)
            }
            this.s--
          },1000)
        })
      },
      finish(){
        if(this.code.length != 4){
          this.$toast("输入完整的验证码")
          return
        }
        this.$apis.user.uputbinding({id:this.id,state:this.t,phone:this.userInfo.phone,smsCode:this.code}).then(res=>{
          if(this.t == 1){
            this.modalContent = "挂失成功,您可以在卡管理中申请重新找回卡,从而继续使用"
          }else{
            this.modalContent = "删除成功"
          }
          this.reportLostShow = true
        })
      },
      reportLostClose(){
        this.$navBack()
      }
    }
  }
</script>
 
<style lang="scss">
.content{
  display: flex;
  flex-direction: column;
  align-items: center;
  .title{
    font-size: 23rpx;
    color: rgba(0, 0, 0, .4);
    line-height: 33rpx;
    margin-top: 86rpx;
  }
  .phone{
    font-weight: 700;
    font-size: 46rpx;
    color: #000000;
    line-height: 50rpx;
    margin-top: 17rpx;
  }
  .retry{
    font-size: 23rpx;
    color: rgba(0, 0, 0, .6);
    line-height: 33rpx;
    margin-top: 23rpx;
    margin-bottom: 42rpx;
  }
  .reportLost-text{
    font-size: 35rpx;
    color: #000000;
    line-height: 58rpx;
  }
  
  .bind-add-card{
    width: 750rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding-top: 255rpx;
    .button{
      width: 635rpx;
      height: 96rpx;
      background: #FF2729;
      border-radius: 58rpx;
      font-weight: 700;
      font-size: 35rpx;
      color: #FFFFFF;
      line-height: 48rpx;
    }
  }
}
</style>