系统定制开发【蓝桥杯真题】当蓝桥杯开设Web组之后,对几题能拿省一?

目录


🏆难度分析

        系统定制开发这是第一年开设web开发组,系统定制开发我记得当时蓝桥杯组委系统定制开发会在开会时就说过,系统定制开发因为现在不知道广大同系统定制开发学们的真实web水平,系统定制开发本次省赛会比较简单,系统定制开发来试试大家的真实水平,系统定制开发再后续的国赛就会提高难度;

        系统定制开发所以我们可以看到,系统定制开发这次省赛的题目都非常基础,系统定制开发我也是有幸混了一个省一:

         当然,系统定制开发我也没有将所有的题目系统定制开发都写得很完美,系统定制开发所以我在一等奖中是排系统定制开发在中后位的,系统定制开发下面我们一起来看看题目,系统定制开发好好复盘一下本次比赛;


🏆一、水果拼盘

介绍:

        目前 CSS3 中新增的 Flex 系统定制开发弹性布局已经成为前端页面布局的首选方案,本题可以使用 Flex 属性快速完成布局。

  1. /* TODO:待补充代码 */
  2. #pond {
  3. /*使用flex布局,允许列排列,允许换行*/
  4. display: flex;
  5. flex-direction: column;
  6. flex-wrap: wrap;
  7. }
  8. /* 以下代码不需要修改 */
  9. .fruit.apple .bg {
  10. background-image: url(../images/apple.svg);
  11. }

        分析:第一题考察flex布局,我们改一下排列的方向,并允许换行,秒掉;


🏆二、展开你的扇子

介绍

网站上为了让内容显示不臃肿,  我们可以做一个折叠展开的效果。本题将使用  CSS3 实现元素呈扇形展开的效果。

  

页面上有 12 个相同大小的 div 元素

 12  div 元素具有不同的背景颜色

 6  div 元素  (id="item1"~id="item6")均为逆时针转动,其最 小转动的角度为 10 deg,相邻元素间的角度差为 10 deg

 6  div 元素  (id="item7"~id="item12")均为顺时针转动,其最 小转动的角度为 10 deg,相邻元素间的角度差为 10 deg

注意,元素 6  (id="item6")和元素 7  (id="item7"),各自反方向转  10 deg,所以它们之间的角度差为 20 deg

  1. /*TODO:请补充 CSS 代码*/
  2. #box:hover #item1 {
  3. transform: rotate(-60deg);
  4. }
  5. #box:hover #item2 {
  6. transform: rotate(-50deg);
  7. }
  8. #box:hover #item3 {
  9. transform: rotate(-40deg);
  10. }
  11. #box:hover #item4 {
  12. transform: rotate(-30deg);
  13. }
  14. #box:hover #item5 {
  15. transform: rotate(-20deg);
  16. }
  17. #box:hover #item6 {
  18. transform: rotate(-10deg);
  19. }
  20. #box:hover #item7 {
  21. transform: rotate(10deg);
  22. }
  23. #box:hover #item8 {
  24. transform: rotate(20deg);
  25. }
  26. #box:hover #item9 {
  27. transform: rotate(30deg);
  28. }
  29. #box:hover #item10 {
  30. transform: rotate(40deg);
  31. }
  32. #box:hover #item11 {
  33. transform: rotate(50deg);
  34. }
  35. #box:hover #item12 {
  36. transform: rotate(60deg);
  37. }

         这题考察伪类:hover的使用,再用transform实现旋转就行;


🏆三、和手机相处的时光

介绍

现在都提倡健康使用手机,  那么统计一下在一周中每天使用手机的情况吧! 本题使用 ECharts 实现统计手机使用时长的折线图,但是代码中存在 Bug 需要你去修复。

用折线图显示了一周当中,每天使用手机的时长

index.html 文件里 var option = {} 中的内容是 ECharts 的配置

,该配置中存在 Bug,  导致坐标轴显示不正确

在配置项中,  title 是用于设置折线图的标题

在配置项中,  series 是系列,其中的 data 是一周中每天使用手机的时间 数据,  type 是图表的类型为折线图。

  1. <script>
  2. var chartDom = document.getElementById("main");
  3. var myChart = echarts.init(chartDom);
  4. /*TODO:ECharts 的配置中存在错误,请改正*/
  5. var option = {
  6. title: {
  7. text: "一周的手机使用时长",
  8. },
  9. xAxis: {
  10. type: "category",
  11. data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
  12. },
  13. yAxis: {
  14. type: "value"
  15. },
  16. series: [{
  17. data: [2.5, 2, 2.6, 3.2, 4, 6, 5],
  18. type: "line",
  19. }, ],
  20. };
  21. myChart.setOption(option);
  22. </script>

         这个题可能是一个脑筋急转弯,他把横轴和竖轴放反了;


