Sfoglia il codice sorgente

会员管理接口联调

htc 2 giorni fa
parent
commit
a434b8629d

+ 0 - 1
src/views/modules/activity/add.vue

@@ -369,7 +369,6 @@ export default {
     },
     getSupplierOptions () {
       this.$http.get('/core/channel/page', { params: { page: 1, limit: -1 } }).then(res => {
-        console.log(res.data.data.list)
         this.channelOptions = res.data.data.list.filter(item => item.type === 1) || []
         this.organizerOptions = res.data.data.list.filter(item => item.type === 2) || []
       })

+ 47 - 22
src/views/modules/member/add.vue

@@ -20,11 +20,11 @@
                         <div class="f_pldr">
                             <div class="fp_box">
                                 <div class="fpb_pre">
-                                    <div class="fpbp_btn" @click="handleDownloadExcel">下载Excel示例文件</div>
+                                    <div class="fpbp_btn" @click="handleDownloadExcel" v-if="$hasPermission('core:appuser:save')">下载Excel示例文件</div>
                                 </div>
                                 <img src="@/assets/img/arrow_right_two.png">
                                 <div class="fpb_pre sc">
-                                    <el-upload
+                                    <el-upload v-if="$hasPermission('core:appuser:uploadSave')"
                                         :action="uploadUrl"
                                         :headers="uploadHeaders"
                                         :on-success="uploadFileSuccess"
@@ -44,14 +44,14 @@
                     </el-form-item>
                     <el-form-item label="渠道方" prop="channelId">
                         <el-select v-model="dataForm.channelId" placeholder="请选择渠道方">
-                            <el-option v-for="item in channelOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                            <el-option v-for="item in channelOptions" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
                         </el-select>
                     </el-form-item>
                     <el-form-item label="善行少年编号" prop="uniqueNo">
                         <el-input v-model="dataForm.uniqueNo" placeholder="根据选择渠道方自动生成编号" disabled></el-input>
                     </el-form-item>
-                    <el-form-item label="姓名" prop="memberName">
-                        <el-input v-model="dataForm.memberName" placeholder="请输入会员昵称"></el-input>
+                    <el-form-item label="姓名" prop="realName">
+                        <el-input v-model="dataForm.realName" placeholder="请输入会员姓名"></el-input>
                     </el-form-item>
                     <el-form-item label="性别" prop="gender">
                         <el-select v-model="dataForm.gender" placeholder="请选择性别">
@@ -75,7 +75,8 @@
                     </el-form-item>
                 </template>
                 <el-form-item>
-                    <el-button type="primary" @click="handleSubmit">保存</el-button>
+                    <!-- <el-button type="primary" @click="handleUploadSave" v-if="$hasPermission('core:appuser:uploadSave')&&dataForm.addType===1">保存</el-button> -->
+                    <el-button type="primary" @click="handleSubmit" v-if="$hasPermission('core:appuser:save')&&dataForm.addType===2">保存</el-button>
                     <el-button type="default" @click="handleCancel">返回</el-button>
                 </el-form-item>
             </el-form>
@@ -93,7 +94,7 @@ export default {
         nickName: '',
         channelId: '',
         uniqueNo: '',
-        memberName: '',
+        realName: '',
         gender: '',
         phone: '',
         idCard: '',
@@ -111,10 +112,7 @@ export default {
         channelId: [
           { required: true, message: '请选择渠道方', trigger: 'change' }
         ],
-        uniqueNo: [
-          { required: true, message: '请输入善行少年编号', trigger: 'blur' }
-        ],
-        memberName: [
+        realName: [
           { required: true, message: '请输入姓名', trigger: 'blur' }
         ],
         gender: [
@@ -126,7 +124,7 @@ export default {
         ],
         idCard: [
           { required: true, message: '请输入身份证号', trigger: 'blur' },
-          { pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(10|11|12))((0[1-9])|([1-2][0-9])|30|31)d{3}([0-9]|X)$/, message: '身份证号格式不正确', trigger: 'blur' }
+          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
         ],
         welfareName: [
           { required: true, message: '请输入家庭公益名称', trigger: 'blur' }
@@ -138,18 +136,18 @@ export default {
           { required: true, message: '请输入爱心值', trigger: 'blur' }
         ]
       },
-      channelOptions: [
-        { id: 1, name: '渠道A' }
-      ],
+      channelOptions: [],
       genderOptions: [
         { id: 0, name: '男' },
         { id: 1, name: '女' },
         { id: 2, name: '保密' }
       ],
-      uploadUrl: `${window.SITE_CONFIG['apiURL']}/sys/oss/uploadFile`,
+      // uploadUrl: `${window.SITE_CONFIG['apiURL']}/sys/oss/uploadFile`,
+      uploadUrl: `${window.SITE_CONFIG['apiURL']}/core/app/user/import`,
       uploadHeaders: {
         token: Cookies.get('token')
-      }
+      },
+      file: ''
     }
   },
   watch: {
@@ -159,7 +157,15 @@ export default {
       }
     }
   },
