success.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="success">
  3. <image src="../static/images/bmcg.png"></image>
  4. <view class="tip">报名成功</view>
  5. <view class="tips">您已成功报名该活动,<!-- 请耐心等待主办方审核。预计1-3个工作日内审核完成, -->点击“<navigator url="/match/activitys/activity" hover-class="none" class="mine">我报名的活动</navigator>”查看详情</view>
  6. <!-- #ifndef H5 -->
  7. <button open-type="share" class="share">分享活动</button>
  8. <!-- #endif -->
  9. <!-- #ifdef H5 -->
  10. <view class="share" @click="showSharePop()">分享活动</view>
  11. <!-- #endif -->
  12. <navigator url="/match/activity/activity" open-type="reLaunch" hover-class="none" class="backhome">更多活动</navigator>
  13. <!-- #ifdef H5 -->
  14. <view class="share-pop" @click="hideSharePop" v-if="isShowSharePop">
  15. <image src="../static/fx-tip1.png"></image>
  16. </view>
  17. <wx-share :title="detail.title" :image="detail.pic" :desc="detail.brief" :type="2" :id="options.id" />
  18. <!-- #endif -->
  19. </view>
  20. </template>
  21. <script>
  22. const req = require('../../utils/request.js');
  23. const api = require('../../utils/api.js');
  24. const util = require('../../utils/util.js');
  25. const app = getApp();
  26. import mpHtml from "../../components/mp-html/components/mp-html/mp-html";
  27. export default {
  28. components: {
  29. mpHtml,
  30. },
  31. data() {
  32. return {
  33. options: {},
  34. detail: {},
  35. config: '',
  36. isShowSharePop: false
  37. };
  38. },
  39. onLoad(options) {
  40. // #ifndef H5
  41. uni.showShareMenu({
  42. withShareTicket: true,
  43. menus: ['shareAppMessage', 'shareTimeline']
  44. });
  45. // #endif
  46. this.options = options;
  47. },
  48. onShow() {
  49. if(req.getStorage('configRes')) this.config = JSON.parse(req.getStorage('configRes'));
  50. this.getData(true);
  51. },
  52. onReachBottom: function() {
  53. },
  54. onShareAppMessage: function() {
  55. let path = '';
  56. let isSolution = req.env[req.env.NODE_ENV].isSolution;
  57. let userInfo = req.getStorage('userInfo');
  58. if(isSolution){
  59. path = '/share/home/index?appId='+req.getStorage('appId')+'&userId='+userInfo.id;
  60. }else{
  61. path = '/match/activityDetail/activityDetail?id=' + this.detail.id;
  62. }
  63. this.saveShareBehavior();
  64. return {
  65. title: this.detail.title,
  66. imageUrl:this.detail.pic,
  67. path: path
  68. };
  69. },
  70. onShareTimeline() {
  71. this.saveShareBehavior();
  72. return {
  73. title: this.detail.title,
  74. image: this.detail.pic,
  75. query: '/match/activityDetail/activityDetail?id=' + this.detail.id
  76. };
  77. },
  78. methods: {
  79. showSharePop() {
  80. this.isShowSharePop = true;
  81. },
  82. hideSharePop() {
  83. this.isShowSharePop = false;
  84. },
  85. getData(isShow){
  86. req.getRequest('/api/match/detail',{id: this.options.id},res => {
  87. this.detail = res;
  88. },isShow);
  89. },
  90. saveShareBehavior(){
  91. let params={
  92. behavior: 6,
  93. type: 2,
  94. bindId: this.detail.id,
  95. }
  96. req.saveBehavior(params, data => {});
  97. },
  98. }
  99. };
  100. </script>
  101. <style>
  102. @import "./success.css";
  103. </style>