123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494 |
- <template>
- <view class="center">
- <view class="homePage">
- <view @click="liangShang">
- <image src="../../static/img/authentication/bg@2x.png" class="background"></image>
- <view class="title-warp">
- <view>
- <view class="title">
- 粮商身份
- </view>
- <view class="textTips_Css">
- {{textTips}}
- </view>
- </view>
- <image src="../../static/img/authentication/liangshang@3x.png" class="portrait1"></image>
- </view>
- </view>
- <view class="arrows1" @click="addliangShang">
- <text style="margin-right: 30px;">新增身份</text>
- <image src="../../static/img/authentication/jiantou@3x.png" class="arrow"></image>
- </view>
- </view>
- <view class="homePage1">
- <view @click="siJi">
- <image src="../../static/img/authentication/bg@2x.png" class="background"></image>
-
- <view class="title-warp">
- <view>
- <view class="title">
- 司机身份
- </view>
- <view class="textTips_Css">
- {{textTips1}}
- </view>
- </view>
- <image src="../../static/img/authentication/siji@3x.png" class="portrait1"></image>
- </view>
- </view>
-
- <view class="arrows1" @click="addsiJi">
- <text style="margin-right: 30px;">新增身份</text>
- <image src="../../static/img/authentication/jiantou@3x.png" class="arrow"></image>
- </view>
- </view>
-
- <!-- <view class="homePage2">
- <image src="../../static/img/authentication/bg@2x.png" class="background"></image>
- <view class="title">
- 粮农身份
- </view>
- <view class="arrows1" @click="identityChange">
- <view style="margin-right: 30px;">{{changes}}</view>
- </view>
- <image src="../../static/img/authentication/farmer@2x.png" class="portrait1"></image>
- </view> -->
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- name: "buy",
- data() {
- return {
- PageCur: "buy",
- buyInfo: [],
- pages: 1, //页数
- limit: 10, //每次取条目数
- loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
- isLoadMore: false, //是否加载中
- showTran: true,
- scrollTop: 0,
- TabCur: 0,
- current: 1,
- changes:"确认",
- identityAuthenticationInfo: {
- pageSize: 10,
- currentPage: 1,
- commonId: "",
- },
- businessman: [],
- drivers: [],
- deletes: {
- id: "",
- },
- id:"",
- textTips:"",
- textTips1:"",
- };
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onLoad() {
- this.getList()
- },
-
- methods: {
- identityChange(){
- if(this.changes == '确认'){
- this.identityAuthenticationInfo.commonId = this.userInfo.id
- this.identityAuthenticationInfo.customerTypeFlag = 3
- this.identityAuthenticationInfo.customerType = "粮农"
- this.identityAuthenticationInfo.customerPhone = this.userInfo.phone
- uni.showModal({
- content: '确认后您将获得粮农身份,是否确认该身份?',
- showCancel: true,
- confirmText: '确定',
- success: (e) => {
- if (e.confirm) {
- this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this.identityAuthenticationInfo,
- 'application/json;charset=UTF-8').then(res => {
- if (res.data.message == "Success") {
- this.$api.msg('确认成功!')
- this.changes = "取消"
- this.getList()
- return
- }
- })
- .catch(res => {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 2000
- })
- });
- }
-
- },
- fail: () => {},
- complete: () => {}
- })
- }else if(this.changes == "取消"){
- this.identityAuthenticationInfo.commonId = this.userInfo.id
- this.identityAuthenticationInfo.customerTypeFlag = 3
- this.identityAuthenticationInfo.customerType = "粮农"
- this.identityAuthenticationInfo.id = this.id
- this.identityAuthenticationInfo.customerPhone = this.userInfo.phone
- uni.showModal({
- content: '确定取消粮农身份?',
- showCancel: true,
- confirmText: '确定',
- success: (e) => {
- if (e.confirm) {
- this.$api.doRequest('post', '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', this.identityAuthenticationInfo,
- 'application/json;charset=UTF-8').then(res => {
- if (res.data.message == "Success") {
- this.$api.msg('取消成功!')
- this.changes = "确认"
- 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: () => {}
- })
- }
- },
-
- liangShang(){
- uni.navigateTo({
- url: `/pages/attestation/indexTwo`
- })
- },
- addliangShang(){
- uni.navigateTo({
- url: `/pageD/identity/companyIdentity`
- })
- },
- siJi(){
- uni.navigateTo({
- url: `/pages/attestation/indexThree`
- })
- },
- addsiJi(){
- if(this.drivers.length > 0){
- uni.navigateTo({
- url: `/pages/attestation/indexThree`
- })
- }
- else{
- uni.navigateTo({
- url: `/pageD/identity/driverIdentity`
- })
- }
-
- },
- driverIdentityEdit(items) {
- uni.navigateTo({
- url: `/pageD/identity/driverIdentityEdit?id=${items.id}`
- })
- },
- deleteLS(item) {
- uni.showModal({
- // title: '提示',
- content: '身份信息删除后不可恢复,是否确定删除?',
- showCancel: true,
- confirmText: '确定',
- success: (e) => {
- 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.errmsg == "Success") {
- 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: () => {}
- })
- },
- deleteSJ(item) {
- this.deletes = {}
- this.deletes.id = item.id
- uni.showModal({
- // title: '提示',
- content: '身份信息删除后不可恢复,是否确定删除?',
- showCancel: true,
- confirmText: '确定',
- success: (e) => {
- this.$api.doRequest('get', '/driverViewInfo/api/deleteDriver', this.deletes,
- 'application/json;charset=UTF-8').then(res => {
- this.procurementPlanInfos = res.data.data.records
- if (res.errmsg == "Success") {
- 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: () => {}
- })
- },
- getList() {
- this.identityAuthenticationInfo.commonId = this.userInfo.id
- this.$api.doRequest('get', '/driverViewInfo/selectDriverInfoPage', {
- pageSize: 10,
- currentPage: 1,
- commonId: this.userInfo.id,
- pcFlag: 0
- }, 'application/json;charset=UTF-8').then(res => {
- console.log(res.data.data.records)
- for(var i = 0 ; i < res.data.data.records.length ; i++){
- res.data.data.records[i].logo = res.data.data.records[i].driverName.substr(0,1)
- }
-
- this.drivers = res.data.data.records
- })
- .catch(res => {
- if(res.errmsg){
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- }
- else{
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- //查看是否有粮商身份
- this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
- if(res.data.code==11016){
- this.textTips = "您还未认证粮商身份"
- }
- })
- // 查看是否有司机身份
- this.$api.doRequest('get', '/driverViewInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
- if(res.data.code==11019){
- this.textTips1 = "您还未认证司机身份"
- }
- //res.data.code==11020 司机身份在审核
- })
-
- // this.$api.doRequest('get', '/identityAuthenticationInfo/selectCount', {
- // customerTypeFlag:3,customerType:"粮农"
- // }, 'application/json;charset=UTF-8').then(res => {
- // if(res.data.data){
- // if(res.data.data.id == "" || res.data.data.id == null){
- // this.changes = "确认"
- // }else if(res.data.data.id != "" || res.data.data.id == null){
- // this.changes = "取消"
- // }
- // this.id = res.data.data.id
- // }
- // })
- // .catch(res => {
- // if(res.errmsg){
- // uni.showToast({
- // title: res.errmsg,
- // icon: 'none',
- // duration: 2000
- // })
- // }
- // else{
- // uni.showToast({
- // title: "系统异常,请联系管理员",
- // icon: 'none',
- // duration: 2000
- // })
- // }
- // });
- },
- adddriver(index) {
- if (index == 1) {
- uni.navigateTo({
- url: `/pageD/identity/companyIdentity`
- })
- } else {
- uni.navigateTo({
- url: `/pageD/identity/driverIdentity`
- })
- }
- },
- navToDetailPage(index, item) {
- if (index == 1) {
- uni.navigateTo({
- url: `/pageD/identity/companyIdentityLook?id=${item.id}`
- })
- } else {
- uni.navigateTo({
- url: `/pageD/identity/driverIdentityLook?id=${item.id}`
- })
- }
- }
- }
- }
- </script>
- <style scoped>
- .center {
- overflow-x: hidden;
- padding: 0rpx 10rpx;
- height: calc(100vh - 90rpx);
- }
- .title {
- font-size: 22px;
- font-weight: 600;
- }
- .title-warp{
- position: absolute;
- width: calc(100% - 40rpx);
- z-index: 2;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 35rpx;
- top: 80rpx;
- left: 10rpx;
- }
- .company {
- font-size: 16px;
- margin-top: 10px;
- }
- .infos {
- width: 100%;
- display: inline-table;
- }
- .info {
- line-height: 20px;
- }
- .but {
- right: 3px;
- float: right;
- }
- .homePage {
- width: 100%;
- height: 350rpx;
- margin-top: 8rpx;
- position: relative;
- }
- .arrows {
- font-size: 14px;
- font-weight: 600;
- float: right;
- margin-top: 130px;
- }
- .arrow {
- width: 36rpx;
- height: 26rpx;
- float: right;
- right: 20px;
- top: 6rpx;
- }
- .portrait {
- width: 75px;
- height: 75px;
- float: right;
- right: -70px;
- }
- .homePage1,.homePage2 {
- width: 100%;
- height: 350rpx;
- margin-top: 50rpx;
- position: relative;
- }
- .background {
- width: 100%;
- height: 200px;
- }
- .arrows1 {
- position: absolute;
- right: 10rpx;
- bottom: 4rpx;
- z-index: 3;
- }
- .portrait1 {
- width:150rpx;
- height:150rpx;
- border-radius: 8rpx;
- }
- .textTips_Css{
- color: #AFB3BF;
- font-size: 28rpx;
- margin-top: 10rpx;
- }
- </style>
|