index.vue 11 KB

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