源文件

This commit is contained in:
gyq
2025-04-25 09:49:53 +08:00
commit 791d82b9e3
640 changed files with 130029 additions and 0 deletions

View File

@@ -0,0 +1,157 @@
<template>
<view :class="theme_view">
<view class="padding-main">
<form @submit="form_submit" class="form-container">
<view class="border-radius-main bg-white padding-main padding-bottom-xxxxl spacing-mb">
<view class="title fw-b text-size margin-vertical-xxxl">{{$t('common.verification_text')}}</view>
<view class="flex-row align-c padding-bottom-xl">
<!-- #ifndef H5 -->
<view class="margin-right" @tap="scan_event">
<uni-icons type="scan" size="56rpx" color="#666"></uni-icons>
</view>
<!-- #endif -->
<input type="text" class="wh-auto check-value" :placeholder="$t('common.verification_message')" placeholder-class="cr-grey-c" :value="check_value" @input="check_event" />
</view>
</view>
<view class="padding-main">
<button type="default" form-type="submit" hover-class="none" class="br-main bg-main cr-white round text-size-lg" :disabled="form_submit_loading">{{$t('common.confirm')}}</button>
</view>
<view class="padding-lg margin-top-xl text-size-lg tc">
<text v-if="(error_msg || null) != null" class="cr-red">{{error_msg}}</text>
<text v-if="(success_msg || null) != null" class="cr-green">{{success_msg}}</text>
</view>
</form>
</view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
form_submit_loading: false,
check_value: '',
error_msg: '',
success_msg: ''
};
},
components: {
componentCommon
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 数据加载
this.init();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
methods: {
// 获取数据
init() {
app.globalData.get_user_info(this, "init");
},
// 输入事件
check_event(e) {
this.setData({
check_value: e.detail.value
});
},
// 扫码事件
scan_event(e) {
var self = this;
uni.scanCode({
success: function (res) {
if((res.result || null) != null) {
self.setData({
check_value: res.result
});
self.form_submit();
}
}
});
},
// 表单提交
form_submit() {
this.setData({
error_msg: '',
success_msg: ''
});
var form_data = {
extraction_code: this.check_value
}
var validation = [
{ fields: 'extraction_code', msg: this.$t('common.verification_message') }
];
if (app.globalData.fields_check(form_data, validation)) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
this.setData({
form_submit_loading: true
});
var temp_code = this.check_value;
uni.request({
url: app.globalData.get_request_url('verification', 'adminorder', 'shop'),
method: 'POST',
data: form_data,
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
this.setData({
form_submit_loading: false,
check_value: '',
error_msg: '',
success_msg: res.data.msg+''+temp_code+'',
});
} else {
if (app.globalData.is_login_check(res.data, this, 'form_submit')) {
this.setData({
form_submit_loading: false,
error_msg: res.data.msg+''+temp_code+'',
success_msg: '',
});
}
}
},
fail: () => {
uni.hideLoading();
this.setData({
form_submit_loading: false,
error_msg: this.$t('common.internet_error_tips')+''+temp_code+'',
success_msg: '',
});
},
});
}
}
}
};
</script>
<style scoped>
input.check-value {
height: 100rpx;
line-height: 100rpx;
font-size: 44rpx;
}
</style>

View File

