话不多说,直接上代码
/**index.wxml*/
<view class="table-list flex fcc fwrap">
<block wx:for="{
{tableList}}" wx:key="id">
<view class="table-item btn fcc {
{isTurnOver?'':'grayscale'}}" wx:if="{
{item.type=='btn'}}" bind:tap="onPrizeClick">{
{
item.name}}</view>
<view class="table-item fcc {
{item.isSelected?'selected':''}}" wx:else>{
{
item.name}}</view>
</block>
</view>
import {
showTextToast } from '../../utils/util';
// pages/turnTable/index.js
Page({
/**
* 页面的初始数据
*/
data: {
tableList: [
{
id: '1', type: 'prize', name: '奖品1', isSelected: false },
{
id: '2', type: 'prize', name: '奖品2', isSelected: false },
{
id: '3', type: