|
@@ -12,7 +12,9 @@
|
|
<div class="cybz-content-text-item">邀请购买云机</div>
|
|
<div class="cybz-content-text-item">邀请购买云机</div>
|
|
<div class="cybz-content-text-item">返星币换现金</div>
|
|
<div class="cybz-content-text-item">返星币换现金</div>
|
|
</div>
|
|
</div>
|
|
- <v-btn class="share-button" rounded @click="share()"></v-btn>
|
|
|
|
|
|
+ <v-btn class="share-button" rounded @click="share()"
|
|
|
|
+ >分享好友赚星币</v-btn
|
|
|
|
+ >
|
|
<!-- <button @click="share()">邀请</button> -->
|
|
<!-- <button @click="share()">邀请</button> -->
|
|
</div>
|
|
</div>
|
|
<!-- <div class="h-40">13</div> -->
|
|
<!-- <div class="h-40">13</div> -->
|
|
@@ -80,8 +82,9 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import qs from 'qs';
|
|
|
|
-import clipboard from 'clipboardy/browser';
|
|
|
|
|
|
+// import qs from 'qs';
|
|
|
|
+// import clipboard from 'clipboardy/browser';
|
|
|
|
+import * as clipboard from 'clipboard-polyfill/text';
|
|
import { getStarCoinOverview } from '~/api/activity/invite-user.js';
|
|
import { getStarCoinOverview } from '~/api/activity/invite-user.js';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -98,12 +101,19 @@ export default {
|
|
todayBuyOrderSuccessCount: 0,
|
|
todayBuyOrderSuccessCount: 0,
|
|
totalBuyOrderSuccessCount: 0,
|
|
totalBuyOrderSuccessCount: 0,
|
|
withdrawStarCoinNum: 0,
|
|
withdrawStarCoinNum: 0,
|
|
|
|
+ inviteUserName: null,
|
|
|
|
+ activityId: null,
|
|
|
|
+ status: 0,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async fetch() {
|
|
async fetch() {
|
|
//
|
|
//
|
|
- this.data = (await getStarCoinOverview(this)).data;
|
|
|
|
|
|
+ try {
|
|
|
|
+ this.data = (await getStarCoinOverview(this)).data;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.$toast.error(error.message);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
head: {
|
|
head: {
|
|
title: '邀请好友',
|
|
title: '邀请好友',
|
|
@@ -119,7 +129,7 @@ export default {
|
|
return [
|
|
return [
|
|
{ label: '今日收益(星币)', value: this.data.todayIncomeStarCoin },
|
|
{ label: '今日收益(星币)', value: this.data.todayIncomeStarCoin },
|
|
{ label: '总收益(星币)', value: this.data.totalIncomeStarCoin },
|
|
{ label: '总收益(星币)', value: this.data.totalIncomeStarCoin },
|
|
- { label: '今日购买订单数', value: this.data.totalBuyOrderCount },
|
|
|
|
|
|
+ { label: '今日购买订单数', value: this.data.todayBuyOrderSuccessCount },
|
|
{ label: '累计推广订单', value: this.data.totalBuyOrderCount },
|
|
{ label: '累计推广订单', value: this.data.totalBuyOrderCount },
|
|
{
|
|
{
|
|
label: '今日购买成功客户',
|
|
label: '今日购买成功客户',
|
|
@@ -136,44 +146,40 @@ export default {
|
|
mounted() {},
|
|
mounted() {},
|
|
methods: {
|
|
methods: {
|
|
async share() {
|
|
async share() {
|
|
- console.log(this);
|
|
|
|
|
|
+ // console.log(this);
|
|
|
|
+ if (this.data.status !== 1) {
|
|
|
|
+ throw new Error('当前活动已失效');
|
|
|
|
+ }
|
|
this.$tongji.trackEvent('活动', '分享', '', 0);
|
|
this.$tongji.trackEvent('活动', '分享', '', 0);
|
|
-
|
|
|
|
const url =
|
|
const url =
|
|
location.origin +
|
|
location.origin +
|
|
this.$router.resolve({
|
|
this.$router.resolve({
|
|
- path: '/register-for-invite',
|
|
|
|
|
|
+ path: '/activity/invite-user/register',
|
|
query: {
|
|
query: {
|
|
- invitationUserName: this.$auth.user?.phone,
|
|
|
|
- activityId: 1,
|
|
|
|
|
|
+ invitationUserName: this.data.inviteUserName,
|
|
|
|
+ activityId: this.data.activityId,
|
|
},
|
|
},
|
|
}).href;
|
|
}).href;
|
|
|
|
|
|
if (this.$userAgent.isMiniProgram) {
|
|
if (this.$userAgent.isMiniProgram) {
|
|
// 小程序环境
|
|
// 小程序环境
|
|
- await clipboard.write(url);
|
|
|
|
|
|
+ await clipboard.writeText(url);
|
|
this.$toast.success('链接复制成功');
|
|
this.$toast.success('链接复制成功');
|
|
} else if (this.$userAgent.isApp) {
|
|
} else if (this.$userAgent.isApp) {
|
|
// app环境
|
|
// app环境
|
|
this.$native.share({
|
|
this.$native.share({
|
|
title: '双子星APP',
|
|
title: '双子星APP',
|
|
content: '分享好友购买云机套餐,返星币换现金',
|
|
content: '分享好友购买云机套餐,返星币换现金',
|
|
- gotoUrl: `${location.origin}${location.pathname}${qs.stringify(
|
|
|
|
- { id: 666 },
|
|
|
|
- { addQueryPrefix: true },
|
|
|
|
- )}`,
|
|
|
|
- shareImg: url,
|
|
|
|
|
|
+ gotoUrl: url,
|
|
|
|
+ shareImg: 'sdsa.png',
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
// 浏览器环境
|
|
// 浏览器环境
|
|
- // await clipboard.write(url);
|
|
|
|
- throw new Error('1231');
|
|
|
|
- // this.$toast.success('链接复制成功');
|
|
|
|
|
|
+ await clipboard.writeText(url);
|
|
|
|
+ // throw new Error('1231');
|
|
|
|
+ this.$toast.success('链接复制成功');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- share2() {
|
|
|
|
- throw new Error('1231');
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -251,12 +257,15 @@ export default {
|
|
.share-button {
|
|
.share-button {
|
|
display: block;
|
|
display: block;
|
|
margin: auto;
|
|
margin: auto;
|
|
- width: 302px;
|
|
|
|
- height: 62px;
|
|
|
|
|
|
+ width: 302px !important;
|
|
|
|
+ height: 62px !important;
|
|
background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
|
|
background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
margin-top: 24px;
|
|
margin-top: 24px;
|
|
// margin-bottom: 24px;
|
|
// margin-bottom: 24px;
|
|
|
|
+ color: #dd1b0d;
|
|
|
|
+ font-size: 22px;
|
|
|
|
+ font-weight: bold;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.box2 {
|
|
.box2 {
|
|
@@ -275,7 +284,7 @@ export default {
|
|
.box4 {
|
|
.box4 {
|
|
.box-main {
|
|
.box-main {
|
|
// padding-left: 20px;
|
|
// padding-left: 20px;
|
|
- padding-top: 0;
|
|
|
|
|
|
+ // padding-top: 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|