vip金额

This commit is contained in:
2024-11-04 18:05:31 +08:00
parent 10125160d3
commit 8a0b0aae88

View File

@@ -1,20 +1,41 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form
<el-form-item > :inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable> <el-input v-model="dataForm.key" placeholder="参数名" clearable>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="pageIndex = 1;getDataList()">查询</el-button> <el-button
<el-button v-if="isAuth('book:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> @click="
<el-button type="primary" @click="addOrUpdateHandle()">合并账号</el-button> pageIndex = 1;
getDataList();
"
>查询</el-button
>
<el-button
v-if="isAuth('book:user:save')"
type="primary"
@click="addOrUpdateHandle()"
>新增</el-button
>
<el-button type="primary" @click="addOrUpdateHandle()"
>合并账号</el-button
>
<!-- <el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()" <!-- <el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">批量删除</el-button> --> :disabled="dataListSelections.length <= 0">批量删除</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="dataList" border v-loading="dataListLoading" <el-table
style="width: 100%;"> :data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;"
>
<!-- <el-table-column type="selection" header-align="center" align="center" width="50"> <!-- <el-table-column type="selection" header-align="center" align="center" width="50">
</el-table-column> --> </el-table-column> -->
<!-- <el-table-column label="序号" width="70" align="center"> <!-- <el-table-column label="序号" width="70" align="center">
@@ -26,11 +47,20 @@
prop="id" prop="id"
header-align="center" header-align="center"
align="center" align="center"
label="用户ID"> label="用户ID"
>
</el-table-column> </el-table-column>
<el-table-column prop="nickname" header-align="center" align="center" label="姓名"> <el-table-column
prop="nickname"
header-align="center"
align="center"
label="姓名"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.nickname ? scope.row.nickname : '暂无用户名'}}</span>- <span>{{
scope.row.nickname ? scope.row.nickname : "暂无用户名"
}}</span
>-
<span v-if="scope.row.vip == 0">普通用户</span> <span v-if="scope.row.vip == 0">普通用户</span>
<span v-else-if="scope.row.vip == 2">吴门医述VIP</span> <span v-else-if="scope.row.vip == 2">吴门医述VIP</span>
<span v-else-if="scope.row.vip == 1">超级VIP</span> <span v-else-if="scope.row.vip == 1">超级VIP</span>
@@ -44,18 +74,49 @@
<span v-if="scope.row.sex == 0">女</span><span v-if="scope.row.sex == 1">男</span><span v-if="scope.row.sex == 2">保密</span> <span v-if="scope.row.sex == 0">女</span><span v-if="scope.row.sex == 1">男</span><span v-if="scope.row.sex == 2">保密</span>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column prop="avatar" header-align="center" align="center" label="头像"> <el-table-column
prop="avatar"
header-align="center"
align="center"
label="头像"
>
<template slot-scope="scope"> <template slot-scope="scope">
<img v-if="scope.row.avatar && scope.row.avatar != ''" :src="scope.row.avatar" width="50" height="50" class="tableImg" /> <img
<img v-else src="../../../../static/img/morenAvavter.png" width="50" height="50" class="tableImg"> v-if="scope.row.avatar && scope.row.avatar != ''"
:src="scope.row.avatar"
width="50"
height="50"
class="tableImg"
/>
<img
v-else
src="../../../../static/img/morenAvavter.png"
width="50"
height="50"
class="tableImg"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="nickname" header-align="center" align="center" label="昵称"> <el-table-column
prop="nickname"
header-align="center"
align="center"
label="昵称"
>
</el-table-column> </el-table-column>
<el-table-column prop="tel" header-align="center" align="center" label="电话"> <el-table-column
prop="tel"
header-align="center"
align="center"
label="电话"
>
</el-table-column> </el-table-column>
<el-table-column prop="email" header-align="center" align="center" label="邮箱"> <el-table-column
prop="email"
header-align="center"
align="center"
label="邮箱"
>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
prop="password" prop="password"
@@ -75,7 +136,41 @@
align="center" align="center"
label="vip 有效期"> label="vip 有效期">
</el-table-column> --> </el-table-column> -->
<el-table-column prop="peanutCoin" header-align="center" align="center" label="天医币"> <el-table-column
prop="peanutCoin"
header-align="center"
align="center"
label="天医币"
>
</el-table-column>
<el-table-column
prop="peanutCoin"
header-align="center"
align="center"
label="VIP 办理"
>
<template slot-scope="scope">
<el-popover
placement="right"
width="300"
trigger="click"
@show="getVipMoney(scope.row)"
>
<el-table :data="vipList">
<el-table-column
width="150"
property="title"
label="VIP名称"
></el-table-column>
<el-table-column
width="100"
property="lastFee"
label="开通金额"
></el-table-column>
</el-table>
<el-button slot="reference" size="small">办理金额</el-button>
</el-popover>
</template>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
prop="readTime" prop="readTime"
@@ -95,48 +190,128 @@
align="center" align="center"
label="删除标记"> label="删除标记">
</el-table-column> --> </el-table-column> -->
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作"> <el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>修改</el-button
>
<el-button
type="text"
size="small"
@click="deleteHandle(scope.row.id)"
>删除</el-button
>
<el-dropdown> <el-dropdown>
<span class="el-dropdown-link" style="font-size:12px; color:#17B3A3; cursor: pointer;"> <span
class="el-dropdown-link"
style="font-size:12px; color:#17B3A3; cursor: pointer;"
>
更多操作<i class="el-icon-arrow-down el-icon--right"></i> 更多操作<i class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item><el-button type="text" size="small" @click="ck(scope.row)">/扣天医币</el-button></el-dropdown-item> <el-dropdown-item
><el-button type="text" size="small" @click="ck(scope.row)"
>/扣天医币</el-button
></el-dropdown-item
>
<el-dropdown-item> <el-dropdown-item>
<router-link :to="{ path: 'user-point-memery', query: {'tel':scope.row.tel, 'id':scope.row.id, 'userName':scope.row.nickname} }"> <router-link
<el-button type="text" size="small">/扣天医币记录</el-button> :to="{
path: 'user-point-memery',
query: {
tel: scope.row.tel,
id: scope.row.id,
userName: scope.row.nickname
}
}"
>
<el-button type="text" size="small"
>/扣天医币记录</el-button
>
</router-link> </router-link>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item><el-button type="text" size="small" @click=" thisUserID = scope.row.id; youVisible = true">优惠券管理</el-button></el-dropdown-item> <el-dropdown-item
<el-dropdown-item><el-button type="text" size="small" @click="resetPassword(scope.row)">修改密码</el-button></el-dropdown-item> ><el-button
type="text"
size="small"
@click="
thisUserID = scope.row.id;
youVisible = true;
"
>优惠券管理</el-button
></el-dropdown-item
>
<el-dropdown-item
><el-button
type="text"
size="small"
@click="resetPassword(scope.row)"
>修改密码</el-button
></el-dropdown-item
>
<el-dropdown-item> <el-dropdown-item>
<router-link :to="{ path: '/userCourse', query: {id:scope.row.id} }"> <router-link
<el-button type="text" size="small"> :to="{ path: '/userCourse', query: { id: scope.row.id } }"
用户课程管理 >
</el-button> <el-button type="text" size="small">
用户课程管理
</el-button>
</router-link> </router-link>
</el-dropdown-item> </el-dropdown-item>
<!-- <el-dropdown-item divided>蚵仔煎</el-dropdown-item> --> <!-- <el-dropdown-item divided>蚵仔煎</el-dropdown-item> -->
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="total" @size-change="sizeChangeHandle"
layout="total, sizes, prev, pager, next, jumper"> @current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update
<el-dialog title="充/扣天医币" :close-on-click-modal="false" :visible.sync="adc" append-to-body width="30%" :before-close="closeDia"> v-if="addOrUpdateVisible"
<el-form :model="pointForm" label-width="100px" :rules="pointFormRules" ref="pointForm"> ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<el-dialog
title="充/扣天医币"
:close-on-click-modal="false"
:visible.sync="adc"
append-to-body
width="30%"
:before-close="closeDia"
>
<el-form
:model="pointForm"
label-width="100px"
:rules="pointFormRules"
ref="pointForm"
>
<el-form-item label="用户"> <el-form-item label="用户">
{{pointForm.tel}} <span v-if="pointForm.name!=''">({{pointForm.name}})</span> {{ pointForm.tel }}
<span>账户余额<em style="font-style: normal; font-size: 16px; color: #17B3A3;">{{pointForm.peanutCoin}}</em></span> <span v-if="pointForm.name != ''">({{ pointForm.name }})</span>
<span
>账户余额<em
style="font-style: normal; font-size: 16px; color: #17B3A3;"
>{{ pointForm.peanutCoin }}</em
></span
>
</el-form-item> </el-form-item>
<!-- <el-form-item label="充/扣主题"> <!-- <el-form-item label="充/扣主题">
<el-input v-model="pointForm.title"></el-input> <el-input v-model="pointForm.title"></el-input>
@@ -145,147 +320,205 @@
<!-- <el-input v-model="pointForm.pointType" placeholder="0-普通 1-vip"></el-input> <!-- <el-input v-model="pointForm.pointType" placeholder="0-普通 1-vip"></el-input>
--> -->
<el-select v-model="pointForm.pointType" placeholder="请选择"> <el-select v-model="pointForm.pointType" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> <el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="金额" prop="pointAmount"> <el-form-item label="金额" prop="pointAmount">
<el-input-number v-model="pointForm.pointAmount" :placeholder="pointForm.peanutCoin+'可用'"> <el-input-number
v-model="pointForm.pointAmount"
:placeholder="pointForm.peanutCoin + '可用'"
>
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="充扣明细"> <el-form-item label="充扣明细">
<el-input type="textarea" rows="5" v-model="pointForm.remark" placeholder="操作说明"> <el-input
type="textarea"
rows="5"
v-model="pointForm.remark"
placeholder="操作说明"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="closeDia">取消</el-button> <el-button @click="closeDia">取消</el-button>
<el-button type="primary" @click="huaSheng(pointForm.peanutCoin)">确定</el-button> <el-button type="primary" @click="huaSheng(pointForm.peanutCoin)"
>确定</el-button
>
</span> </span>
</el-dialog> </el-dialog>
<userCouponList v-if="youVisible" ref="userCouponList" :userId='thisUserID' @close="closeCoupon"></userCouponList> <userCouponList
v-if="youVisible"
ref="userCouponList"
:userId="thisUserID"
@close="closeCoupon"
></userCouponList>
</div> </div>
</template> </template>
<script> <script>
import userCouponList from '../coupon/userCouponList' import userCouponList from "../coupon/userCouponList";
import AddOrUpdate from './user-add-or-update' import AddOrUpdate from "./user-add-or-update";
export default { export default {
data() { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ""
}, },
pointFormRules:{ pointFormRules: {
pointAmount:[ pointAmount: [
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: "请输入金额", trigger: "blur" }
], ],
pointType:{ required: true, message: '请选择操作类型', trigger: 'blur' } pointType: {
}, required: true,
options: [{ message: "请选择操作类型",
trigger: "blur"
}
},
vipList: [],
options: [
{
value: 0, value: 0,
label: '充天医币' label: "充天医币"
}, {
value: 1,
label: '扣天医币'
}],
adc: false,
pointForm: {
pointType: 0,
remark:'',
// title:'',
pointAmount:0
}, },
dataList: [], {
pageIndex: 1, value: 1,
pageSize: 10, label: "扣天医币"
totalPage: 0, }
total:0, ],
dataListLoading: false, adc: false,
dataListSelections: [], pointForm: {
addOrUpdateVisible: false, pointType: 0,
youVisible: false, remark: "",
youForm: {}, // title:'',
courperList: [], pointAmount: 0
courperHistList: [],
}
},
components: {
AddOrUpdate,
userCouponList
},
activated() {
this.getDataList()
},
methods: {
closeCoupon(val){
this.youVisible = false
}, },
// 用户课程 dataList: [],
userCourse(val){ pageIndex: 1,
pageSize: 10,
totalPage: 0,
total: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
youVisible: false,
youForm: {},
courperList: [],
courperHistList: []
};
},
components: {
AddOrUpdate,
userCouponList
},
activated() {
this.getDataList();
},
methods: {
getVipMoney(data) {
console.log("data at line 420:", data.id);
}, this.$http({
// 获取数据列表 // url: this.$http.adornUrl('/book/user/list'),
getDataList() { url: this.$http.adornUrl("/master/userVip/getVipProductForUser"),
this.dataListLoading = true method: "post",
this.$http({ data: this.$http.adornData({
// url: this.$http.adornUrl('/book/user/list'), uid: data.id
url: this.$http.adornUrl('/book/user/getUserList'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
}),
// params: this.$http.adornParams({
// 'page': 1,
// 'limit': this.pageSize,
// 'key': this.dataForm.key
// })
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataList = data.user.records
this.totalPage = data.user.pages
this.total = data.user.total
this.dataListLoading = false
}
}) })
}, // params: this.$http.adornParams({
// 重置密码 // 'page': 1,
resetPassword(row){ // 'limit': this.pageSize,
console.log(row,'row') // 'key': this.dataForm.key
this.$prompt('请输入新密码', '提示', { // })
confirmButtonText: '确定', }).then(({ data }) => {
cancelButtonText: '取消', if (data && data.code === 0) {
var list=[]
console.log("data at line 436:", data.list);
for(let i in data.list){
if (data.list[i].length > 0) {
list.push([...data.list[i]]);
}
}
this.vipList=list.flat(Infinity)
console.log("this.vipList at line 440:", this.vipList);
}else{
this.$message.error(data.msg);
this.vipList=[]
}
});
},
closeCoupon(val) {
this.youVisible = false;
},
// 用户课程
userCourse(val) {},
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.$http({
// url: this.$http.adornUrl('/book/user/list'),
url: this.$http.adornUrl("/book/user/getUserList"),
method: "post",
data: this.$http.adornData({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
})
// params: this.$http.adornParams({
// 'page': 1,
// 'limit': this.pageSize,
// 'key': this.dataForm.key
// })
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.user.records;
this.totalPage = data.user.pages;
this.total = data.user.total;
this.dataListLoading = false;
}
});
},
// 重置密码
resetPassword(row) {
console.log(row, "row");
this.$prompt("请输入新密码", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消"
// inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
// inputErrorMessage: '邮箱格式不正确' // inputErrorMessage: '邮箱格式不正确'
}).then(({ value }) => { })
.then(({ value }) => {
this.$http({ this.$http({
url: this.$http.adornUrl('/book/user/updateUserPassword'), url: this.$http.adornUrl("/book/user/updateUserPassword"),
method: 'post', method: "post",
data: this.$http.adornData({ data: this.$http.adornData({
'id':row.id, id: row.id,
'password': value password: value
}), })
}).then(({data}) => { })
if (data && data.code === 0) { .then(({ data }) => {
this.$message.success('修改密码成功') if (data && data.code === 0) {
} this.$message.success("修改密码成功");
}).catch(({e}) => { }
console.log(e,'e') })
}) .catch(({ e }) => {
console.log(e, "e");
});
// this.$message({ // this.$message({
// type: 'success', // type: 'success',
// message: '你的邮箱是: ' + value // message: '你的邮箱是: ' + value
// }); // });
}).catch(() => { })
.catch(() => {
// this.$message({ // this.$message({
// type: 'info', // type: 'info',
// message: '取消输入' // message: '取消输入'
@@ -293,120 +526,124 @@ import userCouponList from '../coupon/userCouponList'
}); });
}, },
// 每页数 // 每页数
sizeChangeHandle(val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val;
this.pageIndex = 1 this.pageIndex = 1;
this.getDataList() this.getDataList();
}, },
// 当前页 // 当前页
currentChangeHandle(val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val;
this.getDataList() this.getDataList();
}, },
// 多选 // 多选
selectionChangeHandle(val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val;
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle(id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id);
}) });
}, },
closeDia(){ closeDia() {
this.adc = false this.adc = false;
this.$refs.pointForm.resetFields(); this.$refs.pointForm.resetFields();
// this.pointForm.pointType == 0 // this.pointForm.pointType == 0
}, },
// 删除 // 删除
deleteHandle(id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id;
confirmButtonText: '确定', });
cancelButtonText: '取消', this.$confirm(
type: 'warning' `确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
}).then(() => { "提示",
this.$http({ {
url: this.$http.adornUrl('/book/user/delete'), confirmButtonText: "确定",
method: 'post', cancelButtonText: "取消",
data: this.$http.adornData(ids, false) type: "warning"
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
// 充值扣款天医币
ck(e) {
this.pointForm=e
this.adc = true
},
huaSheng(point){
// console.log(this.pointForm.pointAmount, point)
if(this.pointForm.pointAmount > point && this.pointForm.pointType == 1){
return this.$message.error('扣除金额不能大于总金额')
} }
this.$refs['pointForm'].validate((valid) => { ).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl(`/book/user/pointChange?pointType=${this.pointForm.pointType}&note=${this.pointForm.remark}&pointAmount=${this.pointForm.pointAmount}&id=${this.pointForm.id}`), url: this.$http.adornUrl("/book/user/delete"),
method: 'get', method: "post",
params: this.$http.adornParams() data: this.$http.adornData(ids, false)
}).then(({ }).then(({ data }) => {
data
}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message.success('操作成功') this.$message({
this.getDataList() message: "操作成功",
this.adc = false type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
}
});
} else {
this.$message.error(data.msg);
} }
}) });
}) });
}, },
// async getUserCouponList(userId) { // 充值扣款天医币
// var obj = undefined ck(e) {
// await this.$http({ this.pointForm = e;
// url: this.$http.adornUrl('/common/coupon/getCouponHistoryList'), this.adc = true;
// method: 'post', },
// data: this.$http.adornData({ huaSheng(point) {
// // 'userId': this.youForm.id, // console.log(this.pointForm.pointAmount, point)
// "page":1, if (this.pointForm.pointAmount > point && this.pointForm.pointType == 1) {
// "limit":10, return this.$message.error("扣除金额不能大于总金额");
// "getType":"",//获取类型 0 后台赠送 1 主动获取 }
// "status":"",//使用状态 0 未使用 1 已使用 2 已过期 this.$refs["pointForm"].validate(valid => {
// "userInfo":"",//用户信息 this.$http({
// "userId": userId url: this.$http.adornUrl(
// }) `/book/user/pointChange?pointType=${this.pointForm.pointType}&note=${this.pointForm.remark}&pointAmount=${this.pointForm.pointAmount}&id=${this.pointForm.id}`
// }).then(async({ data }) => { ),
// if(data.code != 0 ) return this.$message.error(data.msg) method: "get",
// if (data && data.code == 0) { params: this.$http.adornParams()
// obj = data }).then(({ data }) => {
// console.log('data', data) if (data && data.code === 0) {
// this.youVisible = true this.$message.success("操作成功");
// } this.getDataList();
// }).catch(({e}) => { this.adc = false;
// console.log(e,'e') }
// obj = undefined });
// this.$message.error(e.msg) });
// }) },
// return obj // async getUserCouponList(userId) {
// }, // var obj = undefined
// 个人优惠券 // await this.$http({
// url: this.$http.adornUrl('/common/coupon/getCouponHistoryList'),
// method: 'post',
// data: this.$http.adornData({
// // 'userId': this.youForm.id,
// "page":1,
// "limit":10,
// "getType":"",//获取类型 0 后台赠送 1 主动获取
// "status":"",//使用状态 0 未使用 1 已使用 2 已过期
// "userInfo":"",//用户信息
// "userId": userId
// })
// }).then(async({ data }) => {
// if(data.code != 0 ) return this.$message.error(data.msg)
// if (data && data.code == 0) {
// obj = data
// console.log('data', data)
// this.youVisible = true
// }
// }).catch(({e}) => {
// console.log(e,'e')
// obj = undefined
// this.$message.error(e.msg)
// })
// return obj
// },
// 个人优惠券
// async youhui(e) { // async youhui(e) {
// this.youForm = e // this.youForm = e
// this.youForm.memberId = e.id // this.youForm.memberId = e.id
@@ -420,28 +657,26 @@ import userCouponList from '../coupon/userCouponList'
// }, // },
// 删除优惠券 // 删除优惠券
courDelete(e) { courDelete(e) {
let arrList = [] let arrList = [];
arrList.push(e.id) arrList.push(e.id);
this.$http({ this.$http({
url: this.$http.adornUrl('/book/couponhistory/delete'), url: this.$http.adornUrl("/book/couponhistory/delete"),
method: 'post', method: "post",
data: this.$http.adornData(arrList, false) data: this.$http.adornData(arrList, false)
}).then(({ }).then(({ data }) => {
data if (data && data.code === 0) {
}) => { this.$message({
if (data && data.code === 0) { message: "删除成功",
this.$message({ type: "success",
message: '删除成功', duration: 1500
type: 'success', });
duration: 1500, this.youhui(this.youForm);
}) this.youVisible = true;
this.youhui(this.youForm) }
this.youVisible = true });
}
})
}
} }
} }
};
</script> </script>