link.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. {template 'common/header'}
  2. <div id="js-link-display" class="module-link-page" ng-controller="linkDisplayCtrl">
  3. <ol class="breadcrumb we7-breadcrumb">
  4. <a href="{php echo url('module/display')}"><i class="wi wi-back-circle"></i> </a>
  5. <li><a href="{php echo url('module/display')}">应用列表</a></li>
  6. <li>新建应用</li>
  7. </ol>
  8. <div class="alert we7-page-alert" >
  9. <p>主账号仅可设置一个,关联的账号组,数据以主账号的为准。</p>
  10. <p>关联账号可设置多个,但从任意一个账号进入,数据都与主账号数据保持一致。 </p>
  11. </div>
  12. <div class="we7-form">
  13. <!--选择应用-->
  14. <div class="form-group ">
  15. <div class="control-label col-sm-2">
  16. 选择应用
  17. </div>
  18. <div class="form-controls col-sm-8">
  19. <div class="group-post-mudules">
  20. <div class="module-item" ng-if="module && module.name">
  21. <div class="logo">
  22. <img ng-src="{{module.logo}}" alt="">
  23. </div>
  24. <div class="info">
  25. <div ng-bind="module.title" class="title text-over"></div>
  26. <div class="icon">
  27. <i class="{{item.icon}}" ng-repeat="item in module | moduleInfo"></i>
  28. </div>
  29. </div>
  30. <we7-modal-app module-list="user_modules" title="'添加应用'" on-confirm="checkModule()">
  31. <div class="delete">
  32. <i class="wi wi-cut-account" ></i>
  33. </div>
  34. </we7-modal-app>
  35. </div>
  36. <we7-modal-app module-list="user_modules" ng-if="!module || !module.name" title="'添加应用'" on-confirm="checkModule()">
  37. <div class="module-item add">
  38. <i class="wi wi-plus"></i> 添加应用
  39. </div>
  40. </we7-modal-app>
  41. </div>
  42. </div>
  43. </div>
  44. <!-- 选中主账号 -->
  45. <div class="form-group clearfix" ng-if="linkInfo.module_name">
  46. <div class="control-label col-sm-2">
  47. 选择主账号
  48. </div>
  49. <div class="form-controls col-sm-8">
  50. <div class="group-post-mudules">
  51. <div class="module-item" ng-if="linkInfo && linkInfo.main_account && linkInfo.main_account.name">
  52. <div class="logo">
  53. <img src="{{linkInfo.main_account.logo}}" alt="">
  54. </div>
  55. <div class="info">
  56. <div ng-bind="linkInfo.main_account.name" class="title text-over"></div>
  57. <div class="icon">
  58. <i class="{{we7TypeDefault[linkInfo.main_account.type_sign]['icon']}}"></i>
  59. </div>
  60. </div>
  61. <div class="delete" ng-click="selectAccount('main')">
  62. <i class="wi wi-cut-account" ></i>
  63. </div>
  64. </div>
  65. <div class="module-item add" ng-click="selectAccount('main')" ng-if="!(linkInfo && linkInfo.main_account && linkInfo.main_account.name)">
  66. <i class="wi wi-plus"></i> 选择主账号
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <!-- 选择账号-->
  72. <div class="form-group clearfix" ng-if="linkInfo && linkInfo.main_account && linkInfo.main_account.name">
  73. <div class="control-label col-sm-2">
  74. 选择账号
  75. </div>
  76. <div class="form-controls col-sm-8">
  77. <div class="group-post-mudules">
  78. <div class="module-item" ng-repeat="account in linkInfo.link_accounts track by $index">
  79. <div class="logo">
  80. <img src="{{account.logo}}" alt="">
  81. </div>
  82. <div class="info">
  83. <div ng-bind="account.name" class="title text-over"></div>
  84. <div class="icon">
  85. <i class="{{we7TypeDefault[account.type_sign]['icon']}}"></i>
  86. </div>
  87. </div>
  88. <div class="delete" ng-click="deleteLink(account.name)">
  89. <i class="wi wi-error" ></i>
  90. </div>
  91. </div>
  92. <div class="module-item add" ng-click="selectAccount('link')">
  93. <i class="wi wi-plus"></i> 选择账号
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="col-sm-offset-2">
  99. <button class="btn btn-primary" ng-click="submitLinkInfo()">提交</button>
  100. </div>
  101. </div>
  102. <div class="modal fade modal-app" tabindex="-1" id="add_account" role="dialog" >
  103. <div class="modal-dialog" role="document">
  104. <div class="modal-content">
  105. <div class="modal-header clearfix">
  106. <h4 class="text-over"> 选择账号 </h4>
  107. <div class="type"></div>
  108. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  109. </div>
  110. <div class="modal-body">
  111. <div class="search-box">
  112. <select class="we7-select we7-margin-right"
  113. ng-model="setAccountInfoType"
  114. ng-change="setAccountInfo(setAccountInfoType)">
  115. <option value="{{key}}"
  116. ng-repeat="(key, item) in we7TypeDefault"
  117. ng-if="module[key + '_support'] == 2 && (key == 'wxapp' || selectAccountLinkType != 'link' || linkInfo.main_account.type_sign != key)"
  118. >{{item.name}}</option>
  119. </select>
  120. <div class="search-form">
  121. <div class="input-group ">
  122. <input class="form-control" name="keyword" type="text" ng-model="keyword" autocomplete="false" >
  123. <span class="input-group-btn" ng-click="searchInAccountData(keyword)"><button class="btn btn-default"><i class="fa fa-search"></i></button></span>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="modal-app-list">
  128. <div class="modal-item" ng-repeat="account in searchedAccountData" ng-class="{'active': account.checked == 1}" ng-click="selectedAccount(account)">
  129. <div class="logo ">
  130. <img ng-src="{{account.logo}}" class="account-logo" alt="">
  131. <div class="mark">
  132. <i class="wi wi-right"></i>
  133. </div>
  134. </div>
  135. <div class="name text-over">
  136. <i class="{{we7TypeDefault[account.type_sign]['icon']}}"></i>{{account.name}}
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="modal-footer">
  142. <button type="button" class="btn btn-primary" ng-click="ngConfirm()">确定</button>
  143. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <script>
  150. angular.module('moduleApp').value('config', {
  151. 'submitLinkInfoUrl': '{php echo url("module/link/link_account")}',
  152. 'getLinkAccountUrl': '{php echo url("module/link/get_sub_accounts")}',
  153. 'getMainAccountUrl': '{php echo url("module/link/search_link_account")}',
  154. 'userModules': {php echo json_encode($user_modules)},
  155. });
  156. angular.bootstrap($('#js-link-display'), ['moduleApp']);
  157. </script>
  158. {template 'common/footer'}