Commit 43181b6e authored by xd's avatar xd

修改添加优惠券样式

parent c12a2b4f
......@@ -77,9 +77,9 @@
</div>
</template>
</van-cell>
<van-cell title="金额" style="font-size:14px;">
<van-cell title="金额" style="font-size:14px;" class="js">
<template slot="default">
<van-stepper v-model="addForm.unit" step="1"/>
<van-stepper v-model="addForm.unit" step="1" :show-plus="false" :show-minus="false" />
</template>
</van-cell>
<van-cell title="开始时间" style="font-size:14px;">
......@@ -157,8 +157,8 @@
</div>
</template>
</van-cell>
<van-cell title="总限制次数" style="font-size:14px;">
<van-stepper v-model="addForm.limitOfUse" step="1"/>
<van-cell title="总限制次数" style="font-size:14px;" class="js">
<van-stepper v-model="addForm.limitOfUse" step="1" :show-plus="false" :show-minus="false" />
</van-cell>
<van-cell title="总限制提示" style="font-size:14px;">
<template slot="default">
......@@ -170,17 +170,17 @@
/>
</template>
</van-cell>
<van-cell title="编码券使用上限(次)" style="font-size:14px;">
<van-stepper v-model="addForm.usageMax" step="1"/>
<van-cell title="编码券使用上限(次)" style="font-size:14px;" class="js" >
<van-stepper v-model="addForm.usageMax" step="1" :show-plus="false" :show-minus="false" />
</van-cell>
</van-cell-group>
<div class="title">编码券使用规则明细</div>
<van-cell-group class="all">
<van-cell title="销售金额" style="font-size:14px;" >
<van-stepper v-model="addForm.salesAmount" step="1" :min="addForm.usageAmount"/>
<van-cell title="销售金额" style="font-size:14px;" class="js">
<van-stepper v-model="addForm.salesAmount" step="1" :min="addForm.usageAmount" :show-plus="false" :show-minus="false" />
</van-cell>
<van-cell title="用券金额" style="font-size:14px;">
<van-stepper v-model="addForm.usageAmount" step="1"/>
<van-cell title="用券金额" style="font-size:14px;" class="js">
<van-stepper v-model="addForm.usageAmount" step="1" :show-plus="false" :show-minus="false" />
</van-cell>
</van-cell-group>
</div>
......@@ -368,6 +368,13 @@ export default {
<style></style>
<style scoped>
.js >>> .van-stepper {
text-align: right;
}
.js >>> .van-stepper__input {
text-align: center;
width: 60%;
}
.condition {
display: flex;
justify-content: flex-end;
......
......@@ -70,7 +70,7 @@
if (sessionStorage.getItem("userId")) {
this.zcache.userId = sessionStorage.getItem("userId")
}else{
this.zReadyUserId();
// this.zReadyUserId();
this.zTestGetNowUrlInfo();
}
......
......@@ -103,43 +103,23 @@ export default {
// 获取店铺数据
zReadyGetUserFromId() {
let postData = {
// userName: this.zcache.userId
userName: 'ShanDian'
userName: this.zcache.userId
// userName: 'ShanDian'
}
getUserInfoByUserId(postData)
.then(res => {
if(res.data.length == 0) {
alert('您当前没有绑定店铺')
}else {
// this.zcache.storeId = res.data[0].oyStallCode
// let list = []
// res.data.forEach(item => {
// this.getVoucherList(item.oyStallCode).then(res => {
// console.log(res,'优惠券数据')
// this.zlist.voucher.push(...res)
// console.log(this.zlist.voucher,'this.zlist.voucher')
// })
// console.log(this.zlist.voucher,'111')
// })
let arr = res.data.map( item => {
return this.getVoucherList(item.oyStallCode)
})
console.log();
let promiseAll = Promise.all([
res.data.map( item => {
let obj = this.getVoucherList(item.oyStallCode)
return obj
this.zcache.storeId = res.data[0].oyStallCode
res.data.forEach(item => {
this.getVoucherList(item.oyStallCode).then(res => {
console.log(res,'优惠券数据')
this.zlist.voucher.push(...res)
console.log(this.zlist.voucher,'this.zlist.voucher')
})
])
console.log(promiseAll,'promiseAll')
promiseAll.then(res =>{
console.log(res,'sss')
})
console.log(this.zlist.voucher,'111')
})
}
})
.catch(err => {})
......@@ -159,27 +139,27 @@ export default {
// })
// .catch(err => {
// })
// },
getVoucherList(mdid) {
const postData = {
appCode: "0696", // j接口编码
mdid: mdid
}
return new Promise(function(resolve, reject) {
getVoucherList(postData).then(res => {
if(res.errCode == 0) {
if(res.result.coupons.length != 0) {
resolve(res.result.coupons)
}
}
})
.catch(err => {
reject(err)
})
})
},
getVoucherList(mdid) {
const postData = {
appCode: "0696", // j接口编码
mdid: mdid
}
return new Promise(function(resolve, reject) {
getVoucherList(postData).then(res => {
if(res.errCode == 0) {
if(res.result.coupons.length != 0) {
resolve(res.result.coupons)
}
}
})
.catch(err => {
reject(err)
})
})
},
// 推送链接
handlePush(link) {
wx.invoke(
......
......@@ -103,23 +103,49 @@ export default {
// 获取店铺数据
zReadyGetUserFromId() {
let postData = {
userName: this.zcache.userId
// userName: 'ShanDian'
// userName: this.zcache.userId
userName: 'ShanDian'
}
getUserInfoByUserId(postData)
.then(res => {
if(res.data.length == 0) {
alert('您当前没有绑定店铺')
}else {
this.zcache.storeId = res.data[0].oyStallCode
res.data.forEach(item => {
this.getVoucherList(item.oyStallCode).then(res => {
console.log(res,'优惠券数据')
this.zlist.voucher.push(...res)
console.log(this.zlist.voucher,'this.zlist.voucher')
})
console.log(this.zlist.voucher,'111')
})
// this.zcache.storeId = res.data[0].oyStallCode
// let list = []
// res.data.forEach(item => {
// this.getVoucherList(item.oyStallCode).then(res => {
// console.log(res,'优惠券数据')
// this.zlist.voucher.push(...res)
// console.log(this.zlist.voucher,'this.zlist.voucher')
// })
// console.log(this.zlist.voucher,'111')
// })
let list = []
res.data.forEach(item => {
let obj = this.getVoucherList(item.oyStallCode)
list.push(obj)
})
console.log(list,'list');
let promiseAll = Promise.all([
...list
// res.data.map(item => {
// console.log(item,'item');
// let obj = this.getVoucherList(item.oyStallCode)
// console.log(obj,'obj');
// return obj
// })
])
console.log(promiseAll,'promiseAll')
// promiseAll.then(res =>{
// console.log(res,'sss')
// })
}
})
.catch(err => {})
......@@ -139,27 +165,31 @@ export default {
// })
// .catch(err => {
// })
// },
getVoucherList(mdid) {
const postData = {
appCode: "0696", // j接口编码
mdid: mdid
}
return new Promise(function(resolve, reject) {
getVoucherList(postData).then(res => {
if(res.errCode == 0) {
if(res.result.coupons.length != 0) {
resolve(res.result.coupons)
}
}
})
.catch(err => {
reject(err)
})
})
},
getVoucherList(mdid) {
const postData = {
appCode: "0696", // j接口编码
mdid: mdid
}
return new Promise(function(resolve, reject) {
getVoucherList(postData).then(res => {
if(res.errCode == 0) {
if(res.result.coupons.length != 0) {
resolve(res.result.coupons)
}else {
resolve(res.result)
}
}else {
resolve('')
}
})
.catch(err => {
reject(err)
})
})
},
// 推送链接
handlePush(link) {
wx.invoke(
......
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