zhaojs
2023-08-02 6b90e9d02bd1033e9c16fff7bde78f53b5603dae
h5/apph5/components/items/LineItem.vue
@@ -34,33 +34,44 @@
         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
@@ -76,23 +87,44 @@
               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);
            })