|
@@ -1,6 +1,28 @@
|
|
<template>
|
|
<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>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -8,38 +30,123 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- "content": {
|
|
|
|
|
|
+ content: {
|
|
"pageNumber": 1,
|
|
"pageNumber": 1,
|
|
"pageSize": 20,
|
|
"pageSize": 20,
|
|
- "where": {
|
|
|
|
|
|
+ "isDataAuth":true,//小程序默认传true
|
|
|
|
+ "where":{
|
|
"condition": "",
|
|
"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: {
|
|
methods: {
|
|
|
|
+ onSearch (condition) {
|
|
|
|
+ this.content.where.condition = condition
|
|
|
|
+ this.getList(true)
|
|
|
|
+ },
|
|
init(callBack) {
|
|
init(callBack) {
|
|
callBack()
|
|
callBack()
|
|
|
|
+ this.getList(true)
|
|
this.updatePage = false;
|
|
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) {
|
|
getList(init = false) {
|
|
if (init) uni.pageScrollTo({
|
|
if (init) uni.pageScrollTo({
|
|
scrollTop: 0,
|
|
scrollTop: 0,
|
|
duration: 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) => {
|
|
return new Promise((resolve, reject) => {
|
|
if (this.paging(this.content, init)) return resolve();
|
|
if (this.paging(this.content, init)) return resolve();
|
|
this.$Http.basic({
|
|
this.$Http.basic({
|
|
- "id": "",
|
|
|
|
|
|
+ "id": "20240407094702",
|
|
content: this.content
|
|
content: this.content
|
|
}).then(res => {
|
|
}).then(res => {
|
|
this.$refs.List.RefreshToComplete()
|
|
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();
|
|
resolve();
|
|
if (this.cutoff(res.msg)) return;
|
|
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.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
|
|
this.content = this.$refs.List.paging(this.content, res)
|
|
this.content = this.$refs.List.paging(this.content, res)
|
|
this.total = res.total;
|
|
this.total = res.total;
|
|
@@ -51,4 +158,59 @@ export default {
|
|
}
|
|
}
|
|
</script>
|
|
</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>
|