Commit 4fc56662 authored by Damon's avatar Damon

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents 51f2e92e 83b2f6e3
......@@ -35,7 +35,7 @@
},
created() {
setTimeout(()=> {
this.type = 'collapse'
this.$emit('update:type', 'collapse')
}, 3000)
},
methods: {
......
......@@ -43,7 +43,7 @@
},
data() {
return {
checked: false
oldCount: 0
}
},
computed: {
......@@ -57,13 +57,27 @@
return process.uniEnv.qn_base_url + 'morentupian.png'
},
},
watch: {
showChecked(val) {
this.oldCount = 0
}
},
methods: {
handleChange() {
this.$emit('change')
this.item.selected = !this.item.selected
this.$emit('change', this.item.selected)
},
numChange(event) {
console.log(event.value)
this.$emit('numChange', event.value)
if (event.value == 0 && this.oldCount > 0) {
this.item.selected = false
this.$emit('change', this.item.selected)
} else if (event.value > 0 && this.oldCount == 0) {
this.item.selected = true
this.$emit('change', this.item.selected)
}
this.oldCount = event.value
this.$emit('numChange', event.value)
},
}
}
......
......@@ -36,7 +36,7 @@
</scroll-view>
</view>
<view class="fixed-button">
<ApplyButton :type="buttonType" @click="handleClickApply" />
<ApplyButton :type.sync="buttonType" @click="handleClickApply" />
</view>
<view>
<u-toast ref="uToast" />
......
......@@ -27,7 +27,7 @@
<template v-else>
<view class="list-item" v-for="(item, index) in partsList" :key="item.id">
<SpareCell :item="item" :showChecked="showBounce" type="stock"
@change="handleChange(index)"@numChange="handleNumChange($event, index)" />
@change="handleChange($event, index)"@numChange="handleNumChange($event, index)" />
</view>
<view class="load-more-view">
<u-loadmore v-show="partsList.length > 0" status="nomore" bgColor="#F4F5F7">
......@@ -43,7 +43,7 @@
</view>
</template>
<view class="fixed-button" v-show="!showBounce">
<ApplyButton :type="buttonType" @click="handleClickApply"/>
<ApplyButton :type.sync="buttonType" @click="handleClickApply"/>
</view>
</view>
</template>
......@@ -171,7 +171,8 @@
handleClickBounce() {
this.showBounce = false
for (var item of this.partsList) {
item.selected = false
item.selected = false
item.quantity = 0
}
},
allSelect(value) {
......@@ -180,8 +181,8 @@
item.selected = value
}
},
handleChange(index) {
this.partsList[index].selected = !this.partsList[index].selected
handleChange(value, index) {
this.partsList[index].selected = value
},
handleNumChange(value, index) {
this.partsList[index].quantity = value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment