index.vue 11 KB

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