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

main
yanzai 2 years ago
parent 0eb4c3225d
commit 375a31fa03

@ -307,7 +307,7 @@ class ComboItemController extends Controller
public function GetComboImageList(Request $request){
$hospital = $request->post('hospital');
$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([
'info' => $info
]);

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

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

@ -109,33 +109,33 @@
if (type === 1) nextClick(false)
if (type === 0) next_text.value = '下一步'
}
//
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(",")
// //
// 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)
})
}
// 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)
// })
// }
onShow(() => {
getComboImage()
// getComboImage()
getUserInfo()
HospitalExtraInfo('order_type')
HospitalExtraInfo('readme')
@ -145,7 +145,7 @@
<template>
<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">
<image mode="widthFix" :src="$url+item" />
</view>
@ -155,8 +155,8 @@
</view>
</view>
</view>
<view v-if="!!buy_info && (image_list.length==0 || is_show_image==false) ">
</view> -->
<view v-if="!!buy_info">
<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_tag_wrapper">
@ -606,8 +606,7 @@
}
.tututu image{
width: 100%;
}
.tu_button_main{
padding: 0rpx 20rpx;

@ -201,15 +201,20 @@
$store.buy_info.items = items_ids
$store.buy_info.group = ''
$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({
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>
<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>
</template>
<script setup>
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
onLoad((e)=>{
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
let downLoadOk = ref(false);
onLoad((e) => {
console.log(e)
tiao(e)
})
const tiao=(e)=>{
uni.downloadFile({
url: e.url,
success: function (res) {
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
success: function (res) {
console.log("打开文档成功");
wx.navigateBack({
delta: 1
})
},
});
},
});
// uni.navigateTo({
// url:'/pages/test/test'
// })
let filePath = ref('');
const tiao = (e) => {
console.log("开始下载")
uni.downloadFile({
url: e.url,
success: function(res) {
downLoadOk.value = true
filePath.value = res.tempFilePath;
},
});
}
const openfile = () => {
uni.openDocument({
filePath: filePath.value,
showMenu: true,
success: function(res) {
console.log("打开文档成功");
wx.navigateBack({
delta: 1
})
},
});
}
</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 = ''
onMounted(() => {
console.log('----------')
console.log(props.list)
if(props.list && props.list.list.length>0){
}else{
uni.$lu.toast("暂无报告可下载")
}
Env = uni.getSystemInfoSync().platform
console.log(Env)
})
@ -121,7 +126,7 @@
</view>
<view class="t_title">报告预览</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>
<view class="t_title">报告下载</view>

Loading…
Cancel
Save