多商户店铺头部优化,并支持diy

master
gongfuxiang 2025-08-11 21:07:53 +08:00
parent 2558a6f306
commit 7ac531ef5b
8 changed files with 97 additions and 26 deletions

View File

@ -92,6 +92,7 @@
});
},
methods: {
//
top_nav_left_back_event() {
app.globalData.page_back_prev_event();
},

View File

@ -729,7 +729,7 @@
"54k10s": "Long press WeChat for consultation",
"vj4nom": "Long press line to consult",
"q42ger": "Product search",
"8q6345": "Please enter product keywords",
"8q6345": "Product keywords",
"rdxjvh": "Person sign in, total",
"15i191": "Integral, total",
"8ua11k": "organize a team",

View File

@ -719,7 +719,7 @@
"54k10s": "长按微信咨询",
"vj4nom": "长按line咨询",
"q42ger": "商品搜索",
"8q6345": "请输入商品关键字",
"8q6345": "商品关键字",
"rdxjvh": "人签到,共",
"15i191": "积分,共",
"8ua11k": "组队",

View File

@ -1254,6 +1254,13 @@
{
"path": "detail/detail",
"style": {
// #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || APP
"navigationStyle": "custom",
// #endif
// #ifdef MP-ALIPAY
"transparentTitle": "auto",
"titlePenetrate": "YES",
// #endif
"navigationBarTitleText": "",
"usingComponents": {
"component-layout": "/pages/design/components/layout/layout",
@ -1295,6 +1302,13 @@
{
"path": "design/design",
"style": {
// #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || APP
"navigationStyle": "custom",
// #endif
// #ifdef MP-ALIPAY
"transparentTitle": "auto",
"titlePenetrate": "YES",
// #endif
"enablePullDownRefresh": true,
"usingComponents": {
"component-layout": "/pages/design/components/layout/layout"

View File

@ -3,12 +3,11 @@
<view :style="page_img_style">
<scroll-view :scroll-top="scroll_num_top" :scroll-y="true" class="ht" @scroll="on_scroll_event" @scrolltolower="on_scroll_lower_event" @scrolltoupper="on_scroll_upper_event" lower-threshold="60" scroll-with-animation="true">
<!-- 头部卡槽 -->
<slot name="header">
<!-- 头部小程序兼容 -->
<view class="pr header">
<component-diy-header :propKey="header_data.id" :propValue="header_data.com_data" :propScrollTop="head_scroll_top" @onLocationBack="choice_location_back"></component-diy-header>
</view>
</slot>
<slot name="header"></slot>
<!-- 头部小程序兼容 -->
<view v-if="propIsHeader" class="pr header">
<component-diy-header :propKey="header_data.id" :propValue="header_data.com_data" :propScrollTop="head_scroll_top" @onLocationBack="choice_location_back"></component-diy-header>
</view>
<view :style="content_padding">
<view class="content flex-col" :style="'padding-top:calc(' + (temp_is_header_top ? temp_header_top + temp_sticky_top + 'px)' : '0px)')">
<view v-for="item in tabs_data" :key="item.key">
@ -184,6 +183,10 @@
type: [String, Number],
default: 0,
},
propIsHeader: {
type: Boolean,
default: true,
}
},
components: {
componentDiyFooter,

View File

@ -13,7 +13,9 @@
<view class="flex-1 flex-width">
<mp-html :content="item.content" />
<view v-if="(item.images || null) != null && item.images.length > 0" class="avatar spacing-mt-10 radius margin-right-sm oh">
<image v-for="(img, i) in item.images" class="wh-auto" @tap="comment_images_show_event" :data-index="i" :data-ix="i + 1" :src="img" mode="aspectFit"></image>
<block v-for="(img, i) in item.images" :key="i">
<image class="wh-auto" @tap="comment_images_show_event" :data-index="i" :data-ix="i + 1" :src="img" mode="aspectFit"></image>
</block>
</view>
</view>
</view>

View File

@ -1,22 +1,26 @@
<template>
<view :class="theme_view">
<!-- 搜索 -->
<view class="flex-row jc-sb align-c padding-main bg-white pr oh">
<view class="flex-row jc-sb align-c padding-main bg-white oh bs-bb z-i search-content" :style="'padding-top:' + (status_bar_height > 0 ? status_bar_height + 5 : 0)+'px;'">
<view @tap="top_nav_left_back_event" class="dis-inline-block padding-right-sm">
<iconfont name="icon-arrow-left" size="40rpx" propClass="pr top-xs z-i"></iconfont>
</view>
<view class="flex-1 wh-auto">
<view class="search flex-row jc-sb align-c round border-color-main bg-white">
<view class="flex-row align-c flex-1 wh-auto padding-left-main">
<iconfont name="icon-search-max" size="28rpx" color="#ccc"></iconfont>
<input class="text-size-md flex-1 wh-auto padding-left-sm" type="done" :placeholder="$t('detail.detail.8q6345')" :value="search_keywords_value || ''" placeholder-class="cr-grey-c" @input="search_keywords_event" />
<input class="text-size-xs flex-1 wh-auto padding-left-sm" type="done" :placeholder="$t('detail.detail.8q6345')" :value="search_keywords_value || ''" placeholder-class="cr-grey-c" @input="search_keywords_event" />
</view>
<button class="bg-main br-main cr-white round text-size-xs" type="default" size="mini" hover-class="none" @tap="search_button_event" :data-value="'/pages/plugins/shop/search/search?shop_id=' + propShop.id + '&'">
{{ is_shop_search_all_search_button == 1 ? $t('design.design.i7725u') : $t('common.search') }}
</button>
</view>
</view>
<view v-if="is_shop_search_all_search_button == 1" class="search-btn padding-left-main flex-row align-c">
<view v-if="is_shop_search_all_search_button == 1" class="search-btn padding-left-sm flex-row align-c">
<button class="bg-main-pair br-main-pair cr-white round text-size-xs" type="default" size="mini" hover-class="none" @tap="search_button_event" data-value="/pages/goods-search/goods-search?">{{$t('design.design.ay7m42')}}</button>
</view>
</view>
<view class="search-content-seat" :style="'margin-top:' + (status_bar_height > 0 ? status_bar_height + 5 : 0)+'px;'"></view>
<!-- 顶部 -->
<view class="header plugins-shop-data-list bg-white oh">
<image :src="propShop.logo" mode="widthFix" class="shop-logo fl border-radius-main cp" @tap="image_show_event" :data-value="propShop.logo"></image>
@ -56,7 +60,7 @@
<!-- 导航 -->
<view v-if="((propShopGoodsCategory || null) != null && propShopGoodsCategory.length > 0) || ((shop_navigation || null) != null && shop_navigation.length > 0)" class="nav bg-white padding-sm flex-row">
<view v-if="propShopGoodsCategory.length > 0" class="item padding-main arrow-bottom nav-shop-category dis-inline-block cp" @tap="nav_shop_category_event">{{$t('recommend-form.recommend-form.203itn')}}</view>
<scroll-view scroll-x class="nav-scroll">
<scroll-view scroll-x class="nav-scroll" :class="propShopGoodsCategory.length > 0 ? 'category-all' : ''">
<view class="pr flex-row">
<block v-if="(shop_navigation || null) != null && shop_navigation.length > 0">
<block v-for="(item, index) in shop_navigation" :key="index">
@ -183,6 +187,13 @@
"status": 0,
"count": 0
},
status_bar_height: 0,
// #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || MP-ALIPAY || APP
status_bar_height: parseInt(app.globalData.get_system_info('statusBarHeight', 0, true)),
// #endif
// #ifdef H5
status_bar_height: 5,
// #endif
};
},
@ -330,6 +341,11 @@
//
chat_event() {
app.globalData.chat_entry_handle(this.propShop.chat_info.chat_url);
},
//
top_nav_left_back_event() {
app.globalData.page_back_prev_event();
}
},
};
@ -344,27 +360,51 @@
}
.search button {
width: 140rpx;
height: 56rpx;
line-height: 56rpx;
width: 124rpx;
height: 52rpx;
line-height: 52rpx;
padding: 0;
}
.search input {
height: 56rpx;
line-height: 56rpx;
height: 50rpx;
line-height: 50rpx;
}
.search-btn {
width: 148rpx;
width: 124rpx;
}
.search-btn button {
width: 100%;
padding: 0;
height: 64rpx;
line-height: 64rpx;
height: 60rpx;
line-height: 60rpx;
}
.search-content {
position: fixed;
left: auto;
top: 0;
width: 100%;
/* #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU */
padding-right: 200rpx;
/* #endif */
}
.search-content-seat {
height: 74rpx;
}
/* #ifdef H5 */
@media only screen and (min-width: 1600rpx) {
.search-content {
width: 1560rpx;
}
}
@media only screen and (min-width: 961px) {
.search-content {
width: 800px;
}
}
/* #endif */
/**
* 头部
@ -396,9 +436,11 @@
*/
.nav .nav-scroll {
float: right;
width: 100%;
}
.nav .nav-scroll.category-all {
width: calc(100% - 172rpx);
}
.nav .nav-scroll .item.par {
height: 56rpx;
line-height: 56rpx;

View File

@ -5,7 +5,7 @@
<block v-if="shop.data_model == 3">
<block v-if="(data || null) != null && (data.diy_data || null) != null && (data.diy_data.config || null) != null">
<!-- diy组件 -->
<component-diy :propValue="data.diy_data.config" :propDataId="data.diy_data.id" :propKey="random_value" @onLocationBack="user_back_choice_location">
<component-diy :propValue="data.diy_data.config" :propDataId="data.diy_data.id" :propKey="random_value" :propIsHeader="(data.is_header || 0) != 1" @onLocationBack="user_back_choice_location">
<!-- 头部 -->
<block v-if="(data.is_header || 0) == 1">
<template slot="header">
@ -30,9 +30,16 @@
</block>
</block>
<!-- 自动和手动模式 -->
<block v-else>
<!-- 头部 -->
<block v-else>
<!-- <component-nav-back :persopName="shop.name || $t('index.index.p4872s')" :propIsShowBack="false" :propIsRightSlot="false" :propFixed="false" propClass="bg-white" propNameClass="cr-black">
<template slot="content">
</template>
</component-nav-back> -->
<!-- 头部 -->
<component-shop-header :propBase="data_base" :propShop="shop" :propShopGoodsCategory="shop_goods_category" :propShopNavigation="shop_navigation" :propShopFavorUser="shop_favor_user"></component-shop-header>
<!-- 数据模式 -->
<!-- 自动模式 -->
@ -103,6 +110,7 @@
import componentBanner from '@/components/slider/slider';
import componentGoodsList from '@/components/goods-list/goods-list';
import componentShopHeader from '@/pages/plugins/shop/components/shop-header/shop-header';
import componentNavBack from '@/components/nav-back/nav-back';
import componentDiy from '@/pages/diy/components/diy/diy';
var common_static_url = app.globalData.get_static_url('common');
export default {
@ -141,6 +149,7 @@
componentBanner,
componentGoodsList,
componentShopHeader,
componentNavBack,
componentDiy
},
onLoad(params) {
@ -275,6 +284,6 @@
}
};
</script>
<style>
<style scoped>
@import './detail.css';
</style>