浏览代码

2024.07.13
- 完成抽奖活动页和抽奖奖品页和抽奖奖项页和抽奖记录页;
- 增加旧团蜂项目接口拦截器;
- 组合活动配置页对接社区服务列表接口;
- 组合活动配置页完善活动配置类型字段判断展示;
- 提现申请页增加订单分佣列表显示;
- 重构用户详情组件和增加用户评论组件;

zweiqin 8 月之前
父节点
当前提交
1684a028b2
共有 32 个文件被更改,包括 3229 次插入424 次删除
  1. 2 0
      .env.development
  2. 1 0
      .env.production
  3. 1 0
      .env.staging
  4. 100 220
      package-lock.json
  5. 10 0
      src/api/active/combinationActivities.js
  6. 46 0
      src/api/lotteryManagement/LotteryAwards.js
  7. 46 0
      src/api/lotteryManagement/LotteryPrizes.js
  8. 46 0
      src/api/lotteryManagement/LotteryRecords.js
  9. 46 0
      src/api/lotteryManagement/lotteryActivities.js
  10. 9 0
      src/api/withdrawal.js
  11. 98 0
      src/utils/tuanRequest.js
  12. 36 0
      src/views/active/combinationActivities/components/EditModal.vue
  13. 194 13
      src/views/active/combinationActivityConfiguration/components/EditModal.vue
  14. 136 0
      src/views/finance/withdrawal/components/OrderCommission.vue
  15. 11 1
      src/views/finance/withdrawal/components/RelatedOrders.vue
  16. 132 0
      src/views/lotteryManagement/LotteryAwards/components/DetailModal.vue
  17. 175 0
      src/views/lotteryManagement/LotteryAwards/components/EditModal.vue
  18. 199 0
      src/views/lotteryManagement/LotteryAwards/index.vue
  19. 115 0
      src/views/lotteryManagement/LotteryPrizes/components/DetailModal.vue
  20. 158 0
      src/views/lotteryManagement/LotteryPrizes/components/EditModal.vue
  21. 182 0
      src/views/lotteryManagement/LotteryPrizes/index.vue
  22. 106 0
      src/views/lotteryManagement/LotteryRecords/components/DetailModal.vue
  23. 132 0
      src/views/lotteryManagement/LotteryRecords/components/EditModal.vue
  24. 168 0
      src/views/lotteryManagement/LotteryRecords/index.vue
  25. 105 0
      src/views/lotteryManagement/lotteryActivities/components/DetailModal.vue
  26. 157 0
      src/views/lotteryManagement/lotteryActivities/components/EditModal.vue
  27. 173 0
      src/views/lotteryManagement/lotteryActivities/index.vue
  28. 137 0
      src/views/member/memberList/components/CommentDetails.vue
  29. 294 0
      src/views/member/memberList/components/UserDetails.vue
  30. 21 37
      src/views/member/memberList/details.vue
  31. 185 152
      src/views/member/memberList/index.vue
  32. 8 1
      vue.config.js

+ 2 - 0
.env.development

@@ -7,7 +7,9 @@ VUE_APP_BASE_API = '/dev-api'
 # 开发环境
 # VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9003'
 # 线上
+VUE_APP_DOMAIN_TUAN = 'https://www.tuanfengkeji.cn/dts-app-api'
 VUE_APP_DOMAIN_PREFIX = 'https://nsadminapi.tuanfengkeji.cn'
 # 演示环境
 # VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9003'
+VUE_APP_DOMAIN_TUAN = '/tuan'
 VUE_APP_DOMAIN_PREFIX = '/api'

+ 1 - 0
.env.production

@@ -4,4 +4,5 @@ ENV = 'production'
 # base api
 VUE_APP_BASE_API = '/prod-api'
 
+VUE_APP_DOMAIN_TUAN = 'https://www.tuanfengkeji.cn/dts-app-api'
 VUE_APP_DOMAIN_PREFIX = 'https://nsadminapi.tuanfengkeji.cn'

+ 1 - 0
.env.staging

@@ -9,4 +9,5 @@ VUE_APP_BASE_API = '/stage-api'
 # 线上
 # VUE_APP_DOMAIN_PREFIX = 'https://nsadminapi.tuanfengkeji.cn'
 # 测试
+VUE_APP_DOMAIN_TUAN = 'https://test.tuanfengkeji.cn/dts-app-api'
 VUE_APP_DOMAIN_PREFIX = 'https://nsadminapitest.tuanfengkeji.cn'

文件差异内容过多而无法显示
+ 100 - 220
package-lock.json


+ 10 - 0
src/api/active/combinationActivities.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+import tuanRequest from '@/utils/tuanRequest'
 
 // 分页查询平台组合活动配置
 export function getPlatformComposeConfigPage(data) {
@@ -117,3 +118,12 @@ export function getPlatformComposeData(data) {
   })
 }
 
+// 分页查询平台组合活动配置
+export function getCommunityServerInfoList(data) {
+  return tuanRequest({
+    url: '/third/community/serverInfoList',
+    method: 'post',
+    data
+  })
+}
+

+ 46 - 0
src/api/lotteryManagement/LotteryAwards.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 分页查询抽奖奖项
+export function getPageLotteryItem(params) {
+  return request({
+    url: '/lotteryItem/page',
+    method: 'get',
+    params
+  })
+}
+
+// 查询抽奖奖项
+export function getByIdLotteryItem(params) {
+  return request({
+    url: '/lotteryItem/getById',
+    method: 'get',
+    params
+  })
+}
+
+// 新增抽奖奖项
+export function saveLotteryItem(data) {
+  return request({
+    url: '/lotteryItem/save',
+    method: 'post',
+    data
+  })
+}
+
+// 修改抽奖奖项
+export function updateLotteryItem(data) {
+  return request({
+    url: '/lotteryItem/update',
+    method: 'post',
+    data
+  })
+}
+
+// 删除抽奖奖项
+export function deleteByIdLotteryItem(params) {
+  return request({
+    url: '/lotteryItem/deleteById',
+    method: 'delete',
+    params
+  })
+}

+ 46 - 0
src/api/lotteryManagement/LotteryPrizes.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 分页查询抽奖奖品
+export function getPageLotteryPrize(params) {
+  return request({
+    url: '/lotteryPrize/page',
+    method: 'get',
+    params
+  })
+}
+
+// 查询抽奖奖品
+export function getByIdLotteryPrize(params) {
+  return request({
+    url: '/lotteryPrize/getById',
+    method: 'get',
+    params
+  })
+}
+
+// 新增抽奖奖品
+export function saveLotteryPrize(data) {
+  return request({
+    url: '/lotteryPrize/save',
+    method: 'post',
+    data
+  })
+}
+
+// 修改抽奖奖品
+export function updateLotteryPrize(data) {
+  return request({
+    url: '/lotteryPrize/update',
+    method: 'post',
+    data
+  })
+}
+
+// 删除抽奖奖品
+export function deleteByIdLotteryPrize(params) {
+  return request({
+    url: '/lotteryPrize/deleteById',
+    method: 'delete',
+    params
+  })
+}

+ 46 - 0
src/api/lotteryManagement/LotteryRecords.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 分页查询抽奖记录
+export function getPageLotteryRecord(params) {
+  return request({
+    url: '/lotteryRecord/page',
+    method: 'get',
+    params
+  })
+}
+
+// 查询抽奖记录
+export function getByIdLotteryRecord(params) {
+  return request({
+    url: '/lotteryRecord/getById',
+    method: 'get',
+    params
+  })
+}
+
+// 新增抽奖记录
+export function saveLotteryRecord(data) {
+  return request({
+    url: '/lotteryRecord/save',
+    method: 'post',
+    data
+  })
+}
+
+// 修改抽奖记录
+export function updateLotteryRecord(data) {
+  return request({
+    url: '/lotteryRecord/update',
+    method: 'post',
+    data
+  })
+}
+
+// 删除抽奖记录
+export function deleteByIdLotteryRecord(params) {
+  return request({
+    url: '/lotteryRecord/deleteById',
+    method: 'delete',
+    params
+  })
+}

+ 46 - 0
src/api/lotteryManagement/lotteryActivities.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 分页查询抽奖活动
+export function getPageLotteryActivities(params) {
+  return request({
+    url: '/lottery/page',
+    method: 'get',
+    params
+  })
+}
+
+// 查询抽奖活动
+export function getByIdLotteryActivities(params) {
+  return request({
+    url: '/lottery/getById',
+    method: 'get',
+    params
+  })
+}
+
+// 新增抽奖活动
+export function saveLotteryActivities(data) {
+  return request({
+    url: '/lottery/save',
+    method: 'post',
+    data
+  })
+}
+
+// 修改抽奖活动
+export function updateLotteryActivities(data) {
+  return request({
+    url: '/lottery/update',
+    method: 'post',
+    data
+  })
+}
+
+// 删除抽奖活动
+export function deleteByIdLotteryActivities(params) {
+  return request({
+    url: '/lottery/deleteById',
+    method: 'delete',
+    params
+  })
+}

+ 9 - 0
src/api/withdrawal.js

@@ -63,3 +63,12 @@ export function updateWithdrawalByAllinpay(data) {
     data
   })
 }
+
+// 查看订单分佣列表
+export function getWithdrawalCommissionList(data) {
+  return request({
+    url: '/withdrawal/commissionList',
+    method: 'post',
+    data
+  })
+}

+ 98 - 0
src/utils/tuanRequest.js

@@ -0,0 +1,98 @@
+import Vue from 'vue'
+import axios from 'axios'
+import {
+  MessageBox,
+  Message
+} from 'element-ui'
+import store from '@/store'
+import router from '@/router'
+import {
+  getToken, removeToken
+} from '@/utils/auth'
+
+const baseURL = process.env.VUE_APP_DOMAIN_TUAN
+// create an axios instance
+Vue.prototype.axios = axios
+axios.defaults.timeout = 30000
+const service = axios.create({
+  baseURL, // url = base url + request url
+  // withCredentials: true, // send cookies when cross-domain requests
+  timeout: 30000 // request timeout
+})
+
+export const token = getToken()
+
+// request interceptor
+service.interceptors.request.use(
+  (config) => {
+    // console.log(config)
+    if (store.getters.token) {
+      config.headers['Authorization-admin'] = getToken()
+      config.headers['Content-Type'] = 'application/json; charset=UTF-8'
+      config.headers['TK-token'] = getToken()
+    }
+    return config
+  },
+  (error) => {
+    console.log(error) // for debug
+    return Promise.reject(error)
+  }
+)
+
+// response interceptor
+service.interceptors.response.use((response) => {
+  const res = response.data
+  // console.log(res)
+  if (res.erron && res.erron === 780) {
+    Message({
+      message: '服务器内部错误' || 'Error',
+      type: 'error',
+      duration: 5 * 1000
+    })
+  } else {
+    // if the custom code is not 20000, it is judged as an error.
+    if (res.statusCode !== 20000) {
+      Message({
+        message: res.statusMsg || 'Error',
+        type: 'error',
+        duration: 5 * 1000
+      })
+
+      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
+      if (
+        res.statusCode === 50008 ||
+        res.statusCode === 50012 ||
+        res.statusCode === 50014
+      ) {
+        // to re-login
+        MessageBox.confirm(
+          'You have been logged out, you can cancel to stay on this page, or log in again',
+          'Confirm logout',
+          {
+            confirmButtonText: 'Re-Login',
+            cancelButtonText: 'Cancel',
+            type: 'warning'
+          }
+        ).then(() => {
+          store.dispatch('user/resetToken').then(() => {
+            location.reload()
+          })
+        })
+      }
+      return Promise.reject(new Error(res.statusMsg || res.errmsg || 'Error'))
+      // return res;
+    }
+    return res
+  }
+  return res
+}, (error) => {
+  console.log('err' + error)// for debug
+  Message({
+    message: '登录连接超时(后台不能连接,请联系系统管理员)',
+    type: 'error',
+    duration: 5 * 1000
+  })
+  return Promise.reject(error)
+})
+
+export default service

