当前位置: 首页 > news >正文

网页设计自学网站建设网站技术公司简介

网页设计自学网站,建设网站技术公司简介,传业做微采商城网站,做电影网站需要什么手续目录 效果图 app.json 一、首页#xff08;index3#xff09;的代码 wxml代码 wxss代码 二、猜数字页面#xff08;index#xff09;代码 wxml代码 wxss代码 js代码 三.游戏规则页面#xff08;logs#xff09;代码 wxml代码 wxss代码 四.猜拳页面#xff…目录 效果图 app.json 一、首页index3的代码 wxml代码 wxss代码 二、猜数字页面index代码 wxml代码 wxss代码 js代码 三.游戏规则页面logs代码 wxml代码 wxss代码 四.猜拳页面q1代码 wxml代码 wxss代码 js代码 效果图 app.json 一、首页index3的代码 wxml代码 view classbox2navigator url../index/indexbutton typedefault猜数字/button/navigator /view view classbox2navigator url../logs/logsbutton typeprimary游戏规则/button/navigator /view view classbox3navigator url../q1/q1button typedefault猜拳/button/navigator /view wxss代码 .box2{margin-top: 200rpx;width: 100%;height: 100rpx; } .box3{margin-top: 240rpx;width: 100%;height: 100rpx; } 二、猜数字页面index代码 wxml代码 view classcontainerinput typenumber placeholder输入1到100的数字 bindinputonInputChange/button bindtapmakeGuess猜数字/buttontext{{message}}/textviewtext猜数字历史\n/textblock wx:for{{guesses}} wx:key*thistext第{{index 1}}次: {{item.num}} - {{item.hint}}\n/text/block/view /view wxss代码 .container {padding: 20px; }input {width: 100%;border: 1px solid #ccc;padding: 10px;margin-bottom: 10px; }button {width: 100%;background-color: #1aad19;color: white;padding: 10px;border: none; }.history {margin-top: 20px; }.history text {display: block; }js代码 Page({data: {numberToGuess: null,guesses: [],guessCount: 0,inputNumber: ,message: ,hint: },onLoad: function() {this.startNewGame();},startNewGame: function() {const randomNum Math.round(Math.random() * 100) 1;this.setData({numberToGuess: randomNum,guesses: [],guessCount: 0,message: 开始猜数字吧,hint: });},onInputChange: function(e) {this.setData({inputNumber: e.detail.value});},makeGuess: function() {const guess parseInt(this.data.inputNumber, 10);if (isNaN(guess) || guess 1 || guess 100) {this.setData({ message: 请输入1到100之间的数字。 });return;}let newHint ;if (guess this.data.numberToGuess) {newHint 猜对了;this.setData({message: 恭喜你猜对了游戏即将重新开始。,hint: newHint});setTimeout(() {this.startNewGame();}, 2000);} else {newHint guess this.data.numberToGuess ? 猜小了 : 猜大了;this.setData({message: 继续猜...,hint: newHint});}const count this.data.guessCount 1;const guesses this.data.guesses.concat({ num: guess, hint: newHint });this.setData({guessCount: count,guesses: guesses});if (count 5) {this.setData({message: 游戏结束即将跳转...});setTimeout(() {wx.navigateTo({url: /pages/index3/index3 });}, 2000);}} });三.游戏规则页面logs代码 wxml代码 view classdemo-box text1.游戏仅供娱乐2.此游戏有很多不足3.玩家可以提供您宝贵意见 /text /viewwxss代码 .demo-box{display: flex;flex-direction: column;align-items: center;justify-content: space-around;height: 100vh; } text{margin: 0 50rpx;line-height: 100rpx; } 四.猜拳页面q1代码 wxml代码 view classcontainerbutton bindtapmakeChoice data-choicescissors剪刀/buttonbutton bindtapmakeChoice data-choicerock石头/buttonbutton bindtapmakeChoice data-choicepaper布/buttontext玩家胜利次数{{playerWins}}/texttext电脑胜利次数{{computerWins}}/texttext平局次数:{{draws}}/texttext{{message}}/text /viewwxss代码 .container {display: flex;flex-direction: column;align-items: center;justify-content: center; }button {margin: 10px; }js代码 Page({data: {playerWins: 0,computerWins: 0,draws: 0,message: },makeChoice: function(event) {const playerChoice event.currentTarget.dataset.choice;const choices [scissors, rock, paper];const computerChoice choices[Math.round(Math.random() * choices.length)];const result this.judge(playerChoice, computerChoice);if (result win) {this.setData({playerWins: this.data.playerWins 1,message: 你赢了这一轮});} else if (result lose) {this.setData({computerWins: this.data.computerWins 1,message: 电脑赢了这一轮});} else {this.setData({draws: this.data.draws 1,message: 这一轮是平局});}this.checkGameEnd();},judge: function(player, computer) {if (player computer) {return draw;}if ((player scissors computer paper) ||(player rock computer scissors) ||(player paper computer rock)) {return win;}return lose;},checkGameEnd: function() {if (this.data.playerWins 2 || this.data.computerWins 2) {wx.navigateTo({url: /pages/index3/index3 });}} });
http://www.yutouwan.com/news/491214/

相关文章:

  • 网站建设后台 手工上传wordpress使用国外主题
  • ps软件下载官方网站什么网站可以做时间加减
  • 网站建设上的新闻企业不想做网站的原因
  • 自助游网站开发分析报告总结网站开发公司前台模板
  • 网站做315认证上海市中小企业服务中心
  • 网站建设讲话最适合seo的网站源码
  • .net网站开发框架财务公司业务范围
  • 网站与新闻建设总结陕西建设厅网站首页
  • 酒店网站 方案室内设计怎么收费的
  • net网站开发是什么深圳网站建设公司业务招聘
  • 上海高端网站优设网素材下载
  • 怎么样做网站才能适应手机屏幕网站建设的实训技术总结
  • 网站推广的方法搜索引擎现在有什么推广平台
  • 你好南京网站简单的网页制作软件
  • 如何免费做网站赚钱wordpress安装php5.4
  • 免费用搭建网站网站开发使用什么运行软件
  • 现在建网站软件网站架构模式用哪种
  • 代运营公司网站amh wordpress伪静态
  • 重庆做网站的网络公司中山网站备案
  • 个人优秀网站欣赏渭南做网站价格
  • 手机网站关键词排买个域名多少钱一年
  • 深圳物流网站优化工作安排
  • seo网站优化推广费用wordpress 为什么很慢
  • 石家庄网站制作公司创客贴做网站吗
  • 用粉色做网站主题色资源库网站开发
  • 网站引用百度地图wordpress LaTeX
  • 太原做网站的公司网站建设做一个响应网站多少钱
  • 廊坊网站建设模板页面效果设计
  • 局域网站开发成都装修公司哪家实惠
  • 网站开发设计的技术自行建网站 所需费用