Commit 1d71e4eb by 李伟康

修改发送素材

1 parent 550d2fc1
...@@ -30,12 +30,6 @@ export default { ...@@ -30,12 +30,6 @@ export default {
const imgUrl = 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg' const imgUrl = 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg'
let query = `merchantId=${merchantId}&id=${id}&staffUuid=${uuid}` let query = `merchantId=${merchantId}&id=${id}&staffUuid=${uuid}`
if (sapCode) query = `${query}&storeCode=${sapCode}` if (sapCode) query = `${query}&storeCode=${sapCode}`
marketingApi.sendReadBuriedPoint({
materialId: id,
type: 1,
merchantId,
staffUuid: uuid
}).then(() => {
wxConfig.createMiniprogramUrlLink({ wxConfig.createMiniprogramUrlLink({
path, path,
query, query,
...@@ -58,6 +52,7 @@ export default { ...@@ -58,6 +52,7 @@ export default {
} }
] ]
}).then(() => { }).then(() => {
this.sendReadBuriedPoint({ id, merchantId, uuid })
this.hideLoading() this.hideLoading()
}) })
.catch(err => { .catch(err => {
...@@ -70,32 +65,40 @@ export default { ...@@ -70,32 +65,40 @@ export default {
desc: description || '', desc: description || '',
imgUrl: titleUrl || imgUrl imgUrl: titleUrl || imgUrl
} }
if (entry != 'normal') this.sendChatMessage(params, { id, merchantId, uuid })
if (entry != 'normal') this.sendChatMessage(params, 'news') else this.shareAppMessage(params, { id, merchantId, uuid })
else this.shareAppMessage(params)
} }
}) })
},
sendReadBuriedPoint ({ id, merchantId, uuid }) {
marketingApi.sendReadBuriedPoint({
materialId: id,
type: 1,
merchantId,
staffUuid: uuid
}) })
}, },
sendChatMessage (params, msgtype) { sendChatMessage (params, sendParams) {
wxConfig wxConfig
.sendChatMessage({ .sendChatMessage({
msgtype, msgtype,
[msgtype]: params, news: params,
enterChat: false enterChat: false
}) })
.then(() => { .then(res => {
this.hideLoading() this.hideLoading()
this.sendReadBuriedPoint(sendParams)
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
this.hideLoading() this.hideLoading()
}) })
}, },
shareAppMessage (params) { shareAppMessage (params, sendParams) {
wxConfig wxConfig
.shareAppMessage(params) .shareAppMessage(params)
.then(() => { .then(() => {
this.sendReadBuriedPoint(sendParams)
this.hideLoading() this.hideLoading()
}) })
.catch(() => { .catch(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!