WanAndroid(鸿蒙版)开发的第三篇

前言

DevEco Studio版本:4.0.0.600

WanAndroid的API链接:玩Android 开放API-玩Android - wanandroid.com

其他篇文章参考:

1、WanAndroid(鸿蒙版)开发的第一篇

2、WanAndroid(鸿蒙版)开发的第二篇

3、WanAndroid(鸿蒙版)开发的第三篇

4、WanAndroid(鸿蒙版)开发的第四篇

5、WanAndroid(鸿蒙版)开发的第五篇

效果

   

搜索页面实现

从效果图上可以知道整体是竖直方向(Column),包括:搜索框、热搜、搜索历史三个模块

1、搜索框

代码实现:

 RelativeContainer() {
            Image($r('app.media.ic_back'))
               .width(32)
               .height(32)
               .id('imageBack')
               .margin({ left: 10, right: 10 })
               .alignRules({
                  center: { anchor: '__container__', align: VerticalAlign.Center },
                  left: { anchor: '__container__', align: HorizontalAlign.Start }
               })
               .onClick(() => {
                  router.back()
               })

            Button('搜索')
               .height(35)
               .fontColor(Color.White)
               .id('buttonSearch')
               .margin({ left: 10, right: 10 })
               .alignRules({
                  center: { anchor: '__container__', align: VerticalAlign.Center },
                  right: { anchor: '__container__', align: HorizontalAlign.End }
               })
               .linearGradient({
                  angle: 0,
                  colors: [['#E4572F', 0], ['#D64025', 1]]
               })
               .onClick(() => {
                  if (this.searchContent.trim().length > 0) {
                     this.insertData(new SearchContentBean(this.searchContent.trim()))
                     this.jumpToSearchDetails(this.searchContent)
                  } else {
                     promptAction.showToast({ message: '搜索内容为空' })
                  }
               })

            Row() {
               Image($r('app.media.ic_search_8a8a8a'))
                  .width(20)
                  .height(20)
               TextInput({ placeholder: '发现更多干货', text: '鸿洋' })
                  .fontSize(16)
                  .backgroundColor('#00000000')
                  .enterKeyType(EnterKeyType.Search)
                  .width('100%')
                  .height(45)
                  .flexShrink(1)
                  .onChange((value: string) => {
                     this.searchContent = value
                  })
            }
            .height(45)
            .padding(5)
            .borderWidth(1)
            .borderColor('#ED7C12')
            .borderRadius(10)
            .id('rowSearch')
            .alignRules({
               center: { anchor: '__container__', align: VerticalAlign.Center },
               left: { anchor: 'imageBack', align: HorizontalAlign.End },
               right: { anchor: 'buttonSearch', align: HorizontalAlign.Start }
            })
         }
         .width('100%')
         .height(70)

2、热搜

从UI效果上可以看出热搜内容是个流式布局,要实现流式布局可以通过

Flex({ justifyContent: FlexAlign.Start, wrap: FlexWrap.Wrap }) 来实现

参考:OpenHarmony Flex

代码实现:

@Component
export struct FlowlayoutView {
   @Link flowlayoutArr: string[]
   private onItemClick: (item: string, index: number) => void = () => {
   }

   build() {
      // Flex布局, wrap为FlexWrap.Wrap为流式布局
      Flex({ justifyContent: FlexAlign.Start, wrap: FlexWrap.Wrap }) {
         if (this.flowlayoutArr.length > 0) {
            ForEach(this.flowlayoutArr,
               (item: string, index: number) => {
                  Text(`${item}`)
                     .fontSize(18)
                     .fontColor(Color.White)
                     .borderStyle(BorderStyle.Solid)
                     .padding({ left: 10, right: 10, top: 6, bottom: 6 })
                     .backgroundColor(Color.Pink)
                     .borderRadius(5)
                     .margin({ top: 10, right: 10 })
                     .textOverflow({ overflow: TextOverflow.Ellipsis })
                     .maxLines(2)
                     .onClick(() => {
                        this.onItemClick(item, index)
                     })
               },
               (item: string) => item.toString()
            )
         }
      }
   }
}

