timing.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view>
  3. <u-navbar title="定时" title-color="#101010">
  4. <view slot="right" @click="deleteShow=true" >
  5. <img v-if="deleteShow==true" src="@/assets/img/arcoDesign-select-all.svg" alt="" />
  6. <img v-else src="@/assets/img/riLine-list-settings-line.svg" alt="" />
  7. </view>
  8. </u-navbar>
  9. <view class="time-group">
  10. <view class="time-item" v-for="item in 4" >
  11. <view class="time">
  12. <view class="time-slot">
  13. 18:00
  14. </view>
  15. <view class="type">
  16. 定时关闭 | 每天
  17. </view>
  18. </view>
  19. <!-- 开关 -->
  20. <view class="switch" v-if="!deleteShow" >
  21. <u-switch v-model="checked" size="40" ></u-switch>
  22. </view>
  23. <!-- 单选框 -->
  24. <view class="radio" v-if="deleteShow" >
  25. <radio icon-size="40" ></radio>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 添加按钮 -->
  30. <view class="add" @click="show=true" v-if="deleteShow==false" >
  31. <img src="@/assets/img/riLine-add-line 1.svg" alt="" />
  32. </view>
  33. <!-- 新增弹窗 -->
  34. <view class="add-popup">
  35. <u-action-sheet :list="list" v-model="show" border-radius="16" ></u-action-sheet>
  36. </view>
  37. <!-- 删除 -->
  38. <view class="delete" v-if="deleteShow" @click="deletePopup=true" >
  39. <view class="icon">
  40. <img src="@/assets/img/riLine-delete-bin-7-line 1.svg" alt="" />
  41. </view>
  42. <view class="text">
  43. 删除
  44. </view>
  45. </view>
  46. <!-- 删除确认弹框 -->
  47. <u-popup v-model="deletePopup" mode="bottom" border-radius="12" >
  48. <view class="popup">
  49. <view class="headline">
  50. 删除定时
  51. </view>
  52. <view class="hint">
  53. 要删除选中的定时吗?
  54. </view>
  55. <view class="btn-box">
  56. <view class="cancel" >
  57. 取消
  58. </view>
  59. <view class="confirm" >
  60. 确认删除
  61. </view>
  62. </view>
  63. </view>
  64. </u-popup>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. checked:false,
  72. show: false,
  73. popShow:false,
  74. deleteShow:false,
  75. deletePopup:false,
  76. list: [{
  77. text: '时间段定时',
  78. }, {
  79. text: '定时开启'
  80. }, {
  81. text: '定时关闭'
  82. },{
  83. text:'自动关闭'
  84. }],
  85. }
  86. },
  87. methods: {
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. /deep/.u-slot-right{
  93. margin-right:32rpx;
  94. img{
  95. width: 48rpx;
  96. height: 48rpx;
  97. }
  98. }
  99. .time-group{
  100. background-color: #fff;
  101. .time-item{
  102. padding: 24rpx 0;
  103. margin: 0 32rpx;
  104. display: flex;
  105. justify-content: space-between;
  106. align-items: center;
  107. border-bottom: 1px solid rgba(221,221,221,1);
  108. .time{
  109. .time-slot{
  110. color: rgba(16,16,16,1);
  111. font-size: 32rpx;
  112. }
  113. .type{
  114. color: rgba(119,119,119,1);
  115. }
  116. }
  117. }
  118. .time-item:last-of-type{
  119. border: none;
  120. }
  121. }
  122. // 添加按钮
  123. .add{
  124. width: 128rpx;
  125. height: 128rpx;
  126. background-color: rgba(22,119,255,1);
  127. border-radius: 999px;
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. position: fixed;
  132. bottom: 80rpx;
  133. right: 40rpx;
  134. img{
  135. width: 80rpx;
  136. height: 80rpx;
  137. }
  138. }
  139. .add-popup{
  140. /deep/.u-drawer{
  141. left: 24rpx;
  142. right: 24rpx;
  143. bottom: 24rpx;
  144. border-radius: 8px;
  145. }
  146. /deep/.u-action-sheet-item{
  147. color: #101010;
  148. }
  149. }
  150. // 删除
  151. .delete{
  152. position: fixed;
  153. left: 0;
  154. right: 0;
  155. bottom: 0;
  156. background-color:#fff;
  157. display: flex;
  158. flex-direction: column;
  159. align-items: center;
  160. justify-content: center;
  161. // padding: 20rpx 0;
  162. height: 120rpx;
  163. img{
  164. width: 48rpx;
  165. height: 48rpx;
  166. }
  167. .text{
  168. color: rgba(51,51,51,1);
  169. font-size: 20rpx;
  170. }
  171. }
  172. // 删除确认弹框
  173. .popup{
  174. padding: 32rpx;
  175. text-align: center;
  176. .headline{
  177. color: rgba(16,16,16,1);
  178. font-size: 36rpx;
  179. font-weight: bold;
  180. }
  181. .hint{
  182. color: rgba(16,16,16,1);
  183. font-size: 32rpx;
  184. margin-top: 40rpx;
  185. }
  186. .btn-box{
  187. margin-top: 82rpx;
  188. display: flex;
  189. justify-content: space-between;
  190. .cancel{
  191. width: 328rpx;
  192. line-height: 80rpx;
  193. border-radius: 4px;
  194. background-color: rgba(222,225,228,1);
  195. color: rgba(51,51,51,1);
  196. font-size: 32rpx;
  197. }
  198. .confirm{
  199. width: 328rpx;
  200. line-height: 80rpx;
  201. border-radius: 4px;
  202. background-color: rgba(255,68,68,1);
  203. color: rgba(255,255,255,1);
  204. font-size: 32rpx;
  205. }
  206. }
  207. }
  208. </style>