武装少女在线观看高清完整版免费,丝袜+亚洲区,少妇被cao高潮呻吟声,午夜伦情电午夜伦情电影,日日躁夜夜躁狠狠躁

小程序模板網(wǎng)

小程序-記牌器

發(fā)布時(shí)間:2018-09-08 09:41 所屬欄目:小程序開發(fā)教程

這個(gè)想法來自看直播時(shí)看主播斗地主時(shí)經(jīng)常由于沒有記牌器,判斷失誤導(dǎo)致輸豆,所以做了這個(gè)記牌器。估計(jì)不會有人用 :laughing:,就當(dāng)作練手,熟悉小程序的整個(gè)開發(fā)流程哈哈。 沒想到提交第二天就審核通過了

截圖

 

思路比較簡單只有一個(gè)頁面

1.可選一副牌或兩副牌

2.點(diǎn)擊相應(yīng)牌減少對應(yīng)牌的數(shù)量, 數(shù)量為0時(shí)該圖標(biāo)變灰

3.可撤銷,撤銷操作僅保留最近100個(gè)點(diǎn)擊操作

4.重置操作會清空所有操作記錄

開發(fā)上選擇的是 mpvuempvue.com/

然后直接使用grid布局對卡牌進(jìn)行排列

<div class="gird-container">
  <div class="gird-item" v-for="(poker, index) in pokers" :key="index">
    <card :poker="poker" :index="index" @handleHuase="handleHuase" @handleWang="handleWang">
    </card>
  </div>
</div>
復(fù)制代碼

操作方法

// 點(diǎn)擊操作
handleHuase (obj) {
// 這里用來記錄操作歷史
this.updateHistory.push(JSON.parse(JSON.stringify(this.pokers)))
  if (this.pokers[obj.index][obj.huase] > 0) {
    this.pokers[obj.index][obj.huase] -= 1
    this.pokers[obj.index].count -= 1
  } else {
    this.pokers[obj.index][obj.huase] = this.defaultCount
    this.pokers[obj.index].count += 1
  }
}
復(fù)制代碼
// 撤銷操作
rollback () {
  let pokers = this.updateHistory[this.updateHistory.length - 1]
  this.pokers = pokers
  this.updateHistory.pop(this.updateHistory.length - 1)
}
復(fù)制代碼


易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.kknew.com.cn/wxmini/doc/course/24788.html 復(fù)制鏈接 如需定制請聯(lián)系易優(yōu)客服咨詢:800182392 點(diǎn)擊咨詢
QQ在線咨詢
AI智能客服 ×