123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <template>
- <view class="">
- <view class="search-user flex-y-center ">
- <view class="search-content flex-y-center">
- <icon type="search" size="18" />
- <input confirm-type="search" v-model="seTval" @confirm="confirm" @input="getSearch" class="flex-grow-1"
- type="text" placeholder-style="font-size:26rpx" placeholder="请输入用户id" />
- <view class="flex-center" style="margin-left: 10rpx;" @click.stop="onDel" v-if="seTval">
- <icon type="clear" size="18" />
- </view>
- </view>
- <view class="search-btn" @click="search">
- 搜索
- </view>
- </view>
-
- <view class="header-hg100"></view>
-
- <view class="goodsList border-b flex-y-center box-pack-between" v-for="(item,index) of list"
- @click="choice(index)" :key='index'>
-
- <view>
- <view class="ft28" style="padding-bottom: 10rpx;">用户id:{{item.user_id}}</view>
- <view v-if="item.nickname" class="ft28 flex-y-center" style="padding-bottom: 10rpx;">
- <image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;border-radius: 100px;" :src="item.avatar"></image>
- <text>{{item.nickname}}</text>
- </view>
- <view v-if="item.mobile" class="ft28">手机:{{item.mobile}}</view>
- </view>
- <view class="rund flex-center">
- <block v-if="item.checked">
- <icon type="success_no_circle" size="13"></icon>
- </block>
- </view>
- </view>
- <view class="pof flex-center">
- <button type="default" @click="choiceBtn">选择({{goodStudentTypelength}})</button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- keywords: "",
- list: [],
- admin_id: '',
- goodStudentType: [],
- goodStudentTypelength: 0
- }
- },
- onLoad(e) {
- this.admin_id = uni.getStorageSync("admin_id");
- this.getData(1);
- },
- onReachBottom() {
- if (!this.is_bottom) {
- this.getData(this.page + 1)
- }
- },
- methods: {
- choice(index) {
- this.list[index].checked = !this.list[index].checked;
- this.goodStudentType = this.list.filter((v, i) => v.checked == true);
- this.goodStudentTypelength = this.goodStudentType.length;
- },
-
- choiceBtn(){
- uni.setStorageSync("goodStudentType",this.goodStudentType);
- uni.navigateBack();
- },
- getSearch(e) {
- if (!e.detail.value) {
- this.list = [];
- this.keywords = "";
- this.getData(1);
- }
- this.keywords = e.detail.value;
- },
- onDel() {
- this.seTval = '';
- this.list = [];
- this.keywords = "";
- this.getData(1);
- },
-
- confirm(e) {
- this.list = [];
- this.keywords = e.detail.value;
- this.getData(1);
- },
-
- search(e) {
- this.list = [];
- this.getData(1);
- },
-
- getData(page) {
- if (page == 1) {
- this.list = []
- this.page = 1
- this.is_bottom = false
- }
- this.request({
- url: 'Smdcshop/coupon_user_id',
- data: {
- admin_id: this.admin_id,
- page,
- keyword: this.keywords,
- limit: 20,
- }
- }).then(res => {
- if (res.code == 200 && res.data.length) {
- for (let i of res.data) {
- i.checked = false;
- }
- this.list = this.list.concat(res.data)
- this.page = page;
- this.goodStudentType=[];
- this.goodStudentTypelength=0;
- } else {
- this.is_bottom = true
- }
- })
- }
- }
- }
- </script>
- <style>
- page {
- background: #F9F9F9;
- }
- .pof {
- position: fixed;
- bottom: 20px;
- width: 100%;
- }
- .pof button {
- width: 60%;
- background-color: #007AFF;
- font-size: 28rpx;
- text-align: center;
- color: #FFFFFF;
- height: 80rpx;
- }
- .goodsList {
- padding: 20rpx;
- }
- .rund {
- width: 45rpx;
- height: 45rpx;
- border: 1px solid #ccc;
- margin-right: 20rpx;
- }
- .search-user {
- z-index: 999;
- position: fixed;
- left: 0;
- width: 100%;
- height: 100rpx;
- background: #FFFFFF;
- margin-left: 15rpx;
- }
- .search-user .search-content {
- width: 83%;
- height: 70rpx;
- background: #F1F1F1;
- border-radius: 100rpx;
- padding: 0 20rpx;
- }
- .search-user .search-content icon {
- margin-right: 10rpx;
- }
- .search-user .search-btn {
- margin-left: 20rpx;
- font-size: 28rpx;
- }
- .header-hg100 {
- height: 100rpx;
- }
- </style>
|