|
|
@ -4,11 +4,9 @@ |
|
|
<view class="secbar"><label class="back" @click="back()"></label> |
|
|
<view class="secbar"><label class="back" @click="back()"></label> |
|
|
<view class="title">联系地址</view> |
|
|
<view class="title">联系地址</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cart-container"> |
|
|
<view class="mainwrap2"> |
|
|
<!-- 选择收货地址的盒子 --> |
|
|
<view class="subwrap"> |
|
|
<view class="address-choose-box"> |
|
|
|
|
|
<button type="primary" size="mini" class="btnChooseAddress" @click="chooseAddress">新增地址+</button> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 底部的边框线 --> |
|
|
<!-- 底部的边框线 --> |
|
|
<image src="/static/cart_border@2x.png" class="address-border"></image> |
|
|
<image src="/static/cart_border@2x.png" class="address-border"></image> |
|
|
@ -40,10 +38,20 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<!-- 选择收货地址的盒子 --> |
|
|
|
|
|
<view class="address-choose-box"> |
|
|
|
|
|
<button type="primary" size="mini" class="uni-button" @click="chooseAddress">批量刪除</button> |
|
|
|
|
|
<button type="primary" size="mini" class="uni-button" @click="chooseAddress">新增地址</button> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { mapState, mapMutations, mapGetters } from 'vuex' |
|
|
import { |
|
|
|
|
|
mapState, |
|
|
|
|
|
mapMutations, |
|
|
|
|
|
mapGetters |
|
|
|
|
|
} from 'vuex' |
|
|
import addressVue from './address.vue'; |
|
|
import addressVue from './address.vue'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -66,7 +74,9 @@ |
|
|
async initAddress() { |
|
|
async initAddress() { |
|
|
const { |
|
|
const { |
|
|
data: res |
|
|
data: res |
|
|
} = await uni.$http.post('/small/project/address/listAll',{userId:this.userId}) |
|
|
} = await uni.$http.post('/small/project/address/listAll', { |
|
|
|
|
|
userId: this.userId |
|
|
|
|
|
}) |
|
|
if (!res.success) return uni.$showMsg() |
|
|
if (!res.success) return uni.$showMsg() |
|
|
this.addressList = res.data; |
|
|
this.addressList = res.data; |
|
|
}, |
|
|
}, |
|
|
@ -90,7 +100,8 @@ |
|
|
this.initAddress(); |
|
|
this.initAddress(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (err && (err.errMsg === 'chooseAddress:fail auth deny' || err.errMsg === 'chooseAddress:fail authorize no response')) { |
|
|
if (err && (err.errMsg === 'chooseAddress:fail auth deny' || err.errMsg === |
|
|
|
|
|
'chooseAddress:fail authorize no response')) { |
|
|
// 通过调用这个方法,让用户重新授权 |
|
|
// 通过调用这个方法,让用户重新授权 |
|
|
this.reAuth() |
|
|
this.reAuth() |
|
|
} |
|
|
} |
|
|
@ -111,7 +122,8 @@ |
|
|
if (confirmResult.confirm) return uni.openSetting({ |
|
|
if (confirmResult.confirm) return uni.openSetting({ |
|
|
success: (settingResult) => { |
|
|
success: (settingResult) => { |
|
|
if (!settingResult.authSetting['scope.address']) return uni.$showMsg('您取消了授权!') |
|
|
if (!settingResult.authSetting['scope.address']) return uni.$showMsg('您取消了授权!') |
|
|
if (settingResult.authSetting['scope.address']) return uni.$showMsg('授权成功!请选择地址') |
|
|
if (settingResult.authSetting['scope.address']) return uni.$showMsg( |
|
|
|
|
|
'授权成功!请选择地址') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
@ -137,6 +149,10 @@ |
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|
@import url("@/static/base_css.css"); |
|
|
@import url("@/static/base_css.css"); |
|
|
|
|
|
.mainwrap2 { |
|
|
|
|
|
height: calc(100% - 350rpx); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.address-border { |
|
|
.address-border { |
|
|
display: block; |
|
|
display: block; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
@ -144,19 +160,46 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.address-choose-box { |
|
|
.address-choose-box { |
|
|
height: 90px; |
|
|
|
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: center; |
|
|
position: fixed; |
|
|
|
|
|
bottom: 0; |
|
|
|
|
|
padding: 10rpx 0 50rpx 0; |
|
|
|
|
|
width: 100vw; |
|
|
|
|
|
height: 90rpx; |
|
|
|
|
|
border-top: 1px solid #ddd; |
|
|
|
|
|
background-color: #fff; |
|
|
|
|
|
|
|
|
|
|
|
.uni-button { |
|
|
|
|
|
margin: 1% 2%; |
|
|
|
|
|
font-size: 30rpx; |
|
|
|
|
|
width: 55%; |
|
|
|
|
|
height: 70rpx; |
|
|
|
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
background: #1367fe; |
|
|
|
|
|
border: 1px solid #1367fe; |
|
|
|
|
|
border-radius: 50rpx; |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.uni-button:first-child { |
|
|
|
|
|
width: 35%; |
|
|
|
|
|
background-color: #fff; |
|
|
|
|
|
color: #1367fe; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.address-info-box { |
|
|
.address-info-box { |
|
|
font-size: 12px; |
|
|
|
|
|
height: 90px; |
|
|
|
|
|
display: flex; |
|
|
display: flex; |
|
|
|
|
|
margin: 10rpx 0; |
|
|
|
|
|
padding: 0 10px; |
|
|
|
|
|
height: 180rpx; |
|
|
|
|
|
background: #fff; |
|
|
|
|
|
border-radius: 20rpx; |
|
|
|
|
|
font-size: 30rpx; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
padding: 0 5px; |
|
|
|
|
|
|
|
|
|
|
|
.row1 { |
|
|
.row1 { |
|
|
display: flex; |
|
|
display: flex; |
|
|
@ -242,4 +285,5 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |