Lou
2024-03-23 7bbaa4b3ec07c08f69b8551811f6bd067155d55b
投票更新
3 files modified
1 files added
88 ■■■■■ changed files
manifest.json patch | view | raw | blame | history
pages.json 9 ●●●●● patch | view | raw | blame | history
subPackage/article/detail.vue 33 ●●●● patch | view | raw | blame | history
subPackage/article/document.vue 46 ●●●●● patch | view | raw | blame | history
manifest.json
pages.json
@@ -259,6 +259,15 @@
                        "navigationBarBackgroundColor": "#fff",
                        "navigationBarTextStyle": "black"
                    }
                },
                {
                    "path": "document",
                    "style": {
                        "navigationBarTitleText": "附件",
                        "enablePullDownRefresh": false,
                        "navigationBarBackgroundColor": "#fff",
                        "navigationBarTextStyle": "black"
                    }
                }
            ]
        },
subPackage/article/detail.vue
@@ -67,14 +67,19 @@
                    <view class="vote bgc-ff">
                        <view class="mb-20" v-for="(item,index) in voteTopicList" :key="index">
                            <view class="vote-title">
                                <text v-if="item.mandatoryFlag == 1">*</text>
                                <text v-if="item.mandatoryFlag == 2">*</text>
                                <text class="f-30 fw">{{item.discussContent}}</text>
                                <text class="f-26 ml-10" v-if="item.optionRange == 0">(单选)</text>
                                <text class="f-26 ml-10" v-if="item.optionRange == 1 && !item.optionNumber">(多选)</text>
                                <text class="f-26 ml-10" v-if="item.optionRange == 1 && item.optionNumber>0">(多选
                                    {{`最多可选${item.optionNumber}项`}})</text>
                                <text class="f-26 ml-10" v-if="item.optionRange == 1 && item.optionNumber>0">
                                    (多选{{`最多可选${item.optionNumber}项`}})</text>
                            </view>
                            <view class="file-btn  bgc-main f-28" v-if="item.attachment"
                                @click="navToDocument(item.attachment)">
                                查看附件
                            </view>
                            <view class="" v-if="item.optionRange == 0">
                                <u-radio-group size="22" iconPlacement="right" activeColor="#017BFC" placement="column"
                                    v-model="item.selected" @change="selectOption($event,index)"
@@ -346,6 +351,7 @@
                        this.voteTopicList = data;
                        if (data.length == tempArr.length) {
                            this.isComplete = true;
                            this.setOptionDisable()
                        }
                    }
                })
@@ -444,8 +450,9 @@
                        i.houseCode = uni.getStorageSync("siteInfo").houseCode
                        i.signaturePath = signPath ? signPath : ""
                        arr.push(i)
                    } else if (!i.selected && i.mandatoryFlag) {
                    } else if (!i.selected && i.mandatoryFlag == 2) {
                        this.$showTips('必填议题请选择选项')
                        return;
                    }
                }
@@ -537,6 +544,13 @@
            sendValidationCode() {
            },
            navToDocument(url) {
                uni.navigateTo({
                    url: `document?url=${url}`
                })
            }
        }
@@ -773,4 +787,13 @@
    .mt-30 {
        margin-top: 30rpx;
    }
    .file-btn {
        width: 140rpx;
        padding: 10rpx 0;
        border-radius: 10rpx;
        color: #fff;
        margin-bottom: 20rpx;
        text-align: center;
    }
</style>
subPackage/article/document.vue
New file
@@ -0,0 +1,46 @@
<template>
    <view></view>
</template>
<script>
    import {
        minioBaseUrl
    } from "@/common/setting.js"
    export default {
        data() {
            return {
            }
        },
        onLoad(option) {
            this.showPdf(option.url)
        },
        methods: {
            showPdf(url) {
                //打开pdf文件
                wx.showLoading({
                    title: "加载中...",
                });
                wx.downloadFile({
                    url: `${minioBaseUrl}${url}`,
                    success: function(res) {
                        const filePath = res.tempFilePath;
                        wx.openDocument({
                            filePath: filePath,
                            success: function(res) {
                                wx.hideLoading();
                            },
                            fail: function(res) {
                                console.log("打开失败");
                            },
                        });
                    },
                });
            },
        }
    }
</script>
<style>
</style>