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"; import http from "../request/http";
module.exports = { module.exports = {
...@@ -65,4 +72,21 @@ 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 @@ ...@@ -4,7 +4,7 @@
<view class="box"> <view class="box">
<view class="select-box"> <view class="select-box">
<view class="select" @click="selectType"> <view class="select" @click="selectType">
全部 {{selectIndex}}
<view class="sprite-icon icon-arrow-bottom"></view> <view class="sprite-icon icon-arrow-bottom"></view>
</view> </view>
<view class="pop-box" v-show="isSelect"> <view class="pop-box" v-show="isSelect">
...@@ -59,16 +59,16 @@ ...@@ -59,16 +59,16 @@
@click="playVideo(item)" @click="playVideo(item)"
> >
<image <image
:src="item.coverUrl" :src="item.thumbnailUrl"
class="cover-box" class="cover-box"
></image> ></image>
<image <image
v-if="item.sourceType == 2" v-if="item.materialFormat == 1"
src="../../assets/images/boutique/play.png" src="../../assets/images/boutique/play.png"
class="play-box" class="play-box"
></image> ></image>
</view> </view>
<view class="item-desc">{{ item.tabName }}</view> <view class="item-desc">{{ item.name }}</view>
</view> </view>
</template> </template>
</template> </template>
...@@ -125,29 +125,18 @@ export default { ...@@ -125,29 +125,18 @@ export default {
return { return {
name: '', name: '',
list: [], list: [],
searchList: [],
popupShow: false, popupShow: false,
isSearch: false, isSearch: false,
videoSrc: '', videoSrc: '',
showPreview: false, showPreview: false,
isSelect: false, isSelect: false,
selectIndex: 0, selectIndex: '全部',
selectList: [ selectList: [
{ {
label: '全部', label: '全部',
value: 0 value: '全部'
}, },
{
label: '视频',
value: 1
},
{
label: '图片',
value: 2
},
{
label: 'PDF',
value: 3
}
] ]
} }
}, },
...@@ -167,12 +156,16 @@ export default { ...@@ -167,12 +156,16 @@ export default {
handler () { handler () {
this.name = ''; this.name = '';
this.isSearch = false this.isSearch = false
this.list = this.views // this.list = this.views
this.showPreview = false this.showPreview = false
}, },
immediate: true immediate: true
} }
}, },
mounted() {
this.getCaseList()
this.getCategory()
},
methods: { methods: {
playVideo (item) { playVideo (item) {
const { tabName, sourceType, detailUrl } = item const { tabName, sourceType, detailUrl } = item
...@@ -196,11 +189,11 @@ export default { ...@@ -196,11 +189,11 @@ export default {
handleClear () { handleClear () {
this.init() this.init()
}, },
input (e) { input(e) {
this.name = e.detail.value this.name = e.detail.value
if (this.name == '') if (this.name == '')
this.isSearch = false 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() { selectType() {
this.isSelect = !this.isSelect this.isSelect = !this.isSelect
...@@ -208,6 +201,29 @@ export default { ...@@ -208,6 +201,29 @@ export default {
chooseType(val) { chooseType(val) {
console.log(val) console.log(val)
this.selectIndex = val.value 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 { ...@@ -345,6 +361,7 @@ export default {
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
border-radius: 48rpx; 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!