1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["uni_modules-uni-upgrade-center-app-pages-upgrade-popup"],{1381:function(t,e,n){"use strict";var a=n("ce73"),i=n.n(a);i.a},"58e7":function(t,e,n){"use strict";n.r(e);var a=n("8902"),i=n.n(a);for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);e["default"]=i.a},"5ab9":function(t,e,n){t.exports=n.p+"static/img/app_update_close.901cf6af.png"},6623:function(t,e,n){var a=n("24fb");e=a(!1),e.push([t.i,"uni-page-body[data-v-5fffbf21]{background:transparent}body.?%PAGE?%[data-v-5fffbf21]{background:transparent}.flex-center[data-v-5fffbf21]{\ndisplay:flex;\njustify-content:center;align-items:center}.mask[data-v-5fffbf21]{position:fixed;left:0;top:0;right:0;bottom:0;background-color:rgba(0,0,0,.65)}.botton-radius[data-v-5fffbf21]{border-bottom-left-radius:%?30?%;border-bottom-right-radius:%?30?%}.content[data-v-5fffbf21]{position:relative;top:0;width:%?600?%;background-color:#fff;box-sizing:border-box;padding:0 %?50?%;font-family:Source Han Sans CN}.text[data-v-5fffbf21]{\ndisplay:block;\nline-height:200px;text-align:center;color:#fff}.content-top[data-v-5fffbf21]{position:absolute;top:%?-195?%;left:0;width:%?600?%;height:%?270?%}.content-top-text[data-v-5fffbf21]{font-size:%?45?%;font-weight:700;color:#f8f8fa;position:absolute;top:%?120?%;left:%?50?%;z-index:1}.content-header[data-v-5fffbf21]{height:%?70?%}.title[data-v-5fffbf21]{font-size:%?33?%;font-weight:700;color:#3da7ff;line-height:38px}.footer[data-v-5fffbf21]{height:%?150?%;display:flex;align-items:center;justify-content:space-around}.box-des-scroll[data-v-5fffbf21]{box-sizing:border-box;padding:0 %?40?%;height:%?200?%;text-align:left}.box-des[data-v-5fffbf21]{font-size:%?26?%;color:#000;line-height:%?50?%}.progress-box[data-v-5fffbf21]{width:100%}.progress[data-v-5fffbf21]{width:90%;height:%?40?%;border-radius:35px}.close-img[data-v-5fffbf21]{width:%?70?%;height:%?70?%;z-index:1000;position:absolute;bottom:%?-120?%;left:calc(50% - %?70?% / 2)}.content-button[data-v-5fffbf21]{text-align:center;flex:1;font-size:%?30?%;font-weight:400;color:#fff;border-radius:%?40?%;margin:0 %?18?%;height:%?80?%;line-height:%?80?%;background:linear-gradient(90deg,#1785ff,#3da7ff)}.flex-column[data-v-5fffbf21]{display:flex;flex-direction:column;align-items:center}",""]),t.exports=e},6729:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"mask flex-center"},[a("v-uni-view",{staticClass:"content botton-radius"},[a("v-uni-view",{staticClass:"content-top"},[a("v-uni-text",{staticClass:"content-top-text"},[t._v(t._s(t.title))]),a("v-uni-image",{staticClass:"content-top",staticStyle:{top:"0"},attrs:{width:"100%",height:"100%",src:n("c19fe")}})],1),a("v-uni-view",{staticClass:"content-header"}),a("v-uni-view",{staticClass:"content-body"},[a("v-uni-view",{staticClass:"title"},[a("v-uni-text",[t._v(t._s(t.subTitle))])],1),a("v-uni-view",{staticClass:"body"},[a("v-uni-scroll-view",{staticClass:"box-des-scroll",attrs:{"scroll-y":"true"}},[a("v-uni-text",{staticClass:"box-des"},[t._v(t._s(t.contents))])],1)],1),a("v-uni-view",{staticClass:"footer flex-center"},[t.isiOS?[a("v-uni-button",{staticClass:"content-button",staticStyle:{border:"none",color:"#fff"},attrs:{plain:!0},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.jumpToAppStore.apply(void 0,arguments)}}},[t._v(t._s(t.downLoadBtnTextiOS))])]:[t.downloadSuccess?t.downloadSuccess&&!t.installed?a("v-uni-button",{staticClass:"content-button",staticStyle:{border:"none",color:"#fff"},attrs:{plain:!0,loading:t.installing,disabled:t.installing},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.installPackage.apply(void 0,arguments)}}},[t._v(t._s(t.installing?"正在安装……":"下载完成,立即安装"))]):t._e():[t.downloading?a("v-uni-view",{staticClass:"progress-box flex-column"},[a("v-uni-progress",{staticClass:"progress",attrs:{"border-radius":"35",percent:t.downLoadPercent,activeColor:"#3DA7FF","show-info":!0,"stroke-width":"10"}}),a("v-uni-view",{staticStyle:{width:"100%","font-size":"28rpx",display:"flex","justify-content":"space-around"}},[a("v-uni-text",[t._v(t._s(t.downLoadingText))]),a("v-uni-text",[t._v("("+t._s(t.downloadedSize)+"/"+t._s(t.packageFileSize)+"M)")])],1)],1):a("v-uni-button",{staticClass:"content-button",staticStyle:{border:"none",color:"#fff"},attrs:{plain:!0},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.downloadPackage.apply(void 0,arguments)}}},[t._v(t._s(t.downLoadBtnText))])],t.installed&&t.isWGT?a("v-uni-button",{staticClass:"content-button",staticStyle:{border:"none",color:"#fff"},attrs:{plain:!0},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.restart.apply(void 0,arguments)}}},[t._v("安装完毕,点击重启")]):t._e()]],2)],1),t.is_mandatory?t._e():a("v-uni-image",{staticClass:"close-img",attrs:{src:n("5ab9")},on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.closeUpdate.apply(void 0,arguments)}}})],1)],1)},i=[]},8348:function(t,e,n){"use strict";n.r(e);var a=n("6729"),i=n("58e7");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("1381");var r=n("f0c5"),s=Object(r["a"])(i["default"],a["b"],a["c"],!1,null,"5fffbf21",null,!1,a["a"],void 0);e["default"]=s.exports},8902:function(t,e,n){"use strict";n("7a82");var a=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("3835")),o=a(n("c7eb")),r=a(n("1da1"));n("a9e3"),n("c975"),n("caad"),n("2532");var s=null;var l={data:function(){return{installForBeforeFilePath:"",installed:!1,installing:!1,downloadSuccess:!1,downloading:!1,downLoadPercent:0,downloadedSize:0,packageFileSize:0,tempFilePath:"",title:"更新日志",contents:"",is_mandatory:!1,subTitle:"发现新版本",downLoadBtnTextiOS:"立即跳转更新",downLoadBtnText:"立即下载更新",downLoadingText:"安装包下载中,请稍后"}},onLoad:function(t){var e=t.local_storage_key;if(!e)return console.error("local_storage_key为空,请检查后重试"),void uni.navigateBack();var n=uni.getStorageSync(e);if(!n)return console.error("安装包信息为空,请检查后重试"),void uni.navigateBack();var a=["version","url","type"];for(var i in n)if(-1!==a.indexOf(i)&&!n[i])return console.error("参数 ".concat(i," 必填,请检查后重试")),void uni.navigateBack();Object.assign(this,n),this.checkLocalStoragePackage()},onBackPress:function(){if(this.is_mandatory)return!0;s&&s.abort()},computed:{isWGT:function(){return"wgt"===this.type},isiOS:function(){return!this.isWGT&&this.platform.includes("iOS")}},methods:{checkLocalStoragePackage:function(){var t=uni.getStorageSync("__localFilePath__");if(t){var e=t.version,n=t.savedFilePath,a=t.installed;a||0!==function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";t=String(t).split("."),e=String(e).split(".");for(var n=Math.min(t.length,e.length),a=0,i=0;i<n;i++){var o=Number(t[i]),r=Number(e[i]);if(o>r){a=1;break}if(o<r){a=-1;break}}if(0===a&&t.length!==e.length)for(var s=t.length>e.length,l=s?t:e,c=n;c<l.length;c++){var f=Number(l[c]);if(f>0){a=s?1:-1;break}}return a}(e,this.version)?this.deleteSavedFile(n):(this.downloadSuccess=!0,this.installForBeforeFilePath=n,this.tempFilePath=n)}},closeUpdate:function(){var t=this;return(0,r.default)((0,o.default)().mark((function e(){return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.downloading){e.next=5;break}if(!t.is_mandatory){e.next=3;break}return e.abrupt("return",uni.showToast({title:"下载中,请稍后……",icon:"none",duration:500}));case 3:return uni.showModal({title:"是否取消下载?",cancelText:"否",confirmText:"是",success:function(t){t.confirm&&(s&&s.abort(),uni.navigateBack())}}),e.abrupt("return");case 5:if(!t.downloadSuccess||!t.tempFilePath){e.next=10;break}return e.next=8,t.saveFile(t.tempFilePath,t.version);case 8:return uni.navigateBack(),e.abrupt("return");case 10:uni.navigateBack();case 11:case"end":return e.stop()}}),e)})))()},downloadPackage:function(){var t=this;this.downloading=!0,s=uni.downloadFile({url:this.url,success:function(e){200==e.statusCode&&(t.downloadSuccess=!0,t.tempFilePath=e.tempFilePath,t.is_mandatory&&t.installPackage())},complete:function(){t.downloading=!1,t.downLoadPercent=0,t.downloadedSize=0,t.packageFileSize=0,s=null}}),s.onProgressUpdate((function(e){t.downLoadPercent=e.progress,t.downloadedSize=(e.totalBytesWritten/Math.pow(1024,2)).toFixed(2),t.packageFileSize=(e.totalBytesExpectedToWrite/Math.pow(1024,2)).toFixed(2)}))},installPackage:function(){},restart:function(){this.installed=!1},saveFile:function(t,e){return(0,r.default)((0,o.default)().mark((function n(){var a,r,s,l;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,uni.saveFile({tempFilePath:t});case 2:if(a=n.sent,r=(0,i.default)(a,2),s=r[0],l=r[1],!s){n.next=8;break}return n.abrupt("return");case 8:uni.setStorageSync("__localFilePath__",{version:e,savedFilePath:l.savedFilePath});case 9:case"end":return n.stop()}}),n)})))()},deleteSavedFile:function(t){return uni.removeStorageSync("__localFilePath__"),uni.removeSavedFile({filePath:t})},jumpToAppStore:function(){plus.runtime.openURL(this.url)}}};e.default=l},c19fe:function(t,e,n){t.exports=n.p+"static/img/bg_top.125b3525.png"},ce73:function(t,e,n){var a=n("6623");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("4f06").default;i("d479082c",a,!0,{sourceMap:!1,shadowMode:!1})}}]);
|