Parcourir la source

修改toast命名冲突,暂时注释掉forwardingPort插件

wangcy il y a 3 semaines
Parent
commit
49c5e36c89

+ 0 - 50
commons/basic/src/main/ets/components/ToastBuilders/AgreePrivacy.ets

@@ -1,50 +0,0 @@
-import { BasicType } from '../../models';
-import { yTToast } from '../../utils/YTToast';
-import { YTButton } from '../generalComp/YTButton';
-
-@Builder
-export function agreePrivacy(item: BasicType<undefined>) {
-  Column() {
-    Text('温馨提示')
-      .fontSize(14)
-      .fontColor('Color.Black')
-      .margin({ top: 14, bottom: 8 })
-    Text('已阅读并同意《用户协议》和《隐私政策》')
-      .fontSize(13)
-      .fontColor($r('sys.color.mask_secondary'))
-      .margin({ bottom: 19 })
-
-
-    Column() {
-      YTButton({
-        btContent: '同意并登入',
-        btHeight: 37,
-        click: () => {
-          yTToast.hide()
-          
-          item.loginType!.isAgreePrivacy = true
-
-          item.loginType?.executeLogin()
-
-
-        }
-      })
-      YTButton({
-        btContent: '不同意',
-        btHeight: 37,
-        bgc: Color.White,
-        btFontColor: '#80000000',
-        click: () => {
-          yTToast.hide()
-        }
-      })
-    }
-    .padding({ left: 16, right: 16 })
-
-  }
-  .width(280)
-  .height(160)
-  .backgroundColor(Color.White)
-  .borderRadius(8)
-  .margin({ bottom: 28 })
-}

+ 0 - 104
commons/basic/src/main/ets/components/ToastBuilders/AlertToastComp.ets

@@ -1,104 +0,0 @@
-import { BasicType } from '../../models'
-import { yTToast } from '../../utils/YTToast'
-import { YTButton } from '../generalComp/YTButton'
-
-
-@Builder
-export function AlertToastBuilder(item: BasicType<undefined>) {
-  AlertToastComp({
-    message: item.message,
-    onConfirm: item.onConfirm,
-    onCancel: item.onCancel,
-    messageAlignSelf: item.messageAlignSelf,
-    confirmMessage: item.confirmMessage,
-    cancelMessage: item.cancelMessage,
-    isShowClose: item.isShowClose
-  })
-}
-
-@Component
-struct AlertToastComp {
-  message: string = ''
-  confirmMessage: string = '保存并退出'
-  cancelMessage: string = '取消并退出'
-  isShowClose: boolean = true
-  onConfirm: (index: string) => void = (index: string) => {
-  }
-  onCancel: () => void = () => {
-  }
-  messageAlignSelf: ItemAlign = ItemAlign.Center
-
-  build() {
-
-    Column({ space: 24 }) {
-      Stack() {
-        Row() {
-          Text(this.message)
-            .fontSize(16)
-            .fontWeight(400)
-            .fontColor('#FF353C46')
-            .alignSelf(this.messageAlignSelf)
-        }
-        .width('100%')
-        .justifyContent(FlexAlign.Center)
-
-        Row() {
-          Image($r('app.media.icon_cancel_blue'))
-            .width(16)
-        }
-        .width('100%')
-        .justifyContent(FlexAlign.End)
-        .onClick(() => {
-          yTToast.hide()
-        })
-        .visibility(this.isShowClose ? Visibility.Visible : Visibility.Hidden)
-      }
-      .width('100%')
-
-      Row() {
-        YTButton({
-          btContent: this.confirmMessage,
-          btWidth: 104,
-          btHeight: 42,
-          btFontSize: 16,
-          bgc: '#FF6E645E',
-          btPadding: 0,
-          btFontColor: '#FFF',
-          click: () => {
-            // yTToast.hide()
-            // yTRouter.routerBack()
-
-            this.onConfirm?.('0')
-          }
-        })
-        YTButton({
-          btContent: this.cancelMessage,
-          btWidth: 104,
-          btHeight: 42,
-          btFontSize: 16,
-          bgc: '#FFF5F5F7',
-          btPadding: 0,
-          btFontColor: '#FF353C46',
-          click: () => {
-            // console.log('你好')
-            this.onCancel?.()
-          }
-        })
-      }
-      .width('100%')
-      .justifyContent(FlexAlign.SpaceBetween)
-    }
-    .width(343)
-    // .height(138)
-    .padding({
-      left: 48,
-      right: 48,
-      top: 28,
-      bottom: 20
-    })
-    .backgroundColor('#FFF')
-    .borderRadius(16)
-
-    // .margin({ left: 16, right: 16 })
-  }
-}

+ 0 - 44
commons/basic/src/main/ets/components/ToastBuilders/LoginToUse.ets

