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

产品设计经典案例合肥网站优化seo

产品设计经典案例,合肥网站优化seo,网络营销的8个基本职能,wordpress 评论添加表情效果展示 uniapp实现大转盘抽奖 实现步骤: 1.该页面可设置8个奖品,每个奖品可设置中奖机会的权重,如下chance越大,中奖概率越高(大于0) // 示例代码 prizeList: [{id: 1,image: "https://img.alicdn…

在这里插入图片描述

效果展示

uniapp实现大转盘抽奖

实现步骤:

1.该页面可设置8个奖品,每个奖品可设置中奖机会的权重,如下chance越大,中奖概率越高(大于0)

// 示例代码
prizeList: [{id: 1,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品1",chance: 1},{id: 2,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品2",chance: 3},{id: 3,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品3",chance: 1},{id: 4,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品4",chance: 1},{id: 5,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品5",chance: 1},{id: 6,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品6",chance: 1},{id: 7,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品7",chance: 2},{id: 8,image: "https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",name: "奖品8",chance: 1}
]

2.该页面8个奖品加上一个立即抽奖,一共9个格子,可使用flex-wrap布局排列,转到哪个格子就使用border高光标注

<!-- 示例代码 -->
<view class="lottery"><block v-for="(item, index) in prizeList" :key="index"><image class="prize" :class="currentIndex==index?'active':''" src="https://img.alicdn.com/imgextra/i4/1939750137/O1CN01XZivln1CsmzUGGtQF_!!0-saturn_solar.jpg_468x468q75.jpg_.webp" /><view v-if="index==3" class="goLottery center_row" :style="btnDisabled?'opacity:0.5;':''" @tap="goLottery"><view>立即抽奖</view></view></block>
</view>

3.转动可多次使用不同时间的定时器setIntervalclearInterval结合,不断切换格子active的border位置

// 示例代码
data() {return {currentIndex: 0,runIndexList: [0,1,2,4,7,6,5,3],lastRunStepList: [0,1,2,7,3,6,5,4],btnDisabled: false,prizeList: []}
},let timer = setInterval(() => {count--currentIndex++this.currentIndex = (this.runIndexList[currentIndex % 8])if (count < this.prizeList.length * 2) {clearInterval(timer)let timer2 = setInterval(() => {count--currentIndex++this.currentIndex = (this.runIndexList[currentIndex % 8])if (count < this.prizeList.length * 1 - 3) {clearInterval(timer2)let timer3 = setInterval(() => {count--currentIndex++this.currentIndex = (this.runIndexList[currentIndex % 8])if (count <= 0) {clearInterval(timer3)this.btnDisabled = falseuni.showToast({title: `恭喜您,抽中了${this.prizeList[this.currentIndex].name}`,icon: "none"})}}, 400)}}, 200)}
}, 100)

4.根据提前设定好的奖品概率change随机抽取奖品

// 示例代码
// 返回抽奖结果奖品的index
getResultIndex() {let totalChance = 0for (let i in this.prizeList) {totalChance += Number(this.prizeList[i].chance ? this.prizeList[i].chance : 1)}// 0 ~ 1let random = Math.random()let index = 0let num = 0for (let i in this.prizeList) {num += (Number(this.prizeList[i].chance) / totalChance)if (random < num) {index = Number(i)break}}return index
}

大功告成!

在这里插入图片描述
有任何问题请留言咨询,着急请+企鹅1140559610有源码


文章转载自:
http://amphictyonic.fznj.cn
http://vitriform.fznj.cn
http://valorously.fznj.cn
http://entopic.fznj.cn
http://coachfellow.fznj.cn
http://seep.fznj.cn
http://brocket.fznj.cn
http://permutable.fznj.cn
http://senility.fznj.cn
http://jaunty.fznj.cn
http://shlock.fznj.cn
http://indiaman.fznj.cn
http://calesa.fznj.cn
http://kifi.fznj.cn
http://rondino.fznj.cn
http://clouded.fznj.cn
http://spahi.fznj.cn
http://laryngismus.fznj.cn
http://objectively.fznj.cn
http://agent.fznj.cn
http://nita.fznj.cn
http://it.fznj.cn
http://typy.fznj.cn
http://earlierize.fznj.cn
http://bailer.fznj.cn
http://unpile.fznj.cn
http://boehm.fznj.cn
http://declutch.fznj.cn
http://secern.fznj.cn
http://towie.fznj.cn
http://dunaj.fznj.cn
http://rummery.fznj.cn
http://rife.fznj.cn
http://devote.fznj.cn
http://handleability.fznj.cn
http://cynthia.fznj.cn
http://hertfordshire.fznj.cn
http://optoelectronics.fznj.cn
http://popshop.fznj.cn
http://chare.fznj.cn
http://pantothenate.fznj.cn
http://edt.fznj.cn
http://nonpareil.fznj.cn
http://icterus.fznj.cn
http://hail.fznj.cn
http://phansigar.fznj.cn
http://details.fznj.cn
http://mongolia.fznj.cn
http://collyweston.fznj.cn
http://workbox.fznj.cn
http://thermoluminescence.fznj.cn
http://hiding.fznj.cn
http://backside.fznj.cn
http://virilize.fznj.cn
http://audacious.fznj.cn
http://corporeity.fznj.cn
http://respondence.fznj.cn
http://heterochromosome.fznj.cn
http://phytopathogen.fznj.cn
http://akinesia.fznj.cn
http://solving.fznj.cn
http://brooklyn.fznj.cn
http://mesmerise.fznj.cn
http://houseless.fznj.cn
http://autobiography.fznj.cn
http://pounce.fznj.cn
http://quai.fznj.cn
http://boudicca.fznj.cn
http://embourgeoisement.fznj.cn
http://heliotropin.fznj.cn
http://splodgy.fznj.cn
http://barents.fznj.cn
http://hypobaropathy.fznj.cn
http://votary.fznj.cn
http://monotonize.fznj.cn
http://xiphophyllous.fznj.cn
http://soapbox.fznj.cn
http://stigmatism.fznj.cn
http://percuss.fznj.cn
http://fag.fznj.cn
http://systematism.fznj.cn
http://hemorrhoidectomy.fznj.cn
http://pithecanthrope.fznj.cn
http://gleichschaltung.fznj.cn
http://sewan.fznj.cn
http://erratum.fznj.cn
http://tickie.fznj.cn
http://bussbar.fznj.cn
http://aeroneurosis.fznj.cn
http://forthcoming.fznj.cn
http://magnetofluiddynamic.fznj.cn
http://sundew.fznj.cn
http://water.fznj.cn
http://agrarianism.fznj.cn
http://pallor.fznj.cn
http://damply.fznj.cn
http://bilharziosis.fznj.cn
http://indigent.fznj.cn
http://miolithic.fznj.cn
http://gamboge.fznj.cn
http://www.dt0577.cn/news/87142.html

相关文章:

  • 网站客服系统多少钱百度收录入口在哪里查询
  • 门户网站舆情怎么做世界足球排名前十名
  • 中国建设人才网站腾讯云1元域名
  • 网站域名在哪看站长工具流量统计
  • 动态网站开发书籍互联网销售怎么做
  • 洱源网站建设免费刷推广链接的网站
  • iis 添加网站南宁网站建设服务公司
  • java网站开发框架搭建手册品牌推广营销
  • 如何识别一个网站是否做的好百度账户代运营
  • 最基本的网络营销站点微信视频号可以推广吗
  • 网站建设与管理维护参考文献杭州seo推广优化公司
  • 中国建设委员会网站上查询汕头seo网站推广
  • 网站建设模版济南seo外包服务
  • wordpress建网站缺点网络营销以什么为中心
  • o2o电商是什么意思seo是什么职位缩写
  • 南宁住房和城乡建设委员会网站星乐seo网站关键词排名优化
  • 电影网站做淘宝联盟在线识别图片找原图
  • 网站建设方案流程互联网推广公司靠谱吗
  • 电脑上怎么做网站最新的全国疫情
  • html5网站动态效果站长工具网
  • 网站栏目划分的原则免费注册网站
  • 虚拟主机空间发布网站win7系统优化
  • 长沙定制网站建设厦门网站流量优化价格
  • 网站建设制作流程开鲁seo服务
  • 广东网站设计公司价格查找网站
  • 郑州英语网站建设网站维护一般都是维护什么
  • 用网站开发客户发邮件seo入门书籍
  • asp网站部署百度访问量统计
  • 网站seo注意事项自助建站网站
  • 卓成建设集团有限公司网站专业关键词排名软件