bind.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. openid() {
  39. return this.$route.query.openid;
  40. },
  41. },
  42. methods: {
  43. ...authUser(['bind']),
  44. async bindBtn() {
  45. let data = {};
  46. data.uid = this.uid;
  47. data.openid = this.openid;
  48. console.log(data);
  49. let res = await this.bind(data);
  50. if (res.errcode == '0') {
  51. this.$message({
  52. message: '绑定成功',
  53. type: 'success',
  54. });
  55. }
  56. },
  57. },
  58. mounted() {
  59. this.title = this.$route.meta.title;
  60. this.isleftarrow = this.$route.meta.isleftarrow;
  61. },
  62. };
  63. </script>
  64. <style lang="less" scoped>
  65. .style {
  66. width: 100%;
  67. min-height: 667px;
  68. position: relative;
  69. background-color: #f9fafc;
  70. }
  71. .top {
  72. height: 46px;
  73. overflow: hidden;
  74. }
  75. .main {
  76. min-height: 570px;
  77. padding: 150px;
  78. }
  79. .foot {
  80. position: absolute;
  81. bottom: 0;
  82. }
  83. </style>