commission-condition.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <su-popup
  3. :show="state.show"
  4. type="bottom"
  5. round="10"
  6. :isMaskClick="false"
  7. :backgroundImage="sheep.$url.css('/assets/addons/shopro/uniapp/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="$t('commission.condition.msg1')"
  30. price=""
  31. :img="sheep.$url.static('/assets/addons/shopro/uniapp/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. >* {{$t('commission.condition.msg2')}}</view
  52. >
  53. <view class="content-des" v-else-if="errorData.type === 'consume'"
  54. >* {{$t('commission.condition.msg3')}}</view
  55. >
  56. </view>
  57. <button class="ss-reset-button go-btn ui-BG-Main-Gradient" @tap="sheep.$router.back()">
  58. {{$t('common.back')}}
  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. const props = defineProps({
  67. error: {
  68. type: Number,
  69. default: 0,
  70. },
  71. errorData: {
  72. type: Object,
  73. default() {},
  74. },
  75. });
  76. const userInfo = computed(() => sheep.$store('user').userInfo);
  77. const state = reactive({
  78. percent: computed(() => {
  79. if (props.errorData.type !== 'consume') {
  80. return 0;
  81. }
  82. let percent = (userInfo.value.total_consume / props.errorData.value) * 100;
  83. return parseInt(percent);
  84. }),
  85. show: false,
  86. money: '',
  87. });
  88. watch(
  89. () => props.error,
  90. (error) => {
  91. if (error == 100) {
  92. state.show = true;
  93. }
  94. },
  95. );
  96. </script>
  97. <style lang="scss" scoped>
  98. :deep() {
  99. .ss-goods-item-warp {
  100. background-color: #f8f8f8 !important;
  101. }
  102. }
  103. .progress-title {
  104. font-size: 20rpx;
  105. font-weight: 500;
  106. color: #666666;
  107. }
  108. .progress-box {
  109. flex: 1;
  110. height: 18rpx;
  111. background: #e7e7e7;
  112. border-radius: 9rpx;
  113. }
  114. .progerss-active {
  115. height: 24rpx;
  116. background: linear-gradient(90deg, #ff6000 0%, #fe832a 100%);
  117. border-radius: 12rpx;
  118. }
  119. .model-box {
  120. padding: 140rpx 40rpx 60rpx 40rpx;
  121. height: 916rpx;
  122. box-sizing: border-box;
  123. position: relative;
  124. .content {
  125. height: 720rpx;
  126. width: 612rpx;
  127. padding-top: 30rpx;
  128. // background-color: #fff;
  129. box-sizing: border-box;
  130. .content-des {
  131. margin-top: 20rpx;
  132. font-size: 24rpx;
  133. font-weight: 500;
  134. color: #999999;
  135. text-align: center;
  136. }
  137. }
  138. .scroll-box {
  139. height: 620rpx;
  140. }
  141. .item-box-subtitle {
  142. font-size: 24rpx;
  143. font-weight: 500;
  144. color: #999999;
  145. line-height: normal;
  146. }
  147. .go-btn {
  148. width: 600rpx;
  149. height: 70rpx;
  150. position: absolute;
  151. left: 50%;
  152. transform: translateX(-50%);
  153. bottom: 120rpx;
  154. border-radius: 35rpx;
  155. font-size: 28rpx;
  156. font-weight: 500;
  157. }
  158. }
  159. </style>