Commit ede564b71d21adc3cd0adb5ba31d80fd6185efe2
1 parent
f856251d
热区切图组件
Showing
8 changed files
with
86 additions
and
3 deletions
components/diy_heatImg/diy_heatImg.js
0 → 100644
1 | +// components/diy_heatImg/diy_heatImg.js | ||
2 | +Component({ | ||
3 | + /** | ||
4 | + * 组件的属性列表 | ||
5 | + */ | ||
6 | + properties: { | ||
7 | + object: { | ||
8 | + type: Object, | ||
9 | + value: null, | ||
10 | + }, | ||
11 | + }, | ||
12 | + | ||
13 | + /** | ||
14 | + * 组件的初始数据 | ||
15 | + */ | ||
16 | + data: { | ||
17 | + | ||
18 | + }, | ||
19 | + | ||
20 | + /** | ||
21 | + * 组件的方法列表 | ||
22 | + */ | ||
23 | + methods: { | ||
24 | + //---智能跳转--- | ||
25 | + go_url: function (e) { | ||
26 | + var url = e.currentTarget.dataset.url; | ||
27 | + getApp().goto(url); | ||
28 | + }, | ||
29 | + nv_void(e) { | ||
30 | + var feedId = e.currentTarget.dataset.feedid; | ||
31 | + var finderUserName = e.currentTarget.dataset.finderUserName; | ||
32 | + var video_type = e.currentTarget.dataset.video_type; | ||
33 | + getApp().openChannelsActivity({ | ||
34 | + feedId, | ||
35 | + finderUserName, | ||
36 | + video_type | ||
37 | + }) | ||
38 | + }, | ||
39 | + } | ||
40 | +}) |
components/diy_heatImg/diy_heatImg.json
0 → 100644
components/diy_heatImg/diy_heatImg.wxml
0 → 100644
1 | +<!--components/diy_heatImg/diy_heatImg.wxml--> | ||
2 | +<wxs module="g_filter" src="../diy_notice/g_filter.wxs"></wxs> | ||
3 | +<view class="imgbox"> | ||
4 | + <image src="{{object.img}}" mode="widthFix" class="img"></image> | ||
5 | + <block wx:for="{{object.data}}"> | ||
6 | + <block wx:if="{{g_filter.has_char(item.wxapp_url,'plugin')>=0}}"> | ||
7 | + <navigator url="{{item.wxapp_url}}" class="item" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></navigator> | ||
8 | + </block> | ||
9 | + <block wx:elif="{{item.AppId}}"> | ||
10 | + <navigator url="{{item.wxapp_url}}" target="miniProgram" app-id="{{item.AppId}}" path="{{item.wxapp_url}}" class="item" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></navigator> | ||
11 | + </block> | ||
12 | + <block wx:elif="{{item.finderUserName && item.video_type}}"> | ||
13 | + <view catchtap="nv_void" data-feedid="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" class="item" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></view> | ||
14 | + </block> | ||
15 | + <block wx:else> | ||
16 | + <view class="item" data-url="{{item.wxapp_url}}" catchtap="go_url" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></view> | ||
17 | + </block> | ||
18 | + </block> | ||
19 | +</view> | ||
20 | + | ||
0 | \ No newline at end of file | 21 | \ No newline at end of file |
components/diy_heatImg/diy_heatImg.wxss
0 → 100644
pages/index/index/index.json
@@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
10 | "shopname": "/components/diy_shopname/diy_shopname", | 10 | "shopname": "/components/diy_shopname/diy_shopname", |
11 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", | 11 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", |
12 | "diy_public": "/components/diy_public/diy_public", | 12 | "diy_public": "/components/diy_public/diy_public", |
13 | + "heat_img": "/components/diy_heatImg/diy_heatImg", | ||
13 | "title": "/components/diy_title/diy_title", | 14 | "title": "/components/diy_title/diy_title", |
14 | "notice": "/components/diy_notice/diy_notice", | 15 | "notice": "/components/diy_notice/diy_notice", |
15 | "voice": "/components/diy_voice/diy_voice", | 16 | "voice": "/components/diy_voice/diy_voice", |
pages/index/index/index.wxml
@@ -488,9 +488,10 @@ | @@ -488,9 +488,10 @@ | ||
488 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> | 488 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
489 | <seckill object="{{item.content}}"></seckill> | 489 | <seckill object="{{item.content}}"></seckill> |
490 | </block> | 490 | </block> |
491 | - <!-- <block wx:if="{{item.ename=='seckillNew'}}"> | ||
492 | - <diy_public object="{{item.content}}" prom_type="1"></diy_public> | ||
493 | - </block> --> | 491 | + <!-- 热区切图 --> |
492 | + <block wx:if="{{item.ename=='heatCutDiagram'}}"> | ||
493 | + <heat_img object="{{item.content}}" ></heat_img> | ||
494 | + </block> | ||
494 | <!--标题--> | 495 | <!--标题--> |
495 | <block wx:if="{{item.ename=='title'}}"> | 496 | <block wx:if="{{item.ename=='title'}}"> |
496 | <title object="{{item.content}}"></title> | 497 | <title object="{{item.content}}"></title> |
pages/template/index.json
@@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
13 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", | 13 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", |
14 | "luckyGo": "/components/diy_luckyGo/diy_luckyGo", | 14 | "luckyGo": "/components/diy_luckyGo/diy_luckyGo", |
15 | "diy_public": "/components/diy_public/diy_public", | 15 | "diy_public": "/components/diy_public/diy_public", |
16 | + "heat_img": "/components/diy_heatImg/diy_heatImg", | ||
16 | "title": "/components/diy_title/diy_title", | 17 | "title": "/components/diy_title/diy_title", |
17 | "notice": "/components/diy_notice/diy_notice", | 18 | "notice": "/components/diy_notice/diy_notice", |
18 | "voice": "/components/diy_voice/diy_voice", | 19 | "voice": "/components/diy_voice/diy_voice", |
pages/template/index.wxml
@@ -47,6 +47,10 @@ | @@ -47,6 +47,10 @@ | ||
47 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> | 47 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
48 | <seckill object="{{item.content}}"></seckill> | 48 | <seckill object="{{item.content}}"></seckill> |
49 | </block> | 49 | </block> |
50 | + <!-- 热区切图 --> | ||
51 | + <block wx:if="{{item.ename=='heatCutDiagram'}}"> | ||
52 | + <heat_img object="{{item.content}}" ></heat_img> | ||
53 | + </block> | ||
50 | <!-- <block wx:if="{{item.ename=='seckillNew'}}"> | 54 | <!-- <block wx:if="{{item.ename=='seckillNew'}}"> |
51 | <diy_public object="{{item.content}}" prom_type="1"></diy_public> | 55 | <diy_public object="{{item.content}}" prom_type="1"></diy_public> |
52 | </block> --> | 56 | </block> --> |