(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["uni_modules-uni-upgrade-center-pages-version-detail"],{"01a1":function(t,e,a){"use strict";a.r(e);var n=a("5a6c"),i=a.n(n);for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);e["default"]=i.a},"0f61":function(t,e,a){"use strict";a.r(e);var n=a("b85d"),i=a.n(n);for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);e["default"]=i.a},"13b6":function(t,e,a){"use strict";a.r(e);var n=a("b3d1"),i=a("0f61");for(var r in i)"default"!==r&&function(t){a.d(e,t,(function(){return i[t]}))}(r);a("f8f8");var s,o=a("f0c5"),l=Object(o["a"])(i["default"],n["b"],n["c"],!1,null,"8735cf28",null,!1,n["a"],s);e["default"]=l.exports},"2c5e":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场（https://ext.dcloud.net.cn）上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者，建议你使用scss预处理，并在插件代码中直接使用这些变量（无需 import 这个文件），方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者（插件使用者），你可以通过修改这些变量来定制自己的插件主题，实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理，你也可以直接在你的 scss 代码中使用如下变量，同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.show-stable-info[data-v-8735cf28]{position:absolute;left:165px;padding:5px 10px;background-color:#f4f4f5;color:#909399;border-radius:4px;border:1px solid #e9e9eb}[data-v-8735cf28] .uni-forms-item__content{display:flex;align-items:center}',""]),t.exports=e},"33c1":function(t,e,a){"use strict";a.r(e);var n=a("bcaa"),i=a("01a1");for(var r in i)"default"!==r&&function(t){a.d(e,t,(function(){return i[t]}))}(r);var s,o=a("f0c5"),l=Object(o["a"])(i["default"],n["b"],n["c"],!1,null,"690ab064",null,!1,n["a"],s);e["default"]=l.exports},"5a6c":function(t,e,a){"use strict";a("a9e3"),a("e25e"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a("4fef"),i={name:"uniDateformat",props:{date:{type:[Object,String,Number],default:function(){return"-"}},locale:{type:String,default:"zh"},threshold:{type:Array,default:function(){return[0,0]}},format:{type:String,default:"yyyy/MM/dd hh:mm:ss"},refreshRate:{type:[Number,String],default:0}},data:function(){return{refreshMark:0}},computed:{dateShow:function(){return this.refreshMark,(0,n.friendlyDate)(this.date,{locale:this.locale,threshold:this.threshold,format:this.format})}},watch:{refreshRate:{handler:function(){this.setAutoRefresh()},immediate:!0}},methods:{refresh:function(){this.refreshMark++},setAutoRefresh:function(){var t=this;clearInterval(this.refreshInterval),this.refreshRate&&(this.refreshInterval=setInterval((function(){t.refresh()}),parseInt(this.refreshRate)))}}};e.default=i},b3d1:function(t,e,a){"use strict";a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return n}));var n={uniForms:a("e4ab").default,uniFormsItem:a("7f31").default,uniEasyinput:a("22a8").default,uniDataCheckbox:a("d94d").default,uniFilePicker:a("e6ce").default,uniDateformat:a("33c1").default},i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"uni-container"},[a("v-uni-view",{staticClass:"uni-header"},[a("v-uni-view",{staticClass:"uni-group"},[a("v-uni-view",{staticClass:"uni-title"},[t._v("包类型")]),a("v-uni-view",{staticClass:"uni-sub-title",staticStyle:{display:"flex","justify-content":"center","align-items":"center"}},[t._v(t._s(t.type_valuetotext[t.formData.type]))])],1),t.isStable?t._e():a("v-uni-view",{staticClass:"uni-group"},[a("v-uni-button",{staticClass:"uni-button",attrs:{type:"warn",size:"mini"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.deletePackage.apply(void 0,arguments)}}},[t._v("删除")])],1)],1),a("uni-forms",{ref:"form",attrs:{value:t.formData,validateTrigger:"bind"}},[a("uni-forms-item",{attrs:{name:"appid",label:"AppID",required:!0}},[a("uni-easyinput",{attrs:{disabled:!0,trim:"both"},model:{value:t.formData.appid,callback:function(e){t.$set(t.formData,"appid",e)},expression:"formData.appid"}})],1),a("uni-forms-item",{attrs:{name:"name",label:"应用名称"}},[a("uni-easyinput",{attrs:{disabled:!0,trim:"both"},model:{value:t.formData.name,callback:function(e){t.$set(t.formData,"name",e)},expression:"formData.name"}})],1),a("uni-forms-item",{attrs:{name:"title",label:"更新标题"}},[a("uni-easyinput",{attrs:{disabled:t.detailsState,placeholder:"更新标题"},model:{value:t.formData.title,callback:function(e){t.$set(t.formData,"title",e)},expression:"formData.title"}})],1),a("uni-forms-item",{attrs:{name:"contents",label:"更新内容",required:!0}},[a("v-uni-textarea",{staticClass:"uni-textarea-border",staticStyle:{"box-sizing":"content-box"},attrs:{"auto-height":!0,disabled:t.detailsState,value:t.formData.contents},on:{input:function(e){arguments[0]=e=t.$handleEvent(e),t.binddata("contents",e.detail.value)},"update:value":function(e){arguments[0]=e=t.$handleEvent(e),function(e){return t.formData.contents=e}.apply(void 0,arguments)}}})],1),a("uni-forms-item",{attrs:{name:"platform",label:"平台",required:!0}},[a("uni-data-checkbox",{attrs:{disabled:!0,multiple:!0,localdata:t.platformLocaldata},model:{value:t.formData.platform,callback:function(e){t.$set(t.formData,"platform",e)},expression:"formData.platform"}})],1),a("uni-forms-item",{attrs:{name:"version",label:"版本号",required:!0}},[a("uni-easyinput",{attrs:{disabled:!0,placeholder:"当前包版本号，必须大于当前已上线版本号"},model:{value:t.formData.version,callback:function(e){t.$set(t.formData,"version",e)},expression:"formData.version"}})],1),t.isWGT?a("uni-forms-item",{attrs:{name:"min_uni_version",label:"原生App最低版本",required:t.isWGT}},[a("uni-easyinput",{attrs:{disabled:t.detailsState,placeholder:"原生App最低版本"},model:{value:t.formData.min_uni_version,callback:function(e){t.$set(t.formData,"min_uni_version",e)},expression:"formData.min_uni_version"}}),a("show-info",{attrs:{content:t.minUniVersionContent}})],1):t._e(),t.isiOS||t.detailsState?t._e():a("uni-forms-item",{attrs:{label:"上传包"}},[a("uni-file-picker",{attrs:{"file-extname":t.fileExtname,disabled:t.hasPackage,returnType:"object","file-mediatype":"all",limit:"1"},on:{success:function(e){arguments[0]=e=t.$handleEvent(e),t.packageUploadSuccess.apply(void 0,arguments)},delete:function(e){arguments[0]=e=t.$handleEvent(e),t.packageDelete.apply(void 0,arguments)}},model:{value:t.appFileList,callback:function(e){t.appFileList=e},expression:"appFileList"}},[a("v-uni-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.selectFile.apply(void 0,arguments)}}},[t._v("选择文件")])],1),t.hasPackage?a("v-uni-text",{staticStyle:{"padding-left":"20px",color:"#a8a8a8"}},[t._v(t._s(Number(t.appFileList.size/1024/1024).toFixed(2))+"M")]):t._e()],1),a("uni-forms-item",{attrs:{name:"url",label:t.isiOS?"AppStore":"包地址",required:!0}},[a("uni-easyinput",{attrs:{disabled:t.detailsState,placeholder:"可下载安装包地址",maxlength:-1},model:{value:t.formData.url,callback:function(e){t.$set(t.formData,"url",e)},expression:"formData.url"}}),a("show-info",{attrs:{top:-80,content:t.uploadFileContent}})],1),t.isWGT?a("uni-forms-item",{attrs:{name:"is_silently",label:"静默更新"}},[a("v-uni-switch",{attrs:{disabled:t.detailsState,checked:t.formData.is_silently},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.binddata("is_silently",e.detail.value)}}}),a("show-info",{attrs:{top:-80,content:t.silentlyContent}})],1):t._e(),t.isiOS?t._e():a("uni-forms-item",{attrs:{name:"is_mandatory",label:"强制更新"}},[a("v-uni-switch",{attrs:{disabled:t.detailsState,checked:t.formData.is_mandatory},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.binddata("is_mandatory",e.detail.value)}}}),a("show-info",{attrs:{content:t.mandatoryContent}})],1),a("uni-forms-item",{attrs:{name:"stable_publish",label:"上线发行"}},[a("v-uni-switch",{attrs:{disabled:t.detailsState||t.isStable,checked:t.formData.stable_publish},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.binddata("stable_publish",e.detail.value)}}}),t.isStable?a("show-info",{attrs:{top:-100,content:t.stablePublishContent}}):a("show-info",{attrs:{top:-40,content:t.stablePublishContent2}})],1),a("uni-forms-item",{attrs:{label:"上传时间"}},[a("uni-dateformat",{attrs:{format:"yyyy-MM-dd hh:mm:ss",date:t.formData.create_date,threshold:[0,0]}})],1),a("uni-forms-item",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{name:"type",label:"安装包类型"}},[a("uni-data-checkbox",{attrs:{localdata:t.formOptions.type_localdata},model:{value:t.formData.type,callback:function(e){t.$set(t.formData,"type",e)},expression:"formData.type"}})],1),a("v-uni-view",{staticClass:"uni-button-group"},[t.detailsState?a("v-uni-button",{staticClass:"uni-button",staticStyle:{width:"100px"},attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.detailsState=!1}}},[t._v("修改")]):t._e(),t.detailsState?t._e():a("v-uni-button",{staticClass:"uni-button",staticStyle:{width:"100px"},attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.submit.apply(void 0,arguments)}}},[t._v("提交")]),t.detailsState?t._e():a("v-uni-button",{staticClass:"uni-button",staticStyle:{width:"100px"},attrs:{type:"warn"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.cancelEdit.apply(void 0,arguments)}}},[t._v("取消")]),a("v-uni-navigator",{staticStyle:{"margin-left":"15px"},attrs:{"open-type":"navigateBack"}},[a("v-uni-button",{staticClass:"uni-button",staticStyle:{width:"100px"}},[t._v("返回")])],1)],1)],1)],1)},r=[]},b85d:function(t,e,a){"use strict";(function(t){var n=a("dbce"),i=a("4ea4");a("7db0"),a("caad"),a("d3b7"),a("25f0"),a("2532"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a("96cf");var r=i(a("1da1")),s=(a("b407"),i(a("368d"))),o=n(a("0872")),l=a("1ce6"),u=t.database(),c=(u.command,l.appVersionListDbName);var f={components:{showInfo:s.default},mixins:[o.default],data:function(){return{showStableInfo:!1,isStable:!0,originalData:[],detailsState:!0}},onLoad:function(t){var e=this;return(0,r.default)(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=t.id,e.formDataId=n,a.next=4,e.getDetail(n);case 4:return e.isStable=e.formData.stable_publish,a.next=7,e.getLatestVersion();case 7:e.latestStableData=a.sent,e.isWGT&&e.rules.min_uni_version.rules.push({required:!0});case 9:case"end":return a.stop()}}),a)})))()},methods:{submit:function(){var t=this;uni.showLoading({mask:!0}),this.$refs.form.validate().then((function(e){t.submitForm(e)})).catch((function(t){uni.hideLoading()}))},submitForm:function(t){var e=this;return(0,r.default)(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:n=u.collection(c),n.doc(e.formDataId).update(t).then(function(){var a=(0,r.default)(regeneratorRuntime.mark((function a(i){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(e.isStable||!0!==t.stable_publish||!e.latestStableData){a.next=3;break}return a.next=3,n.doc(e.latestStableData._id).update({stable_publish:!1});case 3:uni.showToast({title:"修改成功"}),e.getOpenerEventChannel().emit("refreshData"),setTimeout((function(){return uni.navigateBack()}),500);case 6:case"end":return a.stop()}}),a)})));return function(t){return a.apply(this,arguments)}}()).catch((function(t){uni.showModal({content:t.message||"请求服务失败",showCancel:!1})})).finally((function(){uni.hideLoading()}));case 2:case"end":return a.stop()}}),a)})))()},getDetail:function(t){var e=this;return uni.showLoading({mask:!0}),u.collection(c).doc(t).field(o.fields).get().then((function(t){var a=t.result.data[0];a&&(e.formData=a,e.originalData=(0,l.deepClone)(e.formData))})).catch((function(t){uni.showModal({content:t.message||"请求服务失败",showCancel:!1})})).finally((function(){uni.hideLoading()}))},deletePackage:function(){var t=this;uni.showModal({title:"提示",content:"是否删除该版本",success:function(e){e.confirm&&(uni.showLoading({mask:!0}),u.collection(c).doc(t.formDataId).remove().then((function(){uni.showToast({title:"删除成功"}),t.getOpenerEventChannel().emit("refreshData"),setTimeout((function(){return uni.navigateBack()}),500)})).catch((function(t){uni.showModal({content:t.message||"请求服务失败",showCancel:!1})})).finally((function(){uni.hideLoading()})))}})},getLatestVersion:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a={appid:t.formData.appid,type:t.formData.type,stable_publish:!0},t.isWGT||(a.platform=t.formData.platform[0]),e.next=4,u.collection(c).where(a).get();case 4:return n=e.sent,e.abrupt("return",n.result.data.find((function(e){return e.platform.toString()===t.formData.platform.toString()})));case 6:case"end":return e.stop()}}),e)})))()},cancelEdit:function(){var t=this,e="";!this.isiOS&&this.hasPackage&&(e+="\n将会删除已上传的包"),uni.showModal({title:"取消修改",content:e,success:function(e){if(e.confirm&&(t.formData=(0,l.deepClone)(t.originalData),t.detailsState=!0,t.hasPackage)){var a=[];a.push(t.appFileList.url),t.$request("deleteFile",{fileList:a},{functionName:"upgrade-center"})}}})}}};e.default=f}).call(this,a("a9ff")["default"])},bcaa:function(t,e,a){"use strict";var n;a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-text",[t._v(t._s(t.dateShow))])},r=[]},f4f2:function(t,e,a){var n=a("2c5e");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("4f06").default;i("7cb96661",n,!0,{sourceMap:!1,shadowMode:!1})},f8f8:function(t,e,a){"use strict";var n=a("f4f2"),i=a.n(n);i.a}}]);