mainMenu.blade.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <div class="yz-menu">
  2. <i class="fa fa-bars" style="color:#333"></i>
  3. </div>
  4. <div class="yz-menu-header">
  5. <nav class="navbar navbar-transparent navbar-absolute" style="display: flex;flex-direction: row-reverse;height: 52px;">
  6. <!-- <div class="container-fluid"> -->
  7. <div class="navbar-minimize" style="margin:0;padding:0;margin-left:20px;">
  8. {{--<h4>{{YunShop::app()->account['name']}}</h4>--}}
  9. {{-- <img src="{{\Setting::get('shop.shop.logo') ?request()->getSchemeAndHttpHost().'/attachment/'.\Setting::get('shop.shop.logo'): '/addons/yun_shop/static/resource/images/nopic.jpg'}}" --}}
  10. {{--style="width:80px;height:50px;margin:0;padding:0">--}}
  11. {{-- <h4>{{YunShop::app()->account['name']}}</h4>--}}
  12. </div>
  13. <div class="collapse navbar-collapse" style="float:right">
  14. <ul class="nav navbar-nav navbar-right" style="display: flex;">
  15. <li>
  16. {{-- @if (!YunShop::isRole())--}}
  17. <a href="#pablo" class="dropdown-toggle" data-toggle="dropdown" style="display: flex;">
  18. <i class="material-icons" style="float: left;">dashboard</i>
  19. <p class="" style="float: left;">{{YunShop::app()->account['name']}}</p>
  20. </a>
  21. @if(YunShop::app()->role)
  22. <ul class="dropdown-menu">
  23. @if (config('app.framework') != 'platform')
  24. @if(YunShop::app()->role !='operator')
  25. <li class="about"> <i></i><a href="?c=account&a=post&uniacid={{YunShop::app()->uniacid}}&acid={{YunShop::app()->uniacid}}"> <span class="fa fa-wechat"></span>编辑当前账号资料</a> </li>
  26. @endif
  27. <li> <a href="?c=account&a=display&"><span class="fa fa-cogs fa-fw"></span>管理其他公众号</a> </li>
  28. <li> <a target="_blank" href="?c=utility&a=emulator&"><span class="fa fa-mobile fa-fw"></span>模拟测试</a> </li>
  29. @else
  30. @if(YunShop::app()->role != 'operator' && YunShop::app()->role != 'clerk')
  31. <li> <a href="/admin.html#/manage/index"><span class="fa fa-cogs fa-fw"></span>管理其他公众号</a> </li>
  32. @endif
  33. <li onclick="openPwd()"> <a ><span class="fa fa-edit fa-fw"></span>个人信息</a> </li>
  34. @endif
  35. @if(config('app.env') != 'production')
  36. <li> <a target="_blank" href="{{yzWebUrl('menu.index')}}"><span class="fa fa-align-justify fa-fw"></span>菜单管理</a></li>
  37. @endif
  38. {{--<li> <a target="_blank" href="{{yzWebUrl('member.member.updateWechatOpenData')}}"><span class="fa fa-cube fa-fw"></span>微信开放平台数据同步</a></li>--}}
  39. <li> <a target="_self" href="{{yzWebUrl('cache.update')}}" onclick="return confirm('确认更新缓存?');return false;"><span class="fa fa-refresh fa-fw"></span>更新缓存</a></li>
  40. <!-- <li> <a href="{{yzWebUrl('setting.shop.entry')}}"> <span class="fa fa-camera-retro fa-fw"></span>商城入口 </a> </li> -->
  41. </ul>
  42. @endif
  43. {{-- @endif--}}
  44. </li>
  45. <li class="dropdown">
  46. <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="display: flex;">
  47. <i class="material-icons" style="float:left">person</i>
  48. {{--<span class="notification">5</span>--}}
  49. <p class="" style="float:left">
  50. {{YunShop::app()->username}}(@if(YunShop::app()->role == 'founder')系统管理员@elseif(YunShop::app()->role =='manager')公众号管理员@else公众号操作员@endif)
  51. <b class="caret"></b>
  52. </p>
  53. </a>
  54. <ul class="dropdown-menu">
  55. @if (config('app.framework') != 'platform')
  56. <li class="about"> <i></i> <a href="?c=user&a=profile&do=profile&"> <span class="fa fa-wechat fa-fw"></span>我的账号</a> </li>
  57. @if(YunShop::app()->role == 'founder')
  58. <li class="system one"> <a href="{{yzWebFullUrl('setting.key.index')}}"><span class="fa fa-key fa-fw"></span>商城授权</a> </li>
  59. <li class="system one"> <a href="?c=system&a=welcome&"><span class="fa fa-sitemap fa-fw"></span>系统选项</a> </li>
  60. <li class="system"> <a href="?c=system&a=welcome" target="_blank"><span class="fa fa-cloud-download fa-fw"></span>自动更新</a> </li>
  61. <li class="system three"> <a href="?c=system&a=updatecache&" target="_blank"><span class="fa fa-refresh fa-fw"></span>更新缓存</a> </li>
  62. @endif
  63. @endif
  64. @if (config('app.framework') == 'platform')
  65. @if(YunShop::app()->role == 'founder')
  66. <li class="system one"> <a href="{{yzWebFullUrl('setting.key.index')}}"><span class="fa fa-key fa-fw"></span>商城授权</a> </li>
  67. @endif
  68. <li class="drop_out"> <a href="javascript:void(0)" id="sys_logout"><span class="fa fa-sign-out fa-fw"></span>退出系统</a> </li>
  69. @else
  70. <li class="drop_out"> <a href="?c=user&a=logout"><span class="fa fa-sign-out fa-fw"></span>退出系统</a> </li>
  71. @endif
  72. </ul>
  73. </li>
  74. {{--<li>
  75. <a href="#pablo" class="dropdown-toggle" data-toggle="dropdown">
  76. <i class="material-icons">person</i>
  77. <p class="hidden-lg hidden-md">Profile</p>
  78. </a>
  79. </li>--}}
  80. <li class="separator hidden-lg hidden-md"></li>
  81. </ul>
  82. {{--<form class="navbar-form navbar-right" role="search">
  83. <div class="form-group form-search is-empty">
  84. <input type="text" class="form-control" placeholder="Search">
  85. <span class="material-input"></span>
  86. </div>
  87. <button type="submit" class="btn btn-white btn-round btn-just-icon">
  88. <i class="material-icons">search</i>
  89. <div class="ripple-container"></div>
  90. </button>
  91. </form>--}}
  92. </div>
  93. <div class="navbar-header" style="width:100%">
  94. {{--<button type="button" class="navbar-toggle" data-toggle="collapse">
  95. <span class="sr-only">Toggle navigation</span>
  96. <span class="icon-bar"></span>
  97. <span class="icon-bar"></span>
  98. <span class="icon-bar"></span>
  99. </button>--}}
  100. <ul class="clearfix pull-left" style="margin-bottom: 0em;">
  101. {{--<li class=" active" style="">
  102. <a ui-sref="shop.dashboard" href="/shop">商城</a>
  103. </li>--}}
  104. @foreach(\app\backend\modules\menu\Menu::current()->getItems() as $key=>$value)
  105. @if(isset($value['menu']) && $value['menu'] == 1 && can($key) && ($value['top_show'] == 1 || app('plugins')->isTopShow($key)))
  106. @if(isset($value['child']) && array_child_kv_exists($value['child'],'menu',1))
  107. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getItems()) ? 'active' : ''}}">
  108. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  109. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  110. {{--<span class="pull-right-container">--}}
  111. {{--<i class="fa fa-angle-left pull-right"></i>--}}
  112. {{--</span>--}}
  113. {{$value['name']}}
  114. </a>
  115. {{--@include('layouts.childMenu',['childs'=>$value['child'],'item'=>$key])--}}
  116. </li>
  117. @elseif($value['menu'] == 1)
  118. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getItems()) ? 'active' : ''}}">
  119. <a href="{{isset($value['url']) ? yzWebFullUrl($value['url']):''}}{{$value['url_params'] ?? ''}}">
  120. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  121. {{$value['name'] ?? ''}}
  122. </a>
  123. </li>
  124. @endif
  125. @endif
  126. @endforeach
  127. </ul>
  128. </div>
  129. <!-- </div> -->
  130. </nav>
  131. </div>
  132. <div id="change_pwd_all_diag">
  133. <el-dialog title="修改个人信息" :visible.sync="change_pwd_all_show">
  134. <el-form ref="form" :model="form" :rules="rules" label-width="20%">
  135. <el-form-item label="用户名" prop="username">
  136. <el-input
  137. style="width: 80%"
  138. type="text"
  139. v-model="form.username"
  140. disabled
  141. ></el-input>
  142. </el-form-item>
  143. <el-form-item label="手机号" prop="mobile">
  144. <el-input
  145. style="width: 80%"
  146. type="text"
  147. v-model="mobile"
  148. disabled
  149. ></el-input>
  150. </el-form-item>
  151. <el-form-item label="原密码" prop="old_password">
  152. <el-input
  153. style="width: 80%"
  154. type="text"
  155. v-model="form.old_password"
  156. ></el-input>
  157. <!-- <div class="tip">不填则不修改密码</div> -->
  158. </el-form-item>
  159. <el-form-item label="新密码" prop="new_pass">
  160. <el-input
  161. style="width: 80%"
  162. type="text"
  163. v-model="form.new_pass"
  164. ></el-input>
  165. </el-form-item>
  166. <el-form-item
  167. label="确认新密码"
  168. prop="re_password"
  169. >
  170. <el-input
  171. style="width: 80%"
  172. type="text"
  173. v-model="form.re_password"
  174. ></el-input>
  175. </el-form-item>
  176. <!-- <el-form-item >
  177. 密码至少为8-16个字符,至少1个大写字母,1个小写字母和一个数字,其他可以任意字符
  178. </el-form-item> -->
  179. </el-form>
  180. <span slot="footer" class="dialog-footer">
  181. <el-button @click="change_pwd_all_show = false">取 消</el-button>
  182. <el-button type="primary" @click="changePwd()">确 定</el-button>
  183. </span>
  184. </el-dialog>
  185. </div>
  186. <script>
  187. $(function () {
  188. $("#sys_logout").click(function () {
  189. $.get("/admin/logout",function(data,status){
  190. location.href = '/';
  191. });
  192. });
  193. });
  194. function openPwd() {
  195. change_pwd_all_diag.change_pwd_all_show = true
  196. }
  197. var change_pwd_all_diag = new Vue({
  198. el: "#change_pwd_all_diag",
  199. delimiters: ['[[', ']]'],
  200. data() {
  201. let validatePass2 = (rule, value, callback) => {
  202. if (value === "") {
  203. callback(new Error("请再次输入密码"));
  204. } else if (value !== this.form.new_pass) {
  205. callback(new Error("两次输入密码不一致!"));
  206. } else {
  207. callback();
  208. }
  209. };
  210. return {
  211. mobile:'',
  212. change_pwd_all_show:false,
  213. form:{
  214. },
  215. rules:{
  216. old_password: [{ required: true, trigger: "blur", message: "请输入原密码" }],
  217. new_pass: [{ required: true, trigger: "blur", message: "请输入密码" }],
  218. re_password: [
  219. { validator: validatePass2, required: true, trigger: "blur" }
  220. ]
  221. }
  222. }
  223. },
  224. watch:{
  225. change_pwd_all_show(value) {
  226. if(value) {
  227. this.getInfo();
  228. }
  229. }
  230. },
  231. created () {
  232. },
  233. methods: {
  234. getInfo() {
  235. this.$http.post('{!! yzWebFullUrl('user.user.getAdminUserInfo') !!}', {}).then(response => {
  236. console.log( response.data)
  237. if (response.data.result === 1) {
  238. this.form.username = response.data.data.username;
  239. this.mobile = response.data.data.mobile;
  240. console.log( response.data)
  241. } else {
  242. this.$message.error(response.data.msg);
  243. }
  244. })
  245. },
  246. changePwd() {
  247. let that = this;
  248. this.$refs["form"].validate(valid => {
  249. if (valid) {
  250. this.$http.post('{!! yzWebFullUrl('user.user.resetPassword') !!}', { old_password:this.form.old_password,username: this.form.username,new_pass:this.form.new_pass }).then(response => {
  251. if (response.data.result === 1) {
  252. this.$message.success("修改成功!");
  253. that.change_pwd_all_show = false;
  254. setTimeout(()=> {
  255. that.logout();
  256. },2000)
  257. } else {
  258. this.$message.error(response.data.msg);
  259. }
  260. }).catch(err => {
  261. console.error(err);
  262. });
  263. }
  264. });
  265. },
  266. logout() {
  267. this.$http.get("/admin/logout", {}).then(response => {
  268. location.href = '/';
  269. })
  270. }
  271. },
  272. });
  273. </script>