Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
9cbad929
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,发现更多精彩内容 >>
提交
9cbad929
编写于
8月 04, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信小程序优化
上级
1054c6cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
81 addition
and
27 deletion
+81
-27
application/service/AppMiniService.php
application/service/AppMiniService.php
+65
-5
application/tags.php
application/tags.php
+14
-14
public/appmini/old/weixin/app.json
public/appmini/old/weixin/app.json
+1
-6
public/appmini/old/weixin/pages/goods-detail/goods-detail.json
...c/appmini/old/weixin/pages/goods-detail/goods-detail.json
+1
-2
未找到文件。
application/service/AppMiniService.php
浏览文件 @
9cbad929
...
...
@@ -10,8 +10,6 @@
// +----------------------------------------------------------------------
namespace
app\service
;
use
think\Db
;
/**
* 小程序服务层
* @author Devil
...
...
@@ -121,13 +119,13 @@ class AppMiniService
// 源码包目录是否存在
if
(
!
is_dir
(
self
::
$new_root
))
{
return
DataReturn
(
'源码包目录不存在'
,
-
1
);
return
DataReturn
(
'源码包目录不存在
['
.
self
::
$new_root
.
']
'
,
-
1
);
}
// 源码包目录是否有权限
if
(
!
is_writable
(
self
::
$new_root
))
{
return
DataReturn
(
'源码包目录没有权限'
,
-
1
);
return
DataReturn
(
'源码包目录没有权限
['
.
self
::
$new_root
.
']
'
,
-
1
);
}
// 目录不存在则创建
...
...
@@ -161,6 +159,23 @@ class AppMiniService
return
DataReturn
(
'基础配置替换失败'
,
-
4
);
}
// 小程序额外处理
switch
(
self
::
$application_name
)
{
// 微信
case
'weixin'
:
$ret
=
self
::
ExtendHandleWeixin
(
$new_dir
);
break
;
// 默认
default
:
$ret
=
DataReturn
(
'无需处理'
,
0
);
}
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 生成压缩包
$zip
=
new
\
base\ZipFolder
();
if
(
!
$zip
->
zip
(
$new_dir
.
'.zip'
,
$new_dir
))
...
...
@@ -174,6 +189,51 @@ class AppMiniService
return
DataReturn
(
'生成成功'
,
0
);
}
/**
* 扩展处理 - 微信
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-21
* @desc description
* @param [string] $new_dir [新得源码包目录]
*/
private
static
function
ExtendHandleWeixin
(
$new_dir
)
{
// 是否开启好物推荐功能
$common_app_is_good_thing
=
MyC
(
'common_app_is_good_thing'
,
0
);
if
(
$common_app_is_good_thing
==
1
)
{
// app.json
$file
=
$new_dir
.
DS
.
'app.json'
;
$data
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$data
)
&&
isset
(
$data
[
'plugins'
]))
{
$data
[
'plugins'
][
'goodsSharePlugin'
]
=
[
'version'
=>
'3.2.0'
,
'provider'
=>
'wx56c8f077de74b07c'
,
];
if
(
file_put_contents
(
$file
,
JsonFormat
(
$data
))
===
false
)
{
return
DataReturn
(
'好物推荐主配置失败'
,
-
50
);
}
}
// goods-detail.json
$file
=
$new_dir
.
DS
.
'pages'
.
DS
.
'goods-detail'
.
DS
.
'goods-detail.json'
;
$data
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$data
)
&&
isset
(
$data
[
'usingComponents'
]))
{
$data
[
'usingComponents'
][
'share-button'
]
=
'plugin://goodsSharePlugin/share-button'
;
if
(
file_put_contents
(
$file
,
JsonFormat
(
$data
))
===
false
)
{
return
DataReturn
(
'好物推荐商品配置失败'
,
-
51
);
}
}
}
return
DataReturn
(
'配置成功'
,
0
);
}
/**
* 源码包删除
* @author Devil
...
...
@@ -181,7 +241,7 @@ class AppMiniService
* @version 1.0.0
* @date 2018-12-21
* @desc description
* @param
[array] $params [输入参数]
* @param [array] $params [输入参数]
*/
public
static
function
Delete
(
$params
=
[])
{
...
...
application/tags.php
浏览文件 @
9cbad929
...
...
@@ -35,8 +35,8 @@ return array (
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
1
=>
'app\\plugins\\
membershiplevelvip
\\Hook'
,
2
=>
'app\\plugins\\
goodsphototag
\\Hook'
,
1
=>
'app\\plugins\\
goodsphototag
\\Hook'
,
2
=>
'app\\plugins\\
membershiplevelvip
\\Hook'
,
),
'plugins_js'
=>
array
(
...
...
@@ -64,6 +64,18 @@ return array (
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_view_goods_detail_photo_within'
=>
array
(
0
=>
'app\\plugins\\goodsphototag\\Hook'
,
),
'plugins_view_home_goods_inside_top'
=>
array
(
0
=>
'app\\plugins\\goodsphototag\\Hook'
,
),
'plugins_view_search_goods_inside_top'
=>
array
(
0
=>
'app\\plugins\\goodsphototag\\Hook'
,
),
'plugins_service_buy_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
...
...
@@ -104,17 +116,5 @@ return array (
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_goods_detail_photo_within'
=>
array
(
0
=>
'app\\plugins\\goodsphototag\\Hook'
,
),
'plugins_view_home_goods_inside_top'
=>
array
(
0
=>
'app\\plugins\\goodsphototag\\Hook'
,
),
'plugins_view_search_goods_inside_top'
=>
array
(
0
=>
'app\\plugins\\goodsphototag\\Hook'
,
),
);
?>
\ No newline at end of file
public/appmini/old/weixin/app.json
浏览文件 @
9cbad929
...
...
@@ -63,12 +63,7 @@
"request"
:
10000
,
"downloadFile"
:
10000
},
"plugins"
:
{
"goodsSharePlugin"
:
{
"version"
:
"3.1.1"
,
"provider"
:
"wx56c8f077de74b07c"
}
},
"plugins"
:
{},
"debug"
:
true
,
"sitemapLocation"
:
"sitemap.json"
}
\ No newline at end of file
public/appmini/old/weixin/pages/goods-detail/goods-detail.json
浏览文件 @
9cbad929
{
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"component-popup"
:
"/components/popup/popup"
,
"share-button"
:
"plugin://goodsSharePlugin/share-button"
"component-popup"
:
"/components/popup/popup"
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录