网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

小程序-記牌器

發布時間:2018-09-08 09:41 所屬欄目:小程序開發教程

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

截圖

 

思路比較簡單只有一個頁面

1.可選一副牌或兩副牌

2.點擊相應牌減少對應牌的數量, 數量為0時該圖標變灰

3.可撤銷,撤銷操作僅保留最近100個點擊操作

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

開發上選擇的是 mpvuempvue.com/

然后直接使用grid布局對卡牌進行排列

<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>
復制代碼

操作方法

// 點擊操作
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
  }
}
復制代碼
// 撤銷操作
rollback () {
  let pokers = this.updateHistory[this.updateHistory.length - 1]
  this.pokers = pokers
  this.updateHistory.pop(this.updateHistory.length - 1)
}
復制代碼


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