Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e3ce7542
authored
Jul 06, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加门店活动
1 parent
5ac14245
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
127 deletions
src/mixins/shareMixin.js
src/views/merchant/index.vue
src/mixins/shareMixin.js
View file @
e3ce754
...
...
@@ -51,7 +51,6 @@ export default {
sendMessage
(
i
)
{
const
{
shopmall_appid
}
=
window
.
$fetchConfig
let
{
merchantId
,
merchantName
,
userName
,
sapCode
,
uuid
}
=
this
.
getLocalStorage
(
'dj_scrm_userInfo'
)
console
.
log
(
this
.
getLocalStorage
(
'dj_scrm_userInfo'
))
let
{
tabIndex
,
entry
}
=
this
let
{
name
}
=
this
.
$route
let
{
userId
,
id
,
couponName
,
activityName
,
packageName
,
goodsName
,
goodsImage
,
discountType
}
=
i
...
...
@@ -59,129 +58,80 @@ export default {
if
(
sapCode
)
query
=
`
${
query
}
&storeCode=
${
sapCode
}
`
const
entryType
=
entry
!=
'normal'
this
.
showLoading
()
let
params
=
{
'coupon'
:
{
path
:
'packageMine/pages/boutique/gift/gift'
,
desc
:
'您的专属服务顾问为您发来了优惠券,请点击领取~'
,
imgUrl
:
'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
},
'activity'
:
{
path
:
'packageMall/pages/detail/detail'
,
desc
:
'您有一个秒杀活动可参加'
,
imgUrl
:
'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
},
'merchant'
:
{
path
:
'pages/tab/index/index'
,
desc
:
''
,
imgUrl
:
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
}
}[
name
]
let
title
=
{
'coupon'
:
couponName
,
'activity'
:
activityName
,
'merchant'
:
merchantName
}[
name
]
if
(
name
===
'coupon'
)
{
/**卡券 */
let
desc
=
'您的专属服务顾问为您发来了优惠券,请点击领取~'
let
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
if
(
tabIndex
==
0
)
{
let
path
=
'packageMine/pages/boutique/gift/gift'
query
=
`id=
${
id
}
&userId=
${
userId
}
&employName=
${
this
.
toUnicode
(
i
.
employeeName
)}
&
${
query
}
`
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
title
:
couponName
,
imgUrl
,
page
:
`/
${
path
}
.html?
${
query
}
`
})
else
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
})
.
then
(
url
=>
{
this
.
shareAppMessage
(
url
,
desc
,
couponName
,
imgUrl
)
})
}
else
{
let
path
=
'packageMall/pages/coupon/coupon'
params
.
path
=
'packageMall/pages/coupon/coupon'
query
=
`couponId=
${
id
}
&
${
query
}
&issueName=
${
this
.
toUnicode
(
userName
)}
&issueDate=
${
new
Date
().
getTime
()}
&shareSource=1&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
this
.
couponShare
(
i
,
url
=>
{
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
title
:
`
${
couponName
}
(
${
window
.
$discountType
[
discountType
]}
券)`
,
imgUrl
,
page
:
`/
${
path
}
.html?
${
query
}
`
})
else
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
})
.
then
(
url
=>
{
this
.
shareAppMessage
(
url
,
desc
,
couponName
,
imgUrl
)
})
})
title
=
`
${
couponName
}
(
${
window
.
$discountType
[
discountType
]}
券)`
this
.
couponShare
(
i
)
}
}
else
if
(
name
===
'activity'
)
{
/**活动 */
}
if
(
name
===
'activity'
)
{
/**活动 */
if
(
tabIndex
==
0
)
{
let
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
let
path
=
'packageMall/pages/detail/detail'
query
=
`isActivity=true&id=
${
id
}
&
${
query
}
&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
title
:
activityName
,
imgUrl
,
page
:
`/
${
path
}
.html?
${
query
}
`
})
else
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
})
.
then
(
url
=>
{
this
.
shareAppMessage
(
url
,
'您有一个秒杀活动可参加'
,
activityName
,
imgUrl
)
})
}
else
{
/**直播 */
}
}
else
{
/**店铺 */
if
(
tabIndex
==
0
)
{
let
path
=
'pages/tab/index/index'
const
imgUrl
=
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
title
:
merchantName
,
imgUrl
,
page
:
`/
${
path
}
.html?
${
query
}
`
})
else
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
})
.
then
(
url
=>
{
this
.
shareAppMessage
(
url
,
''
,
merchantName
,
imgUrl
)
})
}
else
if
(
tabIndex
==
1
)
{
let
path
=
'packageEquity/pages/package/package'
let
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
query
=
`id=
${
id
}
&
${
query
}
&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
title
:
packageName
,
imgUrl
,
page
:
`/
${
path
}
.html?
${
query
}
`
})
else
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
})
.
then
(
url
=>
{
this
.
shareAppMessage
(
url
,
'您的专属客服顾问为您发来了会员套餐,点击查看哦'
,
packageName
,
imgUrl
)
})
}
else
{
let
path
=
'packageMall/pages/detail/detail'
query
=
`id=
${
id
}
&
${
query
}
&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
title
:
goodsName
,
imgUrl
:
goodsImage
,
page
:
`/
${
path
}
.html?
${
query
}
`
})
else
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
})
.
then
(
url
=>
{
this
.
shareAppMessage
(
url
,
''
,
goodsName
,
goodsImage
)
})
}
if
(
name
===
'merchant'
)
{
/**店铺 */
switch
(
+
tabIndex
)
{
case
2
:
params
.
path
=
'packageEquity/pages/package/package'
params
.
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
params
.
desc
=
'您的专属客服顾问为您发来了会员套餐,点击查看哦'
query
=
`id=
${
id
}
&
${
query
}
&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
title
=
packageName
break
;
case
3
:
params
.
path
=
'packageMall/pages/detail/detail'
params
.
imgUrl
=
goodsImage
params
.
desc
=
''
query
=
`id=
${
id
}
&
${
query
}
&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
title
=
goodsName
break
default
:
break
;
}
}
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
title
,
imgUrl
:
params
.
imgUrl
,
page
:
`/
${
params
.
path
}
.html?
${
query
}
`
})
else
this
.
shareAppMessage
({
path
:
params
.
path
,
query
,
appId
:
shopmall_appid
},
{
desc
:
params
.
desc
,
title
,
imgUrl
:
params
.
imgUrl
})
},
sendChatMessage
(
params
)
{
wxConfig
...
...
@@ -198,19 +148,21 @@ export default {
this
.
hideLoading
()
})
},
shareAppMessage
(
link
,
desc
,
title
,
imgUrl
)
{
shareAppMessage
(
link
Params
,
messageParams
)
{
wxConfig
.
shareAppMessage
({
title
,
desc
,
link
,
imgUrl
})
.
then
(()
=>
{
this
.
hideLoading
()
})
.
catch
(()
=>
{
this
.
hideLoading
()
.
createMiniprogramUrlLink
(
linkParams
)
.
then
(
link
=>
{
wxConfig
.
shareAppMessage
({
link
,
...
messageParams
})
.
then
(()
=>
{
this
.
hideLoading
()
})
.
catch
(()
=>
{
this
.
hideLoading
()
})
})
},
toUnicode
(
chineseStr
=
''
)
{
...
...
@@ -220,7 +172,7 @@ export default {
}
return
unicodeStr
},
couponShare
(
item
,
callBack
)
{
couponShare
(
item
)
{
let
{
is_contact
,
id
}
=
item
let
obj
=
{
couponId
:
id
,
...
...
@@ -232,9 +184,6 @@ export default {
}
]
else
obj
.
shareType
=
0
couponApi
.
getCouponShared
(
obj
).
then
(
res
=>
{
callBack
(
res
.
url
)
})
}
}
}
src/views/merchant/index.vue
View file @
e3ce754
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment