Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xulili
ybf
Commits
43181b6e
Commit
43181b6e
authored
Apr 18, 2020
by
xd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改添加优惠券样式
parent
c12a2b4f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
92 deletions
+109
-92
addCoupon.vue
wx_application/src/views/coupon/addCoupon.vue
+17
-10
home.vue
ybf_wx/src/views/home.vue
+1
-1
index 1.vue
ybf_wx/src/views/sideNav/discount/index 1.vue
+30
-50
index.vue
ybf_wx/src/views/sideNav/discount/index.vue
+61
-31
No files found.
wx_application/src/views/coupon/addCoupon.vue
View file @
43181b6e
...
...
@@ -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
;
...
...
ybf_wx/src/views/home.vue
View file @
43181b6e
...
...
@@ -70,7 +70,7 @@
if
(
sessionStorage
.
getItem
(
"userId"
))
{
this
.
zcache
.
userId
=
sessionStorage
.
getItem
(
"userId"
)
}
else
{
this
.
zReadyUserId
();
//
this.zReadyUserId();
this
.
zTestGetNowUrlInfo
();
}
...
...
ybf_wx/src/views/sideNav/discount/index
copy
.vue
→
ybf_wx/src/views/sideNav/discount/index
1
.vue
View file @
43181b6e
...
...
@@ -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
(
...
...
ybf_wx/src/views/sideNav/discount/index.vue
View file @
43181b6e
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment