1 line
6.9 KiB
Plaintext
1 line
6.9 KiB
Plaintext
{"version":3,"file":"s-share-modal.js","sources":["../../../../../../src/sheep/components/s-share-modal/s-share-modal.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9zaGVlcC9jb21wb25lbnRzL3Mtc2hhcmUtbW9kYWwvcy1zaGFyZS1tb2RhbC52dWU"],"sourcesContent":["<!-- 全局分享弹框 -->\r\n<template>\r\n <view>\r\n <su-popup :show=\"state.showShareGuide\" :showClose=\"false\" @close=\"onCloseGuide\" />\r\n <view v-if=\"state.showShareGuide\" class=\"guide-wrap\">\r\n <image\r\n class=\"guide-image\"\r\n :src=\"sheep.$url.static('/static/img/shop/share/share_guide.png')\"\r\n />\r\n </view>\r\n\r\n <su-popup :show=\"show\" round=\"10\" :showClose=\"false\" @close=\"closeShareModal\">\r\n <!-- 分享 tools -->\r\n <view class=\"share-box\">\r\n <view class=\"share-list-box ss-flex\">\r\n <!-- 操作 ①:发送给微信好友 -->\r\n <button\r\n v-if=\"shareConfig.methods.includes('forward')\"\r\n class=\"share-item share-btn ss-flex-col ss-col-center\"\r\n open-type=\"share\"\r\n @tap=\"onShareByForward\"\r\n >\r\n <image\r\n class=\"share-img\"\r\n :src=\"sheep.$url.static('/static/img/shop/share/share_wx.png')\"\r\n mode=\"\"\r\n />\r\n <text class=\"share-title\">微信好友</text>\r\n </button>\r\n\r\n <!-- 操作 ②:生成海报图片 -->\r\n <button\r\n v-if=\"shareConfig.methods.includes('poster')\"\r\n class=\"share-item share-btn ss-flex-col ss-col-center\"\r\n @tap=\"onShareByPoster\"\r\n >\r\n <image\r\n class=\"share-img\"\r\n :src=\"sheep.$url.static('/static/img/shop/share/share_poster.png')\"\r\n mode=\"\"\r\n />\r\n <text class=\"share-title\">生成海报</text>\r\n </button>\r\n\r\n <!-- 操作 ③:生成链接 -->\r\n <button\r\n v-if=\"shareConfig.methods.includes('link')\"\r\n class=\"share-item share-btn ss-flex-col ss-col-center\"\r\n @tap=\"onShareByCopyLink\"\r\n >\r\n <image\r\n class=\"share-img\"\r\n :src=\"sheep.$url.static('/static/img/shop/share/share_link.png')\"\r\n mode=\"\"\r\n />\r\n <text class=\"share-title\">复制链接</text>\r\n </button>\r\n </view>\r\n <view class=\"share-foot ss-flex ss-row-center ss-col-center\" @tap=\"closeShareModal\">\r\n 取消\r\n </view>\r\n </view>\r\n </su-popup>\r\n\r\n <!-- 分享海报,对应操作 ② -->\r\n <canvas-poster\r\n ref=\"SharePosterRef\"\r\n :show=\"state.showPosterModal\"\r\n :shareInfo=\"shareInfo\"\r\n @close=\"state.showPosterModal = false\"\r\n />\r\n </view>\r\n</template>\r\n<script setup>\r\n/**\r\n * 分享弹窗\r\n */\r\nimport { ref, unref, reactive, computed } from 'vue'\r\nimport sheep from '@/sheep'\r\nimport canvasPoster from './canvas-poster/index.vue'\r\nimport { closeShareModal, showAuthModal } from '@/sheep/hooks/useModal'\r\n\r\nconst show = computed(() => sheep.$store('modal').share)\r\nconst shareConfig = computed(() => sheep.$store('app').platform.share)\r\nconst SharePosterRef = ref('')\r\n\r\nconst props = defineProps({\r\n shareInfo: {\r\n type: Object,\r\n default() {},\r\n },\r\n})\r\n\r\nconst state = reactive({\r\n showShareGuide: false, // H5 的指引\r\n showPosterModal: false, // 海报弹窗\r\n})\r\n\r\n// 操作 ②:生成海报分享\r\nconst onShareByPoster = () => {\r\n closeShareModal()\r\n if (!sheep.$store('user').isLogin) {\r\n showAuthModal()\r\n return\r\n }\r\n console.log(props.shareInfo)\r\n unref(SharePosterRef).getPoster()\r\n state.showPosterModal = true\r\n}\r\n\r\n// 操作 ①:直接转发分享\r\nconst onShareByForward = () => {\r\n closeShareModal()\r\n\r\n // #ifdef H5\r\n if (['WechatOfficialAccount', 'H5'].includes(sheep.$platform.name)) {\r\n state.showShareGuide = true\r\n return\r\n }\r\n // #endif\r\n\r\n // #ifdef APP-PLUS\r\n uni.share({\r\n provider: 'weixin',\r\n scene: 'WXSceneSession',\r\n type: 0,\r\n href: props.shareInfo.link,\r\n title: props.shareInfo.title,\r\n summary: props.shareInfo.desc,\r\n imageUrl: props.shareInfo.image,\r\n success: (res) => {\r\n console.log('success:' + JSON.stringify(res))\r\n },\r\n fail: (err) => {\r\n console.log('fail:' + JSON.stringify(err))\r\n },\r\n })\r\n // #endif\r\n}\r\n\r\n// 操作 ③:复制链接分享\r\nconst onShareByCopyLink = () => {\r\n sheep.$helper.copyText(props.shareInfo.link)\r\n closeShareModal()\r\n}\r\n\r\nfunction onCloseGuide() {\r\n state.showShareGuide = false\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.guide-image {\r\n position: fixed;\r\n top: 0;\r\n right: 30rpx;\r\n z-index: 10080;\r\n width: 580rpx;\r\n height: 430rpx;\r\n}\r\n\r\n// 分享tool\r\n.share-box {\r\n width: 750rpx;\r\n padding-top: 30rpx;\r\n background: $white;\r\n border-radius: 30rpx 30rpx 0 0;\r\n\r\n .share-foot {\r\n height: 80rpx;\r\n font-size: 24rpx;\r\n color: $gray-b;\r\n border-top: 1rpx solid $gray-e;\r\n }\r\n\r\n .share-list-box {\r\n .share-btn {\r\n padding: 0;\r\n line-height: 1;\r\n background: none;\r\n border: none;\r\n\r\n &::after {\r\n border: none;\r\n }\r\n }\r\n\r\n .share-item {\r\n flex: 1;\r\n padding-bottom: 20rpx;\r\n\r\n .share-img {\r\n width: 70rpx;\r\n height: 70rpx;\r\n margin-bottom: 20rpx;\r\n background: $gray-f;\r\n border-radius: 50%;\r\n }\r\n\r\n .share-title {\r\n font-size: 24rpx;\r\n color: $dark-6;\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/sheep/components/s-share-modal/s-share-modal.vue'\nwx.createComponent(Component)"],"names":["computed","sheep","ref","reactive","closeShareModal","showAuthModal","unref"],"mappings":";;;;;;;;;;;;AA+EA,MAAM,eAAe,MAAW;;;;;;;;;;;AAGhC,UAAM,OAAOA,cAAQ,SAAC,MAAMC,YAAAA,MAAM,OAAO,OAAO,EAAE,KAAK;AACvD,UAAM,cAAcD,cAAQ,SAAC,MAAMC,YAAK,MAAC,OAAO,KAAK,EAAE,SAAS,KAAK;AACrE,UAAM,iBAAiBC,cAAG,IAAC,EAAE;AAE7B,UAAM,QAAQ;AAOd,UAAM,QAAQC,cAAAA,SAAS;AAAA,MACrB,gBAAgB;AAAA;AAAA,MAChB,iBAAiB;AAAA;AAAA,IACnB,CAAC;AAGD,UAAM,kBAAkB,MAAM;AAC5BC,2CAAiB;AACjB,UAAI,CAACH,YAAAA,MAAM,OAAO,MAAM,EAAE,SAAS;AACjCI,2CAAe;AACf;AAAA,MACD;AACD,cAAQ,IAAI,MAAM,SAAS;AAC3BC,0BAAM,cAAc,EAAE,UAAW;AACjC,YAAM,kBAAkB;AAAA,IAC1B;AAGA,UAAM,mBAAmB,MAAM;AAC7BF,2CAAiB;AAAA,IA0BnB;AAGA,UAAM,oBAAoB,MAAM;AAC9BH,kBAAAA,MAAM,QAAQ,SAAS,MAAM,UAAU,IAAI;AAC3CG,2CAAiB;AAAA,IACnB;AAEA,aAAS,eAAe;AACtB,YAAM,iBAAiB;AAAA,IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnJA,GAAG,gBAAgB,SAAS;"} |