合并冲突

master
十七 4 years ago
commit 73dff4515b

@ -10,3 +10,34 @@ export function getList(params) {
params
});
}
// 发布
export function doAdd(data) {
return service({
url: "/platformCoupon/add",
method: "post",
data
});
}
// 编辑
export function doEdit(data) {
return service({
url: "/platformCoupon/update",
method: "put",
data
});
}
// 删除
export function doDelete(id) {
return service({
url: "/platformCoupon/" + id,
method: "delete",
});
}
// 审核
export function doAudit(data) {
return service({
url: "/platformCoupon/shopCheck",
method: "post",
data
});
}

@ -0,0 +1,104 @@
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag title="适用项目" :visible.sync="dialogVisible" width="600px">
<el-table ref="list" :data="list" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText" @selection-change="handleSelect" @row-click="handleRowClick" @row-dblclick="confirm">
<el-table-column align="center" width="60" type="selection"></el-table-column>
<el-table-column align="center" min-width="120" prop="storeName" label="门店名称"></el-table-column>
<el-table-column align="center" width="100" prop="projectNum" label="项目编码"></el-table-column>
<el-table-column align="center" min-width="120" prop="projectName" label="项目名称"></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="close"> </el-button>
<el-button size="mini" type="primary" @click="confirm">
</el-button>
</span>
</el-dialog>
</template>
<script>
import { propage, organizations } from "@/api/storeManage.js";
export default {
data() {
return {
//
list: [],
listLoading: false,
elementLoadingText: '正在加载...',
//
mulSelect: [],
queryForm: {
pageNum: 1,
pageSize: 1000000,
state: 1
},
dialogVisible: false,
};
},
methods: {
// ======================== ======================== //
//
show(list) {
this.dialogVisible = true
this.fetchHeadStoreId()
},
close() {
this.list = Array.from([]);
this.mulSelect = Array.from([]);
this.dialogVisible = false
},
// ======================== ======================== //
// ID
async fetchHeadStoreId() {
let { code, rows, message } = await organizations({ storeRequest: null })
if (code == '000000') {
rows.forEach((item) => {
if (!item.parentId) {
this.queryForm.storeId = item.id
this.fetchData()
}
});
}
if (code == '010000') {
this.$message({
message: message,
type: 'error'
});
}
},
// ID
async fetchData() {
let { code, pageInfo, message } = await propage(this.queryForm)
if (code == '000000') {
this.list = Array.from(pageInfo.list);
}
if (code == '010000') {
this.$message({
message: message,
type: 'error'
});
}
},
// ======================== ======================== //
handleSelect(data) {
this.mulSelect = Array.from(data);
},
handleRowClick(row) {
this.$refs.list.toggleRowSelection(row)
},
//
confirm(row) {
if (row.id) {
this.$emit('call-back-project', [{ storeId: row.id, storeName: row.storeName, projectId: row.id, projectNum: row.projectNum, projectName: row.projectName }]);
} else {
let list = this.mulSelect.map((item) => {
return { storeId: item.id, storeName: item.storeName, projectId: item.id, projectNum: item.projectNum, projectName: item.projectName }
})
this.$emit('call-back-project', list);
}
this.close()
}
},
};
</script>
<style>
</style>

@ -0,0 +1,79 @@
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag title="适用门店" :visible.sync="dialogVisible" width="600px">
<el-table ref="list" :data="list" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText" @selection-change="handleSelect" @row-click="handleRowClick" @row-dblclick="confirm">
<el-table-column align="center" width="60" type="selection"></el-table-column>
<el-table-column align="center" width="100" prop="storeNum" label="门店编码"></el-table-column>
<el-table-column align="center" min-width="120" prop="storeName" label="门店名称"></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="close"> </el-button>
<el-button size="mini" type="primary" @click="confirm">
</el-button>
</span>
</el-dialog>
</template>
<script>
import { organizations } from "@/api/storeManage.js";
export default {
data() {
return {
//
list: [],
listLoading: false,
elementLoadingText: '正在加载...',
//
mulSelect: [],
dialogVisible: false,
};
},
methods: {
// ======================== ======================== //
//
show(list) {
this.dialogVisible = true
this.fetchData()
},
close() {
this.list = Array.from([]);
this.mulSelect = Array.from([]);
this.dialogVisible = false
},
// ======================== ======================== //
async fetchData() {
let { code, rows, message } = await organizations({ storeRequest: null })
if (code == '000000') {
this.list = Array.from(rows);
}
if (code == '010000') {
this.$message({
message: message,
type: 'error'
});
}
},
// ======================== ======================== //
handleSelect(data) {
this.mulSelect = Array.from(data);
},
handleRowClick(row) {
this.$refs.list.toggleRowSelection(row)
},
//
confirm(row) {
if (row.id) {
this.$emit('call-back-store', [{ storeId: row.id, storeNum: row.storeNum, storeName: row.storeName }]);
} else {
let list = this.mulSelect.map((item) => {
return { storeId: item.id, storeNum: item.storeNum, storeName: item.storeName }
})
this.$emit('call-back-store', list);
}
this.close()
}
},
};
</script>
<style>
</style>

