人人商城

version-front-download.html 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. {template 'common/header'}
  2. <!--小程序前端下载-->
  3. {if $do != 'custom'}
  4. {if $_W['account']['type'] == ACCOUNT_TYPE_ALIAPP_NORMAL}
  5. <ul class="we7-page-tab">
  6. <li class="{if $do == 'front_download'}active{/if}">
  7. <a href="{php echo url('wxapp/front-download/', array('version_id' => $version_id));}">支付宝小程序下载</a>
  8. </li>
  9. </ul>
  10. {else}
  11. <ul class="we7-page-tab">
  12. <li class="{if $do == 'front_download'}active{/if}">
  13. <a href="{php echo url('wxapp/front-download/front_download', array('version_id' => $version_id));}">小程序上传</a>
  14. </li>
  15. <li class="{if $do == 'domainset'}active{/if}">
  16. <a href="{php echo url('wxapp/front-download/domainset', array('version_id' => $version_id))}">小程序域名设置</a>
  17. </li>
  18. {if ($is_single_module_wxapp)}
  19. <li class="{if $do == 'entrychoose'}active{/if}">
  20. <a href="{php echo url('wxapp/front-download/entrychoose', array('version_id' => $version_id))}">小程序入口配置</a>
  21. </li>
  22. {/if}
  23. </ul>
  24. {/if}
  25. {else}
  26. <ol class="breadcrumb" style="background-color: transparent;">
  27. <a href="{php echo url('wxapp/front-download/front_download', array('version_id' => $version_id));}">
  28. <i class="wi wi-back-circle color-gray" style="font-size: 30px;position: relative;top: 5px;"></i>
  29. </a>
  30. <li><a href="{php echo url('wxapp/front-download/front_download', array('version_id' => $version_id));}">小程序上传</a></li>
  31. <li class="active">定制主题</li>
  32. </ol>
  33. {/if}
  34. {if $do == 'entrychoose'}
  35. <div class="panel we7-panel">
  36. <div class="panel-heading">小程序入口配置</div>
  37. <div class="panel-body ">
  38. <table class="table we7-table table-hover" >
  39. <tr>
  40. <th>标题</th>
  41. <th>url</th>
  42. <th>操作</th>
  43. </tr>
  44. {loop $entrys $entry}
  45. <tr>
  46. <td>{$entry['title']}</td>
  47. <td>{$entry['url']}</td>
  48. <td><button class="btn btn-primary js-entry-btn" data-eid="{$entry['eid']}" {if $entry['eid'] == $version_info['entry_id']} disabled {/if} >设为入口</button></td>
  49. </tr>
  50. {/loop}
  51. </table>
  52. </div>
  53. </div>
  54. <script type="text/javascript">
  55. var entry_url = "{php echo url('wxapp/front-download/set_wxapp_entry', array('version_id'=>$version_id))}";
  56. $('.js-entry-btn').click(function(){
  57. var entry_id = $(this).data('eid');
  58. $.post(entry_url, {'entry_id':entry_id}, function(data){
  59. if(data.errno == '0') {
  60. util.message('设置成功');
  61. }
  62. window.location.reload();
  63. })
  64. });
  65. </script>
  66. {/if}
  67. {if $do == 'custom'}
  68. <div ng-controller="code_appjson_ctrl" id="codeappjson" ng-controller="codeAppjsonCtrl">
  69. <div class="panel we7-panel wxapp-upload-setting">
  70. <div class="panel-heading">顶部导航栏设置</div>
  71. <div class="panel-body">
  72. <div class="we7-flex">
  73. <div class="view-img"><img src="/web/resource/images/wxapp/setting-01.png" alt=""></div>
  74. <div class="form-horizontal">
  75. <div class="form-group">
  76. <label class="col-xs-3 control-label">小程序标题</label>
  77. <div class="col-xs-9">
  78. <input type="text" required="required" ng-model="window.navigationBarTitleText"
  79. placeholder="小程序标题" class="form-control">
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <label class="col-xs-3 control-label">标题颜色</label>
  84. <div class="col-xs-9">
  85. <select ng-model="window.navigationBarTextStyle">
  86. <option value="white">白</option>
  87. <option value="black">黑</option>
  88. </select>
  89. </div>
  90. </div>
  91. <div class="form-group">
  92. <label class="col-xs-3 control-label">导航背景颜色</label>
  93. <div class="col-xs-9">
  94. <input type="text" placeholder="小程序导航背景颜色" ng-model="window.navigationBarBackgroundColor" class="form-control js-color">
  95. </div>
  96. </div>
  97. <div class="form-group">
  98. <label class="col-xs-3 control-label">小程序背景色</label>
  99. <div class="col-xs-9">
  100. <input type="text" placeholder="小程序背景色" ng-model="window.backgroundColor" class="form-control js-color">
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="panel we7-panel wxapp-upload-setting">
  108. <div class="panel-heading">底部导航栏设置</div>
  109. <div class="panel-body">
  110. <div class="we7-flex">
  111. <div class="view-img"><img src="/web/resource/images/wxapp/setting-02.png" alt=""></div>
  112. <div class="form-horizontal">
  113. <div class="form-group">
  114. <label class="col-xs-3 control-label">文字默认颜色</label>
  115. <div class="col-xs-9">
  116. <input type="text" placeholder="文字默认颜色" ng-model="tabBar.color" class="form-control js-color">
  117. </div>
  118. </div>
  119. <div class="form-group">
  120. <label class="col-xs-3 control-label">文字选中颜色</label>
  121. <div class="col-xs-9">
  122. <input type="text" placeholder="文字默认颜色" ng-model="tabBar.selectedColor" class="form-control js-color">
  123. </div>
  124. </div>
  125. <div class="form-group">
  126. <label class="col-xs-3 control-label">底部导航颜色</label>
  127. <div class="col-xs-9">
  128. <input type="text" placeholder="底部导航颜色" ng-model="tabBar.backgroundColor" class="form-control js-color">
  129. </div>
  130. </div>
  131. <div class="form-group">
  132. <label class="col-xs-3 control-label">交界线颜色</label>
  133. <div class="col-xs-9">
  134. <select ng-model="tabBar.borderStyle">
  135. <option value="white">白</option>
  136. <option value="black">黑</option>
  137. </select>
  138. </div>
  139. </div>
  140. <div class="form-group hidden">
  141. <label class="col-xs-3 control-label">tab类型</label>
  142. <div class="col-xs-9">
  143. <select ng-model="tabBar.isSystemTabBar">
  144. <option value="1">系统</option>
  145. <option value="0">开发者自定义</option>
  146. </select>
  147. </div>
  148. </div>
  149. <table class="table we7-table hidden">
  150. <col width="75px">
  151. <col width="75px">
  152. <col width="90px">
  153. <col width="60px">
  154. <col width="60px">
  155. <col width="100px">
  156. <tr>
  157. <th>默认</th>
  158. <th>选中</th>
  159. <th>菜单名称</th>
  160. <th class="text-center">跳转</th>
  161. <th>操作</th>
  162. </tr>
  163. <tbody ng-repeat="tabitem in tabBar.list" ng-init="current = $index">
  164. <tr >
  165. <td>
  166. <div class="icon js-image" data-index="{{current}}" data-selected="0">
  167. <img ng-src="{{iconPath(tabitem)}}" />
  168. <span class="replace ">更换</span>
  169. </div>
  170. </td>
  171. <td>
  172. <div class="icon js-image" data-index="{{current}}" data-selected="1">
  173. <img ng-src="{{tabitem.selectedIconPath}}" />
  174. <span class="replace " >更换</span>
  175. </div>
  176. </td>
  177. <td>
  178. <input type="text" class="form-control" value="首页" ng-model="tabitem.text">
  179. </td>
  180. <td>
  181. <div>
  182. <select ng-model="tabitem.pagePath" ng-options="x for x in pages" style="width:100px;"></select>
  183. </div>
  184. </td>
  185. <td>
  186. <button class="btn btn-primary" ng-click="del($index)">删除</button>
  187. </td>
  188. </tr>
  189. </tbody>
  190. <tfoot>
  191. <button class="btn btn-primary hidden" ng-click="add()">添加</button>
  192. </tfoot>
  193. </table>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <button class="btn btn-primary" ng-click="default()">恢复默认</button>
  199. <button class="btn btn-primary" ng-click="save()">保存</button>
  200. </div>
  201. <script type="text/javascript">
  202. angular.module('we7codeAppjsonApp').value('config',{
  203. 'version_id' : {$version_id},
  204. 'default_appjson' : '{$default_appjson}',
  205. 'save_url' : "{php echo url('wxapp/front-download/custom_save')}",
  206. 'default_url' : "{php echo url('wxapp/front-download/custom_default')}",
  207. 'convert_img_url' : "{php echo url('wxapp/front-download/custom_convert_img')}"
  208. });
  209. angular.bootstrap($('#codeappjson'), ['we7codeAppjsonApp']);
  210. </script>
  211. {/if}
  212. {if $do == 'domainset'}
  213. <div class="panel we7-panel">
  214. <div class="panel-heading">小程序配置</div>
  215. <div class="panel-body we7-padding">
  216. <form
  217. action="./index.php?c=wxapp&a=front-download&do=domainset&version_id={$version_id}"
  218. class="we7-form" enctype="multipart/form-data"
  219. method="post">
  220. <div class="form-group hidden">
  221. <label class="control-label col-sm-2">设置小程序URL</label>
  222. <div class="col-sm-10">
  223. <input type="text" class="form-control" name="appurl" value="{$appurl}" placeholder="">
  224. <label style="color: red;">https://域名/app/index.php</label>
  225. </div>
  226. </div>
  227. <div class="form-group">
  228. <label class="control-label col-sm-2">小程序业务域名校验文件</label>
  229. <div class="col-sm-10">
  230. <input type="file" class="form-control"
  231. name="file" value="" placeholder="没有可不传"/>
  232. </div>
  233. </div>
  234. <div class="form-group">
  235. <label class="control-label col-sm-2"></label>
  236. <div class="col-sm-10">
  237. <button class="btn btn-primary" type="submit">更新</button>
  238. <a href="{$appurl}?i={$uniacid}&c=utility&a=visit&do=health" class="btn btn-primary" target="_blank">https访问检测</a>
  239. </div>
  240. </div>
  241. </form>
  242. </div>
  243. </div>
  244. <div class="wxapp-download-procedure">
  245. <div class="title color-gray">设置小程序域名说明:</div>
  246. <div class="step">1.设置链接域名,可以在系统后台设置操作小程序。设置完成后到小程序审核发布里点击下载后,域名更新。</div>
  247. <div class="step">2.设置后的生效页面(<a href="#" class="color-default">站点管理</a><span class="color-default"><i
  248. class="wi wi-angle-right"></i></span> <a href="#" class="color-default">站点设置</a>)
  249. </div>
  250. <div class="img">
  251. <img src="/web/resource/images/wxapp/12.png" alt="" class="img-responsive">
  252. </div>
  253. </div>
  254. {/if}
  255. {if $do == 'front_download'}
  256. {if $_W['account']['type'] == ACCOUNT_TYPE_ALIAPP_NORMAL}
  257. <div><a href="{php echo url('wxapp/front-download/getpackage', array('version_id' => $version_id))}" class="btn btn-primary text-center">下载</a></div>
  258. {else}
  259. <!--在微信小程序后台提交审核-->
  260. {if $uptype == 'normal'}
  261. <div class="media media-wechat-setting">
  262. <div class="media-left color-default">
  263. <span class="wi wi-wxapp-webpack" style="font-size: 55px;"></span>
  264. </div>
  265. <div class="media-body media-middle ">
  266. <h4 class="media-heading color-dark">{$wxapp_versions_info['modules'][0]['title']}</h4>
  267. <div class="color-gray">版本: v{$wxapp_versions_info['version']}</div>
  268. </div>
  269. <div class="media-right media-middle">
  270. <a href="./index.php?c=wxapp&a=front-download&do=getpackage&uniacid={$_W['uniacid']}&version_id={$wxapp_versions_info['id']}"
  271. class="btn btn-primary">立即下载</a>
  272. </div>
  273. </div>
  274. <div class="wxapp-download-procedure">
  275. <div class="title color-gray">小程序前端下载后操作流程说明:</div>
  276. <div class="step">1.进入微信小程序后台(mp.weixin.qq.com),添加小程序开发者(如已经是管理员或开发者则不需要添加)</div>
  277. <div class="img">
  278. <img src="./resource/images/wxapp/01.png" alt=""/>
  279. <img src="./resource/images/wxapp/02.png" alt=""/>
  280. </div>
  281. <div class="step">2.进入小程序后台,点击设置,开发设置,修改服务器域名(设置自己的微擎域名,<span class="color-default">必须是https://</span>)</div>
  282. <div class="img">
  283. <img src="./resource/images/wxapp/03.png" alt=""/>
  284. <img src="./resource/images/wxapp/04.png" alt=""/>
  285. </div>
  286. <div class="step">3.下载 微信web开发者工具(本帖会附上工具下载地址),更新到最新版后(切记),点击,填写小程序appid。将之前<span class="color-default">下载解压后的小程序插件上传</span>
  287. </div>
  288. <div class="img">
  289. <img src="./resource/images/wxapp/05.png" alt=""/>
  290. <img src="./resource/images/wxapp/06.png" alt=""/>
  291. <img src="./resource/images/wxapp/07.png" alt=""/>
  292. </div>
  293. <div class="step">4.点击项目,上传,并设置版本号和项目名称(项目名称自定义)</div>
  294. <div class="img">
  295. <img src="./resource/images/wxapp/08.png" alt=""/>
  296. <img src="./resource/images/wxapp/09.png" alt=""/>
  297. </div>
  298. <div class="step">5.进入小程序后台(mp.weixin.qq.com),点击开发管理,提交审核,小程序<span class="color-default">管理员</span>(必须需要管理员扫描,小程序开发者不可)扫描即可
  299. </div>
  300. <div class="img">
  301. <img src="./resource/images/wxapp/10.png" alt=""/>
  302. <img src="./resource/images/wxapp/11.png" alt=""/>
  303. </div>
  304. <div class="step">6.微信官方审核通过即可使用</div>
  305. </div>
  306. {/if}
  307. <!--end 在微信小程序后台提交审核-->
  308. <!--小程序可自行提交审核-->
  309. {if $uptype=='auto'}
  310. {if $need_upload}
  311. <div class="alert-info">
  312. <div class="alert alert-warning alert-dismissible" role="alert">
  313. <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  314. <strong><i class="wi wi-info-sign color-red"></i></strong>
  315. 该小程序应用已更新至最新版本:{$module['version']}。此小程序当前版本为:{$wxapp_versions_info['version']},需要重新上传微信审核最新版本应用。
  316. </div>
  317. </div>
  318. {/if}
  319. <div class="panel we7-panel wxapp-examine-self we7-margin-top" id="codeupload" ng-controller="code_upload_ctrl">
  320. <div class="panel-heading">上传小程序</div>
  321. <div class="panel-body">
  322. <div class="step we7-flex">
  323. <div class="one active">
  324. <span class="wi wi-one"></span>填写信息
  325. </div>
  326. <div class="arrow">
  327. <span class="wi wi-step-arrows"></span>
  328. </div>
  329. <div class="two" ng-class="{true:'active',false:''}[step>=2]">
  330. <span class="wi wi-two"></span>扫码并上传代码
  331. </div>
  332. <div class="arrow">
  333. <span class="wi wi-step-arrows"></span>
  334. </div>
  335. <div class="three" ng-class="{true:'active',false:''}[step>=3]">
  336. <span class="wi wi-three"></span>上传成功
  337. </div>
  338. </div>
  339. </div>
  340. <div class="panel-heading" ng-show="show_step1">之前小程序版本:{$wxapp_versions_info['version']}</div>
  341. <div class="panel-body" ng-show="show_step1">
  342. <div class="we7-flex">
  343. <div>应用:<img src="{$module['logo']}" style="width: 56px;margin: 0 10px;">{$module['title']}</div>
  344. <div style="position: relative;top: 16px;">之前版本:{$last_modules['version']}</div>
  345. <div style="position: relative;top: 16px;">
  346. 最新版本:{$module['version']}
  347. {if $last_modules['version'] != $module['version']}
  348. <br/>
  349. <span class="color-red" style="font-size: 10px"><i class="wi wi-info-sign"></i>可上传微信审核为最新版本</span>
  350. {/if}
  351. </div>
  352. </div>
  353. </div>
  354. <div class="waiting text-center" id="wait_code_token" ng-show="show_wait" style="border-top: 1px solid #e7e7eb; padding: 150px!important;">
  355. <div><span class="wi wi-waiting"></span></div>
  356. <div>正在获取二维码,请耐心等待,等待时间大约</div>
  357. <div class="second" id="wait_sec">{{wait_sec}}秒</div>
  358. </div>
  359. <div class="panel-footer bg-light-gray" id="readycommit" ng-show="!show_wait">
  360. <form action="" class="we7-form" id="codeform" ng-show="show_step1" ng-init="user_version = '{$user_version}'; user_desc = '{$version_info['description']}'">
  361. <div class="form-group">
  362. <label class="control-label col-sm-2">版本号</label>
  363. <div class="col-sm-10">
  364. <input type="text" class="form-control" id="user_version" ng-model="user_version" value="">
  365. <span class="help-block">
  366. 版本号仅限数字
  367. </span>
  368. </div>
  369. </div>
  370. <div class="form-group">
  371. <label class="control-label col-sm-2">版本描述</label>
  372. <div class="col-sm-10">
  373. <textarea rows="3" class="form-control" id="user_desc" ng-model="user_desc"></textarea>
  374. </div>
  375. </div>
  376. <div class="form-group">
  377. <label class="control-label col-sm-2">主题样式</label>
  378. <div class="col-sm-10">
  379. <div class="form-control" id="theme" style="background-color: #eee">
  380. <i class="wi wi-warning-sign color-red"></i>
  381. <span class="color-gray">如果您的应用支持定制主题,您可以在这步设置主题</span>
  382. <a class="text-right pull-right link-item" href="{php echo url('wxapp/front-download/custom', array('version_id' => $version_id));}" style="color: #45a2f3;">前往设置</a>
  383. </div>
  384. </div>
  385. </div>
  386. <div class="form-group">
  387. <label class="control-label col-sm-2"></label>
  388. <div class="col-sm-10">
  389. <input type="hidden" name="ticket" id="ticket">
  390. <input type="hidden" id="version_id" value="{$version_id}">
  391. <!--<button class="btn btn-primary" type="button" id="commitcode" ng-click="commit()">上传代码</button>-->
  392. <button class="btn btn-primary" type="button" id="begin-upload" ng-click="beginUpload()">确 认</button>
  393. </div>
  394. </div>
  395. </form>
  396. <div class="text-center step1" ng-show="show_step2">
  397. <img alt="" src="{{qrcode_src}}" class="qr-img" id="qrcode" >
  398. <div>请扫描二维码,确认后将直接上传代码</div>
  399. </div>
  400. <div class="success text-center step3" ng-show="show_step3">
  401. <div><span class="wi wi-right-sign"></span></div>
  402. <div class="status-state">上传代码成功,请到微信开发平台小程序后台预览,提交审核应用。</div>
  403. <div>微信开发平台小程序后台<a href="https://mp.weixin.qq.com/" class="color-default">https://mp.weixin.qq.com/</a></div>
  404. <div class="btns">
  405. <button class="btn btn-primary" type="button" ng-click="preview()">预览</button>
  406. <a href="https://mp.weixin.qq.com/" target="_blank" class="btn btn-default">去提交审核</a>
  407. </div>
  408. </div>
  409. <div class="modal fade" id="qrCodeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  410. <div class="modal-dialog" role="document">
  411. <div class="modal-content">
  412. <div class="modal-header">
  413. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  414. <h4 class="modal-title" id="myModalLabel">微信扫码预览小程序</h4>
  415. </div>
  416. <div class="modal-body text-center">
  417. <img class="qr-img" ng-src="{{preview_qrcode}}" src="{{preview_qrcode}}">
  418. </div>
  419. </div>
  420. </div>
  421. </div>
  422. </div>
  423. </div>
  424. {/if}
  425. <!--end 小程序可自行提交审核-->
  426. <!--end 小程序域名设置-->
  427. {if $uptype == 'auto'}
  428. <script type="text/javascript">
  429. angular.module('we7codeuploadApp').value('config',{
  430. 'version_id' : "{$version_id}",
  431. 'upgrade_url' : "{php echo url('wxapp/front-download/upgrade_module')}",
  432. UUIDURL : "{php echo url('wxapp/front-download/code_uuid')}",
  433. CODE_GEN_CHECK_URL : "{php echo url('wxapp/front-download/code_gen')}",
  434. CODE_TOKEN_URL : "{php echo url('wxapp/front-download/code_token')}",
  435. QRCODEURL : "{php echo url('wxapp/front-download/qrcode')}",
  436. CHECKSANURL : "{php echo url('wxapp/front-download/checkscan')}",
  437. PREVIEWURL : "{php echo url('wxapp/front-download/preview')}",
  438. COMMITURL : "{php echo url('wxapp/front-download/commitcode')}"
  439. });
  440. angular.bootstrap($('#codeupload'), ['we7codeuploadApp']);
  441. </script>
  442. {/if}
  443. {/if}
  444. {/if}
  445. {template 'common/footer'}