Show.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div>
  3. <common @asynCallBack="asynCallBack"></common>
  4. <top-header :pageTitle="pageTitle" :routeName="routeName" ></top-header>
  5. <div class="mui-content">
  6. <div class="mui-content-padded">
  7. <img src="~$project/assets/img/03.jpg" width="100%"/>
  8. </div>
  9. </div>
  10. <div class="fyy-footer">
  11. <div class="bindfyy-btn">
  12. <button type="submit" class="mui-btn mui-btn-pink" @click="toPay()" v-text="paytext">开通服务</button>
  13. </div>
  14. </div>
  15. <loading :visible="isLoading"></loading>
  16. </div>
  17. </template>
  18. <script>
  19. import * as API from '@/apis/Master/live'
  20. import Common from '$project/components/Common.vue'
  21. import Loading from '$project/components/Loading.vue'
  22. import TopHeader from '$project/components/TopHeader.vue'
  23. import {
  24. mapGetters,
  25. mapMutations
  26. } from 'vuex'
  27. import {
  28. currentTimeStamp,
  29. parseUnixTime
  30. } from '$project/utils'
  31. export default {
  32. name: 'GuestFromInfo',
  33. components: {
  34. Common,
  35. Loading,
  36. TopHeader
  37. },
  38. data() {
  39. return {
  40. pageTitle: '产品介绍',
  41. routeName: "MasterLiveInfo",
  42. isLoading: false,
  43. paytext: "点击购买",
  44. orderId: null,
  45. id: this.$route.query.id,
  46. detail: {
  47. order: {},
  48. info: null,
  49. list: []
  50. },
  51. }
  52. },
  53. created() {
  54. //接收参数来实现返回的页面是哪一种
  55. if (this.$route.query.routeName) {
  56. this.routeName = this.$route.query.routeName;
  57. }
  58. },
  59. methods: {
  60. toPay() {
  61. this.isLoading = true;
  62. API.submit({
  63. "personId": this.person_data.id,
  64. "payPersonId": this.person_data.id,
  65. }).then(data => {
  66. var url = window.location.href.split("#")[0];
  67. var param = JSON.stringify(data).replace("{", "").replace("}", "").replace(/\",\"/g, "&").replace(/,\"/g, "&").replace(
  68. /:/g, "=").replace(/\":\"/g, "=").replace(/\"/g, "");
  69. param = param.replace('=//', '://');
  70. window.location = url + "?#/master/live/pay?" + param;
  71. }).catch(error => {
  72. this.isLoading = false;
  73. mui.toast(error);
  74. })
  75. },asynCallBack(){},
  76. },
  77. mounted() {
  78. },
  79. destroyed() {
  80. },
  81. computed: {
  82. ...mapGetters({
  83. openId: 'wx_openid',
  84. token: 'token',
  85. person_data: 'person_data',
  86. person_popedom: 'person_popedom',
  87. })
  88. }
  89. }
  90. </script>
  91. <style scoped src="$project/assets/css/pension.css"></style>
  92. <style scoped src="$project/assets/css/xpwyfyy.css"></style>
  93. <style src="$project/assets/css/iconfont.css"></style>
  94. <style>
  95. </style>