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

可以对接微信小程序吗? #387

Open
xiaoyaozz opened this issue May 13, 2024 · 10 comments
Open

可以对接微信小程序吗? #387

xiaoyaozz opened this issue May 13, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@xiaoyaozz
Copy link

小白求助,这个可以对接微信小程序吗?

@xiaoyaozz xiaoyaozz added the enhancement New feature or request label May 13, 2024
@Evil0ctal
Copy link
Owner

可以

@xiaoyaozz
Copy link
Author

xiaoyaozz commented May 20, 2024

太好了啊,但怎么设置呢,可以帮我一下吗,我想设置一个去水印的小程序 。
以下是用的极客API的代码,我应该怎么修改一下呢大佬。求帮助啊。
!function() { getApp(); Page({ data: { isInput: 0, inputValue: "" }, bindinput(e) { var t = e.detail.value; t.length > 0 && this.setData({ isInput: 1, inputValue: t }); }, saveCache(e) { let t = wx.getStorageSync("analysis"); t || (t = []), t.length >= 50 && t.splice(0, 1), t.push(e), wx.setStorageSync("analysis", t); }, paste_and_content() { console.log("观看激励视频,再解析"); let e = this; wx.getClipboardData({ success(t) { if (console.log("解析内容", t.data), !t.data) return wx.showToast({ title: "请输入视频 (或图集) 链接", icon: "none", duration: 2e3 }), !1; e.qushuiyin("", t.data); } }); }, paste() { let e = this; wx.getClipboardData({ success(t) { e.setData({ inputValue: t.data, isInput: 1 }); } }); }, qushuiyin(e, t) { let a = this; wx.showLoading({ title: "解析中..." }); let s = t || a.data.inputValue; console.log("一键去水印", s), wx.request({ url: "https://api.wxshares.com/api/qsy/as", data: { key: "xfwu0IxYvaYYpwaXsPjwY4dIUR", url: s }, header: { "content-type": "application/json" }, success(e) { wx.hideLoading(), console.log("服务器返回数据", e.data); let t = e.data; 200 == t.code ? (console.log("解析成功打印数据", t.data), wx.navigateTo({ url: "/pages/analysis/analysis", events: { acceptDataFromOpenedPage: function(e) { console.log(e); }, someEvent: function(e) { console.log(e); } }, success: function(e) { a.setData({ inputValue: "", isInput: 0 }), a.saveCache(s), e.eventChannel.emit("acceptDataFromOpenerPage", { data: t.data }); } })) : wx.showModal({ title: "解析失败", content: "解析失败,可能是因为:1、链接错误或暂时不支持平台2、作品还未审核通过3、作品已经被删除了---如有问题,请联系我们的客服【xiaoyaozz】", success(e) { e.confirm && a.copyBtn(1, "xiaoyaozz"); } }); } }); }, clear() { this.setData({ inputValue: "", isInput: 0 }); }, copyBtn(e, t) { let a = t || e.target.dataset.kefu; wx.setClipboardData({ data: a, success: function(e) { wx.showToast({ title: "【客服微信】复制成功", icon: "none", mask: "true" }); } }); }, onLoad() { wx.getUserProfile && this.setData({ canIUseGetUserProfile: !0 }); let e = null; wx.createInterstitialAd && (e = wx.createInterstitialAd({ adUnitId: "" }), e.onLoad(() => {}), e.onError(e => {}), e.onClose(() => {})), e && e.show().catch(e => { console.error(e); }); }, getUserProfile(e) { wx.getUserProfile({ desc: "展示用户信息", success: e => { console.log(e), this.setData({ userInfo: e.userInfo, hasUserInfo: !0 }); } }); }, getUserInfo(e) { console.log(e), this.setData({ userInfo: e.detail.userInfo, hasUserInfo: !0 }); } }); }();

他这个有极客API有一个 KEY 需要 充值 才能用,所以有一段是

let s = t || a.data.inputValue; console.log("一键去水印", s), wx.request({ url: "https://api.wxshares.com/api/qsy/as", data: { key: "xfwu0IxYvaYYpwaXsPjwY4dIUR", url: s },

怎么CODE显示的这么烦啊,怎么格式化显示出来。

@Evil0ctal
Copy link
Owner

这个你得自己去处理了,你可以观察一下本项目的响应报文内容然后修改你的js代码

@xiaoyaozz
Copy link
Author

对我来说太难了,哎呀~

@xiaoyaozz
Copy link
Author

你是怎么学会这个的,

@Evil0ctal
Copy link
Owner

你试试ChatGPT吧

@xiaoyaozz
Copy link
Author

好的,感谢大佬
你真是太好了。

@xiaoyaozz
Copy link
Author

搞定了大佬,我研究了一天,真是太难搞了,用了GPT3.5

@wojiadexiaoming
Copy link

怎么做的求带

@zcunyi
Copy link

zcunyi commented Jul 12, 2024

搞定了大佬,我研究了一天,真是太难搞了,用了GPT3.5

牛逼了,交流一下,可以嘛

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

No branches or pull requests

4 participants