Commit 1e160f2a authored by Facius's avatar Facius

feat: 名片分享页

parent 6eb7425d
Pipeline #2917 canceled with stages
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
// green 绿;blue 蓝;black 黑; // green 绿;blue 蓝;black 黑;
image() { image() {
switch (this.info.type) { switch (this.info.coverUrl) {
case 'green': case 'green':
return this.baseUrl + 'muban1fanmian@3x.png' return this.baseUrl + 'muban1fanmian@3x.png'
case 'blue': case 'blue':
...@@ -85,6 +85,7 @@ export default { ...@@ -85,6 +85,7 @@ export default {
font-weight: bold; font-weight: bold;
color: #ffffff; color: #ffffff;
margin-bottom: 24rpx; margin-bottom: 24rpx;
text-align: center;
} }
} }
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<view class="right-view"> <view class="right-view">
<u-button <u-button
:custom-style="customConFirm" :custom-style="customConFirm"
@click="handleClickConFirm" @click="handleClickConfirm"
class="confirm-button" class="confirm-button"
> >
<view class="image-view"> <view class="image-view">
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</u-button> </u-button>
</view> </view>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
...@@ -97,6 +98,9 @@ export default { ...@@ -97,6 +98,9 @@ export default {
}, },
}, },
onLoad(options) { onLoad(options) {
// 测试数据
// options.cardId = '1551401777033641984'
// if (options && options.shareUserId) { // if (options && options.shareUserId) {
// this.shareUserId = options.shareUserId // this.shareUserId = options.shareUserId
// } // }
...@@ -141,13 +145,10 @@ export default { ...@@ -141,13 +145,10 @@ export default {
}, },
operateCall() { operateCall() {
this.loading = true this.loading = true
getBusinessCard({ operateCall({
businessCardId: this.cardId, businessCardId: this.cardId,
}) })
.then((res) => { .then((res) => {
if (res.data) {
this.info = res.data
}
this.loading = false this.loading = false
}) })
.catch((res) => { .catch((res) => {
...@@ -156,13 +157,10 @@ export default { ...@@ -156,13 +157,10 @@ export default {
}, },
operateView() { operateView() {
this.loading = true this.loading = true
getBusinessCard({ operateView({
businessCardId: this.cardId, businessCardId: this.cardId,
}) })
.then((res) => { .then((res) => {
if (res.data) {
this.info = res.data
}
this.loading = false this.loading = false
}) })
.catch((res) => { .catch((res) => {
...@@ -171,13 +169,10 @@ export default { ...@@ -171,13 +169,10 @@ export default {
}, },
operateJoinList() { operateJoinList() {
this.loading = true this.loading = true
getBusinessCard({ operateJoinList({
businessCardId: this.cardId, businessCardId: this.cardId,
}) })
.then((res) => { .then((res) => {
if (res.data) {
this.info = res.data
}
this.loading = false this.loading = false
}) })
.catch((res) => { .catch((res) => {
...@@ -185,9 +180,29 @@ export default { ...@@ -185,9 +180,29 @@ export default {
}) })
}, },
handleClickCall() { handleClickCall() {
if (this.info.phone) {
uni.makePhoneCall({
phoneNumber: this.info.phone,
})
}
this.operateCall() this.operateCall()
}, },
handleClickConfirm() { handleClickConfirm() {
uni.addPhoneContact({
nickName: this.info.name,
mobilePhoneNumber: this.info.phone,
success: () => {
this.$refs.uToast.show({
title: '保存成功',
type: 'success',
duration: 1500,
callback: () => {},
})
},
fail: () => {
console.log('fail')
},
})
this.operateJoinList() this.operateJoinList()
}, },
// 朋友圈 // 朋友圈
......
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