storeNumber.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="container">
  3. <view class="search-user flex-y-center ">
  4. <view class="search-content flex-y-center">
  5. <icon type="search" size="18" />
  6. <input confirm-type="search" v-model="seTval" @confirm="confirm" @input="getSearch" class="flex-grow-1"
  7. type="text" placeholder-style="font-size:26rpx" placeholder="请输入搜索内容" />
  8. <view class="flex-center" style="margin-left: 10rpx;" @click.stop="onDel" v-if="seTval">
  9. <icon type="clear" size="18" />
  10. </view>
  11. </view>
  12. <view class="search-btn" @click="search">
  13. 搜索
  14. </view>
  15. </view>
  16. <view class="hg100rpx">
  17. </view>
  18. <view class="list">
  19. <view class="item" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
  20. <view class="name">账号:{{item.name}}</view>
  21. <view class="content">
  22. <view class="cell flex flex-y-center">
  23. <view class="title">名称:</view>
  24. <view class="desc">{{item.nickname}}</view>
  25. </view>
  26. <view class="cell flex flex-y-center">
  27. <view class="title">所属门店:</view>
  28. <view class="desc">{{item.storename}}</view>
  29. </view>
  30. <view class="cell flex flex-y-center">
  31. <view class="title">创建时间:</view>
  32. <view class="desc">{{item.create_time}}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="no-more">没有更多内容了~</view>
  37. </view>
  38. <view class="footer-bar">
  39. <view class="content flex flex-center">
  40. <navigator url="./addstorenumber" class="btn">+新增账号</navigator>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. admin_id:"",
  50. list: [],
  51. page: 1,
  52. is_bottom: false,
  53. keywords:'',
  54. }
  55. },
  56. onLoad(options) {
  57. this.admin_id = uni.getStorageSync("admin_id");
  58. },
  59. onShow() {
  60. this.getData(1)
  61. },
  62. onReachBottom() {
  63. if (!this.is_bottom) {
  64. this.getData(this.page + 1)
  65. }
  66. },
  67. methods: {
  68. getSearch(e) {
  69. if (!e.detail.value) {
  70. this.page = 1;
  71. this.list = [];
  72. this.keywords = "";
  73. this.getData(1);
  74. }
  75. this.keywords = e.detail.value;
  76. },
  77. onDel() {
  78. this.list = [];
  79. this.keywords = "";
  80. this.getData(1);
  81. },
  82. confirm(e) {
  83. this.list = [];
  84. this.keywords = e.detail.value;
  85. this.getData(1);
  86. },
  87. search(e) {
  88. this.page = 1;
  89. this.list = [];
  90. this.getData(1);
  91. },
  92. toDetail(id){
  93. // let info = JSON.stringify(this.list[index])
  94. uni.navigateTo({
  95. url:`./storeNumberdetail?id=${id}`
  96. })
  97. },
  98. getData(page) {
  99. if (page == 1) {
  100. this.list = []
  101. this.page = 1
  102. this.is_bottom = false
  103. }
  104. this.request({
  105. url: 'Smdcshop/store_user_index',
  106. data: {
  107. page,
  108. limit: 10,
  109. admin_id: this.admin_id,
  110. serch:this.keywords,
  111. }
  112. }).then(res => {
  113. if (res.code == 200 && res.data.length) {
  114. this.list = this.list.concat(res.data)
  115. this.page = page
  116. } else {
  117. this.is_bottom = true
  118. }
  119. })
  120. }
  121. }
  122. }
  123. </script>
  124. <style>
  125. @import url("../static/css/common.css");
  126. page {
  127. background-color: #F4F5F7;
  128. }
  129. .list {
  130. padding: 30rpx 25rpx;
  131. }
  132. .list .item {
  133. border-radius: 8rpx;
  134. overflow: hidden;
  135. padding-left: 30rpx;
  136. border-left: 8rpx solid #247EFF;
  137. background-color: #fff;
  138. margin-bottom: 30rpx;
  139. }
  140. .list .item .name {
  141. height: 80rpx;
  142. border-bottom: 1rpx solid #f5f5f5;
  143. font-size: 30rpx;
  144. line-height: 80rpx;
  145. font-weight: bold;
  146. }
  147. .list .item .content {
  148. padding: 20rpx 0 24rpx;
  149. }
  150. .list .item .content .cell {
  151. flex: none;
  152. width: 100%;
  153. box-sizing: border-box;
  154. padding-right: 30rpx;
  155. font-size: 26rpx;
  156. line-height: 37rpx;
  157. color: #666;
  158. }
  159. .list .item .content .cell .title {
  160. color: #99A0AD;
  161. }
  162. .hg100rpx{
  163. height: 100rpx;
  164. }
  165. </style>