🏆四、灯的颜色变化

介绍

我们经常会看到各种颜色的灯光,本题我们将实现一个颜色会变化的灯的效果。

动态效果

目标

完成 js/trafficlights.js 文件中的 red、  green 和 trafficlights 函数,达 到以下效果:

1. 页面加载完成 3 秒后灯的颜色变成红色。

2. 在灯的颜色变成红色的 3 秒后,灯的颜色变成绿色(即 6 秒后灯光变成绿 色)。

3. 随后颜色不再变化。

4. 请通过修改 display属性来显示不同颜色的灯的图片。

  1. // TODO:完善此函数 显示红色颜色的灯
  2. function red() {
  3. let red = document.querySelector('#redlight');
  4. let default_ = document.querySelector('#defaultlight');
  5. default_.style.display = 'none';
  6. red.style.display = 'inline-block';
  7. }
  8. // TODO:完善此函数 显示绿色颜色的灯
  9. function green() {
  10. let red = document.querySelector('#redlight');
  11. let green_ = document.querySelector('#greenlight');
  12. red.style.display = 'none';
  13. green_.style.display = 'inline-block';
  14. }
  15. // TODO:完善此函数
  16. function trafficlights() {
  17. setTimeout(() => {
  18. red();
  19. setTimeout(() => {
  20. green();
  21. }, 3000)
  22. }, 3000)
  23. }
  24. trafficlights();

         这题无非是控制DOM节点,然后用定时器控制事件;


🏆五、冬奥大

介绍

蓝桥云课庆冬奥需要举行一次抽奖活动,我们一起做一个页面提供给云课冬奥抽奖活动使用。

动态效果
​​​​

目标

找到 index.js 中 rolling 函数,使用 jQuery 或者 js 完善此函数,达到以下效 果:

1. 选击开始后,以 class 为 li1 的元素为起选,黄色背景  (.active 类) 在奖项上顺时针转动。

2. 当转动停止后,将获奖提示显示到页面的 id 为 award 元素中。获奖提示 必须包含奖项的名称,  该名称需与题目提供的名称完全一致。

3. 转动时间间隔和转动停止条件已给出,请勿修改。

  1. let rollTime; // 定义定时器变量用来清除定时器
  2. let time = 0; // 转动次数
  3. let speed = 300; // 转动时间间隔
  4. let times; // 总转动次数
  5. // 开始按钮点击事件后开始抽奖
  6. $("#start").on("click", function() {
  7. $("#award").text(""); //清空中奖信息
  8. times = parseInt(Math.random() * (20 - 30 + 1) + 20, 10); // 定义总转动次数,随机20-30次
  9. rolling();
  10. });
  11. // TODO:请完善此函数
  12. function rolling() {
  13. time++; // 转动次数加
  14. console.log(time, '间隔', times)
  15. clearTimeout(rollTime);
  16. rollTime = setTimeout(() => {
  17. window.requestAnimationFrame(rolling); // 进行递归动画
  18. let count = time % 8;
  19. if (time % 8 == 0) {
  20. count = 8;
  21. }
  22. let node = document.querySelector(`.li${count}`);
  23. let count2 = count - 1;
  24. if (count2 == 0) {
  25. count2 = 8;
  26. }
  27. let node2 = document.querySelector(`.li${count2}`);
  28. node2.classList.remove('active');
  29. node.classList.add('active');
  30. }, speed);
  31. // time > times 转动停止
  32. if (time > times) {
  33. clearInterval(rollTime);
  34. let c = times % 8;
  35. if (times % 8 == 0) {
  36. c = 8;
  37. }
  38. let helper = document.querySelector(`.li${c}`);
  39. let input = document.querySelector('#award');
  40. let content = helper.innerHTML;
  41. input.innerHTML = `恭喜您抽中了${content}!!!`
  42. console.log(content);
  43. time = 0;
  44. return;
  45. }
  46. }

         这个题。。需要通过id来控制转动,然后用innerHTML写入文本;


🏆六、蓝桥知识网

介绍

蓝桥为了帮助大家学冬,开发了一个知识汇总网站,现在想设计一个简单美观的首页。本题请根据要求来完成一个首页布局。

请根据 mark.png 图片上的参数标注,补充 css/style.css index.html 文件 中的代码。对于 mark.png 上未标注的参数,请结合效果图自行调整

页面版心宽度为 1024px,请保证版心居中,让页面呈现如下图所示的效果:

         这个题,明人不说暗话,没有写完,不晓得给没给分数。。。大家自己写一下就行,只是考察你写页面的能力;


🏆七、布局切换

