index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="container">
  3. <navBar title="推荐奖励" :back="true" color="#333333" background="#FFFFFF" />
  4. <view class="outerBox" :style="{'background-image':`url(${picBase+'jl_bg2.png'})`}">
  5. <view class="addPd">
  6. <view class="countBox" :style="{'background-image':`url(${picBase+'jl_c_bg.png'})`}">
  7. <view class="left">
  8. <view class="num">
  9. {{jiangli.currentDiamondCount}}
  10. </view>
  11. <view class="tip">
  12. 剩余次数
  13. </view>
  14. </view>
  15. <view class="right">
  16. <view class="num">
  17. {{jiangli.shareDiamondCount}}
  18. </view>
  19. <view class="tip">
  20. 推荐奖励次数
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- <view class="mianContent" :style="{'background-image':`url(${picBase+'my_b_bg.png'})`}"> -->
  26. <!-- <view class="mianContent" :style="{'background-image':`url(../../../static/other/bg_9.png)`}"> -->
  27. <view class="mianContent" :style="">
  28. <!-- <view class="sanjiaoxing">
  29. </view> -->
  30. <view class="pPos">
  31. </view>
  32. <view class="tipBox">
  33. <view class="top">
  34. <!-- <view class="tag">
  35. TIPS
  36. </view> -->
  37. <image :src="picBase+'hb_tips.png'" mode="" class="tag"></image>
  38. 推荐奖励说明
  39. </view>
  40. <view class="bot">
  41. <!-- 推荐新用户,新用户成功注册后,将奖励推荐次数5次。推荐越多,奖励将会越多哦! -->
  42. {{sm}}
  43. </view>
  44. </view>
  45. <view class="titleBox">
  46. <image :src="picBase+'s_star.png'" mode="heightFix" class="starIcon" @click=""></image>
  47. 推荐奖励明细
  48. </view>
  49. <view class="list">
  50. <view class="empty" style="margin-top: 5%;" v-if="jiangli.data.length==0">
  51. <u-empty mode="data" />
  52. </view>
  53. <view class="" v-else>
  54. <view class="item" v-for="(item,index) in jiangli.data">
  55. <view class="left">
  56. <image :src="item.user.avatar?item.user.avatar:picBase+'defaultAvatar.png'" mode=""
  57. class="avatar"></image>
  58. <view class="des">
  59. <view class="name">
  60. {{item.user.name?item.user.name:'默认用户'}}
  61. </view>
  62. <view class="time">
  63. {{item.updated_at}}
  64. </view>
  65. </view>
  66. </view>
  67. <view class="right">
  68. 奖励次数:{{item.diamond}}
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="btnBox">
  76. <!-- <view class="btn" @click="toTuijian">
  77. 立即推荐
  78. </view> -->
  79. <button open-type="share" class="btn">
  80. 立即推荐
  81. </button>
  82. </view>
  83. <!-- <view class="" style="height: 800px;">
  84. </view> -->
  85. </view>
  86. </template>
  87. <script>
  88. import {
  89. getTuijian,
  90. getPosterBg
  91. } from '@/api/index/index.js'
  92. // import navBar from '@/components/navBar/index.vue'
  93. export default {
  94. // components: {
  95. // navBar
  96. // },
  97. data() {
  98. return {
  99. picBase: this.$picBase2,
  100. jiangli: {
  101. data: []
  102. },
  103. shareTitle: null,
  104. shareImg: '',
  105. sm: ''
  106. }
  107. },
  108. onLoad() {
  109. this.getTuijian()
  110. this.getShare()
  111. },
  112. onShareAppMessage(params) {
  113. if (params.from === 'button' || params.from === 'menu') {
  114. return {
  115. title: this.shareTitle,
  116. imageUrl: this.$ossBaseUrl + this.shareImg,
  117. path: '/pages/index/index?scene=' + uni.getStorageSync('userInfo').id || '',
  118. mpId: this.$appId,
  119. type: this.$shareType,
  120. }
  121. }
  122. },
  123. methods: {
  124. async getShare() {
  125. let res1 = await getPosterBg({
  126. key: 'share_title'
  127. })
  128. console.log('分享信息返回值--------1', res1);
  129. if (res1.code == 0) {
  130. this.shareTitle = res1.data.value
  131. } else {
  132. this.$toast(res1.message)
  133. }
  134. let res2 = await getPosterBg({
  135. key: 'share_image'
  136. })
  137. console.log('分享信息返回值--------2', res2);
  138. if (res2.code == 0) {
  139. this.shareImg = res2.data.value
  140. } else {
  141. this.$toast(res2.message)
  142. }
  143. let res3 = await getPosterBg({
  144. key: 'push_promotion'
  145. })
  146. console.log('奖励说明返回值--------2', res3);
  147. if (res3.code == 0) {
  148. this.sm = res3.data.value
  149. } else {
  150. this.$toast(res3.message)
  151. }
  152. //
  153. },
  154. toTuijian() {
  155. // uni.navigateTo({
  156. // url: '/pages/my/tuiguangDashi/index'
  157. // })
  158. },
  159. async getTuijian() {
  160. let res1 = await getTuijian()
  161. console.log('推荐奖励返回值--------2', res1);
  162. if (res1.code == 0) {
  163. this.jiangli = res1.data
  164. } else {
  165. this.$toast(res1.message)
  166. }
  167. },
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. @import "./index.scss";
  173. </style>