index.wxml 12 KB

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