zhangyaowen 3 месяцев назад
Родитель
Сommit
9159137f72

+ 192 - 211
sheep/components/s-layout/s-layout.vue

@@ -1,41 +1,21 @@
 <template>
-  <view
-    class="page-app"
-    :class="['theme-' + sys?.mode, 'main-' + sys?.theme, 'font-' + sys?.fontSize]"
-  >
+  <view class="page-app" :class="['theme-' + sys?.mode, 'main-' + sys?.theme, 'font-' + sys?.fontSize]">
     <view class="page-main" :style="[bgMain]">
       <!-- 顶部导航栏-情况1:默认通用顶部导航栏 -->
-      <su-navbar
-        v-if="navbar === 'normal'"
-        :title="title"
-        statusBar
-        :color="color"
-        :tools="tools"
-        :opacityBgUi="opacityBgUi"
-        @search="(e) => emits('search', e)"
-        :defaultSearch="defaultSearch"
-      />
+      <su-navbar v-if="navbar === 'normal'" :title="title" statusBar :color="color" :tools="tools"
+        :opacityBgUi="opacityBgUi" @search="(e) => emits('search', e)" :defaultSearch="defaultSearch" />
 
       <!-- 顶部导航栏-情况2:装修组件导航栏-标准 -->
-      <s-custom-navbar
-        v-else-if="navbar === 'custom' && navbarMode === 'normal'"
-        :data="navbarStyle"
-        :showLeftButton="showLeftButton"
-      />
+      <s-custom-navbar v-else-if="navbar === 'custom' && navbarMode === 'normal'" :data="navbarStyle"
+        :showLeftButton="showLeftButton" />
       <view class="page-body" :style="[bgBody]">
         <!-- 顶部导航栏-情况3:沉浸式头部 -->
         <su-inner-navbar v-if="navbar === 'inner'" :title="title" />
-        <view
-          v-if="navbar === 'inner'"
-          :style="[{ paddingTop: sheep?.$platform?.navbar + 'px' }]"
-        ></view>
+        <view v-if="navbar === 'inner'" :style="[{ paddingTop: sheep?.$platform?.navbar + 'px' }]"></view>
 
         <!-- 顶部导航栏-情况4:装修组件导航栏-沉浸式 -->
-        <s-custom-navbar
-          v-if="navbar === 'custom' && navbarMode === 'inner'"
-          :data="navbarStyle"
-          :showLeftButton="showLeftButton"
-        />
+        <s-custom-navbar v-if="navbar === 'custom' && navbarMode === 'inner'" :data="navbarStyle"
+          :showLeftButton="showLeftButton" />
 
         <!-- 页面内容插槽 -->
         <slot />
@@ -57,202 +37,203 @@
 </template>
 
 <script setup>