3、搜索历史

每次点击搜索或点击热搜中的关键词时,将点击的内容保存到数据库中,在搜索页面显示时(onPageShow)去查询数据库。UI上通过List去加载查询的数据

数据库实现:

参考BaseLibrary 中database里面的代码

代码实现:

List() {
   ForEach(this.searchHistoryList, (item, index) => {
      ListItem() {
         Row() {
            Image($r('app.media.searchHistory'))
               .width(24)
               .height(24)
               .margin({ left: 20 })
            Text(item)
               .fontColor(this.getTextColor(index))
               .fontSize(20)
               .margin({ right: 20 })
         }.width('100%')
         .padding({ top: 15, bottom: 15 })
         .justifyContent(FlexAlign.SpaceBetween)
      }.swipeAction({ end: this.itemEnd(index) })
      .onClick(() => {
         this.jumpToSearchDetails(item)
      })
   })
}
.flexShrink(1)
.width('100%')
.height('100%')

4、详细代码

import router from '@ohos.router'
import promptAction from '@ohos.promptAction'
import { FlowlayoutView, HttpManager, RequestMethod, SearchContentBean, SQLManager } from '@app/BaseLibrary'
import LogUtils from '@app/BaseLibrary/src/main/ets/utils/LogUtils'
import { SearchHotKey } from '../../bean/search/SearchHotKeyBean'

const TAG = 'SearchPage--- ';

@Entry
@Component
struct SearchPage {
  private sqlManager = new SQLManager();
  @State searchContent: string = ''
  @State searchHotKeyArr: string[] = []
  @State searchHistoryList: string[] = []
  @State searchContentBeanList: SearchContentBean[] = []

  aboutToAppear() {
    this.getSearchHotKeyData()
  }

  onPageShow() {
    this.queryAllData()
  }

  private getSearchHotKeyData() {
    HttpManager.getInstance()
      .request<SearchHotKey>({
        method: RequestMethod.GET,
        url: `https://www.wanandroid.com/hotkey/json`, //wanAndroid的API:搜索热词
      })
      .then((result: SearchHotKey) => {
        LogUtils.info(TAG, "result: " + JSON.stringify(result))
        if (result.errorCode == 0) {
          for (let i = 0; i < result.data.length; i++) {
            this.searchHotKeyArr = this.searchHotKeyArr.concat(result.data[i].name)
          }
        }
        LogUtils.info(TAG, "添加后的searchHotKeyArr: " + JSON.stringify(this.searchHotKeyArr))
      })
      .catch((error) => {
        LogUtils.info(TAG, "error: " + JSON.stringify(error))
      })
  }

