Commit ede564b71d21adc3cd0adb5ba31d80fd6185efe2

Authored by 前端开发-罗建龙
1 parent f856251d

热区切图组件

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
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
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 21 \ No newline at end of file
... ...
components/diy_heatImg/diy_heatImg.wxss 0 → 100644
  1 +/* components/diy_heatImg/diy_heatImg.wxss */
  2 +.imgbox{
  3 + width: 100%;
  4 + position: relative;
  5 + overflow: hidden;
  6 +}
  7 +.img{
  8 + width: 750rpx;
  9 +}
  10 +.item{
  11 + position: absolute;
  12 +}
0 13 \ No newline at end of file
... ...
pages/index/index/index.json
... ... @@ -10,6 +10,7 @@
10 10 "shopname": "/components/diy_shopname/diy_shopname",
11 11 "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy",
12 12 "diy_public": "/components/diy_public/diy_public",
  13 + "heat_img": "/components/diy_heatImg/diy_heatImg",
13 14 "title": "/components/diy_title/diy_title",
14 15 "notice": "/components/diy_notice/diy_notice",
15 16 "voice": "/components/diy_voice/diy_voice",
... ...
pages/index/index/index.wxml
... ... @@ -488,9 +488,10 @@
488 488 <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}">
489 489 <seckill object="{{item.content}}"></seckill>
490 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 496 <block wx:if="{{item.ename=='title'}}">
496 497 <title object="{{item.content}}"></title>
... ...
pages/template/index.json
... ... @@ -13,6 +13,7 @@
13 13 "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy",
14 14 "luckyGo": "/components/diy_luckyGo/diy_luckyGo",
15 15 "diy_public": "/components/diy_public/diy_public",
  16 + "heat_img": "/components/diy_heatImg/diy_heatImg",
16 17 "title": "/components/diy_title/diy_title",
17 18 "notice": "/components/diy_notice/diy_notice",
18 19 "voice": "/components/diy_voice/diy_voice",
... ...
pages/template/index.wxml
... ... @@ -47,6 +47,10 @@
47 47 <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}">
48 48 <seckill object="{{item.content}}"></seckill>
49 49 </block>
  50 + <!-- 热区切图 -->
  51 + <block wx:if="{{item.ename=='heatCutDiagram'}}">
  52 + <heat_img object="{{item.content}}" ></heat_img>
  53 + </block>
50 54 <!-- <block wx:if="{{item.ename=='seckillNew'}}">
51 55 <diy_public object="{{item.content}}" prom_type="1"></diy_public>
52 56 </block> -->
... ...