addGoods.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <link href="/static/css/szyV6.css" rel="stylesheet">
  45. </head>
  46. <body layadmin-themealias="default">
  47. <!-- 菜单组件 begin-->
  48. <include file="Public/componts_menu"/>
  49. <!-- 菜单组件end -->
  50. <div class="div-iframe">
  51. <div class="layui-fluid">
  52. <div class="layui-card">
  53. <div class="layui-card layadmin-header" style="display:block;">
  54. <div class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
  55. <a href="{:U('application/index')}">应用</a><span lay-separator="">/</span>
  56. <a href="{:U('mptradecomponts/index')}"><cite>交易组件</cite></a><span lay-separator="">/</span>
  57. <a href="{:U('mptradecomponts/addGoods')}"><cite>添加交易组件商品</cite></a>
  58. </div>
  59. </div>
  60. <!--- 内容开始 -->
  61. <div class="layui-card-body" style="padding:15px;">
  62. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  63. <div class="layui-form-item" id="goods_form_item" >
  64. <label class="layui-form-label">选择商品</label>
  65. <div class="layui-input-block">
  66. <div class="input-group " style="margin: 0;">
  67. <input type="text" disabled value="" class="form-control valid" name="goods_id" placeholder="" id="agent_id">
  68. <span class="input-group-btn">
  69. <span data-input="#agent_id" id="chose_agent_id" class="btn btn-default">选择商品</span>
  70. </span>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="layui-form-item" >
  75. <label class="layui-form-label">选择分类</label>
  76. <div class="layui-input-block">
  77. <select name="tx_cate_id" lay-filter="cateid" lay-search>
  78. <option value="0"></option>
  79. <?php foreach($catelist as $cate ){ ?>
  80. <option value="{$cate['third_cat_id']}" data-product_qualification="{$cate['product_qualification']}" data-qualification="{$cate['qualification']}" <?php if( $last_third_cate_id == $cate['third_cat_id'] ){ ?> selected<?php } ?> >{$cate['first_cat_name']} {$cate['second_cat_name']} {$cate['third_cat_name']}</option>
  81. <?php } ?>
  82. </select>
  83. <span class='help-block'>
  84. 请认真选择此分类,腾讯将依据此分类进行商品审核。<font color="red">分类较多,点击下拉框可输入文字筛选分类</font>
  85. </span>
  86. </div>
  87. </div>
  88. <div class="layui-form-item">
  89. <label class="layui-form-label must">类目资质</label>
  90. <div class="layui-input-block gimgs" id="gimgs_mult">
  91. {:tpl_form_field_multi_image3('thumbs',[])}
  92. <span class="layui-form-mid layui-word-aux image-block" style="color:red!important;" id="notice_image">
  93. 该类目无须资质,可不传
  94. </span>
  95. </div>
  96. </div>
  97. <div class="layui-form-item">
  98. <label class="layui-form-label"> </label>
  99. <div class="layui-input-block">
  100. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  101. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  102. </div>
  103. </div>
  104. </form>
  105. </div>
  106. <!--- 内容结束-->
  107. </div>
  108. </div>
  109. </div>
  110. <script src="/layuiadmin/layui/layui.js"></script>
  111. <script>
  112. layui.config({
  113. base: '/layuiadmin/' //静态资源所在路径
  114. }).extend({
  115. index: 'lib/index' //主入口模块
  116. }).use('index');
  117. </script>
  118. <script>
  119. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  120. var layer = layui.layer;
  121. var $;
  122. var is_need_qualification = 0;
  123. layui.use(['jquery', 'layer','form'], function(){
  124. $ = layui.$;
  125. var form = layui.form;
  126. $('.sub-nav').css('height', $(window).height() + 'px');
  127. form.on('radio(isopen_tradecomponts)', function(data){
  128. if ( data.value == 1 ) {
  129. $('#open_div').show();
  130. } else {
  131. $('#open_div').hide();
  132. }
  133. });
  134. $('#chose_agent_id').click(function(){
  135. cur_open_div = $(this).attr('data-input');
  136. $.post("{:U('goods/query_normal')}", {}, function(shtml){
  137. layer.open({
  138. type: 1,
  139. area: '930px',
  140. content: shtml //注意,如果str是object,那么需要字符拼接。
  141. });
  142. });
  143. })
  144. form.on('select(cateid)', function(data){
  145. var _product_qual = $(data.elem).find("option:selected").attr('data-product_qualification');
  146. var _qualification = $(data.elem).find("option:selected").attr('data-qualification');
  147. var s_html = '该类目无须资质,可不传';
  148. if( _product_qual != '' && _qualification != '')
  149. {
  150. s_html = _product_qual +"<br/>";
  151. s_html += _qualification;
  152. is_need_qualification = 1;
  153. }else if( _product_qual != '' )
  154. {
  155. s_html = _product_qual +"<br/>";
  156. is_need_qualification = 1;
  157. }
  158. else if( _qualification != '' )
  159. {
  160. s_html += _qualification;
  161. is_need_qualification =1;
  162. }else{
  163. is_need_qualification = 0;
  164. }
  165. //brand_id: 2100000000
  166. $('#notice_image').html( s_html );
  167. });
  168. //监听提交
  169. form.on('submit(formDemo)', function(data){
  170. var loadingIndex = layer.load(); // 加载中动画遮罩层(1)
  171. data.field.is_need_qualification = is_need_qualification;
  172. $.ajax({
  173. url: data.form.action,
  174. type: data.form.method,
  175. data: data.field,
  176. dataType:'json',
  177. success: function (info) {
  178. layer.close(loadingIndex); // 提交成功失败都需要关闭
  179. if(info.status == 0)
  180. {
  181. layer.msg(info.result.message,{icon: 1,time: 2000});
  182. can_sub = true;
  183. }else if(info.status == 1){
  184. var go_url = location.href;
  185. if( info.result.hasOwnProperty("url") )
  186. {
  187. go_url = info.result.url;
  188. }
  189. layer.msg('操作成功',{time: 1000,
  190. end:function(){
  191. location.href = go_url;
  192. }
  193. });
  194. can_sub = true;
  195. }
  196. }
  197. });
  198. return false;
  199. });
  200. })
  201. function cancle_bind(obj,sdiv)
  202. {
  203. $('#'+sdiv).val('');
  204. $(obj).parent().parent().remove();
  205. }
  206. </script>
  207. </body>
  208. </html>