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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
113 deletions
src/mixins/shareMixin.js
src/views/merchant/index.vue
src/mixins/shareMixin.js
View file @
e3ce754
...
@@ -51,7 +51,6 @@ export default {
...
@@ -51,7 +51,6 @@ export default {
sendMessage
(
i
)
{
sendMessage
(
i
)
{
const
{
shopmall_appid
}
=
window
.
$fetchConfig
const
{
shopmall_appid
}
=
window
.
$fetchConfig
let
{
merchantId
,
merchantName
,
userName
,
sapCode
,
uuid
}
=
this
.
getLocalStorage
(
'dj_scrm_userInfo'
)
let
{
merchantId
,
merchantName
,
userName
,
sapCode
,
uuid
}
=
this
.
getLocalStorage
(
'dj_scrm_userInfo'
)
console
.
log
(
this
.
getLocalStorage
(
'dj_scrm_userInfo'
))
let
{
tabIndex
,
entry
}
=
this
let
{
tabIndex
,
entry
}
=
this
let
{
name
}
=
this
.
$route
let
{
name
}
=
this
.
$route
let
{
userId
,
id
,
couponName
,
activityName
,
packageName
,
goodsName
,
goodsImage
,
discountType
}
=
i
let
{
userId
,
id
,
couponName
,
activityName
,
packageName
,
goodsName
,
goodsImage
,
discountType
}
=
i
...
@@ -59,129 +58,80 @@ export default {
...
@@ -59,129 +58,80 @@ export default {
if
(
sapCode
)
query
=
`
${
query
}
&storeCode=
${
sapCode
}
`
if
(
sapCode
)
query
=
`
${
query
}
&storeCode=
${
sapCode
}
`
const
entryType
=
entry
!=
'normal'
const
entryType
=
entry
!=
'normal'
this
.
showLoading
()
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'
)
{
/**卡券 */
if
(
name
===
'coupon'
)
{
/**卡券 */
let
desc
=
'您的专属服务顾问为您发来了优惠券,请点击领取~'
let
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
if
(
tabIndex
==
0
)
{
if
(
tabIndex
==
0
)
{
let
path
=
'packageMine/pages/boutique/gift/gift'
query
=
`id=
${
id
}
&userId=
${
userId
}
&employName=
${
this
.
toUnicode
(
i
.
employeeName
)}
&
${
query
}
`
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
{
}
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
}
`
query
=
`couponId=
${
id
}
&
${
query
}
&issueName=
${
this
.
toUnicode
(
userName
)}
&issueDate=
${
new
Date
().
getTime
()}
&shareSource=1&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
this
.
couponShare
(
i
,
url
=>
{
title
=
`
${
couponName
}
(
${
window
.
$discountType
[
discountType
]}
券)`
if
(
entryType
)
this
.
sendChatMessage
({
this
.
couponShare
(
i
)
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
)
})
})
}
}
}
else
if
(
name
===
'activity'
)
{
/**活动 */
}
if
(
name
===
'activity'
)
{
/**活动 */
if
(
tabIndex
==
0
)
{
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
}
`
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
{
/**直播 */
/**直播 */
}
}
}
else
{
/**店铺 */
}
if
(
tabIndex
==
0
)
{
if
(
name
===
'merchant'
)
{
/**店铺 */
let
path
=
'pages/tab/index/index'
switch
(
+
tabIndex
)
{
const
imgUrl
=
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
case
2
:
if
(
entryType
)
this
.
sendChatMessage
({
params
.
path
=
'packageEquity/pages/package/package'
appid
:
shopmall_appid
,
params
.
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
title
:
merchantName
,
params
.
desc
=
'您的专属客服顾问为您发来了会员套餐,点击查看哦'
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
}
`
query
=
`id=
${
id
}
&
${
query
}
&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
if
(
entryType
)
this
.
sendChatMessage
({
title
=
packageName
appid
:
shopmall_appid
,
break
;
title
:
packageName
,
case
3
:
imgUrl
,
params
.
path
=
'packageMall/pages/detail/detail'
page
:
`/
${
path
}
.html?
${
query
}
`
params
.
imgUrl
=
goodsImage
})
params
.
desc
=
''
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
}
`
query
=
`id=
${
id
}
&
${
query
}
&shareStaffName=
${
this
.
toUnicode
(
userName
)}
&shareStaffUuid=
${
uuid
}
`
title
=
goodsName
break
default
:
break
;
}
}
if
(
entryType
)
this
.
sendChatMessage
({
if
(
entryType
)
this
.
sendChatMessage
({
appid
:
shopmall_appid
,
appid
:
shopmall_appid
,
title
:
goodsNam
e
,
titl
e
,
imgUrl
:
goodsImage
,
imgUrl
:
params
.
imgUrl
,
page
:
`/
${
path
}
.html?
${
query
}
`
page
:
`/
${
params
.
path
}
.html?
${
query
}
`
})
})
else
wxConfig
else
this
.
shareAppMessage
({
.
createMiniprogramUrlLink
({
path
:
params
.
path
,
path
,
query
,
query
,
appId
:
shopmall_appid
appId
:
shopmall_appid
},
{
desc
:
params
.
desc
,
title
,
imgUrl
:
params
.
imgUrl
})
})
.
then
(
url
=>
{
this
.
shareAppMessage
(
url
,
''
,
goodsName
,
goodsImage
)
})
}
}
},
},
sendChatMessage
(
params
)
{
sendChatMessage
(
params
)
{
wxConfig
wxConfig
...
@@ -198,13 +148,14 @@ export default {
...
@@ -198,13 +148,14 @@ export default {
this
.
hideLoading
()
this
.
hideLoading
()
})
})
},
},
shareAppMessage
(
link
,
desc
,
title
,
imgUrl
)
{
shareAppMessage
(
linkParams
,
messageParams
)
{
wxConfig
.
createMiniprogramUrlLink
(
linkParams
)
.
then
(
link
=>
{
wxConfig
wxConfig
.
shareAppMessage
({
.
shareAppMessage
({
title
,
desc
,
link
,
link
,
imgUrl
...
messageParams
})
})
.
then
(()
=>
{
.
then
(()
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
...
@@ -212,6 +163,7 @@ export default {
...
@@ -212,6 +163,7 @@ export default {
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
})
})
})
},
},
toUnicode
(
chineseStr
=
''
)
{
toUnicode
(
chineseStr
=
''
)
{
let
unicodeStr
=
''
let
unicodeStr
=
''
...
@@ -220,7 +172,7 @@ export default {
...
@@ -220,7 +172,7 @@ export default {
}
}
return
unicodeStr
return
unicodeStr
},
},
couponShare
(
item
,
callBack
)
{
couponShare
(
item
)
{
let
{
is_contact
,
id
}
=
item
let
{
is_contact
,
id
}
=
item
let
obj
=
{
let
obj
=
{
couponId
:
id
,
couponId
:
id
,
...
@@ -232,9 +184,6 @@ export default {
...
@@ -232,9 +184,6 @@ export default {
}
}
]
]
else
obj
.
shareType
=
0
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