zhaojs
2023-08-02 6b90e9d02bd1033e9c16fff7bde78f53b5603dae
no message
已添加3个文件
已修改2个文件
183 ■■■■ 文件已修改
h5/apph5/components/items/LineItem.vue 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/components/setClipboard.js 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/package-lock.json 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/package.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
                })
h5/apph5/components/setClipboard.js
h5/apph5/main.js
@@ -3,6 +3,8 @@
// #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'
h5/apph5/package-lock.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
{
  "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"
      }
    }
  }
}
h5/apph5/package.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
{
  "dependencies": {
    "vue-clipboard2": "^0.3.3"
  }
}