my-info.vue 29.5 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-18 13:41:07
786817560's avatar
786817560 committed
5 6 7 8
 * @LastEditors: Please set LastEditors
 * @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 15
    </h-header>

    <div class="top" style="margin-top:-1px;">
linxin's avatar
linxin committed
16
      <div class="card-top">
17
        <img :src="upLoadObj" @click="checkType" >
linxin's avatar
linxin committed
18 19 20 21
        <div class="sign">
          <span>{{ user_phone }}</span>
          <div>
            电子签
linxin's avatar
linxin committed
22 23 24 25
            <p
              :class="[elecStatus?'across':'un-across']"
              @click="certification"
            >{{ elecStatusDesceibe }}</p>
linxin's avatar
linxin committed
26 27 28
          </div>
        </div>
      </div>
linxin's avatar
linxin committed
29 30 31
      <div class="card">
        <div class="card-info">
          <div class="card-bottom">
32
            <div v-if="(user_bp_type!=='TENANT')&&(user_bp_type!=='GUTA')" @click="goStart">
linxin's avatar
linxin committed
33 34 35
              <img src="@/assets/myInfo/car.png" >
              <p>发车申请</p>
            </div>
36
            <div v-if="(user_bp_type==='TENANT')||(user_bp_type==='GUTA')" @click="changePay">
linxin's avatar
linxin committed
37 38 39
              <img src="@/assets/myInfo/pay.png" >
              <p>首付还款</p>
            </div>
40
            <div v-if="(user_bp_type==='TENANT')||(user_bp_type==='GUTA')" @click="changeRent">
linxin's avatar
linxin committed
41 42 43 44 45
              <img src="@/assets/myInfo/refund.png" >
              <p>租金还款</p>
            </div>
          </div>
        </div>
李晓兵's avatar
李晓兵 committed
46
      </div>
linxin's avatar
linxin committed
47 48
    </div>
    <h-content class="my-content">
linxin's avatar
linxin committed
49 50 51 52
      <div class="content-top">
        <div class="userInfo">我的合同</div>
        <div class="my-contract">
          <div class="content-wrap" @click="goSign">
53 54
            <span
              v-if="signCount > 0"
linxin's avatar
linxin committed
55 56 57 58 59 60 61 62 63 64 65
              :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
66
          </div>-->
67
          <div v-if="user_bp_type!=='FACTORY'" class="content-wrap" @click="goVideoSign">
68 69
            <span
              v-if="vedioCount > 0"
linxin's avatar
linxin committed
70 71 72 73 74
              :class="{'content-wrap-class-width':vedioCount>99, 'content-wrap-class':vedioCount<99}"
            >{{ vedioCount > 99 ? '99+' : vedioCount }}</span>
            <img src="@/assets/myInfo/unFace.png" >
            <p>待面签</p>
          </div>
75 76 77 78 79
          <div
            v-if="(user_bp_type==='TENANT')||(user_bp_type==='GUTA')"
            class="content-wrap"
            @click="goCarConfirm"
          >
80 81
            <span
              v-if="carCount > 0"
linxin's avatar
linxin committed
82 83
              :class="{'content-wrap-class-width':carCount>99, 'content-wrap-class':carCount<99}"
              style="margin-left:5px;"
linxin's avatar
linxin committed
84
            >{{ carCount > 99 ? '99+' : carCount }}</span>
linxin's avatar
linxin committed
85 86 87
            <img src="@/assets/myInfo/carConfirm.png" >
            <p>发车确认</p>
          </div>
linxin's avatar
linxin committed
88
        </div>
linxin's avatar
linxin committed
89
        <list-item :item-height="44" class="list">
90 91 92 93
          <item
            v-if="(user_bp_type==='TENANT')||(user_bp_type==='GUTA')"
            @click.native="goReimburse"
          >
linxin's avatar
linxin committed
94 95 96
            <img slot="left-icon" src="@/assets/myInfo/myRefund.png" class="left-icon" >
            <div slot="name">我的还款</div>
          </item>
786817560's avatar
786817560 committed
97
          <!--  <item @click.native="changeDrawbackList">
linxin's avatar
linxin committed
98 99
            <img slot="left-icon" src="@/assets/myInfo/repay.png" class="left-icon" >
            <div slot="name">业务退款</div>
李晓兵's avatar
李晓兵 committed
100
          </item>-->