@@ -0,0 +1,468 @@
<template>
<view :class="theme_view">
<!-- 搜索 -->
<view class="flex-row jc-sb align-c padding-main bg-white pr oh">
<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" />
</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">
<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="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>
<view class="base fr item">
<view class="shop-title single-text">
<!-- 认证信息 -->
<view v-if="(propBase.is_enable_auth || 0) == 1 && ((propShop.auth_type != -1 && (propShop.auth_type_msg || null) != null) || ((propShop.bond_status || 0) == 1 && (propShop.bond_status_msg || null) != null))" class="auth-icon dis-inline-block">
<!-- 实名认证 -->
<block v-if="propShop.auth_type != -1 && (propShop.auth_type_msg || null) != null">
<image :src="propShop.auth_type == 0 ? propBase.shop_auth_personal_icon : propBase.shop_auth_company_icon" class="icon va-m" mode="aspectFill" :data-value="'/pages/plugins/shop/license/license?id=' + propShop.id" @tap="url_event"></image>
</block>
<!-- 保证金认证 -->
<block v-if="(propShop.bond_status || 0) == 1 && (propShop.bond_status_msg || null) != null">
<image :src="propBase.shop_auth_bond_icon" class="icon va-m" mode="aspectFill"></image>
</block>
</view>
<!-- 标题 -->
<text class="fw-b text-size va-m">{{ propShop.name }}</text>
</view>
<view class="base-bottom oh margin-top-sm text-size-xs">
<!-- 在线客服 -->
<view v-if="(propBase.is_service_info || 0) == 1" class="fl margin-right-xxl cp" @tap="popup_service_open_event">
<image class="va-m margin-right-sm" :src="common_static_url + 'customer-service-icon.png'" mode="scaleToFill"></image>
<text class="va-m cr-base">{{$t('design.design.21kak7')}}</text>
</view>
<!-- 收藏 -->
<view class="fl single-text cp" @tap="shop_favor_event">
<image class="va-m margin-right-sm" :src="common_static_url + 'favor' + (shop_favor_info.status == 1 ? '-active' : '') + '-icon.png'" mode="scaleToFill"></image>
<text :class="'va-m ' + (shop_favor_info.status == 1 ? 'cr-main' : '')">{{ shop_favor_info.text }}({{ shop_favor_info.count }})</text>
</view>
<!-- 评分 -->
<view v-if="(propShop.score_data || null) != null" class="fl margin-left-xxl">
<view class="dis-inline-block va-m">
<uni-rate :value="propShop.score_data.value" :readonly="true" :is-fill="false" :size="14" />
</view>
<text class="va-m cr-red">{{ propShop.score_data.value }}{{$t('design.design.745kx2')}}</text>
</view>
</view>
</view>
</view>
<!-- 导航 -->
<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">
<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">
<block v-if="(item.items || null) == null || item.items.length == 0">
<view class="item par dis-inline-block cp" @tap="nav_event" :data-value="item.url" :data-index="index">{{ item.name }}</view>
</block>
<block v-else>
<view class="item par dis-inline-block cp" @tap="nav_event" :data-index="index">{{ item.name }}</view>
<view v-if="(item.items_status || 0) == 1" class="nav-items pf oh bg-white cr-base">
<block v-for="(items, index2) in item.items" :key="index2">
<view class="item cp" @tap="nav_event" :data-value="items.url" :data-index="index" :data-indexs="index2">{{ items.name }}</view>
</block>
</view>
</block>
</block>
</block>
</view>
</scroll-view>
<view v-if="nav_category_status" class="nav-category bg-white pa">
<scroll-view scroll-y class="category-scroll">
<block v-if="(propShopGoodsCategory || null) != null && propShopGoodsCategory.length > 0">
<block v-for="(item, index) in propShopGoodsCategory" :key="index">
<view class="item dis-block cr-base single-text cp" @tap="shop_category_event" :data-value="item.id">{{ item.name }}</view>
<block v-if="(item.items || null) != null && item.items.length > 0">
<view v-for="(item2, index2) in item.items" :key="index2" class="padding-left-xl">
<view class="item dis-block cr-base single-text cp" @tap="shop_category_event" :data-value="item2.id">{{ item2.name }}</view>
</view>
</block>
</block>
</block>
<block v-else>
<view class="padding-top-xxl padding-bottom-xxl cr-grey">{{$t('design.design.83occ4')}}</view>
</block>
</scroll-view>
</view>
</view>
<!-- 客服弹窗 -->
<component-popup :propShow="popup_service_status" propPosition="bottom" @onclose="popup_service_close_event">
<view class="padding-top-main bg-white">
<view class="padding-horizontal-main">
<view class="close oh">
<view class="fr" @tap.stop="popup_service_close_event">
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
</view>
</view>
</view>
<view class="popup-service-container">
<view v-if="(propShop || null) != null && (propBase || null) != null && (propBase.is_service_info || 0) == 1" class="header-service">
<view v-if="(propShop.chat_info || null) != null" class="item padding-main single-text">
<text class="va-m">{{$t('detail.detail.r4124d')}}</text>
<view class="dis-inline-block chat-info cp" @tap="chat_event">
<image class="dis-inline-block va-m" :src="propShop.chat_info.icon" mode="scaleToFill"></image>
<text class="margin-left-sm va-m cr-blue" :data-value="propShop.chat_info.chat_url">{{ propShop.chat_info.name }}</text>
</view>
</view>
<view v-if="(propShop.service_qq || null) != null" class="item padding-main br-t-f9 single-text">
<text>Q Q</text>
<text class="cp" @tap="text_copy_event" :data-value="propShop.service_qq">{{ propShop.service_qq }}</text>
</view>
<view v-if="(propShop.service_tel || null) != null" class="item padding-main br-t-f9 single-text">
<text>{{$t('order.order.7dxbm5')}}</text>
<text class="cp" @tap="tel_event" :data-value="propShop.service_tel">{{ propShop.service_tel }}</text>
</view>
<view v-if="(propShop.open_week_name || null) != null && (propShop.close_week_name || null) != null" class="item padding-main br-t-f9 single-text">
<text>{{$t('article-detail.article-detail.728374')}}</text>
<text class="cp" @tap="text_copy_event" :data-value="propShop.open_week_name + $t('design.design.gv16tj') + propShop.close_week_name + '' + propShop.open_time + '-' + propShop.close_time">{{ propShop.open_week_name }}{{$t('detail.detail.324777')}}{{ propShop.close_week_name }}{{ propShop.open_time }}-{{ propShop.close_time }}</text>
</view>
<view v-if="(propShop.service_weixin_qrcode || null) != null || (propShop.service_line_qrcode || null) != null" class="oh qrcode tc br-t-f9 padding-top-main">
<view v-if="(propShop.service_weixin_qrcode || null) != null" class="item padding-bottom-lg dis-inline-block">
<image class="radius cp" :src="propShop.service_weixin_qrcode" mode="scaleToFill" @tap="image_show_event" :data-value="propShop.service_weixin_qrcode"></image>
<view>{{$t('detail.detail.54k10s')}}</view>
</view>
<view v-if="(propShop.service_line_qrcode || null) != null" class="item padding-bottom-lg dis-inline-block">
<image class="radius cp" :src="propShop.service_line_qrcode" mode="scaleToFill" @tap="image_show_event" :data-value="propShop.service_line_qrcode"></image>
<view>{{$t('detail.detail.vj4nom')}}</view>
</view>
</view>
</view>
</view>
</view>
</component-popup>
</view>
</template>
<script>
const app = getApp();
import componentPopup from '@/components/popup/popup';
var common_static_url = app.globalData.get_static_url('common');
export default {
props: {
propBase: {
type: [Object,String],
default: '',
},
propShop: {
type: [Object,String],
default: '',
},
propShopGoodsCategory: {
type: [Array,String],
default: '',
},
propShopNavigation: {
type: [Array,String],
default: '',
},
propShopFavorUser: {
type: [Array,Object],
default: '',
},
},
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
is_shop_search_all_search_button: 0,
search_keywords_value: '',
popup_service_status: false,
nav_category_status: false,
shop_category_tab_value: 0,
shop_navigation: [],
shop_favor_info: {
"text": this.$t('goods-detail.goods-detail.dco1sc'),
"status": 0,
"count": 0
},
};
},
components: {
componentPopup
},
created() {
this.init();
},
methods: {
// 初始化
init() {
var upd_data = {
is_shop_search_all_search_button: (this.propBase == null || parseInt(this.propBase.is_shop_search_all_search_button || 0) != 1) ? 0 : 1,
shop_navigation: this.propShopNavigation,
}
// 收藏信息
if ((this.propShop || null) != null) {
var status = this.propShopFavorUser.indexOf(this.propShop.id) != -1 ? 1 : 0;
upd_data['shop_favor_info'] = {
count: this.propShop.shop_favor_count || 0,
status: status,
text: (status == 1 ? this.$t('goods-detail.goods-detail.by7052') : '') + this.$t('goods-detail.goods-detail.dco1sc')
};
}
this.setData(upd_data);
},
// 店铺收藏事件
shop_favor_event(e) {
var user = app.globalData.get_user_info(this, 'shop_favor_event');
if (user != false) {
uni.showLoading({
title: this.$t('common.processing_in_text')
});
uni.request({
url: app.globalData.get_request_url("favor", "shopfavor", "shop"),
method: 'POST',
data: {
"id": this.propShop.id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.setData({
shop_favor_info: res.data.data
});
app.globalData.showToast(res.data.msg, 'success');
} else {
if (app.globalData.is_login_check(res.data, this, 'shop_favor_event')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
}
});
}
},
// 搜索输入事件
search_keywords_event(e) {
this.setData({
search_keywords_value: e.detail.value || ''
});
},
// 搜索事件
search_button_event(e) {
var value = e.currentTarget.dataset.value || null;
app.globalData.url_open(value + 'keywords=' + this.search_keywords_value || '');
},
// 导航分类事件
nav_shop_category_event(e) {
this.setData({
nav_category_status: !this.nav_category_status
});
},
// 分类事件
shop_category_event(e) {
var value = e.currentTarget.dataset.value || null;
app.globalData.url_open('/pages/plugins/shop/search/search?shop_id=' + this.propShop.id + '&category_id=' + value);
},
// 导航事件
nav_event(e) {
// 存在子级则做子级显示隐藏处理
var value = e.currentTarget.dataset.value || null;
if(value == null) {
var index = e.currentTarget.dataset.index;
var temp_nav = this.propShopNavigation;
for(var i in temp_nav) {
if(i == index) {
temp_nav[i]['items_status'] = ((temp_nav[i]['items_status'] || 0) == 0) ? 1 : 0;
} else {
temp_nav[i]['items_status'] = 0;
}
}
this.setData({shop_navigation: temp_nav});
} else {
app.globalData.url_event(e);
}
},
// 开启客服弹层
popup_service_open_event(e) {
this.setData({
popup_service_status: true,
});
},
// 关闭客服弹层
popup_service_close_event(e) {
this.setData({
popup_service_status: false,
});
},
// url事件
url_event(e) {
app.globalData.url_event(e);
},
// 剪切板
text_copy_event(e) {
app.globalData.text_copy_event(e);
},
// 电话
tel_event(e) {
app.globalData.call_tel(e);
},
// 图片预览
image_show_event(e) {
app.globalData.image_show_event(e);
},
// 进入客服系统
chat_event() {
app.globalData.chat_entry_handle(this.propShop.chat_info.chat_url);
}
},
};
</script>
<style scoped>
/**
* 搜索
*/
.search {
border: 2rpx solid;
padding: 2rpx;
}
.search button {
width: 140rpx;
height: 56rpx;
line-height: 56rpx;
padding: 0;
}
.search input {
height: 56rpx;
line-height: 56rpx;
}
.search-btn {
width: 148rpx;
}
.search-btn button {
width: 100%;
padding: 0;
height: 64rpx;
line-height: 64rpx;
}
/**
* 头部
*/
.header {
padding: 20rpx 24rpx;
font-size: 24rpx;
}
.shop-logo {
width: 90rpx;
}
.base-bottom image {
width: 28rpx;
height: 28rpx;
}
.header .base {
width: calc(100% - 110rpx);
}
.shop-title {
line-height: 40rpx;
}
/**
* 导航
*/
.nav .nav-scroll {
float: right;
width: calc(100% - 172rpx);
}
.nav .nav-scroll .item.par {
height: 56rpx;
line-height: 56rpx;
white-space: nowrap;
}
.nav .item {
padding: 0 20rpx;
}
.nav-shop-category {
padding-right: 32rpx !important;
background-size: 28rpx 28rpx;
height: 56rpx;
line-height: 56rpx;
}
.nav .nav-items {
left: calc(50% - 212rpx);
top: 322rpx;
z-index: 1;
border-radius: 0 0 8rpx 8rpx;
box-shadow: 0 12rpx 12rpx rgb(0 0 0 / 10%);
}
.nav .nav-items .item {
padding: 20rpx;
}
/**
* 导航商品分类
*/
.nav-category {
z-index: 1;
box-shadow: 0 12rpx 12rpx rgb(0 0 0 / 10%);
border-bottom-right-radius: 8rpx;
margin-top: 70rpx;
}
.nav-category .category-scroll {
max-height: 600rpx;
}
.nav-category .item {
padding: 20rpx 30rpx;
}
/**
* 商品分类切换
*/
.shop-category-list .item {
margin: 20rpx 0;
}
.shop-category-list .item {
margin-left: 20rpx;
}
.shop-category-list .item:last-child {
margin-right: 20rpx;
}
</style>

