金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.8 KiB

  1. <template>
  2. <view id="gidList">
  3. <view class="gidItem mx-1px-bottom" v-for="(item, index) in list" :key="index">
  4. <view class="wap">
  5. <span class="title">群名称</span>
  6. <open-data type="groupName" :open-gid="item.group_id"></open-data>
  7. </view>
  8. <view class="wap">
  9. <span class="title"> I D</span>
  10. <span class="name">{{item.group_id}}</span>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {pageLogin, getUrl,config} from '@/common/js/utils.js';
  17. export default {
  18. data() {
  19. return {
  20. list: []
  21. };
  22. },
  23. onLoad(e) {
  24. this.getGidList();
  25. },
  26. components: {},
  27. props: {},
  28. methods: {
  29. getGidList() {
  30. var token = this.$cookieStorage.get('user_token');
  31. this.$http.get({
  32. api: 'api/group/list',
  33. header: {
  34. Authorization: token
  35. },
  36. data: {
  37. limit: 1000
  38. }
  39. }).then(res => {
  40. if (res.statusCode == 200) {
  41. res = res.data;
  42. if (res.status) {
  43. this.setData({
  44. list: res.data
  45. });
  46. } else {}
  47. } else {}
  48. });
  49. },
  50. setData: function (obj) {
  51. let that = this;
  52. let keys = [];
  53. let val, data;
  54. Object.keys(obj).forEach(function (key) {
  55. keys = key.split('.');
  56. val = obj[key];
  57. data = that.$data;
  58. keys.forEach(function (key2, index) {
  59. if (index + 1 == keys.length) {
  60. that.$set(data, key2, val);
  61. } else {
  62. if (!data[key2]) {
  63. that.$set(data, key2, {});
  64. }
  65. }
  66. data = data[key2];
  67. });
  68. });
  69. }
  70. },
  71. computed: {},
  72. watch: {}
  73. };
  74. </script>
  75. <style rel="stylesheet/less" lang="less">
  76. @import "gidList";
  77. </style>