Commit 596529b8 by 胡悦

案例视频添加接口

1 parent e21e8dac
/*
* @Description:
* @Author: huyue
* @Date: 2024-09-05 14:05:25
* @LastEditors: huyue
* @LastEditTime: 2024-09-13 11:08:55
*/
import http from "../request/http";
module.exports = {
......@@ -65,4 +72,21 @@ module.exports = {
});
},
/** 案例视频 */
getCaseList(data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.material.case.find",
projectName: "boutique",
...data
})
},
/** 获取类目 */
getCategory(data) {
return http.post({
method: "dj.api.boutique.recepiton.material.merchant.category",
projectName: "boutique",
...data
})
}
};
......@@ -4,7 +4,7 @@
<view class="box">
<view class="select-box">
<view class="select" @click="selectType">
全部
{{selectIndex}}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<view class="pop-box" v-show="isSelect">
......@@ -59,16 +59,16 @@
@click="playVideo(item)"
>
<image
:src="item.coverUrl"
:src="item.thumbnailUrl"
class="cover-box"
></image>
<image
v-if="item.sourceType == 2"
v-if="item.materialFormat == 1"
src="../../assets/images/boutique/play.png"
class="play-box"
></image>
</view>
<view class="item-desc">{{ item.tabName }}</view>
<view class="item-desc">{{ item.name }}</view>
</view>
</template>
</template>
......@@ -125,29 +125,18 @@ export default {
return {
name: '',
list: [],
searchList: [],
popupShow: false,
isSearch: false,
videoSrc: '',
showPreview: false,
isSelect: false,
selectIndex: 0,
selectIndex: '全部',
selectList: [
{
label: '全部',
value: 0
value: '全部'
},
{
label: '视频',
value: 1
},
{
label: '图片',
value: 2
},
{
label: 'PDF',
value: 3
}
]
}
},
......@@ -167,12 +156,16 @@ export default {
handler () {
this.name = '';
this.isSearch = false
this.list = this.views
// this.list = this.views
this.showPreview = false
},
immediate: true
}
},
mounted() {
this.getCaseList()
this.getCategory()
},
methods: {
playVideo (item) {
const { tabName, sourceType, detailUrl } = item
......@@ -196,11 +189,11 @@ export default {
handleClear () {
this.init()
},
input (e) {
input(e) {
this.name = e.detail.value
if (this.name == '')
this.isSearch = false
this.list = this.views.filter(i => i.tabName.includes(this.name))
this.list = this.searchList.filter(i => i.name.includes(this.name))
},
selectType() {
this.isSelect = !this.isSelect
......@@ -208,6 +201,29 @@ export default {
chooseType(val) {
console.log(val)
this.selectIndex = val.value
this.isSelect = false
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex)
},
async getCaseList(category = '') {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
const res = await uni.$api.boutiqueApi.getCaseList({merchantId: 44217687, category})
console.log(res)
this.list = res.list
this.searchList = res.list
},
async getCategory() {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
const res = await uni.$api.boutiqueApi.getCategory({ merchantId: 44217687 })
console.log(res)
const _list = res.map(item => {
return {
label: item,
value: item
}
})
this.selectList = [...this.selectList, ..._list]
}
},
}
......@@ -345,6 +361,7 @@ export default {
font-size: 32rpx;
color: #333333;
border-radius: 48rpx;
text-align: center;
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!