addvircomment.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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 class="layui-input-block">
  129. <span class="help-block">
  130. <?php
  131. if(empty(cookie('is_new_backadmin')) || cookie('is_new_backadmin') == 1){
  132. ?>
  133. <a href="{:U('user/userjia')}" style="color:#0189ff;">添加虚拟会员</a>
  134. <?php
  135. }else if(cookie('is_new_backadmin') == 2){
  136. ?>
  137. <a href="javascript:void(0);" onclick="window.parent.layui.index.openTabsPage('{:U(\'user/userjia\')}', '添加虚拟会员')" style="color:#0189ff;">添加虚拟会员</a>
  138. <?php } ?></span>
  139. </div>
  140. </div>
  141. <div class="layui-form-item">
  142. <label class="layui-form-label">选择评价商品</label>
  143. <div class="layui-input-block">
  144. <div class="input-group " style="margin: 0;">
  145. <input type="text" disabled value="{$agent_saler['member_id']}" class="form-control valid" name="goods_id" placeholder="" id="agent_id">
  146. <span class="input-group-btn">
  147. <span data-input="#agent_id" id="chose_agent_id" class="btn btn-default">选择商品</span>
  148. </span>
  149. </div>
  150. </div>
  151. <div class="layui-input-block" style="display:none;">
  152. {php echo tpl_selector('goods_id',array('key'=>'gid', 'text'=>'goodsname', 'thumb'=>'thumb',
  153. 'placeholder'=>'选择商品','buttontext'=>'请输入商品标题 ',
  154. 'items'=>$saler,'url'=>U('goods/query_normal') ))}
  155. <span class='help-block'></span>
  156. </div>
  157. </div>
  158. <div class="layui-form-item" >
  159. <label class="layui-form-label">评价时间</label>
  160. <div class="layui-input-block">
  161. <span class="input-group-btn">
  162. {:tpl_form_field_date('time', '',true);}
  163. </span>
  164. </div>
  165. </div>
  166. <div class="layui-form-item">
  167. <label class="layui-form-label">评价图片</label>
  168. <div class="layui-input-block gimgs">
  169. {:tpl_form_field_multi_image3('goods_image')}
  170. <span class="help-block">您可以拖动图片改变其显示顺序 </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. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  177. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  178. <a class="btn btn-default" style='margin-left:10px;' href="{:U('order/ordercomment', array('ok' => 1))}">返回列表</a>
  179. </div>
  180. </div>
  181. </form>
  182. </div>
  183. </div>
  184. </div>
  185. <script src="/layuiadmin/layui/layui.js"></script>
  186. <script type="text/javascript" src="/static/js/jquery-migrate-1.1.1.js"></script>
  187. <script src="/static/js/jquery-ui.min.js"></script>
  188. <style>
  189. .multi-img-details{width:100%;}
  190. </style>
  191. <script>
  192. layui.config({
  193. base: '/layuiadmin/' //静态资源所在路径
  194. }).extend({
  195. index: 'lib/index' //主入口模块
  196. }).use('index');
  197. </script>
  198. <script>
  199. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  200. var layer = layui.layer;
  201. var $;
  202. var cur_open_div;
  203. layui.use(['jquery', 'layer','form'], function(){
  204. $ = layui.$;
  205. var form = layui.form;
  206. form.on('radio(linktype)', function(data){
  207. if (data.value == 2) {
  208. $('#typeGroup').show();
  209. } else {
  210. $('#typeGroup').hide();
  211. }
  212. });
  213. $('#chose_member_id').click(function(){
  214. cur_open_div = $(this).attr('data-input');
  215. $.post("{:U('user/query', array('ok' => 1))}", {}, function(shtml){
  216. layer.open({
  217. type: 1,
  218. area: '930px',
  219. content: shtml //注意,如果str是object,那么需要字符拼接。
  220. });
  221. });
  222. })
  223. $('#chose_agent_id').click(function(){
  224. cur_open_div = $(this).attr('data-input');
  225. $.post("{:U('goods/query_normal', array('ok' => 1))}", {}, function(shtml){
  226. layer.open({
  227. type: 1,
  228. area: '930px',
  229. content: shtml //注意,如果str是object,那么需要字符拼接。
  230. });
  231. });
  232. })
  233. $('#chose_link').click(function(){
  234. cur_open_div = $(this).attr('data-input');
  235. $.post("{:U('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  236. layer.open({
  237. type: 1,
  238. area: '930px',
  239. content: shtml //注意,如果str是object,那么需要字符拼接。
  240. });
  241. });
  242. })
  243. //监听提交
  244. form.on('submit(formDemo)', function(data){
  245. $.ajax({
  246. url: data.form.action,
  247. type: data.form.method,
  248. data: data.field,
  249. dataType:'json',
  250. success: function (info) {
  251. if(info.status == 0)
  252. {
  253. layer.msg(info.result.message,{icon: 1,time: 2000});
  254. }else if(info.status == 1){
  255. var go_url = location.href;
  256. if( info.result.hasOwnProperty("url") )
  257. {
  258. go_url = info.result.url;
  259. }
  260. layer.msg('操作成功',{time: 1000,
  261. end:function(){
  262. location.href = info.result.url;
  263. }
  264. });
  265. }
  266. }
  267. });
  268. return false;
  269. });
  270. })
  271. function cancle_bind(obj,sdiv)
  272. {
  273. $('#'+sdiv).val('');
  274. $(obj).parent().parent().remove();
  275. }
  276. </script>
  277. <script>
  278. $(function () {
  279. // 拖拽时开始滚动的间距
  280. var scrollingSensitivity = 20
  281. // 拖拽时滚动速度
  282. let scrollingSpeed = 20
  283. // 拖拽前的父级节点
  284. let dragBeforeParentNode = null
  285. // 初始化拖拽函数
  286. $('.multi-img-details').sortable({
  287. // 自适应placeholder的大小
  288. forceHelperSize: true,
  289. // 拖拽时的鼠标形状
  290. cursor: '-webkit-grabbing',
  291. // 拖拽的父级节点(该节点一定要注意,配置错误会导致当前屏幕外的元素没法自动滚动拖拽,两列之间拖拽的滚动也会出问题)
  292. appendTo: '.layui-form-item',
  293. // 拖拽时的倾斜度
  294. rotate: '5deg',
  295. // 延迟时间(毫秒),避免和click同时操作时出现的冲突
  296. delay: 0,
  297. // 以clone方式拖拽
  298. // 拖拽到边框出现滚动的间距,
  299. scrollSensitivity: scrollingSensitivity,
  300. // 应用于拖拽空白区域的样式
  301. placeholder: 'portlet-placeholder ui-state-highlight',
  302. // 允许拖拽预留空白区域
  303. forcePlaceholderSize: false,
  304. // 多个列表之间的拖拽的dom元素
  305. connectWith: '.multi-img-details',
  306. // 鼠标到区域则填充
  307. tolerance: "pointer",
  308. // 可以拖拽的项
  309. items: '.multi-item',
  310. // 填充动画
  311. revert: 0,
  312. // 拖拽结束函数
  313. stop: (e, ui) => {
  314. // 当前拽入的元素
  315. let item = $(ui.item)
  316. // 当前拽入元素的下标
  317. let index = item.index()
  318. let kid = ''
  319. // xxxx 这里面可以操作数据更新
  320. },
  321. // 开始拖拽时的函数
  322. start: (e, ui) => {
  323. // 拖拽前的父级节点
  324. dragBeforeParentNode = ui.item[0].parentNode
  325. // 让placeholder和源高度一致
  326. ui.helper.addClass('item').width(110)
  327. // xxxx 这里可以记录一些拖拽前的元素属性
  328. },
  329. // 处理两列滚动条问题
  330. sort: function (event, ui) {
  331. var scrollContainer = ui.placeholder[0].parentNode
  332. // 设置拽入的列表的滚动位置
  333. var overflowOffset = $(scrollContainer).offset()
  334. if ((overflowOffset.top + scrollContainer.offsetHeight) - event.pageY <
  335. scrollingSensitivity) {
  336. scrollContainer.scrollTop = scrollContainer.scrollTop + scrollingSpeed
  337. } else if (event.pageY - overflowOffset.top < scrollingSensitivity) {
  338. scrollContainer.scrollTop = scrollContainer.scrollTop - scrollingSpeed
  339. }
  340. }
  341. }).disableSelection()
  342. })
  343. </script>
  344. </body>