role.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='角色' :showback="false" bgColor='transparent'></cus-header>
  4. <template v-if="list.length">
  5. <div class="query adfacjb">
  6. <div class="ql adfac">
  7. <image src="@/static/query_mini.png"></image>
  8. <input type="text" placeholder="搜索" placeholder-class="ph">
  9. </div>
  10. <div class="qr" @tap="addRole"> + 新增角色</div>
  11. </div>
  12. <div class="list" :style="{'height':'calc(100vh - '+(mt+156)+'px)'}">
  13. <u-list @scrolltolower="scrolltolower">
  14. <u-list-item v-for="(item, index) in list" :key="index">
  15. <u-swipe-action @touchstart.stop>
  16. <u-swipe-action-item :options="options" @click="deleteRole(item)" :ref="'swipeAction' + index" :threshold="5"/>
  17. <view class="swipe-action u-border-top u-border-bottom">
  18. <view class="swipe-action__content">
  19. <div class="l_item adfacjb">
  20. <div class="li_l adfac">
  21. <image :src="require('@/static/role_avatar'+(index%3)+'.png')"></image>
  22. <div class="lil_info">
  23. <p>{{'词语接龙'}}</p>
  24. <div class="tip">
  25. <u--text :lines="2" :text="'擅长词语接龙,规范词汇,助你锻炼词汇量与反应能力'" size="24rpx" color="#A6A6A6" :bold="true" lineHeight="40rpx"></u--text>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="li_r">配置到设备</div>
  30. </div>
  31. </view>
  32. </view>
  33. </u-swipe-action-item>
  34. </u-swipe-action>
  35. </u-list-item>
  36. </u-list>
  37. </div>
  38. </template>
  39. <template v-else>
  40. <div class="empty adffcacjc" :style="{'height':'calc(100vh - '+(mt+106)+'px)'}">
  41. <image src="@/static/empty_device.png"></image>
  42. <p>请先绑定设备</p>
  43. <div class="zt_btn" @tap="addDevice"> + 添加新设备</div>
  44. </div>
  45. </template>
  46. <cus-tabbar :tabbarIndex="1"></cus-tabbar>
  47. <bind-device ref="bdRef"></bind-device>
  48. </view>
  49. </template>
  50. <script>
  51. import cusTabbar from '@/components/CusTabbar/index.vue'
  52. import bindDevice from '@/components/bindDevice/index.vue'
  53. export default {
  54. components:{
  55. cusTabbar,
  56. bindDevice
  57. },
  58. data(){
  59. return {
  60. list:[1],
  61. options: [{
  62. text: '删除',
  63. style: {
  64. backgroundColor: '#f56c6c'
  65. }
  66. }],
  67. }
  68. },
  69. methods:{
  70. addDevice(){
  71. this.$refs.bdRef.show = true;
  72. },
  73. addRole(){
  74. uni.navigateTo({
  75. url:'/pagesRole/addRole'
  76. })
  77. },
  78. }
  79. }
  80. </script>
  81. <style>
  82. .u-swipe-action-item__right__button__wrapper {
  83. background: #F55454 !important;
  84. font-size: 32rpx;
  85. font-family: PingFang-SC-Bold, PingFang-SC;
  86. font-weight: bold;
  87. color: #FFFFFF;
  88. letter-spacing: 2rpx;
  89. }
  90. .swipe-action {
  91. width: 100%;
  92. }
  93. .u-swipe-action {
  94. z-index: 100 !important;
  95. }
  96. </style>
  97. <style scoped lang="less">
  98. ::v-deep .list .u-list-item{
  99. margin-top: 60rpx;
  100. }
  101. ::v-deep .list .swipe-action{
  102. border: none !important;
  103. }
  104. .tabPage{
  105. background: #FFFFFF;
  106. padding-bottom: 192rpx;
  107. box-sizing: border-box;
  108. .query{
  109. margin-top: 20rpx;
  110. width: 100%;
  111. padding-left: 30rpx;
  112. box-sizing: border-box;
  113. .ql{
  114. width: calc(100% - 230rpx);
  115. height: 80rpx;
  116. background: #F6F6F8;
  117. border-radius: 40rpx;
  118. padding: 26rpx 36rpx;
  119. box-sizing: border-box;
  120. image{
  121. width: 28rpx;
  122. height: 28rpx;
  123. }
  124. input{
  125. font-family: PingFangSC, PingFang SC;
  126. font-weight: 400;
  127. font-size: 26rpx;
  128. color: #222222;
  129. line-height: 40rpx;
  130. padding-left: 20rpx;
  131. }
  132. }
  133. .qr{
  134. width: 204rpx;
  135. height: 80rpx;
  136. background: #D9F159;
  137. border-radius: 45rpx 0rpx 0rpx 45rpx;
  138. font-family: PingFang-SC, PingFang-SC;
  139. font-weight: bold;
  140. font-size: 28rpx;
  141. color: #111111;
  142. line-height: 80rpx;
  143. text-align: center;
  144. }
  145. }
  146. .list{
  147. padding: 0 30rpx;
  148. ::v-deep .u-list{
  149. width: 100%;
  150. height: 100% !important;
  151. }
  152. ::v-deep .u-list-item{
  153. width: 100%;
  154. }
  155. .l_item{
  156. width: 100%;
  157. .li_l{
  158. width: calc(100% - 200rpx);
  159. image{
  160. width: 116rpx;
  161. height: 116rpx;
  162. }
  163. .lil_info{
  164. width: calc(100% - 116rpx);
  165. padding-left: 23rpx;
  166. p{
  167. font-family: PingFang-SC, PingFang-SC;
  168. font-weight: bold;
  169. font-size: 32rpx;
  170. color: #111111;
  171. line-height: 32rpx;
  172. margin-bottom: 16rpx;
  173. }
  174. }
  175. }
  176. .li_r{
  177. width: 160rpx;
  178. height: 64rpx;
  179. background: #D9F159;
  180. border-radius: 16rpx;
  181. font-family: PingFangSC, PingFang SC;
  182. font-weight: 400;
  183. font-size: 24rpx;
  184. color: #111111;
  185. line-height: 64rpx;
  186. text-align: center;
  187. letter-spacing: 2rpx;
  188. }
  189. }
  190. }
  191. .empty{
  192. image{
  193. width: 64rpx;
  194. height: 66rpx;
  195. }
  196. p{
  197. font-family: PingFangSC, PingFang SC;
  198. font-weight: 400;
  199. font-size: 30rpx;
  200. color: #A6A6A6;
  201. line-height: 42rpx;
  202. text-align: center;
  203. margin-top: 30rpx;
  204. }
  205. .zt_btn{
  206. width: calc(100% - 140rpx);
  207. margin: 230rpx 70rpx 0;
  208. }
  209. }
  210. .ph{
  211. color: #A6A6A6;
  212. }
  213. }
  214. </style>