截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

edit.html 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. {layout name="layout2" /}
  2. <style>
  3. .layui-form-item .layui-form-label { width: 95px; }
  4. .layui-form-item .layui-input-inline { width: 240px; }
  5. .layui-form-item .map-container{ width: 600px; height: 400px; margin-left: 100px; margin-top: 20px; }
  6. .layui-form-select dl {
  7. z-index: 1001;
  8. }
  9. </style>
  10. <div class="layui-card layui-form" style="box-shadow:none;">
  11. <div class="layui-tab layui-tab-card" lay-filter="like-tabs">
  12. <ul class="layui-tab-title">
  13. <li lay-id="1" class="layui-this">基础设置</li>
  14. <li lay-id="2">经营设置</li>
  15. <li lay-id="3">资质信息</li>
  16. </ul>
  17. <div class="layui-tab-content">
  18. <!-- 1、基础设置 -->
  19. <div class="layui-tab-item layui-show">
  20. <div class="layui-form-item">
  21. <label for="name" class="layui-form-label"><span style="color:red;">*</span>商家名称:</label>
  22. <div class="layui-input-inline">
  23. <input type="text" name="name" id="name" value="{$detail.name}" lay-verType="tips" lay-verify="name"
  24. switch-tab="0" autocomplete="off" class="layui-input">
  25. </div>
  26. </div>
  27. <div class="layui-form-item" style="display: none;">
  28. <label class="layui-form-label"><span style="color:red;">*</span>商家类型:</label>
  29. <div class="layui-input-inline">
  30. <input type="radio" name="type" value="1" title="官方自营" {if $detail.type==1}checked{/if}>
  31. <input type="radio" name="type" value="2" title="入驻商家" {if $detail.type==2}checked{/if}>
  32. </div>
  33. </div>
  34. <div class="layui-form-item" style="display: none;">
  35. <label class="layui-form-label"><span style="color:red;">*</span>配送方式:</label>
  36. <div class="layui-input-inline">
  37. <input type="checkbox" name="delivery_type[]" value="1" title="快递发货" disabled lay-skin="primary" checked disabled>
  38. <input type="checkbox" name="delivery_type[]" value="2" title="线下自提" disabled lay-skin="primary" {if in_array(2, $detail.delivery_type)}checked{/if}>
  39. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">实物商品的配送方式【快递发货】默认为必选,虚拟商品默认为虚拟发货,不受配送方式限制</div>
  40. </div>
  41. </div>
  42. <div class="layui-form-item">
  43. <label for="cid" class="layui-form-label"><span style="color:red;">*</span>主营类目:</label>
  44. <div class="layui-input-inline">
  45. <select name="cid" id="cid" lay-verType="tips" lay-verify="cid" switch-tab="0">
  46. <option value=""></option>
  47. {volist name="category" id="vo"}
  48. <option value="{$vo.id}" {if $vo.id == $detail.cid}selected{/if}>{$vo.name}</option>
  49. {/volist}
  50. </select>
  51. </div>
  52. </div>
  53. <div class="layui-form-item" style="display: none;">
  54. <label for="nickname" class="layui-form-label"><span style="color:red;">*</span>联系人:</label>
  55. <div class="layui-input-inline">
  56. <input type="text" name="nickname" id="nickname" value="{$detail.nickname}" lay-verType="tips" lay-verify="nickname"
  57. switch-tab="0" autocomplete="off" class="layui-input">
  58. </div>
  59. </div>
  60. <div class="layui-form-item" style="display: none;">
  61. <label for="mobile" class="layui-form-label"><span style="color:red;">*</span>联系手机:</label>
  62. <div class="layui-input-inline">
  63. <input type="number" name="mobile" id="mobile" value="{$detail.mobile}" lay-verType="tips" lay-verify="phone"
  64. switch-tab="0" autocomplete="off" class="layui-input">
  65. </div>
  66. </div>
  67. <div class="layui-form-item" style="display: none;">
  68. <label class="layui-form-label"><span style="color:red;">*</span>商家logo:</label>
  69. <div class="layui-input-inline">
  70. <div class="like-upload-image" switch-tab="0" lay-verType="tips" lay-verify="logo">
  71. {if $detail.logo}
  72. <div class="upload-image-div">
  73. <img src="{$detail.logo}" alt="img">
  74. <input type="hidden" name="logo" value="{$detail.logo}">
  75. <div class="del-upload-btn">x</div>
  76. </div>
  77. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image add-logo-image"> + 添加图片</a></div>
  78. {else}
  79. <div class="upload-image-elem"><a class="add-upload-image add-logo-image"> + 添加图片</a></div>
  80. {/if}
  81. </div>
  82. </div>
  83. <input type="hidden" name="logo" value="./uploads/images/20250221/202502211625593cc9c0131.png">
  84. </div>
  85. <div class="layui-form-item" style="display: none;">
  86. <label class="layui-form-label">商家地址:</label>
  87. <div class="layui-input-block">
  88. <div class="layui-input-inline" style="width:120px;">
  89. <select name="province_id" id="province" lay-filter="province"></select>
  90. </div>
  91. <div class="layui-input-inline" style="width:120px;">
  92. <select name="city_id" id="city" lay-filter="city"></select>
  93. </div>
  94. <div class="layui-input-inline" style="width:120px;">
  95. <select name="district_id" id="district"></select>
  96. </div>
  97. <div class="layui-input-inline">
  98. <input type="text" name="address" id="address" value="{$detail.address}" autocomplete="off" class="layui-input">
  99. </div>
  100. <div class="layui-input-inline">
  101. <button class="layui-btn layui-btn-normal" id="search_map">搜索地图</button>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="layui-form-item" style="display: none;">
  106. <label class="layui-form-label">地图定位:</label>
  107. <div class="layui-input-block">
  108. <div class="layui-inline" >
  109. <div class="layui-input-inline" style="width:120px;margin-right:5px;">
  110. <input type="text" name="longitude" value="{$detail.longitude}" autocomplete="off" class="layui-input">
  111. </div>
  112. <div class="layui-form-mid layui-word-aux">经度</div>
  113. </div>
  114. <div class="layui-inline" style="margin-right:0;">
  115. <div class="layui-input-inline" style="width:120px;margin-right:5px;">
  116. <input type="text" name="latitude" value="{$detail.latitude}" autocomplete="off" class="layui-input">
  117. </div>
  118. <div class="layui-form-mid layui-word-aux">纬度</div>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="layui-form-item " style="display: none;">
  123. <label class="layui-form-label"></label>
  124. <div class="layui-input-block" style="margin-left:10px;">
  125. <div id="map-container" style="width: 700px;height: 400px;margin-left: 115px;"></div>
  126. </div>
  127. </div>
  128. <div class="layui-form-item" style="display: none;">
  129. <label for="keywords" class="layui-form-label">商家关键字:</label>
  130. <div class="layui-input-inline">
  131. <input type="text" name="keywords" id="keywords" value="{$detail.keywords}" autocomplete="off" class="layui-input">
  132. </div>
  133. </div>
  134. <div class="layui-form-item" style="display: none;">
  135. <label for="intro" class="layui-form-label">商家简介:</label>
  136. <div class="layui-input-inline">
  137. <textarea name="intro" id="intro" class="layui-textarea">{$detail.intro}</textarea>
  138. </div>
  139. </div>
  140. </div>
  141. <!-- 2、经营设置 -->
  142. <div class="layui-tab-item">
  143. <div class="layui-form-item" style="display: none;">
  144. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>到期时间:</label>
  145. <div class="layui-input-inline">
  146. <input type="text" name="expire_time" id="expire_time" value="{$detail.expire_time}"
  147. lay-verType="tips" lay-verify="expire_time"
  148. switch-tab="1" autocomplete="off" class="layui-input">
  149. </div>
  150. </div>
  151. <div class="layui-form-item" style="display: none;">
  152. <label for="trade_service_fee" class="layui-form-label"><span style="color:red;">*</span>交易服务费:</label>
  153. <div class="layui-input-inline">
  154. <input type="number" min="0" max="100" name="trade_service_fee" id="trade_service_fee" value="{$detail.trade_service_fee}"
  155. onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
  156. lay-verType="tips" lay-verify="trade_service_fee"
  157. switch-tab="1" autocomplete="off" class="layui-input">
  158. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">平台每笔交易收取的服务费用。请填写百分比,填0表示不收取服务费</div>
  159. </div>
  160. <div class="layui-form-mid layui-word-aux">%</div>
  161. </div>
  162. <div class="layui-form-item" style="display: none;">
  163. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>产品审核:</label>
  164. <div class="layui-input-inline">
  165. <input type="radio" name="is_product_audit" value="1" title="需要审核" {if $detail.is_product_audit}checked{/if}>
  166. <input type="radio" name="is_product_audit" value="0" title="无需审核" {if !$detail.is_product_audit}checked{/if}>
  167. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家发布商品时是否需要审核</div>
  168. </div>
  169. </div>
  170. <div class="layui-form-item">
  171. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>营业状态:</label>
  172. <div class="layui-input-inline">
  173. <input type="radio" name="is_run" value="1" title="营业中" {if $detail.is_run}checked{/if}>
  174. <input type="radio" name="is_run" value="0" title="暂停营业" {if !$detail.is_run}checked{/if}>
  175. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家暂停营业后,则不能对外提供服务</div>
  176. </div>
  177. </div>
  178. <div class="layui-form-item">
  179. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>商家状态:</label>
  180. <div class="layui-input-inline">
  181. <input type="radio" name="is_freeze" value="0" title="正常" {if !$detail.is_freeze}checked{/if}>
  182. <input type="radio" name="is_freeze" value="1" title="冻结" {if $detail.is_freeze}checked{/if}>
  183. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家冻结后,商家不能对外提供服务</div>
  184. </div>
  185. </div>
  186. </div>
  187. <!-- 3、资质信息 -->
  188. <div class="layui-tab-item">
  189. <div class="layui-form-item">
  190. <label class="layui-form-label">营业执照:</label>
  191. <div class="layui-input-inline">
  192. <div class="like-upload-image">
  193. {if !empty($detail.business_license)}
  194. <div class="upload-image-div">
  195. <img src="{$detail.business_license}" alt="img" style="background-color:#EEEEEE;height: 80px;width:auto">
  196. <input name="business_license" type="hidden" value="{$detail.business_license}">
  197. <div class="del-upload-btn">x</div>
  198. </div>
  199. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image add-business-license"> + 添加图片</a></div>
  200. {else}
  201. <div class="upload-image-elem"><a class="add-upload-image add-business-license"> + 添加图片</a></div>
  202. {/if}
  203. </div>
  204. </div>
  205. </div>
  206. <div class="layui-form-item" style="margin-bottom: 0px">
  207. <label class="layui-form-label">其他资质:</label>
  208. <div class="layui-input-block" id="qualifications_images">
  209. {if !empty($detail.other_qualifications)}
  210. {foreach $detail.other_qualifications as $val}
  211. <div class="upload-image-div">
  212. <img src="{$val}" alt="img" />
  213. <input type="hidden" name="other_qualifications[]" value="{$val}">
  214. <div class="del-upload-btn">x</div>
  215. </div>
  216. {/foreach}
  217. {/if}
  218. <div class="like-upload-image">
  219. <div class="upload-image-elem"><a class="add-upload-image add-other-qualifications" id="other_qualifications"> + 添加图片</a></div>
  220. </div>
  221. </div>
  222. </div>
  223. <div class="layui-form-item">
  224. <label class="layui-form-label"></label>
  225. <span style="color: #a3a3a3;font-size: 9px">最多上传5张</span>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. <div class="layui-form-item layui-hide">
  231. <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
  232. </div>
  233. </div>
  234. <script src="__PUBLIC__/static/common/js/area.js"></script>
  235. <!--<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key={$tx_map_key}"></script>-->
  236. <script src="https://map.qq.com/api/gljs?v=1.exp&key={$tx_map_key}&libraries=service"></script>
  237. <script>
  238. layui.config({
  239. base: "/static/lib/"
  240. }).extend({
  241. likeArea: "likeArea/likeArea",
  242. txMap: "likeMap/txMap",
  243. customTxMap:'likeMap/customTxMap',
  244. }).use(["form", "laydate", "likeArea", "txMap",'customTxMap'], function(){
  245. var $ = layui.$;
  246. var form = layui.form;
  247. var likeArea = layui.likeArea;
  248. var laydate = layui.laydate;
  249. var txMap = layui.txMap;
  250. var customTxMap = layui.customTxMap;
  251. laydate.render({type:"datetime", elem:"#expire_time", trigger:"click",min:0});
  252. like.delUpload();
  253. $(document).on("click", ".add-logo-image", function () {
  254. like.imageUpload({
  255. limit: 1,
  256. field: "logo",
  257. that: $(this)
  258. });
  259. });
  260. $(document).on("click", ".add-business-license", function () {
  261. like.imageUpload({
  262. limit: 1,
  263. field: "business_license",
  264. that: $(this)
  265. });
  266. });
  267. $(document).on("click", ".add-other-qualifications", function () {
  268. like.imageUpload({
  269. limit: 5,
  270. field: "other_qualifications[]",
  271. that: $(this)
  272. });
  273. })
  274. form.verify({
  275. name: function (value, item) {
  276. if (!value) {
  277. switchTab($(item).attr("switch-tab"));
  278. return "请填写商家名称";
  279. }
  280. },
  281. cid: function (value, item) {
  282. if (!value) {
  283. switchTab($(item).attr("switch-tab"));
  284. return "请选择主营类目";
  285. }
  286. },
  287. nickname: function (value, item) {
  288. if (!value) {
  289. switchTab($(item).attr("switch-tab"));
  290. return "请填写联系人";
  291. }
  292. },
  293. mobile: function (value, item) {
  294. if (!value) {
  295. switchTab($(item).attr("switch-tab"));
  296. return "请填写联系手机号";
  297. }
  298. },
  299. logo: function (value, item) {
  300. if (!value) {
  301. if ($(item).find(".upload-image-div").length <= 0) {
  302. switchTab($(item).attr("switch-tab"))
  303. return "请上传商家logo";
  304. }
  305. }
  306. },
  307. expire_time: function (value, item) {
  308. if (!value) {
  309. switchTab($(item).attr("switch-tab"));
  310. return "请选择到期时间";
  311. }
  312. },
  313. trade_service_fee: function (value, item) {
  314. if (!value && parseInt(value) !== 0) {
  315. switchTab($(item).attr("switch-tab"));
  316. return "请填写交易服务费";
  317. }
  318. },
  319. account: function (value, item) {
  320. if (!value) {
  321. switchTab($(item).attr("switch-tab"));
  322. return "请填写商家账号";
  323. }
  324. }
  325. });
  326. function switchTab(number) {
  327. $('.layui-tab-card .layui-tab-title li').removeClass('layui-this');
  328. $('.layui-tab-content .layui-tab-item').removeClass('layui-show');
  329. $('.layui-tab-card .layui-tab-title li').eq(number).addClass('layui-this');
  330. $('.layui-tab-content .layui-tab-item').eq(number).addClass('layui-show');
  331. }
  332. likeArea.init(
  333. "province", "city", "district", "province_id", "city_id", "district_id",
  334. "{$detail.province_id}", "{$detail.city_id}", "{$detail.district_id}"
  335. );
  336. likeArea.init(
  337. "refund_province", "refund_city", "refund_district", "refund_province_id", "refund_city_id", "refund_district_id",
  338. "{$detail.refund_address.province_id ?? ''}", "{$detail.refund_address.city_id ?? ''}", "{$detail.refund_address.district_id ?? ''}"
  339. );
  340. // txMap.init("{$detail.latitude ?? ''}", "{$detail.longitude ?? ''}");
  341. var longitude = "{$detail.longitude ?? ''}";
  342. var latitude = "{$detail.latitude ?? ''}";
  343. if (longitude.length > 0 && latitude.length > 0) {
  344. customTxMap.initMap('map-container',longitude,latitude);
  345. } else {
  346. customTxMap.initMap('map-container');
  347. }
  348. //搜索地图
  349. $("#search_map").click(function () {
  350. var province = $("#province");
  351. var city = $("#city");
  352. var district = $("#district");
  353. var address = $("input[name='address']").val();
  354. if(!province.val()){
  355. layer.msg("请选择省份");
  356. return;
  357. }
  358. if(!city.val()){
  359. layer.msg("请选择市");
  360. return;
  361. }
  362. if(!district.val()){
  363. layer.msg("请选择镇/区");
  364. return;
  365. }
  366. var intactAddress = province.find("option:selected").text() + city.find("option:selected").text() + district.find("option:selected").text() + address;
  367. customTxMap.searchMap(intactAddress);
  368. })
  369. })
  370. </script>