user-1.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div id="list-1">
  3. <van-col span="24" class="main">
  4. <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
  5. <van-col span="24" class="title">
  6. {{ item.name }}
  7. </van-col>
  8. <van-col span="24" class="other">
  9. <van-col span="24" class="otherInfo">
  10. 组织机构代码:<span>{{ item.institution_code || '暂无' }}</span>
  11. </van-col>
  12. <van-col span="24" class="otherInfo">
  13. 所属辖区:<span>{{ item.juris || '暂无' }}</span>
  14. </van-col>
  15. </van-col>
  16. <van-col span="24" class="btn">
  17. <el-button type="primary" size="mini" @click="bind(item)" v-if="item.openid == null">绑定</el-button>
  18. <el-button type="danger" size="mini" @click="removeBind(item)" v-if="item.openid">解绑</el-button>
  19. </van-col>
  20. </van-col>
  21. </van-col>
  22. </div>
  23. </template>
  24. <script>
  25. import { mapState, createNamespacedHelpers } from 'vuex';
  26. export default {
  27. name: 'list-1',
  28. props: {
  29. list: { type: Array },
  30. },
  31. components: {},
  32. data: function () {
  33. return {};
  34. },
  35. created() {},
  36. methods: {
  37. // 绑定微信
  38. bind(data) {
  39. this.$emit('bind', data);
  40. },
  41. // 接触绑定
  42. removeBind(data) {
  43. this.$emit('removeBind', data);
  44. },
  45. },
  46. computed: {
  47. ...mapState(['user']),
  48. },
  49. metaInfo() {
  50. return { title: this.$route.meta.title };
  51. },
  52. watch: {
  53. test: {
  54. deep: true,
  55. immediate: true,
  56. handler(val) {},
  57. },
  58. },
  59. };
  60. </script>
  61. <style lang="less" scoped>
  62. .main {
  63. padding: 8px 8px 0 8px;
  64. .list {
  65. background-color: #fff;
  66. margin: 0 0 8px 0;
  67. padding: 8px;
  68. border-radius: 5px;
  69. .title {
  70. font-size: 16px;
  71. font-weight: bold;
  72. margin: 0 0 5px 0;
  73. }
  74. .other {
  75. .otherInfo {
  76. font-size: 14px;
  77. color: #666;
  78. margin: 0 0 5px 0;
  79. span {
  80. color: #000;
  81. }
  82. }
  83. }
  84. .btn {
  85. text-align: center;
  86. }
  87. }
  88. }
  89. </style>