  build() {
    Column() {
      RelativeContainer() {
        Image($r('app.media.ic_back'))
          .width(32)
          .height(32)
          .id('imageBack')
          .margin({ left: 10, right: 10 })
          .alignRules({
            center: { anchor: '__container__', align: VerticalAlign.Center },
            left: { anchor: '__container__', align: HorizontalAlign.Start }
          })
          .onClick(() => {
            router.back()
          })

        Button('搜索')
          .height(35)
          .fontColor(Color.White)
          .id('buttonSearch')
          .margin({ left: 10, right: 10 })
          .alignRules({
            center: { anchor: '__container__', align: VerticalAlign.Center },
            right: { anchor: '__container__', align: HorizontalAlign.End }
          })
          .linearGradient({
            angle: 0,
            colors: [['#E4572F', 0], ['#D64025', 1]]
          })
          .onClick(() => {
            if (this.searchContent.trim().length > 0) {
              this.insertData(new SearchContentBean(this.searchContent.trim()))
              this.jumpToSearchDetails(this.searchContent)
            } else {
              promptAction.showToast({ message: '搜索内容为空' })
            }
          })

        Row() {
          Image($r('app.media.ic_search_8a8a8a'))
            .width(20)
            .height(20)
          TextInput({ placeholder: '发现更多干货', text: '鸿洋' })
            .fontSize(16)
            .backgroundColor('#00000000')
            .enterKeyType(EnterKeyType.Search)
            .width('100%')
            .height(45)
            .flexShrink(1)
            .onChange((value: string) => {
              this.searchContent = value
            })
        }
        .height(45)
        .padding(5)
        .borderWidth(1)
        .borderColor('#ED7C12')
        .borderRadius(10)
        .id('rowSearch')
        .alignRules({
          center: { anchor: '__container__', align: VerticalAlign.Center },
          left: { anchor: 'imageBack', align: HorizontalAlign.End },
          right: { anchor: 'buttonSearch', align: HorizontalAlign.Start }
        })
      }
      .width('100%')
      .height(70)

      Divider().strokeWidth(1).color('#F1F3F5')

      Text('热搜')
        .fontSize(20)
        .fontColor('#D64025')
        .margin({ left: 15, right: 15, top: 10 })
        .alignSelf(ItemAlign.Start)

      //自定义流式布局
      FlowlayoutView({
        flowlayoutArr: this.searchHotKeyArr,
        onItemClick: (item, index) => {
          LogUtils.info(TAG, "Index------   点击了:index: " + index + " item: " + item)
          this.insertData(new SearchContentBean(item))
          this.jumpToSearchDetails(item)
        }
      }).margin({ left: 20, right: 20 })

      Row() {
        Text('搜索历史')
          .fontSize(20)
          .fontColor('#1296db')
          .margin({ left: 15, right: 15, top: 15, bottom: 15 })
          .alignSelf(ItemAlign.Start)

        Row() {
          Image($r('app.media.deleteAll'))
            .width(22)
            .height(22)
          Text('清空')
            .fontColor(Color.Black)
            .margin({ left: 5 })
            .fontSize(20)
        }.margin({ left: 15, right: 15, top: 15, bottom: 15 })
        .onClick(() => {
          this.deleteAllData()
        })
      }
      .width('100%')
      .justifyContent(FlexAlign.SpaceBetween)

      List() {
        ForEach(this.searchHistoryList, (item, index) => {
          ListItem() {
            Row() {
              Image($r('app.media.searchHistory'))
                .width(24)
                .height(24)
                .margin({ left: 20 })
              Text(item)
                .fontColor(this.getTextColor(index))
                .fontSize(20)
                .margin({ right: 20 })
            }.width('100%')
            .padding({ top: 15, bottom: 15 })
            .justifyContent(FlexAlign.SpaceBetween)
          }.swipeAction({ end: this.itemEnd(index) })
          .onClick(() => {
            this.jumpToSearchDetails(item)
          })
        })
      }
      .flexShrink(1)
      .width('100%')
      .height('100%')
    }
    .width('100%')
    .height('100%')
    .backgroundColor(Color.White)
  }

  @Builder
  itemEnd(index: number) { // 侧滑后尾端出现的组件
    Image($r('app.media.deleteAll'))
      .width(30)
      .height(30)
      .margin(10)
      .onClick(() => {
        this.deleteData(this.searchContentBeanList[index])
        this.searchHistoryList.splice(index, 1);
        this.searchContentBeanList.splice(index, 1);
      })
  }

  /**
   * 跳转到搜索详情页
   */
  private jumpToSearchDetails(content: string) {
    router.pushUrl({
      url: 'pages/search/SearchDetailsPage',
      params: {
        searchContent: content
      }
    }, router.RouterMode.Single)
  }

  private deleteData(searchContentBean: SearchContentBean) {
    LogUtils.info("Rdb-----   deleteData result: " + searchContentBean.id + "   searchContent: " + searchContentBean.searchContent)
    this.sqlManager.deleteData(searchContentBean, (result) => {
      LogUtils.info("Rdb-----   删除 result: " + result)
    })
  }

