| | |
| | | import request from './http.js' |
| | | import utils from './utils.js' |
| | | import clipboard from "../js_sdk/dc-clipboard/clipboard.js" |
| | | |
| | | |
| | | |
| | | function getclick(callback) { |
| | | uni.getClipboardData({ |
| | | //获取剪贴板内容 |
| | | uni.getClipboardData({ |
| | | success: res => { |
| | | console.log(res, '======================================================'); |
| | | var nowClipData = res.data |
| | |
| | | callback(res) |
| | | }).catch(function (err) { |
| | | }) |
| | | // request.post("tb/parseContent", { |
| | | // content: nowClipData |
| | | // }, 'application/json').then(res => { |
| | | // callback(res) |
| | | // }); |
| | | }else{ |
| | | getApp().globalData.hasMode = false |
| | | console.log('内部复制'); |
| | | } |
| | | } |
| | | }) |
| | |
| | | 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%', |
| | |
| | | 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", |
| | |
| | | }) |
| | | }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 |
| | |
| | | }, |
| | | position: { |
| | | top: uni.upx2px(580) + "px", |
| | | left: uni.upx2px(115) + "px", |
| | | left: uni.upx2px(85) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(24) + "px", |
| | | } |
| | | }, |
| | | { |
| | | tag: 'font', |
| | | id: 'dytxt', |
| | | text: '抖音', |
| | | textStyles: { |
| | | size: uni.upx2px(24) + "px", |
| | | color: "#333333", |
| | | align: "center", |
| | | weight: "normal", |
| | | whiteSpace: "nowrap", |
| | | overflow: 'ellipsis', |
| | | verticalAlign: 'middle' |
| | | }, |
| | | position: { |
| | | top: uni.upx2px(580) + "px", |
| | | left: uni.upx2px(185) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(24) + "px", |
| | | } |
| | | }, |
| | | { |
| | | tag: 'font', |
| | | id: 'pddtxt', |
| | |
| | | }, |
| | | position: { |
| | | top: uni.upx2px(580) + "px", |
| | | left: uni.upx2px(225) + "px", |
| | | left: uni.upx2px(285) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(24) + "px", |
| | | } |
| | |
| | | }, |
| | | position: { |
| | | top: uni.upx2px(580) + "px", |
| | | left: uni.upx2px(335) + "px", |
| | | left: uni.upx2px(385) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(24) + "px", |
| | | } |
| | | }, |
| | | |
| | | { |
| | | 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: { |
| | | top: uni.upx2px(490) + "px", |
| | | left: uni.upx2px(115) + "px", |
| | | left: uni.upx2px(85) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(74) + "px", |
| | | } |
| | | }, |
| | | { |
| | | src: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/index_icon/%E6%8A%96.png', |
| | | tag: 'img', |
| | | id: 'dy', |
| | | position: { |
| | | top: uni.upx2px(490) + "px", |
| | | left: uni.upx2px(185) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(74) + "px", |
| | | } |
| | | }, |
| | | { |
| | | 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: { |
| | | top: uni.upx2px(490) + "px", |
| | | left: uni.upx2px(225) + "px", |
| | | left: uni.upx2px(285) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(74) + "px", |
| | | } |
| | | }, |
| | | { |
| | | 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: { |
| | | top: uni.upx2px(490) + "px", |
| | | left: uni.upx2px(335) + "px", |
| | | left: uni.upx2px(385) + "px", |
| | | width: uni.upx2px(74) + "px", |
| | | height: uni.upx2px(74) + "px", |
| | | } |
| | | }, |
| | | |
| | | ]; |
| | | |
| | | nogoodsIdwrap.drawRect({ |
| | |
| | | |
| | | let icontop = uni.upx2px(490) |
| | | let iconbtm = uni.upx2px(600) |
| | | let jdleft = uni.upx2px(115) |
| | | let jdrgt = uni.upx2px(190) |
| | | let pddleft = uni.upx2px(225) |
| | | let pddrgt = uni.upx2px(300) |
| | | let vphleft = uni.upx2px(335) |
| | | let vphrgt = uni.upx2px(410) |
| | | |
| | | let jdleft = uni.upx2px(85) |
| | | let jdrgt = uni.upx2px(160) |
| | | let pddleft = uni.upx2px(285) |
| | | let pddrgt = uni.upx2px(360) |
| | | let vphleft = uni.upx2px(385) |
| | | let vphrgt = uni.upx2px(460) |
| | | let dyleft= uni.upx2px(185) |
| | | let dyrgt= uni.upx2px(260) |
| | | if (e.clientY > icontop && e.clientY < iconbtm) { |
| | | if (e.clientX < jdrgt && e.clientX > jdleft) { |
| | | console.log('去jd'); |
| | |
| | | uni.setStorageSync('clipboard',dataInfo.goods_url) |
| | | getApp().globalData.hasMode = false |
| | | } |
| | | |
| | | if(e.clientX < dyrgt && e.clientX > dyleft) { |
| | | console.log('去dy'); |
| | | maskLayers.hide(); |
| | | nogoodsIdwrap.hide(); |
| | | uni.navigateTo({ |
| | | url: '/pages/search/searchResult?storetype=4&searchText=' + dataInfo.goods_url |
| | | }) |
| | | uni.setStorageSync('clipboard',dataInfo.goods_url) |
| | | getApp().globalData.hasMode = false |
| | | } |
| | | if (e.clientX < pddrgt && e.clientX > pddleft) { |
| | | console.log('去pdd'); |
| | | const value = uni.getStorageSync('userInfo'); |