人人商城

selecturl.html 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <div class="modal-dialog">
  2. <style>
  3. #selectUrl .modal-body {padding: 10px 15px;}
  4. #selectUrl .tab-pane {margin-top: 5px; min-height: 400px; max-height: 400px; overflow-y: auto;}
  5. #selectUrl .page-head {padding: 9px 0; margin-bottom: 8px;}
  6. #selectUrl .page-head h4 {margin: 0;}
  7. #selectUrl .btn {margin-bottom: 3px;}
  8. #selectUrl .modal-dialog {width: 930px;}
  9. #selectUrl .line {border-bottom: 1px dashed #ddd; color: #999; height: 36px; line-height: 36px;}
  10. #selectUrl .line .icon {height: 35px; width: 30px; position: relative; float: left;}
  11. #selectUrl .line .icon.icon-1:before {content: ""; width: 10px; height: 10px; border: 1px dashed #ccc; position: absolute; top: 12px; left: 10px;}
  12. #selectUrl .line .icon.icon-2 {width: 50px;}
  13. #selectUrl .line .icon.icon-2:before {content: ""; width: 10px; height: 10px; border-left: 1px dashed #ccc; border-bottom: 1px dashed #ccc; position: absolute; top: 12px; left: 20px;}
  14. #selectUrl .line .icon.icon-3 {width: 60px;}
  15. #selectUrl .line .icon.icon-3:before {content: ""; width: 10px; height: 10px; border-left: 1px dashed #ccc; border-bottom: 1px dashed #ccc; position: absolute; top: 12px; left: 30px;}
  16. #selectUrl .line .btn-sm {float: right; margin-top: 5px; margin-right: 5px; height: 24px; line-height: 24px; padding: 0 10px;}
  17. #selectUrl .line .text {display: block;}
  18. #selectUrl .line .label-sm {padding: 2px 5px;}
  19. #selectUrl .line.good {height: 60px; padding: 4px 0;}
  20. #selectUrl .line.good .image {height: 50px; width: 50px; border: 1px solid #ccc; float: left;}
  21. #selectUrl .line.good .image img {height: 100%; width: 100%;}
  22. #selectUrl .line.good .text {padding-left: 60px; height: 52px;}
  23. #selectUrl .line.good .text p {padding: 0; margin: 0;}
  24. #selectUrl .line.good .text .name {font-size: 15px; line-height: 32px; height: 28px;}
  25. #selectUrl .line.good .text .price {font-size: 12px; line-height: 18px; height: 18px;}
  26. #selectUrl .line.good .btn-sm {height: 32px; padding: 5px 10px; line-height: 22px; margin-top: 9px;}
  27. #selectUrl .tip {line-height: 250px; text-align: center;}
  28. #selectUrl .nav-tabs > li > a {padding: 8px 20px;}
  29. </style>
  30. <div class="modal-content">
  31. <div class="modal-header">
  32. <button data-dismiss="modal" class="close" type="button">×</button>
  33. <h4 class="modal-title">{if $type == 'topmenu_data'}选择数据{else}选择链接{/if}</h4>
  34. </div>
  35. <div class="modal-body">
  36. <ul class="nav nav-tabs" id="selectUrlTab">
  37. {if ($type != 'topmenu' && $type != 'topmenu_data') || $platform == 'wxapp'}
  38. <li class="active"><a href="#sut_shop">商城</a></li>
  39. {/if}
  40. {if $platform!='wxapp_tabbar' && $type != 'topmenu' && $type != 'topmenu_data'}
  41. <li class=""><a href="#sut_good">商品</a></li>
  42. {if $syscate['level']!=-1 && !empty($categorys)}
  43. <li class=""><a href="#sut_cate">商品分类</a></li>
  44. {/if}
  45. {/if}
  46. {if $platform=='wxapp' && $type != 'topmenu' && $type != 'topmenu_data'}
  47. <li class=""><a href="#sut_quick">快速购买</a></li>
  48. {/if}
  49. {if $platform=='wxapp' && $type != 'topmenu' && $type != 'topmenu_data'}
  50. {if $type == 'menu' || $type == 'listmenu' || $type == 'picture' || $type == 'picturew' || $type == 'menu2'}
  51. <li class=""><a href="#sut_diymobile">电话</a></li>
  52. {/if}
  53. {if $type == 'menu' || $type == 'listmenu' || $type == 'picture' || $type == 'picturew' || $type == 'banner'}
  54. <li class=""><a href="#sut_diyxcx">小程序</a></li>
  55. {/if}
  56. {/if}
  57. {if p('article') && !$platform && $type != 'topmenu' && $type != 'topmenu_data'}
  58. <li class=""><a href="#sut_article">{php echo m('plugin')->getName('article')}</a></li>
  59. {/if}
  60. {if com('coupon') && !$platform && $type != 'topmenu' && $type != 'topmenu_data'}
  61. <li class=""><a href="#sut_coupon">{php echo m('plugin')->getComName('coupon')}</a></li>
  62. {/if}
  63. {if p('diypage') && !$platform && $type != 'topmenu_data'}
  64. <li class=""><a href="#sut_diypage">{php echo m('plugin')->getName('diypage')}</a></li>
  65. {/if}
  66. {if p('groups') && !$platform && $type != 'topmenu' && $type != 'topmenu_data'}
  67. <li class=""><a href="#sut_groups">{php echo m('plugin')->getName('groups')}</a></li>
  68. {/if}
  69. {if p('sns') && !$platform && $type != 'topmenu' && $type != 'topmenu_data'}
  70. <li class=""><a href="#sut_sns">{php echo m('plugin')->getName('sns')}</a></li>
  71. {/if}
  72. {if p('creditshop') && !$platform && $type != 'topmenu' && $type != 'topmenu_data'}
  73. <li class=""><a href="#sut_creditshop">{php echo m('plugin')->getName('creditshop')}</a></li>
  74. {/if}
  75. {if p('quick') && !$platform && $type != 'topmenu' && $type != 'topmenu_data'}
  76. <li class=""><a href="#sut_quick">{php echo m('plugin')->getName('quick')}</a></li>
  77. {/if}
  78. {if $type == 'topmenu_data'}
  79. <li class="active"><a href="#sut_goods_data" class="sut_goods_data">商品</a></li>
  80. <li class=""><a href="#sut_shop_data" class="sut_shop_data">门店</a></li>
  81. {/if}
  82. </ul>
  83. <div class="tab-content ">
  84. {if ($type != 'topmenu' && $type != 'topmenu_data') || $platform == 'wxapp'}
  85. <div class="tab-pane active" id="sut_shop">
  86. {if $platform}
  87. <div class="alert alert-primary" style="margin-bottom: 0;">
  88. <p>如果底部菜单中已经选择该链接,页面中选择后点击无效</p>
  89. {if $platform=='wxapp_tabbar'}
  90. <p>底部菜单只可选择部分页面地址</p>
  91. {/if}
  92. {if $type == 'topmenu'}
  93. <p>不可选择已有顶部菜单的自定义页面</p>
  94. {/if}
  95. </div>
  96. {/if}
  97. {if $type == 'topmenu'}
  98. {loop $allUrls $item}
  99. {if $item['name'] == '自定义页面'}
  100. <div class="page-head"><h4><i class="fa fa-folder-open-o"></i> {$item['name']}</h4></div>
  101. {loop $item['list'] $child}
  102. <nav data-href="{php echo $platform?$child['url_wxapp']:$child['url']}" class="btn btn-default btn-sm" title="{$child['name']}">{$child['name']}</nav>
  103. {/loop}
  104. {/if}
  105. {/loop}
  106. {else}
  107. {loop $allUrls $item}
  108. <div class="page-head"><h4><i class="fa fa-folder-open-o"></i> {$item['name']}</h4></div>
  109. {loop $item['list'] $child}
  110. <nav data-href="{php echo $platform?$child['url_wxapp']:$child['url']}" class="btn btn-default btn-sm" title="{$child['name']}">{$child['name']}</nav>
  111. {/loop}
  112. {/loop}
  113. {/if}
  114. </div>
  115. {/if}
  116. {if $type != 'topmenu' && $type != 'topmenu_data'}
  117. <div class="tab-pane" id="sut_good">
  118. <div class="input-group">
  119. <input type="text" placeholder="请输入商品名称进行搜索" id="select-good-kw" value="" class="form-control">
  120. <span class="input-group-addon btn btn-default select-btn" data-type="good">搜索</span>
  121. </div>
  122. <div id="select-good-list"></div>
  123. </div>
  124. {/if}
  125. {if $type != 'topmenu' && $type != 'topmenu_data'}
  126. <div class="tab-pane" id="sut_cate">
  127. {loop $categorys $category}
  128. {if empty($category['parentid'])}
  129. <div class="line">
  130. <div class="icon icon-1"></div>
  131. <nav title="选择" class="btn btn-default btn-sm" data-href="{if $platform}/pages/goods/index/index?cate={$category['id']}{else}{php echo mobileUrl('goods',array('cate'=>$category['id']), $full)}{/if}">选择</nav>
  132. <div class="text">{$category['name']}</div>
  133. </div>
  134. {loop $categorys $category2}
  135. {if $category2['parentid']==$category['id']}
  136. <div class="line">
  137. <div class="icon icon-2"></div>
  138. <nav title="选择" class="btn btn-default btn-sm" data-href="{if $platform}/pages/goods/index/index?cate={$category2['id']}{else}{php echo mobileUrl('goods',array('cate'=>$category2['id']), $full)}{/if}">选择</nav>
  139. <div class="text">{$category2['name']}</div>
  140. </div>
  141. {loop $categorys $category3}
  142. {if $category3['parentid']==$category2['id']}
  143. <div class="line">
  144. <div class="icon icon-3"></div>
  145. <nav title="选择" class="btn btn-default btn-sm" data-href="{if $platform}/pages/goods/index/index?cate={$category3['id']}{else}{php echo mobileUrl('goods',array('cate'=>$category3['id']), $full)}{/if}">选择</nav>
  146. <div class="text">{$category3['name']}</div>
  147. </div>
  148. {/if}
  149. {/loop}
  150. {/if}
  151. {/loop}
  152. {/if}
  153. {/loop}
  154. </div>
  155. {/if}
  156. {if $platform=='wxapp'}
  157. <div class="tab-pane" id="sut_diyurl" style="min-height: 100px;">
  158. <div class="row" style="margin: 100px 80px 80px;">
  159. <div class="input-group">
  160. <span class="input-group-addon">https://</span>
  161. <input type="text" placeholder="请输入已在小程序管理后台配置白名单的域名 例如:www.baidu.com" id="select-diyurl-kw" value="{$defaultUrl}" class="form-control">
  162. <span class="input-group-addon btn btn-primary select-btn" data-type="diyurl">确认使用</span>
  163. <nav id="select-diy-url"></nav>
  164. </div>
  165. <div class="help-block text-danger">注意:1. 目标链接域名需到<a href="https://mp.weixin.qq.com/" target="_blank" class="text-danger"><b>小程序管理后台</b></a>配置域名白名单 </div>
  166. <div class="help-block text-danger" style="padding-left: 37px;">2. 目标链接必须支持https,否则无法打开</div>
  167. <div class="help-block text-danger" style="padding-left: 37px;">3. 点击链接将跳出小程序与小程序无关</div>
  168. </div>
  169. </div>
  170. {if $type == 'menu' || $type == 'listmenu' || $type == 'picture' || $type == 'picturew' || $type == 'menu2'}
  171. <div class="tab-pane" id="sut_diymobile" style="min-height: 100px;">
  172. <div class="row" style="margin: 100px 80px 80px;">
  173. <div class="input-group">
  174. <span class="input-group-addon">电话</span>
  175. <input type="text" placeholder="请在此输入有效电话号码" id="select-diymobile-kw" value="" class="form-control">
  176. <span class="input-group-addon btn btn-primary select-btn" data-type="diymobile">确认使用</span>
  177. <nav id="select-diy-diymobile"></nav>
  178. </div>
  179. </div>
  180. </div>
  181. {/if}
  182. {if $type == 'menu' || $type == 'listmenu' || $type == 'picture' || $type == 'picturew' || $type == 'banner'}
  183. <div class="tab-pane" id="sut_diyxcx" style="min-height: 100px;">
  184. <div class="row" style="margin: 50px 80px 50px;">
  185. <div class="input-group">
  186. <span class="input-group-addon">APPID</span>
  187. <input type="text" placeholder="请在此输入APPID" id="select-diyxcx-kw" value="" class="form-control">
  188. <nav id="select-diy-diyxcxid"></nav>
  189. </div>
  190. <div class="help-block text-danger">注意:必须是同一个公众号下的小程序appid,否则无法跳转</div>
  191. </div>
  192. <div class="row" style="margin: 50px 80px 50px;">
  193. <div class="input-group">
  194. <span class="input-group-addon">小程序链接</span>
  195. <input type="text" placeholder="请在此输入小程序链接" id="select-diyxcxurl-kw" value="" class="form-control">
  196. <nav id="select-diy-diyxcxurl"></nav>
  197. </div>
  198. <div class="help-block text-danger">注意:小程序链接留空默认跳到小程序首页</div>
  199. </div>
  200. <div class="row" style="margin: 50px 80px 50px;text-align: center;">
  201. <span class="btn btn-primary select-btn" data-type="diyxcx" >确认使用</span>
  202. <nav id="select-diy-diyxcx"></nav>
  203. </div>
  204. </div>
  205. {/if}
  206. {/if}
  207. {if p('article') && $type != 'topmenu' && $type != 'topmenu_data'}
  208. <div class="tab-pane" id="sut_article">
  209. <div class="input-group">
  210. <input type="text" placeholder="请输入文章名称进行搜索" id="select-article-kw" value="" class="form-control">
  211. <span class="input-group-addon btn btn-default select-btn" data-type="article">搜索</span>
  212. </div>
  213. <div id="select-article-list"></div>
  214. </div>
  215. {/if}
  216. <div class="tab-pane" id="sut_coupon">
  217. <div class="input-group">
  218. <input type="text" placeholder="请输入优惠券名称进行搜索" id="select-coupon-kw" value="" class="form-control">
  219. <span class="input-group-addon btn btn-default select-btn" data-type="coupon">搜索</span>
  220. </div>
  221. <div id="select-coupon-list"></div>
  222. </div>
  223. {if p('diypage') && !$platform}
  224. <div class="tab-pane {if $type=='topmenu'}active{/if}" id="sut_diypage">
  225. {if !empty($diypage['list'])}
  226. {loop $diypage['list'] $item}
  227. {if $item['type']!=5 && $item['type']!=7}
  228. <div class="line">
  229. <nav title="选择" class="btn btn-default btn-sm" data-href="{php echo mobileUrl('diypage',array('id'=>$item['id']))}">选择</nav>
  230. <div class="text"><span class="label label-{$allpagetype[$item['type']]['class']} label-sm">{$allpagetype[$item['type']]['name']}</span> {$item['name']}</div>
  231. </div>
  232. {/if}
  233. {/loop}
  234. {else}
  235. <div class="tip">抱歉!未查询到DIY页面。</div>
  236. {/if}
  237. </div>
  238. {/if}
  239. {if p('groups') && $type != 'topmenu' && $type != 'topmenu_data'}
  240. <div class="tab-pane" id="sut_groups">
  241. <div class="input-group">
  242. <input type="text" placeholder="请输入商品名称进行搜索" id="select-groups-kw" value="" class="form-control">
  243. <span class="input-group-addon btn btn-default select-btn" data-type="groups">搜索</span>
  244. </div>
  245. <div id="select-groups-list"></div>
  246. </div>
  247. {/if}
  248. {if p('sns') && $type != 'topmenu' && $type != 'topmenu_data'}
  249. <div class="tab-pane" id="sut_sns">
  250. <div class="input-group">
  251. <input type="text" placeholder="请输入板块名称、帖子标题进行搜索" id="select-sns-kw" value="" class="form-control">
  252. <span class="input-group-addon btn btn-default select-btn" data-type="sns">搜索</span>
  253. </div>
  254. <div id="select-sns-list"></div>
  255. </div>
  256. {/if}
  257. {if p('groups') && $type != 'topmenu' && $type != 'topmenu_data'}
  258. <div class="tab-pane" id="sut_creditshop">
  259. <div class="input-group">
  260. <input type="text" placeholder="请输入商品名称进行搜索" id="select-creditshop-kw" value="" class="form-control">
  261. <span class="input-group-addon btn btn-default select-btn" data-type="creditshop">搜索</span>
  262. </div>
  263. <div id="select-creditshop-list"></div>
  264. </div>
  265. {/if}
  266. {if p('quick') && $type != 'topmenu' && $type != 'topmenu_data'}
  267. <div class="tab-pane" id="sut_quick">
  268. {if !empty($quickList)}
  269. {if $platform=='wxapp'}
  270. {loop $quickList $item}
  271. <div class="line">
  272. <nav title="选择" class="btn btn-default btn-sm" data-href="/pages/quickbuy/quickbuy/shop_index/shop_index?id={$item['id']}">选择</nav>
  273. <div class="text">{$item['title']}</div>
  274. </div>
  275. {/loop}
  276. {else}
  277. {loop $quickList $item}
  278. <div class="line">
  279. <nav title="选择" class="btn btn-default btn-sm" data-href="{php echo mobileUrl('quick',array('id'=>$item['id']))}">选择</nav>
  280. <div class="text">{if empty($item['status'])}<span class="label label-sm label-default">关闭状态</span> {/if}{$item['title']}</div>
  281. </div>
  282. {/loop}
  283. {/if}
  284. {else}
  285. <div class="tip">抱歉!未查询到快速购买页面。</div>
  286. {/if}
  287. </div>
  288. {/if}
  289. {if $type == 'topmenu_data'}
  290. <div class="tab-pane active" id="sut_goods_data">
  291. <ul class="nav nav-tabs">
  292. <li class="active"><a href="#goods_data_cate" class="goods_data_cate">分类</a></li>
  293. <li><a href="#goods_data_group" class="goods_data_group">分组</a></li>
  294. <li><a href="#goods_data_diy" class="goods_data_diy">自定义</a></li>
  295. </ul>
  296. <div class="tab-content">
  297. <div class="tab-pane active" id="goods_data_cate" style="">
  298. {loop $categorys $category}
  299. {if empty($category['parentid'])}
  300. <div class="line">
  301. <div class="icon icon-1"></div>
  302. <nav title="选择" class="btn btn-default btn-sm" data-type="{$type}" data-condition="{$category['id']}" data-tab="category">选择</nav>
  303. <div class="text">{$category['name']}</div>
  304. </div>
  305. {loop $categorys $category2}
  306. {if $category2['parentid']==$category['id']}
  307. <div class="line">
  308. <div class="icon icon-2"></div>
  309. <nav title="选择" class="btn btn-default btn-sm" data-type="{$type}" data-condition="{$category2['id']}" data-tab="category">选择</nav>
  310. <div class="text">{$category2['name']}</div>
  311. </div>
  312. {loop $categorys $category3}
  313. {if $category3['parentid']==$category2['id']}
  314. <div class="line">
  315. <div class="icon icon-3"></div>
  316. <nav title="选择" class="btn btn-default btn-sm" data-type="{$type}" data-condition="{$category3['id']}" data-tab="category">选择</nav>
  317. <div class="text">{$category3['name']}</div>
  318. </div>
  319. {/if}
  320. {/loop}
  321. {/if}
  322. {/loop}
  323. {/if}
  324. {/loop}
  325. </div>
  326. <div class="tab-pane" id="goods_data_group" style="">
  327. {if !empty($groups)}
  328. {loop $groups $group}
  329. <div class="line">
  330. <div class="icon icon-1"></div>
  331. <nav title="选择" class="btn btn-default btn-sm" data-type="{$type}" data-condition="{$group['id']}" data-tab="groups">选择</nav>
  332. <div class="text">{$group['name']}</div>
  333. </div>
  334. {/loop}
  335. {else}
  336. <div class="tip">抱歉!未查询到商品分组。</div>
  337. {/if}
  338. </div>
  339. <div class="tab-pane" id="goods_data_diy" style="">
  340. <!--<div class="input-group">-->
  341. <!--<input type="text" placeholder="请输入商品名称进行搜索" id="select-goods_data_diy-kw" value="" class="form-control">-->
  342. <!--<span class="input-group-addon btn btn-default select-btn" data-type="goods_data_diy">搜索</span>-->
  343. <!--</div>-->
  344. <!--<div id="select-goods_data_diy-list"></div>-->
  345. <div class="form-group" style="margin-top: 15px;">
  346. <label class="col-lg control-label">选择商品</label>
  347. <div class="col-sm-9" >
  348. <div class="form-group" style="height: auto; display: block;">
  349. <div class="col-sm-12 col-xs-12">
  350. {ife 'goods' $item}
  351. <div class="input-group">
  352. <input type="text" id="goodsid_text" name="goodsid_text" value="" class="form-control text" readonly="">
  353. <div class="input-group-btn">
  354. <button class="btn btn-primary select_goods" type="button">选择商品</button>
  355. </div>
  356. </div>
  357. <div class="input-group multi-img-details container ui-sortable goods_show">
  358. {if !empty($goods)}
  359. {loop $goods $g}
  360. <div class="multi-item" data-id="{$g['id']}" data-name="goodsid" id="{$g['id']}">
  361. <img class="img-responsive img-thumbnail" src="{php echo tomedia($g['thumb'])}" onerror="this.src='../addons/ewei_shopv2/static/images/nopic.png'" style="width:100px;height:100px;">
  362. <div class="img-nickname">{$g['title']}</div>
  363. <input type="hidden" value="{$g['id']}" name="goodsids[]">
  364. <em onclick="remove({$g['id']})" class="close">×</em>
  365. <div style="clear:both;"></div>
  366. </div>
  367. {/loop}
  368. {/if}
  369. </div>
  370. <script>
  371. $(function(){
  372. var title = '';
  373. $('.img-nickname').each(function(){
  374. title += $(this).html()+';';
  375. });
  376. $('#goodsid_text').val(title);
  377. })
  378. myrequire(['web/goods_selector'],function (Gselector) {
  379. $('.select_goods').click(function () {
  380. var ids = select_goods_ids();
  381. Gselector.open('goods_show','',0,true,'',ids);
  382. });
  383. })
  384. function goods_show(data) {
  385. if(data.act == 1){
  386. var html = '<div class="multi-item" data-id="'+data.id+'" data-name="goodsid" id="'+data.id+'">'
  387. +'<img class="img-responsive img-thumbnail" src="'+data.thumb+'" onerror="this.src=\'../addons/ewei_shopv2/static/images/nopic.png\'" style="width:100px;height:100px;">'
  388. +'<div class="img-nickname">'+data.title+'</div>'
  389. +'<input type="hidden" value="'+data.id+'" name="goodsids[]">'
  390. +'<em onclick="removeHtml('+data.id+')" class="close">×</em>'
  391. +'</div>';
  392. $('.goods_show').append(html);
  393. var title = '';
  394. $('.img-nickname').each(function(){
  395. title += $(this).html()+';';
  396. });
  397. $('#goodsid_text').val(title);
  398. }else if(data.act == 0){
  399. remove(data.id);
  400. }
  401. }
  402. function remove(id){
  403. $("[id='"+id+"']").remove();
  404. var title = '';
  405. $('.img-nickname').each(function(){
  406. title += $(this).html()+';';
  407. });
  408. $('#goodsid_text').val(title);
  409. }
  410. function select_goods_ids(){
  411. var goodsids = [];
  412. $(".multi-item").each(function(){
  413. goodsids.push($(this).attr('data-id'));
  414. });
  415. return goodsids;
  416. }
  417. </script>
  418. {else}
  419. <div class="input-group multi-img-details container ui-sortable">
  420. {loop $goods $item}
  421. <div data-name="goodsid" data-id="426" class="multi-item">
  422. <img src="{php echo tomedia($item['thumb'])}" class="img-responsive img-thumbnail">
  423. <div class="img-nickname">{$item['title']}</div>
  424. </div>
  425. {/loop}
  426. </div>
  427. {/if}
  428. </div>
  429. </div>
  430. </div>
  431. </div>
  432. <!--<div class="form-group">-->
  433. <!--<nav title="选择" style="width: 82px;height: 30px;" class="btn btn-default btn-sm" data-type="{$type}" data-condition="" data-tab="goodsids">选择</nav>-->
  434. <!--</div>-->
  435. </div>
  436. </div>
  437. </div>
  438. <div class="tab-pane" id="sut_shop_data">
  439. {if !empty($storeList)}
  440. {loop $storeList $store}
  441. <div class="line">
  442. <div class="icon icon-1"></div>
  443. <div title="选择" style="float: right;margin-right: 16px" class="" data-type="{$type}" data-condition="{$store['id']}" data-tab="stores">
  444. <input type="checkbox" name="" data-id="{$store['id']}" data-name="stores" value="{$store['id']}">
  445. </div>
  446. <div class="text">{$store['storename']}</div>
  447. </div>
  448. {/loop}
  449. {else}
  450. <div class="tip">抱歉!未查询到门店。</div>
  451. {/if}
  452. <!--<div class="line" style="border: none;">-->
  453. <!--<nav title="选择" style=" width: 82px;height: 30px;line-height: 27px;margin-top: 22px;" class="btn btn-default btn-sm" data-type="{$type}" data-condition="" data-tab="stores">确定</nav>-->
  454. <!--</div>-->
  455. </div>
  456. {/if}
  457. </div>
  458. </div>
  459. <div class="modal-footer">
  460. <button data-dismiss="modal" class="btn btn-default" type="button">关闭</button>
  461. {if $type == 'topmenu_data'}
  462. <nav title="确定" style="width: 82px;height: 30px;display:none;" class="btn btn-primary btn-sm select_goods_diy" data-type="{$type}" data-condition="" data-tab="goodsids">确定</nav>
  463. <nav title="选择" style=" width: 82px;height: 30px;display:none;" class="btn btn-primary btn-sm select_shop_data" data-type="{$type}" data-condition="" data-tab="stores">确定</nav>
  464. {/if}
  465. </div>
  466. <script>
  467. $(function(){
  468. $("#selectUrl").find('.nav-tabs a').click(function(e) {
  469. $('#tab').val($(this).attr('href'));
  470. e.preventDefault();
  471. $(this).tab('show');
  472. });
  473. $(".select-btn").click(function(){
  474. var type = $(this).data("type");
  475. var kw = $.trim($("#select-"+type+"-kw").val());
  476. if(type=='diyurl'){
  477. if(!kw || kw==''){
  478. tip.msgbox.err("请输入第三方链接!");
  479. return;
  480. }
  481. kw = kw.replace('http://', '');
  482. kw = kw.replace('https://', '');
  483. $('#select-diy-url').data('href', '/pages/web/index?url=' + encodeURIComponent('https://' + kw)).trigger('click');
  484. return;
  485. }
  486. if(type=='diymobile'){
  487. if(!kw || kw==''){
  488. tip.msgbox.err("请输入电话!");
  489. return;
  490. }
  491. $('#select-diy-diymobile').data('href','tel:'+kw).trigger('click');
  492. return;
  493. }
  494. if(type=='diyxcx'){
  495. if(!kw || kw==''){
  496. tip.msgbox.err("请输入小程序APPID!");
  497. return;
  498. }
  499. if($("#select-diyxcxurl-kw").val() != ''){
  500. $('#select-diy-diyxcx').data('href', 'appid:'+kw+',appurl:'+$("#select-diyxcxurl-kw").val()).trigger('click');
  501. }else{
  502. $('#select-diy-diyxcx').data('href', 'appid:'+kw).trigger('click');
  503. }
  504. return;
  505. }
  506. if(type == 'goods_data_diy' && kw == ''){
  507. kw = 'all';
  508. }
  509. if(!kw || kw==''){
  510. tip.msgbox.err("请输入搜索关键字!");
  511. return;
  512. }
  513. $("#select-"+type+"-list").html('<div class="tip">正在进行搜索...</div>');
  514. $.ajax("{php echo webUrl('util/selecturl/query', array('full'=>$full, 'platform'=>$platform))}", {
  515. type: "get",
  516. dataType: "html",
  517. cache: false,
  518. data: {kw:kw, type:type}
  519. }).done(function (html) {
  520. $("#select-"+type+"-list").html(html);
  521. });
  522. });
  523. $('.goods_data_diy').click(function(){
  524. $(".select_goods_diy").show();
  525. var kw = 'all';
  526. var type = 'goods_data_diy';
  527. $.ajax("{php echo webUrl('util/selecturl/query', array('full'=>$full, 'platform'=>$platform))}", {
  528. type: "get",
  529. dataType: "html",
  530. cache: false,
  531. data: {kw:kw, type:type}
  532. }).done(function (html) {
  533. $("#select-"+type+"-list").html(html);
  534. });
  535. });
  536. $('.sut_shop_data').click(function(){
  537. $(".select_shop_data").show();
  538. $(".select_goods_diy").hide();
  539. });
  540. $('.sut_goods_data').click(function(){
  541. $(".select_shop_data").hide();
  542. $(".select_goods_diy").hide();
  543. });
  544. $('.goods_data_cate').click(function(){
  545. $(".select_shop_data").hide();
  546. $(".select_goods_diy").hide();
  547. });
  548. $('.goods_data_group').click(function(){
  549. $(".select_shop_data").hide();
  550. $(".select_goods_diy").hide();
  551. });
  552. });
  553. </script>
  554. </div>
  555. </div>