|
|
- <template>
- <view :class="['page__view', hasPoster ? 'with-bottom' : '']">
-
- <!-- 导航栏 -->
- <navbar :title="details.title" leftClick @leftClick="$utils.navigateBack" />
-
- <view class="cover-image" :style="{ height: coverImageHeight }">
- <image class="img" :src="details.image" mode="scaleToFill" ></image>
- <view class="shadow"></view>
- </view>
- <view class="page-title">
- <view>{{ details.title }}</view>
- <view class="page-title-line"></view>
- </view>
-
- <view class="section" v-if="details.cotentModuleOne">
- <view class="section-header">
- <view>{{ details.titleModuleOne }}</view>
- </view>
- <view class="section-content">
- <view class="paragraph">
- <uv-parse :content="details.cotentModuleOne"></uv-parse>
- </view>
- </view>
- </view>
- <view class="section" v-if="details.cotentModuleTwo">
- <view class="section-header">
- <view>{{ details.titleModuleTwo }}</view>
- </view>
- <view class="section-content">
- <view class="paragraph">
- <uv-parse :content="details.cotentModuleTwo"></uv-parse>
- </view>
- </view>
- </view>
- <view class="section" v-if="details.cotentModuleThree">
- <view class="section-header">
- <view>{{ details.titleModuleThree }}</view>
- </view>
- <view class="section-content">
- <view class="paragraph">
- <uv-parse :content="details.cotentModuleThree"></uv-parse>
- </view>
- </view>
- </view>
- <view class="section" v-if="details.educationExcelOneList && details.educationExcelOneList.length">
- <view class="section-header">
- <view>{{ details.titleExcelOne }}</view>
- </view>
- <view class="section-content">
- <uv-read-more show-height="300rpx" :toggle="true" textIndent="0" closeText="展开" :shadowStyle="{ backgroundImage: 'linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)', paddingTop: '100rpx', marginTop: '-100rpx' }">
- <view class="table">
- <view class="table-row" v-for="row in details.educationExcelOneList" :key="row.id">
- <view class="table-cell">{{ row.columnOne }}</view>
- <view class="table-cell">{{ row.columnTwo }}</view>
- </view>
- </view>
- </uv-read-more>
- </view>
- </view>
- <view class="section" v-if="details.cotentModuleFour">
- <view class="section-header">
- <view>{{ details.titleModuleFour }}</view>
- </view>
- <view class="section-content">
- <view class="paragraph">
- <uv-parse :content="details.cotentModuleFour"></uv-parse>
- </view>
- </view>
- </view>
- <view class="section" v-if="details.cotentModuleFive">
- <view class="section-header">
- <view>{{ details.titleModuleFive }}</view>
- </view>
- <view class="section-content">
- <view class="paragraph">
- <uv-parse :content="details.cotentModuleFive"></uv-parse>
- </view>
- </view>
- </view>
- <view class="section" v-if="details.educationExcelTwoList && details.educationExcelTwoList.length">
- <view class="section-header">
- <view>{{ details.titleExcelTwo }}</view>
- </view>
- <view class="section-content">
- <uv-read-more show-height="300rpx" :toggle="true" textIndent="0" closeText="展开" :shadowStyle="{ backgroundImage: 'linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)', paddingTop: '100rpx', marginTop: '-100rpx' }">
- <view class="table">
- <view class="table-row" v-for="row in details.educationExcelTwoList" :key="row.id">
- <view class="table-cell">{{ row.columnOne }}</view>
- <view class="table-cell">{{ row.columnTwo }}</view>
- </view>
- </view>
- </uv-read-more>
- </view>
- </view>
- <view class="section" v-if="details.cotentModuleSix">
- <view class="section-header">
- <view>{{ details.titleModuleSix }}</view>
- </view>
- <view class="section-content">
- <view class="paragraph">
- <uv-parse :content="details.cotentModuleSix"></uv-parse>
- </view>
- </view>
- </view>
- <view class="section" v-if="details.cotentModuleSeven">
- <view class="section-header">
- <view>{{ details.titleModuleSeven }}</view>
- </view>
- <view class="section-content">
- <view class="paragraph">
- <uv-parse :content="details.cotentModuleSeven"></uv-parse>
- </view>
- </view>
- </view>
-
- <!-- 附加材料 -->
- <view class="section" v-if="details.educationDocumentTwoList && details.educationDocumentTwoList.length">
- <view class="section-header">
- <view class="section-header-line"></view>
- <view>附加材料</view>
- </view>
- <view class="section-content attachment">
- <view class="flex file" v-for="item in details.educationDocumentTwoList" :key="item.id">
- <view class="file-info">
- <template v-if="item.type == 'pdf'">
- <image class="file-icon" src="@/static/image/icon-pdf.png" mode="widthFix"></image>
- </template>
- <template v-else>
- <image class="file-icon" src="@/static/image/icon-word.png" mode="widthFix"></image>
- </template>
- <view class="file-detail">
- <view class="title">{{ item.title }}</view>
- <!-- <view class="desc">{{ `${getFileType(item.document)} ${item.size || '-'}MB` }}</view> -->
- </view>
- </view>
- <button class="btn" @click="downloadFile(item.document)">下载</button>
- </view>
- </view>
- </view>
-
- <view class="flex bottom" v-if="hasPoster">
- <view class="flex btns">
- <button class="btn" @click="jumpToPoster">保存海报</button>
- <button class="btn btn-share" open-type="share">分享文章</button>
- </view>
- </view>
- </view>
- </template>
-
- <script>
- export default {
- data() {
- return {
- details: {},
- coverImageHeight: '848rpx',
- }
- },
- onLoad({ thesisId }) {
-
- const windowWidth = uni.getSystemInfoSync().windowWidth
- this.coverImageHeight = `${(windowWidth) * 848 / 714}px`
-
- this.getData(thesisId)
- },
- onShareAppMessage(res) {
- return {
- title: this.posterData.paperDesc,
- imageUrl: this.posterData.paperImage,
- path: this.posterData.path,
- }
- },
- computed: {
- posterData() {
- const { id, title, image, paperDesc, paperImage } = this.details || {}
-
- return {
- paperDesc: paperDesc || title,
- paperImage: paperImage || image || '',
- path: `pages_order/thesis/index?thesisId=${id}`
- }
- },
- hasPoster() {
- const { paperImage } = this.details || {}
-
- return !!paperImage
- }
- },
- methods: {
- async getData(thesisId) {
-
- try {
- this.details = await this.$fetch('queryThesisTwoById', { thesisId })
- } catch (err) {
-
- }
-
- },
- getFileType(fileName) {
- const pdfReg = /(.pdf)$/g
- // const officeReg = /(doc|docx|ppt|pptx|xls|xlsx)$/g
-
- return pdfReg.test(fileName) ? 'pdf' : ''
- },
- downloadFile(url) {
- console.log('downloadFile', url)
- uni.downloadFile({
- url, // 文件地址
- success: (downloadRes) => {
- console.log('downloadRes', downloadRes)
- if (downloadRes.statusCode === 200) {
- uni.openDocument({
- showMenu: true,
- filePath: downloadRes.tempFilePath,
- success: () => console.log('打开成功')
- });
- } else {
- uni.showToast({ title: '下载失败', icon: 'none' });
- }
- },
- fail: (err) => {
- console.log('downloadFile fail', err)
- uni.showToast({ title: '网络异常', icon: 'none' });
- }
- });
- },
- jumpToPoster() {
- uni.setStorageSync('posterData', this.posterData)
-
- uni.navigateTo({
- url: `/pages_order/thesis/poster`
- })
- },
- },
- }
- </script>
-
- <style scoped lang="scss">
-
- .page__view {
- background: #FFFFFF;
- padding-bottom: 62rpx;
-
- &.with-bottom {
- padding-bottom: calc(62rpx + 110rpx + env(safe-area-inset-bottom));
- }
- }
-
- .cover-image {
- position: relative;
- width: 100%;
- background: #FFFFFF;
-
- .img {
- width: 100%;
- height: 100%;
- }
-
- .shadow {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- // background: linear-gradient(transparent, #FFFFFF);
- background: linear-gradient(transparent, #FFFFFF 90%, #FFFFFF);
- }
- }
-
- .page-title {
- position: absolute;
- padding: 0 36rpx;
- transform: translateY(-100%);
- font-size: 60rpx;
- font-weight: 700;
- color: #4783F9;
-
- &-line {
- margin: 12rpx 0 24rpx 0;
- width: 120rpx;
- height: 8rpx;
- background: #4783F9;
- }
- }
-
- .section {
- width: 100%;
- padding: 0 18rpx;
- box-sizing: border-box;
-
- & + & {
- margin-top: 40rpx;
- }
-
- &-header {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- column-gap: 15rpx;
- padding-left: 18rpx;
- font-size: 32rpx;
- font-weight: 700;
- color: #000000;
-
- &-line {
- width: 11rpx;
- height: 45rpx;
- border-radius: 6rpx;
- background-image: linear-gradient(#FFFFFF, #4883F9);
- }
- }
-
- &-content {
- margin-top: 37rpx;
-
- .paragraph {
- width: 100%;
- padding: 22rpx;
- box-sizing: border-box;
- white-space: pre-line;
- font-size: 28rpx;
- color: #000000;
- background: #F8F8F8;
- border-radius: 15rpx;
- }
-
- .table {
- width: 100%;
- border-radius: 15rpx;
- overflow: hidden;
-
- &-row {
- display: grid;
- grid-template-columns: 218rpx auto;
- background: #EEEEEE;
-
- &:nth-child(2n) {
- background: #DEDEDE;
- }
- }
-
- &-cell {
- display: inline-flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: center;
- padding: 17rpx;
- box-sizing: border-box;
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- white-space: pre-wrap;
- color: #080808;
-
- &:first-child {
- border-right: 1rpx solid #E5E5E5;
- }
- }
-
- }
-
- /deep/ .uv-read-more__toggle {
- justify-content: flex-end;
- }
- /deep/ .uv-read-more__toggle__text .uv-text__value {
- color: $uni-color !important;
- font-size: 22rpx !important;
- }
-
- &.attachment {
-
- .file {
- justify-content: space-between;
- padding: 32rpx 15rpx 32rpx 26rpx;
- background: #f8f8f8;
- border-radius: 15rpx;
-
- &-info {
- display: flex;
- // align-items: flex-end;
- align-items: center;
- }
-
- &-icon {
- width: 64rpx;
- height: auto;
- }
-
- &-detail {
- margin-left: 14rpx;
-
- .title {
- font-size: 30rpx;
- color: #000000;
- }
-
- .desc {
- font-size: 28rpx;
- color: #999999;
- }
-
- }
-
- .btn {
- padding: 7rpx 30rpx;
- font-size: 28rpx;
- color: #FFFFFF;
- background: #4883f9;
- border-radius: 27rpx;
- }
- }
-
- .file + .file {
- margin-top: 21rpx;
- }
-
- }
- }
- }
-
- .bottom {
- position: fixed;
- left: 0;
- bottom: 0;
- width: 100vw;
- height: 110rpx;
- padding-bottom: env(safe-area-inset-bottom);
- background: #FFFFFF;
- box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
-
- .btns {
- column-gap: 34rpx;
- }
-
- .btn {
- padding: 20rpx 90rpx;
- font-size: 28rpx;
- color: #FFFFFF;
- background: #4883F9;
- border-radius: 42rpx;
-
- &-share {
- background: #FFD019;
- }
-
- }
-
- }
-
- </style>
|