+ 36 - 0
src/views/active/combinationActivities/components/EditModal.vue

@@ -8,6 +8,13 @@
           :disabled="formData.state === 0"
         />
       </el-form-item>
+      <el-form-item label="请选择区域" prop="regionId">
+        <el-cascader
+          v-model="regionArrDialog" :props="regionProps" size="large" placeholder="请选择区域"
+          @change="formData.regionId = regionArrDialog[regionArrDialog.length - 1]"
+        ></el-cascader>
+        <div v-if="String(formData.regionId)">已选ID:{{ formData.regionId }}</div>
+      </el-form-item>
       <el-form-item label="备注" prop="remark">
         <el-input
           v-model="formData.remark" maxlength="255" type="textarea" placeholder="请输入活动介绍"
@@ -70,6 +77,7 @@
 
 <script>
 import { getPlatformComposeById, savePlatformComposeActivity, updatePlatformComposeActivity } from '@/api/active/combinationActivities'
+import { getProvinceList, getChildAreaList } from '@/api/address'
 
 export default {
   name: 'EditModal',
@@ -87,6 +95,7 @@ export default {
         dateTime1: [], // 后端不接收
         dateTime2: [], // 后端不接收
         composeId: '',
+        regionId: '',
         composeName: '',
         remark: '',
         signStartTime: '',
@@ -109,6 +118,7 @@ export default {
         composeName: [
           { required: true, message: '请输入活动名称', trigger: 'blur' }
         ],
+        regionId: [ { required: true, message: '请选择地址', trigger: 'blur' } ],
         dateTime1: [
           { type: 'array', required: true, message: '请选择报名时间' }
         ],
@@ -116,6 +126,30 @@ export default {
           { type: 'array', required: true, message: '请选择活动时间' }
         ],
         bondMoney: []
+      },
+      regionArrDialog: [],
+      regionProps: {
+        checkStrictly: true,
+        lazy: true,
+        label: 'name',
+        value: 'id',
+        lazyLoad(node, resolve) {
+          const { level, value } = node
+          if (level === 0) {
+            resolve([ { id: 0, parentId: 0, name: '全中国', shortName: '全国', longitude: '108.55', latitude: '34.32', level: 1, sort: 1, status: true } ])
+          } else if (level === 1) {
+            getProvinceList().then((res) => {
+              resolve(res.data)
+            })
+          } else if ((level != 0) && (level != 1)) {
+            getChildAreaList(value).then((res) => {
+              resolve(res.data.map((item) => {
+                item.leaf = level === 4
+                return item
+              }))
+            })
+          }
+        }
       }
     }
   },
@@ -146,6 +180,7 @@ export default {
         dateTime1: params.signTime ? params.signTime.split('~') : '',
         dateTime2: params.time ? params.time.split('~') : ''
       })
+      if (this.formData.regionId) this.regionArrDialog = [ this.formData.regionId ]
       this.visible = true
       this.initList()
       if (params.composeId) {
@@ -178,6 +213,7 @@ export default {
           dateTime1: res.data.signStartTime || res.data.signEndTime ? [res.data.signStartTime, res.data.signEndTime] : '',
           dateTime2: res.data.startTime || res.data.endTime ? [res.data.startTime, res.data.endTime] : ''
         })
+        if (this.formData.regionId) this.regionArrDialog = [ this.formData.regionId ]
         this.$nextTick(() => {
           this.$refs.formData && this.$refs.formData.validate()
         })

+ 194 - 13
src/views/active/combinationActivityConfiguration/components/EditModal.vue

@@ -11,8 +11,8 @@
       </el-form-item>
       <el-form-item label="活动配置类型" prop="configType">
         <el-select
-          v-model="formData.configType" clearable size="mini" placeholder="请选择活动类型"
-          @change="formData.roleType = formData.ruleId = formData.joinRule = formData.joinMoney = ''"
+          v-model="formData.configType" clearable size="mini" placeholder="请选择活动配置类型"
+          @change="formData.roleType = formData.ruleId = formData.joinRule = formData.joinMoney = formData.isCardHolder = formData.serverId = ''"
         >
           <el-option label="升级活动" :value="1" />
           <el-option label="分佣活动" :value="2" />
@@ -24,6 +24,7 @@
           <el-option label="社区订单" :value="8" />
           <el-option label="用户代金券转增" :value="9" />
           <el-option label="商家代金券转赠" :value="10" />
+          <el-option label="同城联盟卡" :value="11" />
         </el-select>
       </el-form-item>
       <el-form-item label="是否参与" prop="joinRole">
@@ -45,7 +46,7 @@
         </el-select>
       </el-form-item>
       <el-form-item
-        v-if="[1, 2].includes(formData.configType) && (formData.joinRole === 1)" label="关联佣金配置"
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1)" label="关联佣金配置"
         prop="ruleId"
       >
         <el-select v-model="formData.ruleId" clearable size="mini" placeholder="请选择关联佣金配置" filterable>
@@ -56,25 +57,137 @@
         </el-select>
       </el-form-item>
       <el-form-item
-        v-if="[2, 3, 4, 5].includes(formData.configType) && (formData.joinRole === 1)" label="规则"
+        v-if="[1, 2, 3, 4, 5, 6, 7].includes(formData.configType) && (formData.joinRole === 1)" label="规则"
         prop="joinRule"
       >
         <el-select v-model="formData.joinRule" clearable size="mini" placeholder="请选择规则">
-          <el-option label="金额" :value="1" />
-          <el-option label="比例" :value="2" />
+          <el-option label="固定金额活动" :value="1" />
+          <el-option label="商品价格比例" :value="2" />
         </el-select>
       </el-form-item>
       <el-form-item
-        v-if="[2, 3, 4, 5].includes(formData.configType) && (formData.joinRole === 1)" label="参与值"
+        v-if="[1, 2, 3, 4, 5, 6, 7].includes(formData.configType) && (formData.joinRole === 1)" label="参与值"
         prop="joinMoney"
       >
-        <el-input v-model="formData.joinMoney" placeholder="请输入参与值" style="width: 250px;">
+        <el-input v-model="formData.joinMoney" placeholder="请输入商家参与活动金额或价格比例" style="width: 250px;">
           <template #append>
             <div v-if="formData.joinRule === 1">元</div>
             <div v-else-if="formData.joinRule === 2">%</div>
           </template>
         </el-input>
       </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7].includes(formData.configType) && (formData.joinRole === 1)" label="固定分配佣金总额"
+        prop="commissionPrice"
+      >
+        <el-input v-model="formData.commissionPrice" placeholder="请输入固定分配佣金总额" style="width: 250px;">
+          <template #append>
+            <div>元</div>
+          </template>
+        </el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="[ 3 ].includes(formData.configType) && (formData.joinRole === 1)" label="社区服务"
+        prop="serverId"
+      >
+        <el-select v-model="formData.serverId" clearable size="mini" placeholder="请选择社区服务" filterable>
+          <el-option
+            v-for="(item, index) in communityList" :key="item.id"
+            :label="`${item.serverInfoName || '--'}(${item.id})`" :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1)"
+        label="是否发送卡包" prop="isCardHolder"
+      >
+        <el-radio-group v-model="formData.isCardHolder">
+          <el-radio :label="1">是</el-radio>
+          <el-radio :label="0">否</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1)"
+        label="卡券类型" prop="cardType"
+      >
+        <el-select v-model="formData.cardType" clearable size="mini" placeholder="请选择卡券类型">
+          <el-option label="社区" :value="1" />
+          <el-option label="商圈" :value="2" />
+          <el-option label="商城" :value="3" />
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1)"
+        label="卡券类型规则" prop="cardRule"
+      >
+        <el-radio-group v-model="formData.cardRule">
+          <el-radio :label="1">满减券</el-radio>
+          <el-radio :label="2">折扣券</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1)"
+        label="卡包价格规则" prop="cardMoney"
+      >
+        <el-input v-model="formData.cardMoney" placeholder="请输入卡包价格规则" style="width: 250px;">
+          <template #prepend>
+            <div v-if="formData.cardRule === 1">减</div>
+            <div v-else-if="formData.cardRule === 2">打</div>
+          </template>
+          <template #append>
+            <div v-if="formData.cardRule === 1">元</div>
+            <div v-else-if="formData.cardRule === 2">折</div>
+          </template>
+        </el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1)"
+        label="卡券发放数量" prop="cardNum"
+      >
+        <el-input v-model="formData.cardNum" placeholder="请输入卡券发放数量" style="width: 200px;">
+          <template #append>
+            <div>天</div>
+          </template>
+        </el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1)"
+        label="卡券有效期" prop="cardEffectiveTime"
+      >
+        <el-input v-model="formData.cardEffectiveTime" placeholder="请输入卡券有效期" style="width: 200px;">
+          <template #append>
+            <div>天</div>
+          </template>
+        </el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1)"
+        label="卡券使用范围" prop="cardRange"
+      >
+        <el-select v-model="formData.cardRange" clearable size="mini" placeholder="请选择卡券使用范围">
+          <el-option label="指定" :value="1" />
+          <el-option label="全部" :value="2" />
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1) && (formData.cardRange === 1)"
+        label="卡券指定区域" prop="cardRange"
+      >
+        <el-cascader
+          v-model="regionArrDialog" :props="regionProps" size="large" placeholder="请选择区域"
+          @change="formData.cardJson = [ ...new Set(regionArrDialog.map(i => i[i.length - 1])) ].join(',')"
+        ></el-cascader>
+        <div v-if="String(formData.cardJson)">已选ID:{{ formData.cardJson }}</div>
+      </el-form-item>
+      <el-form-item
+        v-if="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(formData.configType) && (formData.joinRole === 1) && (formData.isCardHolder === 1)"
+        label="业务json字段" prop="cardBusinessFields"
+      >
+        <el-input
+          v-model="formData.cardBusinessFields" maxlength="255" type="textarea" placeholder="请输入封装第三方业务的JSON字符串"
+          style="width: 400px;"
+        />
+      </el-form-item>
     </el-form>
     <template #footer>
       <span class="dialog-footer">
@@ -86,8 +199,9 @@
 </template>
 
 <script>
-import { savePlatformComposeConfig, updatePlatformComposeConfig, getPlatformComposeConfigById, getPlatformComposePage } from '@/api/active/combinationActivities'
+import { savePlatformComposeConfig, updatePlatformComposeConfig, getPlatformComposeConfigById, getPlatformComposePage, getCommunityServerInfoList } from '@/api/active/combinationActivities'
 import { getAllPlatformBeeRule } from '@/api/commissionAllocation/gradeCommission'