-  /**
-   * 模板组件 - 提供页面公共组件,属性,方法
-   */
-  import { computed, onMounted } from 'vue';
-  import sheep from '@/sheep';
-  import { isEmpty } from 'lodash-es';
-  // #ifdef MP-WEIXIN
-  import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
-  // #endif
-
-  const props = defineProps({
-    title: {
-      type: String,
-      default: '',
-    },
-    navbar: {
-      type: String,
-      default: 'normal',
-    },
-    opacityBgUi: {
-      type: String,
-      default: 'bg-white',
-    },
-    color: {
-      type: String,
-      default: '',
-    },
-    tools: {
-      type: String,
-      default: 'title',
-    },
-    keyword: {
-      type: String,
-      default: '',
-    },
-    navbarStyle: {
-      type: Object,
-      default: () => ({
-        styleType: '',
-        type: '',
-        color: '',
-        src: '',
-        list: [],
-        alwaysShow: 0,
-      }),
-    },
-    bgStyle: {
-      type: Object,
-      default: () => ({
-        src: '',
-        color: 'var(--ui-BG-1)',
-      }),
-    },
-    tabbar: {
-      type: [String, Boolean],
-      default: '',
-    },
-    onShareAppMessage: {
-      type: [Boolean, Object],
-      default: true,
-    },
-    leftWidth: {
-      type: [Number, String],
-      default: 100,
-    },
-    rightWidth: {
-      type: [Number, String],
-      default: 100,
-    },
-    defaultSearch: {
-      type: String,
-      default: '',
-    },
-    //展示返回按钮
-    showLeftButton: {
-      type: Boolean,
-      default: false,
-    },
-  });
-  const emits = defineEmits(['search']);
-
-  const sysStore = sheep.$store('sys');
-  const userStore = sheep.$store('user');
-  const appStore = sheep.$store('app');
-  const modalStore = sheep.$store('modal');
-  const sys = computed(() => sysStore);
-
-  // 导航栏模式(因为有自定义导航栏 需要计算)
-  const navbarMode = computed(() => {
-    if (props.navbar === 'normal' || props.navbarStyle.styleType === 'normal') {
-      return 'normal';
-    }
-    return 'inner';
-  });
-
-  // 背景1
-  const bgMain = computed(() => {
-    if (navbarMode.value === 'inner') {
-      return {
-        background: `${props.bgStyle.backgroundColor || props.bgStyle.color} url(${sheep.$url.cdn(
-          props.bgStyle.backgroundImage,
-        )}) no-repeat top center / 100% auto`,
-      };
-    }
-    return {};
-  });
-
-  // 背景2
-  const bgBody = computed(() => {
-    if (navbarMode.value === 'normal') {
-      return {
-        background: `${props.bgStyle.backgroundColor || props.bgStyle.color} url(${sheep.$url.cdn(
-          props.bgStyle.backgroundImage,
-        )}) no-repeat top center / 100% auto`,
-      };
-    }
-    return {};
-  });
-
-  // 分享信息
-  const shareInfo = computed(() => {
-    if (props.onShareAppMessage === true) {
-      return sheep.$platform.share.getShareInfo();
-    } else {
-      if (!isEmpty(props.onShareAppMessage)) {
-        sheep.$platform.share.updateShareInfo(props.onShareAppMessage);
-        return props.onShareAppMessage;
-      }
-    }
-    return {};
-  });
+/**
+ * 模板组件 - 提供页面公共组件,属性,方法
+ */
+import { computed, onMounted } from 'vue';
+import sheep from '@/sheep';
+import { isEmpty } from 'lodash-es';
+// #ifdef MP-WEIXIN
+import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
+// #endif
+
+const props = defineProps({
+  title: {
+    type: String,
+    default: '',
+  },
+  navbar: {
+    type: String,
+    default: 'normal',
+  },
+  opacityBgUi: {
+    type: String,
+    default: 'bg-white',
+  },
+  color: {
+    type: String,
+    default: '',
+  },
+  tools: {
+    type: String,
+    default: 'title',
+  },
+  keyword: {
+    type: String,
+    default: '',
+  },
+  navbarStyle: {
+    type: Object,
+    default: () => ({
+      styleType: '',
+      type: '',
+      color: '',
+      src: '',
+      list: [],
+      alwaysShow: 0,
+    }),
+  },
+  bgStyle: {
+    type: Object,
+    default: () => ({
+      src: '',
+      color: 'var(--ui-BG-1)',
+    }),
+  },
+  tabbar: {
+    type: [String, Boolean],
+    default: '',
+  },
+  onShareAppMessage: {
+    type: [Boolean, Object],
+    default: true,
+  },
+  leftWidth: {
+    type: [Number, String],
+    default: 100,
+  },
+  rightWidth: {
+    type: [Number, String],
+    default: 100,
+  },
+  defaultSearch: {
+    type: String,
+    default: '',
+  },
+  //展示返回按钮
+  showLeftButton: {
+    type: Boolean,
+    default: false,
+  },
+});
+const emits = defineEmits(['search']);
+
+const sysStore = sheep.$store('sys');
+const userStore = sheep.$store('user');
+const appStore = sheep.$store('app');
+const modalStore = sheep.$store('modal');
+const sys = computed(() => sysStore);
+
+// 导航栏模式(因为有自定义导航栏 需要计算)
+const navbarMode = computed(() => {
+  if (props.navbar === 'normal' || props.navbarStyle.styleType === 'normal') {
+    return 'normal';
+  }
+  return 'inner';
+});
 
-  // #ifdef MP-WEIXIN
-  uni.showShareMenu({
-    withShareTicket: true,
-    menus: ['shareAppMessage', 'shareTimeline'],
-  });
-  // 微信小程序分享好友
-  onShareAppMessage(() => {
+// 背景1
+const bgMain = computed(() => {
+  if (navbarMode.value === 'inner') {
     return {
-      title: shareInfo.value.title,
-      path: shareInfo.value.forward.path,
-      imageUrl: shareInfo.value.image,
+      background: `${props.bgStyle.backgroundColor || props.bgStyle.color} url(${sheep.$url.cdn(
+        props.bgStyle.backgroundImage,
+      )}) no-repeat top center / 100% auto`,
     };
-  });
-  // 微信小程序分享朋友圈
-  onShareTimeline(() => {
+  }
+  return {};
+});
+
+// 背景2
+const bgBody = computed(() => {
+  if (navbarMode.value === 'normal') {
     return {
-      title: shareInfo.value.title,
-      query: shareInfo.value.forward.path,
-      imageUrl: shareInfo.value.image,
+      background: `${props.bgStyle.backgroundColor || props.bgStyle.color} url(${sheep.$url.cdn(
+        props.bgStyle.backgroundImage,
+      )}) no-repeat top center / 100% auto`,
     };
-  });
-  // #endif
-
-  // 组件中使用 onMounted 监听页面加载,不是页面组件不使用 onShow
-  onMounted(()=>{
-    if (!isEmpty(shareInfo.value)) {
-      sheep.$platform.share.updateShareInfo(shareInfo.value);
+  }
+  return {};
+});
+
+// 分享信息
+const shareInfo = computed(() => {
+  console.log('props.onShareAppMessage', props.onShareAppMessage);
+  if (props.onShareAppMessage === true) {
+    return sheep.$platform.share.getShareInfo();
+  } else {
+    if (!isEmpty(props.onShareAppMessage)) {
+      sheep.$platform.share.updateShareInfo(props.onShareAppMessage);
+      return props.onShareAppMessage;
     }
-  })
+  }
+  return {};
+});
+
+// #ifdef MP-WEIXIN
+uni.showShareMenu({
+  withShareTicket: true,
+  menus: ['shareAppMessage', 'shareTimeline'],
+});
+// 微信小程序分享好友
+onShareAppMessage(() => {
+  return {
+    title: shareInfo.value.title,
+    path: shareInfo.value.forward.path,
+    imageUrl: shareInfo.value.image,
+  };
+});
+// 微信小程序分享朋友圈
+onShareTimeline(() => {
+  return {
+    title: shareInfo.value.title,
+    query: shareInfo.value.forward.path,
+    imageUrl: shareInfo.value.image,
+  };
+});
+// #endif
+
+// 组件中使用 onMounted 监听页面加载,不是页面组件不使用 onShow
+onMounted(() => {
+  if (!isEmpty(shareInfo.value)) {
+    sheep.$platform.share.updateShareInfo(shareInfo.value);
+  }
+})
 </script>
 
 <style lang="scss" scoped>
-  .page-app {
-    position: relative;
-    color: var(--ui-TC);
-    background-color: var(--ui-BG-1) !important;
-    z-index: 2;
-    display: flex;
+.page-app {
+  position: relative;
+  color: var(--ui-TC);
+  background-color: var(--ui-BG-1) !important;
+  z-index: 2;
+  display: flex;
+  width: 100%;
+  height: 100vh;
+
+  .page-main {
+    position: absolute;
+    z-index: 1;
     width: 100%;
-    height: 100vh;
+    min-height: 100%;
+    display: flex;
+    flex-direction: column;
 
-    .page-main {
-      position: absolute;
-      z-index: 1;
+    .page-body {
       width: 100%;
-      min-height: 100%;
-      display: flex;
-      flex-direction: column;
-
-      .page-body {
-        width: 100%;
-        position: relative;
-        z-index: 1;
-        flex: 1;
-      }
+      position: relative;
+      z-index: 1;
+      flex: 1;
+    }
 
-      .page-img {
-        width: 100vw;
-        height: 100vh;
-        position: absolute;
-        top: 0;
-        left: 0;
-        z-index: 0;
-      }
+    .page-img {
+      width: 100vw;
+      height: 100vh;
+      position: absolute;
+      top: 0;
+      left: 0;
+      z-index: 0;
     }
   }
+}
 </style>

+ 163 - 135
sheep/components/s-share-modal/canvas-poster/index.vue

@@ -2,21 +2,12 @@
 <template>
   <su-popup :show="show" round="10" @close="onClosePoster" type="center" class="popup-box">
     <view class="ss-flex-col ss-col-center ss-row-center">
-      <image
-        v-if="!!painterImageUrl"
-        class="poster-img"
-        :src="painterImageUrl"
-        :style="{
-          height: poster.css.height+ 'px',
-          width: poster.css.width + 'px',
-        }"
-        :show-menu-by-longpress="true"
-      />
+      <image v-if="!!painterImageUrl" class="poster-img" :src="painterImageUrl" :style="{
+        height: poster.css.height - 50 + 'px',
+        width: poster.css.width + 'px',
+      }" :show-menu-by-longpress="true" @longpress="onLongPress" />
     </view>
-    <view
-      class="poster-btn-box ss-m-t-20 ss-flex ss-row-between ss-col-center"
-      v-if="!!painterImageUrl"
-    >
+    <view class="poster-btn-box ss-m-t-20 ss-flex ss-row-between ss-col-center" v-if="!!painterImageUrl">
       <button class="cancel-btn ss-reset-button" @tap="onClosePoster">取消</button>
       <button class="save-btn ss-reset-button ui-BG-Main" @tap="onSavePoster">
         {{
@@ -27,142 +18,179 @@
       </button>
     </view>
     <!--  海报画板:默认隐藏只用来生成海报。生成方式为主动调用  -->
-    <l-painter
-      isCanvasToTempFilePath
-      pathType="url"
-      @success="setPainterImageUrl"
-      hidden
-      ref="painterRef"
-    />
+    <l-painter isCanvasToTempFilePath pathType="url" @success="setPainterImageUrl" hidden ref="painterRef" />
   </su-popup>
 </template>
 
 <script setup>
-  /**
-   * 海报生成和展示
-   * 提示:小程序码默认跳转首页,由首页进行 spm 参数解析后跳转到对应的分享页面
-   * @description 用于生成分享海报,如:分享产品海报。
-   * @tutorial https://ext.dcloud.net.cn/plugin?id=2389
-   * @property {Boolean} show   弹出层控制
-   * @property {Object}  shareInfo 分享信息
-   */
-  import { reactive, ref, unref } from 'vue';
-  import sheep from '@/sheep';
-  import { getPosterData } from '@/sheep/components/s-share-modal/canvas-poster/poster';
-
-  const props = defineProps({
-    show: {
-      type: Boolean,
-      default: false,
+/**
+ * 海报生成和展示
+ * 提示:小程序码默认跳转首页,由首页进行 spm 参数解析后跳转到对应的分享页面
+ * @description 用于生成分享海报,如:分享产品海报。
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=2389
+ * @property {Boolean} show   弹出层控制
+ * @property {Object}  shareInfo 分享信息
+ */
+import { reactive, ref, unref } from 'vue';
+import sheep from '@/sheep';
+import { getPosterData } from '@/sheep/components/s-share-modal/canvas-poster/poster';
+
+const props = defineProps({
+  show: {
+    type: Boolean,
+    default: false,
+  },
+  shareInfo: {
+    type: Object,
+    default: () => {
     },
-    shareInfo: {
-      type: Object,
-      default: () => {
-      },
+  },
+});
+
+const poster = reactive({
+  css: {
+    // 根节点若无尺寸,自动获取父级节点
+    width: sheep.$platform.device.windowWidth * 0.9,
+    height: 600,
+  },
+  views: [],
+});
+
+const emits = defineEmits(['success', 'close']);
+
+const onClosePoster = () => {
+  emits('close');
+};
+
+const painterRef = ref(); // 海报画板
+const painterImageUrl = ref(); // 海报 url
+// 渲染海报
+const renderPoster = async () => {
+  console.log(poster, 2222111)
+  await painterRef.value.render(unref(poster));
+};
+// 获得生成的图片
+const setPainterImageUrl = (path) => {
+  painterImageUrl.value = path;
+};
+
+// 长按保存图片
+const onLongPress = () => {
+  // #ifdef H5
+  if (['WechatOfficialAccount', 'H5'].includes(sheep.$platform.name)) {
+    // 创建a标签下载
+    const a = document.createElement('a');
+    a.href = painterImageUrl.value;
+    a.download = 'poster.png';
+    document.body.appendChild(a);
+    a.click();
+    document.body.removeChild(a);
+    sheep.$helper.toast('开始下载');
+    return;
+  }
+  // #endif
+
+  // 非H5 保存到相册
+  uni.saveImageToPhotosAlbum({
+    filePath: painterImageUrl.value,
+    success: (res) => {
+      onClosePoster();
+      sheep.$helper.toast('保存成功');
     },
-  });
-
-  const poster = reactive({
-    css: {
-      // 根节点若无尺寸,自动获取父级节点
-      width: sheep.$platform.device.windowWidth * 0.9,
-      height: 600,
+    fail: (err) => {
+      sheep.$helper.toast('保存失败');
+      console.log('图片保存失败:', err);
     },
-    views: [],
   });
-
-  const emits = defineEmits(['success', 'close']);
-
-  const onClosePoster = () => {
-    emits('close');
-  };
-
-  const painterRef = ref(); // 海报画板
-  const painterImageUrl = ref(); // 海报 url
-  // 渲染海报
-  const renderPoster = async () => {
-    await painterRef.value.render(unref(poster));
-  };
-  // 获得生成的图片
-  const setPainterImageUrl = (path) => {
-    painterImageUrl.value = path;
-  };
-  // 保存海报图片
-  const onSavePoster = () => {
-    if (['WechatOfficialAccount', 'H5'].includes(sheep.$platform.name)) {
-      sheep.$helper.toast('请长按图片保存');
-      return;
-    }
-
-    // 非H5 保存到相册
-    uni.saveImageToPhotosAlbum({
-      filePath: painterImageUrl.value,
-      success: (res) => {
-        onClosePoster();
-        sheep.$helper.toast('保存成功');
-      },
-      fail: (err) => {
-        sheep.$helper.toast('保存失败');
-        console.log('图片保存失败:', err);
-      },
-    });
-  };
-
-  // 获得海报数据
-  async function getPoster() {
-    painterImageUrl.value = undefined
-    poster.views = await getPosterData({
-      width: poster.css.width,
-      shareInfo: props.shareInfo,
-    });
-    await renderPoster();
+};
+
+// 保存海报图片
+const onSavePoster = () => {
+  // #ifdef H5
+  if (['WechatOfficialAccount', 'H5'].includes(sheep.$platform.name)) {
+    // 创建a标签下载
+    const a = document.createElement('a');
+    a.href = painterImageUrl.value;
+    a.download = 'poster.png';
+    document.body.appendChild(a);
+    a.click();
+    document.body.removeChild(a);
+    sheep.$helper.toast('开始下载');
+    return;
   }
-
-  defineExpose({
-    getPoster,
+  // #endif
+
+  // 非H5 保存到相册
+  uni.saveImageToPhotosAlbum({
+    filePath: painterImageUrl.value,
+    success: (res) => {
+      onClosePoster();
+      sheep.$helper.toast('保存成功');
+    },
+    fail: (err) => {
+      sheep.$helper.toast('保存失败');
+      console.log('图片保存失败:', err);
+    },
   });
+};
+
+// 获得海报数据
+async function getPoster() {
+  painterImageUrl.value = undefined
+  console.log(props.shareInfo, '海报数据')
+  poster.views = await getPosterData({
+    width: poster.css.width,
+    shareInfo: props.shareInfo,
+  });
+  await renderPoster();
+}
+
+defineExpose({
+  getPoster,
+});
 </script>
 
 <style lang="scss" scoped>
-  .popup-box {
-    position: relative;
-  }
-
-  .poster-title {
-    color: #999;
-  }
-
-  // 分享海报
-  .poster-btn-box {
-    width: 600rpx;
-    position: absolute;
-    left: 50%;
-    transform: translateX(-50%);
-    bottom: -80rpx;
-
-    .cancel-btn {
-      width: 240rpx;
-      height: 70rpx;
-      line-height: 70rpx;
-      background: $white;
-      border-radius: 35rpx;
-      font-size: 28rpx;
-      font-weight: 500;
-      color: $dark-9;
-    }
-
-    .save-btn {
-      width: 240rpx;
-      height: 70rpx;
-      line-height: 70rpx;
-      border-radius: 35rpx;
-      font-size: 28rpx;
-      font-weight: 500;
-    }
+.popup-box {
+  position: relative;
+  z-index: 999;
+}
+
+.poster-title {
+  color: #999;
+}
+
+// 分享海报
+.poster-btn-box {
+  width: 600rpx;
+  position: absolute;
+  left: 50%;
+  transform: translateX(-50%);
+  bottom: -80rpx;
+  z-index: 1000;
+
+  .cancel-btn {
+    width: 240rpx;
+    height: 70rpx;
+    line-height: 70rpx;
+    background: $white;
+    border-radius: 35rpx;
+    font-size: 28rpx;
+    font-weight: 500;
+    color: $dark-9;
   }
 
-  .poster-img {
-    border-radius: 20rpx;
+  .save-btn {
+    width: 240rpx;
+    height: 70rpx;
+    line-height: 70rpx;
+    border-radius: 35rpx;
+    font-size: 28rpx;
+    font-weight: 500;
   }
+}
 
+.poster-img {
+  border-radius: 20rpx;
+}
 </style>

+ 31 - 29
sheep/components/s-share-modal/canvas-poster/poster/goods.js

@@ -8,7 +8,9 @@ const goods = async (poster) => {
   return [
     {
       type: 'image',
-      src: formatImageUrlProtocol(sheep.$url.cdn(sheep.$store('app').platform.share.posterInfo.goods_bg)),
+      src: formatImageUrlProtocol(
+        sheep.$url.cdn(sheep.$store('app').platform.share.posterInfo.goods_bg),
+      ),
       css: {
         width,
         position: 'fixed',
@@ -65,34 +67,34 @@ const goods = async (poster) => {
         maxWidth: width * 0.91,
       },
     },
-    {
-      type: 'text',
-      text: '¥' + poster.shareInfo.poster.price,
-      css: {
-        position: 'fixed',
-        left: width * 0.04,
-        top: width * 1.31,
-        fontSize: 20,
-        fontFamily: 'OPPOSANS',
-        color: '#333',
-      },
-    },
-    {
-      type: 'text',
-      text:
-        poster.shareInfo.poster.original_price > 0
-          ? '¥' + poster.shareInfo.poster.original_price
-          : '',
-      css: {
-        position: 'fixed',
-        left: width * 0.3,
-        top: width * 1.33,
-        color: '#999',
-        fontSize: 10,
-        fontFamily: 'OPPOSANS',
-        textDecoration: 'line-through',
-      },
-    },
+    // {
+    //   type: 'text',
+    //   text: '¥' + poster.shareInfo.poster.price,
+    //   css: {
+    //     position: 'fixed',
+    //     left: width * 0.04,
+    //     top: width * 1.31,
+    //     fontSize: 20,
+    //     fontFamily: 'OPPOSANS',
+    //     color: '#333',
+    //   },
+    // },
+    // {
+    //   type: 'text',
+    //   text:
+    //     poster.shareInfo.poster.original_price > 0
+    //       ? '¥' + poster.shareInfo.poster.original_price
+    //       : '',
+    //   css: {
+    //     position: 'fixed',
+    //     left: width * 0.3,
+    //     top: width * 1.33,
+    //     color: '#999',
+    //     fontSize: 10,
+    //     fontFamily: 'OPPOSANS',
+    //     textDecoration: 'line-through',
+    //   },
+    // },
     // #ifndef MP-WEIXIN
     {
       type: 'qrcode',

+ 3 - 2
sheep/components/s-share-modal/s-share-modal.vue

@@ -11,11 +11,11 @@
       <view class="share-box">
         <view class="share-list-box ss-flex">
           <!-- 操作 ①:发送给微信好友 -->
-          <button v-if="shareConfig.methods.includes('forward')" class="share-item share-btn ss-flex-col ss-col-center"
+          <!-- <button v-if="shareConfig.methods.includes('forward')" class="share-item share-btn ss-flex-col ss-col-center"
             open-type="share" @tap="onShareByForward">
             <image class="share-img" :src="sheep.$url.static('/static/img/shop/share/share_wx.png')" mode="" />
             <text class="share-title">微信好友</text>
-          </button>
+          </button> -->
 
           <!-- 操作 ②:生成海报图片 -->
           <button v-if="shareConfig.methods.includes('poster')" class="share-item share-btn ss-flex-col ss-col-center"
@@ -110,6 +110,7 @@ const onShareByForward = () => {
 
 // 操作 ③:复制链接分享
 const onShareByCopyLink = () => {
+  console.log(props.shareInfo, 44444)
   sheep.$helper.copyText(props.shareInfo.link);
   closeShareModal();
 };

+ 2 - 2
sheep/platform/share.js

@@ -37,7 +37,7 @@ const getShareInfo = (
     link: '', // 分享Url+参数
     query: '', // 分享参数
     poster, // 海报所需数据
-    forward: {} // 转发所需参数
+    forward: {}, // 转发所需参数
   };
   shareInfo.title = scene.title;
   shareInfo.image = $url.cdn(scene.image);
@@ -49,7 +49,7 @@ const getShareInfo = (
   // 自动拼接分享用户参数
   const query = buildSpmQuery(scene.params);
   shareInfo.query = query;
-
+  console.log('query', shareConfig.linkAddress, query, scene.params);
   // 配置分享链接地址
   shareInfo.link = buildSpmLink(query, shareConfig.linkAddress);
   // 配置页面地址带参数

+ 1 - 1
sheep/store/app.js

@@ -71,7 +71,7 @@ const app = defineStore({
         this.platform = {
           share: {
             methods: ['forward', 'poster', 'link'],
-            linkAddress: 'http://127.0.0.1:3000', // TODO 芋艿:可以考虑改到 .env 那
+            linkAddress: 'https://zjkdywd.com/mail/', // TODO 芋艿:可以考虑改到 .env 那
             posterInfo: {
               user_bg: '/static/img/shop/config/user-poster-bg.png',
               goods_bg: '/static/img/shop/config/goods-poster-bg.png',