"use strict";(self.webpackChunk_client_app_store=self.webpackChunk_client_app_store||[]).push([[6941],{26941:function(t,e,i){i.r(e),i.d(e,{default:function(){return D}});var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"page_content"},["Renew"!==t.page||t.isPayOpen?[e("div",{staticClass:"header"},[e("Logo",{staticClass:"header_logo",attrs:{src:t.appInfo.logo}}),t._v(" "),e("div",{staticClass:"header_content"},[e("div",{staticClass:"header_title"},[t._v("\n          "+t._s(t.appInfo.app_name)+t._s(t.priceInfo.name?" - ".concat(t.priceInfo.name):"")+"\n        ")]),t._v(" "),e("div",{staticClass:"header_desc text_gray"},[t._v(t._s(t.appInfo.slogan))])])],1),t._v(" "),e("div",{staticClass:"table"},[e("div",{staticClass:"table_header"},[e("div",{staticClass:"text_gray"},[t._v(i(11974).nI().t("定价方式"))]),t._v(" "),"Renew"===t.page?[e("div",{staticClass:"text_gray"},[t._v("\n            "+("TOTAL"===t.priceRuleStatus?i(11974).nI().t("续期人数"):i(11974).nI().t("可用人数"))+"\n          ")]),t._v(" "),e("div",{staticClass:"text_gray"},[t._v(i(11974).nI().t("续期时长"))])]:[t.needUserCount?e("div",{staticClass:"text_gray"},[t._v("\n            "+i(11974).nI().t("购买人数")+"\n          ")]):t._e(),t._v(" "),e("div",{staticClass:"text_gray"},[t._v(i(11974).nI().t("购买时长"))])]],2),t._v(" "),e("div",{staticClass:"table_row table_row_price"},[e("div",{staticClass:"text_black"},[t._v("\n          "+t._s(t.formatPrice(t.priceInfo.priceText.price))+t._s(t.priceInfo.priceText.unit)+"\n        ")]),t._v(" "),e("div",["Renew"!==t.page||t.needUserCount?t.needUserCount?e("AppInputWithTips",{staticClass:"input",attrs:{"off-tip":"",error:t.userCountMsg,width:"100px",placeholder:"",type:"number",step:"any"},on:{input:t.debounce.checkUserCount},model:{value:t.userCount,callback:function(e){t.userCount=e},expression:"userCount"}}):t._e():e("div",{staticClass:"text_black"},[t._v("\n            "+t._s(t.formatUserCount(t.paidInfo.paid_user_count))+"\n          ")]),t._v(" "),t.userCountError?e("div",{staticClass:"text_red u-mt-8"},[t._v("\n            "+t._s(t.userCountMsg)+"\n          ")]):t._e()],1),t._v(" "),e("div",[e("DropDown",{staticClass:"dropdown",attrs:{items:t.periodConfig,width:"180px"},on:{change:t.updatePeriod},scopedSlots:t._u([{key:"item",fn:function(i){var r=i.item;return[e("div",{staticClass:"u-w-full u-flex u-justify-between"},[e("span",[t._v(t._s(r.name))]),t._v(" "),e("span",{staticClass:"text_orange u-ml-8"},[t._v(t._s(t.getPeriodItemDesc(r)))])])]}}]),model:{value:t.period,callback:function(e){t.period=e},expression:"period"}}),t._v(" "),t.hidePeriodTips?t._e():[t.present?e("div",{staticClass:"text_orange u-mt-8"},[t._v("\n              "+i(11974).nI().t("赠送{0}，共获得{1}",[t.formatPeriod(t.present.present_time),t.formatPeriod(t.period+t.present.present_time)])+"\n            ")]):t._e(),t._v(" "),t.discount?e("div",{staticClass:"text_orange u-mt-8"},[t._v("\n              "+i(11974).nI().t("总价{0}折",[t.formatDiscount(t.discount)])+"\n            ")]):t._e()]],2)]),t._v(" "),e("div",{staticClass:"divider"}),t._v(" "),e("div",{staticClass:"table_row table_row_summary"},[e("div",{staticClass:"cell text_gray u-flex u-items-center"},[t._v("\n          "+("Renew"===t.page&&i(11974).nI().t("续期后可使用至 {0}",[t.renewTime||""])||"Buy"===t.page&&t.period&&i(11974).nI().t("有效期至 {0}",[t.renewTime||""])||"Expand"===t.page&&"PERSON"!==t.priceRuleStatus&&t.userCount&&!t.userCountError&&i(11974).nI().t("调整后，可用人数为 {0}",[t.userCount||""])||"")+"\n        ")]),t._v(" "),e("div",{staticClass:"cell"},["Rebuy"===t.page?[t.discount?e("div",{staticClass:"cell_row"},[e("p",{},[t._v(i(11974).nI().t("折后价格"))]),t._v(" "),e("p",{staticClass:"appPay_buy_tableItem_text"},[t._v("\n                "+t.formatPrice(t.price.origin_price)+"\n                "+i(11974).nI().t("（{0}'折）",[t.discount.discount_factor/t.discount.discount_dtr*10])+"\n              ")])]):e("div",{staticClass:"cell_row"},[e("p",{staticClass:"text_gray"},[t._v(i(11974).nI().t("原价格"))]),t._v(" "),e("p",{staticClass:"appPay_buy_tableItem_text"},[t._v("\n                "+t._s(t.formatPrice(t.price.origin_price))+"\n              ")])]),t._v(" "),e("div",{staticClass:"cell_row"},[e("p",{staticClass:"text_gray"},[t._v(i(11974).nI().t("抵扣价格"))]),t._v(" "),e("p",{staticClass:"appPay_buy_tableItem_text"},[t._v("\n                -"+t._s(t.price.origin_price<t.discountPrice?t.formatPrice(t.price.origin_price):t.formatPrice(t.discountPrice))+"\n              ")])]),t._v(" "),e("div",{staticClass:"cell_row u-lh-28"},[e("p",{staticClass:"text_gray"},[t._v(i(11974).nI().t("应付价格"))]),t._v(" "),e("p",{staticClass:"text_price"},[t._v(t._s(t.formatPrice(t.price.final_price)))])])]:[t.discount?[e("div",{staticClass:"cell_row"},[e("p",{staticClass:"text_gray"},[t._v(i(11974).nI().t("原价格"))]),t._v(" "),e("p",{staticClass:"text_black"},[t._v("\n                  "+t._s(t.formatPrice(t.price.origin_price_before_factor))+"\n                ")])]),t._v(" "),e("div",{staticClass:"cell_row"},[e("p",{staticClass:"text_gray"},[t._v(i(11974).nI().t("价格折扣"))]),t._v(" "),e("p",{staticClass:"text_black"},[t._v("\n                  "+i(11974).nI().t("{0}折",[t.discount.discount_factor/t.discount.discount_dtr*10])+"\n                ")])]),t._v(" "),e("div",{staticClass:"cell_row u-lh-28"},[e("p",{staticClass:"text_gray"},[t._v(i(11974).nI().t("应付价格"))]),t._v(" "),e("p",{staticClass:"text_price"},[t._v(t._s(t.formatPrice(t.price.final_price)))])])]:e("div",{staticClass:"cell_row u-lh-28"},[e("p",{staticClass:"text_gray"},[t._v(i(11974).nI().t("价格"))]),t._v(" "),e("p",{staticClass:"text_price"},[t._v("\n                "+t._s(t.formatPrice(t.price.final_price))+"\n              ")])])]],2)])]),t._v(" "),e("div",{staticClass:"footer"},[e("Button",{staticClass:"btn",attrs:{width:"160px",color:"blue",disabled:t.isDisabled},on:{click:t.submitOrder}},[t._v("\n        "+i(11974).nI().t("提交订单，并支付")+"\n      ")]),t._v(" "),e("AuthAgreement",{ref:"authAgreement",attrs:{agreements:t.agreements}})],1),t._v(" "),t.addOrderRes?e("Dialog",{attrs:{visible:t.showOrderDialog,title:i(11974).nI().t("下单成功"),width:"400px"},on:{close:t.gotoOrderDetail},scopedSlots:t._u([{key:"default",fn:function(){return[e("div",{staticClass:"dialog_content u-px-24"},[e("p",{staticClass:"u-mt-8 text_black"},[t._v("\n            "+i(11974).nI().t("订单提交成功，请支付{0}元",[t.formatPrice(t.addOrderRes.third_app_order.paid_price)])+"\n          ")]),t._v(" "),e("p",{staticClass:"u-mt-12"},[e("span",{staticClass:"text_gray"},[t._v(i(11974).nI().t("商品名称"))]),e("span",{staticClass:"u-ml-12 text_black"},[t._v(t._s(t.appInfo.app_name)+t._s(t.priceInfo.name?" - ".concat(t.priceInfo.name):""))])]),t._v(" "),e("p",{staticClass:"u-mt-8"},[e("span",{staticClass:"text_gray"},[t._v(i(11974).nI().t("商品订单"))]),t._v(" "),e("span",{staticClass:"u-ml-12 text_black"},[t._v(t._s(t.addOrderRes.third_app_order.open_orderid))])])])]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"u-py-24 u-flex u-items-center u-justify-center"},[e("Button",{staticClass:"u-w-170",attrs:{color:"blue"},on:{click:function(e){return e.stopPropagation(),t.payOrder.apply(null,arguments)}}},[t._v("\n            "+i(11974).nI().t("去支付")+"\n          ")]),t._v(" "),e("Button",{staticClass:"u-w-170 u-ml-12",attrs:{color:"gray",disabled:t.isDisabled},on:{click:function(e){return e.stopPropagation(),t.gotoOrderDetail.apply(null,arguments)}}},[t._v("\n            "+i(11974).nI().t("取消")+"\n          ")])],1)]},proxy:!0}],null,!1,491951195)}):t._e(),t._v(" "),e("Dialog",{attrs:{visible:t.showServiceCorpCertOutdatedDialog,title:i(11974).nI().t("服务商认证已过期"),width:"400px"},on:{close:function(e){t.showServiceCorpCertOutdatedDialog=!1}},scopedSlots:t._u([{key:"default",fn:function(){return[e("div",{staticClass:"dialog_content u-px-24"},[e("p",{staticClass:"u-mt-8 text_black"},[t._v("\n            "+i(11974).nI().t("提供「{0}」的服务商在企业微信的认证信息已经过期。为保障企业数据与资金安全，请谨慎购买。如有疑问，请联系服务商。",[t.appInfo.app_name])+"\n          ")])])]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"u-py-24 u-flex u-items-center u-justify-center"},[e("Button",{staticClass:"u-w-170",attrs:{color:"blue"},on:{click:function(e){e.stopPropagation(),t.showServiceCorpCertOutdatedDialog=!1}}},[t._v("\n            "+i(11974).nI().t("暂不购买")+"\n          ")]),t._v(" "),e("Button",{staticClass:"u-w-170 u-ml-12",attrs:{color:"gray",disabled:t.isDisabled},on:{click:function(e){return e.stopPropagation(),t.addOrder.apply(null,arguments)}}},[t._v("\n            "+i(11974).nI().t("继续购买")+"\n          ")])],1)]},proxy:!0}])})]:[e("div",{staticClass:"header"},[e("Logo",{staticClass:"header_logo",attrs:{src:t.appInfo.logo}}),t._v(" "),e("div",{staticClass:"header_content"},[e("div",{staticClass:"header_title"},[t._v(t._s(t.appInfo.app_name))])])],1),t._v(" "),e("div",{staticClass:"text_black u-mb-12"},[t._v(i(11974).nI().t("当前版本概览"))]),t._v(" "),e("div",{staticClass:"table"},[e("div",{staticClass:"table_header"},[e("div",{staticClass:"text_gray"},[t._v(i(11974).nI().t("应用版本"))]),t._v(" "),e("div",{staticClass:"text_gray"},[t._v(i(11974).nI().t("定价方式"))]),t._v(" "),e("div",{staticClass:"text_gray"},[t._v(i(11974).nI().t("可用人数"))])]),t._v(" "),e("div",{staticClass:"table_row table_row_price !u-py-12"},[e("div",{staticClass:"text_black"},[t._v(t._s(t.priceInfo.name))]),t._v(" "),e("div",{staticClass:"text_black"},[t._v("\n          "+t._s(t.formatPrice(t.priceInfo.priceText.price))+t._s(t.priceInfo.priceText.unit)+"\n        ")]),t._v(" "),e("div",{staticClass:"text_black"},[t._v("\n          "+t._s(t.formatUserCount(t.paidInfo.paid_user_count))+"\n        ")])])]),t._v(" "),e("div",{staticClass:"footer"},[e("Button",{staticClass:"btn",attrs:{width:"160px",color:"blue"},on:{click:t.handleRenewInPayClose}},[t._v("\n        "+(t.canManage?i(11974).nI().t("前往企业管理后台续期"):i(11974).nI().t("联系管理员续期"))+"\n      ")])],1)]],2)};r._withStripped=!0,i(66881);var n=i(40048),s=i(87879),a=i(79394),o=i(63649),c=i.n(o),u=i(97161),l=i(75870),p=(0,i(66519).LC)("appStore/serviceCorp",{name:"wwopen",host:"open.work.weixin.qq.com",prefix:"/wwopen/monoApi"},"getServiceCorpPublicInfo"),d=i(94944),h=i(2271),_=i(92378),f=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wecom_dropdown",style:t.styleObj},[e("div",{ref:"label",staticClass:"wecom_dropdown_label",attrs:{href:"javascript:",disabled:t.disabled},on:{click:t.toggle}},[t._t("text",function(){return[e("label",{class:{wecom_dropdown_placeholder:t.placeholder&&!t.selectedItemName}},[t._v("\n        "+t._s(t.selectedItemName||t.placeholder)+"\n      ")])]},null,{name:t.selectedItemName||t.placeholder}),t._v(" "),e("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADTSURBVHgB7dJBCoJAFAbg97SwpDGwlUl3cGuXqSt0ic5Rl6k7tC3bJcQIgoHTPKMoGh01aOW/GIb39OPNMABdfo1Ji+d5NuLYyTKeQou8/4+M+RPRgzU1EMWWx+ddE4y507kQuCj2g3xl8FH+mooa9EEbjJIkxtCU683qOxcwIHiUMbBsFmcpPzbBEGHDr9GhuEN59lMTVInF0Z725rNYF63CPsA6qA77AqtQa8hmOqyoQ0nkcwrlc1qqemWYcsLySfVYJahCdVjt0PGZ64fQ5S+5A2XjiDzie1r+AAAAAElFTkSuQmCC"}})],2),t._v(" "),!t.disabled&&t.active?e("ul",{staticClass:"wecom_dropdown_menu",style:t.menuStyle},[t._t("dropdown",function(){return t._l(t.items,function(i,r){return e("li",{key:r,staticClass:"wecom_dropdown_menu_item",attrs:{item:i,select:!t.multi&&t.isItemChecked(i.value)},on:{click:function(e){return e.stopPropagation(),t.selectItem(i.value,e)}}},[t.multi?e("input",{staticClass:"ww_checkbox",attrs:{type:"checkbox"},domProps:{checked:t.isItemChecked(i.value)}}):t._e(),t._v(" "),t._t("item",function(){return[t._v("\n          "+t._s(i.name)+"\n        ")]},{item:i})],2)})},{items:t.items,handleSelect:t.selectItem,detectChecked:t.isItemChecked})],2):t._e()])};function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}f._withStripped=!0;var m=i(6080),C=(0,m.Z)({components:{},props:{width:{type:String,default:"200px"},menuWidth:String,placeholder:{type:String,default:""},items:Array,multi:Boolean,disabled:Boolean,value:null},data:function(){return{active:!1}},computed:{selectedItemName:function(){var t=this;if(u.isArray(this.value)){var e=[];return this.value.forEach(function(i){var r=u.find(t.items,{value:i});r&&e.push(r.name)}),e.join(i(11974).nI().t("、"))}var r=u.find(this.items,{value:this.value});return(null==r?void 0:r.name)||""},showPlaceholder:function(){return this.placeholder&&!this.selectedItemName},styleObj:function(){return{width:this.width}},menuStyle:function(){var t=32;if(this.active){var e,i,r,n=null===(e=null===(i=this.$refs)||void 0===i?void 0:null===(r=i.label)||void 0===r?void 0:r.getBoundingClientRect())||void 0===e?void 0:e.height;n>0&&(t=n)}return{width:this.menuWidth||this.width,top:"".concat(t,"px")}}},mounted:function(){this.checkHide=this.checkHide.bind(this),window.addEventListener("mousedown",this.checkHide)},beforeDestroy:function(){window.removeEventListener("mousedown",this.checkHide)},methods:{toggle:function(t){this.active=!this.active,this.$emit("click",t)},show:function(){this.active=!0},checkHide:function(t){this.$el.contains(t.target)||(this.active=!1)},selectItem:function(t,e){if(this.multi||(this.active=!1),this.isItemChecked(t))return this.multi?this.$emit("input",u.filter(this.value,function(e){return e!==t}),e):void 0;if(u.isArray(this.value)){if(this.multi){var i;return this.$emit("input",((function(t){if(Array.isArray(t))return v(t)})(i=this.value)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return v(t,e)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([t]),e)}return this.$emit("input",[t],e),void this.$emit("change",[t],e)}this.$emit("input",t,e),this.$emit("change",t,e)},isItemChecked:function(t){return u.isArray(this.value)?this.value.includes(t):this.value===t}}},f,[],!1,null,"7216e2ec",null).exports,y=function(){var t=this,e=t._self._c;return e("HoverTip",{attrs:{active:!!t.error&&!t.offTip,direction:"down",skew:12}},[e("template",{slot:"content"},[e("Input",t._g(t._b({staticClass:"app_input_wrapper",class:{app_input_wrapper_error:!!t.error},attrs:{type:t.type,max:t.max,min:t.min,placeholder:t.placeholder,"input-style":t.inputStyle,"input-class":"app_input"},model:{value:t.text,callback:function(e){t.text=e},expression:"text"}},"Input",t.$attrs,!1),t.$listeners))],1),t._v(" "),e("template",{slot:"tip"},[e("div",{staticClass:"tip_text"},[t._v("\n      "+t._s(t.error)+"\n    ")])])],2)};y._withStripped=!0;var I=i(35851),g={name:"AppInput",components:{Input:i(96221).Z,HoverTip:I.xW},props:{value:{type:[String,Number],default:null},width:{type:String,default:"auto"},placeholder:{type:String,default:i(11974).nI().t("请输入内容")},type:{type:String,default:"text"},max:{type:Number,default:1},min:{type:Number,default:0},error:{type:String,default:""},offTip:{type:Boolean,defalut:!1}},data:function(){return{text:this.value||""}},computed:{inputStyle:function(){return{width:this.width}}},watch:{value:function(t){this.text!==t&&(this.text=t)},text:function(t){this.value!==t&&this.$emit("input",t)}}},w=(0,m.Z)(g,y,[],!1,null,"70787b3e",null).exports;function b(t,e,i,r,n,s,a){try{var o=t[s](a),c=o.value}catch(u){i(u);return}o.done?e(c):Promise.resolve(c).then(r,n)}function x(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var s=t.apply(e,i);function a(t){b(s,r,n,a,o,"next",t)}function o(t){b(s,r,n,a,o,"throw",t)}a(void 0)})}}var A=function(t,e){var i,r,n,s,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(o){s=[6,o],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},k="eSuiteOpTableNormal",P=[{name:i(11974).nI().t("1年 (365天)"),value:365},{name:i(11974).nI().t("2年 (730天)"),value:730},{name:i(11974).nI().t("3年 (1095天)"),value:1095}],S={Buy:0,Expand:1,Renew:2,Rebuy:3},O={components:{Logo:d.Z,Button:a.zx,Dialog:a.Vq.component,DropDown:C,AppInputWithTips:w,AuthAgreement:_.Z},asyncData:function(t){return x(function(){var e,i,r,n;return A(this,function(s){switch(s.label){case 0:return[4,t.$ctrl.appVersion.getAppPriceInfoDetail({appId:t.query.appId})];case 1:if(s.sent(),!(n=null===(e=t.$ctrl.appVersion.state)||void 0===e?void 0:null===(i=e.app)||void 0===i?void 0:null===(r=i.servicecorp_info)||void 0===r?void 0:r.servicecorp_id))return[3,3];return[4,t.$request(p,{scorp_id:n})];case 2:return[2,{isCert:s.sent().data.is_cert}];case 3:return[2,{isCert:!0}]}})})()},data:function(){return{userCount:null,userCountError:!1,userCountMsg:null,period:null,present:null,renewTime:null,hidePeriodTips:!1,priceRuleStatus:null,needUserCount:!1,isPriceMonthly:!1,discountPrice:null,price:{},totalPrice:null,addOrderRes:{third_app_order:{open_orderid:111}},showOrderDialog:!1,showServiceCorpCertOutdatedDialog:!1,debounce:{}}},head:function(){var t;return{title:(null===(t=this.appInfo)||void 0===t?void 0:t.app_name)||" "}},computed:{periodConfig:function(){return P},state:function(){return this.$ctrl.appVersion.state},appInfo:function(){var t,e;return null===(t=this.state)||void 0===t?void 0:null===(e=t.app)||void 0===e?void 0:e.app_info},agreements:function(){return[this.appInfo.agreement_entry_control]},query:function(){return this.$route.query},page:function(){return this.query.page},canManage:function(){var t;return(null===(t=this.state)||void 0===t?void 0:t.canManage)||!1},isPayOpen:function(){var t;return(null===(t=this.state)||void 0===t?void 0:t.isPayOpen)||!1},versions:function(){var t,e;return(0,h.ko)((null===(t=this.state.appPriceInfo.priceInfo)||void 0===t?void 0:null===(e=t.list)||void 0===e?void 0:e.standardpriceinfo)||[],{canManage:this.canManage,isPayOpen:this.isPayOpen})},paidInfo:function(){var t;return(null===(t=this.state.appPriceInfo.paidInfo)||void 0===t?void 0:t.paid_app_info)||{}},priceinfoid:function(){var t;return["Buy","Rebuy"].includes(this.page)?Number(null===(t=this.query)||void 0===t?void 0:t.priceinfoid):this.paidInfo.cur_priceinfoid},priceInfo:function(){return u.find(this.versions,{standardpriceinfoid:this.priceinfoid})},discount:function(){var t;return null===(t=this.price)||void 0===t?void 0:t.version_discount_rule},isDisabled:function(){return!!this.needUserCount&&(!this.userCount||!!this.userCountError)}},created:function(){return x(function(){return A(this,function(t){switch(t.label){case 0:return[4,this.initialize()];case 1:return t.sent(),this.period=P[0].value,this.updatePeriod(this.period),this.debounce.checkUserCount=u.debounce(this.checkUserCount,200),[2]}})}).apply(this)},methods:{formatPrice:h.T4,formatPeriod:h.Iu,formatDiscount:h.HU,formatUserCount:h.Md,formatTime:function(t){return c().unix(t).format("YYYY/MM/DD")},getPeriodItemDesc:function(t){var e=this.priceInfo.discountRule||[];if(e.length){var r=u.find(e,{period:t.value});if(r)return i(11974).nI().t("总价{0}折",[(0,h.HU)(r)])}var n=this.priceInfo.presentRule||[];if(n.length){var s=u.find(n,{period:t.value});if(s)return i(11974).nI().t("赠送{0}",[(0,h.Iu)(s.present_time)])}return""},initialize:function(){return x(function(){return A(this,function(t){return this.priceRuleStatus=(0,h.Y1)(this.paidInfo,this.priceInfo),this.needUserCount=(0,h.ij)(this.query.page,this.priceRuleStatus,this.paidInfo,this.priceInfo),this.isPriceMonthly=(0,h.bA)(this.priceInfo),"Expand"===this.query.page&&(this.period=365,this.fetchDiscount()),this.needUserCount||(this.userCount=this.paidInfo.paid_user_count,this.calcPrice()),"Rebuy"===this.query.page&&(this.fetchDiscount(),1===this.priceInfo.price_rule.rule_type&&this.calcPrice()),[2]})}).apply(this)},fetchDiscount:function(){return x(function(){return A(this,function(t){return this.$request(l.WH,{standardpriceinfoid:this.priceinfoid,oper_table:k,order_type:S[this.query.page]}).then(function(t){this.discountPrice=t.discount}),[2]})}).apply(this)},calcPrice:function(){return x(function(){var t,e,i;return A(this,function(r){switch(r.label){case 0:if(!this.period||1!==this.priceInfo.price_rule.rule_type&&!this.userCount)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.$request(l.lh,{standardpriceinfoid:this.priceinfoid,order_type:S[this.query.page],user_count:this.userCount,oper_table:k,period:this.period,suiteid:this.priceInfo.suiteid,thirdappid:this.priceInfo.thirdappid})];case 2:return t=r.sent(),this.price=t,this.totalPrice=(0,h.T4)(t.final_price),[3,4];case 3:return e=r.sent(),this.needUserCount&&(u.includes([84086,84077,84142],null==e?void 0:null===(i=e.result)||void 0===i?void 0:i.errCode)?this.userCountError=e.result.humanMessage:this.userCountError=!0),[3,4];case 4:return[2]}})}).apply(this)},checkUserCount:function(){if(!u.trim(this.userCount)||!/^[1-9]+[0-9]*$/.test(this.userCount)){this.userCountMsg=i(11974).nI().t("请填写正确人数"),this.userCountError=!0;return}var t=parseInt(this.userCount,10);if(this.priceInfo.sell_rule&&(this.userCountError=!1,clearTimeout(this.calcTime),t<this.priceInfo.sell_rule.min_user||t>this.priceInfo.sell_rule.max_user)){this.userCountMsg=i(11974).nI().t("该版本购买人数为{0}-{1}人",[this.priceInfo.sell_rule.min_user,this.priceInfo.sell_rule.max_user]),this.userCountError=!0;return}if(t<this.state.memberAuthCount){this.userCountMsg=i(11974).nI().t("企业已有超过{0}人使用应用，请修改购买人数",[this.state.memberAuthCount]),this.userCountError=!0;return}this.userCountError&&(this.userCountError=!1),this.calcPrice()},updatePeriod:function(t){var e=u.find(this.priceInfo.presentRule,{period:t}),i=null;if("Renew"===this.page||"Buy"===this.page){var r=e?e.present_time:0,n=Math.max(this.paidInfo.paid_end_time||0,Math.floor(Date.now()/1e3));i=this.formatTime(n+(t+r)*86400)}this.period=t,this.present=e,this.renewTime=i,this.hidePeriodTips=!1,this.calcPrice()},submitOrder:function(){return x(function(){return A(this,function(t){switch(t.label){case 0:if(this.userCountError)return[2,!1];if(1!==this.priceInfo.price_rule.rule_type&&(!this.userCount||!/^[1-9]+[0-9]*$/.test(this.userCount)))return(0,s.Z)({message:i(11974).nI().t("请填写正确的可用人数")}),[2,!1];if(!this.isCert)return this.showServiceCorpCertOutdatedDialog=!0,[2];return[4,this.$refs.authAgreement.checkAgreement()];case 1:if(!t.sent())return[2];return this.addOrder(),[2]}})}).apply(this)},addOrder:function(){return x(function(){var t;return A(this,function(e){switch(e.label){case 0:return this.showServiceCorpCertOutdatedDialog=!1,[4,this.$request(l.fS,{standardpriceinfoid:this.priceinfoid,user_count:this.userCount,period:this.period,order_type:S[this.query.page],suiteid:this.priceInfo.suiteid,thirdappid:this.priceInfo.thirdappid,oper_table:k})];case 1:return t=e.sent(),this.addOrderRes=t,this.showOrderDialog=!0,[2]}})}).apply(this)},payOrder:function(){var t=this.addOrderRes.third_app_order.open_orderid;location.replace("https://open.work.weixin.qq.com/wwopen/client/orderCenter/pay?".concat(new URLSearchParams({redirect_uri:"https://open.work.weixin.qq.com/appStore/appVersion/payment/callback?".concat(new URLSearchParams({orderid:t,appId:this.query.appId,source:this.query.source})),orderid:t})))},gotoOrderDetail:function(){location.replace("https://open.work.weixin.qq.com/wwopen/client/orderCenter/detail?orderid=".concat(this.addOrderRes.third_app_order.open_orderid))},openBrowser:function(t){return x(function(){var e;return A(this,function(i){switch(i.label){case 0:return e="https://work.weixin.qq.com/s/app?redirect=".concat(encodeURIComponent(t)),[4,(0,n.veL)({url:e})];case 1:return i.sent(),(0,n.onL)(),[2]}})})()},handleRenewInPayClose:function(){if(this.canManage){this.openBrowser("https://work.weixin.qq.com/wework_admin/frame#apps/third/renew?appid=".concat(encodeURIComponent(this.appInfo.corp_app_id)));return}(0,n.Lq5)({desc:i(11974).nI().t("应用续费提醒：{0}",[this.appInfo.app_name]),inputPlaceholder:i(11974).nI().t("留言..."),buttonText:i(11974).nI().t("发送"),businessId:10015,msgData:JSON.stringify({thirdappid:this.query.appId})})}}},D=(0,m.Z)(O,r,[],!1,null,"074af890",null).exports}}]);