<!--index.wxml-->
<view class="content">
  <block wx:if="{{noticeText}}" class="noticeBar">
    <VanNoticeBar color="#ffffff" background="#4ac987" left-icon="volume-o" mode="link" text="{{noticeText}}" bindtap="goToProductDetail" />
  </block>
  <view class="{{logoActive ? 'logo active' : 'logo' }}">
    <view class="{{holdingSwitch ? 'tinyChatICon active' : 'tinyChatICon' }}" bindtouchstart="iconTouchStart" bindtouchend="iconTouchEnd">
      <image src="../../asset/icon/tiny-Chat-rotate.png" mode="widthFix" />
    </view>
    <text bindtap="checkCheatCodeStatus">𝑺𝒎𝒂𝒓𝒕-𝑪𝒉𝒂𝒕</text>
  </view>
  <view class="introduction">
    <view class="title">欢迎使用小闲聊</view>
    <view class="contain">
      <view>
        "小闲聊"是一款基于人工智能技术开发的智能聊天机器人应用，用户可以通过文字聊天方式与机器人进行交互。该小程序不仅可以与用户进行简单的闲聊，还可以通过学习用户的行为和偏好，提供个性化的推荐服务。例如，如果用户喜欢科技内容，"小闲聊"可以根据用户的兴趣爱好，为用户推荐相关的科技内容。总之，"小闲聊"是一款功能全面、交互便捷、智能化的聊天小程序，让用户可以随时随地与机器人或好友进行交流，获得各种信息和娱乐。
      </view>
      <view class="notice">严格遵守国家法律法规,自觉遵守中国互联网协会《文明上网自律公约》,不发布危害国家安全、违反法律法规、影响社会和谐稳定的有害信息</view>
    </view>
    <view class="switch topLeft" data-flag="topLeft" bindtap="checkCheatCode"></view>
    <view class="switch topRight" data-flag="topRight" bindtap="checkCheatCode"></view>
    <view class="switch bottomLeft" data-flag="bottomLeft" bindtap="checkCheatCode"></view>
    <view class="switch bottomRight" data-flag="bottomRight" bindtap="checkCheatCode"></view>
  </view>

  <view class="buttons">
    <block wx:if="{{!isDevMode}}">
      <block wx:if="{{userInfo.isMember == 0 && userInfo.isValid == 0}}">
        <view class="userProtocolModel">
          <view class="textInside">
            <view class="{{isNotRead ? 'agreeButton' : 'agreeButton active'}}" bindtap="agreedClick">√</view>
            <text>我已阅读并同意</text>
            <text class="userProtocol" bindtap="checkUserProtocol">《用户协议及隐私政策》</text>
          </view>
        </view>
        <button type="primary" bindtap="apply" disabled="{{isNotRead}}">申请使用</button>
      </block>

      <block wx:if="{{userInfo.isMember == 1 && userInfo.isValid == 1}}">
        <view wx:if="{{userInfo.coverPhone}}" class="userPhone">当前用户：{{userInfo.coverPhone}}</view>
        <view class="userPhone" wx:if="{{userInfo.validEndTime}}">到期时间：{{userInfo.validEndTime}}</view>
        <view class="payHistory">
          <text style="margin-right: 20rpx;" bindtap="checkUserProtocol">用户协议</text>
          <text bindtap="checkPayHistory">延续历史</text>
        </view>
        <button type="primary" bindtap="goToChat">开始聊天</button>
      </block>

      <block wx:if="{{userInfo.isMember == 1 && userInfo.isValid == 0}}">
        <view wx:if="{{userInfo.coverPhone}}" class="userPhone">当前用户：{{userInfo.coverPhone}}</view>
        <view class="userPhone" wx:if="{{userInfo.validEndTime}}">到期时间：{{userInfo.validEndTime}}</view>
        <view class="payHistory">
          <text bindtap="checkUserProtocol" style="margin-right: 20rpx;">用户协议</text>
          <text bindtap="checkPayHistory">延续历史</text>
        </view>
        <button type="primary" bindtap="goToBuy">延续使用</button>
      </block>

      <!-- <block wx:if="{{userInfo.phone && userInfo.isMember == 0 && userInfo.isValid == 0}}">
        <view class="userPhone">当前用户：{{userInfo.coverPhone}}</view>
        <button type="primary" bindtap="goToBuy">购买会员</button>
      </block> -->
    </block>

    <block wx:if="{{isDevMode}}">
      <view class="userPhone" style="color: #ff0000;font-weight: 600;">{{devMode}}</view>
      <button type="primary" bindtap="goToChat">开始聊天</button>
    </block>
  </view>

</view>