优化走访慰问

This commit is contained in:
花有清香月有阴
2021-12-24 13:58:52 +08:00
parent 808a97825f
commit 6dac1c09b3
4 changed files with 25 additions and 26 deletions

View File

@@ -48,7 +48,7 @@
<div class="addBtns">
<span> 点击</span>
<span class="toAdds" @click="goDetail">新增按钮</span>
<span class="toAdds" @click="goDetail()">新增按钮</span>
<span> 试试试吧~</span>
</div>
</div>
@@ -61,23 +61,16 @@
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="goDetail()" />
</AiFixedBtn>
</template>
<component v-else :is="comp" :params="params"></component>
</div>
</template>
<script>
import { mapState } from 'vuex'
import add from './add.vue'
import detail from './detail.vue'
export default {
name: 'AppWalkask',
appName: '走访慰问',
components: {
add,
detail,
},
components: {},
props: {},
data() {
return {
@@ -164,13 +157,13 @@ export default {
},
goDetail(item, hint) {
this.isList = false
if (hint == 1 || hint == 2) {
this.comp = hint == 1 ? 'detail' : 'add'
this.params = item
if (hint == 1) {
uni.navigateTo({ url: `./detail?id=${item.id}` })
}
if (hint == 2) {
uni.navigateTo({ url: `./add?id=${item.id}` })
} else {
this.comp = 'add'
this.params = 111
uni.navigateTo({ url: `./add` })
}
},