|
@@ -2,7 +2,9 @@ Component({
|
|
|
/**
|
|
|
* 组件的属性列表
|
|
|
*/
|
|
|
- properties: {},
|
|
|
+ properties: {
|
|
|
+ shopDetail: Object
|
|
|
+ },
|
|
|
|
|
|
/**
|
|
|
* 组件的初始数据
|
|
@@ -22,10 +24,7 @@ Component({
|
|
|
name: '添加到手机通讯录',
|
|
|
value: 'addPhoneContact'
|
|
|
}
|
|
|
- ],
|
|
|
- businessInfo: {
|
|
|
- phone: '13429176706'
|
|
|
- }
|
|
|
+ ]
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -40,17 +39,17 @@ Component({
|
|
|
},
|
|
|
async onSelect(event) {
|
|
|
const { value } = event.detail
|
|
|
- const { businessInfo } = this.data
|
|
|
+ const { shopDetail } = this.data
|
|
|
this.hideActionSheet()
|
|
|
switch (value) {
|
|
|
case 'makePhoneCall':
|
|
|
try {
|
|
|
- await wx.makePhoneCall({ phoneNumber: businessInfo.phone })
|
|
|
+ await wx.makePhoneCall({ phoneNumber: shopDetail.shop_phone })
|
|
|
} catch (err) {}
|
|
|
break
|
|
|
case 'setClipboardData':
|
|
|
try {
|
|
|
- await wx.setClipboardData({ data: businessInfo.phone })
|
|
|
+ await wx.setClipboardData({ data: shopDetail.shop_phone })
|
|
|
} catch (err) {}
|
|
|
break
|
|
|
case 'addPhoneContact':
|
|
@@ -98,22 +97,23 @@ Component({
|
|
|
} catch (err) {}
|
|
|
},
|
|
|
async addPhoneContactBridge() {
|
|
|
- const { businessInfo } = this.data
|
|
|
+ const { shopDetail } = this.data
|
|
|
|
|
|
try {
|
|
|
await wx.addPhoneContact({
|
|
|
- firstName: 'businessInfo.phone',
|
|
|
- mobilePhoneNumber: businessInfo.phone
|
|
|
+ firstName: shopDetail.user_name,
|
|
|
+ mobilePhoneNumber: shopDetail.shop_phone
|
|
|
})
|
|
|
} catch (err) {}
|
|
|
},
|
|
|
async openLocationBridge() {
|
|
|
+ const { shop_address } = this.data.shopDetail
|
|
|
+
|
|
|
try {
|
|
|
- // 测试 latitude: 30.25727 longitude: 120.20523
|
|
|
await wx.openLocation({
|
|
|
- latitude: 30.25727,
|
|
|
- longitude: 120.20523,
|
|
|
- name: '浙江省杭州市余杭区'
|
|
|
+ latitude: shop_address.latitude,
|
|
|
+ longitude: shop_address.longitude,
|
|
|
+ name: shop_address.address_name
|
|
|
})
|
|
|
} catch (err) {}
|
|
|
}
|