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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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" 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="官方自营" >
  31. <input type="radio" name="type" value="2" title="入驻商家" checked>
  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="快递发货" lay-skin="primary" checked disabled>
  38. <input type="checkbox" name="delivery_type[]" value="2" title="线下自提" lay-skin="primary" >
  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}">{$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" lay-verType="tips" lay-verify="nickname"
  57. switch-tab="0" autocomplete="off" class="layui-input" value="wuwu">
  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" lay-verType="tips" lay-verify="mobile"
  64. switch-tab="0" autocomplete="off" class="layui-input" value="13268119865">
  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-block">
  70. <div class="like-upload-image" switch-tab="0" lay-verType="tips" lay-verify="logo">
  71. <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
  72. </div>
  73. <div class="layui-form-mid layui-word-aux">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</div>
  74. </div>
  75. <input type="hidden" name="logo" value="./uploads/images/20250221/202502211625593cc9c0131.png">
  76. </div>
  77. <div class="layui-form-item" style="display: none;">
  78. <label class="layui-form-label">商家地址:</label>
  79. <div class="layui-input-block">
  80. <div class="layui-input-inline" style="width:120px;">
  81. <select name="province_id" id="province" lay-filter="province"></select>
  82. </div>
  83. <div class="layui-input-inline" style="width:120px;">
  84. <select name="city_id" id="city" lay-filter="city"></select>
  85. </div>
  86. <div class="layui-input-inline" style="width:120px;">
  87. <select name="district_id" id="district"></select>
  88. </div>
  89. <div class="layui-input-inline">
  90. <input type="text" name="address" id="address" autocomplete="off" class="layui-input">
  91. </div>
  92. <div class="layui-input-inline">
  93. <button class="layui-btn layui-btn-normal" id="search_map">搜索地图</button>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="layui-form-item" style="display: none;">
  98. <label class="layui-form-label">地图定位:</label>
  99. <div class="layui-input-block">
  100. <div class="layui-inline" >
  101. <div class="layui-input-inline" style="width:120px;margin-right:5px;">
  102. <input type="text" name="longitude" autocomplete="off" class="layui-input">
  103. </div>
  104. <div class="layui-form-mid layui-word-aux">经度</div>
  105. </div>
  106. <div class="layui-inline" style="margin-right:0;">
  107. <div class="layui-input-inline" style="width:120px;margin-right:5px;">
  108. <input type="text" name="latitude" autocomplete="off" class="layui-input">
  109. </div>
  110. <div class="layui-form-mid layui-word-aux">纬度</div>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="layui-form-item " style="display: none;">
  115. <label class="layui-form-label"></label>
  116. <div class="layui-input-block" style="margin-left:10px;">
  117. <div id="map-container" style="width: 700px;height: 400px;margin-left: 115px;"></div>
  118. </div>
  119. </div>
  120. <div class="layui-form-item" style="display: none;">
  121. <label for="keywords" class="layui-form-label">商家关键字:</label>
  122. <div class="layui-input-inline">
  123. <input type="text" name="keywords" id="keywords" autocomplete="off" class="layui-input">
  124. </div>
  125. </div>
  126. <div class="layui-form-item" style="display: none;">
  127. <label for="intro" class="layui-form-label">商家简介:</label>
  128. <div class="layui-input-inline">
  129. <textarea name="intro" id="intro" class="layui-textarea"></textarea>
  130. </div>
  131. </div>
  132. </div>
  133. <!-- 2、经营设置 -->
  134. <div class="layui-tab-item">
  135. <div class="layui-form-item">
  136. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>到期时间:</label>
  137. <div class="layui-input-inline">
  138. <input type="text" name="expire_time" id="expire_time" lay-verType="tips" lay-verify="expire_time"
  139. switch-tab="1" autocomplete="off" class="layui-input">
  140. </div>
  141. </div>
  142. <div class="layui-form-item" style="display: none;">
  143. <label for="trade_service_fee" class="layui-form-label"><span style="color:red;">*</span>交易服务费:</label>
  144. <div class="layui-input-inline">
  145. <input type="number" min="0" max="100" name="trade_service_fee" id="trade_service_fee"
  146. lay-verType="tips" lay-verify="trade_service_fee"
  147. onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
  148. switch-tab="1" autocomplete="off" class="layui-input" value="0">
  149. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">平台每笔交易收取的服务费用。请填写百分比,填0表示不收取服务费</div>
  150. </div>
  151. <div class="layui-form-mid layui-word-aux">%</div>
  152. </div>
  153. <div class="layui-form-item" style="display: none;">
  154. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>产品审核:</label>
  155. <div class="layui-input-inline">
  156. <input type="radio" name="is_product_audit" value="1" title="需要审核">
  157. <input type="radio" name="is_product_audit" value="0" title="无需审核" checked>
  158. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家发布商品时是否需要审核</div>
  159. </div>
  160. </div>
  161. <div class="layui-form-item">
  162. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>营业状态:</label>
  163. <div class="layui-input-inline">
  164. <input type="radio" name="is_run" value="1" title="营业中">
  165. <input type="radio" name="is_run" value="0" title="暂停营业" checked>
  166. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家暂停营业后,则不能对外提供服务</div>
  167. </div>
  168. </div>
  169. <div class="layui-form-item">
  170. <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>商家状态:</label>
  171. <div class="layui-input-inline">
  172. <input type="radio" name="is_freeze" value="0" title="正常">
  173. <input type="radio" name="is_freeze" value="1" title="冻结" checked>
  174. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家冻结后,商家不能对外提供服务</div>
  175. </div>
  176. </div>
  177. </div>
  178. <!-- 3、账号设置 -->
  179. <div class="layui-tab-item">
  180. <div class="layui-form-item">
  181. <label for="account" class="layui-form-label"><span style="color:red;">*</span>商家账号:</label>
  182. <div class="layui-input-inline">
  183. <input type="text" name="account" id="account" lay-verType="tips" lay-verify="account"
  184. switch-tab="2" autocomplete="off" class="layui-input">
  185. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家账号和密码用于登录商家后台</div>
  186. </div>
  187. </div>
  188. <div class="layui-form-item">
  189. <label for="password" class="layui-form-label"><span style="color:red;">*</span>登录密码:</label>
  190. <div class="layui-input-inline">
  191. <input type="text" name="password" id="password" lay-verType="tips" lay-verify="password"
  192. switch-tab="2" autocomplete="off" class="layui-input">
  193. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家账号和密码用于登录商家后台</div>
  194. </div>
  195. </div>
  196. <div class="layui-form-item">
  197. <label for="okPassword" class="layui-form-label"><span style="color:red;">*</span>确认密码:</label>
  198. <div class="layui-input-inline">
  199. <input type="text" name="okPassword" id="okPassword" lay-verType="tips" lay-verify="pwd"
  200. switch-tab="2" autocomplete="off" class="layui-input">
  201. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商家账号和密码用于登录商家后台</div>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="layui-form-item layui-hide">
  208. <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
  209. </div>
  210. </div>
  211. <script src="__PUBLIC__/static/common/js/area.js"></script>
  212. <!--<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key={$tx_map_key}"></script>-->
  213. <script src="https://map.qq.com/api/gljs?v=1.exp&key={$tx_map_key}&libraries=service"></script>
  214. <script>
  215. layui.config({
  216. base: "/static/lib/"
  217. }).extend({
  218. likeArea: "likeArea/likeArea",
  219. txMap: "likeMap/txMap",
  220. customTxMap:'likeMap/customTxMap',
  221. }).use(["form", "laydate", "likeArea", "txMap",'customTxMap'], function(){
  222. var $ = layui.$;
  223. var form = layui.form;
  224. var likeArea = layui.likeArea;
  225. var laydate = layui.laydate;
  226. var txMap = layui.txMap;
  227. var customTxMap = layui.customTxMap;
  228. laydate.render({type:"datetime", elem:"#expire_time", trigger:"click",min:0});
  229. like.delUpload();
  230. $(document).on("click", ".add-upload-image", function () {
  231. like.imageUpload({
  232. limit: 1,
  233. field: "logo",
  234. that: $(this)
  235. });
  236. });
  237. form.verify({
  238. name: function (value, item) {
  239. if (!value) {
  240. switchTab($(item).attr("switch-tab"));
  241. return "请填写商家名称";
  242. }
  243. },
  244. cid: function (value, item) {
  245. if (!value) {
  246. switchTab($(item).attr("switch-tab"));
  247. return "请选择主营类目";
  248. }
  249. },
  250. nickname: function (value, item) {
  251. if (!value) {
  252. switchTab($(item).attr("switch-tab"));
  253. return "请填写联系人";
  254. }
  255. },
  256. mobile: function (value, item) {
  257. if (!value) {
  258. switchTab($(item).attr("switch-tab"));
  259. return "请填写联系手机号";
  260. }
  261. },
  262. logo: function (value, item) {
  263. if (!value) {
  264. /*if ($(item).find(".upload-image-div").length <= 0) {
  265. switchTab($(item).attr("switch-tab"))
  266. return "请上传商家logo";
  267. }*/
  268. }
  269. },
  270. expire_time: function (value, item) {
  271. if (!value) {
  272. switchTab($(item).attr("switch-tab"));
  273. return "请选择到期时间";
  274. }
  275. },
  276. trade_service_fee: function (value, item) {
  277. if (!value && parseInt(value) !== 0) {
  278. switchTab($(item).attr("switch-tab"));
  279. return "请填写交易服务费";
  280. }
  281. },
  282. account: function (value, item) {
  283. if (!value) {
  284. switchTab($(item).attr("switch-tab"));
  285. return "请填写商家账号";
  286. }
  287. },
  288. password: function (value, item) {
  289. if (!value) {
  290. switchTab($(item).attr("switch-tab"));
  291. return "请填写商家登录密码";
  292. }
  293. },
  294. pwd: function (value, item) {
  295. if (!value) {
  296. switchTab($(item).attr("switch-tab"));
  297. return "请填确认商家登录密码";
  298. }
  299. }
  300. });
  301. function switchTab(number) {
  302. $('.layui-tab-card .layui-tab-title li').removeClass('layui-this');
  303. $('.layui-tab-content .layui-tab-item').removeClass('layui-show');
  304. $('.layui-tab-card .layui-tab-title li').eq(number).addClass('layui-this');
  305. $('.layui-tab-content .layui-tab-item').eq(number).addClass('layui-show');
  306. }
  307. likeArea.init(
  308. "province", "city", "district", "province_id", "city_id", "district_id",
  309. "", "", ""
  310. );
  311. likeArea.init(
  312. "refund_province", "refund_city", "refund_district", "refund_province_id", "refund_city_id", "refund_district_id",
  313. "", "", ""
  314. );
  315. // txMap.init("", "");
  316. customTxMap.initMap('map-container');
  317. //搜索地图
  318. $("#search_map").click(function () {
  319. var province = $("#province");
  320. var city = $("#city");
  321. var district = $("#district");
  322. var address = $("input[name='address']").val();
  323. if(!province.val()){
  324. layer.msg("请选择省份");
  325. return;
  326. }
  327. if(!city.val()){
  328. layer.msg("请选择市");
  329. return;
  330. }
  331. if(!district.val()){
  332. layer.msg("请选择镇/区");
  333. return;
  334. }
  335. var intactAddress = province.find("option:selected").text() + city.find("option:selected").text() + district.find("option:selected").text() + address;
  336. customTxMap.searchMap(intactAddress);
  337. })
  338. })
  339. </script>