Skip to content

Commit

Permalink
feat:conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
wybieshang committed Mar 28, 2024
2 parents 9963c10 + bedd2cd commit b97f7d6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cw/cw_text_power_library/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Library-Type: Frontend
Metadata-File: usage.json
packages/extension/[email protected]/dist-theme/demo.html: dist-theme/demo.html
packages/extension/[email protected]/dist-theme/index.js: dist-theme/index.js
packages/extension/[email protected]/dist-theme/index.js.map: dist-theme/index.js.map
packages/extension/[email protected]/dist-theme/index.js.map: dist-theme/index.js.map
2 changes: 2 additions & 0 deletions packages/cw/wechat_sdk_share/logics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import updateAppMessageShareData from './updateAppMessageShareData'
import getNetworkType from './getNetworkType'
import closeWindow from './closeWindow'
import previewImage from './previewImage'
import sendTemplateMessage from './sendTemplateMessage'
// LOGIC IMPORTS

UtilsLogics.install = function (Vue, option = {}) {
Expand All @@ -31,6 +32,7 @@ UtilsLogics.install = function (Vue, option = {}) {
Vue.prototype.$library[`${$libraryName}`].getNetworkType=getNetworkType
Vue.prototype.$library[`${$libraryName}`].closeWindow=closeWindow
Vue.prototype.$library[`${$libraryName}`].previewImage=previewImage
Vue.prototype.$library[`${$libraryName}`].sendTemplateMessage=sendTemplateMessage
// LOGIC USE
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: sendTemplateMessage
description: 发送模版消息
type: both
belong: logic
labels: [Runtime]
41 changes: 41 additions & 0 deletions packages/cw/wechat_sdk_share/logics/sendTemplateMessage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* @param {string} options <false> 这是一个描述
* @returns {string} result
*/
import wx from 'weixin-js-sdk'
export default (appId, nonceStr, signature, accessToken, openId, templateId, url, pagepath, value ) => {
var timestamp = Math.floor(new Date().getTime() / 1000).toString();

wx.config({
debug: false,
appId,
timestamp,
nonceStr,
signature,
jsApiList: ["chooseWXPay", "sendTemplateMessage"], // 需要使用的JS接口列表
});

wx.ready(function () {
// 在这里调用微信JS-SDK的接口
wx.sendTemplateMessage({
touser: openId,
template_id,
url,
miniprogram: {
appid,
pagepath,
},
data: {
keyword1: {
value,
},
},
success: function (res) {
console.log('success', res)
},
fail: function (error) {
console.error('error', error)
},
});
});
};

0 comments on commit b97f7d6

Please sign in to comment.