|
|
@@ -69,13 +69,17 @@ export struct ScanFilePage{
|
|
|
|
|
|
}
|
|
|
|
|
|
- endScan(){
|
|
|
+ endScan(isOnekey:boolean){
|
|
|
const eventData: emitter.EventData = {};
|
|
|
emitter.emit({ eventId: 101 }, eventData); // 发送视频打开广播事件
|
|
|
|
|
|
ToastUtil.showToast('扫描文件入库成功!')
|
|
|
- this.isStart = false
|
|
|
- this.isStartCover = false
|
|
|
+ if(isOnekey){
|
|
|
+ this.isStartCover = false
|
|
|
+ }else{
|
|
|
+ this.isStart = false
|
|
|
+
|
|
|
+ }
|
|
|
this.strText = ''
|
|
|
//结束动画
|
|
|
lottie.pause()
|
|
|
@@ -106,22 +110,25 @@ export struct ScanFilePage{
|
|
|
router.back()
|
|
|
|
|
|
})
|
|
|
- initState(){
|
|
|
+ initState(isOnekey:boolean){
|
|
|
|
|
|
this.initLottie(this.path,true)
|
|
|
- this.isStart = true
|
|
|
- this.isStartCover = true
|
|
|
+ if(isOnekey){
|
|
|
+ this.isStartCover = true
|
|
|
+ }else{
|
|
|
+ this.isStart = true
|
|
|
+ }
|
|
|
this.strText = Utility.resourceToString(getContext(this),$r('app.string.scaning'))
|
|
|
lottie.play()
|
|
|
}
|
|
|
|
|
|
- doOptimize(){
|
|
|
+ doOptimize(isOnekey:boolean){
|
|
|
|
|
|
- this.initState()
|
|
|
+ this.initState(isOnekey)
|
|
|
const task = new taskpool.Task(scanDirectoryTask, getContext(this), this.rootPath,
|
|
|
this.lockPath,PreferencesUtil.getStringSync('COVER_API',''));
|
|
|
taskpool.execute(task, taskpool.Priority.HIGH).then(()=>{
|
|
|
- this.endScan()
|
|
|
+ this.endScan(isOnekey)
|
|
|
}).catch((e:object)=>{
|
|
|
console.info("task1 catch e: " + e);
|
|
|
})
|
|
|
@@ -236,7 +243,7 @@ export struct ScanFilePage{
|
|
|
})
|
|
|
.enabled(this.isStart ?false:true)
|
|
|
.onClick(() => {
|
|
|
- this.doOptimize()
|
|
|
+ this.doOptimize(false)
|
|
|
|
|
|
})
|
|
|
.alignSelf(ItemAlign.Center)
|
|
|
@@ -256,7 +263,7 @@ export struct ScanFilePage{
|
|
|
this.showTipsDialog()
|
|
|
return
|
|
|
}
|
|
|
- this.doOptimize()
|
|
|
+ this.doOptimize(true)
|
|
|
|
|
|
})
|
|
|
.alignSelf(ItemAlign.Center)
|
|
|
@@ -299,7 +306,7 @@ export struct ScanFilePage{
|
|
|
.fontSize(16)
|
|
|
|
|
|
Row() {
|
|
|
- Button('教程')
|
|
|
+ Button('取消')
|
|
|
.fontColor(Color.White)
|
|
|
.backgroundColor($r('app.color.title_bar_bg'))//.linearGradient( { direction: GradientDirection.Right, colors:[['#ff37a0fc',0.0],['#67e667',0.5],['#f5856e',1.0]]})
|
|
|
.height(50)
|
|
|
@@ -307,8 +314,6 @@ export struct ScanFilePage{
|
|
|
.stateEffect(true)
|
|
|
.margin({ right: 6 })
|
|
|
.onClick(() => {
|
|
|
- ToastUtil.showToast('欢迎进群学习教程,复制Q群号成功!')
|
|
|
- Utility.copyText('685109858')
|
|
|
DialogHelper.closeDialog('tips'); //关闭弹框
|
|
|
})
|
|
|
Button('跳转')
|