  /**
   * 删除所有数据
   */
  private deleteAllData() {
    if (this.searchHistoryList.length <= 0) {
      promptAction.showToast({ message: '没有可清除的数据' })
      return
    }
    this.sqlManager.deleteDataAll((result) => {
      LogUtils.info(TAG, "Rdb-----   删除所有 result: " + result)
      if (result) {
        promptAction.showToast({ message: '清除完成' })
        this.searchHistoryList = []
      }
    })
  }

  /**
   * 查询所有数据
   */
  private queryAllData() {
    this.sqlManager.getRdbStore(() => {
      this.sqlManager.query((result: Array<SearchContentBean>) => {
        LogUtils.info(TAG, "Rdb-----   查询 result: " + JSON.stringify(result))
        this.searchContentBeanList = result
        this.searchHistoryList = []
        for (let i = 0; i < result.length; i++) {
          this.searchHistoryList.push(result[i].searchContent)
        }
      })
    })
  }

  /**
   * 插入数据
   */
  private insertData(searchContentBean: SearchContentBean) {
    this.sqlManager.insertData(searchContentBean, (id: number) => {
      LogUtils.info(TAG, "Rdb-----  result  插入 id: " + id)
      searchContentBean.id = id
      if (id >= 0) { //id < 0 表示插入数据失败
      }
    })
  }

  private getTextColor(index: number): ResourceColor {
    if (index % 3 == 0) {
      return Color.Orange
    } else if (index % 3 == 1) {
      return Color.Blue
    } else if (index % 3 == 2) {
      return Color.Pink
    }
    return Color.Black
  }
}

搜索详情页面实现

1、代码实现:

import router from '@ohos.router';
import {
   Constants,
   HtmlUtils,
   HttpManager,
   LoadingDialog,
   RefreshController,
   RefreshListView,
   RequestMethod
} from '@app/BaseLibrary';
import LogUtils from '@app/BaseLibrary/src/main/ets/utils/LogUtils';
import { SearchDetailsItemBean } from '../../bean/search/SearchDetailsItemBean';
import { SearchDetailsBean } from '../../bean/search/SearchDetailsBean';
import promptAction from '@ohos.promptAction';
import { AppTitleBar } from '../../widget/AppTitleBar';

const TAG = 'SearchDetailsPage--- ';

@Entry
@Component
struct SearchDetailsPage {
   @State searchContent: string = router.getParams()?.['searchContent'];
   @State controller: RefreshController = new RefreshController()
   @State searchDetailsListData: Array<SearchDetailsItemBean> = [];
   @State pageNum: number = 0
   @State isRefresh: boolean = true
   @State userName: string = ''
   @State token_pass: string = ''

   aboutToAppear() {
      LogUtils.info(TAG, " aboutToAppear: " + this.searchContent)
      if (AppStorage.Has(Constants.APPSTORAGE_USERNAME)) {
         this.userName = AppStorage.Get(Constants.APPSTORAGE_USERNAME) as string
      }
      if (AppStorage.Has(Constants.APPSTORAGE_TOKEN_PASS)) {
         this.token_pass = AppStorage.Get(Constants.APPSTORAGE_TOKEN_PASS) as string
      }
      this.dialogController.open()
      this.getSearchDetailsData()
   }

   private getSearchDetailsData() {
      HttpManager.getInstance()
         .request<SearchDetailsBean>({
            method: RequestMethod.POST,
            header: {
               "Content-Type": "application/json",
               "Cookie": `loginUserName=${this.userName}; token_pass=${this.token_pass}`
            },
            url: `https://www.wanandroid.com/article/query/${this.pageNum}/json/?k=${encodeURIComponent(this.searchContent)}`, //wanAndroid的API:搜索  ?k=${this.searchContent}
         })
         .then((result: SearchDetailsBean) => {
            LogUtils.info(TAG, "result: " + JSON.stringify(result))
            if (this.isRefresh) {
               this.controller.finishRefresh()
            } else {
               this.controller.finishLoadMore()
            }
            if (result.errorCode == 0) {
               if (this.isRefresh) {
                  this.searchDetailsListData = result.data.datas
               } else {
                  if (result.data.datas.length > 0) {
                     this.searchDetailsListData = this.searchDetailsListData.concat(result.data.datas)
                  } else {
                     promptAction.showToast({ message: '没有更多数据啦!' })
                  }
               }
            }
            this.dialogController.close()
         })
         .catch((error) => {
            LogUtils.info(TAG, "error: " + JSON.stringify(error))
            if (this.isRefresh) {
               this.controller.finishRefresh()
            } else {
               this.controller.finishLoadMore()
            }
            this.dialogController.close()
         })
   }

