post.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. {template 'common/header'}
  2. <div class="account-list-add-step" id="js-wxapp-create" ng-controller="MainCtrl" ng-cloak>
  3. <ol class="breadcrumb we7-breadcrumb">
  4. <a href="{php echo url ('account/manage')}"><i class="wi wi-back-circle"></i></a>
  5. <li><a href="{php echo url ('account/manage')}">平台列表</a></li>
  6. <li>新建小程序</li>
  7. </ol>
  8. <ul class="we7-step">
  9. <li class="new" ng-class="createStep == 1 ? 'active': ''"><span class="content">1. 设置小程序信息</span></li>
  10. <li class="new" ng-class="createStep == 3 ? 'active': ''" ng-if="create_type == 2"><span class="content">2. 设计首页</span> </li>
  11. <li class="new " ng-class="createStep == 4 ? 'active': ''"><span class="content">{{create_type == 2 ? 3 : 2}}. 生成版本</span> </li>
  12. </ul>
  13. <form method="post" ng-submit="package()">
  14. <input name="token" type="hidden" value="{$_W['token']}" />
  15. <div class="panel panel-app">
  16. <div class="panel-body">
  17. <div class="wxapp-content tab-content" style="width: 100%;">
  18. <div id="select" ng-show="createStep == 1">
  19. <div class="form-defalut we7-form">
  20. {if empty($uniacid)}
  21. <div class="form-group">
  22. <label for="" class="control-label col-sm-2">小程序名称</label>
  23. <div class="form-controls col-sm-10">
  24. <input type="text" name="name" ng-model="wxappinfo.name" class="form-control wxapp-name" placeholder="小程序名称">
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label for="" class="control-label col-sm-2">小程序描述</label>
  29. <div class="form-controls col-sm-10">
  30. <input type="text" name="description" ng-model="wxappinfo.description" class="form-control wxapp-name" placeholder="版本描述">
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <label for="" class="control-label col-sm-2">原始ID</label>
  35. <div class="form-controls col-sm-10">
  36. <input type="text" name="original" ng-model="wxappinfo.original" value="" class="form-control wxapp-name" placeholder="原始ID">
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label for="" class="control-label col-sm-2">AppId</label>
  41. <div class="form-controls col-sm-10">
  42. <input type="text" name="key" value="" ng-model="wxappinfo.appid" class="form-control wxapp-name" placeholder="AppId">
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label for="" class="control-label col-sm-2">AppSecret</label>
  47. <div class="form-controls col-sm-10">
  48. <input type="text" name="secret" value="" ng-model="wxappinfo.appsecret" class="form-control wxapp-name" placeholder="AppSecret">
  49. </div>
  50. </div>
  51. {else}
  52. <div class="form-group">
  53. <label for="" class="control-label col-sm-2">版本描述</label>
  54. <div class="form-controls col-sm-10">
  55. <input type="text" name="description" ng-model="wxappinfo.description" class="form-control wxapp-name" placeholder="版本描述">
  56. </div>
  57. </div>
  58. {/if}
  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="version" ng-model="wxappinfo.version" class="form-control wxapp-name" placeholder="版本号,只能是数字、点,数字最多两位,例如 1.01 / 1.0.1">
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <label for="" class="control-label col-sm-2">头像</label>
  67. <div class="form-controls col-sm-8">
  68. <div class="input-more we7-input-img" ng-class="{'active': wxappinfo.headimg}">
  69. <img ng-src="{{wxappinfo.headimg}}" width="150px" ng-if="wxappinfo.headimg" ng-style="{'height': 'auto'}">
  70. <a href="javascript:;" class="input-addon" ng-click="uploadMultiImage('headimg')" ng-hide="wxappinfo.headimg"><span>+</span></a>
  71. <input type="text" name="headimg" ng-model="wxappinfo.headimg" ng-style="{'display' : 'none'}">
  72. <div class="cover-dark">
  73. <a href="javascript:;" class="cut" ng-click="uploadMultiImage('headimg')">更换</a>
  74. <a href="javascript:;" class="del" ng-click="delMultiImage('headimg')"><i class="fa fa-times text-danger"></i></a>
  75. </div>
  76. </div>
  77. <span class="help-block"></span>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label for="" class="control-label col-sm-2">二维码</label>
  82. <div class="form-controls col-sm-8">
  83. <div class="input-more we7-input-img" ng-class="{'active': wxappinfo.qrcode}">
  84. <img ng-src="{{wxappinfo.qrcode}}" width="150px" ng-if="wxappinfo.qrcode" ng-style="{'height': 'auto'}">
  85. <a href="javascript:;" class="input-addon" ng-click="uploadMultiImage('qrcode')" ng-hide="wxappinfo.qrcode"><span>+</span></a>
  86. <input type="text" name="qrcode" ng-model="wxappinfo.qrcode" ng-style="{'display' : 'none'}">
  87. <div class="cover-dark">
  88. <a href="javascript:;" class="cut" ng-click="uploadMultiImage('qrcode')">更换</a>
  89. <a href="javascript:;" class="del" ng-click="delMultiImage('qrcode')"><i class="fa fa-times text-danger"></i></a>
  90. </div>
  91. </div>
  92. <span class="help-block"></span>
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <input type="hidden" name="modules" value="">
  97. <label class="control-label col-sm-2">添加应用</label>
  98. <div class="form-controls col-sm-10">
  99. <ul class="app-list" id="resource_module">
  100. <div class="app-info" ng-repeat="module in wxappinfo.choose.modules">
  101. <img ng-src="{{module.icon}}" />
  102. <p>{{module.title}}</p>
  103. </div>
  104. <li class="select select-more"></li>
  105. </ul>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div id="home" ng-show="createStep == 2">
  111. <!-- 选择模板 -->
  112. <div ng-if="designMethod == 2">
  113. <div class="wxapp-tem-preview">
  114. <div class="wxapp-phone">
  115. <img src="./resource/images/iphone6.png" alt="" class="wxapp-phone-bg" />
  116. <div class="wxapp-home-preview">
  117. <img src="./resource/images/wxapp-default-tpl1.jpg" />
  118. </div>
  119. </div>
  120. <div class="panel panel-app tem-detail">
  121. <div class="panel-heading">
  122. 模板功能
  123. </div>
  124. <div class="panel-body">
  125. <div class="tem-detail-heading">
  126. 本模板包含以下功能
  127. </div>
  128. <div class="tem-detail-content">
  129. <ul>
  130. <li>更换幻灯片</li>
  131. <li>更换顶部小图标</li>
  132. <li>上传推荐图文</li>
  133. </ul>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="creat-select-tem">
  139. <div class="select-tem-heading">
  140. 选择模板
  141. </div>
  142. <div class="select-tem-filter">
  143. <div class="form-group" style="display:none;">
  144. <select name="" class="select-we7">
  145. <option value="">全部分类</option>
  146. <option value="">分类1</option>
  147. <option value="">分类2</option>
  148. </select>
  149. </div>
  150. <div class="input-group" style="display:none;">
  151. <input type="text" name="" class="form-control" placeholder="输入模板名">
  152. <span class="input-group-addon"><i class="fa fa-search"></i></span>
  153. </div>
  154. </div>
  155. <div class="select-tem-list">
  156. <input type="hidden" name="template" ng-model="wxappinfo.choose.template" />
  157. <ul>
  158. <li class="select-tem-item" ng-class="{'active' : wxappinfo.choose.template == '1'}" ng-click="selectTpl(1)">
  159. <img src="./resource/images/wxapp-default-tpl0.jpg"/>
  160. <a href="javascript:;" class="cover-dark">
  161. <i class="fa fa-check cover-selected"></i>
  162. </a>
  163. </li>
  164. </ul>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <div id="bottom" ng-show="createStep == 3">
  170. <div class="wxapp-tem-preview wxapp-buttom-preview">
  171. <div class="wxapp-phone">
  172. <img src="./resource/images/iphone6.png" alt="" class="wxapp-phone-bg" />
  173. <div class="wxapp-home-preview">
  174. <div class="box clearfix">
  175. <div class="item pic" ng-repeat="module in wxappinfo.choose.modules">
  176. <a href="javascript:void(0)">
  177. <i style="background-image:url({{module.icon}});"></i>
  178. <div class="name">{{module.title}}</div>
  179. </a>
  180. </div>
  181. </div>
  182. <div class="buttom-list-preview" ng-style="{'background-color': wxappinfo.quickmenu.bottom.bgcolor}">
  183. <ul ng-style="{'border-top': '1px solid'+wxappinfo.quickmenu.bottom.boundary}">
  184. <li ng-repeat="menu in wxappinfo.quickmenu.menus">
  185. <img ng-src="{{menu.defaultImage}}" class="buttom-preview-img"/>
  186. <p class="buttom-preview-title" ng-bind="menu.name" ng-style="{'font-size':'12px', 'color': wxappinfo.quickmenu.bottom.color}"></p>
  187. </li>
  188. </ul>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. <div class="creat-buttom">
  194. <div class="buttom-heading">
  195. 配置
  196. </div>
  197. <div class="creat-buttom-select form-defalut">
  198. <div class="form-group">
  199. <label for="" class="control-label col-sm-3">是否显示</label>
  200. <div class="form-controls col-sm-9">
  201. <label><input name="" id="" class="form-control" type="checkbox" style="display: none;">
  202. <div class="switch" ng-class="{'switchOn': wxappinfo.quickmenu.show}" ng-click="showMenu()"></div>
  203. </label>
  204. </div>
  205. </div>
  206. <div class="form-group buttom-bg-color">
  207. <label for="" class="control-label col-sm-3">背景颜色</label>
  208. <div class="form-controls col-sm-4" >
  209. <div we7-colorpicker we7-form-name="wxappinfo.quickmenu.bottom.bgcolor" we7-my-color="wxappinfo.quickmenu.bottom.bgcolor" we7-my-default-color="bottom.bgcolor"></div>
  210. </div>
  211. </div>
  212. <div class="form-group buttom-boundary-color">
  213. <label for="" class="control-label col-sm-3">交界线颜色</label>
  214. <div class="form-controls col-sm-4" >
  215. <div we7-colorpicker we7-my-color="wxappinfo.quickmenu.bottom.boundary" we7-my-default-color="wxappinfo.quickmenu.bottom.boundary"></div>
  216. </div>
  217. </div>
  218. <div class="form-group buttom-bg-color">
  219. <label for="" class="control-label col-sm-3">文字默认颜色</label>
  220. <div class="form-controls col-sm-4" >
  221. <div we7-colorpicker we7-my-color="wxappinfo.quickmenu.bottom.color" we7-my-default-color="wxappinfo.quickmenu.bottom.color"></div>
  222. </div>
  223. </div>
  224. <div class="form-group buttom-bg-color">
  225. <label for="" class="control-label col-sm-3">文字选中颜色</label>
  226. <div class="form-controls col-sm-4" >
  227. <div we7-colorpicker we7-my-color="wxappinfo.quickmenu.bottom.selectedColor" we7-my-default-color="wxappinfo.quickmenu.bottom.selectedColor"></div>
  228. </div>
  229. </div>
  230. </div>
  231. <div class="buttom-list">
  232. <table class="table we7-table buttom-list-table vertical-middle">
  233. <col width="70" />
  234. <col width="70" />
  235. <col width="100" />
  236. <col width="120" />
  237. <col width="70" />
  238. <tr>
  239. <th>默认</th>
  240. <th>选中</th>
  241. <th>菜单名称</th>
  242. <th>跳转到</th>
  243. <th>操作</th>
  244. </tr>
  245. <tr ng-repeat="menu in wxappinfo.quickmenu.menus" class="we7-form">
  246. <td>
  247. <div class="nav-img-box">
  248. <img ng-src="{{menu.defaultImage}}" >
  249. <div ng-click="addDefaultImg($index)" class="select">选择</div>
  250. </div>
  251. </td>
  252. <td>
  253. <div class="nav-img-box">
  254. <img ng-src="{{menu.selectedImage}}">
  255. <div ng-click="addSelectedImg($index)" class="select">选择</div>
  256. </div>
  257. </td>
  258. <td>
  259. <input type="text" name="menuname" ng-model="menu.name" class="form-control" />
  260. </td>
  261. <td>
  262. <select class="form-control" id="lineheight" ng-model="menu.defaultentry" ng-options="binding.title group by binding.modulename for binding in module_bindings">
  263. </select>
  264. </td>
  265. <td>
  266. <a href="javascript:;" class="buttom-del" ng-click="delMenu($index)"><i class="fa fa-times-circle"></i></a>
  267. </td>
  268. </tr>
  269. <tr class="buttom-more">
  270. <td colspan="5"><a href="javascript:;" class="buttom-add" ng-click="addMenu()">+</a></td>
  271. </tr>
  272. </table>
  273. </div>
  274. <div class="buttom-list">
  275. <table class="table we7-table buttom-list-table vertical-middle">
  276. <col width="70" />
  277. <col width="70" />
  278. <col width="120" />
  279. <tr>
  280. <th>默认</th>
  281. <th>模块名</th>
  282. <th>跳转到</th>
  283. </tr>
  284. <tr ng-repeat="module in wxappinfo.choose.modules" class="we7-form">
  285. <td>
  286. <div class="nav-img-box">
  287. <img ng-src="{{module.newicon ? module.newicon : module.icon}}" >
  288. <div ng-click="addModuleImage(module)" class="select">选择</div>
  289. </div>
  290. </td>
  291. <td>
  292. <input type="text" name="modulename" ng-model="module.title" class="form-control" readonly />
  293. </td>
  294. <td>
  295. <select class="form-control" id="lineheight1"
  296. ng-model="module.defaultentry"
  297. ng-options="binding.eid as binding.title for binding in module.bindings">
  298. </select>
  299. </td>
  300. </tr>
  301. </table>
  302. </div>
  303. </div>
  304. </div>
  305. <div id="finish" ng-show="createStep == 4">
  306. <div class="form we7-form wxapp-finish">
  307. <div class="form-group">
  308. <label for="" class="control-label col-sm-2">小程序名称</label>
  309. <div class="form-controls col-sm-10">
  310. <p class="form-control-static" ng-bind="wxappinfo.name"></p>
  311. </div>
  312. </div>
  313. <div class="form-group">
  314. <label for="" class="control-label col-sm-2">描述</label>
  315. <div class="form-controls col-sm-10">
  316. <p class="form-control-static" ng-bind="wxappinfo.description"></p>
  317. </div>
  318. </div>
  319. <div class="form-group">
  320. <label class="control-label col-sm-2">版本号</label>
  321. <div class="form-controls col-sm-10">
  322. <p class="form-control-static">{{wxappinfo.version}}</p>
  323. </div>
  324. </div>
  325. <div class="form-group">
  326. <label class="control-label col-sm-2">打包应用</label>
  327. <div class="form-controls col-sm-10">
  328. <ul class="app-list">
  329. <li class="select" ng-repeat="module in wxappinfo.choose.modules">
  330. <div class="app-info">
  331. <img ng-src="{{module.icon}}" />
  332. <p>{{module.title}}</p>
  333. </div>
  334. </li>
  335. </ul>
  336. </div>
  337. </div>
  338. <div class="form-group" ng-if="designMethod == 2">
  339. <label class="control-label col-sm-2">首页模板</label>
  340. <div class="form-controls col-sm-10">
  341. <p class="form-control-static" ng-bind="wxappinfo.choose.template"></p>
  342. </div>
  343. </div>
  344. <div class="form-group" ng-if="designMethod == 2">
  345. <label class="control-label col-sm-2">底部菜单</label>
  346. <div class="form-controls col-sm-10">
  347. <table class="table-finish-buttom">
  348. <col width="75px"/>
  349. <col width="105"/>
  350. <col />
  351. <tr>
  352. <td>菜单图标</td>
  353. <td>菜单名字</td>
  354. <td>菜单链接模块</td>
  355. </tr>
  356. <tr ng-repeat="menu in wxappinfo.quickmenu.menus">
  357. <td ng-style="{'background-color' : wxappinfo.quickmenu.bottom.bgcolor}">
  358. <img ng-src="{{menu.defaultImage}}" alt="" width="48px" height="48px"/>
  359. </td>
  360. <td ng-bind="menu.name"></td>
  361. <td ng-bind="menu.module.title"></td>
  362. </tr>
  363. </table>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. </div>
  369. </div>
  370. </div>
  371. <nav class="navbar navbar-wxapp-bottom navbar-fixed-bottom" role="navigation">
  372. <div class="container">
  373. <div class="pager">
  374. <a type="button" class="btn btn-primary" ng-show="createStep != 1" ng-click="prevStep()">上一步</a>
  375. <a type="button" class="btn btn-primary" ng-show="createStep != 4" ng-click="nextStep()">下一步</a>
  376. <button type="submit" name="submit" value="yes" class="btn btn-danger" ng-show="createStep == 4" ng-disabled="submitDisabled">生成版本</button>
  377. <!-- <a type="button" class="btn btn-default" ng-show="createStep == 4">首页预览</a> -->
  378. </div>
  379. </div>
  380. </nav>
  381. </form>
  382. </div>
  383. <script>
  384. require(['fileUploader','underscore'], function(uploader){
  385. var isedit = {$isedit};
  386. var wxappinfo = {'name' : '{$wxapp_info['name']}'};
  387. if (isedit) {
  388. wxappinfo.modules = {php echo json_encode($wxapp_version['modules'])};
  389. wxappinfo.quickmenu = {php echo json_encode($wxapp_version['quickmenu'])};
  390. wxappinfo.version = '{$wxapp_version['version']}';
  391. wxappinfo.description = '{$wxapp_version['description']}';
  392. }
  393. angular.module('wxApp').value('config', {
  394. 'wxappinfo' : wxappinfo,
  395. 'uniacid' : "{$uniacid}",
  396. 'version_id' : "{$version_id}",
  397. 'create_type' : "{$create_type}",
  398. 'isedit' : isedit,
  399. 'designMethod' : "{$design_method}",
  400. 'bindingsUrl' : "{php echo url('wxapp/post/module_binding')}",
  401. 'wxappPostUrl' : "{php echo url('wxapp/post', array('design_method' => $design_method, 'create_type'=>$create_type, 'version_id' => $version_id))}",
  402. 'token' : "{$_W['token']}",
  403. });
  404. angular.bootstrap($('#js-wxapp-create'), ['wxApp']);
  405. });
  406. </script>
  407. </html>