zhaojs
2023-07-13 5f5179811a778b6bd996ed64cae2a96f5ccc437f
uniapp/utils/getClipboard.js
@@ -2,10 +2,9 @@
  import request from './http.js'
  import utils from './utils.js'
  import clipboard from "../js_sdk/dc-clipboard/clipboard.js"
  function getclick(callback) {
  //获取剪贴板内容
  uni.getClipboardData({
      success: res => {
        console.log(res, '======================================================');
@@ -18,10 +17,10 @@
            var res = e.data;
            callback(res)
          }).catch(function (err) {
           console.log(err)
          })
        }else{
          getApp().globalData.hasMode = false
          console.log('内部复制');
        }
      }
    })
@@ -31,7 +30,7 @@
  function updatePopup(dataInfo) {
    var data = dataInfo.goods;
    // 弹窗遮罩层
    let maskLayers = new plus.nativeObj.View("maskLayers", { //先创建遮罩层
    var maskLayers = new plus.nativeObj.View("maskLayers", { //先创建遮罩层
      top: '0px',
      left: '0px',
      height: '100%',
@@ -50,13 +49,13 @@
    const viewContentWidth = parseInt(popupViewWidth - viewContentPadding * 2);
    // 显示弹窗
    maskLayers.show();
    try{
    if (data.goodsId) {
      let sLeft = 0;
      let popupViewHeight = popupViewWidth + uni.upx2px(390);
      sLeft = (data.originalPrice.toString().length + 1) * uni.upx2px(30);
      // 弹窗内容
      var clipViews = new plus.nativeObj.View("clipViews", { //创建底部图标菜单
    let clipViews = new plus.nativeObj.View("clipViews", { //创建底部图标菜单
        tag: "rect",
        top: (screenHeight - popupViewHeight) / 2 + "px",
        left: (screenWidth - popupViewWidth) / 2 + "px",
@@ -297,7 +296,7 @@
              })
            }else{
              uni.navigateTo({
                url: '/pages/goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(data))
                url: '/pages/goods/goodsDetail?proform=clipboard&info=' + encodeURIComponent(JSON.stringify(data))
              })
            }
            getApp().globalData.hasMode = false
@@ -480,7 +479,7 @@
        },
      
        {
          src: './static/images/app/jd.png',
          src: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/index_icon/%E4%BA%AC%E4%B8%9C.png',
          tag: 'img',
          id: 'jd',
          position: {
@@ -502,7 +501,7 @@
        }
      },
        {
          src: './static/images/app/pdd.png',
          src: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/index_icon/%E6%8B%BC.png',
          tag: 'img',
          id: 'pdd',
          position: {
@@ -513,7 +512,7 @@
          }
        },
        {
          src: './static/images/app/vph.png',
          src: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/index_icon/%E5%94%AF.png',
          tag: 'img',
          id: 'vph',
          position: {
@@ -744,6 +743,12 @@
        getApp().globalData.hasMode = false
      }
    });
   }
   catch(e)
   {
      console.log(e);
      maskLayers.hide();
   }
  }
  export default () => {