View File

@@ -0,0 +1,159 @@
<template>
<view :class="theme_view">
<view v-if="(data || null) != null" class="pr">
<!-- 头部 -->
<block v-if="(data.is_header || 0) == 1">
<component-shop-header :propBase="data_base" :propShop="shop" :propShopGoodsCategory="shop_goods_category" :propShopNavigation="shop_navigation" :propShopFavorUser="shop_favor_user"></component-shop-header>
</block>
<!-- 拖拽模式引入拖拽数据模块 -->
<component-layout :propData="layout_data"></component-layout>
<!-- 结尾 -->
<block v-if="(data.is_footer || 0) == 1">
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</block>
</view>
<block v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</block>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentLayout from "@/components/layout/layout";
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentShopHeader from '../components/shop-header/shop-header';
var common_static_url = app.globalData.get_static_url('common');
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
params: {},
data_base: null,
data: null,
layout_data: [],
shop: null,
shop_favor_user: [],
shop_navigation: [],
shop_goods_category: [],
// 自定义分享信息
share_info: {}
};
},
components: {
componentCommon,
componentLayout,
componentNoData,
componentBottomLine,
componentShopHeader
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: app.globalData.launch_params_handle(params)
});
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 加载数据
this.get_data();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
methods: {
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("index", "design", "shop"),
method: 'POST',
data: this.params,
dataType: 'json',
success: res => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var base = data.base || null;
this.setData({
data_base: base,
shop: (data.shop || null) == null || data.shop.length <= 0 ? null : data.shop,
shop_favor_user: data.shop_favor_user || [],
shop_navigation: data.shop_navigation || [],
shop_goods_category: data.shop_goods_category || [],
data: (data.data || null) != null && data.data.length != 0 ? data.data : null,
layout_data: data.layout_data || [],
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: true
});
if ((this.data || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.data.seo_title || this.data.name,
desc: this.data.seo_desc,
path: '/pages/plugins/shop/design/design',
query: 'id='+this.data.id,
img: this.data.logo
}
});
// 标题名称
uni.setNavigationBarTitle({
title: this.data.name
});
}
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips')
});
}
});
}
}
};
</script>
<style>
</style>

View File

@@ -0,0 +1,125 @@
/**
* 搜索
*/
.search {
border: 2rpx solid;
padding: 2rpx;
}
.search button {
width: 140rpx;
height: 56rpx;
line-height: 56rpx;
padding: 0;
}
.search input {
height: 56rpx;
line-height: 56rpx;
}
.search-btn {
width: 148rpx;
}
.search-btn button {
width: 100%;
padding: 0;
height: 64rpx;
line-height: 64rpx;
}
/**
* 头部
*/
.header {
padding: 20rpx 24rpx;
font-size: 24rpx;
}
.shop-logo {
width: 90rpx;
}
.base-bottom image {
width: 28rpx;
height: 28rpx;
}
.header .base {
width: calc(100% - 110rpx);
}
.shop-title {
line-height: 40rpx;
}
/**
* 导航
*/
.nav .nav-scroll {
float: right;
width: calc(100% - 172rpx);
}
.nav .nav-scroll .item.par {
height: 56rpx;
line-height: 56rpx;
white-space: nowrap;
}
.nav .item {
padding: 0 20rpx;
}
.nav-shop-category {
padding-right: 32rpx !important;
background-size: 28rpx 28rpx;
height: 56rpx;
line-height: 56rpx;
}
.nav .nav-items {
left: calc(50% - 212rpx);
top: 322rpx;
z-index: 1;
border-radius: 0 0 8rpx 8rpx;
box-shadow: 0 12rpx 12rpx rgb(0 0 0 / 10%);
}
.nav .nav-items .item {
padding: 20rpx;
}
/**
* 导航商品分类
*/
.nav-category {
z-index: 1;
box-shadow: 0 12rpx 12rpx rgb(0 0 0 / 10%);
border-bottom-right-radius: 8rpx;
margin-top: 70rpx;
}
.nav-category .category-scroll {
max-height: 600rpx;
}
.nav-category .item {
padding: 20rpx;
}
/**
* 商品分类切换
*/
.shop-category-list .item {
margin: 20rpx 0;
}
.shop-category-list .item {
margin-left: 20rpx;
}
.shop-category-list .item:last-child {
margin-right: 20rpx;
}

