|
@@ -4,25 +4,59 @@
|
|
the
|
|
the
|
|
tasks.</div>
|
|
tasks.</div>
|
|
<div class="area-url">
|
|
<div class="area-url">
|
|
- <div class="url">h5.denetme.net/aac465147b12I8ac46531994</div>
|
|
|
|
- <div class="btn">
|
|
|
|
|
|
+ <div class="url">{{ state.share_url }}</div>
|
|
|
|
+ <div class="btn copy-btn" @click="clickCopy" :data-clipboard-text="state.share_url">
|
|
Copy
|
|
Copy
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="share-list">
|
|
<div class="share-list">
|
|
- <img :src="require('@/assets/svg/icon-btn-box.svg')" alt="" />
|
|
|
|
- <img :src="require('@/assets/svg/icon-btn-box.svg')" alt="" />
|
|
|
|
- <img :src="require('@/assets/svg/icon-btn-box.svg')" alt="" />
|
|
|
|
- <img :src="require('@/assets/svg/icon-btn-box.svg')" alt="" />
|
|
|
|
- <img :src="require('@/assets/svg/icon-btn-box.svg')" alt="" />
|
|
|
|
- <img :src="require('@/assets/svg/icon-btn-box.svg')" alt="" />
|
|
|
|
|
|
+ <img :src="item.iconPath" alt="" v-for="item in state.share_list" @click="clickShare(item)" />
|
|
</div>
|
|
</div>
|
|
<v-btn :txt="'Invite a friend to open the chest'" :font-size="'17px'" class="btn" :icon="false"
|
|
<v-btn :txt="'Invite a friend to open the chest'" :font-size="'17px'" class="btn" :icon="false"
|
|
:disabled="true"></v-btn>
|
|
:disabled="true"></v-btn>
|
|
|
|
+ <v-toast :show="state.toast.show" :txt="state.toast.txt"></v-toast>
|
|
|
|
+ <open-box></open-box>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
|
|
+import VToast from '@/view/iframe/treasure-hunt/components/toast.vue'
|
|
|
|
+import OpenBox from '@/view/iframe/treasure-hunt/components/dialog.vue'
|
|
|
|
+import { inject } from 'vue'
|
|
|
|
+let ClipboardJS = require('clipboard');
|
|
|
|
+let state = inject('state')
|
|
|
|
+state.toast = {}
|
|
|
|
+
|
|
|
|
+state.share_list = [{
|
|
|
|
+ iconPath: require('@/assets/svg/icon-btn-box.svg'),
|
|
|
|
+ redirectPath: 'https://www.baidu.com'
|
|
|
|
+}]
|
|
|
|
+state.share_url = '123123123123'
|
|
|
|
+
|
|
|
|
+const clickShare = (item) => {
|
|
|
|
+ window.open(item.redirectPath)
|
|
|
|
+}
|
|
|
|
+var clipboard = new ClipboardJS('.copy-btn');
|
|
|
|
+
|
|
|
|
+const clickCopy = () => {
|
|
|
|
+ clipboard.on('success', function (e) {
|
|
|
|
+ state.toast.txt = 'Copy Successfully'
|
|
|
|
+ state.toast.show = true
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ state.toast.show = false
|
|
|
|
+ }, 2000)
|
|
|
|
+ e.clearSelection();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ clipboard.on('error', function (e) {
|
|
|
|
+ state.toast.txt = 'Copy Error'
|
|
|
|
+ state.toast.show = true
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ state.toast.show = false
|
|
|
|
+ }, 2000)
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.invite-friends {
|
|
.invite-friends {
|
|
@@ -52,6 +86,10 @@ import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
|
|
|
.url {
|
|
.url {
|
|
|
|
+ display: -webkit-box;
|
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
|
+ -webkit-line-clamp: 3;
|
|
|
|
+ overflow: hidden;
|
|
width: 194px;
|
|
width: 194px;
|
|
|
|
|
|
color: #737373;
|
|
color: #737373;
|
|
@@ -82,6 +120,7 @@ import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
.share-list {
|
|
.share-list {
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
text-align: center;
|
|
text-align: center;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
|
|
img {
|
|
img {
|
|
user-select: none;
|
|
user-select: none;
|