index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <script>
  2. import propertyList from '@/utils/propertyList.js';
  3. import template1 from './template1.vue';
  4. import template2 from './template2.vue';
  5. import template3 from './template3.vue';
  6. import template4 from './template4.vue';
  7. import template5 from './template5.vue';
  8. // #ifdef MP || APP-PLUS
  9. import topBar from '../topBar.vue';
  10. // #endif
  11. export default {
  12. components: {
  13. template1,
  14. template2,
  15. template3,
  16. template4,
  17. template5,
  18. // #ifdef MP || APP-PLUS
  19. topBar
  20. // #endif
  21. },
  22. props: {
  23. userInfo: {
  24. type: Object,
  25. default: () => {}
  26. },
  27. memberData: {
  28. type: Object,
  29. default: () => {}
  30. },
  31. orderAdminData: {
  32. type: Object,
  33. default: () => {}
  34. },
  35. isScrolling: {
  36. type: Boolean,
  37. default: false
  38. },
  39. balanceStatus: {
  40. type: Number,
  41. default: 0
  42. }
  43. },
  44. data() {
  45. return {
  46. property: []
  47. };
  48. },
  49. watch: {
  50. memberData: {
  51. handler(nVal, oVal) {
  52. this.$nextTick((e) => {
  53. this.getPropertyArr(nVal.property);
  54. });
  55. },
  56. immediate: true,
  57. deep: true
  58. },
  59. userInfo: {
  60. handler(nVal, oVal) {
  61. this.$nextTick((e) => {
  62. this.getPropertyArr(this.memberData.property);
  63. });
  64. },
  65. deep: true
  66. }
  67. },
  68. methods: {
  69. getPropertyArr(arr) {
  70. let data = [];
  71. const propertyFilter = propertyList.filter((item) => {
  72. return arr.includes(item.value);
  73. });
  74. propertyFilter.forEach((item) => {
  75. if ((item.value == 0 && this.balanceStatus) || item.value != 0) {
  76. data.push({
  77. ...item,
  78. value: this.userInfo[item.k]
  79. });
  80. }
  81. });
  82. this.property = data;
  83. }
  84. }
  85. };
  86. </script>
  87. <template>
  88. <view>
  89. <!-- #ifdef MP || APP-PLUS -->
  90. <topBar v-if="memberData.style != 5" :styleType="memberData.style" :isScrolling="isScrolling"></topBar>
  91. <!-- #endif -->
  92. <template1 v-if="memberData.style == 1" :perShowType="memberData.per_show_type" :userInfo="userInfo" :property="property"></template1>
  93. <template2 v-if="memberData.style == 2" :perShowType="memberData.per_show_type" :userInfo="userInfo" :property="property"></template2>
  94. <template3 v-if="memberData.style == 3" :perShowType="memberData.per_show_type" :userInfo="userInfo" :property="property"></template3>
  95. <template4 v-if="memberData.style == 4" :perShowType="memberData.per_show_type" :userInfo="userInfo" :commission="orderAdminData.commission"></template4>
  96. <template5
  97. v-if="memberData.style == 5"
  98. :perShowType="memberData.per_show_type"
  99. :userInfo="userInfo"
  100. :commission="orderAdminData.commission"
  101. :isScrolling="isScrolling"
  102. :property="property"
  103. ></template5>
  104. </view>
  105. </template>
  106. <style lang="scss">
  107. /deep/ .bind-phone {
  108. margin-top: 12rpx;
  109. background: rgba(255, 255, 255, 0.3);
  110. border-radius: 30px;
  111. width: max-content;
  112. text-align: center;
  113. font-size: 20rpx;
  114. font-weight: 400;
  115. color: #ffffff;
  116. line-height: 28rpx;
  117. padding: 6rpx 16rpx;
  118. }
  119. /deep/ .tips::before {
  120. content: '';
  121. position: absolute;
  122. bottom: -6rpx;
  123. left: calc(50% - 6rpx);
  124. width: 0;
  125. height: 0;
  126. border-left: 6rpx solid transparent;
  127. border-right: 6rpx solid transparent;
  128. border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
  129. }
  130. </style>