完成首页数据
|
@ -2,34 +2,32 @@ export default {
|
|||
index: {
|
||||
banner: {
|
||||
url: "/index/banner",
|
||||
method: "post",
|
||||
auth: false,
|
||||
},
|
||||
notify: {
|
||||
url: "/index/message",
|
||||
},
|
||||
install: {
|
||||
url: "/index/category1",
|
||||
},
|
||||
aftermarket: {
|
||||
url: "/index/category2",
|
||||
},
|
||||
},
|
||||
user: {
|
||||
sendCode: {
|
||||
url: "/public/send",
|
||||
method: "post",
|
||||
auth: false,
|
||||
},
|
||||
openId: {
|
||||
url: "/public/getopenid",
|
||||
method: "post",
|
||||
auth: false,
|
||||
},
|
||||
register: {
|
||||
url: "/public/register",
|
||||
method: "post",
|
||||
auth: false,
|
||||
},
|
||||
login: {
|
||||
url: "/public/login",
|
||||
method: "post",
|
||||
auth: false,
|
||||
},
|
||||
info: {
|
||||
url: "/user/getuserinfo",
|
||||
method: "post",
|
||||
auth: true,
|
||||
}
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<widget-search />
|
||||
</view>
|
||||
<view class="banner">
|
||||
<app-banner :list="bannerList" @onClickItem="clickBanner" />
|
||||
<app-banner :list="bannerList" />
|
||||
</view>
|
||||
<view class="notify">
|
||||
<view class="icon">
|
||||
|
@ -87,118 +87,10 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
utils: this.$utils,
|
||||
bannerList: [
|
||||
{
|
||||
id: 1,
|
||||
image: require("@/static/temp/banner.png"),
|
||||
title: "",
|
||||
page: "",
|
||||
},
|
||||
],
|
||||
notifyList: [
|
||||
{
|
||||
id: 1,
|
||||
title: "恭喜成都市王先生订购xxxxxx服务一套",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "恭喜成都市王先生订购xxxxxx服务一套",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "恭喜成都市王先生订购xxxxxx服务一套",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "恭喜成都市王先生订购xxxxxx服务一套",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: "恭喜成都市王先生订购xxxxxx服务一套",
|
||||
},
|
||||
],
|
||||
installServiceList: [
|
||||
{
|
||||
id: 1,
|
||||
icon: require("@/static/temp/index/1.png"),
|
||||
title: "电器安装",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
icon: require("@/static/temp/index/2.png"),
|
||||
title: "卫浴吊顶安装",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
icon: require("@/static/temp/index/3.png"),
|
||||
title: "水电安装",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
icon: require("@/static/temp/index/4.png"),
|
||||
title: "烟道钻孔",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
icon: require("@/static/temp/index/5.png"),
|
||||
title: "家具安装",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
icon: require("@/static/temp/index/6.png"),
|
||||
title: "门窗五金安装",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
icon: require("@/static/temp/index/7.png"),
|
||||
title: "地面墙体安装",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
icon: require("@/static/temp/index/8.png"),
|
||||
title: "其他安装",
|
||||
page: "/pages/service/other/other",
|
||||
},
|
||||
],
|
||||
aftermarketServiceList: [
|
||||
{
|
||||
id: 9,
|
||||
icon: require("@/static/temp/index/a1.png"),
|
||||
title: "电器维护",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
icon: require("@/static/temp/index/a2.png"),
|
||||
title: "家电清洗",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
icon: require("@/static/temp/index/a3.png"),
|
||||
title: "保洁家政",
|
||||
page: "/pages/demand/demand",
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
icon: require("@/static/temp/index/a4.png"),
|
||||
title: "管道疏通",
|
||||
page: "",
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
icon: require("@/static/temp/index/a5.png"),
|
||||
title: "货物配送",
|
||||
page: "/pages/service/other/distribution",
|
||||
},
|
||||
],
|
||||
bannerList: [],
|
||||
notifyList: [],
|
||||
installServiceList: [],
|
||||
aftermarketServiceList: [],
|
||||
bussinessServiceList: [
|
||||
{
|
||||
id: 14,
|
||||
|
@ -220,16 +112,58 @@ export default {
|
|||
AppBanner,
|
||||
WidgetSearch,
|
||||
},
|
||||
onLoad() {},
|
||||
onLoad() {
|
||||
// 轮播
|
||||
this.$request({
|
||||
api: "index.banner",
|
||||
}).then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
this.bannerList.push({
|
||||
image: item.image,
|
||||
});
|
||||
});
|
||||
});
|
||||
// 公告
|
||||
this.$request({
|
||||
api: "index.notify",
|
||||
}).then((response) => {
|
||||
this.notifyList = [
|
||||
{
|
||||
title: response.data.message,
|
||||
},
|
||||
];
|
||||
});
|
||||
// 服务
|
||||
this.$request({
|
||||
api: "index.install",
|
||||
}).then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
this.installServiceList.push({
|
||||
id: item.id,
|
||||
title: item.name,
|
||||
icon: item.more,
|
||||
page: "",
|
||||
});
|
||||
});
|
||||
});
|
||||
this.$request({
|
||||
api: "index.aftermarket",
|
||||
}).then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
this.aftermarketServiceList.push({
|
||||
id: item.id,
|
||||
title: item.name,
|
||||
icon: item.more,
|
||||
page: "",
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
onShow() {},
|
||||
onReady() {},
|
||||
onReachBottom() {},
|
||||
onPullDownRefresh() {},
|
||||
methods: {
|
||||
clickBanner(item) {
|
||||
console.log(item);
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |