|
@@ -200,9 +200,15 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+<<<<<<< HEAD
|
|
import { Toast } from 'vant';
|
|
import { Toast } from 'vant';
|
|
// import NativeShare from 'nativeshare';
|
|
// import NativeShare from 'nativeshare';
|
|
// import { fileKeyToUrl } from '@/plugins/file-center.js';
|
|
// import { fileKeyToUrl } from '@/plugins/file-center.js';
|
|
|
|
+=======
|
|
|
|
+import { Toast, Dialog } from 'vant';
|
|
|
|
+import NativeShare from 'nativeshare';
|
|
|
|
+import { fileKeyToUrl } from '@/plugins/file-center.js';
|
|
|
|
+>>>>>>> 6996e6c966cfa7e49b1fdde30f339cb400f99a8e
|
|
|
|
|
|
export default {
|
|
export default {
|
|
auth: false,
|
|
auth: false,
|
|
@@ -271,12 +277,21 @@ export default {
|
|
preRanking: 0,
|
|
preRanking: 0,
|
|
userType: 1,
|
|
userType: 1,
|
|
received: 0,
|
|
received: 0,
|
|
|
|
+<<<<<<< HEAD
|
|
// shareInfo: {
|
|
// shareInfo: {
|
|
// title: '双子星云手机',
|
|
// title: '双子星云手机',
|
|
// content: `免费领取一台全能云手机!`,
|
|
// content: `免费领取一台全能云手机!`,
|
|
// shareUrl: '',
|
|
// shareUrl: '',
|
|
// shareImage: ''
|
|
// shareImage: ''
|
|
// },
|
|
// },
|
|
|
|
+=======
|
|
|
|
+ shareInfo: {
|
|
|
|
+ title: '双子星云手机',
|
|
|
|
+ content: `免费领取一台全能云手机!`,
|
|
|
|
+ shareUrl: '',
|
|
|
|
+ shareImage: ''
|
|
|
|
+ },
|
|
|
|
+>>>>>>> 6996e6c966cfa7e49b1fdde30f339cb400f99a8e
|
|
showShare: false,
|
|
showShare: false,
|
|
returnContent: [{
|
|
returnContent: [{
|
|
img: require('@/assets/image/activity/invite-user/card-1.png'),
|
|
img: require('@/assets/image/activity/invite-user/card-1.png'),
|
|
@@ -301,8 +316,12 @@ export default {
|
|
try {
|
|
try {
|
|
this.token = this.$route.query.token;
|
|
this.token = this.$route.query.token;
|
|
await this.getActiveInfo();
|
|
await this.getActiveInfo();
|
|
|
|
+<<<<<<< HEAD
|
|
this.$native.setShareInfo(this.shareInfo);
|
|
this.$native.setShareInfo(this.shareInfo);
|
|
// await this.shareCanReceiveCloudPhone();
|
|
// await this.shareCanReceiveCloudPhone();
|
|
|
|
+=======
|
|
|
|
+ await this.shareCanReceiveCloudPhone();
|
|
|
|
+>>>>>>> 6996e6c966cfa7e49b1fdde30f339cb400f99a8e
|
|
await Promise.all([
|
|
await Promise.all([
|
|
this.getActivityRules(),
|
|
this.getActivityRules(),
|
|
this.type === 2 && this.getMyActivationCode(this.myCodeFrom),
|
|
this.type === 2 && this.getMyActivationCode(this.myCodeFrom),
|
|
@@ -374,21 +393,6 @@ export default {
|
|
},
|
|
},
|
|
}).href
|
|
}).href
|
|
);
|
|
);
|
|
- },
|
|
|
|
- shareInfo() {
|
|
|
|
- if (this.$userAgent.isMiniProgram) {
|
|
|
|
- return {
|
|
|
|
- title: '双子星APP',
|
|
|
|
- path: '/pages/home/home',
|
|
|
|
- imgUrl: location.origin + require('~/assets/image/logo.png'),
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
- return {
|
|
|
|
- title: '双子星云手机',
|
|
|
|
- desc: `畅玩“原神”“幻塔”,24小时在线,不限下载流量的手机`,
|
|
|
|
- link: this.shareUrl,
|
|
|
|
- imgUrl: location.origin + require('~/assets/image/logo.png'),
|
|
|
|
- };
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -397,6 +401,7 @@ export default {
|
|
this.addUserVisit(12);
|
|
this.addUserVisit(12);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+<<<<<<< HEAD
|
|
// async shareCanReceiveCloudPhone() {
|
|
// async shareCanReceiveCloudPhone() {
|
|
// try {
|
|
// try {
|
|
// const res = await this.$axios.$get('/resources/register/send/cloud/phone/shareCanReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
|
|
// const res = await this.$axios.$get('/resources/register/send/cloud/phone/shareCanReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
|
|
@@ -429,6 +434,40 @@ export default {
|
|
// });
|
|
// });
|
|
// }
|
|
// }
|
|
// },
|
|
// },
|
|
|
|
+=======
|
|
|
|
+ async shareCanReceiveCloudPhone() {
|
|
|
|
+ try {
|
|
|
|
+ const res = await this.$axios.$get('/resources/register/send/cloud/phone/shareCanReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
|
|
|
|
+ this.received = res.data.received
|
|
|
|
+ this.shareInfo.title = res.data.title
|
|
|
|
+ this.shareInfo.content = res.data.content
|
|
|
|
+ this.shareInfo.shareUrl = res.data.url
|
|
|
|
+ this.shareInfo.shareImage = fileKeyToUrl(res.data.imgUrl)
|
|
|
|
+ this.$native.setShareInfo(this.shareInfo);
|
|
|
|
+ } catch (err) {
|
|
|
|
+ Toast({
|
|
|
|
+ message: err.message,
|
|
|
|
+ position: 'top'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async shareReceiveCloudPhone() {
|
|
|
|
+ try {
|
|
|
|
+ const res = await this.$axios.$post('/resources/register/send/cloud/phone/shareReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
|
|
|
|
+ Dialog.alert({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.showShare = false
|
|
|
|
+ });
|
|
|
|
+ this.addUserVisit(7);
|
|
|
|
+ } catch (err) {
|
|
|
|
+ Toast({
|
|
|
|
+ message: err.message,
|
|
|
|
+ position: 'top'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+>>>>>>> 6996e6c966cfa7e49b1fdde30f339cb400f99a8e
|
|
async receiveLevelAward(goodsId) {
|
|
async receiveLevelAward(goodsId) {
|
|
try {
|
|
try {
|
|
const res = await this.$axios.$post('/activity/v1/level/award/receiveLevelAward', { activityId: this.myCodeFrom.activityId, goodsId }, { headers: { Authorization: this.token } });
|
|
const res = await this.$axios.$post('/activity/v1/level/award/receiveLevelAward', { activityId: this.myCodeFrom.activityId, goodsId }, { headers: { Authorization: this.token } });
|
|
@@ -506,7 +545,7 @@ export default {
|
|
this.codeIsLoading = false;
|
|
this.codeIsLoading = false;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async share() {
|
|
|
|
|
|
+ share() {
|
|
if (this.data.status !== 1) {
|
|
if (this.data.status !== 1) {
|
|
if (this.data.status === 0) {
|
|
if (this.data.status === 0) {
|
|
Toast({
|
|
Toast({
|
|
@@ -535,7 +574,6 @@ export default {
|
|
});
|
|
});
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
this.$tongji.trackEvent('活动', '分享', '', 0);
|
|
this.$tongji.trackEvent('活动', '分享', '', 0);
|
|
if (this.received) {
|
|
if (this.received) {
|
|
this.addUserVisit(13);
|
|
this.addUserVisit(13);
|
|
@@ -543,13 +581,36 @@ export default {
|
|
if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
|
|
if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
|
|
// app环境
|
|
// app环境
|
|
this.$native.share(this.shareInfo);
|
|
this.$native.share(this.shareInfo);
|
|
- this.makePoint('activity_Share_分享好友按钮');
|
|
|
|
} else {
|
|
} else {
|
|
// 浏览器环境
|
|
// 浏览器环境
|
|
- await this.$native.clipboard.writeText(`${this.shareUrl} 双子星云手机`);
|
|
|
|
- // throw new Error('1231');
|
|
|
|
- this.$toast.success('链接复制成功');
|
|
|
|
- this.makePoint('activity_Share_复制链接');
|
|
|
|
|
|
+ const nativeShare = new NativeShare()
|
|
|
|
+ nativeShare.setShareData({
|
|
|
|
+ icon: this.shareInfo.shareImage,
|
|
|
|
+ link: this.shareInfo.shareUrl,
|
|
|
|
+ title: this.shareInfo.content,
|
|
|
|
+ desc: this.shareInfo.title,
|
|
|
|
+ success: () => {
|
|
|
|
+ this.shareReceiveCloudPhone()
|
|
|
|
+ },
|
|
|
|
+ fail: () => {
|
|
|
|
+ Toast({
|
|
|
|
+ message: '分享失败',
|
|
|
|
+ position: 'center'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ try {
|
|
|
|
+ nativeShare.call('wechatTimeline')
|
|
|
|
+ } catch (err) {
|
|
|
|
+ Toast({
|
|
|
|
+ message: '您的浏览器不支持分享功能,请下载app使用!',
|
|
|
|
+ position: 'center',
|
|
|
|
+ duration: 3000
|
|
|
|
+ })
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ window.open('https://www.androidscloud.com/', '_self');
|
|
|
|
+ }, 3000)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
makePoint(positionButton) {
|
|
makePoint(positionButton) {
|