Identity_switching.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view class="center">
  3. <view v-if='lists.length>0'>
  4. <view v-for="(item , index) in lists" :Key="index">
  5. <view @click="navToDetailPage(item)" class="forList">
  6. <view class="flex">
  7. <view class="company" v-if="item.customerType == '企业'">{{item.customerType}}</view>
  8. <view class="company1" v-if="item.customerType == '个人'">{{item.customerType}}</view>
  9. <view class="infos">
  10. <view class="info1">
  11. <text v-if='item.customerTypeFlag==1'>{{item.customerName}}</text>
  12. <text v-if='item.customerTypeFlag==2'>{{item.compName}}</text>
  13. <view class='but but1' v-if="item.authenticationStatus == '已认证'">{{item.authenticationStatus}}</view>
  14. <view class='but but2' v-if="item.authenticationStatus == '审核中'">{{item.authenticationStatus}}</view>
  15. <view class='but but3' v-if="item.authenticationStatus == '未通过'">{{item.authenticationStatus}}</view>
  16. <view class='but but4' v-if="item.authenticationStatus == '已覆盖'">{{item.authenticationStatus}}</view>
  17. </view>
  18. <view class="info2">{{item.customerPhone}}</view>
  19. </view>
  20. </view>
  21. <hr style="margin: 10px 0px;">
  22. <label>
  23. <checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
  24. <text>设置默认</text>
  25. </label>
  26. </view>
  27. </view>
  28. </view>
  29. <view style='text-align:center;' v-else>
  30. 当前暂无已认证的粮商身份
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. mapState
  37. } from 'vuex';
  38. export default {
  39. name: "buy",
  40. data() {
  41. return {
  42. lists:[],
  43. PageCur: "buy",
  44. buyInfo: [],
  45. pages: 1, //页数
  46. limit: 10, //每次取条目数
  47. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  48. isLoadMore: false, //是否加载中
  49. showTran: true,
  50. scrollTop: 0,
  51. TabCur: 0,
  52. current: 1,
  53. id:0,
  54. checked:false,
  55. status:0,
  56. goodsName:'',
  57. receivePrivate:'',
  58. receiveCity:'',
  59. receiveArea:'',
  60. minimumVolume:'',
  61. basis:'',
  62. buyer:'',
  63. unitPrice:'',
  64. receiveWarehouse:'',
  65. procurementPlanType:'',
  66. procurementPlan:'',
  67. identityAuthenticationInfo: {
  68. pageSize: 10,
  69. currentPage: 1,
  70. commonId: "",
  71. },
  72. };
  73. },
  74. onLoad(options) {
  75. this.status=options.status
  76. },
  77. onShow(){
  78. this.getList()
  79. },
  80. computed: {
  81. ...mapState(['hasLogin', 'userInfo'])
  82. },
  83. methods: {
  84. getList() {
  85. console.log(this.userInfo)
  86. this.identityAuthenticationInfo.commonId = this.userInfo.id
  87. this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
  88. pageSize: 10,
  89. currentPage: 1,
  90. commonId: this.userInfo.id,
  91. flag:1
  92. }, 'application/json;charset=UTF-8').then(res => {
  93. if(res.data.code==200){
  94. for(var i=0;i<res.data.data.records.length;i++){
  95. if(res.data.data.records[i].defaultFlag!=1){
  96. res.data.data.records[i].checked=false
  97. }else{
  98. res.data.data.records[i].checked=true
  99. }
  100. }
  101. this.lists = res.data.data.records
  102. }
  103. })
  104. .catch(res => {
  105. if(res.errmsg){
  106. uni.showToast({
  107. title: res.errmsg,
  108. icon: 'none',
  109. duration: 2000
  110. })
  111. }
  112. else{
  113. uni.showToast({
  114. title: "系统异常,请联系管理员",
  115. icon: 'none',
  116. duration: 2000
  117. })
  118. }
  119. });
  120. },
  121. checkBox(e,item){
  122. for(var i=0;i<this.lists.length;i++){
  123. this.lists[i].checked=true
  124. }
  125. item.checked=true
  126. this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
  127. id:item.id,
  128. commonId: this.userInfo.id
  129. }).then(res => {
  130. if(res.data.code==200){
  131. // this.lists = res.data.data.records
  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. // adddriver(index) {
  152. // if (index == 1) {
  153. // uni.navigateTo({
  154. // url: `/pageD/identity/companyIdentity`
  155. // })
  156. // } else {
  157. // uni.navigateTo({
  158. // url: `/pageD/identity/driverIdentity`
  159. // })
  160. // }
  161. // },
  162. navToDetailPage(item) {
  163. console.log(11111)
  164. var url=''
  165. if(this.status==1){
  166. url='/pageD/myRelease/buyGrain'
  167. }else{
  168. url='/pageD/myRelease/sellGrain'
  169. }
  170. // if (index == 1) {
  171. if(item.customerTypeFlag==1){
  172. uni.navigateTo({
  173. url: url+`?id=${item.id}&customerName=${item.customerName}`
  174. })
  175. }else{
  176. uni.navigateTo({
  177. url: url+`?id=${item.id}&customerName=${item.compName}`
  178. })
  179. }
  180. },
  181. // } else {
  182. // uni.navigateTo({
  183. // url: `/pageD/identity/driverIdentityLook`
  184. // })
  185. // }
  186. }
  187. }
  188. </script>
  189. <style>
  190. .center {
  191. padding: 10px 20px;
  192. background-color: #F5F6FA;
  193. }
  194. .title {
  195. font-size: 18px;
  196. font-weight: 900;
  197. margin-right: 20px;
  198. display: initial;
  199. }
  200. .company {
  201. width: 35px;
  202. height: 35px;
  203. background-color: #E9F8F0;
  204. font-size: 16px;
  205. margin-top: 10px;
  206. border-radius: 5px;
  207. text-align: center;
  208. line-height: 35px;
  209. color: #22C572;
  210. font-size: 12px;
  211. }
  212. .company1{
  213. width: 35px;
  214. height: 35px;
  215. background-color: #FEECE6;
  216. font-size: 16px;
  217. margin-top: 10px;
  218. border-radius: 5px;
  219. text-align: center;
  220. line-height: 35px;
  221. color:#FE6430;
  222. font-size: 12px;
  223. }
  224. .infos {
  225. /* margin: 10px 20px; */
  226. width: 100%;
  227. display: inline-table;
  228. }
  229. .info {
  230. line-height: 20px;
  231. }
  232. .but {
  233. margin-right: 30px;
  234. float: right;
  235. font-size: 14px;
  236. background-color: #FFFFFF;
  237. }
  238. .but1{
  239. color: #22C572 ;
  240. }
  241. .but2{
  242. color:#FE6430;
  243. }
  244. .but3{
  245. color:#FB1E1E;
  246. }
  247. .but4{
  248. color:#AFB3BF;
  249. }
  250. .forList{
  251. background-color: #FFFFFF;
  252. padding: 10px 10px;
  253. border-radius: 10px;
  254. margin-top: 10px;
  255. }
  256. /* .guess-item{
  257. font-size: 18px;
  258. margin-left: 20px;
  259. font-weight: 700;
  260. } */
  261. .info1{
  262. font-size: 18px;
  263. margin-left: 20px;
  264. font-weight: 700;
  265. }
  266. .info2{
  267. margin-left: 20px;
  268. color: #AFB3BF;
  269. }
  270. </style>