itemList.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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" @click="placeOrder(item)">立即预约</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 placeOrder=async(item)=>{
  169. console.log(item,'传递的参数')
  170. uni.navigateTo({
  171. url: '/pages/XDHome/technician/reservationPlaceOrder/reservationPlaceOrder?item='
  172. });
  173. }
  174. //获取顶部安全距离
  175. const app = uni.getSystemInfoSync()
  176. const bottomHeightOne = (app.statusBarHeight) + 'rpx'
  177. const bottomHeight = ref(bottomHeightOne)
  178. </script>
  179. <style scoped lang="scss">
  180. .reservation-box{
  181. font-size: 22rpx;
  182. background-color: #2AB0D5;
  183. padding: 5rpx 20rpx;
  184. color: #fff;
  185. border-radius: 5rpx;
  186. }
  187. .icon-rmb{
  188. font-size: 30rpx;
  189. color:#E60012;
  190. font-weight: 700;
  191. }
  192. .maney-number-box{
  193. font-size: 30rpx;
  194. color:#E60012;
  195. margin-left: 5rpx;
  196. padding-top: 5rpx;
  197. font-weight: 650;
  198. }
  199. .count-number{
  200. font-size: 24rpx;
  201. color: #555;
  202. padding-left: 10rpx;
  203. padding-right: 10rpx;
  204. box-sizing: border-box;
  205. }
  206. .count-icon{
  207. font-size: 30rpx;
  208. color: #999;
  209. }
  210. .line-box{
  211. width: 2rpx;
  212. height: 30rpx;
  213. background-color: #D2D3D5;
  214. margin-left: 10rpx;
  215. margin-right: 10rpx;
  216. }
  217. .event-box{
  218. font-size: 22rpx;
  219. color: #909295;
  220. height: 30rpx;
  221. line-height: 30rpx;
  222. box-sizing: border-box;
  223. }
  224. .event-wrap{
  225. width: 100%;
  226. max-height: 60rpx;
  227. min-height: 60rpx;
  228. overflow-y: auto;
  229. }
  230. .icon-navigation{
  231. font-size: 32rpx;
  232. color: #fff;
  233. font-weight:700;
  234. }
  235. // 上中下布局样式
  236. .body {
  237. display: flex;
  238. flex-direction: column;
  239. height: 100vh;
  240. background: linear-gradient(to bottom, #08A3E9, #F8FCFF);
  241. box-sizing: border-box;
  242. }
  243. // 中部滚动
  244. .list-wrap {
  245. flex-grow: 1;
  246. position: relative;
  247. width: 95%;
  248. margin-left: 2.5%;
  249. box-sizing: border-box;
  250. }
  251. .list {
  252. position: absolute;
  253. top: 0;
  254. left: 0;
  255. right: 0;
  256. bottom: 50rpx;
  257. padding: 10rpx;
  258. border-radius: 15rpx;
  259. background-color: #fff;
  260. box-sizing: border-box;
  261. }
  262. .list-scroll-view {
  263. display: flex;
  264. flex-direction: row;
  265. flex-wrap: nowrap;
  266. width:100%;
  267. padding-bottom: 20rpx;
  268. margin-bottom: 20rpx;
  269. border-bottom: 1rpx solid #999BA2;
  270. box-sizing: border-box;
  271. }
  272. .course-card {
  273. width: 47vw;
  274. margin-top: 10px;
  275. margin-bottom: 10px;
  276. }
  277. // 底部
  278. .tools {
  279. display: flex;
  280. flex-direction: row;
  281. justify-content: space-between;
  282. }
  283. .tools-item {
  284. width: 45px;
  285. text-align: center;
  286. font-size: 14px;
  287. padding: 20px;
  288. }
  289. </style>
  290. <style scoped>
  291. /deep/.uni-select__input-text {
  292. font-size: 22rpx !important;
  293. color: #fff !important;
  294. }
  295. /deep/uni-slider .uni-slider-handle-wrapper{
  296. height:18rpx !important;
  297. }
  298. .distance{
  299. /deep/.uni-select__input-text{
  300. width:130rpx;
  301. color:#fff;
  302. overflow: hidden;
  303. white-space: nowrap;
  304. text-overflow: ellipsis;
  305. font-size:24rpx;
  306. text-align: right;
  307. }
  308. }
  309. /deep/.uni-select__input-text{
  310. width:180rpx;
  311. color:#fff;
  312. overflow: hidden;
  313. white-space: nowrap;
  314. text-overflow: ellipsis;
  315. font-size:24rpx;
  316. text-align: right;
  317. }
  318. /deep/.uni-searchbar__box{
  319. height:100% !important;
  320. }
  321. /deep/.uni-select{
  322. border: none !important;
  323. padding-left: 0rpx;
  324. }
  325. </style>