Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解決 async:true , dataLoaded 針對 Send to Chat 沒反應的辦法 #37

Open
teyou opened this issue Dec 19, 2014 · 9 comments
Open

Comments

@teyou
Copy link

teyou commented Dec 19, 2014

問題: 當使用 Async 時Send到Chat 有些字段沒有刷新

解決辦法:
line 124 下面 : 加上

cmd.menu == 'menu:share:appmessage' ||

完整如下:

                 if (cmd.menu == 'menu:share:timeline' ||
                        cmd.menu == 'menu:share:appmessage' ||
                        (cmd.menu == 'menu:general:share' && argv.shareTo == 'timeline')) {
                        theData = {
                            "appid":theData.appId ? theData.appId : '',
                            "img_url":theData.imgUrl,
                            "link":theData.link,
                            "desc":theData.title,
                            "title":theData.desc,
                            "img_width":"640",
                            "img_height":"640"
                        };
                    }

請參考!

@mgcnrx11
Copy link

其实这里只不过是针对timeline把desc和title写错了做的处理

关键是上一行的_extend执行不好导致没更新

1 similar comment
@mgcnrx11
Copy link

其实这里只不过是针对timeline把desc和title写错了做的处理

关键是上一行的_extend执行不好导致没更新

@zxlie
Copy link
Owner

zxlie commented Dec 28, 2014

加上async为true以后,需要手动在ready方法中调用:this.dataLoaded。我在新版本中加个兼容吧。

@teyou
Copy link
Author

teyou commented Dec 28, 2014

問題不在有沒有調用 dataLoaded.

是 async:true 時 ,分享到朋友圈時 調用 dataLoaded 所有字段都刷新 (是好的)
但是 “Send to chat" (發送給朋友) 調用 dataLoaded 有些字段沒有被刷新 (bug)

@zxlie
Copy link
Owner

zxlie commented Dec 28, 2014

是Android还是iOS?微信版本是多少,send to chat的时候,那个字段未更新?我一并fix了吧。

@teyou
Copy link
Author

teyou commented Dec 28, 2014

我在 android 測試的
版本沒記錯是 3.1 或 3.2
抱歉! 微信版本是 6.0.X
哪些字段? 基本上send to chat 時沒進去下面的 if, 所以整個 theData 都沒更新

我的解法是
line 124 下面 : 加上

cmd.menu == 'menu:share:appmessage' ||

原本只有

 if (cmd.menu == 'menu:share:timeline' ||
                        (cmd.menu == 'menu:general:share' && argv.shareTo == 'timeline')) {
...

修改後的 if

 if (cmd.menu == 'menu:share:timeline' ||
                        cmd.menu == 'menu:share:appmessage' ||
                        (cmd.menu == 'menu:general:share' && argv.shareTo == 'timeline')) {
...

@zxlie
Copy link
Owner

zxlie commented Dec 28, 2014

我刚刚升级了一个版本,这个问题应该是不存在了,我明天去找个3.1版本的Android试试。

@teyou
Copy link
Author

teyou commented Dec 28, 2014

恩 我也剛升到 6.0.2
沒記錯當時測試用的是 6.0.0

@mgcnrx11
Copy link

我遇到的问题是图片没有刷新,所以我强制写了一个
theData.img_url = theData.imgUrl;

这个语句在
if (cmd.menu == 'menu:share:timeline' ||

这些判断之前,问题解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants