mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-02 03:48:47 +08:00
微信小程序支持多商户
This commit is contained in:
parent
de95d78017
commit
a1c3a09845
@ -74,7 +74,7 @@ App({
|
||||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
request_url: 'http://shopxo.com/',
|
||||
// request_url: 'https://dev.shopxo.net/',
|
||||
request_url: 'https://dev.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
@ -910,4 +910,59 @@ App({
|
||||
return uuid;
|
||||
},
|
||||
|
||||
// 链接地址事件
|
||||
url_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if(value != null)
|
||||
{
|
||||
var temp = value.substr(0, 6);
|
||||
if(temp == 'http:/' || temp == 'https:')
|
||||
{
|
||||
this.open_web_view(value);
|
||||
} else {
|
||||
if (this.is_tabbar_pages(value))
|
||||
{
|
||||
wx.switchTab({ url: value });
|
||||
} else {
|
||||
wx.navigateTo({ url: value });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 剪贴板
|
||||
text_copy_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if(value != null)
|
||||
{
|
||||
var self = this;
|
||||
wx.setClipboardData({
|
||||
data: value,
|
||||
success (res) {
|
||||
wx.getClipboardData({
|
||||
success (res) {
|
||||
self.showToast('复制成功', 'success');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.showToast('复制内容为空');
|
||||
}
|
||||
},
|
||||
|
||||
// 图片预览
|
||||
image_show_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if(value != null)
|
||||
{
|
||||
wx.previewImage({
|
||||
current: value,
|
||||
urls: [value]
|
||||
});
|
||||
} else {
|
||||
this.showToast('图片地址为空');
|
||||
}
|
||||
},
|
||||
|
||||
});
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/goods-category/goods-category",
|
||||
"pages/cart/cart",
|
||||
@ -81,7 +81,11 @@
|
||||
"pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo",
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list",
|
||||
"pages/plugins/points/index/index",
|
||||
"pages/plugins/brand/index/index"
|
||||
"pages/plugins/brand/index/index",
|
||||
"pages/plugins/shop/search/search",
|
||||
"pages/plugins/shop/detail/detail",
|
||||
"pages/plugins/shop/faovr/faovr",
|
||||
"pages/plugins/shop/design/design"
|
||||
],
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
|
@ -45,22 +45,7 @@ Component({
|
||||
|
||||
// 链接地址事件
|
||||
layout_url_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if(value != null)
|
||||
{
|
||||
var temp = value.substr(0, 6);
|
||||
if(temp == 'http:/' || temp == 'https:')
|
||||
{
|
||||
app.open_web_view(value);
|
||||
} else {
|
||||
if (app.is_tabbar_pages(value))
|
||||
{
|
||||
wx.switchTab({ url: value });
|
||||
} else {
|
||||
wx.navigateTo({ url: value });
|
||||
}
|
||||
}
|
||||
}
|
||||
app.url_event(e);
|
||||
},
|
||||
},
|
||||
});
|
@ -31,6 +31,13 @@ Page({
|
||||
goods_video_is_autoplay: false,
|
||||
popup_share_status: false,
|
||||
|
||||
// 导航首页按钮
|
||||
nav_home_button_info: {
|
||||
"name": "首页",
|
||||
"icon": "/images/goods-detail-home-icon.png",
|
||||
"value": "/pages/index/index"
|
||||
},
|
||||
|
||||
// 购物车快捷导航
|
||||
quick_nav_cart_count: 0,
|
||||
|
||||
@ -72,6 +79,9 @@ Page({
|
||||
plugins_salerecords_timer: null,
|
||||
plugins_salerecords_tips_content: null,
|
||||
plugins_salerecords_tips_ent: '',
|
||||
|
||||
// 多商户
|
||||
plugins_shop_data: null,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
@ -179,6 +189,8 @@ Page({
|
||||
quick_nav_cart_count: data.common_cart_total || 0,
|
||||
|
||||
plugins_salerecords_data: ((data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0) ? null : data.plugins_salerecords_data,
|
||||
|
||||
plugins_shop_data: ((data.plugins_shop_data || null) == null || data.plugins_shop_data.length <= 0) ? null : data.plugins_shop_data,
|
||||
});
|
||||
|
||||
// 限时秒杀倒计时
|
||||
@ -195,6 +207,18 @@ Page({
|
||||
|
||||
// 购买记录提示
|
||||
this.plugins_salerecords_tips_handle();
|
||||
|
||||
// 导航首页按钮、多商户
|
||||
if(this.data.plugins_shop_data != null)
|
||||
{
|
||||
this.setData({
|
||||
nav_home_button_info: {
|
||||
"name": "店铺",
|
||||
"icon": this.data.plugins_shop_data.shop_icon,
|
||||
"value": "/pages/plugins/shop/detail/detail?id="+this.data.plugins_shop_data.id
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
@ -261,9 +285,13 @@ Page({
|
||||
// 进入店铺
|
||||
shop_event(e)
|
||||
{
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
var value = this.data.nav_home_button_info.value;
|
||||
if(value == '/pages/index/index')
|
||||
{
|
||||
wx.switchTab({url: value});
|
||||
} else {
|
||||
wx.navigateTo({url: value});
|
||||
}
|
||||
},
|
||||
|
||||
// 导航购买按钮事件
|
||||
|
@ -116,6 +116,20 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 多商户 -->
|
||||
<view wx:if="{{plugins_shop_data != null}}" class="plugins-shop-container spacing-mt bg-white oh">
|
||||
<navigator url="/pages/plugins/shop/detail/detail?id={{plugins_shop_data.id}}" hover-class="none">
|
||||
<image src="{{plugins_shop_data.logo}}" mode="aspectFit" class="plugins-shop-logo fl"></image>
|
||||
<view class="plugins-shop-base fr arrow-right">
|
||||
<view class="plugins-shop-title single-text">
|
||||
<text wx:if="{{plugins_shop_data.auth_type == 1}}" class="plugins-shop-auth-icon">{{plugins_shop_data.auth_type_name}}</text>
|
||||
<text>{{plugins_shop_data.name}}</text>
|
||||
</view>
|
||||
<view class="plugins-shop-desc multi-text cr-888 margin-top-sm">{{plugins_shop_data.describe}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<!-- 商品详情参数 -->
|
||||
<view wx:if="{{(goods.parameters || null) != null && goods.parameters.detail.length > 0}}" class="goods-parameters spacing-mt bg-white">
|
||||
<view class="spacing-nav-title">
|
||||
@ -168,8 +182,8 @@
|
||||
<!-- 底部操作 -->
|
||||
<view class="goods-buy-nav wh-auto bg-white">
|
||||
<view class="shop fl tc br-t" bindtap="shop_event">
|
||||
<image src="/images/goods-detail-home-icon.png" mode="scaleToFill" />
|
||||
<text class="dis-block cr-888">首页</text>
|
||||
<image src="{{nav_home_button_info.icon}}" mode="scaleToFill" />
|
||||
<text class="dis-block cr-888">{{nav_home_button_info.name}}</text>
|
||||
</view>
|
||||
<view class="collect fl tc br-t" bindtap="goods_favor_event">
|
||||
<image src="{{goods_favor_icon}}" mode="scaleToFill" />
|
||||
|
@ -498,4 +498,41 @@
|
||||
.plugins-salerecords-tips-bottom-center {
|
||||
bottom: 10%;
|
||||
top: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 多商户 - 插件
|
||||
*/
|
||||
.plugins-shop-container {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
.plugins-shop-logo {
|
||||
width: 120rpx;
|
||||
height: 120rpx !important;
|
||||
}
|
||||
.plugins-shop-base {
|
||||
width: calc(100% - 190rpx);
|
||||
padding-right: 50rpx;
|
||||
}
|
||||
.plugins-shop-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.plugins-shop-auth-icon {
|
||||
background-color: #f4c985;
|
||||
border: 1px solid #e7ba77;
|
||||
border-radius: 6rpx;
|
||||
color: #856651;
|
||||
text-align: center;
|
||||
padding: 2rpx 12rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.plugins-shop-desc {
|
||||
color: #888;
|
||||
font-size: 24rpx;
|
||||
min-height: 72rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
213
sourcecode/weixin/default/pages/plugins/shop/design/design.js
Normal file
213
sourcecode/weixin/default/pages/plugins/shop/design/design.js
Normal file
@ -0,0 +1,213 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
shop: null,
|
||||
shop_favor_user: [],
|
||||
shop_navigation: [],
|
||||
shop_goods_category: [],
|
||||
data: null,
|
||||
layout_data: [],
|
||||
|
||||
// 基础配置
|
||||
search_keywords_value: '',
|
||||
header_service_status: false,
|
||||
nav_category_status: false,
|
||||
shop_category_tab_value: 0,
|
||||
shop_favor_info: {
|
||||
"text": "收藏",
|
||||
"status": 0,
|
||||
"count": 0
|
||||
},
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
params['id'] = 1;
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.get_user_cache_info(),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
var self = this;
|
||||
wx.request({
|
||||
url: app.get_request_url("index", "design", "shop"),
|
||||
method: "POST",
|
||||
data: {"id": this.data.params.id || 0},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
wx.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_base: data.base || null,
|
||||
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,
|
||||
layout_data: data.layout_data || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
|
||||
// 收藏信息
|
||||
if((this.data.shop || null) != null)
|
||||
{
|
||||
var status = (this.data.shop_favor_user.indexOf(this.data.shop.id) != -1) ? 1 : 0;
|
||||
this.setData({
|
||||
shop_favor_info: {
|
||||
"count": this.data.shop.shop_favor_count || 0,
|
||||
"status": status,
|
||||
"text": ((status == 1) ? '已' : '')+'收藏'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 标题名称
|
||||
if((this.data.data || null) != null)
|
||||
{
|
||||
wx.setNavigationBarTitle({title: this.data.data.name});
|
||||
}
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 店铺收藏事件
|
||||
shop_favor_event(e) {
|
||||
var user = app.get_user_info(this, 'shop_favor_event');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/login/login?event_callback=shop_favor_event"
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
wx.showLoading({title: '处理中...'});
|
||||
wx.request({
|
||||
url: app.get_request_url("favor", "shopfavor", "shop"),
|
||||
method: 'POST',
|
||||
data: {"id": this.data.shop.id},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
wx.hideLoading();
|
||||
if(res.data.code == 0)
|
||||
{
|
||||
this.setData({shop_favor_info: res.data.data});
|
||||
app.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
if (app.is_login_check(res.data, this, 'shop_favor_event')) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.hideLoading();
|
||||
app.showToast('服务器请求出错');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索输入事件
|
||||
search_keywords_event(e) {
|
||||
this.setData({search_keywords_value: e.detail.value || ''});
|
||||
},
|
||||
|
||||
// 搜索事件
|
||||
search_button_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
wx.navigateTo({
|
||||
url: value+'keywords='+this.data.search_keywords_value || '',
|
||||
});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
header_service_event(e) {
|
||||
this.setData({header_service_status: !this.data.header_service_status});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
nav_shop_category_event(e) {
|
||||
this.setData({nav_category_status: !this.data.nav_category_status});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
shop_category_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
wx.navigateTo({ url: '/pages/plugins/shop/search/search?shop_id='+this.data.shop.id+'&category_id='+value });
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
app.url_event(e);
|
||||
},
|
||||
|
||||
// 剪切板
|
||||
text_copy_event(e) {
|
||||
app.text_copy_event(e);
|
||||
},
|
||||
|
||||
// 图片预览
|
||||
image_show_event(e) {
|
||||
app.image_show_event(e);
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data.name || this.data.data.seo_title || app.data.application_title,
|
||||
desc: this.data.data.seo_desc || app.data.application_describe,
|
||||
path: '/pages/plugins/shop/design/design?id='+this.data.data.id+'&referrer=' + user_id
|
||||
};
|
||||
},
|
||||
|
||||
// 分享朋友圈
|
||||
onShareTimeline() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data.name || this.data.data.seo_title || app.data.application_title,
|
||||
query: 'id='+this.data.data.id+'&referrer=' + user_id,
|
||||
imageUrl: ''
|
||||
};
|
||||
},
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#d2364c",
|
||||
"backgroundColorTop": "#d2364c",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"component-layout": "/components/layout/layout"
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<view wx:if="{{(data || null) != null}}">
|
||||
<!-- 头部 -->
|
||||
<block wx:if="{{(data.is_header || 0) == 1}}">
|
||||
<import src="/pages/plugins/shop/public/header.wxml" />
|
||||
<template is="shop-header" data="{{data_base: data_base, shop: shop, shop_navigation: shop_navigation, shop_goods_category: shop_goods_category, shop_favor_info: shop_favor_info, search_keywords_value: search_keywords_value, header_service_status: header_service_status, nav_category_status: nav_category_status}}"></template>
|
||||
</block>
|
||||
|
||||
<!-- 拖拽模式、引入拖拽数据模块 -->
|
||||
<component-layout prop-data="{{layout_data}}"></component-layout>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<block wx:if="{{(data.is_footer || 0) == 1}}">
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</block>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
155
sourcecode/weixin/default/pages/plugins/shop/design/design.wxss
Normal file
155
sourcecode/weixin/default/pages/plugins/shop/design/design.wxss
Normal file
@ -0,0 +1,155 @@
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
.search {
|
||||
background: #d2364c;
|
||||
padding: 20rpx 10rpx 25rpx 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
.search input {
|
||||
width: calc(100% - 328rpx);
|
||||
padding-left: 15rpx;
|
||||
font-size: 24rpx;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.search input,.search-btn button {
|
||||
height: 52rpx;
|
||||
line-height: 52rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.search-btn {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.search-btn button {
|
||||
color: #fff;
|
||||
width: 150rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.search-btn button:first-child {
|
||||
background: #ff8c00;
|
||||
border: 1px solid #ff8c00;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.search-btn button:last-child {
|
||||
background: #483E39;
|
||||
border: 1px solid #483E39;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 头部
|
||||
*/
|
||||
.header {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
.shop-logo {
|
||||
width: 280rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.base-bottom image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
.header .base {
|
||||
width: calc(100% - 320rpx);
|
||||
}
|
||||
.shop-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.shop-auth-icon {
|
||||
background-color: #f4c985;
|
||||
border: 1px solid #e7ba77;
|
||||
border-radius: 6rpx;
|
||||
color: #856651;
|
||||
text-align: center;
|
||||
padding: 2rpx 12rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客服
|
||||
*/
|
||||
.header-service {
|
||||
width: 390rpx;
|
||||
position: absolute;
|
||||
left: 80rpx;
|
||||
top: 210rpx;
|
||||
z-index: 2;
|
||||
font-size: 24rpx;
|
||||
-webkit-box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
}
|
||||
.header-service image {
|
||||
width: 260rpx;
|
||||
height: 260rpx;
|
||||
}
|
||||
.header-service .item {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 滚动
|
||||
*/
|
||||
.nav-roll {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.nav-roll .item {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
.nav {
|
||||
height: 70rpx;
|
||||
border-bottom: 1px solid #d2364c;
|
||||
}
|
||||
.nav .nav-scroll {
|
||||
float: right;
|
||||
width: calc(100% - 230rpx);
|
||||
}
|
||||
.nav .item {
|
||||
padding: 0 20rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.nav-shop-category {
|
||||
padding-right: 38rpx !important;
|
||||
background-size: 14px 14px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航商品分类
|
||||
*/
|
||||
.nav-category {
|
||||
background: #d2364c;
|
||||
width: 220rpx;
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
margin-top: 50rpx;
|
||||
border: 1px solid #d2364c;
|
||||
-webkit-box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
}
|
||||
.nav-category .category-scroll {
|
||||
max-height: 600rpx;
|
||||
}
|
||||
.nav-category .item {
|
||||
padding: 15rpx 20rpx;
|
||||
display: block;
|
||||
font-weight: inherit;
|
||||
color: #f1f1f1;
|
||||
}
|
||||
.nav-category .item:not(:last-child) {
|
||||
border-bottom: 1px solid #c72e44;
|
||||
}
|
247
sourcecode/weixin/default/pages/plugins/shop/detail/detail.js
Normal file
247
sourcecode/weixin/default/pages/plugins/shop/detail/detail.js
Normal file
@ -0,0 +1,247 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
shop: null,
|
||||
shop_favor_user: [],
|
||||
shop_navigation: [],
|
||||
shop_goods_category: [],
|
||||
data: null,
|
||||
goods_list: [],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
search_keywords_value: '',
|
||||
header_service_status: false,
|
||||
nav_category_status: false,
|
||||
shop_category_tab_value: 0,
|
||||
shop_favor_info: {
|
||||
"text": "收藏",
|
||||
"status": 0,
|
||||
"count": 0
|
||||
},
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.get_user_cache_info(),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
var self = this;
|
||||
wx.request({
|
||||
url: app.get_request_url("detail", "index", "shop"),
|
||||
method: "POST",
|
||||
data: {"id": this.data.params.id || 0},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
wx.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_base: data.base || null,
|
||||
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,
|
||||
goods_list: ((data.data || null) != null && (data.data.goods || null) != null && data.data.goods.length > 0) ? data.data.goods : [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
|
||||
// 收藏信息
|
||||
if((this.data.shop || null) != null)
|
||||
{
|
||||
var status = (this.data.shop_favor_user.indexOf(this.data.shop.id) != -1) ? 1 : 0;
|
||||
this.setData({
|
||||
shop_favor_info: {
|
||||
"count": this.data.shop.shop_favor_count || 0,
|
||||
"status": status,
|
||||
"text": ((status == 1) ? '已' : '')+'收藏'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 标题名称
|
||||
if((this.data.shop || null) != null)
|
||||
{
|
||||
wx.setNavigationBarTitle({title: this.data.shop.name});
|
||||
}
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 店铺收藏事件
|
||||
shop_favor_event(e) {
|
||||
var user = app.get_user_info(this, 'shop_favor_event');
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/login/login?event_callback=shop_favor_event"
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
wx.showLoading({title: '处理中...'});
|
||||
wx.request({
|
||||
url: app.get_request_url("favor", "shopfavor", "shop"),
|
||||
method: 'POST',
|
||||
data: {"id": this.data.shop.id},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
wx.hideLoading();
|
||||
if(res.data.code == 0)
|
||||
{
|
||||
this.setData({shop_favor_info: res.data.data});
|
||||
app.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
if (app.is_login_check(res.data, this, 'shop_favor_event')) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.hideLoading();
|
||||
app.showToast('服务器请求出错');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索输入事件
|
||||
search_keywords_event(e) {
|
||||
this.setData({search_keywords_value: e.detail.value || ''});
|
||||
},
|
||||
|
||||
// 搜索事件
|
||||
search_button_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
wx.navigateTo({
|
||||
url: value+'keywords='+this.data.search_keywords_value || '',
|
||||
});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
header_service_event(e) {
|
||||
this.setData({header_service_status: !this.data.header_service_status});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
nav_shop_category_event(e) {
|
||||
this.setData({nav_category_status: !this.data.nav_category_status});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
shop_category_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
wx.navigateTo({ url: '/pages/plugins/shop/search/search?shop_id='+this.data.shop.id+'&category_id='+value });
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
app.url_event(e);
|
||||
},
|
||||
|
||||
// 剪切板
|
||||
text_copy_event(e) {
|
||||
app.text_copy_event(e);
|
||||
},
|
||||
|
||||
// 图片预览
|
||||
image_show_event(e) {
|
||||
app.image_show_event(e);
|
||||
},
|
||||
|
||||
// 分类切换
|
||||
shop_category_tab_event(e) {
|
||||
var value = e.currentTarget.dataset.value || 0;
|
||||
var temp = this.data.data;
|
||||
var goods = [];
|
||||
if(temp.goods.length > 0) {
|
||||
for(var i in temp.goods) {
|
||||
if(temp.goods[i]['shop_category_id'] == value || value == 0) {
|
||||
goods.push(temp.goods[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
shop_category_tab_value: value,
|
||||
goods_list: goods,
|
||||
data_bottom_line_status: (goods.length > 0)
|
||||
});
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.shop.name || this.data.shop.seo_title || app.data.application_title,
|
||||
desc: this.data.shop.seo_desc || app.data.application_describe,
|
||||
path: '/pages/plugins/shop/detail/detail?id='+this.data.shop.id+'&referrer=' + user_id
|
||||
};
|
||||
},
|
||||
|
||||
// 分享朋友圈
|
||||
onShareTimeline() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.shop.name || this.data.shop.seo_title || app.data.application_title,
|
||||
query: 'id='+this.data.shop.id+'&referrer=' + user_id,
|
||||
imageUrl: this.data.shop.logo || ''
|
||||
};
|
||||
},
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#d2364c",
|
||||
"backgroundColorTop": "#d2364c",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"component-layout": "/components/layout/layout"
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
<view wx:if="{{(data || null) != null}}">
|
||||
<!-- 头部 -->
|
||||
<import src="/pages/plugins/shop/public/header.wxml" />
|
||||
<template is="shop-header" data="{{data_base: data_base, shop: shop, shop_navigation: shop_navigation, shop_goods_category: shop_goods_category, shop_favor_info: shop_favor_info, search_keywords_value: search_keywords_value, header_service_status: header_service_status, nav_category_status: nav_category_status}}"></template>
|
||||
|
||||
<!-- 数据模式 -->
|
||||
<block wx:if="{{(shop.data_model || 0) == 1}}">
|
||||
<!-- 拖拽模式、引入拖拽数据模块 -->
|
||||
<component-layout prop-data="{{data}}"></component-layout>
|
||||
</block>
|
||||
<!-- 自动模式 -->
|
||||
<block wx:else>
|
||||
<view class="shop-category-list nav-roll oh bg-white margin-top-sm margin-bottom-sm">
|
||||
<scroll-view scroll-x>
|
||||
<view class="item {{(shop_category_tab_value == 0) ? 'active' : ''}}" bindtap="shop_category_tab_event" data-value="0">全部商品</view>
|
||||
<block wx:if="{{shop_goods_category.length > 0}}">
|
||||
<block wx:for="{{shop_goods_category}}" wx:key="key">
|
||||
<view class="item {{(shop_category_tab_value == item.id) ? 'active' : ''}}" bindtap="shop_category_tab_event" data-value="{{item.id}}">{{item.name}}</view>
|
||||
</block>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="data-list oh">
|
||||
<block wx:if="{{goods_list.length > 0}}">
|
||||
<block wx:for="{{goods_list}}" wx:key="key">
|
||||
<view wx:if="{{item.active != 0}}" class="items bg-white">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.id}}" hover-class="none">
|
||||
<image src="{{item.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: 0}}"></template>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
198
sourcecode/weixin/default/pages/plugins/shop/detail/detail.wxss
Normal file
198
sourcecode/weixin/default/pages/plugins/shop/detail/detail.wxss
Normal file
@ -0,0 +1,198 @@
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
.search {
|
||||
background: #d2364c;
|
||||
padding: 20rpx 10rpx 25rpx 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
.search input {
|
||||
width: calc(100% - 328rpx);
|
||||
padding-left: 15rpx;
|
||||
font-size: 24rpx;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.search input,.search-btn button {
|
||||
height: 52rpx;
|
||||
line-height: 52rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.search-btn {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.search-btn button {
|
||||
color: #fff;
|
||||
width: 150rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.search-btn button:first-child {
|
||||
background: #ff8c00;
|
||||
border: 1px solid #ff8c00;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.search-btn button:last-child {
|
||||
background: #483E39;
|
||||
border: 1px solid #483E39;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 头部
|
||||
*/
|
||||
.header {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
.shop-logo {
|
||||
width: 280rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.base-bottom image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
.header .base {
|
||||
width: calc(100% - 320rpx);
|
||||
}
|
||||
.shop-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.shop-auth-icon {
|
||||
background-color: #f4c985;
|
||||
border: 1px solid #e7ba77;
|
||||
border-radius: 6rpx;
|
||||
color: #856651;
|
||||
text-align: center;
|
||||
padding: 2rpx 12rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客服
|
||||
*/
|
||||
.header-service {
|
||||
width: 390rpx;
|
||||
position: absolute;
|
||||
left: 80rpx;
|
||||
top: 210rpx;
|
||||
z-index: 2;
|
||||
font-size: 24rpx;
|
||||
-webkit-box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
}
|
||||
.header-service image {
|
||||
width: 260rpx;
|
||||
height: 260rpx;
|
||||
}
|
||||
.header-service .item {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 滚动
|
||||
*/
|
||||
.nav-roll {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.nav-roll .item {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
.nav {
|
||||
height: 70rpx;
|
||||
border-bottom: 1px solid #d2364c;
|
||||
}
|
||||
.nav .nav-scroll {
|
||||
float: right;
|
||||
width: calc(100% - 230rpx);
|
||||
}
|
||||
.nav .item {
|
||||
padding: 0 20rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.nav-shop-category {
|
||||
padding-right: 38rpx !important;
|
||||
background-size: 14px 14px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航商品分类
|
||||
*/
|
||||
.nav-category {
|
||||
background: #d2364c;
|
||||
width: 220rpx;
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
margin-top: 50rpx;
|
||||
border: 1px solid #d2364c;
|
||||
-webkit-box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
}
|
||||
.nav-category .category-scroll {
|
||||
max-height: 600rpx;
|
||||
}
|
||||
.nav-category .item {
|
||||
padding: 15rpx 20rpx;
|
||||
display: block;
|
||||
font-weight: inherit;
|
||||
color: #f1f1f1;
|
||||
}
|
||||
.nav-category .item:not(:last-child) {
|
||||
border-bottom: 1px solid #c72e44;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类切换
|
||||
*/
|
||||
.shop-category-list {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
.shop-category-list .item {
|
||||
border-radius: 6rpx;
|
||||
padding: 5rpx 20rpx;
|
||||
}
|
||||
.shop-category-list .active {
|
||||
background: #d2364c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.data-list .items {
|
||||
width: calc(50% - 5rpx);
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.data-list .items:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .items:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 100%;
|
||||
height: 200px !important;
|
||||
}
|
||||
.data-list .items .base {
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
.data-list .items .base,
|
||||
.data-list .items .base .price {
|
||||
margin-top: 15rpx;
|
||||
}
|
184
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.js
Executable file
184
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.js
Executable file
@ -0,0 +1,184 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
wx.redirectTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
// 获取数据
|
||||
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.data_bottom_line_status == true) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 加载loding
|
||||
wx.showLoading({title: "加载中..." });
|
||||
this.setData({
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
wx.request({
|
||||
url: app.get_request_url("index", "shopfavor", "shop"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data.data_page
|
||||
},
|
||||
dataType: "json",
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data.data_list;
|
||||
var temp_data = res.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: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data.data_page + 1
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
if (this.data.data_page > 1 && this.data.data_page > this.data.data_page_total)
|
||||
{
|
||||
this.setData({ data_bottom_line_status: true });
|
||||
} else {
|
||||
this.setData({data_bottom_line_status: false});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
if (app.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
|
||||
this.setData({
|
||||
data_list_loding_status: 2
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel_event(e) {
|
||||
wx.showModal({
|
||||
title: "温馨提示",
|
||||
content: "取消后不可恢复,确定继续吗?",
|
||||
confirmText: "确认",
|
||||
cancelText: "不了",
|
||||
success: result => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
wx.showLoading({title: "处理中..." });
|
||||
|
||||
wx.request({
|
||||
url: app.get_request_url("delete", "shopfavor", "shop"),
|
||||
method: "POST",
|
||||
data: {ids: id},
|
||||
dataType: "json",
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
wx.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data_list = this.data.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.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
} else {
|
||||
app.showToast('提交失败,请重试!');
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.hideLoading();
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
6
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.json
Executable file
6
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.json
Executable file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "店铺收藏",
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
20
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxml
Executable file
20
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxml
Executable file
@ -0,0 +1,20 @@
|
||||
<scroll-view scroll-y="{{true}}" class="scroll-box" bindscrolltolower="scroll_lower" lower-threshold="30">
|
||||
<view class="list-item" wx:if="{{data_list.length > 0}}">
|
||||
<view class="item oh bg-white spacing-mb" wx:for="{{data_list}}" wx:for-item="item" >
|
||||
<navigator url="/pages/plugins/shop/detail/detail?id={{item.shop_info.id}}" hover-class="none">
|
||||
<image class="logo fl" src="{{item.shop_info.logo}}" mode="aspectFill" />
|
||||
<view class="base">
|
||||
<view class="title single-text">{{item.shop_info.name}}</view>
|
||||
<view class="describe multi-text cr-888">{{item.shop_info.describe}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<button class="submit-cancel" type="default" size="mini" bindtap="cancel_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</scroll-view>
|
29
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxss
Executable file
29
sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxss
Executable file
@ -0,0 +1,29 @@
|
||||
.item {
|
||||
padding: 20rpx 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
.logo {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.title {
|
||||
margin-bottom: 15rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.describe {
|
||||
font-size: 28rpx;
|
||||
line-height: 42rpx;
|
||||
min-height: 84rpx;
|
||||
width: calc(100% - 325rpx);
|
||||
}
|
||||
|
||||
.submit-cancel {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 20rpx;
|
||||
border: 1px solid #f7c3b3;
|
||||
color: #f7c3b3 !important;
|
||||
padding: 0 35rpx;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
<template name="shop-header">
|
||||
<!-- 搜索 -->
|
||||
<view class="search oh">
|
||||
<input type="done" placeholder="请输入您搜索的商品关键字" value="{{search_keywords_value || ''}}" class="bg-white wh-auto fl" placeholder-class="cr-ccc" bindinput="search_keywords_event" />
|
||||
<view class="search-btn fr">
|
||||
<button class="mini-btn" type="default" size="mini" hover-class="none" bindtap="search_button_event" data-value="/pages/goods-search/goods-search?">搜全站</button>
|
||||
<button class="mini-btn" type="default" size="mini" hover-class="none" bindtap="search_button_event" data-value="/pages/plugins/shop/search/search?shop_id={{shop.id}}&">搜本店</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 顶部 -->
|
||||
<view class="header bg-white oh">
|
||||
<image src="{{shop.logo_long}}" mode="widthFix" class="shop-logo fl br-r padding-right-lg"></image>
|
||||
<view class="base fr">
|
||||
<view class="shop-title single-text">
|
||||
<text wx:if="{{((data_base.is_auth_fill_info || 0) == 1 || (data_base.is_auth_upload_pic || 0) == 1) && shop.auth_type == 1 && (shop.auth_type_name || null) != null}}" class="shop-auth-icon">{{shop.auth_type_name}}</text>
|
||||
<text>{{shop.name}}</text>
|
||||
</view>
|
||||
<view class="base-bottom oh margin-top-sm">
|
||||
<view wx:if="{{(data_base.is_service_info || 0) == 1}}" class="fl margin-right-xxl" bindtap="header_service_event">
|
||||
<image src="/images/user-nav-customer-service-icon.png" mode="scaleToFill" class="va-m" />
|
||||
<text class="va-m cr-666">在线客服</text>
|
||||
</view>
|
||||
<view class="fl single-text" bindtap="shop_favor_event">
|
||||
<image src="/images/default-xingxing-icon{{shop_favor_info.status == 1 ? '-active' : ''}}.png" mode="scaleToFill" class="va-m" />
|
||||
<text class="va-m {{shop_favor_info.status == 1 ? 'cr-main' : ''}}">{{shop_favor_info.text}}({{shop_favor_info.count}})</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 在线客服 -->
|
||||
<view wx:if="{{header_service_status && (data_base.is_service_info || 0) == 1}}" class="header-service bg-white oh padding-top-xxl br">
|
||||
<view wx:if="{{(shop.service_weixin_qrcode || null) != null}}" class="tc margin-bottom-sm">
|
||||
<image src="{{shop.service_weixin_qrcode}}" mode="scaleToFill" bindtap="image_show_event" data-value="{{shop.service_weixin_qrcode}}" />
|
||||
<view>点击长按微信咨询</view>
|
||||
</view>
|
||||
<view wx:if="{{(shop.service_qq || null) != null}}" class="item br-t single-text">
|
||||
<text>QQ:</text>
|
||||
<text bindtap="text_copy_event" data-value="{{shop.service_qq}}">{{shop.service_qq}}</text>
|
||||
</view>
|
||||
<view wx:if="{{(shop.service_tel || null) != null}}" class="item br-t single-text">
|
||||
<text>电话:</text>
|
||||
<text bindtap="text_copy_event" data-value="{{shop.service_tel}}">{{shop.service_tel}}</text>
|
||||
</view>
|
||||
<view wx:if="{{(shop.open_week_name || null) != null && (shop.close_week_name || null) != null}}" class="item br-t single-text">
|
||||
<text>时间:</text>
|
||||
<text bindtap="text_copy_event" data-value="{{shop.open_week_name}}至{{shop.close_week_name}},{{shop.open_time}}-{{shop.close_time}}">{{shop.open_week_name}}至{{shop.close_week_name}},{{shop.open_time}}-{{shop.close_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view class="nav nav-roll bg-white padding-top-lg">
|
||||
<view class="item arrow-bottom nav-shop-category fl" bindtap="nav_shop_category_event">查看商品分类</view>
|
||||
<scroll-view scroll-x class="nav-scroll">
|
||||
<block wx:if="{{shop_navigation.length > 0}}">
|
||||
<block wx:for="{{shop_navigation}}" wx:key="key">
|
||||
<view class="item" bindtap="nav_event" data-value="{{item.url}}" data-index="{{index}}">{{item.name}}</view>
|
||||
</block>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<view wx:if="{{nav_category_status}}" class="nav-category bg-white tc">
|
||||
<scroll-view scroll-y class="category-scroll">
|
||||
<block wx:if="{{shop_goods_category.length > 0}}">
|
||||
<block wx:for="{{shop_goods_category}}" wx:key="key">
|
||||
<view class="item single-text" bindtap="shop_category_event" data-value="{{item.id}}">{{item.name}}</view>
|
||||
</block>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="padding-top-xxl padding-bottom-xxl cr-888">暂无数据</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
358
sourcecode/weixin/default/pages/plugins/shop/search/search.js
Executable file
358
sourcecode/weixin/default/pages/plugins/shop/search/search.js
Executable file
@ -0,0 +1,358 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
params: null,
|
||||
post_data: {},
|
||||
is_show_popup_form: false,
|
||||
popup_form_loading_status: false,
|
||||
search_nav_sort_list: [
|
||||
{ name: "综合", field: "default", sort: "asc", "icon": null },
|
||||
{ name: "销量", field: "sales_count", sort: "asc", "icon": "default" },
|
||||
{ name: "热度", field: "access_count", sort: "asc", "icon": "default" },
|
||||
{ name: "价格", field: "min_price", sort: "asc", "icon": "default" },
|
||||
{ name: "最新", field: "id", sort: "asc", "icon": "default" }
|
||||
],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
|
||||
// 搜素条件
|
||||
search_map_info: [],
|
||||
category_list: [],
|
||||
map_fields_list: {
|
||||
"category_list": {"height":"82rpx", "default":"82rpx", "form_key":"category_ids"}
|
||||
},
|
||||
},
|
||||
|
||||
onLoad(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})
|
||||
}
|
||||
});
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 搜索
|
||||
search_event() {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_page: 1
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data.data_bottom_line_status == true) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 加载loding
|
||||
wx.showLoading({title: "加载中..." });
|
||||
|
||||
// 参数
|
||||
var post_data = this.request_map_handle();
|
||||
|
||||
// 获取数据
|
||||
wx.request({
|
||||
url: app.get_request_url("index", "search", "shop"),
|
||||
method: "POST",
|
||||
data: post_data,
|
||||
dataType: "json",
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
|
||||
// 仅首次请求赋值条件数据
|
||||
if(this.data.data_list_loding_status == 1)
|
||||
{
|
||||
this.setData({
|
||||
search_map_info: data.search_map_info || [],
|
||||
category_list: data.shop_goods_category || [],
|
||||
});
|
||||
|
||||
// 指定分类id选中处理
|
||||
if((this.data.params.category_id || 0) != 0 && this.data.category_list.length > 0)
|
||||
{
|
||||
var temp = this.data.category_list;
|
||||
for(var i in temp)
|
||||
{
|
||||
if(temp[i]['id'] == this.data.params.category_id)
|
||||
{
|
||||
temp[i]['active'] = 1;
|
||||
}
|
||||
}
|
||||
this.setData({category_list: temp});
|
||||
}
|
||||
}
|
||||
|
||||
// 列表数据处理
|
||||
if (data.data.length > 0) {
|
||||
if (this.data.data_page <= 1) {
|
||||
var temp_data_list = data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data.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.data_page + 1
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
if (this.data.data_page > 1 && this.data.data_page > this.data.data_page_total)
|
||||
{
|
||||
this.setData({ data_bottom_line_status: true });
|
||||
} else {
|
||||
this.setData({data_bottom_line_status: false});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
if (this.data.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
|
||||
});
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.hideLoading();
|
||||
wx.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索条件处理
|
||||
request_map_handle() {
|
||||
var params = this.data.params;
|
||||
var post_data = this.data.post_data;
|
||||
post_data['page'] = this.data.data_page;
|
||||
|
||||
// 店铺id
|
||||
post_data['shop_id'] = params['shop_id'] || 0;
|
||||
|
||||
// 搜索条件
|
||||
var data = this.data;
|
||||
for(var i in data.map_fields_list)
|
||||
{
|
||||
if((data[i] != null) != null && data[i].length > 0)
|
||||
{
|
||||
var temp = {};
|
||||
var index = 0;
|
||||
for(var k in data[i])
|
||||
{
|
||||
if((data[i][k]['active'] || 0) == 1)
|
||||
{
|
||||
// 默认取值id
|
||||
temp[index] = data[i][k]['id'];
|
||||
index++;
|
||||
}
|
||||
}
|
||||
post_data[data.map_fields_list[i]['form_key']] = (app.get_length(temp) > 0) ? JSON.stringify(temp) : '';
|
||||
}
|
||||
}
|
||||
|
||||
return post_data;
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 搜索条件
|
||||
form_submit_event(e) {
|
||||
this.setData({ post_data: e.detail.value, data_page: 1});
|
||||
this.popup_form_event_close();
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 筛选条件关闭
|
||||
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_post_data = this.data.post_data;
|
||||
var temp_search_nav_sort = this.data.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;
|
||||
}
|
||||
|
||||
temp_post_data['order_by_field'] = temp_search_nav_sort[index]['field'];
|
||||
temp_post_data['order_by_type'] = temp_sort;
|
||||
|
||||
this.setData({
|
||||
post_data: temp_post_data,
|
||||
search_nav_sort_list: temp_search_nav_sort,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 条件-更多数据展示事件
|
||||
more_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
var temp_more = this.data.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 index = e.currentTarget.dataset.index;
|
||||
var field = e.currentTarget.dataset.field;
|
||||
var data = this.data;
|
||||
if((data[field] || null) != null && (data[field][index] || null) != null)
|
||||
{
|
||||
data[field][index]['active'] = ((data[field][index]['active'] || 0) == 0) ? 1 : 0;
|
||||
this.setData(data);
|
||||
}
|
||||
},
|
||||
|
||||
// 条件-清空
|
||||
map_remove_event(e) {
|
||||
var data = this.data;
|
||||
// 关键字
|
||||
data['post_data']['wd'] = '';
|
||||
|
||||
// 分类
|
||||
for(var i in data.map_fields_list)
|
||||
{
|
||||
if((data[i] != null) != null && data[i].length > 0)
|
||||
{
|
||||
for(var k in data[i])
|
||||
{
|
||||
data[i][k]['active'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭条件弹层
|
||||
data['is_show_popup_form'] = false;
|
||||
|
||||
// 分页恢复1页、重新获取数据
|
||||
data['data_page'] = 1;
|
||||
this.setData(data);
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
var shop_id = this.data.params['shop_id'] || 0;
|
||||
var category_id = this.data.params['category_id'] || 0;
|
||||
var keywords = this.data.params['keywords'] || '';
|
||||
return {
|
||||
title: this.data.shop.name || app.data.application_title,
|
||||
desc: this.data.shop.describe || app.data.application_describe,
|
||||
path: '/pages/plugins/shop/search/search?shop_id='+shop_id+'&referrer=' + user_id+'&category_id='+category_id+'&keywords='+keywords
|
||||
};
|
||||
},
|
||||
|
||||
// 分享朋友圈
|
||||
onShareTimeline() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
var shop_id = this.data.params['shop_id'] || 0;
|
||||
var category_id = this.data.params['category_id'] || 0;
|
||||
var keywords = this.data.params['keywords'] || '';
|
||||
return {
|
||||
title: this.data.shop.name || app.data.application_title,
|
||||
query: 'shop_id='+shop_id+'&referrer=' + user_id+'&category_id='+category_id+'&keywords='+keywords
|
||||
};
|
||||
},
|
||||
});
|
8
sourcecode/weixin/default/pages/plugins/shop/search/search.json
Executable file
8
sourcecode/weixin/default/pages/plugins/shop/search/search.json
Executable file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "店铺商品搜索",
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
}
|
72
sourcecode/weixin/default/pages/plugins/shop/search/search.wxml
Executable file
72
sourcecode/weixin/default/pages/plugins/shop/search/search.wxml
Executable file
@ -0,0 +1,72 @@
|
||||
<!-- 排序 -->
|
||||
<view class="nav-sort oh">
|
||||
<view class="nav-sort-content">
|
||||
<block wx:for="{{search_nav_sort_list}}" wx:key="key">
|
||||
<view class="item tc fl" data-index="{{index}}" bindtap="nav_sort_event">
|
||||
<text class="cr-666">{{item.name}}</text>
|
||||
<image wx:if="{{(item.icon || null) != null}}" class="icon" src="/images/search-{{item.icon}}-icon.png" mode="aspectFill" />
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<image class="screening-submit" src="/images/search-submit-icon.png" mode="aspectFill" bindtap="popup_form_event_show" />
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view scroll-y="{{true}}" class="scroll-box" bindscrolltolower="scroll_lower" lower-threshold="30">
|
||||
<view class="data-list">
|
||||
<view class="items bg-white" wx:for="{{data_list}}" wx:key="key">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.id}}" hover-class="none">
|
||||
<image src="{{item.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 筛选条件 popup -->
|
||||
<component-popup prop-show="{{is_show_popup_form}}" prop-position="left" bindonclose="popup_form_event_close">
|
||||
<form bindsubmit="form_submit_event" class="popup-form oh bg-white">
|
||||
<view class="search-map">
|
||||
<view class="map-item map-base">
|
||||
<text>筛选出</text>
|
||||
<text class="cr-main"> {{data_total}} </text>
|
||||
<text>条数据</text>
|
||||
<text class="map-remove-submit fr" bindtap="map_remove_event">清除</text>
|
||||
</view>
|
||||
|
||||
<!-- 搜索关键字 -->
|
||||
<input type="text" placeholder="其实搜索很简单^_^ !" name="wd" value="{{(post_data.wd || '')}}" class="map-keywords wh-auto" placeholder-class="cr-ccc" />
|
||||
|
||||
<!-- 分类 -->
|
||||
<view wx:if="{{(category_list || null) != null && category_list.length > 0}}" class="map-item">
|
||||
<view class="map-nav tc">
|
||||
<text>分类</text>
|
||||
<text class="arrow-bottom" wx:if="{{category_list.length > 3}}" bindtap="more_event" data-value="category_list">更多</text>
|
||||
</view>
|
||||
<view class="map-content map-text-items map-category-container oh bg-white" style="height:{{map_fields_list.category_list.height}};">
|
||||
<block wx:for="{{category_list}}" wx:key="key">
|
||||
<view class="fl {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="category_list">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button formType="submit" class="bg-main search-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
|
||||
</view>
|
||||
</form>
|
||||
</component-popup>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
162
sourcecode/weixin/default/pages/plugins/shop/search/search.wxss
Executable file
162
sourcecode/weixin/default/pages/plugins/shop/search/search.wxss
Executable file
@ -0,0 +1,162 @@
|
||||
/**
|
||||
* 排序导航
|
||||
*/
|
||||
.nav-sort {
|
||||
background: #eee;
|
||||
}
|
||||
.nav-sort-content .item {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 130rpx;
|
||||
}
|
||||
.nav-sort-content .item .icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.nav-sort-content .item text, .nav-sort-content .item image {
|
||||
vertical-align:middle;
|
||||
}
|
||||
.screening-submit {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
position: absolute;
|
||||
top: 15rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 80rpx);
|
||||
}
|
||||
.data-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-list .items {
|
||||
width: calc(50% - 5rpx);
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.data-list .items:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .items:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 100%;
|
||||
height: 200px !important;
|
||||
}
|
||||
.data-list .items .base {
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
.data-list .items .base,
|
||||
.data-list .items .base .price {
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件
|
||||
*/
|
||||
.search-map {
|
||||
height: calc(100vh - 80rpx);
|
||||
width: 680rpx;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.map-keywords {
|
||||
border-radius: 0 !important;
|
||||
padding: 0 10rpx;
|
||||
line-height: 66rpx;
|
||||
height: 66rpx;
|
||||
font-size: 26rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.map-nav {
|
||||
position: relative;
|
||||
}
|
||||
.map-nav .arrow-bottom {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 10rpx;
|
||||
padding-right: 46rpx;
|
||||
color: #999;
|
||||
}
|
||||
.map-item {
|
||||
background: #f0f0f0;
|
||||
line-height: 76rpx;
|
||||
}
|
||||
.map-base,
|
||||
.map-nav {
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.map-content {
|
||||
padding: 15rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.map-text-items view,
|
||||
.map-images-text-items view {
|
||||
padding: 0 15rpx;
|
||||
border-radius: 2px;
|
||||
margin: 15rpx;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.map-images-text-items view {
|
||||
vertical-align: middle;
|
||||
border: 1px solid #eee;
|
||||
width: 150rpx;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
.map-images-text-items view image {
|
||||
width: 150rpx;
|
||||
height: calc(100% - 8rpx);
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
.map-text-items view.active,
|
||||
.map-images-text-items view.active {
|
||||
border: 1px solid #e23f36;
|
||||
color: #e23f36;
|
||||
font-weight: bold;
|
||||
}
|
||||
.search-map .search-submit {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
.map-remove-submit {
|
||||
color: #e23f36;
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌基础信息
|
||||
*/
|
||||
.brand-info {
|
||||
padding: 35rpx 15rpx;
|
||||
}
|
||||
.brand-info image,
|
||||
.brand-info .info-logo-empty {
|
||||
width: 300rpx;
|
||||
height: 130rpx;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.brand-info .info-logo-empty {
|
||||
line-height: 130rpx;
|
||||
}
|
||||
.brand-info .info-right {
|
||||
width: calc(100% - 330rpx);
|
||||
}
|
||||
.brand-info .info-desc {
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
min-height: 80rpx;
|
||||
}
|
Loading…
Reference in New Issue
Block a user