|
@@ -19,7 +19,7 @@
|
|
|
</view>
|
|
|
<view class="award-progress">
|
|
|
<view class="award-progress-bar"></view>
|
|
|
- <view class="award-progress-value" :style="{width: getProcess()}"></view>
|
|
|
+ <view class="award-progress-value" :style="{width: getProcess}"></view>
|
|
|
<view class="award-progress-point-list">
|
|
|
<view v-for="(item,index) in giftList" :style="{left:((index+1)/giftList.length)*90+'%'}" :key="item.id"
|
|
|
:class="['award-progress-point-item',checked>=item.route_count?'active':'']">
|
|
@@ -171,28 +171,30 @@ export default {
|
|
|
onUnload() {
|
|
|
clearTimeout(this.timer)
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ getProcess(){
|
|
|
+ let subList = []
|
|
|
+ for (var i = this.giftList.length-1; i > 0; i--) {
|
|
|
+ subList.unshift(this.giftList[i].route_count - this.giftList[i-1].route_count)
|
|
|
+ }
|
|
|
+ subList.unshift(this.giftList[0].route_count)
|
|
|
+
|
|
|
+ let process = 0
|
|
|
+ let count = this.checked
|
|
|
+ let per_process = 100/this.giftList.length
|
|
|
+ subList.forEach(item => {
|
|
|
+ if(count>=item){
|
|
|
+ count -= item
|
|
|
+ process += per_process
|
|
|
+ }else{
|
|
|
+ process += per_process*(count/item)
|
|
|
+ count = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return process+'%'
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
- getProcess(){
|
|
|
- let subList = []
|
|
|
- for (var i = this.giftList.length-1; i > 0; i--) {
|
|
|
- subList.unshift(this.giftList[i].route_count - this.giftList[i-1].route_count)
|
|
|
- }
|
|
|
- subList.unshift(this.giftList[0].route_count)
|
|
|
-
|
|
|
- let process = 0
|
|
|
- let count = this.checked
|
|
|
- let per_process = 100/this.giftList.length
|
|
|
- subList.forEach(item => {
|
|
|
- if(count>=item){
|
|
|
- count -= item
|
|
|
- process += per_process
|
|
|
- }else{
|
|
|
- process += per_process*(count/item)
|
|
|
- count = 0
|
|
|
- }
|
|
|
- })
|
|
|
- return process+'%'
|
|
|
- },
|
|
|
getRouteListInfo() {
|
|
|
getRouteList().then(res => {
|
|
|
this.is_receipts = res.data.is_receipts
|