index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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. 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. uni.showToast({
  132. title: res.errmsg,
  133. icon: 'none',
  134. duration: 2000
  135. })
  136. });
  137. }
  138. },
  139. fail: () => {},
  140. complete: () => {}
  141. })
  142. }
  143. },
  144. liangShang(){
  145. uni.navigateTo({
  146. url: `/pages/attestation/indexTwo`
  147. })
  148. },
  149. siJi(){
  150. uni.navigateTo({
  151. url: `/pages/attestation/indexThree`
  152. })
  153. },
  154. driverIdentityEdit(items) {
  155. uni.navigateTo({
  156. url: `/pageD/identity/driverIdentityEdit?id=${items.id}`
  157. })
  158. },
  159. deleteLS(item) {
  160. uni.showModal({
  161. // title: '登录提示',
  162. content: '身份信息删除后不可恢复,是否确定删除?',
  163. showCancel: true,
  164. confirmText: '确定',
  165. success: (e) => {
  166. this.$api.doRequest('post',
  167. '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', {
  168. id: item.id
  169. }, 'application/json;charset=UTF-8').then(res => {
  170. this.procurementPlanInfos = res.data.data.records
  171. if (res.errmsg == "Success") {
  172. this.$api.msg('删除成功!')
  173. this.getList()
  174. return
  175. }
  176. })
  177. .catch(res => {
  178. uni.showToast({
  179. title: res.errmsg,
  180. icon: 'none',
  181. duration: 2000
  182. })
  183. });
  184. },
  185. fail: () => {},
  186. complete: () => {}
  187. })
  188. },
  189. deleteSJ(item) {
  190. this.deletes = {}
  191. this.deletes.id = item.id
  192. uni.showModal({
  193. // title: '登录提示',
  194. content: '身份信息删除后不可恢复,是否确定删除?',
  195. showCancel: true,
  196. confirmText: '确定',
  197. success: (e) => {
  198. this.$api.doRequest('get', '/driverViewInfo/api/deleteDriver', this.deletes,
  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. uni.showToast({
  209. title: res.errmsg,
  210. icon: 'none',
  211. duration: 2000
  212. })
  213. });
  214. },
  215. fail: () => {},
  216. complete: () => {}
  217. })
  218. },
  219. getList() {
  220. this.$api.doRequest('get', '/identityAuthenticationInfo/selectCount', {
  221. customerTypeFlag:3,customerType:"粮农"
  222. }, 'application/json;charset=UTF-8').then(res => {
  223. if(res.data.data){
  224. if(res.data.data.id == "" || res.data.data.id == null){
  225. this.changes = "确认"
  226. }else if(res.data.data.id != "" || res.data.data.id == null){
  227. this.changes = "取消"
  228. }
  229. this.id = res.data.data.id
  230. }
  231. })
  232. .catch(res => {
  233. uni.showToast({
  234. title: res.message,
  235. icon: 'none',
  236. duration: 2000
  237. })
  238. });
  239. },
  240. adddriver(index) {
  241. if (index == 1) {
  242. uni.navigateTo({
  243. url: `/pageD/identity/companyIdentity`
  244. })
  245. } else {
  246. uni.navigateTo({
  247. url: `/pageD/identity/driverIdentity`
  248. })
  249. }
  250. },
  251. navToDetailPage(index, item) {
  252. if (index == 1) {
  253. uni.navigateTo({
  254. url: `/pageD/identity/companyIdentityLook?id=${item.id}`
  255. })
  256. } else {
  257. uni.navigateTo({
  258. url: `/pageD/identity/driverIdentityLook?id=${item.id}`
  259. })
  260. }
  261. }
  262. }
  263. }
  264. </script>
  265. <style>
  266. .center {
  267. padding: 10px 20px;
  268. }
  269. .title {
  270. font-size: 22px;
  271. font-weight: 900;
  272. /* margin-top: 30px; */
  273. top: 50px;
  274. left: 24px;
  275. position: relative;
  276. }
  277. .company {
  278. font-size: 16px;
  279. margin-top: 10px;
  280. }
  281. .infos {
  282. /* margin: 10px 20px; */
  283. width: 100%;
  284. display: inline-table;
  285. }
  286. .info {
  287. line-height: 20px;
  288. }
  289. .but {
  290. right: 3px;
  291. float: right;
  292. }
  293. .homePage {
  294. width: 100%;
  295. height: 350rpx;
  296. margin-top: 20rpx;
  297. }
  298. .arrows {
  299. font-size: 14px;
  300. font-weight: 600;
  301. float: right;
  302. margin-top: 130px;
  303. }
  304. .arrow {
  305. width: 16px;
  306. height: 16px;
  307. float: right;
  308. right: 20px;
  309. }
  310. .portrait {
  311. width: 75px;
  312. height: 75px;
  313. float: right;
  314. right: -70px;
  315. }
  316. .homePage1 {
  317. width: 100%;
  318. height: 350rpx;
  319. margin-top: 50rpx;
  320. }
  321. .homePage2 {
  322. width: 100%;
  323. height: 350rpx;
  324. margin-top: 50rpx;
  325. }
  326. .background {
  327. width: 90%;
  328. height: 200px;
  329. margin: 0 auto;
  330. position: absolute;
  331. }
  332. .arrows1 {
  333. position: absolute;
  334. right: 30px;
  335. margin-top: 120px;
  336. }
  337. .portrait1 {
  338. width: 75px;
  339. height: 75px;
  340. margin-right: 20px;
  341. float: right;
  342. }
  343. </style>