diff --git a/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js index 68bb676e..590914b7 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js @@ -1,3 +1,5 @@ +import { navLinkType } from '@/common/setting/constVarsHelper.js'; + /** * 全局混入型 */ @@ -231,6 +233,70 @@ module.exports = { this.$u.route('/pages/member/serviceOrder/details/details', { id: serviceId }); }, + + /** + * 广告相关 + */ + + // 广告点击查看详情 + showSliderInfo(type, val) { + if (!val) { + return; + } + if (type == navLinkType.urlLink) { + if (val.indexOf('http') != -1) { + // #ifdef H5 + window.location.href = val + // #endif + // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP + this.$u.route('/pages/webview/webview', { src: val }); + // #endif + } else { + // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP + if (val == '/pages/index/default/default' || val == '/pages/category/index/index' || val == '/pages/index/cart/cart' || val == '/pages/index/member/member') { + this.$u.route({ type: 'switchTab', url: val }); + return; + } else if (val.indexOf('/pages/coupon/coupon') > -1) { + var id = val.replace('/pages/coupon/coupon?id=', ""); + this.receiveCoupon(id) + } else { + this.$u.route(val); + return; + } + // #endif + } + } else if (type == navLinkType.shop) { + // 商品详情 + this.$u.route('/pages/goods/goodDetails/goodDetails', { id: val }); + } else if (type == navLinkType.article) { + // 文章详情 + this.$u.route('/pages/article/details/details', { idType: 1, id: val }); + } else if (type == navLinkType.articleCategory) { + // 文章列表 + this.$u.route('/pages/article/list/list') + } else if (type == navLinkType.intelligentForms) { + //自定义表单 + this.$u.route('/pages/form/details/details', { id: val }); + } else { + this.$u.route(val); + } + }, + // 用户领取优惠券 + receiveCoupon(couponId) { + let _this = this; + let coreshopdata = { + id: couponId + } + this.$u.api.getCoupon(coreshopdata).then(res => { + if (res.status) { + _this.$refs.uToast.show({ message: res.msg, type: 'success', back: false }) + } else { + _this.$u.toast(res.msg) + } + }) + }, + + /** * 工具函数 */ diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-adpop.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-adpop.vue index c717695d..3a5a5c09 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-adpop.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-adpop.vue @@ -5,7 +5,7 @@ - + @@ -44,101 +44,6 @@ closePop() { this.closeAd = false }, - showSliderInfo(type, val) { - console.log(type); - if (!val) { - return; - } - if (type == 1) { - if (val.indexOf('http') != -1) { - // #ifdef H5 - window.location.href = val - // #endif - } else { - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP - if (val == '/pages/index/default/default' || val == '/pages/category/index/index' || val == '/pages/index/cart/cart' || val == '/pages/index/member/member') { - this.$u.route({ type: 'switchTab', url: val }); - return; - } else if (val.indexOf('/pages/coupon/coupon') > -1) { - var id = val.replace('/pages/coupon/coupon?id=', ""); - this.receiveCoupon(id) - } else { - this.$u.route(val); - return; - } - // #endif - } - } else if (type == 2) { - // 商品详情 - this.goGoodsDetail(val) - } else if (type == 3) { - // 文章详情 - this.$u.route('/pages/article/details/details?id=' + val + '&idType=1') - } else if (type == 4) { - // 文章列表 - this.$u.route('/pages/article/list/list?cid=' + val) - } else if (type == 5) { - //智能表单 - this.$u.route('/pages/form/details/details?id=' + val) - } - }, - // 用户领取优惠券 - receiveCoupon(couponId) { - let data = { - promotion_id: couponId - } - this.$u.api.getCoupon(data).then(res => { - if (res.status) { - this.$refs.uToast.show({ message: res.msg, type: 'success', back: false }) - } else { - this.$u.toast(res.msg) - } - }) - }, - // #ifdef MP-WEIXIN - showSliderInfo2: function (e) { - let type = e.currentTarget.dataset.type; - let val = e.currentTarget.dataset.val; - console.log(type); - console.log(val) - console.log(type); - if (!val) { - return; - } - if (type == 1) { - if (val.indexOf('http') != -1) { - // #ifdef H5 - window.location.href = val - // #endif - } else { - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP - if (val == '/pages/index/default/default' || val == '/pages/category/index/index' || val == '/pages/index/cart/cart' || val == '/pages/index/member/member') { - this.$u.route({ type: 'switchTab', url: val }); - return; - } else if (val.indexOf('/pages/coupon/coupon') > -1) { - var id = val.replace('/pages/coupon/coupon?id=', ""); - this.receiveCoupon(id) - } else { - this.$u.route(val); - return; - } - // #endif - } - } else if (type == 2) { - // 商品详情 - this.goGoodsDetail(val) - } else if (type == 3) { - // 文章详情 - this.$u.route('/pages/article/details/details?id=' + val + '&idType=1') - } else if (type == 4) { - // 文章列表 - this.$u.route('/pages/article/list/list?cid=' + val) - } else if (type == 5) { - //智能表单 - this.$u.route('/pages/form/details/details?id=' + val) - } - } - // #endif }, } diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-articleClassify.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-articleClassify.vue index e46721d3..93a37859 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-articleClassify.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-articleClassify.vue @@ -2,7 +2,7 @@ - + {{ item.title }} diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue index 642a46b8..8b544004 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue @@ -1,37 +1,63 @@ diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goodTabBar.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goodTabBar.vue index 53e1818c..d5b17ce9 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goodTabBar.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goodTabBar.vue @@ -32,7 +32,7 @@ - + @@ -59,7 +59,7 @@ - + 推荐 diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue index 7996e53c..564b154c 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue @@ -1,51 +1,52 @@