Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
ebc295cc
ShopXO
项目概览
jamesyang1999
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ebc295cc
编写于
1月 12, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小程序品牌开发、首页商品自动模式不需要推荐
上级
b11b6518
变更
51
展开全部
隐藏空白更改
内联
并排
Showing
51 changed file
with
2650 addition
and
354 deletion
+2650
-354
application/admin/form/Goods.php
application/admin/form/Goods.php
+0
-16
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+0
-4
application/index/controller/Goods.php
application/index/controller/Goods.php
+2
-3
application/index/controller/Index.php
application/index/controller/Index.php
+1
-1
application/service/GoodsService.php
application/service/GoodsService.php
+2
-4
config/shopxo.sql
config/shopxo.sql
+464
-48
sourcecode/alipay/default/app.acss
sourcecode/alipay/default/app.acss
+1
-0
sourcecode/alipay/default/app.json
sourcecode/alipay/default/app.json
+2
-1
sourcecode/alipay/default/pages/goods-search/goods-search.acss
...ecode/alipay/default/pages/goods-search/goods-search.acss
+89
-26
sourcecode/alipay/default/pages/goods-search/goods-search.axml
...ecode/alipay/default/pages/goods-search/goods-search.axml
+88
-12
sourcecode/alipay/default/pages/goods-search/goods-search.js
sourcecode/alipay/default/pages/goods-search/goods-search.js
+140
-15
sourcecode/alipay/default/pages/index/index.acss
sourcecode/alipay/default/pages/index/index.acss
+1
-1
sourcecode/alipay/default/pages/plugins/brand/index/index.acss
...ecode/alipay/default/pages/plugins/brand/index/index.acss
+48
-0
sourcecode/alipay/default/pages/plugins/brand/index/index.axml
...ecode/alipay/default/pages/plugins/brand/index/index.axml
+32
-0
sourcecode/alipay/default/pages/plugins/brand/index/index.js
sourcecode/alipay/default/pages/plugins/brand/index/index.js
+129
-0
sourcecode/alipay/default/pages/plugins/brand/index/index.json
...ecode/alipay/default/pages/plugins/brand/index/index.json
+4
-0
sourcecode/baidu/default/app.css
sourcecode/baidu/default/app.css
+1
-0
sourcecode/baidu/default/app.json
sourcecode/baidu/default/app.json
+2
-1
sourcecode/baidu/default/pages/goods-search/goods-search.css
sourcecode/baidu/default/pages/goods-search/goods-search.css
+85
-23
sourcecode/baidu/default/pages/goods-search/goods-search.js
sourcecode/baidu/default/pages/goods-search/goods-search.js
+169
-50
sourcecode/baidu/default/pages/goods-search/goods-search.swan
...cecode/baidu/default/pages/goods-search/goods-search.swan
+88
-12
sourcecode/baidu/default/pages/index/index.css
sourcecode/baidu/default/pages/index/index.css
+2
-2
sourcecode/baidu/default/pages/plugins/brand/index/index.css
sourcecode/baidu/default/pages/plugins/brand/index/index.css
+48
-0
sourcecode/baidu/default/pages/plugins/brand/index/index.js
sourcecode/baidu/default/pages/plugins/brand/index/index.js
+131
-0
sourcecode/baidu/default/pages/plugins/brand/index/index.json
...cecode/baidu/default/pages/plugins/brand/index/index.json
+4
-0
sourcecode/baidu/default/pages/plugins/brand/index/index.swan
...cecode/baidu/default/pages/plugins/brand/index/index.swan
+32
-0
sourcecode/qq/default/app.json
sourcecode/qq/default/app.json
+2
-1
sourcecode/qq/default/app.qss
sourcecode/qq/default/app.qss
+1
-0
sourcecode/qq/default/pages/goods-search/goods-search.js
sourcecode/qq/default/pages/goods-search/goods-search.js
+140
-16
sourcecode/qq/default/pages/goods-search/goods-search.qml
sourcecode/qq/default/pages/goods-search/goods-search.qml
+88
-12
sourcecode/qq/default/pages/goods-search/goods-search.qss
sourcecode/qq/default/pages/goods-search/goods-search.qss
+85
-23
sourcecode/qq/default/pages/index/index.qss
sourcecode/qq/default/pages/index/index.qss
+1
-1
sourcecode/qq/default/pages/plugins/brand/index/index.js
sourcecode/qq/default/pages/plugins/brand/index/index.js
+129
-0
sourcecode/qq/default/pages/plugins/brand/index/index.json
sourcecode/qq/default/pages/plugins/brand/index/index.json
+4
-0
sourcecode/qq/default/pages/plugins/brand/index/index.qml
sourcecode/qq/default/pages/plugins/brand/index/index.qml
+32
-0
sourcecode/qq/default/pages/plugins/brand/index/index.qss
sourcecode/qq/default/pages/plugins/brand/index/index.qss
+48
-0
sourcecode/toutiao/default/app.json
sourcecode/toutiao/default/app.json
+2
-1
sourcecode/toutiao/default/app.ttss
sourcecode/toutiao/default/app.ttss
+1
-0
sourcecode/toutiao/default/pages/goods-search/goods-search.js
...cecode/toutiao/default/pages/goods-search/goods-search.js
+139
-16
sourcecode/toutiao/default/pages/goods-search/goods-search.ttml
...code/toutiao/default/pages/goods-search/goods-search.ttml
+88
-12
sourcecode/toutiao/default/pages/goods-search/goods-search.ttss
...code/toutiao/default/pages/goods-search/goods-search.ttss
+85
-23
sourcecode/toutiao/default/pages/index/index.ttss
sourcecode/toutiao/default/pages/index/index.ttss
+1
-1
sourcecode/toutiao/default/pages/plugins/brand/index/index.js
...cecode/toutiao/default/pages/plugins/brand/index/index.js
+129
-0
sourcecode/toutiao/default/pages/plugins/brand/index/index.json
...code/toutiao/default/pages/plugins/brand/index/index.json
+4
-0
sourcecode/toutiao/default/pages/plugins/brand/index/index.ttml
...code/toutiao/default/pages/plugins/brand/index/index.ttml
+32
-0
sourcecode/toutiao/default/pages/plugins/brand/index/index.ttss
...code/toutiao/default/pages/plugins/brand/index/index.ttss
+48
-0
sourcecode/weixin/default/app.wxss
sourcecode/weixin/default/app.wxss
+1
-0
sourcecode/weixin/default/pages/goods-search/goods-search.js
sourcecode/weixin/default/pages/goods-search/goods-search.js
+20
-20
sourcecode/weixin/default/pages/goods-search/goods-search.wxml
...ecode/weixin/default/pages/goods-search/goods-search.wxml
+2
-4
sourcecode/weixin/default/pages/goods-search/goods-search.wxss
...ecode/weixin/default/pages/goods-search/goods-search.wxss
+2
-4
sourcecode/weixin/default/pages/index/index.wxss
sourcecode/weixin/default/pages/index/index.wxss
+1
-1
未找到文件。
application/admin/form/Goods.php
浏览文件 @
ebc295cc
...
...
@@ -166,22 +166,6 @@ class Goods
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'首页推荐'
,
'view_type'
=>
'status'
,
'view_key'
=>
'is_home_recommended'
,
'post_url'
=>
MyUrl
(
'admin/goods/statusupdate'
),
'align'
=>
'center'
,
'is_sort'
=>
1
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'where_type'
=>
'in'
,
'data'
=>
lang
(
'common_is_text_list'
),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'扣减库存'
,
'view_type'
=>
'status'
,
...
...
application/admin/view/default/goods/save_info.html
浏览文件 @
ebc295cc
...
...
@@ -174,10 +174,6 @@
<label
class=
"block"
>
上下架
<span
class=
"am-form-group-label-tips"
>
下架后用户不可见
</span></label>
<input
name=
"is_shelves"
value=
"1"
type=
"checkbox"
data-off-text=
"下架"
data-on-text=
"上架"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
(
isset
($
data
['
is_shelves
'])
and
$
data
['
is_shelves
']
eq
1)
or
empty
($
data
)}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
首页推荐
<span
class=
"am-form-group-label-tips"
>
推荐后在首页展示
</span></label>
<input
name=
"is_home_recommended"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
isset
($
data
['
is_home_recommended
'])
and
$
data
['
is_home_recommended
']
eq
1}}
checked=
"true"
{{/
if
}}
/>
</div>
</div>
<!-- 规格 -->
...
...
application/index/controller/Goods.php
浏览文件 @
ebc295cc
...
...
@@ -126,9 +126,8 @@ class Goods extends Common
// 详情tab商品 猜你喜欢
$params
=
[
'where'
=>
[
'is_delete_time'
=>
0
,
'is_shelves'
=>
1
,
'is_home_recommended'
=>
1
,
'is_delete_time'
=>
0
,
'is_shelves'
=>
1
,
],
'order_by'
=>
'sales_count desc'
,
'field'
=>
'id,title,title_color,price,images'
,
...
...
application/index/controller/Index.php
浏览文件 @
ebc295cc
...
...
@@ -58,7 +58,7 @@ class Index extends Common
// 楼层数据
$this
->
assign
(
'goods_floor_list'
,
GoodsService
::
HomeFloorList
());
//
新闻
//
文章
$params
=
[
'where'
=>
[
'is_enable'
=>
1
,
'is_home_recommended'
=>
1
],
'field'
=>
'id,title,title_color,article_category_id'
,
...
...
application/service/GoodsService.php
浏览文件 @
ebc295cc
...
...
@@ -264,9 +264,8 @@ class GoodsService
// 获取商品ids
$where
=
[
'gci.category_id'
=>
$category_ids
,
'g.is_home_recommended'
=>
1
,
'g.is_shelves'
=>
1
,
'gci.category_id'
=>
$category_ids
,
'g.is_shelves'
=>
1
,
];
$v
[
'goods_ids'
]
=
Db
::
name
(
'Goods'
)
->
alias
(
'g'
)
->
join
([
'__GOODS_CATEGORY_JOIN__'
=>
'gci'
],
'g.id=gci.goods_id'
)
->
where
(
$where
)
->
group
(
'g.id'
)
->
order
(
$order_by
)
->
limit
(
$goods_count
)
->
column
(
'g.id'
);
}
...
...
@@ -1090,7 +1089,6 @@ class GoodsService
'is_shelves'
=>
isset
(
$params
[
'is_shelves'
])
?
intval
(
$params
[
'is_shelves'
])
:
0
,
'content_web'
=>
$content_web
,
'photo_count'
=>
count
(
$photo
[
'data'
]),
'is_home_recommended'
=>
isset
(
$params
[
'is_home_recommended'
])
?
intval
(
$params
[
'is_home_recommended'
])
:
0
,
'images'
=>
$images
,
'brand_id'
=>
isset
(
$params
[
'brand_id'
])
?
intval
(
$params
[
'brand_id'
])
:
0
,
'video'
=>
$attachment
[
'data'
][
'video'
],
...
...
config/shopxo.sql
浏览文件 @
ebc295cc
此差异已折叠。
点击以展开。
sourcecode/alipay/default/app.acss
浏览文件 @
ebc295cc
...
...
@@ -138,6 +138,7 @@ textarea {
min-height: 104rpx;
line-height: 52rpx;
font-size: 32rpx;
white-space: initial;
}
...
...
sourcecode/alipay/default/app.json
浏览文件 @
ebc295cc
...
...
@@ -76,7 +76,8 @@
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail"
,
"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/points/index/index"
,
"pages/plugins/brand/index/index"
],
"window"
:
{
"defaultTitle"
:
"{{application_title}}"
,
...
...
sourcecode/alipay/default/pages/goods-search/goods-search.acss
浏览文件 @
ebc295cc
...
...
@@ -13,6 +13,9 @@
width: 30rpx;
height: 30rpx;
}
.nav-sort-content .item text, .nav-sort-content .item image {
vertical-align:middle;
}
.screening-submit {
width: 50rpx;
height: 50rpx;
...
...
@@ -55,46 +58,106 @@
margin-top: 15rpx;
}
/**
* 条件
*/
.popup-form {
height: calc(100vh - 20rpx);
padding: 20rpx 20rpx 0 20rpx;
}
.popup-form input {
.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;
height: 60rpx;
line-height: 60rpx;
background: #fbfbfb;
border-radius: 6rpx;
}
.screening-price input {
width: calc(50% - 20px);
box-sizing: border-box;
}
.
screening-price .separator
{
line-height: 50rpx
;
.
map-nav
{
position: relative
;
}
.popup-form .item {
width: 480rpx;
padding: 0 20rpx;
margin-top: 20rpx;
.map-nav .arrow-bottom {
position: absolute;
top: 0;
right: 10rpx;
padding-right: 46rpx;
color: #999;
}
.popup-form .keywords input {
width: calc(100% - 30rpx);
.map-item {
background: #f0f0f0;
line-height: 76rpx;
}
.popup-form .item:not(:last-child) {
margin-bottom: 50rpx;
.map-base,
.map-nav {
padding: 0 10rpx;
}
.
popup-form .item .title
{
margin-bottom: 10
rpx;
font-size: 28
rpx;
.
map-content
{
padding: 15
rpx;
line-height: 60
rpx;
}
.popup-form .form-submit {
.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;
}
\ No newline at end of file
sourcecode/alipay/default/pages/goods-search/goods-search.axml
浏览文件 @
ebc295cc
...
...
@@ -38,21 +38,97 @@
</scroll-view>
<!-- 筛选条件 popup -->
<component-popup prop-show="{{is_show_popup_form}}" prop-position="
righ
t" onClose="popup_form_event_close">
<component-popup prop-show="{{is_show_popup_form}}" prop-position="
lef
t" onClose="popup_form_event_close">
<form onSubmit="form_submit_event" class="popup-form oh bg-white">
<view class="
item oh screening-price
">
<view class="
title cr-666">价格区间(元)</view
>
<view class="tc oh"
>
<
input type="digit" placeholder="最低价" name="min_price" class="br fl" /
>
<text
class="cr-888 separator">~
</text>
<
input type="digit" placeholder="最高价" name="max_price" class="br fr" /
>
<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" onTap="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 a:if="{{((brand_list || null) != null && brand_list.length > 0) || ((search_map_info.brand || null) != null)}}" class="map-item">
<view class="map-nav tc">
<text>品牌</text>
<text class="arrow-bottom" a:if="{{brand_list.length > 3}}" onTap="more_event" data-value="brand_list">更多</text>
</view>
<view a:if="{{(search_map_info.brand || null) != null}}" class="map-content brand-info oh bg-white">
<image a:if="{{(search_map_info.brand.logo || null) != null}}" src="{{search_map_info.brand.logo}}" mode="aspectFit" class="fl" />
<view a:else class="info-logo-empty tc fl">{{search_map_info.brand.name}}</view>
<view class="info-right fr">
<view a:if="{{(search_map_info.brand.logo || null) != null}}" class="info-name">{{search_map_info.brand.name}}</view>
<view a:if="{{(search_map_info.brand.describe || null) != null}}"class="info-desc multi-text">{{search_map_info.brand.describe}}</view>
</view>
</view>
<view a:else class="map-content map-images-text-items map-brand-container oh bg-white" style="height:{{map_fields_list.brand_list.height}};">
<block a:for="{{brand_list}}" a:key="key">
<view class="fl tc single-text {{item.active == 1 ? 'active' : ''}}" onTap="map_item_event" data-index="{{index}}" data-field="brand_list">
<image a:if="{{(item.logo || null) != null}}" src="{{item.logo}}" mode="aspectFit" />
<text a:else>{{item.name}}</text>
</view>
</block>
</view>
</view>
<!-- 分类 -->
<view a:if="{{(category_list || null) != null && category_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>分类</text>
<text class="arrow-bottom" a:if="{{category_list.length > 3}}" onTap="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 a:for="{{category_list}}" a:key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" onTap="map_item_event" data-index="{{index}}" data-field="category_list">{{item.name}}</view>
</block>
</view>
</view>
<!-- 价格 -->
<view a:if="{{(screening_price_list || null) != null && screening_price_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>价格</text>
<text class="arrow-bottom" a:if="{{screening_price_list.length > 3}}" onTap="more_event" data-value="screening_price_list">更多</text>
</view>
<view class="map-content map-text-items screening-price-container oh bg-white" style="height:{{map_fields_list.screening_price_list.height}};">
<block a:for="{{screening_price_list}}" a:key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" onTap="map_item_event" data-index="{{index}}" data-field="screening_price_list">{{item.name}}</view>
</block>
</view>
</view>
<!-- 属性 -->
<view a:if="{{(goods_params_list || null) != null && goods_params_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>属性</text>
<text class="arrow-bottom" a:if="{{goods_params_list.length > 3}}" onTap="more_event" data-value="goods_params_list">更多</text>
</view>
<view class="map-content map-text-items goods-params-container oh bg-white" style="height:{{map_fields_list.goods_params_list.height}};">
<block a:for="{{goods_params_list}}" a:key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" onTap="map_item_event" data-index="{{index}}" data-field="goods_params_list">{{item.value}}</view>
</block>
</view>
</view>
<!-- 规格 -->
<view a:if="{{(goods_spec_list || null) != null && goods_spec_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>规格</text>
<text class="arrow-bottom" a:if="{{goods_spec_list.length > 3}}" onTap="more_event" data-value="goods_spec_list">更多</text>
</view>
<view class="map-content map-text-items goods-spec-container oh bg-white" style="height:{{map_fields_list.goods_spec_list.height}};">
<block a:for="{{goods_spec_list}}" a:key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" onTap="map_item_event" data-index="{{index}}" data-field="goods_spec_list">{{item.value}}</view>
</block>
</view>
</view>
<button formType="submit" class="bg-main search-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
</view>
<view class="item keywords">
<view class="title cr-666">关键字</view>
<input type="text" placeholder="关键字" name="wd" value="{{(params.keywords || '')}}" class="br" />
</view>
<button formType="submit" class="bg-main form-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
</form>
</component-popup>
...
...
sourcecode/alipay/default/pages/goods-search/goods-search.js
浏览文件 @
ebc295cc
...
...
@@ -4,6 +4,7 @@ Page({
data_list_loding_status
:
1
,
data_bottom_line_status
:
false
,
data_list
:
[],
data_total
:
0
,
data_page_total
:
0
,
data_page
:
1
,
params
:
null
,
...
...
@@ -20,6 +21,21 @@ Page({
// 基础配置
currency_symbol
:
app
.
data
.
currency_symbol
,
// 搜素条件
search_map_info
:
[],
brand_list
:
[],
category_list
:
[],
screening_price_list
:
[],
goods_params_list
:
[],
goods_spec_list
:
[],
map_fields_list
:
{
"
brand_list
"
:
{
"
height
"
:
"
100rpx
"
,
"
default
"
:
"
100rpx
"
,
"
form_key
"
:
"
brand_ids
"
},
"
category_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
category_ids
"
},
"
screening_price_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
screening_price_values
"
},
"
goods_params_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_params_values
"
},
"
goods_spec_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_spec_values
"
}
},
},
onLoad
(
params
)
{
...
...
@@ -82,16 +98,9 @@ Page({
// 加载loding
my
.
showLoading
({
content
:
"
加载中...
"
});
this
.
setData
({
data_list_loding_status
:
1
});
// 参数
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_id
'
]
||
0
;
var
post_data
=
this
.
request_map_handle
();
// 获取数据
my
.
request
({
...
...
@@ -104,20 +113,36 @@ Page({
my
.
hideLoading
();
my
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
data
.
data
.
length
>
0
)
{
var
data
=
res
.
data
.
data
;
// 仅首次请求赋值条件数据
if
(
this
.
data
.
data_list_loding_status
==
1
)
{
this
.
setData
({
search_map_info
:
data
.
search_map_info
||
[],
brand_list
:
data
.
brand_list
||
[],
category_list
:
data
.
category_list
||
[],
screening_price_list
:
data
.
screening_price_list
||
[],
goods_params_list
:
data
.
goods_params_list
||
[],
goods_spec_list
:
data
.
goods_spec_list
||
[],
});
}
// 列表数据处理
if
(
data
.
data
.
length
>
0
)
{
if
(
this
.
data
.
data_page
<=
1
)
{
var
temp_data_list
=
res
.
data
.
data
.
data
;
var
temp_data_list
=
data
.
data
;
}
else
{
var
temp_data_list
=
this
.
data
.
data_list
;
var
temp_data
=
res
.
data
.
data
.
data
;
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
:
res
.
data
.
data
.
total
,
data_page_total
:
res
.
data
.
data
.
page_total
,
data_total
:
data
.
total
,
data_page_total
:
data
.
page_total
,
data_list_loding_status
:
3
,
data_page
:
this
.
data
.
data_page
+
1
});
...
...
@@ -159,6 +184,55 @@ Page({
});
},
// 搜索条件处理
request_map_handle
()
{
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
// 指定分类、品牌
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_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
)
{
switch
(
i
)
{
// 价格
case
'
screening_price_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
min_price
'
]
+
'
-
'
+
data
[
i
][
k
][
'
max_price
'
];
break
;
// 属性、规格
case
'
goods_params_list
'
:
case
'
goods_spec_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
value
'
];
break
;
// 默认取值id
default
:
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
({
...
...
@@ -189,7 +263,7 @@ Page({
this
.
setData
({
is_show_popup_form
:
true
});
},
//
筛选
//
排序事件
nav_sort_event
(
e
)
{
var
index
=
e
.
target
.
dataset
.
index
||
0
;
var
temp_post_data
=
this
.
data
.
post_data
;
...
...
@@ -220,15 +294,66 @@ Page({
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
category_id
=
this
.
data
.
params
[
'
category_id
'
]
||
0
;
var
brand_id
=
this
.
data
.
params
[
'
brand_id
'
]
||
0
;
var
keywords
=
this
.
data
.
params
[
'
keywords
'
]
||
''
;
return
{
title
:
app
.
data
.
application_title
,
desc
:
app
.
data
.
application_describe
,
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&keywords=
'
+
keywords
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&
brand_id=
'
+
brand_id
+
'
&
keywords=
'
+
keywords
};
},
});
sourcecode/alipay/default/pages/index/index.acss
浏览文件 @
ebc295cc
...
...
@@ -157,7 +157,7 @@
}
.limitedtimediscount .goods-list .item {
width: 460rpx;
height: 6
05
rpx;
height: 6
70
rpx;
border: 1px solid #f5f5f5;
background: white;
display: inline-block;
...
...
sourcecode/alipay/default/pages/plugins/brand/index/index.acss
0 → 100644
浏览文件 @
ebc295cc
/**
* 分类导航
*/
.nav-list {
width: 100%;
height: 80rpx;
white-space: nowrap;
box-sizing: border-box;
}
.nav-list .item {
padding: 20rpx 30rpx;
border-bottom: 3px solid #f0f0f0;
display: inline-block;
position: relative;
}
.nav-list .active {
border-bottom: 3px solid #d2364c;
color: #d2364c;
}
/**
* 数据列表
*/
.data-list .items {
width: calc(50% - 5rpx);
margin-bottom: 10rpx;
}
.data-list .items:nth-child(2n) {
float: right;
}
.data-list .items:nth-child(2n+1) {
float: left;
}
.data-list .items image {
width: 100%;
height: 160rpx !important;
}
.data-list .items .base {
padding-top: 20rpx;
margin: 20rpx;
}
.data-list .items .desc {
color: #999;
margin-top: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
min-height: 80rpx;
}
\ No newline at end of file
sourcecode/alipay/default/pages/plugins/brand/index/index.axml
0 → 100644
浏览文件 @
ebc295cc
<view a:if="{{(data_base || null) != null}}">
<!-- 分类 -->
<scroll-view a:if="{{(brand_category_list || null) != null && brand_category_list.length > 0}}" class="nav-list bg-white tc oh" scroll-x="true">
<view class="item cr-888 {{nav_active_value == 0 ? 'active' : ''}}" onTap="nav_event" data-value="0">全部</view>
<block a:for="{{brand_category_list}}" a:key="key">
<view class="item cr-888 {{nav_active_value == item.id ? 'active' : ''}}" onTap="nav_event" data-value="{{item.id}}">{{item.name}}</view>
</block>
</scroll-view>
<!-- 品牌列表 -->
<view a:if="{{(brand_list || null) != null && brand_list.length > 0}}" class="data-list oh spacing-mt">
<block a:for="{{brand_list}}" a:key="key">
<view a:if="{{(item.is_not_show || 0) == 0}}" class="items bg-white">
<navigator url="/pages/goods-search/goods-search?brand_id={{item.id}}" hover-class="none">
<image src="{{item.logo}}" mode="aspectFit" />
<view class="base br-t-dashed">
<view class="single-text name tc">{{item.name}}</view>
<view class="multi-text desc">{{item.describe}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- 结尾 -->
<import src="/pages/common/bottom_line.axml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</view>
<view a:if="{{data_list_loding_status != 3}}">
<import src="/pages/common/nodata.axml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
\ No newline at end of file
sourcecode/alipay/default/pages/plugins/brand/index/index.js
0 → 100644
浏览文件 @
ebc295cc
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
params
:
null
,
data_base
:
null
,
brand_list
:
[],
brand_category_list
:
[],
nav_active_value
:
0
,
},
onLoad
(
params
)
{
this
.
setData
({
params
:
params
,
});
},
onShow
()
{
this
.
get_data
();
// 显示分享菜单
app
.
show_share_menu
();
},
// 获取数据
get_data
()
{
var
self
=
this
;
my
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
brand
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
my
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
self
.
setData
({
data_base
:
data
.
base
||
null
,
brand_list
:
data
.
brand_list
||
[],
brand_category_list
:
data
.
brand_category_list
||
[],
data_list_loding_msg
:
''
,
data_list_loding_status
:
((
data
.
brand_list
||
[]).
length
>
0
)
?
3
:
0
,
data_bottom_line_status
:
((
data
.
brand_list
||
[]).
length
>
0
),
});
// 选中处理
self
.
nav_active_handle
();
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
}
},
fail
:
()
=>
{
my
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
,
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data
();
},
// 导航事件
nav_event
(
e
)
{
this
.
setData
({
nav_active_value
:
e
.
currentTarget
.
dataset
.
value
||
0
,
});
this
.
nav_active_handle
();
},
// 导航选中处理
nav_active_handle
()
{
var
value
=
this
.
data
.
nav_active_value
;
var
temp_brand_list
=
this
.
data
.
brand_list
;
var
count
=
0
;
for
(
var
i
in
temp_brand_list
)
{
if
(
value
==
0
)
{
temp_brand_list
[
i
][
'
is_not_show
'
]
=
0
;
count
++
;
}
else
{
var
is_not_show
=
(
temp_brand_list
[
i
][
'
brand_category_ids
'
].
indexOf
(
value
)
==
-
1
)
?
1
:
0
;
temp_brand_list
[
i
][
'
is_not_show
'
]
=
is_not_show
;
if
(
is_not_show
==
0
)
{
count
++
;
}
}
}
this
.
setData
({
brand_list
:
temp_brand_list
,
data_list_loding_status
:
(
count
>
0
)
?
3
:
0
,
data_bottom_line_status
:
(
count
>
0
),
});
},
// 自定义分享
onShareAppMessage
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
desc
:
this
.
data
.
data_base
.
seo_desc
||
app
.
data
.
application_describe
,
path
:
'
/pages/plugins/brand/index/index?referrer=
'
+
user_id
};
},
// 分享朋友圈
onShareTimeline
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
query
:
'
referrer=
'
+
user_id
,
imageUrl
:
this
.
data
.
data_base
.
right_images
||
''
};
},
});
\ No newline at end of file
sourcecode/alipay/default/pages/plugins/brand/index/index.json
0 → 100644
浏览文件 @
ebc295cc
{
"pullRefresh"
:
true
,
"defaultTitle"
:
"品牌"
}
\ No newline at end of file
sourcecode/baidu/default/app.css
浏览文件 @
ebc295cc
...
...
@@ -145,6 +145,7 @@ textarea {
min-height
:
104
rpx
;
line-height
:
52
rpx
;
font-size
:
32
rpx
;
white-space
:
initial
;
}
...
...
sourcecode/baidu/default/app.json
浏览文件 @
ebc295cc
...
...
@@ -54,7 +54,8 @@
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail"
,
"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/points/index/index"
,
"pages/plugins/brand/index/index"
],
"window"
:
{
"navigationBarTitleText"
:
"{{application_title}}"
,
...
...
sourcecode/baidu/default/pages/goods-search/goods-search.css
浏览文件 @
ebc295cc
...
...
@@ -61,40 +61,102 @@
/**
* 条件
*/
.popup-form
{
height
:
100vh
;
}
.popup-form
input
{
.search-map
{
height
:
calc
(
100vh
-
80
rpx
);
width
:
680
rpx
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
}
.map-keywords
{
border-radius
:
0
!important
;
padding
:
0
10
rpx
;
line-height
:
66
rpx
;
height
:
66
rpx
;
font-size
:
26
rpx
;
height
:
60
rpx
;
line-height
:
60
rpx
;
background
:
#fbfbfb
;
border-radius
:
6
rpx
;
padding
:
0
6
rpx
;
box-sizing
:
border-box
;
}
.
screening-price
input
{
width
:
calc
(
50%
-
20px
)
;
.
map-nav
{
position
:
relative
;
}
.screening-price
.separator
{
line-height
:
50
rpx
;
.map-nav
.arrow-bottom
{
position
:
absolute
;
top
:
0
;
right
:
10
rpx
;
padding-right
:
46
rpx
;
color
:
#999
;
}
.popup-form
.item
{
width
:
480
rpx
;
padding
:
0
20
rpx
;
margin-top
:
20
rpx
;
.map-item
{
background
:
#f0f0f0
;
line-height
:
76
rpx
;
}
.popup-form
.item
:not
(
:last-child
)
{
margin-bottom
:
30
rpx
;
.map-base
,
.map-nav
{
padding
:
0
10
rpx
;
}
.
popup-form
.item
.title
{
margin-bottom
:
10
rpx
;
font-size
:
28
rpx
;
.
map-content
{
padding
:
15
rpx
;
line-height
:
60
rpx
;
}
.popup-form
.form-submit
{
.map-text-items
view
,
.map-images-text-items
view
{
padding
:
0
15
rpx
;
border-radius
:
2px
;
margin
:
15
rpx
;
border
:
1px
solid
transparent
;
}
.map-images-text-items
view
{
vertical-align
:
middle
;
border
:
1px
solid
#eee
;
width
:
150
rpx
;
height
:
72
rpx
;
line-height
:
72
rpx
;
}
.map-images-text-items
view
image
{
width
:
150
rpx
;
height
:
calc
(
100%
-
8
rpx
);
display
:
block
;
margin
:
0
auto
;
margin-top
:
4
rpx
;
}
.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
:
80
rpx
;
line-height
:
80
rpx
;
position
:
absolute
;
left
:
0
;
bottom
:
0
;
border-radius
:
0
;
}
.map-remove-submit
{
color
:
#e23f36
;
}
/**
* 品牌基础信息
*/
.brand-info
{
padding
:
35
rpx
15
rpx
;
}
.brand-info
image
,
.brand-info
.info-logo-empty
{
width
:
300
rpx
;
height
:
130
rpx
;
border
:
1px
solid
#eee
;
}
.brand-info
.info-logo-empty
{
line-height
:
130
rpx
;
}
.brand-info
.info-right
{
width
:
calc
(
100%
-
330
rpx
);
}
.brand-info
.info-desc
{
color
:
#999
;
font-size
:
28
rpx
;
line-height
:
40
rpx
;
min-height
:
80
rpx
;
}
\ No newline at end of file
sourcecode/baidu/default/pages/goods-search/goods-search.js
浏览文件 @
ebc295cc
...
...
@@ -20,6 +20,21 @@ Page({
// 基础配置
currency_symbol
:
app
.
data
.
currency_symbol
,
// 搜素条件
search_map_info
:
[],
brand_list
:
[],
category_list
:
[],
screening_price_list
:
[],
goods_params_list
:
[],
goods_spec_list
:
[],
map_fields_list
:
{
"
brand_list
"
:
{
"
height
"
:
"
100rpx
"
,
"
default
"
:
"
100rpx
"
,
"
form_key
"
:
"
brand_ids
"
},
"
category_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
category_ids
"
},
"
screening_price_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
screening_price_values
"
},
"
goods_params_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_params_values
"
},
"
goods_spec_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_spec_values
"
}
},
},
onLoad
(
params
)
{
...
...
@@ -82,16 +97,9 @@ Page({
// 加载loding
swan
.
showLoading
({
title
:
"
加载中...
"
});
this
.
setData
({
data_list_loding_status
:
1
});
// 参数
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_id
'
]
||
0
;
var
post_data
=
this
.
request_map_handle
();
// 获取数据
swan
.
request
({
...
...
@@ -104,52 +112,63 @@ Page({
swan
.
hideLoading
();
swan
.
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
});
}
var
data
=
res
.
data
.
data
;
// 仅首次请求赋值条件数据
if
(
this
.
data
.
data_list_loding_status
==
1
)
{
this
.
setData
({
search_map_info
:
data
.
search_map_info
||
[],
brand_list
:
data
.
brand_list
||
[],
category_list
:
data
.
category_list
||
[],
screening_price_list
:
data
.
screening_price_list
||
[],
goods_params_list
:
data
.
goods_params_list
||
[],
goods_spec_list
:
data
.
goods_spec_list
||
[],
});
}
// 列表数据处理
if
(
data
.
data
.
length
>
0
)
{
if
(
this
.
data
.
data_page
<=
1
)
{
var
temp_data_list
=
data
.
data
;
}
else
{
this
.
setData
({
data_list_loding_status
:
0
});
if
(
this
.
data
.
data_page
<=
1
)
{
this
.
setData
({
data_list
:
[],
data_bottom_line_status
:
false
});
}
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
(
post_data
[
'
page
'
]
==
1
)
{
this
.
set_page_info
();
// 是否还有数据
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
{
}
else
{
this
.
setData
({
data_list_loding_status
:
0
data_list_loding_status
:
0
,
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
this
.
data
.
data_page
<=
1
)
{
this
.
setData
({
data_list
:
[],
data_bottom_line_status
:
false
,
});
}
}
}
else
{
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
...
...
@@ -164,6 +183,55 @@ Page({
});
},
// 搜索条件处理
request_map_handle
()
{
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
// 指定分类、品牌
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_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
)
{
switch
(
i
)
{
// 价格
case
'
screening_price_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
min_price
'
]
+
'
-
'
+
data
[
i
][
k
][
'
max_price
'
];
break
;
// 属性、规格
case
'
goods_params_list
'
:
case
'
goods_spec_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
value
'
];
break
;
// 默认取值id
default
:
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
({
...
...
@@ -194,7 +262,7 @@ Page({
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
;
...
...
@@ -225,6 +293,56 @@ Page({
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
);
},
// web页面信息设置
set_page_info
()
{
swan
.
setPageInfo
({
...
...
@@ -239,11 +357,12 @@ Page({
onShareAppMessage
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
var
category_id
=
this
.
data
.
params
[
'
category_id
'
]
||
0
;
var
brand_id
=
this
.
data
.
params
[
'
brand_id
'
]
||
0
;
var
keywords
=
this
.
data
.
params
[
'
keywords
'
]
||
''
;
return
{
title
:
app
.
data
.
application_title
,
desc
:
app
.
data
.
application_describe
,
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&keywords=
'
+
keywords
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&
brand_id=
'
+
brand_id
+
'
&
keywords=
'
+
keywords
};
},
...
...
sourcecode/baidu/default/pages/goods-search/goods-search.swan
浏览文件 @
ebc295cc
...
...
@@ -37,21 +37,97 @@
</scroll-view>
<!-- 筛选条件 popup -->
<component-popup status="{{is_show_popup_form}}" position="
righ
t" bindonclose="popup_form_event_close">
<component-popup status="{{is_show_popup_form}}" position="
lef
t" bindonclose="popup_form_event_close">
<form bindsubmit="form_submit_event" class="popup-form oh bg-white">
<view class="
item oh screening-price
">
<view class="
title cr-666">价格区间(元)</view
>
<view class="tc oh"
>
<
input type="digit" placeholder="最低价" name="min_price" class="br fl" /
>
<text
class="cr-888 separator">~
</text>
<
input type="digit" placeholder="最高价" name="max_price" class="br fr" /
>
<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 s-if="((brand_list || null) != null && brand_list.length > 0) || ((search_map_info.brand || null) != null)" class="map-item">
<view class="map-nav tc">
<text>品牌</text>
<text class="arrow-bottom" s-if="brand_list.length > 3" bindtap="more_event" data-value="brand_list">更多</text>
</view>
<view s-if="(search_map_info.brand || null) != null" class="map-content brand-info oh bg-white">
<image s-if="(search_map_info.brand.logo || null) != null" src="{{search_map_info.brand.logo}}" mode="aspectFit" class="fl" />
<view s-else class="info-logo-empty tc fl">{{search_map_info.brand.name}}</view>
<view class="info-right fr">
<view s-if="(search_map_info.brand.logo || null) != null" class="info-name">{{search_map_info.brand.name}}</view>
<view s-if="(search_map_info.brand.describe || null) != null" class="info-desc multi-text">{{search_map_info.brand.describe}}</view>
</view>
</view>
<view s-else class="map-content map-images-text-items map-brand-container oh bg-white" style="height:{{map_fields_list.brand_list.height}};">
<block s-for="item, index in brand_list" s-key="key">
<view class="fl tc single-text {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="brand_list">
<image s-if="(item.logo || null) != null" src="{{item.logo}}" mode="aspectFit" />
<text s-else>{{item.name}}</text>
</view>
</block>
</view>
</view>
<!-- 分类 -->
<view s-if="(category_list || null) != null && category_list.length > 0" class="map-item">
<view class="map-nav tc">
<text>分类</text>
<text class="arrow-bottom" s-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 s-for="item, index in category_list" s-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>
<!-- 价格 -->
<view s-if="(screening_price_list || null) != null && screening_price_list.length > 0" class="map-item">
<view class="map-nav tc">
<text>价格</text>
<text class="arrow-bottom" s-if="screening_price_list.length > 3" bindtap="more_event" data-value="screening_price_list">更多</text>
</view>
<view class="map-content map-text-items screening-price-container oh bg-white" style="height:{{map_fields_list.screening_price_list.height}};">
<block s-for="item, index in screening_price_list" s-key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="screening_price_list">{{item.name}}</view>
</block>
</view>
</view>
<!-- 属性 -->
<view s-if="(goods_params_list || null) != null && goods_params_list.length > 0" class="map-item">
<view class="map-nav tc">
<text>属性</text>
<text class="arrow-bottom" s-if="goods_params_list.length > 3" bindtap="more_event" data-value="goods_params_list">更多</text>
</view>
<view class="map-content map-text-items goods-params-container oh bg-white" style="height:{{map_fields_list.goods_params_list.height}};">
<block s-for="item, index in goods_params_list" s-key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="goods_params_list">{{item.value}}</view>
</block>
</view>
</view>
<!-- 规格 -->
<view s-if="(goods_spec_list || null) != null && goods_spec_list.length > 0" class="map-item">
<view class="map-nav tc">
<text>规格</text>
<text class="arrow-bottom" s-if="goods_spec_list.length > 3" bindtap="more_event" data-value="goods_spec_list">更多</text>
</view>
<view class="map-content map-text-items goods-spec-container oh bg-white" style="height:{{map_fields_list.goods_spec_list.height}};">
<block s-for="item, index in goods_spec_list" s-key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="goods_spec_list">{{item.value}}</view>
</block>
</view>
</view>
<button formType="submit" class="bg-main search-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
</view>
<view class="item keywords">
<view class="title cr-666">关键字</view>
<input type="text" placeholder="关键字" name="wd" value="{=(params.keywords || '')=}" class="br" />
</view>
<button formType="submit" class="bg-main form-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
</form>
</component-popup>
...
...
sourcecode/baidu/default/pages/index/index.css
浏览文件 @
ebc295cc
...
...
@@ -4,7 +4,7 @@
.search
{
left
:
0
;
top
:
20
rpx
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
20
rpx
;
background
:
#d2364c
;
}
...
...
@@ -157,7 +157,7 @@
}
.limitedtimediscount
.goods-list
.item
{
width
:
460
rpx
;
height
:
6
1
0
rpx
;
height
:
6
7
0
rpx
;
border
:
1px
solid
#f5f5f5
;
background
:
white
;
display
:
inline-block
;
...
...
sourcecode/baidu/default/pages/plugins/brand/index/index.css
0 → 100644
浏览文件 @
ebc295cc
/**
* 分类导航
*/
.nav-list
{
width
:
100%
;
height
:
80
rpx
;
white-space
:
nowrap
;
box-sizing
:
border-box
;
}
.nav-list
.item
{
padding
:
20
rpx
30
rpx
;
border-bottom
:
3px
solid
#f0f0f0
;
display
:
inline-block
;
position
:
relative
;
}
.nav-list
.active
{
border-bottom
:
3px
solid
#d2364c
;
color
:
#d2364c
;
}
/**
* 数据列表
*/
.data-list
.items
{
width
:
calc
(
50%
-
5
rpx
);
margin-bottom
:
10
rpx
;
}
.data-list
.items
:nth-child
(
2
n
)
{
float
:
right
;
}
.data-list
.items
:nth-child
(
2
n
+
1
)
{
float
:
left
;
}
.data-list
.items
image
{
width
:
100%
;
height
:
160
rpx
!important
;
}
.data-list
.items
.base
{
padding-top
:
20
rpx
;
margin
:
20
rpx
;
}
.data-list
.items
.desc
{
color
:
#999
;
margin-top
:
10
rpx
;
font-size
:
28
rpx
;
line-height
:
40
rpx
;
min-height
:
80
rpx
;
}
\ No newline at end of file
sourcecode/baidu/default/pages/plugins/brand/index/index.js
0 → 100644
浏览文件 @
ebc295cc
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
params
:
null
,
data_base
:
null
,
brand_list
:
[],
brand_category_list
:
[],
nav_active_value
:
0
},
onReady
()
{},
onLoad
(
params
)
{
this
.
setData
({
params
:
params
});
},
onShow
()
{
this
.
get_data
();
// 显示分享菜单
app
.
show_share_menu
();
},
// 获取数据
get_data
()
{
var
self
=
this
;
swan
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
brand
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
swan
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
self
.
setData
({
data_base
:
data
.
base
||
null
,
brand_list
:
data
.
brand_list
||
[],
brand_category_list
:
data
.
brand_category_list
||
[],
data_list_loding_msg
:
''
,
data_list_loding_status
:
(
data
.
brand_list
||
[]).
length
>
0
?
3
:
0
,
data_bottom_line_status
:
(
data
.
brand_list
||
[]).
length
>
0
});
// 选中处理
self
.
nav_active_handle
();
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
});
}
},
fail
:
()
=>
{
swan
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data
();
},
// 导航事件
nav_event
(
e
)
{
this
.
setData
({
nav_active_value
:
e
.
currentTarget
.
dataset
.
value
||
0
});
this
.
nav_active_handle
();
},
// 导航选中处理
nav_active_handle
()
{
var
value
=
this
.
data
.
nav_active_value
;
var
temp_brand_list
=
this
.
data
.
brand_list
;
var
count
=
0
;
for
(
var
i
in
temp_brand_list
)
{
if
(
value
==
0
)
{
temp_brand_list
[
i
][
'
is_not_show
'
]
=
0
;
count
++
;
}
else
{
var
is_not_show
=
temp_brand_list
[
i
][
'
brand_category_ids
'
].
indexOf
(
value
)
==
-
1
?
1
:
0
;
temp_brand_list
[
i
][
'
is_not_show
'
]
=
is_not_show
;
if
(
is_not_show
==
0
)
{
count
++
;
}
}
}
this
.
setData
({
brand_list
:
temp_brand_list
,
data_list_loding_status
:
count
>
0
?
3
:
0
,
data_bottom_line_status
:
count
>
0
});
},
// 自定义分享
onShareAppMessage
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
desc
:
this
.
data
.
data_base
.
seo_desc
||
app
.
data
.
application_describe
,
path
:
'
/pages/plugins/brand/index/index?referrer=
'
+
user_id
};
},
// 分享朋友圈
onShareTimeline
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
query
:
'
referrer=
'
+
user_id
,
imageUrl
:
this
.
data
.
data_base
.
right_images
||
''
};
}
});
\ No newline at end of file
sourcecode/baidu/default/pages/plugins/brand/index/index.json
0 → 100644
浏览文件 @
ebc295cc
{
"enablePullDownRefresh"
:
true
,
"navigationBarTitleText"
:
"品牌"
}
\ No newline at end of file
sourcecode/baidu/default/pages/plugins/brand/index/index.swan
0 → 100644
浏览文件 @
ebc295cc
<view s-if="(data_base || null) != null">
<!-- 分类 -->
<scroll-view s-if="(brand_category_list || null) != null && brand_category_list.length > 0" class="nav-list bg-white tc oh" scroll-x="true">
<view class="item cr-888 {{nav_active_value == 0 ? 'active' : ''}}" bindtap="nav_event" data-value="0">全部</view>
<block s-for="item, index in brand_category_list" s-key="key">
<view class="item cr-888 {{nav_active_value == item.id ? 'active' : ''}}" bindtap="nav_event" data-value="{{item.id}}">{{item.name}}</view>
</block>
</scroll-view>
<!-- 品牌列表 -->
<view s-if="(brand_list || null) != null && brand_list.length > 0" class="data-list oh spacing-mt">
<block s-for="item, index in brand_list" s-key="key">
<view s-if="(item.is_not_show || 0) == 0" class="items bg-white">
<navigator url="/pages/goods-search/goods-search?brand_id={{item.id}}" hover-class="none">
<image src="{{item.logo}}" mode="aspectFit" />
<view class="base br-t-dashed">
<view class="single-text name tc">{{item.name}}</view>
<view class="multi-text desc">{{item.describe}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- 结尾 -->
<import src="/pages/common/bottom_line.swan" />
<template is="bottom_line" data="{{{status: data_bottom_line_status}}}"></template>
</view>
<view s-if="data_list_loding_status != 3">
<import src="/pages/common/nodata.swan" />
<template is="nodata" data="{{{status: data_list_loding_status, msg: data_list_loding_msg}}}"></template>
</view>
\ No newline at end of file
sourcecode/qq/default/app.json
浏览文件 @
ebc295cc
...
...
@@ -54,7 +54,8 @@
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail"
,
"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/points/index/index"
,
"pages/plugins/brand/index/index"
],
"window"
:
{
"navigationBarTitleText"
:
"{{application_title}}"
,
...
...
sourcecode/qq/default/app.qss
浏览文件 @
ebc295cc
...
...
@@ -145,6 +145,7 @@ textarea {
min-height: 104rpx;
line-height: 52rpx;
font-size: 32rpx;
white-space: initial;
}
...
...
sourcecode/qq/default/pages/goods-search/goods-search.js
浏览文件 @
ebc295cc
...
...
@@ -4,6 +4,7 @@ Page({
data_list_loding_status
:
1
,
data_bottom_line_status
:
false
,
data_list
:
[],
data_total
:
0
,
data_page_total
:
0
,
data_page
:
1
,
params
:
null
,
...
...
@@ -20,6 +21,21 @@ Page({
// 基础配置
currency_symbol
:
app
.
data
.
currency_symbol
,
// 搜素条件
search_map_info
:
[],
brand_list
:
[],
category_list
:
[],
screening_price_list
:
[],
goods_params_list
:
[],
goods_spec_list
:
[],
map_fields_list
:
{
"
brand_list
"
:
{
"
height
"
:
"
100rpx
"
,
"
default
"
:
"
100rpx
"
,
"
form_key
"
:
"
brand_ids
"
},
"
category_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
category_ids
"
},
"
screening_price_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
screening_price_values
"
},
"
goods_params_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_params_values
"
},
"
goods_spec_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_spec_values
"
}
},
},
onLoad
(
params
)
{
...
...
@@ -82,16 +98,9 @@ Page({
// 加载loding
qq
.
showLoading
({
title
:
"
加载中...
"
});
this
.
setData
({
data_list_loding_status
:
1
});
// 参数
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_id
'
]
||
0
;
var
post_data
=
this
.
request_map_handle
();
// 获取数据
qq
.
request
({
...
...
@@ -104,20 +113,36 @@ Page({
qq
.
hideLoading
();
qq
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
data
.
data
.
length
>
0
)
{
var
data
=
res
.
data
.
data
;
// 仅首次请求赋值条件数据
if
(
this
.
data
.
data_list_loding_status
==
1
)
{
this
.
setData
({
search_map_info
:
data
.
search_map_info
||
[],
brand_list
:
data
.
brand_list
||
[],
category_list
:
data
.
category_list
||
[],
screening_price_list
:
data
.
screening_price_list
||
[],
goods_params_list
:
data
.
goods_params_list
||
[],
goods_spec_list
:
data
.
goods_spec_list
||
[],
});
}
// 列表数据处理
if
(
data
.
data
.
length
>
0
)
{
if
(
this
.
data
.
data_page
<=
1
)
{
var
temp_data_list
=
res
.
data
.
data
.
data
;
var
temp_data_list
=
data
.
data
;
}
else
{
var
temp_data_list
=
this
.
data
.
data_list
;
var
temp_data
=
res
.
data
.
data
.
data
;
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
:
res
.
data
.
data
.
total
,
data_page_total
:
res
.
data
.
data
.
page_total
,
data_total
:
data
.
total
,
data_page_total
:
data
.
page_total
,
data_list_loding_status
:
3
,
data_page
:
this
.
data
.
data_page
+
1
});
...
...
@@ -144,7 +169,6 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
...
...
@@ -160,6 +184,55 @@ Page({
});
},
// 搜索条件处理
request_map_handle
()
{
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
// 指定分类、品牌
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_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
)
{
switch
(
i
)
{
// 价格
case
'
screening_price_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
min_price
'
]
+
'
-
'
+
data
[
i
][
k
][
'
max_price
'
];
break
;
// 属性、规格
case
'
goods_params_list
'
:
case
'
goods_spec_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
value
'
];
break
;
// 默认取值id
default
:
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
({
...
...
@@ -190,7 +263,7 @@ Page({
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
;
...
...
@@ -221,15 +294,66 @@ Page({
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
category_id
=
this
.
data
.
params
[
'
category_id
'
]
||
0
;
var
brand_id
=
this
.
data
.
params
[
'
brand_id
'
]
||
0
;
var
keywords
=
this
.
data
.
params
[
'
keywords
'
]
||
''
;
return
{
title
:
app
.
data
.
application_title
,
desc
:
app
.
data
.
application_describe
,
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&keywords=
'
+
keywords
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&
brand_id=
'
+
brand_id
+
'
&
keywords=
'
+
keywords
};
},
});
sourcecode/qq/default/pages/goods-search/goods-search.qml
浏览文件 @
ebc295cc
...
...
@@ -37,21 +37,97 @@
<
/scroll-view
>
<!--
筛选条件
popup
-->
<
component
-
popup
prop
-
show
=
"
{{is_show_popup_form}}
"
prop
-
position
=
"
righ
t
"
bindonclose
=
"
popup_form_event_close
"
>
<
component
-
popup
prop
-
show
=
"
{{is_show_popup_form}}
"
prop
-
position
=
"
lef
t
"
bindonclose
=
"
popup_form_event_close
"
>
<
form
bindsubmit
=
"
form_submit_event
"
class
=
"
popup-form oh bg-white
"
>
<
view
class
=
"
item oh screening-price
"
>
<
view
class
=
"
title cr-666
"
>
价格区间
(
元
)
<
/view
>
<
view
class
=
"
tc oh
"
>
<
input
type
=
"
digit
"
placeholder
=
"
最低价
"
name
=
"
min_price
"
class
=
"
br fl
"
/
>
<
text
class
=
"
cr-888 separator
"
>~
<
/text
>
<
input
type
=
"
digit
"
placeholder
=
"
最高价
"
name
=
"
max_price
"
class
=
"
br fr
"
/
>
<
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
qq
:
if
=
"
{{((brand_list || null) != null && brand_list.length > 0) || ((search_map_info.brand || null) != null)}}
"
class
=
"
map-item
"
>
<
view
class
=
"
map-nav tc
"
>
<
text
>
品牌
<
/text
>
<
text
class
=
"
arrow-bottom
"
qq
:
if
=
"
{{brand_list.length > 3}}
"
bindtap
=
"
more_event
"
data
-
value
=
"
brand_list
"
>
更多
<
/text
>
<
/view
>
<
view
qq
:
if
=
"
{{(search_map_info.brand || null) != null}}
"
class
=
"
map-content brand-info oh bg-white
"
>
<
image
qq
:
if
=
"
{{(search_map_info.brand.logo || null) != null}}
"
src
=
"
{{search_map_info.brand.logo}}
"
mode
=
"
aspectFit
"
class
=
"
fl
"
/>
<
view
qq
:
else
class
=
"
info-logo-empty tc fl
"
>
{{
search_map_info
.
brand
.
name
}}
<
/view
>
<
view
class
=
"
info-right fr
"
>
<
view
qq
:
if
=
"
{{(search_map_info.brand.logo || null) != null}}
"
class
=
"
info-name
"
>
{{
search_map_info
.
brand
.
name
}}
<
/view
>
<
view
qq
:
if
=
"
{{(search_map_info.brand.describe || null) != null}}
"
class
=
"
info-desc multi-text
"
>
{{
search_map_info
.
brand
.
describe
}}
<
/view
>
<
/view
>
<
/view
>
<
view
qq
:
else
class
=
"
map-content map-images-text-items map-brand-container oh bg-white
"
style
=
"
height:{{map_fields_list.brand_list.height}};
"
>
<
block
qq
:
for
=
"
{{brand_list}}
"
qq
:
key
=
"
key
"
>
<
view
class
=
"
fl tc single-text {{item.active == 1 ? 'active' : ''}}
"
bindtap
=
"
map_item_event
"
data
-
index
=
"
{{index}}
"
data
-
field
=
"
brand_list
"
>
<
image
qq
:
if
=
"
{{(item.logo || null) != null}}
"
src
=
"
{{item.logo}}
"
mode
=
"
aspectFit
"
/>
<
text
qq
:
else
>
{{
item
.
name
}}
<
/text
>
<
/view
>
<
/block
>
<
/view
>
<
/view
>
<!--
分类
-->
<
view
qq
:
if
=
"
{{(category_list || null) != null && category_list.length > 0}}
"
class
=
"
map-item
"
>
<
view
class
=
"
map-nav tc
"
>
<
text
>
分类
<
/text
>
<
text
class
=
"
arrow-bottom
"
qq
:
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
qq
:
for
=
"
{{category_list}}
"
qq
:
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
>
<!--
价格
-->
<
view
qq
:
if
=
"
{{(screening_price_list || null) != null && screening_price_list.length > 0}}
"
class
=
"
map-item
"
>
<
view
class
=
"
map-nav tc
"
>
<
text
>
价格
<
/text
>
<
text
class
=
"
arrow-bottom
"
qq
:
if
=
"
{{screening_price_list.length > 3}}
"
bindtap
=
"
more_event
"
data
-
value
=
"
screening_price_list
"
>
更多
<
/text
>
<
/view
>
<
view
class
=
"
map-content map-text-items screening-price-container oh bg-white
"
style
=
"
height:{{map_fields_list.screening_price_list.height}};
"
>
<
block
qq
:
for
=
"
{{screening_price_list}}
"
qq
:
key
=
"
key
"
>
<
view
class
=
"
fl {{item.active == 1 ? 'active' : ''}}
"
bindtap
=
"
map_item_event
"
data
-
index
=
"
{{index}}
"
data
-
field
=
"
screening_price_list
"
>
{{
item
.
name
}}
<
/view
>
<
/block
>
<
/view
>
<
/view
>
<!--
属性
-->
<
view
qq
:
if
=
"
{{(goods_params_list || null) != null && goods_params_list.length > 0}}
"
class
=
"
map-item
"
>
<
view
class
=
"
map-nav tc
"
>
<
text
>
属性
<
/text
>
<
text
class
=
"
arrow-bottom
"
qq
:
if
=
"
{{goods_params_list.length > 3}}
"
bindtap
=
"
more_event
"
data
-
value
=
"
goods_params_list
"
>
更多
<
/text
>
<
/view
>
<
view
class
=
"
map-content map-text-items goods-params-container oh bg-white
"
style
=
"
height:{{map_fields_list.goods_params_list.height}};
"
>
<
block
qq
:
for
=
"
{{goods_params_list}}
"
qq
:
key
=
"
key
"
>
<
view
class
=
"
fl {{item.active == 1 ? 'active' : ''}}
"
bindtap
=
"
map_item_event
"
data
-
index
=
"
{{index}}
"
data
-
field
=
"
goods_params_list
"
>
{{
item
.
value
}}
<
/view
>
<
/block
>
<
/view
>
<
/view
>
<!--
规格
-->
<
view
qq
:
if
=
"
{{(goods_spec_list || null) != null && goods_spec_list.length > 0}}
"
class
=
"
map-item
"
>
<
view
class
=
"
map-nav tc
"
>
<
text
>
规格
<
/text
>
<
text
class
=
"
arrow-bottom
"
qq
:
if
=
"
{{goods_spec_list.length > 3}}
"
bindtap
=
"
more_event
"
data
-
value
=
"
goods_spec_list
"
>
更多
<
/text
>
<
/view
>
<
view
class
=
"
map-content map-text-items goods-spec-container oh bg-white
"
style
=
"
height:{{map_fields_list.goods_spec_list.height}};
"
>
<
block
qq
:
for
=
"
{{goods_spec_list}}
"
qq
:
key
=
"
key
"
>
<
view
class
=
"
fl {{item.active == 1 ? 'active' : ''}}
"
bindtap
=
"
map_item_event
"
data
-
index
=
"
{{index}}
"
data
-
field
=
"
goods_spec_list
"
>
{{
item
.
value
}}
<
/view
>
<
/block
>
<
/view
>
<
/view
>
<
button
formType
=
"
submit
"
class
=
"
bg-main search-submit wh-auto
"
disabled
=
"
{{popup_form_loading_status}}
"
hover
-
class
=
"
none
"
>
确认
<
/button
>
<
/view
>
<
view
class
=
"
item keywords
"
>
<
view
class
=
"
title cr-666
"
>
关键字
<
/view
>
<
input
type
=
"
text
"
placeholder
=
"
关键字
"
name
=
"
wd
"
value
=
"
{{(params.keywords || '')}}
"
class
=
"
br
"
/>
<
/view
>
<
button
formType
=
"
submit
"
class
=
"
bg-main form-submit wh-auto
"
disabled
=
"
{{popup_form_loading_status}}
"
hover
-
class
=
"
none
"
>
确认
<
/button
>
<
/form
>
<
/component-popup
>
...
...
sourcecode/qq/default/pages/goods-search/goods-search.qss
浏览文件 @
ebc295cc
...
...
@@ -61,40 +61,102 @@
/**
* 条件
*/
.popup-form {
height: 100vh;
}
.popup-form input {
.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;
height: 60rpx;
line-height: 60rpx;
background: #fbfbfb;
border-radius: 6rpx;
padding: 0 6rpx;
box-sizing: border-box;
}
.
screening-price input
{
width: calc(50% - 20px)
;
.
map-nav
{
position: relative
;
}
.screening-price .separator {
line-height: 50rpx;
.map-nav .arrow-bottom {
position: absolute;
top: 0;
right: 10rpx;
padding-right: 46rpx;
color: #999;
}
.popup-form .item {
width: 480rpx;
padding: 0 20rpx;
margin-top: 20rpx;
.map-item {
background: #f0f0f0;
line-height: 76rpx;
}
.popup-form .item:not(:last-child) {
margin-bottom: 30rpx;
.map-base,
.map-nav {
padding: 0 10rpx;
}
.
popup-form .item .title
{
margin-bottom: 10
rpx;
font-size: 28
rpx;
.
map-content
{
padding: 15
rpx;
line-height: 60
rpx;
}
.popup-form .form-submit {
.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;
}
\ No newline at end of file
sourcecode/qq/default/pages/index/index.qss
浏览文件 @
ebc295cc
...
...
@@ -157,7 +157,7 @@
}
.limitedtimediscount .goods-list .item {
width: 460rpx;
height: 6
05
rpx;
height: 6
70
rpx;
border: 1px solid #f5f5f5;
background: white;
display: inline-block;
...
...
sourcecode/qq/default/pages/plugins/brand/index/index.js
0 → 100644
浏览文件 @
ebc295cc
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
params
:
null
,
data_base
:
null
,
brand_list
:
[],
brand_category_list
:
[],
nav_active_value
:
0
,
},
onLoad
(
params
)
{
this
.
setData
({
params
:
params
,
});
},
onShow
()
{
this
.
get_data
();
// 显示分享菜单
app
.
show_share_menu
();
},
// 获取数据
get_data
()
{
var
self
=
this
;
qq
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
brand
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
qq
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
self
.
setData
({
data_base
:
data
.
base
||
null
,
brand_list
:
data
.
brand_list
||
[],
brand_category_list
:
data
.
brand_category_list
||
[],
data_list_loding_msg
:
''
,
data_list_loding_status
:
((
data
.
brand_list
||
[]).
length
>
0
)
?
3
:
0
,
data_bottom_line_status
:
((
data
.
brand_list
||
[]).
length
>
0
),
});
// 选中处理
self
.
nav_active_handle
();
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
}
},
fail
:
()
=>
{
qq
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
,
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data
();
},
// 导航事件
nav_event
(
e
)
{
this
.
setData
({
nav_active_value
:
e
.
currentTarget
.
dataset
.
value
||
0
,
});
this
.
nav_active_handle
();
},
// 导航选中处理
nav_active_handle
()
{
var
value
=
this
.
data
.
nav_active_value
;
var
temp_brand_list
=
this
.
data
.
brand_list
;
var
count
=
0
;
for
(
var
i
in
temp_brand_list
)
{
if
(
value
==
0
)
{
temp_brand_list
[
i
][
'
is_not_show
'
]
=
0
;
count
++
;
}
else
{
var
is_not_show
=
(
temp_brand_list
[
i
][
'
brand_category_ids
'
].
indexOf
(
value
)
==
-
1
)
?
1
:
0
;
temp_brand_list
[
i
][
'
is_not_show
'
]
=
is_not_show
;
if
(
is_not_show
==
0
)
{
count
++
;
}
}
}
this
.
setData
({
brand_list
:
temp_brand_list
,
data_list_loding_status
:
(
count
>
0
)
?
3
:
0
,
data_bottom_line_status
:
(
count
>
0
),
});
},
// 自定义分享
onShareAppMessage
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
desc
:
this
.
data
.
data_base
.
seo_desc
||
app
.
data
.
application_describe
,
path
:
'
/pages/plugins/brand/index/index?referrer=
'
+
user_id
};
},
// 分享朋友圈
onShareTimeline
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
query
:
'
referrer=
'
+
user_id
,
imageUrl
:
this
.
data
.
data_base
.
right_images
||
''
};
},
});
\ No newline at end of file
sourcecode/qq/default/pages/plugins/brand/index/index.json
0 → 100644
浏览文件 @
ebc295cc
{
"enablePullDownRefresh"
:
true
,
"navigationBarTitleText"
:
"品牌"
}
\ No newline at end of file
sourcecode/qq/default/pages/plugins/brand/index/index.qml
0 → 100644
浏览文件 @
ebc295cc
<
view
qq
:
if
=
"
{{(data_base || null) != null}}
"
>
<!--
分类
-->
<
scroll
-
view
qq
:
if
=
"
{{(brand_category_list || null) != null && brand_category_list.length > 0}}
"
class
=
"
nav-list bg-white tc oh
"
scroll
-
x
=
"
true
"
>
<
view
class
=
"
item cr-888 {{nav_active_value == 0 ? 'active' : ''}}
"
bindtap
=
"
nav_event
"
data
-
value
=
"
0
"
>
全部
<
/view
>
<
block
qq
:
for
=
"
{{brand_category_list}}
"
qq
:
key
=
"
key
"
>
<
view
class
=
"
item cr-888 {{nav_active_value == item.id ? 'active' : ''}}
"
bindtap
=
"
nav_event
"
data
-
value
=
"
{{item.id}}
"
>
{{
item
.
name
}}
<
/view
>
<
/block
>
<
/scroll-view
>
<!--
品牌列表
-->
<
view
qq
:
if
=
"
{{(brand_list || null) != null && brand_list.length > 0}}
"
class
=
"
data-list oh spacing-mt
"
>
<
block
qq
:
for
=
"
{{brand_list}}
"
qq
:
key
=
"
key
"
>
<
view
qq
:
if
=
"
{{(item.is_not_show || 0) == 0}}
"
class
=
"
items bg-white
"
>
<
navigator
url
=
"
/pages/goods-search/goods-search?brand_id={{item.id}}
"
hover
-
class
=
"
none
"
>
<
image
src
=
"
{{item.logo}}
"
mode
=
"
aspectFit
"
/>
<
view
class
=
"
base br-t-dashed
"
>
<
view
class
=
"
single-text name tc
"
>
{{
item
.
name
}}
<
/view
>
<
view
class
=
"
multi-text desc
"
>
{{
item
.
describe
}}
<
/view
>
<
/view
>
<
/navigator
>
<
/view
>
<
/block
>
<
/view
>
<!--
结尾
-->
<
import
src
=
"
/pages/common/bottom_line.qml
"
/>
<
template
is
=
"
bottom_line
"
data
=
"
{{status: data_bottom_line_status}}
"
><
/template
>
<
/view
>
<
view
qq
:
if
=
"
{{data_list_loding_status != 3}}
"
>
<
import
src
=
"
/pages/common/nodata.qml
"
/>
<
template
is
=
"
nodata
"
data
=
"
{{status: data_list_loding_status, msg: data_list_loding_msg}}
"
><
/template
>
<
/view>
\ No newline at end of file
sourcecode/qq/default/pages/plugins/brand/index/index.qss
0 → 100644
浏览文件 @
ebc295cc
/**
* 分类导航
*/
.nav-list {
width: 100%;
height: 80rpx;
white-space: nowrap;
box-sizing: border-box;
}
.nav-list .item {
padding: 20rpx 30rpx;
border-bottom: 3px solid #f0f0f0;
display: inline-block;
position: relative;
}
.nav-list .active {
border-bottom: 3px solid #d2364c;
color: #d2364c;
}
/**
* 数据列表
*/
.data-list .items {
width: calc(50% - 5rpx);
margin-bottom: 10rpx;
}
.data-list .items:nth-child(2n) {
float: right;
}
.data-list .items:nth-child(2n+1) {
float: left;
}
.data-list .items image {
width: 100%;
height: 160rpx !important;
}
.data-list .items .base {
padding-top: 20rpx;
margin: 20rpx;
}
.data-list .items .desc {
color: #999;
margin-top: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
min-height: 80rpx;
}
\ No newline at end of file
sourcecode/toutiao/default/app.json
浏览文件 @
ebc295cc
...
...
@@ -73,7 +73,8 @@
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail"
,
"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/points/index/index"
,
"pages/plugins/brand/index/index"
],
"window"
:
{
"navigationBarTitleText"
:
"{{application_title}}"
,
...
...
sourcecode/toutiao/default/app.ttss
浏览文件 @
ebc295cc
...
...
@@ -146,6 +146,7 @@ textarea {
min-height: 104rpx;
line-height: 52rpx;
font-size: 32rpx;
white-space: initial;
}
...
...
sourcecode/toutiao/default/pages/goods-search/goods-search.js
浏览文件 @
ebc295cc
...
...
@@ -20,6 +20,21 @@ Page({
// 基础配置
currency_symbol
:
app
.
data
.
currency_symbol
,
// 搜素条件
search_map_info
:
[],
brand_list
:
[],
category_list
:
[],
screening_price_list
:
[],
goods_params_list
:
[],
goods_spec_list
:
[],
map_fields_list
:
{
"
brand_list
"
:
{
"
height
"
:
"
100rpx
"
,
"
default
"
:
"
100rpx
"
,
"
form_key
"
:
"
brand_ids
"
},
"
category_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
category_ids
"
},
"
screening_price_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
screening_price_values
"
},
"
goods_params_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_params_values
"
},
"
goods_spec_list
"
:
{
"
height
"
:
"
82rpx
"
,
"
default
"
:
"
82rpx
"
,
"
form_key
"
:
"
goods_spec_values
"
}
},
},
onLoad
(
params
)
{
...
...
@@ -82,16 +97,9 @@ Page({
// 加载loding
tt
.
showLoading
({
title
:
"
加载中...
"
});
this
.
setData
({
data_list_loding_status
:
1
});
// 参数
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_id
'
]
||
0
;
var
post_data
=
this
.
request_map_handle
();
// 获取数据
tt
.
request
({
...
...
@@ -104,20 +112,36 @@ Page({
tt
.
hideLoading
();
tt
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
data
.
data
.
length
>
0
)
{
var
data
=
res
.
data
.
data
;
// 仅首次请求赋值条件数据
if
(
this
.
data
.
data_list_loding_status
==
1
)
{
this
.
setData
({
search_map_info
:
data
.
search_map_info
||
[],
brand_list
:
data
.
brand_list
||
[],
category_list
:
data
.
category_list
||
[],
screening_price_list
:
data
.
screening_price_list
||
[],
goods_params_list
:
data
.
goods_params_list
||
[],
goods_spec_list
:
data
.
goods_spec_list
||
[],
});
}
// 列表数据处理
if
(
data
.
data
.
length
>
0
)
{
if
(
this
.
data
.
data_page
<=
1
)
{
var
temp_data_list
=
res
.
data
.
data
.
data
;
var
temp_data_list
=
data
.
data
;
}
else
{
var
temp_data_list
=
this
.
data
.
data_list
;
var
temp_data
=
res
.
data
.
data
.
data
;
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
:
res
.
data
.
data
.
total
,
data_page_total
:
res
.
data
.
data
.
page_total
,
data_total
:
data
.
total
,
data_page_total
:
data
.
page_total
,
data_list_loding_status
:
3
,
data_page
:
this
.
data
.
data_page
+
1
});
...
...
@@ -144,7 +168,6 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
...
...
@@ -160,6 +183,55 @@ Page({
});
},
// 搜索条件处理
request_map_handle
()
{
var
params
=
this
.
data
.
params
;
var
post_data
=
this
.
data
.
post_data
;
post_data
[
'
page
'
]
=
this
.
data
.
data_page
;
// 指定分类、品牌
post_data
[
'
category_id
'
]
=
params
[
'
category_id
'
]
||
0
;
post_data
[
'
brand_id
'
]
=
params
[
'
brand_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
)
{
switch
(
i
)
{
// 价格
case
'
screening_price_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
min_price
'
]
+
'
-
'
+
data
[
i
][
k
][
'
max_price
'
];
break
;
// 属性、规格
case
'
goods_params_list
'
:
case
'
goods_spec_list
'
:
temp
[
index
]
=
data
[
i
][
k
][
'
value
'
];
break
;
// 默认取值id
default
:
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
({
...
...
@@ -190,7 +262,7 @@ Page({
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
;
...
...
@@ -221,15 +293,66 @@ Page({
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
category_id
=
this
.
data
.
params
[
'
category_id
'
]
||
0
;
var
brand_id
=
this
.
data
.
params
[
'
brand_id
'
]
||
0
;
var
keywords
=
this
.
data
.
params
[
'
keywords
'
]
||
''
;
return
{
title
:
app
.
data
.
application_title
,
desc
:
app
.
data
.
application_describe
,
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&keywords=
'
+
keywords
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&
brand_id=
'
+
brand_id
+
'
&
keywords=
'
+
keywords
};
},
});
sourcecode/toutiao/default/pages/goods-search/goods-search.ttml
浏览文件 @
ebc295cc
...
...
@@ -37,21 +37,97 @@
</scroll-view>
<!-- 筛选条件 popup -->
<component-popup prop-show="{{is_show_popup_form}}" prop-position="
righ
t" bindonclose="popup_form_event_close">
<component-popup prop-show="{{is_show_popup_form}}" prop-position="
lef
t" bindonclose="popup_form_event_close">
<form bindsubmit="form_submit_event" class="popup-form oh bg-white">
<view class="
item oh screening-price
">
<view class="
title cr-666">价格区间(元)</view
>
<view class="tc oh"
>
<
input type="digit" placeholder="最低价" name="min_price" class="br fl" /
>
<text
class="cr-888 separator">~
</text>
<
input type="digit" placeholder="最高价" name="max_price" class="br fr" /
>
<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 tt:if="{{((brand_list || null) != null && brand_list.length > 0) || ((search_map_info.brand || null) != null)}}" class="map-item">
<view class="map-nav tc">
<text>品牌</text>
<text class="arrow-bottom" tt:if="{{brand_list.length > 3}}" bindtap="more_event" data-value="brand_list">更多</text>
</view>
<view tt:if="{{(search_map_info.brand || null) != null}}" class="map-content brand-info oh bg-white">
<image tt:if="{{(search_map_info.brand.logo || null) != null}}" src="{{search_map_info.brand.logo}}" mode="aspectFit" class="fl" />
<view tt:else class="info-logo-empty tc fl">{{search_map_info.brand.name}}</view>
<view class="info-right fr">
<view tt:if="{{(search_map_info.brand.logo || null) != null}}" class="info-name">{{search_map_info.brand.name}}</view>
<view tt:if="{{(search_map_info.brand.describe || null) != null}}"class="info-desc multi-text">{{search_map_info.brand.describe}}</view>
</view>
</view>
<view tt:else class="map-content map-images-text-items map-brand-container oh bg-white" style="height:{{map_fields_list.brand_list.height}};">
<block tt:for="{{brand_list}}" tt:key="key">
<view class="fl tc single-text {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="brand_list">
<image tt:if="{{(item.logo || null) != null}}" src="{{item.logo}}" mode="aspectFit" />
<text tt:else>{{item.name}}</text>
</view>
</block>
</view>
</view>
<!-- 分类 -->
<view tt:if="{{(category_list || null) != null && category_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>分类</text>
<text class="arrow-bottom" tt: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 tt:for="{{category_list}}" tt: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>
<!-- 价格 -->
<view tt:if="{{(screening_price_list || null) != null && screening_price_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>价格</text>
<text class="arrow-bottom" tt:if="{{screening_price_list.length > 3}}" bindtap="more_event" data-value="screening_price_list">更多</text>
</view>
<view class="map-content map-text-items screening-price-container oh bg-white" style="height:{{map_fields_list.screening_price_list.height}};">
<block tt:for="{{screening_price_list}}" tt:key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="screening_price_list">{{item.name}}</view>
</block>
</view>
</view>
<!-- 属性 -->
<view tt:if="{{(goods_params_list || null) != null && goods_params_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>属性</text>
<text class="arrow-bottom" tt:if="{{goods_params_list.length > 3}}" bindtap="more_event" data-value="goods_params_list">更多</text>
</view>
<view class="map-content map-text-items goods-params-container oh bg-white" style="height:{{map_fields_list.goods_params_list.height}};">
<block tt:for="{{goods_params_list}}" tt:key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="goods_params_list">{{item.value}}</view>
</block>
</view>
</view>
<!-- 规格 -->
<view tt:if="{{(goods_spec_list || null) != null && goods_spec_list.length > 0}}" class="map-item">
<view class="map-nav tc">
<text>规格</text>
<text class="arrow-bottom" tt:if="{{goods_spec_list.length > 3}}" bindtap="more_event" data-value="goods_spec_list">更多</text>
</view>
<view class="map-content map-text-items goods-spec-container oh bg-white" style="height:{{map_fields_list.goods_spec_list.height}};">
<block tt:for="{{goods_spec_list}}" tt:key="key">
<view class="fl {{item.active == 1 ? 'active' : ''}}" bindtap="map_item_event" data-index="{{index}}" data-field="goods_spec_list">{{item.value}}</view>
</block>
</view>
</view>
<button formType="submit" class="bg-main search-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
</view>
<view class="item keywords">
<view class="title cr-666">关键字</view>
<input type="text" placeholder="关键字" name="wd" value="{{(params.keywords || '')}}" class="br" />
</view>
<button formType="submit" class="bg-main form-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
</form>
</component-popup>
...
...
sourcecode/toutiao/default/pages/goods-search/goods-search.ttss
浏览文件 @
ebc295cc
...
...
@@ -61,40 +61,102 @@
/**
* 条件
*/
.popup-form {
height: 100vh;
}
.popup-form input {
.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;
height: 60rpx;
line-height: 60rpx;
background: #fbfbfb;
border-radius: 6rpx;
padding: 0 6rpx;
box-sizing: border-box;
}
.
screening-price input
{
width: calc(50% - 20px)
;
.
map-nav
{
position: relative
;
}
.screening-price .separator {
line-height: 50rpx;
.map-nav .arrow-bottom {
position: absolute;
top: 0;
right: 10rpx;
padding-right: 46rpx;
color: #999;
}
.popup-form .item {
width: 480rpx;
padding: 0 20rpx;
margin-top: 20rpx;
.map-item {
background: #f0f0f0;
line-height: 76rpx;
}
.popup-form .item:not(:last-child) {
margin-bottom: 30rpx;
.map-base,
.map-nav {
padding: 0 10rpx;
}
.
popup-form .item .title
{
margin-bottom: 10
rpx;
font-size: 28
rpx;
.
map-content
{
padding: 15
rpx;
line-height: 60
rpx;
}
.popup-form .form-submit {
.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;
}
\ No newline at end of file
sourcecode/toutiao/default/pages/index/index.ttss
浏览文件 @
ebc295cc
...
...
@@ -157,7 +157,7 @@
}
.limitedtimediscount .goods-list .item {
width: 460rpx;
height: 6
05
rpx;
height: 6
70
rpx;
border: 1px solid #f5f5f5;
background: white;
display: inline-block;
...
...
sourcecode/toutiao/default/pages/plugins/brand/index/index.js
0 → 100644
浏览文件 @
ebc295cc
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
params
:
null
,
data_base
:
null
,
brand_list
:
[],
brand_category_list
:
[],
nav_active_value
:
0
,
},
onLoad
(
params
)
{
this
.
setData
({
params
:
params
,
});
},
onShow
()
{
this
.
get_data
();
// 显示分享菜单
app
.
show_share_menu
();
},
// 获取数据
get_data
()
{
var
self
=
this
;
tt
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
brand
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
tt
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
self
.
setData
({
data_base
:
data
.
base
||
null
,
brand_list
:
data
.
brand_list
||
[],
brand_category_list
:
data
.
brand_category_list
||
[],
data_list_loding_msg
:
''
,
data_list_loding_status
:
((
data
.
brand_list
||
[]).
length
>
0
)
?
3
:
0
,
data_bottom_line_status
:
((
data
.
brand_list
||
[]).
length
>
0
),
});
// 选中处理
self
.
nav_active_handle
();
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
}
},
fail
:
()
=>
{
tt
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
,
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data
();
},
// 导航事件
nav_event
(
e
)
{
this
.
setData
({
nav_active_value
:
e
.
currentTarget
.
dataset
.
value
||
0
,
});
this
.
nav_active_handle
();
},
// 导航选中处理
nav_active_handle
()
{
var
value
=
this
.
data
.
nav_active_value
;
var
temp_brand_list
=
this
.
data
.
brand_list
;
var
count
=
0
;
for
(
var
i
in
temp_brand_list
)
{
if
(
value
==
0
)
{
temp_brand_list
[
i
][
'
is_not_show
'
]
=
0
;
count
++
;
}
else
{
var
is_not_show
=
(
temp_brand_list
[
i
][
'
brand_category_ids
'
].
indexOf
(
value
)
==
-
1
)
?
1
:
0
;
temp_brand_list
[
i
][
'
is_not_show
'
]
=
is_not_show
;
if
(
is_not_show
==
0
)
{
count
++
;
}
}
}
this
.
setData
({
brand_list
:
temp_brand_list
,
data_list_loding_status
:
(
count
>
0
)
?
3
:
0
,
data_bottom_line_status
:
(
count
>
0
),
});
},
// 自定义分享
onShareAppMessage
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
desc
:
this
.
data
.
data_base
.
seo_desc
||
app
.
data
.
application_describe
,
path
:
'
/pages/plugins/brand/index/index?referrer=
'
+
user_id
};
},
// 分享朋友圈
onShareTimeline
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
'
品牌 -
'
+
app
.
data
.
application_title
,
query
:
'
referrer=
'
+
user_id
,
imageUrl
:
this
.
data
.
data_base
.
right_images
||
''
};
},
});
\ No newline at end of file
sourcecode/toutiao/default/pages/plugins/brand/index/index.json
0 → 100644
浏览文件 @
ebc295cc
{
"enablePullDownRefresh"
:
true
,
"navigationBarTitleText"
:
"品牌"
}
\ No newline at end of file
sourcecode/toutiao/default/pages/plugins/brand/index/index.ttml
0 → 100644
浏览文件 @
ebc295cc
<view tt:if="{{(data_base || null) != null}}">
<!-- 分类 -->
<scroll-view tt:if="{{(brand_category_list || null) != null && brand_category_list.length > 0}}" class="nav-list bg-white tc oh" scroll-x="true">
<view class="item cr-888 {{nav_active_value == 0 ? 'active' : ''}}" bindtap="nav_event" data-value="0">全部</view>
<block tt:for="{{brand_category_list}}" tt:key="key">
<view class="item cr-888 {{nav_active_value == item.id ? 'active' : ''}}" bindtap="nav_event" data-value="{{item.id}}">{{item.name}}</view>
</block>
</scroll-view>
<!-- 品牌列表 -->
<view tt:if="{{(brand_list || null) != null && brand_list.length > 0}}" class="data-list oh spacing-mt">
<block tt:for="{{brand_list}}" tt:key="key">
<view tt:if="{{(item.is_not_show || 0) == 0}}" class="items bg-white">
<navigator url="/pages/goods-search/goods-search?brand_id={{item.id}}" hover-class="none">
<image src="{{item.logo}}" mode="aspectFit" />
<view class="base br-t-dashed">
<view class="single-text name tc">{{item.name}}</view>
<view class="multi-text desc">{{item.describe}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- 结尾 -->
<import src="/pages/common/bottom_line.ttml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</view>
<view tt:if="{{data_list_loding_status != 3}}">
<import src="/pages/common/nodata.ttml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
\ No newline at end of file
sourcecode/toutiao/default/pages/plugins/brand/index/index.ttss
0 → 100644
浏览文件 @
ebc295cc
/**
* 分类导航
*/
.nav-list {
width: 100%;
height: 80rpx;
white-space: nowrap;
box-sizing: border-box;
}
.nav-list .item {
padding: 20rpx 30rpx;
border-bottom: 3px solid #f0f0f0;
display: inline-block;
position: relative;
}
.nav-list .active {
border-bottom: 3px solid #d2364c;
color: #d2364c;
}
/**
* 数据列表
*/
.data-list .items {
width: calc(50% - 5rpx);
margin-bottom: 10rpx;
}
.data-list .items:nth-child(2n) {
float: right;
}
.data-list .items:nth-child(2n+1) {
float: left;
}
.data-list .items image {
width: 100%;
height: 160rpx !important;
}
.data-list .items .base {
padding-top: 20rpx;
margin: 20rpx;
}
.data-list .items .desc {
color: #999;
margin-top: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
min-height: 80rpx;
}
\ No newline at end of file
sourcecode/weixin/default/app.wxss
浏览文件 @
ebc295cc
...
...
@@ -145,6 +145,7 @@ textarea {
min-height: 104rpx;
line-height: 52rpx;
font-size: 32rpx;
white-space: initial;
}
...
...
sourcecode/weixin/default/pages/goods-search/goods-search.js
浏览文件 @
ebc295cc
...
...
@@ -117,6 +117,21 @@ Page({
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
||
[],
brand_list
:
data
.
brand_list
||
[],
category_list
:
data
.
category_list
||
[],
screening_price_list
:
data
.
screening_price_list
||
[],
goods_params_list
:
data
.
goods_params_list
||
[],
goods_spec_list
:
data
.
goods_spec_list
||
[],
});
}
// 列表数据处理
if
(
data
.
data
.
length
>
0
)
{
if
(
this
.
data
.
data_page
<=
1
)
{
var
temp_data_list
=
data
.
data
;
...
...
@@ -127,21 +142,6 @@ Page({
temp_data_list
.
push
(
temp_data
[
i
]);
}
}
// 仅首次请求赋值条件数据
if
(
this
.
data
.
data_list_loding_status
==
1
)
{
this
.
setData
({
search_map_info
:
data
.
search_map_info
||
[],
brand_list
:
data
.
brand_list
||
[],
category_list
:
data
.
category_list
||
[],
screening_price_list
:
data
.
screening_price_list
||
[],
goods_params_list
:
data
.
goods_params_list
||
[],
goods_spec_list
:
data
.
goods_spec_list
||
[],
});
}
// 公共基础数据
this
.
setData
({
data_list
:
temp_data_list
,
data_total
:
data
.
total
,
...
...
@@ -172,14 +172,12 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
wx
.
hideLoading
();
wx
.
stopPullDownRefresh
();
this
.
setData
({
data_list_loding_status
:
2
});
...
...
@@ -340,7 +338,7 @@ Page({
}
// 关闭条件弹层
this
.
popup_form_event_close
()
;
data
[
'
is_show_popup_form
'
]
=
false
;
// 分页恢复1页、重新获取数据
data
[
'
data_page
'
]
=
1
;
...
...
@@ -352,11 +350,12 @@ Page({
onShareAppMessage
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
var
category_id
=
this
.
data
.
params
[
'
category_id
'
]
||
0
;
var
brand_id
=
this
.
data
.
params
[
'
brand_id
'
]
||
0
;
var
keywords
=
this
.
data
.
params
[
'
keywords
'
]
||
''
;
return
{
title
:
app
.
data
.
application_title
,
desc
:
app
.
data
.
application_describe
,
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&keywords=
'
+
keywords
path
:
'
/pages/goods-search/goods-search?referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&
brand_id=
'
+
brand_id
+
'
&
keywords=
'
+
keywords
};
},
...
...
@@ -364,10 +363,11 @@ Page({
onShareTimeline
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
var
category_id
=
this
.
data
.
params
[
'
category_id
'
]
||
0
;
var
brand_id
=
this
.
data
.
params
[
'
brand_id
'
]
||
0
;
var
keywords
=
this
.
data
.
params
[
'
keywords
'
]
||
''
;
return
{
title
:
app
.
data
.
application_title
,
query
:
'
referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&keywords=
'
+
keywords
query
:
'
referrer=
'
+
user_id
+
'
&category_id=
'
+
category_id
+
'
&
brand_id=
'
+
brand_id
+
'
&
keywords=
'
+
keywords
};
},
});
sourcecode/weixin/default/pages/goods-search/goods-search.wxml
浏览文件 @
ebc295cc
...
...
@@ -48,10 +48,10 @@
</view>
<!-- 搜索关键字 -->
<input type="text" placeholder="其实搜索很简单^_^ !" name="wd" value="{{(post_data.wd || '')}}" class="map-keywords" placeholder-class="cr-ccc" />
<input type="text" placeholder="其实搜索很简单^_^ !" name="wd" value="{{(post_data.wd || '')}}" class="map-keywords
wh-auto
" placeholder-class="cr-ccc" />
<!-- 品牌 -->
<view wx:if="{{(
brand_list || null) != null && brand_list.length > 0
}}" class="map-item">
<view wx:if="{{(
(brand_list || null) != null && brand_list.length > 0) || ((search_map_info.brand || null) != null)
}}" class="map-item">
<view class="map-nav tc">
<text>品牌</text>
<text class="arrow-bottom" wx:if="{{brand_list.length > 3}}" bindtap="more_event" data-value="brand_list">更多</text>
...
...
@@ -128,8 +128,6 @@
<button formType="submit" class="bg-main search-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
</view>
</form>
</component-popup>
...
...
sourcecode/weixin/default/pages/goods-search/goods-search.wxss
浏览文件 @
ebc295cc
...
...
@@ -72,9 +72,8 @@
padding: 0 10rpx;
line-height: 66rpx;
height: 66rpx;
border-color: #e8e8e8;
border-width: 1px 0;
border-style: solid;
font-size: 26rpx;
box-sizing: border-box;
}
.map-nav {
position: relative;
...
...
@@ -135,7 +134,6 @@
}
.map-remove-submit {
color: #e23f36;
cursor: pointer;
}
/**
...
...
sourcecode/weixin/default/pages/index/index.wxss
浏览文件 @
ebc295cc
...
...
@@ -157,7 +157,7 @@
}
.limitedtimediscount .goods-list .item {
width: 460rpx;
height: 6
05
rpx;
height: 6
70
rpx;
border: 1px solid #f5f5f5;
background: white;
display: inline-block;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录