فهرست منبع

扫描文件Button页面加上图片效果

onecold 1 سال پیش
والد
کامیت
9cec0d7740

+ 7 - 0
entry/src/main/ets/common/util/UserUtil.ets

@@ -350,10 +350,12 @@ export default class UserUtil {
           let hasActiveSubscription = false;
           let subscriptionName = '';
           let subscriptionEndDate = '';
+          let plan_id = '';
           if (subInfo && subInfo.has_active_subscription && subInfo.subscriptions && subInfo.subscriptions.length > 0) {
             hasActiveSubscription = true;
             subscriptionName = subInfo.subscriptions[0].plan_name;
             subscriptionEndDate = subInfo.subscriptions[0].end_date;
+            plan_id = subInfo.subscriptions[0].plan_id
           }
           // 保存登录状态
           PreferencesUtil.putSync('isLogin', true);
@@ -364,6 +366,11 @@ export default class UserUtil {
           PreferencesUtil.putSync('subscriptionEndDate', subscriptionEndDate);
           PreferencesUtil.putSync('hasActiveSubscription', hasActiveSubscription);
           PreferencesUtil.putSync('userToken', json.data.system_info?.token || '');
+          if(plan_id=='1'){
+            PreferencesUtil.putSync('isForever', true);
+          }else{
+            PreferencesUtil.putSync('isForever', false);
+          }
           return json.data;
         } else {
           return null;

+ 0 - 2
entry/src/main/ets/common/util/Utility.ets

@@ -137,10 +137,8 @@ export class Utility {
     let isNoble = false
     if(StrUtil.isNotEmpty(expireDate)){
       if(expireDate===VipPage.FOREVER_DATE){
-        PreferencesUtil.putSync('isForever',true)
         isNoble = true
       }else{
-        PreferencesUtil.putSync('isForever',false)
         const currentDate = new Date();
         const targetDate = DateUtil.getFormatDate(expireDate)
 

+ 85 - 46
entry/src/main/ets/pages/ScanFilePage.ets

@@ -219,8 +219,8 @@ export struct ScanFilePage{
                 this.mainCanvasRenderingContext.imageSmoothingQuality = 'medium'
               })
           }
-          .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
-            .animation({ duration: 380, curve: Curve.Ease,delay:30 }))
+          .transition(TransitionEffect.move(TransitionEdge.END)
+            .animation({ duration: 380, curve: Curve.Ease,delay:300 }))
 
           Text(this.strText)
             .height(50)
@@ -229,21 +229,35 @@ export struct ScanFilePage{
             .fontWeight(480)
             .visibility(this.textVisi)
 
-          Button($r('app.string.start_scan'), { type: ButtonType.Capsule, stateEffect: false })
+          Button({ type: ButtonType.Capsule, stateEffect: true }) {
+            Row(){
+              SymbolGlyph($r('sys.symbol.magnifyingglass'))
+                .fontSize(22)
+                .fontColor([Color.White])
+              Text($r('app.string.start_scan'))
+                .margin({ left: 8 })
+                .fontSize(18)
+                .fontColor(Color.White)
+                .fontWeight(480)
+                .textAlign(TextAlign.Center)
+            }
+            .justifyContent(FlexAlign.Center)
+          }
+          .width(180)
+          .height(55)
+          .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
+          .margin({ top: 10, bottom: 10 })
+          .backgroundColor(this.themeColor)
+          .enabled(this.isStart ?false:true)
+          .onClick(() => {
+            this.doOptimize(false)
+
+          })
+          .alignSelf(ItemAlign.Center)
+          .transition(TransitionEffect.move(TransitionEdge.END)
+            .animation({ duration: 380, curve: Curve.Ease,delay:300 }))
 
-            .width(180)
-            .height(55)
-            .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
-            .margin({ top: 10, bottom: 10 })
-            .backgroundColor(this.themeColor)
-            .enabled(this.isStart ?false:true)
-            .onClick(() => {
-              this.doOptimize(false)
 
-            })
-            .alignSelf(ItemAlign.Center)
-            .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
-              .animation({ duration: 380, curve: Curve.Ease,delay:30 }))
 
           Column() {
             Row() {
@@ -314,46 +328,71 @@ export struct ScanFilePage{
           .margin({ left:25,right: 25,top:20,bottom:20  })
           .borderRadius(20)
           .justifyContent(FlexAlign.Center)
-          .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
-            .animation({ duration: 380, curve: Curve.Ease,delay:60 }))
+          .transition(TransitionEffect.move(TransitionEdge.END)
+            .animation({ duration: 380, curve: Curve.Ease,delay:300 }))
 
           Row() {
 
+            Button({ type: ButtonType.Capsule, stateEffect: true }) {
+              Row(){
+                SymbolGlyph($r('sys.symbol.picture'))
+                  .fontSize(19)
+                  .fontColor([Color.White])
+                Text($r('app.string.onekey_cover'))
+                  .margin({ left: 4 })
+                  .fontSize(15)
+                  .fontColor(Color.White)
+                  .fontWeight(480)
+                  .textAlign(TextAlign.Center)
+              }
+              .justifyContent(FlexAlign.Center)
+            }
+            .width(150)
+            .height(55)
+            .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
+            .margin({ top: 10, bottom: 10,right:10 })
+            .backgroundColor(this.themeColor)
+            .enabled(this.isStartCover ?false:true)
+            .onClick(() => {
+              if(PreferencesUtil.getStringSync('COVER_API','')===''){
+                this.showTipsDialog()
+                return
+              }
+              this.doOptimize(true)
 
-            Button($r('app.string.onekey_cover'), { type: ButtonType.Capsule, stateEffect: false })
-              .width(150)
-              .height(55)
-              .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
-              .margin({ top: 10, bottom: 10,right:10 })
-              .backgroundColor(this.themeColor)
-              .enabled(this.isStartCover ?false:true)
-              .onClick(() => {
-                if(PreferencesUtil.getStringSync('COVER_API','')===''){
-                  this.showTipsDialog()
-                  return
-                }
-                this.doOptimize(true)
-
-              })
-              .alignSelf(ItemAlign.Center)
+            })
+            .alignSelf(ItemAlign.Center)
 
-            Button($r('app.string.sync_data'), { type: ButtonType.Capsule, stateEffect: false })
-              .width(150)
-              .height(55)
-              .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
-              .margin({ left:10,top: 10, bottom: 10 })
-              .backgroundColor(this.themeColor)
-              .enabled(this.isStartSync ?false:true)
-              .onClick(() => {
-                this.doSyncData()
+            Button({ type: ButtonType.Capsule, stateEffect: true }) {
+              Row(){
+                SymbolGlyph($r('sys.symbol.arrow_counterclockwise'))
+                  .fontSize(19)
+                  .fontColor([Color.White])
+                Text($r('app.string.sync_data'))
+                  .margin({ left: 4 })
+                  .fontSize(15)
+                  .fontColor(Color.White)
+                  .fontWeight(480)
+                  .textAlign(TextAlign.Center)
+              }
+              .justifyContent(FlexAlign.Center)
+            }
+            .width(150)
+            .height(55)
+            .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
+            .margin({ top: 10, bottom: 10,right:10 })
+            .backgroundColor(this.themeColor)
+            .enabled(this.isStartSync ?false:true)
+            .onClick(() => {
+              this.doSyncData()
 
-              })
-              .alignSelf(ItemAlign.Center)
+            })
+            .alignSelf(ItemAlign.Center)
 
 
           }
-          .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
-            .animation({ duration: 380, curve: Curve.Ease,delay:90 }))
+          .transition(TransitionEffect.move(TransitionEdge.END)
+            .animation({ duration: 380, curve: Curve.Ease,delay:300 }))
 
         }