ソースを参照

我的设计/实景

xiaohaizhao 1 年間 前
コミット
390ea8bfa7

+ 1 - 1
cloud/collect/mylist.vue

@@ -20,7 +20,7 @@
 
 <script>
 import imgList from '../../pages/index/index/casePages/modules/imgList.vue';
-import designList from '../../pages/index/index/casePages/modules/designList.vue';
+import designList from '../../components/designList.vue';
 import product from "../../components/collectLists/product.vue";
 import courseware from "../../components/collectLists/courseware.vue";
 import commodityList from "../../pages/index/index/modules/commodityList.vue";

+ 158 - 0
cloud/designReality/index.vue

@@ -0,0 +1,158 @@
+<template>
+    <view>
+         <u-tabs :scrollable="false" lineColor="#C30D23" :activeStyle="{ color: '#C30D23', fontWeight: 'bold' }"
+            :list="tabs" @click="changeCurrent" :current="current" />
+        <My_listbox ref="List" @getlist="getList" bottomHeight="70">
+            <designList ref="designList" :list="list" @toDetail="toDetail" showStatus />
+        </My_listbox>
+        <view class="footer">
+            <view class="add" hover-class="navigator" @click="toUpload">
+                上传
+            </view>
+        </view>
+    </view>
+</template>
+<script>
+import designList from "../../components/designList";
+export default {
+    components: { designList },
+    data() {
+        return {
+            current: 0,
+            tabs: [{
+                name: '我的设计',
+            }, {
+                name: '我的实景',
+            }],
+            list: [],
+            "content": {
+                "where": {
+                    "condition": "",
+                    "type": 4 //4:设计,5:实景
+                }
+            }
+        }
+    },
+    onLoad(options) {
+        uni.setNavigationBarTitle({
+            title: '设计实景'
+        });
+        this.getList(true)
+    },
+    methods: {
+        getList(init = false) {
+            if (this.paging(this.content, init)) return;
+            this.$Http.basic({
+                "id": "2024052413361402",
+                content: this.content
+            }).then(res => {
+                console.log("我的设计实景列表", res)
+                this.$refs.List.RefreshToComplete()
+                if (this.cutoff(res.msg)) return;
+                res.data = this.$refs.designList.handleList(res.data)
+                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
+                this.content = this.$refs.List.paging(this.content, res)
+            })
+        },
+        changeCurrent({ name }) {
+            this.content.where.type = name == '我的设计' ? 4 : 5;
+            this.getList(true)
+        },
+        updateList(data = null) {
+            if (this.content.pageNumber && this.content.pageNumber >= 2) {
+                let that = this;
+                let content = this.paging(this.content, true, true)
+                this.$Http.basic({
+                    "id": "2024052413361402",
+                    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.content.where.type == 4 ? '设计' : '实景'),
+            })
+            this.$Http.updateList = this.updateList.bind(this);
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.footer {
+    position: fixed;
+    bottom: 0;
+    width: 100vw;
+    height: 65px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+    box-sizing: border-box;
+    padding: 5px 10px;
+    display: flex;
+
+    .add {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 100%;
+        height: 45px;
+        background: #C30D23;
+        border-radius: 5px;
+        font-family: PingFang SC, PingFang SC;
+        font-size: 14px;
+        color: #FFFFFF;
+    }
+}
+</style>

+ 29 - 3
pages/index/index/casePages/modules/designList.vue → components/designList.vue

@@ -1,10 +1,18 @@
 <template>
     <view>
 
-        <navigator class="list-item" url="#" v-for="(item, index) in list" hover-class="navigator-hover"
+        <navigator class="list-item" url="#" v-for="(item, index) in  list " hover-class="navigator-hover"
             :key="item.sat_coursewareid" @click="onClick(index)">
             <view style="position: relative;">
                 <image class="image" :src="item.cover" mode="aspectFill" lazy-load="true" />
+                <block v-if="showStatus">
+                    <view v-if="item.status == '发布'" class="status" style="background: #FFF0F2;color: #E3041F;">
+                        已审核
+                    </view>
+                    <view v-else class="status">
+                        未审核
+                    </view>
+                </block>
                 <view class="createby-box">
                     <image class="headpic"
                         :src="item.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'"
@@ -27,12 +35,11 @@
                 </view>
             </view>
         </navigator>
-
     </view>
 </template>
 
 <script>
-import { formattedFiles } from "../../../../../utils/settleFiles"
+import { formattedFiles } from "../utils/settleFiles"
 export default {
     props: {
         list: {
@@ -40,6 +47,9 @@ export default {
         },
         toDetail: {
             type: Function
+        },
+        showStatus: {
+            type: Boolean
         }
     },
     methods: {
@@ -72,6 +82,22 @@ export default {
         overflow: hidden;
     }
 
+    .status {
+        position: absolute;
+        top: 10px;
+        right: 0;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 56px;
+        height: 24px;
+        background: #E3041F;
+        border-radius: 12px 0px 0px 12px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-size: 12px;
+        color: #FFFFFF;
+    }
+
     .createby-box {
         position: absolute;
         display: flex;

+ 1 - 2
packageA/fullView/detail.vue

@@ -52,11 +52,10 @@
                             @click="delectComment(item)" />
                     </view>
                 </view>
-                <view v-if="comments.length == 0" style="padding-bottom: 25px;">
+                <view v-if="comments.length == 0" style="padding-bottom: 200px;">
                     <u-empty mode="data" />
                 </view>
             </view>
-
         </My_listbox>
 
         <view class="footer">

+ 2 - 1
packageA/fullView/upload.vue

@@ -76,7 +76,7 @@ export default {
                 type: "upload",
                 label: "图片/视频",
                 placeholder: "可上传多个视频或图片",
-                accept: "all",
+                accept: "media",
                 ownertable: "temporary",
                 ownerid: 999,
                 usetype: 'default',
@@ -148,6 +148,7 @@ export default {
                             })
                         })
                     };
+                    console.log("updateList", this.$Http.updateList)
                     if (this.$Http.updateList) return this.$Http.updateList(res.data);
                     uni.showModal({
                         title: '提示',

+ 2 - 0
pages.json

@@ -116,6 +116,8 @@
 			"path": "feedback/insert"
 		}, {
 			"path": "serviceAdmin/redskinsServiceAdmin"
+		}, {
+			"path": "designReality/index"
 		}]
 	}, {
 		"root": "team",

+ 1 - 1
pages/index/index/casePages/design.vue

@@ -10,7 +10,7 @@
 
 <script>
 import tabs from "./tabs.vue"
-import designList from "./modules/designList.vue";
+import designList from "../../../../components/designList.vue";
 
 export default {
     components: { tabs, designList },

+ 1 - 1
team/team/modules/store.vue

@@ -109,7 +109,7 @@ export default {
                 this.$refs.List.setHeight()
                 res.data = this.$refs.storeList.handleList(res.data)
                 this.total = res.total;
-                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data), this.colors;
+                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
                 this.content = this.$refs.List.paging(this.content, res)
             })
         },