Commit b6e580da authored by xd's avatar xd

优惠券页面差优惠券类型

parent f1631122
...@@ -166,6 +166,21 @@ const routes = [ ...@@ -166,6 +166,21 @@ const routes = [
path: '/noSet', path: '/noSet',
name: 'noSet', name: 'noSet',
component: () => import('@/views/counter/noSet') component: () => import('@/views/counter/noSet')
},
{
path: '/coupon',
name: 'coupon',
component: () => import('@/views/coupon/list')
},
{
path: '/couponAdd',
name: 'couponAdd',
component: () => import('@/views/coupon/addCoupon')
},
{
path: '/yhqDetail',
name: 'yhqDetail',
component: () => import('@/views/coupon/detail')
}, },
...mineRoute ...mineRoute
// { // {
......
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
mounted() { mounted() {
this.addForm.oyStallCode = sessionStorage.getItem("oyStallCode"); this.addForm.oyStallCode = sessionStorage.getItem("oyStallCode");
console.log(this.addForm.oyStallCode, "编辑专柜信息oyStallCode"); console.log(this.addForm.oyStallCode, "编辑专柜信息oyStallCode");
this.getDetail(); this.getDetail()
}, },
methods: { methods: {
getDetail() { getDetail() {
......
<template>
<div class="container">
<div>
<div class="title bTitle">优惠券配置</div>
<van-cell-group class="all">
<van-cell title="优惠券名称" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.name"
placeholder="请输入优惠券名称"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
<van-cell title="优惠券类型" style="font-size:14px;">
<template slot="default">
<div class="npbr">
<van-field
class="right"
v-model="startTime1"
placeholder="选择优惠券类型"
readonly="readonly"
@click="startShow = true"
/>
<van-popup v-model="startShow" position="bottom" :overlay="true">
<van-datetime-picker
v-model="startTime"
type="date"
@cancel="startShow = false"
@confirm="handleStartTime"
@change="startTimeChange"
/>
</van-popup>
</div>
</template>
</van-cell>
<van-cell title="金额" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.unit"
placeholder="请输入金额"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
<van-cell title="开始时间" style="font-size:14px;">
<template slot="default">
<div class="npbr">
<van-field
class="right"
v-model="addForm.startTime"
placeholder="选择开始时间"
readonly="readonly"
@click="startShow = true"
/>
<van-popup v-model="startShow" position="bottom" :overlay="true">
<van-datetime-picker
v-model="startTime"
type="date"
@cancel="startShow = false"
@confirm="handleStartTime"
@change="startTimeChange"
/>
</van-popup>
</div>
</template>
</van-cell>
<van-cell title="结束时间" style="font-size:14px;">
<template slot="default">
<div class="npbr">
<van-field
class="right"
v-model="addForm.endDate"
placeholder="选择结束时间"
readonly="readonly"
@click="endShow = true"
/>
<van-popup v-model="endShow" position="bottom" :overlay="true">
<van-datetime-picker
v-model="endTime"
type="date"
@cancel="endShow = false"
@confirm="handleEndTime"
@change="endTimeChange"
/>
</van-popup>
</div>
</template>
</van-cell>
<van-cell title="使用说明" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.instruction"
placeholder="请输入使用说明"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
<van-cell title="优惠券Id" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.couponId"
placeholder="请输入优惠券Id"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
<van-cell title="总限制次数" style="font-size:14px;">
<template slot="default">
<div class="npbr">
<van-field
class="right noborder"
readonly
clickable
:value="addForm.limitOfUse"
placeholder="请输入总限制次数"
@touchstart.native.stop="show = true"
/>
<van-number-keyboard
v-model="addForm.limitOfUse"
:show="show"
:maxlength="6"
@blur="show = false"
/>
</div>
</template>
</van-cell>
<van-cell title="总限制提示" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.remind"
placeholder="请输入使用说明"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
<van-cell title="编码券使用上限(次)" style="font-size:14px;">
<template slot="default">
<div class="npbr">
<van-field
class="right noborder"
readonly
clickable
:value="addForm.usageMax"
placeholder="请输入编码券使用上限"
@touchstart.native.stop="show = true"
/>
<van-number-keyboard
v-model="addForm.usageMax "
:show="show"
:maxlength="6"
@blur="show = false"
/>
</div>
</template>
</van-cell>
</van-cell-group>
<div class="title">编码券使用规则明细</div>
<van-cell-group class="all">
<van-cell title="销售金额" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.salesAmount"
placeholder="请输入销售金额"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
<van-cell title="用券金额" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.usageMax"
placeholder="请输入用券金额"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
</van-cell-group>
</div>
<div class="creat">
<div class="btn-l" @click="handleCancel">取消</div>
<div class="btn-y" @click="handleSave">保存</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
show: false,
show2: false,
startTime: new Date(),
startTime1: "",
endTime: new Date(),
endTime1: "",
startShow: false,
endShow: false,
//
addForm: {
name: "",
endDate: '',
startDate: '',
type: '',
unit: '',
instruction: '',
limitOfUse: '',
couponId: '',
remind: '',
usageMax: '',
salesAmount: '',
usageMax: ''
}
};
},
methods: {
timeFormat(time) {
let year = 1900 + time.getYear();
let month = "0" + (time.getMonth() + 1);
let date = "0" + time.getDate();
return (
year +
"-" +
month.substring(month.length - 2, month.length) +
"-" +
date.substring(date.length - 2, date.length) +
" "
);
},
startTimeChange(e) {
let startTimeArr = e.getValues();
this.addForm.startTime = `${startTimeArr[0]}-${startTimeArr[1]}-${startTimeArr[2]}`;
},
handleStartTime(value) {
this.addForm.startTime = this.timeFormat(value);
this.startShow = false;
},
handleEndTime(value) {
this.addForm.endDate = this.timeFormat(value);
this.endShow = false;
},
endTimeChange(e) {
let endTimeArr = e.getValues();
this.addForm.endDate = `${endTimeArr[0]}-${endTimeArr[1]}-${endTimeArr[2]}`;
},
handleCancel() {
this.$router.push('coupon')
},
handleSave() {
}
},
mounted() {}
};
</script>
<style></style>
<style scoped>
.condition {
display: flex;
justify-content: flex-end;
align-items: center;
}
.phone {
margin-right: 10px;
}
.all >>> input {
text-align: right;
}
.noborder >>> .van-cell:not(:last-child)::after {
display: none !important;
}
.npbr .van-cell:not(:last-child)::after {
display: none !important;
}
.creat {
width: 96%;
display: flex;
height: 40px;
background: rgba(117, 178, 253, 1);
align-items: center;
font-size: 16px;
font-weight: bold;
color: #fff;
}
.btn-l,.btn-y {
display: flex;
align-items: center;
height: 100%;
width: 50%;
justify-content: center;
}
.btn-l {
background-color: #fff;
color: #000;
}
.container {
height: auto;
display: flex;
justify-content: space-between;
flex-direction: column;
background: rgba(248, 248, 248, 1);
min-height: 100%;
}
.area >>> .van-field__control {
background: #f8f8f8;
padding: 12px;
}
.des {
padding: 5px 18px 0px;
font-size: 14px;
color: #2d476a;
}
.title {
background-color: #f8f8f8;
height: 36px;
line-height: 36px;
font-size: 12px;
padding-left: 16px;
color: #2d476a;
}
[data-v-08d4afe1] .van-cell {
height: 100%;
font-size: 14px;
}
.right {
padding: 0;
}
.van-cell__title {
color: #2d476a !important;
}
.bTitle {
height: 60px;
font-size: 18px;
line-height: 60px;
}
</style>
<template>
<div class="contain">
<div class="box">
<div class="yhq">
<div class="left">
<div class="price">¥{{ form.unit }}</div>
</div>
<div class="right">
<div>{{ form.usageAmount }}元可用</div>
<div>
<div>有效期:</div>
<div>
<span>{{ form.beginDate }}</span>~
<span>{{ form.endDate }}</span>
</div>
</div>
<div>全店通用</div>
</div>
<i></i>
</div>
<div class="txt">{{ form.type }}</div>
<div class="txt">此优惠券仅限于 <span>{{ form.store }}</span> 使用</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
form: {
store: 'only',
unit: '100',
type: '老用户回馈券',
usageAmount: '500',
beginDate: '2020/2/3',
endDate: '2020/4/5'
}
}
}
}
</script>
<style scoped>
.contain {
background-color: rgb(237, 239, 243);
height: 100%;
justify-content: center;
}
.box {
margin-top: 18px;
height: 50%;
background-color: #fff;
width: 90%;
padding: 50px 20px;
}
.yhq {
background-color: #F39B00;
height: 60%;
display: flex;
padding: 20px;
align-items: center;
margin-bottom: 38px;
}
.yhq:before {
content: '';
position: absolute;
top:0;
bottom:0;
left:10px;
right:10px;
z-index: -1;
}
.yhq i {
position: absolute;
left: 20%;
top: 45px;
height: 190px;
width: 390px;
background-color: rgba(255, 255, 255, .15);
transform: rotate(-30deg);
}
.left,.right {
font-size: 16px;
color:rgb(255,255,255);
}
.txt {
font-size: 18px;
text-align: center;
margin-top: 14px;
}
.left {
display: flex;
align-items: center;
width: 35%;
height: 100%;
border-right: 1px dashed #f0f0f0;
}
.price {
font-size: 32px;
font-weight: 800;
}
.right {
width: 65%;
height: 100%;
padding: 10px 0 10px 10px;
}
</style>
\ No newline at end of file
<template>
<div class="contain">
<div class="box" @click="handleCoupon">
<div class="left">
<div class="price">¥{{ form.unit }}</div>
<div class="type">{{ form.type }}</div>
</div>
<div class="right">
<div>{{ form.usageAmount }}元可用</div>
<div class="time">
<div>有效期:</div>
<span>{{ form.beginDate }}</span>~
<span>{{ form.endDate }}</span>
</div>
</div>
</div>
<div class="btn-plus" @click="handleAddCoupon"><span>+</span></div>
</div>
</template>
<script>
export default {
data() {
return {
form: {
unit: '100',
type: '老用户回馈券',
usageAmount: '500',
beginDate: '2020/2/3',
endDate: '2020/4/5'
}
}
},
methods: {
handleCoupon() {
this.$router.push("yhqDetail")
},
handleAddCoupon() {
this.$router.push("couponAdd")
}
}
}
</script>
<style scoped>
.contain {
background-color: rgb(237, 239, 243);
height: 100%;
}
.left,.right {
font-size: 16px;
}
.box {
display: flex;
align-items: center;
width: 100%;
padding: 20px;
height: 22%;
background-color: #fff;
border: 1px solid #777;
margin-top: 18px;
}
.left {
width: 35%;
}
.price {
font-size: 32px;
font-weight: 800;
}
.right {
width: 65%;
padding: 10px 0 0 10px;
}
.type {
margin-top: 17px;
}
.time {
margin-top: 20px;
}
.btn-plus {
position: fixed;
right: 30px;
bottom: 30px;
font-size: 40px;
font-weight: bold;
width: 50px;
height: 50px;
border: 2px solid #ccc;
border-radius: 50%;
text-align: center;
color: green;
line-height: 1;
}
</style>
\ No newline at end of file
...@@ -24,10 +24,6 @@ ...@@ -24,10 +24,6 @@
</div> </div>
<div class="main-menus"> <div class="main-menus">
<div class="menus-row"> <div class="menus-row">
<!-- <div class="menu">
<img class="menu-logo" :src="test.menuInfo.icon['1']" />
<div class="menu-text">优惠券核销</div>
</div>-->
<div class="menu" @click="menu02Click"> <div class="menu" @click="menu02Click">
<img class="menu-logo" :src="test.menuInfo.icon['2']" /> <img class="menu-logo" :src="test.menuInfo.icon['2']" />
<div class="menu-text">任务列表</div> <div class="menu-text">任务列表</div>
...@@ -50,7 +46,10 @@ ...@@ -50,7 +46,10 @@
<img class="menu-logo" :src="test.menuInfo.icon['6']" /> <img class="menu-logo" :src="test.menuInfo.icon['6']" />
<div class="menu-text">商品管理</div> <div class="menu-text">商品管理</div>
</div> </div>
<div class="menu"></div> <div class="menu" @click="handleCoupon">
<img class="menu-logo" :src="test.menuInfo.icon['1']" />
<div class="menu-text">优惠券管理</div>
</div>
</div> </div>
</div> </div>
<div class="main-actives"> <div class="main-actives">
...@@ -234,7 +233,7 @@ export default { ...@@ -234,7 +233,7 @@ export default {
this.test.barInfo.allNewFans = sessionStorage.getItem('allNewFans') this.test.barInfo.allNewFans = sessionStorage.getItem('allNewFans')
} }
}else { }else {
this.zReadyUserId() // this.zReadyUserId()
this.zTestGetNowUrlInfo() this.zTestGetNowUrlInfo()
} }
}, },
...@@ -396,6 +395,9 @@ export default { ...@@ -396,6 +395,9 @@ export default {
menu06Click() { menu06Click() {
this.$router.push("goodManage") this.$router.push("goodManage")
}, },
handleCoupon() {
this.$router.push("coupon")
},
buttonMainMarketingClick() { buttonMainMarketingClick() {
// this.$router.push("home") // this.$router.push("home")
}, },
...@@ -528,9 +530,7 @@ export default { ...@@ -528,9 +530,7 @@ export default {
width: 100%; width: 100%;
height: 72px; height: 72px;
background-color: #4377bc; background-color: #4377bc;
padding: 0px 16px; padding: 0px 16px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
......
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