index.vue 9.7 KB

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