Identity_switching.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="center">
  3. <view v-for="(item , index) in lists" :Key="index">
  4. <view>
  5. <view class="company">{{item.customerType}}</view>
  6. <view class="guess-item" @click="navToDetailPage(item)">
  7. <view class="infos">
  8. <view class="info">{{item.customerName}}
  9. <view class='cu-tag radius line-pink but'>{{item.authenticationStatus}}</view>
  10. </view>
  11. <view class="info">{{item.customerPhone}}</view>
  12. <label>
  13. <checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
  14. <text>设置默认</text>
  15. </label>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. mapState
  27. } from 'vuex';
  28. export default {
  29. name: "buy",
  30. data() {
  31. return {
  32. lists:[],
  33. PageCur: "buy",
  34. buyInfo: [],
  35. pages: 1, //页数
  36. limit: 10, //每次取条目数
  37. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  38. isLoadMore: false, //是否加载中
  39. showTran: true,
  40. scrollTop: 0,
  41. TabCur: 0,
  42. current: 1,
  43. id:0,
  44. checked:false,
  45. goodsName:'',
  46. receivePrivate:'',
  47. receiveCity:'',
  48. receiveArea:'',
  49. minimumVolume:'',
  50. basis:'',
  51. buyer:'',
  52. unitPrice:'',
  53. receiveWarehouse:'',
  54. procurementPlanType:'',
  55. procurementPlan:'',
  56. identityAuthenticationInfo: {
  57. pageSize: 10,
  58. currentPage: 1,
  59. commonId: "",
  60. },
  61. };
  62. },
  63. onShow(){
  64. this.getList()
  65. },
  66. onLoad(options) {
  67. this.id=options.id
  68. },
  69. computed: {
  70. ...mapState(['hasLogin', 'userInfo'])
  71. },
  72. methods: {
  73. getList() {
  74. this.identityAuthenticationInfo.commonId = this.userInfo.id
  75. this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
  76. pageSize: 10,
  77. currentPage: 1,
  78. commonId: this.userInfo.id
  79. }, 'application/json;charset=UTF-8').then(res => {
  80. if(res.data.code==200){
  81. for(var i=0;i<res.data.data.records.length;i++){
  82. if(res.data.data.records[i].defaultFlag!=1){
  83. res.data.data.records[i].checked=false
  84. }else{
  85. res.data.data.records[i].checked=true
  86. }
  87. }
  88. this.lists = res.data.data.records
  89. }
  90. })
  91. .catch(res => {
  92. uni.showToast({
  93. title: res.errmsg,
  94. icon: 'none',
  95. duration: 2000
  96. })
  97. });
  98. },
  99. checkBox(e,item){
  100. for(var i=0;i<this.lists.length;i++){
  101. this.lists[i].checked=true
  102. }
  103. item.checked=true
  104. this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
  105. id:item.id,
  106. commonId: this.userInfo.id
  107. }).then(res => {
  108. if(res.data.code==200){
  109. // this.lists = res.data.data.records
  110. }
  111. })
  112. .catch(res => {
  113. uni.showToast({
  114. title: res.errmsg,
  115. icon: 'none',
  116. duration: 2000
  117. })
  118. });
  119. },
  120. // adddriver(index) {
  121. // if (index == 1) {
  122. // uni.navigateTo({
  123. // url: `/pageD/identity/companyIdentity`
  124. // })
  125. // } else {
  126. // uni.navigateTo({
  127. // url: `/pageD/identity/driverIdentity`
  128. // })
  129. // }
  130. // },
  131. navToDetailPage(item) {
  132. // if (index == 1) {
  133. if(item.customerTypeFlag==1){
  134. uni.navigateTo({
  135. url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.customerName}`
  136. })
  137. }else{
  138. uni.navigateTo({
  139. url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.compName}`
  140. })
  141. }
  142. },
  143. // } else {
  144. // uni.navigateTo({
  145. // url: `/pageD/identity/driverIdentityLook`
  146. // })
  147. // }
  148. }
  149. }
  150. </script>
  151. <style>
  152. .center {
  153. padding: 10px 20px;
  154. }
  155. .title {
  156. font-size: 18px;
  157. font-weight: 900;
  158. margin-right: 20px;
  159. display: initial;
  160. }
  161. .company {
  162. font-size: 16px;
  163. margin-top: 10px;
  164. }
  165. .infos {
  166. /* margin: 10px 20px; */
  167. width: 100%;
  168. display: inline-table;
  169. }
  170. .info {
  171. line-height: 20px;
  172. }
  173. .but {
  174. right: 3px;
  175. float: right;
  176. }
  177. </style>