index.vue 4.2 KB

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