index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. __name: "index",
  5. setup(__props) {
  6. const url = common_vendor.ref("");
  7. common_vendor.onLoad((query) => {
  8. url.value = decodeURIComponent(query.url);
  9. });
  10. function messaged(e) {
  11. if (e.detail.data.length > 0) {
  12. common_vendor.index.setStorageSync("wxCode", e.detail.data[0].date.code);
  13. common_vendor.index.__f__("log", "at pages/webview/index.vue:19", "e.detail", e.detail);
  14. } else {
  15. common_vendor.index.showToast({
  16. title: "授权失败!",
  17. icon: "none"
  18. });
  19. }
  20. }
  21. function onBinderror(e) {
  22. common_vendor.index.showModal({
  23. title: e.detail.fullUrl,
  24. content: "无法打开当前域名 请复制链接,到浏览器打开",
  25. cancelText: "返回",
  26. confirmText: "复制链接",
  27. success: (res) => {
  28. if (res.confirm) {
  29. common_vendor.index.setClipboardData({
  30. data: e.detail.fullUrl,
  31. showToast: false,
  32. success: () => {
  33. common_vendor.index.showToast({
  34. title: "已复制链接,快去浏览器打开吧",
  35. icon: "none"
  36. });
  37. }
  38. });
  39. } else {
  40. common_vendor.index.navigateBack();
  41. }
  42. }
  43. });
  44. }
  45. return (_ctx, _cache) => {
  46. return {
  47. a: url.value,
  48. b: common_vendor.o(onBinderror),
  49. c: common_vendor.o(messaged)
  50. };
  51. };
  52. }
  53. };
  54. wx.createPage(_sfc_main);
  55. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/webview/index.js.map