| | |
| | | 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, '======================================================'); |
| | |
| | | var res = e.data; |
| | | callback(res) |
| | | }).catch(function (err) { |
| | | console.log(err) |
| | | }) |
| | | }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%', |
| | |
| | | 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", |
| | |
| | | }) |
| | | }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 |
| | |
| | | getApp().globalData.hasMode = false |
| | | } |
| | | }); |
| | | } |
| | | catch(e) |
| | | { |
| | | console.log(e); |
| | | maskLayers.hide(); |
| | | } |
| | | } |
| | | |
| | | export default () => { |