优化微信小程序直播可配置

feat/task1-c-wallet
devil 2020-04-21 13:15:50 +08:00
parent 27dd2a22c9
commit 1c878b4b12
4 changed files with 37 additions and 14 deletions

View File

@ -18,6 +18,15 @@
</select>
</div>
<div class="am-form-group">
<label>{{$data.common_app_weixin_liveplayer.name}}<span class="am-form-group-label-tips">{{$data.common_app_weixin_liveplayer.describe}}</span></label>
<select name="{{$data.common_app_weixin_liveplayer.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_app_weixin_liveplayer.error_tips}}" required>
{{foreach $common_is_text_list as $v}}
<option value="{{$v.id}}" {{if isset($data['common_app_weixin_liveplayer']['value']) and $data['common_app_weixin_liveplayer']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</div>
<div class="am-form-group">
<label>{{$data.common_app_is_poster_share.name}}<span class="am-form-group-label-tips">{{$data.common_app_is_poster_share.describe}}</span></label>
<select name="{{$data.common_app_is_poster_share.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_app_is_poster_share.error_tips}}" required>

View File

@ -215,9 +215,8 @@ class AppMiniService
*/
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)
// 启用好物推荐
if(MyC('common_app_is_good_thing', 0) == 1)
{
// app.json
$file = $new_dir.DS.'app.json';
@ -246,6 +245,26 @@ class AppMiniService
}
}
}
// 启用直播
if(MyC('common_app_weixin_liveplayer', 0) == 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']['live-player-plugin'] = [
'version' => '1.0.5',
'provider' => 'wx2b03c6e691cd7370',
];
if(file_put_contents($file, JsonFormat($data)) === false)
{
return DataReturn('直播配置失败', -50);
}
}
}
return DataReturn('配置成功', 0);
}

File diff suppressed because one or more lines are too long

View File

@ -114,12 +114,7 @@
"request": 10000,
"downloadFile": 10000
},
"plugins": {
"live-player-plugin": {
"version": "1.0.5",
"provider": "wx2b03c6e691cd7370"
}
},
"plugins": {},
"debug": true,
"sitemapLocation": "sitemap.json"
}