This commit is contained in:
徐哼唧L
2024-02-26 09:05:13 +08:00
4 changed files with 233 additions and 0 deletions

View File

@@ -564,6 +564,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/medicaldes/recordDetail",
"style": {
"navigationBarTitleText": "纪实详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/medicaldes/video",
"style": {

View File

@@ -56,6 +56,12 @@
<view :class="['titleItem']">{{item.name}}</view>
</u-grid-item>
</u-grid>
<u-grid :col="1" v-if="titleList.length > 0&&curOneCateIndex==3">
<u-grid-item v-for="(item, index) in titleList" :key="item.id" @click="gotoDetail(item)"
style="align-items: flex-start;border-bottom: 2px solid #fff;">
<view :class="['titleItem']">{{item.title}}</view>
</u-grid-item>
</u-grid>
<view :col="1" v-if="titleList.length > 0&&curOneCateIndex==1">
<view v-for="(item, index) in titleList" :key="item.id" @click="gotoDetail(item)"
style="align-items: flex-start;border-bottom: 2px solid #fff;display: flex;padding: 20rpx 0;">
@@ -117,6 +123,9 @@
}, {
title: "吴门之光",
type: 'lightType'
}, {
title: "吴门纪实",
type: 'recordType'
}], // 一级分类标题1
twoCateList: [], // 二级分类标题
titleList: [], // 方剂标题
@@ -201,6 +210,13 @@
})
return
}
if (this.curOneCateIndex == 3) {
console.log('111', item)
uni.navigateTo({
url: "./recordDetail?id=" + item.id
})
return
}
},
// 获取名称
getTitles(dictType) {
@@ -282,6 +298,30 @@
console.log(e)
})
}
if (this.curOneCateIndex == 3) {
$http.request({
url: "book/medicaldes/recordByType?type=" + dictType,
method: "POST",
data: {
// loadAnimate: 'none', // 请求加载动画
"limit": 1000,
"page": 1,
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
console.log(res, '内容获取成功')
if (res.code == 0 && res.result.length > 0) {
this.titleList = res.result
} else {
this.titleList = []
}
}).catch(e => {
this.titleList = []
console.log(e)
})
}
},
setTwoCateIndex(item, index) {
@@ -349,6 +389,18 @@
"dictValue": "吴门之徽"
}]
}
if (this.curOneCateIndex == 3) {
this.twoCateList = [{
'dictType': "1",
"dictValue": "学术贡献"
}, {
'dictType': "2",
"dictValue": "抗疫纪实"
}, {
'dictType': "3",
"dictValue": "吴门公益"
}]
}
this.getTitles(this.twoCateList[0].dictType)
} else {
this.twoCateList = []

View File

@@ -21,6 +21,11 @@
{{prescriptDetail.name}}
</view>
</uni-section>
<uni-section class="mb-10" titleFontSize="18px" title="城市" type="line"
v-if="prescriptDetail.city_name && prescriptDetail.city_name != ''">
<view class="item" v-html="prescriptDetail.city_name">
</view>
</uni-section>
<uni-section class="mb-10" titleFontSize="18px" title="详细介绍" type="line"
v-if="prescriptDetail.content && prescriptDetail.content != ''">
<view class="item" v-html="prescriptDetail.content">

View File

@@ -0,0 +1,169 @@
<template>
<view class="container">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="prescriptDetail.title"></z-nav-bar>
<view class="uni-margin-wrap"
v-if="prescriptDetail && prescriptDetail.images && prescriptDetail.images.length > 0">
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
:duration="duration">
<swiper-item v-for="(item, index) in prescriptDetail.images" :key="index">
<view class="swiper-item">
<image :src="item" mode="aspectFit" @click="previewImage(item)"></image>
</view>
</swiper-item>
</swiper>
</view>
<view class="contentBox">
<view class="content">
<uni-section class="mb-10" titleFontSize="18px" title="标题" type="line">
<view class="item">
{{prescriptDetail.title}}
</view>
</uni-section>
<uni-section class="mb-10" titleFontSize="18px" title="内容" type="line"
v-if="prescriptDetail.content && prescriptDetail.content != ''">
<view class="item" v-html="prescriptDetail.content">
</view>
</uni-section>
<!-- <uni-section class="mb-10" titleFontSize="18px" title="配伍" type="line">
<view class="item" v-if="prescriptDetail.compatibility && prescriptDetail.compatibility != ''" v-html="prescriptDetail.compatibility">
</view>
<view class="item" v-else>
暂无
</view>
</uni-section>
<uni-section class="mb-10" titleFontSize="18px" title="文献" type="line">
<view class="item" v-if="prescriptDetail.literature && prescriptDetail.literature != ''" v-html="prescriptDetail.literature">
</view>
<view class="item" v-else>
暂无
</view>
</uni-section> -->
</view>
</view>
<music-play :playData="playData"></music-play>
<!-- <z-navigation></z-navigation> -->
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
export default {
data() {
return {
playData: {},
prescriptDetail: {
images: []
},
id: null,
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 500,
}
},
onLoad(e) {
this.id = e.id
},
onShow() {
this.getDetail()
},
methods: {
// 放大图片
previewImage(url) {
console.log(url)
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ['很抱歉,暂不支持保存图片到本地'],
success: function(res) {
// console.log(res,'+++++')
}
}
});
},
// 方剂详情
getDetail() {
$http.request({
url: "book/medicaldes/getRecordById?id=" + this.id,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
// loadAnimate: 'none', // 请求加载动画
// 'prescriptId': this.prescriptId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
console.log(res, '内容获取成功')
if (res.code == 0) {
this.prescriptDetail = res.result
if (this.prescriptDetail.image) {
this.prescriptDetail.images = this.prescriptDetail.image.split(';');
}
}
}).catch(e => {
// this.titleList = []
console.log(e)
})
},
},
components: {
musicPlay
},
}
</script>
<style lang="scss" scoped>
.contentBox {
padding-bottom: 20rpx;
}
.mb-10 {
margin-bottom: 10px;
}
.content {
font-size: 28rpx;
}
.swiper-item {
image {
margin: 0 auto;
height: 250rpx;
}
}
.uni-margin-wrap {
margin-bottom: 20rpx;
padding-top: 20rpx;
background-color: #fff;
}
.container {
padding: 10rpx;
// background-color: #fff;
.item {
color: #666;
padding: 10rpx 20rpx;
padding-bottom: 20rpx;
line-height: 46rpx;
}
}
.flexbox {
display: flex;
}
/deep/ .uni-section-header__decoration.line {
background-color: #18bc37;
}
</style>