index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <template>
  2. <view class="center">
  3. <view class="homePage">
  4. <view @click="liangShang">
  5. <image src="../../static/img/authentication/bg@2x.png" class="background"></image>
  6. <view class="title-warp">
  7. <view>
  8. <view class="title">
  9. 粮商身份
  10. </view>
  11. <view class="textTips_Css">
  12. {{textTips}}
  13. </view>
  14. </view>
  15. <image src="../../static/img/authentication/liangshang@3x.png" class="portrait1"></image>
  16. </view>
  17. </view>
  18. <view class="arrows1" @click="addliangShang">
  19. <text style="margin-right: 30px;">新增身份</text>
  20. <image src="../../static/img/authentication/jiantou@3x.png" class="arrow"></image>
  21. </view>
  22. </view>
  23. <view class="homePage1">
  24. <view @click="siJi">
  25. <image src="../../static/img/authentication/bg@2x.png" class="background"></image>
  26. <view class="title-warp">
  27. <view>
  28. <view class="title">
  29. 司机身份
  30. </view>
  31. <view class="textTips_Css">
  32. {{textTips1}}
  33. </view>
  34. </view>
  35. <image src="../../static/img/authentication/siji@3x.png" class="portrait1"></image>
  36. </view>
  37. </view>
  38. <view class="arrows1" @click="addsiJi">
  39. <text style="margin-right: 30px;">新增身份</text>
  40. <image src="../../static/img/authentication/jiantou@3x.png" class="arrow"></image>
  41. </view>
  42. </view>
  43. <!-- <view class="homePage2">
  44. <image src="../../static/img/authentication/bg@2x.png" class="background"></image>
  45. <view class="title">
  46. 粮农身份
  47. </view>
  48. <view class="arrows1" @click="identityChange">
  49. <view style="margin-right: 30px;">{{changes}}</view>
  50. </view>
  51. <image src="../../static/img/authentication/farmer@2x.png" class="portrait1"></image>
  52. </view> -->
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. mapState
  58. } from 'vuex';
  59. export default {
  60. name: "buy",
  61. data() {
  62. return {
  63. PageCur: "buy",
  64. buyInfo: [],
  65. pages: 1, //页数
  66. limit: 10, //每次取条目数
  67. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  68. isLoadMore: false, //是否加载中
  69. showTran: true,
  70. scrollTop: 0,
  71. TabCur: 0,
  72. current: 1,
  73. changes:"确认",
  74. identityAuthenticationInfo: {
  75. pageSize: 10,
  76. currentPage: 1,
  77. commonId: "",
  78. },
  79. businessman: [],
  80. drivers: [],
  81. deletes: {
  82. id: "",
  83. },
  84. id:"",
  85. textTips:"",
  86. textTips1:"",
  87. };
  88. },
  89. computed: {
  90. ...mapState(['hasLogin', 'userInfo'])
  91. },
  92. onLoad() {
  93. this.getList()
  94. },
  95. methods: {
  96. identityChange(){
  97. if(this.changes == '确认'){
  98. this.identityAuthenticationInfo.commonId = this.userInfo.id
  99. this.identityAuthenticationInfo.customerTypeFlag = 3
  100. this.identityAuthenticationInfo.customerType = "粮农"
  101. this.identityAuthenticationInfo.customerPhone = this.userInfo.phone
  102. uni.showModal({
  103. content: '确认后您将获得粮农身份,是否确认该身份?',
  104. showCancel: true,
  105. confirmText: '确定',
  106. success: (e) => {
  107. if (e.confirm) {
  108. this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this.identityAuthenticationInfo,
  109. 'application/json;charset=UTF-8').then(res => {
  110. if (res.data.message == "Success") {
  111. this.$api.msg('确认成功!')
  112. this.changes = "取消"
  113. this.getList()
  114. return
  115. }
  116. })
  117. .catch(res => {
  118. uni.showToast({
  119. title: res.message,
  120. icon: 'none',
  121. duration: 2000
  122. })
  123. });
  124. }
  125. },
  126. fail: () => {},
  127. complete: () => {}
  128. })
  129. }else if(this.changes == "取消"){
  130. this.identityAuthenticationInfo.commonId = this.userInfo.id
  131. this.identityAuthenticationInfo.customerTypeFlag = 3
  132. this.identityAuthenticationInfo.customerType = "粮农"
  133. this.identityAuthenticationInfo.id = this.id
  134. this.identityAuthenticationInfo.customerPhone = this.userInfo.phone
  135. uni.showModal({
  136. content: '确定取消粮农身份?',
  137. showCancel: true,
  138. confirmText: '确定',
  139. success: (e) => {
  140. if (e.confirm) {
  141. this.$api.doRequest('post', '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', this.identityAuthenticationInfo,
  142. 'application/json;charset=UTF-8').then(res => {
  143. if (res.data.message == "Success") {
  144. this.$api.msg('取消成功!')
  145. this.changes = "确认"
  146. this.getList()
  147. return
  148. }
  149. })
  150. .catch(res => {
  151. if(res.errmsg){
  152. uni.showToast({
  153. title: res.errmsg,
  154. icon: 'none',
  155. duration: 2000
  156. })
  157. }
  158. else{
  159. uni.showToast({
  160. title: "系统异常,请联系管理员",
  161. icon: 'none',
  162. duration: 2000
  163. })
  164. }
  165. });
  166. }
  167. },
  168. fail: () => {},
  169. complete: () => {}
  170. })
  171. }
  172. },
  173. liangShang(){
  174. uni.navigateTo({
  175. url: `/pages/attestation/indexTwo`
  176. })
  177. },
  178. addliangShang(){
  179. uni.navigateTo({
  180. url: `/pageD/identity/companyIdentity`
  181. })
  182. },
  183. siJi(){
  184. uni.navigateTo({
  185. url: `/pages/attestation/indexThree`
  186. })
  187. },
  188. addsiJi(){
  189. if(this.drivers.length > 0){
  190. uni.navigateTo({
  191. url: `/pages/attestation/indexThree`
  192. })
  193. }
  194. else{
  195. uni.navigateTo({
  196. url: `/pageD/identity/driverIdentity`
  197. })
  198. }
  199. },
  200. driverIdentityEdit(items) {
  201. uni.navigateTo({
  202. url: `/pageD/identity/driverIdentityEdit?id=${items.id}`
  203. })
  204. },
  205. deleteLS(item) {
  206. uni.showModal({
  207. // title: '提示',
  208. content: '身份信息删除后不可恢复,是否确定删除?',
  209. showCancel: true,
  210. confirmText: '确定',
  211. success: (e) => {
  212. this.$api.doRequest('post',
  213. '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', {
  214. id: item.id
  215. }, 'application/json;charset=UTF-8').then(res => {
  216. this.procurementPlanInfos = res.data.data.records
  217. if (res.errmsg == "Success") {
  218. this.$api.msg('删除成功!')
  219. this.getList()
  220. return
  221. }
  222. })
  223. .catch(res => {
  224. if(res.errmsg){
  225. uni.showToast({
  226. title: res.errmsg,
  227. icon: 'none',
  228. duration: 2000
  229. })
  230. }
  231. else{
  232. uni.showToast({
  233. title: "系统异常,请联系管理员",
  234. icon: 'none',
  235. duration: 2000
  236. })
  237. }
  238. });
  239. },
  240. fail: () => {},
  241. complete: () => {}
  242. })
  243. },
  244. deleteSJ(item) {
  245. this.deletes = {}
  246. this.deletes.id = item.id
  247. uni.showModal({
  248. // title: '提示',
  249. content: '身份信息删除后不可恢复,是否确定删除?',
  250. showCancel: true,
  251. confirmText: '确定',
  252. success: (e) => {
  253. this.$api.doRequest('get', '/driverViewInfo/api/deleteDriver', this.deletes,
  254. 'application/json;charset=UTF-8').then(res => {
  255. this.procurementPlanInfos = res.data.data.records
  256. if (res.errmsg == "Success") {
  257. this.$api.msg('删除成功!')
  258. this.getList()
  259. return
  260. }
  261. })
  262. .catch(res => {
  263. if(res.errmsg){
  264. uni.showToast({
  265. title: res.errmsg,
  266. icon: 'none',
  267. duration: 2000
  268. })
  269. }
  270. else{
  271. uni.showToast({
  272. title: "系统异常,请联系管理员",
  273. icon: 'none',
  274. duration: 2000
  275. })
  276. }
  277. });
  278. },
  279. fail: () => {},
  280. complete: () => {}
  281. })
  282. },
  283. getList() {
  284. this.identityAuthenticationInfo.commonId = this.userInfo.id
  285. this.$api.doRequest('get', '/driverViewInfo/selectDriverInfoPage', {
  286. pageSize: 10,
  287. currentPage: 1,
  288. commonId: this.userInfo.id,
  289. pcFlag: 0
  290. }, 'application/json;charset=UTF-8').then(res => {
  291. console.log(res.data.data.records)
  292. for(var i = 0 ; i < res.data.data.records.length ; i++){
  293. res.data.data.records[i].logo = res.data.data.records[i].driverName.substr(0,1)
  294. }
  295. this.drivers = res.data.data.records
  296. })
  297. .catch(res => {
  298. if(res.errmsg){
  299. uni.showToast({
  300. title: res.errmsg,
  301. icon: 'none',
  302. duration: 2000
  303. })
  304. }
  305. else{
  306. uni.showToast({
  307. title: "系统异常,请联系管理员",
  308. icon: 'none',
  309. duration: 2000
  310. })
  311. }
  312. });
  313. //查看是否有粮商身份
  314. this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
  315. if(res.data.code==11016){
  316. this.textTips = "您还未认证粮商身份"
  317. }
  318. })
  319. // 查看是否有司机身份
  320. this.$api.doRequest('get', '/driverViewInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
  321. if(res.data.code==11019){
  322. this.textTips1 = "您还未认证司机身份"
  323. }
  324. //res.data.code==11020 司机身份在审核
  325. })
  326. // this.$api.doRequest('get', '/identityAuthenticationInfo/selectCount', {
  327. // customerTypeFlag:3,customerType:"粮农"
  328. // }, 'application/json;charset=UTF-8').then(res => {
  329. // if(res.data.data){
  330. // if(res.data.data.id == "" || res.data.data.id == null){
  331. // this.changes = "确认"
  332. // }else if(res.data.data.id != "" || res.data.data.id == null){
  333. // this.changes = "取消"
  334. // }
  335. // this.id = res.data.data.id
  336. // }
  337. // })
  338. // .catch(res => {
  339. // if(res.errmsg){
  340. // uni.showToast({
  341. // title: res.errmsg,
  342. // icon: 'none',
  343. // duration: 2000
  344. // })
  345. // }
  346. // else{
  347. // uni.showToast({
  348. // title: "系统异常,请联系管理员",
  349. // icon: 'none',
  350. // duration: 2000
  351. // })
  352. // }
  353. // });
  354. },
  355. adddriver(index) {
  356. if (index == 1) {
  357. uni.navigateTo({
  358. url: `/pageD/identity/companyIdentity`
  359. })
  360. } else {
  361. uni.navigateTo({
  362. url: `/pageD/identity/driverIdentity`
  363. })
  364. }
  365. },
  366. navToDetailPage(index, item) {
  367. if (index == 1) {
  368. uni.navigateTo({
  369. url: `/pageD/identity/companyIdentityLook?id=${item.id}`
  370. })
  371. } else {
  372. uni.navigateTo({
  373. url: `/pageD/identity/driverIdentityLook?id=${item.id}`
  374. })
  375. }
  376. }
  377. }
  378. }
  379. </script>
  380. <style scoped>
  381. .center {
  382. overflow-x: hidden;
  383. padding: 0rpx 10rpx;
  384. height: calc(100vh - 90rpx);
  385. }
  386. .title {
  387. font-size: 22px;
  388. font-weight: 600;
  389. }
  390. .title-warp{
  391. position: absolute;
  392. width: calc(100% - 40rpx);
  393. z-index: 2;
  394. display: flex;
  395. align-items: center;
  396. justify-content: space-between;
  397. padding: 0 35rpx;
  398. top: 80rpx;
  399. left: 10rpx;
  400. }
  401. .company {
  402. font-size: 16px;
  403. margin-top: 10px;
  404. }
  405. .infos {
  406. width: 100%;
  407. display: inline-table;
  408. }
  409. .info {
  410. line-height: 20px;
  411. }
  412. .but {
  413. right: 3px;
  414. float: right;
  415. }
  416. .homePage {
  417. width: 100%;
  418. height: 350rpx;
  419. margin-top: 8rpx;
  420. position: relative;
  421. }
  422. .arrows {
  423. font-size: 14px;
  424. font-weight: 600;
  425. float: right;
  426. margin-top: 130px;
  427. }
  428. .arrow {
  429. width: 36rpx;
  430. height: 26rpx;
  431. float: right;
  432. right: 20px;
  433. top: 6rpx;
  434. }
  435. .portrait {
  436. width: 75px;
  437. height: 75px;
  438. float: right;
  439. right: -70px;
  440. }
  441. .homePage1,.homePage2 {
  442. width: 100%;
  443. height: 350rpx;
  444. margin-top: 50rpx;
  445. position: relative;
  446. }
  447. .background {
  448. width: 100%;
  449. height: 200px;
  450. }
  451. .arrows1 {
  452. position: absolute;
  453. right: 10rpx;
  454. bottom: 4rpx;
  455. z-index: 3;
  456. }
  457. .portrait1 {
  458. width:150rpx;
  459. height:150rpx;
  460. border-radius: 8rpx;
  461. }
  462. .textTips_Css{
  463. color: #AFB3BF;
  464. font-size: 28rpx;
  465. margin-top: 10rpx;
  466. }
  467. </style>