Эх сурвалжийг харах

双指缩放的设置界面功能

onecold 1 жил өмнө
parent
commit
610230a75f

+ 2 - 0
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -97,6 +97,8 @@ export class CommonConstants {
 
   static readonly PIP_LYRIC_BG = ["音乐封面", "自定义"]
 
+  static readonly TWO_FINGER_TYPE = ["小", "中", "大"]
+
 
   //德本的接口调用微信支付下单接口返回的支付交易会话ID,该值有效期为2小时。
   static readonly WX_PAY_API: string = "https://pay.ss5.xyz/wechat/prepay"

+ 8 - 12
entry/src/main/ets/pages/SettingPage.ets

@@ -666,22 +666,18 @@ export struct SettingPage {
               //   .height(30);
 
               Select([
-                { value: CommonConstants.SORT_ARRAY[0] },
-                { value: CommonConstants.SORT_ARRAY[1] },
-                { value: CommonConstants.SORT_ARRAY[2] },
-                { value: CommonConstants.SORT_ARRAY[3] },
-                { value: CommonConstants.SORT_ARRAY[4] },
-                { value: CommonConstants.SORT_ARRAY[5] },
-                { value: CommonConstants.SORT_ARRAY[6] },
-                { value: CommonConstants.SORT_ARRAY[7] }])
+                { value: CommonConstants.TWO_FINGER_TYPE[0] },
+                { value:CommonConstants.TWO_FINGER_TYPE[1]},
+                { value: CommonConstants.TWO_FINGER_TYPE[2] }])
                 .font({ size: 15, weight: FontWeight.Medium })
                 .fontColor(Color.Gray)
                 .margin({ right: 18 })
-                .selected(this.sortType)
-                .value(CommonConstants.SORT_ARRAY[this.sortType])
+                .selected(this.twoFingerType)
+                .value(CommonConstants.TWO_FINGER_TYPE[this.twoFingerType-1])
                 .onSelect(async (_index: number, text?: string | undefined) => {
-                  this.sortType = _index
-                  PreferencesUtil.put(SettingPage.SORT_TYPE, this.sortType)
+                  _index ++;
+                  this.twoFingerType = _index
+                  PreferencesUtil.put(SettingPage.TWO_FINGER_TYPE, this.twoFingerType)
                   this.sendChangeEvent()
                 })
             }