linxin's avatar
linxin committed
101 102 103
          <item @click.native="goMyProduct">
            <img slot="left-icon" src="@/assets/myInfo/collect.png" class="left-icon" >
            <div slot="name">我的收藏</div>
104 105
            <div
              v-if="productCount > 0"
linxin's avatar
linxin committed
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
              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>
          <item>
            <img slot="left-icon" src="@/assets/myInfo/about.png" class="left-icon" >
            <div slot="name">关于徐工</div>
          </item>
          <item @click.native="updateVersion">
            <img slot="left-icon" src="@/assets/myInfo/refresh.png" class="left-icon" >
            <div slot="name">检查更新</div>
          </item>
李晓兵's avatar
李晓兵 committed
122
          <item @click.native="openTest">
李晓兵's avatar
李晓兵 committed
123 124
            <img slot="left-icon" src="@/assets/myInfo/refresh.png" class="left-icon" >
            <div slot="name">当前版本</div>
125
            <div slot="content">{{ currentVersion }}</div>
李晓兵's avatar
李晓兵 committed
126
          </item>
linxin's avatar
linxin committed
127 128 129 130 131
          <item @click.native="logOut">
            <img slot="left-icon" src="@/assets/myInfo/exit.png" class="left-icon" >
            <div slot="name">退出登录</div>
          </item>
        </list-item>
李晓兵's avatar
李晓兵 committed
132
        <button @click="approveBtn ? unBind() : changePageHead()">{{ description }}</button>
linxin's avatar
linxin committed
133
      </div>
李晓兵's avatar
李晓兵 committed
134
    </h-content>
李晓兵's avatar
李晓兵 committed
135
    <role-switch
linxin's avatar
linxin committed
136 137 138 139 140 141
      v-show="roleSwitchFlag"
      ref="roleSwitch"
      :roleList="roleList"
      @roleConfirm="roleConfirm"
      @roleCancle="roleCancle"
    />
linxin's avatar
linxin committed
142
  </h-view>
李晓兵's avatar
李晓兵 committed
143 144
</template>
<script>
李晓兵's avatar
李晓兵 committed
145
import roleSwitch from './role-switch-component'
linxin's avatar
linxin committed
146
import defaultImg from '../../assets/myInfo/1.png'
李晓兵's avatar
李晓兵 committed
147
export default {
李晓兵's avatar
李晓兵 committed
148 149 150
  components: {
    roleSwitch,
  },
李晓兵's avatar
李晓兵 committed
151
  data () {
linxin's avatar
linxin committed
152
    return {
李晓兵's avatar
李晓兵 committed
153
      currentVersion: process.env.currentVersion,
154
      upLoadObj: defaultImg, // 上传的图片
linxin's avatar
linxin committed
155
      flag: true,
linxin's avatar
linxin committed
156
      isAGENT: false,
linxin's avatar
linxin committed
157
      elecStatusDesceibe: '',
linxin's avatar
linxin committed
158 159 160
      user_bp_status: '',
      user_bp_class: '',
      bp_id: '',
linxin's avatar
linxin committed
161
      user_phone: '',
linxin's avatar
linxin committed
162
      user_bp_name: '',
linxin's avatar
linxin committed
163
      user_bp_type: '',
李晓兵's avatar
李晓兵 committed
164
      signCount: '0',
786817560's avatar
786817560 committed
165
      carNum: '0',
李晓兵's avatar
李晓兵 committed
166 167 168
      confirmCount: '0',
      vedioCount: '0',
      productCount: '0',
linxin's avatar
linxin committed
169
      carCount: '0',
李晓兵's avatar
李晓兵 committed
170
      description: '',
linxin's avatar
linxin committed
171
      bp_identity: '',
李晓兵's avatar
李晓兵 committed
172
      approveBtn: false,
linxin's avatar
linxin committed
173
      elecStatus: false,
李晓兵's avatar
李晓兵 committed
174 175 176 177 178 179 180 181 182 183 184
      roleSwitchFlag: false, // 选择角色模态框显示标志
      roleList: [
        {
          bp_type: 'TENANT',
          bp_type_desc: '主承租人',
        },
        {
          bp_type: 'GUTA',
          bp_type_desc: '担保人',
        },
      ],
linxin's avatar
linxin committed
185 186
    }
  },
linxin's avatar
linxin committed
187
  watch: {
linxin's avatar
linxin committed
188
    user_bp_type (newVal, oldVal) {
linxin's avatar
linxin committed
189 190 191 192 193 194
      if (newVal === 'AGENT') {
        this.isAGENT = true
      } else {
        this.isAGENT = false
      }
    },
linxin's avatar
linxin committed
195
    bp_identity (newVal, oldVal) {
linxin's avatar
linxin committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
      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
242 243
      }
    },
linxin's avatar
linxin committed
244
  },
