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 @@ ...@@ -35,7 +35,7 @@
}, },
created() { created() {
setTimeout(()=> { setTimeout(()=> {
this.type = 'collapse' this.$emit('update:type', 'collapse')
}, 3000) }, 3000)
}, },
methods: { methods: {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
}, },
data() { data() {
return { return {
checked: false oldCount: 0
} }
}, },
computed: { computed: {
...@@ -57,13 +57,27 @@ ...@@ -57,13 +57,27 @@
return process.uniEnv.qn_base_url + 'morentupian.png' return process.uniEnv.qn_base_url + 'morentupian.png'
}, },
}, },
watch: {
showChecked(val) {
this.oldCount = 0
}
},
methods: { methods: {
handleChange() { handleChange() {
this.$emit('change') this.item.selected = !this.item.selected
this.$emit('change', this.item.selected)
}, },
numChange(event) { 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 @@ ...@@ -36,7 +36,7 @@
</scroll-view> </scroll-view>
</view> </view>
<view class="fixed-button"> <view class="fixed-button">
<ApplyButton :type="buttonType" @click="handleClickApply" /> <ApplyButton :type.sync="buttonType" @click="handleClickApply" />
</view> </view>
<view> <view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<template v-else> <template v-else>
<view class="list-item" v-for="(item, index) in partsList" :key="item.id"> <view class="list-item" v-for="(item, index) in partsList" :key="item.id">
<SpareCell :item="item" :showChecked="showBounce" type="stock" <SpareCell :item="item" :showChecked="showBounce" type="stock"
@change="handleChange(index)"@numChange="handleNumChange($event, index)" /> @change="handleChange($event, index)"@numChange="handleNumChange($event, index)" />
</view> </view>
<view class="load-more-view"> <view class="load-more-view">
<u-loadmore v-show="partsList.length > 0" status="nomore" bgColor="#F4F5F7"> <u-loadmore v-show="partsList.length > 0" status="nomore" bgColor="#F4F5F7">
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</view> </view>
</template> </template>
<view class="fixed-button" v-show="!showBounce"> <view class="fixed-button" v-show="!showBounce">
<ApplyButton :type="buttonType" @click="handleClickApply"/> <ApplyButton :type.sync="buttonType" @click="handleClickApply"/>
</view> </view>
</view> </view>
</template> </template>
...@@ -171,7 +171,8 @@ ...@@ -171,7 +171,8 @@
handleClickBounce() { handleClickBounce() {
this.showBounce = false this.showBounce = false
for (var item of this.partsList) { for (var item of this.partsList) {
item.selected = false item.selected = false
item.quantity = 0
} }
}, },
allSelect(value) { allSelect(value) {
...@@ -180,8 +181,8 @@ ...@@ -180,8 +181,8 @@
item.selected = value item.selected = value
} }
}, },
handleChange(index) { handleChange(value, index) {
this.partsList[index].selected = !this.partsList[index].selected this.partsList[index].selected = value
}, },
handleNumChange(value, index) { handleNumChange(value, index) {
this.partsList[index].quantity = value 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