zc.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="m_right">
  3. <view class="m_right_hander">
  4. <button size="mini" class="m_btn_red">添加资产</button>
  5. </view>
  6. <view class="m_right_container">
  7. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  8. <thead class="m-table-hander">
  9. <tr>
  10. <th>用户名</th>
  11. <th>班级</th>
  12. <th>学号</th>
  13. <th>电话</th>
  14. <th>ilab账户</th>
  15. <th>注册时间</th>
  16. <th>分数</th>
  17. <th>修改信息</th>
  18. <th>删除</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. <tr v-for="(dataUser,dataUserI) in dataUsers_all" :key="dataUserI">
  23. <th style="color: #EA252C;">dataUser.Name</th>
  24. <th>dataUser.Id</th>
  25. <th>dataUser.Id</th>
  26. <th>dataUser.Id</th>
  27. <th>dataUser.Id</th>
  28. <th>dataUser.Id</th>
  29. <th>dataUser.Id</th>
  30. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  31. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </view>
  36. <view class="m_right_footer">
  37. <view class="m_paging">
  38. <text class="m_paging_item m_paging_upper">上一页</text>
  39. <text class="m_paging_item" v-for="i in 8" @click="paging(i)" :class="i==index?'p_act':''">
  40. {{i}}
  41. </text>
  42. <text class="m_paging_item m_paging_lower">下一页</text>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. name: "manager_zc",
  50. data() {
  51. return {
  52. pageTotalNum:1,
  53. currentPage:0,
  54. totalItem:2,
  55. dataUsers_all: []
  56. }
  57. },
  58. methods: {
  59. paging(i) {
  60. uni.showLoading({
  61. title: '加载中'
  62. });
  63. let fromIndex = this.totalItem*(i-1);
  64. let toIndex = fromIndex+this.totalItem;
  65. let data = {
  66. "UserID": mydata_userInfo.userID,
  67. "BeginNum": 0, //用户数组索引
  68. "EndNum": 15, //用户数组索引结束
  69. "ItemType":""//道具 角色 场景 空为全部
  70. }
  71. uni.request({
  72. header: {
  73. 'Content-Type': 'application/json;charset=UTF-8'
  74. },
  75. url: mydata_api + '/item/getitemlist',
  76. method: 'POST',
  77. data: data,
  78. dataType: 'json',
  79. success: (res) => {
  80. //100成功
  81. if (res.data.Code == 100) {
  82. console.log("请求全部用户", res);
  83. this.dataUsers_all = res.data.Users;
  84. this.pageTotalNum = parseInt(res.data.AllNumOfList/this.totalItem);
  85. }
  86. //200失败
  87. else {
  88. console.log('suc200', res);
  89. }
  90. uni.hideLoading();
  91. },
  92. fail: (res) => {
  93. console.log("请求失败****");
  94. uni.hideLoading();
  95. }
  96. });
  97. },
  98. initPage() {
  99. uni.showLoading({
  100. title: '加载中'
  101. });
  102. let data = {
  103. "UserID": mydata_userInfo.userID,
  104. "BeginNum": 0, //用户数组索引
  105. "EndNum": 15, //用户数组索引结束
  106. "ItemType":""//道具 角色 场景 空为全部
  107. }
  108. uni.request({
  109. header: {
  110. 'Content-Type': 'application/json;charset=UTF-8'
  111. },
  112. url: mydata_api + '/item/getitemlist',
  113. method: 'POST',
  114. data: data,
  115. dataType: 'json',
  116. success: (res) => {
  117. //100成功
  118. if (res.data.Code == 100) {
  119. console.log("请求全部用户", res);
  120. this.dataUsers_all = res.data.Users;
  121. this.pageTotalNum = parseInt(res.data.AllNumOfList/this.totalItem);
  122. uni.hideLoading();
  123. }
  124. //200失败
  125. else {
  126. console.log('suc200', res);
  127. uni.hideLoading();
  128. }
  129. },
  130. fail: (res) => {
  131. console.log("请求失败****");
  132. uni.hideLoading();
  133. }
  134. });
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .m_right {
  141. width: 100%;
  142. margin-top: 5rpx;
  143. padding: 0 150rpx;
  144. background-color: #fff;
  145. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  146. .m_right_hander {
  147. text-align: right;
  148. height: 250rpx;
  149. position: relative;
  150. .m_btn_red {
  151. position: absolute;
  152. height: 80rpx;
  153. line-height: 80rpx;
  154. padding: 0 40rpx;
  155. right: 0;
  156. top: 50%;
  157. transform: translateY(-50%);
  158. background: #EA252C;
  159. color: #fff;
  160. }
  161. }
  162. }
  163. tbody tr {
  164. border-top: 2rpx solid #DDDDDD !important;
  165. }
  166. tbody tr th {
  167. font-weight: 400 !important;
  168. height: 140rpx;
  169. line-height: 140rpx;
  170. }
  171. tbody tr:hover {
  172. // color: #fff;
  173. background: #FDEBEC;
  174. // opacity: 0.08;
  175. }
  176. .m-table-hander {
  177. background-color: #FFF8F7;
  178. height: 140rpx;
  179. line-height: 140rpx;
  180. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  181. font-weight: bold;
  182. }
  183. .m_edit {
  184. position: absolute;
  185. top: 50%;
  186. left: 50%;
  187. transform: translate(-50%, -50%);
  188. background: rgb(67, 127, 250);
  189. color: rgb(255, 255, 255);
  190. min-width: 130rpx;
  191. }
  192. .m_delete {
  193. position: absolute;
  194. top: 50%;
  195. left: 50%;
  196. min-width: 130rpx;
  197. transform: translate(-50%, -50%);
  198. background: rgb(234, 37, 44);
  199. color: rgb(255, 255, 255);
  200. }
  201. .m_right_footer {
  202. margin-top: 80rpx;
  203. }
  204. .m_paging {
  205. text-align: right;
  206. .m_paging_item {
  207. padding: 10rpx 18rpx;
  208. border: 1rpx solid #DDDDDD;
  209. border-radius: 8rpx;
  210. margin-right: 10rpx;
  211. }
  212. .p_act {
  213. background: #EA252C;
  214. color: #fff;
  215. border: inherit;
  216. }
  217. }
  218. .m_paging_item:hover {
  219. background: #EA252C;
  220. color: #fff;
  221. border: inherit;
  222. }
  223. .m_act1 {
  224. color: #FF0019;
  225. }
  226. </style>