|
|
@@ -1,37 +1,90 @@
|
|
|
<template>
|
|
|
<div class="app-main app-content">
|
|
|
- <button @click="toPay">去支付页</button>
|
|
|
- <button @click="$util.pageTo('/pages/callback/index')">支付回调</button>
|
|
|
+ <!-- <button @click="toPay">去支付页</button>
|
|
|
<button @click="$util.pageTo('/pages/user/register')">注册</button>
|
|
|
- <button @click="$util.pageTo('/pages/chat/index')">聊天</button>
|
|
|
+ <button @click="$util.pageTo('/pages/chat/index')">聊天</button>-->
|
|
|
<!-- <app-footer /> -->
|
|
|
+ <app-swiper v-if="!$util.isEmpty(ad)" :list="ad" @detail="adDetailFn" />
|
|
|
+ <block v-if="!$util.isEmpty(category)">
|
|
|
+ <div class="goods-module" v-for="(item, index) in category" :key="index">
|
|
|
+ <goods-list-big v-if="item.showRow == 1" :info="item" />
|
|
|
+ <!-- <goods-list-middle :list="[]" /> -->
|
|
|
+ <goods-list-small v-if="item.showRow == 2" :info="item" />
|
|
|
+ </div>
|
|
|
+ </block>
|
|
|
+ <app-trademark />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import AppSwiper from '@/components/app-swiper'
|
|
|
+import AppTrademark from '@/components/module/app-trademark'
|
|
|
+// 商品组件
|
|
|
+import goodsListBig from '@/pages/home/components/goods-list-big'
|
|
|
+import goodsListMiddle from '@/pages/home/components/goods-list-middle'
|
|
|
+import goodsListSmall from '@/pages/home/components/goods-list-small'
|
|
|
// import AppFooter from '@/components/app-footer'
|
|
|
+// api
|
|
|
+import { getMainIndex } from '@/api/home'
|
|
|
export default {
|
|
|
name: 'home',
|
|
|
components: {
|
|
|
+ AppSwiper,
|
|
|
+ AppTrademark,
|
|
|
+ goodsListBig,
|
|
|
+ goodsListMiddle,
|
|
|
+ goodsListSmall
|
|
|
// AppFooter
|
|
|
},
|
|
|
data() {
|
|
|
- return {}
|
|
|
+ return {
|
|
|
+ data: {},
|
|
|
+ ad: [],
|
|
|
+ category: [],
|
|
|
+ columnStyle: null
|
|
|
+ }
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: '国兰花尚'
|
|
|
- })
|
|
|
+ this.init()
|
|
|
},
|
|
|
methods: {
|
|
|
- toPay() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/pay/index'
|
|
|
+ init() {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '国兰花尚'
|
|
|
+ })
|
|
|
+ this._detail()
|
|
|
+ },
|
|
|
+ _detail() {
|
|
|
+ getMainIndex().then(res => {
|
|
|
+ this.data = res.data
|
|
|
+ if (this.$util.isEmpty(res.data)) return false
|
|
|
+ this.ad = res.data.ad.map(e => {
|
|
|
+ e.img = e.adImg
|
|
|
+ return e
|
|
|
+ })
|
|
|
+ this.category = res.data.category
|
|
|
+ this.columnStyle = res.data.columnStyle
|
|
|
})
|
|
|
+ },
|
|
|
+ // operate
|
|
|
+ adDetailFn(item) {
|
|
|
+ location.href = item.url
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+ .app-content {
|
|
|
+ // padding-bottom: 100px;
|
|
|
+ }
|
|
|
+ .goods-module {
|
|
|
+ padding: 0 20px;
|
|
|
+ margin-top: 40px;
|
|
|
+ /deep/.buy-com-btn {
|
|
|
+ font-size: 24px;
|
|
|
+ padding: 10px 20px 12px;
|
|
|
+ box-shadow: 8px 8px 20px #eee;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|