itemList.vue 8.2 KB

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