tabbar.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <script type="text/javascript" src="./resource/components/colpick/colpick.js"></script>
  43. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  44. <link href="/static/css/snailfish.css" rel="stylesheet">
  45. <link href="./resource/components/colpick/colpick.css" rel="stylesheet">
  46. </head>
  47. <body layadmin-themealias="default">
  48. <div class="layui-fluid">
  49. <div class="layui-card">
  50. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">小程序tabbar设置</span></div>
  51. <div class="layui-card-body" style="padding:15px;">
  52. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  53. <div class="layui-form-item">
  54. <label class="layui-form-label">首页标题</label>
  55. <div class="layui-input-block">
  56. <input type="text" name="parameter[wepro_tabbar_text1]" class="layui-input" value="{$data['wepro_tabbar_list']['t1']}" />
  57. </div>
  58. </div>
  59. <div class="layui-form-item">
  60. <label class="layui-form-label">未选中图标</label>
  61. <div class="layui-input-block">
  62. {:tpl_form_field_image2('parameter[wepro_tabbar_iconPath1]', $data['wepro_tabbar_list']['i1'])}
  63. <span class="layui-form-mid">此图为导航栏未选中状态图标,尺寸为81*81</span>
  64. </div>
  65. </div>
  66. <div class="layui-form-item">
  67. <label class="layui-form-label">选中图标</label>
  68. <div class="layui-input-block">
  69. {:tpl_form_field_image2('parameter[wepro_tabbar_selectedIconPath1]', $data['wepro_tabbar_list']['s1'])}
  70. <span class="layui-form-mid">此图为导航栏选中状态图标,尺寸为81*81</span>
  71. </div>
  72. </div>
  73. <hr>
  74. <div class="layui-form-item">
  75. <label class="layui-form-label">分类标题</label>
  76. <div class="layui-input-block">
  77. <input type="text" name="parameter[wepro_tabbar_text4]" class="layui-input" value="{$data['wepro_tabbar_list']['t4']}" />
  78. </div>
  79. </div>
  80. <div class="layui-form-item">
  81. <label class="layui-form-label">未选中图标</label>
  82. <div class="layui-input-block">
  83. {:tpl_form_field_image2('parameter[wepro_tabbar_iconPath4]', $data['wepro_tabbar_list']['i4'])}
  84. <span class="layui-form-mid">此图为导航栏未选中状态图标,尺寸为81*81</span>
  85. </div>
  86. </div>
  87. <div class="layui-form-item">
  88. <label class="layui-form-label">选中图标</label>
  89. <div class="layui-input-block">
  90. {:tpl_form_field_image2('parameter[wepro_tabbar_selectedIconPath4]', $data['wepro_tabbar_list']['s4'])}
  91. <span class="layui-form-mid">此图为导航栏选中状态图标,尺寸为81*81</span>
  92. </div>
  93. </div>
  94. <div class="layui-form-item">
  95. <label class="layui-form-label">是否开启分类</label>
  96. <div class="layui-input-block">
  97. <label class='radio-inline'>
  98. <input type='radio' name='parameter[open_tabbar_type]' title="关闭" value='0' <?php if( !empty($data) && $data['open_tabbar_type'] ==0 ){ ?>checked <?php } ?> />
  99. </label>
  100. <label class='radio-inline'>
  101. <input type='radio' name='parameter[open_tabbar_type]' title="开启" value='1' <?php if( empty($data) || $data['open_tabbar_type'] ==1 ){ ?>checked <?php } ?> />
  102. </label>
  103. </div>
  104. </div>
  105. <hr>
  106. <div class="layui-form-item">
  107. <label class="layui-form-label">外部跳转标题</label>
  108. <div class="layui-input-block">
  109. <input type="text" name="parameter[wepro_tabbar_text5]" class="layui-input" value="{$data['wepro_tabbar_list']['t5']}" />
  110. </div>
  111. </div>
  112. <div class="layui-form-item">
  113. <label class="layui-form-label">链接类型</label>
  114. <div class="layui-input-block">
  115. <label class='radio-inline'>
  116. <input type='radio' name='parameter[tabbar_out_type]' title="本小程序链接" lay-filter="linktype" value="1" <?php if( $data['tabbar_out_type']==1 || empty($data) ){ ?>checked<?php } ?> />
  117. </label>
  118. <label class='radio-inline'>
  119. <input type='radio' name='parameter[tabbar_out_type]' title="webview外链" lay-filter="linktype" value="0" <?php if( $data['tabbar_out_type']==0 && !empty($data) ){ ?>checked<?php } ?> />
  120. </label>
  121. <label class='radio-inline'>
  122. <input type='radio' name='parameter[tabbar_out_type]' title="外部小程序链接" lay-filter="linktype" value="2" <?php if( $data['tabbar_out_type']==2 && !empty($data) ){ ?>checked<?php } ?> />
  123. </label>
  124. <label class='radio-inline'>
  125. <input type='radio' name='parameter[tabbar_out_type]' title="拼团" lay-filter="linktype" value="3" <?php if( $data['tabbar_out_type']==3 && !empty($data )){ ?>checked<?php } ?> />
  126. </label>
  127. <label class='radio-inline'>
  128. <input type='radio' name='parameter[tabbar_out_type]' title="菜谱" lay-filter="linktype" value="4" <?php if( $data['tabbar_out_type']==4 && !empty($data) ){ ?>checked<?php } ?> />
  129. </label>
  130. <label class='radio-inline'>
  131. <input type='radio' name='parameter[tabbar_out_type]' title="视频列表" lay-filter="linktype" value="5" <?php if( $data['tabbar_out_type']==5 && !empty($data) ){ ?>checked<?php } ?> />
  132. </label>
  133. <label class='radio-inline'>
  134. <input type='radio' name='parameter[tabbar_out_type]' title="群接龙" lay-filter="linktype" value="6" <?php if( $data['tabbar_out_type']==6 && !empty($data) ){ ?>checked<?php } ?> />
  135. </label>
  136. <label class='radio-inline'>
  137. <input type='radio' name='parameter[tabbar_out_type]' title="直播列表" lay-filter="linktype" value="7" <?php if( $data['tabbar_out_type']==7 && !empty($data) ){ ?>checked<?php } ?> />
  138. </label>
  139. <label class='radio-inline'>
  140. <input type='radio' name='parameter[tabbar_out_type]' title="商城" lay-filter="linktype" value="8" <?php if( $data['tabbar_out_type']==8 && !empty($data) ){ ?>checked<?php } ?> />
  141. </label>
  142. <label class='radio-inline'>
  143. <input type='radio' name='parameter[tabbar_out_type]' title="预售" lay-filter="linktype" value="8" <?php if( $data['tabbar_out_type']==9 && !empty($data) ){ ?>checked<?php } ?> />
  144. </label>
  145. </div>
  146. </div>
  147. <div class="layui-form-item" id="appidGroup" style="<?php if( $data['tabbar_out_type']!=2 ){ ?>display: none;<?php } ?>">
  148. <label class="layui-form-label">跳转小程序appID</label>
  149. <div class="layui-input-block">
  150. <input type="text" name="parameter[tabbar_out_appid]" class="layui-input" value="{$data['tabbar_out_appid']}" />
  151. </div>
  152. </div>
  153. <div class="layui-form-item" id="linkGroup" style="<?php if( $data['tabbar_out_type']==3 || $data['tabbar_out_type']==4 || $data['tabbar_out_type']==5 || $data['tabbar_out_type']==6 || $data['tabbar_out_type']==7 || $data['tabbar_out_type']==8){ ?>display: none;<?php } ?>">
  154. <label class="layui-form-label">跳转链接</label>
  155. <div class="layui-input-block">
  156. <!-- <input type="text" name="parameter[tabbar_out_link]" class="layui-input" value="{$data['tabbar_out_link']}" /> -->
  157. <div class="input-group" style="margin: 0;">
  158. <input type="text" value="{$data['tabbar_out_link']}" class="form-control valid" name="parameter[tabbar_out_link]" placeholder="" id="advlink">
  159. <span class="input-group-btn">
  160. <span data-input="#advlink" id="chose_link" data-toggle="selectUrl" class="btn btn-default">选择链接</span>
  161. </span>
  162. </div>
  163. <!-- <input type="text" name="parameter[tabbar_out_link]" class="layui-input" value="{$data['tabbar_out_link']}" /> -->
  164. </div>
  165. </div>
  166. <div class="layui-form-item">
  167. <label class="layui-form-label">未选中图标</label>
  168. <div class="layui-input-block">
  169. {:tpl_form_field_image2('parameter[wepro_tabbar_iconPath5]', $data['wepro_tabbar_list']['i5'])}
  170. <span class="layui-form-mid">此图为导航栏未选中状态图标,尺寸为81*81</span>
  171. </div>
  172. </div>
  173. <div class="layui-form-item">
  174. <label class="layui-form-label">选中图标</label>
  175. <div class="layui-input-block">
  176. {:tpl_form_field_image2('parameter[wepro_tabbar_selectedIconPath5]', $data['wepro_tabbar_list']['s5'])}
  177. <span class="layui-form-mid">此图为导航栏选中状态图标,尺寸为81*81</span>
  178. </div>
  179. </div>
  180. <div class="layui-form-item">
  181. <label class="layui-form-label">是否开启跳转按钮</label>
  182. <div class="layui-input-block">
  183. <label class='radio-inline'>
  184. <input type='radio' name='parameter[open_tabbar_out_weapp]' title="关闭" value='0' <?php if( !empty($data) && $data['open_tabbar_out_weapp'] ==0 ){ ?>checked <?php } ?> />
  185. </label>
  186. <label class='radio-inline'>
  187. <input type='radio' name='parameter[open_tabbar_out_weapp]' title="开启" value='1' <?php if( empty($data) || $data['open_tabbar_out_weapp'] ==1 ){ ?>checked <?php } ?> />
  188. </label>
  189. </div>
  190. </div>
  191. <hr>
  192. <div class="layui-form-item">
  193. <label class="layui-form-label">购物车标题</label>
  194. <div class="layui-input-block">
  195. <input type="text" name="parameter[wepro_tabbar_text2]" class="layui-input" value="{$data['wepro_tabbar_list']['t2']}" />
  196. </div>
  197. </div>
  198. <div class="layui-form-item">
  199. <label class="layui-form-label">未选中图标</label>
  200. <div class="layui-input-block">
  201. {:tpl_form_field_image2('parameter[wepro_tabbar_iconPath2]', $data['wepro_tabbar_list']['i2'])}
  202. <span class="layui-form-mid">此图为导航栏未选中状态图标,尺寸为81*81</span>
  203. </div>
  204. </div>
  205. <div class="layui-form-item">
  206. <label class="layui-form-label">选中图标</label>
  207. <div class="layui-input-block">
  208. {:tpl_form_field_image2('parameter[wepro_tabbar_selectedIconPath2]', $data['wepro_tabbar_list']['s2'])}
  209. <span class="layui-form-mid">此图为导航栏选中状态图标,尺寸为81*81</span>
  210. </div>
  211. </div>
  212. <hr>
  213. <div class="layui-form-item">
  214. <label class="layui-form-label">个人中心标题</label>
  215. <div class="layui-input-block">
  216. <input type="text" name="parameter[wepro_tabbar_text3]" class="layui-input" value="{$data['wepro_tabbar_list']['t3']}" />
  217. </div>
  218. </div>
  219. <div class="layui-form-item">
  220. <label class="layui-form-label">未选中图标</label>
  221. <div class="layui-input-block">
  222. {:tpl_form_field_image2('parameter[wepro_tabbar_iconPath3]', $data['wepro_tabbar_list']['i3'])}
  223. <span class="layui-form-mid">此图为导航栏未选中状态图标,尺寸为81*81</span>
  224. </div>
  225. </div>
  226. <div class="layui-form-item">
  227. <label class="layui-form-label">选中图标</label>
  228. <div class="layui-input-block">
  229. {:tpl_form_field_image2('parameter[wepro_tabbar_selectedIconPath3]', $data['wepro_tabbar_list']['s3'])}
  230. <span class="layui-form-mid">此图为导航栏选中状态图标,尺寸为81*81</span>
  231. </div>
  232. </div>
  233. <div class="layui-form-item" >
  234. <label class="layui-form-label">选中字体颜色</label>
  235. <div class="layui-input-block">
  236. <div class="" style="margin:0px;">
  237. <div class="layui-input-inline" style="width: 120px;">
  238. <input type="text" name="parameter[wepro_tabbar_selectedColor]" value="{$data['wepro_tabbar_selectedColor']}" placeholder="请选择颜色" class="layui-input" id="test-colorpicker-form-input">
  239. </div>
  240. <div class="layui-inline" style="left: -11px;">
  241. <div id="minicolors">
  242. <div class="layui-unselect layui-colorpicker"><span><span class="layui-colorpicker-trigger-span" lay-type="" style="background: {$data['wepro_tabbar_selectedColor']}"><i class="layui-icon layui-colorpicker-trigger-i layui-icon-down"></i></span></span></div>
  243. </div>
  244. </div>
  245. </div>
  246. <span class='layui-form-mid'>颜色值,有效值为十六进制颜色。默认色值:<font color="#F75451">#F75451</font></span>
  247. </div>
  248. </div>
  249. <div class="layui-form-item" >
  250. <label class="layui-form-label">背景颜色</label>
  251. <div class="layui-input-block">
  252. <div class="" style="margin:0px;">
  253. <div class="layui-input-inline" style="width: 120px;">
  254. <input type="text" name="parameter[wepro_tabbar_bgColor]" value="{$data['wepro_tabbar_bgColor']}" placeholder="请选择颜色" class="layui-input" id="test-colorpicker-form-input2">
  255. </div>
  256. <div class="layui-inline" style="left: -11px;">
  257. <div id="minicolors2">
  258. <div class="layui-unselect layui-colorpicker"><span><span class="layui-colorpicker-trigger-span" lay-type="" style="background: {$data['wepro_tabbar_bgColor']}"><i class="layui-icon layui-colorpicker-trigger-i layui-icon-down"></i></span></span></div>
  259. </div>
  260. </div>
  261. </div>
  262. <span class='layui-form-mid'>颜色值,有效值为十六进制颜色。默认色值:#FFFFFF</span>
  263. </div>
  264. </div>
  265. <div class="layui-form-item">
  266. <label class="layui-form-label"> </label>
  267. <div class="layui-input-block">
  268. <input type="hidden" name="wepro_tabbar_version" value="<?php if( !empty($data['wepro_tabbar_version']) ){ ?><?php echo $data['wepro_tabbar_version']+1;?><?php }else{ ?>0<?php } ?>">
  269. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  270. </div>
  271. </div>
  272. </form>
  273. </div>
  274. </div>
  275. </div>
  276. <script src="/layuiadmin/layui/layui.js"></script>
  277. <script>
  278. layui.config({
  279. base: '/layuiadmin/' //静态资源所在路径
  280. }).extend({
  281. index: 'lib/index' //主入口模块
  282. }).use('index');
  283. var wepro_tabbar_selectedColor = '{$data["wepro_tabbar_selectedColor"]}';
  284. $('#minicolors').colpick({
  285. submit:true,
  286. color: wepro_tabbar_selectedColor,
  287. onSubmit: function(color,color2){
  288. $('#test-colorpicker-form-input').val('#'+color2);
  289. $('#minicolors').find('.layui-colorpicker-trigger-span').css('background','#'+color2);
  290. $('.colpick_full').hide();
  291. }
  292. });
  293. var wepro_tabbar_bgColor = '{$data["wepro_tabbar_bgColor"]}';
  294. $('#minicolors2').colpick({
  295. submit:true,
  296. color: wepro_tabbar_bgColor,
  297. onSubmit: function(color,color2){
  298. $('#test-colorpicker-form-input2').val('#'+color2);
  299. $('#minicolors2').find('.layui-colorpicker-trigger-span').css('background','#'+color2);
  300. $('.colpick_full').hide();
  301. }
  302. });
  303. </script>
  304. <script>
  305. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  306. var layer = layui.layer;
  307. var $;
  308. layui.use(['jquery', 'layer','form','colorpicker'], function(){
  309. $ = layui.$;
  310. var form = layui.form;
  311. var colorpicker = layui.colorpicker;
  312. //表单赋值
  313. /*var wepro_tabbar_selectedColor = '{$data["wepro_tabbar_selectedColor"]}';
  314. colorpicker.render({
  315. elem: '#minicolors'
  316. ,color: wepro_tabbar_selectedColor ? wepro_tabbar_selectedColor : '#F75451'
  317. ,done: function(color){
  318. $('#test-colorpicker-form-input').val(color);
  319. }
  320. });
  321. var wepro_tabbar_bgColor = '{$data["wepro_tabbar_bgColor"]}';
  322. colorpicker.render({
  323. elem: '#minicolors2'
  324. ,color: wepro_tabbar_bgColor ? wepro_tabbar_bgColor : '#FFFFFF'
  325. ,done: function(color){
  326. $('#test-colorpicker-form-input2').val(color);
  327. }
  328. });*/
  329. form.on('radio(linktype)', function(data){
  330. if (data.value == 2) {
  331. $('#linkGroup').show();
  332. $('#appidGroup').show();
  333. } else if(data.value == 3 || data.value == 4 || data.value == 5 || data.value == 6 || data.value == 7 || data.value == 8){
  334. $('#linkGroup').hide();
  335. $('#appidGroup').hide();
  336. } else {
  337. $('#linkGroup').show();
  338. $('#appidGroup').hide();
  339. }
  340. });
  341. $('#chose_link').click(function(){
  342. cur_open_div = $(this).attr('data-input');
  343. $.post("{:U('util/selecturl', array('ok' => 1))}", {}, function(shtml){
  344. layer.open({
  345. type: 1,
  346. area: '930px',
  347. content: shtml //注意,如果str是object,那么需要字符拼接。
  348. });
  349. });
  350. })
  351. //监听提交
  352. form.on('submit(formDemo)', function(data){
  353. $.ajax({
  354. url: data.form.action,
  355. type: data.form.method,
  356. data: data.field,
  357. dataType:'json',
  358. success: function (info) {
  359. if(info.status == 0)
  360. {
  361. layer.msg(info.result.message,{icon: 1,time: 2000});
  362. }else if(info.status == 1){
  363. var go_url = location.href;
  364. if( info.result.hasOwnProperty("url") )
  365. {
  366. go_url = info.result.url;
  367. }
  368. layer.msg('操作成功',{time: 1000,
  369. end:function(){
  370. location.href = info.result.url;
  371. }
  372. });
  373. }
  374. }
  375. });
  376. return false;
  377. });
  378. })
  379. </script>
  380. </body>