xiaohaizhao 1 jaar geleden
bovenliggende
commit
4ead5d286a

+ 30 - 0
components/contact.vue

@@ -0,0 +1,30 @@
+<template>
+    <button class="button" open-type="contact">
+        <slot />
+    </button>
+</template>
+
+<script>
+export default {
+    name: "contact",
+}
+</script>
+<style scoped>
+.button {
+    width: 100%;
+    height: 100%;
+    background: none;
+    line-height: 12px;
+}
+
+.button::after {
+    border: none;
+    width: 0;
+    height: 0;
+    border-radius: 0;
+}
+
+.button {
+    border-radius: 0;
+}
+</style>

+ 17 - 5
components/floatBut.vue

@@ -1,6 +1,11 @@
 <template>
-    <view class="float-but" hover-class="navigator-hover" :style="{ 'z-index': zIndex }" @click.stop="click1">
-        {{ text }}
+    <view>
+        <view v-if="isSlot" class="box">
+            <slot />
+        </view>
+        <view v-else class="float-but box" hover-class="navigator-hover" :style="{ 'z-index': zIndex }" @click.stop="click1">
+            {{ text }}
+        </view>
     </view>
 </template>
 
@@ -19,6 +24,10 @@ export default {
         zIndex: {
             type: [String, Number],
             default: 99
+        },
+        isSlot: {
+            type: Boolean,
+            default: false
         }
     },
     data() {
@@ -36,9 +45,6 @@ export default {
 
 <style lang="scss" scoped>
 .float-but {
-    position: fixed;
-    bottom: 120px;
-    right: 10px;
     width: 56px;
     height: 56px;
     line-height: 56px;
@@ -50,4 +56,10 @@ export default {
     font-size: 16px;
     color: #FFFFFF;
 }
+
+.box {
+    position: fixed;
+    bottom: 120px;
+    right: 10px;
+}
 </style>

+ 81 - 0
components/slideshow.vue

@@ -0,0 +1,81 @@
+<template>
+    <view v-if="list.length">
+        <swiper :style="{
+            width: tovw(width),
+            height: tovw(height),
+        }">
+            <swiper-item class="swiper-item" v-for="(item, index) in list" :key="item.list">
+                <u--image @click="onClick(index)" :src="item.cover" :width="tovw(width)" :height="tovw(height)"
+                    mode="aspectFill" :lazy-load="true">
+                    <template v-slot:loading>
+                        <u-loading-icon color="red"></u-loading-icon>
+                    </template>
+                </u--image>
+            </swiper-item>
+        </swiper>
+    </view>
+</template>
+
+<script>
+import { viewImage } from "../utils/settleFiles";
+
+export default {
+    name: 'slideshow',
+    data() {
+        return {
+            width: 375,
+            height: 500,
+            list: [],
+        }
+    },
+    methods: {
+        getBanners(locations, systemclient = 'marketingtool') {
+            return new Promise((resolve, reject) => {
+                this.$Http.basic({
+                    "id": "20240426154302",
+                    "content": {
+                        systemclient,
+                        locations
+                    }
+                }).then(res => {
+                    console.log("获取广告位" + locations, res)
+                    resolve(res.msg)
+                    if (this.cutoff(res.msg)) return;
+                    try {
+                        let list = res.data[locations[0]];
+                        if (list.length) {
+                            if (list[0].dimensional) {
+                                let dimensional = list[0].dimensional.split("*")
+                                this.width = dimensional[0] - 0;
+                                this.height = dimensional[1] - 0;
+                            };
+                            this.list = list.map(v => {
+                                v.cover = this.getSpecifiedImage(v.attinfos[0], 'compressed')
+                                return v
+                            })
+                        }
+                    } catch (error) {
+                    }
+                })
+            })
+        },
+        onClick(index) {
+            let item = this.list[index];
+            console.log("点击广告图", index, item)
+            if (item.hyperlink) {
+                uni.navigateTo({
+                    url: item.hyperlink,
+                    fail: (fail) => {
+                        console.log("跳转失败原因", fail)
+                        viewImage(item.attinfos[0].url)
+                    },
+                })
+            } else {
+                viewImage(item.attinfos[0].url)
+            }
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 2 - 0
main.js

@@ -17,6 +17,8 @@ import appList from './components/appList.vue';
 Vue.component("appList", appList);
 import floatBut from './components/floatBut.vue';
 Vue.component("floatBut", floatBut);
+import slideshow from './components/slideshow.vue';
+Vue.component("slideshow", slideshow);
 
 //挂载接口
 let isDev = process.env.NODE_ENV === 'development';

+ 2 - 2
packageA/advertising/shareable.vue

@@ -17,9 +17,9 @@ export default {
     },
     onLoad(options) {
         if (options.id) {
-            this.id = options.id;
+            this.id = options.id - 0;
             setTimeout(() => {
-                this.$refs.list.getDetail(options.id).then(detail => {
+                this.$refs.list.getDetail(this.id).then(detail => {
                     this.detail = detail;
                 })
             }, 100)

+ 2 - 2
packageA/advertising/unshareable.vue

@@ -16,9 +16,9 @@ export default {
     },
     onLoad(options) {
         if (options.id) {
-            this.id = options.id;
+            this.id = options.id - 0;
             setTimeout(() => {
-                this.$refs.list.getDetail(options.id).then(detail => {
+                this.$refs.list.getDetail(this.id).then(detail => {
                     this.detail = detail;
                 })
             }, 100)

+ 7 - 4
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<index ref="首页" v-show="page == '首页'" />
+		<index ref="首页" v-show="page == '首页'" @changePage="changePage" />
 		<my-case ref="案例" v-show="page == '案例'" />
 		<dataBank ref="资料库" v-show="page == '资料库'" />
 		<school ref="商学院" v-show="page == '商学院'" />
@@ -22,8 +22,8 @@ export default {
 	components: { bottomSuspensionFrame, index, myCase, dataBank, school, product },
 	data() {
 		return {
-			swiperItemID: 'cloud',
-			page: '单品'
+			swiperItemID: 'index',
+			page: '首页'
 		}
 	},
 	onShow() {
@@ -35,13 +35,16 @@ export default {
 		updatePageData(itemId, page) {
 			if (this.$refs[this.page].updatePage) this.$refs.pages.onClick(itemId, page)
 		},
+		changePage(itemId, page, params) {
+			this.$refs.pages.onClick(itemId, page, false, params)
+		},
 		pageChange(detail) {
 			uni.setNavigationBarTitle({
 				title: detail.name,
 			})
 			this.page = detail.name;
 			try {
-				this.$refs[detail.name].init(detail.callBack)
+				this.$refs[detail.name].init(detail.callBack, detail.params)
 			} catch (error) {
 				detail.callBack()
 			}

+ 61 - 4
pages/index/index/index.vue

@@ -1,17 +1,74 @@
 <template>
-    <text>
-        首页
-    </text>
+    <view>
+        <homeShop />
+        <slideshow ref="indexTop" />
+        <apps @appsToPage="appsToPage" />
+        <slideshow ref="indexBottom" />
+        <floatBut isSlot>
+            <contact>
+                <view class="contact">
+                    <view class="iconfont icon-kefu" />
+                    <view class="text">
+                        客服
+                    </view>
+                </view>
+            </contact>
+        </floatBut>
+        <view style="height: 80px;" />
+    </view>
 </template>
 
 <script>
+import homeShop from "../../shop/homeShop.vue"
+import contact from "../../../components/contact"
+import apps from "./modules/apps"
 export default {
+    components: { homeShop, contact, apps },
+    props: {
+        changePage: {
+            type: Function
+        }
+    },
     data() {
         return {
             updatePage: true,
         }
     },
+    methods: {
+        init(callBack) {
+            Promise.all([this.$refs.indexTop.getBanners(['indexTop']), this.$refs.indexBottom.getBanners(['indexBottom'])]).then(res => {
+                callBack()
+                this.updatePage = false;
+            })
+        },
+        appsToPage(id, name, params) {
+            this.$emit("changePage", id, name, params)
+        }
+    },
 }
 </script>
 
-<style></style>
+<style lang="scss" scoped>
+.contact {
+    background: #EDD27E;
+    width: 50px;
+    height: 50px;
+    border-radius: 50%;
+    padding-top: 6px;
+    box-sizing: border-box;
+
+    .iconfont {
+        color: #433300;
+        font-size: 20px;
+        line-height: 20px;
+
+    }
+
+    .text {
+        font-family: PingFang SC, PingFang SC;
+        font-size: 12px;
+        color: #5D4808;
+        line-height: 17px;
+    }
+}
+</style>

+ 161 - 0
pages/index/index/modules/apps.vue

@@ -0,0 +1,161 @@
+<template>
+    <view class="apps-box">
+        <view class="item" v-for="item in list" :key="item.label" hover-class="navigator-hover" @click="onClick(item)">
+            <view class="label">
+                {{ item.label }}
+                <view class="backg" :style="{ background: item.color }" />
+            </view>
+            <view class="introduce u-line-2">
+                {{ item.introduce }}
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    name: "apps",
+    props: {
+        appsToPage: {
+            type: Function
+        }
+    },
+    data() {
+        return {
+            list: [{
+                label: "单品",
+                introduce: "电器 / 吊顶 / 墙面 / 木制品 \n渠道 / 工程",
+                itemId: "cloud"
+            }, {
+                label: "商品",
+                introduce: "总部直通车  千万大返利",
+            }, {
+                label: "图库",
+                introduce: "电器 / 厨卫 / 阳台 / 背景墙 /顶墙",
+                itemId: "index",
+                page: "案例",
+                params: {
+                    active: '图库'
+                }
+            }, {
+                label: "实景/设计分享图",
+                introduce: "总部精选 / 实景图 / 设计图",
+                itemId: "index",
+                page: "案例",
+                params: {
+                    active: '实景案例'
+                }
+            }, {
+                label: "资料库",
+                introduce: "单品 / 通知 / 介绍 / 画册 / 物料\n视频 / 说明书等",
+                itemId: "cloud",
+            }, {
+                label: "商学院",
+                introduce: "产品 / 销售 / 管理 / 设计 / 考试等",
+                itemId: "cloud",
+            }, {
+                label: "6C红人服务",
+                introduce: "装修报价 / 老房改造 / 精装房焕新\n品质服务",
+                path: "/packageA/advertising/shareable?id=465"
+            }, {
+                label: "免费设计",
+                introduce: "0元领取全屋顶墙设计方案\n免费量尺寸 / 免费设计",
+                path: "/packageA/advertising/shareable?id=147"
+            }, {
+                label: "视频",
+                introduce: "品牌 / 产品 / 安装 / 服务等视频",
+                itemId: "index",
+            }, {
+                label: "云C+工作台",
+                introduce: "预约名单 / 人员管理 / 活动 \n门店 / 商城管理 / 排行榜等",
+            }],
+        }
+    },
+    created() {
+        this.dye(this.list)
+    },
+    methods: {
+        onClick(item) {
+            if (item.itemId) {
+                this.$emit("appsToPage", item.itemId, item.page || item.label, item.params || '')
+            } else if (item.path) {
+                uni.navigateTo({
+                    url: item.path,
+                })
+            } else {
+                uni.showToast({
+                    title: "功能尚在开发中",
+                    icon: "none"
+                })
+            }
+        },
+        dye(list, num = 2) {
+            let colors = ['linear-gradient( 270deg, rgba(255,255,255,0) 0%, #E18FFA 100%)',
+                "linear-gradient( 270deg, rgba(255,255,255,0) 0%, #FD8C90 100%)",
+                "linear-gradient( 270deg, rgba(255,255,255,0) 0%, #9191FA 100%)",
+                "linear-gradient( 270deg, rgba(255,255,255,0) 0%, #8CD6F7 100%)",
+                "linear-gradient( 270deg, rgba(255,255,255,0) 0%, #5CD96B 100%)",
+                "linear-gradient( 270deg, rgba(255,255,255,0) 0%, #D4D418 100%)"],
+                count = num - 1,
+                index = 0;
+            this.list = list.map((v, i) => {
+                if (i > count) {
+                    count += num;
+                    index += 1;
+                }
+                v.color = colors[index % colors.length]
+                return v
+            })
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.apps-box {
+    display: flex;
+    flex-wrap: wrap;
+    padding: 10px;
+    box-sizing: border-box;
+    justify-content: space-between;
+    padding-top: 0;
+
+    .item {
+        width: 173px;
+        height: 94px;
+        background: #FFFFFF;
+        border-radius: 8px;
+        margin-top: 10px;
+        box-sizing: border-box;
+        padding: 15px;
+        padding-right: 10px;
+
+        .label {
+            position: relative;
+            line-height: 24px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-weight: bold;
+            font-size: 16px;
+            color: #333333;
+
+            .backg {
+                position: absolute;
+                width: 40px;
+                height: 6px;
+                border-radius: 5px;
+                left: 0;
+                bottom: 0;
+            }
+        }
+
+        .introduce {
+            line-height: 15px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-size: 10px;
+            color: #999999;
+            margin-top: 10px;
+            white-space: pre-wrap;
+        }
+    }
+}
+</style>

+ 10 - 2
pages/index/index/myCase.vue

@@ -24,7 +24,7 @@ export default {
     data() {
         return {
             updatePage: true,
-            tabsActive: "设计美家",
+            tabsActive: "图库",
             tabs: ['图库', '设计美家', '实景案例', '全景720'],
             list: [],
             appList: [],
@@ -37,7 +37,15 @@ export default {
         }
     },
     methods: {
-        init(callBack) {
+        init(callBack, params) {
+            if (params) {
+                this.tabsActive = params.active;
+                uni.pageScrollTo({
+                    scrollTop: 0,
+                    duration: 0,
+                })
+            }
+            console.log(this.tabsActive)
             if (!this.$refs[this.tabsActive].isInitialize) this.$refs[this.tabsActive].getList(true).then(res => {
                 callBack()
                 this.updatePage = false;

+ 2 - 2
pages/index/modules/bottomSuspensionFrame.vue

@@ -65,7 +65,7 @@ export default {
         // #endif
     },
     methods: {
-        onClick(current, name, update = false) {
+        onClick(current, name, update = false, params = null) {
             if (name == '首页') current = 'index';
             const item = this[current].find(v => v.name == name),
                 that = this;
@@ -77,7 +77,7 @@ export default {
             this.current = current;
             this.showPageName = name;
             this.$emit("onChange", {
-                current, name, update, callBack
+                current, name, update, callBack, params
             })
             function callBack(loading = false) {
                 item.loading = loading;

+ 68 - 0
pages/shop/homeShop.vue

@@ -0,0 +1,68 @@
+<template>
+    <view class="shop" v-if="detail.storename">
+        <view class="shop-name">
+            {{ detail.storename }} <text class="iconfont icon-a-wodetiaozhuan" />
+        </view>
+        <view class="shop-distance">
+            距您{{ detail.distance }}
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    name: "homeShop",
+    data() {
+        return {
+            detail: {
+                storename: "",
+                distance: ""
+            }
+        }
+    },
+    created() {
+        this.getLocation().then(s => {
+            console.log("获取地理位置信息", s)
+            this.$Http.basic({
+                "id": 20240416153202,
+                "content": {
+                    "longitude": s.longitude,
+                    "latitude": s.latitude
+                }
+            }).then(res => {
+                console.log("获取最近门店信息", res)
+                if (this.cutoff(res.msg)) return;
+                res.data.distance = res.data.distance > 1000 ? ((res.data.distance / 1000).toFixed(2) - 0) + 'km' : ((res.data.distance).toFixed(2) - 0) + 'm'
+                this.detail = res.data;
+            })
+        })
+    },
+
+}
+</script>
+
+<style lang="scss" scoped>
+.shop {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 100vw;
+    height: 45px;
+    background: #F7F7F7;
+    padding: 0 10px;
+    box-sizing: border-box;
+
+    &-name {
+        font-family: PingFang SC, PingFang SC;
+        font-size: 14px;
+        color: #333333;
+    }
+
+    &-distance {
+        font-family: PingFang SC, PingFang SC;
+        font-size: 12px;
+        color: #666666;
+    }
+
+}
+</style>

+ 7 - 31
static/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4131149 */
-  src: url('//at.alicdn.com/t/c/font_4131149_rjkihcpa1g.woff2?t=1713496091921') format('woff2'),
-       url('//at.alicdn.com/t/c/font_4131149_rjkihcpa1g.woff?t=1713496091921') format('woff'),
-       url('//at.alicdn.com/t/c/font_4131149_rjkihcpa1g.ttf?t=1713496091921') format('truetype');
+  src: url('//at.alicdn.com/t/c/font_4131149_vvqgurcstc.woff2?t=1714112273836') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4131149_vvqgurcstc.woff?t=1714112273836') format('woff'),
+       url('//at.alicdn.com/t/c/font_4131149_vvqgurcstc.ttf?t=1714112273836') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-a-wodetiaozhuan:before {
+  content: "\e647";
+}
+
 .icon-dianhua-hong:before {
   content: "\e6d4";
 }
@@ -29,22 +33,10 @@
   content: "\e6cf";
 }
 
-.icon-shoucang-hui:before {
-  content: "\e6d0";
-}
-
-.icon-dianzan-hui:before {
-  content: "\e6d1";
-}
-
 .icon-a-720quanjing-bai:before {
   content: "\e6ce";
 }
 
-.icon-a-720quanjing-hong:before {
-  content: "\e6cd";
-}
-
 .icon-weishoucang:before {
   content: "\e6c9";
 }
@@ -97,10 +89,6 @@
   content: "\e6c0";
 }
 
-.icon-touxiangnan-44:before {
-  content: "\e6bd";
-}
-
 .icon-shanchu:before {
   content: "\e6be";
 }
@@ -137,18 +125,6 @@
   content: "\e6b8";
 }
 
-.icon-a-yuncxuanzhong:before {
-  content: "\e6b4";
-}
-
-.icon-a-yuncweixuanzhong:before {
-  content: "\e6b5";
-}
-
-.icon-zanwushuju:before {
-  content: "\e6b1";
-}
-
 .icon-tonggao:before {
   content: "\e6b2";
 }

+ 1 - 0
utils/tool.js

@@ -30,6 +30,7 @@ function mount() {
                         }
                     },
                     fail: err => {
+                        console.log("获取位置失败", err)
                         uni.hideLoading();
                         query()
                     }