人人商城

post.html 19KB

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