广告位跳转

This commit is contained in:
2020-08-19 16:59:06 +08:00
parent 5dff8c8d96
commit dc636e30b7
3 changed files with 45 additions and 63 deletions

View File

@@ -46,7 +46,7 @@
<!-- 拼团列表 -->
<group></group>
<view class="activity-view">
<image class="lingquan" :src="activityInfo.adv_code" @click="activityLink({ type: activityInfo.url_type, id: activityInfo.info_id })"></image>
<image class="lingquan" :src="activityInfo.adv_code" @click="jumpPage({ type: activityInfo.url_type, id: activityInfo.info_id })"></image>
</view>
<!-- 优惠券 -->
<youhq></youhq>
@@ -61,6 +61,7 @@
</view>
</template>
<script>
import common from '@/static/js/common.js';
import shopitem from "@/components/shop/shop-item/index";
import recommend from "@/components/shop/recommend/index";
import pintuan from "@/components/shop/recommend/pintuan";
@@ -190,31 +191,11 @@
clickImage(index) {
// console.log(this.list[index]);
let item = this.list[index];
this.activityLink({
type: item.url_type,
this.jumpPage({
type: item.url_type,
id: item.info_id,
});
});
},
activityLink({
type,
id
}) {
console.log(type,id);
if (type == 0) return false;
// type 1 商品详情页, 2 店铺详情页
const url = type == 1 ? 'pageB/sdetails/index' : 'pageC/merchant/index';
let params = {
id: id
};
// type: 1 // 商品详情 1普通 2拼团 3秒杀 4优惠券
if (type == 1) Object.assign(params, {
type: 1
});
this.$u.route({
url: url,
params: params
})
},
// 下拉加载更多推荐商品
onreachBottom() {
this.$refs.recommendGoods.loadMore();
@@ -240,18 +221,10 @@
}
})
},
activityLink({ type, id }) {
if(type == 0 || type == 2) return false;
// type 1 商品详情页, 2 店铺详情页
const url = type == 1 ? 'pageB/sdetails/index' : '';
let params = { id: id };
// type: 1 // 商品详情 1普通 2拼团 3秒杀 4优惠券
if(type == 1) Object.assign(params, { type: 1 });
this.$u.route({
url: url,
params: params
})
},
jumpPage(uri) {
// console.log(uri);
common.jumpPage({ type: uri.type, id: uri.id });
}
},
}
</script>