uu
This commit is contained in:
parent
6d9e6a2b16
commit
dbf3df828f
@ -49,7 +49,7 @@
|
|||||||
<u-row custom-style="margin-top:20rpx;" justify="between">
|
<u-row custom-style="margin-top:20rpx;" justify="between">
|
||||||
<!-- <u-row>
|
<!-- <u-row>
|
||||||
<text class="pr-20 clr-sub">默认地址</text>
|
<text class="pr-20 clr-sub">默认地址</text>
|
||||||
<u-switch v-model="item.blDefaultFlag" @change="handleDefaultSwitch(item)" activeValue="1" active-color="#B12D29" size="34"></u-switch>
|
<u-switch v-model="item.blDefaultFlag" @change="handleDefaultSwitch(item)" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34"></u-switch>
|
||||||
</u-row> -->
|
</u-row> -->
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-text @click="handleEditItem(item)" text="编辑" prefixIcon="edit-pen" size="26"></u-text>
|
<u-text @click="handleEditItem(item)" text="编辑" prefixIcon="edit-pen" size="26"></u-text>
|
||||||
@ -168,14 +168,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleDefaultSwitch(item) {
|
async handleDefaultSwitch(item) {
|
||||||
try{
|
setTimeout(async ()=> {
|
||||||
await apiService.setDefaultAddressById({ id: item.id, defaultFlag: Number(!!item.blDefaultFlag), _loading: true })
|
let blDefaultFlag = item.blDefaultFlag
|
||||||
this.showToast('操作成功')
|
try{
|
||||||
this.$refs.listRef.getDataList(true) // 重置到第一页数据
|
await apiService.setDefaultAddressById({ id: item.id, defaultFlag: blDefaultFlag, _loading: true })
|
||||||
}catch(e){
|
this.showToast('操作成功')
|
||||||
// 操作失败,切回按钮状态
|
this.$refs.listRef.getDataList(true) // 重置到第一页数据
|
||||||
item.blDefaultFlag = !item.blDefaultFlag
|
}catch(e){
|
||||||
}
|
// 操作失败,切回按钮状态
|
||||||
|
item.blDefaultFlag = Number(!Number(blDefaultFlag)) + ''
|
||||||
|
}
|
||||||
|
},300)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user