poster.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view>
  3. <view v-if="user_share_qrode != null || user_share_url != null" class="padding-main">
  4. <!-- 二维码 -->
  5. <view v-if="user_share_qrode != null" class="share qrcode padding-main border-radius-main bg-white spacing-mb">
  6. <view class="title border-color-main padding-left-lg text-size fw-b">二维码分享</view>
  7. <view class="cr-gray br-b padding-vertical-main">
  8. 保存二维码后,发送给微信好友/群、QQ好友/群,分享到分朋友圈,微博等进行推广,轻轻松松赚返利!
  9. </view>
  10. <view class="margin-top-lg">
  11. <image :src="user_share_qrode" class="wh-auto dis-block radius" mode="widthFix"></image>
  12. </view>
  13. <view class="margin-top-lg">
  14. <button class="dis-block wh-auto bg-white cr-green br-green round" type="default" size="mini" hover-class="none" @tap="images_show_event" :data-value="user_share_qrode">查看二维码长按保存</button>
  15. </view>
  16. </view>
  17. <!-- 链接 -->
  18. <view v-if="user_share_url != null" class="share url padding-main border-radius-main bg-white spacing-mb">
  19. <view class="title border-color-main padding-left-lg text-size fw-b">链接分享</view>
  20. <view class="cr-gray br-b padding-vertical-main">
  21. 复制以下链接,发送给微信好友/群、QQ好友/群,分享到分朋友圈,微博等进行推广,轻轻松松赚返利!
  22. </view>
  23. <view class="cr-main text-size margin-top-lg">{{user_share_url}}</view>
  24. <view class="margin-top-lg">
  25. <button class="dis-block wh-auto bg-white cr-green br-green round" type="default" size="mini" hover-class="none" @tap="url_event" :data-value="user_share_url">点击复制链接地址</button>
  26. </view>
  27. </view>
  28. <!-- 结尾 -->
  29. <component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
  30. </view>
  31. <view v-else>
  32. <!-- 提示信息 -->
  33. <component-no-data :propStatus="data_list_loding_status"></component-no-data>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. const app = getApp();
  39. import componentNoData from "../../../../components/no-data/no-data";
  40. import componentBottomLine from "../../../../components/bottom-line/bottom-line";
  41. export default {
  42. data() {
  43. return {
  44. data_list_loding_status: 1,
  45. data_list_loding_msg: '加载中...',
  46. data_bottom_line_status: false,
  47. user_share_qrode: null,
  48. user_share_url: null
  49. };
  50. },
  51. components: {
  52. componentNoData,
  53. componentBottomLine
  54. },
  55. props: {},
  56. onLoad() {
  57. this.init();
  58. },
  59. onShow() {
  60. // 分享菜单处理
  61. app.globalData.page_share_handle();
  62. },
  63. // 下拉刷新
  64. onPullDownRefresh() {
  65. this.init();
  66. },
  67. methods: {
  68. init() {
  69. uni.showLoading({
  70. title: '加载中...'
  71. });
  72. this.setData({
  73. data_list_loding_status: 1
  74. });
  75. uni.request({
  76. url: app.globalData.get_request_url("index", "poster", "membershiplevelvip"),
  77. method: 'POST',
  78. data: {},
  79. dataType: 'json',
  80. success: res => {
  81. uni.hideLoading();
  82. uni.stopPullDownRefresh();
  83. if (res.data.code == 0) {
  84. var data = res.data.data;
  85. this.setData({
  86. user_share_qrode: data.user_share_qrode || null,
  87. user_share_url: data.user_share_url || null,
  88. data_list_loding_status: 3,
  89. data_bottom_line_status: true,
  90. data_list_loding_msg: ''
  91. });
  92. // 是否全部没数据
  93. if (this.user_share_qrode == null && this.user_share_url == null) {
  94. this.setData({
  95. data_list_loding_status: 0,
  96. data_bottom_line_status: false
  97. });
  98. }
  99. } else {
  100. this.setData({
  101. data_list_loding_status: 2,
  102. data_bottom_line_status: false,
  103. data_list_loding_msg: res.data.msg
  104. });
  105. if (app.globalData.is_login_check(res.data, this, 'init')) {
  106. app.globalData.showToast(res.data.msg);
  107. }
  108. }
  109. },
  110. fail: () => {
  111. uni.hideLoading();
  112. uni.stopPullDownRefresh();
  113. this.setData({
  114. data_list_loding_status: 2,
  115. data_bottom_line_status: false,
  116. data_list_loding_msg: '服务器请求出错'
  117. });
  118. app.globalData.showToast('服务器请求出错');
  119. }
  120. });
  121. },
  122. // 图片查看事件
  123. images_show_event(e) {
  124. var value = e.currentTarget.dataset.value || null;
  125. if (value != null) {
  126. uni.previewImage({
  127. current: value,
  128. urls: [value]
  129. });
  130. } else {
  131. app.globalData.showToast('宣传图片地址有误');
  132. }
  133. },
  134. // url事件
  135. url_event(e) {
  136. app.globalData.text_copy_event(e);
  137. }
  138. }
  139. };
  140. </script>
  141. <style>
  142. @import './poster.css';
  143. </style>