mb-js-bridge
Advanced tools
Comparing version 5.0.3 to 5.0.6
/*! | ||
* mb-js-bridge | ||
* | ||
* @version 5.0.3 | ||
* @version 5.0.6 | ||
* @copyright MicroBenefits | ||
*/ | ||
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Bridge=t():n.Bridge=t()}("undefined"!=typeof self?self:this,function(){return function(n){function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};return t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:i})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=3)}([function(n,t,e){"use strict";function i(){var n=navigator.userAgent;return/MicroBenefitsCIQ/.test(n)?"ciq":/MicroMessenger/.test(n)?"wechat":""}var o=e(8),r=e(9),a={ciq:o.a,wechat:r.a},c="";t.a=function(n,t,e,o){if(console.log(arguments),void 0===e&&(e=!0),void 0===o&&(o=!0),c||(c=i()),!c||void 0===a[c])return null;try{var r=a[c],u=r(e?"JS_BRIDGE_"+n:n,t);return o&&u&&"string"==typeof u?JSON.parse(u):u}catch(n){return console.warn(n),null}}},function(n,t,e){"use strict";t.a=function(){if("file:"===location.protocol)return!0;return!!new RegExp(atob("KFwuaWZ1bGlcLmNufFwuaXdlaWJhbmdcLmNvbXxcLm1lXC5jb218MTkyXC4xNjhcLlxkezEsM31cLlxkezEsM30oOlxkezEsNX0pPykk")).test(location.host)}},function(n,t,e){"use strict";function i(n,t){t=Object.assign({},{type:n||"GET",url:"",headers:{},data:"",withSignature:!1,timeout:1e4,withCredentials:!1,success:u,error:u,complete:u},t);var e=new XMLHttpRequest;e.open(t.type,t.url),e.timeout=t.timeout;var i=Object(r.a)("GET_USER")||{},a=Object.assign({},{appName:i.appName||"ciq3",appVersion:i.appVersion||"",sysType:i.sysType||"",sysVersion:i.sysVersion||"",deviceId:i.deviceId||"",sessionId:i.sessionId||"",lang:i.lang||"zh"},t.headers);t.withSignature&&(a.sign=o(t.data));var c=null;t.data&&("object"==typeof t.data?/json/i.test(a["Content-type"])?c=JSON.stringify(t.data):(a["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",c=new URLSearchParams(t.data).toString()):c=t.data);for(var s in a)a.hasOwnProperty(s)&&e.setRequestHeader(s,a[s]);e.send(c),e.onreadystatechange=function(){if(4===e.readyState&&e.responseText)try{var n=JSON.parse(e.responseText);t.success(n,e),t.complete(e)}catch(n){t.success(e.responseText,e),t.complete(e)}},e.ontimeout=function(n){t.error(n,e),t.complete(e)},e.onerror=function(n){t.error(n,e),t.complete(e)}}function o(n){var t=Object.keys(n).sort().map(function(t){return t+"="+n[t]}).join("&");return c()("tQbPwzcmERdu",t)}var r=e(0),a=e(12),c=e.n(a),u=function(){};t.a={post:function(n,t,e){"object"!=typeof n||t||e?Object.assign(e,{url:n,data:t}):e=n,i("POST",e)},get:function(n,t){"object"!=typeof n||t?Object.assign(t,{url:n}):t=n,i("GET",t)},ajax:function(n){i("",n)}}},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(4),o=(e.n(i),e(6)),r=(e.n(o),e(7)),a=e(0),c=e(2);Object(a.a)("INIT",null,!1);var u={version:"5.0.3",openPage:r.a,ajax:c.a,getSession:function(){return Object(a.a)("GET_USER")},setSession:function(n){return Object(a.a)("SET_USER",n)},getUserInfo:function(){return Object(a.a)("GET_USER_INFO")},sessionInvalid:function(){Object(a.a)("SESSION_INVALID")},setCallbackArgs:function(n){Object(a.a)("CALLBACK_ARGUMENTS",{arguments:n})},closePage:function(){Object(a.a)("CLOSE_WINDOW")},log:function(n){Object(a.a)("LOG",n)},uploadImage:function(n){if("function"!=typeof n)throw new Error("UploadImage callback must be a function");Object(a.a)("UPLOAD_PIC",{callback:n})},showImage:function(n,t){Object(a.a)("SHOW_IMAGE",{imageUrl:n,currentPos:t})},takeShortVideo:function(){return Object(a.a)("TAKE_SHORT_VIDEO")},getNetState:function(){return Object(a.a)("NET_STATE")},getLocation:function(){return Object(a.a)("LOCATION")},showLoading:function(){Object(a.a)("OPEN_LOADING")},hideLoading:function(){Object(a.a)("CLOSE_LOADING")},hideTitleBar:function(){Object(a.a)("HIDE_TITLE_BAR")},share:function(n,t,e,i){return Object(a.a)("SHARE",{url:n,title:t,desc:e||"",image:i||""})},eventsStatistic:function(n,t){return Object(a.a)("EVENTS_STATISTIC",{eventName:n,properties:t||{}})},getDecryptValue:function(n,t){return Object(a.a)("DECRYPT_DATA",{key:n,data:t})},onClosePage:function(n){if("function"!=typeof n)return void console.error("onCloseWindow callback must be a function");window._$onCloseWindowEvent=function(){n()},prompt("JS_BRIDGE_INTERCEPT_CLOSE_WINDOW_EVENT",'{"func":"_$onCloseWindowEvent"}')},getContact:function(){return Object(a.a)("SELECT_CONTACT")}};t.default=u},function(n,t,e){(function(n){!function(n){"use strict";function t(n){n=n||"",(n instanceof URLSearchParams||n instanceof t)&&(n=n.toString()),this[f]=r(n)}function e(n){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'\(\)~]|%20|%00/g,function(n){return t[n]})}function i(n){return decodeURIComponent(n.replace(/\+/g," "))}function o(t){var e={next:function(){var n=t.shift();return{done:void 0===n,value:n}}};return I&&(e[n.Symbol.iterator]=function(){return e}),e}function r(n){var t={};if("object"==typeof n){for(var e in n)if(n.hasOwnProperty(e)){var o="string"==typeof n[e]?n[e]:JSON.stringify(n[e]);a(t,e,o)}}else{0===n.indexOf("?")&&(n=n.slice(1));for(var r=n.split("&"),c=0;c<r.length;c++){var u=r[c],s=u.indexOf("=");-1<s?a(t,i(u.slice(0,s)),i(u.slice(s+1))):u&&a(t,i(u),"")}}return t}function a(n,t,e){t in n?n[t].push(""+e):n[t]=[""+e]}var c=n.URLSearchParams?n.URLSearchParams:null,u=c&&"a=1"===new c({a:1}).toString(),s=c&&"+"===new c("s=%2B").get("s"),f="__URLSearchParams__",l=t.prototype,I=!(!n.Symbol||!n.Symbol.iterator);if(!(c&&u&&s)){l.append=function(n,t){a(this[f],n,t)},l.delete=function(n){delete this[f][n]},l.get=function(n){var t=this[f];return n in t?t[n][0]:null},l.getAll=function(n){var t=this[f];return n in t?t[n].slice(0):[]},l.has=function(n){return n in this[f]},l.set=function(n,t){this[f][n]=[""+t]},l.toString=function(){var n,t,i,o,r=this[f],a=[];for(t in r)for(i=e(t),n=0,o=r[t];n<o.length;n++)a.push(i+"="+e(o[n]));return a.join("&")};var d=!s,p=!d&&c&&!u&&n.Proxy;n.URLSearchParams=p?new Proxy(c,{construct:function(n,e){return new n(new t(e[0]).toString())}}):t;var g=n.URLSearchParams.prototype;g.polyfill=!0,g.forEach=g.forEach||function(n,t){var e=r(this.toString());Object.getOwnPropertyNames(e).forEach(function(i){e[i].forEach(function(e){n.call(t,e,i,this)},this)},this)},g.sort=g.sort||function(){var n,t,e,i=r(this.toString()),o=[];for(n in i)o.push(n);for(o.sort(),t=0;t<o.length;t++)this.delete(o[t]);for(t=0;t<o.length;t++){var a=o[t],c=i[a];for(e=0;e<c.length;e++)this.append(a,c[e])}},g.keys=g.keys||function(){var n=[];return this.forEach(function(t,e){n.push([e])}),o(n)},g.values=g.values||function(){var n=[];return this.forEach(function(t){n.push([t])}),o(n)},g.entries=g.entries||function(){var n=[];return this.forEach(function(t,e){n.push([e,t])}),o(n)},I&&(g[n.Symbol.iterator]=g[n.Symbol.iterator]||g.entries)}}(void 0!==n?n:"undefined"!=typeof window?window:this)}).call(t,e(5))},function(n,t){var e;e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(n){"object"==typeof window&&(e=window)}n.exports=e},function(n,t){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(n,t){"use strict";if(null==n)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(n),i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o)for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},writable:!0,configurable:!0})},function(n,t,e){"use strict";function i(n,t){Object(o.a)("OPEN_PAGE",{pageName:n,data:t||{}})}var o=e(0);i.webPage=function(n,t,e){i("WEB_PAGE",Object.assign({url:n,title:t},e))},i.scanning=function(){i("SCANING")},i.userCenter=function(n,t,e){i("USERCENTER",{userId:n,avatar:t,realName:e})},i.taskList=function(){i("TASK")},i.task=function(n){i("TASK_DETAIL",n)},i.courseLibrary=function(){i("COURSE")},i.courseSet=function(n,t,e,o){i("COURSE_SET_DETAIL",{id:n,title:t,thumb:e,categoryName:o||""})},i.userCenter=function(n,t,e){i("USERCENTER",{userId:n,avatar:t,realName:e})},i.achievement=function(n){i("ACHIEVEMENT",n)},i.comment=function(n,t,e,i){var o;o="object"!=typeof n||t||e||i?{topicId:n,title:t,isAudit:e,limitTime:i||""}:n,prompt("JS_BRIDGE_OPEN_COMMENT",JSON.stringify(o))},i.chat=function(n,t){i("PERSON_CHAT",{fId:n,fName:t})},i.groupChat=function(n,t){i("GROUP_CHAT",{tId:n,tName:t})},t.a=i},function(n,t,e){"use strict";var i=e(1),o=window.prompt,r=JSON.stringify,a=!0,c={INIT:function(){Object(i.a)()||(a=!1)},JS_BRIDGE_UPLOAD_PIC:function(n){var t=n.callback;window._$uploadPicHandler=function(n){try{var e=JSON.parse(n);t(e.imgUrl)}catch(n){t("")}};var e=o("JS_BRIDGE_UPLOAD_PIC",r({callback:"_$uploadPicHandler"}));e&&window._$uploadPicHandler(e)},JS_BRIDGE_SHOW_IMAGE:function(n){var t=n.imageUrl,e=n.currentPos;return"object"==typeof t&&t.length&&t.length>0?(void 0===e&&(e=0),o("JS_BRIDGE_OPEN_IMAGE_LIST",r({data:t,currImgUrl:"number"==typeof e?t[e]:e}))):o("JS_BRIDGE_OPEN_IMAGE",r({imgUrl:t}))}};t.a=function(n,t){return a?"function"==typeof c[n]?c[n](t):o(n,r(t)):null}},function(n,t,e){"use strict";function i(n,t){if("function"==typeof m[n]){var e=["INIT","JS_BRIDGE_GET_USER","JS_BRIDGE_SET_USER","JS_BRIDGE_OPEN_PAGE","JS_BRIDGE_OPEN_LOADING","JS_BRIDGE_CLOSE_LOADING"];return S?!g&&e.indexOf(n)<0?(h.push([n,t]),console.info("Wechat invoking is cached"),null):m[n](t):null}return null}function o(){var n=location.host.match(/^(intl-)?[^.]+(\.[a-z.]+)$/i);return n?location.protocol+"//"+(n[1]?"intl-":"")+"ciqapi"+n[2]+"/":""}function r(){return o().replace(/ciqapi/i,"wechat")}function a(){var n=location.host.split(".");return n.shift(),"."+n.join(".")}function c(){var n=document.createElement("style");n.innerHTML="@-webkit-keyframes __jsBridgeLoading {0% {-webkit-transform: rotate3d(0, 0, 1, 0deg);} 100% {-webkit-transform: rotate3d(0, 0, 1, 360deg);}}@keyframes __jsBridgeLoading {0% {transform: rotate3d(0, 0, 1, 0deg);} 100% {transform: rotate3d(0, 0, 1, 360deg);}}.__bridge-mask_transparent {margin: 0; padding: 0; position: fixed; z-index: 1000; top: 0; right: 0; left: 0; bottom: 0}.__bridge-toast {margin: 0; padding: 0; position: fixed; z-index: 5000; width: 100px; height: 100px; top: 180px; left: 50%; margin-left: -3.8em; background: rgba(17, 17, 17, 0.7); text-align: center; border-radius: 5px; color: #FFFFFF;}.__bridge-icon-loading {margin: 30px 0 0; padding: 0; width: 38px; height: 38px; vertical-align: baseline; display: inline-block; -webkit-animation: __jsBridgeLoading 1s steps(12, end) infinite; animation: __jsBridgeLoading 1s steps(12, end) infinite; background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat; background-size: 100%}",document.head.appendChild(n)}function u(){var n=document.getElementById("__BRIDGE_LOADING");return n||(n=document.createElement("div"),n.id="__BRIDGE_LOADING",n.style.display="none",n.innerHTML='<div class="__bridge-mask_transparent"></div><div class="__bridge-toast"><i class="__bridge-icon-loading"></i></div>',document.body.appendChild(n),n)}var s=e(10),f=e.n(s),l=e(11),I=e.n(l),d=e(2),p=e(1),g=!1,S=!0,h=[],m={INIT:function(){Object(p.a)()||(S=!1),f()("//res.wx.qq.com/open/js/jweixin-1.2.0.js",function(){d.a.get({url:r()+"api/wechat/get-js-signature?url="+encodeURIComponent(location.href),success:function(n){console.log(n),wx.config(n),wx.ready(function(){for(g=!0;h.length;){var n=h.shift();i.apply(null,n)}}),wx.error(function(n){console.error(n)})}})}),window.prompt=function(n,t){try{t&&(t=JSON.parse(t))}catch(n){}i(n,t)},c()},JS_BRIDGE_GET_USER:function(){var n=I.a.get(),t={};for(var e in n)n.hasOwnProperty(e)&&"wap_"===e.substr(0,4)&&(t[e.substr(4)]=n[e]);return Object.assign({},{appName:"ciq3",appVersion:"wechat",sysType:"wechat",sysVersion:"0",deviceId:"WECHAT",sessionId:"",lang:"zh",domain:o()},t)},JS_BRIDGE_SET_USER:function(n){for(var t in n)n.hasOwnProperty(t)&&I.a.set("wap_"+t,n[t],{expires:1,path:"/",domain:a()})},JS_BRIDGE_OPEN_PAGE:function(n){var t=n.pageName,e=n.data||{};switch(t){case"WEB_PAGE":location.href=e.url}},JS_BRIDGE_OPEN_LOADING:function(){u().style.display="block"},JS_BRIDGE_CLOSE_LOADING:function(){u().style.display="none"},JS_BRIDGE_CLOSE_WINDOW:function(){wx.closeWindow()},JS_BRIDGE_UPLOAD_PIC:function(n){var t=n.callback;wx.chooseImage({count:1,sizeType:["compressed"],success:function(n){var e=n.localIds[0];wx.uploadImage({localId:e,success:function(n){var e=n.serverId;console.log(n),d.a.get({url:r()+"api/wechat/upload-image?media_id="+e,success:function(n){console.log("get data from server"),console.log(n),200===n.status&&t(n.data.imgUrl)}})}})}})},JS_BRIDGE_SHOW_IMAGE:function(n){var t=n.imageUrl,e=n.currentPos;"string"==typeof t&&(t=[t]),wx.previewImage({urls:t,current:("number"==typeof e?t[e]:e)||""})}};t.a=i},function(n,t,e){var i,o;/*! | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Bridge=e():n.Bridge=e()}("undefined"!=typeof self?self:this,function(){return function(n){function e(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var t={};return e.m=n,e.c=t,e.d=function(n,t,i){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="",e(e.s=3)}([function(n,e,t){"use strict";function i(){var n=navigator.userAgent;return/MicroBenefitsCIQ/.test(n)?"ciq":/MicroMessenger/.test(n)?"wechat":""}var o=t(8),r=t(9),a={ciq:o.a,wechat:r.a},c="";e.a=function(n,e,t,o){if(console.log(arguments),void 0===t&&(t=!0),void 0===o&&(o=!0),c||(c=i()),!c||void 0===a[c])return null;try{var r=a[c],u=r(t?"JS_BRIDGE_"+n:n,e);return o&&u&&"string"==typeof u?JSON.parse(u):u}catch(n){return console.warn(n),null}}},function(n,e,t){"use strict";e.a=function(){if("file:"===location.protocol)return!0;return!!new RegExp(atob("KFwuaWZ1bGlcLmNufFwuaXdlaWJhbmdcLmNvbXxcLm1lXC5jb218MTkyXC4xNjhcLlxkezEsM31cLlxkezEsM30oOlxkezEsNX0pPykk")).test(location.host)}},function(n,e,t){"use strict";function i(n,e){e=Object.assign({},{type:n||"GET",url:"",headers:{},data:"",withSignature:!1,timeout:1e4,withCredentials:!1,success:u,error:u,complete:u},e);var t=new XMLHttpRequest;t.open(e.type,e.url),t.timeout=e.timeout;var i=Object(r.a)("GET_USER")||{},a=Object.assign({},{appName:i.appName||"ciq3",appVersion:i.appVersion||"",sysType:i.sysType||"",sysVersion:i.sysVersion||"",deviceId:i.deviceId||"",sessionId:i.sessionId||"",lang:i.lang||"zh"},e.headers);e.withSignature&&(a.sign=o(e.data));var c=null;e.data&&("object"==typeof e.data?/json/i.test(a["Content-type"])?c=JSON.stringify(e.data):(a["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",c=new URLSearchParams(e.data).toString()):c=e.data);for(var s in a)a.hasOwnProperty(s)&&t.setRequestHeader(s,a[s]);t.send(c),t.onreadystatechange=function(){if(4===t.readyState&&t.responseText)try{var n=JSON.parse(t.responseText);e.success(n,t),e.complete(t)}catch(n){e.success(t.responseText,t),e.complete(t)}},t.ontimeout=function(n){e.error(n,t),e.complete(t)},t.onerror=function(n){e.error(n,t),e.complete(t)}}function o(n){var e=Object.keys(n).sort().map(function(e){return e+"="+n[e]}).join("&");return c()("tQbPwzcmERdu",e)}var r=t(0),a=t(12),c=t.n(a),u=function(){};e.a={post:function(n,e,t){"object"!=typeof n||e||t?Object.assign(t,{url:n,data:e}):t=n,i("POST",t)},get:function(n,e){"object"!=typeof n||e?Object.assign(e,{url:n}):e=n,i("GET",e)},ajax:function(n){i("",n)}}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t(4),o=(t.n(i),t(6)),r=(t.n(o),t(7)),a=t(0),c=t(2);Object(a.a)("INIT",null,!1);var u={version:"5.0.6",openPage:r.a,ajax:c.a,getSession:function(){return Object(a.a)("GET_USER")},setSession:function(n){return Object(a.a)("SET_USER",n)},getUserInfo:function(){return Object(a.a)("GET_USER_INFO")},sessionInvalid:function(){Object(a.a)("SESSION_INVALID")},setCallbackArgs:function(n){Object(a.a)("CALLBACK_ARGUMENTS",{arguments:n})},closePage:function(){Object(a.a)("CLOSE_WINDOW")},setOperationButton:function(n,e){Object(a.a)("SET_RIGHT_BUTTON",{buttonName:n,callback:e})},log:function(n){Object(a.a)("LOG",n)},uploadImage:function(n){if("function"!=typeof n)throw new Error("UploadImage callback must be a function");Object(a.a)("UPLOAD_PIC",{callback:n})},showImage:function(n,e){Object(a.a)("SHOW_IMAGE",{imageUrl:n,currentPos:e})},takeShortVideo:function(){return Object(a.a)("TAKE_SHORT_VIDEO")},getNetState:function(){return Object(a.a)("NET_STATE")},getLocation:function(){return Object(a.a)("LOCATION")},showLoading:function(){Object(a.a)("OPEN_LOADING")},hideLoading:function(){Object(a.a)("CLOSE_LOADING")},hideTitleBar:function(){Object(a.a)("HIDE_TITLE_BAR")},share:function(n,e,t,i){return Object(a.a)("SHARE",{url:n,title:e,desc:t||"",image:i||""})},eventsStatistic:function(n,e){return Object(a.a)("EVENTS_STATISTIC",{eventName:n,properties:e||{}})},getDecryptValue:function(n,e){return Object(a.a)("DECRYPT_DATA",{key:n,data:e})},onClosePage:function(n){if("function"!=typeof n)return void console.error("onCloseWindow callback must be a function");window._$onCloseWindowEvent=function(){n()},prompt("JS_BRIDGE_INTERCEPT_CLOSE_WINDOW_EVENT",'{"func":"_$onCloseWindowEvent"}')},getContact:function(){return Object(a.a)("SELECT_CONTACT")}};e.default=u},function(n,e,t){(function(n){!function(n){"use strict";function e(n){n=n||"",(n instanceof URLSearchParams||n instanceof e)&&(n=n.toString()),this[l]=r(n)}function t(n){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'\(\)~]|%20|%00/g,function(n){return e[n]})}function i(n){return decodeURIComponent(n.replace(/\+/g," "))}function o(e){var t={next:function(){var n=e.shift();return{done:void 0===n,value:n}}};return I&&(t[n.Symbol.iterator]=function(){return t}),t}function r(n){var e={};if("object"==typeof n){for(var t in n)if(n.hasOwnProperty(t)){var o="string"==typeof n[t]?n[t]:JSON.stringify(n[t]);a(e,t,o)}}else{0===n.indexOf("?")&&(n=n.slice(1));for(var r=n.split("&"),c=0;c<r.length;c++){var u=r[c],s=u.indexOf("=");-1<s?a(e,i(u.slice(0,s)),i(u.slice(s+1))):u&&a(e,i(u),"")}}return e}function a(n,e,t){e in n?n[e].push(""+t):n[e]=[""+t]}var c=n.URLSearchParams?n.URLSearchParams:null,u=c&&"a=1"===new c({a:1}).toString(),s=c&&"+"===new c("s=%2B").get("s"),l="__URLSearchParams__",f=e.prototype,I=!(!n.Symbol||!n.Symbol.iterator);if(!(c&&u&&s)){f.append=function(n,e){a(this[l],n,e)},f.delete=function(n){delete this[l][n]},f.get=function(n){var e=this[l];return n in e?e[n][0]:null},f.getAll=function(n){var e=this[l];return n in e?e[n].slice(0):[]},f.has=function(n){return n in this[l]},f.set=function(n,e){this[l][n]=[""+e]},f.toString=function(){var n,e,i,o,r=this[l],a=[];for(e in r)for(i=t(e),n=0,o=r[e];n<o.length;n++)a.push(i+"="+t(o[n]));return a.join("&")};var d=!s,p=!d&&c&&!u&&n.Proxy;n.URLSearchParams=p?new Proxy(c,{construct:function(n,t){return new n(new e(t[0]).toString())}}):e;var g=n.URLSearchParams.prototype;g.polyfill=!0,g.forEach=g.forEach||function(n,e){var t=r(this.toString());Object.getOwnPropertyNames(t).forEach(function(i){t[i].forEach(function(t){n.call(e,t,i,this)},this)},this)},g.sort=g.sort||function(){var n,e,t,i=r(this.toString()),o=[];for(n in i)o.push(n);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var a=o[e],c=i[a];for(t=0;t<c.length;t++)this.append(a,c[t])}},g.keys=g.keys||function(){var n=[];return this.forEach(function(e,t){n.push([t])}),o(n)},g.values=g.values||function(){var n=[];return this.forEach(function(e){n.push([e])}),o(n)},g.entries=g.entries||function(){var n=[];return this.forEach(function(e,t){n.push([t,e])}),o(n)},I&&(g[n.Symbol.iterator]=g[n.Symbol.iterator]||g.entries)}}(void 0!==n?n:"undefined"!=typeof window?window:this)}).call(e,t(5))},function(n,e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(n){"object"==typeof window&&(t=window)}n.exports=t},function(n,e){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(n,e){"use strict";if(null==n)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o)for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t},writable:!0,configurable:!0})},function(n,e,t){"use strict";function i(n,e){Object(o.a)("OPEN_PAGE",{pageName:n,data:e||{}})}var o=t(0);i.webPage=function(n,e,t){i("WEB_PAGE",Object.assign({url:n,title:e},t))},i.scanning=function(){i("SCANING")},i.userCenter=function(n,e,t){i("USERCENTER",{userId:n,avatar:e,realName:t})},i.taskList=function(){i("TASK")},i.task=function(n){i("TASK_DETAIL",n)},i.courseLibrary=function(){i("COURSE")},i.courseSet=function(n,e,t,o){i("COURSE_SET_DETAIL",{id:n,title:e,thumb:t,categoryName:o||""})},i.userCenter=function(n,e,t){i("USERCENTER",{userId:n,avatar:e,realName:t})},i.achievement=function(n){i("ACHIEVEMENT",n)},i.comment=function(n,e,t,i){var o;o="object"!=typeof n||e||t||i?{topicId:n,title:e,isAudit:t,limitTime:i||""}:n,prompt("JS_BRIDGE_OPEN_COMMENT",JSON.stringify(o))},i.chat=function(n,e){i("PERSON_CHAT",{fId:n,fName:e})},i.groupChat=function(n,e){i("GROUP_CHAT",{tId:n,tName:e})},e.a=i},function(n,e,t){"use strict";var i=t(1),o=window.prompt,r=JSON.stringify,a=!0,c={INIT:function(){Object(i.a)()||(a=!1)},JS_BRIDGE_UPLOAD_PIC:function(n){var e=n.callback;window._$uploadPicHandler=function(n){try{var t=JSON.parse(n);e(t.imgUrl)}catch(n){e("")}};var t=o("JS_BRIDGE_UPLOAD_PIC",r({callback:"_$uploadPicHandler"}));t&&window._$uploadPicHandler(t)},JS_BRIDGE_SHOW_IMAGE:function(n){var e=n.imageUrl,t=n.currentPos;return"object"==typeof e&&e.length&&e.length>0?(void 0===t&&(t=0),o("JS_BRIDGE_OPEN_IMAGE_LIST",r({data:e,currImgUrl:"number"==typeof t?e[t]:t}))):o("JS_BRIDGE_OPEN_IMAGE",r({imgUrl:e}))},JS_BRIDGE_SET_RIGHT_BUTTON:function(n){window._$rightButtonHandler=function(){n.callback()},o("JS_BRIDGE_SET_RIGHT_BUTTON",r({buttonName:n.buttonName,buttonClickHandle:"_$rightButtonHandler"}))}};e.a=function(n,e){return a?"function"==typeof c[n]?c[n](e):o(n,r(e)):null}},function(n,e,t){"use strict";function i(n,e){if("function"==typeof h[n]){var t=["INIT","JS_BRIDGE_GET_USER","JS_BRIDGE_SET_USER","JS_BRIDGE_OPEN_PAGE","JS_BRIDGE_OPEN_LOADING","JS_BRIDGE_CLOSE_LOADING"];return m?!g&&t.indexOf(n)<0?(S.push([n,e]),console.info("Wechat invoking is cached"),null):h[n](e):null}return null}function o(){var n=location.host.match(/^(intl-)?[^.]+(\.[a-z.]+)$/i);return n?location.protocol+"//"+(n[1]?"intl-":"")+"ciqapi"+n[2]+"/":""}function r(){return o().replace(/ciqapi/i,"wechat")}function a(){var n=location.host.split(".");return n.shift(),"."+n.join(".")}function c(){var n=document.createElement("style");n.innerHTML="@-webkit-keyframes __jsBridgeLoading {0% {-webkit-transform: rotate3d(0, 0, 1, 0deg);} 100% {-webkit-transform: rotate3d(0, 0, 1, 360deg);}}@keyframes __jsBridgeLoading {0% {transform: rotate3d(0, 0, 1, 0deg);} 100% {transform: rotate3d(0, 0, 1, 360deg);}}.__bridge-mask_transparent {margin: 0; padding: 0; position: fixed; z-index: 1000; top: 0; right: 0; left: 0; bottom: 0}.__bridge-toast {margin: 0; padding: 0; position: fixed; z-index: 5000; width: 100px; height: 100px; top: 180px; left: 50%; margin-left: -3.8em; background: rgba(17, 17, 17, 0.7); text-align: center; border-radius: 5px; color: #FFFFFF;}.__bridge-icon-loading {margin: 30px 0 0; padding: 0; width: 38px; height: 38px; vertical-align: baseline; display: inline-block; -webkit-animation: __jsBridgeLoading 1s steps(12, end) infinite; animation: __jsBridgeLoading 1s steps(12, end) infinite; background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat; background-size: 100%}",document.head.appendChild(n)}function u(n){var e=document.getElementById(n);return e||(e=document.createElement("div"),e.id=n,e.style.display="none",e.innerHTML='<div class="__bridge-mask_transparent"></div><div class="__bridge-toast"><i class="__bridge-icon-loading"></i></div>',document.body.appendChild(e),e)}var s=t(10),l=t.n(s),f=t(11),I=t.n(f),d=t(2),p=t(1),g=!1,m=!0,S=[],h={INIT:function(){Object(p.a)()||(m=!1),l()("//res.wx.qq.com/open/js/jweixin-1.2.0.js",function(){d.a.get({url:r()+"api/wechat/get-js-signature?url="+encodeURIComponent(location.href),success:function(n){wx.config(n),wx.ready(function(){for(g=!0,wx.hideAllNonBaseMenuItem(),wx.hideMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]});S.length;){var n=S.shift();i.apply(null,n)}}),wx.error(function(n){console.error(n)})}})}),window.prompt=function(n,e){try{e&&(e=JSON.parse(e))}catch(n){}i(n,e)},c()},JS_BRIDGE_GET_USER:function(){var n=I.a.get(),e={};for(var t in n)n.hasOwnProperty(t)&&"wap_"===t.substr(0,4)&&(e[t.substr(4)]=n[t]);return Object.assign({},{appName:"ciq3",appVersion:"wechat",sysType:"wechat",sysVersion:"0",deviceId:"WECHAT",sessionId:"",lang:"zh",domain:o()},e)},JS_BRIDGE_SET_USER:function(n){for(var e in n)n.hasOwnProperty(e)&&I.a.set("wap_"+e,n[e],{expires:1,path:"/",domain:a()})},JS_BRIDGE_OPEN_PAGE:function(n){var e=n.pageName,t=n.data||{};switch(e){case"WEB_PAGE":location.href=t.url}},JS_BRIDGE_OPEN_LOADING:function(){u("__BRIDGE_LOADING").style.display="block"},JS_BRIDGE_CLOSE_LOADING:function(){u("__BRIDGE_LOADING").style.display="none"},JS_BRIDGE_CLOSE_WINDOW:function(){wx.closeWindow()},JS_BRIDGE_UPLOAD_PIC:function(n){var e=n.callback,t=u("__BRIDGE_UPLOAD_LOADING");wx.chooseImage({count:1,sizeType:["compressed"],success:function(n){var i=n.localIds[0];t.style.display="block",wx.uploadImage({localId:i,success:function(n){var i=n.serverId;console.log(n),d.a.get({url:r()+"api/wechat/upload-image?media_id="+i,success:function(n){t.style.display="none",200===n.status?e(n.data.imgUrl):alert(n.message)},error:function(){t.style.display="none"}})},fail:function(){t.style.display="none"}})}})},JS_BRIDGE_SHOW_IMAGE:function(n){var e=n.imageUrl,t=n.currentPos;"string"==typeof e&&(e=[e]),wx.previewImage({urls:e,current:("number"==typeof t?e[t]:t)||""})},JS_BRIDGE_SHARE:function(n){wx.showMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]}),wx.onMenuShareTimeline({title:n.title,link:n.url,imgUrl:n.image,success:function(){}}),wx.onMenuShareAppMessage({title:n.title,desc:n.desc,link:n.url,imgUrl:n.image,type:"link",success:function(){}})}};e.a=i},function(n,e,t){var i,o;/*! | ||
* $script.js JS loader & dependency manager | ||
@@ -12,2 +12,2 @@ * https://github.com/ded/script.js | ||
*/ | ||
!function(r,a){void 0!==n&&n.exports?n.exports=a():(i=a,void 0!==(o="function"==typeof i?i.call(t,e,t,n):i)&&(n.exports=o))}(0,function(){function n(n,t){for(var e=0,i=n.length;e<i;++e)if(!t(n[e]))return u;return 1}function t(t,e){n(t,function(n){return!e(n)})}function e(r,a,c){function u(n){return n.call?n():I[n]}function f(){if(!--m){I[h]=1,S&&S();for(var e in p)n(e.split("|"),u)&&!t(p[e],u)&&(p[e]=[])}}r=r[s]?r:[r];var l=a&&a.call,S=l?a:c,h=l?r.join(""):a,m=r.length;return setTimeout(function(){t(r,function n(t,e){return null===t?f():(e||/^https?:\/\//.test(t)||!o||(t=-1===t.indexOf(".js")?o+t+".js":o+t),g[t]?(h&&(d[h]=1),2==g[t]?f():setTimeout(function(){n(t,!0)},0)):(g[t]=1,h&&(d[h]=1),void i(t,f)))})},0),e}function i(n,t){var e,i=a.createElement("script");i.onload=i.onerror=i[l]=function(){i[f]&&!/^c|loade/.test(i[f])||e||(i.onload=i[l]=null,e=1,g[n]=2,t())},i.async=1,i.src=r?n+(-1===n.indexOf("?")?"?":"&")+r:n,c.insertBefore(i,c.lastChild)}var o,r,a=document,c=a.getElementsByTagName("head")[0],u=!1,s="push",f="readyState",l="onreadystatechange",I={},d={},p={},g={};return e.get=i,e.order=function(n,t,i){!function o(r){r=n.shift(),n.length?e(r,o):e(r,t,i)}()},e.path=function(n){o=n},e.urlArgs=function(n){r=n},e.ready=function(i,o,r){i=i[s]?i:[i];var a=[];return!t(i,function(n){I[n]||a[s](n)})&&n(i,function(n){return I[n]})?o():function(n){p[n]=p[n]||[],p[n][s](o),r&&r(a)}(i.join("|")),e},e.done=function(n){e([null],n)},e})},function(n,t,e){var i,o;!function(r){var a=!1;if(i=r,void 0!==(o="function"==typeof i?i.call(t,e,t,n):i)&&(n.exports=o),a=!0,n.exports=r(),a=!0,!a){var c=window.Cookies,u=window.Cookies=r();u.noConflict=function(){return window.Cookies=c,u}}}(function(){function n(){for(var n=0,t={};n<arguments.length;n++){var e=arguments[n];for(var i in e)t[i]=e[i]}return t}function t(e){function i(t,o,r){var a;if("undefined"!=typeof document){if(arguments.length>1){if(r=n({path:"/"},i.defaults,r),"number"==typeof r.expires){var c=new Date;c.setMilliseconds(c.getMilliseconds()+864e5*r.expires),r.expires=c}r.expires=r.expires?r.expires.toUTCString():"";try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(n){}o=e.write?e.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape);var u="";for(var s in r)r[s]&&(u+="; "+s,!0!==r[s]&&(u+="="+r[s]));return document.cookie=t+"="+o+u}t||(a={});for(var f=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,I=0;I<f.length;I++){var d=f[I].split("="),p=d.slice(1).join("=");this.json||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var g=d[0].replace(l,decodeURIComponent);if(p=e.read?e.read(p,g):e(p,g)||p.replace(l,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(n){}if(t===g){a=p;break}t||(a[g]=p)}catch(n){}}return a}}return i.set=i,i.get=function(n){return i.call(i,n)},i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(t,e){i(t,"",n(e,{expires:-1}))},i.withConverter=t,i}return t(function(){})})},function(n,t){function e(n,t,e,i){function o(n,t,e,i){return n<20?t&e|~t&i:n<40?t^e^i:n<60?t&e|t&i|e&i:t^e^i}function r(n){return n<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514}function a(n,t){var e=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(e>>16)<<16|65535&e}function c(n,t){return n<<t|n>>>32-t}function u(n,t){n[t>>5]|=128<<24-t%32,n[15+(t+64>>9<<4)]=t;for(var e=[80],i=1732584193,u=-271733879,s=-1732584194,f=271733878,l=-1009589776,I=0;I<n.length;I+=16){for(var d=i,p=u,g=s,S=f,h=l,m=0;m<80;m++){e[m]=m<16?n[I+m]:c(e[m-3]^e[m-8]^e[m-14]^e[m-16],1);var v=a(a(c(i,5),o(m,u,s,f)),a(a(l,e[m]),r(m)));l=f,f=s,s=c(u,30),u=i,i=v}i=a(i,d),u=a(u,p),s=a(s,g),f=a(f,S),l=a(l,h)}return[i,u,s,f,l]}function s(n){for(var t=[],e=(1<<i)-1,o=0;o<n.length*i;o+=i)t[o>>5]|=(n.charCodeAt(o/8)&e)<<32-i-o%32;return t}function f(n,t){var e=s(n);e.length>16&&(e=u(e,n.length*i));for(var o=[16],r=[16],a=0;a<16;a++)o[a]=909522486^e[a],r[a]=1549556828^e[a];var c=u(o.concat(s(t)),512+t.length*i);return u(r.concat(c),672)}function l(n){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="",o=0;o<4*n.length;o+=3)for(var r=(n[o>>2]>>8*(3-o%4)&255)<<16|(n[o+1>>2]>>8*(3-(o+1)%4)&255)<<8|n[o+2>>2]>>8*(3-(o+2)%4)&255,a=0;a<4;a++)8*o+6*a>32*n.length?i+=e:i+=t.charAt(r>>6*(3-a)&63);return i}return e||(e="="),i||(i=8),function(n,t){return l(f(n,t))}(n,t)}n.exports=e}]).default}); | ||
!function(r,a){void 0!==n&&n.exports?n.exports=a():(i=a,void 0!==(o="function"==typeof i?i.call(e,t,e,n):i)&&(n.exports=o))}(0,function(){function n(n,e){for(var t=0,i=n.length;t<i;++t)if(!e(n[t]))return u;return 1}function e(e,t){n(e,function(n){return!t(n)})}function t(r,a,c){function u(n){return n.call?n():I[n]}function l(){if(!--h){I[S]=1,m&&m();for(var t in p)n(t.split("|"),u)&&!e(p[t],u)&&(p[t]=[])}}r=r[s]?r:[r];var f=a&&a.call,m=f?a:c,S=f?r.join(""):a,h=r.length;return setTimeout(function(){e(r,function n(e,t){return null===e?l():(t||/^https?:\/\//.test(e)||!o||(e=-1===e.indexOf(".js")?o+e+".js":o+e),g[e]?(S&&(d[S]=1),2==g[e]?l():setTimeout(function(){n(e,!0)},0)):(g[e]=1,S&&(d[S]=1),void i(e,l)))})},0),t}function i(n,e){var t,i=a.createElement("script");i.onload=i.onerror=i[f]=function(){i[l]&&!/^c|loade/.test(i[l])||t||(i.onload=i[f]=null,t=1,g[n]=2,e())},i.async=1,i.src=r?n+(-1===n.indexOf("?")?"?":"&")+r:n,c.insertBefore(i,c.lastChild)}var o,r,a=document,c=a.getElementsByTagName("head")[0],u=!1,s="push",l="readyState",f="onreadystatechange",I={},d={},p={},g={};return t.get=i,t.order=function(n,e,i){!function o(r){r=n.shift(),n.length?t(r,o):t(r,e,i)}()},t.path=function(n){o=n},t.urlArgs=function(n){r=n},t.ready=function(i,o,r){i=i[s]?i:[i];var a=[];return!e(i,function(n){I[n]||a[s](n)})&&n(i,function(n){return I[n]})?o():function(n){p[n]=p[n]||[],p[n][s](o),r&&r(a)}(i.join("|")),t},t.done=function(n){t([null],n)},t})},function(n,e,t){var i,o;!function(r){var a=!1;if(i=r,void 0!==(o="function"==typeof i?i.call(e,t,e,n):i)&&(n.exports=o),a=!0,n.exports=r(),a=!0,!a){var c=window.Cookies,u=window.Cookies=r();u.noConflict=function(){return window.Cookies=c,u}}}(function(){function n(){for(var n=0,e={};n<arguments.length;n++){var t=arguments[n];for(var i in t)e[i]=t[i]}return e}function e(t){function i(e,o,r){var a;if("undefined"!=typeof document){if(arguments.length>1){if(r=n({path:"/"},i.defaults,r),"number"==typeof r.expires){var c=new Date;c.setMilliseconds(c.getMilliseconds()+864e5*r.expires),r.expires=c}r.expires=r.expires?r.expires.toUTCString():"";try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(n){}o=t.write?t.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape);var u="";for(var s in r)r[s]&&(u+="; "+s,!0!==r[s]&&(u+="="+r[s]));return document.cookie=e+"="+o+u}e||(a={});for(var l=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,I=0;I<l.length;I++){var d=l[I].split("="),p=d.slice(1).join("=");this.json||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var g=d[0].replace(f,decodeURIComponent);if(p=t.read?t.read(p,g):t(p,g)||p.replace(f,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(n){}if(e===g){a=p;break}e||(a[g]=p)}catch(n){}}return a}}return i.set=i,i.get=function(n){return i.call(i,n)},i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(e,t){i(e,"",n(t,{expires:-1}))},i.withConverter=e,i}return e(function(){})})},function(n,e){function t(n,e,t,i){function o(n,e,t,i){return n<20?e&t|~e&i:n<40?e^t^i:n<60?e&t|e&i|t&i:e^t^i}function r(n){return n<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514}function a(n,e){var t=(65535&n)+(65535&e);return(n>>16)+(e>>16)+(t>>16)<<16|65535&t}function c(n,e){return n<<e|n>>>32-e}function u(n,e){n[e>>5]|=128<<24-e%32,n[15+(e+64>>9<<4)]=e;for(var t=[80],i=1732584193,u=-271733879,s=-1732584194,l=271733878,f=-1009589776,I=0;I<n.length;I+=16){for(var d=i,p=u,g=s,m=l,S=f,h=0;h<80;h++){t[h]=h<16?n[I+h]:c(t[h-3]^t[h-8]^t[h-14]^t[h-16],1);var y=a(a(c(i,5),o(h,u,s,l)),a(a(f,t[h]),r(h)));f=l,l=s,s=c(u,30),u=i,i=y}i=a(i,d),u=a(u,p),s=a(s,g),l=a(l,m),f=a(f,S)}return[i,u,s,l,f]}function s(n){for(var e=[],t=(1<<i)-1,o=0;o<n.length*i;o+=i)e[o>>5]|=(n.charCodeAt(o/8)&t)<<32-i-o%32;return e}function l(n,e){var t=s(n);t.length>16&&(t=u(t,n.length*i));for(var o=[16],r=[16],a=0;a<16;a++)o[a]=909522486^t[a],r[a]=1549556828^t[a];var c=u(o.concat(s(e)),512+e.length*i);return u(r.concat(c),672)}function f(n){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="",o=0;o<4*n.length;o+=3)for(var r=(n[o>>2]>>8*(3-o%4)&255)<<16|(n[o+1>>2]>>8*(3-(o+1)%4)&255)<<8|n[o+2>>2]>>8*(3-(o+2)%4)&255,a=0;a<4;a++)8*o+6*a>32*n.length?i+=t:i+=e.charAt(r>>6*(3-a)&63);return i}return t||(t="="),i||(i=8),function(n,e){return f(l(n,e))}(n,e)}n.exports=t}]).default}); |
@@ -85,2 +85,15 @@ /** | ||
/** | ||
* 设置右上角操作按钮 | ||
* | ||
* @since v5.0.6 | ||
* @param buttonName | ||
* @param callback | ||
*/ | ||
setOperationButton: function (buttonName, callback) { | ||
callBridge('SET_RIGHT_BUTTON', { | ||
buttonName: buttonName, | ||
callback: callback | ||
}); | ||
}, | ||
@@ -87,0 +100,0 @@ /** |
@@ -48,2 +48,3 @@ /** | ||
/** | ||
* 设置右上角操作按钮 | ||
* | ||
@@ -70,2 +71,13 @@ * @param data | ||
})); | ||
}, | ||
JS_BRIDGE_SET_RIGHT_BUTTON: function(params) { | ||
window._$rightButtonHandler = function() { | ||
params.callback() | ||
} | ||
p('JS_BRIDGE_SET_RIGHT_BUTTON', s({ | ||
buttonName: params.buttonName, | ||
buttonClickHandle: '_$rightButtonHandler' | ||
})) | ||
} | ||
@@ -72,0 +84,0 @@ } |
@@ -32,3 +32,2 @@ /** | ||
success: function(data) { | ||
console.log(data); | ||
wx.config(data) | ||
@@ -39,2 +38,12 @@ | ||
// 隐藏所有非基础按钮 | ||
wx.hideAllNonBaseMenuItem(); | ||
wx.hideMenuItems({ | ||
menuList: [ | ||
"menuItem:share:appMessage", | ||
"menuItem:share:timeline" | ||
] | ||
}) | ||
// 执行保存在 stack 中的调用 | ||
@@ -134,3 +143,3 @@ while (callStack.length) { | ||
JS_BRIDGE_OPEN_LOADING: function() { | ||
var $loading = getLoadingDOM() | ||
var $loading = getLoadingDOM('__BRIDGE_LOADING') | ||
$loading.style.display = 'block' | ||
@@ -143,3 +152,3 @@ }, | ||
JS_BRIDGE_CLOSE_LOADING: function() { | ||
var $loading = getLoadingDOM() | ||
var $loading = getLoadingDOM('__BRIDGE_LOADING') | ||
$loading.style.display = 'none' | ||
@@ -153,3 +162,4 @@ }, | ||
JS_BRIDGE_UPLOAD_PIC: function(data) { | ||
var callback = data.callback; | ||
var callback = data.callback, | ||
$loading = getLoadingDOM('__BRIDGE_UPLOAD_LOADING') | ||
@@ -161,4 +171,6 @@ // 选择图片 | ||
success: function(res) { | ||
var localId = res.localIds[0] | ||
var localId = res.localIds[0]; | ||
$loading.style.display = 'block'; | ||
// 上传图片 | ||
@@ -174,12 +186,18 @@ wx.uploadImage({ | ||
success: function(data) { | ||
console.log('get data from server') | ||
console.log(data) | ||
$loading.style.display = 'none' | ||
if (data.status === 200) { | ||
callback(data.data.imgUrl) | ||
} else { | ||
alert(data.message) | ||
} | ||
}, | ||
error: function() { | ||
$loading.style.display = 'none' | ||
} | ||
}) | ||
}, | ||
fail: function() { | ||
$loading.style.display = 'none' | ||
} | ||
}); | ||
} | ||
@@ -206,2 +224,27 @@ }) | ||
}) | ||
}, | ||
JS_BRIDGE_SHARE: function(data) { | ||
wx.showMenuItems({ | ||
menuList: [ | ||
"menuItem:share:appMessage", | ||
"menuItem:share:timeline" | ||
] | ||
}); | ||
wx.onMenuShareTimeline({ | ||
title: data.title, | ||
link: data.url, | ||
imgUrl: data.image, | ||
success: function() {} | ||
}) | ||
wx.onMenuShareAppMessage({ | ||
title: data.title, | ||
desc: data.desc, | ||
link: data.url, | ||
imgUrl: data.image, | ||
type: 'link', | ||
success: function() {} | ||
}) | ||
} | ||
@@ -275,4 +318,4 @@ } | ||
function getLoadingDOM() { | ||
var $loading = document.getElementById('__BRIDGE_LOADING') | ||
function getLoadingDOM(id) { | ||
var $loading = document.getElementById(id) | ||
if ($loading) { | ||
@@ -283,3 +326,3 @@ return $loading | ||
$loading = document.createElement('div'); | ||
$loading.id = '__BRIDGE_LOADING' | ||
$loading.id = id | ||
$loading.style.display = 'none' | ||
@@ -286,0 +329,0 @@ |
{ | ||
"name": "mb-js-bridge", | ||
"version": "5.0.3", | ||
"version": "5.0.6", | ||
"description": "", | ||
"main": "lib/index.js", | ||
"main": "dist/js-bridge-umd.min.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "build": "webpack -p lib/index.js dist/js-bridge-umd.min.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
121220
1053
0