+  created () {
+    this.getSupplierOptions()
+  },
   methods: {
+    getSupplierOptions () {
+      this.$http.get('/core/channel/page', { params: { page: 1, limit: -1 } }).then(res => {
+        this.channelOptions = res.data.data.list.filter(item => item.type === 1) || []
+      })
+    },
     handleBack () {
       this.$router.push({ name: 'member-query' })
     },
@@ -167,7 +173,7 @@ export default {
       this.handleBack()
     },
     handleDownloadExcel () {
-      window.location.href = `${window.SITE_CONFIG['apiURL']}/sys/user/download?token=${Cookies.get('token')}`
+      window.location.href = `${window.SITE_CONFIG['apiURL']}/core/app/user/download?token=${Cookies.get('token')}`
     },
     beforeAvatarUpload (file) {
       const isXls = file.type === 'application/vnd.ms-excel'
@@ -179,22 +185,37 @@ export default {
     },
     uploadFileSuccess (response, file, fileList) {
       if (response && response.code === 0) {
-        this.$message.success('文件上传成功!')
+        this.$message.success('会员批量导入成功!')
+        this.file = response.data || ''
+        this.handleBack()
       } else {
         this.$message.error(response.msg || '文件上传失败!')
       }
     },
+    handleUploadSave () {
+      if (!this.file) return this.$message.error('请先上传Excel文件!')
+      this.$http.post('/core/app/user/import', { file: this.file }).then(({ data: res }) => {
+        if (res.code !== 0) return this.$message.error(res.msg || '导入失败!')
+        this.$message.success('会员批量导入成功!')
+        this.handleBack()
+      })
+    },
     handleSubmit () {
       this.$refs.dataForm.validate(valid => {
         if (valid) {
           console.log('提交的表单数据:', this.dataForm)
-          // 在这里根据 this.dataForm.addType 的值来决定调用哪个接口
           if (this.dataForm.addType === 1) {
             // ...处理批量导入的逻辑(通常在上传成功的回调里处理)
             alert('请上传文件以完成批量导入')
           } else {
-            // ...调用手动新增会员的接口
-            alert('正在保存手动录入的会员...')
+            this.$http.post('/core/app/user', this.dataForm).then(({ data: res }) => {
+              if (res.code === 0) {
+                this.$message.success('会员新增成功!')
+                this.handleBack()
+              } else {
+                this.$message.error(res.msg || '会员新增失败!')
+              }
+            })
           }
         }
       })
@@ -204,6 +225,10 @@ export default {
 </script>
 
 <style scoped lang="scss">
+::v-deep .el-upload-list{
+  display: none;
+}
+
 .top {
     padding-bottom: 13px;
     box-shadow: inset 0px -1px 0px 0px #F0F1F7;

+ 85 - 33
src/views/modules/member/detail.vue

@@ -14,52 +14,52 @@
                 <div class="info adfacjb">
                     <div class="info-left adffcac">
                         <img src="@/assets/img/member_avatar.png">
-                        <el-button type="primary" @click="handleEdit">编辑资料</el-button>
+                        <el-button type="primary" @click="handleEdit" v-if="$hasPermission('core:appuser:update')">编辑资料</el-button>
                     </div>
-                    <div class="info-right adf">
+                    <div class="info-right adf" v-if="userInfo">
                         <div class="info-right-pre adf" style="margin-top: 0;">
                             <div class="info-right-pre-title">会员姓名:</div>
-                            <div class="info-right-pre-content">{{ '周飒然' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.realName||'' }}</div>
                         </div>
                         <div class="info-right-pre adf" style="margin-top: 0;">
                             <div class="info-right-pre-title">会员手机:</div>
-                            <div class="info-right-pre-content">{{ '187 **** 9876' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.phoneCopy||'' }}</div>
                         </div>
                         <div class="info-right-pre adf" style="margin-top: 0;">
                             <div class="info-right-pre-title">善行少年编号:</div>
-                            <div class="info-right-pre-content">{{ 'SXSN-PAB-20250001' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.uniqueNo||'' }}</div>
                         </div>
                         <div class="info-right-pre adf">
                             <div class="info-right-pre-title">会员性别:</div>
-                            <div class="info-right-pre-content">{{ '' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.genderText||'' }}</div>
                         </div>
-                        <div class="info-right-pre adf">
+                        <!-- <div class="info-right-pre adf">
                             <div class="info-right-pre-title">会员年龄:</div>
-                            <div class="info-right-pre-content">{{ '46' }}</div>
-                        </div>
+                            <div class="info-right-pre-content">{{ userInfo.age||'' }}</div>
+                        </div> -->
                         <div class="info-right-pre adf">
                             <div class="info-right-pre-title">微信昵称:</div>
-                            <div class="info-right-pre-content">{{ '妮可妮可' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.nickName||'' }}</div>
                         </div>
                         <div class="info-right-pre adf">
                             <div class="info-right-pre-title">渠道方:</div>
-                            <div class="info-right-pre-content">{{ '平安银行' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.channelName||'' }}</div>
                         </div>
                         <div class="info-right-pre adf">
                             <div class="info-right-pre-title">成为会员时间:</div>
-                            <div class="info-right-pre-content">{{ '2025-06-30 13:00:08' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.createDate||'' }}</div>
                         </div>
                         <div class="info-right-pre adf">
                             <div class="info-right-pre-title">家庭公益口号:</div>
-                            <div class="info-right-pre-content">{{ '心中有爱,温暖你我他' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.welfareSlogan||'' }}</div>
                         </div>
                         <div class="info-right-pre adf">
                             <div class="info-right-pre-title">家庭公益名称:</div>
-                            <div class="info-right-pre-content">{{ '善意行' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.welfareName||'' }}</div>
                         </div>
                         <div class="info-right-pre adf">
                             <div class="info-right-pre-title">身份证号:</div>
-                            <div class="info-right-pre-content">{{ '342221 ******** 9898' }}</div>
+                            <div class="info-right-pre-content">{{ userInfo.idCardCopy||'' }}</div>
                         </div>
                     </div>
                 </div>
@@ -68,22 +68,22 @@
         <el-card shadow="never" class="aui-card--fill">
             <div class="mod-home">
                 <div class="title" style="margin-top: 0;">会员资产</div>
-                <div class="nums adf">
+                <div class="nums adf" v-if="assetInfo">
                     <div class="nums-pre adffcac">
                         <p>累计捐献爱心值</p>
-                        <p class="num">{{ 8000 }}</p>
+                        <p class="num">{{ assetInfo.totalDonationValue||0 }}</p>
                     </div>
                     <div class="nums-pre adffcac">
                         <p>家庭累计义工时长</p>
-                        <p class="num">{{ 180 }}h</p>
+                        <p class="num">{{ assetInfo.totalVolunteerHours||0 }}h</p>
                     </div>
                     <div class="nums-pre adffcac">
                         <p>会员等级</p>
-                        <p class="num">Lv.{{ 3 }}</p>
+                        <p class="num">Lv.{{ assetInfo.userLevel||1 }}</p>
                     </div>
                     <div class="nums-pre adffcac">
                         <p>剩余爱心值</p>
-                        <p class="num">{{ 10000 }}</p>
+                        <p class="num">{{ assetInfo.loveValue||0 }}</p>
                     </div>
                 </div>
             </div>
@@ -110,10 +110,12 @@
               <el-input v-model="form.uniqueNo" placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="渠道方" prop="channelId">
-              <el-select v-model="form.channelId" placeholder="请选择" style="width: 100%;"></el-select>
+              <el-select v-model="form.channelId" placeholder="请选择" style="width: 100%;">
+                <el-option v-for="item in channelOptions" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item label="姓名" prop="xxx">
-              <el-input v-model="form.xxx" placeholder="请输入"></el-input>
+            <el-form-item label="姓名" prop="realName">
+              <el-input v-model="form.realName" placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="家庭公益名称" prop="welfareName">
               <el-input v-model="form.welfareName" placeholder="请输入"></el-input>
@@ -122,13 +124,13 @@
               <el-input v-model="form.welfareSlogan" placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="累计捐献爱心值" prop="totalInvoicedAmount">
-              <el-input type="number" v-model="form.totalInvoicedAmount" placeholder="请输入"></el-input>
+              <el-input type="number" v-model="form.totalInvoicedAmount" disabled placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="剩余爱心值" prop="loveValue">
               <el-input type="number" v-model="form.loveValue" placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="参与公益次数" prop="welfareCount">
-              <el-input type="number" v-model="form.welfareCount" placeholder="请输入"></el-input>
+              <el-input type="number" v-model="form.welfareCount" disabled placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="会员等级" prop="userLevel">
               <el-input type="number" v-model="form.userLevel" placeholder="请输入"></el-input>
@@ -160,12 +162,14 @@ export default {
       tabList: ['活动记录', '爱心值记录', '专享券', '家庭成员'],
       show: false,
       buttonLoading: false,
+      userInfo: null,
+      assetInfo: null,
       form: {
         id: '',
         nickName: '',
         uniqueNo: '',
         channelId: '',
-        xxx: '',
+        realName: '',
         welfareName: '',
         welfareSlogan: '',
         totalInvoicedAmount: 0,
@@ -183,7 +187,7 @@ export default {
         channelId: [
           { required: true, message: '请选择渠道方', trigger: 'change' }
         ],
-        xxx: [
+        realName: [
           { required: true, message: '请输入姓名', trigger: 'blur' }
         ],
         welfareName: [
@@ -193,21 +197,59 @@ export default {
           { required: true, message: '请输入家庭公益口号', trigger: 'blur' }
         ],
         totalInvoicedAmount: [
-          { required: true, type: 'number', message: '请输入累计捐献爱心值', trigger: 'change' }
+          { required: true, message: '请输入累计捐献爱心值', trigger: 'blur' }
         ],
         loveValue: [
-          { required: true, type: 'number', message: '请输入剩余爱心值', trigger: 'change' }
+          { required: true, message: '请输入剩余爱心值', trigger: 'blur' }
         ],
         welfareCount: [
-          { required: true, type: 'number', message: '请输入参与公益次数', trigger: 'change' }
+          { required: true, message: '请输入参与公益次数', trigger: 'blur' }
         ],
         userLevel: [
-          { required: true, type: 'number', message: '请输入会员等级', trigger: 'change' }
+          { required: true, message: '请输入会员等级', trigger: 'blur' }
         ]
-      }
+      },
+      genderCfg: {
+        '0': '男',
+        '1': '女',
+        '2': '保密'
+      },
+      channelOptions: []
     }
   },
+  created () {
+    this.getSupplierOptions()
+  },
+  mounted () {
+    this.getDetail()
+    this.getUserAsset()
+  },
   methods: {
+    getSupplierOptions () {
+      this.$http.get('/core/channel/page', { params: { page: 1, limit: -1 } }).then(res => {
+        this.channelOptions = res.data.data.list.filter(item => item.type === 1) || []
+      })
+    },
+    getDetail () {
+      this.$http.get('/core/app/user/' + this.$route.query.id).then(({ data: res }) => {
+        if (res.code !== 0) return this.$message.error(res.msg)
+        this.form = res.data
+        this.form.totalInvoicedAmount = res.data.totalInvoicedAmount || 0
+        this.form.welfareCount = res.data.welfareCount || 0
+        this.form.userLevel = res.data.userLevel || 1
+
+        this.userInfo = res.data
+        this.userInfo.phoneCopy = this.userInfo.phone.replace(/(\d{3})\d*(\d{4})/, '$1****$2')
+        this.userInfo.idCardCopy = this.userInfo.idCard.replace(/^(\d{6})\d{8}(\w{4})$/, '$1********$2')
+        this.userInfo.genderText = this.genderCfg[this.userInfo.gender]
+      })
+    },
+    getUserAsset () {
+      this.$http.get('/core/app/user/getUserAsset/' + this.$route.query.id).then(({ data: res }) => {
+        if (res.code !== 0) return this.$message.error(res.msg)
+        this.assetInfo = res.data
+      })
+    },
     handleBack () {
       this.$router.push({ name: 'member-query' })
     },
@@ -216,11 +258,21 @@ export default {
     },
     handleEdit () {
       this.show = true
+      this.getDetail()
     },
     submitForm () {
       this.$refs['memberRef'].validate((valid) => {
         if (valid) {
-          console.log('submit!')
+          this.$http.put('/core/app/user', this.form).then(({ data: res }) => {
+            if (res.code === 0) {
+              this.$message.success('保存成功!')
+              this.show = false
+              this.getDetail()
+              this.getUserAsset()
+            } else {
+              this.$message.error(res.msg || '保存失败!')
+            }
+          })
         } else {
           return false
         }

+ 109 - 42
src/views/modules/member/query.vue

@@ -1,15 +1,15 @@
 <template>
     <el-card shadow="never" class="aui-card--fill">
         <div class="mod-home">
-          <div class="title">会员查询</div>
+          <div class="page-title">{{ pageTitle }}</div>
           <div class="query">
             <div class="query-left">
               <el-form :inline="true" :model="queryParams" @keyup.enter.native="getList">
                 <el-form-item label="善行少年编号" style="margin-right: 50px;">
-                  <el-input v-model="queryParams.memberId" placeholder="请输入"></el-input>
+                  <el-input v-model="queryParams.uniqueNo" placeholder="请输入"></el-input>
                 </el-form-item>
                 <el-form-item label="用户名" style="margin-right: 50px;">
-                  <el-input v-model="queryParams.memberName" placeholder="请输入"></el-input>
+                  <el-input v-model="queryParams.realName" placeholder="请输入"></el-input>
                 </el-form-item>
                 <el-form-item label="渠道方">
                   <el-select v-model="queryParams.channelId" placeholder="请选择渠道方" class="select-box">
@@ -28,34 +28,43 @@
           <div class="table-title adfacjb">
             <div class="table-title-left">会员列表共({{ total }})人</div>
             <div class="table-title-right">
-              <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增会员</el-button>
-              <el-button type="default" @click="handleExcel">导出Excel</el-button>
+              <el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="$hasPermission('core:appuser:save')">新增会员</el-button>
+              <el-button type="default" @click="handleExcel" v-if="$hasPermission('core:appuser:export')">导出Excel</el-button>
             </div>
           </div>
           <el-table :data="dataList" border cell-class-name="vertical-top-cell" v-loading="loading" empty-text="暂无会员" style="margin-top: 22px;">
-            <el-table-column prop="xxx" label="会员信息">
-              <template #default="scope"></template>
+            <el-table-column prop="xxx" label="会员信息" width="180">
+              <template #default="{ row }">
+                <div class="userinfo adfac">
+                  <img :src="row.avatarPath" v-if="row.avatarPath">
+                  <div class="userinfo-text">
+                    <div class="userinfo-text-name">{{ row.nickName||'' }}</div>
+                    <div class="userinfo-text-phone">{{ row.phoneCopy||'' }}</div>
+                  </div>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="uniqueNo" label="善行少年编号" width="220"></el-table-column>
+            <el-table-column prop="channelName" label="渠道方" width="150"></el-table-column>
+            <el-table-column prop="realName" label="用户名" width="100"></el-table-column>
+            <el-table-column prop="phoneCopy" label="手机号" width="120"></el-table-column>
+            <el-table-column prop="welfareName" label="家庭公益名称" width="130"></el-table-column>
+            <el-table-column prop="welfareSlogan" label="家庭公益口号" width="130"></el-table-column>
+            <el-table-column prop="usedLoves" label="累计捐献爱心值" width="140">
+              <template #default="{ row }">{{ row.usedLoves||0 }}</template>
             </el-table-column>
-            <el-table-column prop="xxx" label="善行少年编号"></el-table-column>
-            <el-table-column prop="xxx" label="渠道方"></el-table-column>
-            <el-table-column prop="xxx" label="姓名"></el-table-column>
-            <el-table-column prop="xxx" label="手机号"></el-table-column>
-            <el-table-column prop="xxx" label="家庭公益名称"></el-table-column>
-            <el-table-column prop="xxx" label="家庭公益口号"></el-table-column>
-            <el-table-column prop="xxx" label="累计捐献爱心值"></el-table-column>
-            <el-table-column prop="xxx" label="剩余爱心值"></el-table-column>
-            <el-table-column prop="xxx" label="参与公益次数">
-              <template #default="scope"></template>
+            <el-table-column prop="loveValue" label="剩余爱心值" width="120"></el-table-column>
+            <el-table-column prop="welfareCount" label="参与公益次数" width="130">
+              <template #default="{ row }">{{ row.welfareCount||0 }}次</template>
             </el-table-column>
-            <el-table-column prop="xxx" label="会员等级">
-              <template #default="scope"></template>
+            <el-table-column prop="userLevel" label="会员等级" width="100">
+              <template #default="{ row }">Lv.{{ row.userLevel||1 }}</template>
             </el-table-column>
             <el-table-column label="操作" width="300" fixed="right">
               <template #default="scope">
-                  <el-button link type="text" @click="handleEdit(scope.row)">编辑</el-button>
-                  <el-button link type="text" @click="handleDetail(scope.row)">会员详情</el-button>
-                  <el-button link type="text" @click="handleCreateCode(scope.row)">生成邀请码</el-button>
-                  <el-button link type="text" @click="handleDelete(scope.row)">删除</el-button>
+                  <el-button link type="text" @click="handleDetail(scope.row)" v-if="$hasPermission('core:appuser:detail')">会员详情</el-button>
+                  <el-button link type="text" @click="handleCreateCode(scope.row)" v-if="$hasPermission('core:appuser:code')">生成邀请码</el-button>
+                  <el-button link type="text" @click="handleDelete(scope.row)" v-if="$hasPermission('core:appuser:delete')">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -78,27 +87,54 @@ import qs from 'qs'
 export default {
   data () {
     return {
+      pageTitle: '',
       queryParams: {
         page: 1,
         limit: 10,
-        memberId: '',
-        memberName: '',
+        uniqueNo: '',
+        realName: '',
         channelId: ''
       },
-      total: 999,
-      channelOptions: [
-        { id: 1, channelName: '渠道方1' }
-      ],
-      dataList: [1],
+      total: 0,
+      channelOptions: [],
+      dataList: [],
       loading: false
     }
   },
+  created () {
+    this.getSupplierOptions()
+  },
+  mounted () {
+    this.pageTitle = this.$router.currentRoute.meta.title
+    this.getList()
+  },
   methods: {
+    getSupplierOptions () {
+      this.$http.get('/core/channel/page', { params: { page: 1, limit: -1 } }).then(res => {
+        this.channelOptions = res.data.data.list.filter(item => item.type === 1) || []
+      })
+    },
     getList () {
+      this.loading = true
+      this.$http.get('/core/app/user/page', { params: this.queryParams }).then(res => {
+        this.dataList = res.data.data.list || []
+        this.dataList.forEach(item => {
+          item.phoneCopy = item.phone && item.phone.replace(/^(\d{3})\d*(\d{4})$/, '$1****$2')
+        })
 
+        this.total = res.data.data.total || 0
+        this.loading = false
+      })
     },
     reset () {
-
+      this.queryParams = {
+        page: 1,
+        limit: 10,
+        uniqueNo: '',
+        nickName: '',
+        channelId: ''
+      }
+      this.getList()
     },
     handleAdd () {
       this.$router.push({ name: 'memberAdd' })
@@ -111,17 +147,22 @@ export default {
       })
       window.location.href = `${window.SITE_CONFIG['apiURL']}/core/app/user/export?${params}`
     },
-    handleEdit (row) {
-      this.$router.push({ name: 'memberDetail', query: { id: row.id } })
-    },
     handleDetail (row) {
-
+      this.$router.push({ name: 'memberDetail', query: { id: row.id } })
     },
     handleCreateCode (row) {
 
     },
     handleDelete (row) {
-
+      this.$confirm(`确定要删除会员【${row.nickName}】吗?`, '提示', {
+        type: 'warning'
+      }).then(() => {
+        this.$http.delete('/core/app/user', { 'data': [row.id] }).then(res => {
+          if (res.data.code !== 0) return this.$message.error(res.data.msg)
+          this.$message.success('删除成功')
+          this.getList()
+        })
+      })
     },
     pageSizeChangeHandle (val) {
       this.queryParams.limit = val
@@ -136,12 +177,12 @@ export default {
 </script>
 
 <style scoped lang="scss">
-.title{
-  font-family: PingFang-SC, PingFang-SC;
-  font-weight: bold;
-  font-size: 16px;
-  color: #252525;
-  line-height: 22px;
+.page-title{
+    font-family: PingFang-SC, PingFang-SC;
+    font-weight: bold;
+    font-size: 16px;
+    color: #252525;
+    line-height: 22px;
 }
 
 .query{
@@ -167,4 +208,30 @@ export default {
     line-height: 22px;
   }
 }
+
+.userinfo{
+  img{
+    width: 36px;
+    height: 36px;
+    border-radius: 50%;
+  }
+  &-text{
+    margin-left: 5px;
+    &-name{
+      font-family: PingFangSC, PingFang SC;
+      font-weight: 400;
+      font-size: 14px;
+      color: #252525;
+      line-height: 14px;
+    }
+    &-phone{
+      font-family: PingFangSC, PingFang SC;
+      font-weight: 400;
+      font-size: 14px;
+      color: #252525;
+      line-height: 14px;
+      margin-top: 10px;
+    }
+  }
+}
 </style>