+import { getProvinceList, getChildAreaList } from '@/api/address'
 
 export default {
   name: 'EditModal',
@@ -109,7 +223,18 @@ export default {
         joinRule: '',
         roleType: '',
         joinMoney: '',
-        ruleId: ''
+        commissionPrice: '',
+        ruleId: '',
+        isCardHolder: '',
+        cardType: '',
+        cardRule: '',
+        cardMoney: '',
+        cardNum: '',
+        cardEffectiveTime: '',
+        cardRange: '',
+        cardJson: '',
+        cardBusinessFields: '',
+        serverId: ''
       },
       formRules: {
         composeId: [
@@ -121,10 +246,51 @@ export default {
         joinMoney: [
           { required: false, message: '请输入参与值' },
           { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
-        ]
+        ],
+        commissionPrice: [
+          { required: false, message: '请输入固定分配佣金总额' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        cardRule: [
+          { required: false, message: '请输入卡包价格规则' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        cardNum: [
+          { required: false, message: '请输入卡券发放数量' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        cardEffectiveTime: [
+          { required: false, message: '请输入卡券有效期' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        isCardHolder: [ { required: true, message: '请选择是否发送卡包' } ]
       },
       activityList: [],
-      ruleList: []
+      ruleList: [],
+      communityList: [],
+      regionArrDialog: [],
+      regionProps: {
+        checkStrictly: true,
+        multiple: true,
+        lazy: true,
+        label: 'name',
+        value: 'id',
+        lazyLoad(node, resolve) {
+          const { level, value } = node
+          if (level === 0) {
+            getProvinceList().then((res) => {
+              resolve(res.data)
+            })
+          } else if (level != 0) {
+            getChildAreaList(value).then((res) => {
+              resolve(res.data.map((item) => {
+                item.leaf = level === 3
+                return item
+              }))
+            })
+          }
+        }
+      }
     }
   },
   methods: {
@@ -136,12 +302,15 @@ export default {
       this.activityList = res1.data.list
       const res2 = await getAllPlatformBeeRule({ page: 1, pageSize: 9999 })
       this.ruleList = res2.data.list
+      const res3 = await getCommunityServerInfoList({ pageNo: 1, pageSize: 9999 })
+      this.communityList = res3.data.list
     },
     handleOpen(params = {}) {
       this.modalOptions.title = params.configId ? '编辑组合活动配置' : '添加组合活动配置'
       this.formData = Object.assign(this.$options.data().formData, params, {
         joinMoney: (params.joinRule === 2) && (typeof params.joinMoney === 'number') ? params.joinMoney * 100 : params.joinMoney
       })
+      if (this.formData.cardJson) this.regionArrDialog = this.formData.cardJson.split(',').map((i) => [ i ])
       this.visible = true
       this.initList()
       if (params.configId) {
@@ -162,8 +331,20 @@ export default {
           joinRule: res.data.joinRule || '',
           roleType: res.data.roleType || '',
           joinMoney: (res.data.joinRule === 2) && (typeof res.data.joinMoney === 'number') ? res.data.joinMoney * 100 : res.data.joinMoney,
-          ruleId: res.data.ruleId || ''
+          commissionPrice: '',
+          ruleId: res.data.ruleId || '',
+          isCardHolder: res.data.isCardHolder,
+          cardType: res.data.cardType || '',
+          cardRule: res.data.cardRule || '',
+          cardMoney: res.data.cardMoney || '',
+          cardNum: res.data.cardNum || '',
+          cardEffectiveTime: res.data.cardEffectiveTime || '',
+          cardRange: res.data.cardRange || '',
+          cardJson: res.data.cardJson || '',
+          cardBusinessFields: res.data.cardBusinessFields || '',
+          serverId: res.data.serverId || ''
         })
+        if (this.formData.cardJson) this.regionArrDialog = this.formData.cardJson.split(',').map((i) => [ i ])
         this.$nextTick(() => {
           this.$refs.formData && this.$refs.formData.validate()
         })

+ 136 - 0
src/views/finance/withdrawal/components/OrderCommission.vue

@@ -0,0 +1,136 @@
+<template>
+  <el-dialog :visible.sync="visible" v-bind="modalOptions" append-to-body>
+    <!-- 查询结果 -->
+    <div style="position: relative;padding: 0 0 10px;">
+      <el-table
+        v-loading="listLoading" max-height="600" element-loading-text="正在查询中。。。" :data="list"
+        :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="用户名称" prop="name" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" min-width="120" label="入账用户ID" prop="buyerUserId">
+          <template slot-scope="{ row }">
+            <div>
+              <span>{{ row.buyerUserId }}</span>
+              <el-button
+                v-if="row.buyerUserId"
+                style="margin-left: 14px;" type="warning" size="mini"
+                @click="$refs.DetailModal1 && $refs.DetailModal1.handleOpen(row)"
+              >
+                详情
+              </el-button>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="来源类型" prop="sourceType">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.sourceType === 1" effect="plain">平台</el-tag>
+            <el-tag v-else-if="row.sourceType === 2" effect="plain">商圈</el-tag>
+            <el-tag v-else-if="row.sourceType === 3" effect="plain">用户</el-tag>
+            <el-tag v-else-if="row.sourceType === 4" effect="plain">社区</el-tag>
+            <el-tag v-else-if="row.sourceType === 5" effect="plain">商城</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="120" label="来源ID" prop="sourceId" />
+        <el-table-column align="center" width="150" label="来源订单编号" prop="orderFormid" />
+        <el-table-column align="center" width="120" label="入账数量" prop="commissionNumber" />
+        <el-table-column align="center" label="来源类型" prop="waterType">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.waterType === 1" effect="plain">订单退款</el-tag>
+            <el-tag v-else-if="row.waterType === 2" effect="plain">升级活动</el-tag>
+            <el-tag v-else-if="row.waterType === 3" effect="plain">社区活动</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="有效时间" prop="effectiveTime" />
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+      </el-table>
+      <div style="position: sticky;bottom: -5px;z-index: 1;padding: 10px;background-color: #eeeeee;">
+        <el-pagination
+          :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]"
+          :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"
+          @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+          @current-change="(val) => ((listQuery.page = val) && getList())"
+        />
+      </div>
+
+      <!-- 用户详情 -->
+      <DetailModal1 ref="DetailModal1" @success="getList" />
+    </div>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">关 闭</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import DetailModal1 from '../../../member/memberList/components/UserDetails'
+import { getWithdrawalCommissionList } from '@/api/withdrawal'
+
+export default {
+  name: 'OrderCommission',
+  components: {
+    DetailModal1
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '1000px',
+        title: '查看订单分佣列表'
+      },
+      visible: false,
+      formData: {
+        orderFormid: ''
+      },
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        orderFormid: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.listQuery.orderFormid = params.orderFormid
+      if (params.orderFormid) {
+        // this.getInfo(params.orderFormid)
+        this.getList()
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await xxx({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          xxx: res.data.xxx || ''
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getWithdrawalCommissionList(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    }
+  }
+}
+</script>

+ 11 - 1
src/views/finance/withdrawal/components/RelatedOrders.vue

@@ -87,10 +87,16 @@
         <el-table-column align="center" min-width="150" prop="receivePhone" label="收货人手机号" show-overflow-tooltip />
         <el-table-column align="center" min-width="150" prop="address" label="详细地址" show-overflow-tooltip />
         <el-table-column align="center" min-width="120" prop="shopId" label="关联店铺ID" show-overflow-tooltip />
-        <el-table-column label="操作" width="200" fixed="right" class-name="small-padding fixed-width">
+        <el-table-column label="操作" width="260" fixed="right" class-name="small-padding fixed-width">
           <template slot-scope="{ row }">
             <el-button
               v-if="formData.relatedPresenterVoucherLogs[row.orderFormid]" type="success" size="mini"
+              @click="$refs.OrderCommission && $refs.OrderCommission.handleOpen(row)"
+            >
+              查看分佣
+            </el-button>
+            <el-button
+              v-if="formData.relatedPresenterVoucherLogs[row.orderFormid]" type="success" size="mini"
               @click="$refs.RelatedVoucherLogs && $refs.RelatedVoucherLogs.handleOpen(formData.relatedPresenterVoucherLogs[row.orderFormid], { userList: formData.relatedBuyerUsers })"
             >
               代金券记录
@@ -105,6 +111,8 @@
         </el-table-column>
       </el-table>
 
+      <!-- 订单分佣 -->
+      <OrderCommission ref="OrderCommission" />
       <!-- 代金券记录 -->
       <RelatedVoucherLogs ref="RelatedVoucherLogs" />
       <!-- 佣金记录 -->
@@ -121,6 +129,7 @@
 </template>
 
 <script>
+import OrderCommission from './OrderCommission'
 import RelatedVoucherLogs from './RelatedVoucherLogs'
 import RelatedCommissionLogs from './RelatedCommissionLogs'
 import UserDetails from './UserDetails'
@@ -128,6 +137,7 @@ import UserDetails from './UserDetails'
 export default {
   name: 'RelatedOrders',
   components: {
+    OrderCommission,
     RelatedVoucherLogs,
     RelatedCommissionLogs,
     UserDetails

+ 132 - 0
src/views/lotteryManagement/LotteryAwards/components/DetailModal.vue

@@ -0,0 +1,132 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 抽奖奖项信息 -->
+      <el-form-item label="ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="关联抽奖活动ID" prop="lotteryId">
+        <div style="display: flex;align-items: center;">
+          <span>{{ formData.lotteryId || '--' }}</span>
+          <el-button
+            v-if="formData.lotteryId"
+            style="margin-left: 14px;" type="warning" size="mini"
+            @click="$refs.DetailModal1 && $refs.DetailModal1.handleOpen({ id: formData.lotteryId })"
+          >
+            详情
+          </el-button>
+        </div>
+      </el-form-item>
+      <el-form-item label="奖项名称" prop="itemName">
+        {{ formData.itemName || '--' }}
+      </el-form-item>
+      <el-form-item label="奖项等级" prop="level">
+        {{ typeof formData.level === 'number' ? formData.level : '--' }}
+      </el-form-item>
+      <el-form-item label="奖项概率" prop="percent">
+        {{ typeof formData.percent === 'number' ? formData.percent : '--' }}
+      </el-form-item>
+      <el-form-item label="关联抽奖奖品ID" prop="prizeId">
+        <div style="display: flex;align-items: center;">
+          <span>{{ formData.prizeId || '--' }}</span>
+          <el-button
+            v-if="formData.prizeId"
+            style="margin-left: 14px;" type="warning" size="mini"
+            @click="$refs.DetailModal2 && $refs.DetailModal2.handleOpen({ id: formData.prizeId })"
+          >
+            详情
+          </el-button>
+        </div>
+      </el-form-item>
+      <el-form-item label="是否默认" prop="defaultItem">
+        <span v-if="formData.defaultItem === 0">不是</span>
+        <span v-else-if="formData.defaultItem === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+    </el-form>
+
+    <!-- 活动详情 -->
+    <DetailModal1 ref="DetailModal1" />
+    <!-- 奖品详情 -->
+    <DetailModal2 ref="DetailModal2" />
+  </el-dialog>
+</template>
+
+<script>
+import { getByIdLotteryItem } from '@/api/lotteryManagement/LotteryAwards'
+import DetailModal1 from '../../lotteryActivities/components/DetailModal'
+import DetailModal2 from '../../LotteryPrizes/components/DetailModal'
+
+export default {
+  name: 'DetailModal',
+  components: {
+    DetailModal1,
+    DetailModal2
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看抽奖奖项详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        lotteryId: '',
+        itemName: '',
+        level: '',
+        percent: '',
+        prizeId: '',
+        defaultItem: '',
+        createTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryItem({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          lotteryId: res.data.lotteryId || '',
+          itemName: res.data.itemName || '',
+          level: res.data.level,
+          percent: res.data.percent,
+          prizeId: res.data.prizeId || '',
+          defaultItem: res.data.defaultItem,
+          createTime: res.data.createTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 175 - 0
src/views/lotteryManagement/LotteryAwards/components/EditModal.vue

@@ -0,0 +1,175 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="奖项名称" prop="itemName">
+        <el-input v-model="formData.itemName" placeholder="请输入奖项名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="关联抽奖活动" prop="lotteryId">
+        <el-select v-model="formData.lotteryId" size="mini" placeholder="请选择关联抽奖活动" filterable>
+          <el-option
+            v-for="(item, index) in activityList" :key="item.id" :label="`${item.topic}(${item.id})`"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="level" label="奖项等级">
+        <el-input v-model="formData.level" placeholder="请输入奖项等级" style="width: 250px;"></el-input>
+      </el-form-item>
+      <el-form-item prop="percent" label="奖项概率">
+        <el-input v-model="formData.percent" placeholder="请输入奖项概率" style="width: 250px;"></el-input>
+      </el-form-item>
+      <el-form-item label="关联抽奖奖品" prop="prizeId">
+        <el-select v-model="formData.prizeId" size="mini" placeholder="请选择关联抽奖奖品" filterable>
+          <el-option
+            v-for="(item, index) in prizeList" :key="item.id" :label="`${item.prizeName}(${item.id})`"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="是否默认" prop="defaultItem">
+        <el-select v-model="formData.defaultItem" size="mini" placeholder="请选择是否默认">
+          <el-option label="不是" :value="0" />
+          <el-option label="是" :value="1" />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { saveLotteryItem, updateLotteryItem, getByIdLotteryItem } from '@/api/lotteryManagement/LotteryAwards'
+import { getPageLotteryActivities } from '@/api/lotteryManagement/lotteryActivities'
+import { getPageLotteryPrize } from '@/api/lotteryManagement/LotteryPrizes'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        id: '',
+        lotteryId: '',
+        itemName: '',
+        level: '',
+        percent: '',
+        prizeId: '',
+        defaultItem: '',
+        createTime: ''
+      },
+      formRules: {
+        itemName: [
+          { required: true, message: '请输入奖项名称' }
+        ],
+        lotteryId: [
+          { required: true, message: '请选择关联活动' }
+        ],
+        level: [
+          { required: false, message: '请输入奖项等级' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        percent: [
+          { required: false, message: '请输入奖项概率' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        defaultItem: [
+          { required: true, message: '请选择是否默认' }
+        ]
+      },
+      activityList: [],
+      prizeList: []
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    async initList() {
+      const res1 = await getPageLotteryActivities({ page: 1, pageSize: 9999 })
+      this.activityList = res1.data.list
+      const res2 = await getPageLotteryPrize({ page: 1, pageSize: 9999 })
+      this.prizeList = res2.data.list
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '编辑抽奖奖项' : '添加抽奖奖项'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.id) {
+        this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryItem({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          lotteryId: res.data.lotteryId || '',
+          itemName: res.data.itemName || '',
+          level: res.data.level,
+          percent: res.data.percent,
+          prizeId: res.data.prizeId || '',
+          defaultItem: res.data.defaultItem,
+          createTime: res.data.createTime || ''
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '加载中' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.id ? await updateLotteryItem(params) : await saveLotteryItem(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 199 - 0
src/views/lotteryManagement/LotteryAwards/index.vue

@@ -0,0 +1,199 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.itemName" clearable size="mini" class="filter-item"
+        style="width: 200px;"
+        placeholder="请输入奖项名称"
+      />
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <br />
+      <el-button
+        size="mini" type="primary" icon="el-icon-plus"
+        @click="$refs.EditModal && $refs.EditModal.handleOpen({ jobId: '' })"
+      >
+        添加
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="奖项名称" prop="itemName" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" min-width="120" label="关联抽奖活动ID" prop="lotteryId">
+          <template slot-scope="{ row }">
+            <div>
+              <span>{{ row.lotteryId }}</span>
+              <el-button
+                v-if="row.lotteryId"
+                style="margin-left: 14px;" type="warning" size="mini"
+                @click="$refs.DetailModal1 && $refs.DetailModal1.handleOpen({ id: row.lotteryId })"
+              >
+                详情
+              </el-button>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="120" label="奖项等级" prop="level" />
+        <el-table-column align="center" width="120" label="奖项概率" prop="percent" />
+        <el-table-column align="center" min-width="120" label="关联抽奖奖品ID" prop="prizeId">
+          <template slot-scope="{ row }">
+            <div>
+              <span>{{ row.prizeId }}</span>
+              <el-button
+                v-if="row.prizeId"
+                style="margin-left: 14px;" type="warning" size="mini"
+                @click="$refs.DetailModal2 && $refs.DetailModal2.handleOpen({ id: row.prizeId })"
+              >
+                详情
+              </el-button>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否默认" prop="defaultItem">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.defaultItem === 0" effect="plain">不是</el-tag>
+            <el-tag v-else-if="row.defaultItem === 1" effect="plain">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="300" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+    <!-- 活动详情 -->
+    <DetailModal1 ref="DetailModal1" />
+    <!-- 奖品详情 -->
+    <DetailModal2 ref="DetailModal2" />
+  </div>
+</template>
+
+<script>
+import EditModal from './components/EditModal'
+import DetailModal from './components/DetailModal'
+import DetailModal1 from '../lotteryActivities/components/DetailModal'
+import DetailModal2 from '../LotteryPrizes/components/DetailModal'
+import { getPageLotteryItem, deleteByIdLotteryItem } from '@/api/lotteryManagement/LotteryAwards'
+
+export default {
+  name: 'LotteryAwards',
+  components: {
+    EditModal,
+    DetailModal,
+    DetailModal1,
+    DetailModal2
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        itemName: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getPageLotteryItem(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleEdit(row) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    },
+    handleDelete(row) {
+      this.$confirm('确定删除此项?')
+        .then(async () => {
+          await deleteByIdLotteryItem({ id: row.id })
+          this.$message({ message: '删除成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => { })
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 115 - 0
src/views/lotteryManagement/LotteryPrizes/components/DetailModal.vue

@@ -0,0 +1,115 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 抽奖奖品信息 -->
+      <el-form-item label="ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="关联抽奖活动ID" prop="lotteryId">
+        <div style="display: flex;align-items: center;">
+          <span>{{ formData.lotteryId || '--' }}</span>
+          <el-button
+            v-if="formData.lotteryId"
+            style="margin-left: 14px;" type="warning" size="mini"
+            @click="$refs.DetailModal1 && $refs.DetailModal1.handleOpen({ id: formData.lotteryId })"
+          >
+            详情
+          </el-button>
+        </div>
+      </el-form-item>
+      <el-form-item label="奖品名称" prop="prizeName">
+        {{ formData.prizeName || '--' }}
+      </el-form-item>
+      <el-form-item label="奖品类型" prop="prizeType">
+        <span v-if="formData.prizeType === -1">谢谢参与</span>
+        <span v-else-if="formData.prizeType === 1">普通奖品</span>
+        <span v-else-if="formData.prizeType === 2">唯一性奖品</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="总库存" prop="totalStock">
+        {{ typeof formData.totalStock === 'number' ? formData.totalStock : '--' }}
+      </el-form-item>
+      <el-form-item label="可用库存" prop="validStock">
+        {{ typeof formData.validStock === 'number' ? formData.validStock : '--' }}
+      </el-form-item>
+      <el-form-item label="备注" prop="remark">
+        {{ formData.remark || '--' }}
+      </el-form-item>
+    </el-form>
+
+    <!-- 活动详情 -->
+    <DetailModal1 ref="DetailModal1" />
+  </el-dialog>
+</template>
+
+<script>
+import { getByIdLotteryPrize } from '@/api/lotteryManagement/LotteryPrizes'
+import DetailModal1 from '../../lotteryActivities/components/DetailModal'
+
+export default {
+  name: 'DetailModal',
+  components: {
+    DetailModal1
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看抽奖奖品详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        lotteryId: '',
+        prizeName: '',
+        prizeType: '',
+        totalStock: '',
+        validStock: '',
+        remark: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryPrize({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          lotteryId: res.data.lotteryId || '',
+          prizeName: res.data.prizeName || '',
+          prizeType: res.data.prizeType,
+          totalStock: res.data.totalStock,
+          validStock: res.data.validStock,
+          remark: res.data.remark || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 158 - 0
src/views/lotteryManagement/LotteryPrizes/components/EditModal.vue

@@ -0,0 +1,158 @@
+<template>
+  <el-dialog :visible.sync="visible" v-bind="modalOptions">
+    <el-form ref="formData" :model="formData" :rules="formRules" size="mini" label-suffix=":" label-width="150px">
+      <el-form-item label="奖品名称" prop="prizeName">
+        <el-input v-model="formData.prizeName" placeholder="请输入奖品名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="关联活动" prop="lotteryId">
+        <el-select v-model="formData.lotteryId" size="mini" placeholder="请选择关联平台组合活动" filterable>
+          <el-option
+            v-for="(item, index) in activityList" :key="item.id" :label="`${item.topic}(${item.id})`"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="奖品类型" prop="prizeType">
+        <el-select v-model="formData.prizeType" size="mini" placeholder="请选择任务状态">
+          <el-option label="谢谢参与" :value="-1" />
+          <el-option label="普通奖品" :value="1" />
+          <el-option label="唯一性奖品" :value="2" />
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="totalStock" label="总库存">
+        <el-input v-model="formData.totalStock" placeholder="请输入总库存" style="width: 250px;"></el-input>
+      </el-form-item>
+      <el-form-item prop="validStock" label="可用库存">
+        <el-input v-model="formData.validStock" placeholder="请输入可用库存" style="width: 250px;"></el-input>
+      </el-form-item>
+      <el-form-item label="备注" prop="remark">
+        <el-input
+          v-model="formData.remark" type="textarea" placeholder="请输入备注" maxlength="520"
+          :rows="3"
+          show-word-limit
+        />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { saveLotteryPrize, updateLotteryPrize, getByIdLotteryPrize } from '@/api/lotteryManagement/LotteryPrizes'
+import { getPageLotteryActivities } from '@/api/lotteryManagement/lotteryActivities'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        id: '',
+        lotteryId: '',
+        prizeName: '',
+        prizeType: '',
+        totalStock: '',
+        validStock: '',
+        remark: ''
+      },
+      formRules: {
+        prizeName: [
+          { required: true, message: '请输入抽奖奖品名称' }
+        ],
+        lotteryId: [
+          { required: true, message: '请选择关联活动' }
+        ],
+        prizeType: [
+          { required: true, message: '请选择奖品类型' }
+        ],
+        totalStock: [
+          { required: false, message: '请输入总库存' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        validStock: [
+          { required: false, message: '请输入可用库存' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ]
+      },
+      activityList: []
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    async initList() {
+      const res1 = await getPageLotteryActivities({ page: 1, pageSize: 9999 })
+      this.activityList = res1.data.list
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '编辑抽奖奖品' : '添加抽奖奖品'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.id) {
+        this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryPrize({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          lotteryId: res.data.lotteryId || '',
+          prizeName: res.data.prizeName || '',
+          prizeType: res.data.prizeType,
+          totalStock: res.data.totalStock,
+          validStock: res.data.validStock,
+          remark: res.data.remark || ''
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '加载中' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.id ? await updateLotteryPrize(params) : await saveLotteryPrize(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>

+ 182 - 0
src/views/lotteryManagement/LotteryPrizes/index.vue

@@ -0,0 +1,182 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.itemName" clearable size="mini" class="filter-item"
+        style="width: 200px;"
+        placeholder="请输入奖项名称"
+      />
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <br />
+      <el-button
+        size="mini" type="primary" icon="el-icon-plus"
+        @click="$refs.EditModal && $refs.EditModal.handleOpen({ id: '' })"
+      >
+        添加
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="奖品名称" prop="prizeName" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" min-width="120" label="关联抽奖活动ID" prop="lotteryId">
+          <template slot-scope="{ row }">
+            <div>
+              <span>{{ row.lotteryId }}</span>
+              <el-button
+                v-if="row.lotteryId"
+                style="margin-left: 14px;" type="warning" size="mini"
+                @click="$refs.DetailModal1 && $refs.DetailModal1.handleOpen({ id: row.lotteryId })"
+              >
+                详情
+              </el-button>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="奖品类型" prop="prizeType">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.prizeType === -1" effect="plain">谢谢参与</el-tag>
+            <el-tag v-else-if="row.prizeType === 1" effect="plain">普通奖品</el-tag>
+            <el-tag v-else-if="row.prizeType === 2" effect="plain">唯一性奖品</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="120" label="总库存" prop="totalStock" />
+        <el-table-column align="center" width="120" label="可用库存" prop="validStock" />
+        <el-table-column align="center" min-width="150" label="备注" prop="remark" show-overflow-tooltip />
+        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+    <!-- 活动详情 -->
+    <DetailModal1 ref="DetailModal1" />
+  </div>
+</template>
+
+<script>
+import EditModal from './components/EditModal'
+import DetailModal from './components/DetailModal'
+import DetailModal1 from '../lotteryActivities/components/DetailModal'
+import { getPageLotteryPrize, deleteByIdLotteryPrize } from '@/api/lotteryManagement/LotteryPrizes'
+
+export default {
+  name: 'LotteryPrizes',
+  components: {
+    EditModal,
+    DetailModal,
+    DetailModal1
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        topic: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getPageLotteryPrize(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleEdit(row) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    },
+    handleDelete(row) {
+      this.$confirm('确定删除此项?')
+        .then(async () => {
+          await deleteByIdLotteryPrize({ id: row.id })
+          this.$message({ message: '删除成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => { })
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 106 - 0
src/views/lotteryManagement/LotteryRecords/components/DetailModal.vue

@@ -0,0 +1,106 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 抽奖记录信息 -->
+      <el-form-item label="ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="用户ID" prop="buyerUserId">
+        {{ formData.buyerUserId || '--' }}
+      </el-form-item>
+      <el-form-item label="关联抽奖奖项ID" prop="itemId">
+        <div style="display: flex;align-items: center;">
+          <span>{{ formData.itemId || '--' }}</span>
+          <el-button
+            v-if="formData.itemId"
+            style="margin-left: 14px;" type="warning" size="mini"
+            @click="$refs.DetailModal1 && $refs.DetailModal1.handleOpen({ id: formData.itemId })"
+          >
+            详情
+          </el-button>
+        </div>
+      </el-form-item>
+      <el-form-item label="奖品名称" prop="prizeName">
+        {{ formData.prizeName || '--' }}
+      </el-form-item>
+      <el-form-item label="IP" prop="accountIp">
+        {{ formData.accountIp || '--' }}
+      </el-form-item>
+      <el-form-item label="createTime" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+    </el-form>
+
+    <!-- 奖项详情 -->
+    <DetailModal1 ref="DetailModal1" />
+  </el-dialog>
+</template>
+
+<script>
+import { getByIdLotteryRecord } from '@/api/lotteryManagement/LotteryRecords'
+import DetailModal1 from '../../LotteryAwards/components/DetailModal'
+
+export default {
+  name: 'DetailModal',
+  components: {
+    DetailModal1
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看抽奖记录详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        buyerUserId: '',
+        itemId: '',
+        prizeName: '',
+        accountIp: '',
+        createTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryRecord({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          buyerUserId: res.data.buyerUserId || '',
+          itemId: res.data.itemId || '',
+          prizeName: res.data.prizeName || '',
+          accountIp: res.data.accountIp || '',
+          createTime: res.data.createTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 132 - 0
src/views/lotteryManagement/LotteryRecords/components/EditModal.vue

@@ -0,0 +1,132 @@
+<template>
+  <el-dialog :visible.sync="visible" v-bind="modalOptions">
+    <el-form ref="formData" :model="formData" :rules="formRules" size="mini" label-suffix=":" label-width="150px">
+      <el-form-item label="用户ID" prop="buyerUserId">
+        <el-input v-model="formData.buyerUserId" placeholder="请输入用户ID" style="width: 250px;"></el-input>
+      </el-form-item>
+      <el-form-item label="关联奖项" prop="itemId">
+        <el-select v-model="formData.itemId" size="mini" placeholder="请选择关联奖项" filterable>
+          <el-option
+            v-for="(item, index) in awardsList" :key="item.id" :label="`${item.itemName}(${item.id})`"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="prizeName" label="奖品名称">
+        <el-input v-model="formData.prizeName" placeholder="请输入奖品名称" style="width: 250px;"></el-input>
+      </el-form-item>
+      <el-form-item prop="accountIp" label="IP">
+        <el-input v-model="formData.accountIp" placeholder="请输入IP" style="width: 250px;"></el-input>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { saveLotteryRecord, updateLotteryRecord, getByIdLotteryRecord } from '@/api/lotteryManagement/LotteryRecords'
+import { getPageLotteryItem } from '@/api/lotteryManagement/LotteryAwards'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        id: '',
+        buyerUserId: '',
+        itemId: '',
+        prizeName: '',
+        accountIp: '',
+        createTime: ''
+      },
+      formRules: {
+        buyerUserId: [
+          { required: true, message: '请输入用户ID' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        itemId: [
+          { required: true, message: '请选择关联奖项' }
+        ]
+      },
+      awardsList: []
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    async initList() {
+      const res1 = await getPageLotteryItem({ page: 1, pageSize: 9999 })
+      this.awardsList = res1.data.list
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '编辑抽奖记录' : '添加抽奖记录'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.id) {
+        this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryRecord({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          buyerUserId: res.data.buyerUserId || '',
+          itemId: res.data.itemId || '',
+          prizeName: res.data.prizeName || '',
+          accountIp: res.data.accountIp || '',
+          createTime: res.data.createTime || ''
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '加载中' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.id ? await updateLotteryRecord(params) : await saveLotteryRecord(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>

+ 168 - 0
src/views/lotteryManagement/LotteryRecords/index.vue

@@ -0,0 +1,168 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <br />
+      <el-button
+        size="mini" type="primary" icon="el-icon-plus"
+        @click="$refs.EditModal && $refs.EditModal.handleOpen({ id: '' })"
+      >
+        添加
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="100" label="用户ID" prop="buyerUserId" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" min-width="120" label="关联抽奖奖项ID" prop="itemId">
+          <template slot-scope="{ row }">
+            <div>
+              <span>{{ row.itemId }}</span>
+              <el-button
+                v-if="row.itemId"
+                style="margin-left: 14px;" type="warning" size="mini"
+                @click="$refs.DetailModal1 && $refs.DetailModal1.handleOpen({ id: row.itemId })"
+              >
+                详情
+              </el-button>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="奖品名称" prop="prizeName" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="IP" prop="accountIp" />
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+    <!-- 奖项详情 -->
+    <DetailModal1 ref="DetailModal1" />
+  </div>
+</template>
+
+<script>
+import EditModal from './components/EditModal'
+import DetailModal from './components/DetailModal'
+import DetailModal1 from '../LotteryAwards/components/DetailModal'
+import { getPageLotteryRecord, deleteByIdLotteryRecord } from '@/api/lotteryManagement/LotteryRecords'
+
+export default {
+  name: 'LotteryRecords',
+  components: {
+    EditModal,
+    DetailModal,
+    DetailModal1
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getPageLotteryRecord(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleEdit(row) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    },
+    handleDelete(row) {
+      this.$confirm('确定删除此项?')
+        .then(async () => {
+          await deleteByIdLotteryRecord({ id: row.id })
+          this.$message({ message: '删除成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => { })
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 105 - 0
src/views/lotteryManagement/lotteryActivities/components/DetailModal.vue

@@ -0,0 +1,105 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 抽奖活动信息 -->
+      <el-form-item label="ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="抽奖活动名称" prop="topic">
+        {{ formData.topic || '--' }}
+      </el-form-item>
+      <el-form-item label="活动状态" prop="state">
+        {{ formData.state || '--' }}
+      </el-form-item>
+      <el-form-item label="抽奖页面链接" prop="link">
+        {{ formData.link || '--' }}
+      </el-form-item>
+      <el-form-item label="图片" prop="images">
+        <el-image
+          v-if="formData.images" :src="formData.images" style="width:80px;height:80px"
+          fit="cover" :preview-src-list="[ formData.images ]"
+        />
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="开始时间" prop="startTime">
+        {{ formData.startTime || '--' }}
+      </el-form-item>
+      <el-form-item label="结束时间" prop="endTime">
+        {{ formData.endTime || '--' }}
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { getByIdLotteryActivities } from '@/api/lotteryManagement/lotteryActivities'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看抽奖活动详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        topic: '',
+        state: '',
+        link: '',
+        images: '',
+        startTime: '',
+        endTime: '',
+        createTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryActivities({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          topic: res.data.topic || '',
+          state: res.data.state,
+          link: res.data.link || '',
+          images: res.data.images || '',
+          startTime: res.data.startTime || '',
+          endTime: res.data.endTime || '',
+          createTime: res.data.createTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 157 - 0
src/views/lotteryManagement/lotteryActivities/components/EditModal.vue

@@ -0,0 +1,157 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="抽奖活动名称" prop="topic">
+        <el-input v-model="formData.topic" placeholder="请输入抽奖活动名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="活动状态" prop="state">
+        <el-select v-model="formData.state" size="mini" placeholder="请选择活动状态">
+          <el-option label="上线" :value="1" />
+          <el-option label="下线" :value="2" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="抽奖页面链接" prop="link">
+        <el-input v-model="formData.link" placeholder="请输入抽奖页面链接" />
+      </el-form-item>
+      <el-form-item label="logo" prop="images">
+        <ImageUpload v-model="formData.images" :limit="1" />
+      </el-form-item>
+      <el-form-item label="抽奖时间" prop="dateTime1">
+        <el-date-picker
+          v-model="formData.dateTime1" type="datetimerange" range-separator="至" start-placeholder="开始时间"
+          end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss"
+        />
+      </el-form-item>
+
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import ImageUpload from '@/components/ImageUpload'
+import { saveLotteryActivities, updateLotteryActivities, getByIdLotteryActivities } from '@/api/lotteryManagement/lotteryActivities'
+
+export default {
+  name: 'EditModal',
+  components: { ImageUpload },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        dateTime1: [], // 后端不接收
+        id: '',
+        topic: '',
+        state: '',
+        link: '',
+        images: '',
+        startTime: '',
+        endTime: '',
+        createTime: ''
+      },
+      formRules: {
+        topic: [
+          { required: true, message: '请输入抽奖活动名称' }
+        ],
+        state: [
+          { required: true, message: '请选择活动状态' }
+        ],
+        dateTime1: [
+          { type: 'array', required: true, message: '请选择抽奖时间' }
+        ]
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '编辑抽奖活动' : '添加抽奖活动'
+      this.formData = Object.assign(this.$options.data().formData, params, {
+        dateTime1: params.startTime || params.endTime ? [params.startTime, params.endTime] : ''
+      })
+      this.visible = true
+      this.initList()
+      if (params.id) {
+        this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getByIdLotteryActivities({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          topic: res.data.topic || '',
+          state: res.data.state,
+          link: res.data.link || '',
+          images: res.data.images || '',
+          startTime: res.data.startTime || '',
+          endTime: res.data.endTime || '',
+          createTime: res.data.createTime || ''
+        }, {
+          dateTime1: res.data.startTime || res.data.endTime ? [res.data.startTime, res.data.endTime] : ''
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '加载中' })
+          try {
+            const { dateTime1, ...otps } = this.formData
+            const params = {
+              ...otps,
+              startTime: dateTime1 && dateTime1[0],
+              endTime: dateTime1 && dateTime1[1]
+            }
+            this.formData.id ? await updateLotteryActivities(params) : await saveLotteryActivities(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 173 - 0
src/views/lotteryManagement/lotteryActivities/index.vue

@@ -0,0 +1,173 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.topic" clearable size="mini" class="filter-item"
+        style="width: 200px;"
+        placeholder="请输入抽奖名称"
+      />
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <br />
+      <el-button
+        size="mini" type="primary" icon="el-icon-plus"
+        @click="$refs.EditModal && $refs.EditModal.handleOpen({ id: '' })"
+      >
+        添加
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="抽奖活动名称" prop="topic" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" label="活动状态" prop="state">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.state === 1" effect="plain">上线</el-tag>
+            <el-tag v-else-if="row.state === 2" effect="plain">下线</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" min-width="150" label="抽奖页面链接" prop="link" show-overflow-tooltip />
+        <el-table-column align="center" label="图片" prop="images">
+          <template slot-scope="{ row }">
+            <el-image
+              v-if="row.images" :src="row.images" style="width:40px;height:40px;" fit="cover"
+              :preview-src-list="[ row.images ]"
+            />
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="开始时间" prop="startTime" />
+        <el-table-column align="center" width="150" label="结束时间" prop="endTime" />
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import EditModal from './components/EditModal'
+import DetailModal from './components/DetailModal'
+import { getPageLotteryActivities, deleteByIdLotteryActivities } from '@/api/lotteryManagement/lotteryActivities'
+
+export default {
+  name: 'LotteryActivities',
+  components: {
+    EditModal,
+    DetailModal
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        topic: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getPageLotteryActivities(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleEdit(row) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    },
+    handleDelete(row) {
+      this.$confirm('确定删除此项?')
+        .then(async () => {
+          await deleteByIdLotteryActivities({ id: row.id })
+          this.$message({ message: '删除成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 137 - 0
src/views/member/memberList/components/CommentDetails.vue

@@ -0,0 +1,137 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 评论信息 -->
+      <el-form-item label="评论" prop="comment">
+        {{ formData.comment || '--' }}
+      </el-form-item>
+      <el-form-item label="图片" prop="images">
+        <div v-if="formData.images && formData.images.length">
+          <el-image
+            v-for="(item, index) in formData.images" :key="index" :src="item"
+            style="width:80px;height:80px;margin-right: 10px;" fit="cover"
+            :preview-src-list="formData.images"
+          />
+        </div>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="追加评论" prop="addComment">
+        {{ formData.addComment || '--' }}
+      </el-form-item>
+      <el-form-item label="追加图片" prop="addImages">
+        <div v-if="formData.addImages && formData.addImages.length">
+          <el-image
+            v-for="(item, index) in formData.addImages" :key="index" :src="item"
+            style="width:80px;height:80px;margin-right: 10px;" fit="cover"
+            :preview-src-list="formData.addImages"
+          />
+        </div>
+        <span v-else>--</span>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleShow">允许展示</el-button>
+        <el-button type="primary" size="mini" @click="handleHide">隐藏</el-button>
+        <el-button type="primary" size="mini" @click="handleDelete">删除</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { commentSysGetById, commentSysUpdate, commentSysDelete, commentAllow } from '@/api/comment'
+
+export default {
+  name: 'CommentDetails',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看评论详情'
+      },
+      visible: false,
+      formData: {
+        commentId: '',
+        comment: '',
+        images: [],
+        addComment: '',
+        addImages: []
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.commentId) {
+        this.getInfo(params.commentId)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await commentSysGetById({ commentId: id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          commentId: res.data.commentId || '',
+          comment: res.data.comment || '',
+          images: res.data.images || [],
+          addComment: res.data.addComment || '',
+          addImages: res.data.addImages || []
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    async handleShow() {
+      const res = await commentAllow({
+        commentId: this.formData.commentId,
+        state: 1
+      })
+      if (res.code === '') {
+        this.$message.success('成功')
+        this.visible = false
+        this.$emit('success')
+      }
+    },
+    async handleHide() {
+      const res = await commentSysUpdate({
+        commentId: this.formData.commentId,
+        state: 0
+      })
+      if (res.code === '') {
+        this.$message.success('隐藏成功')
+        this.visible = false
+        this.$emit('success')
+      }
+    },
+    async handleDelete() {
+      const res = await commentSysDelete({
+        commentId: this.formData.commentId
+      })
+      if (res.code === '') {
+        this.$message.success('删除成功')
+        this.visible = false
+        this.$emit('success')
+      }
+    }
+  }
+}
+</script>
+

+ 294 - 0
src/views/member/memberList/components/UserDetails.vue

@@ -0,0 +1,294 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 用户详情信息 -->
+      <div style="display: flex;padding-bottom: 14px;font-size: 16px;font-weight: bold;">
+        <div
+          style="width: 4px;height: 14px;margin-left: 6px;margin-right: 6px;background-color: #0519D4;border-radius: 2px;"
+        >
+        </div>
+        <div>客户信息</div>
+      </div>
+      <el-form-item label="用户ID" prop="buyerUserId">
+        {{ formData.buyerUserId || '--' }}
+      </el-form-item>
+      <el-form-item label="用户头像" prop="headImage">
+        <el-image
+          v-if="formData.headImage" :src="formData.headImage" style="width:80px;height:80px"
+          fit="cover" :preview-src-list="[ formData.headImage ]"
+        />
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="用户昵称" prop="name">
+        {{ formData.name || '--' }}
+      </el-form-item>
+      <el-form-item label="手机号" prop="phone">
+        {{ formData.phone || '--' }}
+      </el-form-item>
+      <el-form-item label="性别" prop="sex">
+        <span v-if="formData.sex === 1">男</span>
+        <span v-else-if="formData.sex === 2">女</span>
+        <span v-else>未知</span>
+      </el-form-item>
+      <el-form-item label="注册时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+      <el-form-item label="生日" prop="birthday">
+        {{ formData.birthday || '--' }}
+      </el-form-item>
+
+      <div style="display: flex;padding-bottom: 14px;font-size: 16px;font-weight: bold;">
+        <div
+          style="width: 4px;height: 14px;margin-left: 6px;margin-right: 6px;background-color: #0519D4;border-radius: 2px;"
+        >
+        </div>
+        <div>客户标签</div>
+      </div>
+      <el-form-item label="客户标签" prop="labels">
+        <span v-if="formData.labels && formData.labels.length">{{ formData.labels }}</span>
+        <span v-else>--</span>
+      </el-form-item>
+
+      <div style="display: flex;padding-bottom: 14px;font-size: 16px;font-weight: bold;">
+        <div
+          style="width: 4px;height: 14px;margin-left: 6px;margin-right: 6px;background-color: #0519D4;border-radius: 2px;"
+        >
+        </div>
+        <div>消费数据</div>
+      </div>
+      <el-form-item label="下单数" prop="orders">
+        {{ typeof formData.orders === 'number' ? formData.orders : '--' }}
+      </el-form-item>
+      <el-form-item label="支付成功数" prop="pays">
+        {{ typeof formData.pays === 'number' ? formData.pays : '--' }}
+      </el-form-item>
+      <el-form-item label="售后次数" prop="afters">
+        {{ typeof formData.afters === 'number' ? formData.afters : '--' }}
+      </el-form-item>
+      <el-form-item label="售后单数" prop="afterOrders">
+        {{ typeof formData.afterOrders === 'number' ? formData.afterOrders : '--' }}
+      </el-form-item>
+      <div>
+        <el-tabs v-model="activeName">
+          <el-tab-pane label="TA的订单" name="first">
+            <div>
+              <!-- 查询和其他操作 -->
+              <div class="filter-container">
+                <el-input
+                  v-model="formData.orderFormid" clearable size="mini" class="filter-item"
+                  style="width: 200px;"
+                  placeholder="请输入订单编号"
+                />
+                <el-button
+                  size="mini" class="filter-item" type="primary" icon="el-icon-search"
+                  style="margin-left:10px;"
+                  @click="handleSearch"
+                >
+                  查找
+                </el-button>
+              </div>
+              <!-- 表格 -->
+              <div>
+                <el-table
+                  v-loading="!formData.orderList" height="60vh" element-loading-text="暂无订单数据"
+                  :data="formData.orderList"
+                  v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+                >
+                  <el-table-column align="center" width="100" label="订单编号" prop="orderFormid" fixed="left" />
+                  <el-table-column align="center" width="150" label="店铺名称" prop="shopName" fixed="left" show-overflow-tooltip />
+                  <el-table-column align="center" width="120" label="商品数量" prop="products" />
+                  <el-table-column align="center" width="120" label="订单金额(元)" prop="price" />
+                  <el-table-column align="center" label="状态" prop="state">
+                    <template slot-scope="{ row }">
+                      <el-tag v-if="row.state === 1" effect="plain">待付款</el-tag>
+                      <el-tag v-else-if="row.state === 2" effect="plain">待发货</el-tag>
+                      <el-tag v-else-if="row.state === 3" effect="plain">待收货</el-tag>
+                      <el-tag v-else-if="row.state === 4" effect="plain">已完成</el-tag>
+                      <el-tag v-else-if="row.state === 5" effect="plain">已关闭</el-tag>
+                      <span v-else>--</span>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="TA的评论" name="second">
+            <!-- 表格 -->
+            <div>
+              <el-table
+                v-loading="!formData.comments" height="60vh" element-loading-text="暂无评论数据"
+                :data="formData.comments"
+                v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+              >
+                <el-table-column align="center" width="150" label="店铺名称" prop="shopName" fixed="left" show-overflow-tooltip />
+                <el-table-column align="center" width="120" label="商品名称" prop="productName" />
+                <el-table-column align="center" width="120" label="订单金额(元)" prop="price" />
+                <el-table-column align="center" label="状态" prop="state">
+                  <template slot-scope="{ row }">
+                    <el-tag v-if="row.state === 1" effect="plain">待付款</el-tag>
+                    <el-tag v-else-if="row.state === 2" effect="plain">待发货</el-tag>
+                    <el-tag v-else-if="row.state === 3" effect="plain">待收货</el-tag>
+                    <el-tag v-else-if="row.state === 4" effect="plain">已完成</el-tag>
+                    <el-tag v-else-if="row.state === 5" effect="plain">已关闭</el-tag>
+                    <span v-else>--</span>
+                  </template>
+                </el-table-column>
+                <el-table-column align="center" label="操作" width="120" fixed="right" class-name="small-padding fixed-width">
+                  <template slot-scope="{ row }">
+                    <el-button
+                      v-if="formData.comments[row.commentId]" type="success" size="mini"
+                      @click="$refs.CommentDetails && $refs.CommentDetails.handleOpen(row)"
+                    >
+                      查看
+                    </el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="TA的收货地址" name="third">
+            <!-- 表格 -->
+            <div>
+              <el-table
+                v-loading="!formData.receives" height="60vh" element-loading-text="暂无订单数据"
+                :data="formData.receives"
+                v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+              >
+                <el-table-column align="center" width="100" label="姓名" prop="receiveName" fixed="left" />
+                <el-table-column align="center" width="120" label="电话" prop="receivePhone" />
+                <el-table-column align="center" label="地址" prop="receiveAdress">
+                  <template slot-scope="{ row }">
+                    <span>{{ row.receiveAdress }}{{ row.address }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
+
+    </el-form>
+
+    <!-- 评论详情 -->
+    <CommentDetails ref="CommentDetails" @success="getList" />
+  </el-dialog>
+</template>
+
+<script>
+import CommentDetails from './CommentDetails'
+import { customerMageGetById } from '@/api/customerMage'
+
+export default {
+  name: 'DetailModal',
+  components: {
+    CommentDetails
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看用户详情'
+      },
+      visible: false,
+      formData: {
+        buyerUserId: '',
+        orderFormid: '',
+        headImage: '',
+        name: '',
+        phone: '',
+        sex: '',
+        createTime: '',
+        birthday: '',
+        labels: [],
+        orders: '',
+        pays: '',
+        afters: '',
+        afterOrders: '',
+        orderList: [],
+        comments: [],
+        receives: []
+      },
+      activeName: 'first'
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.buyerUserId) {
+        this.getInfo(params.buyerUserId)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await customerMageGetById({ buyerUserId: id, orderFormid: this.formData.orderFormid })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          buyerUserId: res.data.buyerUserId || '',
+          headImage: res.data.headImage || '',
+          name: res.data.name || '',
+          phone: res.data.phone || '',
+          sex: res.data.sex || '',
+          createTime: res.data.createTime || '',
+          birthday: res.data.birthday || '',
+          labels: res.data.labels || [],
+          orders: res.data.orders,
+          pays: res.data.pays,
+          afters: res.data.afters,
+          afterOrders: res.data.afterOrders,
+          orderList: res.data.orderList || [],
+          comments: res.data.comments || [],
+          receives: res.data.receives || []
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    async getList() {
+      this.getInfo(this.formData.buyerUserId)
+    },
+    handleSearch() {
+      this.getInfo(this.formData.buyerUserId)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.filter-container {
+	.filter-item {
+		display: inline-block;
+		vertical-align: middle;
+		margin-bottom: 10px;
+	}
+}
+
+.small-padding {
+	.cell {
+		padding-left: 5px;
+		padding-right: 5px;
+	}
+}
+
+.fixed-width {
+	.el-button--mini {
+		padding: 7px 10px;
+	}
+}
+</style>
+

+ 21 - 37
src/views/member/memberList/details.vue

@@ -143,10 +143,12 @@
             </el-checkbox>
           </el-checkbox-group>
         </div>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="addFormDialog = false">取 消</el-button>
-          <el-button type="primary" @click="saveTips">确定</el-button>
-        </span>
+        <template #footer>
+          <span class="dialog-footer">
+            <el-button @click="addFormDialog = false">取 消</el-button>
+            <el-button type="primary" @click="saveTips">确定</el-button>
+          </span>
+        </template>
       </el-dialog>
       <!-- 查看评论弹框 -->
       <el-dialog
@@ -181,17 +183,21 @@
             </div>
           </div>
         </div>
-        <span slot="footer" class="dialog-footer">
-          <el-button v-if="comState" @click="toShow">允许展示</el-button>
-          <el-button v-else @click="noneShow">隐藏</el-button>
-          <el-button type="primary" @click="delCom">删除</el-button>
-        </span>
+        <template #footer>
+          <span class="dialog-footer">
+            <el-button v-if="comState" @click="toShow">允许展示</el-button>
+            <el-button v-else @click="noneShow">隐藏</el-button>
+            <el-button type="primary" @click="delCom">删除</el-button>
+          </span>
+        </template>
       </el-dialog>
     </div>
-    <div slot="footer" class="dialog-footer">
-      <el-button type="text" @click="doCancel">取消</el-button>
-      <el-button type="primary" @click="doSubmit">确认</el-button>
-    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="text" @click="doCancel">取消</el-button>
+        <el-button type="primary" @click="doSubmit">确认</el-button>
+      </div>
+    </template>
   </el-dialog>
 </template>
 
@@ -199,6 +205,7 @@
 import { customerMageGetById, getLabels, customerSaveUserLabel } from '@/api/customerMage'
 import { commentSysGetById, commentSysUpdate, commentSysDelete, commentAllow } from '@/api/comment'
 export default {
+  name: 'Details',
   data() {
     return {
       visible: false,
@@ -220,7 +227,6 @@ export default {
       dialog: {},
       user: '',
       userObj: {},
-      addFormDialog: false,
       tipsForm: {
         labelName: ''
       },
@@ -292,12 +298,6 @@ export default {
       this.comState = 1
       this.componentName = 'order'
     },
-    // 贴标签
-    addTag() {
-      this.addFormDialog = true
-      // this.checkList
-      this.getSelect({ labelName: this.tipsForm.labelName })
-    },
     // 查询订单
     searchOrders() {
       this.user.orderFormid = this.userForm.orderFormid
@@ -314,22 +314,6 @@ export default {
         path: '/member/tips'
       })
     },
-    // 打标签
-    async saveTips(row) {
-      console.log(this.checkList)
-      const res = await customerSaveUserLabel({
-        buyerUserId: this.user.buyerUserId,
-        buyerLabelIds: this.checkList
-      })
-      if (res.code === '') {
-        this.$message({
-          message: '成功',
-          type: 'success'
-        })
-        this.checkList = []
-        this.addFormDialog = false
-      }
-    },
     changeTab(item) {
       this.componentName = item.componentName
     },
@@ -364,7 +348,7 @@ export default {
     },
     doSubmit() {
       this.visible = false
-      this.$emit('reset')
+      this.$emit('success')
     }
   }
 }

+ 185 - 152
src/views/member/memberList/index.vue

@@ -13,13 +13,17 @@
           </el-form-item>
           <el-form-item label="标签">
             <el-select v-model="formParams.labelId" placeholder="请选择">
-              <el-option v-for="(item, index) in tipsList" :key="index" :label="item.labelName"
-                :value="item.buyerLabelId" />
+              <el-option
+                v-for="(item, index) in tipsList" :key="index" :label="item.labelName"
+                :value="item.buyerLabelId"
+              />
             </el-select>
           </el-form-item>
           <el-form-item label="最近消费时间">
-            <el-date-picker v-model="formParams.dates" type="daterange" range-separator="至" start-placeholder="开始时间"
-              end-placeholder="结束时间" value-format="yyyy-MM-dd" />
+            <el-date-picker
+              v-model="formParams.dates" type="daterange" range-separator="至" start-placeholder="开始时间"
+              end-placeholder="结束时间" value-format="yyyy-MM-dd"
+            />
           </el-form-item>
           <el-form-item>
             <el-form-item label="累计消费金额">
@@ -31,12 +35,16 @@
           </el-form-item>
           <el-form-item>
             <el-form-item label="购买次数">
-              <el-input v-model="formParams.minBuyers" maxlength="9" oninput="value=value.replace(/[^\d]/g,'')"
-                placeholder="请输入最小值" />
+              <el-input
+                v-model="formParams.minBuyers" maxlength="9" oninput="value=value.replace(/[^\d]/g,'')"
+                placeholder="请输入最小值"
+              />
             </el-form-item>
             <el-form-item label="-">
-              <el-input v-model="formParams.maxBuyers" maxlength="9" oninput="value=value.replace(/[^\d]/g,'')"
-                placeholder="请输入最大值" />
+              <el-input
+                v-model="formParams.maxBuyers" maxlength="9" oninput="value=value.replace(/[^\d]/g,'')"
+                placeholder="请输入最大值"
+              />
             </el-form-item>
           </el-form-item>
 
@@ -50,8 +58,10 @@
       <!--  表格 -->
       <div class="content_table">
         <div class="table">
-          <el-table :data="tableData" border :header-cell-style="{ background: '#EEF3FF', color: '#333333' }"
-            style="width: 100%">
+          <el-table
+            :data="tableData" border :header-cell-style="{ background: '#EEF3FF', color: '#333333' }"
+            style="width: 100%"
+          >
             <el-table-column prop="name" label="客户昵称" />
             <el-table-column prop="phone" label="手机号" />
             <el-table-column prop="memberLevelName" label="会员等级" />
@@ -68,10 +78,14 @@
             </el-table-column>
             <el-table-column prop="time" label="最近消费时间" />
             <el-table-column prop="createTime" label="注册时间" />
-            <el-table-column :formatter="row => row.registerIp ? row.registerIp : '-'" label="注册IP"
-              show-overflow-tooltip />
-            <el-table-column :formatter="row => row.lastLoginIp ? row.lastLoginIp : '-'" prop="time" label="最后登录IP"
-              show-overflow-tooltip />
+            <el-table-column
+              :formatter="row => row.registerIp ? row.registerIp : '-'" label="注册IP"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              :formatter="row => row.lastLoginIp ? row.lastLoginIp : '-'" prop="time" label="最后登录IP"
+              show-overflow-tooltip
+            />
             <el-table-column label="操作" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click.native.prevent="details(scope.row)">详情</el-button>
@@ -86,9 +100,11 @@
             </el-table-column>
           </el-table>
           <div class="fenye">
-            <el-pagination :current-page="currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="10"
+            <el-pagination
+              :current-page="currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="10"
               layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
-              @current-change="handleCurrentChange" />
+              @current-change="handleCurrentChange"
+            />
           </div>
         </div>
       </div>
@@ -113,17 +129,22 @@
         <el-checkbox-group v-model="checkList">
           <el-checkbox v-for="(item, index) in tipsList" :key="index" class="checkBoxStyle" :label="item.buyerLabelId">
             {{
-          item.labelName }}
+              item.labelName }}
           </el-checkbox>
         </el-checkbox-group>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="addFormDialog = false">取 消</el-button>
-        <el-button type="primary" @click="saveTips">确定</el-button>
-      </span>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="addFormDialog = false">取 消</el-button>
+          <el-button type="primary" @click="saveTips">确定</el-button>
+        </span>
+      </template>
     </el-dialog>
-    <el-dialog title="修改会员积分" :visible.sync="editIntegral" width="30%" center :close-on-click-modal="false"
-      @close="credit = 0">
+    <el-dialog
+      title="修改会员积分" :visible.sync="editIntegral" width="30%" center
+      :close-on-click-modal="false"
+      @close="credit = 0"
+    >
       <el-form label-width="100px">
         <el-form-item label="修改积分">
           <el-radio-group v-model="updateWay" @change="changeWayRadio">
@@ -139,72 +160,84 @@
           <span>提示 : 在原有积分上增加或减少</span>
         </el-form-item>
       </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="editIntegral = false">取 消</el-button>
-        <el-button type="primary" @click="saveIntegral">确定</el-button>
-      </span>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="editIntegral = false">取 消</el-button>
+          <el-button type="primary" @click="saveIntegral">确定</el-button>
+        </span>
+      </template>
     </el-dialog>
 
     <!--  指定关系 -->
-    <el-dialog title="选择关系" :visible.sync="appointDialog" width="40%" center :close-on-click-modal="false"
-      @close="appintClose">
-      <span slot="footer" class="dialog-footer">
-        <el-form label-width="120px" :model="appintForm" :rules="rules" ref="ruleForm">
-          <div class="lable-list">
-            <div class="lable-item">
-              <el-form-item label="加盟商名称:" prop="name">
-                <el-input v-model="appintForm.name" placeholder="请输入名称"></el-input>
-              </el-form-item>
+    <el-dialog
+      title="选择关系" :visible.sync="appointDialog" width="40%" center
+      :close-on-click-modal="false"
+      @close="appintClose"
+    >
+      <template #footer>
+        <span class="dialog-footer">
+          <el-form ref="ruleForm" label-width="120px" :model="appintForm" :rules="rules">
+            <div class="lable-list">
+              <div class="lable-item">
+                <el-form-item label="加盟商名称:" prop="name">
+                  <el-input v-model="appintForm.name" placeholder="请输入名称"></el-input>
+                </el-form-item>
+              </div>
+              <div class="lable-item">
+                <el-form-item label="加盟商电话:" prop="phone">
+                  <el-input v-model="appintForm.phone" placeholder="请输入电话"></el-input>
+                </el-form-item>
+              </div>
             </div>
-            <div class="lable-item">
-              <el-form-item label="加盟商电话:" prop="phone">
-                <el-input v-model="appintForm.phone" placeholder="请输入电话"></el-input>
-              </el-form-item>
+            <div class="lable-list">
+              <div class="lable-item">
+                <el-form-item label="请选择区域:" prop="area">
+                  <!-- <el-cascader  :props="{checkStrictly: true}"  ref="cascaderRef" @change="handleCascaderChange"></el-cascader> -->
+                  <el-cascader ref="cascaderRef" :props="areaData" @change="handleCascaderChange"></el-cascader>
+                </el-form-item>
+              </div>
+              <div class="lable-item">
+                <el-form-item label="详细地址:" prop="address">
+                  <el-input v-model="appintForm.address" placeholder="请输入详细地址"></el-input>
+                </el-form-item>
+              </div>
             </div>
-          </div>
-          <div class="lable-list">
-            <div class="lable-item">
-              <el-form-item label="请选择区域:" prop="area">
-                <!-- <el-cascader  :props="{checkStrictly: true}"  ref="cascaderRef" @change="handleCascaderChange"></el-cascader> -->
-                <el-cascader :props="areaData" ref="cascaderRef" @change="handleCascaderChange"></el-cascader>
-              </el-form-item>
-            </div>
-            <div class="lable-item">
-              <el-form-item label="详细地址:" prop="address">
-                <el-input v-model="appintForm.address" placeholder="请输入详细地址"></el-input>
-              </el-form-item>
-            </div>
-          </div>
-          <div class="lable-list">
-            <div class="lable-item">
-              <el-form-item label="店长名称:" prop="chargePersonName">
-                <el-input v-model="appintForm.chargePersonName" placeholder="请输入店长名称"></el-input>
-              </el-form-item>
-            </div>
-            <div class="lable-item" v-if="appintForm.type == 5">
-              <el-form-item label="选择小区:" prop="communityId">
-                <el-select v-model="communityId" placeholder="请选择">
-                  <el-option v-for="item in communityList" :key="item.id" :label="item.communityName" :value="item.id">
-                  </el-option>
-                </el-select>
-              </el-form-item>
+            <div class="lable-list">
+              <div class="lable-item">
+                <el-form-item label="店长名称:" prop="chargePersonName">
+                  <el-input v-model="appintForm.chargePersonName" placeholder="请输入店长名称"></el-input>
+                </el-form-item>
+              </div>
+              <div v-if="appintForm.type == 5" class="lable-item">
+                <el-form-item label="选择小区:" prop="communityId">
+                  <el-select v-model="communityId" placeholder="请选择">
+                    <el-option
+                      v-for="item in communityList" :key="item.id" :label="item.communityName"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </div>
             </div>
-          </div>
-          <el-form-item label="选择指定关系:" prop="type">
-            <template>
-              <el-radio v-model="appintForm.type" :label="1">团长</el-radio>
-              <el-radio v-model="appintForm.type" :label="2">合伙人</el-radio>
-              <el-radio v-model="appintForm.type" :label="3">加盟商</el-radio>
-              <el-radio v-model="appintForm.type" :label="4">区代理</el-radio>
-              <el-radio v-model="appintForm.type" :label="5">小区</el-radio>
-            </template>
-          </el-form-item>
-        </el-form>
-        <el-button @click="appintCan">取消</el-button>
-        <el-button type="primary" @click="appintDetermine">确定</el-button>
-      </span>
+            <el-form-item label="选择指定关系:" prop="type">
+              <template>
+                <el-radio v-model="appintForm.type" :label="1">团长</el-radio>
+                <el-radio v-model="appintForm.type" :label="2">合伙人</el-radio>
+                <el-radio v-model="appintForm.type" :label="3">加盟商</el-radio>
+                <el-radio v-model="appintForm.type" :label="4">区代理</el-radio>
+                <el-radio v-model="appintForm.type" :label="5">小区</el-radio>
+              </template>
+            </el-form-item>
+          </el-form>
+          <el-button @click="appintCan">取消</el-button>
+          <el-button type="primary" @click="appintDetermine">确定</el-button>
+        </span>
+      </template>
     </el-dialog>
-    <member-details ref="memberDetails" @reset="reset" />
+
+    <!-- 用户详情 -->
+    <UserDetails ref="UserDetails" @success="getList" />
   </div>
 </template>
 
@@ -219,11 +252,13 @@ import {
   appointUserRelationship
 } from '@/api/customerMage'
 import { getProvinceList, getChildAreaList, getCommunityList } from '@/api/address'
-// import { getSelect } from '../../../api/renovation'
-import memberDetails from './details'
-// import { constants } from 'fs';
+import UserDetails from './components/UserDetails'
+
 export default {
-  components: { memberDetails },
+  name: 'MemberList',
+  components: {
+    UserDetails
+  },
   data() {
     return {
       showMore: false,
@@ -263,15 +298,15 @@ export default {
         label: 'name',
         value: 'id',
         lazyLoad(node, resolve) {
-          const { level, value } = node;
+          const { level, value } = node
           if (level === 0) {
-            getProvinceList().then(res => {
+            getProvinceList().then((res) => {
               resolve(res.data)
-              console.log(res);
+              console.log(res)
             })
           } else if (level != 0) {
-            getChildAreaList(value).then(res => {
-              resolve(res.data.map(item => {
+            getChildAreaList(value).then((res) => {
+              resolve(res.data.map((item) => {
                 item.leaf = level === 3
                 return item
               }))
@@ -279,22 +314,22 @@ export default {
           }
         }
       },
-      //  
-      cityId: "",
+      //
+      cityId: '',
       appintForm: {
         userId: null,
         area: null,
         type: '',
-        name: "",
-        phone: "",
-        address: "",
-        chargePersonName: ""
+        name: '',
+        phone: '',
+        address: '',
+        chargePersonName: ''
       },
 
       // 小区数据
       communityList: [],
       //  小区的id
-      communityId: "",
+      communityId: '',
 
       //  指定关系正则校验
       rules: {
@@ -316,18 +351,18 @@ export default {
         ],
         type: [
           { required: true, message: '请选择你需要指定的关系', trigger: 'change' }
-        ],
+        ]
       }
     }
   },
   created() {
-    this.getAll(this.formParams)
+    this.getList()
     this.getSelect({ labelName: '' })
   },
   methods: {
     /**
-     * 导出
-     */
+		 * 导出
+		 */
 
     async handleExport() {
       this.$message({
@@ -339,7 +374,7 @@ export default {
       if (!res) {
         return
       }
-      const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
+      const blob = new Blob([ res ], { type: 'application/vnd.ms-excel' })
       const fileName = '用户列表.xls'
       if ('download' in document.createElement('a')) {
         // 非IE下载
@@ -358,17 +393,17 @@ export default {
     },
     handleSizeChange(val) {
       this.formParams.pageSize = val
-      this.getAll(this.formParams)
+      this.getList()
     },
     handleCurrentChange(val) {
       this.formParams.page = val
-      this.getAll(this.formParams)
+      this.getList()
     },
     // 查询
     search() {
       this.total = 1
       this.formParams.page = 1
-      this.getAll(this.formParams)
+      this.getList()
     },
     // 查询标签
     searchTips() {
@@ -394,7 +429,7 @@ export default {
           credit: this.credit
         })
         if (res.code === '') {
-          this.getAll(this.formParams)
+          this.getList()
           this.editIntegral = false
           this.$message.success('修改积分成功')
         }
@@ -426,12 +461,12 @@ export default {
     async handleCascaderChange() {
       const checkedNode = this.$refs.cascaderRef.getCheckedNodes()
       const nodeData = checkedNode[0].data
-      let res = await getChildAreaList(nodeData.id)
+      const res = await getChildAreaList(nodeData.id)
       if (res.data.length == 0) {
-        let res2 = await getCommunityList({ cityId: nodeData.id })
+        const res2 = await getCommunityList({ cityId: nodeData.id })
         this.communityList = res2.data
       }
-      console.log(res);
+      console.log(res)
 
       this.appintForm.area = nodeData.id
     },
@@ -442,29 +477,29 @@ export default {
     //  指定关系确认
     async appintDetermine() {
       //  先进行校验
-      this.$refs['ruleForm'].validate(async (valid) => {
+      this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
-          if(this.appintForm.type == 5 && this.communityId == ""){
-            this.$message.error("请选择小区,如没有小区的话,是该区域没有小区,请选择有区域的小区");
+          if (this.appintForm.type == 5 && this.communityId == '') {
+            this.$message.error('请选择小区,如没有小区的话,是该区域没有小区,请选择有区域的小区')
             return
           }
-          if(this.appintForm.type == 5 && this.communityId != ""){
-            this.appintForm.communityId = this.communityId;
+          if (this.appintForm.type == 5 && this.communityId != '') {
+            this.appintForm.communityId = this.communityId
           }
-          let res = await appointUserRelationship(this.appintForm);
-          if(res.code == ""){
+          const res = await appointUserRelationship(this.appintForm)
+          if (res.code == '') {
             this.$message({
-              message: "添加成功",
+              message: '添加成功',
               type: res.message
-            });
-            this.appointDialog = false;
-            this.search();
+            })
+            this.appointDialog = false
+            this.search()
           }
         } else {
-          console.log('error submit!!');
-          return false;
+          console.log('error submit!!')
+          return false
         }
-      });
+      })
 
       // if (this.appintForm.region == null && this.appintForm.isType != '3') {
       //   this.$message.error("请选择区域");
@@ -476,24 +511,24 @@ export default {
       //   this.appointDialog = false
       // }
       //  重新获取数据
-      this.getAll(this.formParams)
+      this.getList()
     },
     //  弹窗关闭 把数据重置
     appintClose() {
       this.appintForm = {
         userId: null,
         area: null,
-        type: "",
-        name: "",
-        phone: "",
-        address: "",
-        chargePersonName: "",
-        communityId:""
+        type: '',
+        name: '',
+        phone: '',
+        address: '',
+        chargePersonName: '',
+        communityId: ''
       }
-      this.communityId = ""
+      this.communityId = ''
       this.communityList = []
-      this.$refs.cascaderRef.inputValue = ""
-      this.$refs['ruleForm'].resetFields();
+      this.$refs.cascaderRef.inputValue = ''
+      this.$refs.ruleForm.resetFields()
     },
     // 加入黑名单
     addBlackList(row) {
@@ -522,7 +557,7 @@ export default {
                   type: 'success',
                   message: '成功!'
                 })
-                this.getAll(this.formParams)
+                this.getList()
               }
             })
           } else {
@@ -535,7 +570,7 @@ export default {
                   type: 'success',
                   message: '成功!'
                 })
-                this.getAll(this.formParams)
+                this.getList()
               }
             })
           }
@@ -567,7 +602,7 @@ export default {
         page: 1,
         pageSize: 10
       }
-      this.getAll(this.formParams)
+      this.getList()
     },
     // 打标签
     makeTag(row) {
@@ -581,13 +616,11 @@ export default {
       //   name: 'customerDetails',
       //   params: { buyerUserId: row.buyerUserId, orderFormid: row.orderFormid }
       // })
-      this.$refs.memberDetails.checkList = row.labelIds
-      console.log(this.$refs.memberDetails);
-      this.$refs.memberDetails.getUser({ buyerUserId: row.buyerUserId, orderFormid: row.orderFormid })
+      this.$refs.UserDetails && this.$refs.UserDetails.handleOpen(row)
     },
     // 初始化查询所有数据
-    async getAll(formParams) {
-      const res = await customerMageGetAll(formParams)
+    async getList() {
+      const res = await customerMageGetAll(this.formParams)
       this.tableData = res.data.list
       this.total = res.data.total
     },
@@ -597,7 +630,7 @@ export default {
       this.tipsList = res.data
     },
     reset() {
-      this.getAll(this.formParams)
+      this.getList()
     },
     checkMinMoney(e) {
       this.formParams.minMoney = e.match(/^\d*(\.?\d{0,2})/g)[0] || null
@@ -613,24 +646,24 @@ export default {
 @import url("../../../styles/elDialog.scss");
 
 .custom_page {
-  padding: 20px;
+	padding: 20px;
 }
 
 .checkBoxStyle {
-  margin-bottom: 20px;
+	margin-bottom: 20px;
 }
 
 .lable-list {
-  display: flex;
-  align-items: center;
+	display: flex;
+	align-items: center;
 
-  .lable-item {
-    // flex: 1;
-    width: 50%;
-  }
+	.lable-item {
+		// flex: 1;
+		width: 50%;
+	}
 }
 
 ::v-deep .el-cascader {
-  width: 100%
+	width: 100%
 }
 </style>

+ 8 - 1
vue.config.js

@@ -42,13 +42,20 @@ module.exports = {
     // before: require('./mock/mock-server.js'),
     proxy: {
       '/api': {
-        target: 'https://nsadminapitest.tuanfengkeji.cn', // 测试
+        target: 'https://nsadminapi.tuanfengkeji.cn', // 测试
         // target: 'http://192.168.0.91:9103', // 平台端
         changeOrigin: true,
         pathRewrite: {
           '^/api': ''
         }
       },
+      '/tuan': {
+        target: 'https://test.tuanfengkeji.cn/dts-app-api', // 测试
+        changeOrigin: true,
+        pathRewrite: {
+          '^/tuan': ''
+        }
+      },
       '/adminapi': {
         target: 'https://nsadminapitest.tuanfengkeji.cn', // 测试
         // target: 'http://192.168.0.91:9103', // 平台端

部分文件因为文件数量过多而无法显示