| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- <template>
- <view class="contentV">
- <customNav :shownav="true" :title="$t('index.changydz')" titledetl=""></customNav>
- <view v-if="userAddr!=''" class="contentColumn newaddrcvt">
- <text class="addrV" style="margin: 20rpx;font-size: 30rpx;">{{userAddr.name}}</text>
- <text class="addrV" style="margin: 20rpx;font-size: 28rpx;">{{userAddr.address}}</text>
- <view class="contentInRowS" style="margin: 20rpx;">
- <view class="contentInRowC newaddract" style="background-color: #00A6FF;" @click="addadr">
- <text>{{$t('index.tianjiashdz')}}</text>
- </view>
- <view class="contentColumnC newaddract" style="background-color:black;" @click="addrselect">
- <text>{{$t('index.yihouzais')}}</text>
- </view>
- </view>
- </view>
- <view class="contentColumn" style="margin-bottom: 120rpx;">
- <view v-for="item in addrList">
- <view class="itemView" @click="selectAddr(item)">
- <view class="textView">
- <text class="addrV textfontB4">{{item.area}}</text>
- <text class="addrV textfontB5">{{item.address}}</text>
- <text class="nameph">{{item.name}}: {{item.phone}}</text>
- </view>
- </view>
- </view>
- </view>
- <view style="height: 10rpx;"></view>
- <view class="addbtV">
- <view class="addbt" @click="newdizhi">{{$t('index.qitadizhi')}}</view>
- </view>
-
- </view>
- </template>
- <script>
- import api from "@/pages/api/api.js";
- export default {
- data() {
- return {
- addrList:[],
- isNewAddr:false,
- userAddr:''
- }
- },
- onShow() {
- if(this.isNewAddr){
- this.gettempLocate();
- this.isNewAddr=false;
- }
- this.getaddressList();
- },
- methods: {
- newdizhi(){
- this.isNewAddr=true;
- uni.redirectTo({
- url:'/pages/UserCenter/map/map?state=0'
- })
- },
- gettempLocate(){
- uni.setStorageSync('tempLocation','');
- var data = uni.getStorageSync("userAddrLocation");
- if(''==data || undefined==data || null==data){
- return;
- }
- else{
- this.userAddr=data;
- uni.setStorageSync('userAddrLocation',"");
- uni.setStorageSync('tempLocation','');
- return;
- }
- },
- selectAddr(item){
- var addr={
- address:item.address,
- name:item.area,
- longitude:item.longitude,
- latitude:item.latitude,
- }
- uni.setStorageSync('userAddrLocation',addr);
- uni.navigateBack();
- },
-
- getaddressList(){
- api('getaddressList',{
- },res=>{
- this.addrList=res.data.data;
- },failc=>{
- //console.log('getadvertis----',failc)
- })
- },
- addadr(){
- var token = uni.getStorageSync("token");
- if(''==token || undefined==token ||null==token){
- uni.navigateTo({
- url:'/pages/UserCenter/LoginView'
- })
- return;
- }
- uni.setStorageSync('tempLocation',this.userAddr);
- uni.navigateTo({
- url:'/pages/UserCenter/dizhi/newdizhi?id=-2'
- })
- },
- addrselect(){
- uni.setStorageSync('userAddrLocation',this.userAddr);
- uni.navigateBack();
- },
- }
- }
- </script>
- <style>
- .contentV{
- width: 100%;
- position: relative;
- height: 90vh;
- }
- .newaddrcvt {
- width: 92%;
- margin-left: 4%;
- margin-top: 40rpx;
- margin-bottom: 20rpx;
- box-shadow: 0rpx 0rpx 10rpx 0rpx darkgray;
- }
- .newaddract{
- font-size: 26rpx;
- width: 43%;
- height: 80rpx;
- color: white;
- text-align: center;
- }
- .itemView{
- margin: 30rpx;
- padding: 30rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content:flex-start;
- border-radius: 20rpx;
- box-shadow: 0rpx 0rpx 10rpx 0rpx darkgray;
- }
- .textView{
- display: flex;
- flex-direction: column;
- }
- .addrV{
- color: black;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .nameph{
- font-size: 28rpx;
- color: darkslategray;
- }
- .addbtV{
- position: fixed;
- width: 100%;
- height: 120rpx;
- bottom: 0rpx;
- left: 0;
- background-color: whitesmoke;
- }
- .addbt{
- margin-left: 10%;
- margin-top: 20rpx;
- text-align: center;
- font-size: 36rpx;
- width: 80%;
- height: 80rpx;
- line-height: 80rpx;
- background-color: #00A6FF;
- color: white;
- box-shadow: 0rpx 0rpx 10rpx 0rpx #00A6FF;
- border-radius: 10rpx;
- }
- </style>
|