index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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">
  6. 粮商身份
  7. </view>
  8. <view class="arrows1" @click="liangShang">
  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">
  17. 司机身份
  18. </view>
  19. <view class="arrows1" @click="siJi">
  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. uni.showModal({
  82. content: '确认后您将获得粮农身份,是否确认该身份?',
  83. showCancel: true,
  84. confirmText: '确定',
  85. success: (e) => {
  86. this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this.identityAuthenticationInfo,
  87. 'application/json;charset=UTF-8').then(res => {
  88. // this.procurementPlanInfos = res.data.data.records
  89. console.log("成功!")
  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.errmsg,
  100. icon: 'none',
  101. duration: 2000
  102. })
  103. });
  104. },
  105. fail: () => {},
  106. complete: () => {}
  107. })
  108. }else if(this.changes == "取消"){
  109. this.identityAuthenticationInfo.commonId = this.userInfo.id
  110. this.identityAuthenticationInfo.customerTypeFlag = 3
  111. this.identityAuthenticationInfo.customerType = "粮农"
  112. this.identityAuthenticationInfo.id = this.id
  113. uni.showModal({
  114. content: '确定取消粮农身份?',
  115. showCancel: true,
  116. confirmText: '确定',
  117. success: (e) => {
  118. this.$api.doRequest('post', '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', this.identityAuthenticationInfo,
  119. 'application/json;charset=UTF-8').then(res => {
  120. console.log(res.data.message,"判断")
  121. console.log(res)
  122. if (res.data.message == "Success") {
  123. this.$api.msg('取消成功!')
  124. this.changes = "确认"
  125. this.getList()
  126. return
  127. }
  128. })
  129. .catch(res => {
  130. uni.showToast({
  131. title: res.errmsg,
  132. icon: 'none',
  133. duration: 2000
  134. })
  135. });
  136. },
  137. fail: () => {},
  138. complete: () => {}
  139. })
  140. }
  141. },
  142. liangShang(){
  143. uni.navigateTo({
  144. url: `/pages/attestation/indexTwo`
  145. })
  146. },
  147. siJi(){
  148. uni.navigateTo({
  149. url: `/pages/attestation/indexThree`
  150. })
  151. },
  152. driverIdentityEdit(items) {
  153. uni.navigateTo({
  154. url: `/pageD/identity/driverIdentityEdit?id=${items.id}`
  155. })
  156. },
  157. // companyEdit(item) {
  158. // uni.navigateTo({
  159. // url: `/pageD/identity/companyIdentityEdit?id=${item.id}`
  160. // })
  161. // },
  162. deleteLS(item) {
  163. uni.showModal({
  164. // title: '登录提示',
  165. content: '身份信息删除后不可恢复,是否确定删除?',
  166. showCancel: true,
  167. confirmText: '确定',
  168. success: (e) => {
  169. this.$api.doRequest('post',
  170. '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', {
  171. id: item.id
  172. }, 'application/json;charset=UTF-8').then(res => {
  173. this.procurementPlanInfos = res.data.data.records
  174. if (res.errmsg == "Success") {
  175. this.$api.msg('删除成功!')
  176. this.getList()
  177. return
  178. }
  179. })
  180. .catch(res => {
  181. uni.showToast({
  182. title: res.errmsg,
  183. icon: 'none',
  184. duration: 2000
  185. })
  186. });
  187. },
  188. fail: () => {},
  189. complete: () => {}
  190. })
  191. },
  192. deleteSJ(item) {
  193. console.log(item.driverName)
  194. this.deletes = {}
  195. this.deletes.id = item.id
  196. uni.showModal({
  197. // title: '登录提示',
  198. content: '身份信息删除后不可恢复,是否确定删除?',
  199. showCancel: true,
  200. confirmText: '确定',
  201. success: (e) => {
  202. this.$api.doRequest('get', '/driverViewInfo/api/deleteDriver', this.deletes,
  203. 'application/json;charset=UTF-8').then(res => {
  204. this.procurementPlanInfos = res.data.data.records
  205. if (res.errmsg == "Success") {
  206. this.$api.msg('删除成功!')
  207. this.getList()
  208. return
  209. }
  210. })
  211. .catch(res => {
  212. uni.showToast({
  213. title: res.errmsg,
  214. icon: 'none',
  215. duration: 2000
  216. })
  217. });
  218. },
  219. fail: () => {},
  220. complete: () => {}
  221. })
  222. },
  223. getList() {
  224. // this.identityAuthenticationInfo.commonId = this.userInfo.id
  225. // this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
  226. // pageSize: 10,
  227. // currentPage: 1,
  228. // commonId: this.userInfo.id
  229. // }, 'application/json;charset=UTF-8').then(res => {
  230. // console.log("成功连接")
  231. // this.businessman = res.data.data.records
  232. // })
  233. // .catch(res => {
  234. // uni.showToast({
  235. // title: res.errmsg,
  236. // icon: 'none',
  237. // duration: 2000
  238. // })
  239. // });
  240. // this.$api.doRequest('get', '/driverViewInfo/selectDriverInfoPage', {
  241. // pageSize: 10,
  242. // currentPage: 1,
  243. // commonId: this.userInfo.id,
  244. // flag: 0
  245. // }, 'application/json;charset=UTF-8').then(res => {
  246. // console.log("成功连接")
  247. // this.drivers = res.data.data.records
  248. // console.log(this.drivers, "skalkdkk")
  249. // })
  250. // .catch(res => {
  251. // uni.showToast({
  252. // title: res.errmsg,
  253. // icon: 'none',
  254. // duration: 2000
  255. // })
  256. // });
  257. this.$api.doRequest('get', '/identityAuthenticationInfo/selectCount', {
  258. customerTypeFlag:3,customerType:"粮农"
  259. }, 'application/json;charset=UTF-8').then(res => {
  260. if(res.data.data.id == "" || res.data.data.id == null){
  261. this.changes = "确认"
  262. }else if(res.data.data.id != "" || res.data.data.id == null){
  263. this.changes = "取消"
  264. }
  265. this.id = res.data.data.id
  266. })
  267. .catch(res => {
  268. uni.showToast({
  269. title: res.errmsg,
  270. icon: 'none',
  271. duration: 2000
  272. })
  273. });
  274. },
  275. adddriver(index) {
  276. if (index == 1) {
  277. uni.navigateTo({
  278. url: `/pageD/identity/companyIdentity`
  279. })
  280. } else {
  281. uni.navigateTo({
  282. url: `/pageD/identity/driverIdentity`
  283. })
  284. }
  285. },
  286. navToDetailPage(index, item) {
  287. if (index == 1) {
  288. uni.navigateTo({
  289. url: `/pageD/identity/companyIdentityLook?id=${item.id}`
  290. })
  291. } else {
  292. uni.navigateTo({
  293. url: `/pageD/identity/driverIdentityLook?id=${item.id}`
  294. })
  295. }
  296. }
  297. }
  298. }
  299. </script>
  300. <style>
  301. .center {
  302. padding: 10px 20px;
  303. }
  304. .title {
  305. font-size: 22px;
  306. font-weight: 900;
  307. /* margin-top: 30px; */
  308. top: 50px;
  309. left: 24px;
  310. position: relative;
  311. }
  312. .company {
  313. font-size: 16px;
  314. margin-top: 10px;
  315. }
  316. .infos {
  317. /* margin: 10px 20px; */
  318. width: 100%;
  319. display: inline-table;
  320. }
  321. .info {
  322. line-height: 20px;
  323. }
  324. .but {
  325. right: 3px;
  326. float: right;
  327. }
  328. .homePage {
  329. width: 100%;
  330. height: 200px;
  331. margin-top: 20px;
  332. }
  333. .arrows {
  334. font-size: 14px;
  335. font-weight: 600;
  336. float: right;
  337. margin-top: 130px;
  338. }
  339. .arrow {
  340. width: 16px;
  341. height: 16px;
  342. float: right;
  343. right: 20px;
  344. }
  345. .portrait {
  346. width: 75px;
  347. height: 75px;
  348. float: right;
  349. right: -70px;
  350. }
  351. .homePage1 {
  352. width: 100%;
  353. height: 200px;
  354. margin-top: 20px;
  355. }
  356. .homePage2 {
  357. width: 100%;
  358. height: 200px;
  359. margin-top: 20px;
  360. }
  361. .background {
  362. width: 90%;
  363. height: 200px;
  364. margin: 0 auto;
  365. position: absolute;
  366. }
  367. .arrows1 {
  368. position: absolute;
  369. right: 30px;
  370. margin-top: 120px;
  371. }
  372. .portrait1 {
  373. width: 75px;
  374. height: 75px;
  375. margin-right: 20px;
  376. float: right;
  377. }
  378. </style>