更新 调整首页结构

wenjuan
鹿和sa0ChunLuyu 1 year ago
parent fc73f4d96a
commit ebf7133e2f

@ -12,7 +12,7 @@ class HomeController extends Controller
// 获取配置更新时间 // 获取配置更新时间
public function config_version() public function config_version()
{ {
$version= DB::table('configs')->where(['label'=>'H5配置版本'])->first(); $version = DB::table('configs')->where(['label' => 'H5配置版本'])->first();
$version = $version->value; $version = $version->value;
return \Yz::Return(true, '获取成功', [ return \Yz::Return(true, '获取成功', [
'version' => $version 'version' => $version
@ -22,23 +22,22 @@ class HomeController extends Controller
// 获取配置更新时间 // 获取配置更新时间
public function config() public function config()
{ {
$hospitals=DB::table('hospitals') $hospitals = DB::table('hospitals')
->select("id","name","latitude","longitude","logo") ->select("id", "name", "latitude", "longitude", "logo")
->where(['status'=>1,'is_del'=>0])->get(); ->where(['status' => 1, 'is_del' => 0])->get();
if(count($hospitals)<1) return \Yz::echoError1(''); if (count($hospitals) < 1) return \Yz::echoError1('');
$db_config=DB::table('configs')->whereIn('label',['首页欢迎词','首页banner'])->get(); $db_config = DB::table('configs')->whereIn('label', ['首页欢迎词', '首页banner'])->get();
$config = [ $config = [
'hospital' => $hospitals 'hospital' => $hospitals,
// [[ // [[
// 'id' => 1, // 'id' => 1,
// 'name' => '秀英院区', // 'name' => '秀英院区',
// 'latitude' => '39.867671', // 'latitude' => '39.867671',
// 'longitude' => '119.514223', // 'longitude' => '119.514223',
// ]] // ]]
, 'tip' => $this->getValueByLabel($db_config, '首页欢迎词'),
'tip' => $this->getValueByLabel($db_config,'首页欢迎词'),
'logo' => $hospitals[0]->logo, 'logo' => $hospitals[0]->logo,
'banner' => $this->getValueByLabel($db_config,'首页banner'), 'banner' => $this->getValueByLabel($db_config, '首页banner'),
'order' => [[ 'order' => [[
'message' => '', 'message' => '',
'name' => '个人体检预约', 'name' => '个人体检预约',
@ -50,29 +49,16 @@ class HomeController extends Controller
'jump' => '/pages/main/combo/combo', 'jump' => '/pages/main/combo/combo',
'icon' => '/assets/h5/tuanjianyuyue.png' 'icon' => '/assets/h5/tuanjianyuyue.png'
]], ]],
'check' => [[ 'button' => [[[
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '报告查询', 'name' => '健康问卷',
'desc' => '查体检报告', 'jump' => '/pages/main/cjwt/cjwt',
'jump' => '/pages/main/check/check', 'icon' => '/assets/h5/changjianwenti.png'
'icon' => '/assets/h5/baogao.png'
], [ ], [
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '体检中心简介', 'name' => '预检咨询',
'desc' => '健康体检中心', 'jump' => '/pages/main/cjwt/cjwt',
'jump' => '/pages/main/desc/desc', 'icon' => '/assets/h5/changjianwenti.png'
'icon' => '/assets/h5/jianjie.png'
]],
'ad' => [
'title' => '6大体检套餐 5折',
'combo' => ['123', '234'],
'button' => '点击购买'
],
'more' => [[
'message' => '暂未开放',
'name' => '满意度调查',
'jump' => '/pages/main/myddc/myddc',
'icon' => '/assets/h5/manyidudiaocha.png'
], [ ], [
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '体检注意事项', 'name' => '体检注意事项',
@ -80,27 +66,27 @@ class HomeController extends Controller
'icon' => '/assets/h5/zhuyishixiang.png' 'icon' => '/assets/h5/zhuyishixiang.png'
], [ ], [
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '健康问卷', 'name' => '体检引导',
'jump' => '/pages/main/cjwt/cjwt', 'jump' => '/pages/main/cjwt/cjwt',
'icon' => '/assets/h5/changjianwenti.png' 'icon' => '/assets/h5/changjianwenti.png'
], [ ]], [[
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '预检咨询', 'name' => '解读报告',
'jump' => '/pages/main/cjwt/cjwt', 'jump' => '/pages/main/cjwt/cjwt',
'icon' => '/assets/h5/changjianwenti.png' 'icon' => '/assets/h5/changjianwenti.png'
], [ ], [
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '体检引导', 'name' => '健康指导',
'jump' => '/pages/main/cjwt/cjwt', 'jump' => '/pages/main/cjwt/cjwt',
'icon' => '/assets/h5/changjianwenti.png' 'icon' => '/assets/h5/changjianwenti.png'
], [ ], [
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '报告解读', 'name' => '满意度调查',
'jump' => '/pages/main/cjwt/cjwt', 'jump' => '/pages/main/myddc/myddc',
'icon' => '/assets/h5/changjianwenti.png' 'icon' => '/assets/h5/manyidudiaocha.png'
], [ ]], [[
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '健康指导', 'name' => '报告查询',
'jump' => '/pages/main/cjwt/cjwt', 'jump' => '/pages/main/cjwt/cjwt',
'icon' => '/assets/h5/changjianwenti.png' 'icon' => '/assets/h5/changjianwenti.png'
], [ ], [
@ -113,17 +99,19 @@ class HomeController extends Controller
'name' => '我的订单', 'name' => '我的订单',
'jump' => '/pages/main/cjwt/cjwt', 'jump' => '/pages/main/cjwt/cjwt',
'icon' => '/assets/h5/changjianwenti.png' 'icon' => '/assets/h5/changjianwenti.png'
]], ]]
],
'color' => true, 'color' => true,
]; ];
return \Yz::Return(true, '获取成功', [ return \Yz::Return(true, '获取成功', [
'config' => $config 'config' => $config
]); ]);
} }
//点击个检获取页面按钮 //点击个检获取页面按钮
public function GetGeJianButtonList() public function GetGeJianButtonList()
{ {
$list=[ $list = [
[ [
'message' => '暂未开放', 'message' => '暂未开放',
'name' => '检前健康评估', 'name' => '检前健康评估',
@ -143,10 +131,11 @@ class HomeController extends Controller
'icon' => '/assets/h5/zhuyishixiang.png' 'icon' => '/assets/h5/zhuyishixiang.png'
] ]
]; ];
return \Yz::Return(true,"查询完成",['button_list'=>$list]); return \Yz::Return(true, "查询完成", ['button_list' => $list]);
} }
function getValueByLabel($items, $label) { function getValueByLabel($items, $label)
{
foreach ($items as $item) { foreach ($items as $item) {
if ($item->label === $label) { if ($item->label === $label) {
return $item->value; return $item->value;

@ -219,30 +219,13 @@
</view> </view>
</view> </view>
</view> </view>
<view class="check_wrapper"> <view class="more_wrapper" v-for="(i,k) in $store.config.button">
<view @click="buttonClick(i)" class="check_item_wrapper" v-for="(i,k) in $store.config.check" :key="k"> <view @click="buttonClick(ii)" class="more_item_wrapper" v-for="(ii,ik) in i" :key="ik">
<view class="check_item_icon_wrapper">
<image :src="$image(i.icon)"></image>
</view>
<view class="check_item_name_wrapper">
{{ i.name }}
</view>
<view class="check_item_desc_wrapper">
{{ i.desc }}
</view>
</view>
</view>
<view v-if="!!$store.config.ad.title" class="ad_wrapper">
<view class="ad_title_wrapper">{{ $store.config.ad.title }}</view>
<view class="ad_button_wrapper">{{ $store.config.ad.button }}</view>
</view>
<view class="more_wrapper">
<view @click="buttonClick(i)" class="more_item_wrapper" v-for="(i,k) in $store.config.more" :key="k">
<view class="more_item_icon_wrapper"> <view class="more_item_icon_wrapper">
<image :src="$image(i.icon)"></image> <image :src="$image(ii.icon)"></image>
</view> </view>
<view class="more_item_name_wrapper"> <view class="more_item_name_wrapper">
{{ i.name }} {{ ii.name }}
</view> </view>
</view> </view>
</view> </view>
@ -484,8 +467,6 @@
.more_item_wrapper { .more_item_wrapper {
width: 170rpx; width: 170rpx;
height: 157rpx; height: 157rpx;
background: #FFFFFF;
border-radius: 9rpx;
} }
.more_wrapper { .more_wrapper {
@ -494,6 +475,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
background: #FFFFFF;
border-radius: 9rpx;
} }
.ad_wrapper { .ad_wrapper {

Loading…
Cancel
Save