|
@@ -34,7 +34,7 @@
|
|
|
<div class="secondBoxItem">
|
|
|
<span class="secondBoxTitle">活动地址</span>
|
|
|
<span class="secondBoxInfo dhInfo">
|
|
|
- <span>{{ form.activityAddress }} - {{ form.activityAddressDetail }}</span>
|
|
|
+ <span>{{ formattedAddress }}</span>
|
|
|
<img src="./image/dhIcon.png" class="dhIcon" @tap="getLocal">
|
|
|
</span>
|
|
|
</div>
|
|
@@ -90,7 +90,25 @@ export default {
|
|
|
this.url = options.url
|
|
|
this.getById()
|
|
|
},
|
|
|
- methods: {
|
|
|
+ computed: {
|
|
|
+ formattedAddress() {
|
|
|
+ // 检查两个地址字段是否都存在值
|
|
|
+ const hasAddress = this.form.activityAddress && this.form.activityAddress.trim() !== '';
|
|
|
+ const hasDetail = this.form.activityAddressDetail && this.form.activityAddressDetail.trim() !== '';
|
|
|
+
|
|
|
+ // 根据是否存在值来拼接地址
|
|
|
+ if (hasAddress && hasDetail) {
|
|
|
+ return `${this.form.activityAddress} - ${this.form.activityAddressDetail}`;
|
|
|
+ } else if (hasAddress) {
|
|
|
+ return this.form.activityAddress;
|
|
|
+ } else if (hasDetail) {
|
|
|
+ return this.form.activityAddressDetail;
|
|
|
+ } else {
|
|
|
+ return ''; // 或者返回其他默认值
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
call(){
|
|
|
uni.makePhoneCall({
|
|
|
phoneNumber: this.form.activityPhone, // 电话号码
|