Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
d7a98927
ShopXO
项目概览
jcy2004x
/
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,发现更多精彩内容 >>
提交
d7a98927
编写于
7月 05, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信小程序多商户优化
上级
a1c3a098
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
325 addition
and
10 deletion
+325
-10
application/layout/service/BaseLayout.php
application/layout/service/BaseLayout.php
+9
-3
sourcecode/weixin/default/app.json
sourcecode/weixin/default/app.json
+5
-4
sourcecode/weixin/default/pages/plugins/shop/index/index.js
sourcecode/weixin/default/pages/plugins/shop/index/index.js
+203
-0
sourcecode/weixin/default/pages/plugins/shop/index/index.json
...cecode/weixin/default/pages/plugins/shop/index/index.json
+8
-0
sourcecode/weixin/default/pages/plugins/shop/index/index.wxml
...cecode/weixin/default/pages/plugins/shop/index/index.wxml
+42
-0
sourcecode/weixin/default/pages/plugins/shop/index/index.wxss
...cecode/weixin/default/pages/plugins/shop/index/index.wxss
+55
-0
sourcecode/weixin/default/pages/plugins/shop/public/header.wxml
...code/weixin/default/pages/plugins/shop/public/header.wxml
+1
-1
sourcecode/weixin/default/pages/plugins/shop/search/search.wxss
...code/weixin/default/pages/plugins/shop/search/search.wxss
+2
-2
未找到文件。
application/layout/service/BaseLayout.php
浏览文件 @
d7a98927
...
@@ -482,6 +482,7 @@ class BaseLayout
...
@@ -482,6 +482,7 @@ class BaseLayout
// 多商户
// 多商户
'plugins-shop-home'
=>
PluginsHomeUrl
(
'shop'
,
'index'
,
'index'
),
'plugins-shop-home'
=>
PluginsHomeUrl
(
'shop'
,
'index'
,
'index'
),
'plugins-shop-favor'
=>
PluginsHomeUrl
(
'shop'
,
'shopfavor'
,
'index'
),
// 品牌
// 品牌
'plugins-brand-home'
=>
PluginsHomeUrl
(
'brand'
,
'index'
,
'index'
),
'plugins-brand-home'
=>
PluginsHomeUrl
(
'brand'
,
'index'
,
'index'
),
...
@@ -530,6 +531,7 @@ class BaseLayout
...
@@ -530,6 +531,7 @@ class BaseLayout
// 多商户
// 多商户
'plugins-shop-home'
=>
'/pages/plugins/shop/index/index'
,
'plugins-shop-home'
=>
'/pages/plugins/shop/index/index'
,
'plugins-shop-faovr'
=>
'/pages/plugins/shop/favor/favor'
,
// 品牌
// 品牌
'plugins-brand-home'
=>
'/pages/plugins/brand/index/index'
,
'plugins-brand-home'
=>
'/pages/plugins/brand/index/index'
,
...
@@ -940,7 +942,11 @@ class BaseLayout
...
@@ -940,7 +942,11 @@ class BaseLayout
'data'
=>
[
'data'
=>
[
[
[
'value'
=>
'home'
,
'value'
=>
'home'
,
'name'
=>
'首页'
,
'name'
=>
'所有店铺'
,
],
[
'value'
=>
'favor'
,
'name'
=>
'店铺收藏'
,
],
],
],
],
],
],
...
@@ -950,7 +956,7 @@ class BaseLayout
...
@@ -950,7 +956,7 @@ class BaseLayout
'data'
=>
[
'data'
=>
[
[
[
'value'
=>
'home'
,
'value'
=>
'home'
,
'name'
=>
'
首页
'
,
'name'
=>
'
所有品牌
'
,
],
],
],
],
],
],
...
@@ -960,7 +966,7 @@ class BaseLayout
...
@@ -960,7 +966,7 @@ class BaseLayout
'data'
=>
[
'data'
=>
[
[
[
'value'
=>
'home'
,
'value'
=>
'home'
,
'name'
=>
'
首页
'
,
'name'
=>
'
领券中心
'
,
],
],
[
[
'value'
=>
'user'
,
'value'
=>
'user'
,
...
...
sourcecode/weixin/default/app.json
浏览文件 @
d7a98927
...
@@ -82,10 +82,11 @@
...
@@ -82,10 +82,11 @@
"pages/plugins/signin/user-coming-list/user-coming-list"
,
"pages/plugins/signin/user-coming-list/user-coming-list"
,
"pages/plugins/points/index/index"
,
"pages/plugins/points/index/index"
,
"pages/plugins/brand/index/index"
,
"pages/plugins/brand/index/index"
,
"pages/plugins/shop/
search/search
"
,
"pages/plugins/shop/
index/index
"
,
"pages/plugins/shop/detail/detail"
,
"pages/plugins/shop/detail/detail"
,
"pages/plugins/shop/faovr/faovr"
,
"pages/plugins/shop/search/search"
,
"pages/plugins/shop/design/design"
"pages/plugins/shop/design/design"
,
"pages/plugins/shop/faovr/faovr"
],
],
"permission"
:
{
"permission"
:
{
"scope.userLocation"
:
{
"scope.userLocation"
:
{
...
...
sourcecode/weixin/default/pages/plugins/shop/index/index.js
0 → 100755
浏览文件 @
d7a98927
const
app
=
getApp
();
Page
({
data
:
{
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
data_bottom_line_status
:
false
,
data_list
:
[],
data_total
:
0
,
data_page_total
:
0
,
data_page
:
1
,
params
:
null
,
data_base
:
null
,
shop_category
:
[],
nav_active_value
:
0
,
},
onLoad
(
params
)
{
// 显示分享菜单
app
.
show_share_menu
();
},
onShow
()
{
// 数据加载
this
.
get_data
();
},
// 初始化
get_data
()
{
wx
.
showLoading
({
title
:
"
加载中...
"
});
var
data
=
{
"
category_id
"
:
this
.
data
.
nav_tab_value
||
0
};
wx
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
shop
"
),
method
:
"
POST
"
,
data
:
data
,
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
wx
.
hideLoading
();
wx
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
this
.
setData
({
data_base
:
data
.
base
||
null
,
shop_category
:
data
.
shop_category
||
[],
});
// 标题名称
if
((
this
.
data
.
data_base
||
null
)
!=
null
&&
(
this
.
data
.
data_base
.
application_name
||
null
)
!=
null
)
{
wx
.
setNavigationBarTitle
({
title
:
this
.
data
.
data_base
.
application_name
});
}
// 获取列表数据
this
.
get_data_list
(
1
);
}
else
{
this
.
setData
({
data_list_loding_status
:
0
,
data_list_loding_msg
:
res
.
data
.
msg
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
wx
.
hideLoading
();
wx
.
stopPullDownRefresh
();
this
.
setData
({
data_list_loding_status
:
2
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 获取数据列表
get_data_list
(
is_mandatory
)
{
// 分页是否还有数据
if
((
is_mandatory
||
0
)
==
0
)
{
if
(
this
.
data
.
data_bottom_line_status
==
true
)
{
return
false
;
}
}
// 加载loding
wx
.
showLoading
({
title
:
"
加载中...
"
});
// 参数
var
data
=
{
"
category_id
"
:
this
.
data
.
nav_active_value
||
0
};
// 获取数据
wx
.
request
({
url
:
app
.
get_request_url
(
"
shoplist
"
,
"
index
"
,
"
shop
"
),
method
:
"
POST
"
,
data
:
data
,
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
wx
.
hideLoading
();
wx
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
// 列表数据处理
if
(
data
.
data
.
length
>
0
)
{
if
(
this
.
data
.
data_page
<=
1
)
{
var
temp_data_list
=
data
.
data
;
}
else
{
var
temp_data_list
=
this
.
data
.
data_list
;
var
temp_data
=
data
.
data
;
for
(
var
i
in
temp_data
)
{
temp_data_list
.
push
(
temp_data
[
i
]);
}
}
this
.
setData
({
data_list
:
temp_data_list
,
data_total
:
data
.
total
,
data_page_total
:
data
.
page_total
,
data_list_loding_status
:
3
,
data_page
:
this
.
data
.
data_page
+
1
});
// 是否还有数据
if
(
this
.
data
.
data_page
>
1
&&
this
.
data
.
data_page
>
this
.
data
.
data_page_total
)
{
this
.
setData
({
data_bottom_line_status
:
true
});
}
else
{
this
.
setData
({
data_bottom_line_status
:
false
});
}
}
else
{
this
.
setData
({
data_list_loding_status
:
0
,
});
if
(
this
.
data
.
data_page
<=
1
)
{
this
.
setData
({
data_list
:
[],
data_bottom_line_status
:
false
,
});
}
}
}
else
{
this
.
setData
({
data_list_loding_status
:
0
,
data_list_loding_msg
:
res
.
data
.
msg
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
wx
.
hideLoading
();
wx
.
stopPullDownRefresh
();
this
.
setData
({
data_list_loding_status
:
2
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
setData
({
data_page
:
1
});
this
.
get_data
();
},
// 滚动加载
scroll_lower
(
e
)
{
this
.
get_data_list
();
},
// 导航事件
nav_event
(
e
)
{
this
.
setData
({
nav_active_value
:
e
.
currentTarget
.
dataset
.
value
||
0
,
data_page
:
1
});
// 获取列表数据
this
.
get_data_list
(
1
);
},
// 自定义分享
onShareAppMessage
()
{
var
user_id
=
app
.
get_user_cache_info
(
'
id
'
,
0
)
||
0
;
return
{
title
:
this
.
data
.
data_base
.
seo_title
||
this
.
data
.
data_base
.
application_name
||
app
.
data
.
application_title
,
desc
:
this
.
data
.
data_base
.
seo_desc
||
app
.
data
.
application_describe
,
path
:
'
/pages/plugins/shop/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
||
this
.
data
.
data_base
.
application_name
||
app
.
data
.
application_title
,
query
:
'
referrer=
'
+
user_id
};
},
});
sourcecode/weixin/default/pages/plugins/shop/index/index.json
0 → 100755
浏览文件 @
d7a98927
{
"enablePullDownRefresh"
:
true
,
"navigationBarTitleText"
:
"所有店铺"
,
"usingComponents"
:
{
"component-quick-nav"
:
"/components/quick-nav/quick-nav"
,
"component-popup"
:
"/components/popup/popup"
}
}
\ No newline at end of file
sourcecode/weixin/default/pages/plugins/shop/index/index.wxml
0 → 100755
浏览文件 @
d7a98927
<view wx:if="{{(data_base || null) != null}}">
<!-- 分类 -->
<scroll-view wx:if="{{(shop_category || null) != null && shop_category.length > 0}}" class="nav-list bg-white oh" scroll-x="true">
<view class="item cr-888 {{nav_active_value == 0 ? 'active' : ''}}" bindtap="nav_event" data-value="0">全部</view>
<block wx:for="{{shop_category}}" wx: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>
<!-- 列表 -->
<scroll-view scroll-y="{{true}}" class="scroll-box" bindscrolltolower="scroll_lower" lower-threshold="30">
<view wx:if="{{(data_list || null) != null && data_list.length > 0}}" class="data-list oh spacing-mt">
<block wx:for="{{data_list}}" wx:key="key">
<view class="item bg-white">
<navigator url="/pages/plugins/shop/detail/detail?id={{item.id}}" hover-class="none">
<image src="{{item.logo_long}}" 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 class="oh margin-top-sm single-text base-bottom">
<view class="bitem fl cr-888 single-text">商品 {{item.goods_count}}</view>
<view class="bitem fr cr-888 single-text tr">销量 {{item.goods_sales_count}}</view>
</view>
</view>
</navigator>
</view>
</block>
</view>
<view wx:else>
<import src="/pages/common/nodata.wxml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<!-- 结尾 -->
<import src="/pages/common/bottom_line.wxml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>
</view>
<view wx:else>
<import src="/pages/common/nodata.wxml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
\ No newline at end of file
sourcecode/weixin/default/pages/plugins/shop/index/index.wxss
0 → 100755
浏览文件 @
d7a98927
/**
* 分类导航
*/
.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;
}
/**
* 数据列表
*/
.scroll-box {
height: calc(100vh - 80rpx);
}
.data-list .item {
width: calc(50% - 5rpx);
margin-bottom: 10rpx;
}
.data-list .item:nth-child(2n) {
float: right;
}
.data-list .item:nth-child(2n+1) {
float: left;
}
.data-list .item image {
width: 100%;
height: 160rpx !important;
}
.data-list .item .base {
padding-top: 20rpx;
margin: 20rpx;
}
.data-list .item .desc {
color: #999;
margin-top: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
min-height: 80rpx;
}
.data-list .item .base-bottom .bitem {
width: 45%;
font-size: 24rpx;
}
\ No newline at end of file
sourcecode/weixin/default/pages/plugins/shop/public/header.wxml
浏览文件 @
d7a98927
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
</block>
</block>
</block>
</block>
<block wx:else>
<block wx:else>
<view class="padding-top-xxl padding-bottom-xxl cr-
888
">暂无数据</view>
<view class="padding-top-xxl padding-bottom-xxl cr-
ccc
">暂无数据</view>
</block>
</block>
</scroll-view>
</scroll-view>
</view>
</view>
...
...
sourcecode/weixin/default/pages/plugins/shop/search/search.wxss
浏览文件 @
d7a98927
/**
/**
* 排序导航
* 排序导航
*/
*/
.nav-sort {
.nav-sort {
background: #eee;
background: #eee;
}
}
.nav-sort-content .item {
.nav-sort-content .item {
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
/**
/**
* 商品列表
* 商品列表
*/
*/
.scroll-box {
.scroll-box {
height: calc(100vh - 80rpx);
height: calc(100vh - 80rpx);
}
}
.data-list {
.data-list {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录