   build() {
      Column() {
         AppTitleBar({ title: this.searchContent })

         RefreshListView({
            list: this.searchDetailsListData,
            controller: this.controller,
            isEnableLog: true,
            paddingRefresh: { left: 10, right: 10, top: 5, bottom: 5 },
            refreshLayout: (item: SearchDetailsItemBean, index: number): void => this.itemLayout(item, index),
            onItemClick: (item: SearchDetailsItemBean, index: number) => {
               LogUtils.info(TAG, "点击了:index: " + index + " item: " + item)
               router.pushUrl({
                  url: 'pages/WebPage',
                  params: {
                     title: item.title,
                     uriLink: item.link
                  }
               }, router.RouterMode.Single)
            },
            onRefresh: () => {
               //下拉刷新
               this.isRefresh = true
               this.pageNum = 0
               this.getSearchDetailsData()
            },
            onLoadMore: () => {
               //上拉加载
               this.isRefresh = false
               this.pageNum++
               this.getSearchDetailsData()
            }
         }).flexShrink(1)

      }
      .width('100%')
      .height('100%')
      .backgroundColor('#F1F3F5')
   }

   @Builder
   itemLayout(item: SearchDetailsItemBean, index: number) {
      RelativeContainer() {
         //作者或分享人
         Text(item.author.length > 0 ? "作者:" + item.author : "分享人:" + item.shareUser)
            .fontColor('#666666')
            .fontSize(14)
            .id("textAuthor")
            .alignRules({
               top: { anchor: '__container__', align: VerticalAlign.Top },
               left: { anchor: '__container__', align: HorizontalAlign.Start }
            })

         Text(item.superChapterName + '/' + item.chapterName)
            .fontColor('#1296db')
            .fontSize(14)
            .id("textChapterName")
            .alignRules({
               top: { anchor: '__container__', align: VerticalAlign.Top },
               right: { anchor: '__container__', align: HorizontalAlign.End }
            })

         //标题
         Text(HtmlUtils.formatStr(item.title))
            .fontColor('#333333')
            .fontWeight(FontWeight.Bold)
            .maxLines(2)
            .textOverflow({
               overflow: TextOverflow.Ellipsis
            })
            .fontSize(20)
            .margin({ top: 10 })
            .id("textTitle")
            .alignRules({
               top: { anchor: 'textAuthor', align: VerticalAlign.Bottom },
               left: { anchor: '__container__', align: HorizontalAlign.Start }
            })

         //更新时间
         Text("时间:" + item.niceDate)
            .fontColor('#666666')
            .fontSize(14)
            .id("textNiceDate")
            .alignRules({
               bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
               left: { anchor: '__container__', align: HorizontalAlign.Start }
            })
      }
      .width('100%')
      .height(120)
      .padding(10)
      .borderRadius(10)
      .backgroundColor(Color.White)
   }

   private dialogController = new CustomDialogController({
      builder: LoadingDialog(),
      customStyle: true,
      alignment: DialogAlignment.Center, // 可设置dialog的对齐方式,设定显示在底部或中间等,默认为底部显示
   })
}

2、根据传入的搜索词获取数据

aboutToAppear() {
   this.getSearchDetailsData()
}

源代码地址:WanAndroid_Harmony: WanAndroid的鸿蒙版本

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/466992.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

微信小程序 nodejs+vue+uninapp学生在线选课作业管理系统

