| | |
| | | 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); |
| | | }) |
| | |
| | | <style> |
| | | .item-price-prc { |
| | | color: #fe3a3f; |
| | | font-size: 1.2rem; |
| | | margin-right: 0.4rem; |
| | | font-size: 1rem; |
| | | margin-right: 0.2rem; |
| | | font-weight: 500; |
| | | } |
| | | |
| | |
| | | background: linear-gradient(0deg, #ff753c, #ff4b42); |
| | | color: #fff; |
| | | padding: 0.05rem; |
| | | font-size: 0.9rem; |
| | | font-size: 0.7rem; |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .item-txt { |
| | | width: 71%; |
| | | width: 70%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | |
| | | } |
| | | |
| | | .item-txt-title { |
| | | font-size: 0.9rem; |
| | | font-size: 0.7rem; |
| | | margin-left: 0.3rem; |
| | | text-overflow: -o-ellipsis-lastline; |
| | | overflow: hidden; |
| | |
| | | |
| | | .item-price { |
| | | display: flex; |
| | | font-size: 0.8rem; |
| | | font-size: 0.5rem; |
| | | align-items: baseline; |
| | | color: #8d8484; |
| | | } |
| | |
| | | } |
| | | |
| | | .item-copy { |
| | | width: 5.92rem; |
| | | width: 5.22rem; |
| | | height: 1.66rem; |
| | | background: linear-gradient(-90deg, #fe3a3f, #faa450); |
| | | font-size: 0.9rem; |
| | | font-size: 0.7rem; |
| | | font-weight: 500; |
| | | color: #fffefd; |
| | | line-height: 1.66rem; |