Identity_switching.vue 5.4 KB

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