Commit bbef66cc authored by 张九刚's avatar 张九刚

feat: 更新品牌API请求,优化品牌数据结构,调整搜索页面数据格式,动态加载品牌信息

parent 74249ea7
......@@ -3,10 +3,5 @@ const {
api
} = requestModule;
/**
* 获取首页信息
* @returns
*/
export const fetchHomeInfo = () => api.get('/c/user/index');
export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home'});
\ No newline at end of file
export const fetchBrandJSON = () => api.get('/c/front/content',{type:'brand'});
\ No newline at end of file
......@@ -31,7 +31,7 @@ export const brandObj = {
"productTabList": [
"全部", "母婴全阶", "功能营养", "儿童产品", "北纬47°"
],
"productInfoList": [
"product": [
[
{
"bgUrl": "brandpage/pic_0_1.png",
......
......@@ -31,7 +31,7 @@ var a ={
"productTabList": [
"全部", "母婴全阶", "功能营养", "儿童产品", "北纬47°"
],
"productInfoList": [
"product": [
[
{
"bgUrl": "brandpage/pic_0_1.png",
......@@ -256,7 +256,7 @@ var a ={
"qrUrl": "brandpage/qrhxf_wxxd.png"
}
]
}
}
var b = JSON.stringify(JSON.stringify(a));
console.log(b);
\ No newline at end of file
......@@ -230,7 +230,7 @@
keyword:this.searchValue
}).then(res=>{
console.log(res);
// this.resultList=res.data || [];
this.resultList=res.data || {'tool':[],'content':[],'product':[]};
});
}
}
......
......@@ -131,6 +131,7 @@
<script>
import { brandObj } from '../mock/brand';
import { fetchBrandJSON } from '../api/brand';
export default {
data() {
return {
......@@ -157,15 +158,15 @@ export default {
}
},
mounted() {
this.swiperList = brandObj.swiperList;
this.productTabList = brandObj.productTabList;
this.productInfoList = brandObj.productInfoList;
this.esgInfoList = brandObj.esgInfoList;
this.qrInfoList = brandObj.qrInfoList;
this.ipDesc = brandObj.ipDesc;
this.swiperIconList = brandObj.swiperIconList;
this.currentVideoUrl=brandObj.videoUrl;
// this.initBrandInfo();
// this.swiperList = brandObj.swiperList;
// this.productTabList = brandObj.productTabList;
// this.productInfoList = brandObj.productInfoList;
// this.esgInfoList = brandObj.esgInfoList;
// this.qrInfoList = brandObj.qrInfoList;
// this.ipDesc = brandObj.ipDesc;
// this.swiperIconList = brandObj.swiperIconList;
// this.currentVideoUrl=brandObj.videoUrl;
this.initBrandInfo();
},
methods: {
async initBrandInfo(){
......@@ -173,7 +174,7 @@ export default {
if(data){
this.swiperList = data.swiperList;
this.productTabList = data.productTabList;
this.productInfoList = data.productInfoList;
this.productInfoList = data.product;
this.esgInfoList = data.esgInfoList;
this.qrInfoList = data.qrInfoList;
this.ipDesc = data.ipDesc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment