my-info.vue 39.4 KB
Newer Older
786817560's avatar
786817560 committed
1 2 3
<!--
 * @Author: your name
 * @Date: 2019-11-07 17:48:53
786817560's avatar
786817560 committed
4
 * @LastEditTime : 2019-12-23 15:30:46
786817560's avatar
786817560 committed
5
 * @LastEditors  : Please set LastEditors
786817560's avatar
786817560 committed
6 7 8
 * @Description: In User Settings Edit
 -->
<!-- -->
李晓兵's avatar
李晓兵 committed
9
<template>
linxin's avatar
linxin committed
10
  <h-view id="my-info">
linxin's avatar
linxin committed
11
    <h-header class="bar-custom">
linxin's avatar
linxin committed
12
      <div slot="center">个人中心</div>
linxin's avatar
linxin committed
13 14
    </h-header>

linxin's avatar
linxin committed
15 16
    <!-- <div :class="['top',(multipleRole!=='GUTA'&&user_bp_type!=='GUTA')?'has':'antiHas']" style="margin-top:-1px;"> -->
    <div class="top" style="margin-top:-1px;">
linxin's avatar
linxin committed
17
      <div class="card-top">
18
        <img :src="upLoadObj" @click="checkType" >
linxin's avatar
linxin committed
19 20 21 22
        <div class="sign">
          <span>{{ user_phone }}</span>
          <div>
            电子签
linxin's avatar
linxin committed
23 24 25 26
            <p
              :class="[elecStatus?'across':'un-across']"
              @click="certification"
            >{{ elecStatusDesceibe }}</p>
linxin's avatar
linxin committed
27 28 29
          </div>
        </div>
      </div>
linxin's avatar
linxin committed
30 31
      <!-- <div v-if="multipleRole!=='GUTA'&&user_bp_type!=='GUTA'" class="card"> -->
      <div class="card">
linxin's avatar
linxin committed
32 33
        <div class="card-info">
          <div class="card-bottom">
linxin's avatar
linxin committed
34
            <div v-if="((user_bp_type!=='TENANT')&&(user_bp_type!=='GUTA')&&(multipleRole!=='GUTA')&&(multipleRole!=='TENANT'))||multipleRole==='AGENT'" @click="goStart">
linxin's avatar
linxin committed
35 36 37
              <img src="@/assets/myInfo/car.png" >
              <p>发车申请</p>
            </div>
linxin's avatar
linxin committed
38
            <div v-if="((user_bp_type==='TENANT')&&(multipleRole==='TENANT'))||(multipleRole==='TENANT')||((user_bp_type==='TENANT')&&(!multipleRole))" @click="changePay">
linxin's avatar
linxin committed
39 40 41
              <img src="@/assets/myInfo/pay.png" >
              <p>首付还款</p>
            </div>
linxin's avatar
linxin committed
42
            <div v-if="((user_bp_type==='TENANT')&&(multipleRole==='TENANT'))||(multipleRole==='TENANT')||((user_bp_type==='TENANT')&&(!multipleRole))" @click="changeRent">
linxin's avatar
linxin committed
43 44 45
              <img src="@/assets/myInfo/refund.png" >
              <p>租金还款</p>
            </div>
linxin's avatar
linxin committed
46 47 48 49
            <div v-if="(user_bp_type==='AGENT')&&(user_bp_class==='ORG')&&(user_bp_status === 'APPROVED')" @click="changeCash">
              <img src="@/assets/myInfo/promise.png" >
              <p>缴纳保证金</p>
            </div>
linxin's avatar
linxin committed
50 51 52 53 54 55 56 57
            <div v-if="((user_bp_type==='GUTA')&&(multipleRole==='GUTA'))||(multipleRole==='GUTA')||((user_bp_type==='GUTA')&&(!multipleRole))" @click="changeContract('GUTA')">
              <img src="@/assets/myInfo/under.png" >
              <p>我担保的合同</p>
            </div>
            <div v-if="((user_bp_type==='AGENT')&&(multipleRole==='AGENT'))||(multipleRole==='AGENT')||((user_bp_type==='AGENT')&&(!multipleRole))" @click="changeContract('AGENT')">
              <img src="@/assets/myInfo/agent.png" >
              <p>我办理的合同</p>
            </div>
linxin's avatar
linxin committed
58 59
          </div>
        </div>
李晓兵's avatar
李晓兵 committed
60
      </div>
linxin's avatar
linxin committed
61 62
    </div>
    <h-content class="my-content">
linxin's avatar
linxin committed
63 64 65
      <div class="content-top">
        <div class="userInfo">我的合同</div>
        <div class="my-contract">
linxin's avatar
linxin committed
66
          <div v-if="(user_bp_type === 'AGENT'&&multipleRole==='AGENT') || user_bp_type === 'OFFICE'||multipleRole==='AGENT'||(user_bp_type === 'AGENT'&&!multipleRole)" class="content-wrap" @click="goCreate">
linxin's avatar
linxin committed
67 68 69 70
            <span
              v-if="prjSubmit > 0"
              :class="{'content-wrap-class-width':prjSubmit>99, 'content-wrap-class':prjSubmit<99}"
            >{{ prjSubmit > 99 ? '99+' : prjSubmit }}</span>
786817560's avatar
786817560 committed
71 72 73
            <img src="@/assets/myInfo/contractCreate.png" >
            <p>合同创建</p>
          </div>
linxin's avatar
linxin committed
74
          <div class="content-wrap" @click="goSign">
75 76
            <span
              v-if="signCount > 0"
linxin's avatar
linxin committed
77 78 79 80 81 82 83 84 85 86 87
              :class="{'content-wrap-class-width':signCount>99, 'content-wrap-class':signCount<99}"
            >{{ signCount > 99 ? '99+' : signCount }}</span>
            <img src="@/assets/myInfo/unSign.png" >
            <p>待签约</p>
          </div>
          <!-- <div class="content-wrap" @click="goConfirm">
            <span
              :class="{'content-wrap-class-width':confirmCount>99, 'content-wrap-class':confirmCount<99}"
            >{{ confirmCount > 99 ? '99+' : confirmCount }}</span>
            <img src="@/assets/myInfo/unConfirm.png" >
            <p>待确认</p>
linxin's avatar
linxin committed
88
          </div>-->
89
          <div v-if="user_bp_type!=='FACTORY'" class="content-wrap" @click="goVideoSign">
90
            <span
linxin's avatar
linxin committed
91 92 93
              v-if="faceSign > 0"
              :class="{'content-wrap-class-width':faceSign>99, 'content-wrap-class':faceSign<99}"
            >{{ faceSign > 99 ? '99+' : faceSign }}</span>
linxin's avatar
linxin committed
94 95 96
            <img src="@/assets/myInfo/unFace.png" >
            <p>待面签</p>
          </div>
97
          <div
linxin's avatar
linxin committed
98
            v-if="((user_bp_type==='TENANT')||(user_bp_type==='GUTA')||(multipleRole==='GUTA')||(multipleRole==='TENANT'))&&multipleRole!=='AGENT'"
99 100 101
            class="content-wrap"
            @click="goCarConfirm"
          >
102 103
            <span
              v-if="carCount > 0"
linxin's avatar
linxin committed
104 105
              :class="{'content-wrap-class-width':carCount>99, 'content-wrap-class':carCount<99}"
              style="margin-left:5px;"
linxin's avatar
linxin committed
106
            >{{ carCount > 99 ? '99+' : carCount }}</span>
