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

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

parent 74249ea7
...@@ -3,10 +3,5 @@ const { ...@@ -3,10 +3,5 @@ const {
api api
} = requestModule; } = requestModule;
/**
* 获取首页信息
* @returns
*/
export const fetchHomeInfo = () => api.get('/c/user/index');
export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home'}); export const fetchBrandJSON = () => api.get('/c/front/content',{type:'brand'});
\ No newline at end of file \ No newline at end of file
...@@ -31,7 +31,7 @@ export const brandObj = { ...@@ -31,7 +31,7 @@ export const brandObj = {
"productTabList": [ "productTabList": [
"全部", "母婴全阶", "功能营养", "儿童产品", "北纬47°" "全部", "母婴全阶", "功能营养", "儿童产品", "北纬47°"
], ],
"productInfoList": [ "product": [
[ [
{ {
"bgUrl": "brandpage/pic_0_1.png", "bgUrl": "brandpage/pic_0_1.png",
......
This diff is collapsed.
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
keyword:this.searchValue keyword:this.searchValue
}).then(res=>{ }).then(res=>{
console.log(res); console.log(res);
// this.resultList=res.data || []; this.resultList=res.data || {'tool':[],'content':[],'product':[]};
}); });
} }
} }
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
<script> <script>
import { brandObj } from '../mock/brand'; import { brandObj } from '../mock/brand';
import { fetchBrandJSON } from '../api/brand';
export default { export default {
data() { data() {
return { return {
...@@ -157,15 +158,15 @@ export default { ...@@ -157,15 +158,15 @@ export default {
} }
}, },
mounted() { mounted() {
this.swiperList = brandObj.swiperList; // this.swiperList = brandObj.swiperList;
this.productTabList = brandObj.productTabList; // this.productTabList = brandObj.productTabList;
this.productInfoList = brandObj.productInfoList; // this.productInfoList = brandObj.productInfoList;
this.esgInfoList = brandObj.esgInfoList; // this.esgInfoList = brandObj.esgInfoList;
this.qrInfoList = brandObj.qrInfoList; // this.qrInfoList = brandObj.qrInfoList;
this.ipDesc = brandObj.ipDesc; // this.ipDesc = brandObj.ipDesc;
this.swiperIconList = brandObj.swiperIconList; // this.swiperIconList = brandObj.swiperIconList;
this.currentVideoUrl=brandObj.videoUrl; // this.currentVideoUrl=brandObj.videoUrl;
// this.initBrandInfo(); this.initBrandInfo();
}, },
methods: { methods: {
async initBrandInfo(){ async initBrandInfo(){
...@@ -173,7 +174,7 @@ export default { ...@@ -173,7 +174,7 @@ export default {
if(data){ if(data){
this.swiperList = data.swiperList; this.swiperList = data.swiperList;
this.productTabList = data.productTabList; this.productTabList = data.productTabList;
this.productInfoList = data.productInfoList; this.productInfoList = data.product;
this.esgInfoList = data.esgInfoList; this.esgInfoList = data.esgInfoList;
this.qrInfoList = data.qrInfoList; this.qrInfoList = data.qrInfoList;
this.ipDesc = data.ipDesc; 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