chooseTime.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <!-- 选择时间 -->
  2. <template>
  3. <view class="body" :style="'padding-top:' + bottomHeight">
  4. <!-- 导航 -->
  5. <view class="ss-flex-2 ss-col-center ss-margin-width2" style="position: relative">
  6. <view class="ss-flex-2 ss-col-center">
  7. <text class="textIcon icon-fanhui icon-navigation" @click="backPage"></text>
  8. <view style="margin-left: 15rpx; color: #3D444E; font-size: 28rpx">接单时间</view>
  9. </view>
  10. <view class="ss-flex-1"></view>
  11. <text class="textIcon icon-kefu2 icon-navigation"></text>
  12. </view>
  13. <view class="big-time-box">
  14. <view class="default-box ss-flex-2 ss-col-center">
  15. <view class="ss-flex-1"></view>
  16. <view class="default-item-box" @click="clickInfo(1)" :style="clickIndex==1?'background-color: #DB2A46;color: #fff;':''">
  17. 默认
  18. </view>
  19. <view class="ss-flex-1"></view>
  20. <view class="default-item-box" @click="clickInfo(2)" :style="clickIndex==2?'background-color: #DB2A46;color: #fff;':''">
  21. 今天
  22. </view>
  23. <view class="ss-flex-1"></view>
  24. </view>
  25. <view class="ss-flex-2 ss-col-center" style="width: 95%;margin-left: 2.5%;box-sizing: border-box;margin-top: 20rpx;">
  26. <view class="week-box" v-for="item in weekData" :key="item.text" @click="clickWeek(item)" :style="weekArr.indexOf(item.value)>-1?'background-color: #FED037;color: #fff;':''">
  27. {{item.text}}
  28. </view>
  29. </view>
  30. </view>
  31. <view class="setting-time">
  32. <view class="title-time-box">点击以下时间段设置/取消</view>
  33. <view class="ss-flex-2 ss-col-center" style="flex-wrap: wrap;width: 95%;margin-left: 2.5%;box-sizing: border-box;">
  34. <view class="time-pian-box" v-for="i in 46">
  35. 00:00
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 中部 -->
  40. <view class="list-wrap">
  41. <scroll-view scroll-y="true" class="list">
  42. <view class="list-scroll-view">
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </view>
  47. </template>
  48. <script setup>
  49. import {
  50. reactive,
  51. ref
  52. } from 'vue';
  53. import {
  54. computed
  55. } from 'vue';
  56. import {
  57. onLoad,
  58. onPageScroll,
  59. onPullDownRefresh,
  60. onReady,
  61. onReachBottom,
  62. onShow,
  63. } from '@dcloudio/uni-app';
  64. import sheep from '@/sheep';
  65. import $share from '@/sheep/platform/share';
  66. // 隐藏原生tabBar
  67. // uni.hideTabBar();
  68. //点击默认还是今天
  69. const clickIndex=ref(1)
  70. const clickInfo=async(num)=>{
  71. clickIndex.value=num
  72. }
  73. const weekArr=ref([])
  74. const clickWeek=async(item)=>{
  75. if(weekArr.value.length>0){
  76. if(weekArr.value.indexOf(item.value)>-1){
  77. weekArr.value.splice(weekArr.value.indexOf(item.value),1)
  78. }else{
  79. weekArr.value.push(item.value)
  80. }
  81. }else{
  82. weekArr.value.push(item.value)
  83. }
  84. }
  85. const weekData=ref([
  86. {
  87. text:'周一',
  88. value:1
  89. },
  90. {
  91. text:'周二',
  92. value:2
  93. },
  94. {
  95. text:'周三',
  96. value:3
  97. },
  98. {
  99. text:'周四',
  100. value:4
  101. },
  102. {
  103. text:'周五',
  104. value:5
  105. },
  106. {
  107. text:'周六',
  108. value:6
  109. },
  110. {
  111. text:'周日',
  112. value:7
  113. }
  114. ])
  115. // 返回上一页
  116. const backPage = async () => {
  117. uni.navigateBack({
  118. delta:1
  119. });
  120. };
  121. const bottomHeight = ref('0rpx');
  122. // #ifdef APP-PlUS
  123. //获取顶部安全距离
  124. const app = uni.getSystemInfoSync();
  125. const bottomHeightOne = app.statusBarHeight + 'rpx';
  126. bottomHeight.value = bottomHeightOne
  127. // #endif
  128. </script>
  129. <style scoped lang="scss">
  130. .time-pian-box{
  131. padding: 10rpx 40rpx;
  132. font-size: 18rpx;
  133. color: #414141;
  134. border-radius: 20rpx;
  135. border: 1rpx solid #CCCCD0;
  136. margin-top:20rpx;
  137. margin-right:28rpx;
  138. }
  139. .title-time-box{
  140. font-size: 22rpx;
  141. color: #3D444E;
  142. font-weight: 600;
  143. width: 95%;
  144. margin-left: 2.5%;
  145. box-sizing: border-box;
  146. }
  147. .setting-time{
  148. width: 95%;
  149. min-height: 100rpx;
  150. margin-left: 2.5%;
  151. padding: 10rpx;
  152. box-sizing: border-box;
  153. border-radius: 10rpx;
  154. background-color: #fff;
  155. margin-top: 30rpx;
  156. }
  157. .week-box{
  158. padding: 10rpx 10rpx 30rpx 10rpx;
  159. box-sizing: border-box;
  160. border: 1rpx solid #EEEEF0;
  161. border-radius: 10rpx;
  162. font-size: 22rpx;
  163. color: #484F57;
  164. margin-right: 20rpx;
  165. }
  166. .default-item-box{
  167. padding: 10rpx 70rpx;
  168. border-radius: 10rpx;
  169. font-size: 24rpx;
  170. color: #484F57;
  171. }
  172. .default-box{
  173. width: 95%;
  174. min-height: 50rpx;
  175. margin-left: 2.5%;
  176. box-sizing: border-box;
  177. padding: 10rpx 30rpx;
  178. background-color: #EEEEF0;
  179. border-radius: 5rpx;
  180. }
  181. .big-time-box{
  182. width:95%;
  183. min-height:100rpx;
  184. margin-left:2.5%;
  185. padding: 15rpx;
  186. box-sizing:border-box;
  187. border-radius:10rpx;
  188. background-color:#fff;
  189. margin-top:20rpx;
  190. }
  191. .icon-navigation {
  192. font-size: 32rpx;
  193. color: #3D444E;
  194. font-weight: 700;
  195. }
  196. // 上中下布局样式
  197. .body {
  198. display: flex;
  199. flex-direction: column;
  200. background-color: #EEEEF0;
  201. height: 100vh;
  202. box-sizing: border-box;
  203. }
  204. .head {
  205. text-align: center;
  206. }
  207. // 中部滚动
  208. .list-wrap {
  209. flex-grow: 1;
  210. position: relative;
  211. width: 95%;
  212. margin-left: 2.5%;
  213. box-sizing: border-box;
  214. }
  215. .list {
  216. position: absolute;
  217. top: 0;
  218. left: 0;
  219. right: 0;
  220. bottom: 50rpx;
  221. padding: 10rpx;
  222. border-radius: 15rpx;
  223. box-sizing: border-box;
  224. }
  225. .list-scroll-view {
  226. width: 100%;
  227. margin-bottom: 20rpx;
  228. box-sizing: border-box;
  229. }
  230. .course-card {
  231. width: 47vw;
  232. margin-top: 10px;
  233. margin-bottom: 10px;
  234. }
  235. // 底部
  236. .tools {
  237. display: flex;
  238. flex-direction: row;
  239. justify-content: space-between;
  240. }
  241. .tools-item {
  242. width: 45px;
  243. text-align: center;
  244. font-size: 14px;
  245. padding: 20px;
  246. }
  247. </style>