基于微信小程序的班级作业管理助手使用的是MySQL数据库&#xff0c;nodejs语言和IDEA以及微信开发者工具作为开发工具&#xff0c;这些技术和工具我在日常的作业中都经常的使用&#xff0c;并且因为对编程感兴趣&#xff0c;在闲暇时间也进行的进行编程的提高&#xff0c;所以在…

09|代理(上):ReAct框架,推理与行动的协同

应用思维链推理并不能解决大模型的固有问题&#xff1a;无法主动更新自己的知识&#xff0c;导致出现事实幻觉。也就是说&#xff0c;因为缺乏和外部世界的接触&#xff0c;大模型只拥有训练时见过的知识&#xff0c;以及提示信息中作为上下文提供的附加知识。如果你问的问题超…

AI+权重衰退

AI权重衰退 1权重衰退2代码实现 2丢弃法 1权重衰退 AI权重衰退是指在人工智能&#xff08;AI&#xff09;领域中的一种技术或方法&#xff0c;用于训练机器学习模型时对权重进行惩罚或调整&#xff0c;以避免过拟合现象的发生。 在机器学习中&#xff0c;过拟合是指模型在训练…

c语言文件操作(中)

目录 1. 文件的顺序读写1.1 顺序读写函数1.2 顺序读写函数的原型和介绍 结语 1. 文件的顺序读写 1.1 顺序读写函数 函数名功能适用于fgetc字符输入函数所有输出流fputc字符输出函数所有输出流fgets文本行输入函数所有输出流fputs文本行输出函数所有输出流fscanf格式化输入函数…

苍穹外卖-day08:导入地址簿功能代码(单表crud)、用户下单(业务逻辑)、订单支付(业务逻辑,cpolar软件)

苍穹外卖-day08 课程内容 导入地址簿功能代码用户下单订单支付 功能实现&#xff1a;用户下单、订单支付 用户下单效果图&#xff1a; 订单支付效果图&#xff1a; 1. 导入地址簿功能代码&#xff08;单表crud&#xff09; 1.1 需求分析和设计 1.1.1 产品原型&#xff08…

C++_day6

思维导图&#xff1a; 2试编程 封装一个动物的基类&#xff0c;类中有私有成员: 姓名&#xff0c;颜色&#xff0c;指针成员年纪 再封装一个狗这样类&#xff0c;共有继承于动物类&#xff0c;自己拓展的私有成员有:指针成员:腿的个数(整型 int count)&#xff0c;共有成员函数…

7.测试教程-自动化测试selenium-2

文章目录 1.webdriver API1.1元素的定位1.2id定位1.3name 定位1.4tag name 定位和class name 定位1.5CSS 定位(常用)1.5.1概念1.5.2实操1.5.3语法 1.6XPath 定位1.6.1概念1.6.2实操1.6.3语法 1.7link text定位1.8Partial link text 定位1.9一个简单的测试实战1.10CSS定位和XPat…

【人工智能】英文学习材料03(每日一句)

&#x1f33b;个人主页&#xff1a;相洋同学 &#x1f947;学习在于行动、总结和坚持&#xff0c;共勉&#xff01; 目录 Chain Rule (链式法则) Dimensionality Reduction (降维) Long Short-Term Memory (LSTM) (长短期记忆网络) Gradient Explosion (梯度爆炸) Gradie…

Java项目:63 ssm网上花店设计+vue

作者主页&#xff1a;舒克日记 简介&#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文中获取源码 项目介绍 系统具备友好性且功能完善。管理员登录进入后台之后&#xff0c;主要完成花材选择管理&#xff0c;用户管理&#xff0c;鲜花管理&#xff0c;鲜花出入…

计算机网络实践学习 思科实验31:配置思科DHCP

思科实验31&#xff1a;配置思科DHCP 实验拓扑图实验目标实验步骤实验配置 实验拓扑图 实验目标 配置思科设备作为DHCP服务器 实验步骤 配置OSPF路由协议配置R1为DHCP服务器配置DHCP中继&#xff0c;使得PC3可以获得地址全网通信测试 实验配置 1、配置R1为DHCP服务器&…

