index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="page">
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
  5. left-icon="left" title="我的规则" @clickLeft="back"/>
  6. <!-- #endif -->
  7. <view class="flex-col item" v-for="(item,index) in list" :key="index">
  8. <view class="flex-row justify-between">
  9. <text class="storeName">{{ item.title }}</text>
  10. <text class="time">{{ item.createTime }}</text>
  11. </view>
  12. <view class="flex-row">
  13. <text class="key">直推:</text>
  14. <view>
  15. <view class="phone">注册现金:{{ item.awardAmount }}元</view>
  16. <view class="flex-row">
  17. <view class="phone">消费现金:{{ item.consumeAmount }}元</view>
  18. <view class="phone">消费比例:{{ item.consumeRatio * 100 }}%</view>
  19. </view>
  20. <view class="flex-row">
  21. <view class="phone">充值现金:{{ item.rechargeAmount }}元</view>
  22. <view class="phone">充值比例:{{ item.rechargeRatio * 100 }}%</view>
  23. </view>
  24. <view class="flex-row">
  25. <view class="phone">首消现金:{{ item.firstConsumeAmount }}元</view>
  26. <view class="phone">首消比例:{{ item.firstConsumeRatio * 100 }}%</view>
  27. </view>
  28. <view class="flex-row">
  29. <view class="phone">首充现金:{{ item.firstRechargeAmount }}元</view>
  30. <view class="phone">首充比例:{{ item.firstRechargeRatio * 100 }}%</view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="flex-row">
  35. <text class="key">间推:</text>
  36. <view>
  37. <view class="flex-row">
  38. <view class="phone">消费现金:{{ item.indirectAmount }}元</view>
  39. <view class="phone">消费比例:{{ item.indirectRatio * 100 }}%</view>
  40. </view>
  41. <view class="flex-row">
  42. <view class="phone">充值现金:{{ item.indirectRechargeAmount }}元</view>
  43. <view class="phone">充值比例:{{ item.indirectRechargeRatio * 100 }}%</view>
  44. </view>
  45. <view class="flex-row">
  46. <view class="phone">首消现金:{{ item.indirectFirstConsumeAmount }}元</view>
  47. <view class="phone">首消比例:{{ item.indirectFirstConsumeRatio * 100 }}%</view>
  48. </view>
  49. <view class="flex-row">
  50. <view class="phone">首充现金:{{ item.indirectFirstRechargeAmount }}元</view>
  51. <view class="phone">首充比例:{{ item.indirectFirstRechargeRatio * 100 }}%</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="flex-row" v-for="i in item.strategyList">
  56. <text class="key">优惠券:</text>
  57. <view>
  58. <view class="phone">{{i.name}}</view>
  59. </view>
  60. </view>
  61. </view>
  62. <!--#ifdef H5-->
  63. <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
  64. <!--#endif-->
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. height: '',
  72. list: [],
  73. roleId:null,
  74. }
  75. },
  76. onLoad(options) {
  77. if(options.id){
  78. this.roleId = options.id
  79. this.getInfoById()
  80. }else {
  81. this.roleId = uni.getStorageSync('spreadUserInfo').roleId
  82. console.log(this.roleId)
  83. this.getInfoById()
  84. }
  85. let sysInfo = uni.getSystemInfoSync()
  86. this.height = sysInfo.windowHeight - 120 + 'px' //除标题栏栏外的屏幕可用高度
  87. },
  88. methods: {
  89. back() {
  90. let pages = getCurrentPages()
  91. if (pages.length > 1) {
  92. uni.navigateBack({
  93. delta: 1,
  94. fail: err => {
  95. console.log(err)
  96. }
  97. })
  98. } else {
  99. uni.switchTab({
  100. url: '/pages/my/my'
  101. });
  102. }
  103. },
  104. getInfo() {
  105. this.$api.service.getRuleList( {roleId:this.roleId}).then((res) => {
  106. this.list = res.data.data
  107. })
  108. },
  109. getInfoById(){
  110. this.$api.service.getRuleByRoleId({roleId:this.roleId}).then((res) => {
  111. this.list = res.data.data
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. @import './index.rpx.css';
  119. </style>