View File

@@ -0,0 +1,240 @@
<template>
<view :class="theme_view">
<view v-if="(shop || null) != null" class="pr">
<!-- 头部 -->
<component-shop-header :propBase="data_base" :propShop="shop" :propShopGoodsCategory="shop_goods_category" :propShopNavigation="shop_navigation" :propShopFavorUser="shop_favor_user"></component-shop-header>
<!-- 数据模式 -->
<!-- 自动模式 -->
<block v-if="(shop.data_model || 0) == 0">
<view v-if="(data || null) != null && data.length > 0" class="wh-auto">
<view class="padding-main">
<component-goods-list :propData="{ style_type: 1, goods_list: data }" :propCurrencySymbol="currency_symbol"></component-goods-list>
<button class="bg-main br-main cr-white round dis-block margin-top-xl margin-bottom-xl margin-horizontal-main" @tap="url_event" :data-value="'/pages/plugins/shop/search/search?shop_id=' + shop.id" size="mini">查看更多商品 >></button>
</view>
</view>
<block v-else>
<component-no-data propStatus="0"></component-no-data>
</block>
</block>
<!-- 标准模式 -->
<block v-if="(shop.data_model || 0) == 1">
<block v-if="((slider || null) != null && slider.length > 0) || ((data || null) != null && data.length > 0)">
<view class="data-list padding-horizontal-main oh">
<!-- 轮播 -->
<view v-if="slider.length > 0" class="margin-top-main">
<component-banner :propData="slider"></component-banner>
</view>
<!-- 商品列表 -->
<view v-if="data.length > 0" :class="((slider || null) == null || slider.length == 0) ? 'margin-top-main' : ''">
<block v-for="(item, index) in data" :key="index">
<component-goods-list :propData="item" :propKeywordsUrl="'/pages/plugins/shop/search/search?shop_id=' + shop.id + '&keywords='" :propIsAutoPlay="true" :propCurrencySymbol="currency_symbol"></component-goods-list>
</block>
</view>
</view>
</block>
<block v-else>
<component-no-data propStatus="0"></component-no-data>
</block>
</block>
<!-- 拖拽模式 -->
<block v-if="(shop.data_model || 0) == 2">
<block v-if="(data || null) != null && data.length > 0">
<!-- 拖拽模式引入拖拽数据模块 -->
<component-layout :propData="data"></component-layout>
</block>
<block v-else>
<component-no-data propStatus="0"></component-no-data>
</block>
</block>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
<block v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</block>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentLayout from '@/components/layout/layout';
import componentNoData from '@/components/no-data/no-data';
import componentBottomLine from '@/components/bottom-line/bottom-line';
import componentBanner from '@/components/slider/slider';
import componentGoodsList from '@/components/goods-list/goods-list';
import componentShopHeader from '../components/shop-header/shop-header';
var common_static_url = app.globalData.get_static_url('common');
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.currency_symbol(),
params: null,
data_base: null,
shop: null,
shop_favor_user: [],
shop_navigation: [],
shop_goods_category: [],
slider: [],
data: [],
search_keywords_value: '',
popup_service_status: false,
nav_category_status: false,
// 自定义分享信息
share_info: {},
};
},
components: {
componentCommon,
componentLayout,
componentNoData,
componentBottomLine,
componentBanner,
componentGoodsList,
componentShopHeader
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
params = app.globalData.launch_params_handle(params);
// 是否指定店铺id
var shop_id = app.globalData.data.plugins_shop_id || null;
if(shop_id != null) {
params['id'] = shop_id;
}
this.setData({
params: params
});
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 加载数据
this.get_data();
// 初始化配置
this.init_config();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
onPullDownRefresh() {
if(this.data_list_loding_status === 1) {
uni.stopPullDownRefresh();
} else {
this.get_data();
}
},
methods: {
// 初始化配置
init_config(status) {
if ((status || false) == true) {
this.setData({
currency_symbol: app.globalData.get_config('currency_symbol'),
});
} else {
app.globalData.is_config(this, 'init_config');
}
},
// 获取数据
get_data(params = {}) {
// 网络检查
if((params || null) == null || (params.loading || 0) == 0) {
app.globalData.network_type_handle(this, 'get_data', params);
return false;
}
// 请求数据
uni.request({
url: app.globalData.get_request_url('detail', 'index', 'shop'),
method: 'POST',
data: this.params,
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var base = data.base || null;
var temp_data = data.data || [];
this.setData({
data_base: base,
shop: data.shop || null,
shop_favor_user: data.shop_favor_user || [],
shop_navigation: data.shop_navigation || [],
shop_goods_category: data.shop_goods_category || [],
data: temp_data,
slider: data.slider || [],
data_list_loding_msg: '',
data_list_loding_status: 0,
data_bottom_line_status: temp_data.length > 0,
});
if ((this.shop || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.shop.seo_title || this.shop.name,
desc: this.shop.seo_desc || this.shop.describe,
path: '/pages/plugins/shop/detail/detail',
query: 'id=' + this.shop.id,
img: this.shop.share_images || this.shop.logo,
},
});
// 标题名称
uni.setNavigationBarTitle({
title: this.shop.name
});
}
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
},
});
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
}
};
</script>
<style>
@import './detail.css';
</style>

View File

@@ -0,0 +1,8 @@
.base {
min-height: 140rpx;
margin-left: 160rpx;
}
.logo {
width: 140rpx;
height: 140rpx;
}

View File

