123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745 |
- <template>
- <view class="center">
- <view v-for="(item , index) in businessman" :Key="index" class="forList">
- <view class='forList-item' @click="navToDetailPage(item)">
- <view class="logo left">
- 粮商
- </view>
- <view class="right">
- <view class="top">
- <view class="company" v-if="item.customerTypeFlag != 1">{{item.compName}}</view>
- <view class="company" v-if="item.customerTypeFlag == 1">{{item.customerName}}</view>
- <view class="status" v-if="item.cover == '1'">
- 已覆盖
- </view>
- <view v-else>
- <view class="status" v-if="item.authenticationStatus == '已认证'">
- <image src="../../static/img/authentication/cert-personal@3x.png"
- style="width: 16px;height: 16px;top:3px;"></image>
- {{item.authenticationStatus}}
- </view>
- <view class="status1" v-if="item.authenticationStatus == '审核中'">
- {{item.authenticationStatus}}
- </view>
- <view class="status2" v-if="item.authenticationStatus == '未通过'">
- {{item.authenticationStatus}}
- </view>
- <view class="status3" v-if="item.authenticationStatus == '已覆盖'">
- {{item.authenticationStatus}}
- </view>
- </view>
- </view>
- <view class="bottom">
- <view class="">
- <view class="geren" v-if="item.basis == 'true'">默认</view>
- <view class="geren" v-if="item.customerTypeFlag == 1"> {{item.customerPhone}}</view>
- <view class="geren" v-if="item.customerTypeFlag == 2">{{item.customerName}}</view>
- <view class="geren" v-if="item.customerTypeFlag == 2">{{item.customerPhone}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="flex number justify-between">
- <view class="yuan flex">
- <view v-bind:class="defaults1" @click.stop="select(item)" v-if="item.basis == 'false'"></view>
- <view v-bind:class="defaults2" @click.stop="select(item)" v-if="item.basis == 'true'">✓</view>
- <text style="font-size: 12px;" @click.stop="select(item)">设为默认</text>
- </view>
- <view class="options flex">
- <view class='but' v-if="item.cover == '1'||item.authenticationStatus == '已认证'"
- @click="open(item)">更换手机号</view>
- <view class='but' v-if="item.cover != '1'&&item.authenticationStatus == '未通过'" @click="companyEdit(item)">修改</view>
- <view class='but' @click="deleteLS(item)">删除</view>
- </view>
- </view>
- <view v-if='pricestatus' class='shade'>
- <view class='shade-content'>
- <view class="titel">
- 更换手机号
- </view>
- <view class="cancel" @click='pricestatus=false'>×</view>
- <view class='shade-content-item'>
- <input v-model='price' placeholder="请输入手机号" type="number" class="tainput" maxlength="11">
- </view>
- <view class="bottom-btn">
- <view class="determine" @click="getcode">
- 获取验证码
- </view>
- </view>
- </view>
- </view>
- <!-- //填写验证码 -->
- <view v-if='pricestatusTwo' class='shade'>
- <view class='shade-content'>
- <view class="titel">
- 填写验证码
- </view>
- <text style="color:#AFB3BF;font-size: 14px;">验证码已发送至+86 {{price}}</text>
- <view class="cancel" @click='pricestatusTwo=false,pricestatus=false'>×</view>
- <view class='shade-content-item1 flex'>
- <input v-model='verifyCode' placeholder="填写验证码" type="number" class="tainput1" maxlength="6">
- <text style="color:#22C572;font-size: 14px;padding-right: 40rpx;" @click="resend">{{sendText}}</text>
- </view>
- <view>
- <view class="flex">
- <text class="btns1 btn1" @click='pricestatusTwo=false'>取消</text>
- <view class="btns1 btn2" @click='amendprice(item)'>确定</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <button class="btns btn" @click="Add">新增</button>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- name: "buy",
- data() {
- return {
- businessman: {},
- identityAuthenticationInfo: {},
- judge: "geren",
- pricestatus: false,
- pricestatusTwo: false,
- price: "",
- sendText: "60s后重发",
- verifyCode: "",
- loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
- id: "",
- defaults1: "default1",
- defaults2: "default2",
- identityAuthenticationInfos: {},
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onShow() {
- this.pricestatus = false
- this.pricestatusTwo = false
- this.getList()
- },
- onPullDownRefresh() {
- this.getList()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- methods: {
- resend() {
- if (this.sendText == "获取验证码") {
- this.getcode()
- }
- },
- select(item) {
- if (item.authenticationStatus == '已认证') {
- if (item.basis == "false") {
- for (var i = 0; i < this.businessman.length; i++) {
- if (this.businessman[i] == item) {
- item.basis = "true"
- } else {
- this.businessman[i].basis = "false"
- }
- }
- // this.defaults1 = "default2"
- } else if (item.basis == "true") {
- item.basis = "false"
- // this.defaults2 = "default1"
- }
- this.identityAuthenticationInfo.commonId = this.userInfo.id
- this.identityAuthenticationInfo.defaultFlag = 1
- this.identityAuthenticationInfo.id = item.id
- this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', this
- .identityAuthenticationInfo,
- 'application/json;charset=UTF-8').then(res => {
- for (var i = 0; i < this.businessman.length; i++) {
- if (this.businessman.defaultFlag == 1) {
- this.defaults = "default2"
- } else {
- this.defaults = "default1"
- }
- }
- this.getList()
- })
- .catch(res => {
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- } else {
- this.$api.msg('已认证的身份才能设为默认!')
- }
- },
- open(item) {
- console.log(item.id)
- this.id = item.id
- this.pricestatus = !this.pricestatus
- },
- Add() {
- uni.navigateTo({
- url: `/pageD/identity/companyIdentity`
- })
- },
- getList() {
- console.log(this.userInfo)
- this.identityAuthenticationInfo.commonId = this.userInfo.id
- this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
- pageSize: 10,
- currentPage: 1,
- commonId: this.userInfo.id,
- flag: 0
- }, 'application/json;charset=UTF-8').then(res => {
- for (var i = 0; i < res.data.data.records.length; i++) {
- res.data.data.records[i].basis = "false"
- if (res.data.data.records[i].defaultFlag == 1) {
- res.data.data.records[i].basis = "true"
- }
- }
- var data = res.data.data.records
- for (var i = 0; i < data.length; i++) {
- if (data[i].customerTypeFlag == 2) {
- if (data[i].compName && data[i].compName.length > 10) {
- data[i].compName = data[i].compName.substring(0, 10) + "..."
- }
- }
- }
- this.businessman = res.data.data.records
- })
- .catch(res => {
- if (res.message) {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- amendprice(item) {
- this.identityAuthenticationInfo.id = this.id
- this.identityAuthenticationInfo.customerPhone = this.price
- var that = this
- this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
- phone: this.price,
- verifyCode: this.verifyCode
- }).then(res => {
- if (res.data.code == 200) {
- that.identityAuthenticationInfos.customerPhone = that.price
- that.$api.doRequest('get', '/identityAuthenticationInfo/selectPhone', that
- .identityAuthenticationInfos)
- .then(res => {
- if (res.data.code == '11018') {
- uni.showModal({
- title: '提示',
- content: '该手机号已认证过个人粮商,再次认证将覆盖之前的认证信息,是否确定认证?',
- success: function(res) {
- if (res.confirm) {
- that.$api.doRequest('post',
- '/identityAuthenticationInfo/api/modifyIdentityPhone',
- that.identityAuthenticationInfo).then(
- res => {
- uni.showToast({
- title: '提交成功',
- icon: 'none',
- duration: 2000
- })
- that.pricestatusTwo = false
- that.getList()
- }).catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- })
- } else if (res.cancel) {
- uni.showToast({
- title: '提交失败',
- icon: 'none',
- duration: 2000
- })
- }
- }
- });
- } else if (res.data.code == 200) {
- that.$api.doRequest('post',
- '/identityAuthenticationInfo/api/modifyIdentityPhone',
- that.identityAuthenticationInfo).then(
- res => {
- uni.showToast({
- title: '提交成功',
- icon: 'none',
- duration: 2000
- })
- uni.navigateTo({
- url: `/pages/attestation/indexTwo`,
- })
- }).catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- })
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- }
- }).catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- })
- } else {
- that.verification = false
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- return false
- }
- })
- .catch(res => {
- that.verification = false
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- return false
- });
- },
- getcode() {
- if (!this.price) {
- uni.showToast({
- title: '请填写手机号!',
- icon: 'none',
- duration: 2000
- })
- return
- }
- if (this.price.length != 11) {
- uni.showToast({
- title: '请正确填写手机号!',
- icon: 'none',
- duration: 2000
- })
- return
- }
- this.pricestatus = false
- this.pricestatusTwo = true
- // this.pricestatusTwo = !this.pricestatusTwo
- var that = this
- if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.price)) {
- this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
- phone: this.price
- }).then(res => {
- if (res.data.code == 200) {
- that.sendDisabled = true
- let sec = 60
- let interval = setInterval(() => {
- sec--;
- that.sendText = sec + 's后重发'
- if (sec <= 0) {
- that.sendDisabled = false
- that.sendText = "获取验证码"
- clearInterval(interval)
- }
- }, 1000)
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- }
- })
- .catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- });
- } else {
- uni.showToast({
- title: '请输入正确的手机号',
- icon: 'none',
- duration: 2000
- })
- }
- },
- navToDetailPage(item) {
- uni.navigateTo({
- url: `/pageD/identity/companyIdentityLook?id=${item.id}`
- })
- },
- deleteLS(item) {
- uni.showModal({
- // title: '提示',
- content: '身份信息删除后不可恢复,是否确定删除?',
- showCancel: true,
- confirmText: '确定',
- success: (e) => {
- if (e.confirm) {
- this.$api.doRequest('post',
- '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', {
- id: item.id
- }, 'application/json;charset=UTF-8').then(res => {
- // this.procurementPlanInfos = res.data.data.records
- if (res.data.code == 200) {
- this.$api.msg('删除成功!')
- this.getList()
- return
- }
- })
- .catch(res => {
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- }
- },
- fail: () => {},
- complete: () => {}
- })
- },
- companyEdit(item) {
-
- uni.navigateTo({
- url: `/pageD/identity/companyIdentity?isEdit=${true}&id=${item.id}`
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .center {
- padding: 10px 20rpx;
- height:calc(100vh - 88rpx);
- }
- .title {
- font-size: 22px;
- font-weight: 900;
- /* margin-top: 30px; */
- top: 50px;
- left: 24px;
- position: relative;
- }
- .company {
- font-size: 18px;
- font-weight: 600;
- margin-top: 10px;
- display: inline-block;
- }
- .geren {
- color: #AFB3BF;
- font-size: 14px;
- margin-right: 10px;
- display: inline-block;
- /* margin-top: -15px;
- margin-bottom: 20px;
- margin-left: 46px; */
- }
- .infos {
- width: 100%;
- display: inline-table;
- }
- .info {
- line-height: 20px;
- }
- .but {
- border: 1px solid #CDCDCD;
- border-radius: 20px;
- padding: 8rpx 30rpx;
- text-align: center;
- margin-left: 20px;
- font-size: 14px;
- font-weight: 500;
- }
- .yuan {
- margin-top: 6px;
- font-size: 14px;
- font-weight: 500;
- }
- .homePage {
- width: 101%;
- height: 200px;
- margin: 20px auto;
- }
- .logo {
- width: 75rpx;
- height: 75rpx;
- background-color: #E9F8F0;
- color: #22C572;
- text-align: center;
- line-height: 75rpx;
- padding: 0 4rpx;
- border-radius: 6rpx;
- display: inline-block;
- margin-top: 20rpx;
- }
- .forList {
- background: #FFFFFF;
- margin-top: 10px;
- padding: 10px 10px;
- border-radius: 16px;
- }
- .status {
- /* position: absolute; */
- /* margin-top: 10px; */
- /* right: 36px; */
- color: #22C572;
- }
- .status1 {
- // position: absolute;
- // margin-top: 10px;
- // right: 36px;
- color: #FE6430;
- }
- .status2 {
- position: absolute;
- margin-top: 10px;
- right: 36px;
- color: #FB1E1E;
- }
- .status3 {
- position: absolute;
- margin-top: 10px;
- right: 36px;
- color: #AFB3BF;
- }
- .btn {
- margin-top: 10px;
- background-color: #FFFFFF;
- border-radius: 25px;
- border: none;
- }
- .btns {
- background-color: #22C572;
- color: white;
- margin: 52rpx 0;
- }
- .shade-content {
- background: #fff;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translateX(-50%) translateY(-50%);
- z-index: 2;
- text-align: center;
- border-radius: 20px;
- }
- .shade-content-item {
- width: 277px;
- text-align: center;
- height: 160rpx;
- padding: 35px 10px;
- }
- .shade-content-item1 {
- width: 277px;
- text-align: center;
- height: 160rpx;
- padding: 15px 10px;
- }
- .shade {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- background: rgba(0, 0, 0, 0.1);
- height: 100%;
- z-index: 2;
- }
- .titel {
- font-size: 18px;
- font-weight: 600;
- margin-top: 20px;
- }
- .bottom-btn{
- display: flex;
- justify-content: center;
- margin-bottom: 50rpx;
- }
- .determine {
- width: 50%;
- background-color: #22C572;
- color: #FFFFFF;
- border-radius: 10px;
- padding: 15rpx 18rpx;
- }
- .tainput {
- width: 70%;
- // padding-bottom: 15rpx;
- margin: 0 auto;
- text-align: left;
- border-bottom: 1px solid #AFB3BF;
- border-radius: 3px;
- }
- .tainput1 {
- width: 50%;
- padding-left: 10px;
- margin: 0 auto;
- text-align: left;
- /* border-bottom: 1px solid #AFB3BF; */
- border-radius: 3px;
- }
- .cancel {
- width: 20px;
- height: 20px;
- font-size: 20px;
- color: #AFB3BF;
- float: right;
- margin-right: 20px;
- margin-top: -25px;
- }
- .btns1 {
- width: 50%;
- font-size: 18px;
- line-height: 50px;
- text-align: center;
- border-top: 1px solid #EEEEEE;
- margin-top: -26px;
- }
- .btn1 {
- border-right: 1px solid #EEEEEE;
- color: #AFB3BF;
- }
- .btn2 {
- color: #22C572;
- }
- .default1 {
- width: 16px;
- height: 16px;
- border: 1px solid #AFB3BF;
- border-radius: 8px;
- text-align: center;
- line-height: 16px;
- color: #FFFFFF;
- margin-right: 3px;
- margin-top: 2px;
- }
- .default2 {
- width: 16px;
- height: 16px;
- /* border: 1px solid #AFB3BF; */
- border-radius: 8px;
- text-align: center;
- line-height: 16px;
- color: #FFFFFF;
- margin-right: 3px;
- margin-top: 2px;
- background-color: #22C572;
- }
- .options {
- justify-content: flex-end;
- }
- .forList-item {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #EEEEEE;
- padding-bottom: 20px;
- .left {
- margin-left: 5px;
- }
- .right {
- flex: 1;
- margin-left:10rpx
- }
- .top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .company {
- display: inline-block;
- }
- .bottom {
- width: 100%;
- }
- }
- .number{
- margin-top: 40rpx;
- }
- </style>
|