Commit d35d45a6 by 吕明尚

增加赠送时长按钮

parent 3d0f9619
......@@ -42,3 +42,11 @@ export function delWallet(id) {
method: 'delete'
})
}
export function giveDuration(data) {
return request({
url: '/system/wallet/giveDuration',
method: 'post',
data: data
})
}
......@@ -134,16 +134,16 @@
<el-table v-loading="loading" :data="consumerList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户账号" align="center" prop="account" />
<el-table-column label="用户昵称" align="center" prop="nickName" />
<el-table-column align="center" label="用户账号" prop="account" width="120"/>
<el-table-column align="center" label="用户昵称" prop="nickName" width="100"/>
<el-table-column label="用户头像" align="center" prop="avatar" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.avatar" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="用户手机号" align="center" prop="phone" />
<el-table-column align="center" label="用户手机号" prop="phone" width="120"/>
<el-table-column label="会员级别" align="center" prop="level" />
<el-table-column label="会员角色类型" align="center" prop="roleType">
<el-table-column align="center" label="会员角色类型" prop="roleType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.wechat_role_type" :value="scope.row.roleType"/>
</template>
......@@ -153,12 +153,12 @@
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
</template>
</el-table-column>
<el-table-column label="车牌" align="center" prop="numberplate"/>
<el-table-column align="center" label="车牌" prop="numberplate" width="100"/>
<el-table-column label="详细地址" align="center" prop="addres" />
<el-table-column label="充值余额" align="center" prop="amount" />
<el-table-column label="赠送余额" align="center" prop="freeAmount" />
<el-table-column label="消费次数" align="center" prop="totalTimes" />
<el-table-column label="总消费时长" align="center" prop="duration" />
<el-table-column align="center" label="总消费时长" prop="duration" width="100"/>
<el-table-column label="账号状态" align="center" prop="status" >
<template slot-scope="scope">
<span v-if="scope.row.status === 1">
......@@ -170,12 +170,12 @@
</span>
</template>
</el-table-column>
<el-table-column label="最后一次登录时间" align="center" prop="lastLoginTime" >
<el-table-column align="center" label="最后一次登录时间" prop="lastLoginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastLoginTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="180">
<template slot-scope="scope">
<!-- <el-button-->
<!-- size="mini"-->
......@@ -199,6 +199,14 @@
@click="give(scope.row)"
>赠送优惠卷
</el-button>
<el-button
v-hasPermi="['system:consumer:give']"
icon="el-icon-delete"
size="mini"
type="text"
@click="giveDuration(scope.row)"
>赠送时长
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -261,6 +269,22 @@
</div>
</el-dialog>
<!-- 添加或修改会员用户对话框 -->
<el-dialog :title="durationTitle" :visible.sync="durationOpen" append-to-body width="500px">
<el-form ref="durationForm" :model="durationForm" :rules="durationRules">
<el-form-item label="时长(单位:小时)" prop="remainingDuration">
<el-input-number v-model="durationForm.remainingDuration" :max="100" :min="0" :step="0.5"
placeholder="请输入门槛时长"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitDurationForm"> </el-button>
<el-button @click="durationCancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="couponTitle" :visible.sync="couponOpen" width="80%" append-to-bod>
<el-table v-loading="couponLoading" :data="couponList">
<el-table-column label="优惠券名称" align="center" prop="name"/>
......@@ -359,6 +383,8 @@ import {listDuration} from "../../../api/system/coupon";
import {give} from "../../../api/system/consumerCoupon";
import moment from "moment";
import {query} from '@/api/system/pack';
import {giveDuration} from '@/api/system/wallet';
import {storeList} from "../../../api/system/store";
export default {
......@@ -386,11 +412,14 @@ export default {
storeList: [],
// 弹出层标题
title: "",
durationTitle: "",
couponTitle: "",
// 是否显示弹出层
couponOpen: false,
open: false,
durationOpen: false,
consumerId: null,
giveConsumerId: null,
// 查询参数
queryParams: {
pageNum: 1,
......@@ -412,6 +441,7 @@ export default {
},
// 表单参数
form: {},
durationForm: {},
couponForm: {},
// 表单校验
rules: {
......@@ -424,6 +454,9 @@ export default {
phone: [
{ required: true, message: "用户手机号不能为空", trigger: "blur" }
],
},
// 表单校验
durationRules: {
}
};
},
......@@ -515,6 +548,21 @@ export default {
};
this.resetForm("form");
},
// 取消按钮
durationCancel() {
this.durationOpen = false;
this.durationReset();
},
// 表单重置
durationReset() {
this.durationForm = {
duration: null
};
this.resetForm("durationForm");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
......@@ -567,6 +615,19 @@ export default {
}
});
},
/** 提交按钮 */
submitDurationForm() {
this.$refs["durationForm"].validate(valid => {
if (valid) {
this.durationForm.consumerId = this.giveConsumerId;
giveDuration(this.durationForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.durationOpen = false;
this.getList();
});
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
......@@ -591,6 +652,11 @@ export default {
this.couponOpen = true;
this.couponTitle = "优惠卷列表";
},
giveDuration(row) {
this.giveConsumerId = row.id;
this.durationOpen = true;
this.durationTitle = "添加时长";
},
submitcouponGive(row) {
const consumerId = this.consumerId;
this.$modal.confirm('是否赠送' + row.name + '优惠卷').then(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment