|
|
|
@ -13,7 +13,7 @@ |
|
|
|
<view> |
|
|
|
<uni-swipe-action> |
|
|
|
<block v-for="(item, i) in addressList" :key="i"> |
|
|
|
<uni-swipe-action-item :options="options" @click="swipeItemClickHandler(item)"> |
|
|
|
<uni-swipe-action-item :right-options="options" @click="swipeItemClickHandler(item)"> |
|
|
|
<view class="address-info-box"> |
|
|
|
<view class="row1"> |
|
|
|
<view class="row1-left"> |
|
|
|
@ -55,10 +55,17 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapState, mapMutations, mapGetters } from 'vuex' |
|
|
|
import addressVue from './address.vue'; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
options: [{ |
|
|
|
text: '删除', |
|
|
|
style: { |
|
|
|
backgroundColor: '#C00000' |
|
|
|
} |
|
|
|
}], |
|
|
|
addressList:[] |
|
|
|
}; |
|
|
|
}, |
|
|
|
@ -118,7 +125,14 @@ |
|
|
|
if (settingResult.authSetting['scope.address']) return uni.$showMsg('授权成功!请选择地址') |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
async swipeItemClickHandler(item){ |
|
|
|
this.addressList = this.addressList.filter(x=>x.guid!=item.guid); |
|
|
|
const { |
|
|
|
data: res |
|
|
|
} = await uni.$http.post('/small/project/address/remove',item.guid) |
|
|
|
if (!res.success) return uni.$showMsg() |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState('m_user', ['address','userId']), |
|
|
|
|