addvircomment.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">添加虚拟评价</span></div>
  49. <div class="layui-card-body" style="padding:15px;">
  50. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">评价内容</label>
  53. <div class="col-sm-9 subtitle">
  54. <textarea name="data[content]" id="content" rows="5" class="form-control" data-parent=".subtitle" maxlength="200" data-rule-maxlength="200"></textarea>
  55. <div class="help-block">评论内容请控制在200字以内</div>
  56. </div>
  57. </div>
  58. <div class="layui-form-item">
  59. <label class="layui-form-label">描述等级</label>
  60. <div class="layui-input-block" id="param-items">
  61. <label class="radio-inline">
  62. <input type="radio" name='data[star]' value="1" title="1星" />
  63. </label>
  64. <label class="radio-inline">
  65. <input type="radio" name='data[star]' value="2" title="2星" />
  66. </label>
  67. <label class="radio-inline">
  68. <input type="radio" name='data[star]' value="3" title="3星" />
  69. </label>
  70. <label class="radio-inline">
  71. <input type="radio" name='data[star]' value="4" title="4星" />
  72. </label>
  73. <label class="radio-inline">
  74. <input type="radio" name='data[star]' value="5" checked title="5星" />
  75. </label>
  76. </div>
  77. </div>
  78. <div class="layui-form-item">
  79. <label class="layui-form-label">价格合理等级</label>
  80. <div class="layui-input-block" id="param-items">
  81. <label class="radio-inline">
  82. <input type="radio" name='data[star2]' value="1" title="1星" />
  83. </label>
  84. <label class="radio-inline">
  85. <input type="radio" name='data[star2]' value="2" title="2星" />
  86. </label>
  87. <label class="radio-inline">
  88. <input type="radio" name='data[star2]' value="3" title="3星" />
  89. </label>
  90. <label class="radio-inline">
  91. <input type="radio" name='data[star2]' value="4" title="4星" />
  92. </label>
  93. <label class="radio-inline">
  94. <input type="radio" name='data[star2]' value="5" checked title="5星" />
  95. </label>
  96. </div>
  97. </div>
  98. <div class="layui-form-item">
  99. <label class="layui-form-label">质量满意等级</label>
  100. <div class="layui-input-block" id="param-items">
  101. <label class="radio-inline">
  102. <input type="radio" name='data[star3]' value="1" title="1星" />
  103. </label>
  104. <label class="radio-inline">
  105. <input type="radio" name='data[star3]' value="2" title="2星" />
  106. </label>
  107. <label class="radio-inline">
  108. <input type="radio" name='data[star3]' value="3" title="3星" />
  109. </label>
  110. <label class="radio-inline">
  111. <input type="radio" name='data[star3]' value="4" title="4星" />
  112. </label>
  113. <label class="radio-inline">
  114. <input type="radio" name='data[star3]' value="5" checked title="5星" />
  115. </label>
  116. </div>
  117. </div>
  118. <div class="layui-form-item">
  119. <label class="layui-form-label must">选择机器人</label>
  120. <div class="layui-input-block">
  121. <div class="input-group " style="margin: 0;">
  122. <input type="text" disabled value="" class="form-control valid" name="jiaid" placeholder="" id="member_id">
  123. <span class="input-group-btn">
  124. <span data-input="#member_id" id="chose_member_id" class="btn btn-default">选择会员</span>
  125. </span>
  126. </div>
  127. </div>
  128. </div>
  129. <div class="layui-form-item">
  130. <label class="layui-form-label">选择评价商品</label>
  131. <div class="layui-input-block">
  132. <div class="input-group " style="margin: 0;">
  133. <input type="text" disabled value="{$agent_saler['member_id']}" class="form-control valid" name="goods_id" placeholder="" id="agent_id">
  134. <span class="input-group-btn">
  135. <span data-input="#agent_id" id="chose_agent_id" class="btn btn-default">选择商品</span>
  136. </span>
  137. </div>
  138. </div>
  139. <div class="layui-input-block" style="display:none;">
  140. {php echo tpl_selector('goods_id',array('key'=>'gid', 'text'=>'goodsname', 'thumb'=>'thumb',
  141. 'placeholder'=>'选择商品','buttontext'=>'请输入商品标题 ',
  142. 'items'=>$saler,'url'=>U('goods/query_normal') ))}
  143. <span class='help-block'></span>
  144. </div>
  145. </div>
  146. <div class="layui-form-item" >
  147. <label class="layui-form-label">评价时间</label>
  148. <div class="layui-input-block">
  149. <span class="input-group-btn">
  150. {:tpl_form_field_date('time', '',true);}
  151. </span>
  152. </div>
  153. </div>
  154. <div class="layui-form-item">
  155. <label class="layui-form-label">评价图片</label>
  156. <div class="layui-input-block gimgs">
  157. {:tpl_form_field_multi_image3('goods_image')}
  158. <span class="help-block">您可以拖动图片改变其显示顺序 </span>
  159. </div>
  160. </div>
  161. <div class="layui-form-item">
  162. <label class="layui-form-label"> </label>
  163. <div class="layui-input-block">
  164. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  165. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  166. <a class="btn btn-default" style='margin-left:10px;' href="{:U('group/goodsvircomment', array('ok' => 1))}">返回列表</a>
  167. </div>
  168. </div>
  169. </form>
  170. </div>
  171. </div>
  172. </div>
  173. <script src="/layuiadmin/layui/layui.js"></script>
  174. <script type="text/javascript" src="/static/js/jquery-migrate-1.1.1.js"></script>
  175. <script src="/static/js/jquery-ui.min.js"></script>
  176. <style>
  177. .multi-img-details{width:100%;}
  178. </style>
  179. <script>
  180. layui.config({
  181. base: '/layuiadmin/' //静态资源所在路径
  182. }).extend({
  183. index: 'lib/index' //主入口模块
  184. }).use('index');
  185. </script>
  186. <script>
  187. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  188. var layer = layui.layer;
  189. var $;
  190. var cur_open_div;
  191. layui.use(['jquery', 'layer','form'], function(){
  192. $ = layui.$;
  193. var form = layui.form;
  194. form.on('radio(linktype)', function(data){
  195. if (data.value == 2) {
  196. $('#typeGroup').show();
  197. } else {
  198. $('#typeGroup').hide();
  199. }
  200. });
  201. $('#chose_member_id').click(function(){
  202. cur_open_div = $(this).attr('data-input');
  203. $.post("{:U('user/query', array('ok' => 1))}", {}, function(shtml){
  204. layer.open({
  205. type: 1,
  206. area: '930px',
  207. content: shtml //注意,如果str是object,那么需要字符拼接。
  208. });
  209. });
  210. })
  211. $('#chose_agent_id').click(function(){
  212. cur_open_div = $(this).attr('data-input');
  213. $.post("{:U('goods/query_normal', array('type' => 'pin'))}", {}, function(shtml){
  214. layer.open({
  215. type: 1,
  216. area: '930px',
  217. content: shtml //注意,如果str是object,那么需要字符拼接。
  218. });
  219. });
  220. })
  221. $('#chose_link').click(function(){
  222. cur_open_div = $(this).attr('data-input');
  223. $.post("{:U('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  224. layer.open({
  225. type: 1,
  226. area: '930px',
  227. content: shtml //注意,如果str是object,那么需要字符拼接。
  228. });
  229. });
  230. })
  231. //监听提交
  232. form.on('submit(formDemo)', function(data){
  233. $.ajax({
  234. url: data.form.action,
  235. type: data.form.method,
  236. data: data.field,
  237. dataType:'json',
  238. success: function (info) {
  239. if(info.status == 0)
  240. {
  241. layer.msg(info.result.message,{icon: 1,time: 2000});
  242. }else if(info.status == 1){
  243. var go_url = location.href;
  244. if( info.result.hasOwnProperty("url") )
  245. {
  246. go_url = info.result.url;
  247. }
  248. layer.msg('操作成功',{time: 1000,
  249. end:function(){
  250. location.href = info.result.url;
  251. }
  252. });
  253. }
  254. }
  255. });
  256. return false;
  257. });
  258. })
  259. function cancle_bind(obj,sdiv)
  260. {
  261. $('#'+sdiv).val('');
  262. $(obj).parent().parent().remove();
  263. }
  264. </script>
  265. <script>
  266. $(function () {
  267. // 拖拽时开始滚动的间距
  268. var scrollingSensitivity = 20
  269. // 拖拽时滚动速度
  270. let scrollingSpeed = 20
  271. // 拖拽前的父级节点
  272. let dragBeforeParentNode = null
  273. // 初始化拖拽函数
  274. $('.multi-img-details').sortable({
  275. // 自适应placeholder的大小
  276. forceHelperSize: true,
  277. // 拖拽时的鼠标形状
  278. cursor: '-webkit-grabbing',
  279. // 拖拽的父级节点(该节点一定要注意,配置错误会导致当前屏幕外的元素没法自动滚动拖拽,两列之间拖拽的滚动也会出问题)
  280. appendTo: '.layui-form-item',
  281. // 拖拽时的倾斜度
  282. rotate: '5deg',
  283. // 延迟时间(毫秒),避免和click同时操作时出现的冲突
  284. delay: 0,
  285. // 以clone方式拖拽
  286. // 拖拽到边框出现滚动的间距,
  287. scrollSensitivity: scrollingSensitivity,
  288. // 应用于拖拽空白区域的样式
  289. placeholder: 'portlet-placeholder ui-state-highlight',
  290. // 允许拖拽预留空白区域
  291. forcePlaceholderSize: false,
  292. // 多个列表之间的拖拽的dom元素
  293. connectWith: '.multi-img-details',
  294. // 鼠标到区域则填充
  295. tolerance: "pointer",
  296. // 可以拖拽的项
  297. items: '.multi-item',
  298. // 填充动画
  299. revert: 0,
  300. // 拖拽结束函数
  301. stop: (e, ui) => {
  302. // 当前拽入的元素
  303. let item = $(ui.item)
  304. // 当前拽入元素的下标
  305. let index = item.index()
  306. let kid = ''
  307. // xxxx 这里面可以操作数据更新
  308. },
  309. // 开始拖拽时的函数
  310. start: (e, ui) => {
  311. // 拖拽前的父级节点
  312. dragBeforeParentNode = ui.item[0].parentNode
  313. // 让placeholder和源高度一致
  314. ui.helper.addClass('item').width(110)
  315. // xxxx 这里可以记录一些拖拽前的元素属性
  316. },
  317. // 处理两列滚动条问题
  318. sort: function (event, ui) {
  319. var scrollContainer = ui.placeholder[0].parentNode
  320. // 设置拽入的列表的滚动位置
  321. var overflowOffset = $(scrollContainer).offset()
  322. if ((overflowOffset.top + scrollContainer.offsetHeight) - event.pageY <
  323. scrollingSensitivity) {
  324. scrollContainer.scrollTop = scrollContainer.scrollTop + scrollingSpeed
  325. } else if (event.pageY - overflowOffset.top < scrollingSensitivity) {
  326. scrollContainer.scrollTop = scrollContainer.scrollTop - scrollingSpeed
  327. }
  328. }
  329. }).disableSelection()
  330. })
  331. </script>
  332. </body>