截流自动化的商城平台
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.

add.html 21KB

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