调整流程,增加报告预览,下载,优化报告提示

main
yanzai 2 years ago
parent 0eb4c3225d
commit 375a31fa03

@ -307,7 +307,7 @@ class ComboItemController extends Controller
public function GetComboImageList(Request $request){ public function GetComboImageList(Request $request){
$hospital = $request->post('hospital'); $hospital = $request->post('hospital');
$combo = $request->post('combo'); $combo = $request->post('combo');
$info=DB::table('hospital_combo')->where(['hospital'=>$hospital,'combo_id'=>$combo])->first(); $info=DB::table('hospital_combo')->where(['hospital'=>$hospital,'combo_id'=>$combo])->where('imgs','<>','')->first();
return Yo::echo([ return Yo::echo([
'info' => $info 'info' => $info
]); ]);

@ -70,7 +70,7 @@ class HospitalController extends Controller
public function select_list() public function select_list()
{ {
Login::admin(); Login::admin();
$list = Hospital::where('del', 2)->get(); $list = Hospital::where('del', 2)->where('status',1)->get();
return Yo::echo([ return Yo::echo([
'list' => $list 'list' => $list
]); ]);

@ -9,7 +9,8 @@
"path": "pages/main/user/user", "path": "pages/main/user/user",
"style": { "style": {
"navigationBarTitleText": "我的", "navigationBarTitleText": "我的",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"navigationStyle": "custom"
} }
}, { }, {
@ -52,6 +53,15 @@
} }
} }
,{
"path" : "pages/main/combo/combo_image",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
], ],
"subPackages": [{ "subPackages": [{
"root": "pages/buy", "root": "pages/buy",

@ -109,33 +109,33 @@
if (type === 1) nextClick(false) if (type === 1) nextClick(false)
if (type === 0) next_text.value = '下一步' if (type === 0) next_text.value = '下一步'
} }
// // //
let image_list=ref([]) // let image_list=ref([])
let is_show_image=ref(false) // let is_show_image=ref(false)
const getComboImage=async()=>{ // const getComboImage=async()=>{
const response = await GetComboImageListAction({ // const response = await GetComboImageListAction({
hospital: $store.buy_info.hospital, // hospital: $store.buy_info.hospital,
combo:$store.buy_info.combo // combo:$store.buy_info.combo
}) // })
$response(response, () => { // $response(response, () => {
if(response.data.info){ // if(response.data.info){
let arr = response.data.info.imgs.split(",") // let arr = response.data.info.imgs.split(",")
arr.forEach(function(v,k){ // arr.forEach(function(v,k){
if(v != ""){ // if(v != ""){
image_list.value.push(v) // image_list.value.push(v)
is_show_image.value=true // is_show_image.value=true
} // }
}) // })
console.log( image_list.value) // console.log( image_list.value)
}else{ // }else{
image_list.value=[] // image_list.value=[]
} // }
console.log(image_list.value.length) // console.log(image_list.value.length)
}) // })
} // }
onShow(() => { onShow(() => {
getComboImage() // getComboImage()
getUserInfo() getUserInfo()
HospitalExtraInfo('order_type') HospitalExtraInfo('order_type')
HospitalExtraInfo('readme') HospitalExtraInfo('readme')
@ -145,7 +145,7 @@
<template> <template>
<view> <view>
<view class="top_line_wrapper"></view> <view class="top_line_wrapper"></view>
<view v-if="image_list.length>0 && is_show_image==true" class="tututu"> <!-- <view v-if="image_list.length>0 && is_show_image==true" class="tututu">
<view v-for="(item,index) in image_list" :key="index"> <view v-for="(item,index) in image_list" :key="index">
<image mode="widthFix" :src="$url+item" /> <image mode="widthFix" :src="$url+item" />
</view> </view>
@ -155,8 +155,8 @@
</view> </view>
</view> </view>
</view> </view> -->
<view v-if="!!buy_info && (image_list.length==0 || is_show_image==false) "> <view v-if="!!buy_info">
<view v-if="!!buy_info.combo" class="combo_info_wrapper"> <view v-if="!!buy_info.combo" class="combo_info_wrapper">
<view class="combo_info_name_wrapper">{{ buy_info.combo.name }}</view> <view class="combo_info_name_wrapper">{{ buy_info.combo.name }}</view>
<view class="combo_info_tag_wrapper"> <view class="combo_info_tag_wrapper">
@ -606,8 +606,7 @@
} }
.tututu image{ .tututu image{
width: 100%; width: 100%;
} }
.tu_button_main{ .tu_button_main{
padding: 0rpx 20rpx; padding: 0rpx 20rpx;

@ -201,15 +201,20 @@
$store.buy_info.items = items_ids $store.buy_info.items = items_ids
$store.buy_info.group = '' $store.buy_info.group = ''
$store.buy_info.time = time $store.buy_info.time = time
if ($store.buy_info.person.length === 0) { // if ($store.buy_info.person.length === 0) {
// uni.navigateTo({
// url: '/pages/buy/person/person?type=info'
// })
// } else {
// uni.navigateTo({
// url: '/pages/buy/info/info'
// })
// }
//
uni.navigateTo({ uni.navigateTo({
url: '/pages/buy/person/person?type=info' url: '/pages/main/combo/combo_image'
}) })
} else {
uni.navigateTo({
url: '/pages/buy/info/info'
})
}
} }
} }

@ -0,0 +1,111 @@
<template>
<view>
<view v-if="image_list.length>0 && is_show_image==true" class="tututu">
<view v-for="(item,index) in image_list" :key="index">
<image mode="widthFix" :src="$url+item" />
</view>
<view class="tu_button_main">
<view class="tu_button" @click="goto('1')">
下一步
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
GetComboImageListAction,
$url,
$image,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
const $store = useStore()
//
let image_list=ref([])
let is_show_image=ref(false)
const getComboImage=async()=>{
const response = await GetComboImageListAction({
hospital: $store.buy_info.hospital,
combo:$store.buy_info.combo
})
$response(response, () => {
if(response.data.info){
let arr = response.data.info.imgs.split(",")
arr.forEach(function(v,k){
if(v != ""){
image_list.value.push(v)
is_show_image.value=true
}
})
console.log( image_list.value)
}else{
image_list.value=[]
}
console.log(image_list.value.length)
if(image_list.value.length>0){
}else{
goto('noimage')
}
})
}
const goto=(type)=>{
if(type=='noimage'){
if ($store.buy_info.person.length === 0) {
uni.reLaunch({
url: '/pages/buy/person/person?type=info'
})
} else {
uni.reLaunch({
url: '/pages/buy/info/info'
})
}
}else{
if ($store.buy_info.person.length === 0) {
uni.navigateTo({
url: '/pages/buy/person/person?type=info'
})
} else {
uni.navigateTo({
url: '/pages/buy/info/info'
})
}
}
}
onShow(() => {
getComboImage()
})
</script>
<style scoped>
.tututu image{
width: 100%;
}
.tu_button_main{
padding: 0rpx 20rpx;
}
.tu_button{
position: fixed;
bottom: 60rpx;
border: 1px solid #5FCAEA;
padding:10rpx 0rpx;
height: 50rpx;
border-radius: 25rpx;
width:calc(100% - 40rpx) ;
text-align: center;
}
</style>

@ -1,44 +1,90 @@
<template> <template>
<view> <view>
正在加载请稍后... <view v-if="downLoadOk==false" class="loading">...</view>
<view v-else class="tishi">
<view class="tishi2">
<view>文档打开后</view>
<view>点击右上角按钮然后选择保存到手机即可下载</view>
</view>
<view class="ok" @click="openfile()">
我知道了,打开文档
</view>
</view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import {
ref ref
} from 'vue' } from 'vue'
import { import {
onLoad onLoad
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
onLoad((e)=>{ let downLoadOk = ref(false);
onLoad((e) => {
console.log(e) console.log(e)
tiao(e) tiao(e)
}) })
const tiao=(e)=>{ let filePath = ref('');
uni.downloadFile({ const tiao = (e) => {
url: e.url, console.log("开始下载")
success: function (res) { uni.downloadFile({
var filePath = res.tempFilePath; url: e.url,
uni.openDocument({ success: function(res) {
filePath: filePath, downLoadOk.value = true
success: function (res) { filePath.value = res.tempFilePath;
console.log("打开文档成功");
wx.navigateBack({ },
delta: 1 });
})
}, }
}); const openfile = () => {
}, uni.openDocument({
}); filePath: filePath.value,
// uni.navigateTo({ showMenu: true,
// url:'/pages/test/test' success: function(res) {
// }) console.log("打开文档成功");
wx.navigateBack({
delta: 1
})
},
});
} }
</script> </script>
<style> <style scoped>
.loading {
margin-top: 200rpx;
width: 100%;
text-align: center;
}
</style> .tishi {
width: 100%;
height: calc(100vh - 200rpx);
background-color: black;
opacity: 0.5;
color: #fff;
padding-top: 200rpx;
}
.tishi2 {
width: 50%;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.ok {
width: 50%;
margin-left: auto;
margin-right: auto;
text-align: center;
border: 1px solid #fff;
margin-top: 70%;
padding: 20rpx;
border-radius: 20rpx;
}
</style>

@ -92,7 +92,12 @@
} }
let Env = '' let Env = ''
onMounted(() => { onMounted(() => {
console.log('----------') console.log(props.list)
if(props.list && props.list.list.length>0){
}else{
uni.$lu.toast("暂无报告可下载")
}
Env = uni.getSystemInfoSync().platform Env = uni.getSystemInfoSync().platform
console.log(Env) console.log(Env)
}) })
@ -121,7 +126,7 @@
</view> </view>
<view class="t_title">报告预览</view> <view class="t_title">报告预览</view>
</view> </view>
<view class="t_row" @click="jianqieban(url)"> <view class="t_row" v-if="Env != 'android'" @click="jianqieban(url)">
<view class="t_logo"><uni-icons type="download-filled" color="#42b983" size="60rpx"></uni-icons> <view class="t_logo"><uni-icons type="download-filled" color="#42b983" size="60rpx"></uni-icons>
</view> </view>
<view class="t_title">报告下载</view> <view class="t_title">报告下载</view>

Loading…
Cancel
Save