代码内容

  1. function() {
  2. return {
  3. // 组件初始化
  4. init: function(options) {
  5. this._super.apply(this, arguments);
  6. },
  7. // 容器内所有组件加载完成
  8. allChildrenLoaded: function() {
  9. const btnIds =['txt_a16450776575571','txt_a16450776593582','txt_a16450776608893','txt_a16450776672914']; //组件id
  10. const time = 3000; // 每次点击间隔时间 ms
  11. let index =0 ;
  12. let timer;
  13. btnIds.forEach(id=>{
  14. $('#'+id).click(function(){
  15. clearTimeout(timer)
  16. index = btnIds.indexOf(this.id)
  17. if(index == btnIds.length-1){
  18. index = 0;
  19. }else{
  20. index++;
  21. }
  22. timer = setTimeout(() => {
  23. $('#'+btnIds[index]).click()
  24. }, time);
  25. })
  26. })
  27. $('#'+btnIds[0]).click()
  28. }
  29. };
  30. }

image.png

使用说明

1、配置各按钮与其他组件的正常联动;
2、修改代码中按钮中的id与正式系统保持一致;
3、运行测试;