popadv_one.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <div class="adv_list" id="adv_list_{$num}">
  2. <input type="hidden" name="aid[]" value="{$num}"/>
  3. <input type="hidden" name="adv_id[]" value=""/>
  4. <div class="layui-form-item">
  5. <label class="layui-form-label">广告<span class="adv_num">{$num}</span>图片</label>
  6. <div class="layui-input-block">
  7. {:tpl_form_field_image2('thumb[]', '')}
  8. <span class='help-block'>建议尺寸:710 * 320或同比例, 请将所有幻灯片图片尺寸保持一致</span>
  9. </div>
  10. </div>
  11. <div class="layui-form-item">
  12. <label class="layui-form-label">广告<span class="adv_linkurl">{$num}</span>跳转</label>
  13. <div class="layui-input-block">
  14. <label class='radio-inline'>
  15. <input type='radio' name='data[linktype_{$num}]' lay-filter="linktype_{$num}" title="本小程序链接" value="1" checked="checked"/>
  16. </label>
  17. <label class='radio-inline'>
  18. <input type='radio' name='data[linktype_{$num}]' lay-filter="linktype_{$num}" title="webview外链" value="0"/>
  19. </label>
  20. <label class='radio-inline'>
  21. <input type='radio' name='data[linktype_{$num}]' lay-filter="linktype_{$num}" title="外部小程序链接" value="2"/>
  22. </label>
  23. </div>
  24. </div>
  25. <div class="layui-form-item" style="display: none;" id="typeGroup_{$num}">
  26. <div class="layui-input-block " style="text-align: left;">
  27. <label class="layui-form-label" style="text-align: left;">外链小程序appid</label>
  28. <input type="text" id='appid' name="data[appid_{$num}]" class="form-control" value="" maxlength="32" style="width:70%;"/>
  29. </div>
  30. </div>
  31. <div class="layui-form-item">
  32. <div class="layui-input-block" style="text-align: left;">
  33. <label class="layui-form-label" style="text-align: left;">链接</label>
  34. <div class="input-group " style="margin: 0;width:50%;">
  35. <input type="text" value="" class="form-control valid" name="data[link_{$num}]" placeholder="" id="advlink_{$num}">
  36. <span class="input-group-btn" id="chose_link_box_{$num}">
  37. <span data-input="#advlink_{$num}" id="chose_link_{$num}" class="btn btn-default">选择链接</span>
  38. </span>
  39. </div>
  40. <span class='help-block' style="display:none;" id="chose_link_tip_{$num}">备注:请使用http或https链接,需要在<a href="http://mp.weixin.qq.com" target="_blank">mp.weixin.qq.com</a>开发-开发设置-业务域名添加上此域名</span>
  41. </div>
  42. </div>
  43. </div>
  44. <script>
  45. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  46. var layer = layui.layer;
  47. var $;
  48. var cur_open_div;
  49. layui.use(['jquery', 'layer','form'], function() {
  50. $ = layui.$;
  51. var form = layui.form;
  52. form.on('radio(linktype_{$num})', function (data) {
  53. if (data.value == 2) {
  54. $('#typeGroup_{$num}').show();
  55. $('#chose_link_box_{$num}').hide();
  56. }
  57. else if (data.value == 0) {
  58. $('#typeGroup_{$num}').hide();
  59. $('#chose_link_box_{$num}').hide();
  60. $('#chose_link_tip_{$num}').show();
  61. }
  62. else {
  63. $('#typeGroup_{$num}').hide();
  64. $('#chose_link_box_{$num}').show();
  65. $('#chose_link_tip_{$num}').hide();
  66. }
  67. });
  68. $('#chose_link_{$num}').click(function(){
  69. cur_open_div = $(this).attr('data-input');
  70. $.post("/seller.php?s=/util/selecturl/ok/1", {}, function(shtml){
  71. layer.open({
  72. type: 1,
  73. area: '930px',
  74. content: shtml //注意,如果str是object,那么需要字符拼接。
  75. });
  76. });
  77. })
  78. });
  79. </script>