| | |
| | | items: Object, |
| | | isrecord: { |
| | | type: Boolean, |
| | | default: false |
| | | default: false, |
| | | text: '' |
| | | }, |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | oncopy(txt) { |
| | | let copyObj = { |
| | | data: txt, |
| | | success: function() { |
| | | |
| | | copyText() { |
| | | // #ifdef H5 |
| | | this.$copyText(this.text).then( |
| | | res => { |
| | | uni.showToast({ |
| | | title: '伿 龿¥å·²å¤å¶ï¼ç°å¨æå¼ææºæ·å®ï¼é¢å伿 å¸å§~', |
| | | icon: 'none', |
| | | duration: 2500 |
| | | }); |
| | | }, |
| | | fail: function(e) { |
| | | console.log(e); |
| | | }) |
| | | } |
| | | }; |
| | | uni.setClipboardData(copyObj); |
| | | ) |
| | | // #endif |
| | | // #ifndef H5 |
| | | uni.setClipboardData({ |
| | | data: this.text, |
| | | success: () => { |
| | | uni.showToast({ |
| | | title: '伿 龿¥å·²å¤å¶ï¼ç°å¨æå¼ææºæ·å®ï¼é¢å伿 å¸å§~', |
| | | icon: 'none', |
| | | duration: 2500 |
| | | }) |
| | | } |
| | | }) |
| | | // #endif |
| | | }, |
| | | getShareLink(items) { |
| | | if(this.isrecord) |
| | | {//è®°å½ç¹å» |
| | | this.recordClick(items.goodsId,items.sourceType,items.dtitle,items.actualPrice); |
| | | |
| | | if (this.isrecord) { //è®°å½ç¹å» |
| | | this.recordClick(items.goodsId, items.sourceType, items.dtitle, items.actualPrice); |
| | | } |
| | | var goodsid=items.goodsId; |
| | | var goodsid = items.goodsId; |
| | | var that = this; |
| | | let postdata = { |
| | | goodsId: goodsid |
| | |
| | | if (e.code != 0) { |
| | | return; |
| | | } |
| | | this.oncopy(e.data.info.longTpwd); |
| | | this.text = e.data.info.longTpwd; |
| | | uni.getSystemInfo({ |
| | | success: function(res) { |
| | | if (res.osName == 'ios') { |
| | | uni.showModal({ |
| | | title: 'æç¤º', |
| | | content: '伿 ä¿¡æ¯å¤å¶åï¼è¯·æå¼ææºæ·å®é¢å¸', |
| | | showCancel: false, |
| | | confirmText: 'å¤å¶ä¼æ ä¿¡æ¯', |
| | | success: function(res) { |
| | | if (res.confirm) { |
| | | that.copyText(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | else{ |
| | | that.copyText(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //this.oncopy(e.data.info.longTpwd); |
| | | }).catch(function(err) { |
| | | console.log(err); |
| | | }) |
| | | }, |
| | | recordClick(goodsid,plat,title,act_price) |
| | | { |
| | | let postdata={ |
| | | goodsid:goodsid, |
| | | plat:plat, |
| | | title:title, |
| | | act_price:act_price |
| | | recordClick(goodsid, plat, title, act_price) { |
| | | let postdata = { |
| | | goodsid: goodsid, |
| | | plat: plat, |
| | | title: title, |
| | | act_price: act_price |
| | | } |
| | | this.$http.post('/api/activity/recordItemClick', |
| | | postdata |
| | | ).then(e => { |
| | | |
| | | |
| | | }).catch(function(err) { |
| | | console.log(err); |
| | | }) |
| | |
| | | // #ifndef VUE3 |
| | | import Vue from 'vue' |
| | | import './uni.promisify.adaptor' |
| | | import VueClipboard from 'vue-clipboard2' |
| | | Vue.use(VueClipboard) |
| | | Vue.config.productionTip = false |
| | | Vue.prototype.$http=api; |
| | | App.mpType = 'app' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "apph5", |
| | | "lockfileVersion": 2, |
| | | "requires": true, |
| | | "packages": { |
| | | "": { |
| | | "dependencies": { |
| | | "vue-clipboard2": "^0.3.3" |
| | | } |
| | | }, |
| | | "node_modules/clipboard": { |
| | | "version": "2.0.11", |
| | | "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz", |
| | | "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", |
| | | "dependencies": { |
| | | "good-listener": "^1.2.2", |
| | | "select": "^1.1.2", |
| | | "tiny-emitter": "^2.0.0" |
| | | } |
| | | }, |
| | | "node_modules/delegate": { |
| | | "version": "3.2.0", |
| | | "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", |
| | | "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" |
| | | }, |
| | | "node_modules/good-listener": { |
| | | "version": "1.2.2", |
| | | "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", |
| | | "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", |
| | | "dependencies": { |
| | | "delegate": "^3.1.2" |
| | | } |
| | | }, |
| | | "node_modules/select": { |
| | | "version": "1.1.2", |
| | | "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", |
| | | "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" |
| | | }, |
| | | "node_modules/tiny-emitter": { |
| | | "version": "2.1.0", |
| | | "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", |
| | | "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" |
| | | }, |
| | | "node_modules/vue-clipboard2": { |
| | | "version": "0.3.3", |
| | | "resolved": "https://registry.npmmirror.com/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz", |
| | | "integrity": "sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==", |
| | | "dependencies": { |
| | | "clipboard": "^2.0.0" |
| | | } |
| | | } |
| | | }, |
| | | "dependencies": { |
| | | "clipboard": { |
| | | "version": "2.0.11", |
| | | "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz", |
| | | "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", |
| | | "requires": { |
| | | "good-listener": "^1.2.2", |
| | | "select": "^1.1.2", |
| | | "tiny-emitter": "^2.0.0" |
| | | } |
| | | }, |
| | | "delegate": { |
| | | "version": "3.2.0", |
| | | "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", |
| | | "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" |
| | | }, |
| | | "good-listener": { |
| | | "version": "1.2.2", |
| | | "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", |
| | | "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", |
| | | "requires": { |
| | | "delegate": "^3.1.2" |
| | | } |
| | | }, |
| | | "select": { |
| | | "version": "1.1.2", |
| | | "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", |
| | | "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" |
| | | }, |
| | | "tiny-emitter": { |
| | | "version": "2.1.0", |
| | | "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", |
| | | "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" |
| | | }, |
| | | "vue-clipboard2": { |
| | | "version": "0.3.3", |
| | | "resolved": "https://registry.npmmirror.com/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz", |
| | | "integrity": "sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==", |
| | | "requires": { |
| | | "clipboard": "^2.0.0" |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "dependencies": { |
| | | "vue-clipboard2": "^0.3.3" |
| | | } |
| | | } |