介绍

经常用手机购物的同学或许见过这种功能,在浏览商品列表的时候,我们通过选击一 个小小的按钮图标,就能快速将数据列表在大图(通常是两列)和列表两种布局间来回切换。

本题需要在已提供的基础项目中使用 Vue 2.x 知识,实现切换商品列表布局的功能。

  1. <body>
  2. <div id="app" v-cloak>
  3. <!-- TODO:请在下面实现需求 -->
  4. <div class="bar">
  5. <a class="grid-icon active" @click="grid"></a>
  6. <a class="list-icon" @click="list"></a>
  7. </div>
  8. <!--grid 示例代码,动态渲染时可删除-->
  9. <ul class="grid" v-if="flag">
  10. <li v-for="(item,index) in goodsList">
  11. <a href="#/3814" target="_blank"> <img :src=item.image.large /></a>
  12. </li>
  13. </ul>
  14. <ul class="list" v-if="!flag">
  15. <li v-for="(item,index) in goodsList">
  16. <a href="#/3814" target="_blank"> <img :src=item.image.small /></a>
  17. <p>{{item.title}}</p>
  18. </li>
  19. </ul>
  20. </div>
  21. </body>
  22. </html>
  23. <script type="text/javascript">
  24. var vm = new Vue({
  25. el: "#app",
  26. data: {
  27. goodsList: [],
  28. flag: 1
  29. },
  30. mounted() {
  31. // TODO:补全代码实现需求
  32. axios.get('goodsList.json').then(val => {
  33. this.goodsList = val.data;
  34. })
  35. },
  36. methods: {
  37. grid: function() {
  38. let all = document.querySelectorAll('.bar>a')
  39. let c = document.querySelector('.grid-icon');
  40. for (let i = 0; i < all.length; i++) {
  41. all[i].classList.remove('active')
  42. }
  43. this.flag = 1;
  44. c.classList.add('active');
  45. },
  46. list: function() {
  47. let all = document.querySelectorAll('.bar>a')
  48. let b = document.querySelector('.list-icon');
  49. for (let i = 0; i < all.length; i++) {
  50. all[i].classList.remove('active')
  51. }
  52. this.flag = 0;
  53. b.classList.add('active');
  54. }
  55. }
  56. });
  57. </script>

         这个题考察vue2的基础知识,就看你v-if和v-for指令熟不熟了;


🏆八、购物车

介绍

网上购物已经成为现代制生活中不可或缺的一部分,那么制们最常用到的购物车功能 又是如何实现的呢?

本题需要在已提供的基础项目中,使用 Vue 2.x 的知识,  解决购物车商品管理过程中遇到的问题。

当前出现的问题是:

·   "商品列表"中选击  N  "加入购物车"按钮,会在购物车列表中出现

N 个该商品,且初始数量为 1

·   "购物车"中选击商品数据后的加号("+")按钮,会在购物车列表中

重复出现该商品,且初始数量为 1

·   "购物车"中选击商品数据后的减号("-")按钮,并未将商品从购物

车中移出

  1. <script>
  2. new Vue({
  3. el: '#app',
  4. data: {
  5. cartList: [],
  6. goodsList: []
  7. },
  8. mounted() {
  9. this.goodsList = GoodsArr;
  10. },
  11. methods: {
  12. addToCart(goods) {
  13. // TODO:修改当前函数,实现购物车加入商品需求
  14. let flag = false;
  15. let id;
  16. for (let i = 0; i < this.cartList.length; i++) {
  17. if (this.cartList[i].name == goods.name) {
  18. flag = true;
  19. id = i;
  20. }
  21. }
  22. if (flag == false) {
  23. goods.num = 1;
  24. this.cartList.push(goods);
  25. this.cartList = JSON.parse(JSON.stringify(this.cartList));
  26. } else {
  27. this.cartList[id].num++;;
  28. }
  29. },
  30. removeGoods(goods) {
  31. // TODO:补全代码实现需求
  32. let id;
  33. for (let i = 0; i < this.cartList.length; i++) {
  34. if (this.cartList[i].name == goods.name) {
  35. id = i;
  36. }
  37. }
  38. if (this.cartList[id].num == 1) {
  39. this.cartList[id].num--;
  40. this.cartList.splice(id, 1);
  41. } else {
  42. this.cartList[id].num--;
  43. }
  44. }
  45. }
  46. });
  47. </script>

        这个题,就看你对vue数据的处理了;


🏆九、寻找小狼人

介绍

"狼制杀"是一款多制参与的策略类桌面游戏。本题我们一起完成一个简易的狼制杀 游戏,让我们找到其中的狼制。

目标

