Commit 43181b6e authored by xd's avatar xd

修改添加优惠券样式

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