欢迎使用 微信率土抽卡助手
你好!率土抽卡助手是包含全赛季土地难度表、开荒阵容、武将阵容、主城守军阵容推荐、内政、荣誉值计算、拆迁队、队伍克制、沃土坐标、鱼塘坐标、武将寻访技巧、行军外观判断队伍、T0阵容、战法拆解、卡包抽取等全功能小程序。可在微信游览小程序。
1.为什么要写这样一款小程序呢
本人是率土忠实粉丝,在玩率土的过程中,发现无法预判下一次出现半价保底、免费保底的位置,所以开发了这样一款小程序:
- 抽卡统计、推测保底位置功能 ,将会带来全新的体验;
- 全地图鱼塘、沃土、名胜坐标,让你更方面;
- 武警寻访 功能,让你更容易寻访出五星;
- T0阵容 推荐,让你更快的组队;
- 开荒阵容、阵容转型模块,让你丝滑转型;
2.小程序主页
3.小程序主页代码
index.wxml
<!-- 顶图 -->
<!-- <view>
<image style="height: 100px; width: 94%;margin:3%" src="/images/icon/stzb.png"></image>
</view> -->
<!-- 中间的格子 -->
<!-- <view>
<view class='function_container'>
<view class='function_item' wx:for="{{functions}}" wx:for-index="idx" wx:for-item="function" bindtap="goOtherPage" data-url="{{function.url}}">
<image class='function_img' src='{{function.pic_url}}'/>
<view class='function_name'>{{function.name}}</view>
</view>
</view>
</view> -->
<!-- 页面中间的几个分类 height:486rpx-->
<scroll-view scroll-y class="scrollPage">
<image src='/images/icon/stzb.png' mode='widthFix' class='png' style='width:100%;height: 21%;'></image>
<view class='nav-list'>
<navigator open-type="navigate" hover-class='none' url="{{item.url}}" class="nav-li bg-{{item.color}}" wx:for="{{elements}}" wx:key="id">
<view class="nav-title">{{item.title}}</view>
<view class="nav-name">{{item.name}}</view>
<text class='cuIcon-{{item.icon}}'></text>
</navigator>
</view>
<!-- 打赏作者栏;判断是否显示出来 -->
<!-- <view>
<view class='nav-list' wx:if="{{showDaShangZuoZhe}}">
<navigator open-type="navigate" hover-class='none' url="{{item.url}}" class="nav-li bg-{{item.color}}" wx:for="{{elements3}}" style="width: 99%;" wx:key>
<view class="nav-title">{{item.title}}</view>
<view class="nav-name">{{item.name}}</view>
<text class='cuIcon-{{item.icon}}'></text>
</navigator>
</view>
</view> -->
<!-- banner广告 -->
<ad unit-id="adunit-XXX"></ad>
<view style="margin-top: 3%;"></view>
<!-- 分割层标签 -->
<view class='cu-tabbar-height'></view>
<view class="padding bg-white" wx:for="{{elements2}}" wx:key="id">
<view class="flex p-xs margin-bottom-sm mb-sm " bindtap="goOtherPage2" data-url='{{item.url}}'>
<view class="flex-twice padding-sm margin-xs radius bg-black">
<view class="flex solid-bottom padding justify-between">
<view>
<text class='cuIcon-{{item.icon}}'></text>
<text class="text lines-white">{{item.title}}</text>
</view>
<view>
<text class='cuIcon-right'></text>
</view>
</view>
</view>
</view>
</view>
<view style="top: 2%;;margin: 2%;">
<view class="padding">
<button open-type="contact" class="cu-btn block bg-black margin-tb-sm lg light" style="width: 40%;margin-bottom: 1%;">
<text style="margin-left:2%">在线客服</text>
</button>
</view>
</view>
<view style="top: 2%;;margin: 2%;">
<view class="padding">
<button open-type="share" class="cu-btn block bg-black margin-tb-sm lg light" style="width: 40%;margin-bottom: 1%;">
<text style="margin-left:2%">分享盟友</text>
</button>
</view>
</view>
</scroll-view>
<!-- 页面最底下的横条 -->
<!-- <view class="padding bg-white" style="margin:-200px" wx:for="{{elements2}}" wx:key>
<view class="flex p-xs margin-bottom-sm mb-sm " bindtap="goOtherPage2" data-url='{{item.url}}'>
<view class="flex-twice bg-grey padding-sm margin-xs radius bg-gradual-blue">
<text class='cuIcon-{{item.icon}}'></text>
<text class="text line-yellow" style="margin-left:3%">{{item.title}}</text>
</view>
</view>
</view> -->
<!-- 页面最底下的横条 -->
<!-- <view class="padding bg-white">
<view class="flex p-xs margin-bottom-sm mb-sm">
<view class="flex-twice bg-grey padding-sm margin-xs radius"></view>
</view>
</view> -->
index.wxss
.container {
height: 650px;
}
.slide-image{
display: block;
height: 280rpx;
width:100%
}
.function_container{
display:flex;
flex-wrap: wrap;
width:100%;
}
.function_item{
color: white;
width:30%;
margin: 1.5%;
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
font-size:12px;
box-sizing:border-box;
padding-bottom:10px;
padding-top:10px;
/* box-shadow: 0px 0px 20px 10px rgba(0, 255, 115, 0.5) inset; */
--borderWidth: 2px;
background: #1D1F20;
position: relative;
border-radius: var(--borderWidth);
}
/* 边框特效 */
.function_item:after {
content: '';
position: absolute;
top: calc(-1 * var(--borderWidth));
left: calc(-1 * var(--borderWidth));
height: calc(100% + var(--borderWidth) * 2);
width: calc(100% + var(--borderWidth) * 2);
background: linear-gradient(60deg, #f79533, #f37055, #ef4e7b, #a166ab, #5073b8, #1098ad, #07b39b, #6fba82);
border-radius: calc(2 * var(--borderWidth));
z-index: -1;
animation: animatedgradient 3s ease alternate infinite;
background-size: 300% 300%;
}
.function_img{
width:100%;
height:80px;
margin-top: -10px;
}
.function_name{
padding-top:10px;
}
.more-box {
border-top-right-radius: 50rpx;
border-bottom-left-radius: 50rpx;
background-color: #fcbd71;
padding: 5% 30rpx;
font-size: 30rpx;
margin: 20rpx;
color: white;
margin-top: -35%;
}
/* 最底下横条 */
.margin-xs {
margin: 10px;
margin-top: 0px;
}
.padding-sm {
padding: 10px;
}
.radius {
border-radius: 6px;
}
/* 在线客服 */
/* .row {
display: flex;
align-items: center;
padding: 36rpx 10rpx;
font-size: 30rpx;
font-weight: inherit;
background-color: rgba(0, 0, 0, 0);
border-bottom: 1rpx solid #f1f1f1;
}
.row::after {
border: none;
} */
/* .text {
margin-left: 15rpx;
color: #636262;
} */
index.ts
const app13 = getApp()
Page({
data: {
functions: [
{
"name": "土地难度表",
"pic_url": '/images/icon/tuDiIcon.jpg',
'url': '/pages/catalogue/catalogue',
},
{
"name": "武将专题",
"pic_url": '/images/icon/wuJiangIcon.jpg',
'url': '/pages/study/study',
},
{
"name": "战法专题",
"pic_url": '/images/icon/zhanFaIcon.jpg',
'url': '/pages/study2/study2',
},
{
"name": "武器专题",
"pic_url": '/images/icon/wuQiIcon.jpg',
'url': '/pages/study3/study3',
},
{
"name": "阵容推荐",
"pic_url": '/images/icon/1.png',
'url': '/pages/catalogue/catalogue',
},
{
"name": "火车票",
"pic_url": '/images/icon/1.png',
'url': '/pages/catalogue/catalogue',
},
],
options: {
addGlobalClass: true,
},
StatusBar: app13.globalData.StatusBar,
CustomBar: app13.globalData.CustomBar,
elements: [{
id:1,
title: '土地难度',
name: 'Land difficulty',
color: 'cyan',
icon: 'news',
url: '/pages/catalogue/catalogue'
},
{
id:2,
title: '开荒阵容',
name: 'Opening lineup',
color: 'red',
icon: 'activity',
url: '/pages/kaiHuangZhenRong/kaiHuangZhenRong'
},
{
id:3,
title: '武将专题',
name: 'military generals',
color: 'blue',
icon: 'colorlens',
url: '/pages/study/study'
}, {
id:4,
title: '战法专题',
name: 'Topic of War',
color: 'purple',
icon: 'font',
url: '/pages/study2/study2'
},
{
id:5,
title: '武器专题',
name: 'Topic on Arms',
color: 'mauve',
icon: 'wenzi',
url: '/pages/study3/study3'
},
{
id:6,
title: '武将阵容',
name: 'Military general',
color: 'olive',
icon: 'footprint',
url: '/pages/zhenRongTuiJian/zhenRongTuiJian'
},
{
id:7,
title: '95保底卡池',
name: '95 card pool',
color: 'yellow',
icon: 'activity',
url: '/pages/kaChi/kaChi'
},
{
id:8,
title: '主城守军',
name: 'the main city',
color: 'brown',
icon: 'home',
url: '/pages/zhuChengShouJun/zhuChengShouJun'
}, {
id:9,
title: "内政",
name: 'internal affairs',
color: 'orange',
icon: 'focus',
url: "/pages/neiZhengTuiJian/neiZhengTuiJian",
}, {
id:10,
title: "荣誉值",
name: 'Honor Value',
color: 'cyan',
icon: 'crown',
url: "/pages/rongYuZhi/rongYuZhi",
}, {
id:11,
title: "拆迁队",
name: 'demolition crew',
color: 'olive',
icon: 'repair',
url: "/pages/chaiQianDui/chaiQianDui",
},{
id:13,
title: "队伍克制",
name: 'Team restraint',
color: 'red',
icon: 'warn',
url: "/pages/duiWuKeZhiGuanXi/duiWuKeZhiGuanXi",
},{
id:12,
title: "藏宝阁",
name: 'Treasure House',
color: 'blue',
icon: 'search',
url: "/pages/cangBaoGe/cangBaoGe",
},
],
elements2: [
{
id:1,
title: "沃土坐标",
color: 'brown',
icon: 'evaluate',
url: "/pages/jiuZhouWoTu/jiuZhouWoTu",
}, {
id:1,
title: "鱼塘坐标",
color: 'brown',
icon: 'evaluate',
url: "/pages/yuTang/yuTang",
},{
id:4,
title: "名胜坐标",
color: 'brown',
icon: 'evaluate',
url: "/pages/mingShengZuoBiao/mingShengZuoBiao",
},{
id:2,
title: "队伍篇",
color: 'brown',
icon: 'evaluate',
url: "/pages/duiWuPian/duiWuPian",
}, {
id:3,
title: "武将寻访",
color: 'brown',
icon: 'evaluate',
url: "/pages/wuJiangXunFang/wuJiangXunFang",
},{
id:4,
title: "行军外观",
color: 'brown',
icon: 'evaluate',
url: "/pages/xingJunWaiGuan/xingJunWaiGuan",
}, {
id:5,
title: "T0武将阵容",
color: 'brown',
icon: 'evaluate',
url: '/pages/baDaHeXinWuJiang/baDaHeXinWuJiang'
}, {
id:6,
title: "名将卡包爆率",
color: 'brown',
icon: 'evaluate',
url: "/pages/MingJiangKaBaoGaiLv/MingJiangKaBaoGaiLv",
}, {
id:7,
title: "全赛季武将战法拆解表",
color: 'brown',
icon: 'evaluate',
url: "/pages/chaiJieZhanFaZhiYin/chaiJieZhanFaZhiYin",
},
{
id:8,
title: "征服割据卡包抽卡建议与分析",
color: 'brown',
icon: 'evaluate',
url: "/pages/zhengFuGeJuKaBaoFenXi/zhengFuGeJuKaBaoFenXi",
},
],
// elements3: [{
// title: "支持创作",
// name: 'shopping mall',
// color: 'gradual-purple',
// icon: 'like',
// url: "/pages/daShangZuoZhe/daShangZuoZhe",
// },
// ],
showDaShangZuoZhe:false,
},
// 从用户在抽卡记录页面填的值,确定是否显示 打赏作者页
// 该函数已经弃用,因为审核不过
showDaShangZuoZhe(){
//强制显示该页面
this.setData({
showDaShangZuoZhe:true,
})
return;
var chouKa = wx.getStorageSync('chouKa');
var temp=0;
for(let i=0;i<chouKa.length;i++){
if(chouKa[i]['color']=='blue'){
temp=temp+1;
}
if(chouKa[i]['color']=='gray'){
return;
}
if(temp>12){
this.setData({
showDaShangZuoZhe:true,
})
}
}
},
onLoad() {
this.showDaShangZuoZhe();
},
// 去其他配置页面
goOtherPage: function (option: any) {
console.log("details 已被调用" + option.currentTarget.dataset.url);
wx.redirectTo({
url: option.currentTarget.dataset.url
// url:'/pages/details/details'
})
},
// 去其他配置页面
goOtherPage2: function (option: any) {
console.log("details 已被调用" + option.currentTarget.dataset.url);
wx.navigateTo({
url: option.currentTarget.dataset.url // 页面 B
})
},
isCard(e: any) {
this.setData({
isCard: e.detail.value
})
},
})
4.寄语
欢迎在程序中更好的了解,这里因为代码量太庞大,只是放了一个首页,后续会在github和国内gitee上传源代码,供大家学习参考。