From ba482f80956480f99135e5655a00123106a34474 Mon Sep 17 00:00:00 2001 From: yanzai Date: Mon, 6 Jan 2025 23:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=88=97=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E5=A5=97=E9=A4=90=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/H5/ComboController.php | 66 +- h5/common/PriceRange.vue | 87 +- h5/pages.json | 7 + h5/pages/main/combo/combo_new.vue | 2198 +++++++++-------- h5/pages/main/tj/tjzx_new.vue | 590 +++++ h5/static/assets/buy/huomiao.jpg | Bin 0 -> 4580 bytes 6 files changed, 1857 insertions(+), 1091 deletions(-) create mode 100644 h5/pages/main/tj/tjzx_new.vue create mode 100644 h5/static/assets/buy/huomiao.jpg diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index 9f67f37..78a554a 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -48,6 +48,10 @@ class ComboController extends Controller $combo_item = $request->post('combo_item'); $checkup_type_id = $request->post('checkup_type_id'); $keshi_name=$request->post('keshi_name'); + $price_range=$request->post('price_range'); + $sort_price=$request->post('sort_price'); + $sort_sale_count=$request->post('sort_sale_count'); + $hospital = DB::table('hospitals')->select('id', 'name', 'address', 'latitude', 'longitude')->where(['id' => $hospital])->first(); $user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first(); @@ -59,7 +63,7 @@ class ComboController extends Controller $canshu = []; $canshu[]=$person->sex; $sql = ''; - if (isset($combo_price)) { + if (isset($combo_price) and !isset($price_range)) { $price_list = [ "1" => [0, 299], "2" => [300, 999], @@ -71,8 +75,13 @@ class ComboController extends Controller $sql = " and (a.price>=? and a.price<=?) "; $canshu[] = $price_list[$combo_price][0]; $canshu[] = $price_list[$combo_price][1]; - } + if (isset($price_range) and !isset($combo_price)) { + $sql = " and (a.price>=? and a.price<=?) "; + $canshu[] = $price_range[0]; + $canshu[] = $price_range[1]; + } + if(isset($checkup_type_id)){ $sql = $sql . " and a.checkup_type_id=? "; $canshu[] = $checkup_type_id; @@ -92,9 +101,12 @@ class ComboController extends Controller $sql = $sql . " and a.name like ? "; $canshu[] = '%'.$search.'%'; } - if (!isset($combo_sort)) { - $sql = $sql . " order by a.order "; - } + + if(isset($sort_price) and $sort_price==1) $combo_sort=3; + if(isset($sort_price) and $sort_price==2) $combo_sort=4; + if(isset($sort_sale_count) and $sort_sale_count==1) $combo_sort=7; + if(isset($sort_sale_count) and $sort_sale_count==2) $combo_sort=8; + if (isset($combo_sort)) { if ($combo_sort == 1) { $sql = $sql . " "; @@ -114,7 +126,15 @@ class ComboController extends Controller if ($combo_sort == 6) { $sql = $sql . " order by b.count "; } - + if ($combo_sort == 7) { + $sql = $sql . " order by a.sale_count "; + } + if ($combo_sort == 8) { + $sql = $sql . " order by a.sale_count desc"; + } + } + if (!isset($combo_sort)) { + $sql = $sql . " order by a.order "; } if(isset($keshi_name)){ $combo_ids=DB::table('combo_items')->where(['status'=>1,'keshi_name'=>$keshi_name]) ->pluck('combo_id')->toArray(); @@ -208,12 +228,46 @@ select combo_id as c_id,count(*) as count from combo_items where status in(1) gr 'id' => $doctor, 'name' => '张大夫' ]; + //获取套餐价格分布 + $step = 500; + $maxPrice = 20000 + $step; + $result=DB::select("SELECT FLOOR(price / ?) * ? AS price_range_start, COUNT(*) AS count + FROM combos + WHERE price >= 0 AND price < ? + GROUP BY price_range_start;",[$step,$step,$maxPrice]); + $price_ranges = []; + for ($i = 0; $i <= 20000; $i += $step) { + $price_ranges[$i] = 0; + } + foreach ($result as $row) { + if (isset($price_ranges[$row->price_range_start])) { + $price_ranges[$row->price_range_start] = $row->count; + } + } + $formatted_price_ranges = []; + $formatted_price_ranges[]=['start' => 0, + 'count' => 0]; + foreach ($price_ranges as $start => $count) { + // 如果你想包括结束值,可以添加 'end' 键,例如:'end' => $start + 99 + $formatted_price_ranges[] = [ + 'start' => $start, + 'count' => $count + ]; + } + $price_max_min=DB::select("SELECT + MAX(price) AS highest_price, + MIN(price) AS lowest_price +FROM combos;"); return \Yz::Return(true, '获取成功', [ 'list' => $combos, 'hospital' => $hospital_info, 'doctor' => $doctor_info, 'info' => $info, + 'price_range' => $formatted_price_ranges, + 'price_max_min' =>isset($price_range)?$price_range:[0,$maxPrice], + 'price_max' =>$maxPrice, + 'step' => $step, ]); } diff --git a/h5/common/PriceRange.vue b/h5/common/PriceRange.vue index 5f57210..fee6c53 100644 --- a/h5/common/PriceRange.vue +++ b/h5/common/PriceRange.vue @@ -2,18 +2,18 @@ - 折线图 + ¥{{rang0}} ¥{{rang1}} - + - + @@ -23,13 +23,66 @@ + .select_done_wrapper { + color: #ffffff; + background: #239ea3; + width: calc(100% - 60rpx); + margin: 50rpx auto 0; + height: 50rpx; + line-height: 50rpx; + text-align: center; + border-radius: 6rpx; + } + + .select_group_item_wrapper { + padding: 10rpx 20rpx; + border: 1rpx solid #239ea3; + font-size: 22rpx; + margin: 20rpx 20rpx 0 0; + border-radius: 6rpx; + color: #239ea3; + } + + .select_group_item_wrapper.active { + color: #ffffff; + background: #239ea3; + } + + .select_group_line_wrapper { + display: flex; + align-items: center; + flex-wrap: wrap; + } + + .select_group_wrapper { + margin: 20rpx; + } + + .list_wrapper { + padding-top: 30rpx; + height: calc(100vh - 100rpx - 10rpx - 70rpx - 80rpx - 30rpx - 30rpx); + width: 750rpx; + overflow-y: auto; + padding-bottom: 30rpx; + margin: 0 auto; + overflow-x: hidden; + -ms-overflow-style: none; + scrollbar-width: none; + overflow: -moz-scrollbars-none; + overflow-y: scroll; + background-color: #fff; + } + + .list_wrapper::-webkit-scrollbar { + display: none; + } + + .combo_line_wrapper { + width: 710rpx; + height: 1rpx; + background: #e1ecee; + margin: 26rpx 0rpx 0rpx 0; + } + + .combo_pick_button_wrapper { + width: 160rpx; + height: 60rpx; + background: #e1ecee; + border-radius: 30rpx; + font-weight: 400; + font-size: 28rpx; + color: #239ea3; + text-align: center; + line-height: 60rpx; + } + + .combo_buy_button_wrapper { + width: 160rpx; + height: 60rpx; + background: #239ea3; + border-radius: 30rpx; + font-weight: 400; + font-size: 28rpx; + color: #ffffff; + text-align: center; + line-height: 60rpx; + } + + .combo_button_wrapper { + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; + + } + + .combo_count_wrapper { + font-weight: 500; + font-size: 18rpx; + color: #8b8b8b; + line-height: 1; + } + + .combo_original_price_wrapper { + font-weight: 500; + font-size: 18rpx; + color: #8b8b8b; + line-height: 1; + text-decoration-line: line-through; + margin-left: 10rpx; + } + + .combo_true_price_wrapper { + font-weight: 500; + font-size: 18rpx; + color: #ec3d15; + line-height: 1; + } + + .combo_true_price_number_wrapper { + font-size: 38rpx; + } + + .combo_price_wrapper { + display: flex; + align-items: end; + justify-content: space-between; + margin-top: 21rpx; + } + + .combo_price_box_wrapper { + display: flex; + align-items: end; + } + + .combo_wrapper { + /* height: 196rpx; */ + width: calc(750rpx - 80rpx); + margin: 0 auto; + background-color: #fff; + padding: 0rpx 40rpx 30rpx 40rpx; + } + + .combo_tags_wrapper { + display: flex; + align-items: center; + margin-top: 13rpx; + } + + .combo_desc_wrapper { + font-weight: 500; + font-size: 20rpx; + color: #8b8b8b; + line-height: 1; + margin-top: 18rpx; + } + + .combo_tag_wrapper { + padding-left: 13rpx; + padding-right: 13rpx; + height: 30rpx; + line-height: 30rpx; + border-radius: 5rpx; + font-weight: 400; + font-size: 18rpx; + color: #47abd8; + margin: 10rpx 8rpx 10rpx 0rpx; + border: 1rpx solid #009da5; + } + + .combo_name_wrapper { + font-weight: 400; + font-size: 32rpx; + color: #0e0e0e; + line-height: 32rpx; + + } + + .combo_content_wrapper { + margin-left: 30rpx; + width: calc(750rpx - 190rpx - 30rpx - 20rpx - 55rpx); + } + + .combo_info_wrapper { + display: flex; + align-items: center; + width: 750rpx; + margin: 0 auto; + } + + .combo_cover_wrapper { + width: 190rpx; + height: 190rpx; + margin-left: 20rpx; + } + + .combo_cover_wrapper image { + width: 190rpx; + height: 190rpx; + display: block; + object-fit: contain; + } + + .select_item_line_wrapper { + position: absolute; + width: 95rpx; + height: 10rpx; + background: linear-gradient(to bottom, #ffffff00, #1b9a9f); + border-radius: 5rpx; + bottom: 0; + left: 50%; + transform: translateX(calc(-50% - 8px)); + opacity: 0; + } + + .select_wrapper { + display: flex; + align-items: center; + justify-content: space-between; + width: 750rpx; + height: 80rpx; + background: #eef7f7; + box-shadow: 0rpx -1rpx 1rpx 0rpx rgba(0, 0, 0, 0.1); + margin: 0 auto; + position: relative; + z-index: 999; + } + + .select_item_icon_wrapper { + width: 18rpx; + height: 9rpx; + margin-left: 9rpx; + filter: grayscale(100%); + } + + .select_item_icon_wrapper image { + width: 18rpx; + height: 9rpx; + display: block; + object-fit: contain; + } + + .select_item_icon2_wrapper { + width: 26rpx; + height: 23rpx; + margin-left: 7rpx; + } + + .select_item_icon2_wrapper image { + width: 26rpx; + height: 23rpx; + display: block; + object-fit: contain; + } + + .select_item_name_wrapper { + font-weight: 400; + font-size: 26rpx; + color: #2f2f2f; + line-height: 1; + } + + .select_item_wrapper { + width: 25%; + display: flex; + align-items: center; + justify-content: center; + position: relative; + height: 80rpx; + } + + .select_item_wrapper.active .select_item_name_wrapper { + color: #239ea3; + font-weight: bold; + } + + .select_item_wrapper.active .select_item_icon_wrapper { + filter: grayscale(0%); + } + + .select_item_wrapper.active .select_item_line_wrapper { + opacity: 1; + } + + .doctor_name_wrapper { + font-weight: 400; + font-size: 24rpx; + line-height: 1; + color: #ffffff; + border-bottom: 1rpx solid #ffffff; + } + + .doctor_tip_wrapper { + font-weight: 400; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + } + + .doctor_wrapper { + display: flex; + align-items: center; + width: 710rpx; + height: 70rpx; + background: #239ea3; + border-radius: 15rpx 15rpx 0rpx 0rpx; + padding-left: 24rpx; + } + + .user_choose_wrapper { + width: 50rpx; + height: 50rpx; + margin-left: 30rpx; + } + + .user_choose_wrapper image { + width: 50rpx; + height: 50rpx; + display: block; + object-fit: contain; + } + + .user_title_wrapper { + font-weight: 400; + font-size: 26rpx; + color: #fff; + line-height: 1; + } + + .user_name_wrapper { + font-weight: 400; + font-size: 26rpx; + color: #fff; + line-height: 1; + } + + .user_wrapper { + height: 80rpx; + padding-left: 40rpx; + padding-right: 20rpx; + margin-right: 20rpx; + background: #009ea7; + border-radius: 40rpx; + display: flex; + align-items: center; + justify-content: center; + } + + .header_wrapper { + display: flex; + align-items: center; + justify-content: space-between; + width: 710rpx; + height: 100rpx; + background: #d8edf2; + margin: 0 auto; + position: relative; + z-index: 999; + background-color: #fff; + margin-left: 20rpx; + margin-right: 20rpx; + border-radius: 20rpx; + } + + .hospital_wrapper { + display: flex; + align-items: center; + width: 40%; + } + + .hospital_icon_wrapper { + width: 48rpx; + height: 48rpx; + margin-left: 20rpx; + } + + .hospital_icon_wrapper image { + width: 48rpx; + height: 48rpx; + display: block; + object-fit: contain; + } + + .hospital_name_wrapper { + font-weight: 400; + font-size: 28rpx; + color: #484747; + margin-left: 9rpx; + line-height: 1; + } + + .hospital_select_wrapper { + width: 24rpx; + height: 14rpx; + margin-left: 19rpx; + } + + .hospital_select_wrapper image { + width: 24rpx; + height: 14rpx; + display: block; + object-fit: contain; + } + + .popup_new_main { + background-color: #fff; + border-radius: 0rpx 0rpx 20rpx 20rpx; + padding: 40rpx 20rpx 20rpx 20rpx; + } + + .top_button_row { + display: flex; + justify-content: space-between; + padding-left: 20rpx; + padding-right: 20rpx; + } + + .top_button { + color: #666; + background-color: #fff; + padding: 6rpx 40rpx; + border-radius: 15rpx; + margin-top: -6rpx; + margin-bottom: 8rpx; + font-size: 28rpx; + width: 140rpx; + text-align: center; + } + + .top_button_active { + background-color: #009ea7; + color: #fff; + } + + .search {} + + .shaixuan_title { + font-size: 26rpx; + margin-top: 20rpx; + margin-bottom: 10rpx; + } + + .shaixuan_button { + font-size: 24rpx; + padding-left: 10rpx; + background-color: #ccc; + margin: 10rpx; + padding: 5rpx 10rpx; + border-radius: 5rpx; + background-color: #f3f3f3; + color: #1e1a19; + } + .shaixuan_button_active{ + background-color: #009da5; + color: #fff; + } + \ No newline at end of file diff --git a/h5/pages/main/tj/tjzx_new.vue b/h5/pages/main/tj/tjzx_new.vue new file mode 100644 index 0000000..d88f219 --- /dev/null +++ b/h5/pages/main/tj/tjzx_new.vue @@ -0,0 +1,590 @@ + + + diff --git a/h5/static/assets/buy/huomiao.jpg b/h5/static/assets/buy/huomiao.jpg new file mode 100644 index 0000000000000000000000000000000000000000..24fe9647e73f4d857d2014dcda653919eb46090f GIT binary patch literal 4580 zcma)8c{tSH_n%>mwd~3g(@cb7#@MGJYbawUdtqiWF*D4JeXArzgpw>R2pQRukg=~Z zA*8Y|6`gu7g4dSS{#TRSW{-qmT0>7za~u*1={r9>HE7npo&bZ3sFL z6-e|U;%IJ=K%zH^iVD<%{w7E5+I!1zDCD;b%}WcayB8H=kFkL0lPNferXoVY1A#z5 z)HM~A)RjDt>UcNz;}9eQiG(9G;7V!=NF+*G6{VsC`9q+)0V!BK%F5u>AK`XqTF^hv z6%Y`h7@(|3rd)t4X=-Z15lA=^sj%yzKn)_%+yWIyRM?*k1~{q*h2TRYkV%j|MmKk| zA59Coo9us2LG<~H_J5Y^AC4Hz|Lsa7?$zKoEtO`4`#azNNldi~^1;Eaa8$A%#RIqN z4%-9!p!6v?HyW8@LneFwSx5^{GL202B>O;+DvAh*>{$W{OAesQ{RUt#C=(Ku=0@_s znHXq6cPSJJ1T0EPNy$)MPu)OYU)f;SJf)#wpsuf>s;sQ1j?`1uQ2rBZK=$w>;z+bV zvDm+{hX0D)YX_pwZe#--h2W3Fo}!S6kl$xU5&k_Fy?^EV1B?ClT=f4H3*Su!zIU_# zxamKacH3vq{Ht|$Cx10RjTtezE0kX5R@8j8bkdN=6 zm@vPv*k2p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