index.wxml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <!-- index.wxml -->
  2. <view class="container" style="flex-direction: column; display: flex;">
  3. <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}}'></nav-bar>
  4. <view style="height: calc(100vh - 22rpx - {{navBarHeight}}px);">
  5. <view wx:if="{{indexPage==0}}" class="mair" style="flex-direction: column; display: flex; height: calc(100vh - 105rpx - {{safeBottomHeight}}rpx - 22rpx - {{navBarHeight}}px);">
  6. <view style="font-size: 32rpx; color: #333333; margin-top: 14rpx;">{{greeting}}</view>
  7. <view wx:if="{{bannerList.length>0}}" class="banner_container">
  8. <swiper class="swiper" indicator-dots="{{bannerList.length>1}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" indicator-active-color="#FFFFFF" indicator-color="#999999">
  9. <block wx:for="{{bannerList}}" wx:key="index">
  10. <swiper-item>
  11. <image mode="widthFix" class="swiper_image" src="{{item.pic}}" data-item="{{item}}" bind:tap="onTapBanner" />
  12. </swiper-item>
  13. </block>
  14. </swiper>
  15. </view>
  16. <view class="add_device_public" bind:tap="jumpToAddDevice">
  17. <image mode="heightFix" src="./../../../img/add_device.png" style="width: 48rpx;height: 48rpx;"></image>
  18. <view style="color: white; margin-left: 8rpx; font-size: 32rpx;">添加设备</view>
  19. </view>
  20. <scroll-view scroll-y="true" style="height: calc(100vh - 152rpx - 296rpx - 46rpx - 105rpx - {{safeBottomHeight}}rpx - 5rpx - {{navBarHeight}}px);">
  21. <block wx:key="key" wx:for-item="item" wx:for-index="index" wx:for="{{deviceList}}">
  22. <view class="item_public" style="border: {{item.state && item.state === 'online'&&deviceListSelect === index ? '6rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}}; flex-direction: row; display: flex; margin-top: 10rpx; margin-bottom: {{index==0?deviceList.length-1:0}}rpx; " data-item="{{item}}" data-index="{{index}}" bind:tap="onTapItem">
  23. <view style="width: 264rpx; height: 200rpx;">
  24. <image class="item_public_image" src="{{item.imageUrl}}" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};" mode="aspectFit" lazy-load="true" webp="true"></image>
  25. </view>
  26. <view class="item_public_right" style="flex: 1; margin-right: 25rpx; 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;flex-direction: column; display: flex;">
  29. <view style="display: flex; width: calc(100vw - 64rpx - 268rpx);">
  30. <view style="width: calc(100vw - 64rpx - 268rpx - 53rpx - 30rpx); color: #333333; font-size: 28rpx;padding-right: 5rpx; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  31. <text>{{item.devName}}</text>
  32. </view>
  33. <view style="width: 48rpx; height: 48rpx;">
  34. <image mode="aspectFit" src="./../../../img/add_device_arrow.png" style="width: 48rpx; height: 48rpx; opacity: {{item.state && item.state === 'online'&&deviceListSelect === index ? '1' : '0'}}; "></image>
  35. </view>
  36. </view>
  37. <view style="display: flex; flex-direction: row;">
  38. <view style="color: #666666; font-size: 24rpx;display: flex; flex-direction: row; align-items: center;">
  39. <image mode="heightFix" src="{{item.connectType==3?'./../../../images/device/wifi_black.png':'./../../../images/device/blue_black.png'}}" style="width: 28rpx;height: 28rpx; padding-right: 10rpx; opacity: {{item.state && item.state === 'online' ? '1' : '0.7'}};"></image>
  40. <view style="white-space: nowrap;"> {{item.state && item.state === "online" ? (item.connectType==3?"Wifi在线":"蓝牙在线") : "离线"}} </view>
  41. </view>
  42. <!-- <view wx:if="{{item.ProdModel=='MW-2AXD'||item.ProdModel=='MW-2XD(COZE)'}}" style="margin-left: 20rpx; padding-left: 20rpx;padding-right: 20rpx; padding-top: 5rpx; padding-bottom: 5rpx; align-items: center; justify-content: center; vertical-align: middle;background-color: #F2F5F7; border-radius: 52rpx; text-align: center; justify-content: center; display: flex;" data-item="{{item}}" data-index="{{index}}" catchtap="toRecharge">
  43. <view style="color: #666666; font-size: 24rpx; ">充值会员内容</view>
  44. </view> -->
  45. </view>
  46. </view>
  47. <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">
  48. <view style="color: #666666; font-size: 28rpx; ">删除</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </block>
  54. </scroll-view>
  55. </view>
  56. <view wx:else>
  57. <!-- 频道 -->
  58. <view wx:if="{{indexPage==1&&deviceListSelect!=null&&deviceList.length>deviceListSelect&&deviceList[deviceListSelect].connectType===3}}" class="mair" style="height: calc(100vh - 105rpx - {{safeBottomHeight}}rpx - 22rpx - {{navBarHeight}}px);">
  59. <view class="play-info">
  60. <view class="info">
  61. <image src="./../../../img/blak.png" class="black" mode="scaleToFill"></image>
  62. <image src="./../../../img/mm.png" class="mode" mode="widthFix"></image>
  63. <image class="logo" mode="heightFix" src="./../../../img/logo.png"></image>
  64. <view wx:if="{{actionIndex !== null}}" style="opacity: 0.8; text-shadow:0px 0px 4px #6D00FF;" class="fm">
  65. FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}} </view>
  66. <view wx:if="{{actionIndex !== null}}" style="opacity: 1;" class="fm">
  67. FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}} <image class="gochnnalList" mode="heightFix" src="./../../../img/a6.png">
  68. </image>
  69. </view>
  70. <view class="fmMod" bindtap="onTapToChannel"></view>
  71. <view wx:if="{{actionIndex !== null}}" class="thisMusic">
  72. <text>当前播放:</text>
  73. <view class="scroll-box">
  74. <view class="scroll-wrap">
  75. <view class="scroll-item">{{channelData[actionIndex].channelName}}</view>
  76. </view>
  77. </view>
  78. </view>
  79. <image src="{{'./../../../img/dl' + battery + '.png'}}" class="battery" mode="scaleToFill"></image>
  80. </view>
  81. <view class="wakeMode" bindtap="goWake">
  82. <image src="./../../../img/woak.png" class="mode" mode="scaleToFill"></image>
  83. <image class="wake" mode="heightFix" src="{{isSetWake ? './../../../img/n24.png' : './../../../img/n23.png' }}"></image>
  84. <text>定时</text>
  85. </view>
  86. </view>
  87. <scroll-view class="pd" scroll-y="true">
  88. <view class="conm" wx:if="{{channelData && channelData.length > 0}}">
  89. <image mode="scaleToFill" class="cz" src="./../../../img/cz.png"></image>
  90. <view class="musicList">
  91. <view wx:for="{{channelData}}" class="li {{index === actionIndex ? 'action' : ' '}}">
  92. <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="zz" src="./../../../img/zz.png"></image>
  93. <text class="lm">{{luoma[index]}}</text>
  94. <view class="musicInfo" data-index="{{index}}" bindtap="onTapChannelIndex">
  95. <image mode="scaleToFill" class="pic" src="{{item.channelPic ? item.channelPic : './../../../img/head_pic.png'}}"></image>
  96. <text>{{item.channelName}}</text>
  97. <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="svg" src="./../../../svg/audio.svg"></image>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. <!-- 登录启用以下版本 -->
  104. <view class="gologin" wx:if="{{showLogin}}">
  105. <view class="model">
  106. <view bindtap="goLogin" style="position: none; height: auto;" class="loginPic">
  107. <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../../img/BG_long.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 class="gologin goruter" wx:if="{{!showLogin && deviceList && deviceList.length === 0}}">
  117. <view class="model">
  118. <view bindtap="goDeviceConnect" style="position: none; height: auto;" class="loginPic">
  119. <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../../img/BG_LJ.png"></image>
  120. </view>
  121. <view style="position: none; height: calc(100% - 224rpx); overflow: auto;" class="BG_PD">
  122. <view>
  123. <image style="margin: 0; width: 100vw;" mode="widthFix" src="./../../../img/BG_PD.png"></image>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <!-- 我的 -->
  130. <view wx:elif="{{indexPage==2}}" class="me" style="height: calc(100vh - 105rpx - {{safeBottomHeight}}rpx - 22rpx - {{navBarHeight}}px); display: flex; flex-direction: column;">
  131. <view class="head-logo" bind:tap="{{isLogin?'':'onTapLogin'}}">
  132. <image mode="scaleToFill" src="{{userPic}}"></image>
  133. <text class="nick_name" wx:if="{{nickName}}">{{nickName}}</text>
  134. </view>
  135. <view class="br"></view>
  136. <view class="list">
  137. <view class="li">
  138. <view class="icon">
  139. <image mode="widthFix" style="width: 40rpx; height: 40rpx;" src="./../../../img/o.png"></image>
  140. </view>
  141. <view class="button">
  142. <button class="between_text" open-type="feedback">建议与反馈</button>
  143. <button class="between_image" open-type="feedback">
  144. <image class="j" src="./../../../img/b.png"></image>
  145. </button>
  146. </view>
  147. </view>
  148. <view class="li">
  149. <view class="icon">
  150. <image mode="widthFix" style="width: 40rpx; height: 40rpx;" src="./../../../img/q.png"></image>
  151. </view>
  152. <view class="button" bindtap="jumpToAboutUs">
  153. <text>关于我们</text>
  154. <image class="j" src="./../../../img/b.png"></image>
  155. </view>
  156. </view>
  157. </view>
  158. <view wx:if="{{isLogin}}" style="flex: 1;display: flex;">
  159. <view class="login">
  160. <view bindtap="onTapLogin" class="{{!isLogin ? 'action' : ''}}">
  161. {{isLogin ? '退出登录' : "登录"}}
  162. </view>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. <view style="height: calc(105rpx + {{safeBottomHeight}}rpx); flex-direction: column; display: flex;background-color: white;">
  169. <view class="line"></view>
  170. <view style="flex: 1; text-align: center; display: flex;align-items: center;">
  171. <!-- 首页 -->
  172. <view class="bottom_view" data-index="0" bind:tap="onTapIndex">
  173. <image class="bottom_image" mode="widthFix" src="{{indexPage==0?'./../../../img/index_action.png':'./../../../img/index_unaction.png'}}"></image>
  174. <view style="font-size: 20rpx;color: {{indexPage==0?'#A4D099':'black'}}; padding-top: 0rpx;margin-top: 0rpx;">
  175. 首页
  176. </view>
  177. </view>
  178. <!-- 频道 -->
  179. <view wx:if="{{deviceListSelect!=null&&deviceList.length>deviceListSelect&&deviceList[deviceListSelect].connectType===3}}" class="bottom_view" data-index="1" bind:tap="onTapIndex">
  180. <image class="bottom_image" mode="widthFix" src="{{indexPage==1?'./../../../img/channel_action.png':'./../../../img/channel_unaction.png'}}"></image>
  181. <view style="font-size: 20rpx;color: {{indexPage==1?'#A4D099':'black'}};">频道</view>
  182. </view>
  183. <!-- 我的 -->
  184. <view class="bottom_view" data-index="2" bind:tap="onTapIndex">
  185. <image class="bottom_image" mode="widthFix" src="{{indexPage==2?'./../../../img/me_action.png':'./../../../img/me_unaction.png'}}"></image>
  186. <view style="font-size: 20rpx;color: {{indexPage==2?'#A4D099':'black'}};">我的</view>
  187. </view>
  188. </view>
  189. <view style="height: {{safeBottomHeight}}rpx;"></view>
  190. </view>
  191. </view>