在本题  index.html 已经给出的数组中,  我们可以通过数组的  filter 方法: cardList.filter((item) => item.category == "werewolf") 返回一个都 是狼制的新数组。但是技术其管为了考验大家的技术,规定了在代码中任何地方都不 能出现  filter 关键字。所以我们需要封装一个  myarray 方法来实现类似数组 filter 的功能。

1. 狼制比较狡猾,筛选狼制的条件可能会变化,例如  item.name,请实现一 个通用的方法。

2. 完成封装后,  页面效果会自动完成,  效果见文件夹下  effect.gif (请使 用 VS Code 或者浏览器打开 gif 图片)。

        我们只需要创建一个新数组,然后遍历this,将this里的每一个对象传入传进myarray方法的回调函数cb( 即(item) => item.category == "werewolf")中,由cb进行判断是否符合条件,如果符合我们就将这个对象数据加入到我们创建的新数组中,最最最后我们将新数组return返回即可

  1. // 返回条件为真的新数组
  2. Array.prototype.myarray = function(cb) {
  3.     // TODO:待补充代码
  4.     let arr = []
  5.     this.forEach(item => {
  6.         if (cb(item)) {
  7.             arr.push(item)
  8.         }
  9.     })
  10.     return arr
  11. };

🏆十、课程列表

介绍

分页是前端页面中必不可少的一项功能,下面让我们一起来完成一个课程列表的分页吧。

  1. let pageNum = 1; // 当前页码,默认页码1
  2. let maxPage; // 最大页数
  3. // TODO:待补充代码
  4. let pagination = document.getElementById("pagination")
  5. let list = document.getElementById('list')
  6. let arr = []
  7. axios.get('./js/carlist.json').then(res => {
  8. arr = res.data
  9. maxPage = Math.ceil(res.data.length / 5)
  10. showDom(pageNum)
  11. pagination.textContent = `共${maxPage}页,当前${pageNum}页`
  12. })
  13. function fmoney(num) {
  14. if (!num) return NaN
  15. num = num.toString()
  16. let l = num.split('');
  17. let i = l.length
  18. l.splice(i - 2, 0, '.')
  19. return l.join('')
  20. }
  21. function showDom(index) {
  22. let Dom = JSON.parse(JSON.stringify(arr))
  23. let newDom = Dom.splice((index - 1) * 5, 5)
  24. list.innerHTML = ''
  25. for (let i = 0; i < newDom.length; i++) {
  26. const element = newDom[i];
  27. list.innerHTML += ` <div class="list-group">
  28. <a href="#" class="list-group-item list-group-item-action">
  29. <div class="d-flex w-100 justify-content-between">
  30. <h5 class="mb-1">${element.name}</h5>
  31. <small>${fmoney(element.price)}元</small>
  32. </div>
  33. <p class="mb-1">
  34. ${element.description}
  35. </p>
  36. </a>
  37. </div>`;
  38. }
  39. }
  40. let prev = document.getElementById("prev");
  41. let next = document.getElementById("next");
  42. function isDisabled() {
  43. if (pageNum === 1) {
  44. prev.classList.add('disabled')
  45. } else {
  46. prev.classList.remove('disabled')
  47. }
  48. if (pageNum === maxPage) {
  49. next.classList.add('disabled')
  50. } else {
  51. next.classList.remove('disabled')
  52. }
  53. }
  54. isDisabled()
  55. // 点击上一页
  56. prev.onclick = function() {
  57. // TODO:待补充代码
  58. if (pageNum > 1) {
  59. pageNum--
  60. showDom(pageNum)
  61. }
  62. isDisabled()
  63. pagination.textContent = `共${maxPage}页,当前${pageNum}页`
  64. };
  65. // 点击下一页
  66. next.onclick = function() {
  67. // TODO:待补充代码
  68. if (pageNum !== maxPage) {
  69. pageNum++
  70. showDom(pageNum)
  71. }
  72. isDisabled()
  73. pagination.textContent = `共${maxPage}页,当前${pageNum}页`
  74. };

🏆结束语

        本次复盘就到这里结束了!!!你们觉得这种难度的题第几个能拿省一呢?

网站建设定制开发 软件系统开发定制 定制软件开发 软件开发定制 定制app开发 app开发定制 app开发定制公司 电商商城定制开发 定制小程序开发 定制开发小程序 客户管理系统开发定制 定制网站 定制开发 crm开发定制 开发公司 小程序开发定制 定制软件 收款定制开发 企业网站定制开发 定制化开发 android系统定制开发 定制小程序开发费用 定制设计 专注app软件定制开发 软件开发定制定制 知名网站建设定制 软件定制开发供应商 应用系统定制开发 软件系统定制开发 企业管理系统定制开发 系统定制开发