itemList.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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:#fff;font-size:28rpx;">项目列表</view>
  9. </view>
  10. <view class="ss-flex-1"></view>
  11. <text class="textIcon icon-kefu icon-navigation"></text>
  12. <text class="textIcon icon-tongzhiguanli icon-navigation" style="margin-left: 30rpx;"></text>
  13. </view>
  14. <!-- 搜索框 -->
  15. <view class="ss-margin-width2" style="margin-top:1rpx;">
  16. <uni-search-bar radius="30" v-model="searchInfo" placeholder="请输入搜索关键字" cancelButton="none" clearButton="none" @confirm="onSearch" ></uni-search-bar>
  17. </view>
  18. <!-- 选择地址 -->
  19. <view class="ss-flex-2 ss-col-center public-box" style="margin-top: -15rpx;">
  20. <text class="textIcon icon-ditu" style="margin-left:30rpx;color: #fff;font-size: 26rpx;"></text>
  21. <uni-data-select
  22. style="font-size: 22rpx;margin-left: 10rpx;"
  23. v-model="address"
  24. :localdata="range"
  25. :clear="false"
  26. @change="changeAddress"
  27. ></uni-data-select>
  28. <view class="ss-flex-1"></view>
  29. </view>
  30. <!-- 中部 -->
  31. <view class="list-wrap">
  32. <scroll-view scroll-y="true" class="list">
  33. <view class="list-scroll-view" v-for="item in listData">
  34. <!-- 左右布局 -->
  35. <view style="width:200rpx;">
  36. <image class="wh" referrerpolicy="no-referrer"
  37. src="/static/lanhu_shouye/pskrims113novhztuh3djro4dewm6siic9cbfccd-f457-4e94-a2a5-bf7808d1dd3f.png" />
  38. </view>
  39. <!-- 上下布局 -->
  40. <view class="ss-flex-1" style="margin-left: 10rpx;margin-top: 5rpx;">
  41. <!-- 服务大项 -->
  42. <view class="ss-flex-2 ss-col-center">
  43. <view>精油按摩</view>
  44. <view class="ss-flex-1"></view>
  45. <view class="ss-flex-2 ss-col-center ss-row-center">
  46. <text class="textIcon icon-fenzhong" style="font-size: 22rpx;color:#3A4450;"></text>
  47. <view style="font-size: 20rpx;color:#3A4450;margin-left: 10rpx;padding-top: 5rpx;">80分钟</view>
  48. </view>
  49. <view style="margin-left: 20rpx;font-size: 20rpx;color:#8F8F93;padding-top: 5rpx;">已预约11636单</view>
  50. </view>
  51. <!-- 服务小项 -->
  52. <view class="ss-flex-2 event-wrap" style="margin-top: 5rpx;flex-wrap: wrap;">
  53. <view class="ss-flex-2" v-for="i in 4">
  54. <view class="event-box">舒缓疲劳{{i}}</view>
  55. <view class="line-box"></view>
  56. </view>
  57. </view>
  58. <!-- 加减 -->
  59. <view class="ss-flex-2">
  60. <view class="ss-flex-1"></view>
  61. <!-- 手写一个加减计算器 -->
  62. <view class="ss-flex-2 ss-col-center">
  63. <view @click="minusNumber($event,item)">
  64. <text class="textIcon icon-jianhao- count-icon"></text>
  65. </view>
  66. <view class="count-number">{{item.number}}</view>
  67. <view @click="addNumber($event,item)">
  68. <text class="textIcon icon-jiahao- count-icon" style="color: #2DAFD1;"></text>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 价格以及预约 -->
  73. <view class="ss-flex-2 ss-col-center" style="margin-top: 10rpx;">
  74. <view class="ss-flex-2 ss-col-center ss-row-center">
  75. <text class="textIcon icon-renminbi1688 icon-rmb"></text>
  76. <view class="maney-number-box">498.00</view>
  77. </view>
  78. <view class="ss-flex-1"></view>
  79. <view class="reservation-box">立即预约</view>
  80. </view>
  81. </view>
  82. </view>
  83. </scroll-view>
  84. </view>
  85. </view>
  86. </template>
  87. <script setup>
  88. import {
  89. reactive,
  90. ref
  91. } from 'vue';
  92. import {
  93. computed
  94. } from 'vue';
  95. import {
  96. onLoad,
  97. onPageScroll,
  98. onPullDownRefresh,
  99. onReady,
  100. onReachBottom,
  101. onShow
  102. } from '@dcloudio/uni-app';
  103. import sheep from '@/sheep';
  104. import $share from '@/sheep/platform/share';
  105. // 隐藏原生tabBar
  106. uni.hideTabBar();
  107. // 返回上一页
  108. const backPage=async()=>{
  109. uni.navigateBack({
  110. delta:1
  111. })
  112. }
  113. // 搜索框
  114. const searchInfo=ref('')
  115. const onSearch=async(e)=>{
  116. console.log(e,searchInfo.value,'搜索信息')
  117. }
  118. // 选择地址
  119. const address=ref(0)
  120. const range=ref([
  121. { value: 0, text: "华庭路橡树湾小区10-909" },
  122. { value: 1, text: "足球" },
  123. { value: 2, text: "游泳" },
  124. ])
  125. const changeAddress=async(e)=>{
  126. console.log(e,'获取地址信息')
  127. }
  128. // 项目列表
  129. const listData = ref([{
  130. id: 1,
  131. price: 240,
  132. allManey: 0,
  133. number: 0
  134. },
  135. {
  136. id: 2,
  137. price: 220,
  138. allManey: 0,
  139. number: 0
  140. },
  141. {
  142. id: 3,
  143. price: 270,
  144. allManey: 0,
  145. number: 0
  146. },
  147. {
  148. id: 4,
  149. price: 499,
  150. allManey: 0,
  151. number: 0
  152. }
  153. ])
  154. // 每个项目的加减
  155. const minusNumber = async (e, item) => {
  156. item.number--
  157. if(item.number<=0){
  158. item.number=0
  159. }
  160. }
  161. const addNumber = async (e, item) => {
  162. item.number++
  163. if(item.number>=5){
  164. item.number=5
  165. }
  166. }
  167. //获取顶部安全距离
  168. const app = uni.getSystemInfoSync()
  169. const bottomHeightOne = (app.statusBarHeight) + 'rpx'
  170. const bottomHeight = ref(bottomHeightOne)
  171. </script>
  172. <style scoped lang="scss">
  173. .reservation-box{
  174. font-size: 22rpx;
  175. background-color: #2AB0D5;
  176. padding: 5rpx 20rpx;
  177. color: #fff;
  178. border-radius: 5rpx;
  179. }
  180. .icon-rmb{
  181. font-size: 30rpx;
  182. color:#E60012;
  183. font-weight: 700;
  184. }
  185. .maney-number-box{
  186. font-size: 30rpx;
  187. color:#E60012;
  188. margin-left: 5rpx;
  189. padding-top: 5rpx;
  190. font-weight: 650;
  191. }
  192. .count-number{
  193. font-size: 24rpx;
  194. color: #555;
  195. padding-left: 10rpx;
  196. padding-right: 10rpx;
  197. box-sizing: border-box;
  198. }
  199. .count-icon{
  200. font-size: 30rpx;
  201. color: #999;
  202. }
  203. .line-box{
  204. width: 2rpx;
  205. height: 30rpx;
  206. background-color: #D2D3D5;
  207. margin-left: 10rpx;
  208. margin-right: 10rpx;
  209. }
  210. .event-box{
  211. font-size: 22rpx;
  212. color: #909295;
  213. height: 30rpx;
  214. line-height: 30rpx;
  215. box-sizing: border-box;
  216. }
  217. .event-wrap{
  218. width: 100%;
  219. max-height: 60rpx;
  220. min-height: 60rpx;
  221. overflow-y: auto;
  222. }
  223. .icon-navigation{
  224. font-size: 32rpx;
  225. color: #fff;
  226. font-weight:700;
  227. }
  228. // 上中下布局样式
  229. .body {
  230. display: flex;
  231. flex-direction: column;
  232. height: 100vh;
  233. background: linear-gradient(to bottom, #08A3E9, #F8FCFF);
  234. box-sizing: border-box;
  235. }
  236. // 中部滚动
  237. .list-wrap {
  238. flex-grow: 1;
  239. position: relative;
  240. width: 95%;
  241. margin-left: 2.5%;
  242. box-sizing: border-box;
  243. }
  244. .list {
  245. position: absolute;
  246. top: 0;
  247. left: 0;
  248. right: 0;
  249. bottom: 50rpx;
  250. padding: 10rpx;
  251. border-radius: 15rpx;
  252. background-color: #fff;
  253. box-sizing: border-box;
  254. }
  255. .list-scroll-view {
  256. display: flex;
  257. flex-direction: row;
  258. flex-wrap: nowrap;
  259. width:100%;
  260. padding-bottom: 20rpx;
  261. margin-bottom: 20rpx;
  262. border-bottom: 1rpx solid #999BA2;
  263. box-sizing: border-box;
  264. }
  265. .course-card {
  266. width: 47vw;
  267. margin-top: 10px;
  268. margin-bottom: 10px;
  269. }
  270. // 底部
  271. .tools {
  272. display: flex;
  273. flex-direction: row;
  274. justify-content: space-between;
  275. }
  276. .tools-item {
  277. width: 45px;
  278. text-align: center;
  279. font-size: 14px;
  280. padding: 20px;
  281. }
  282. </style>
  283. <style scoped>
  284. /deep/.uni-select__input-text {
  285. font-size: 22rpx !important;
  286. color: #fff !important;
  287. }
  288. /deep/uni-slider .uni-slider-handle-wrapper{
  289. height:18rpx !important;
  290. }
  291. .distance{
  292. /deep/.uni-select__input-text{
  293. width:130rpx;
  294. color:#fff;
  295. overflow: hidden;
  296. white-space: nowrap;
  297. text-overflow: ellipsis;
  298. font-size:24rpx;
  299. text-align: right;
  300. }
  301. }
  302. /deep/.uni-select__input-text{
  303. width:180rpx;
  304. color:#fff;
  305. overflow: hidden;
  306. white-space: nowrap;
  307. text-overflow: ellipsis;
  308. font-size:24rpx;
  309. text-align: right;
  310. }
  311. /deep/.uni-searchbar__box{
  312. height:100% !important;
  313. }
  314. /deep/.uni-select{
  315. border: none !important;
  316. padding-left: 0rpx;
  317. }
  318. </style>