linxin's avatar
linxin committed
245
  created () {},
linxin's avatar
linxin committed
246 247 248
  beforeRouteEnter (to, from, next) {
    next(vm => {
      vm.userQuery()
李晓兵's avatar
李晓兵 committed
249
      vm.numQuery()
linxin's avatar
linxin committed
250
    })
linxin's avatar
linxin committed
251
    next()
李晓兵's avatar
李晓兵 committed
252
  },
linxin's avatar
linxin committed
253
  activated () {},
李晓兵's avatar
李晓兵 committed
254
  methods: {
786817560's avatar
786817560 committed
255 256
    openTest () {
      cordova.InAppBrowser.open('http://www.baidu.com', '_blank', 'location=yes')
李晓兵's avatar
李晓兵 committed
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
    // 查询头像
    getHead () {
      let vm = this
      let url = process.env.basePath + 'app_attment_query'
      let param = {
        master: {
          source_type: 'HLS_APP_USER',
          pkvalue: vm.bp_id,
        },
      }
      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
          }
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
李晓兵's avatar
李晓兵 committed
284 285 286 287 288 289 290 291 292
    // 选择角色后确定
    roleConfirm (role) {
      this.roleSwitchFlag = false
      console.log('选择后的角色为:' + role)
    },
    // 选择角色后取消
    roleCancle () {
      this.roleSwitchFlag = false
    },
李晓兵's avatar
李晓兵 committed
293
    // 监听用户状态
linxin's avatar
linxin committed
294
    watchBpStatus () {
李晓兵's avatar
李晓兵 committed
295 296
      if (!this.bp_id && this.user_bp_status === 'NEW') {
        this.description = '用户绑定'
linxin's avatar
linxin committed
297
        this.approveBtn = false
李晓兵's avatar
李晓兵 committed
298 299 300 301 302
      } else if (this.bp_id && this.user_bp_status === 'NEW') {
        this.description = '待提交'
      } else if (this.bp_id && this.user_bp_status === 'APPROVED') {
        this.description = '解除绑定'
        this.approveBtn = true
linxin's avatar
linxin committed
303 304 305 306
      } else if (
        (this.bp_id && this.user_bp_status === 'RETURN') ||
        (this.bp_id && this.user_bp_status === 'REJECT')
      ) {
李晓兵's avatar
李晓兵 committed
307 308 309 310 311
        this.description = '审核未通过'
      } else {
        this.description = '审批中'
      }
    },
李晓兵's avatar
李晓兵 committed
312 313
    // 进入待签约功能,客户类型为经销商则进入经销商功能,非经销商则进入合同签约
    goSign () {
李晓兵's avatar
李晓兵 committed
314 315 316 317 318 319 320 321
      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
322
            params: {
linxin's avatar
linxin committed
323 324
              user_bp_type: this.user_bp_type,
            },
李晓兵's avatar
李晓兵 committed
325 326
          })
        }
