codeMan hai 1 ano
pai
achega
03ce5174bc

+ 5 - 0
components/filtrate-group.vue

@@ -23,6 +23,11 @@ export default {
             type: Function
         }
     },
+    watch: {
+        item(val) {
+            console.log(val)
+        }
+    },
     data() {
         return {
             show: true

+ 8 - 4
pages/index/cloud/userInfo.vue

@@ -18,10 +18,12 @@
               <image class="image" src="/static/workbench/个人名片.svg" mode="widthFix"></image>
               <text class="title">{{isCode?'个人名片':'个人信息'}}</text>
           </navigator>
-          <view class="info-card">
-              <image class="image" src="/static/workbench/咨询消息.svg" mode="widthFix"></image>
-              <text class="title">咨询消息</text>
-          </view>
+          <contact>
+            <view class="info-card">
+                <image class="image" src="/static/workbench/咨询消息.svg" mode="widthFix"></image>
+                <text class="title">咨询消息</text>
+            </view>
+          </contact>
           <navigator :url="'/store/storeQRCode/index?id='+userInfoValue.userid" class="info-card" v-if="isCode">
               <image class="image" src="/static/workbench/店铺码.svg" mode="widthFix"></image>
               <text class="title">店铺码</text>
@@ -31,7 +33,9 @@
 </template>
 
 <script>
+import contact from "../../../components/contact"
 export default {
+    components:{contact},
   props:{
     isCode: {
       type:Boolean,

+ 19 - 0
pages/index/index/videoDetail.vue

@@ -0,0 +1,19 @@
+<!--  -->
+<template>
+  <div>
+    1111111
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+    }
+  }
+}
+</script>
+
+<style  scoped>
+
+</style>

+ 173 - 11
pages/index/index/videos.vue

@@ -1,6 +1,28 @@
 <template>
-    <view>
-        视频
+    <view class="video-box">
+        <view style="padding: 10px;background: #ffffff;">
+            <view class="search-box">
+                <view style="flex:1;margin-right: 20px;">
+                 <My_search placeholder="标题搜索" @onSearch="onSearch"></My_search>
+                </view>
+                <view class="filtration-but" @click="openFiltrate">
+                    筛选
+                    <text class="iconfont icon-shaixuan" />
+                </view>
+            </view>
+            <view class="crumbs u-line-1">
+                <text class="crumb" v-for="item in crumbs" :key="item.parentid">{{ item.classname }}</text>
+            </view>
+        </view>
+        <filtrate ref="Filtrate" @onInterrupt="onInterrupt" :filtrateList="filtrateList" @onFiltration="onFiltration" />
+        <view class="list">
+            <My_listbox ref="List" @getlist="getList" :bottomHeight="70">
+                <navigator :url="'/packageA/resourceLibrary/detail?id='+item.sat_sharematerialid" class="video-item" v-for="item in list" :key="item.sat_sharematerialid">   
+                    <u-image :src="item.image" width="100%" radius="5"></u-image>
+                    <text class="descript">{{ item.title }}</text>
+                </navigator>
+            </My_listbox>
+        </view>
     </view>
 </template>
 
@@ -8,38 +30,123 @@
 export default {
     data() {
         return {
-            "content": {
+            content: {
                 "pageNumber": 1,
                 "pageSize": 20,
-                "where": {
+                "isDataAuth":true,//小程序默认传true
+                "where":{
                     "condition": "",
-                    "isnew": '',
-                    "class": ""
+                    "sat_sharematerial_classids":[],
+                    "type": "2",//1:图片,2:视频,3:图文
+                    "status": "",
+                    "begindate_create": "",//创建时间
+                    "enddate_create": "",//创建时间
+                    "begindate": "",//发布时间
+                    "enddate": ""//发布时间
                 }
-            }
+            },
+            filtrateList:[],
+            updatePage:true,
+            crumbs:[{classname:'视频'}],
+            list:[]
         }
     },
     methods: {
+        onSearch (condition) {
+            this.content.where.condition = condition
+            this.getList(true)
+        },
         init(callBack) {
             callBack()
+            this.getList(true)
             this.updatePage = false;
         },
+        async openFiltrate() {
+            if (this.filtrateList.length == 0) {
+                    // let list = res.map(v => [{ remarks: "全部", value: "" }].concat(v));
+                    let res = await this.$Http.basic({
+                        "id": "20221102143202",
+                        "content": {
+                            "parentid": 0,
+                            "where": {
+                                "isenable": 1
+                            }
+                        }
+                    })
+                    this.filtrateList = [{
+                        title: "分类1",
+                        key: "分类1",
+                        showKey: "classname",
+                        selected: "sat_sharematerial_classid",
+                        interrupt:true,
+                        value: "",
+                        isAll: true,
+                        defaultVal: "",
+                        rang: res.data,
+                    }]
+                    this.$refs.Filtrate.changeShow();
+            } else {
+                this.$refs.Filtrate.changeShow();
+            }
+        },
+        onInterrupt ({item,index,option}) {
+            if (option.children && option.children.length) {
+                this.$refs.Filtrate.list.splice(option.level,this.$refs.Filtrate.list.length - 1)
+                this.$refs.Filtrate.list.push({
+                    title: "分类"+(option.level+1),
+                    key: "下级分类"+(option.level+1),
+                    showKey: "classname",
+                    selected: "sat_sharematerial_classid",
+                    interrupt:true,
+                    value: "",
+                    defaultVal: "",
+                    isAll: true,
+                    rang: option.children,
+                })
+            }
+            
+            console.log(item,index,option);
+        },
+        onFiltration(e) {
+            let crumbs = [this.crumbs[0]]
+            crumbs.push({
+                classname: e.分类1.classname,
+                parentid: e.分类1.sat_sharematerial_classid
+            })
+            if (e.下级分类2) crumbs.push({
+                classname: e.下级分类2.classname,
+                parentid: e.下级分类2.sat_sharematerial_classid
+            })
+
+            if (e.下级分类3) crumbs.push({
+                classname: e.下级分类3.classname,
+                parentid: e.下级分类3.sat_sharematerial_classid
+            })
+
+            this.crumbs = crumbs;
+            this.getList(true)
+        },
         getList(init = false) {
             if (init) uni.pageScrollTo({
                 scrollTop: 0,
                 duration: 0,
             })
+            let ids = this.crumbs.map(v => v.parentid).filter(v => v);
+            this.content.where.sat_sharematerial_classids = ids.length ? [[ids[ids.length - 1]]] : []
             return new Promise((resolve, reject) => {
                 if (this.paging(this.content, init)) return resolve();
                 this.$Http.basic({
-                    "id": "",
+                    "id": "20240407094702",
                     content: this.content
                 }).then(res => {
                     this.$refs.List.RefreshToComplete()
-                    console.log("获取商品列表", res)
+                    res.data = res.data.map(v => {
+                        v.image = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "avatar") || v.attinfos[0]) : ''
+                        return v
+                    })
+                    console.log("获取视频列表", res)
                     resolve();
                     if (this.cutoff(res.msg)) return;
-                    res.data = this.$refs.commodity.handleList(res.data)
                     this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
                     this.content = this.$refs.List.paging(this.content, res)
                     this.total = res.total;
@@ -51,4 +158,59 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.search-box {
+    display: flex;
+    align-items: center;
+    align-content: center;
+    justify-content: space-between;
+    margin-bottom: 10px;
+    .filtration-but {
+        font-family: PingFang SC, PingFang SC;
+        font-weight: 400;
+        font-size: 14px;
+        color: #333333;
+        text {
+            color:#DDDDDD !important;
+        }
+    }
+}
+.crumbs {
+    display: flex;
+    align-items: center;
+    align-content: center;
+    .crumb {
+        flex-shrink: 0;
+        font-size: 12px;
+        font-family: PingFang SC, PingFang SC;
+    }
+
+    .crumb::after {
+        content: ">";
+        padding: 0 2px;
+    }
+
+    .crumb:last-child {
+        font-weight: bold;
+    }
+
+    .crumb:last-child::after {
+        content: "";
+    }
+}
+
+.list {
+    padding: 10px;
+    margin-top: 10px;
+    background: #ffffff;
+    .video-item {
+        display: flex;
+        flex-direction: column;
+        margin-bottom: 20px;
+        .descript{
+            margin-top: 10px;
+            text-align: center;
+        }
+    }
+}
+</style>