Commit 260f5ae4 authored by Morson's avatar Morson

长按保存图片,登录页面跳转问题

parent 3d202a34
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="address-view"> <view class="address-view">
<view class="address-left-view"> <view class="address-left-view">
<image class="address-image" :src="dizhiImage" mode="widthFix"></image> <image class="address-image" :src="dizhiImage" mode="widthFix"></image>
<text>{{orderData.contactAddress }}</text> <text>{{ formatAddress(orderData) }}</text>
</view> </view>
<view v-if="showDistance"> <view v-if="showDistance">
{{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km {{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km
...@@ -268,6 +268,17 @@ ...@@ -268,6 +268,17 @@
getDistance(Latitud, Longitud) { getDistance(Latitud, Longitud) {
return this.distance(Latitud, Longitud, this.location[0], this.location[1]) return this.distance(Latitud, Longitud, this.location[0], this.location[1])
}, },
formatAddress(order) {
let address = ""
if(order) {
address = order.contactProvinceText || ""
address += order.contactCityText || ""
address += order.contactCommunityText || ""
address += order.contactStreetText || ""
address += order.contactAddress || ""
}
return address
},
/** /**
* echo distance(116.3896,39.91917,116.3940,39.91726); * echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离 * 计算两点之间直线距离
......
...@@ -162,7 +162,7 @@ export default { ...@@ -162,7 +162,7 @@ export default {
if(index) { if(index) {
let prevPage = pages[index]; //上一个页面 let prevPage = pages[index]; //上一个页面
if(prevPage.route == "pages/login/index") { if(prevPage.route == "pages/login/index") {
uni.navigateTo({ uni.redirectTo({
url:'pages/index/index' url:'pages/index/index'
}) })
} else { } else {
...@@ -174,12 +174,12 @@ export default { ...@@ -174,12 +174,12 @@ export default {
}) })
} }
} else { } else {
uni.navigateTo({ uni.redirectTo({
url:'pages/index/index' url:'pages/index/index'
}) })
} }
} else { } else {
uni.navigateTo({ uni.reLaunch({
url: "pages/index/mine" url: "pages/index/mine"
}) })
} }
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
v-for="(txt,index) in info.tipsArr" :key="index">{{txt}}</text> v-for="(txt,index) in info.tipsArr" :key="index">{{txt}}</text>
</view> </view>
<view class="services-view"> <view class="services-view">
<view v-if="[1, 2, 3, 4].indexOf(status) != -1"> <view v-if="[1, 2, 3, 4, 7].indexOf(status) != -1">
<image class="service-info-image" :src="erweimaImage"></image> <image class="service-info-image" :src="erweimaImage" @longtap="saveQrcode"></image>
<view class="content-info-tip">长按二维码添加官方客服微信</view> <view class="content-info-tip">长按二维码保存图片,添加官方客服微信</view>
<view class="content-info-tip">及时了解审核进度</view> <view class="content-info-tip">及时了解审核进度</view>
</view> </view>
</view> </view>
...@@ -183,6 +183,25 @@ ...@@ -183,6 +183,25 @@
} }
this.info = info this.info = info
}, },
saveQrcode() {
let that = this;
uni.downloadFile({ //获得二维码的临时地址
url: that.erweimaImage,
success:(res)=>{
if(res.statusCode == 200){
uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,//传入临时地址
success() {
that.$u.toast('保存成功!');
},
fail() {
that.$u.toast('保存失败!');
}
})
}
}
})
},
goPage() { goPage() {
const url = this.info.url const url = this.info.url
if (this.status == 1 || this.status == 3 || this.status == 7) { if (this.status == 1 || this.status == 3 || this.status == 7) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment