@@ -391,29 +391,29 @@ const QTGateRegionsSetup: IQTGateRegionsSetup[] = [
391391 }
392392]
393393
394- const nextExpirDate = ( expire : Date ) => {
395- const now = new Date ( )
394+ const nextExpirDate = ( expire : string ) => {
395+ const now = new Date ( )
396+ const _expire = new Date ( expire )
396397 now . setHours ( 0 , 0 , 0 , 0 )
397- if ( now . getTime ( ) > expire . getTime ( ) ) {
398- return expire
398+ if ( now . getTime ( ) > _expire . getTime ( ) ) {
399+ return _expire
399400 }
400401 const nextExpirDate = new Date ( expire )
401402 nextExpirDate . setMonth ( now . getMonth ( ) )
402403 nextExpirDate . setFullYear ( now . getFullYear ( ) )
403404
404405 if ( nextExpirDate . getTime ( ) < now . getTime ( ) ) {
405406 nextExpirDate . setMonth ( now . getMonth ( ) + 1 )
407+ return nextExpirDate
406408 }
407409
408- if ( nextExpirDate . getTime ( ) >= expire . getTime ( ) ) {
409- return expire
410- }
411- return nextExpirDate
410+ return _expire
412411}
413412
414- const getRemainingMonth = ( expire : Date ) => {
415- const _nextExpirDate = nextExpirDate ( expire )
416- return expire . getFullYear ( ) === _nextExpirDate . getFullYear ( ) ? expire . getMonth ( ) - _nextExpirDate . getMonth ( ) : ( 11 - _nextExpirDate . getMonth ( ) + expire . getMonth ( ) )
413+ const getRemainingMonth = ( expire : string ) => {
414+ const _expire = new Date ( expire )
415+ const _nextExpirDate = nextExpirDate ( expire )
416+ return _expire . getFullYear ( ) === _nextExpirDate . getFullYear ( ) ? _expire . getMonth ( ) - _nextExpirDate . getMonth ( ) : ( 11 - _nextExpirDate . getMonth ( ) + _expire . getMonth ( ) )
417417}
418418
419419const infoDefine = [
@@ -480,8 +480,8 @@ const infoDefine = [
480480 multiRegion :[ '单一代理区域并发代理' , '多代理区域混合并发代理' , '多代理区域混合并发代理' , '多代理区域混合并发代理' ] ,
481481 downGradeMessage :'您正在操作降级您的订阅,如果操作成功您将从下月您的订阅之日起,实行新的订阅,如果您是。' ,
482482 cancelPlanMessage :'QTGate的订阅是以月为基本的单位。您的月订阅将在下月您的订阅起始日前被终止,您可以继续使用您的本月订阅计划,您将自动回到免费用户。如果您是每月自动扣款,则下月将不再扣款。如果您是年度订阅计划,您的退款将按普通每月订阅费,扣除您已经使用的月份后计算的差额,将自动返还您所支付的信用卡账号,如果您是使用促销码,或您是测试用户,您的终止订阅将不能被接受。' ,
483- cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : Date ) => {
484- return `您的订阅计划是${ isAnnual ? `年度订阅,退还金额将按照您已付年订阅费 us$[${ getPlanPrice ( planName , true ) } ] - 您已使用月份原价 us$[${ getPlanPrice ( planName , false ) } ] X 已使用月数[${ 12 - getRemainingMonth ( expire ) } ] = 余额 us$[${ getCurrentPlanCancelBalance ( expire , planName ) } ]将退还到您用来支付的信用卡。` : `月订阅,您的订阅将下次更新日${ nextExpirDate ( expire ) . toLocaleDateString ( ) } 时不再被自动扣款和更新。` } `
483+ cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : string ) => {
484+ return `您的订阅计划是${ isAnnual ? `年度订阅,退还金额将按照您已付年订阅费 us$[${ getPlanPrice ( planName , true ) } ] - 您已使用月份原价 us$[${ getPlanPrice ( planName , false ) } ] X 已使用月数[${ 12 - getRemainingMonth ( expire ) } ] = 余额 us$[${ getCurrentPlanCancelBalance ( expire , planName ) } ]将退还到您用来支付的信用卡。` : `月订阅,您的订阅将下次更新日${ nextExpirDate ( expire ) . toLocaleDateString ( ) } 时不再被自动扣款和更新。` } `
485485 }
486486 } ,
487487
@@ -1007,7 +1007,7 @@ const infoDefine = [
10071007 serverShareData1 :'並列ゲットウェイ技術を使う際に、同時使う数が独占数を超える場合には、独占リソースを他人と割合にチェアする場合もあります。' ,
10081008 maxmultigateway : [ '最大二つ並列ゲットウェイ' , '最大四つ並列ゲットウェイ*' , '最大四つ並列ゲットウェイ' ] ,
10091009 cancelPlanMessage :'QTGateプランは月毎に計算し、来月のあなたの最初加入した日まで、今のプランのままご利用ですます。キャンセルした日から自動的にQTGateの無料ユーザーになります。おアカウトは(月)払いの場合は、来月の自動払いは中止となります。年払いの場合は、ご使った分に月普通料金と計算し控除してから、お支払いを使ったクレジットカードに戻ります。販促コードまたはテストユーザーにはキャンセルすることができません。' ,
1010- cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : Date ) => {
1010+ cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : string ) => {
10111011 return `あなたのプランは${ isAnnual ? `一年契約です。キャンセルをした場合は、ご利用して頂いた月に普通料金と請求を計算されます。お返し金額はプラン年契約料金 us$[${ getPlanPrice ( planName , true ) } ] - プラン普通月料金 us$[${ getPlanPrice ( planName , false ) } ] X ご利用頂いた月[${ 12 - getRemainingMonth ( expire ) } ] = 戻る金額 us$[${ getCurrentPlanCancelBalance ( expire , planName ) } ]となります。` : `月プランです。キャンセルにすると次の更新日[${ nextExpirDate ( expire ) . toLocaleDateString ( ) } ]に自動更新はしませんです。` } `
10121012 }
10131013 } ,
@@ -1497,7 +1497,7 @@ const infoDefine = [
14971497 CancelSuccess : ( PlanExpire : Date , isAnnual : boolean , returnAmount : number ) => {
14981498 return `Your subscriptions was cancelled. You may keep use QTGate service with this plan until ${ PlanExpire . toLocaleDateString ( ) } . Restrictions apply to free accounts and accounts using promotions. ${ isAnnual ? `us$${ returnAmount } will return to your paid card in 5 working day.` : `Automatically canceled.` } `
14991499 } ,
1500- currentPlanExpire : [ 'Plan expires at:' , 'Renews at' ] ,
1500+ currentPlanExpire : [ 'Plan expires at:' , 'Renews at' , 'monthly reset day ' ] ,
15011501 currentAnnualPlan : [ 'Monthly plan' , 'Annual plan' ] ,
15021502 cardPaymentErrorMessage :[ 'Error: card number or have an unsupported card type.' , 'Error: expiration!' , 'Error: Card Security Code' , 'Error: Card owner postcode' ,
15031503 'Error: payment failed. Please try again late.' ,
@@ -1542,8 +1542,8 @@ const infoDefine = [
15421542 aboutCancel : 'About cancel subscription' ,
15431543 cancelPlanMessage : 'You may cancel your QTGate subscription at any time, and you will continue to have access to the QTGate services through the end of your paid period until all remaining subscription time in your account is used up. Restrictions apply to free accounts and accounts using promotions.' ,
15441544 serverShareData1 :'Your dedicated server will be share ratio when you connected over your dedicated count via use Multi-gateway technology.' ,
1545- cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : Date ) => {
1546- return `Your plan is ${ isAnnual ? `annual paid ${ getPlanPrice ( planName , true ) } . The passed ${ 12 - getRemainingMonth ( expire ) } month will being normal price us$${ getPlanPrice ( planName , false ) } , QTGate will refunds us$${ getCurrentPlanCancelBalance ( expire , planName ) } to your paid card.` : `monthly, it will not be renew at ${ nextExpirDate ( expire ) . toLocaleDateString ( ) } if you cancel this plan.` } `
1545+ cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : string ) => {
1546+ return `Your plan is ${ isAnnual ? `annual paid ${ getPlanPrice ( planName , true ) } . The passed ${ 12 - getRemainingMonth ( expire ) } month will being normal price us$${ getPlanPrice ( planName , false ) } , QTGate will refunds us$${ getCurrentPlanCancelBalance ( expire , planName ) } to your paid card.` : `monthly, it will not be renew at ${ nextExpirDate ( expire ) . toLocaleDateString ( ) } if you cancel this plan.` } `
15471547 }
15481548 } ,
15491549
@@ -2063,7 +2063,7 @@ const infoDefine = [
20632063 paymentProblem1 :'支付遇到問題' ,
20642064 paymentProblem :'您目前的所在區域看上去銀行網關被和諧,您可以使用QTGate網關支付來完成支付' ,
20652065 title : '賬戶管理' ,
2066- currentPlanExpire : [ '訂閱截止日期:' , '下一次自動續訂日' ] ,
2066+ currentPlanExpire : [ '訂閱截止日期:' , '下一次自動續訂日' , '每月數據重置日' ] ,
20672067 CancelSuccess : ( PlanExpire : Date , isAnnual : boolean , returnAmount : number ) => {
20682068 return `中止訂閱成功。您可以一直使用您的原訂閱到${ PlanExpire . toLocaleDateString ( ) } 為止。以後您將會自動成為QTGate免費用戶可以繼續使用QTGate的各項免費功能。 ${ isAnnual ? `您的餘款us$${ returnAmount } 會在5個工作日內退還到您的支付卡。 ` : '下月起QTGate系統不再自動扣款。 ' } 祝您網絡衝浪愉快。`
20692069 } ,
@@ -2111,8 +2111,8 @@ const infoDefine = [
21112111 internetShareData :[ '共享高速帶寬' , '獨享高速帶寬*' , '獨享雙線高速帶寬*' , '獨享四線高速帶寬' ] ,
21122112 serverShareData1 :'OPN併發多代理技術,同時使用數大於獨占數時,會相應分享您所獨占的資源' ,
21132113 cancelPlanMessage :'可隨時終止您的訂閱,QTGate的訂閱是以月為基本的單位。您的月訂閱將在下月您的訂閱起始日前被終止,您可以繼續使用您的本月訂閱計劃,您將自動回到免費用戶。如果您是每月自動扣款,則下月將不再扣款。如果您是年度訂閱計劃,您的退款將按普通每月訂閱費,扣除您已經使用的月份後計算的差額,將自動返還您所支付的信用卡賬號,如果您是使用促銷碼,或您是測試用戶,您的終止訂閱將不能被接受。 ' ,
2114- cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : Date ) => {
2115- return `您的訂閱計劃是${ isAnnual ? `年度訂閱,退還金額將按照您已付年訂閱費 us$[${ getPlanPrice ( planName , true ) } ] - 您已使用月份原價 us$[${ getPlanPrice ( planName , false ) } ] X 已使用月數[${ 12 - getRemainingMonth ( expire ) } ] = 餘額 us$[${ getCurrentPlanCancelBalance ( expire , planName ) } ]將退還到您用來支付的信用卡。` : `月訂閱,您的訂閱將下次更新日${ nextExpirDate ( expire ) . toLocaleDateString ( ) } 時不再被自動扣款和更新。` } `
2114+ cancelPlanMessage1 : ( planName : string , isAnnual : boolean , expire : string ) => {
2115+ return `您的訂閱計劃是${ isAnnual ? `年度訂閱,退還金額將按照您已付年訂閱費 us$[${ getPlanPrice ( planName , true ) } ] - 您已使用月份原價 us$[${ getPlanPrice ( planName , false ) } ] X 已使用月數[${ 12 - getRemainingMonth ( expire ) } ] = 餘額 us$[${ getCurrentPlanCancelBalance ( expire , planName ) } ]將退還到您用來支付的信用卡。` : `月訂閱,您的訂閱將下次更新日${ nextExpirDate ( expire ) . toLocaleDateString ( ) } 時不再被自動扣款和更新。` } `
21162116 }
21172117
21182118 } ,
@@ -4838,10 +4838,10 @@ module view_layout {
48384838
48394839 private clearAllPaymentErrorTimeUP ( ) {
48404840 return setTimeout ( ( ) => {
4841- this . showSuccessPayment ( false )
4842- this . showCancelSuccess ( false )
4841+ // this.showSuccessPayment ( false )
4842+ // this.showCancelSuccess ( false )
48434843 return this . clearPaymentError ( )
4844- } , 5000 )
4844+ } , 5000 )
48454845 }
48464846
48474847 private paymentCallBackFromQTGate ( err , data : QTGateAPIRequestCommand ) {
@@ -5144,9 +5144,12 @@ module view_layout {
51445144 } )
51455145
51465146 public showUserDetail ( ) {
5147+
51475148 if ( ! this . keyPair ( ) . passwordOK || ! this . getCurrentPlan ( ) ) {
51485149 return
51495150 }
5151+ this . showSuccessPayment ( false )
5152+ this . showCancelSuccess ( false )
51505153 this . UserPerment ( true )
51515154 if ( ! this . QTTransferData ( ) . paidID ) {
51525155 $ ( '.CancelPlanButton' ) . popup ( {
@@ -5171,7 +5174,7 @@ module view_layout {
51715174 this . QTGateAccountPlan ( value )
51725175 this . UserPermentShapeDetail ( true )
51735176 return $ ( '.CancelMessage' ) . popup ( {
5174- position : 'Right Center ' ,
5177+ position : 'bottom right ' ,
51755178 on : 'click' ,
51765179 delay : {
51775180 show : 300 ,
@@ -5186,7 +5189,7 @@ module view_layout {
51865189 public showCurrentPlanBalance = ko . computed ( ( ) => {
51875190 if ( ! this . getCurrentPlan ( ) || ! this . QTTransferData ( ) )
51885191 return null
5189- return getCurrentPlanUpgradelBalance ( new Date ( this . QTTransferData ( ) . expire ) , this . QTTransferData ( ) . productionPackage , this . QTTransferData ( ) . isAnnual )
5192+ return getCurrentPlanUpgradelBalance ( this . QTTransferData ( ) . expire , this . QTTransferData ( ) . productionPackage , this . QTTransferData ( ) . isAnnual )
51905193 } )
51915194
51925195 public selectPlanPrice = ko . computed ( ( ) => {
@@ -5387,7 +5390,7 @@ const getPlanPrice = ( plan: string, isAnnualPlan: boolean ) => {
53875390 }
53885391}
53895392
5390- const getCurrentPlanCancelBalance = ( expiration : Date , planName : string ) => {
5393+ const getCurrentPlanCancelBalance = ( expiration : string , planName : string ) => {
53915394
53925395 const price = getPlanPrice ( planName , true )
53935396 const normalPrice = getPlanPrice ( planName , false )
@@ -5404,7 +5407,7 @@ const getExpire = ( startDate: Date, isAnnual: boolean ) => {
54045407 return start
54055408}
54065409
5407- const getCurrentPlanUpgradelBalance = ( expiration : Date , planName : string , isAnnual : boolean ) => {
5410+ const getCurrentPlanUpgradelBalance = ( expiration : string , planName : string , isAnnual : boolean ) => {
54085411 if ( ! isAnnual ) {
54095412 return getPlanPrice ( planName , false )
54105413 }
0 commit comments