微信小程序编译
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 13s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 17s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 35s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 15s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 5s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 2s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 2m32s
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 13s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 17s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 35s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 15s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 5s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 2s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 2m32s
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 模板引擎使用教程可见:https://wechat-miniprogram.github.io/minigame-canvas-engine/tutorial/templateengine.html
|
||||
* xml经过doT.js编译出的模板函数
|
||||
* 因为小游戏不支持new Function,模板函数只能外部编译
|
||||
* 可直接拷贝本函数到小游戏中使用
|
||||
* 原始的模板如下:
|
||||
*
|
||||
<view class="container" id="main">
|
||||
<view class="rankList">
|
||||
<scrollview class="list" scrollY="true">
|
||||
{{~it.data :item:index}}
|
||||
<view class="listItem">
|
||||
<image src="open-data/render/image/rankBg.png" class="rankBg"></image>
|
||||
<image class="rankAvatarBg" src="open-data/render/image/rankAvatar.png"></image>
|
||||
<image class="rankAvatar" src="{{= item.avatarUrl }}"></image>
|
||||
<view class="rankNameView">
|
||||
<image class="rankNameBg" src="open-data/render/image/nameBg.png"></image>
|
||||
<text class="rankName" value="{{=item.nickname}}"></text>
|
||||
<text class="rankScoreTip" value="战力值:"></text>
|
||||
<text class="rankScoreVal" value="{{=item.score || 0}}"></text>
|
||||
</view>
|
||||
<view class="shareToBtn" data-isSelf="{{= item.isSelf ? true : false}}" data-id="{{= item.openid || ''}}">
|
||||
<image src="open-data/render/image/{{= item.isSelf ? 'button3':'button2'}}.png" class="shareBtnBg"></image>
|
||||
<text class="shareText" value="{{= item.isSelf ? '你自己' : '分享'}}"></text>
|
||||
</view>
|
||||
</view>
|
||||
{{~}}
|
||||
</scrollview>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
*
|
||||
*/
|
||||
export default function tplFunc(it) {
|
||||
var out = '<view class="container" id="main"> <view class="rankList"> <scrollview class="list" scrollY="true"> ';
|
||||
var arr1 = it.data;
|
||||
if (arr1) {
|
||||
var item, index = -1, l1 = arr1.length - 1;
|
||||
while (index < l1) {
|
||||
item = arr1[index += 1];
|
||||
out += ' <view class="listItem"> <image src="open-data/render/image/rankBg.png" class="rankBg"></image> <image class="rankAvatarBg" src="open-data/render/image/rankAvatar.png"></image> <image class="rankAvatar" src="' + (item.avatarUrl) + '"></image> <view class="rankNameView"> <image class="rankNameBg" src="open-data/render/image/nameBg.png"></image> <text class="rankName" value="' + (item.nickname) + '"></text> <text class="rankScoreTip" value="战力值:"></text> <text class="rankScoreVal" value="' + (item.score || 0) + '"></text> </view> <view class="shareToBtn" data-isSelf="' + (item.isSelf ? true : false) + '" data-id="' + (item.openid || '') + '"> <image src="open-data/render/image/' + (item.isSelf ? 'button3' : 'button2') + '.png" class="shareBtnBg"></image> <text class="shareText" value="' + (item.isSelf ? '你自己' : '分享') + '"></text> </view> </view> ';
|
||||
}
|
||||
}
|
||||
out += ' </scrollview> </view></view>';
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02a3592f7dacf20489d6e6615de94308
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* 下面的内容分成两部分,第一部分是一个模板,模板的好处是能够有一定的语法
|
||||
* 坏处是模板引擎一般都依赖 new Function 或者 eval 能力,小游戏下面是没有的
|
||||
* 所以模板的编译需要在外部完成,可以将注释内的模板贴到下面的页面内,点击 "run"就能够得到编译后的模板函数
|
||||
* https://wechat-miniprogram.github.io/minigame-canvas-engine/playground.html
|
||||
* 如果觉得模板引擎使用过于麻烦,也可以手动拼接字符串,本文件对应函数的目标仅仅是为了创建出 xml 节点数
|
||||
*/
|
||||
/**
|
||||
|
||||
<view id="container">
|
||||
<text class="tips" value="{{= it.tips || '' }}"></text>
|
||||
</view>
|
||||
|
||||
*/
|
||||
/**
|
||||
* xml经过doT.js编译出的模板函数
|
||||
* 因为小游戏不支持new Function,模板函数只能外部编译
|
||||
* 可直接拷贝本函数到小游戏中使用
|
||||
*/
|
||||
export default function anonymous(it) {
|
||||
const out = `<view id="container"> <text class="tips" value="${it.tips || ''}"></text></view>`;
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ee33f73b412b4143a012d6d8ddb10f8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user