@@ -0,0 +1,257 @@
<template>
<view :class="theme_view">
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
<view v-for="(item, index) in data_list" :key="index" class="padding-main border-radius-main oh bg-white spacing-mb">
<view :data-value="'/pages/plugins/shop/detail/detail?id=' + item.shop_info.id" @tap="url_event" class="cp">
<image class="logo fl radius" :src="item.shop_info.logo" mode="aspectFill"></image>
<view class="base">
<view class="single-text fw-b">{{item.shop_info.name}}</view>
<view class="multi-text cr-grey margin-top-sm">{{item.shop_info.describe}}</view>
</view>
</view>
<button class="br-yellow cr-yellow bg-white fr round" type="default" size="mini" @tap="cancel_event" :data-value="item.id" :data-index="index" hover-class="none">{{$t('common.cancel')}}</button>
</view>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</scroll-view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_list: [],
data_total: 0,
data_page_total: 0,
data_page: 1,
data_list_loding_status: 1,
data_bottom_line_status: false,
data_is_loading: 0
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 数据加载
this.init();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
// 分享菜单处理
app.globalData.page_share_handle();
},
// 下拉刷新
onPullDownRefresh() {
this.setData({
data_page: 1
});
this.get_data_list(1);
},
methods: {
// 获取数据
init() {
var user = app.globalData.get_user_info(this, "init");
if (user != false) {
this.get_data_list();
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
},
// 获取数据
get_data_list(is_mandatory) {
// 分页是否还有数据
if ((is_mandatory || 0) == 0) {
if (this.data_bottom_line_status == true) {
uni.stopPullDownRefresh();
return false;
}
}
// 是否加载中
if(this.data_is_loading == 1) {
return false;
}
this.setData({
data_is_loading: 1,
data_list_loding_status: 1
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 获取数据
uni.request({
url: app.globalData.get_request_url("index", "shopfavor", "shop"),
method: 'POST',
data: {
page: this.data_page
},
dataType: 'json',
success: res => {
if (this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
if (res.data.code == 0) {
// 数据列表
var data = res.data.data;
if (this.data_page <= 1) {
var temp_data_list = data.data_list || [];
} else {
var temp_data_list = this.data_list || [];
var temp_data = data.data_list;
for (var i in temp_data) {
temp_data_list.push(temp_data[i]);
}
}
this.setData({
data_list: temp_data_list,
data_total: data.total,
data_page_total: data.page_total,
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
data_list_loding_msg: '',
data_page: this.data_page + 1,
data_is_loading: 0,
});
// 是否还有数据
this.setData({
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
});
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
app.globalData.is_login_check(res.data, this, 'get_data_list');
}
},
fail: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
}
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 取消
cancel_event(e) {
uni.showModal({
title: this.$t('common.warm_tips'),
content: this.$t('order.order.pn78ns'),
confirmText: this.$t('common.confirm'),
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
success: result => {
if (result.confirm) {
// 参数
var id = e.currentTarget.dataset.value;
var index = e.currentTarget.dataset.index;
// 加载loding
uni.showLoading({
title: this.$t('common.processing_in_text')
});
uni.request({
url: app.globalData.get_request_url("delete", "shopfavor", "shop"),
method: 'POST',
data: {
ids: id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data_list = this.data_list;
temp_data_list.splice(index, 1);
this.setData({
data_list: temp_data_list
});
if (temp_data_list.length == 0) {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
app.globalData.showToast(res.data.msg, 'success');
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
}
});
}
}
});
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
}
};
</script>
<style>
@import './favor.css';
</style>

View File

@@ -0,0 +1,20 @@
/**
* 数据列表
*/
.data-list .item {
width: calc(50% - 10rpx);
margin-bottom: 20rpx;
}
.data-list .item:nth-child(2n) {
float: right;
}
.data-list .item:nth-child(2n+1) {
float: left;
}
.data-list .item .logo {
width: 100%;
height: 160rpx !important;
}

View File

@@ -0,0 +1,317 @@
<template>
<view :class="theme_view">
<!-- 分类 -->
<scroll-view v-if="(shop_category || null) != null && shop_category.length > 0" class="nav-base scroll-view-horizontal bg-white oh" scroll-x="true">
<block v-for="(item, index) in shop_category" :key="index">
<view :class="'item cr-grey dis-inline-block padding-horizontal-main ' + (nav_active_value == item.id ? 'cr-main nav-active-line fw-b' : '')" @tap="nav_event" :data-value="item.id">
{{ item.name }}
</view>
</block>
</scroll-view>
<!-- 列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav plugins-shop-data-list" @scrolltolower="scroll_lower" lower-threshold="60">
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
<block v-for="(item, index) in data_list" :key="index">
<view :data-value="'/pages/plugins/shop/detail/detail?id=' + item.id" @tap="url_event" class="item border-radius-main bg-white oh cp spacing-mb">
<image :src="item.logo_long" class="logo" mode="aspectFit"></image>
<view class="tc">
<view class="single-text padding-horizontal-main padding-top-main">
<!-- 标题 -->
<text class="fw-b text-size-md va-m">{{ item.name }}</text>
<!-- 认证信息 -->
<view v-if="(data_base.is_enable_auth || 0) == 1 && ((item.auth_type != -1 && (item.auth_type_msg || null) != null) || ((item.bond_status || 0) == 1 && (item.bond_status_msg || null) != null))" class="auth-icon dis-inline-block margin-left-sm">
<!-- 实名认证 -->
<block v-if="item.auth_type != -1 && (item.auth_type_msg || null) != null">
<block v-if="item.auth_type == 0">
<image :src="data_base.shop_auth_personal_icon" class="icon va-m" mode="aspectFill"></image>
</block>
<block v-if="item.auth_type == 1">
<image :src="data_base.shop_auth_company_icon" class="icon va-m" mode="aspectFill"></image>
</block>
</block>
<!-- 保证金认证 -->
<block v-if="(item.bond_status || 0) == 1 && (item.bond_status_msg || null) != null">
<image :src="data_base.shop_auth_bond_icon" class="icon va-m" mode="aspectFill"></image>
</block>
</view>
</view>
<view class="cr-grey padding-main">
<text class="multi-text">{{ item.describe }}</text>
</view>
<view class="oh br-t-dashed padding-main">
<view class="fl cr-grey-9 single-text"
>{{$t('recommend-list.recommend-list.x74z3o')}}<text class="cr-black fw-b padding-left-sm">{{ item.goods_count }}</text></view
>
<view class="fr cr-grey-9 single-text"
>{{$t('goods-category.goods-category.at5p35')}}<text class="cr-black fw-b padding-left-sm">{{ item.goods_sales_count }}</text></view
>
</view>
</view>
</view>
</block>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</scroll-view>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from '@/components/no-data/no-data';
import componentBottomLine from '@/components/bottom-line/bottom-line';
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_list_loding_status: 1,
data_list_loding_msg: '',
data_bottom_line_status: false,
data_is_loading: 0,
data_list: [],
data_total: 0,
data_page_total: 0,
data_page: 1,
params: null,
data_base: null,
shop_category: [],
nav_active_value: 0,
// 自定义分享信息
share_info: {},
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 参数处理
params = app.globalData.launch_params_handle(params);
// 设置参数
this.setData({
params: params,
nav_active_value: params.category_id || 0,
});
// 数据加载
this.get_data();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
onPullDownRefresh() {
if(this.data_list_loding_status === 1) {
uni.stopPullDownRefresh();
} else {
this.setData({
data_page: 1,
});
this.get_data_list(1);
}
},
methods: {
// 初始化
get_data(params = {}) {
// 网络检查
if((params || null) == null || (params.loading || 0) == 0) {
app.globalData.network_type_handle(this, 'get_data', params);
return false;
}
// 请求数据
uni.request({
url: app.globalData.get_request_url('index', 'index', 'shop'),
method: 'POST',
data: {},
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
data_base: data.base || null,
shop_category: data.shop_category || [],
});
if ((this.data_base || null) != null) {
// 基础自定义分享
this.setData({
share_info: {
title: this.data_base.seo_title || this.data_base.application_name,
desc: this.data_base.seo_desc,
path: '/pages/plugins/shop/index/index',
},
});
// 导航名称
if ((this.data_base.application_name || null) != null) {
uni.setNavigationBarTitle({
title: this.data_base.application_name,
});
}
}
// 获取列表数据
this.get_data_list(1);
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: this.$t('index.index.f69r4i'),
});
},
});
},
// 获取数据列表
get_data_list(is_mandatory) {
// 分页是否还有数据
if ((is_mandatory || 0) == 0) {
if (this.data_bottom_line_status == true) {
uni.stopPullDownRefresh();
return false;
}
}
// 是否加载中
if (this.data_is_loading == 1) {
return false;
}
this.setData({
data_is_loading: 1,
});
// 加载loding
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
// 获取数据
uni.request({
url: app.globalData.get_request_url('shoplist', 'index', 'shop'),
method: 'POST',
data: {
page: this.data_page,
category_id: this.nav_active_value || 0,
},
dataType: 'json',
success: (res) => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.data.length > 0) {
if (this.data_page <= 1) {
var temp_data_list = data.data;
} else {
var temp_data_list = this.data_list || [];
var temp_data = data.data;
for (var i in temp_data) {
temp_data_list.push(temp_data[i]);
}
}
this.setData({
data_list: temp_data_list,
data_total: data.total,
data_page_total: data.page_total,
data_list_loding_status: 3,
data_page: this.data_page + 1,
data_is_loading: 0,
});
// 是否还有数据
this.setData({
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
});
} else {
this.setData({
data_list_loding_status: 0,
data_is_loading: 0,
});
if (this.data_page <= 1) {
this.setData({
data_list: [],
data_bottom_line_status: false,
});
}
}
} else {
this.setData({
data_list_loding_status: 0,
data_list_loding_msg: res.data.msg,
data_is_loading: 0,
});
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 导航事件
nav_event(e) {
this.setData({
nav_active_value: e.currentTarget.dataset.value || 0,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// url事件
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>
<style>
@import './index.css';
</style>

View File

@@ -0,0 +1,129 @@
<template>
<view :class="theme_view">
<block v-if="(data || null) != null">
<!-- 主体信息 -->
<view class="padding-main">
<view class="fw-b text-size margin-top-xxl">{{ data.title }}</view>
<view class="text-size-xs cr-grey margin-top-sm">{{ data.sub_title }}</view>
<view class="br padding-main margin-top-lg bg-white border-radius-main">
<image :src="data.images" class="wh-auto border-radius-main dis-block" mode="aspectFill" :data-value="data.images" @tap="image_show_event"></image>
</view>
<view v-if="(data.tips || null) != null && data.tips.length > 0" class="cr-grey margin-top-lg text-size-xs">
<block v-for="(item, index) in data.tips" :key="index">
<view class="margin-top-sm">{{ item }}</view>
</block>
</view>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</block>
<block v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</block>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: "",
params: null,
data: null,
};
},
components: {
componentCommon,
componentNoData,
componentBottomLine,
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
});
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 加载数据
this.get_data();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
onPullDownRefresh() {
this.get_data();
},
methods: {
// 获取数据
get_data() {
uni.request({
url: app.globalData.get_request_url("index", "license", "shop"),
method: "POST",
data: {
id: this.params.id || 0,
},
dataType: "json",
success: (res) => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
data: res.data.data || null,
layout_data: data.layout_data || [],
data_list_loding_msg: "",
data_list_loding_status: 0,
data_bottom_line_status: true,
});
} else {
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
// 图片预览
image_show_event(e) {
app.globalData.image_show_event(e);
},
},
};
</script>
<style></style>

View File

@@ -0,0 +1,76 @@
/**
* 排序导航
*/
.nav-sort-content .item {
height: 80rpx;
line-height: 80rpx;
width: calc(20% - 33.33rpx);
}
.nav-sort-content .item .icon {
width: 30rpx;
height: 30rpx !important;
}
.screening-submit {
width: 50rpx;
height: 50rpx;
top: 15rpx;
right: 80rpx !important;
}
.show-type-submit {
width: 50rpx;
height: 50rpx !important;
top: 15rpx;
right: 16rpx;
}
/**
* 条件
*/
.search-map {
height: calc(100vh - 180rpx);
overflow-y: scroll;
overflow-x: hidden;
}
.search-map,
.search-map .search-submit {
width: 660rpx;
}
.map-keywords {
padding: 0 20rpx;
line-height: 66rpx;
height: 66rpx;
font-size: 26rpx;
box-sizing: border-box;
}
.map-nav text:first-child {
font-weight: bold;
}
.map-nav .arrow-bottom {
top: 0;
right: 10rpx;
padding-right: 46rpx;
}
.map-item {
line-height: 66rpx;
}
.map-content {
line-height: 50rpx;
}
.map-content .item {
margin-bottom: 20rpx;
}
.map-content .item:not(:last-child) {
margin-right: 20rpx;
}
.map-text-item .item {
padding: 0 15rpx;
border: 1px solid transparent;
}
.search-map .search-submit {
left: 0;
bottom: 0;
}
.search-map .search-submit .btn {
height: 80rpx;
line-height: 80rpx;
}

View File

@@ -0,0 +1,567 @@
<template>
<view :class="theme_view">
<!-- 排序 -->
<view class="nav-sort bg-white oh pr">
<view class="nav-sort-content">
<block v-for="(item, index) in search_nav_sort_list" :key="index">
<view class="item tc fl" :data-index="index" @tap="nav_sort_event">
<text class="cr-base va-m">{{item.name}}</text>
<image v-if="(item.icon || null) != null" class="icon va-m" :src="common_static_url + 'sort-' + item.icon + '-icon.png'" mode="aspectFill"></image>
</view>
</block>
</view>
<image class="screening-submit pa cp" :src="common_static_url+'search-submit-icon.png'" mode="aspectFill" @tap="popup_form_event_show"></image>
<image class="show-type-submit pa cp" :src="common_static_url+'show-'+(data_show_type_value == 0 ? 'grid' : 'list')+'-icon.png'" mode="aspectFill" @tap="data_show_type_event"></image>
</view>
<!-- 列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="60">
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main oh">
<component-goods-list :propData="{style_type: data_show_type_value, goods_list: data_list}" :propCurrencySymbol="currency_symbol"></component-goods-list>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</scroll-view>
<!-- 筛选条件 popup -->
<component-popup :propShow="is_show_popup_form" propPosition="left" @onclose="popup_form_event_close">
<form @submit="form_submit_event" class="popup-form oh">
<view class="search-map padding-main bg-base">
<view class="padding-main border-radius-main bg-white">
<view class="map-item map-base br-b">
<text>{{$t('goods-search.goods-search.j8o278')}}</text>
<text class="cr-main"> {{data_total}} </text>
<text>{{$t('goods-search.goods-search.t9nikq')}}</text>
<text class="fr cr-red" @tap="map_remove_event">{{$t('goods-search.goods-search.pxk051')}}</text>
</view>
<!-- 搜索关键字 -->
<input type="text" confirm-type="done" :placeholder="$t('search.search.723rbx')" name="wd" :value="(post_data.wd || '')" class="map-keywords wh-auto round bg-base margin-top-lg" placeholder-class="cr-grey">
</view>
<!-- 分类 -->
<view v-if="(search_map_list.category_list || null) != null && search_map_list.category_list.length > 0" class="map-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mt">
<view class="map-nav pr br-b">
<text>{{$t('common.category')}}</text>
<text class="arrow-bottom pa cr-grey" v-if="search_map_list.category_list.length > 3" @tap="more_event" data-value="category_list">{{$t('common.more')}}</text>
</view>
<view class="map-content map-text-item map-category-container oh margin-top-lg" :style="'height:' + map_fields_list.category_list.height + ';'">
<block v-for="(item, index) in search_map_list.category_list" :key="index">
<view :class="'item fl radius ' + (item.active == 1 ? 'cr-main br-main' : 'cr-base')" @tap="map_item_event" :data-value="item.id" data-field="category_list">{{item.name}}</view>
</block>
</view>
<block v-for="(item, index) in search_map_list.category_list" :key="index">
<view v-if="item.active == 1 && (item.items || null) != null && item.items.length > 0" class="map-category-two map-text-item padding-bottom">
<view class="bg-grey-f7 oh radius padding-sm">
<block v-for="(item2, index2) in item.items" :key="index2">
<view :class="'item fl radius ' + (item2.active == 1 ? 'cr-main' : 'cr-base')" @tap="map_item_event" :data-pvalue="item.id" :data-value="item2.id" data-field="category_list">{{item2.name}}</view>
</block>
</view>
</view>
</block>
</view>
<view class="search-submit padding-main pa">
<button form-type="submit" class="btn bg-main cr-white text-size wh-auto round" :disabled="popup_form_loading_status" hover-class="none">{{$t('common.confirm')}}</button>
</view>
</view>
</form>
</component-popup>
<!-- 公共 -->
<component-common ref="common"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentPopup from "@/components/popup/popup";
import componentNoData from "@/components/no-data/no-data";
import componentBottomLine from "@/components/bottom-line/bottom-line";
import componentGoodsList from "@/components/goods-list/goods-list";
var common_static_url = app.globalData.get_static_url('common');
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
common_static_url: common_static_url,
data_list_loding_status: 1,
data_bottom_line_status: false,
data_is_loading: 0,
currency_symbol: app.globalData.currency_symbol(),
data_list: [],
data_total: 0,
data_page_total: 0,
data_page: 1,
params: null,
post_data: {},
shop: null,
is_show_popup_form: false,
popup_form_loading_status: false,
// 排序导航
search_nav_sort_index: 0,
search_nav_sort_list: [
{ name: this.$t('goods-category.goods-category.x69aow'), field: "default", sort: "asc", "icon": null },
{ name: this.$t('goods-category.goods-category.at5p35'), field: "sales_count", sort: "asc", "icon": "default" },
{ name: this.$t('goods-category.goods-category.283ot0'), field: "access_count", sort: "asc", "icon": "default" },
{ name: this.$t('goods-category.goods-category.g2u3lf'), field: "min_price", sort: "asc", "icon": "default" },
{ name: this.$t('goods-category.goods-category.5p4ksj'), field: "id", sort: "asc", "icon": "default" }
],
// 数据展示样式0图文、1九方格
data_show_type_value: 1,
// 搜素条件
search_map_list: {
category_list: []
},
map_fields_list: {
category_list: {height: "82rpx", default: "82rpx", form_key: "category_ids"}
},
// 自定义分享信息
share_info: {}
};
},
components: {
componentCommon,
componentPopup,
componentNoData,
componentBottomLine,
componentGoodsList
},
onLoad(params) {
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
// 设置参数
this.setData({
params: params,
post_data: {
wd: params.keywords || '',
shop_id: params.shop_id || 0,
category_ids: ((params.category_id || 0) == 0) ? '' : JSON.stringify({"0":params.category_id})
}
});
// 数据加载
this.get_data();
},
onShow() {
// 调用公共事件方法
app.globalData.page_event_onshow_handle();
// 初始化配置
this.init_config();
// 公共onshow事件
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
},
// 下拉刷新
onPullDownRefresh() {
this.setData({
data_page: 1
});
this.get_data_list(1);
},
methods: {
// 初始化配置
init_config(status) {
if ((status || false) == true) {
this.setData({
currency_symbol: app.globalData.get_config('currency_symbol')
});
} else {
app.globalData.is_config(this, 'init_config');
}
},
// 初始化
get_data() {
var post_data = this.request_map_handle();
uni.request({
url: app.globalData.get_request_url("index", "search", "shop"),
method: 'POST',
data: post_data,
dataType: 'json',
success: res => {
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
// 分类选中处理
var category = data.shop_goods_category || [];
if((this.params.category_id || 0) != 0 && category.length > 0) {
for(var i in category) {
category[i]['active'] = (category[i]['id'] == this.params.category_id) ? 1 : 0;
if((category[i]['items'] || null) != null && category[i]['items'].length > 0) {
for(var x in category[i]['items']) {
category[i]['items'][x]['active'] = (category[i]['items'][x]['id'] == this.params.category_id) ? 1 : 0;
}
}
}
}
this.setData({
shop: data.shop || null,
search_map_info: data.search_map_info || [],
search_map_list: {
category_list: category
}
});
if((this.shop || null) != null) {
// 获取列表数据
this.get_data_list(1);
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false
});
}
} else {
this.setData({
data_list_loding_status: 0
});
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
}
});
},
// 获取数据列表
get_data_list(is_mandatory) {
// 分页是否还有数据
if ((is_mandatory || 0) == 0) {
if (this.data_bottom_line_status == true) {
uni.stopPullDownRefresh();
return false;
}
}
// 基础自定义分享
this.share_info_handle();
// 是否加载中
if(this.data_is_loading == 1) {
return false;
}
this.setData({data_is_loading: 1});
// 获取数据
if(this.data_page > 1) {
uni.showLoading({
title: this.$t('common.loading_in_text'),
});
}
var post_data = this.request_map_handle();
uni.request({
url: app.globalData.get_request_url("datalist", "search", "shop"),
method: 'POST',
data: post_data,
dataType: 'json',
success: res => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.data.length > 0) {
if (this.data_page <= 1) {
var temp_data_list = data.data;
} else {
var temp_data_list = this.data_list || [];
var temp_data = data.data;
for (var i in temp_data) {
temp_data_list.push(temp_data[i]);
}
}
this.setData({
data_list: temp_data_list,
data_total: data.total,
data_page_total: data.page_total,
data_list_loding_status: 3,
data_page: this.data_page + 1,
data_is_loading: 0
});
// 是否还有数据
this.setData({
data_bottom_line_status: (this.data_page > 1 && this.data_page > this.data_page_total)
});
} else {
this.setData({
data_list_loding_status: 0,
data_total: 0,
data_is_loading: 0
});
if (this.data_page <= 1) {
this.setData({
data_list: [],
data_bottom_line_status: false
});
}
}
} else {
this.setData({
data_list_loding_status: 0,
data_is_loading: 0
});
app.globalData.showToast(res.data.msg);
}
},
fail: () => {
if(this.data_page > 1) {
uni.hideLoading();
}
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
}
});
},
// 搜索条件处理
request_map_handle() {
var params = this.params;
var post_data = this.post_data;
post_data['page'] = this.data_page;
// 店铺id
post_data['shop_id'] = params['shop_id'] || 0;
// 搜索条件
var temp_field = this.map_fields_list;
var temp_list = this.search_map_list;
for (var i in temp_field) {
if (temp_list[i] != null != null && temp_list[i].length > 0) {
var value = '';
for (var k in temp_list[i]) {
if ((temp_list[i][k]['active'] || 0) == 1) {
value = temp_list[i][k]['id'];
if((temp_list[i][k]['items'] || null) != null) {
for(var x in temp_list[i][k]['items']) {
if ((temp_list[i][k]['items'][x]['active'] || 0) == 1) {
value = temp_list[i][k]['items'][x]['id'];
}
}
}
}
}
post_data[temp_field[i]['form_key']] = value;
}
}
// 排序
var temp_index = this.search_nav_sort_index;
var temp_search_nav_sort = this.search_nav_sort_list;
post_data['order_by_type'] = temp_search_nav_sort[temp_index]['sort'] == 'desc' ? 'asc' : 'desc';
post_data['order_by_field'] = temp_search_nav_sort[temp_index]['field'];
return post_data;
},
// 分享设置处理
share_info_handle() {
if((this.shop || null) != null) {
// 基础自定义分享
var shop_id = this.shop.id;
var category_id = this.params.category_id || 0;
var keywords = this.post_data.wd || '';
this.setData({
share_info: {
title: this.shop.seo_title || this.shop.name,
desc: this.shop.seo_desc || this.shop.describe,
path: '/pages/plugins/shop/search/search',
query: 'shop_id='+shop_id+'&category_id='+category_id+'&keywords='+keywords,
img: this.shop.logo
}
});
}
// 分享菜单处理
app.globalData.page_share_handle(this.share_info);
},
// 滚动加载
scroll_lower(e) {
this.get_data_list();
},
// 搜索条件
form_submit_event(e) {
this.setData({
post_data: e.detail.value,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
this.popup_form_event_close();
},
// 筛选条件关闭
popup_form_event_close(e) {
this.setData({
is_show_popup_form: false
});
},
// 筛选条件开启
popup_form_event_show(e) {
this.setData({
is_show_popup_form: true
});
},
// 排序事件
nav_sort_event(e) {
var index = e.currentTarget.dataset.index || 0;
var temp_search_nav_sort = this.search_nav_sort_list;
var temp_sort = temp_search_nav_sort[index]['sort'] == 'desc' ? 'asc' : 'desc';
for (var i in temp_search_nav_sort) {
if (i != index) {
if (temp_search_nav_sort[i]['icon'] != null) {
temp_search_nav_sort[i]['icon'] = 'default';
}
temp_search_nav_sort[i]['sort'] = 'desc';
}
}
temp_search_nav_sort[index]['sort'] = temp_sort;
if (temp_search_nav_sort[index]['icon'] != null) {
temp_search_nav_sort[index]['icon'] = temp_sort;
}
this.setData({
search_nav_sort_index: index,
search_nav_sort_list: temp_search_nav_sort,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// 条件-更多数据展示事件
more_event(e) {
var value = e.currentTarget.dataset.value || null;
var temp_more = this.map_fields_list;
if (value != null && (temp_more[value] || null) != null) {
temp_more[value]['height'] = temp_more[value]['height'] == 'auto' ? temp_more[value]['default'] : 'auto';
this.setData({
map_fields_list: temp_more
});
}
},
// 条件-选择事件
map_item_event(e) {
var pvalue = e.currentTarget.dataset.pvalue;
var value = e.currentTarget.dataset.value;
var field = e.currentTarget.dataset.field;
var temp_list = this.search_map_list;
if ((temp_list[field] || null) != null) {
if(pvalue === undefined) {
for(var i in temp_list[field]) {
temp_list[field][i]['active'] = (temp_list[field][i]['id'] == value) ? (temp_list[field][i]['active'] == 1 ? 0 : 1) : 0;
// 当前没有选中则取消子级数据的选中
if(temp_list[field][i]['active'] == 0 && (temp_list[field][i]['items'] || null) != null) {
for(var x in temp_list[field][i]['items']) {
temp_list[field][i]['items'][x]['active'] = 0;
}
}
}
} else {
for(var i in temp_list[field]) {
temp_list[field][i]['active'] = (temp_list[field][i]['id'] == pvalue) ? 1 : 0;
if((temp_list[field][i]['items'] || null) != null) {
for(var x in temp_list[field][i]['items']) {
temp_list[field][i]['items'][x]['active'] = (temp_list[field][i]['items'][x]['id'] == value) ? (temp_list[field][i]['items'][x]['active'] == 1 ? 0 : 1) : 0;
// 选中父级
if(temp_list[field][i]['items'][x]['active'] == 1) {
temp_list[field][i]['active'] = 1;
}
}
}
}
}
this.setData({
search_map_list: temp_list,
});
}
},
// 条件-清空
map_remove_event(e) {
var temp_list = this.search_map_list;
var temp_post = this.post_data;
// 关键字
temp_post['wd'] = '';
// 分类
for (var i in temp_list) {
if((temp_list[i] || null) != null && temp_list[i].length > 0) {
for(var k in temp_list[i]) {
temp_list[i][k]['active'] = 0;
if((temp_list[i][k]['items'] || null) != null) {
for(var x in temp_list[i][k]['items']) {
temp_list[i][k]['items'][x]['active'] = 0;
}
}
}
}
}
// 排序导航
var temp_search_nav_sort = this.search_nav_sort_list;
for (var i in temp_search_nav_sort) {
temp_search_nav_sort[i]['sort'] = 'asc';
temp_search_nav_sort[i]['icon'] = (temp_search_nav_sort[i]['field'] == 'default') ? null : 'default';
}
// 关闭弹窗、分页恢复1页、重新获取数据
this.setData({
search_map_list: temp_list,
post_data: temp_post,
is_show_popup_form: false,
search_nav_sort_list: temp_search_nav_sort,
search_nav_sort_index: 0,
data_page: 1,
data_list: [],
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.get_data_list(1);
},
// 数据展示类型
data_show_type_event(e) {
this.setData({data_show_type_value: this.data_show_type_value == 0 ? 1 : 0});
}
}
};
</script>
<style>
@import './search.css';
</style>