React Native: could not connect to development server

问题&#xff1a; 运行模拟器错误&#xff1a;无法连接到开发服务器 原因分析&#xff1a; 1、确认模拟器连接状态&#xff0c;是连接成功的 查看进程的端口占用&#xff0c;也没问题 lsof -i tcp:8081 kill pid2、检查包服务器是否运行正常 连接真机进行调试发现真机是正常…

【力扣精选算法100道】——带你了解(数组模拟栈)算法

目录 &#x1f4bb;比较含退格的字符串 &#x1f388;了解题意 &#x1f388;分析题意 &#x1f6a9;栈 &#x1f6a9;数组模拟栈 &#x1f388;实现代码 844. 比较含退格的字符串 - 力扣&#xff08;LeetCode&#xff09; &#x1f4bb;比较含退格的字符串 &#x1f3…

查看网卡和网关命令

ifconfig&#xff08;接口配置&#xff09; 是一个网络管理工具&#xff0c;它用于配置和查看 Linux 操作系统中网络接口的状态&#xff0c;使用ifconfig&#xff0c;您可以分配 IP 地址、启用或禁用接口、管理 ARP 缓存、路由等。 ping命令是个使用频率极高的网络诊断工具。…

win32汇编弹出对话框

之前书上有一个win32 asm 的odbc例子&#xff0c;它有一个窗体&#xff0c;可以执行sql&#xff1b;下面看一下弹出一个录入数据的对话框&#xff1b; 之前它在.code段包含2个单独的asm文件&#xff0c;增加第三个&#xff0c;增加的这个里面是弹出对话框的窗口过程&#xff0…

01初识Python

一、Python 简介 二、为什么要学Python&#xff1f; 三、Python 安装 四、输出第一条指令 五、总结 一、Python 简介 Python是一种高级编程语言&#xff0c;由Guido van Rossum于1991年创建。它具有简单易学的语法结构&#xff0c;被广泛应用于Web开发、数据科学、人工智…

LeetCode刷题记录:(11)组合(初识回溯算法)

leetcode传送通道 暂时记录&#xff0c;这篇没啥营养&#xff0c;不用看了 class Solution {List<List<Integer>> result new ArrayList<>(); // 存所有组合List<Integer> path new LinkedList<>(); //存每一个组合public List<List<Int…

高效使用git流程分享

准备 假设你已经 clone 了当前仓库&#xff0c;并且你的终端位置已经位于仓库目录中。 查询状态 查询状态常用的命令有 git status 和 git branch。 前者用于查询更改文件情况&#xff0c;后者用于展示所有分支。 chatbot-system$ git status On branch develop Your bran…

基于SpringBoot和Vue的图书个性化推荐系统的设计与实现

今天要和大家聊的是一款基于SpringBoot和Vue的图书个性化推荐系统。 &#x1f495;&#x1f495;作者&#xff1a;李同学 &#x1f495;&#x1f495;个人简介&#xff1a;混迹在java圈十年有余&#xff0c;擅长Java、微信小程序、Python、Android等&#xff0c;大家有这一块的…

Spring-3

目录 Spring AOP和AspectJ AOP 在Spring AOP 中&#xff0c;关注点和横切关注的区别 Spring 框架中的单例 Bean 是线程安全的吗 Spring 是怎么解决循环依赖的&#xff1f; 事务隔离级别 事务的传播级别 Spring 事务实现方式 Spring框架的事务管理有哪些优点 事务注解的…

【鸿蒙HarmonyOS开发笔记】如何使用图片插帧将低像素图片清晰放大

开发UI时&#xff0c;当我们的原图分辨率较低并且需要放大显示时&#xff0c;图片会模糊并出现锯齿。如下图所示 这时可以使用interpolation()方法对图片进行插值&#xff0c;使图片显示得更清晰。该方法的参数为ImageInterpolation枚举类型&#xff0c;可选的值有: ImageInte…