<template>
  <view class="index">
    <swiper class="swiper" :circular="true" :autoplay="true">
      <swiper-item v-for="(item, index) in list" :key="index">
        <image :src="item" />
      </swiper-item>
    </swiper>
    <view class="container">
      <!-- <view>摇骰子</view> -->

      <rich-text :nodes="info.introduction"></rich-text>
      <view class="btn" @click="startGame()">开始游戏</view>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import Taro from '@tarojs/taro'
import './index.scss'

const info = ref<any>({})

Taro.useLoad(() => {
  info.value = Taro.getStorageSync('gameItem')
})

const list = ref(['https://files.wanzhuanyongcheng.com/file/img/yaotouzi/banner/qietu.png'])

const startGame = () => {
  console.log(info.value)
  Taro.navigateTo({
    url: info.value.url,
  })
}
</script>
