12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace Content\Lib;
- use Dever;
- class Applet
- {
- # 更新数据
- public function update_api()
- {
- $value = Dever::input('value');
- if ($value) {
- $value = explode('||', $value);
- }
- $pic = $path = $link = $applet_value = '';
- if (isset($value[0])) {
- $pic = $value[0];
- }
- if (isset($value[2])) {
- $path = $value[2];
- }
- if (isset($value[3])) {
- $link = $value[3];
- }
- if (isset($value[1])) {
- $applet_value = $value[1];
- }
- $applet = Dever::db('content/applet')->state();
- $option = '<option parent="" value="" selected>当前小程序</option>';
- if ($applet) {
- foreach ($applet as $k => $v) {
- if ($applet_value == $v['appid']) {
- $check = 'selected';
- } else {
- $check = '';
- }
- $option .= '<option parent="" value="'.$v['appid'].'" '.$check.'>'.$v['name'].'</option>';
- }
- }
- $html = '<div class="layui-card-body">';
- $html .= '<div class="layui-form-item "><div classs="layui-col-lg6"><div><label style="font-size:14px;font-weight:bold;" class="">选择小程序</label></div><div><select lay-ignore="" class="update_value form-control layui-input layui-select validate[required]" name="editor_applet_id" id="editor_applet_id">'.$option.'</select></div></div></div>';
- $html .= '<div class="layui-form-item "><div classs="layui-col-lg6"><div><label style="font-size:14px;font-weight:bold;" class="">路径</label></div><div><input type="text" class="update_value form-control layui-input validate[required]" value="'.$path.'" name="editor_applet_path" id="editor_applet_path" autocomplete="new-password" placeholder=""></div></div></div>';
- $html .= '<div class="layui-form-item "><div classs="layui-col-lg6"><div><label style="font-size:14px;font-weight:bold;" class="">链接-为空则使用小程序里的链接</label></div><div><input type="text" class="update_value form-control layui-input validate[required]" value="'.$link.'" name="editor_applet_link" id="editor_applet_link" autocomplete="new-password" placeholder=""></div></div></div>';
- $html .= '<div class="layui-form-item "><div classs="layui-col-lg6"><div><label style="font-size:14px;font-weight:bold;" class="">封面图<span style="font-size:12px;font-weight:normal;font-color:#bababa;margin-left:5px;">[图片宽度750px高度自适应,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式]</span></label></div><div><input type="button" style="width:100px;display:inline;padding-left:0px;" class="form-control layui-input image_upload" v="editor_applet_pic" id="file_applet_pic" key="1" value="本地上传" autocomplete="new-password">
- <div style="margin-top:5px;">
- <input type="text" class="update_value form-control layui-input " name="editor_applet_pic" id="editor_applet_pic" value="'.$pic.'" autocomplete="new-password"></div></div></div></div>';
- $html .= '</div>';
- return $html;
- }
- }
|