@@ -1,44 +0,0 @@
-import { BasicType } from '../../models';
-import { yTRouter } from '../../utils/YTRouter';
-import { YTButton } from '../generalComp/YTButton';
-
-@Builder
-export function loginToUse(_: BasicType) {
-  Column() {
-    Row() {
-      Text('登录使用所有功能')
-        .fontSize(16)
-        .fontWeight(400)
-        .fontColor('#B31C1C1C')
-
-      YTButton({
-        btHeight: 30,
-        btWidth: 80,
-        btContent: '马上登录',
-        btBorderRadius: 32,
-        btFontSize: 12,
-        click: () => {
-          yTRouter.router2LoginPage()
-        }
-      })
-    }
-    .justifyContent(FlexAlign.SpaceBetween)
-    .padding({
-      top: 13,
-      left: 20,
-      bottom: 13,
-      right: 20
-    })
-    .borderRadius(8)
-    .backgroundColor(Color.White)
-    .width('100%')
-    .height(56)
-    .shadow({
-      color: '#14000000',
-      radius: 32,
-      offsetX: 0,
-      offsetY: 4
-    })
-  }
-  .padding({ left: 20, right: 20 })
-}

+ 0 - 54
commons/basic/src/main/ets/components/ToastBuilders/YtDoubleConfirm.ets

@@ -1,54 +0,0 @@
-import { YTButton, yTToast, } from '../../../../../Index';
-import { BasicType } from '../../models';
-
-@Builder
-export function yTDoubleConfirm(item: BasicType<undefined>) {
-  Column() {
-    Text(item.text)
-      .fontSize(14)
-      .fontColor(Color.Black)
-      .margin({ bottom: 18 })
-    Text(item.message)
-      .fontColor($r('sys.color.mask_secondary'))
-      .lineHeight(18)
-      .fontSize(13)
-      .margin({ bottom: 18 })
-    Row() {
-      YTButton(
-        {
-          btContent: '确定',
-          btWidth: 108,
-          btHeight: 37,
-          btFontSize: 12,
-          click: item.click,
-          btLinearGradient: { angle: 92, colors: [['#FF4597F7', 0.023], ['#FF6B6DF7', 1.081]] },
-        }
-      )
-      YTButton(
-        {
-          btContent: '取消',
-          btWidth: 108,
-          btHeight: 37,
-          btFontColor: '#80000000',
-          btBorder: { width: 1, color: '#33000000' },
-          btFontSize: 12,
-          bgc: Color.White,
-          click: () => {
-            yTToast.hide()
-          }
-        }
-      )
-    }
-    .justifyContent(FlexAlign.SpaceBetween)
-    .width('100%')
-  }
-  .width(280)
-  .padding({
-    top: 14,
-    left: 24,
-    right: 24,
-    bottom: 24
-  })
-  .backgroundColor(Color.White)
-  .borderRadius(8)
-}

+ 23 - 23
hvigorfile.ts

@@ -479,34 +479,34 @@ function rDBPlugin(): HvigorPlugin {
     }
 }
 
-function forwardingPort(){
-    return {
-        pluginId: 'customPlugin',
-        apply(node: HvigorNode) {
-            try {
-                var connectKeys = execSync('hdc list targets', { encoding: 'utf-8' }).split('\n');
-
-                var targetKey = connectKeys[0].trim();
-
-                var operation = `hdc -t ${targetKey} fport rm tcp:8080 tcp:8080`
-                var result = execSync(operation, { encoding: 'utf-8' })
-                console.log(`执行命令 ${operation}, 删除端口结果:${result.trim()}`);
-
-                operation = `hdc -t ${targetKey} fport tcp:8080 tcp:8080`
-                result = execSync(operation, { encoding: 'utf-8' })
-                console.log(`执行命令 ${operation}, 转发端口结果:${result.trim()}`);
-            } catch (error) {
-                console.error(`执行失败: ${error.message}`);
-            }
-        }
-    }
-}
+// function forwardingPort(){
+//     return {
+//         pluginId: 'customPlugin',
+//         apply(node: HvigorNode) {
+//             try {
+//                 var connectKeys = execSync('hdc list targets', { encoding: 'utf-8' }).split('\n');
+//
+//                 var targetKey = connectKeys[0].trim();
+//
+//                 var operation = `hdc -t ${targetKey} fport rm tcp:8080 tcp:8080`
+//                 var result = execSync(operation, { encoding: 'utf-8' })
+//                 console.log(`执行命令 ${operation}, 删除端口结果:${result.trim()}`);
+//
+//                 operation = `hdc -t ${targetKey} fport tcp:8080 tcp:8080`
+//                 result = execSync(operation, { encoding: 'utf-8' })
+//                 console.log(`执行命令 ${operation}, 转发端口结果:${result.trim()}`);
+//             } catch (error) {
+//                 console.error(`执行失败: ${error.message}`);
+//             }
+//         }
+//     }
+// }
 
 export default {
     system: appTasks,  /* Built-in plugin of Hvigor. It cannot be modified. */
     plugins: [
         customPlugin(),  // 应用自定义Plugin
         rDBPlugin(),
-        forwardingPort()
+        // forwardingPort()
     ]         /* Custom plugin to extend the functionality of Hvigor. */
 }