@ -8,15 +8,17 @@
export default {
data() {
return {
imageUrl: ''
imageUrl: ''//
};
},
methods: {
show(url) {
this.imageUrl = url
},
// 访edit.vue
handleChange(file, fileList) {
this.imageUrl = URL.createObjectURL(file.raw);
this.$emit('active-img', file.raw);
// console.log('file', file);
console.log('fileList', fileList);
this.imageUrl = URL.createObjectURL(file.raw);//访
this.$emit('active-img', file.raw);//raw
},
//
handleClear() {

@ -5,21 +5,22 @@
</div>
<div class="title">优惠券发布成功</div>
<div class="btn">
<el-button class="sub" type="primary" size="medium" @click="GoOn"></el-button>
<el-button size="medium" @click="complete"></el-button>
<el-button class="sub" type="primary" size="medium" @click="GoOn"></el-button>
<!-- <el-button class="sub" type="primary" size="medium" @click="GoOn"></el-button> -->
<!-- <el-button size="medium" @click="complete"></el-button> -->
</div>
</div>
</template>
<script>
import Bus from "../../../bus";
export default {
data() {
return {
choose: 0,
}
return {}
},
methods: {
GoOn() {
this.$emit('next', 1)
this.$emit('next', 1, null)
Bus.$emit('issueComplete')
},
complete() {
this.$router.push('/active/management')
@ -32,6 +33,10 @@ export default {
.container {
margin-top: 80px;
text-align: center;
height: 75vh;
/* background-color: #409eff; */
overflow-y: auto;
overflow-x: hidden;
}
.container .icon {
font-size: 80px;
@ -42,7 +47,7 @@ export default {
font-size: 20px;
margin-bottom: 100px;
}
.container .btn .sub {
/* .container .btn .sub {
margin-right: 50px;
}
} */
</style>

@ -8,37 +8,55 @@
<el-input v-model.trim="form.couponName" placeholder="优惠券名称"></el-input>
</el-form-item>
<el-form-item label="优惠券数量" prop="couponNumber">
<el-input-number v-model="form.couponNumber" :min="1" :precision="0" label="优惠券数量" style="width:100%"></el-input-number>
<el-input-number v-model="form.couponNumber" :min="1" :precision="0" label="优惠券数量" style="width:100%" @change="handleCalculate"></el-input-number>
</el-form-item>
<el-form-item label="优惠方式" prop="couponType">
<el-radio v-model="form.couponType" :label="0"></el-radio>
<el-radio v-model="form.couponType" :label="1"></el-radio>
<el-radio v-model="form.couponType" :label="2"></el-radio>
<el-radio-group v-model="form.couponType" @change="handleChange($event===0?['fullKimsMoney']:$event===1?['fullDiscountMoney']:false)">
<el-radio v-model="form.couponType" :label="0"></el-radio>
<el-radio v-model="form.couponType" :label="1"></el-radio>
<el-radio v-model="form.couponType" :label="2"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="fullKimsMoney" v-if="form.couponType===0">
<el-input-number class="hideBtn" v-model="form.fullKimsMoney" :min="1" :precision="0" placeholder="抵扣金额"></el-input-number>
</el-form-item>
<el-form-item prop="fullDiscountMoney" v-if="form.couponType===1">
<el-input-number class="hideBtn" v-model="form.fullDiscountMoney" :min="1" :max="100" :precision="0" placeholder="折扣(%)"></el-input-number>
</el-form-item>
<el-form-item label="优惠限制" prop="serviceConditions">
<el-radio v-model="form.serviceConditions" :label="0"></el-radio>
<el-radio v-model="form.serviceConditions" :label="1"></el-radio>
<el-radio-group v-model="form.serviceConditions">
<el-radio v-model="form.serviceConditions" :label="0"></el-radio>
<el-radio v-model="form.serviceConditions" :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.serviceConditions===0" prop="fullReductionMoney">
<amount-input ref="fullReductionMoney" @amount="handleAmount" name="fullReductionMoney" placeholder="满减金额(满多少可以减)"></amount-input>
<el-input-number class="hideBtn" v-model="form.fullReductionMoney" :min="1" :precision="2" placeholder="满减金额(满多少可以减)"></el-input-number>
</el-form-item>
<el-form-item label="适用门店" prop="suitableStore">
<el-radio v-model="form.suitableStore" :label="0"></el-radio>
<el-radio v-model="form.suitableStore" :label="1"></el-radio>
<el-radio-group v-model="form.suitableStore">
<el-radio v-model="form.suitableStore" :label="0"></el-radio>
<el-radio v-model="form.suitableStore" :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.suitableStore===1" prop="useStoreList">
<el-button type="primary" size="mini">选择门店</el-button>
<div class="store" v-for="item in form.useStoreList" :key="item.storeId" @click="handleStore">{{`${item.storeName}${item.storeNum}`}}</div>
<el-button v-if="!(form.useStoreList.length>0)" type="primary" size="mini" @click="handleStore"></el-button>
</el-form-item>
<el-form-item label="适用项目" prop="suitableProject">
<el-radio v-model="form.suitableProject" :label="0"></el-radio>
<el-radio v-model="form.suitableProject" :label="1"></el-radio>
<el-radio-group v-model="form.suitableProject">
<el-radio v-model="form.suitableProject" :label="0"></el-radio>
<el-radio v-model="form.suitableProject" :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.suitableProject===1" prop="projectList">
<el-button type="primary" size="mini">选择项目</el-button>
<div class="store" v-for="item in form.projectList" :key="item.projectId" @click="handleProject">{{`${item.projectName}${item.projectNum}`}}</div>
<el-button v-if="!(form.projectList.length>0)" type="primary" size="mini" @click="handleProject"></el-button>
</el-form-item>
<el-form-item label="有效方式" prop="indateType">
<el-radio v-model="form.indateType" :label="0"></el-radio>
<el-radio v-model="form.indateType" :label="1"></el-radio>
<el-radio-group v-model="form.indateType" @change="handleChange($event===0?['startDay','endDay']:$event===1?['fixDate']:false)">
<el-radio v-model="form.indateType" :label="0"></el-radio>
<el-radio v-model="form.indateType" :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.indateType===0" prop="startDay">
<el-input v-model.trim="form.startDay" placeholder="领取后多少天生效"></el-input>
@ -46,19 +64,24 @@
<el-form-item v-if="form.indateType===0" prop="endDay">
<el-input v-model.trim="form.endDay" placeholder="生效后多少天内有效"></el-input>
</el-form-item>
<el-form-item v-if="form.indateType===1" prop="startDate">
<el-date-picker v-model="form.fixDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="截止日期" value-format="yyyy-MM-dd">
<el-form-item v-if="form.indateType===1" prop="fixDate">
<el-date-picker v-model="form.fixDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="截止日期" value-format="yyyy-MM-dd 00:00:00" @change="handleChange(['fixDate'],true)" style="width:100%">
</el-date-picker>
</el-form-item>
<el-form-item label="分享提成规则" prop="shareCommissionRules">
<el-radio v-model="form.shareCommissionRules" :label="0"></el-radio>
<el-radio v-model="form.shareCommissionRules" :label="1">(%)</el-radio>
<el-radio-group v-model="form.shareCommissionRules" @change="handleChange($event===0?['fixedAmount']:$event===1?['orderCommission']:false)">
<el-radio v-model="form.shareCommissionRules" :label="0">()</el-radio>
<el-radio v-model="form.shareCommissionRules" :label="1">(%)</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.shareCommissionRules===0" prop="fixedAmount">
<amount-input ref="fixedAmount" @amount="handleAmount" name="fixedAmount" placeholder="固定提成(元)"></amount-input>
<el-input-number class="hideBtn" v-model="form.fixedAmount" :min="1" :precision="2" placeholder="固定提成(元)" @change="handleCalculate"></el-input-number>
</el-form-item>
<el-form-item v-if="form.shareCommissionRules===1" prop="orderCommission">
<amount-input ref="orderCommission" @amount="handleAmount" name="orderCommission" placeholder="单据金额抽成(%)"></amount-input>
<el-input-number class="hideBtn" v-model="form.orderCommission" :min="1" :max="100" :precision="0" placeholder="单据金额抽成(%)" @change="handleCalculate"></el-input-number>
</el-form-item>
<el-form-item label="保证金">
<el-input v-model.trim="form.guaranteeMoney" placeholder="保证金(自动生成)" readonly></el-input>
</el-form-item>
<el-form-item label="活动图片" prop="imageUrl">
<active-img ref="activeImg" @active-img="handleImage"></active-img>
@ -75,19 +98,25 @@
</div>
</el-col>
</el-row>
<Store ref="Store" @call-back-store="callBackStore"></Store>
<Project ref="Project" @call-back-project="callBackProject"></Project>
</div>
</template>
<script>
import AmountInput from '@/components/AmountInput/index'
import ActiveImg from './activeImg'
import Store from '@/components/mulStore/index'
import Project from '@/components/mulProject/index'
import { partten } from "@/utils/partten/index.js";
export default {
name: 'Form',
components: { AmountInput, ActiveImg },
components: { ActiveImg, Store, Project },
data() {
return {
form: {
couponNumber: 1,
useStoreList: [],
projectList: [],
},
rules: {
couponName: [
@ -102,18 +131,33 @@ export default {
couponType: [
{ required: true, message: '请选择优惠方式', trigger: ['blur', 'change'] },
],
fullKimsMoney: [
{ required: true, message: '请输入抵扣金额', trigger: 'blur' },
],
fullDiscountMoney: [
{ required: true, message: '请输入折扣(%)', trigger: 'blur' },
],
fullReductionMoney: [
{ required: true, message: '请输入满减金额', trigger: 'blur' },
],
suitableStore: [
{ required: true, message: '请选择所有门店/指定门店', trigger: ['blur', 'change'] },
],
useStoreList: [
{ required: true, message: '请选择适用门店', trigger: ['blur', 'change'] },
],
suitableProject: [
{ required: true, message: '请选择所有项目/指定项目', trigger: ['blur', 'change'] },
],
projectList: [
{ required: true, message: '请选择适用项目', trigger: ['blur', 'change'] },
],
indateType: [
{ required: true, message: '请选择有效方式', trigger: ['blur', 'change'] },
],
fixDate: [
{ required: true, message: '请选择有效日期', trigger: ['blur', 'change'] },
],
startDay: [
{ required: true, message: '请输入多少天', trigger: 'blur' },
],
@ -123,12 +167,37 @@ export default {
shareCommissionRules: [
{ required: true, message: '请选择分享提成规则', trigger: ['blur', 'change'] },
],
fixedAmount: [
{ required: true, message: '请输入固定金额', trigger: 'blur' },
],
orderCommission: [
{ required: true, message: '请输入单据金额抽成(%', trigger: 'blur' },
],
imageUrl: [{ required: true, message: '请上传活动图片', trigger: ['blur', 'change'] }],
guaranteeMoney: [{ required: true, message: '请输入保证金', trigger: ['blur', 'change'] }],
},
}
},
methods: {
// ============================== ============================== //
//
handleData(row) {
// idid
if (row.id) {
// useStoreListprojectListuseStoresuseProjects2useStoreListprojectList
row.useStoreList = row.useStoreList ? row.useStoreList : Array.from(row.useStores);
row.projectList = row.projectList ? row.projectList : Array.from(row.useProjects);
// ,使imageUrl
row.imageUrl = row.imageUrl ? row.imageUrl : partten.imagePath + row.fileLists[0].filePath + '/' + row.fileLists[0].fileName
// elementfixDate
row.fixDate = Array.from([row.startDate, row.endDate]);
// 使this.$refsthis.$nextTick
this.$nextTick(function () {
this.$refs.activeImg.show(row.imageUrl)
});
}
this.form = Object.assign({}, row);
},
//
handleNext() {
this.$refs.form.validate((valid) => {
@ -141,43 +210,90 @@ export default {
},
//
resetForm() {
let form = Object.assign({}, this.form);
if (form.serviceConditions === 0) {
this.$refs.fullReductionMoney.reset()
}
if (shareCommissionRules === 0) {
this.$refs.fixedAmount.reset()
}
if (shareCommissionRules === 1) {
this.$refs.orderCommission.reset()
}
this.$refs.form.resetFields()
this.$baseMessage('重置成功', 'success')
},
// ============================== ============================== //
// ,
handleChange(value, judge) {
if (judge) {
this.$refs.form.validateField(value)
let form = Object.assign({}, this.form);
form.startDate = form.fixDate[0]
form.endDate = form.fixDate[1]
this.form = Object.assign({}, form);
}
if (value.length > 1) {
value.forEach((item) => {
this.$refs.form.clearValidate([item])
});
} else {
this.$refs.form.clearValidate(value)
}
},
//
handleImage(file) {
let form = Object.assign({}, this.form);
form.multipartFile = file
form.imageUrl = URL.createObjectURL(file)
this.form = Object.assign({}, form);
},
//
handleAmount(name, amount) {
let form = Object.assign({}, this.form)
form[name] = amount
this.form = Object.assign({}, form)
this.$nextTick(function () {
this.$refs.form.validateField(['imageUrl'])
});
},
//
handleClear() {
this.$refs.activeImg.handleClear()
},
//
handleStore() {
this.$refs.Store.show()
},
//
callBackStore(list) {
let form = Object.assign({}, this.form);
form.useStoreList = Array.from(list);
this.form = Object.assign({}, form);
this.$nextTick(function () {
this.$refs.form.validateField(['useStoreList'])
});
},
//
handleProject() {
this.$refs.Project.show()
},
//
callBackProject(list) {
let form = Object.assign({}, this.form);
form.projectList = Array.from(list);
this.form = Object.assign({}, form);
this.$nextTick(function () {
this.$refs.form.validateField(['projectList'])
});
},
//
handleCalculate() {
let form = Object.assign({}, this.form);
// (guaranteeMoney) = (couponNumber) * (fixedAmount)
// (guaranteeMoney) = 10000
if (form.shareCommissionRules === 0) {
if (form.couponNumber && form.fixedAmount) {
// form.guaranteeMoney =
}
}
}
},
}
</script>
<style scoped>
.container {
height: 75vh;
/* background-color: #409eff; */
overflow-y: auto;
overflow-x: hidden;
}
.container .form {
width: 500px;
/* // margin: 0 auto; */
}
.container .box {
display: flex;
@ -185,7 +301,35 @@ export default {
justify-content: center;
padding: 50px 0;
}
/* 让form-item下边距增大 */
.form .el-form-item {
margin-bottom: 15px;
}
/* 让输入款的内容居中 */
.form /deep/ .el-form-item .el-input--medium .el-input__inner {
text-align: center;
}
/* 让form标题离内容更远一点 */
.form /deep/ .el-form-item .el-form-item__content {
margin-left: 90px !important;
}
/* 隐藏el-input-number的加减按钮 */
.form .hideBtn {
width: 100%;
}
.form .hideBtn /deep/ .el-input-number__decrease {
display: none;
}
.form .hideBtn /deep/ .el-input-number__increase {
display: none;
}
/* 门店 */
.form .store {
color: #000;
border: 1px solid #409eff;
padding: 5px 10px;
margin-bottom: 10px;
border-radius: 5px;
cursor: pointer;
}
</style>

@ -0,0 +1,92 @@
<template>
<el-dialog title="打款" :visible.sync="dialogFormVisible" width="500px" @close="close" :close-on-click-modal="false" v-dialogDrag>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="保证金">
<el-input v-model.trim="form.guaranteeMoney" readonly></el-input>
</el-form-item>
<el-form-item label="打款回执" prop="">
<el-upload class="avatar-uploader" :limit="10" ref="upload" action="#" :show-file-list="false" :auto-upload="false" :on-change="handleChange">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'pay',
data() {
return {
imageUrl: '',//
form: {},
dialogFormVisible: false//
}
},
created() { },
methods: {
// ============================ ============================ //
//
show() {
this.dialogFormVisible = true
},
//
close() {
this.dialogFormVisible = false
},
// ============================ ============================ //
// 访edit.vue
handleChange(file, fileList) {
this.imageUrl = URL.createObjectURL(file.raw);//访
this.$emit('active-img', file.raw);//raw
},
//
handleClear() {
this.$refs.upload.clearFiles();
},
//
save() {
this.$refs.form.validate((valid) => {
if (valid) {
} else {
return false
}
})
},
},
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
background-color: #fff;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 150px;
height: 150px;
line-height: 150px;
text-align: center;
}
.avatar {
width: 150px;
height: 150px;
display: block;
}
</style>

@ -5,17 +5,28 @@
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<div class="box">
<div class="box-item">
<div class="item choose">
<div class="image">
<el-image style="width: 100%;border-radius: 15px;" src="https://ts1.cn.mm.bing.net/th/id/R-C.787ddc53f1e0e63069414ad9b92c6f46?rik=xhhOWcsZt8PKpQ&riu=http%3a%2f%2fpic.sc.chinaz.com%2ffiles%2fpic%2fpic9%2f201910%2fzzpic20432.jpg&ehk=FoOO5jHvDTus6T3RQ2zKGr%2bDgi%2fV4oGu1ERv6Nd9ce8%3d&risl=&pid=ImgRaw&r=0"></el-image>
</div>
<div class="btn">
<div class="item">领取</div>
<div class="item">分享</div>
</div>
</div>
</div>
<!-- <div class="box-item">
<div class="item" :class="choose == 1 ? 'choose' : ''" @click="handleChoose(1)"></div>
<div :class="choose == 1 ? 'choose' : ''">模板一</div>
</div>
<div class="box-item">
</div> -->
<!-- <div class="box-item">
<div class="item" :class="choose == 2 ? 'choose' : ''" @click="handleChoose(2)"></div>
<div :class="choose == 2 ? 'choose' : ''">模板二</div>
</div>
<div class="box-item">
<div class="item" :class="choose == 3 ? 'choose' : ''" @click="handleChoose(3)"></div>
<div :class="choose == 3 ? 'choose' : ''">模板三</div>
</div>
</div> -->
</div>
</el-col>
</el-row>
@ -30,7 +41,7 @@
</div>
</template>
<script>
import { doAdd } from "@/api/discount-coupon/issue.js";
import { doAdd, doEdit } from "@/api/discount-coupon/management.js";
export default {
data() {
return {
@ -42,34 +53,70 @@ export default {
//
handleData(form) {
this.form = Object.assign({}, form);
console.log('form', form);
},
handleChoose(num) {
this.choose = num
},
//
handleLast() {
this.$emit('next', 1)
this.$emit('next', 1, this.form)
},
//
async handleSubmit() {
let form = Object.assign({}, this.form);
for (let key in form) {
// formatnullnullnull
if (form[key] !== 0 && !form[key]) {
delete form[key]
}
// formformat[object object]
if (key == 'fixDate' || key == 'imageUrl' || key == 'useStores' || key == 'useProjects' || key == 'fileLists') {
delete form[key]
}
}
// IDmapstoreNumprojectId
form.useStoreList = form.useStoreList.map(item => item.storeNum);
form.projectList = form.projectList.map(item => item.projectId);
//
let format = new FormData()
Object.keys(this.form).map(key => {
format.append(key, this.form[key])
//
Object.keys(form).map(key => {
format.append(key, form[key])
})
let { code } = await doAdd(format)
if (form.id) {
//
let { code, message } = await doEdit(format)
this.callBack(code, message)
} else {
//
let { code, message } = await doAdd(format)
this.callBack(code, message)
}
},
callBack(code, message) {
if (code == '000000') {
this.$message({
message: '发布成功',
message: message,
type: 'success'
});
this.$emit('next', 3)
}
},
if (code == '010000') {
this.$message({
message: message,
type: 'error'
});
}
}
},
}
</script>
<style scoped>
.container {
height: 75vh;
/* background-color: #409eff; */
overflow-y: auto;
}
.container .box {
display: flex;
align-items: center;
@ -87,11 +134,29 @@ export default {
.container .box .box-item:last-child {
margin-right: 0px;
}
.container .box .box-item .item {
width: 250px;
height: 380px;
.container .box .box-item > .item {
width: 300px;
height: 500px;
border: 3px solid #dddddd;
margin-bottom: 30px;
padding: 13px;
background-color: #f8f8f8;
}
.container .box .box-item > .item .image {
height: 250px;
border-radius: 15px;
overflow-y: auto;
}
.container .box .box-item > .item .btn {
display: flex;
align-items: center;
justify-content: space-between;
}
.container .box .box-item > .item .btn > .item {
width: 114px;
height: 35px;
background-color: #fa3534;
color: #fff;
}
.container .box .box-item .choose {
color: #5470c6;

@ -1,5 +1,5 @@
<template>
<div class="container">
<div class="container-box">
<!-- 步骤 -->
<el-row :gutter="20">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
@ -20,6 +20,8 @@
import Complete from './components/complete'
import Edit from './components/edit'
import Templates from './components/template'
import Bus from "../../bus";
export default {
name: 'Form',
components: { Templates, Edit, Complete },
@ -29,17 +31,53 @@ export default {
form: {},
}
},
created() {
if (this.$route.params.id) {
this.$nextTick(function () {
this.$refs.edit.handleData(this.$route.params)
});
} else {
this.$nextTick(function () {
this.$refs.edit.handleData({
couponNumber: 1,
useStoreList: [],
projectList: [],
})
});
}
},
watch: {
$route(to, from) {
if (to.fullPath == '/couponIssue' && to.params.id) {
this.$nextTick(function () {
this.$refs.edit.handleData(to.params)
});
} else {
this.$nextTick(function () {
this.$refs.edit.handleData({
couponNumber: 1,
useStoreList: [],
projectList: [],
})
});
}
}
},
methods: {
// /
// active=1active=2active=3
handleNext(active, form) {
this.active = active
this.form = Object.assign({}, form);
// active ref1=edit2=templates3=complete
let activeName = active == 1 ? 'edit' : active == 2 ? 'templates' : 'complete'
if (activeName == 'templates') {
// 穿form
if (activeName == 'templates' || (activeName == 'edit' && this.form)) {
this.$nextTick(function () {
this.$refs[activeName].handleData(form)
this.$refs[activeName].handleData(this.form)
});
}
if (active === 1) {
if (active === 1 && !this.form) {
//
this.$nextTick(function () {
this.$refs.edit.handleClear()
@ -51,7 +89,7 @@ export default {
</script>
<style scoped>
.container /deep/ .el-step__icon {
.container-box /deep/ .el-step__icon {
background-color: #f1f1f1;
}
.marginTop {

@ -1,5 +1,5 @@
<template>
<el-dialog title="增加优惠券" :visible.sync="dialogFormVisible" ref="dialog" width="450px" @close="close">
<el-dialog title="编辑" :visible.sync="dialogFormVisible" ref="dialog" width="450px" @close="close">
<el-form ref="form" :model="form" :rules="rules" label-width="auto">
<el-form-item label="增量" prop="num">
<el-input v-model.trim="form.num" clearable autocomplete="off" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"></el-input>

@ -3,7 +3,7 @@
<div class="query-form">
<div class="query-form-left-panel">
<el-button icon="el-icon-s-promotion" type="primary" size="mini" @click="handleIssue"></el-button>
<el-button icon="el-icon-full-screen" type="warning" size="mini" @click="handleVerification"></el-button>
<!-- <el-button icon="el-icon-full-screen" type="warning" size="mini" @click="handleVerification"></el-button> -->
</div>
<div class="query-form-right-panel">
<el-form :inline="true" class="docTime" :model="queryForm" @submit.native.prevent>
@ -17,29 +17,82 @@
</div>
</div>
<el-table style="width: 100%;margin-top:5px" max-height="650" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" ref="list" class="custom-table" highlight-current-row border v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" @row-dblclick="handleGoter">
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="name" label="优惠券名称"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="type" label="优惠券类型"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="couponNumber" label="优惠券数量"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="deductionAmount" label="优惠"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="shareAmount" label="分润"></el-table-column>
<!-- <el-table-column show-overflow-tooltip align="center" min-width="130" prop="phone" label="手机号码"></el-table-column> -->
<!-- <el-table-column show-overflow-tooltip align="center" min-width="130" prop="imgUrl" label="图片"></el-table-column> -->
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="desc1" label="已领取数量"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="desc2" label="已使用数量"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="190" prop="desc3" label="使用日期" sortable></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="desc4" label="优惠券状态">
<template #default="{ row, $index }">
<el-tag type="success" v-if="row.status == 1"></el-tag>
<el-tag type="primary" v-if="row.status == 2"></el-tag>
<el-tag type="warning" v-if="row.status == 3"></el-tag>
<el-tag type="danger" v-if="row.status == 4"></el-tag>
<el-table-column align="center" width="50" type="index" label="序号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="state" label="状态">
<template #default="{row}">
<el-tag effect="dark" v-if="row.state===0"></el-tag>
<el-tag effect="dark" type="info" v-if="row.state===1"></el-tag>
<el-tag effect="dark" type="danger" v-if="row.state===2"></el-tag>
<el-tag effect="dark" type="success" v-if="row.state===3"></el-tag>
<el-tag effect="dark" type="warning" v-if="row.state===4"></el-tag>
<el-tag effect="dark" type="danger" v-if="row.state===11"></el-tag>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="couponName" label="优惠券名称"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="couponNumber" label="优惠券数量"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="couponType" label="优惠方式">
<template #default="{row}">
{{row.couponType===0?'代金券':row.couponType===1?'折扣券':row.couponType===2?'代扣券':''}}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="fullKimsMoney" label="抵扣金额"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="fullDiscountMoney" label="折扣(%)"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="serviceConditions" label="优惠限制">
<template #default="{row}">
{{row.serviceConditions===0?'满减':row.serviceConditions===1?'没有限制':''}}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="fullReductionMoney" label="满减金额"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="suitableStore" label="适用门店">
<template #default="{row}">
<div v-if="row.suitableStore===0"></div>
<el-button v-if="row.suitableStore===1" size="mini"></el-button>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="suitableProject" label="适用项目">
<template #default="{row}">
<div v-if="row.suitableProject===0"></div>
<el-button v-if="row.suitableProject===1" size="mini"></el-button>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="indateType" label="有效方式">
<template #default="{row}">
{{row.indateType===0?'领取后多少天':row.indateType===1?'固定日期':''}}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="startDay" label="领取后多少天生效"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="endDay" label="生效后多少天内有效"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="180" label="有效日期">
<template #default="{row}">
{{row.indateType===1?`${row.startDate.split(' ')[0]} ~ ${row.endDate.split(' ')[0]}`:''}}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="130" prop="shareCommissionRules" label="分享提成规则">
<template #default="{row}">
{{row.shareCommissionRules===0?'固定提成(元)':row.shareCommissionRules===1?'单据金额抽成(%)':''}}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="fixedAmount" label="固定提成(元)"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="120" prop="orderCommission" label="单据金额抽成(%)"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="120" prop="guaranteeMoney" label="保证金" sortable></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="imageUrl" label="活动图片">
<template #default="{row}">
<el-image style="width: 30px; height: 30px" :src="imgPath+row.fileLists[0].filePath+'/'+row.fileLists[0].fileName" :preview-src-list="[imgPath+row.fileLists[0].filePath+'/'+row.fileLists[0].fileName]">
</el-image>
</template>
</el-table-column>
<el-table-column align="center" min-width="250" label="操作">
<el-table-column align="center" min-width="440" label="操作">
<template #default="{ row, $index }">
<el-button type="primary" size="mini" :disabled="row.status != 2">增量</el-button>
<el-button type="warning" size="mini" :disabled="row.status != 2">作废</el-button>
<el-button type="danger" size="mini" :disabled="row.status != 2">删除</el-button>
<el-button type="primary" size="mini" :disabled="row.state!==0&&row.state!=2&&row.state!=4" @click="handleEdit(row)"></el-button>
<el-button type="info" size="mini" :disabled="row.state!==0&&row.state!=2&&row.state!=4" @click="handleAudit(row,1)"></el-button>
<el-button type="danger" size="mini" :disabled="row.state!=1" @click="handleAudit(row,2)"></el-button>
<el-button type="success" size="mini" :disabled="row.state!=1" @click="handleAudit(row,3)"></el-button>
<el-button type="warning" size="mini" :disabled="row.state!=3" @click="handleAudit(row,4)"></el-button>
<el-button type="primary" size="mini" :disabled="row.state!=3" @click="handleRemit(row,5)"></el-button>
<el-button type="danger" size="mini" :disabled="row.state!=3" @click="handleRemit(row,5)">退</el-button>
<!-- <el-button type="primary" size="mini">增量</el-button>
<el-button type="warning" size="mini">作废</el-button>
<el-button type="danger" size="mini" @click="handleDelete(row)"></el-button> -->
</template>
</el-table-column>
</el-table>
@ -50,7 +103,14 @@
<script>
import Verification from "./components/verification";
import { getList } from "@/api/discount-coupon/management.js";
import {
getList,
doDelete,
doAudit,
} from "@/api/discount-coupon/management.js";
import { partten } from "@/utils/partten/index.js";
import Bus from "../../bus";
export default {
name: "management",
components: { Verification },
@ -79,10 +139,17 @@ export default {
},
total: 0,
layout: "total, sizes, prev, pager, next, jumper",
//
imgPath: "",
};
},
created() {
this.imgPath = partten.imagePath;
this.fetchData();
//
Bus.$on("issueComplete", () => {
this.fetchData();
});
},
methods: {
// ========================== ========================== //
@ -113,6 +180,11 @@ export default {
this.fetchData();
},
// ========================== ========================== //
//
handleEdit(row) {
// Bus.$emit("/couponIssue", row)
this.$router.push({ name: "CouponIssue", params: row });
},
//
handleGoter(row) {
this.$router.push({ name: "AllGot", params: row });
@ -125,6 +197,39 @@ export default {
handleVerification() {
this.$refs.verification.open();
},
//
async handleAudit(row, state) {
let { code, message } = await doAudit({ id: row.id, state: state });
if (code == "000000") {
this.$message.success(
state === 1
? "送审成功"
: state === 2
? "回收成功"
: state === 3
? "审核成功"
: state === 4
? "反审核成功"
: message
);
this.fetchData();
}
if (code == "010000") {
this.$message.error(message);
}
},
//
handleRemit() {},
//
async handleDelete(row) {
let { code, message } = await doDelete(row.id);
if (code == "000000") {
this.$message.success("删除成功");
}
if (code == "010000") {
this.$message.error(message);
}
},
},
};
</script>

@ -22,7 +22,7 @@
</el-form>
</vab-query-form-right-panel>
</vab-query-form> -->
<el-table class="custom-table" highlight-current-row border v-loading="listLoading" :data="list" max-height="508px" :element-loading-text="elementLoadingText" @row-dblclick="handleGot">
<el-table style="width: 100%;margin-top:5px" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" ref="list" class="custom-table" highlight-current-row border v-loading="listLoading" :data="list" max-height="600px" :element-loading-text="elementLoadingText" @row-dblclick="handleGot">
<template slot="empty"></template>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="share" label="分享人"></el-table-column>
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="got" label="领取人"></el-table-column>

@ -785,6 +785,7 @@ const router = new VueRouter({
},
{
path: "/couponIssue",
name: "CouponIssue",
component: () => import("../pages/discount-coupon/issue/index.vue"),
meta: {
title: "发布",
@ -793,6 +794,7 @@ const router = new VueRouter({
},
{
path: "/couponMane",
name: "CouponMane",
component: () =>
import("../pages/discount-coupon/management/index.vue"),
meta: {

@ -1,187 +1,187 @@
/* 主题样式 */
.el-aside {
/* background: #f78989; */
/* background: linear-gradient(#f78989, #d69c9c); */
/* background-color: #1873d4; */
background: linear-gradient(#51a5ff, #1873d4);
/* 随着.el-menu-item background:rgb(247, 137, 137) !important;一起变 */
/* background: rgb(247, 137, 137); */
height: 100%;
font-family: "幼圆";
font-weight: 700;
color: rgb(207, 207, 207) !important;
}
.collapse:hover {
/* 收缩菜单按钮样式 */
/* background: #fc9ca7; */
background-color: linear-gradient(#fc3b3b, #2375f0);
box-shadow: #51a5ff 10px 10px 8px;
}
/* 菜单 */
.el-submenu .el-menu-item {
height: 35px;
line-height: 35px;
}
/* 图标 */
.el-submenu [class^=el-icon-] {
font-size: 16px;
}
/* 一级菜单字体 */
.el-submenu__title span {
font-size: 14px;
}
.el-menu-item,
.el-submenu__title {
/* 一级菜单 */
height: 50px;
line-height: 50px;
}
/* 二级菜单字体 */
.el-menu-item {
font-size: 12px;
}
.el-menu-vertical-demo {
/*菜单列表样式*/
padding-bottom: 10px;
}
.el-menu-item.is-active {
/* background-color: #fc7483 !important; */
/* 右边菜单样式 */
/* background-color: linear-gradient(#f78989, #f78989); */
/* background-color: #1873d4; */
/* background: linear-gradient(#1873d4, #51a5ff); */
color: rgb(207, 207, 207) !important;
}
.el-menu-item:focus {
background-color: none !important;
}
.el-menu {
/* 右边菜单样式 */
/* background: linear-gradient(#f78989, #fdb3b3); */
/* background-color: #1873d4; */
background: linear-gradient(#1873d4, #51a5ff);
}
.el-submenu .is-active {
/* 菜单栏选中样式 */
min-width: 64px;
border: none;
/* background: #f0eeef; */
/* background: linear-gradient(#f78989, #a1c5fc); */
background: linear-gradient(#5aa7fa, #116cce) !important;
}
.el-submenu__title:hover,
.el-menu-item:hover {
/* 菜单鼠标覆盖样式 */
/* background: linear-gradient(#f78989, #a1c5fc) !important; */
background: linear-gradient(#5aa7fa, #116cce) !important;
}
html,
body {
/* 主题样式 */
height: 100%;
overflow: auto;
/* background: linear-gradient(#ffffff, #f9f9f9); */
background-color: #5e9af5;
}
.el-header {
/* 头部样式 */
/* background: linear-gradient(#fda1a1, #fd7b7b); */
/* background-color: #1873d4; */
background: linear-gradient(#6cb3ff, #1873d4);
border-top: 2px solid linear-gradient(#f78989, #5e9af5);
width: 100%;
z-index: 98;
padding: 0 !important;
}
/* 面包屑导航样式 */
/* ------------------- */
/* ------------------- */
/* 搜索 */
/* .el-form-item label:after {
content: " ";
display: inline-block;
width: 100%;
}
.el-form-item__label {
text-align: justify
}
.el-form-item.is-required .el-form-item__label:before {
content: none !important;
} */
.el-radio__input.is-checked .el-radio__inner {
border-color: #f78989;
background: #f78989;
}
.el-radio__input.is-checked+.el-radio__label {
color: #f78989;
}
.max-height-60 {
max-height: 60vh;
overflow: auto;
}
.max-height-55 {
max-height: 55vh;
overflow: auto;
}
.max-height-50 {
max-height: 50vh;
overflow: auto;
}
.max-height-45 {
max-height: 45vh;
overflow: auto;
}
.max-height-40 {
max-height: 40vh;
overflow: auto;
}
.max-height-65 {
max-height: 65vh;
overflow: auto;
}
.max-height-35 {
max-height: 35vh;
overflow: auto;
}
/* 主题样式 */
.el-aside {
/* background: #f78989; */
/* background: linear-gradient(#f78989, #d69c9c); */
/* background-color: #1873d4; */
background: linear-gradient(#51a5ff, #1873d4);
/* 随着.el-menu-item background:rgb(247, 137, 137) !important;一起变 */
/* background: rgb(247, 137, 137); */
height: 100%;
font-family: "幼圆";
font-weight: 700;
color: rgb(207, 207, 207) !important;
}
.collapse:hover {
/* 收缩菜单按钮样式 */
/* background: #fc9ca7; */
background-color: linear-gradient(#fc3b3b, #2375f0);
box-shadow: #51a5ff 10px 10px 8px;
}
/* 菜单 */
.el-submenu .el-menu-item {
height: 35px;
line-height: 35px;
}
/* 图标 */
.el-submenu [class^=el-icon-] {
font-size: 16px;
}
/* 一级菜单字体 */
.el-submenu__title span {
font-size: 14px;
}
.el-menu-item,
.el-submenu__title {
/* 一级菜单 */
height: 50px;
line-height: 50px;
}
/* 二级菜单字体 */
.el-menu-item {
font-size: 12px;
}
.el-menu-vertical-demo {
/*菜单列表样式*/
padding-bottom: 10px;
}
.el-menu-item.is-active {
/* background-color: #fc7483 !important; */
/* 右边菜单样式 */
/* background-color: linear-gradient(#f78989, #f78989); */
/* background-color: #1873d4; */
/* background: linear-gradient(#1873d4, #51a5ff); */
color: rgb(207, 207, 207) !important;
}
.el-menu-item:focus {
background-color: none !important;
}
.el-menu {
/* 右边菜单样式 */
/* background: linear-gradient(#f78989, #fdb3b3); */
/* background-color: #1873d4; */
background: linear-gradient(#1873d4, #51a5ff);
}
.el-submenu .is-active {
/* 菜单栏选中样式 */
min-width: 64px;
border: none;
/* background: #f0eeef; */
/* background: linear-gradient(#f78989, #a1c5fc); */
background: linear-gradient(#5aa7fa, #116cce) !important;
}
.el-submenu__title:hover,
.el-menu-item:hover {
/* 菜单鼠标覆盖样式 */
/* background: linear-gradient(#f78989, #a1c5fc) !important; */
background: linear-gradient(#5aa7fa, #116cce) !important;
}
html,
body {
/* 主题样式 */
height: 100%;
overflow: auto;
/* background: linear-gradient(#ffffff, #f9f9f9); */
background-color: #5e9af5;
}
.el-header {
/* 头部样式 */
/* background: linear-gradient(#fda1a1, #fd7b7b); */
/* background-color: #1873d4; */
background: linear-gradient(#6cb3ff, #1873d4);
border-top: 2px solid linear-gradient(#f78989, #5e9af5);
width: 100%;
z-index: 98;
padding: 0 !important;
}
/* 面包屑导航样式 */
/* ------------------- */
/* ------------------- */
/* 搜索 */
/* .el-form-item label:after {
content: " ";
display: inline-block;
width: 100%;
}
.el-form-item__label {
text-align: justify
}
.el-form-item.is-required .el-form-item__label:before {
content: none !important;
} */
/* .el-radio__input.is-checked .el-radio__inner {
border-color: #f78989;
background: #f78989;
}
.el-radio__input.is-checked+.el-radio__label {
color: #f78989;
} */
.max-height-60 {
max-height: 60vh;
overflow: auto;
}
.max-height-55 {
max-height: 55vh;
overflow: auto;
}
.max-height-50 {
max-height: 50vh;
overflow: auto;
}
.max-height-45 {
max-height: 45vh;
overflow: auto;
}
.max-height-40 {
max-height: 40vh;
overflow: auto;
}
.max-height-65 {
max-height: 65vh;
overflow: auto;
}
.max-height-35 {
max-height: 35vh;
overflow: auto;
}

@ -1,72 +1,73 @@
export const phoneNum = /^((1)|(\\+861)|(861))[0-9]{10}$/;
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
// export const http = "https://www.decaisoft.com:443/";
// export const https = "https://www.decaisoft.com:443/img";
export const http = "http://14.18.154.50:5757/img";
export const https = "http://14.18.154.50:5757/img";
var month = "";
if (new Date().getMonth() + 1 < 10) {
month = "0" + (new Date().getMonth() + 1);
} else {
month = new Date().getMonth() + 1;
}
var day = "";
if (new Date().getDate() < 10) {
day = "0" + new Date().getDate();
} else {
day = new Date().getDate();
}
var hours = "";
if (new Date().getHours() < 10) {
hours = "0" + new Date().getHours();
} else {
hours = new Date().getHours();
}
var Min = null;
if (new Date().getMinutes() < 10) {
Min = "0" + new Date().getMinutes();
} else {
Min = new Date().getMinutes();
}
var seconds = null;
if (new Date().getSeconds() < 10) {
seconds = "0" + new Date().getSeconds();
} else {
seconds = new Date().getSeconds();
}
export const date =
new Date().getFullYear() +
"" +
month +
"" +
day +
"" +
hours +
"" +
Min +
"" +
seconds;
export const dates =
new Date().getFullYear() +
"/" +
month +
"/" +
day +
" " +
hours +
":" +
Min +
":" +
seconds;
export const dayStatisticDate =
new Date().getFullYear() + "-" + month + "-" + new Date().getDate();
export const months = new Date().getFullYear() + "-" + month + "";
export const phoneNum = /^((1)|(\\+861)|(861))[0-9]{10}$/;
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
// export const http = "https://www.decaisoft.com:443/";
// export const https = "https://www.decaisoft.com:443/img";
export const http = "http://14.18.154.50:5757/img";
export const https = "http://14.18.154.50:5757/img";
export const imagePath = "https://139.9.185.131:8093/img"
var month = "";
if (new Date().getMonth() + 1 < 10) {
month = "0" + (new Date().getMonth() + 1);
} else {
month = new Date().getMonth() + 1;
}
var day = "";
if (new Date().getDate() < 10) {
day = "0" + new Date().getDate();
} else {
day = new Date().getDate();
}
var hours = "";
if (new Date().getHours() < 10) {
hours = "0" + new Date().getHours();
} else {
hours = new Date().getHours();
}
var Min = null;
if (new Date().getMinutes() < 10) {
Min = "0" + new Date().getMinutes();
} else {
Min = new Date().getMinutes();
}
var seconds = null;
if (new Date().getSeconds() < 10) {
seconds = "0" + new Date().getSeconds();
} else {
seconds = new Date().getSeconds();
}
export const date =
new Date().getFullYear() +
"" +
month +
"" +
day +
"" +
hours +
"" +
Min +
"" +
seconds;
export const dates =
new Date().getFullYear() +
"/" +
month +
"/" +
day +
" " +
hours +
":" +
Min +
":" +
seconds;
export const dayStatisticDate =
new Date().getFullYear() + "-" + month + "-" + new Date().getDate();
export const months = new Date().getFullYear() + "-" + month + "";

@ -12,6 +12,6 @@ function setRem() {
// 初始化
setRem();
// 改变窗口大小时重新设置 rem
window.onresize = function() {
window.onresize = function () {
setRem();
};

Loading…
Cancel
Save