index.wxml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <!--index.wxml-->
  2. <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'>
  3. </nav-bar>
  4. <view class="container">
  5. <view wx:if="{{indexPage==0}}" class="mair" style="height: calc(100vh - 120rpx - {{navBarHeight}}px);">
  6. <view style="font-size: 32rpx; color: #333333; margin-top: 14rpx;">{{greeting}}</view>
  7. <!-- banner-->
  8. <view wx:if="{{bannerList.length>0}}" class="banner_container">
  9. <swiper class="swiper" indicator-dots="{{bannerList.length>1}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" indicator-active-color="#FFFFFF" indicator-color="#999999">
  10. <block wx:for="{{bannerList}}" wx:key="index">
  11. <swiper-item>
  12. <image class="swiper_image" src="{{item.pic}}" data-item="{{item}}" bind:tap="onTapBanner" />
  13. </swiper-item>
  14. </block>
  15. </swiper>
  16. </view>
  17. <view class="add_device_public" bind:tap="addDevice">
  18. <image mode="heightFix" src="./../../img/add_device.png" style="width: 48rxp;height: 48rpx;"></image>
  19. <view style="color: white; margin-left: 8rpx; font-size: 32rpx;">添加设备</view>
  20. </view>
  21. <scroll-view scroll-y="true" style="height: calc(100vh - 118rpx - 14rpx - 20rpx - 88rpx - 64rpx - 58rpx - {{bannerList.length>0?296:0}}rpx - {{navBarHeight}}px);margin-top: 22rpx;padding-top: 10rpx; ">
  22. <view wx:if="{{deviceList}}">
  23. <block wx:key="key" wx:for-item="item" wx:for-index="index" wx:for="{{deviceList}}">
  24. <view class="item_public" style="width: calc(100vw - 72rpx);border: {{item.state && item.state === 'online'&&deviceListIndex === index ? '4rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}}; margin-left: {{item.state && item.state === 'online'&&deviceListIndex === index ?0:4}}rpx;" data-item="{{item}}" data-index="{{index}}" bind:tap="{{item.state && item.state === 'online' ? 'onTapItem' : ''}}">
  25. <image class="item_public_image" src="./../../img/min.png" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};"></image>
  26. <view class="item_public_right" style="margin-right: 26rpx; opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};">
  27. <view style="height: 190rpx; margin-top: 37rpx; margin-left: 32rpx; flex-direction: column; display: flex;">
  28. <view style="flex: 1;">
  29. <view style="display: flex;">
  30. <view style="color: #333333; font-size: 28rpx; flex: 1;padding-right: 5rpx;">{{item.devName}}</view>
  31. <image wx:if="{{item.state && item.state === 'online'&&deviceListIndex === index }}" mode="heightFix" src="./../../img/add_device_arrow.png" style="width: 48rxp;height: 48rpx;"></image>
  32. </view>
  33. <view style="color: #666666; font-size: 24rpx;">{{item.state && item.state === "online" ? (item.connectType==3?"Wifi在线":"蓝牙在线") : "离线"}}</view>
  34. </view>
  35. <view style="align-items: center; justify-content: center; vertical-align: middle;width: 280rpx;height: 64rpx;background-color: #F2F5F7; border-radius: 52rpx; text-align: center; justify-content: center; display: flex;" data-index="{{index}}" catchtap="deleteDevice">
  36. <view style="color: #666666; font-size: 28rpx; ">删除</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </block>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. <view wx:else>
  46. <!-- 连接设备启用以下版本 -->
  47. <view wx:if="{{indexPage==1&&deviceListIndex!=null&&deviceList.length>deviceListIndex&&deviceList[deviceListIndex].ProdModel==='MW-2AX(WIFI-N)'}}" class="mair" style="height: calc(100vh - 118rpx - {{navBarHeight}}px);">
  48. <view class="play-info">
  49. <view class="info">
  50. <image src="./../../img/blak.png" class="black" mode="scaleToFill"></image>
  51. <image src="./../../img/mm.png" class="mode" mode="scaleToFill"></image>
  52. <image class="logo" mode="heightFix" src="./../../img/logo.png"></image>
  53. <view wx:if="{{actionIndex !== null}}" style="opacity: 0.8; text-shadow:0px 0px 4px #6D00FF;" class="fm">FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}}</view>
  54. <view wx:if="{{actionIndex !== null}}" style="opacity: 1;" class="fm">FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}} <image class="gochnnalList" mode="heightFix" src="./../../img/a6.png">
  55. </image>
  56. </view>
  57. <view class="fmMod" bindtap="goChannel"></view>
  58. <view wx:if="{{actionIndex !== null}}" class="thisMusic">
  59. <text>当前播放:</text>
  60. <view class="scroll-box">
  61. <view class="scroll-wrap">
  62. <view class="scroll-item">{{channelData[actionIndex].channelName}}</view>
  63. </view>
  64. </view>
  65. </view>
  66. <image src="{{'./../../img/dl' + battery + '.png'}}" class="battery" mode="scaleToFill"></image>
  67. </view>
  68. <view class="wakeMode" bindtap="goWake">
  69. <image src="./../../img/woak.png" class="mode" mode="scaleToFill"></image>
  70. <image class="wake" mode="heightFix" src="{{isSetWake ? './../../img/n24.png' : './../../img/n23.png' }}"></image>
  71. <text>定时</text>
  72. </view>
  73. </view>
  74. <scroll-view class="pd" scroll-y="true">
  75. <view class="conm" wx:if="{{channelData && channelData.length > 0}}">
  76. <image mode="scaleToFill" class="cz" src="./../../img/cz.png"></image>
  77. <view class="musicList">
  78. <view wx:for="{{channelData}}" class="li {{index === actionIndex ? 'action' : ' '}}">
  79. <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="zz" src="./../../img/zz.png"></image>
  80. <text class="lm">{{luoma[index]}}</text>
  81. <view class="musicInfo" data-index="{{index}}" bindtap="actionMusic">
  82. <image mode="scaleToFill" class="pic" src="{{item.channelPic ? item.channelPic : './../../img/head_pic.png'}}"></image>
  83. <text>{{item.channelName}}</text>
  84. <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="svg" src="./../../svg/audio.svg"></image>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- <image src="./../../svg/audio.svg"></image> -->
  89. </view>
  90. </scroll-view>
  91. <!-- 登录启用以下版本 -->
  92. <view class="gologin" wx:if="{{showLogin}}">
  93. <view class="model">
  94. <view bindtap="goLogin" style="position: none; height: auto;" class="loginPic">
  95. <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../img/BG_long.png"></image>
  96. </view>
  97. <view style="position: none; height: calc(100% - 224rpx); overflow: auto;" class="BG_PD">
  98. <view>
  99. <image style="margin: 0; width: 100vw;" mode="widthFix" src="./../../img/BG_PD.png"></image>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <view class="gologin goruter" wx:if="{{!showLogin && deviceList && deviceList.length === 0}}">
  105. <view class="model">
  106. <view bindtap="goDeviceConnect" style="position: none; height: auto;" class="loginPic">
  107. <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../img/BG_LJ.png"></image>
  108. </view>
  109. <view style="position: none; height: calc(100% - 224rpx); overflow: auto;" class="BG_PD">
  110. <view>
  111. <image style="margin: 0; width: 100vw;" mode="widthFix" src="./../../img/BG_PD.png"></image>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <view wx:elif="{{indexPage==2}}" class="me" style="height: calc(100vh - 100rpx - {{navBarHeight}}px);">
  118. <view class="head-logo">
  119. <image mode="scaleToFill" src="{{userPic}}"></image>
  120. <text class="nick_name" wx:if="{{nickName}}">{{nickName}}</text>
  121. </view>
  122. <view class="br"></view>
  123. <view class="list">
  124. <view class="li">
  125. <view class="icon">
  126. <image mode="widthFix" src="./../../img/o.png"></image>
  127. </view>
  128. <view class="button">
  129. <button open-type="feedback">建议与反馈</button>
  130. <image class="j" mode="heightFix" src="./../../img/b.png"></image>
  131. </view>
  132. </view>
  133. <view class="li">
  134. <view class="icon">
  135. <image mode="widthFix" src="./../../img/q.png"></image>
  136. </view>
  137. <view class="button" bindtap="goMeAbout">
  138. <text>关于我们</text>
  139. <image class="j" mode="heightFix" src="./../../img/b.png"></image>
  140. </view>
  141. </view>
  142. </view>
  143. <view wx:if="{{isLogin}}" class="login">
  144. <view bindtap="goMeLogin" class="{{!isLogin ? 'action' : ''}}">{{isLogin ? '退出登录' : "登录"}}</view>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. <view style="height: 98rpx;">
  150. <view class="line"></view>
  151. <view style="height: 97rpx; text-align: center; display: flex; flex: 1; align-items: center;">
  152. <view class="bottom_view" data-index="0" bind:tap="onTapIndex">
  153. <image class="bottom_image" mode="widthFix" src="{{indexPage==0?'./../../img/index_action.png':'./../../img/index_unaction.png'}}"></image>
  154. <view style="font-size: 20rpx;color: {{indexPage==0?'#A4D099':'black'}}; padding-top: 0rpx;margin-top: 0rpx;"> 首页</view>
  155. </view>
  156. <view wx:if="{{deviceListIndex!=null&&deviceList.length>deviceListIndex&&deviceList[deviceListIndex].ProdModel==='MW-2AX(WIFI-N)'}}" class="bottom_view" data-index="1" bind:tap="onTapIndex">
  157. <image class="bottom_image" mode="widthFix" src="{{indexPage==1?'./../../img/channel_action.png':'./../../img/channel_unaction.png'}}"></image>
  158. <view style="font-size: 20rpx;color: {{indexPage==1?'#A4D099':'black'}};"> 频道</view>
  159. </view>
  160. <view class="bottom_view" data-index="2" bind:tap="onTapIndex">
  161. <image class="bottom_image" mode="widthFix" src="{{indexPage==2?'./../../img/me_action.png':'./../../img/me_unaction.png'}}"></image>
  162. <view style="font-size: 20rpx;color: {{indexPage==2?'#A4D099':'black'}};"> 我的</view>
  163. </view>
  164. </view>
  165. </view>
  166. <!-- <view wx:if="{{newVersion}}" class="updataminiwx">
  167. <view class="mode">
  168. <image class="bg" src="./../../img/BG@2x.png"></image>
  169. <view class="updata-view">
  170. <image src="./../../img/sj.png"></image>
  171. <text class="title">更新检测</text>
  172. <text class="tip">检测到新版本,是否重启小程序</text>
  173. <view>
  174. <text bindtap="updataClone" class="onBut">取消</text>
  175. <text bindtap="updata" class="twoBut">确定</text>
  176. </view>
  177. </view>
  178. </view>
  179. </view> -->