xiaohaizhao 1 年之前
父節點
當前提交
f8bc99bb65

+ 1 - 1
components/My_listbox.vue

@@ -8,7 +8,7 @@
             <view id="header">
                 <slot />
             </view>
-            <view v-if="empty">
+            <view v-if="isShowEmpty && empty">
                 <view :style="{ height: tovw(occupyHeight) }" />
                 <u-empty :mode="mode" text="暂无数据" />
             </view>

+ 53 - 0
components/floatBut.vue

@@ -0,0 +1,53 @@
+<template>
+    <view class="float-but" hover-class="navigator-hover" :style="{ 'z-index': zIndex }" @click.stop="click1">
+        {{ text }}
+    </view>
+</template>
+
+<script>
+
+export default {
+    name: "floatBut",
+    props: {
+        text: {
+            type: String,
+            default: "上传"
+        },
+        onClick: {
+            type: Function
+        },
+        zIndex: {
+            type: [String, Number],
+            default: 99
+        }
+    },
+    data() {
+        return {
+
+        }
+    },
+    methods: {
+        click1() {
+            this.$emit("onClick")
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.float-but {
+    position: fixed;
+    bottom: 120px;
+    right: 10px;
+    width: 56px;
+    height: 56px;
+    line-height: 56px;
+    text-align: center;
+    background: radial-gradient(100% 0% at 50% 50%, #E2041E 0%, #C30D23 100%);
+    border-radius: 50%;
+    font-family: Source Han Sans SC, Source Han Sans SC;
+    font-weight: bold;
+    font-size: 16px;
+    color: #FFFFFF;
+}
+</style>

+ 9 - 0
components/my-upload.vue

@@ -29,6 +29,9 @@ export default {
         showLoading: {
             type: Boolean,
             default: true
+        },
+        onLoading: {
+            type: Function
         }
     },
     data() {
@@ -36,6 +39,11 @@ export default {
             loading: false
         }
     },
+    watch: {
+        loading: function (newVal) {
+            this.$emit("onLoading", newVal)
+        }
+    },
     methods: {
         afterRead({ file }) {
             const that = this;
@@ -107,6 +115,7 @@ export default {
         /* 上传成功反馈 */
         uploadFile(res, data) {
             var that = this;
+            that.loading = true;
             uni.request({
                 url: res.uploadurl,
                 method: "PUT",

+ 437 - 0
components/my_form.vue

@@ -0,0 +1,437 @@
+<template>
+    <view>
+        <block v-for="(item, index) in  list " :key="item.key">
+            <!-- 文本输入 -->
+            <view class="input-box" v-if="item.type == 'text'" :style="{ marginTop: tovw(item.marginTop || 0) }"
+                @click="focusLabel = item.label">
+                <view class="box">
+                    <view class="label">
+                        <text class="must" v-if="item.isMust">*</text>
+                        {{ item.label }}:
+                    </view>
+                    <view class="content-box">
+                        <textarea auto-height type="text" :focus="focusLabel == item.label"
+                            :placeholder="item.placeholder || '请填写' + item.label" :value="item.value"
+                            :style="{ width: item.value ? '220px' : '240px' }" @input="onInput($event, index)"
+                            :maxlength="item.maxlength || '499'" confirm-type="done" />
+                        <icon v-if="item.value" class="icon" type="clear" size="3.733vw" @click="onClearInput(index)" />
+                    </view>
+                </view>
+            </view>
+            <!-- 自定义选项分类 -->
+            <view class="custom-class-box" v-else-if="item.type == 'customClass'"
+                :style="{ marginTop: tovw(item.marginTop || 0) }">
+                <view class="head">
+                    <view class="label">
+                        <text class="must" v-if="item.isMust">*</text>
+                        {{ item.label }}
+                    </view>
+                    <view class="state">
+                        {{ item.isMultipleChoice ? '可多选' : '仅单选' }}
+                    </view>
+                </view>
+                <view class="options">
+                    <view class="option"
+                        :class="item.isMultipleChoice ? (item.value.includes(option.value) ? 'active' : '') : (item.value == option.value ? 'active' : '')"
+                        v-for=" option  in  item.list " :key="option.value" hover-class="navigator-hover"
+                        @click="changOptions(option.value, index)">
+                        {{ option.remarks }}
+                    </view>
+                </view>
+            </view>
+            <!-- 上传附件 -->
+            <view class="custom-class-box" v-else-if="item.type == 'upload'"
+                :style="{ marginTop: tovw(item.marginTop || 0) }">
+                <view class="head">
+                    <view class="label">
+                        <text class="must" v-if="item.isMust">*</text>
+                        {{ item.label }}
+                    </view>
+                    <view class="state">
+                        {{ item.placeholder }}
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="file-box" v-for="file in item.value" :key="file.attachmentid">
+                        <image class="image" v-if="file.fileType == 'image'" :src="file.url" mode="aspectFill"
+                            lazy-load="true" @click="previewImg(file)" />
+                        <video v-else-if="file.fileType == 'video'" class="video" :poster="file.subfiles[0].url"
+                            :src="file.url" />
+                        <image class="delete" @click.stop="deleteFile(file, index)"
+                            src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404241713944430197B47af9b2f.png"
+                            mode="widthFix" />
+                    </view>
+                    <my-upload v-if="item.allowUpload" :showLoading="false" :accept="item.accept"
+                        @uploadCallback="uploadCallback($event, index)" @onLoading="onUploadLoading($event, index)">
+                        <view class="upload-box" hover-class="navigator-hover">
+                            <u-loading-icon v-if="item.loading" />
+                            <text v-else class="iconfont icon-xiazai" />
+                            <text style="margin-left: 5px;">上传</text>
+                        </view>
+                    </my-upload>
+                </view>
+            </view>
+        </block>
+    </view>
+</template>
+
+<script>
+import myUpload from "./my-upload.vue";
+import { formattedFiles, viewImage } from "../utils/settleFiles.js"
+export default {
+    name: "my_form",
+    components: { myUpload },
+    props: {
+        form: {
+            type: Array,
+            default: []
+        },
+        isUncomplete: {
+            type: Function
+        },
+        onUploading: {
+            type: Function
+        }
+    },
+    data() {
+        return {
+            list: [],
+            focusLabel: ""
+        }
+    },
+    watch: {
+        form: function (newVal) {
+            if (newVal) {
+                this.list = JSON.parse(JSON.stringify(newVal));
+                this.verify()
+            } else {
+
+            }
+        }
+    },
+    async created() {
+        /*     let list = [{
+                key: "name",
+                type: "text",
+                label: "标题",
+                isMust: true,//是否必填
+                value: "",
+                marginTop: 10
+            }, {
+                key: "Class",
+                type: "customClass",
+                label: "标题",
+                isMust: false,//是否必填
+                isMultipleChoice: true,//是否多选
+                value: [],// 多选[] 单选 ""
+                isMust: true,//是否必填
+                list: await this.getCustomClass('picturespace'),
+                marginTop: 10
+            },{
+                key: "attachmentids",
+                type: "upload",
+                label: "图片/视频",
+                accept:"all",
+                placeholder: "可上传多个视频或图片",
+                ownertable: "temporary",
+                ownerid: 999,
+                usetype: 'default',
+                allowUpload: true,
+                allowDelete: true,
+                value:[],
+                marginTop: 10
+            }] */
+    },
+    methods: {
+        onInput(e, index) {
+            this.$set(this.list[index], 'value', e.detail.value)
+            if (this.list[index].isMust) this.verify()
+        },
+        onClearInput(index) {
+            this.$set(this.list[index], 'value', '')
+            if (this.list[index].isMust) this.verify()
+        },
+        changOptions(value, index) {
+            let item = this.list[index];
+            if (item.isMultipleChoice) {
+                let i = -1;
+                try {
+                    i = item.value.findIndex(v => v == value)
+                } catch (error) {
+                }
+                if (i == -1) {
+                    item.value.push(value)
+                } else {
+                    item.value.splice(i, 1)
+                }
+                this.$set(this.list[index], 'value', item.value)
+            } else {
+                this.$set(this.list[index], 'value', value)
+            }
+            if (this.list[index].isMust) this.verify()
+        },
+        verify() {
+            let list = this.list.filter(v => v.isMust);
+            let Uncomplete = false;
+            if (list.length) Uncomplete = list.some(v => {
+                let res = false;
+                if (v.type == 'customClass') {
+                    if (v.isMultipleChoice) {
+                        res = v.value.length == 0;
+                    } else {
+                        res = v.value == "";
+                    }
+                } else if (v.type == 'upload') {
+                    res = v.value.length == 0;
+                } else {
+                    res = v.value == "";
+                }
+                return res
+            })
+            this.$emit("isUncomplete", Uncomplete)
+        },
+        previewImg(item) {
+            viewImage(item.url)
+        },
+        uploadCallback(attachmentids, index) {
+            let item = this.list[index];
+            this.$Http.basic({
+                "classname": "system.attachment.Attachment",
+                "method": "createFileLink",
+                "content": {
+                    ownertable: item.ownertable,
+                    ownerid: item.ownerid,
+                    usetype: item.usetype,
+                    attachmentids
+                }
+            }).then(res => {
+                console.log('绑定附件', res)
+                if (this.cutoff(res.msg)) return;
+                res.data = formattedFiles(res.data)
+                item.value.push(res.data[0]);
+
+                //临时文件
+                if (res.data[0].ownertable == "temporary") try {
+                    item.temporarys.push(attachmentids[0])
+                } catch (error) {
+                    item.temporarys = [attachmentids[0]]
+                }
+
+                this.$set(this.list[index], 'value', item.value)
+                if (this.list[index].isMust) this.verify()
+            })
+        },
+        deleteFiles() {
+            this.list.forEach(v => {
+                if (v.type == 'upload') {
+                    let linksids = v.value.filter(v => v.ownertable == "temporary").map(v => v.linksid)
+                    if (linksids.length) this.$Http.basic({
+                        "classname": "system.attachment.Attachment",
+                        "method": "deleteFileLink",
+                        "content": {
+                            linksids
+                        }
+                    }).then(res => {
+                        console.log("处理删除附件", res)
+                        if (this.cutoff(res.msg)) return;
+                    });
+                }
+            });
+        },
+        onUploadLoading(e, index) {
+            this.$set(this.list[index], 'loading', e)
+            this.$emit("onUploading", e)
+        },
+        deleteFile(flie, index) {
+            let item = this.list[index];
+            item.value = item.value.filter(v => v.attachmentid != flie.attachmentid)
+            //临时文件
+            if (flie.ownertable == "temporary") {
+                item.temporarys = item.temporarys.filter(v => v != flie.attachmentid)
+                this.$Http.basic({
+                    "classname": "system.attachment.Attachment",
+                    "method": "deleteFileLink",
+                    "content": {
+                        linksids: [flie.linksid]
+                    }
+                }).then(res => {
+                    console.log("处理删除附件", res)
+                    if (this.cutoff(res.msg)) return;
+                });
+            } else {
+                try {
+                    item.linksids.push(flie.linksid)
+                } catch (error) {
+                    item.linksids = [flie.linksid]
+                }
+            }
+            this.$set(this.list[index], 'value', item.value)
+            if (this.list[index].isMust) this.verify()
+        },
+        submit() {
+            return new Promise((resolve, reject) => {
+                let res = {};
+                this.list.forEach(v => {
+                    if (v.type == 'upload') {
+                        res.files = {
+                            temporarys: [],
+                            linksids: [],
+                        }
+                        try {
+                            res.files.temporarys = v.temporarys || []
+                        } catch (error) {
+
+                        }
+                        try {
+                            res.files.linksids = v.linksids || []
+                        } catch (error) {
+
+                        }
+                    } else {
+                        res[v.key] = v.value;
+                    }
+                })
+                resolve(res)
+            })
+        }
+    },
+}
+</script>
+
+<style lang="scss">
+.custom-class-box {
+    width: 100%;
+    background: #fff;
+    padding: 15px 0 15px 10px;
+    box-sizing: border-box;
+
+    .head {
+        width: 355px;
+        height: 20px;
+        display: flex;
+        justify-content: space-between;
+        align-items: flex-end;
+
+        .label {
+            font-size: 14px;
+            color: #333333;
+            line-height: 20px;
+        }
+
+        .state {
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-size: 12px;
+            color: #999999;
+        }
+    }
+
+    .options {
+        display: flex;
+        flex-wrap: wrap;
+
+        .option {
+            padding: 6px 10px;
+            text-align: center;
+            min-width: 81px;
+            font-family: PingFang SC, PingFang SC;
+            font-size: 14px;
+            color: #333333;
+            border-radius: 5px;
+            background: #F2F2F2;
+            margin-top: 10px;
+            margin-right: 10px;
+            box-sizing: border-box;
+        }
+
+        .active {
+            background: #C30D23;
+            color: #fff;
+        }
+    }
+
+    .content {
+        .file-box {
+            position: relative;
+            width: 355px;
+            height: 240px;
+            margin-top: 10px;
+
+            .video,
+            .image {
+                width: 355px;
+                height: 240px;
+                border-radius: 5px;
+            }
+
+            .delete {
+                position: absolute;
+                width: 30px;
+                top: 0;
+                right: 0;
+                z-index: 1;
+            }
+        }
+
+        .upload-box {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            width: 355px;
+            height: 45px;
+            background: #FFFFFF;
+            border-radius: 5px;
+            border: 1px dashed #C30D23;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-size: 14px;
+            color: #C30D23;
+            margin-top: 10px;
+        }
+    }
+}
+
+.input-box {
+    width: 100vw;
+    background: #fff;
+    box-sizing: border-box;
+    padding-left: 10px;
+
+    .box {
+        display: flex;
+        width: 100%;
+        min-height: 54.4px;
+        padding: 15px 0;
+        box-sizing: border-box;
+        border-bottom: 1px #DDDDDD solid;
+        align-items: center;
+    }
+
+    .label {
+        width: 100px;
+        margin-right: 10px;
+        line-height: 20px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-size: 14px;
+        color: #666666;
+        flex-shrink: 0;
+
+        .must {
+            color: #E3041F;
+            margin-right: 5px;
+        }
+    }
+
+    .content-box {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        padding-right: 10px;
+        box-sizing: border-box;
+
+        .icon {
+            padding: 5px;
+        }
+    }
+
+
+}
+</style>

+ 2 - 0
main.js

@@ -15,6 +15,8 @@ import filtrate from './components/filtrate.vue';
 Vue.component("filtrate", filtrate);
 import appList from './components/appList.vue';
 Vue.component("appList", appList);
+import floatBut from './components/floatBut.vue';
+Vue.component("floatBut", floatBut);
 
 //挂载接口
 let isDev = process.env.NODE_ENV === 'development';

+ 3 - 1
packageA/course/list.vue

@@ -7,7 +7,7 @@
             <view class="title">{{ detail.title || '--' }}</view>
             <view class="text">
                 <view class="teacher">讲师:{{ detail.teacher || ' --' }}</view>
-                <view class="count">共{{ detail.courseware_count || 0 }}个课件 | {{ detail.study_count || 1 }}人已学习</view>
+                <view class="count">共{{ total || 0 }}个课件 | {{ detail.study_count || 1 }}人已学习</view>
             </view>
         </view>
         <view style="height: 10px;" />
@@ -56,6 +56,7 @@ export default {
             tabsActive: "目录",
             list: [],
             detail: {},
+            total: 0,
             "content": {
                 "sat_coursewareid": 0,
                 "where": {
@@ -98,6 +99,7 @@ export default {
                     return v
                 })
                 this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
+                this.total = res.total;
                 this.content = this.$refs.List.paging(this.content, res)
             })
         }

+ 447 - 0
packageA/fullView/detail.vue

@@ -0,0 +1,447 @@
+<template>
+    <view>
+        <My_listbox ref="List" @getlist="getDetail" bottomHeight="75" :isShowEmpty="false">
+            <view class="main">
+                <view class="changeby-box">
+                    <view class="changeby">
+                        <image class="headpic"
+                            :src="detail.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'"
+                            mode="aspectFill" />
+                        <view class="name u-line-1">
+                            {{ detail.changeby || '--' }}
+                        </view>
+                    </view>
+                    <navigator class="iconfont icon-a-720quanjing-bai" v-if="detail.ispanorama"
+                        style="color: #C30D23;font-size: 24px;"
+                        :url="'/packageA/webView/webView?url=' + detail.panoramaurl" />
+                </view>
+                <view class="title" v-if="detail.title_c || detail.title">
+                    {{ detail.title_c || detail.title }}
+                </view>
+                <block v-for="item in files" :key="item.attachmentid">
+                    <image class="image" v-if="item.fileType == 'image'" :src="item.cover" mode="widthFix" lazy-load="true"
+                        @click="previewImg(item)" />
+                    <video v-else-if="item.fileType == 'video'" class="video" :poster="item.subfiles[0].url"
+                        :src="item.url" />
+                </block>
+            </view>
+            <view class="comment-box">
+                <view class="head">
+                    <view class="label">
+                        评论
+                    </view>
+                    <view class="total">
+                        共{{ detail.commentcount || 0 }}条
+                    </view>
+                </view>
+                <view class="comment" v-for="item in comments" :key="item.sys_datacommentid">
+                    <view class="user">
+                        <image class="headpic"
+                            :src="item.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'"
+                            mode="aspectFill" />
+                        <view class="name">
+                            {{ item.name }}
+                        </view>
+                    </view>
+                    <view class="content">
+                        {{ item.content }}
+                    </view>
+                    <view class="time">
+                        <text class="createdate">{{ item.createdate }}</text>
+                        <view v-if="userid == item.userid" class="iconfont icon-shanchu" hover-class="navigator-hover"
+                            @click="delectComment(item)" />
+                    </view>
+                </view>
+                <view v-if="comments.length == 0" style="padding-bottom: 25px;">
+                    <u-empty mode="data" />
+                </view>
+            </view>
+
+        </My_listbox>
+
+        <view class="footer">
+            <view class="but" @click="loadings.like ? '' : handleCollect(2, detail.islike)">
+                <u-loading-icon v-if="loadings.like" />
+                <block v-else>
+                    <view v-if="detail.islike" style="color: #E3041F;" class="iconfont icon-yidianzan" />
+                    <view v-else style="color: #646566;" class="iconfont icon-weidianzan" />
+                    <view class="text">
+                        点赞
+                    </view>
+                </block>
+            </view>
+            <view class="but" @click="loadings.collect ? '' : handleCollect(1, detail.iscollect)">
+                <u-loading-icon v-if="loadings.collect" />
+                <block v-else>
+                    <view v-if="detail.iscollect" style="color: #FFC300;" class="iconfont icon-yishoucang" />
+                    <view v-else style="color: #646566;" class="iconfont icon-weishoucang" />
+                    <view class="text">
+                        收藏
+                    </view>
+                </block>
+            </view>
+            <view class="input-box" hover-class="navigator-hover">
+                <input class="input" type="text" placeholder="评论" :value="commentText" maxlength="499"
+                    @input="changeComment" confirm-type="send" @confirm="onSend">
+                <icon v-if="commentText" class="icon" type="clear" size="3.733vw" @click="onClear" />
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+import { viewImage, formattedFiles } from "../../utils/settleFiles"
+export default {
+    data() {
+        return {
+            sat_sharematerialid: 0,
+            detail: {},
+            files: [],
+            comments: [],
+            "content": {
+                "ownertable": "sat_sharematerial"
+            },
+            commentText: "",
+            userid: uni.getStorageSync('userMsg').userid,
+            loadings: {
+                collect: false,
+                like: false
+            }
+        }
+    },
+    onLoad(options) {
+        this.sat_sharematerialid = options.id;
+        this.getDetail(true);
+    },
+    onUnload() {
+        this.$Http.setCount && delete this.$Http.setCount
+    },
+    methods: {
+        previewImg(item) {
+            viewImage(item.url)
+        },
+        getDetail(init = false) {
+            this.getList(init)
+            if (!init) return;
+            this.$Http.basic({
+                "id": 20240417104702,
+                "content": {
+                    "sat_sharematerialid": this.sat_sharematerialid
+                },
+            }).then(res => {
+                this.$refs.List.RefreshToComplete()
+                console.log("设计实景详情", res)
+                if (this.cutoff(res.msg)) return;
+                this.files = formattedFiles(res.data.attinfos_pic.map(v => v.attinfos[0])).map(v => {
+                    if (v.fileType == 'image') v.cover = this.getSpecifiedImage(v)
+                    return v
+                })
+                this.detail = res.data;
+                this.setCount()
+                uni.setNavigationBarTitle({
+                    title: res.data.title_c || res.data.title || '详情'
+                });
+            })
+        },
+        getList(init = false) {
+            if (this.paging(this.content, init)) return;
+            this.content.ownerid = this.sat_sharematerialid;
+            this.$Http.basic({
+                "id": 20240417161702,
+                content: this.content
+            }).then(res => {
+                console.log("获取评论列表", res)
+                if (this.cutoff(res.msg)) return;
+                this.comments = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
+                this.content = this.$refs.List.paging(this.content, res)
+            })
+        },
+        changeComment(e) {
+            this.commentText = e.detail.value;
+        },
+        onClear() {
+            let that = this;
+            uni.showModal({
+                title: '提示',
+                content: '是否确定清空评论?',
+                success: ({ confirm }) => {
+                    if (confirm) that.commentText = ""
+                },
+            })
+        },
+        onSend() {
+            if (this.commentText == '') return uni.showToast({
+                title: '还未输入评论内容!',
+                duration: 2000,
+                icon: "none"
+            });
+            this.$Http.basic({
+                "id": 20240417161502,
+                "content": {
+                    "ownertable": "sat_sharematerial",
+                    "ownerid": this.sat_sharematerialid,
+                    "contentstr": this.commentText
+                },
+            }).then(res => {
+                console.log("发送评论", res)
+                if (this.cutoff(res.msg, '评论成功')) return;
+                this.commentText = '';
+                this.getDetail(true)
+            })
+        },
+        delectComment(item) {
+            let that = this;
+            uni.showModal({
+                title: '提示',
+                content: "是否确定删除该评论?",
+                success: ({ confirm }) => {
+                    if (confirm) that.$Http.basic({
+                        "id": 20240417161602,
+                        "content": {
+                            "sys_datacommentid": item.sys_datacommentid,
+                            "ownertable": "sat_sharematerial",
+                            "ownerid": item.ownerid
+                        },
+                    }).then(res => {
+                        console.log("删除评论", res)
+                        if (this.cutoff(res.msg, '删除成功')) return;
+                        that.detail.commentcount -= 1;
+                        that.comments = that.comments.filter(v => v.sys_datacommentid != item.sys_datacommentid);
+                        this.setCount()
+                    })
+                },
+            })
+        },
+        setCount() {
+            this.$Http.setCount && this.$Http.setCount(this.detail)
+        },
+        handleCollect(type, value) {
+            if (type == 1) {
+                this.loadings.collect = true;
+            } else {
+                this.loadings.like = true;
+            }
+            this.$Http.basic({
+                "id": 20240416133702,
+                "content": {
+                    "ownertable": "sat_sharematerial",
+                    "ownerid": this.detail.sat_sharematerialid,
+                    type
+                },
+            }).then(res => {
+                console.log(value ? '取消' : '添加', type == 1 ? "收藏" : "喜欢", res)
+                if (type == 1) {
+                    this.loadings.collect = false;
+                } else {
+                    this.loadings.like = false;
+                }
+                if (this.cutoff(res.msg)) return;
+                if (type == 1) {
+                    this.detail.iscollect = value ? 0 : 1
+                    this.detail.collectcount = value ? this.detail.collectcount - 1 : this.detail.collectcount - 0 + 1
+                } else {
+                    this.detail.islike = value ? 0 : 1
+                    this.detail.likecount = value ? this.detail.likecount - 1 : this.detail.likecount - 0 + 1
+                }
+                this.setCount();
+            })
+        },
+    },
+
+}
+</script>
+
+<style lang="scss">
+.main {
+    width: 355px;
+    margin: 10px auto;
+
+    .changeby-box {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+
+        .changeby {
+            display: flex;
+            align-items: center;
+
+            .headpic {
+                width: 24px;
+                height: 24px;
+                border-radius: 50%;
+                margin-right: 5px;
+            }
+
+            .name {
+                font-family: Source Han Sans SC, Source Han Sans SC;
+                font-size: 12px;
+                color: #333333;
+                width: 200px;
+            }
+        }
+    }
+
+    .title {
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-size: 12px;
+        color: #333333;
+        line-height: 20px;
+        margin-top: 10px;
+    }
+
+    .image {
+        width: 100%;
+        border-radius: 5px;
+        margin-top: 10px;
+    }
+
+    .video {
+        width: 355px;
+        height: 240px;
+        border-radius: 5px;
+        margin-top: 10px;
+    }
+}
+
+.comment-box {
+    background: #fff;
+    margin-top: 10px;
+
+    .head {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        width: 100vw;
+        height: 45px;
+
+        .label {
+            font-family: PingFang SC, PingFang SC;
+            font-weight: bold;
+            font-size: 16px;
+            color: #333333;
+            margin-left: 10px;
+        }
+
+        .total {
+            font-family: PingFang SC, PingFang SC;
+            font-size: 14px;
+            color: #333333;
+            margin-right: 10px;
+        }
+    }
+
+    .comment {
+        padding: 10px;
+
+        .user {
+            display: flex;
+            align-items: center;
+            height: 32px;
+
+            .headpic {
+                width: 32px;
+                height: 32px;
+                border-radius: 50%;
+
+            }
+
+            .name {
+                margin-left: 10px;
+                font-family: Source Han Sans SC,
+                    Source Han Sans SC;
+                font-weight: 500;
+                font-size: 14px;
+                color: #666666;
+            }
+
+        }
+
+        .content {
+            width: 313px;
+            margin-top: 4px;
+            margin-left: 42px;
+            line-height: 20px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-size: 14px;
+            color: #333333;
+        }
+
+        .time {
+            display: flex;
+            justify-content: space-between;
+            width: 313px;
+            margin-top: 10px;
+            margin-left: 42px;
+
+            .iconfont,
+            .createdate {
+                font-family: Source Han Sans SC, Source Han Sans SC;
+                font-size: 12px;
+                color: #999999;
+                line-height: 17px;
+            }
+
+            .iconfont {
+                padding: 0 5px;
+                border-radius: 4px;
+            }
+        }
+
+
+    }
+}
+
+.footer {
+    display: flex;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 375px;
+    height: 70px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+
+    .but {
+        width: 50px;
+        text-align: center;
+        padding-top: 13px;
+
+        .iconfont {
+            font-size: 16px;
+            margin-bottom: 4px;
+        }
+
+        .text {
+            font-family: PingFang SC, PingFang SC;
+            font-size: 10px;
+            color: #333333;
+            height: 100%;
+            box-sizing: border-box;
+        }
+    }
+
+    .input-box {
+        display: flex;
+        align-items: center;
+        width: 245px;
+        height: 45px;
+        background: #F7F7F7;
+        border-radius: 50px;
+        border: 1px solid #CCCCCC;
+        margin-left: 20px;
+        margin-top: 6px;
+        padding: 0 10px 0 20px;
+        box-sizing: border-box;
+
+        .input {
+            flex: 1;
+            height: 45px;
+            line-height: 45px;
+        }
+
+        .icon {
+            margin-left: 5px;
+        }
+    }
+}
+</style>

+ 210 - 0
packageA/fullView/upload.vue

@@ -0,0 +1,210 @@
+<template>
+    <view>
+        <my-form ref="form" :form="form" @isUncomplete="isUncomplete" @onUploading="onUploading" />
+        <view class="footer">
+            <view class="but" :class="(uncomplete || onUpload) ? 'forbidden' : ''" hover-class="navigator-hover"
+                @click="(uncomplete || onUpload) ? '' : submit()">
+                立即提交
+            </view>
+        </view>
+        <view style="height: 75px;" />
+    </view>
+</template>
+
+<script>
+import myForm from "../../components/my_form.vue"
+export default {
+    components: {
+        myForm
+    },
+    data() {
+        return {
+            form: [],
+            uncomplete: true,
+            pageType: 4,
+            onUpload: false,
+            isSubmit: false,
+        }
+    },
+    onUnload() {
+        if(!this.isSubmit) this.$refs.form.deleteFiles()
+    },
+    onLoad(options) {
+        this.pageType = options.pageType == '设计' ? 4 : 5
+        uni.setNavigationBarTitle({
+            title: '上传'
+        });
+        this.initForm()
+    },
+    methods: {
+        async initForm() {
+            this.form = [{
+                key: "title_c",
+                type: "text",
+                label: "标题",
+                isMust: true,//是否必填
+                value: "",
+                marginTop: 10
+            }, {
+                key: "panoramaurl",
+                type: "text",
+                label: "全景地址",
+                placeholder: "请填写酷乐家/三维家720°全景地址",
+                value: ""
+            }, {
+                key: "space",
+                type: "customClass",
+                label: "空间",
+                isMultipleChoice: true,//是否多选
+                value: [],
+                list: await this.getCustomClass('picturespace'),
+                marginTop: 10
+            }, {
+                key: "style",
+                type: "customClass",
+                label: "风格",
+                isMultipleChoice: true,//是否多选
+                value: [],
+                list: await this.getCustomClass('picturestyle'),
+                marginTop: 10
+            }, {
+                key: "spec",
+                type: "customClass",
+                label: "尺寸",
+                isMultipleChoice: true,//是否多选
+                value: [],
+                list: await this.getCustomClass('picturespec'),
+                marginTop: 10
+            }, {
+                key: "attachmentids",
+                type: "upload",
+                label: "图片/视频",
+                placeholder: "可上传多个视频或图片",
+                accept: "all",
+                ownertable: "temporary",
+                ownerid: 999,
+                usetype: 'default',
+                allowUpload: true,
+                allowDelete: true,
+                value: [],
+                marginTop: 10
+            }]
+        },
+        isUncomplete(uncomplete) {
+            this.uncomplete = uncomplete;
+        },
+        submit() {
+            this.$refs.form.submit().then(data => {
+                this.onUpload = true;
+                this.$Http.basic({
+                    "id": 20240417104602,
+                    "content": {
+                        "sat_sharematerialid": 0,
+                        "title": "",
+                        "title_c": data.title_c,
+                        "type": this.pageType, //4:设计,5:实景
+                        "panoramaurl": data.panoramaurl,
+                        "renderingsclass": {
+                            "style": data.style,
+                            "space": data.space,
+                            "spec": data.spec
+                        },
+                        "isnationwide": 0, //是否全国精选
+                        "sequence": 0,
+                        "ispublish": 1//是否发布
+                    },
+                }).then(async res => {
+                    this.onUpload = false;
+                    console.log("新建", res)
+                    if (this.cutoff(res.msg)) return;
+                    if (data.files.temporarys.length) {
+                        this.onUpload = true;
+                        await this.$Http.basic({
+                            "classname": "system.attachment.Attachment",
+                            "method": "createFileLink",
+                            "content": {
+                                ownertable: 'sat_sharematerial',
+                                ownerid: res.data.sat_sharematerialid,
+                                usetype: 'default',
+                                attachmentids: data.files.temporarys
+                            }
+                        }).then(async s => {
+                            this.isSubmit = true;
+                            this.onUpload = false;
+                            console.log("绑定附加", s)
+                            if (this.cutoff(s.msg)) return;
+                            await this.$Http.basic({
+                                "id": "20240425102102",
+                                "content": {
+                                    "ownertable": 'sat_sharematerial',
+                                    "ownerid": res.data.sat_sharematerialid,
+                                    "items": data.files.temporarys.map(v => {
+                                        return {
+                                            "attachmentid": v,
+                                            "jumpurl": "",
+                                            "sequence": 0
+                                        }
+                                    })
+                                }
+                            }).then(e => {
+                                console.log("plc", e)
+                                if (this.cutoff(e.msg)) return;
+                            })
+                        })
+                    };
+                    if (this.$Http.updateList) return this.$Http.updateList(res.data);
+                    uni.showModal({
+                        title: '提示',
+                        content: '新建成功,是否立即查看',
+                        cancelText: '返回列表',
+                        confirmText: '查看详情',
+                        success: ({ confirm }) => {
+                            if (confirm) {
+                                uni.redirectTo({
+                                    url: `/packageA/fullView/detail?id=${res.data.sat_sharematerialid}`
+                                });
+                                this.$Http.setCount = null;
+                            } else {
+                                uni.navigateBack()
+                            }
+                        },
+                    })
+                })
+                console.log("页面", data)
+            })
+        },
+        onUploading(ing) {
+            this.onUpload = ing;
+        },
+
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.footer {
+    position: fixed;
+    bottom: 0;
+    width: 375px;
+    height: 65px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+    border-radius: 0px 0px 0px 0px;
+
+    .but {
+        width: 355px;
+        height: 45px;
+        background: #C30D23;
+        border-radius: 5px;
+        margin: 5px auto;
+        text-align: center;
+        line-height: 45px;
+        font-size: 14px;
+        color: #FFFFFF;
+    }
+
+    .forbidden {
+        opacity: .6;
+    }
+}
+</style>

+ 8 - 0
pages.json

@@ -8,6 +8,8 @@
 		}
 	}, {
 		"path": "pages/index/index"
+	}, {
+		"path": "pages/picture/index"
 	}],
 	"subPackages": [{
 		"root": "packageA",
@@ -37,6 +39,12 @@
 			"path": "resourceLibrary/index"
 		}, {
 			"path": "resourceLibrary/detail"
+		}, {
+			"path": "webView/webView"
+		}, {
+			"path": "fullView/detail"
+		}, {
+			"path": "fullView/upload"
 		}]
 	}, {
 		"root": "packageCase",

+ 84 - 6
pages/index/index/casePages/design.vue

@@ -1,19 +1,21 @@
 <template>
     <view>
         <tabs ref="tabs" typename="renderingstype" @getList="getList" />
+        <float-but @onClick="toUpload" />
         <My_listbox ref="List" @getlist="getList" :bottomHeight="70">
-            <navigator class="list-item" :url="'/packageCase/imgs/detail?id=' + item.sat_sharematerialid"
-                v-for="(item, index) in list" hover-class="navigator-hover" :key="item.sat_coursewareid">
+            <navigator class="list-item" url="#" v-for="(item, index) in list" hover-class="navigator-hover"
+                :key="item.sat_coursewareid" @click="toDetail(index)">
                 <view style="position: relative;">
                     <image class="image" :src="item.cover" mode="aspectFill" lazy-load="true" />
                     <view class="createby-box">
-                        <image class="headpic" :src="item.headpic || '../../../../static/images/headpic.svg'"
+                        <image class="headpic"
+                            :src="item.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'"
                             mode="aspectFill" lazy-load="true" />
                         <view class="name u-line-1">{{ item.createby }}</view>
                     </view>
                 </view>
                 <view class="tips">
-                    <view class="label u-line-1">{{ item.title }}</view>
+                    <view class="label u-line-1">{{ item.title_c || item.title }}</view>
                     <view class="iconfont-box">
                         <text class="iconfont icon-pinglun-hui">
                             <text style="padding-left: 2px;" />{{ item.commentcount }}
@@ -33,6 +35,8 @@
 
 <script>
 import tabs from "./tabs.vue"
+import { formattedFiles } from "../../../../utils/settleFiles"
+
 export default {
     components: { tabs },
     props: {
@@ -54,7 +58,7 @@ export default {
                 }
             },
             list: [],
-            isInitialize: false,
+            isInitialize: false
         }
     },
     methods: {
@@ -102,13 +106,87 @@ export default {
                     if (this.cutoff(res.msg)) return;
                     this.isInitialize = true;
                     res.data = res.data.map(v => {
-                        v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "sat_sharematerial") || v.attinfos[0]) : uni.getStorageSync("site").logo || ''
+                        v.attinfos = formattedFiles(v.attinfos);
+                        v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "sat_sharematerial" && s.fileType == 'image') || v.attinfos.find(s => s.fileType == 'image')) : uni.getStorageSync("site").logo || ''
                         return v
                     })
                     this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
                     this.content = this.$refs.List.paging(this.content, res)
                 })
             })
+        },
+        updateList(data = null) {
+            if (this.content.pageNumber && this.content.pageNumber >= 2) {
+                let that = this;
+                if (data.isnationwide != this.content.isnationwide) return handle();
+                let content = this.paging(this.content, true, true)
+
+                this.$Http.basic({
+                    "id": "20240417144702",
+                    content
+                }).then(res => {
+                    console.log("更新列表", res)
+                    if (this.cutoff(res.msg)) return;
+                    res.data = res.data.map(v => {
+                        v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "sat_sharematerial") || v.attinfos[0]) : uni.getStorageSync("site").logo || ''
+                        return v
+                    })
+                    this.list = res.data;
+                    if (data) handle();
+
+                })
+                function handle() {
+                    uni.showModal({
+                        title: '提示',
+                        content: '新建成功,是否立即查看',
+                        cancelText: '返回列表',
+                        confirmText: '查看详情',
+                        success: ({ confirm }) => {
+                            if (confirm) {
+                                let index = that.list.findIndex(v => v.sat_sharematerialid == data.sat_sharematerialid);
+                                if (index == -1) {
+                                    uni.redirectTo({
+                                        url: `/packageA/fullView/detail?id=${data.sat_sharematerialid}`
+                                    });
+                                    that.$Http.setCount = null;
+                                } else {
+                                    that.toDetail(index, 2)
+                                }
+                            } else {
+                                uni.navigateBack();
+                            }
+                        },
+                    })
+                }
+
+
+            }
+        },
+        toDetail(index, type = 1) {
+            let item = this.list[index]
+            if (type == 1) {
+                uni.navigateTo({
+                    url: `/packageA/fullView/detail?id=${item.sat_sharematerialid}`,
+                });
+            } else {
+                uni.redirectTo({
+                    url: `/packageA/fullView/detail?id=${item.sat_sharematerialid}`,
+                });
+            }
+            this.$Http.setCount = function (detail) {
+                item.collectcount = detail.collectcount;
+                item.commentcount = detail.commentcount;
+                item.likecount = detail.likecount;
+                item.islike = detail.islike;
+                item.iscollect = detail.iscollect;
+                this.$set(this.list, index, item)
+            }.bind(this)
+        },
+        toUpload() {
+            uni.navigateTo({
+                url: '/packageA/fullView/upload?pageType=' + this.pageType,
+            })
+            this.$Http.updateList = this.updateList.bind(this);
         }
     },
 }

File diff suppressed because it is too large
+ 0 - 0
static/images/headpic.svg


Some files were not shown because too many files changed in this diff