spread.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view class="conteiner" style="height: 100%;">
  3. <view class="img"><image src="https://mmz.liuniu946.com/statics/img/img02.png"></image></view>
  4. <view class="spread-content">
  5. <!-- #ifndef MP -->
  6. <view class="spread-header">
  7. <!-- <view class="box-bg">
  8. </view> -->
  9. <view class="return" @click="switchTab('/pages/user/user')"><image src="../../static/img/img03.png"></image></view>
  10. <view class="spread-title">我的推广</view>
  11. </view>
  12. <!-- #endif -->
  13. <view class="current-money">当前佣金</view>
  14. <view class="money">¥{{ money | getMoneyStyle }}</view>
  15. </view>
  16. <view class="spread-box">
  17. <!-- pages/user/share -->
  18. <!-- #ifndef APP-PLUS -->
  19. <navigator class="box-item" url="/pages/user/ShareIndex">
  20. <view class="box-bg"><image src="../../static/img/erweima.png"></image></view>
  21. <view class="box-info">邀请好友</view>
  22. </navigator>
  23. <!-- #endif -->
  24. <!-- #ifdef APP-PLUS -->
  25. <view class="box-item" @click="shareMp">
  26. <view class="box-bg"><image src="../../static/img/erweima.png"></image></view>
  27. <view class="box-info">邀请好友</view>
  28. </view>
  29. <!-- #endif -->
  30. <navigator class="box-item" url="/pages/extension/extension">
  31. <view class="box-bg"><image class="img" src="https://mmz.liuniu946.com/statics/img/team.png"></image></view>
  32. <view class="box-info">我的团队</view>
  33. </navigator>
  34. <navigator class="box-item" url="/pages/award/award">
  35. <view class="box-bg"><image src="../../static/img/detaile.png"></image></view>
  36. <view class="box-info">佣金明细</view>
  37. </navigator>
  38. <navigator class="box-item" url="/pages/recommen/order">
  39. <view class="box-bg"><image src="../../static/img/list.png"></image></view>
  40. <view class="box-info">推广人订单</view>
  41. </navigator>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import { commission } from '@/api/wallet.js';
  47. import { getMoneyStyle } from '@/utils/rocessor.js';
  48. export default {
  49. filters: {
  50. getMoneyStyle
  51. },
  52. data() {
  53. return {
  54. money: '' // 佣金
  55. };
  56. },
  57. onLoad() {
  58. },
  59. onShow() {
  60. this.onfirst();
  61. },
  62. methods: {
  63. onfirst(){
  64. // 获取用户佣金
  65. commission({}).then(({ data }) => {
  66. this.money = data.commissionCount;
  67. });
  68. },
  69. // #ifdef APP-PLUS
  70. shareMp(){
  71. uni.showModal({
  72. title: '提示',
  73. content: '需要微信开发平台进行配置',
  74. showCancel: false,
  75. success: res => {},
  76. fail: () => {},
  77. complete: () => {}
  78. });
  79. uni.share({
  80. provider:'weixin',
  81. scene: "WXSceneSession",
  82. title:'邀请好友',
  83. type:'5',//5为小程序
  84. miniProgram:{
  85. id:'gh_ae4872203499',//微信小程序原始id
  86. path:'pages/user/ShareIndex',//链接地址
  87. type:0, //0-正式版; 1-测试版; 2-体验版。 默认值为0
  88. },//分享小程序必要值
  89. imageUrl:'',//图片地址
  90. success (){
  91. console.log('成功')
  92. },
  93. fail(res) {
  94. console.log(res,'失败')
  95. }
  96. })
  97. },
  98. // #endif
  99. onLoad() {
  100. if (this.isLogin) {
  101. this.getUserInfo();
  102. } else {
  103. // #ifdef H5 || APP-PLUS
  104. // toLogin();
  105. // #endif
  106. // #ifdef MP
  107. // this.isAuto = true;
  108. // this.$set(this, 'isShowAuth', true)
  109. // #endif
  110. }
  111. },
  112. switchTab(url) {
  113. uni.switchTab({
  114. url
  115. });
  116. },
  117. // 跳转
  118. navTo(url) {
  119. uni.navigateTo({
  120. url: '/pages/user/user'
  121. });
  122. },
  123. /**
  124. * 获取个人用户信息
  125. */
  126. getUserInfo: function() {
  127. let that = this;
  128. getUserInfo().then(res => {
  129. that.$set(that, 'userInfo', res.data);
  130. });
  131. }
  132. }
  133. };
  134. </script>
  135. <style lang="scss">
  136. page,
  137. .conteiner {
  138. background-color: #f0f0f0;
  139. height: 100%;
  140. }
  141. .conteiner {
  142. width: 100%;
  143. height: 100%;
  144. position: relative;
  145. // background-color: pink;
  146. .img {
  147. width: 100%;
  148. image {
  149. width: 100%;
  150. }
  151. }
  152. .spread-content {
  153. position: absolute;
  154. top: 0;
  155. left: 0;
  156. width: 100%;
  157. height: 600rpx;
  158. padding: 0 24rpx;
  159. .spread-header {
  160. margin-top: 30rpx;
  161. display: flex;
  162. .return {
  163. width: 21rpx;
  164. height: 36rpx;
  165. image {
  166. width: 21rpx;
  167. height: 36rpx;
  168. }
  169. }
  170. .spread-title {
  171. width: 100%;
  172. text-align: center;
  173. color: #fff;
  174. font-size: 32rpx;
  175. }
  176. }
  177. .current-money {
  178. color: #fff;
  179. font-size: 24rpx;
  180. margin-top: 54rpx;
  181. }
  182. .money {
  183. font-size: 82rpx;
  184. color: #fff;
  185. margin: 82rpx auto;
  186. text-align: center;
  187. }
  188. }
  189. .spread-box {
  190. width: 94%;
  191. height: 600rpx;
  192. background-color: #fff;
  193. margin: 0 24rpx 216rpx 24rpx;
  194. position: absolute;
  195. top: 420rpx;
  196. margin-left: 24rpx;
  197. display: flex;
  198. flex-wrap: wrap;
  199. justify-content: center;
  200. border-radius: 10rpx;
  201. // margin-right: 224rpx;
  202. left: 0;
  203. .box-item {
  204. width: 50%;
  205. .box-bg {
  206. width: 88rpx;
  207. height: 88rpx;
  208. margin: 0 auto;
  209. margin-top: 66rpx;
  210. image {
  211. width: 88rpx;
  212. height: 88rpx;
  213. // margin: 77rpx auto;
  214. }
  215. .img {
  216. width: 99rpx;
  217. height: 75rpx;
  218. // margin: 77rpx auto;
  219. }
  220. }
  221. .box-info {
  222. color: #666666;
  223. font-size: 30rpx;
  224. text-align: center;
  225. margin-top: 40rpx;
  226. }
  227. }
  228. }
  229. }
  230. </style>