merchantList.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="container">
  3. <view class="selectInput">
  4. <!-- <input type="text"> -->
  5. <tui-input v-model="queryList.shopName" placeholder="请输入商家名字">
  6. <template slot="right">
  7. <view class="selectBtn" @click="dataList = []; getList()">
  8. 搜索
  9. </view>
  10. </template>
  11. </tui-input>
  12. </view>
  13. <view class="merchantList">
  14. <listItem v-for="datas in dataList" :key="datas.shopId" :datas="datas"></listItem>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import {
  20. getRechargeShopAllApi,
  21. } from "@/api/anotherTFInterface";
  22. import listItem from './listItem.vue'
  23. export default {
  24. name: 'merchantList',
  25. components: {
  26. listItem
  27. },
  28. data() {
  29. return {
  30. queryList: {
  31. page: 1,
  32. pageSize: 10,
  33. shopName: '' // 商家名字
  34. },
  35. dataList: []
  36. }
  37. },
  38. created() {
  39. this.getList();
  40. },
  41. methods: {
  42. getList() {
  43. getRechargeShopAllApi(this.queryList).then(res => {
  44. res.data.records.forEach(item => {
  45. this.dataList.push(item)
  46. })
  47. // console.log(this.dataList);
  48. }).catch(err => {
  49. console.log(err);
  50. })
  51. },
  52. getMoreList() {
  53. this.queryList.page++
  54. this.getList()
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .selectBtn {
  61. font-size: 32rpx;
  62. font-weight: normal;
  63. line-height: normal;
  64. font-feature-settings: "kern" on;
  65. color: #EF520E;
  66. }
  67. .selectInput{
  68. margin-top: -30rpx;
  69. }
  70. .merchantList {
  71. }
  72. </style>