人人商城

create-post.html 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. {template 'common/header'}
  2. <link rel="stylesheet" href="./resource/css/wxapp-icon.css">
  3. <div id="js-wxapp-create" ng-controller="MainCtrl" ng-cloak>
  4. <div class="container">
  5. <div class="caret-wxapp">
  6. <form action="" method="post">
  7. <input type="hidden" name="wxappval" value="{{submit}}">
  8. </form>
  9. <div class="panel panel-app">
  10. <div class="panel-heading">
  11. <ol class="breadcrumb we7-breadcrumb">
  12. <a href="javascript:;" onclick="history.go(-1)" class="go-back">
  13. <i class="wi wi-back-circle"></i></a>
  14. <span class="font-lg">新建小程序</span>
  15. </ol>
  16. </div>
  17. <div class="panel-body">
  18. <ul class="nav nav-wxapp" role="tablist">
  19. <li ng-class="{'active ban' : createStep == 1, 'finished ready' : createStep > 1}">
  20. <a href="javascript:void(0);">
  21. <i class="num">1</i>
  22. <div class="wxapp-step-name">
  23. <img src="./resource/images/creat-step-1.png"/>
  24. <p>选择应用</p>
  25. </div>
  26. </a>
  27. </li>
  28. <li ng-class="{'active ban' : createStep == 2, 'finished ready' : createStep > 2}">
  29. <a href="javascript:void(0);">
  30. <i class="num">2</i>
  31. <div class="wxapp-step-name">
  32. <img src="./resource/images/creat-step-2.png"/>
  33. <p>首页设计</p>
  34. </div>
  35. </a>
  36. </li>
  37. <li ng-class="{'active ban' : createStep == 3, 'finished ready' : createStep > 3}">
  38. <a href="javascript:void(0);">
  39. <i class="num">3</i>
  40. <div class="wxapp-step-name">
  41. <img src="./resource/images/creat-step-3.png"/>
  42. <p>底部导航</p>
  43. </div>
  44. </a>
  45. </li>
  46. <li ng-class="{'active ban' : createStep == 4, 'finished ready' : createStep > 4}">
  47. <a href="javascript:void(0);">
  48. <i class="num">4</i>
  49. <div class="wxapp-step-name">
  50. <img src="./resource/images/creat-step-4.png"/>
  51. <p>打包完成</p>
  52. </div>
  53. </a>
  54. </li>
  55. </ul>
  56. <div class="wxapp-content tab-content">
  57. <div id="select" ng-show="createStep == 1">
  58. <div class="form-defalut we7-form">
  59. <div class="form-group">
  60. <label for="" class="control-label col-sm-2">小程序名称</label>
  61. <div class="form-controls col-sm-10">
  62. <input type="text" name="name" value="{$wxapp_info['name']}" class="form-control wxapp-name" id="" placeholder="小程序名称">
  63. </div>
  64. </div>
  65. {if empty($wxapp_info)}
  66. <div class="form-group">
  67. <label for="" class="control-label col-sm-2">小程序账号</label>
  68. <div class="form-controls col-sm-10">
  69. <input type="text" name="account" value="" class="form-control wxapp-name" id="" placeholder="小程序账号">
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <label for="" class="control-label col-sm-2">原始ID</label>
  74. <div class="form-controls col-sm-10">
  75. <input type="text" name="original" value="" class="form-control wxapp-name" id="" placeholder="原始ID">
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label for="" class="control-label col-sm-2">AppId</label>
  80. <div class="form-controls col-sm-10">
  81. <input type="text" name="key" value="" class="form-control wxapp-name" id="" placeholder="AppId">
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <label for="" class="control-label col-sm-2">AppSecret</label>
  86. <div class="form-controls col-sm-10">
  87. <input type="text" name="secret" value="" class="form-control wxapp-name" id="" placeholder="AppSecret">
  88. </div>
  89. </div>
  90. {/if}
  91. <div class="form-group">
  92. <label class="control-label col-sm-2">版本号</label>
  93. <div class="form-controls col-sm-1">
  94. <input type="number" name="version0" min="0" max="100" value="{$version_nums[0]}" {if !empty($version_nums)}disabled{/if} class="form-control wxapp-version version0">
  95. </div>
  96. <div class="form-controls pull-left">
  97. <p class="form-control-static wxapp-version">.</p>
  98. </div>
  99. <div class="form-controls col-sm-1">
  100. <input type="number" name="version1" min="0" max="100" value="{$version_nums[1]}" {if !empty($version_nums)}disabled{/if} class="form-control wxapp-version version1">
  101. </div>
  102. <div class="form-controls pull-left">
  103. <p class="form-control-static wxapp-version">.</p>
  104. </div>
  105. <div class="form-controls col-sm-1">
  106. <input type="number" name="version2" min="0" max="100" value="{$version_nums[2]}" {if !empty($version_nums)}disabled{/if} class="form-control wxapp-version version2">
  107. </div>
  108. </div>
  109. <div class="form-group">
  110. <input type="hidden" name="modules" value="">
  111. <label class="control-label col-sm-2">添加应用</label>
  112. <div class="form-controls col-sm-10">
  113. <ul class="app-list">
  114. <div we7-select-more></div>
  115. </ul>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="wxapp-modules">
  121. <div id="modules-Modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
  122. <div class="modal-dialog modal-dialog-default modal-lg">
  123. <div class="modal-content">
  124. <div class="modal-header">
  125. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  126. <h3>
  127. <ul role="tablist" class="nav nav-pills" style="font-size:14px; margin-top:-20px;">
  128. <li role="presentation" class="basic">
  129. <a data-toggle="tab" data-type="basic" role="tab" aria-controls="baisc" href="#basic">选择需要打包的应用</a>
  130. </li>
  131. </ul>
  132. </h3>
  133. </div>
  134. <div class="modal-body modules-content">
  135. <div class="tab-content">
  136. <ul class="app-allow-list">
  137. </ul>
  138. </div>
  139. </div>
  140. <div class="modal-footer">
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <div id="home" ng-show="createStep == 2">
  147. <div class="creat-wxapp-type" ng-show="type == 0">
  148. <input type="hidden" name="type" value="">
  149. <div class="type-heading">
  150. 选择设计类型
  151. </div>
  152. <ul class="type-list">
  153. <li class="ban">
  154. <i class="wi wi-select-diy"></i>
  155. <p>DIY设计</p>
  156. </li>
  157. <li ng-click="selectType(2)">
  158. <i class="wi wi-select-tem"></i>
  159. <p>选择模板</p>
  160. </li>
  161. <li ng-click="selectType(3)">
  162. <i class="wi wi-select-app"></i>
  163. <p>直接跳转应用</p>
  164. </li>
  165. </ul>
  166. </div>
  167. <div ng-if="type == 2">
  168. <div class="wxapp-type-cut">
  169. <div class="dropdown dropdown-toggle">
  170. <a id="dLabel" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  171. 选择模板
  172. <span class="caret"></a>
  173. </a>
  174. <ul class="dropdown-menu" aria-labelledby="dLabel">
  175. <li><a href="" class="active">DIY设计</a></li>
  176. <li ng-click="selectType(2)"><a href="" class="active">选择模板</a></li>
  177. <li ng-click="selectType(3)"><a href="" class="active">直接跳转应用</a></li>
  178. </ul>
  179. </div>
  180. </div>
  181. <div class="wxapp-tem-preview">
  182. <div class="wxapp-phone">
  183. <img src="./resource/images/iphone6.png" alt="" class="wxapp-phone-bg" />
  184. <div class="wxapp-home-preview">
  185. <img src="./resource/images/wxapp-default-tpl1.jpg" />
  186. </div>
  187. </div>
  188. <div class="panel panel-app tem-detail">
  189. <div class="panel-heading">
  190. 模板功能
  191. </div>
  192. <div class="panel-body">
  193. <div class="tem-detail-heading">
  194. 本模板包含以下功能
  195. </div>
  196. <div class="tem-detail-content">
  197. <ul>
  198. <li>更换幻灯片</li>
  199. <li>更换顶部小图标</li>
  200. <li>上传推荐图文</li>
  201. </ul>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. <div class="creat-select-tem">
  207. <div class="select-tem-heading">
  208. 选择模板
  209. </div>
  210. <div class="select-tem-filter">
  211. <div class="form-group" style="display:none;">
  212. <select name="" class="select-we7">
  213. <option value="">全部分类</option>
  214. <option value="">分类1</option>
  215. <option value="">分类2</option>
  216. </select>
  217. </div>
  218. <div class="input-group" style="display:none;">
  219. <input type="text" name="" class="form-control" placeholder="输入模板名">
  220. <span class="input-group-addon"><i class="fa fa-search"></i></span>
  221. </div>
  222. </div>
  223. <div class="select-tem-list">
  224. <input type="hidden" name="template" value="">
  225. <ul>
  226. <li class="select-tem-item" ng-click="selectTpl()">
  227. <img src="./resource/images/wxapp-default-tpl0.jpg"/>
  228. <a href="javascript:;" class="cover-dark">
  229. <i class="fa fa-check cover-selected"></i>
  230. </a>
  231. </li>
  232. </ul>
  233. </div>
  234. </div>
  235. </div>
  236. <div class="form-group" ng-if="type == 3">
  237. <div class="wxapp-type-cut">
  238. <div class="dropdown dropdown-toggle">
  239. <a id="dLabel" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  240. 直接跳转应用
  241. <span class="caret"></a>
  242. </a>
  243. <ul class="dropdown-menu" aria-labelledby="dLabel">
  244. <li><a href="" class="active">DIY设计</a></li>
  245. <li ng-click="selectType(2)"><a href="" class="active">选择模板</a></li>
  246. <li ng-click="selectType(3)"><a href="" class="active">直接跳转应用</a></li>
  247. </ul>
  248. </div>
  249. </div>
  250. <input type="hidden" name="tomodule" value="">
  251. <ul class="app-allow-list" style="padding-top: 110px;">
  252. <li class="select to-module" ng-click="selectHomeModule(m)" ng-repeat="m in modules">
  253. <div class="app-info">
  254. <img ng-src="{{m.icon}}"/>
  255. <p ng-bind="m.title"></p>
  256. </div>
  257. <a href="javascript:;" class="cover-dark">
  258. <i class="fa fa-check cover-selected"></i>
  259. </a>
  260. </li>
  261. </ul>
  262. </div>
  263. </div>
  264. <div id="bottom" ng-show="createStep == 3">
  265. <div class="wxapp-tem-preview wxapp-buttom-preview">
  266. <div class="wxapp-phone">
  267. <img src="./resource/images/iphone6.png" alt="" class="wxapp-phone-bg" />
  268. <div class="wxapp-home-preview">
  269. <div class="buttom-list-preview" ng-style="{'background-color': bottom.bgcolor}">
  270. <ul ng-style="{'border-top': '1px solid'+bottom.boundary}">
  271. <li ng-repeat="menu in menus">
  272. <img ng-src="{{menu.defaultImage}}" class="buttom-preview-img"/>
  273. <p class="buttom-preview-title" ng-bind="menu.name" ng-style="{'font-size':'12px', 'color': bottom.color}"></p>
  274. </li>
  275. </ul>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. <div class="creat-buttom">
  281. <div class="buttom-heading">
  282. 底部菜单
  283. </div>
  284. <div class="creat-buttom-select form-defalut">
  285. <div class="form-group">
  286. <label for="" class="control-label col-sm-3">是否显示</label>
  287. <div class="form-controls col-sm-9">
  288. <label><input name="" id="" class="form-control" type="checkbox" style="display: none;">
  289. <div class="switch" ng-class="{'switchOn': ifShowMenu}" ng-click="showMenu()"></div>
  290. </label>
  291. </div>
  292. </div>
  293. <div class="form-group buttom-bg-color">
  294. <label for="" class="control-label col-sm-3">背景颜色</label>
  295. <div class="form-controls col-sm-4" >
  296. <div we7-colorpicker we7-my-color="bottom.bgcolor" we7-my-default-color="bottom.bgcolor"></div>
  297. </div>
  298. </div>
  299. <div class="form-group buttom-boundary-color">
  300. <label for="" class="control-label col-sm-3">交界线颜色</label>
  301. <div class="form-controls col-sm-4" >
  302. <div we7-colorpicker we7-my-color="bottom.boundary" we7-my-default-color="bottom.boundary"></div>
  303. </div>
  304. </div>
  305. <div class="form-group buttom-bg-color">
  306. <label for="" class="control-label col-sm-3">文字默认颜色</label>
  307. <div class="form-controls col-sm-4" >
  308. <div we7-colorpicker we7-my-color="bottom.color" we7-my-default-color="bottom.color"></div>
  309. </div>
  310. </div>
  311. <div class="form-group buttom-bg-color">
  312. <label for="" class="control-label col-sm-3">文字选中颜色</label>
  313. <div class="form-controls col-sm-4" >
  314. <div we7-colorpicker we7-my-color="bottom.selectedColor" we7-my-default-color="bottom.selectedColor"></div>
  315. </div>
  316. </div>
  317. <!-- <td>
  318. <div class="buttom-default-color">
  319. <div we7-colorpicker we7-my-color="menu.defaultColor" we7-my-default-color="menu.defaultColor"></div>
  320. </div>
  321. </td>
  322. <td>
  323. <div class="buttom-default-color">
  324. <div we7-colorpicker we7-my-color="menu.selectedColor" we7-my-default-color="menu.selectedColor"></div>
  325. </div>
  326. </td> -->
  327. </div>
  328. <div class="buttom-list">
  329. <table class="table we7-table buttom-list-table vertical-middle">
  330. <col width="70" />
  331. <col width="70" />
  332. <col width="100" />
  333. <col width="120" />
  334. <col width="70" />
  335. <tr>
  336. <th>默认</th>
  337. <th>选中</th>
  338. <th>菜单名称</th>
  339. <th>跳转到</th>
  340. <th>操作</th>
  341. </tr>
  342. <tr ng-repeat="menu in menus" class="we7-form">
  343. <td>
  344. <div class="nav-img-box">
  345. <img ng-src="{{menu.defaultImage}}" >
  346. <div ng-click="addDefaultImg($index)" class="select">选择</div>
  347. </div>
  348. </td>
  349. <td>
  350. <div class="nav-img-box">
  351. <img ng-src="{{menu.selectedImage}}">
  352. <div ng-click="addSelectedImg($index)" class="select">选择</div>
  353. </div>
  354. </td>
  355. <td>
  356. <input type="text" name="menuname" ng-model="menu.name" class="form-control" />
  357. </td>
  358. <td>
  359. <select class="form-control" id="lineheight" ng-model="menu.module" ng-options="menu.title group by menu.module.title for menu in show_url">
  360. </select>
  361. </td>
  362. <td>
  363. <a href="javascript:;" class="buttom-del" ng-click="delMenu($index)"><i class="fa fa-times-circle"></i></a>
  364. </td>
  365. </tr>
  366. <tr class="buttom-more">
  367. <td colspan="5"><a href="javascript:;" class="buttom-add" ng-click="addMenu()">+</a></td>
  368. </tr>
  369. </table>
  370. </div>
  371. </div>
  372. </div>
  373. <div id="finish" ng-show="createStep == 4">
  374. <div class="form we7-form wxapp-finish">
  375. <div class="form-group">
  376. <label for="" class="control-label col-sm-2">小程序名称</label>
  377. <div class="form-controls col-sm-10">
  378. <p class="form-control-static" ng-bind="submit.name"></p>
  379. </div>
  380. </div>
  381. <div class="form-group">
  382. <label class="control-label col-sm-2">版本号</label>
  383. <div class="form-controls col-sm-10">
  384. <p class="form-control-static">V {{submit.version0}}.{{submit.version1}}.{{submit.version2}}</p>
  385. </div>
  386. </div>
  387. <div class="form-group">
  388. <label class="control-label col-sm-2">打包应用</label>
  389. <div class="form-controls col-sm-10">
  390. <ul class="app-list">
  391. <li class="select" ng-repeat="m in submit.modules">
  392. <div class="app-info">
  393. <img ng-src="{{m.icon}}" />
  394. <p>{{m.title}}</p>
  395. </div>
  396. </li>
  397. </ul>
  398. </div>
  399. </div>
  400. <div class="form-group" ng-if="type == 2">
  401. <label class="control-label col-sm-2">首页模板</label>
  402. <div class="form-controls col-sm-10">
  403. <p class="form-control-static" ng-bind="submit.template"></p>
  404. </div>
  405. </div>
  406. <div class="form-group" ng-if="type == 3">
  407. <label class="control-label col-sm-2">首页跳转应用</label>
  408. <div class="form-controls col-sm-10">
  409. <p class="form-control-static" ng-bind="submit.tomodule.title"></p>
  410. </div>
  411. </div>
  412. <div class="form-group">
  413. <label class="control-label col-sm-2">底部菜单</label>
  414. <div class="form-controls col-sm-10">
  415. <table class="table-finish-buttom">
  416. <col width="75px"/>
  417. <col width="105"/>
  418. <col />
  419. <tr>
  420. <td>菜单图标</td>
  421. <td>菜单名字</td>
  422. <td>菜单链接模块</td>
  423. </tr>
  424. <tr ng-repeat="menu in submit.menus">
  425. <td>
  426. <img ng-src="{{menu.defaultImage}}" alt="" width="48px" height="48px"/>
  427. </td>
  428. <td ng-bind="menu.name"></td>
  429. <td ng-bind="menu.module.title"></td>
  430. </tr>
  431. </table>
  432. </div>
  433. </div>
  434. </div>
  435. </div>
  436. </div>
  437. </div>
  438. </div>
  439. </div>
  440. </div>
  441. <nav class="navbar navbar-wxapp-bottom navbar-fixed-bottom" role="navigation">
  442. <div class="container">
  443. <div class="pager">
  444. <a type="button" class="btn btn-primary" ng-show="createStep != 1" ng-click="prevStep()">上一步</a>
  445. <a type="button" class="btn btn-primary" ng-show="createStep != 4" ng-click="nextStep()">下一步</a>
  446. <a type="button" class="btn btn-danger" ng-show="createStep == 4" ng-click="package()">生成版本打包下载</a>
  447. <!-- <a type="button" class="btn btn-default" ng-show="createStep == 4">首页预览</a> -->
  448. </div>
  449. </div>
  450. </nav>
  451. </div>
  452. <script>
  453. require(['fileUploader','underscore'], function(uploader){
  454. angular.module('wxApp').value('config', {
  455. 'uniacid' : "{$uniacid}",
  456. 'getlink_url' : "{php echo url('wxapp/post/getlink')}"
  457. });
  458. angular.bootstrap($('#js-wxapp-create'), ['wxApp']);
  459. });
  460. var modulesVal = [];
  461. var selectModule = function(module, title, icon, showurl, version){
  462. var html = '<li class="select">'+
  463. ' <div class="app-info">'+
  464. ' <img src="'+icon+'" />'+
  465. ' <p>'+title+'</p>'+
  466. ' </div>'+
  467. ' <div class="cover-dark">'+
  468. ' <a href="javascript:;" class="cover-delect" onclick="delModule(\''+module+'\', this);"><i class="fa fa-minus-circle"></i>删除</a>'+
  469. ' </div>'+
  470. ' </li>';
  471. $('#select .app-list').prepend(html);
  472. modulesVal.push({
  473. title: title,
  474. module: module,
  475. icon: icon,
  476. url: showurl,
  477. version: version
  478. });
  479. $(':hidden[name="modules"]').val(modulesVal);
  480. $('#modules-Modal').modal('hide');
  481. };
  482. var delModule = function(module, t) {
  483. if(!_.isEmpty(modulesVal)) {
  484. angular.forEach(modulesVal, function(val, key){
  485. if(val.module == module) {
  486. modulesVal = _.without(modulesVal, modulesVal[key]);
  487. }
  488. });
  489. $(':hidden[name="modules"]').val(modulesVal);
  490. $(t).parent().parent().remove();
  491. }
  492. };
  493. </script>
  494. </html>