123456789101112131415161718192021222324 |
- import ad from '../index/ad'
- ad({
- data: {
- current: 1,
- },
- onLoad() {
- this.key = Math.floor(Math.random() * 3)
- },
- onChange(e) {
- console.log(e)
- if (e.detail.key === this.key) {
- return wx.showModal({
- title: 'No switching is allowed',
- showCancel: !1,
- })
- }
- this.setData({
- current: e.detail.key,
- })
- },
- })
|