index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-form-default">
  4. <div class="alert"><strong>{$Think.lang.ds_explain}{$Think.lang.ds_colon}</strong>{$Think.lang.store_callcenter_notes}
  5. </li>
  6. </div>
  7. <form method="post" action="{:url('Sellercallcenter/save')}" id="callcenter_form" class="dss-message">
  8. <dl dstype="pre">
  9. <dt>{$Think.lang.store_callcenter_presales_service}{$Think.lang.ds_colon}</dt>
  10. <dd>
  11. <div class="dss-message-title"><span class="name">{$Think.lang.store_callcenter_service_name}</span><span class="tool">{$Think.lang.store_callcenter_service_tool}</span><span class="number">{$Think.lang.store_callcenter_service_number}</span></div>
  12. {empty name="storeinfo.store_presales"}
  13. <div class="dss-message-list"><span class="name tip" title="{$Think.lang.store_callcenter_name_title}">
  14. <input type="text" class="text w60" value="{$Think.lang.store_callcenter_presales}1" name="pre[1][name]" maxlength="10" />
  15. </span><span class="tool tip" title="{$Think.lang.store_callcenter_tool_title}">
  16. <select name="pre[1][type]">
  17. <option value="0">{$Think.lang.store_callcenter_please_choose}</option>
  18. <option value="1">QQ</option>
  19. <option value="2">{$Think.lang.store_callcenter_wangwang}</option>
  20. <option value="3">{$Think.lang.standing_im}</option>
  21. </select>
  22. </span><span class="number tip" title="{$Think.lang.store_callcenter_number_title}">
  23. <input name="pre[1][num]" type="text" class="text w180" maxlength="25" />
  24. </span><span class="del"><a dstype="del" href="javascript:void(0);" class="dssc-btn" onclick="del_service(this)"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_delete}</a></span></div>
  25. {else}
  26. {foreach name="storeinfo.store_presales" item="val"}
  27. <div class="dss-message-list"><span class="name tip" title="{$Think.lang.store_callcenter_name_title}">
  28. <input type="text" class="text w60" value="{$val.name}" name="pre[{$key}][name]" maxlength="10" />
  29. </span><span class="tool tip" title="{$Think.lang.store_callcenter_tool_title}">
  30. <select name="pre[{$key}][type]">
  31. <option value="1" {if $val.type == 1}selected="selected"{/if}>QQ</option>
  32. <option value="2" {if $val.type == 2}selected="selected"{/if}>{$Think.lang.store_callcenter_wangwang}</option>
  33. <option value="3"{if $val.type == 3}selected="selected"{/if}>{$Think.lang.standing_im}</option>
  34. </select>
  35. </span><span class="number tip" title="{$Think.lang.store_callcenter_number_title}">
  36. <input name="pre[{$key}][num]" type="text" class="text w180" value="{$val.num}" maxlength="25" />
  37. </span><span class="del"><a dstype="del" href="javascript:void(0);" class="dssc-btn" onclick="del_service(this)"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_delete}</a></span> </div>
  38. {/foreach}
  39. {/empty}
  40. <p><span><a href="javascript:void(0);" onclick="add_service('pre');" class="dssc-btn dssc-btn-acidblue mt10"><i class="iconfont">&#xe6db;</i>{$Think.lang.store_callcenter_add_service}</a></span></p>
  41. </dd>
  42. </dl>
  43. <dl dstype="after" >
  44. <dt>{$Think.lang.store_callcenter_aftersales_service}{$Think.lang.ds_colon}</dt>
  45. <dd>
  46. <div class="dss-message-title"><span class="name">{$Think.lang.store_callcenter_service_name}</span><span class="tool">{$Think.lang.store_callcenter_service_tool}</span><span class="number">{$Think.lang.store_callcenter_service_number}</span></div>
  47. {empty name="storeinfo.store_aftersales"}
  48. <div class="dss-message-list"><span class="name tip" title="{$Think.lang.store_callcenter_name_title}">
  49. <input type="text" class="text w60" value="{$Think.lang.store_callcenter_aftersales}1" name="after[1][name]" maxlength="10" />
  50. </span><span class="tool tip" title="{$Think.lang.store_callcenter_tool_title}">
  51. <select name="after[1][type]">
  52. <option value="0">{$Think.lang.store_callcenter_please_choose}</option>
  53. <option value="1">QQ</option>
  54. <option value="2">{$Think.lang.store_callcenter_wangwang}</option>
  55. <option value="3">{$Think.lang.standing_im}</option>
  56. </select>
  57. </span><span class="number tip" title="{$Think.lang.store_callcenter_number_title}">
  58. <input type="text" class="text w180" name="after[1][num]" maxlength="25" />
  59. </span><span><a dstype="del" href="javascript:void(0);" class="dssc-btn" onclick="del_service(this)"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_delete}</a></span> </div>
  60. {else}
  61. {foreach name="storeinfo.store_aftersales" item="val"}
  62. <div class="dss-message-list"><span class="name tip" title="{$Think.lang.store_callcenter_name_title}">
  63. <input type="text" class="text w60" value="{$val.name}" name="after[{$key}][name]" maxlength="10" />
  64. </span><span class="tool tip" title="{$Think.lang.store_callcenter_tool_title}">
  65. <select name="after[{$key}][type]">
  66. <option value="1" {if $val.type == 1}selected="selected"{/if}>QQ</option>
  67. <option value="2" {if $val.type == 2}selected="selected"{/if}>{$Think.lang.store_callcenter_wangwang}</option>
  68. <option value="3" {if $val.type == 3}selected="selected"{/if}>{$Think.lang.standing_im}</option>
  69. </select>
  70. </span><span class="number tip" title="{$Think.lang.store_callcenter_number_title}">
  71. <input type="text" class="text w180" name="after[{$key}][num]" maxlength="25" value="{$val.num}" />
  72. </span><span class="del"><a dstype="del" href="javascript:void(0);" class="dssc-btn" onclick="del_service(this)"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_delete}</a></span> </div>
  73. {/foreach}
  74. {/empty}
  75. <p><span><a href="javascript:void(0);" onclick="add_service('after');" class="dssc-btn dssc-btn-acidblue mt10"><i class="iconfont">&#xe6db;</i>{$Think.lang.store_callcenter_add_service}</a></span></p>
  76. </dd>
  77. </dl>
  78. <dl >
  79. <dt><em class="pngFix">{$Think.lang.store_callcenter_working_time}{$Think.lang.ds_colon}</em></dt>
  80. <dd>
  81. <div class="dss-message-title"><span>{$Think.lang.store_callcenter_working_time_title}</span></div>
  82. <div>
  83. <textarea name="working_time" class="textarea w500 h50">{$storeinfo.store_workingtime}</textarea>
  84. </div>
  85. </dd>
  86. </dl>
  87. <div class="bottom">
  88. <input type="submit" class="submit" value="{$Think.lang.ds_submit}" />
  89. </div>
  90. </form>
  91. </div>
  92. <script>
  93. jQuery.browser={};(function(){jQuery.browser.msie=false; jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)./)){ jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();
  94. </script>
  95. <script src="{$Think.PLUGINS_SITE_ROOT}/jquery.poshytip.min.js"></script>
  96. <script>
  97. $(document).ready(function(){
  98. $('#callcenter_form').validate({
  99. submitHandler:function(form){
  100. ds_ajaxpost('callcenter_form','url',"{:url('Sellercallcenter/index')}")
  101. },
  102. });
  103. });
  104. var seller_option = '';
  105. {notempty name="seller_list"}
  106. {foreach name='seller_list' item="val"}
  107. seller_option += '<option value="{$val.member_id}">{$val.seller_name}</option>';
  108. {/foreach}
  109. {/notempty}
  110. $('#callcenter_form').find('.tool select').on('change', function(){
  111. var obj = $(this).parent().parent();
  112. var input_obj = obj.find(".number input");
  113. var input_name = input_obj.attr("name");
  114. var input_val = input_obj.val();
  115. var select_val = $(this).val();
  116. if ( select_val == 3 ) {
  117. obj.find(".number").html('<input type="hidden" name="'+input_name+'" value="'+input_val+'" /><select name="'+
  118. input_name+'">'+seller_option+'</select>');
  119. obj.find(".number select").val(input_val);
  120. } else {
  121. obj.find(".number").html('<input class="text w180" type="text" name="'+input_name+'" value="'+input_val+'" />');
  122. }
  123. });
  124. $('#callcenter_form').find('.tool select').trigger("change");
  125. $(function(){
  126. titleTip();
  127. });
  128. function del_service(obj){
  129. $(obj).parents('div:first').remove();
  130. }
  131. function add_service(param){
  132. if(param == 'pre'){
  133. var text = '{$Think.lang.store_callcenter_presales}';
  134. }else if(param == 'after'){
  135. var text = '{$Think.lang.store_callcenter_aftersales}';
  136. }
  137. obj = $('dl[dstype="'+param+'"]').children('dd').find('p');
  138. len = $('dl[dstype="'+param+'"]').children('dd').find('div').length;
  139. key = 'k'+len+Math.floor(Math.random()*100);
  140. var add_html = '';
  141. add_html += '<div class="dss-message-list">';
  142. add_html += '<span class="name tip" title="{$Think.lang.store_callcenter_name_title}">';
  143. add_html += '<input type="text" class="text w60" value="'+text+len+'" name="'+param+'['+key+'][name]" /></span>';
  144. add_html += '<span class="tool tip" title="{$Think.lang.store_callcenter_tool_title}"><select name="'+param+'['+key+'][type]">';
  145. add_html += '<option class="" value="0">{$Think.lang.store_callcenter_please_choose}</option><option value="1">QQ</option>';
  146. add_html += '<option value="2">{$Think.lang.store_callcenter_wangwang}</option><option value="3">{$Think.lang.standing_im}</option></select></span>';
  147. add_html += '<span class="number tip" title="{$Think.lang.store_callcenter_number_title}"><input class="text w180" type="text" name="'+param+'['+key+'][num]" /></span>';
  148. add_html += '<span class="del"><a dstype="del" href="javascript:void(0);" class="dssc-btn" onclick="del_service(this)"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_delete}</a></span>';
  149. add_html += '</div>';
  150. obj.before(add_html);
  151. titleTip();
  152. }
  153. function titleTip(){
  154. $('.tip').unbind().poshytip({
  155. className: 'tip-yellowsimple',
  156. showTimeout: 1,
  157. alignTo: 'target',
  158. alignX: 'center',
  159. alignY: 'top',
  160. offsetX: 5,
  161. offsetY: 0,
  162. allowTipHover: false
  163. });
  164. }
  165. </script>
  166. {/block}