linxin's avatar
linxin committed
107 108 109
            <img src="@/assets/myInfo/carConfirm.png" >
            <p>发车确认</p>
          </div>
linxin's avatar
linxin committed
110
        </div>
linxin's avatar
linxin committed
111
        <list-item :item-height="44" class="list">
112
          <item
linxin's avatar
linxin committed
113
            v-if="((user_bp_type==='TENANT')||(user_bp_type==='GUTA'||(multipleRole==='GUTA')||(multipleRole==='TENANT')))&&multipleRole!=='AGENT'"
114 115
            @click.native="goReimburse"
          >
linxin's avatar
linxin committed
116 117 118
            <img slot="left-icon" src="@/assets/myInfo/myRefund.png" class="left-icon" >
            <div slot="name">我的还款</div>
          </item>
李晓兵's avatar
李晓兵 committed
119
          <item v-if="user_bp_type==='TENANT'" @click.native="goInvoice">
李晓兵's avatar
李晓兵 committed
120 121 122
            <img slot="left-icon" src="@/assets/myInfo/invoice.png" class="left-icon" >
            <div slot="name">我的发票</div>
          </item>
linxin's avatar
linxin committed
123 124 125
          <item @click.native="goMyProduct">
            <img slot="left-icon" src="@/assets/myInfo/collect.png" class="left-icon" >
            <div slot="name">我的收藏</div>
126 127
            <div
              v-if="productCount > 0"
linxin's avatar
linxin committed
128 129 130 131 132 133 134 135
              slot="right-icon"
              :class="{'right-icon-width':productCount>99, 'right-icon':productCount<99}"
            >{{ productCount > 99 ? '99+' : productCount }}</div>
          </item>
          <item @click.native="changeHelp">
            <img slot="left-icon" src="@/assets/myInfo/help.png" class="left-icon" >
            <div slot="name">帮助与反馈</div>
          </item>
JingChao's avatar
JingChao committed
136
          <item @click.native="goAbout">
linxin's avatar
linxin committed
137 138 139
            <img slot="left-icon" src="@/assets/myInfo/about.png" class="left-icon" >
            <div slot="name">关于徐工</div>
          </item>
linxin's avatar
linxin committed
140
          <!-- <item @click.native="updateVersion">
linxin's avatar
linxin committed
141 142
            <img slot="left-icon" src="@/assets/myInfo/refresh.png" class="left-icon" >
            <div slot="name">检查更新</div>
linxin's avatar
linxin committed
143
          </item> -->
linxin's avatar
linxin committed
144
          <!-- <item @click.native="openTest">
李晓兵's avatar
李晓兵 committed
145 146
            <img slot="left-icon" src="@/assets/myInfo/refresh.png" class="left-icon" >
            <div slot="name">当前版本</div>
147
            <div slot="content">{{ currentVersion }}</div>
linxin's avatar
linxin committed
148
          </item> -->
linxin's avatar
linxin committed
149 150 151 152 153
          <item @click.native="logOut">
            <img slot="left-icon" src="@/assets/myInfo/exit.png" class="left-icon" >
            <div slot="name">退出登录</div>
          </item>
        </list-item>
linxin's avatar
linxin committed
154 155
        <button v-if="!popSetect" @click="approveBtn ? unBind() : changePageHead()">{{ description }}</button>
        <button v-if="popSetect" @click="popSetectBox=true">{{ description }}</button>
linxin's avatar
linxin committed
156
      </div>
李晓兵's avatar
李晓兵 committed
157
    </h-content>
李晓兵's avatar
李晓兵 committed
158
    <role-switch
linxin's avatar
linxin committed
159
      v-show="roleSwitchFlag"
linxin's avatar
linxin committed
160
      ref="roleSwitchRoleList"
linxin's avatar
linxin committed
161 162 163 164
      :roleList="roleList"
      @roleConfirm="roleConfirm"
      @roleCancle="roleCancle"
    />
linxin's avatar
linxin committed
165 166
    <role-switch
      v-show="popSetectBox"
linxin's avatar
linxin committed
167
      ref="roleSwitchType"
linxin's avatar
linxin committed
168 169 170 171
      :roleList="type"
      @roleConfirm="typeConfirm"
      @roleCancle="typeCancle"
    />
linxin's avatar
linxin committed
172
  </h-view>
