commission-condition.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <su-popup
  3. :show="state.show"
  4. type="bottom"
  5. round="10"
  6. :isMaskClick="false"
  7. :backgroundImage="sheep.$url.css('/static/img/shop/commission/become-agent.png')"
  8. @close="show = false"
  9. backgroundColor="var(--ui-BG-Main)"
  10. >
  11. <view class="model-box ss-flex ss-row-center">
  12. <view class="content">
  13. <scroll-view
  14. class="scroll-box"
  15. scroll-y="true"
  16. :scroll-with-animation="true"
  17. :show-scrollbar="false"
  18. >
  19. <view v-if="errorData.type === 'goods'">
  20. <view class="item-box ss-m-b-20" v-for="item in errorData.value" :key="item.id">
  21. <s-goods-item :title="item.title" :img="item.image" :price="item.price[0]" priceColor="#E1212B" @tap="sheep.$router.go('/pages/goods/index', { id: item.id })">
  22. <template #groupon>
  23. <view class="item-box-subtitle">{{ item.subtitle }}</view>
  24. </template>
  25. </s-goods-item>
  26. </view>
  27. </view>
  28. <s-goods-item
  29. title="累计消费满"
  30. price=""
  31. :img="sheep.$url.static('/static/img/shop/commission/consume.png')"
  32. v-else-if="errorData.type === 'consume'"
  33. >
  34. <template #groupon>
  35. <view class="ss-flex">
  36. <view class="progress-box ss-flex">
  37. <view
  38. class="progerss-active"
  39. :style="{
  40. width: state.percent < 10 ? '10%' : state.percent + '%',
  41. }"
  42. ></view>
  43. </view>
  44. <view class="progress-title ss-m-l-10">{{ errorData.value }}元</view>
  45. </view>
  46. <view class="progress-title ss-m-t-20">{{ userInfo.total_consume }}元</view>
  47. </template>
  48. </s-goods-item>
  49. </scroll-view>
  50. <view class="content-des" v-if="errorData.type === 'goods'"
  51. >* 购买指定商品即可成为分销商</view
  52. >
  53. <view class="content-des" v-else-if="errorData.type === 'consume'"
  54. >* 满足累计消费即可成为分销商</view
  55. >
  56. </view>
  57. <button class="ss-reset-button go-btn ui-BG-Main-Gradient" @tap="sheep.$router.back()">
  58. 返回
  59. </button>
  60. </view>
  61. </su-popup>
  62. </template>
  63. <script setup>
  64. import sheep from '@/sheep';
  65. import { computed, reactive, watch } from 'vue';
  66. import { onLoad } from '@dcloudio/uni-app';
  67. const props = defineProps({
  68. error: {
  69. type: Number,
  70. default: 0,
  71. },
  72. errorData: {
  73. type: Object,
  74. default() {},
  75. },
  76. });
  77. const userInfo = computed(() => sheep.$store('user').userInfo);
  78. const state = reactive({
  79. percent: computed(() => {
  80. if (props.errorData.type !== 'consume') {
  81. return 0;
  82. }
  83. let percent = (userInfo.value.total_consume / props.errorData.value) * 100;
  84. return parseInt(percent);
  85. }),
  86. show: false,
  87. money: '',
  88. });
  89. watch(
  90. () => props.error,
  91. (error) => {
  92. if (error == 100) {
  93. state.show = true;
  94. }
  95. },
  96. );
  97. </script>
  98. <style lang="scss" scoped>
  99. :deep() {
  100. .ss-goods-item-warp {
  101. background-color: #f8f8f8 !important;
  102. }
  103. }
  104. .progress-title {
  105. font-size: 20rpx;
  106. font-weight: 500;
  107. color: #666666;
  108. }
  109. .progress-box {
  110. flex: 1;
  111. height: 18rpx;
  112. background: #e7e7e7;
  113. border-radius: 9rpx;
  114. }
  115. .progerss-active {
  116. height: 24rpx;
  117. background: linear-gradient(90deg, #ff6000 0%, #fe832a 100%);
  118. border-radius: 12rpx;
  119. }
  120. .model-box {
  121. padding: 140rpx 40rpx 60rpx 40rpx;
  122. height: 916rpx;
  123. box-sizing: border-box;
  124. position: relative;
  125. .content {
  126. height: 720rpx;
  127. width: 612rpx;
  128. padding-top: 30rpx;
  129. // background-color: #fff;
  130. box-sizing: border-box;
  131. .content-des {
  132. margin-top: 20rpx;
  133. font-size: 24rpx;
  134. font-weight: 500;
  135. color: #999999;
  136. text-align: center;
  137. }
  138. }
  139. .scroll-box {
  140. height: 620rpx;
  141. }
  142. .item-box-subtitle {
  143. font-size: 24rpx;
  144. font-weight: 500;
  145. color: #999999;
  146. line-height: normal;
  147. }
  148. .go-btn {
  149. width: 600rpx;
  150. height: 70rpx;
  151. position: absolute;
  152. left: 50%;
  153. transform: translateX(-50%);
  154. bottom: 120rpx;
  155. border-radius: 35rpx;
  156. font-size: 28rpx;
  157. font-weight: 500;
  158. }
  159. }
  160. </style>