bind.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div id="bind">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
  7. </el-col>
  8. <el-col :span="24" class="main">
  9. <el-button @click="bindBtn()" type="primary">确认绑定</el-button>
  10. </el-col>
  11. </el-col>
  12. </el-row>
  13. </div>
  14. </template>
  15. <script>
  16. import NavBar from '@/layout/common/topInfo.vue';
  17. import { mapState, createNamespacedHelpers } from 'vuex';
  18. const { mapActions: authUser } = createNamespacedHelpers('authUser');
  19. export default {
  20. name: 'bind',
  21. props: {},
  22. components: {
  23. NavBar,
  24. },
  25. data: () => ({
  26. // 头部标题
  27. title: '',
  28. // meta为true
  29. isleftarrow: '',
  30. // 返回
  31. navShow: true,
  32. }),
  33. created() {},
  34. computed: {
  35. uid() {
  36. return this.$route.query.uid;
  37. },
  38. },
  39. methods: {
  40. ...authUser(['bind']),
  41. async bindBtn() {
  42. let data = {};
  43. data.uid = this.uid;
  44. data.openid = '05';
  45. let res = await this.bind(data);
  46. if (res.errcode == '0') {
  47. this.$message({
  48. message: '绑定成功',
  49. type: 'success',
  50. });
  51. }
  52. },
  53. },
  54. mounted() {
  55. this.title = this.$route.meta.title;
  56. this.isleftarrow = this.$route.meta.isleftarrow;
  57. },
  58. };
  59. </script>
  60. <style lang="less" scoped>
  61. .style {
  62. width: 100%;
  63. min-height: 667px;
  64. position: relative;
  65. background-color: #f9fafc;
  66. }
  67. .top {
  68. height: 46px;
  69. overflow: hidden;
  70. }
  71. .main {
  72. min-height: 570px;
  73. padding: 150px;
  74. }
  75. .foot {
  76. position: absolute;
  77. bottom: 0;
  78. }
  79. </style>