Skip to content

Commit bda8ed7

Browse files
author
sanfordsun
committed
fix: chattool
1 parent c0ce6b9 commit bda8ed7

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

miniprogram/packageAPI/pages/chattool/material_open/material_open.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { getGroupEnterInfo } from '../util'
2+
const config = require('../../../../config')
23

34
let needShowEntrance = true
4-
let entrancePath = 'pages/chattool/material_open/material_open'
5+
let entrancePath = 'packageAPI/pages/chattool/material_open/material_open'
56
let templateId = '4A68CBB88A92B0A9311848DBA1E94A199B166463' // 完成
67
// let templateId = '2A84254B945674A2F88CE4970782C402795EB607' // 参与
78

@@ -30,8 +31,9 @@ Page({
3031
this._activityId = options.activityId
3132

3233
wx.cloud.init({
34+
env: config.envId,
3335
traceUser: true,
34-
});
36+
})
3537

3638
this.setData({
3739
theme: wx.getSystemInfoSync().theme || 'light'
@@ -142,6 +144,7 @@ Page({
142144
},
143145

144146
shareUpdatableMessage() {
147+
const that = this
145148
wx.cloud.callFunction({
146149
name: 'openapi',
147150
data: {
@@ -163,6 +166,7 @@ Page({
163166
title: '动态消息卡片',
164167
path: `${entrancePath}?activityId=${activityId}`,
165168
complete(res) {
169+
that._activityId = activityId
166170
console.info('shareAppMessageToGroup: ', res)
167171
}
168172
})
@@ -176,7 +180,7 @@ Page({
176180

177181
shareImage() {
178182
wx.downloadFile({
179-
url: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg',
183+
url: 'https://cdc-opendesign-1258344706.cos.ap-guangzhou.myqcloud.com/image/emywrxo77wrzaj3kn3exgk81c1e5x6767l/k689zkwkdmj9ngm/2024/11/06/vlnycdv60lakegvyup38kfh2wbhuzgha2ua6xfdfxxcdoaf6/xj812q7y2n3obyq/abe09549-8469-4e6d-a4f2-7c7e20cdad54.png?imageMogr2/thumbnail/600x340%3E',
180184
success: (res) => {
181185
wx.shareImageToGroup({
182186
imagePath: res.tempFilePath, // 本地路径或临时路径

miniprogram/packageAPI/pages/chattool/material_open/material_open.wxml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<button bind:tap="viewChatMaterials" class="btn" type="primary">查看聊天内容</button>
99
<button bind:tap="shareUpdatableMessage" class="btn" type="primary">发送动态消息卡片</button>
1010
<button bind:tap="signIn" class="btn" type="primary">签到动态消息卡片</button>
11-
<button bind:tap="remindExpiration" class="btn" type="primary">设置动态消息即将结束</button>
1211
<button bind:tap="earlyTerminate" class="btn" type="primary">设置动态消息结束</button>
1312
<button bind:tap="changeNeedShowEntrance" class="btn" type="primary">{{needShowEntrance ? '显示' : '隐藏'}}发送消息小尾巴</button>
1413
<form bind:submitToGroup="onSubmitToGroup">

miniprogram/packageAPI/pages/chattool/material_view/material_view.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ Page({
128128
wx.getChatForwardMaterials({
129129
needGroupOpenID: true,
130130
success(res) {
131-
res.materials = mockData.materials
132131
if (res.materials) {
133132
that.formatMaterials(res.materials)
134133
}
@@ -137,7 +136,6 @@ Page({
137136
},
138137

139138
formatMaterials(forwardMaterials = []) {
140-
let id = 0
141139
const materials = []
142140
for (let item of forwardMaterials) {
143141
let recordType = ''

0 commit comments

Comments
 (0)