分享_利用定时器函数实现图片轮播效果【制作系统登录开工大吉欢迎图片】_想到就说
学习.交流
专业源于专注
www. onlyit. cn   
学习交流 文件下载 手册资料 交流QQ群

    

 4  1/1   1  
作者
内容
fwj3861  [个人空间]
QQ名  越南-叶子(121305301)


注册  2010-09-09
发贴数  535
精华贴  10
原创贴  20
来自  越南
状态  正常

级别  贵宾
#1»发布于2024-02-17 22:55

因系统不支持显示GIF格式图片,所以利用定时器函数可以做到图片轮播效果!也可以根据这个思路在每个单据添加图片式的新手指引,定时轮播展示或手动轮播都是可以的 
 
1.在【秘书】菜单下的【文档管理】上传用来轮播的图片(例如新增了一个文档目录编号【CAAB】的文档目录) 
2.在【导航窗口脚本定义】里面添加窗口最大化脚本 
int main() 

win_max()   //最大化导航窗口 
  return 1; 
}; 
3.在【主窗口脚本定义】里添加脚本 
int timer1() 

 gui_hide('kgdj6')  //隐藏第6张图片控件【多次轮播才需要隐藏最后一张图片控件】 
 string v_tp1; 
 v_tp1 = get_edoc_file("CAAB","龙年大吉1.jpg"); //提取第1张图片,【CAAB】是存放轮播照片的文档目录编号,根据实际修改,【龙年大吉1.jpg】这是文档资料的资料名称 
 gui_create_image("ScrollBox_Base",'kgdj1',770,220,380,660,v_tp1)  //创建第1张图片控件 
 timer_create('timer_hello2',1500,'main_win_open','timer2') //设置第2个定时器1.5秒后创建第2张图片的控件 
 timer_stop('timer_hello1');  //关闭第1个定时器 
 timer_start('timer_hello2');  //启动第2个定时器 
  return 1; 
}; 
int timer2() 

 gui_hide('kgdj1')  //隐藏第1张图片控件 
 string v_tp1; 
 v_tp1 = get_edoc_file("CAAB","龙年大吉2.jpg");  //提取第2张图片 
 gui_create_image("ScrollBox_Base",'kgdj2',610,270,660,380,v_tp1)  //创建第2张图片控件 
 timer_create('timer_hello3',1500,'main_win_open','timer3')  //设置第3个定时器1.5秒后创建第3张图片的控件 
 timer_stop('timer_hello2');  //关闭第2个定时器 
 timer_start('timer_hello3');  //启动第3个定时器 
  return 1; 
}; 
int timer3() 

 gui_hide('kgdj2')  //隐藏第2张图片控件 
 string v_tp1; 
 v_tp1 = get_edoc_file("CAAB","龙年大吉3.jpg");  //提取第3张图片 
 gui_create_image("ScrollBox_Base",'kgdj3',610,270,660,380,v_tp1)  //创建第3张图片控件 
 timer_create('timer_hello4',1500,'main_win_open','timer4')  //设置第4个定时器1.5秒后创建第4张图片的控件 
 timer_stop('timer_hello3');  //关闭第3个定时器 
 timer_start('timer_hello4');  //启动第4个定时器 
  return 1; 
}; 
int timer4() 

 gui_hide('kgdj3')  //隐藏第3张图片控件 
 string v_tp1; 
 v_tp1 = get_edoc_file("CAAB","龙年大吉4.jpg");  //提取第4张图片 
 gui_create_image("ScrollBox_Base",'kgdj4',610,270,660,380,v_tp1)  //创建第4张图片控件 
 timer_create('timer_hello5',1500,'main_win_open','timer5')  //设置第5个定时器1.5秒后创建第5张图片的控件 
 timer_stop('timer_hello4');  //关闭第4个定时器 
 timer_start('timer_hello5');  //启动第5个定时器 
  return 1; 
}; 
int timer5() 

 gui_hide('kgdj4')  //隐藏第4张图片控件 
 string v_tp1; 
 v_tp1 = get_edoc_file("CAAB","龙年大吉5.jpg");  //提取第5张图片 
 gui_create_image("ScrollBox_Base",'kgdj5',610,270,660,380,v_tp1)  //创建第5张图片控件 
 timer_create('timer_hello6',1500,'main_win_open','timer6')  //设置第6个定时器1.5秒后创建第6张图片的控件 
 timer_stop('timer_hello5');  //关闭第5个定时器 
 timer_start('timer_hello6');return 1;  //启动第6个定时器 
}; 
int timer6() 

 gui_hide('kgdj5')  //隐藏第5张图片控件 
 string v_tp1; 
 v_tp1 = get_edoc_file("CAAB","龙年大吉6.jpg");  //提取第6张图片 
 gui_create_image("ScrollBox_Base",'kgdj6',770,220,380,660,v_tp1)  //创建第6张图片控件 
 timer_create('timer_hello1',1500,'main_win_open','timer1')  //设置第1个定时器1.5秒后重新创建第1张图片的控件【需要多次轮播才设置】 
 timer_stop('timer_hello6');   //关闭第6个定时器 
 timer_start('timer_hello1');   //启动第1个定时器【需要多次轮播才启动】 
  return 1; 
}; 
int timer7() 

 gui_hide('kgdj1')   //隐藏第1张图片控件 
 gui_hide('kgdj2')   //隐藏第2张图片控件 
 gui_hide('kgdj3')   //隐藏第3张图片控件 
 gui_hide('kgdj4')   //隐藏第4张图片控件 
 gui_hide('kgdj5')   //隐藏第5张图片控件 
 gui_hide('kgdj6')   //隐藏第6张图片控件 
 timer_stop('timer_hello1');   //关闭第1个定时器 
 timer_stop('timer_hello2');   //关闭第2个定时器 
 timer_stop('timer_hello3');   //关闭第3个定时器 
 timer_stop('timer_hello4');   //关闭第4个定时器 
 timer_stop('timer_hello5');   //关闭第5个定时器 
 timer_stop('timer_hello6');   //关闭第6个定时器 
 string v_ywzfy,v_zwzfy; 
 v_zwzfy ='开工之际,祝你事业有成,财源广进;身体康健,家庭和睦;前程似锦,未来可期。愿你在新的一年里,工作顺利,万事如意!'    //中文祝福语 
 v_ywzfy = ' Khi bắt đầu công việc, tôi chúc bạn thành công trong sự nghiệp, tài chính dồi dào, sức khỏe tốt,'   //越南文祝福语 
 v_ywzfy = v_ywzfy+'gia đình hòa thuận và một tương lai tươi sáng. Tôi chúc bạn thành công trong công việc và mọi điều tốt đẹp nhất trong năm mới!'    //越南文祝福语拼接 
 voice_play(v_zwzfy); //语音播报中文祝福语 
 tip(v_zwzfy+v_ywzfy) //弹出中越文祝福语,3秒后自动关闭 
 timer_create('timer_hello7',1000,'main_win_open','timer7')  //重新设置第7个定时器 
 timer_stop('timer_hello7');  //关闭第7个定时器,结束轮播 
  return 1; 
}; 
 
