itemList.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <!-- 项目列表 -->
  2. <template>
  3. <s-layout class="homepage-wrap ss-w-100 box-sizing" title="首页" navbar="custom"
  4. tabbar="/pages/XDHome/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="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 class="mb-box" @tap="jumpPackage"></view>
  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"
  47. style="font-size: 22rpx; color: #3a4450"></text>
  48. <view
  49. style="font-size: 20rpx; color: #3a4450; margin-left: 10rpx; padding-top: 5rpx">
  50. 80分钟</view>
  51. </view>
  52. <view style="margin-left: 20rpx; font-size: 20rpx; color: #8f8f93; padding-top: 5rpx">
  53. 已预约11636单</view>
  54. </view>
  55. <!-- 服务小项 -->
  56. <view class="ss-flex-2 event-wrap" style="margin-top: 5rpx; flex-wrap: wrap">
  57. <view class="ss-flex-2" v-for="i in 4">
  58. <view class="event-box">舒缓疲劳{{ i }}</view>
  59. <view class="line-box"></view>
  60. </view>
  61. </view>
  62. <!-- 加减 -->
  63. <!-- <view class="ss-flex-2">
  64. <view class="ss-flex-1"></view>
  65. <view class="ss-flex-2 ss-col-center">
  66. <view @click="minusNumber($event, item)">
  67. <text class="textIcon icon-jianhao- count-icon"></text>
  68. </view>
  69. <view class="count-number">{{ item.number }}</view>
  70. <view @click="addNumber($event, item)">
  71. <text class="textIcon icon-jiahao- count-icon" style="color: #2dafd1"></text>
  72. </view>
  73. </view>
  74. </view> -->
  75. <!-- 价格以及预约 -->
  76. <view class="ss-flex-2 ss-col-center" style="margin-top: 10rpx">
  77. <view class="ss-flex-2 ss-col-center ss-row-center">
  78. <text class="textIcon icon-renminbi1688 icon-rmb"></text>
  79. <view class="maney-number-box">498.00</view>
  80. </view>
  81. <view class="ss-flex-1"></view>
  82. <view class="reservation-box" @click="placeOrder(item)">立即预约</view>
  83. </view>
  84. </view>
  85. </view>
  86. </scroll-view>
  87. </view>
  88. </view>
  89. </s-layout>
  90. </template>
  91. <script setup>
  92. import {
  93. reactive,
  94. ref
  95. } from 'vue';
  96. import {
  97. computed
  98. } from 'vue';
  99. import {
  100. onLoad,
  101. onPageScroll,
  102. onPullDownRefresh,
  103. onReady,
  104. onReachBottom,
  105. onShow,
  106. } from '@dcloudio/uni-app';
  107. import sheep from '@/sheep';
  108. import $share from '@/sheep/platform/share';
  109. // 隐藏原生tabBar
  110. uni.hideTabBar();
  111. // 返回首页
  112. const backPage = async () => {
  113. uni.reLaunch({
  114. url: '/pages/XDHome/homePage/homePage',
  115. });
  116. };
  117. // 搜索框
  118. const searchInfo = ref('');
  119. const onSearch = async (e) => {
  120. console.log(e, searchInfo.value, '搜索信息');
  121. };
  122. // 选择地址
  123. const address = ref(0);
  124. const range = ref([{
  125. value: 0,
  126. text: '华庭路橡树湾小区10-909',
  127. },
  128. {
  129. value: 1,
  130. text: '足球',
  131. },
  132. {
  133. value: 2,
  134. text: '游泳',
  135. },
  136. ]);
  137. const changeAddress = async (e) => {
  138. console.log(e, '获取地址信息');
  139. };
  140. // 项目列表
  141. const listData = ref([{
  142. id: 1,
  143. price: 240,
  144. allManey: 0,
  145. number: 0,
  146. },
  147. {
  148. id: 2,
  149. price: 220,
  150. allManey: 0,
  151. number: 0,
  152. },
  153. {
  154. id: 3,
  155. price: 270,
  156. allManey: 0,
  157. number: 0,
  158. },
  159. {
  160. id: 4,
  161. price: 499,
  162. allManey: 0,
  163. number: 0,
  164. },
  165. ]);
  166. // 每个项目的加减
  167. const minusNumber = async (e, item) => {
  168. item.number--;
  169. if (item.number <= 0) {
  170. item.number = 0;
  171. }
  172. };
  173. const addNumber = async (e, item) => {
  174. item.number++;
  175. if (item.number >= 5) {
  176. item.number = 5;
  177. }
  178. };
  179. //跳转到套餐详情
  180. const jumpPackage = async () => {
  181. uni.navigateTo({
  182. url: '/pages/XDHome/myFeat/Packages/Packages',
  183. });
  184. }
  185. // 预约下单
  186. const placeOrder = async (item) => {
  187. console.log(item, '传递的参数');
  188. uni.navigateTo({
  189. url: '/pages/XDHome/technician/reservationPlaceOrder/reservationPlaceOrder?item=',
  190. });
  191. };
  192. //获取顶部安全距离
  193. const app = uni.getSystemInfoSync();
  194. const bottomHeightOne = app.statusBarHeight + 'rpx';
  195. const bottomHeight = ref(bottomHeightOne);
  196. </script>
  197. <style scoped lang="scss">
  198. .mb-box {
  199. position: absolute;
  200. top: 10rpx;
  201. left: 100rpx;
  202. width: 440rpx;
  203. height: 150rpx;
  204. z-index: 9;
  205. }
  206. .reservation-box {
  207. font-size: 22rpx;
  208. background-color: #2ab0d5;
  209. padding: 5rpx 20rpx;
  210. color: #fff;
  211. border-radius: 5rpx;
  212. }
  213. .icon-rmb {
  214. font-size: 30rpx;
  215. color: #e60012;
  216. font-weight: 700;
  217. }
  218. .maney-number-box {
  219. font-size: 30rpx;
  220. color: #e60012;
  221. margin-left: 5rpx;
  222. padding-top: 5rpx;
  223. font-weight: 650;
  224. }
  225. .count-number {
  226. font-size: 24rpx;
  227. color: #555;
  228. padding-left: 10rpx;
  229. padding-right: 10rpx;
  230. box-sizing: border-box;
  231. }
  232. .count-icon {
  233. font-size: 30rpx;
  234. color: #999;
  235. }
  236. .line-box {
  237. width: 2rpx;
  238. height: 30rpx;
  239. background-color: #d2d3d5;
  240. margin-left: 10rpx;
  241. margin-right: 10rpx;
  242. }
  243. .event-box {
  244. font-size: 22rpx;
  245. color: #909295;
  246. height: 30rpx;
  247. line-height: 30rpx;
  248. box-sizing: border-box;
  249. }
  250. .event-wrap {
  251. width: 100%;
  252. max-height: 60rpx;
  253. min-height: 60rpx;
  254. overflow-y: auto;
  255. }
  256. .icon-navigation {
  257. font-size: 32rpx;
  258. color: #fff;
  259. font-weight: 700;
  260. }
  261. // 上中下布局样式
  262. .body {
  263. display: flex;
  264. flex-direction: column;
  265. height: calc(100vh - 50px);
  266. background: linear-gradient(to bottom, #08a3e9, #f8fcff);
  267. box-sizing: border-box;
  268. }
  269. // 中部滚动
  270. .list-wrap {
  271. flex-grow: 1;
  272. position: relative;
  273. width: 95%;
  274. margin-left: 2.5%;
  275. box-sizing: border-box;
  276. }
  277. .list {
  278. position: absolute;
  279. top: 0;
  280. left: 0;
  281. right: 0;
  282. bottom: 50rpx;
  283. padding: 10rpx;
  284. border-radius: 15rpx;
  285. background-color: #fff;
  286. box-sizing: border-box;
  287. }
  288. .list-scroll-view {
  289. position: relative;
  290. display: flex;
  291. flex-direction: row;
  292. flex-wrap: nowrap;
  293. width: 100%;
  294. padding-bottom: 20rpx;
  295. margin-bottom: 20rpx;
  296. border-bottom: 1rpx solid #999ba2;
  297. box-sizing: border-box;
  298. }
  299. .course-card {
  300. width: 47vw;
  301. margin-top: 10px;
  302. margin-bottom: 10px;
  303. }
  304. // 底部
  305. .tools {
  306. display: flex;
  307. flex-direction: row;
  308. justify-content: space-between;
  309. }
  310. .tools-item {
  311. width: 45px;
  312. text-align: center;
  313. font-size: 14px;
  314. padding: 20px;
  315. }
  316. </style>
  317. <style scoped>
  318. /deep/.uni-select__input-text {
  319. font-size: 22rpx !important;
  320. color: #fff !important;
  321. }
  322. /deep/uni-slider .uni-slider-handle-wrapper {
  323. height: 18rpx !important;
  324. }
  325. .distance {
  326. /deep/.uni-select__input-text {
  327. width: 130rpx;
  328. color: #fff;
  329. overflow: hidden;
  330. white-space: nowrap;
  331. text-overflow: ellipsis;
  332. font-size: 24rpx;
  333. text-align: right;
  334. }
  335. }
  336. /deep/.uni-select__input-text {
  337. width: 180rpx;
  338. color: #fff;
  339. overflow: hidden;
  340. white-space: nowrap;
  341. text-overflow: ellipsis;
  342. font-size: 24rpx;
  343. text-align: right;
  344. }
  345. /deep/.uni-searchbar__box {
  346. height: 100% !important;
  347. }
  348. /deep/.uni-select {
  349. border: none !important;
  350. padding-left: 0rpx;
  351. }
  352. </style>