quanwei
2 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<template>
  <div>
    <div class="tips-border">
      <div class="tips_tit pb">操作提示</div>
      <div class="tips_txt">申请中请联系平台客服进行审核</div>
    </div>
    <div class="table-wrap" v-if="dataList!=''">
      <el-row>
        <el-col :span="8" v-for="(item,index) in dataList" :key="index">
          <div class="service-item d-b-c">
            <div class="d-s-c">
              <div class="service_img"><img :src="item.logo" alt=""> </div>
              <div>
                <div class="service-item-top">{{item.name}}</div>
                <div class="service-item-btm">{{item.describe}}</div>
              </div>
            </div>
            <div>
              <div v-if="item.status==0" class="apply_off">申请中</div>
              <div @click="toApply(item.service_security_id,1)" v-if="item.status==2" class="apply_btn">申请开通</div>
              <div v-if="item.status==1" class="d-s-c">
                <span class="apply_off">已开通</span><div @click="open(item.service_security_id)" class="apply_btn">退出</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
 
<script>
  import ShopApi from '@/api/shop.js';
  export default {
    data() {
      return {
        dataList:[]
      }
    },
    mounted() {
      this.getData();
    },
    methods: {
        getData(){
          let self=this;
          ShopApi.security({
              },
              true
            )
            .then(data => {
              console.log(data);
              self.dataList=data.data.list
              console.log(self.dataList);
            })
            .catch(error => {
 
            });
        },
        open(id) {
          this.$confirm('确定要退出吗?', '信息', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.toApply(id,0);
            this.$message({
              type: 'success',
              message: '操作成功'
            });
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消退出'
            });
          });
        },
        toApply(id,n){
          let self=this;
          let service_security_id=id;
          if(n==0){
          ShopApi.quit({
                service_security_id
              },
              true
            )
            .then(data => {
             self.getData();
            })
            .catch(error => {
 
            });
          }
          if(n==1){
            ShopApi.apply({
                  service_security_id
                },
                true
              )
              .then(data => {
                self.getData();
                this.$message({
                  type: 'success',
                  message: '操作成功'
                });
              })
              .catch(error => {
 
              });
          console.log("申请")
          }
        }
    }
  }
</script>
 
<style>
  .tips-border {
    border: 1px solid #CACACA;
    padding: 15px;
    margin-bottom: 20px;
  }
 
  .tips_tit {
    font-size: 22px;
    margin-bottom: 10px;
  }
 
  .tips_txt {
    line-height: 25px;
    color: #666;
    font-size: 14px;
  }
  .service-item{
        background-color: #f7f9fb;
        box-shadow: inherit;
        border-radius: 2px;
        padding: 20px;
        margin-right: 10px;
        margin-bottom: 10px;
  }
  .service-item .service_img{
        margin-right: 10px;
  }
  .service-item .service_img img{
      width: 42px;
      height: 42px;
  }
  .service-item-top {
    font-size: 16px;
    font-weight: 600;
    line-height: 25px
  }
 
  .service-item-btm {
    color: #999999;
    font-size: 12px;
    line-height: 25px
  }
  .apply_btn{
    background-color: #ff8143;
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    color: #fff;
    white-space: nowrap;
    text-align: center;
    font-size: 14px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    margin-left: 5px;
  }
 
  .apply_off{
    color: #ff8143
  }
</style>