mobile/pages/branch/admin/member/index.vue
@@ -1,11 +1,15 @@
<template>
   <view class="activity-container" :data-theme='theme()' :class="theme() || ''">
      <view class="top-box">
         <view class="index-search-box index-search-box_re d-b-c" id="searchBox">
      <view class="top-box d-s-c">
         <view class="index-search-box index-search-box_re d-b-c flex-1" id="searchBox">
            <view class="index-search index-search_re t-c flex-1">
               <text class="icon iconfont icon-sousuo"></text>
               <input type="text" v-model="keyword" class="flex-1 ml10 f26 gray3" value="" placeholder-class="f26 gray9"
                placeholder="输入用户昵称/姓名/手机号进行搜索" confirm-type="search" @confirm="searchFunc()" />
            </view>
            <view class="top-add d-s-c" @click="gotoPage('pages/branch/admin/member/add')">
               <text class="iconfont icon-ziyuan2 f24 mr10"></text>
               <text class="f24">添加</text>
            </view>
         </view>
      </view>
@@ -20,8 +24,8 @@
                  </view>
                  <view class="flex-1 ml20 f24">
                     <view class="item-info d-s-c f28 gray3">
                        <text>{{ item.nickName }}</text>
                        <text v-if="item.real_name">({{ item.real_name }})</text>
                        <text>{{ item.real_name  }}</text>
                        <!-- <text v-if="item.real_name">({{ item.real_name }})</text> -->
                        <text class="item-position" v-if="item.position_name">{{ item.position_name }}</text>
                     </view>
                     <view class="gray6 pt10" v-if="item.supplier || item.company">
@@ -30,8 +34,14 @@
                     </view>
                     <view class="gray9 pt10">加入时间:{{ item.create_time }}</view>
                  </view>
                  <view class="item-call" @click="callPhone(item.mobile)">
                     <text class="iconfont icon-002dianhua f40" v-if="item.mobile"></text>
                  <view>
                     <view class="item-call tr" @click="callPhone(item.mobile)">
                        <text class="iconfont icon-002dianhua f40" v-if="item.mobile"></text>
                     </view>
                     <view class="d-s-e member-op pt20">
                        <view class="member-btn" @click="gotoPage('pages/branch/admin/member/edit?user_id='+item.user_id)">修改</view>
                        <view class="member-btn ml10" @click="onDelete(item.user_id)">删除</view>
                     </view>
                  </view>
               </view>
            </view>
@@ -131,6 +141,31 @@
               }
               uni.hideLoading();
               self.loading = false;
            });
         },
         /*删除会员*/
         onDelete(user_id, index) {
            let self = this;
            uni.showModal({
               title: '提示',
               content: '确定要删除吗?',
               success: (res) => {
                  if (res.confirm) {
                     // 调用删除接口
                     self._post('branch.admin.member/delete', {
                        user_id: user_id
                     }, (res) => {
                        if (res.code === 1) {
                           // 删除成功,更新列表
                           self.listData.splice(index, 1);
                           self.showToast('删除成功');
                        } else {
                           self.showToast(res.msg || '删除失败');
                        }
                     });
                  }
               }
            });
         },
         
@@ -248,6 +283,14 @@
               color: #000;
            }
         }
         .member-btn {
            font-size: 24rpx;
            color: #333333;
            border: 1rpx solid #cccccc;
            border-radius: 60rpx;
            padding: 6rpx 16rpx;
         }
      }
      
   }