李晓兵's avatar
李晓兵 committed
173 174
</template>
<script>
李晓兵's avatar
李晓兵 committed
175
import roleSwitch from './role-switch-component'
linxin's avatar
linxin committed
176
import defaultImg from '../../assets/myInfo/1.png'
李晓兵's avatar
李晓兵 committed
177
export default {
李晓兵's avatar
李晓兵 committed
178 179 180
  components: {
    roleSwitch,
  },
李晓兵's avatar
李晓兵 committed
181
  data () {
linxin's avatar
linxin committed
182
    return {
李晓兵's avatar
李晓兵 committed
183
      currentVersion: process.env.currentVersion,
linxin's avatar
linxin committed
184
      multipleRole: '',
185
      upLoadObj: defaultImg, // 上传的图片
linxin's avatar
linxin committed
186
      flag: true,
linxin's avatar
linxin committed
187
      isAGENT: false,
linxin's avatar
linxin committed
188
      popSetect: false, // true:待提交或者审核未通过
linxin's avatar
linxin committed
189
      popSetectBox: false, // 弹出选择框
linxin's avatar
linxin committed
190
      elecStatusDesceibe: '',
linxin's avatar
linxin committed
191 192 193
      user_bp_status: '',
      user_bp_class: '',
      bp_id: '',
linxin's avatar
linxin committed
194
      user_phone: '',
linxin's avatar
linxin committed
195
      user_bp_name: '',
linxin's avatar
linxin committed
196
      user_bp_type: '',
李晓兵's avatar
李晓兵 committed
197
      signCount: '0',
786817560's avatar
786817560 committed
198
      carNum: '0',
linxin's avatar
linxin committed
199
      faceSign: '0',
linxin's avatar
linxin committed
200
      prjSubmit: '0',
李晓兵's avatar
李晓兵 committed
201 202
      confirmCount: '0',
      productCount: '0',
linxin's avatar
linxin committed
203
      carCount: '0',
李晓兵's avatar
李晓兵 committed
204
      description: '',
linxin's avatar
linxin committed
205
      bp_identity: '',
linxin's avatar
linxin committed
206
      bp_type_n: '',
李晓兵's avatar
李晓兵 committed
207
      approveBtn: false,
linxin's avatar
linxin committed
208
      elecStatus: false,
李晓兵's avatar
李晓兵 committed
209
      roleSwitchFlag: false, // 选择角色模态框显示标志
linxin's avatar
linxin committed
210
      multiRoleList: [], // 查到的多角色
linxin's avatar
linxin committed
211 212 213
      type: [
        {
          bp_type: '0',
linxin's avatar
linxin committed
214
          bp_type_n: '修改信息',
linxin's avatar
linxin committed
215 216 217
        },
        {
          bp_type: '1',
linxin's avatar
linxin committed
218
          bp_type_n: '重新选择用户类型',
linxin's avatar
linxin committed
219 220
        },
      ],
linxin's avatar
linxin committed
221 222
    }
  },
linxin's avatar
linxin committed
223 224 225 226 227 228
  computed: {
    'roleList' () {
      let obj = {
        bp_type: this.user_bp_type,
        bp_type_n: this.bp_type_n,
      }
linxin's avatar
linxin committed
229 230 231 232
      let arr = []
      if (this.multiRoleList.length > 0) {
        arr = [...this.multiRoleList]
      }
linxin's avatar
linxin committed
233 234 235 236
      arr.push(obj)
      return arr
    },
  },
linxin's avatar
linxin committed
237
  watch: {
linxin's avatar
linxin committed
238
    user_bp_type (newVal, oldVal) {
linxin's avatar
linxin committed
239 240 241 242 243 244
      if (newVal === 'AGENT') {
        this.isAGENT = true
      } else {
        this.isAGENT = false
      }
    },
linxin's avatar
linxin committed
245
    bp_identity (newVal, oldVal) {
linxin's avatar
linxin committed
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
      switch (newVal) {
        case 'NP_NO': {
          this.elecStatusDesceibe = '个人待认证'
          this.elecStatus = false
          break
        }
        case 'NP_YES': {
          this.elecStatusDesceibe = '个人认证通过'
          this.elecStatus = true
          break
        }
        case 'ORG_NO': {
          this.elecStatusDesceibe = '企业待认证'
          this.elecStatus = false
          break
        }
        case 'ORG_YES': {
          this.elecStatusDesceibe = '企业认证通过'
          this.elecStatus = true
          break
        }
        case 'ORG_L_NO': {
          this.elecStatusDesceibe = '法人待认证'
          this.elecStatus = false
          break
        }
        case 'ORG_L_YES': {
          this.elecStatusDesceibe = '法人认证通过'
          this.elecStatus = true
          break
        }
        case 'ORG_AUTH_NO': {
          this.elecStatusDesceibe = '授权人待认证'
          this.elecStatus = false
          break
        }
        case 'ORG_AUTH_YES': {
          this.elecStatusDesceibe = '授权人认证通过'
          this.elecStatus = true
          break
        }
        default: {
          this.elecStatusDesceibe = '用户未绑定'
          this.elecStatus = false
          break
        }
linxin's avatar
linxin committed
292 293
      }
    },
linxin's avatar
linxin committed
294
  },
linxin's avatar
linxin committed
295
  created () {},
linxin's avatar
linxin committed
296 297
  beforeRouteEnter (to, from, next) {
    next(vm => {
linxin's avatar
linxin committed
298 299 300 301 302 303 304
      vm.signCount = '0'
      vm.carNum = '0'
      vm.faceSign = '0'
      vm.prjSubmit = '0'
      vm.confirmCount = '0'
      vm.productCount = '0'
      vm.carCount = '0'
linxin's avatar
linxin committed
305
      vm.multiRoleList = []
linxin's avatar
linxin committed
306
      vm.multipleRole = window.localStorage.getItem('multipleRole')
linxin's avatar
linxin committed
307
      vm.userQuery()
李晓兵's avatar
李晓兵 committed
308
      vm.numQuery()
linxin's avatar
linxin committed
309
    })
linxin's avatar
linxin committed
310
    next()
李晓兵's avatar
李晓兵 committed
311
  },
linxin's avatar
linxin committed
312
  activated () {},
李晓兵's avatar
李晓兵 committed
313
  methods: {
786817560's avatar
786817560 committed
314
    openTest () {
linxin's avatar
linxin committed
315
      // cordova.InAppBrowser.open('http://www.baidu.com', '_blank', 'location=yes')
李晓兵's avatar
李晓兵 committed
316 317 318 319
      var date = '2019.11.23'
      var times = this.dateFormat(date)
      console.log(times)
    },
linxin's avatar
linxin committed
320 321 322
    dateFormat (str) {
      // return `${str.substring(0,4)}-${str.substring(4,6)}-${str.substring(6)}`
      return str.replace(/\./g, '-')
李晓兵's avatar
李晓兵 committed
323
    },
324 325 326 327 328 329 330
    // 查询头像
    getHead () {
      let vm = this
      let url = process.env.basePath + 'app_attment_query'
      let param = {
        master: {
          source_type: 'HLS_APP_USER',
linxin's avatar
linxin committed
331
          pkvalue: vm.app_user_id,
332 333 334 335 336 337 338 339 340 341 342 343
        },
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          if (res.info) {
            vm.upLoadObj = process.env.filePath +
              'attachment_id=' +
              res.info.attachment_id +
              '&access_token=' +
              window.localStorage.access_token
linxin's avatar
linxin committed
344 345
          } else {
            vm.upLoadObj = defaultImg
346 347 348 349 350 351
          }
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
李晓兵's avatar
李晓兵 committed
352 353 354
    // 选择角色后确定
    roleConfirm (role) {
      this.roleSwitchFlag = false
linxin's avatar
linxin committed
355 356 357 358 359 360
      if (role.bp_type === 'TENANT') {
        window.localStorage.setItem('multipleRole', 'TENANT')
        this.multipleRole = 'TENANT'
      } else if (role.bp_type === 'GUTA') {
        window.localStorage.setItem('multipleRole', 'GUTA')
        this.multipleRole = 'GUTA'
linxin's avatar
linxin committed
361 362 363
      } else if (role.bp_type === 'AGENT') {
        window.localStorage.setItem('multipleRole', 'AGENT')
        this.multipleRole = 'AGENT'
linxin's avatar
linxin committed
364
      }
李晓兵's avatar
李晓兵 committed
365 366
      console.log('选择后的角色为:' + role)
    },
linxin's avatar
linxin committed
367 368 369 370 371 372 373 374
    typeConfirm (e) { // 选择操作方式后
      this.popSetectBox = false
      if (e.bp_type === '0') {
        this.changePageHead()
      } else if (e.bp_type === '1') {
        this.unBindSelext()
      }
    },
李晓兵's avatar
李晓兵 committed
375 376 377 378
    // 选择角色后取消
    roleCancle () {
      this.roleSwitchFlag = false
    },
linxin's avatar
linxin committed
379 380 381
    typeCancle () {
      this.popSetectBox = false
    },
李晓兵's avatar
李晓兵 committed
382
    // 监听用户状态
linxin's avatar
linxin committed
383
    watchBpStatus () {
李晓兵's avatar
李晓兵 committed
384 385
      if (!this.bp_id && this.user_bp_status === 'NEW') {
        this.description = '用户绑定'
linxin's avatar
linxin committed
386
        this.approveBtn = false
linxin's avatar
linxin committed
387
        this.popSetect = false
李晓兵's avatar
李晓兵 committed
388 389
      } else if (this.bp_id && this.user_bp_status === 'NEW') {
        this.description = '待提交'
李晓兵's avatar
李晓兵 committed
390
        this.approveBtn = false
linxin's avatar
linxin committed
391
        this.popSetect = true// 是否弹出选择框
李晓兵's avatar
李晓兵 committed
392 393 394
      } else if (this.bp_id && this.user_bp_status === 'APPROVED') {
        this.description = '解除绑定'
        this.approveBtn = true
linxin's avatar
linxin committed
395
        this.popSetect = false
linxin's avatar
linxin committed
396 397 398 399
      } else if (
        (this.bp_id && this.user_bp_status === 'RETURN') ||
        (this.bp_id && this.user_bp_status === 'REJECT')
      ) {
李晓兵's avatar
李晓兵 committed
400
        this.description = '审核未通过'
李晓兵's avatar
李晓兵 committed
401
        this.approveBtn = false
linxin's avatar
linxin committed
402
        this.popSetect = true// 是否弹出选择框
李晓兵's avatar
李晓兵 committed
403 404
      } else {
        this.description = '审批中'
李晓兵's avatar
李晓兵 committed
405
        this.approveBtn = false
linxin's avatar
linxin committed
406
        this.popSetect = false
李晓兵's avatar
李晓兵 committed
407 408
      }
    },
李晓兵's avatar
李晓兵 committed
409 410 411 412 413 414
    // 我的发票
    goInvoice () {
      this.$router.push({
        name: 'MyInvoice',
      })
    },
786817560's avatar
786817560 committed
415 416 417 418
    // 合同创建
    goCreate () {
      this.$router.push({
        name: 'ContractCreateList',
786817560's avatar
786817560 committed
419 420 421
        params: {
          user_bp_type: this.user_bp_type,
        },
786817560's avatar
786817560 committed
422 423
      })
    },
李晓兵's avatar
李晓兵 committed
424 425
    // 进入待签约功能,客户类型为经销商则进入经销商功能,非经销商则进入合同签约
    goSign () {
李晓兵's avatar
李晓兵 committed
426 427 428 429 430 431 432 433
      if (this.bp_id) {
        if (this.user_bp_type === 'AGENT') {
          this.$router.push({
            name: 'ContractList',
          })
        } else {
          this.$router.push({
            name: 'ContractSigning',
786817560's avatar
786817560 committed
434
            params: {
linxin's avatar
linxin committed
435 436
              user_bp_type: this.user_bp_type,
            },
李晓兵's avatar
李晓兵 committed
437 438
          })
        }
李晓兵's avatar
李晓兵 committed
439
      } else {
李晓兵's avatar
李晓兵 committed
440
        hlsPopup.showLongCenter('请先进行用户绑定')
李晓兵's avatar
李晓兵 committed
441 442 443 444
      }
    },
    // 进入待确认,(进件确认)
    goConfirm () {
李晓兵's avatar
李晓兵 committed
445
      this.$router.push({
linxin's avatar
linxin committed
446
        name: 'IntoList',
李晓兵's avatar
李晓兵 committed
447
      })
linxin's avatar
linxin committed
448 449 450
      // this.$router.push({
      //   name: 'IframTest',
      // })
李晓兵's avatar
李晓兵 committed
451 452 453
    },
    // 进入我的还款
    goReimburse () {
李晓兵's avatar
李晓兵 committed
454 455 456 457 458 459 460
      if (this.bp_id) {
        this.$router.push({
          name: 'ReimburseMyselfList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
李晓兵's avatar
李晓兵 committed
461
    },
李晓兵's avatar
李晓兵 committed
462 463 464 465 466 467
    // 进入我的收藏
    goMyProduct () {
      this.$router.push({
        name: 'MyProductList',
      })
    },
linxin's avatar
linxin committed
468 469 470 471 472 473 474 475 476
    // 进入
    changeContract (e) {
      this.$router.push({
        name: 'ContractRecords',
        params: {
          bp_type: e,
        },
      })
    },
477 478
    // 进入发车申请
    goStart () {
李晓兵's avatar
李晓兵 committed
479 480 481 482 483 484 485
      if (this.bp_id) {
        this.$router.push({
          name: 'StartList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
486
    },
487 488
    // 进入发车确认
    goCarConfirm () {
李晓兵's avatar
李晓兵 committed
489 490 491 492 493 494 495
      if (this.bp_id) {
        this.$router.push({
          name: 'ConfirmList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
496
    },
linxin's avatar
linxin committed
497
    goVideoSign () {
李晓兵's avatar
李晓兵 committed
498 499 500 501 502 503 504
      if (this.bp_id) {
        this.$router.push({
          name: 'VideoSign',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
505
    },
linxin's avatar
linxin committed
506 507 508 509 510
    changeHelp () {
      this.$router.push({
        name: 'HelpList',
      })
    },
linxin's avatar
linxin committed
511
    changeDrawbackList () {
李晓兵's avatar
李晓兵 committed
512 513 514 515 516 517 518
      if (this.bp_id) {
        this.$router.push({
          name: 'DrawbackList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
519
    },
linxin's avatar
linxin committed
520
    changePay () {
linxin's avatar
linxin committed
521
      if (window.localStorage.getItem('bp_id') !== 'undefined') {
linxin's avatar
linxin committed
522 523 524 525 526 527
        this.$router.push({
          name: 'FirstPay',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
528 529
    },
    changeRent () {
linxin's avatar
linxin committed
530
      if (window.localStorage.getItem('bp_id') !== 'undefined') {
linxin's avatar
linxin committed
531 532 533 534
        this.$router.push({
          name: 'NewList',
        })
      } else {
linxin's avatar
linxin committed
535 536 537 538 539 540 541 542 543
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
    },
    changeCash () {
      if (window.localStorage.getItem('bp_id') !== 'undefined') {
        this.$router.push({
          name: 'MarginFirstPay',
        })
      } else {
linxin's avatar
linxin committed
544 545
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
546
    },
李晓兵's avatar
李晓兵 committed
547 548
    updateVersion () {
      if (vum.Platform.isAndroid()) {
linxin's avatar
linxin committed
549 550
        this.hote_update_version(
          '发现新版本是否更新',
李晓兵's avatar
李晓兵 committed
551
          'http://hlsapp.hand-china.com/file/XCMG/www_myself/dev/android/www.zip'
linxin's avatar
linxin committed
552
        )
李晓兵's avatar
李晓兵 committed
553
      } else {
linxin's avatar
linxin committed
554 555
        this.hote_update_version(
          '发现新版本是否更新',
李晓兵's avatar
李晓兵 committed
556
          'http://hlsapp.hand-china.com/file/XCMG/www_myself/dev/ios/www.zip'
linxin's avatar
linxin committed
557
        )
李晓兵's avatar
李晓兵 committed
558 559 560 561 562 563 564 565 566 567 568 569 570
      }
    },
    hote_update_version (content, url) {
      hlsPopup.showConfirm({
        title: '版本更新',
        content: content,
        onConfirm: function (index) {
          if (index === 1) {
            hotpatch.updateNewVersion(url)
          }
        },
      })
    },
李晓兵's avatar
李晓兵 committed
571 572 573 574 575 576 577
    logOut () {
      let vm = this
      hlsPopup.showConfirm({
        title: '提示',
        content: '确定退出',
        onConfirm: function (index) {
          if (index === 1) {
李晓兵's avatar
李晓兵 committed
578 579
            let width = window.localStorage.getItem('width')
            let height = window.localStorage.getItem('height')
linxin's avatar
linxin committed
580 581 582 583 584 585 586 587
            if (window.localStorage.isReadPolicy === 'false') {
              window.localStorage.clear()
            } else if (window.localStorage.isReadPolicy === 'true') {
              window.localStorage.clear()
              window.localStorage.setItem('isReadPolicy', true)
            } else {
              window.localStorage.clear()
            }
李晓兵's avatar
李晓兵 committed
588 589
            window.localStorage.setItem('width', width)
            window.localStorage.setItem('height', height)
李晓兵's avatar
李晓兵 committed
590
            vm.$router.push('/login')
linxin's avatar
linxin committed
591
            // location.reload()
李晓兵's avatar
李晓兵 committed
592 593 594 595
          }
        },
      })
    },
linxin's avatar
linxin committed
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
    unBindSelext () {
      let vm = this
      vm.popSetectBox = true
      hlsPopup.showConfirm({
        title: '提示',
        content: '确定解除绑定?',
        onConfirm: function (index) {
          if (index === 1) {
            let myPhone = window.localStorage.getItem('user_phone')
            let myPassword = window.localStorage.getItem('password')
            let url = process.env.basePath + 'bp_unbind'
            let param = {
              master: {
                phone: myPhone,
                password: myPassword,
              },
            }
            vm.hlsPopup.showLoading('请稍候')
            vm.hlsHttp
              .post(url, param)
              .then(function (res) {
                vm.hlsPopup.hideLoading()
                if (res.result === 'S') {
                  vm.hlsPopup.showLongCenter('解绑成功')
                  vm.userQuery()
                  vm.approveBtn = false
linxin's avatar
linxin committed
622
                  vm.$router.push({
linxin's avatar
linxin committed
623 624 625 626 627 628 629 630 631 632
                    name: 'UserBind',
                  })
                } else {
                  vm.hlsPopup.showLongCenter(res.message)
                }
              })
          }
        },
      })
    },
linxin's avatar
linxin committed
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656
    unBind () {
      let vm = this
      hlsPopup.showConfirm({
        title: '提示',
        content: '确定解除绑定?',
        onConfirm: function (index) {
          if (index === 1) {
            // window.localStorage.clear()
            // vm.$router.push('/login')
            let myPhone = window.localStorage.getItem('user_phone')
            let myPassword = window.localStorage.getItem('password')
            let url = process.env.basePath + 'bp_unbind'
            let param = {
              master: {
                phone: myPhone,
                password: myPassword,
              },
            }
            vm.hlsPopup.showLoading('请稍候')
            vm.hlsHttp
              .post(url, param)
              .then(function (res) {
                vm.hlsPopup.hideLoading()
                if (res.result === 'S') {
linxin's avatar
linxin committed
657 658
                  vm.hlsPopup.showLongCenter('解绑成功')
                  vm.userQuery()
linxin's avatar
linxin committed
659
                  // vm.flag = true
李晓兵's avatar
李晓兵 committed
660
                  vm.approveBtn = false
linxin's avatar
linxin committed
661 662
                } else {
                  vm.hlsPopup.showLongCenter(res.message)
linxin's avatar
linxin committed
663 664 665 666 667 668
                }
              })
          }
        },
      })
    },
linxin's avatar
linxin committed
669
    checkType () {
670
      let vm = this
linxin's avatar
linxin committed
671
      this.hlsPopup.showActionSheet({
linxin's avatar
linxin committed
672 673 674 675 676
        buttonArray:
          this.bp_id === undefined
            ? ['修改头像']
            : ['修改头像', '用户信息', '角色切换'],
        callback: index => {
linxin's avatar
linxin committed
677
          if (index === 0) {
linxin's avatar
linxin committed
678
            this.imgUploadShow(vm.app_user_id)
linxin's avatar
linxin committed
679 680 681
          } else if (index === 1) {
            this.changePageHead()
          } else if (index === 2) {
linxin's avatar
linxin committed
682 683
            if (((vm.user_bp_type === 'TENANT') || (vm.user_bp_type === 'GUTA') || (vm.user_bp_type === 'AGENT')) && (vm.user_bp_status === 'APPROVED')) {
              vm.$refs.roleSwitchRoleList.show()
linxin's avatar
linxin committed
684 685 686
            } else {
              hlsPopup.showLongCenter('您当前尚无可用角色')
            }
linxin's avatar
linxin committed
687 688 689 690
          }
        },
      })
    },
linxin's avatar
linxin committed
691 692 693
    getMultipleRole () {
      let vm = this
      let url = process.env.basePath + 'bp_role_query'
Jennie Shi's avatar
Jennie Shi committed
694 695 696 697 698 699 700 701
      let bpId = window.localStorage.getItem('bp_id')
      let bpType = window.localStorage.getItem('bp_type')
      if (bpId === 'undefined') {
        bpId = null
      }
      if (bpType === 'undefined') {
        bpType = null
      }
linxin's avatar
linxin committed
702 703
      let param = {
        master: {
Jennie Shi's avatar
Jennie Shi committed
704 705
          bp_id: bpId,
          bp_type: bpType,
linxin's avatar
linxin committed
706 707 708 709 710 711 712 713
        },
      }
      vm.hlsHttp.post(url, param).then(function (res) {
        if (res.result === 'S') {
          vm.multiRoleList = res.lists
        }
      })
    },
linxin's avatar
linxin committed
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
    // 图片上传入口
    imgUploadShow (check_id) {
      let vm = this
      // vm.upload_list = []
      hlsPopup.showActionSheet({
        titleText: '请选择照片',
        buttonArray: ['拍照', '从相册取'],
        callback: index => {
          if (index === 0) {
            vm.imgUploadOpenCamera(check_id)
          } else {
            vm.imgUploadTakePicture(check_id)
          }
        },
      })
    },
    imgUploadOpenCamera (check_id) {
      let vm = this
      let obj = {
        pkvalue: check_id,
734
        source_type: 'HLS_APP_USER',
linxin's avatar
linxin committed
735 736 737 738 739 740 741 742 743 744 745 746 747
        picture: '',
        check_id: check_id,
        filePath: '',
        attachment_id: '',
        user_id: 1,
        fileName: '',
      }
      let cameraoptions = {
        quality: 100,
      }
      let success = function (imgdata) {
        obj.picture = imgdata
        obj.filePath = imgdata
748
        vm.upLoadObj = obj.picture
linxin's avatar
linxin committed
749 750 751 752 753 754 755 756 757
        vm.save_picture(obj)
      }
      let error = function () {
        hlsPopup.showLongCenter('请拍照')
      }
      hlsUtil.openCamera(cameraoptions, success, error)
    },
    imgUploadTakePicture (check_id) {
      let vm = this
linxin's avatar
linxin committed
758 759 760 761 762 763 764 765 766 767
      let obj = {
        pkvalue: check_id,
        source_type: 'HLS_APP_USER',
        picture: '',
        check_id: check_id,
        filePath: '',
        attachment_id: '',
        user_id: 1,
        fileName: '',
      }
linxin's avatar
linxin committed
768 769 770 771
      let cameraoptions = {
        quality: 100,
      }
      let success = function (imgUrl) {
linxin's avatar
linxin committed
772 773
        obj.picture = imgUrl[0]
        obj.filePath = imgUrl[0]
774
        vm.upLoadObj = obj.picture
linxin's avatar
linxin committed
775 776 777
        // 拍完一张立马执行保存图片逻辑
        vm.save_picture(obj)
      }
linxin's avatar
linxin committed
778 779 780
      let error = function () {
        hlsPopup.showLongCenter('请选择图片')
      }
linxin's avatar
linxin committed
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819
      vm.hlsUtil.takePicture(cameraoptions, success, error)
    },
    openCamera (ocrType, type) {
      let vm = this
      let cameraoptions = {
        quality: 60,
        width: 1843,
        height: 1382,
      }
      let success = function (imgdata) {
        if (!imgdata) {
          hlsPopup.showLongCenter('请拍照')
        }
      }
      let error = function () {
        hlsPopup.showLongCenter('请拍照')
      }
      hlsUtil.openCamera(cameraoptions, success, error)
    },
    takePicture (ocrType, type) {
      let vm = this
      var cameraoptions = {
        quality: 70,
        width: 1843,
        height: 1382,
        maxCount: 1,
      }
      let success = function (imgUrl) {
        if (imgUrl.length === 0) {
          hlsPopup.showLongCenter('请选择一张图片')
        }
      }
      let error = function () {
        hlsPopup.showLongCenter(error)
      }
      vm.hlsUtil.takePicture(cameraoptions, success, error)
    },
    save_picture (obj) {
      if (obj) {
820 821 822 823
        let success = function () {
          hlsPopup.showLongCenter('头像上传成功')
        }
        hlsUtil.fileUploadSvc(obj, success)
linxin's avatar
linxin committed
824 825 826 827
      } else {
        hlsPopup.hideLoading()
      }
    },
linxin's avatar
linxin committed
828 829 830
    changePageHead () {
      let vm = this
      if (vm.bp_id) {
linxin's avatar
linxin committed
831 832 833 834
        if (
          vm.user_bp_status === 'NEW' ||
          vm.user_bp_status === 'RETURN'
        ) {
linxin's avatar
linxin committed
835
          vm.flag = true
linxin's avatar
linxin committed
836 837
          if (vm.user_bp_class === 'NP') {
            vm.$router.push({
linxin's avatar
linxin committed
838
              name: 'NPBaseInfo',
linxin's avatar
linxin committed
839
              params: {
linxin's avatar
linxin committed
840
                bp_id: this.bp_id,
linxin's avatar
linxin committed
841
                user_bp_name: this.user_bp_name,
linxin's avatar
linxin committed
842 843 844 845
              },
            })
          } else {
            this.$router.push({
786817560's avatar
786817560 committed
846
              name: 'EnterpriseNew',
linxin's avatar
linxin committed
847
              params: {
linxin's avatar
linxin committed
848
                bp_id: this.bp_id,
linxin's avatar
linxin committed
849
                user_bp_name: this.user_bp_name,
786817560's avatar
786817560 committed
850
                bp_class: vm.user_bp_class,
linxin's avatar
linxin committed
851 852 853 854
              },
            })
          }
        } else if (vm.user_bp_status === 'APPROVED') {
linxin's avatar
linxin committed
855
          vm.flag = false
linxin's avatar
linxin committed
856 857
          if (vm.user_bp_class === 'NP') {
            vm.$router.push({
linxin's avatar
linxin committed
858
              name: 'NPBaseInfo',
linxin's avatar
linxin committed
859
              params: {
linxin's avatar
linxin committed
860
                bp_id: this.bp_id,
linxin's avatar
linxin committed
861
                user_bp_name: this.user_bp_name,
linxin's avatar
linxin committed
862
                isAGENT: this.isAGENT,
linxin's avatar
linxin committed
863
                status: 'APPROVED',
linxin's avatar
linxin committed
864
                isMultiRole: this.isMultiRole,
linxin's avatar
linxin committed
865 866 867 868
              },
            })
          } else {
            this.$router.push({
786817560's avatar
786817560 committed
869
              name: 'EnterpriseNew',
linxin's avatar
linxin committed
870
              params: {
linxin's avatar
linxin committed
871
                bp_id: this.bp_id,
linxin's avatar
linxin committed
872
                user_bp_name: this.user_bp_name,
linxin's avatar
linxin committed
873
                isAGENT: this.isAGENT,
linxin's avatar
linxin committed
874
                status: 'APPROVED',
linxin's avatar
linxin committed
875
                isMultiRole: this.isMultiRole,
786817560's avatar
786817560 committed
876
                bp_class: vm.user_bp_class,
linxin's avatar
linxin committed
877 878 879
              },
            })
          }
linxin's avatar
linxin committed
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905
        } else if (
          vm.user_bp_status === 'REJECT'
        ) {
          vm.flag = true
          if (vm.user_bp_class === 'NP') {
            vm.$router.push({
              name: 'NPBaseInfo',
              params: {
                bp_id: this.bp_id,
                isMultiRole: this.isMultiRole,
                user_bp_name: this.user_bp_name,
                status: 'APPROVED',
              },
            })
          } else {
            this.$router.push({
              name: 'EnterpriseNew',
              params: {
                bp_id: this.bp_id,
                isMultiRole: this.isMultiRole,
                user_bp_name: this.user_bp_name,
                bp_class: vm.user_bp_class,
                status: 'APPROVED',
              },
            })
          }
linxin's avatar
linxin committed
906
        } else if (vm.user_bp_status === 'APPROVING') {
linxin's avatar
linxin committed
907
          vm.flag = true
linxin's avatar
linxin committed
908 909 910
          this.hlsPopup.showLongCenter('您的绑定申请还在流程中')
        }
      } else {
linxin's avatar
linxin committed
911
        vm.flag = true
linxin's avatar
linxin committed
912 913 914
        this.$router.push({
          name: 'UserBind',
        })
linxin's avatar
linxin committed
915 916 917 918 919 920
      }
    },
    userQuery () {
      let vm = this
      let url = $config.basePath + 'user_query'
      let param = {
linxin's avatar
linxin committed
921
        phone: window.localStorage.getItem('user_phone'),
linxin's avatar
linxin committed
922
      }
linxin's avatar
linxin committed
923
      vm.hlsPopup.showLoading('请稍候')
linxin's avatar
linxin committed
924 925
      vm.$post(url, param).then(function (res) {
        if (res.result === 'S') {
linxin's avatar
linxin committed
926 927 928
          if (res.info.user_bp_status === 'APPROVED') {
            vm.flag = false
          }
linxin's avatar
linxin committed
929 930 931
          vm.user_bp_status = res.info.user_bp_status
          vm.user_bp_class = res.info.user_bp_class
          vm.bp_id = res.info.user_bp_id
linxin's avatar
linxin committed
932
          vm.bp_identity = res.info.bp_identity
linxin's avatar
linxin committed
933
          vm.app_user_id = res.info.app_user_id
Jennie Shi's avatar
Jennie Shi committed
934
          window.localStorage.removeItem('bp_id')
linxin's avatar
linxin committed
935
          window.localStorage.setItem('bp_id', res.info.user_bp_id)
linxin's avatar
linxin committed
936
          window.localStorage.setItem('user_bp_status', res.info.user_bp_status)
linxin's avatar
linxin committed
937
          window.localStorage.setItem('bp_name', res.info.user_bp_name)
786817560's avatar
786817560 committed
938
          window.localStorage.setItem('bp_identity', res.info.bp_identity)
linxin's avatar
linxin committed
939
          window.localStorage.setItem('bp_class', res.info.user_bp_class)
linxin's avatar
linxin committed
940
          window.localStorage.setItem('bp_type', res.info.user_bp_type)
linxin's avatar
linxin committed
941
          vm.user_bp_name = res.info.user_bp_name
linxin's avatar
linxin committed
942
          vm.user_bp_type = res.info.user_bp_type
linxin's avatar
linxin committed
943
          vm.user_phone = res.info.user_phone
linxin's avatar
linxin committed
944
          vm.bp_type_n = res.info.user_bp_type_n
李晓兵's avatar
李晓兵 committed
945
          vm.watchBpStatus()
946
          vm.getHead()
linxin's avatar
linxin committed
947
          vm.getMultipleRole()
linxin's avatar
linxin committed
948 949 950 951 952
          if (vm.user_bp_type === 'AGENT') {
            vm.isAGENT = true
          } else {
            vm.isAGENT = false
          }
linxin's avatar
linxin committed
953
          if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT' || vm.user_bp_type === 'AGENT') {
linxin's avatar
linxin committed
954 955 956 957
            vm.isMultiRole = true
          } else {
            vm.isMultiRole = false
          }
linxin's avatar
linxin committed
958 959
        } else {
          this.hlsPopup.showLongCenter(res.message)
李晓兵's avatar
李晓兵 committed
960 961 962 963 964 965 966
        }
      })
    },
    numQuery () {
      let vm = this
      let url = $config.basePath + 'number_display_query'
      let param = {
李晓兵's avatar
李晓兵 committed
967
        user_phone: window.localStorage.getItem('user_phone'),
李晓兵's avatar
李晓兵 committed
968 969 970
      }
      vm.$post(url, param).then(function (res) {
        if (res.result === 'S') {
971
          if ('info' in res) {
李晓兵's avatar
李晓兵 committed
972
            vm.signCount = res.info.con_confirm_num || 0
786817560's avatar
786817560 committed
973
            // vm.confirmCount = res.info.con_confirm_num
李晓兵's avatar
李晓兵 committed
974 975
            vm.productCount = res.info.collect_num || 0
            vm.carCount = res.info.car_confirm_num || 0
linxin's avatar
linxin committed
976
            vm.faceSign	= res.info.face_sign_num	 || 0
linxin's avatar
linxin committed
977
            vm.prjSubmit = res.info.prj_submit_num || 0
李晓兵's avatar
李晓兵 committed
978 979 980
          }
        } else {
          this.hlsPopup.showLongCenter(res.message)
linxin's avatar
linxin committed
981 982 983
        }
      })
    },
李晓兵's avatar
李晓兵 committed
984 985 986
    // 认证入口
    async certification () {
      let vm = this
李晓兵's avatar
李晓兵 committed
987
      if (vm.bp_id) {
linxin's avatar
linxin committed
988 989
        if (
          vm.bp_identity === 'NP_NO' ||
linxin's avatar
linxin committed
990
          vm.bp_identity === 'ORG_L_NO'
linxin's avatar
linxin committed
991
        ) {
李晓兵's avatar
李晓兵 committed
992 993
          let authUrl = await vm.getNpCertificationUrl()
          if (authUrl) {
linxin's avatar
linxin committed
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007
            const u = navigator.userAgent
            const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
            if (isiOS) {
              cordova.InAppBrowser.open(authUrl, '_blank', 'location=yes')
              console.log('ios')
            } else {
              vm.$router.push({
                name: 'Certification',
                params: {
                  authUrl: authUrl,
                },
              })
              console.log('android')
            }
李晓兵's avatar
李晓兵 committed
1008
          } else {
1009
            // hlsPopup.showLongCenter('获取认证url失败')
李晓兵's avatar
李晓兵 committed
1010
          }
linxin's avatar
linxin committed
1011 1012
        } else if (vm.bp_identity === 'ORG_NO' ||
          vm.bp_identity === 'ORG_AUTH_NO') {
linxin's avatar
linxin committed
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024
          // let authUrl = await vm.getOrgCertificationUrl()
          // if (authUrl) {
          //   vm.$router.push({
          //     name: 'Certification',
          //     params: {
          //       authUrl: authUrl,
          //     },
          //   })
          // } else {
          //   // hlsPopup.showLongCenter('获取认证url失败')
          // }
          hlsPopup.showLongCenter('请联系对应业务人员为企业进行认证')
李晓兵's avatar
李晓兵 committed
1025
        } else {
李晓兵's avatar
李晓兵 committed
1026
          hlsPopup.showLongCenter('您已认证通过')
李晓兵's avatar
李晓兵 committed
1027 1028
        }
      } else {
李晓兵's avatar
李晓兵 committed
1029
        hlsPopup.showLongCenter('请先进行用户绑定')
李晓兵's avatar
李晓兵 committed
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041
      }
    },
    // 获取个人认证url
    async getNpCertificationUrl () {
      let vm = this
      let url = $config.basePath + 'auth_user_sign'
      let param = {
        phone: vm.user_phone,
      }
      hlsPopup.showLoading('请稍候')
      let res = await vm.$post(url, param)
      hlsPopup.hideLoading()
linxin's avatar
linxin committed
1042 1043 1044 1045 1046 1047
      if ((res.info.code === 0) && (res.info.data.authUrl)) {
        vm.authUrl = res.info.data.authUrl
        return vm.authUrl
      } else if ((res.info.code === 0) && (res.info.data.openId)) {
        vm.authUrl = res.info.data.openId
        return vm.authUrl
李晓兵's avatar
李晓兵 committed
1048
      } else {
linxin's avatar
linxin committed
1049 1050
        hlsPopup.showError(res.info.msg)
        return ''
李晓兵's avatar
李晓兵 committed
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062
      }
    },
    // 获取企业认证url
    async getOrgCertificationUrl () {
      let vm = this
      let url = $config.basePath + 'auth_company_sign'
      let param = {
        phone: vm.user_phone,
      }
      hlsPopup.showLoading('请稍候')
      let res = await vm.$post(url, param)
      hlsPopup.hideLoading()
linxin's avatar
linxin committed
1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
      // if (res.info.code === 0) {
      //   return res.info.data.authUrl
      // } else {
      //   hlsPopup.showLongCenter(res.info.msg)
      //   return null
      // }
      if ((res.info.code === 0) && (res.info.data.authUrl)) {
        vm.authUrl = res.info.data.authUrl
        return vm.authUrl
      } else if ((res.info.code === 0) && (res.info.data.openId)) {
        vm.authUrl = res.info.data.openId
        return vm.authUrl
李晓兵's avatar
李晓兵 committed
1075
      } else {
linxin's avatar
linxin committed
1076 1077
        hlsPopup.showError(res.info.msg)
        return ''
李晓兵's avatar
李晓兵 committed
1078 1079
      }
    },
JingChao's avatar
JingChao committed
1080 1081 1082 1083 1084
    goAbout () {
      this.$router.push({
        name: 'About',
      })
    },
李晓兵's avatar
李晓兵 committed
1085 1086 1087 1088
  },
}
</script>

linxin's avatar
linxin committed
1089
<style lang="less" scoped>
linxin's avatar
linxin committed
1090
#my-info {
李晓兵's avatar
李晓兵 committed
1091
 /* .content-wrap{
linxin's avatar
linxin committed
1092 1093 1094 1095
    margin-left:40px;
  }
  .content-wrap:not(:nth-of-type(1)){
    margin-left:70px;
李晓兵's avatar
李晓兵 committed
1096
  }*/
linxin's avatar
linxin committed
1097 1098 1099 1100 1101 1102 1103 1104
  .card-top {
    width: 330px;
    margin: 0 auto;
    height: 110px;
    display: flex;
    align-items: center;
    .sign {
      margin-left: 24px;
linxin's avatar
linxin committed
1105
      height: 55px;
linxin's avatar
linxin committed
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
      span {
        font-family: PingFangSC-Semibold;
        font-size: 18px;
        color: #fff;
        margin-top: 10px;
      }
      div {
        display: flex;
        align-items: center;
        margin-top: 20px;
        font-family: PingFangSC-Regular;
        font-size: 12px;
        color: #ffffff;
        letter-spacing: 0;
        p {
          display: flex;
          align-items: center;
          justify-content: center;
linxin's avatar
linxin committed
1124
          padding: 0 5px;
linxin's avatar
linxin committed
1125 1126 1127 1128 1129 1130 1131 1132 1133
          height: 20px;
          margin-left: 10px;
          border: 1px solid #fff;
          border-radius: 4px;
          font-family: PingFangSC-Regular;
          font-size: 12px;
          color: #ffffff;
          letter-spacing: 0;
        }
linxin's avatar
linxin committed
1134 1135
        .across {
          background-color: #1d3fff;
linxin's avatar
linxin committed
1136
        }
linxin's avatar
linxin committed
1137
        .un-across {
linxin's avatar
linxin committed
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148
          background: #0523ce;
        }
      }
    }
    img {
      width: 59px;
      height: 59px;
      border-radius: 50%;
      border: 1px solid #00469c;
    }
  }
linxin's avatar
linxin committed
1149 1150 1151 1152 1153 1154
  .has{
    height:206px;
  }
.antiHas{
  height:3.12rem;
}
linxin's avatar
linxin committed
1155 1156
  .top {
    width: 100%;
linxin's avatar
linxin committed
1157
    // height: 206px;
linxin's avatar
linxin committed
1158
    background: url("../../assets/myInfo/back.png") no-repeat;
linxin's avatar
linxin committed
1159
    background-size: 100% 156px;
linxin's avatar
linxin committed
1160
    background-color: #efefef;
linxin's avatar
linxin committed
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170
    .header {
      background-color: rgba(0, 0, 0, 0);
      .top-word {
        font-family: PingFangSC-Semibold;
        font-size: 17px;
        letter-spacing: 0.61px;
        color: #fff;
      }
    }
    .card {
linxin's avatar
linxin committed
1171 1172
      width: 359px;
      height: 108px;
linxin's avatar
linxin committed
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
      margin: 0 auto;
      z-index: 10;
      position: relative;
      top: 0px;
      left: 0px;
      background-color: #fff;
      border-radius: 4px;
      .card-info {
        width: 295px;
        margin: 0 auto;
        .card-bottom {
          height: 100px;
          width: 285px;
          margin: 0 auto;
          display: flex;
1188
          justify-content: flex-start;
linxin's avatar
linxin committed
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200
          align-items: center;
          text-align: center;
          p {
            font-family: PingFangSC-Regular;
            font-size: 13px;
            color: #3c3d48;
            margin-top: 5px;
          }
          img {
            width: 48px;
            height: 48px;
          }
1201 1202
          div:not(:first-child) {
            margin-left: 60px;
1203
          }
linxin's avatar
linxin committed
1204 1205 1206 1207 1208
        }
      }
    }
  }
  .my-content {
linxin's avatar
linxin committed
1209
    background-color: #efefef;
linxin's avatar
linxin committed
1210 1211 1212
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
linxin's avatar
linxin committed
1213 1214 1215 1216 1217
    .content-top {
      width: 359px;
      height: 121px;
      background-color: #fff;
      border-radius: 4px;
linxin's avatar
linxin committed
1218
      margin-top: 8px;
linxin's avatar
linxin committed
1219
    }
linxin's avatar
linxin committed
1220 1221 1222
    .userInfo {
      height: 45px;
      line-height: 45px;
linxin's avatar
linxin committed
1223
      color: @headerColor;
linxin's avatar
linxin committed
1224 1225 1226 1227 1228 1229 1230 1231 1232
      font-size: 15px;
      margin-left: 16px;
      position: relative;
    }
    .userInfo::before {
      content: "";
      display: block;
      width: 4px;
      height: 20px;
linxin's avatar
linxin committed
1233
      background-color: @headerColor;
linxin's avatar
linxin committed
1234 1235 1236 1237 1238
      position: absolute;
      left: -15px;
      top: 12px;
    }
    .my-contract {
李晓兵's avatar
李晓兵 committed
1239
     // width: 295px;
linxin's avatar
linxin committed
1240 1241
      margin: 0 auto;
      display: flex;
linxin's avatar
linxin committed
1242 1243
      // justify-content: space-around;
      // align-items: center;
李晓兵's avatar
李晓兵 committed
1244
     // flex:1;
linxin's avatar
linxin committed
1245
      text-align: center;
李晓兵's avatar
李晓兵 committed
1246 1247
      padding: 0 6%;
      justify-content: flex-start;
linxin's avatar
linxin committed
1248
      .content-wrap {
李晓兵's avatar
李晓兵 committed
1249
        position: relative;
李晓兵's avatar
李晓兵 committed
1250 1251 1252 1253 1254
        width: 33%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
linxin's avatar
linxin committed
1255
        .content-wrap-class {
李晓兵's avatar
李晓兵 committed
1256 1257
          position: absolute;
          top: -10px;
李晓兵's avatar
李晓兵 committed
1258
          left: 56px;
李晓兵's avatar
李晓兵 committed
1259
          font-size: 10px;
1260 1261
          width: 18px;
          height: 18px;
李晓兵's avatar
李晓兵 committed
1262
          text-align: center;
1263
          line-height: 18px;
李晓兵's avatar
李晓兵 committed
1264 1265 1266 1267
          background-color: red;
          color: #fff;
          border-radius: 50%;
        }
linxin's avatar
linxin committed
1268
        .content-wrap-class-width {
李晓兵's avatar
李晓兵 committed
1269 1270 1271 1272
          position: absolute;
          top: -10px;
          left: 25px;
          font-size: 10px;
1273 1274
          width: 24px;
          height: 18px;
李晓兵's avatar
李晓兵 committed
1275
          text-align: center;
1276
          line-height: 18px;
李晓兵's avatar
李晓兵 committed
1277 1278 1279 1280 1281
          background-color: red;
          color: #fff;
          border-radius: 50%;
        }
      }
linxin's avatar
linxin committed
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291
      img {
        width: 38px;
        height: 38px;
      }
      p {
        font-family: PingFangSC-Regular;
        font-size: 12px;
        color: #383f45;
        margin-top: 5px;
      }
李晓兵's avatar
李晓兵 committed
1292
     /* div:not(:first-child) {
1293
        margin-left: 85px;
李晓兵's avatar
李晓兵 committed
1294
      }*/
linxin's avatar
linxin committed
1295 1296
    }
    .list {
linxin's avatar
linxin committed
1297 1298 1299
      width: 359px;
      margin: 0 auto;
      background-color: #fff;
linxin's avatar
linxin committed
1300 1301 1302 1303 1304
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: #656464;
      letter-spacing: 0;
      line-height: 18px;
linxin's avatar
linxin committed
1305
      margin-top: 25px;
linxin's avatar
linxin committed
1306 1307 1308 1309 1310
    }
  }
  button {
    width: 359px;
    height: 40px;
linxin's avatar
linxin committed
1311
    background: @headerColor;
linxin's avatar
linxin committed
1312 1313
    border-radius: 4px;
    color: #fff;
linxin's avatar
linxin committed
1314
    margin: 0 auto;
李晓兵's avatar
李晓兵 committed
1315
    margin-bottom: 68px;
linxin's avatar
linxin committed
1316
    margin-top: 10px;
linxin's avatar
linxin committed
1317 1318 1319 1320
  }
}
.content {
  background-color: #fff;
linxin's avatar
linxin committed
1321
}
linxin's avatar
linxin committed
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341
.right-icon {
  width: 18px;
  height: 18px;
  font-size: 10px;
  text-align: center;
  line-height: 18px;
  background-color: red;
  color: #fff;
  border-radius: 50%;
}
.right-icon-width {
  width: 24px;
  height: 18px;
  font-size: 10px;
  text-align: center;
  line-height: 18px;
  background-color: red;
  color: #fff;
  border-radius: 50%;
}
1342 1343 1344 1345
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
  .platform-ios {
    #my-info {
      button {
linxin's avatar
linxin committed
1346
        margin-bottom: 98px;
1347 1348 1349 1350 1351 1352 1353 1354 1355
      }
    }
  }
}
// iPhoneXR适配
@media (device-width: 414px) and (device-height: 896px) {
  .platform-ios {
    #my-info {
      button {
linxin's avatar
linxin committed
1356
        margin-bottom: 98px;
1357 1358 1359 1360
      }
    }
  }
}
李晓兵's avatar
李晓兵 committed
1361
</style>