diff --git a/application/layout/service/BaseLayout.php b/application/layout/service/BaseLayout.php
index bc5b6c8f2034f33c9e3dc4a8903df33f4bf8f1f9..d4bcb02530c2a5839b2f0f4f255df57beda073e1 100644
--- a/application/layout/service/BaseLayout.php
+++ b/application/layout/service/BaseLayout.php
@@ -482,6 +482,7 @@ class BaseLayout
// 多商户
'plugins-shop-home' => PluginsHomeUrl('shop', 'index', 'index'),
+ 'plugins-shop-favor' => PluginsHomeUrl('shop', 'shopfavor', 'index'),
// 品牌
'plugins-brand-home' => PluginsHomeUrl('brand', 'index', 'index'),
@@ -530,6 +531,7 @@ class BaseLayout
// 多商户
'plugins-shop-home' => '/pages/plugins/shop/index/index',
+ 'plugins-shop-faovr' => '/pages/plugins/shop/favor/favor',
// 品牌
'plugins-brand-home' => '/pages/plugins/brand/index/index',
@@ -940,7 +942,11 @@ class BaseLayout
'data' => [
[
'value' => 'home',
- 'name' => '首页',
+ 'name' => '所有店铺',
+ ],
+ [
+ 'value' => 'favor',
+ 'name' => '店铺收藏',
],
],
],
@@ -950,7 +956,7 @@ class BaseLayout
'data' => [
[
'value' => 'home',
- 'name' => '首页',
+ 'name' => '所有品牌',
],
],
],
@@ -960,7 +966,7 @@ class BaseLayout
'data' => [
[
'value' => 'home',
- 'name' => '首页',
+ 'name' => '领券中心',
],
[
'value' => 'user',
diff --git a/sourcecode/weixin/default/app.json b/sourcecode/weixin/default/app.json
index d6da01c4298fc039ca7f6edcf3e76a0f90e291ea..2d0809ab58a99c339e14aafca703248e9861950b 100755
--- a/sourcecode/weixin/default/app.json
+++ b/sourcecode/weixin/default/app.json
@@ -1,5 +1,5 @@
{
- "pages": [
+ "pages": [
"pages/index/index",
"pages/goods-category/goods-category",
"pages/cart/cart",
@@ -82,10 +82,11 @@
"pages/plugins/signin/user-coming-list/user-coming-list",
"pages/plugins/points/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/faovr/faovr",
- "pages/plugins/shop/design/design"
+ "pages/plugins/shop/search/search",
+ "pages/plugins/shop/design/design",
+ "pages/plugins/shop/faovr/faovr"
],
"permission": {
"scope.userLocation": {
diff --git a/sourcecode/weixin/default/pages/plugins/shop/index/index.js b/sourcecode/weixin/default/pages/plugins/shop/index/index.js
new file mode 100755
index 0000000000000000000000000000000000000000..1c69e2e70106184a0069a676ec6a35d97034ad15
--- /dev/null
+++ b/sourcecode/weixin/default/pages/plugins/shop/index/index.js
@@ -0,0 +1,203 @@
+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
+ };
+ },
+});
diff --git a/sourcecode/weixin/default/pages/plugins/shop/index/index.json b/sourcecode/weixin/default/pages/plugins/shop/index/index.json
new file mode 100755
index 0000000000000000000000000000000000000000..19ce470a7c36ccd26175de358c450195442ece80
--- /dev/null
+++ b/sourcecode/weixin/default/pages/plugins/shop/index/index.json
@@ -0,0 +1,8 @@
+{
+ "enablePullDownRefresh": true,
+ "navigationBarTitleText": "所有店铺",
+ "usingComponents": {
+ "component-quick-nav": "/components/quick-nav/quick-nav",
+ "component-popup": "/components/popup/popup"
+ }
+}
\ No newline at end of file
diff --git a/sourcecode/weixin/default/pages/plugins/shop/index/index.wxml b/sourcecode/weixin/default/pages/plugins/shop/index/index.wxml
new file mode 100755
index 0000000000000000000000000000000000000000..322a5e7acac11591d864d14cd76d4f0fcbd8b3c8
--- /dev/null
+++ b/sourcecode/weixin/default/pages/plugins/shop/index/index.wxml
@@ -0,0 +1,42 @@
+
+
+
+ 全部
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ {{item.describe}}
+
+ 商品 {{item.goods_count}}
+ 销量 {{item.goods_sales_count}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sourcecode/weixin/default/pages/plugins/shop/index/index.wxss b/sourcecode/weixin/default/pages/plugins/shop/index/index.wxss
new file mode 100755
index 0000000000000000000000000000000000000000..8bf7e055fe7f66eea81056457156b51af79f3f07
--- /dev/null
+++ b/sourcecode/weixin/default/pages/plugins/shop/index/index.wxss
@@ -0,0 +1,55 @@
+/**
+ * 分类导航
+ */
+ .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
diff --git a/sourcecode/weixin/default/pages/plugins/shop/public/header.wxml b/sourcecode/weixin/default/pages/plugins/shop/public/header.wxml
index 2d36f6b6962cb230ae90e65a21c9ad8b269bd325..b773b6f8535aa04bc80983db3d57a175bb98e9bc 100644
--- a/sourcecode/weixin/default/pages/plugins/shop/public/header.wxml
+++ b/sourcecode/weixin/default/pages/plugins/shop/public/header.wxml
@@ -64,7 +64,7 @@
- 暂无数据
+ 暂无数据
diff --git a/sourcecode/weixin/default/pages/plugins/shop/search/search.wxss b/sourcecode/weixin/default/pages/plugins/shop/search/search.wxss
index 13b24464ce69956aa6f9f45411ae9caf1fa4e806..787ae74c01578d4711a5605695807cff40267843 100755
--- a/sourcecode/weixin/default/pages/plugins/shop/search/search.wxss
+++ b/sourcecode/weixin/default/pages/plugins/shop/search/search.wxss
@@ -1,7 +1,7 @@
/**
* 排序导航
*/
- .nav-sort {
+.nav-sort {
background: #eee;
}
.nav-sort-content .item {
@@ -27,7 +27,7 @@
/**
* 商品列表
*/
- .scroll-box {
+.scroll-box {
height: calc(100vh - 80rpx);
}
.data-list {