int main() 

//在指定的日期:2024-2-19第一次登录才执行脚本 
 string dlrq,uid; 
 dlrq = get_serv_date() //获取当前日期 
 uid = get_user_id() //获取登录账号 
 db_run("select count(*) from mup_login_log as a,mup_user p where a.login_time like '"+dlrq+"'+'%' and p.user_id = a.user_id and a.user_id in('"+ uid +"')") //提取当前日期登录账号的登陆次数 
 if(dlrq == '20240219' && db_res(0) == '1') //指定【2024-02-19】这天第一次登录才执行脚本 
 { 
 timer_create('timer_hello1',3000,'main_win_open','timer1')  //设置第1个定时器,3秒后创建第1张图片的控件【系统登录后到显示导航窗口有一个缓冲时间,增加了1.5秒,设置每个图片显示1.5秒】 
 timer_start('timer_hello1');  //启动第1个计时器 
 timer_create('timer_hello7',33000,'main_win_open','timer7') //设置第7个定时器,33秒之后(结束3次轮播)关闭所有计时器【这里是按照轮播3次的总时间来设置的关闭轮播的时间为33秒,具体根据实测到关闭轮播时最后显示的图片是否最后一张图片来进行调整】 
 timer_start('timer_hello7');  //启动第7个定时器 
 } 
  return 1; 
};




        于 2024-02-17 22:55 被 fwj3861 修改




官方认证第三方服务团队  樊文俊(越南-叶子) QQ:121305301 TEL:+84869350626
承接越南北部-河内周边省份-OIT部署和维护服务(24小时上门或远程服务)
服务介绍:http://www.onlyit.cn/onlyit_service.html

fwj3861  [个人空间]
QQ名  越南-叶子(121305301)


注册  2010-09-09
发贴数  535
精华贴  10
原创贴  20
来自  越南
状态  正常

级别  贵宾
#2»发布于2024-02-17 18:14

这是登陆后的轮播效果图,提取上传到文档目录的图片来展示!




        于 2024-02-17 18:14 被 fwj3861 修改




官方认证第三方服务团队  樊文俊(越南-叶子) QQ:121305301 TEL:+84869350626
承接越南北部-河内周边省份-OIT部署和维护服务(24小时上门或远程服务)
服务介绍:http://www.onlyit.cn/onlyit_service.html

fwj3861  [个人空间]
QQ名  越南-叶子(121305301)


注册  2010-09-09
发贴数  535
精华贴  10
原创贴  20
来自  越南
状态  正常

级别  贵宾
#3»发布于2024-02-17 21:57

这是最后显示的中越文开工祝福语,同时语音播报中文祝福语



        于 2024-02-17 21:57 被 fwj3861 修改




官方认证第三方服务团队  樊文俊(越南-叶子) QQ:121305301 TEL:+84869350626
承接越南北部-河内周边省份-OIT部署和维护服务(24小时上门或远程服务)
服务介绍:http://www.onlyit.cn/onlyit_service.html

qf2016  [个人空间]
QQ名  meng 113779009


注册  2016-01-17
发贴数  2301
精华数  0
原创贴  0
来自  
状态  正常

级别  版主
#4»发布于2024-02-18 11:02

 
赞一个,这个应用综合了很多功能函数。





 4  1/1   1  

登录后方可发贴


[ 电话: 0571-85462761 王先生 QQ: 124520435 加入软件QQ群 - 杭州 - 浙ICP备19051128号-1 网安 33010402003225 ]