feat: taro框架使用自定义标签

This commit is contained in:
eric
2022-12-09 18:00:16 +08:00
parent 05e0bbae3f
commit 15e162f62d
13 changed files with 132 additions and 57 deletions

2
dist/app.js vendored

File diff suppressed because one or more lines are too long

2
dist/app.json vendored
View File

@@ -1 +1 @@
{"pages":["pages/home/index","pages/home/components/CheckIn/index","pages/home/components/Certified/index","pages/activityList/index","pages/formSubmit/index","pages/activityList/components/details/index","pages/mountainPeak/index","pages/my/index","pages/my/components/Version/index","pages/my/components/AbountUs/index","pages/my/components/CheckinDetail/index"],"permission":{"scope.userLocation":{"desc":"你的位置信息将用于小程序位置接口的效果展示"}},"requiredPrivateInfos":["getLocation","chooseLocation","chooseAddress"],"window":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#fff","navigationBarTitleText":"WeChat","navigationBarTextStyle":"black"}}
{"pages":["pages/home/index","pages/home/components/CheckIn/index","pages/home/components/Certified/index","pages/activityList/index","pages/formSubmit/index","pages/activityList/components/details/index","pages/mountainPeak/index","pages/my/index","pages/my/components/Version/index","pages/my/components/AbountUs/index","pages/my/components/CheckinDetail/index"],"permission":{"scope.userLocation":{"desc":"你的位置信息将用于小程序位置接口的效果展示"}},"requiredPrivateInfos":["getLocation","chooseLocation","chooseAddress"],"window":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#fff","navigationBarTitleText":"WeChat","navigationBarTextStyle":"black"},"usingComponents":{}}

135
dist/base.wxml vendored
View File

@@ -137,9 +137,12 @@
<block>{{i.v}}</block>
</template>
<template name="tmpl_0_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_0_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_0_container">
@@ -202,9 +205,12 @@
</scroll-view>
</template>
<template name="tmpl_1_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_1_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_1_container">
@@ -267,9 +273,12 @@
</scroll-view>
</template>
<template name="tmpl_2_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_2_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_2_container">
@@ -332,9 +341,12 @@
</scroll-view>
</template>
<template name="tmpl_3_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_3_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_3_container">
@@ -389,9 +401,12 @@
</text>
</template>
<template name="tmpl_4_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_4_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_4_container">
@@ -446,9 +461,12 @@
</text>
</template>
<template name="tmpl_5_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_5_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_5_container">
@@ -495,9 +513,12 @@
</text>
</template>
<template name="tmpl_6_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_6_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_6_container">
@@ -544,9 +565,12 @@
</text>
</template>
<template name="tmpl_7_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_7_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_7_container">
@@ -593,9 +617,12 @@
</text>
</template>
<template name="tmpl_8_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_8_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_8_container">
@@ -642,9 +669,12 @@
</text>
</template>
<template name="tmpl_9_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_9_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_9_container">
@@ -691,9 +721,12 @@
</text>
</template>
<template name="tmpl_10_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_10_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_10_container">
@@ -740,9 +773,12 @@
</text>
</template>
<template name="tmpl_11_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_11_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_11_container">
@@ -789,9 +825,12 @@
</text>
</template>
<template name="tmpl_12_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_12_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_12_container">
@@ -838,9 +877,12 @@
</text>
</template>
<template name="tmpl_13_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_13_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_13_container">
@@ -887,9 +929,12 @@
</text>
</template>
<template name="tmpl_14_custom-wrapper">
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
</custom-wrapper>
<template name="tmpl_14_channel-video">
<channel-video autoplay="{{i.autoplay}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</channel-video>
</template>
<template name="tmpl_14_container">

2
dist/comp.json vendored
View File

@@ -1 +1 @@
{"component":true,"usingComponents":{"comp":"./comp"},"custom-wrapper":"./custom-wrapper"}
{"component":true,"usingComponents":{"comp":"./comp"}}

View File

@@ -1 +1 @@
{"navigationBarTitleText":"活动详情","usingComponents":{"custom-wrapper":"../../../../custom-wrapper","comp":"../../../../comp"}}
{"navigationBarTitleText":"活动详情","usingComponents":{"comp":"../../../../comp"}}

View File

@@ -1 +1 @@
{"navigationBarTitleText":"活动列表","usingComponents":{"custom-wrapper":"../../custom-wrapper","comp":"../../comp"}}
{"navigationBarTitleText":"活动列表","usingComponents":{"comp":"../../comp"}}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"navigationBarTitleText":"首页","usingComponents":{"custom-wrapper":"../../custom-wrapper","comp":"../../comp"}}
{"navigationBarTitleText":"首页","usingComponents":{"comp":"../../comp"}}

View File

@@ -1 +1 @@
{"navigationBarTitleText":"山峰介绍","usingComponents":{"custom-wrapper":"../../custom-wrapper","comp":"../../comp"}}
{"navigationBarTitleText":"山峰介绍","usingComponents":{"comp":"../../comp"}}

View File

@@ -1 +1 @@
{"navigationBarTitleText":"我的","usingComponents":{"custom-wrapper":"../../custom-wrapper","comp":"../../comp"}}
{"navigationBarTitleText":"我的","usingComponents":{"comp":"../../comp"}}

2
dist/utils.wxs vendored
View File

@@ -1,6 +1,6 @@
module.exports = {
a: function (l, n, s) {
var a = ["7","0","19","5","2","12","6","4","51","52","26","21","48","53","54","custom-wrapper"]
var a = ["7","0","19","5","2","12","6","4","51","52","26","21","48","53","54","channel-video"]
var b = ["4","51","52","26","21","48","53","54"]
if (a.indexOf(n) === -1) {
l = 0

View File

@@ -27,4 +27,7 @@ export default {
navigationBarTitleText: "WeChat",
navigationBarTextStyle: "black",
},
// 设置后,空对象代表可以使用小程序原生组件
usingComponents: {
}
};

View File

@@ -12,7 +12,13 @@ import {
Tag,
Toast,
} from "@antmjs/vantui";
import { Input, OfficialAccount, View, WebView } from "@tarojs/components";
import {
Input,
OfficialAccount,
View,
WebView,
// ChannelVideo,
} from "@tarojs/components";
import React, { useCallback, useEffect, useState } from "react";
import { Swiper, SwiperItem, Image } from "@antmjs/vantui";
import react from "react";
@@ -533,7 +539,6 @@ const Home = () => {
<Skeleton title={true} row={4} />
)}
{/* <View style={{marginTop:'10px'}}>打卡精选</View> */}
{/* 瀑布流 */}
{/* <InfoCard /> */}
@@ -590,6 +595,28 @@ const Home = () => {
<Toast id="vanToast-demo2" />
<View
onClick={() => {
Taro.openChannelsActivity({
finderUserName: "sphqzUmI0BlppCI", //视频号id
feedId:
"export/UzFfAgtgekIEAQAAAAAAeIIQA5S-0wAAAAstQy6ubaLX4KHWvLEZgBPEj6MUcExXaL37zNPgMJpEUVVnZ9njxR_hb9_u-bQj", //视频 feedId
success: (res: any) => {
console.log("res", res);
},
});
}}
>
</View>
{/* @ts-ignore */}
{/* <channel-video feed-id={'export/UzFfAgtgekIEAQAAAAAAeIIQA5S-0wAAAAstQy6ubaLX4KHWvLEZgBPEj6MUcExXaL37zNPgMJpEUVVnZ9njxR_hb9_u-bQj'} finder-user-name={'sphqzUmI0BlppCI'}></channel-video> */}
{/* @ts-ignore */}
{/* <channel-video autoplay = {true} object-fit={'cover'} feed-id={'export/UzFfAgtgekIEAQAAAAAAi2cqMAslgwAAAAstQy6ubaLX4KHWvLEZgBPEgIFoIyNiE9iBzNPgMJpw2GKV9V4VOKQarDhUTo15'} finder-user-name={'sphiBL5kbHuXDRZ'}></channel-video> */}
<TabbarCom active={0} />
</View>
);