李晓兵's avatar
李晓兵 committed
327
      } else {
李晓兵's avatar
李晓兵 committed
328
        hlsPopup.showLongCenter('请先进行用户绑定')
李晓兵's avatar
李晓兵 committed
329 330 331 332
      }
    },
    // 进入待确认,(进件确认)
    goConfirm () {
李晓兵's avatar
李晓兵 committed
333
      this.$router.push({
linxin's avatar
linxin committed
334
        name: 'IntoList',
李晓兵's avatar
李晓兵 committed
335
      })
linxin's avatar
linxin committed
336 337 338
      // this.$router.push({
      //   name: 'IframTest',
      // })
李晓兵's avatar
李晓兵 committed
339 340 341
    },
    // 进入我的还款
    goReimburse () {
李晓兵's avatar
李晓兵 committed
342 343 344 345 346 347 348
      if (this.bp_id) {
        this.$router.push({
          name: 'ReimburseMyselfList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
李晓兵's avatar
李晓兵 committed
349
    },
李晓兵's avatar
李晓兵 committed
350 351 352 353 354 355
    // 进入我的收藏
    goMyProduct () {
      this.$router.push({
        name: 'MyProductList',
      })
    },
356 357
    // 进入发车申请
    goStart () {
李晓兵's avatar
李晓兵 committed
358 359 360 361 362 363 364
      if (this.bp_id) {
        this.$router.push({
          name: 'StartList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
365
    },
366 367
    // 进入发车确认
    goCarConfirm () {
李晓兵's avatar
李晓兵 committed
368 369 370 371 372 373 374
      if (this.bp_id) {
        this.$router.push({
          name: 'ConfirmList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
375
    },
linxin's avatar
linxin committed
376
    goVideoSign () {
李晓兵's avatar
李晓兵 committed
377 378 379 380 381 382 383
      if (this.bp_id) {
        this.$router.push({
          name: 'VideoSign',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
384
    },
linxin's avatar
linxin committed
385 386 387 388 389
    changeHelp () {
      this.$router.push({
        name: 'HelpList',
      })
    },
linxin's avatar
linxin committed
390
    changeDrawbackList () {
李晓兵's avatar
李晓兵 committed
391 392 393 394 395 396 397
      if (this.bp_id) {
        this.$router.push({
          name: 'DrawbackList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
398
    },
linxin's avatar
linxin committed
399
    changePay () {
linxin's avatar
linxin committed
400
      if (window.localStorage.getItem('bp_id') !== 'undefined') {
linxin's avatar
linxin committed
401 402 403 404 405 406
        this.$router.push({
          name: 'FirstPay',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
407 408
    },
    changeRent () {
linxin's avatar
linxin committed
409
      if (window.localStorage.getItem('bp_id') !== 'undefined') {
linxin's avatar
linxin committed
410 411 412 413 414 415
        this.$router.push({
          name: 'NewList',
        })
      } else {
        hlsPopup.showLongCenter('请先进行用户绑定')
      }
linxin's avatar
linxin committed
416
    },
李晓兵's avatar
李晓兵 committed
417 418
    updateVersion () {
      if (vum.Platform.isAndroid()) {
linxin's avatar
linxin committed
419 420
        this.hote_update_version(
          '发现新版本是否更新',
李晓兵's avatar
李晓兵 committed
421
          'http://hlsapp.hand-china.com/file/XCMG/www_myself/android/www.zip'
linxin's avatar
linxin committed
422
        )
李晓兵's avatar
李晓兵 committed
423
      } else {
linxin's avatar
linxin committed
424 425
        this.hote_update_version(
          '发现新版本是否更新',
李晓兵's avatar
李晓兵 committed
426
          'http://hlsapp.hand-china.com/file/XCMG/www_myself/ios/www.zip'
linxin's avatar
linxin committed
427
        )
李晓兵's avatar
李晓兵 committed
428 429 430 431 432 433 434 435 436 437 438 439 440
      }
    },
    hote_update_version (content, url) {
      hlsPopup.showConfirm({
        title: '版本更新',
        content: content,
        onConfirm: function (index) {
          if (index === 1) {
            hotpatch.updateNewVersion(url)
          }
        },
      })
    },
李晓兵's avatar
李晓兵 committed
441 442 443 444 445 446 447
    logOut () {
      let vm = this
      hlsPopup.showConfirm({
        title: '提示',
        content: '确定退出',
        onConfirm: function (index) {
          if (index === 1) {
李晓兵's avatar
李晓兵 committed
448 449
            let width = window.localStorage.getItem('width')
            let height = window.localStorage.getItem('height')
李晓兵's avatar
李晓兵 committed
450
            window.localStorage.clear()
李晓兵's avatar
李晓兵 committed
451 452
            window.localStorage.setItem('width', width)
            window.localStorage.setItem('height', height)
李晓兵's avatar
李晓兵 committed
453
            vm.$router.push('/login')
454
            location.reload()
李晓兵's avatar
李晓兵 committed
455 456 457 458
          }
        },
      })
    },
linxin's avatar
linxin committed
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
    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
483 484
                  vm.hlsPopup.showLongCenter('解绑成功')
                  vm.userQuery()
linxin's avatar
linxin committed
485
                  // vm.flag = true
李晓兵's avatar
李晓兵 committed
486
                  vm.approveBtn = false
linxin's avatar
linxin committed
487 488
                } else {
                  vm.hlsPopup.showLongCenter(res.message)
linxin's avatar
linxin committed
489 490 491
                }
              })
              .catch(() => {
linxin's avatar
linxin committed
492
                vm.hlsPopup.showLongCenter('传入参数异常')
linxin's avatar
linxin committed
493 494 495 496 497
              })
          }
        },
      })
    },
linxin's avatar
linxin committed
498
    checkType () {
499
      let vm = this
linxin's avatar
linxin committed
500
      this.hlsPopup.showActionSheet({
linxin's avatar
linxin committed
501 502 503 504 505
        buttonArray:
          this.bp_id === undefined
            ? ['修改头像']
            : ['修改头像', '用户信息', '角色切换'],
        callback: index => {
linxin's avatar
linxin committed
506
          if (index === 0) {
507
            this.imgUploadShow(vm.bp_id)
linxin's avatar
linxin committed
508 509 510
          } else if (index === 1) {
            this.changePageHead()
          } else if (index === 2) {
李晓兵's avatar
李晓兵 committed
511
            this.$refs.roleSwitch.show()
linxin's avatar
linxin committed
512 513 514 515
          }
        },
      })
    },
linxin's avatar
linxin committed
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535
    // 图片上传入口
    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,
536
        source_type: 'HLS_APP_USER',
linxin's avatar
linxin committed
537 538 539 540 541 542 543 544 545 546 547 548 549
        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
550
        vm.upLoadObj = obj.picture
linxin's avatar
linxin committed
551 552 553 554 555 556 557 558 559
        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
560 561 562 563 564 565 566 567 568 569
      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
570 571 572 573
      let cameraoptions = {
        quality: 100,
      }
      let success = function (imgUrl) {
linxin's avatar
linxin committed
574 575
        obj.picture = imgUrl[0]
        obj.filePath = imgUrl[0]
576
        vm.upLoadObj = obj.picture
linxin's avatar
linxin committed
577 578 579
        // 拍完一张立马执行保存图片逻辑
        vm.save_picture(obj)
      }
linxin's avatar
linxin committed
580 581 582
      let error = function () {
        hlsPopup.showLongCenter('请选择图片')
      }
linxin's avatar
linxin committed
583 584 585 586 587 588 589 590 591 592 593 594 595 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
      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) {
622 623 624 625
        let success = function () {
          hlsPopup.showLongCenter('头像上传成功')
        }
        hlsUtil.fileUploadSvc(obj, success)
linxin's avatar
linxin committed
626 627 628 629
      } else {
        hlsPopup.hideLoading()
      }
    },
linxin's avatar
linxin committed
630 631 632
    changePageHead () {
      let vm = this
      if (vm.bp_id) {
linxin's avatar
linxin committed
633 634 635 636 637
        if (
          vm.user_bp_status === 'NEW' ||
          vm.user_bp_status === 'REJECT' ||
          vm.user_bp_status === 'RETURN'
        ) {
linxin's avatar
linxin committed
638
          vm.flag = true
linxin's avatar
linxin committed
639 640
          if (vm.user_bp_class === 'NP') {
            vm.$router.push({
linxin's avatar
linxin committed
641
              name: 'NPBaseInfo',
linxin's avatar
linxin committed
642
              params: {
linxin's avatar
linxin committed
643
                bp_id: this.bp_id,
linxin's avatar
linxin committed
644
                user_bp_name: this.user_bp_name,
linxin's avatar
linxin committed
645 646 647 648
              },
            })
          } else {
            this.$router.push({
786817560's avatar
786817560 committed
649
              name: 'EnterpriseNew',
linxin's avatar
linxin committed
650
              params: {
linxin's avatar
linxin committed
651
                bp_id: this.bp_id,
linxin's avatar
linxin committed
652
                user_bp_name: this.user_bp_name,
786817560's avatar
786817560 committed
653
                bp_class: vm.user_bp_class,
linxin's avatar
linxin committed
654 655 656 657
              },
            })
          }
        } else if (vm.user_bp_status === 'APPROVED') {
linxin's avatar
linxin committed
658
          vm.flag = false
linxin's avatar
linxin committed
659 660
          if (vm.user_bp_class === 'NP') {
            vm.$router.push({
linxin's avatar
linxin committed
661
              name: 'NPBaseInfo',
linxin's avatar
linxin committed
662
              params: {
linxin's avatar
linxin committed
663
                bp_id: this.bp_id,
linxin's avatar
linxin committed
664
                user_bp_name: this.user_bp_name,
linxin's avatar
linxin committed
665
                isAGENT: this.isAGENT,
linxin's avatar
linxin committed
666
                status: 'APPROVED',
linxin's avatar
linxin committed
667
                isMultiRole: this.isMultiRole,
linxin's avatar
linxin committed
668 669 670 671
              },
            })
          } else {
            this.$router.push({
786817560's avatar
786817560 committed
672
              name: 'EnterpriseNew',
linxin's avatar
linxin committed
673
              params: {
linxin's avatar
linxin committed
674
                bp_id: this.bp_id,
linxin's avatar
linxin committed
675
                user_bp_name: this.user_bp_name,
linxin's avatar
linxin committed
676
                isAGENT: this.isAGENT,
linxin's avatar
linxin committed
677
                status: 'APPROVED',
linxin's avatar
linxin committed
678
                isMultiRole: this.isMultiRole,
786817560's avatar
786817560 committed
679
                bp_class: vm.user_bp_class,
linxin's avatar
linxin committed
680 681 682 683
              },
            })
          }
        } else if (vm.user_bp_status === 'APPROVING') {
linxin's avatar
linxin committed
684
          vm.flag = true
linxin's avatar
linxin committed
685 686 687
          this.hlsPopup.showLongCenter('您的绑定申请还在流程中')
        }
      } else {
linxin's avatar
linxin committed
688
        vm.flag = true
linxin's avatar
linxin committed
689 690 691
        this.$router.push({
          name: 'UserBind',
        })
linxin's avatar
linxin committed
692 693 694 695 696 697
      }
    },
    userQuery () {
      let vm = this
      let url = $config.basePath + 'user_query'
      let param = {
linxin's avatar
linxin committed
698
        phone: window.localStorage.getItem('user_phone'),
linxin's avatar
linxin committed
699 700 701
      }
      vm.$post(url, param).then(function (res) {
        if (res.result === 'S') {
linxin's avatar
linxin committed
702 703 704
          if (res.info.user_bp_status === 'APPROVED') {
            vm.flag = false
          }
linxin's avatar
linxin committed
705 706 707
          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
708
          vm.bp_identity = res.info.bp_identity
linxin's avatar
linxin committed
709
          window.localStorage.setItem('bp_id', res.info.user_bp_id)
linxin's avatar
linxin committed
710
          window.localStorage.setItem('user_bp_status', res.info.user_bp_status)
linxin's avatar
linxin committed
711
          window.localStorage.setItem('bp_name', res.info.user_bp_name)
linxin's avatar
linxin committed
712
          vm.user_bp_name = res.info.user_bp_name
linxin's avatar
linxin committed
713
          vm.user_bp_type = res.info.user_bp_type
linxin's avatar
linxin committed
714
          vm.user_phone = res.info.user_phone
李晓兵's avatar
李晓兵 committed
715
          vm.watchBpStatus()
716
          vm.getHead()
linxin's avatar
linxin committed
717 718 719 720 721 722 723 724 725 726
          if (vm.user_bp_type === 'AGENT') {
            vm.isAGENT = true
          } else {
            vm.isAGENT = false
          }
          if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT') {
            vm.isMultiRole = true
          } else {
            vm.isMultiRole = false
          }
linxin's avatar
linxin committed
727 728
        } else {
          this.hlsPopup.showLongCenter(res.message)
李晓兵's avatar
李晓兵 committed
729 730 731 732 733 734 735
        }
      })
    },
    numQuery () {
      let vm = this
      let url = $config.basePath + 'number_display_query'
      let param = {
李晓兵's avatar
李晓兵 committed
736
        user_phone: window.localStorage.getItem('user_phone'),
李晓兵's avatar
李晓兵 committed
737 738 739
      }
      vm.$post(url, param).then(function (res) {
        if (res.result === 'S') {
740
          if ('info' in res) {
李晓兵's avatar
李晓兵 committed
741
            vm.signCount = res.info.con_confirm_num || 0
786817560's avatar
786817560 committed
742
            // vm.confirmCount = res.info.con_confirm_num
李晓兵's avatar
李晓兵 committed
743 744
            vm.productCount = res.info.collect_num || 0
            vm.carCount = res.info.car_confirm_num || 0
李晓兵's avatar
李晓兵 committed
745 746 747
          }
        } else {
          this.hlsPopup.showLongCenter(res.message)
linxin's avatar
linxin committed
748 749 750
        }
      })
    },
李晓兵's avatar
李晓兵 committed
751 752 753
    // 认证入口
    async certification () {
      let vm = this
李晓兵's avatar
李晓兵 committed
754
      if (vm.bp_id) {
linxin's avatar
linxin committed
755 756 757 758 759
        if (
          vm.bp_identity === 'NP_NO' ||
          vm.bp_identity === 'ORG_L_NO' ||
          vm.bp_identity === 'ORG_AUTH_NO'
        ) {
李晓兵's avatar
李晓兵 committed
760 761 762 763 764 765 766 767 768
          let authUrl = await vm.getNpCertificationUrl()
          if (authUrl) {
            vm.$router.push({
              name: 'Certification',
              params: {
                authUrl: authUrl,
              },
            })
          } else {
769
            // hlsPopup.showLongCenter('获取认证url失败')
李晓兵's avatar
李晓兵 committed
770 771 772 773 774 775 776 777 778 779 780
          }
        } else if (vm.bp_identity === 'ORG_NO') {
          let authUrl = await vm.getOrgCertificationUrl()
          if (authUrl) {
            vm.$router.push({
              name: 'Certification',
              params: {
                authUrl: authUrl,
              },
            })
          } else {
781
            // hlsPopup.showLongCenter('获取认证url失败')
李晓兵's avatar
李晓兵 committed
782
          }
李晓兵's avatar
李晓兵 committed
783
        } else {
李晓兵's avatar
李晓兵 committed
784
          hlsPopup.showLongCenter('您已认证通过')
李晓兵's avatar
李晓兵 committed
785 786
        }
      } else {
李晓兵's avatar
李晓兵 committed
787
        hlsPopup.showLongCenter('请先进行用户绑定')
李晓兵's avatar
李晓兵 committed
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 820 821 822 823
      }
    },
    // 获取个人认证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()
      if (res.info.code === 0) {
        return res.info.data.authUrl
      } else {
        hlsPopup.showLongCenter(res.info.msg)
        return null
      }
    },
    // 获取企业认证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()
      if (res.info.code === 0) {
        return res.info.data.authUrl
      } else {
        hlsPopup.showLongCenter(res.info.msg)
        return null
      }
    },
李晓兵's avatar
李晓兵 committed
824 825 826 827
  },
}
</script>

linxin's avatar
linxin committed
828
<style lang="less" scoped>
linxin's avatar
linxin committed
829
#my-info {
linxin's avatar
linxin committed
830 831 832 833 834 835 836 837
  .card-top {
    width: 330px;
    margin: 0 auto;
    height: 110px;
    display: flex;
    align-items: center;
    .sign {
      margin-left: 24px;
linxin's avatar
linxin committed
838
      height: 55px;
linxin's avatar
linxin committed
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856
      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
857
          padding: 0 5px;
linxin's avatar
linxin committed
858 859 860 861 862 863 864 865 866
          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
867 868
        .across {
          background-color: #1d3fff;
linxin's avatar
linxin committed
869
        }
linxin's avatar
linxin committed
870
        .un-across {
linxin's avatar
linxin committed
871 872 873 874 875 876 877 878 879 880 881
          background: #0523ce;
        }
      }
    }
    img {
      width: 59px;
      height: 59px;
      border-radius: 50%;
      border: 1px solid #00469c;
    }
  }
linxin's avatar
linxin committed
882 883 884 885
  .top {
    width: 100%;
    height: 206px;
    background: url("../../assets/myInfo/back.png") no-repeat;
linxin's avatar
linxin committed
886
    background-size: 100% 156px;
linxin's avatar
linxin committed
887
    background-color: #efefef;
linxin's avatar
linxin committed
888 889 890 891 892 893 894 895 896 897
    .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
898 899
      width: 359px;
      height: 108px;
linxin's avatar
linxin committed
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914
      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;
915
          justify-content: flex-start;
linxin's avatar
linxin committed
916 917 918 919 920 921 922 923 924 925 926 927
          align-items: center;
          text-align: center;
          p {
            font-family: PingFangSC-Regular;
            font-size: 13px;
            color: #3c3d48;
            margin-top: 5px;
          }
          img {
            width: 48px;
            height: 48px;
          }
928 929
          div:not(:first-child) {
            margin-left: 60px;
930
          }
linxin's avatar
linxin committed
931 932 933 934 935
        }
      }
    }
  }
  .my-content {
linxin's avatar
linxin committed
936
    background-color: #efefef;
linxin's avatar
linxin committed
937 938 939
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
linxin's avatar
linxin committed
940 941 942 943 944
    .content-top {
      width: 359px;
      height: 121px;
      background-color: #fff;
      border-radius: 4px;
linxin's avatar
linxin committed
945
      margin-top: 18px;
linxin's avatar
linxin committed
946
    }
linxin's avatar
linxin committed
947 948 949
    .userInfo {
      height: 45px;
      line-height: 45px;
linxin's avatar
linxin committed
950
      color: @headerColor;
linxin's avatar
linxin committed
951 952 953 954 955 956 957 958 959
      font-size: 15px;
      margin-left: 16px;
      position: relative;
    }
    .userInfo::before {
      content: "";
      display: block;
      width: 4px;
      height: 20px;
linxin's avatar
linxin committed
960
      background-color: @headerColor;
linxin's avatar
linxin committed
961 962 963 964 965 966 967 968
      position: absolute;
      left: -15px;
      top: 12px;
    }
    .my-contract {
      width: 295px;
      margin: 0 auto;
      display: flex;
969
      justify-content: flex-start;
linxin's avatar
linxin committed
970 971
      align-items: center;
      text-align: center;
linxin's avatar
linxin committed
972
      .content-wrap {
李晓兵's avatar
李晓兵 committed
973
        position: relative;
linxin's avatar
linxin committed
974
        .content-wrap-class {
李晓兵's avatar
李晓兵 committed
975 976 977 978
          position: absolute;
          top: -10px;
          left: 25px;
          font-size: 10px;
979 980
          width: 18px;
          height: 18px;
李晓兵's avatar
李晓兵 committed
981
          text-align: center;
982
          line-height: 18px;
李晓兵's avatar
李晓兵 committed
983 984 985 986
          background-color: red;
          color: #fff;
          border-radius: 50%;
        }
linxin's avatar
linxin committed
987
        .content-wrap-class-width {
李晓兵's avatar
李晓兵 committed
988 989 990 991
          position: absolute;
          top: -10px;
          left: 25px;
          font-size: 10px;
992 993
          width: 24px;
          height: 18px;
李晓兵's avatar
李晓兵 committed
994
          text-align: center;
995
          line-height: 18px;
李晓兵's avatar
李晓兵 committed
996 997 998 999 1000
          background-color: red;
          color: #fff;
          border-radius: 50%;
        }
      }
linxin's avatar
linxin committed
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
      img {
        width: 38px;
        height: 38px;
      }
      p {
        font-family: PingFangSC-Regular;
        font-size: 12px;
        color: #383f45;
        margin-top: 5px;
      }
1011 1012 1013
      div:not(:first-child) {
        margin-left: 85px;
      }
linxin's avatar
linxin committed
1014 1015
    }
    .list {
linxin's avatar
linxin committed
1016 1017 1018
      width: 359px;
      margin: 0 auto;
      background-color: #fff;
linxin's avatar
linxin committed
1019 1020 1021 1022 1023
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: #656464;
      letter-spacing: 0;
      line-height: 18px;
linxin's avatar
linxin committed
1024
      margin-top: 25px;
linxin's avatar
linxin committed
1025 1026 1027 1028 1029
    }
  }
  button {
    width: 359px;
    height: 40px;
linxin's avatar
linxin committed
1030
    background: @headerColor;
linxin's avatar
linxin committed
1031 1032
    border-radius: 4px;
    color: #fff;
linxin's avatar
linxin committed
1033
    margin: 0 auto;
李晓兵's avatar
李晓兵 committed
1034
    margin-bottom: 68px;
linxin's avatar
linxin committed
1035
    margin-top: 10px;
linxin's avatar
linxin committed
1036 1037 1038 1039
  }
}
.content {
  background-color: #fff;
linxin's avatar
linxin committed
1040
}
linxin's avatar
linxin committed
1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060
.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%;
}
1061 1062 1063 1064
@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
1065
        margin-bottom: 98px;
1066 1067 1068 1069 1070 1071 1072 1073 1074
      }
    }
  }
}
// iPhoneXR适配
@media (device-width: 414px) and (device-height: 896px) {
  .platform-ios {
    #my-info {
      button {
linxin's avatar
linxin committed
1075
        margin-bottom: 98px;
1076 1077 1078 1079
      }
    }
  }
}
李晓兵's avatar
李晓兵 committed
1080
</style>