|
@@ -1,5 +1,414 @@
|
|
<template>
|
|
<template>
|
|
- <div class="about">
|
|
|
|
- <h1>This is an home page</h1>
|
|
|
|
|
|
+ <div class="share-create">
|
|
|
|
+ <van-tabs v-model="activeName" swipeable>
|
|
|
|
+ <van-tab title="口令分享" name="a">
|
|
|
|
+ <div class="copy-box">
|
|
|
|
+ <div class="copy-text">
|
|
|
|
+ <van-skeleton :row="3" class="skeleton--text" :loading="loading">
|
|
|
|
+ 你身边的人都在用剑鱼标讯超级订阅找商机就差你了! 复制这条信息:{{TextContent}},打开【剑鱼标讯APP】识别复制口令,快速获取全国招标项目!
|
|
|
|
+ </van-skeleton>
|
|
|
|
+ </div>
|
|
|
|
+ <van-button class="copy-button" :loading="loading" type="primary" @click="copyText">复制文案</van-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="help-box">
|
|
|
|
+ <div class="help-title">如何分享口令?</div>
|
|
|
|
+ <div class="help-content">
|
|
|
|
+ 如何分享口令? 如果您是网络大V想赚佣金,拥有自媒体账号如微博、头条号、百家号、抖音、快手、知乎、豆瓣、B站等,或独立APP,您可以:
|
|
|
|
+ <br>1、将您的专属分享口令复制到您的自媒体文章、简介或独立APP当中(注意不要更改文案中的口令码);
|
|
|
|
+ <br>2、引导您的粉丝复制口令并购买;
|
|
|
|
+ <br>3、粉丝通过您的分享口令完成购买后,您将获得由剑鱼标讯支付的相应佣金哦~
|
|
|
|
+ </div>
|
|
|
|
+ <span style="font-size: 14px">--生成后下方会产生测试预览图片--</span>
|
|
|
|
+ <img :src="imgUrl" alt="">
|
|
|
|
+ </div>
|
|
|
|
+ </van-tab>
|
|
|
|
+ <van-tab title="链接分享" name="b">
|
|
|
|
+ <div class="copy-box">
|
|
|
|
+ <div class="copy-text">
|
|
|
|
+ <van-skeleton :row="3" class="skeleton--text" :loading="loading">
|
|
|
|
+ 你身边的人都在用剑鱼标讯超级订阅找商机就差你了! 微信打开链接:{{UrlContent}},快速获取全国招标项目!
|
|
|
|
+ </van-skeleton>
|
|
|
|
+ </div>
|
|
|
|
+ <van-button class="copy-button" type="primary" :loading="loading" @click="copyText">复制文案</van-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="help-box">
|
|
|
|
+ <div class="help-title">如何分享链接?</div>
|
|
|
|
+ <div class="help-content">
|
|
|
|
+ 如果您希望在微信中赚佣金,您可以:
|
|
|
|
+ <br>1、将您的专属分享链接复制到您的朋友圈、微信好友、微信群、微信视频号文字介绍中,或复制到您的公众号图文中或“阅读原文”中(注意不要更改文案中的链接);
|
|
|
|
+ <br>2、引导您的粉丝或好友打开链接并购买;
|
|
|
|
+ <br>3、粉丝或好友通过您的分享链接完成购买后,您将获得由剑鱼标讯支付的相应佣金哦~
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-tab>
|
|
|
|
+ <van-tab title="图片分享" name="c">
|
|
|
|
+ <div class="save-img" id="save-img">
|
|
|
|
+ <div class="share-img-box">
|
|
|
|
+ <img class="bg-view" src="@/assets/image/share-sprite/hbjh_bg.png" alt="">
|
|
|
|
+ <div class="title-box" :data-index="shareType">
|
|
|
|
+ <!--超级订阅-->
|
|
|
|
+ <img v-if="shareType === 1" src="@/assets/image/share-sprite/hbjh_2.png" alt="超级订阅">
|
|
|
|
+ <!--数据导出-->
|
|
|
|
+ <img v-if="shareType === 2" src="@/assets/image/share-sprite/hbjh_1.png" alt="数据导出">
|
|
|
|
+ <!--数据报告-->
|
|
|
|
+ <img v-if="shareType === 3" src="@/assets/image/share-sprite/hbjh_3.png" alt="数据报告">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="qr-code-box">
|
|
|
|
+ <span :data-index="shareType">微信扫码 或 长按二维码</span>
|
|
|
|
+ <van-image :data-index="shareType" @click="reloadImg" :src="ImgContent" @load="ImgStatus = true" @error="ImgStatus = false">
|
|
|
|
+ <template v-slot:error>
|
|
|
|
+ <van-row type="flex" justify="center" align="center">
|
|
|
|
+ 加载失败
|
|
|
|
+ <van-icon style="margin-left: 6px" name="replay" />
|
|
|
|
+ </van-row>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-slot:loading>
|
|
|
|
+ <van-loading type="spinner" size="20" />
|
|
|
|
+ </template>
|
|
|
|
+ </van-image>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="tip-bg-box">
|
|
|
|
+ <div class="tip-box">
|
|
|
|
+ <img src="@/assets/image/share-sprite/qrcode-icon.png" alt="">
|
|
|
|
+ <span>{{tipArr[shareType - 1]}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="fill-tip-box" data-html2canvas-ignore></div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="save-button-box">
|
|
|
|
+ <van-button :disabled="!ImgStatus" :loading="runSaveStatus" class="save-button" type="primary" @click="saveImg">保存图片</van-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-tab>
|
|
|
|
+ </van-tabs>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
+<script lang="ts">
|
|
|
|
+import { Component, Vue } from 'vue-property-decorator'
|
|
|
|
+import { Button, Image, Loading, Tab, Tabs, Toast, Skeleton, Icon, Row } from 'vant'
|
|
|
|
+import html2canvas from 'html2canvas'
|
|
|
|
+import { mapActions, mapState } from 'vuex'
|
|
|
|
+import { CardItem, ShareType } from '@/views/share/utils'
|
|
|
|
+
|
|
|
|
+enum tabs {
|
|
|
|
+ a = '口令',
|
|
|
|
+ b = '链接',
|
|
|
|
+ c = '图片'
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+@Component({
|
|
|
|
+ components: {
|
|
|
|
+ [Tab.name]: Tab,
|
|
|
|
+ [Tabs.name]: Tabs,
|
|
|
|
+ [Button.name]: Button,
|
|
|
|
+ [Image.name]: Image,
|
|
|
|
+ [Row.name]: Row,
|
|
|
|
+ [Icon.name]: Icon,
|
|
|
|
+ [Skeleton.name]: Skeleton,
|
|
|
|
+ [Loading.name]: Loading
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapActions({
|
|
|
|
+ ShareInfo: 'share/ShareInfo'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState('share', {
|
|
|
|
+ Item: (state: any) => state.selectShare
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+export default class Share extends Vue {
|
|
|
|
+ protected ShareInfo!: any
|
|
|
|
+ protected Item: CardItem | any
|
|
|
|
+ activeName: keyof typeof tabs = 'a'
|
|
|
|
+ shareType = 1
|
|
|
|
+ imgUrl = ''
|
|
|
|
+ runSaveStatus = false
|
|
|
|
+ tipArr = ['立即扫码,快速获取全国招标项目!', '立即扫码,直接使用!', '现在扫码,立即获取!']
|
|
|
|
+ TextContent = ''
|
|
|
|
+ UrlContent = ''
|
|
|
|
+ ImgContent = null
|
|
|
|
+ loading = true
|
|
|
|
+ ImgStatus = false
|
|
|
|
+
|
|
|
|
+ copyText () {
|
|
|
|
+ Toast(tabs[this.activeName] + '已经复制,快去粘贴吧~')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ saveStatus () {
|
|
|
|
+ Toast.clear()
|
|
|
|
+ Toast('保存成功')
|
|
|
|
+ this.runSaveStatus = false
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ reloadImg () {
|
|
|
|
+ if (!this.ImgStatus) {
|
|
|
|
+ const tempImg = this.ImgContent
|
|
|
|
+ this.ImgContent = null
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.ImgContent = tempImg
|
|
|
|
+ }, 2000)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ saveImg () {
|
|
|
|
+ this.runSaveStatus = true
|
|
|
|
+ Toast.loading({
|
|
|
|
+ message: '生成中...',
|
|
|
|
+ forbidClick: true
|
|
|
|
+ })
|
|
|
|
+ if (this.imgUrl !== '') {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.saveStatus()
|
|
|
|
+ }, 1000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const dom = document.querySelector('.share-img-box')
|
|
|
|
+ html2canvas(dom as any, {
|
|
|
|
+ // allowTaint: true,
|
|
|
|
+ backgroundColor: null,
|
|
|
|
+ scale: 3
|
|
|
|
+ }).then(canvas => {
|
|
|
|
+ this.imgUrl = canvas.toDataURL('image/png')
|
|
|
|
+ this.saveStatus()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ created () {
|
|
|
|
+ console.log(this.Item)
|
|
|
|
+ this.shareType = this.Item.type || ShareType.超级订阅
|
|
|
|
+ this.ShareInfo().then(({ data = {} as any, flag = false, msg = '请重试' } = {}) => {
|
|
|
|
+ console.log(data)
|
|
|
|
+ if (flag) {
|
|
|
|
+ this.TextContent = data?.disWord
|
|
|
|
+ this.UrlContent = data?.shareLink
|
|
|
|
+ this.ImgContent = data?.erUrl
|
|
|
|
+ } else {
|
|
|
|
+ Toast(msg)
|
|
|
|
+ }
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss">
|
|
|
|
+ .share-create {
|
|
|
|
+ .skeleton--text .van-skeleton__row{
|
|
|
|
+ background-color: #dedede;
|
|
|
|
+ }
|
|
|
|
+ .van-tabs__nav--line {
|
|
|
|
+ padding-bottom: 0;
|
|
|
|
+ }
|
|
|
|
+ .van-tab {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #5F5E64;
|
|
|
|
+ &--active {
|
|
|
|
+ color: #2ABED1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .van-tabs--line .van-tabs__wrap {
|
|
|
|
+ padding: 2px 0;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ }
|
|
|
|
+ .van-tabs__line {
|
|
|
|
+ bottom: 4px;
|
|
|
|
+ width: 24px !important;
|
|
|
|
+ background: linear-gradient(270.45deg, #25BEEE 0.03%, #2ABED1 74.46%);
|
|
|
|
+ }
|
|
|
|
+ .van-tabs__content .van-tab__pane:last-child {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .save-img {
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ .tip-bg-box {
|
|
|
|
+ position: absolute;
|
|
|
|
+ z-index: 2;
|
|
|
|
+ bottom: 34px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ width: 100%;
|
|
|
|
+ background: #fff;
|
|
|
|
+ padding: 2px;
|
|
|
|
+ }
|
|
|
|
+ .fill-tip-box {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ z-index: 2;
|
|
|
|
+ background: #fff;
|
|
|
|
+ }
|
|
|
|
+ .tip-box {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ height: 38px;
|
|
|
|
+ border: 1px solid #2ABED1;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ border-radius: 41px;
|
|
|
|
+ font-size: 15px;
|
|
|
|
+ line-height: 2;
|
|
|
|
+ color: #171826;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ padding: 8px 16px;
|
|
|
|
+ > img {
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ margin-right: 8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .title-box {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ z-index: 2;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ &[data-index='1'] img {
|
|
|
|
+ width: 298px;
|
|
|
|
+ height: 128px;
|
|
|
|
+ margin-top: 81px;
|
|
|
|
+ }
|
|
|
|
+ &[data-index='2'] img {
|
|
|
|
+ width: 295px;
|
|
|
|
+ height: 159px;
|
|
|
|
+ margin-top: 73px;
|
|
|
|
+ }
|
|
|
|
+ &[data-index='3'] img {
|
|
|
|
+ width: 357px;
|
|
|
|
+ height: 145px;
|
|
|
|
+ margin-top: 77px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .qr-code-box {
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 100%;
|
|
|
|
+ top: 273px;
|
|
|
|
+ left: 0;
|
|
|
|
+ z-index: 2;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ > span {
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ background-color: #3D3D50;
|
|
|
|
+ width: 200px;
|
|
|
|
+ border-radius: 8px 8px 0 0;
|
|
|
|
+ line-height: 34px;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ text-align: center;
|
|
|
|
+ &[data-index='2'] {
|
|
|
|
+ background-color: #37D2B8;
|
|
|
|
+ }
|
|
|
|
+ &[data-index='3'] {
|
|
|
|
+ background-color: #9B87FF;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .van-image {
|
|
|
|
+ width: 200px;
|
|
|
|
+ min-height: 200px;
|
|
|
|
+ padding: 15px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ border-radius: 0 0 8px 8px;
|
|
|
|
+ background-color: #FAE5C6;
|
|
|
|
+ &[data-index='2'] {
|
|
|
|
+ background-color: #EBFFFC;
|
|
|
|
+ }
|
|
|
|
+ &[data-index='3'] {
|
|
|
|
+ background-color: #FAF9FF;
|
|
|
|
+ }
|
|
|
|
+ > img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .save-button-box {
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ z-index: 3;
|
|
|
|
+ width: 100%;
|
|
|
|
+ background: rgba(255, 255, 255, 0.96);
|
|
|
|
+ padding: 8px 16px 12px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ .save-button {
|
|
|
|
+ margin-top: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .share-create {
|
|
|
|
+ background-color: #F5F6F7;
|
|
|
|
+ }
|
|
|
|
+ .copy-box {
|
|
|
|
+ background: #FFFFFF;
|
|
|
|
+ padding: 20px 16px;
|
|
|
|
+ .copy-text {
|
|
|
|
+ background: #F5F6F7;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ padding: 16px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ color: #171826;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .copy-button, .save-button {
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ background: #2ABED1;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ line-height: 26px;
|
|
|
|
+ color: #F7F9FA;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 46px;
|
|
|
|
+ border: none;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .help-box {
|
|
|
|
+ padding: 0 16px 24px;
|
|
|
|
+ .help-title {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ line-height: 26px;
|
|
|
|
+ color: #171826;
|
|
|
|
+ position: relative;
|
|
|
|
+ padding-left: 11px;
|
|
|
|
+ margin: 24px 0 14px;
|
|
|
|
+ &::before {
|
|
|
|
+ content: "";
|
|
|
|
+ width: 3px;
|
|
|
|
+ height: 16px;
|
|
|
|
+ background: #2ABED1;
|
|
|
|
+ border-radius: 11px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 5px;
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .help-content {
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ color: #5F5E64;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+</style>
|