Identity_switching.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. goodsName:'',
  56. receivePrivate:'',
  57. receiveCity:'',
  58. receiveArea:'',
  59. minimumVolume:'',
  60. basis:'',
  61. buyer:'',
  62. unitPrice:'',
  63. receiveWarehouse:'',
  64. procurementPlanType:'',
  65. procurementPlan:'',
  66. identityAuthenticationInfo: {
  67. pageSize: 10,
  68. currentPage: 1,
  69. commonId: "",
  70. },
  71. };
  72. },
  73. onLoad(options) {
  74. this.id=options.id
  75. },
  76. onShow(){
  77. this.getList()
  78. },
  79. computed: {
  80. ...mapState(['hasLogin', 'userInfo'])
  81. },
  82. methods: {
  83. getList() {
  84. console.log(this.userInfo)
  85. this.identityAuthenticationInfo.commonId = this.userInfo.id
  86. this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
  87. pageSize: 10,
  88. currentPage: 1,
  89. commonId: this.userInfo.id,
  90. flag:1
  91. }, 'application/json;charset=UTF-8').then(res => {
  92. if(res.data.code==200){
  93. for(var i=0;i<res.data.data.records.length;i++){
  94. if(res.data.data.records[i].defaultFlag!=1){
  95. res.data.data.records[i].checked=false
  96. }else{
  97. res.data.data.records[i].checked=true
  98. }
  99. }
  100. this.lists = res.data.data.records
  101. }
  102. })
  103. .catch(res => {
  104. uni.showToast({
  105. title: res.errmsg,
  106. icon: 'none',
  107. duration: 2000
  108. })
  109. });
  110. },
  111. checkBox(e,item){
  112. for(var i=0;i<this.lists.length;i++){
  113. this.lists[i].checked=true
  114. }
  115. item.checked=true
  116. this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
  117. id:item.id,
  118. commonId: this.userInfo.id
  119. }).then(res => {
  120. if(res.data.code==200){
  121. // this.lists = res.data.data.records
  122. }
  123. })
  124. .catch(res => {
  125. uni.showToast({
  126. title: res.errmsg,
  127. icon: 'none',
  128. duration: 2000
  129. })
  130. });
  131. },
  132. // adddriver(index) {
  133. // if (index == 1) {
  134. // uni.navigateTo({
  135. // url: `/pageD/identity/companyIdentity`
  136. // })
  137. // } else {
  138. // uni.navigateTo({
  139. // url: `/pageD/identity/driverIdentity`
  140. // })
  141. // }
  142. // },
  143. navToDetailPage(item) {
  144. console.log(11111)
  145. // if (index == 1) {
  146. if(item.customerTypeFlag==1){
  147. uni.navigateTo({
  148. url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.customerName}`
  149. })
  150. }else{
  151. uni.navigateTo({
  152. url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.compName}`
  153. })
  154. }
  155. },
  156. // } else {
  157. // uni.navigateTo({
  158. // url: `/pageD/identity/driverIdentityLook`
  159. // })
  160. // }
  161. }
  162. }
  163. </script>
  164. <style>
  165. .center {
  166. padding: 10px 20px;
  167. background-color: #F5F6FA;
  168. }
  169. .title {
  170. font-size: 18px;
  171. font-weight: 900;
  172. margin-right: 20px;
  173. display: initial;
  174. }
  175. .company {
  176. width: 35px;
  177. height: 35px;
  178. background-color: #E9F8F0;
  179. font-size: 16px;
  180. margin-top: 10px;
  181. border-radius: 5px;
  182. text-align: center;
  183. line-height: 35px;
  184. color: #22C572;
  185. font-size: 12px;
  186. }
  187. .company1{
  188. width: 35px;
  189. height: 35px;
  190. background-color: #FEECE6;
  191. font-size: 16px;
  192. margin-top: 10px;
  193. border-radius: 5px;
  194. text-align: center;
  195. line-height: 35px;
  196. color:#FE6430;
  197. font-size: 12px;
  198. }
  199. .infos {
  200. /* margin: 10px 20px; */
  201. width: 100%;
  202. display: inline-table;
  203. }
  204. .info {
  205. line-height: 20px;
  206. }
  207. .but {
  208. margin-right: 30px;
  209. float: right;
  210. font-size: 14px;
  211. background-color: #FFFFFF;
  212. }
  213. .but1{
  214. color: #22C572 ;
  215. }
  216. .but2{
  217. color:#FE6430;
  218. }
  219. .but3{
  220. color:#FB1E1E;
  221. }
  222. .but4{
  223. color:#AFB3BF;
  224. }
  225. .forList{
  226. background-color: #FFFFFF;
  227. padding: 10px 10px;
  228. border-radius: 10px;
  229. margin-top: 10px;
  230. }
  231. /* .guess-item{
  232. font-size: 18px;
  233. margin-left: 20px;
  234. font-weight: 700;
  235. } */
  236. .info1{
  237. font-size: 18px;
  238. margin-left: 20px;
  239. font-weight: 700;
  240. }
  241. .info2{
  242. margin-left: 20px;
  243. color: #AFB3BF;
  244. }
  245. </style>