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
58f5213c
Commit
58f5213c
authored
Apr 17, 2020
by
xd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券修改,侧边栏发券成功跳转小程序
parent
766f1d3d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
455 additions
and
354 deletions
+455
-354
changeCounter.vue
wx_application/src/views/counter/changeCounter.vue
+168
-12
counterInfo.vue
wx_application/src/views/counter/counterInfo.vue
+1
-1
addCoupon.vue
wx_application/src/views/coupon/addCoupon.vue
+41
-98
index.vue
wx_application/src/views/mainSale/active/main/index.vue
+50
-60
addGroup.vue
ybf_admin/src/pages/in/contact/components/addGroup.vue
+2
-1
editGroup.vue
ybf_admin/src/pages/in/contact/components/editGroup.vue
+2
-1
index.html
ybf_wx/public/qrCode/index.html
+0
-1
index cop.vue
ybf_wx/src/views/sideNav/discount/index cop.vue
+129
-155
index.vue
ybf_wx/src/views/sideNav/discount/index.vue
+62
-25
No files found.
wx_application/src/views/counter/changeCounter.vue
View file @
58f5213c
<
template
>
<div
class=
"container"
>
<van-loading
size=
"80px"
color=
"#1989fa"
class=
"ld"
v-if=
"overlayShow"
>
正在处理...
</van-loading>
<van-overlay
:show=
"overlayShow"
/>
<van-radio-group
v-model=
"radio"
class=
"nobr"
@
change=
"handleStoreChange"
>
<van-cell-group
>
<van-cell
v-for=
"(item,index) in list"
:key=
"index"
>
...
...
@@ -20,27 +22,32 @@
</
template
>
<
script
>
import
{
getStoreList
}
from
"@/api/sidebar/voucher"
import
{
getStoreList
,
getMemberListByCode
}
from
"@/api/sidebar/voucher"
import
axios
from
"axios"
;
import
{
log
}
from
'util'
;
export
default
{
data
()
{
return
{
radio
:
''
,
userId
:
''
,
list
:
[]
list
:
[],
overlayShow
:
false
,
oyStallCode
:
''
}
},
created
()
{
this
.
radio
=
sessionStorage
.
getItem
(
'oyStallCode'
)
this
.
getList
()
},
methods
:
{
getList
()
{
if
(
this
.
$route
.
query
.
userId
!==
''
)
{
this
.
userId
=
this
.
$route
.
query
.
userId
}
else
{
this
.
userId
=
sessionStorage
.
getItem
(
'userId'
)
}
this
.
radio
=
sessionStorage
.
getItem
(
'oyStallCode'
)
// this.radio = 111
this
.
getList
()
// this.userId = '10000190'
},
methods
:
{
getList
()
{
let
params
=
{
user_id
:
this
.
userId
}
...
...
@@ -49,20 +56,169 @@ export default {
this
.
list
=
res
.
data
})
},
///
// 获取店铺的所有店员
getAllNewFans
(
oyStallCode
)
{
let
params
=
{
oyStallCode
:
oyStallCode
}
getMemberListByCode
(
params
).
then
(
res
=>
{
this
.
getAllInfo
(
res
.
data
)
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
},
// 获取个人粉丝
getFans
()
{
let
headerData
=
{
agentId
:
"1000033"
,
corpId
:
"ww4df265003b43fa0d"
}
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId="
+
this
.
userId
,
method
:
"get"
,
headers
:
headerData
})
.
then
(
res
=>
{
if
(
res
.
data
.
data
!=
null
)
{
sessionStorage
.
setItem
(
"personalFan"
,
res
.
data
.
data
.
length
)
resolve
(
res
.
data
.
data
.
length
)
}
else
{
console
.
log
(
'zheli'
);
if
(
res
.
errorCode
==
"84061"
)
{
sessionStorage
.
setItem
(
"personalFan"
,
0
)
resolve
(
0
)
}
else
{
sessionStorage
.
setItem
(
"personalFan"
,
''
)
resolve
(
''
)
}
}
})
.
catch
(
err
=>
{
reject
(
err
)
})
})
},
// 获取店铺所有粉丝
getAllFans
()
{
let
headerData
=
{
agentId
:
"1000033"
,
corpId
:
"ww4df265003b43fa0d"
}
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/contact/getCustomerInfoByOyStallCode?oyStallCode="
+
this
.
oyStallCode
,
method
:
"get"
,
headers
:
headerData
})
.
then
(
res
=>
{
let
newList
=
[]
res
.
data
.
data
.
forEach
(
item
=>
{
if
(
item
!=
null
)
{
newList
.
push
(
item
)
}
})
sessionStorage
.
setItem
(
"allFans"
,
newList
.
length
)
resolve
(
newList
.
length
)
})
.
catch
(
err
=>
{
reject
(
err
)
})
})
},
getAddFans
(
flag
,
userId
)
{
let
JsonStr
=
{}
if
(
flag
==
1
)
{
JsonStr
.
userid
=
[
userId
];
}
else
{
JsonStr
.
userid
=
userId
}
let
timeNow
=
Math
.
round
(
new
Date
()
/
1000
);
JsonStr
.
start_time
=
timeNow
-
24
*
60
*
60
;
JsonStr
.
end_time
=
timeNow
;
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/contact/getUserBehaviorData"
,
method
:
"post"
,
headers
:
{
"Content-Type"
:
"application/json"
,
agentId
:
"1000033"
,
corpId
:
"ww4df265003b43fa0d"
},
data
:
JsonStr
}).
then
(
res
=>
{
let
data
=
JSON
.
parse
(
res
.
data
.
data
);
if
(
flag
==
1
)
{
// 获取个人新增粉丝
console
.
log
(
data
,
'个人新增粉丝'
)
if
(
data
!=
null
)
{
let
newFans
=
data
.
behavior_data
[
0
].
new_contact_cnt
+
data
.
behavior_data
[
1
].
new_contact_cnt
;
sessionStorage
.
setItem
(
"newFans"
,
newFans
)
resolve
(
newFans
)
}
else
{
sessionStorage
.
setItem
(
"newFans"
,
''
)
resolve
(
''
)
}
}
else
{
console
.
log
(
data
,
'全部新增粉丝'
);
if
(
data
!=
null
)
{
let
allNewFans
=
data
.
behavior_data
[
0
].
new_contact_cnt
+
data
.
behavior_data
[
1
].
new_contact_cnt
;
sessionStorage
.
setItem
(
"allNewFans"
,
allNewFans
);
resolve
(
allNewFans
)
}
else
{
sessionStorage
.
setItem
(
"allNewFans"
,
''
)
resolve
(
''
)
}
}
})
.
catch
(
err
=>
{
reject
(
err
)
})
})
},
getAllInfo
(
list
)
{
console
.
log
(
'getAllInfo'
);
Promise
.
all
([
this
.
getFans
(),
this
.
getAllFans
(),
this
.
getAddFans
(
1
,
this
.
userId
),
this
.
getAddFans
(
2
,
list
)]).
then
(
res
=>
{
console
.
log
(
'进来了'
);
console
.
log
(
res
,
'promise修改'
);
this
.
overlayShow
=
false
this
.
$toast
(
"切换成功"
)
})
},
///
handleStoreChange
(
val
)
{
this
.
overlayShow
=
true
console
.
log
(
val
,
'修改后的oyStallCode'
)
this
.
oyStallCode
=
val
sessionStorage
.
setItem
(
'oyStallCode'
,
val
)
let
obj
=
this
.
list
.
find
(
function
(
obj
)
{
return
obj
.
oyStallCode
==
val
})
console
.
log
(
obj
,
'obj'
)
sessionStorage
.
setItem
(
"barName"
,
obj
.
name
)
this
.
getAllNewFans
(
val
)
}
}
}
</
script
>
<
style
scoped
>
.ld
>>>
.van-loading__text
{
color
:
#fff
;
}
.ld
{
z-index
:
1000
;
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
}
.container
{
height
:
auto
;
background-color
:
#fff
;
...
...
wx_application/src/views/counter/counterInfo.vue
View file @
58f5213c
...
...
@@ -94,7 +94,7 @@ export default {
},
handlePushInfo
()
{
if
(
this
.
info
==
1
)
{
this
.
$router
.
push
(
'
pushStoreInfo
'
)
this
.
$router
.
push
(
'
noSet
'
)
}
else
{
let
url
=
`http://oysales.oywanhao.com:8087/counterPageHome?oyStallCode=
${
this
.
oyStallCode
}
`
wx
.
invoke
(
"shareToExternalContact"
,
{
...
...
wx_application/src/views/coupon/addCoupon.vue
View file @
58f5213c
...
...
@@ -5,12 +5,21 @@
<van-cell-group
class=
"all"
>
<van-cell
title=
"欧亚活动编码"
style=
"font-size:14px;"
>
<template
slot=
"default"
>
<div
class=
"npbr"
>
<van-field
v-model
=
"addForm.cxcode"
:value
=
"addForm.cxcode"
placeholder=
"请输入欧亚活动编码"
class=
"right"
readonly
style=
"font-size:14px;"
@
touchstart
.
native
.
stop=
"codeShow = true"
/>
<van-number-keyboard
v-model=
"addForm.cxcode"
:show=
"codeShow"
@
blur=
"codeShow = false"
/>
</div>
</
template
>
</van-cell>
<van-cell
title=
"商户类型"
style=
"font-size:14px;"
>
...
...
@@ -70,21 +79,7 @@
</van-cell>
<van-cell
title=
"金额"
style=
"font-size:14px;"
>
<
template
slot=
"default"
>
<div
class=
"npbr"
>
<van-field
class=
"right noborder"
readonly
clickable
:value=
"addForm.unit"
placeholder=
"请输入金额"
@
touchstart
.
native
.
stop=
"unitShow = true"
/>
<van-number-keyboard
v-model=
"addForm.unit "
:show=
"unitShow"
@
blur=
"unitShow = false"
/>
</div>
<van-stepper
v-model=
"addForm.unit"
step=
"1"
/>
</
template
>
</van-cell>
<van-cell
title=
"开始时间"
style=
"font-size:14px;"
>
...
...
@@ -101,6 +96,7 @@
<van-datetime-picker
v-model=
"startTime"
type=
"date"
:min-date=
"minStartDate"
@
cancel=
"startShow = false"
@
confirm=
"handleStartTime"
@
change=
"startTimeChange"
...
...
@@ -123,6 +119,7 @@
<van-datetime-picker
v-model=
"endTime"
type=
"date"
:min-date=
"minEndDate"
@
cancel=
"endShow = false"
@
confirm=
"handleEndTime"
@
change=
"endTimeChange"
...
...
@@ -141,36 +138,28 @@
/>
</
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;"
>
<van-cell
title=
"优惠券ID"
style=
"font-size:14px;"
>
<
template
slot=
"default"
>
<div
class=
"npbr"
>
<van-field
class=
"right noborder"
readonly
clickable
:value=
"addForm.
limitOfUse
"
placeholder=
"请输入
总限制次数
"
@
touchstart
.
native
.
stop=
"
allLim
itShow = true"
:value=
"addForm.
couponId
"
placeholder=
"请输入
优惠券ID
"
@
touchstart
.
native
.
stop=
"
un
itShow = true"
/>
<van-number-keyboard
v-model=
"addForm.limitOfUse"
:show=
"allLimitShow"
:maxlength=
"6"
@
blur=
" allLimitShow = false"
v-model=
"addForm.couponId "
:show=
"unitShow"
@
blur=
"unitShow = false"
/>
</div>
</
template
>
</van-cell>
<van-cell
title=
"总限制次数"
style=
"font-size:14px;"
>
<van-stepper
v-model=
"addForm.limitOfUse"
step=
"1"
/>
</van-cell>
<van-cell
title=
"总限制提示"
style=
"font-size:14px;"
>
<
template
slot=
"default"
>
<van-field
...
...
@@ -182,66 +171,16 @@
</
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-stepper
v-model=
"addForm.usageMax"
step=
"1"
/>
</van-cell>
</van-cell-group>
<div
class=
"title"
>
编码券使用规则明细
</div>
<van-cell-group
class=
"all"
>
<van-cell
title=
"销售金额"
style=
"font-size:14px;"
>
<
template
slot=
"default"
>
<div
class=
"npbr"
>
<van-field
class=
"right noborder"
readonly
clickable
:value=
"addForm.salesAmount"
placeholder=
"请输入销售金额"
@
touchstart
.
native
.
stop=
"salesAmountShow = true"
/>
<van-number-keyboard
v-model=
"addForm.salesAmount "
:show=
"salesAmountShow"
@
blur=
"salesAmountShow = false"
/>
</div>
</
template
>
<van-cell
title=
"销售金额"
style=
"font-size:14px;"
>
<van-stepper
v-model=
"addForm.salesAmount"
step=
"1"
:min=
"addForm.usageAmount"
/>
</van-cell>
<van-cell
title=
"用券金额"
style=
"font-size:14px;"
>
<
template
slot=
"default"
>
<div
class=
"npbr"
>
<van-field
:value=
"addForm.usageAmount"
placeholder=
"请输入用券金额"
class=
"right"
style=
"font-size:14px;"
readonly
@
touchstart
.
native
.
stop=
"usageAmountShow = true"
/>
<van-number-keyboard
v-model=
"addForm.usageAmount"
:show=
"usageAmountShow"
:maxlength=
"6"
@
blur=
"usageAmountShow = false"
/>
</div>
</
template
>
<van-stepper
v-model=
"addForm.usageAmount"
step=
"1"
/>
</van-cell>
</van-cell-group>
</div>
...
...
@@ -258,6 +197,8 @@ import { addCoupon } from "@/api/sidebar/voucher"
export
default
{
data
()
{
return
{
minStartDate
:
null
,
minEndDate
:
null
,
allLimitShow
:
false
,
show
:
false
,
show2
:
false
,
...
...
@@ -275,6 +216,7 @@ export default {
endDate
:
''
,
cxsh
:
''
,
cxshShow
:
false
,
codeShow
:
false
,
//
addForm
:
{
cxcode
:
''
,
...
...
@@ -291,7 +233,6 @@ export default {
usageMax
:
''
,
salesAmount
:
''
,
usageAmount
:
''
,
usageMax
:
''
,
deptId
:
''
,
cxcode
:
''
},
...
...
@@ -304,7 +245,9 @@ export default {
};
},
mounted
()
{
this
.
addForm
.
deptId
=
Number
(
sessionStorage
.
getItem
(
"oyStallCode"
))
this
.
addForm
.
deptId
=
sessionStorage
.
getItem
(
"oyStallCode"
)
this
.
minStartDate
=
new
Date
((
new
Date
()
/
1000
+
3600
)
*
1000
)
this
.
minEndDate
=
new
Date
((
new
Date
()
/
1000
+
86400
)
*
1000
)
},
methods
:
{
timeFormat
(
time
)
{
...
...
@@ -412,7 +355,7 @@ export default {
addCoupon
(
this
.
addForm
).
then
(
res
=>
{
console
.
log
(
res
,
'res'
)
if
(
res
.
errorCode
==
"fail"
)
{
this
.
$toast
(
"活动
编码不能重复
!"
)
this
.
$toast
(
"活动
创建失败
!"
)
}
else
{
this
.
$router
.
push
(
'coupon'
)
}
...
...
wx_application/src/views/mainSale/active/main/index.vue
View file @
58f5213c
...
...
@@ -74,24 +74,6 @@
</div>
</div>
</
template
>
<!-- <div class="actives-main">
<div class="active-logos">
<img class="active-logo" :src="test.activeInfo.icon['2']" />
</div>
<div class="active-infos">
<div class="active-title">现金券发放</div>
<div class="active-dsc">{{test.cache.actDsc}}</div>
</div>
</div>
<div class="actives-main">
<div class="active-logos">
<img class="active-logo" :src="test.activeInfo.icon['3']" />
</div>
<div class="active-infos">
<div class="active-title">集卡</div>
<div class="active-dsc">{{test.cache.actDsc}}</div>
</div>
</div>-->
<div
v-if=
"currentActives.length > 3 && !finished"
class=
"actives-mores"
@
click=
"handleMore"
>
<div
class=
"mores-title"
>
查看更多
</div>
<img
class=
"mores-icon"
:src=
"test.cache.arrowRightDark"
/>
...
...
@@ -232,10 +214,7 @@ export default {
};
},
created
()
{
// this.overlayShow = true
this
.
checkNowMenuBar
()
// this.zcache.userId = 'ShanDian'
// this.getUserFromId(this.zcache.userId)
if
(
sessionStorage
.
getItem
(
"userId"
))
{
if
(
sessionStorage
.
getItem
(
"avatar"
))
{
this
.
test
.
manInfo
.
logoUrl
=
sessionStorage
.
getItem
(
"avatar"
);
...
...
@@ -307,14 +286,17 @@ export default {
}
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/user/get?userId="
+
this
.
zcache
.
userId
,
url
:
"http://139.155.48.151:8085/workWx/auth/user/get?userId="
+
this
.
zcache
.
userId
,
method
:
"get"
,
headers
:
headerData
})
.
then
(
res
=>
{
if
(
res
.
data
!=
null
)
{
sessionStorage
.
setItem
(
"avatar"
,
res
.
data
.
data
.
avatar
)
resolve
(
res
.
data
.
data
.
avatar
)
}
else
{
resolve
(
''
)
}
})
.
catch
(
err
=>
{
reject
(
err
)
...
...
@@ -336,8 +318,28 @@ export default {
headers
:
headerData
})
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
data
!=
null
)
{
if
(
res
.
data
!=
[])
{
sessionStorage
.
setItem
(
"personalFan"
,
res
.
data
.
data
.
length
)
resolve
(
res
.
data
.
data
.
length
)
}
else
{
sessionStorage
.
setItem
(
"personalFan"
,
''
)
resolve
(
''
)
}
}
else
{
console
.
log
(
'zheli'
);
if
(
res
.
data
.
errorCode
==
"84061"
)
{
sessionStorage
.
setItem
(
"personalFan"
,
0
)
resolve
(
0
)
}
else
{
console
.
log
(
'?'
);
sessionStorage
.
setItem
(
"personalFan"
,
''
)
resolve
(
''
)
}
}
})
.
catch
(
err
=>
{
reject
(
err
)
...
...
@@ -373,20 +375,6 @@ export default {
})
},
// 获取店铺所有新增粉丝
// getAllNewFans() {
// let params = {
// oyStallCode: this.oyStallCode
// }
// return new Promise((resolve, reject) => {
// getMemberListByCode(params).then(res => {
// resolve(res.data)
// }).catch(err => {
// reject(err)
// })
// })
// },
getAllNewFans
()
{
let
params
=
{
oyStallCode
:
this
.
oyStallCode
...
...
@@ -404,7 +392,6 @@ export default {
JsonStr
.
userid
=
[
userId
];
}
else
{
JsonStr
.
userid
=
userId
console
.
log
(
userId
,
'拿到吗'
)
}
let
timeNow
=
Math
.
round
(
new
Date
()
/
1000
);
JsonStr
.
start_time
=
timeNow
-
24
*
60
*
60
;
...
...
@@ -424,17 +411,23 @@ export default {
let
data
=
JSON
.
parse
(
res
.
data
.
data
);
if
(
flag
==
1
)
{
// 获取个人新增粉丝
if
(
data
!=
null
)
{
let
newFans
=
data
.
behavior_data
[
0
].
new_contact_cnt
+
data
.
behavior_data
[
1
].
new_contact_cnt
;
// this.test.barInfo.newFans = data.behavior_data[0].new_contact_cnt + data.behavior_data[1].new_contact_cnt;
sessionStorage
.
setItem
(
"newFans"
,
newFans
);
resolve
(
newFans
)
}
else
{
sessionStorage
.
setItem
(
"newFans"
,
''
)
resolve
(
''
)
}
}
else
{
console
.
log
(
data
,
'全部粉丝'
);
if
(
data
!=
null
)
{
let
allNewFans
=
data
.
behavior_data
[
0
].
new_contact_cnt
+
data
.
behavior_data
[
1
].
new_contact_cnt
;
console
.
log
(
allNewFans
,
'allNewFans '
);
// this.test.barInfo.allNewFans = data.behavior_data[0].new_contact_cnt + data.behavior_data[1].new_contact_cnt;
sessionStorage
.
setItem
(
"allNewFans"
,
allNewFans
);
resolve
(
allNewFans
)
}
else
{
sessionStorage
.
setItem
(
"allNewFans"
,
''
);
resolve
(
''
)
}
}
})
.
catch
(
err
=>
{
...
...
@@ -471,11 +464,6 @@ export default {
this
.
test
.
barInfo
.
allNewFans
=
res
[
4
]
this
.
test
.
manInfo
.
barName
=
res
[
5
]
this
.
overlayShow
=
false
// this.getAddFans(2,this.memberList).then(res => {
// this.test.barInfo.allNewFans = res
// this.overlayShow = false
// })
//
})
},
checkNowMenuBar
()
{
...
...
@@ -605,6 +593,8 @@ export default {
},
// 获取店铺code
getUserFromId
(
id
)
{
console
.
log
(
1
);
let
userName
=
id
;
getUserInfoByUserId
({
userName
}).
then
(
res
=>
{
sessionStorage
.
setItem
(
"oyStallCode"
,
res
.
data
[
0
].
oyStallCode
)
...
...
ybf_admin/src/pages/in/contact/components/addGroup.vue
View file @
58f5213c
...
...
@@ -130,7 +130,8 @@ export default {
{
max
:
50
,
message
:
"长度在50个字符以内"
,
trigger
:
"blur"
}
],
parentId
:
[{
required
:
true
,
message
:
"请选择上级部门"
,
trigger
:
"change"
}],
oyStallCode
:
[{
required
:
true
,
validator
:
idNumber
,
trigger
:
"blur"
}]
oyStallCode
:
[{
required
:
true
,
validator
:
idNumber
,
trigger
:
"blur"
}],
clerkId
:
[{
required
:
true
,
message
:
"主管不能为空"
,
trigger
:
"blur"
}]
},
deptOption
:
{
value
:
'id'
,
...
...
ybf_admin/src/pages/in/contact/components/editGroup.vue
View file @
58f5213c
...
...
@@ -134,7 +134,8 @@ export default {
{
max
:
50
,
message
:
"长度在50个字符以内"
,
trigger
:
"blur"
},
],
parentId
:
[{
required
:
true
,
message
:
"请选择上级部门"
,
trigger
:
"change"
}],
oyStallCode
:
[{
required
:
true
,
validator
:
idNumber
,
trigger
:
"blur"
}]
oyStallCode
:
[{
required
:
true
,
validator
:
idNumber
,
trigger
:
"blur"
}],
clerkId
:
[{
required
:
true
,
message
:
"主管不能为空"
,
trigger
:
"blur"
}]
},
deptOption
:
{
value
:
'id'
,
...
...
ybf_wx/public/qrCode/index.html
View file @
58f5213c
...
...
@@ -137,7 +137,6 @@
font-size
:
2rem
;
font-weight
:
bold
;
}
.main
>
.cards
>
.card02
>
.tips
>
.rules
{}
.main
>
.cards
>
.card02
>
.tips
>
.rules
>
.rule
{
font-size
:
2rem
;
}
...
...
ybf_wx/src/views/sideNav/discount/index cop
y
.vue
→
ybf_wx/src/views/sideNav/discount/index cop.vue
View file @
58f5213c
<
template
>
<div
class=
"main"
>
<div
class=
"contents"
>
<div
class=
"zListActive"
>
<
!--
<
div
class=
"zListActive"
>
<div
class=
"inputs"
>
<div
class=
"button"
@
click=
"zReadySetVoucherList"
>
ReLoad
</div>
</div>
<div
class=
"button"
@
click=
"zReadyGetUserFromId"
>
ReLoad
</div>
</div>
</div>
-->
<div
v-for=
"item of zlist.voucher"
:key=
"item.coupon_id"
>
<div
class=
"content"
>
<div
class=
"content-imgs"
>
...
...
@@ -18,7 +18,7 @@
<div
class=
"main-money"
>
{{
item
.
coupon_title
}}
</div>
</div>
<div
class=
"buttons"
>
<button
class=
"button-send"
@
click=
"
zVoucherPick(item.action_id, item.coupon_id
)"
>
推送
</button>
<button
class=
"button-send"
@
click=
"
handlePush(item.coupon_link
)"
>
推送
</button>
</div>
</div>
<div
class=
"infos-tips"
>
...
...
@@ -97,178 +97,152 @@ export default {
this
.
getAgentAuth
();
// this.zReadySetVoucherList()
},
mounted
()
{
},
methods
:
{
// 测试-获取预授权码
zTestPreAuthCode
()
{
const
basicInfo
=
{
head
:
"https://open.weixin.qq.com/connect/oauth2/authorize?"
,
// appId: "wwd1cdbca7b8b2b6c4",
appId
:
"ww4df265003b43fa0d"
,
redirectUrI
:
encodeURIComponent
(
"oysales.oywanhao.com"
),
responseType
:
"code"
,
scope
:
"snsapi_base"
,
state
:
"ztest"
,
tail
:
"#wechat_redirect"
};
let
url
=
basicInfo
.
head
+
"appid="
+
basicInfo
.
appId
+
"&redirect_uri="
+
basicInfo
.
redirectUrI
+
"&response_type="
+
basicInfo
.
responseType
+
"&scope="
+
basicInfo
.
scope
+
"&state="
+
basicInfo
.
state
+
basicInfo
.
tail
;
zlog
(
"%c--->zTestPreAuthCode: Url ="
,
"background: orange"
,
url
);
// window.location.href = url
},
// 获取店铺数据
zReadyGetUserFromId
()
{
let
postData
=
{
userName
:
this
.
zcache
.
userId
}
getUserInfoByUserId
(
postData
)
.
then
(
res
=>
{
// alert(`--->userInfoFromId: res = ${JSON.stringify(res.data)}`);
// this.zcache.userInfo = String(res.data[0].departmentId);
if
(
res
.
data
[
0
].
oyStallCode
==
''
)
{
if
(
res
.
data
.
length
==
0
)
{
alert
(
'您当前没有绑定店铺'
)
}
else
{
this
.
zcache
.
storeId
=
res
.
data
[
0
].
oyStallCode
// this.zcache.storeId = Number(res.data[0].stall);
this
.
zReadySetVoucherList
()
// this.zcache.storeId = res.data[0].oyStallCode
res
.
data
.
forEach
(
item
=>
{
this
.
zReadySetVoucherList
(
item
.
oyStallCode
)
})
}
})
.
catch
(
err
=>
{})
},
// 获取优惠券列表
zReadySetVoucherList
()
{
this
.
zReadyDelVoucherList
();
zReadySetVoucherList
(
mdid
)
{
const
postData
=
{
appCode
:
"0696"
,
// j接口编码
mdid
:
this
.
zcache
.
storeI
d
mdid
:
mdi
d
}
getVoucherList
(
postData
).
then
(
res
=>
{
if
(
res
.
result
.
coupons
.
length
==
0
)
{
alert
(
'当前店铺暂无优惠券可发放'
)
}
else
{
this
.
zVoucherSet
(
res
.
result
.
coupons
)
console
.
log
(
res
,
'优惠券列表'
);
if
(
res
.
errCode
==
0
)
{
if
(
res
.
result
.
coupons
.
length
!=
0
)
{
this
.
zlist
.
voucher
.
push
(...
res
.
result
.
coupons
)
}
console
.
log
(
this
.
zlist
.
voucher
,
'this.zlist.voucher'
)
}
})
.
catch
(
err
=>
{
})
},
zReadyDelVoucherList
()
{
this
.
zVoucherDel
()
this
.
zVoucherUrlDel
()
},
zVoucherPick
(
inActiveId
,
inVoucherId
)
{
this
.
zcache
.
now
.
activeId
=
String
(
inActiveId
)
this
.
zcache
.
now
.
voucherId
=
String
(
inVoucherId
)
this
.
zVoucherUrlDel
()
const
postData
=
{
appCode
:
"0697"
,
action_id
:
Number
(
inActiveId
),
coupon_id
:
Number
(
inVoucherId
)
}
getVoucherWxUrl
(
postData
).
then
(
res
=>
{
this
.
zVoucherUrlSet
(
res
.
result
.
link
)
});
},
zpick
(
inMsgType
,
inUrl
)
{
switch
(
inMsgType
)
{
case
"text"
:
wx
.
invoke
(
"sendChatMessage"
,
{
msgtype
:
"text"
,
//消息类型,必填
text
:
{
content
:
inUrl
}
},
function
(
res
)
{
if
(
res
.
err_msg
==
"sendChatMessage:ok"
)
{
// alert("--->discount.vue: zpick: text 分享成功!")
}
else
if
(
res
.
err_msg
!=
"sendChatMessage:ok"
)
{
// alert('分享失败')
}
}
);
break
;
case
"h5"
:
// alert(`--->discount.vue: zpick: H5: IN.`);
// alert('zpick')
// 推送链接
handlePush
(
link
)
{
wx
.
invoke
(
"sendChatMessage"
,
{
msgtype
:
"news"
,
//消息类型,必填
news
:
{
link
:
`http://oysales.oywanhao.com/qrCode?Url=
${
inUrl
}
&activeId=
${
this
.
zcache
.
now
.
activeId
}
&voucherId=
${
this
.
zcache
.
now
.
voucherId
}
&unionId=1234
`
,
//H5消息页面url 必填
link
:
`http://oysales.oywanhao.com/qrCode?Url=
${
link
}
`
,
//H5消息页面url 必填
title
:
"领取优惠券"
,
//H5消息标题
desc
:
inUrl
,
//H5消息摘要
imgUrl
:
inUrl
//H5消息封面图片URL
desc
:
''
,
//H5消息摘要
imgUrl
:
''
//H5消息封面图片URL
}
},
function
(
res
)
{
// alert('sendChatMessage')
if
(
res
.
err_msg
==
"sendChatMessage:ok"
)
{
// alert("--->discount.vue: zpick: h5 分享成功!")
}
else
if
(
res
.
err_msg
!=
"sendChatMessage:ok"
)
{
// alert(`--->discount.vue: zpick: h5 分享失败.`)
// alert(
// `--->discount.vue: zpick: h5 分享失败: res =${res.err_msg}`
// );
}
}
);
break
;
default
:
break
;
}
)
},
zVoucherSet
(
inArray
)
{
// alert('zVoucherSet')
this
.
zlist
.
voucher
=
inArray
;
},
zVoucherDel
()
{
this
.
zlist
.
voucher
=
[];
},
zVoucherUrlSet
(
inData
)
{
this
.
zlist
.
voucherUrl
=
String
(
inData
);
this
.
zpick
(
'h5'
,
String
(
inData
))
},
zVoucherUrlDel
()
{
this
.
zlist
.
voucherUrl
=
""
;
},
testEaPost
()
{
let
postData
=
{
appCode
:
"0696"
,
mdid
:
1
};
ApiEaActiveList
(
postData
).
then
(
res
=>
{
// console.log(res);
});
},
buttonSingleMarketingClick
()
{
// this.$router.push("");
},
buttonMainMarketingClick
()
{
this
.
$router
.
push
(
"MainSale"
);
}
// zVoucherPick(inActiveId, inVoucherId) {
// this.zcache.now.activeId = String(inActiveId)
// this.zcache.now.voucherId = String(inVoucherId)
// this.zlist.voucherUrl = "";
// const postData = {
// appCode: "0697",
// action_id: Number(inActiveId),
// coupon_id: Number(inVoucherId)
// }
// getVoucherWxUrl(postData).then(res => {
// console.log(res,'指向小程序的链接')
// this.zlist.voucherUrl = String(res.result.link);
// this.zpick('h5', String(inData))
// // this.zVoucherUrlSet(res.result.link)
// });
// },
// zpick(inMsgType, inUrl) {
// switch (inMsgType) {
// case "text":
// wx.invoke(
// "sendChatMessage",
// {
// msgtype: "text", //消息类型,必填
// text: {
// content: inUrl
// }
// },
// function(res) {
// if (res.err_msg == "sendChatMessage:ok") {
// // alert("--->discount.vue: zpick: text 分享成功!")
// } else if (res.err_msg != "sendChatMessage:ok") {
// // alert('分享失败')
// }
// }
// );
// break;
// case "h5":
// // alert(`--->discount.vue: zpick: H5: IN.`);
// // alert('zpick')
// wx.invoke(
// "sendChatMessage",
// {
// msgtype: "news", //消息类型,必填
// news: {
// link: `http://oysales.oywanhao.com/qrCode?Url=${inUrl}`, //H5消息页面url 必填
// title: "领取优惠券", //H5消息标题
// desc: inUrl, //H5消息摘要
// imgUrl: inUrl //H5消息封面图片URL
// }
// },
// function(res) {
// // alert('sendChatMessage')
// if (res.err_msg == "sendChatMessage:ok") {
// // alert("--->discount.vue: zpick: h5 分享成功!")
// } else if (res.err_msg != "sendChatMessage:ok") {
// // alert(`--->discount.vue: zpick: h5 分享失败.`)
// // alert(
// // `--->discount.vue: zpick: h5 分享失败: res =${res.err_msg}`
// // );
// }
// }
// );
// break;
// default:
// break;
// }
// },
// zVoucherUrlSet(inData) {
// this.zlist.voucherUrl = String(inData);
// this.zpick('h5', String(inData))
// },
// testEaPost() {
// let postData = {
// appCode: "0696",
// mdid: 1
// };
// ApiEaActiveList(postData).then(res => {
// // console.log(res);
// });
// },
// buttonSingleMarketingClick() {
// },
// buttonMainMarketingClick() {
// this.$router.push("MainSale");
// }
}
};
</
script
>
...
...
ybf_wx/src/views/sideNav/discount/index.vue
View file @
58f5213c
...
...
@@ -97,39 +97,68 @@ export default {
this
.
getAgentAuth
();
// this.zReadySetVoucherList()
},
mounted
()
{
},
methods
:
{
// 测试-获取预授权码
zTestPreAuthCode
()
{
const
basicInfo
=
{
head
:
"https://open.weixin.qq.com/connect/oauth2/authorize?"
,
// appId: "wwd1cdbca7b8b2b6c4",
appId
:
"ww4df265003b43fa0d"
,
redirectUrI
:
encodeURIComponent
(
"oysales.oywanhao.com"
),
responseType
:
"code"
,
scope
:
"snsapi_base"
,
state
:
"ztest"
,
tail
:
"#wechat_redirect"
};
let
url
=
basicInfo
.
head
+
"appid="
+
basicInfo
.
appId
+
"&redirect_uri="
+
basicInfo
.
redirectUrI
+
"&response_type="
+
basicInfo
.
responseType
+
"&scope="
+
basicInfo
.
scope
+
"&state="
+
basicInfo
.
state
+
basicInfo
.
tail
;
zlog
(
"%c--->zTestPreAuthCode: Url ="
,
"background: orange"
,
url
);
// window.location.href = url
},
zReadyGetUserFromId
()
{
let
postData
=
{
userName
:
this
.
zcache
.
userId
}
getUserInfoByUserId
(
postData
)
.
then
(
res
=>
{
if
(
res
.
data
.
length
==
0
)
{
// alert(`--->userInfoFromId: res = ${JSON.stringify(res.data)}`);
// this.zcache.userInfo = String(res.data[0].departmentId);
if
(
res
.
data
[
0
].
oyStallCode
==
''
)
{
alert
(
'您当前没有绑定店铺'
)
}
else
{
// this.zcache.storeId = res.data[0].oyStallCode
res
.
data
.
forEach
(
item
=>
{
this
.
zReadySetVoucherList
(
item
.
id
)
})
this
.
zcache
.
storeId
=
res
.
data
[
0
].
oyStallCode
// this.zcache.storeId = Number(res.data[0].stall);
this
.
zReadySetVoucherList
()
}
})
.
catch
(
err
=>
{})
},
// 获取优惠券列表
zReadySetVoucherList
(
mdid
)
{
// this.zReadyDelVoucherList()
zReadySetVoucherList
()
{
this
.
zReadyDelVoucherList
();
const
postData
=
{
appCode
:
"0696"
,
// j接口编码
mdid
:
mdi
d
mdid
:
this
.
zcache
.
storeI
d
}
getVoucherList
(
postData
).
then
(
res
=>
{
if
(
res
.
errCode
==
0
)
{
if
(
res
.
result
.
coupons
.
length
!=
0
)
{
this
.
zlist
.
voucher
.
push
(...
res
.
result
.
coupons
)
}
console
.
log
(
this
.
zlist
.
voucher
,
'this.zlist.voucher'
)
if
(
res
.
result
.
coupons
.
length
==
0
)
{
alert
(
'当前店铺暂无优惠券可发放'
)
}
else
{
this
.
zVoucherSet
(
res
.
result
.
coupons
)
}
})
.
catch
(
err
=>
{
...
...
@@ -143,7 +172,8 @@ export default {
zVoucherPick
(
inActiveId
,
inVoucherId
)
{
this
.
zcache
.
now
.
activeId
=
String
(
inActiveId
)
this
.
zcache
.
now
.
voucherId
=
String
(
inVoucherId
)
this
.
zlist
.
voucherUrl
=
""
;
this
.
zVoucherUrlDel
()
const
postData
=
{
appCode
:
"0697"
,
...
...
@@ -151,15 +181,13 @@ export default {
coupon_id
:
Number
(
inVoucherId
)
}
getVoucherWxUrl
(
postData
).
then
(
res
=>
{
console
.
log
(
res
,
'指向小程序的链接'
)
this
.
zlist
.
voucherUrl
=
String
(
res
.
result
.
lin
);
this
.
zpick
(
'h5'
,
String
(
inData
))
// this.zVoucherUrlSet(res.result.link)
this
.
zVoucherUrlSet
(
res
.
result
.
link
)
});
},
zpick
(
inMsgType
,
inUrl
)
{
switch
(
inMsgType
)
{
case
"text"
:
wx
.
invoke
(
"sendChatMessage"
,
...
...
@@ -186,7 +214,7 @@ export default {
{
msgtype
:
"news"
,
//消息类型,必填
news
:
{
link
:
`http://oysales.oywanhao.com/qrCode?Url=
${
inUrl
}
`
,
//H5消息页面url 必填
link
:
`http://oysales.oywanhao.com/qrCode?Url=
${
inUrl
}
&activeId=
${
this
.
zcache
.
now
.
activeId
}
&voucherId=
${
this
.
zcache
.
now
.
voucherId
}
&unionId=1234
`
,
//H5消息页面url 必填
title
:
"领取优惠券"
,
//H5消息标题
desc
:
inUrl
,
//H5消息摘要
imgUrl
:
inUrl
//H5消息封面图片URL
...
...
@@ -209,6 +237,11 @@ export default {
break
;
}
},
zVoucherSet
(
inArray
)
{
// alert('zVoucherSet')
this
.
zlist
.
voucher
=
inArray
;
},
zVoucherDel
()
{
this
.
zlist
.
voucher
=
[];
},
...
...
@@ -216,6 +249,10 @@ export default {
this
.
zlist
.
voucherUrl
=
String
(
inData
);
this
.
zpick
(
'h5'
,
String
(
inData
))
},
zVoucherUrlDel
()
{
this
.
zlist
.
voucherUrl
=
""
;
},
testEaPost
()
{
let
postData
=
{
appCode
:
"0696"
,
...
...
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