Commit b4cb02cc authored by wildfirecode13's avatar wildfirecode13

1

parent a63c385f
No preview for this file type
No preview for this file type
.DS_Store
node_modules/
.tea/
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const app = getApp();
const { tbcc, cloudName, cloud, requestType } = app;
const { utils: { generateAPI }, request: tbccRequest, capi } = tbcc;
const apicfg_1 = require("./apicfg");
const request = tbccRequest({
cloud,
cloudName,
requestType
});
// api handle 列表
const apiList = Object.assign(Object.assign({}, capi), apicfg_1.default);
// 生成API
const API = generateAPI(apiList, request);
exports.default = API;
//# sourceMappingURL=api.js.map1
\ No newline at end of file
import request from './utils/request';
const API = {
// 获取首页接口
getCollectItemList: params => request('getCollectItemList', 'POST', params),
doTaskComplete: params => request('doTaskComplete', 'POST', params),
// 经验排行榜
getExpRankList: params => request('getExpRankList', 'POST', params, { isShowLoading: true }),
// 登录接口
login: params => request('login', 'POST', params, { cloudName: 'bubbleSurviva' }),
//领取任务奖励 takeTaskPrize
takeTaskPrize: params => request('takeTaskPrize', 'POST', params),
// 获取我的奖品
getMyPrizeList: params => request('getMyPrizeList', 'POST', params, { cloudName: 'bubbleSurviva' }),
// 购买商品
getGoodsList: params => request('getGoodsList', 'POST', params, { cloudName: 'bubbleSurviva' }),
// 实物领取
receiveObjectPrize: params => request('receiveObjectPrize', 'POST', params, { cloudName: 'bubbleSurviva' }),
// 非实物领取
receivePrize: params => request('receiveEnamePrize', 'POST', params, { cloudName: 'bubbleSurviva' }),
//是否可助力
canAssist: params => request('canAssist', 'POST', params, { cloudName: 'bubbleSurviva' }),
//邮费标识
postageMark: params => request('postageMark', 'POST', params, { cloudName: 'bubbleSurviva' }),
//是否可助力
canAssist: params => request('canAssist', 'POST', params, { cloudName: 'bubbleSurviva' }),
//助力
assist: params => request('assist', 'POST', params, { cloudName: 'bubbleSurviva' }),
//小样奖品弹框提示
samplePop: params => request('samplePop', 'POST', params, { cloudName: 'bubbleSurviva' }),
//数据埋点
addDataUv: params => request('addDataUv', 'POST', params, { cloudName: 'bubbleSurviva' }),
};
export default API;
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/packages/jsx2taobao/template/api/api.js"],"names":[],"mappings":";;AAAA,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AACrB,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;AAEpD,MAAM,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AACpE,qCAA8B;AAC9B,MAAM,OAAO,GAAG,WAAW,CAAC;IAC1B,KAAK;IACL,SAAS;IACT,WAAW;CACZ,CAAC,CAAC;AAEH,gBAAgB;AAChB,MAAM,OAAO,mCACR,IAAI,GACJ,gBAAM,CACV,CAAC;AAEF,QAAQ;AACR,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAE1C,kBAAe,GAAG,CAAC"}
\ No newline at end of file
let projectId = window.CFG.projectId || '';
const apiCfg = {
getRule:`/projectx/${projectId}/projectRule.query`,
doJoin: {
uri: `/projectx/${projectId}/join.do`,
method: "post"
}
}
export default apiCfg;
\ No newline at end of file
page {
background: #f7f7f7;
font-family: 'Helvetica Neue', Helvetica, Hiragino Sans GB, 'Microsoft Yahei', STHeiTi, Arial, sans-serif;
}
* {
box-sizing: border-box;
}
.d-flex {
display: flex
}
.d-flex__item {
flex: 1;
}
.d-flex--aligncenter {
align-items: center;
}
.modal-animate-fade-in {
opacity: 0;
animation: modalAnimateFadeIn .3s forwards;
}
.modal-animate-zoom-in {
transform: scale(0);
animation: modalAnimateZoomIn .3s forwards;
}
.modal-animate-fly-in {
transform: translateY(100%);
animation: modalAnimateFlyIn .3s forwards;
}
.btn-animate-pulse {
animation: btnAnimatePulse .8s infinite;
}
@keyframes modalAnimateFadeIn {
to {
opacity: 1;
}
}
@keyframes modalAnimateZoomIn {
to {
transform: scale(1);
}
}
@keyframes modalAnimateFlyIn {
to {
transform: translateY(0);
}
}
@keyframes btnAnimatePulse {
from {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
to {
transform: scale(1);
}
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const mp_cloud_sdk_1 = require("@tbmp/mp-cloud-sdk");
const tbcc_sdk_1 = require("./tbcc-sdk");
mp_cloud_sdk_1.default.init({
env: 'test' // 云函数环境 test 测试环境 online 线上环境
import cloud from '@tbmp/mp-cloud-sdk';
cloud.init({
env: 'online' // 云函数环境 test 测试环境 online 线上环境
});
App({
requestType: 'cloud',
cloudName: '',
cloud: // 主云函数项目名
mp_cloud_sdk_1.default,
tbcc: tbcc_sdk_1.default,
activityId: "",
onLaunch(options) {
this.handleQuery(options.query || {});
console.log('onLauch')
},
onShow(options) {
// 从后台被 scheme 重新打开
},
/**
* 处理链接参数
* @param {object} query 小程序链接上的参数
*/
handleQuery(query) {
const { activityId } = query;
activityId && (this.activityId = activityId);
}
requestType: 'cloud', // ams:ams接口,cloud: 云函数
cloudName: 'bubbleSurviva', // 主云函数项目名 duiba
cloud,
sellerId: 880734502,//固定
smallKidItemId: '625760427170',//小样商品ID
onLaunch(options) {
this.handleQuery(options.query || {});
console.log('onLaunch')
},
onShow(options) {
// 从后台被 scheme 重新打开
},
/**
* 处理链接参数
* @param {object} query 小程序链接上的参数
*/
handleQuery(query) {
const { activityId,isAssist,inviteId } = query;
this.activityId = activityId || '5f34e1c4964f9706aa7d803c';//5ef1903a9897b43b31bb651a
this.isAssist=isAssist;
this.inviteId=inviteId;
}
});
//# sourceMappingURL=app.js.map
\ No newline at end of file
{
"pages": ["pages/pagecanvas/pagecanvas", "pages/pagemycanvaspage/pagemycanvaspage"],
"window": {
"enableSkia": "true",
"allowsBounceVertical":"NO"
}
}
\ No newline at end of file
"pages": [
"pages/index/index",
"pages/myPrize/myPrize",
"pages/goodsPage/goodsPage",
"pages/helpPage/helpPage"
],
"window": {
"navigationBarForceEnable": true,
"defaultTitle": "",
"enableSkia": "true"
}
}
.adopt-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
}
.adopt-modal__shade {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.75);
}
.adopt-modal__container {
position: absolute;
top: 50%;
left: 50%;
margin-left: -325rpx;
margin-top: -324rpx;
width: 650rpx;
height: 648rpx;
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/adoptBg.png") no-repeat;
background-size: 100%;
}
.adopt_xj {
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/adopt_xj.png") no-repeat;
background-size: 100%;
}
.adopt_xm {
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/adopt_xm.png") no-repeat;
background-size: 100%;
}
.adopt_xk {
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/adopt_xk.png") no-repeat;
background-size: 100%;
}
.adopt-modal__bd {
font-size: 28rpx;
text-align: center;
color: #fff;
padding: 50rpx 0;
}
.adopt-modal__close {
position: absolute;
right: -20rpx;
top: -80rpx;
height: 75rpx;
width: 85rpx;
/* background: url('../../assets/modal_close_btn.png') center center no-repeat; */
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/close.png") no-repeat;
background-size: 100%;
z-index: 9;
}
.adopt-modal_introduce{
position: absolute;
left: 0;
top: 378rpx;
width: 100%;
color: #4d2716;
font-size: 29rpx;
text-align: center;
}
.adopt-modal_input{
border:0;
position: absolute;
left: 78rpx;
top: 300rpx;
/* margin-left: -225rpx; */
width: 450rpx;
height: 66rpx;
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/inputBg.png") no-repeat;
background-size: 100%;
}
.adopt-modal_input input {
/* position: absolute;
top: 0;
width: 631px;
height: 91px; */
width: 450rpx;
height: 66rpx;
border: 0;
background-color: rgba(0, 0, 0, 0);
font-size: 12px;
text-align: left;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
color: #4d2716;
}
input::-webkit-input-placeholder {
color: #4d2716;
font-size: 12px;
text-align: center;
}
.adopt-modal_resetBtn{
position: absolute;
left: 0;
bottom: 34rpx;
width: 100%;
color: #4d2716;
font-size: 32rpx;
text-align: center;
}
.adopt-modal__tz {
position: absolute;
left: 545rpx;
top: 291rpx;
width: 68rpx;
height: 77rpx;
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/tz.png") no-repeat;
background-size: 100%;
}
.adopt-modal__confirm-btn {
position: absolute;
left: 50%;
margin-left: -165rpx;
bottom: 84rpx;
width: 330rpx;
height: 104rpx;
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/adoptBtn.png") no-repeat;
background-size: 100%;
}
<view class="adopt-modal">
<view class="adopt-modal__shade modal-animate-fade-in" />
<view class="adopt-modal__container modal-animate-zoom-in {{type==1?'adopt_xj':type==2?'adopt_xm':'adopt_xk'}} ">
<view class="adopt-modal__close" onTap="onModalClose" />
<view class="adopt-modal_input">
<input placeholder="给你的松鼠取个名字吧!(6字以内)" value="{{randomName}}" maxlength="6" onInput="onChangeInput" />
</view>
<view class="adopt-modal_introduce">快快领它回家,陪它长大吧!</view>
<view class="adopt-modal__tz" onTap="handelRandomName"></view>
<view onTap="onModalConfirm" class="adopt-modal__confirm-btn"></view>
<view class="adopt-modal_resetBtn" onTap="onModalClose">重新选择</view>
</view>
</view>
import { commonToast } from "../../utils/utils";
const SYSTEMNAME = [
"鼠苹果",
"鼠蜜桃",
"鼠木瓜",
"鼠香橙",
"鼠葡萄",
"鼠冻梨",
"鼠狮子",
"鼠猴子",
"鼠悟空",
"鼠八戒",
"鼠白雪",
"鼠雪花",
"鼠吐吐",
"鼠典典",
"鼠璐璐",
"鼠奔奔",
"鼠蜡烛",
"鼠宁宁",
"鼠卡卡",
"鼠艾西",
"鼠蓝宝",
"鼠麒麟",
"鼠淘淘",
"鼠泰山",
"鼠帅哥",
"鼠西瓜",
"鼠瑞拉",
"鼠妞妞",
"鼠圆圆",
"鼠盐盐",
"鼠太子",
"鼠恺撒",
"鼠哈哈",
"鼠公子",
"鼠洛忧",
"鼠迪尔",
"鼠洛洛",
"鼠七喜",
"鼠四傻",
"鼠乖乖",
"鼠米奇",
"鼠柯基",
"鼠跳跳",
"鼠淘气",
"鼠豹子",
"鼠扑扑",
"鼠麻团",
"鼠来福",
"鼠波利",
"鼠安琪",
"鼠瑞瑞",
"鼠洛克",
"鼠基诺",
"鼠莎莉",
"鼠绵绵",
"鼠仙缔",
"鼠长毛",
"鼠米菲",
"鼠公爵",
"鼠宝马",
"鼠柯弟",
"鼠贝贝",
"鼠金金",
"鼠导弹",
"鼠西西",
"鼠阿郎",
"鼠本伟",
"鼠彦祖",
"鼠棉花",
"鼠丝丝",
"鼠安娜",
"鼠玛吉",
"鼠优卡",
"鼠耐克",
"鼠尼卡",
"鼠元帅",
"鼠懒懒",
"鼠兰兰",
"鼠艾米",
"鼠团团",
"鼠贝塔",
"鼠雪郎",
"鼠罗杰",
"鼠伯通",
"鼠满意",
"鼠大象",
"鼠天天",
"鼠妖妖",
"鼠小杰",
"鼠傻傻",
"鼠鼎鼎",
"鼠钢炮",
"鼠果冻",
"鼠依恋",
"鼠思诺",
"鼠白宫",
"鼠萨萨",
"鼠贝茜",
"鼠苏拉",
"鼠黑虎",
"鼠格格",
"鼠梅西",
"鼠肥肥",
"鼠饭团",
"鼠米莉",
"鼠绅士",
"鼠旋风",
"鼠白龙",
"鼠泪恩",
"鼠多多",
"鼠彼利",
"鼠巴特",
"鼠丸子",
"鼠拉索",
"鼠苏苏",
"鼠灵宝",
"鼠卡索",
"鼠晨晨",
"鼠露露",
"鼠黑狼",
"鼠盒子",
"鼠大款",
"鼠大海",
"鼠正男",
"鼠咪咪",
"鼠肉肉",
"鼠莱多",
"鼠棒棒",
"鼠乐乐",
"鼠康熙",
"鼠米可",
"鼠辛缔",
"鼠白虎",
"鼠路路",
"鼠巴顿"
];
Component({
data: {
inputVal: "",
randomName: "",
type:1
},
didMount() {
// 页面显示
let { type } = this.props
console.log("typetypetype-=-=-",type)
// this.type = type;
this.setData({
type
});
},
methods: {
onModalClose() {
const { onModalClose } = this.props;
onModalClose && onModalClose();
},
randNum(a, b) {
return Math.floor(Math.random() * (b - a) + a);
},
onModalConfirm() {
const { onModalConfirm, onModalClose } = this.props;
var reg = /^\s*$/g;
if (
reg.test(this.data.inputVal) ||
this.data.inputVal == null ||
this.data.inputVal == ""
) {
commonToast("松鼠名字不能为空");
} else {
onModalConfirm && onModalConfirm(this.data.inputVal);
// onModalClose && onModalClose();
}
},
onChangeInput(e) {
console.log(e);
let { value } = e.detail;
this.setData({
inputVal: value
});
console.log(this.data.inputVal);
},
handelRandomName() {
let numRand = Math.floor((Math.random() * 999)) + 1;
let str = SYSTEMNAME[this.randNum(0, 135)] + numRand;
this.setData({
randomName: str,
inputVal: str
});
console.log(str)
}
}
});
{
"component": true
}
\ No newline at end of file
.exp-rank-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
background-color: rgba(0, 0, 0, 0.75);
}
.exp-rank-wrap {
width: 100%;
/* height: 900rpx; */
position: fixed;
bottom: 0;
left: 0;
background-color: #e9dab6;
border-top-right-radius: 20rpx;
border-top-left-radius: 20rpx;
padding: 0 25rpx;
animation: mallmodalIn 0.5s ease-out;
}
.exp-rank-title {
font-size: 48rpx;
line-height: 1;
color: #4d2716;
text-align: center;
padding-top: 50rpx;
padding-bottom: 30rpx;
font-weight: bold;
}
.exp-rank-content {
background-color: #fff;
border-top-right-radius: 20rpx;
border-top-left-radius: 20rpx;
height: 784rpx;
}
.exp-rank-header {
width: 100%;
height: 70rpx;
line-height: 70rpx;
font-size: 24rpx;
color: #4d2716;
display: flex;
justify-content: space-around;
text-align: center;
border-bottom: 1rpx solid #e9dab6;
}
.exp-rank-list {
height: 713rpx;
}
.exp-rank-list .exp-rank-item {
width: 100%;
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx;
color: #4d2716;
display: flex;
justify-content: space-around;
text-align: center;
border-bottom: 1rpx solid #e9dab6;
}
.exp-rank-list .exp-rank-item:nth-child(1) .exp-rank-item-rank {
font-size: 0;
background: url('//yun.duiba.com.cn/taobaomini/squirrelAdopt/exp-rank1.png') no-repeat;
background-size: 37rpx 42rpx;
background-position: 32rpx 23rpx;
}
.exp-rank-list .exp-rank-item:nth-child(2) .exp-rank-item-rank {
font-size: 0;
background: url('//yun.duiba.com.cn/taobaomini/squirrelAdopt/exp-rank2.png') no-repeat;
background-size: 37rpx 42rpx;
background-position: 32rpx 23rpx;
}
.exp-rank-list .exp-rank-item:nth-child(3) .exp-rank-item-rank {
font-size: 0;
background: url('//yun.duiba.com.cn/taobaomini/squirrelAdopt/exp-rank3.png') no-repeat;
background-size: 37rpx 42rpx;
background-position: 32rpx 23rpx;
}
.exp-rank-list .exp-rank-item-rank {
font-weight: bold;
}
.exp-rank-item-rank {
width: 100rpx;
display: inline-block;
}
.exp-rank-item-name {
width: 200rpx;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
display: inline-block;
}
.exp-rank-item-level {
width: 100rpx;
display: inline-block;
}
.exp-rank-item-exp {
width: 150rpx;
display: inline-block;
}
.exp-rank-content .exp-rank-nodata {
color: #4d2716;
font-size: 28rpx;
text-align: center;
padding-top: 240rpx;
}
.exp-rank-modal .close {
position: absolute;
right: 25rpx;
top: -92rpx;
height: 75rpx;
width: 85rpx;
background: url("//yun.duiba.com.cn/duiba-h5/tb/adopt/close.png") no-repeat;
background-size: 100% 100%;
z-index: 9;
}
@keyframes mallmodalIn {
from {
transform: translateY(100%)
}
to {
transform: translateY(0)
}
}
\ No newline at end of file
<view class="exp-rank-modal">
<view class="exp-rank-wrap">
<view class="close" onTap="onModalClose"></view>
<view class="exp-rank-title">等级排行榜</view>
<view class="exp-rank-content">
<view class="exp-rank-header">
<text class="exp-rank-item-rank">排名</text>
<text class="exp-rank-item-name">昵称</text>
<text class="exp-rank-item-level">等级</text>
<text class="exp-rank-item-exp">经验值</text>
</view>
<view class="exp-rank-list" a:if="{{list && list.length>0}}">
<scroll-view scroll-y="{{true}}" style="height: 100%">
<view class="exp-rank-item" a:for="{{list}}">
<text class="exp-rank-item-rank">{{item.rank}}</text>
<text class="exp-rank-item-name">{{item.squirrelName}}</text>
<text class="exp-rank-item-level">{{item.level}}</text>
<text class="exp-rank-item-exp">{{item.exp}}</text>
</scroll-view>
</view>
<view class="exp-rank-nodata" a:else>暂无人上榜</view>
</view>
</view>
</view>
\ No newline at end of file
import API from '../../api';
import { commonToast } from '../../utils/utils';
const app = getApp();
Component({
mixins: [],
data: {
},
props: {},
didMount() {
this.getExpRankList();
},
didUpdate() {},
didUnmount() {},
methods: {
onModalClose() {
const { onExpModalClose } = this.props;
console.log('onExpModalClose', onExpModalClose)
onExpModalClose && onExpModalClose();
},
async getExpRankList(){
const { activityId } = app;
const { success, data } = await API.getExpRankList({ activityId }).catch(res => {
commonToast(res && res.message);
}) || {};
if (success && data){
const { list = [] } = data;
this.setData({
list
})
console.log(list)
}
}
},
});
{
"component": true
}
\ No newline at end of file
.get-small-modal-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 20;
}
.get-small-modal-container__content {
position: absolute;
width:703rpx;
height:445rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/samplePanelBg.png") no-repeat;
background-size: 100%;
position: absolute;
top: 50%;
left: 50%;
margin-left: -352rpx;
margin-top: -222rpx;
}
.get-small-modal-container__close {
position: absolute;
right: 30rpx;
top: -60rpx;
height: 48rpx;
width: 48rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/tc_close.png") no-repeat;
background-size: 100% 100%;
}
.get-small-modal-container__btn {
position: absolute;
bottom: 60rpx;
width: 436rpx;
height: 86rpx;
left: 50%;
margin-left: -218rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/samplePanelBtn.png") no-repeat;
background-size: 100% 100%;
}
\ No newline at end of file
<view class="get-small-modal-container">
<view class="get-small-modal-container__content">
<view class="get-small-modal-container__close" onTap="closeModal"></view>
<view class="get-small-modal-container__btn" onTap="closeModal"></view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {},
props: {
onCloseModal: () => {}
},
didMount() {},
didUpdate() {},
didUnmount() {},
methods: {
closeModal() {
this.props.onCloseModal()
}
},
});
{
"component": true
}
\ No newline at end of file
.logistics-modal-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 20;
}
.logistics-modal-container__content {
width:645rpx;
height:243rpx;
border:2rpx solid rgba(239,234,255,1);
border-radius:20rpx;
padding: 11rpx 10rpx;
background: #B09BFF;
position: absolute;
left: 50%;
top: 50%;
margin-left: -322rpx;
margin-top: -121rpx;
}
.logistics-modal-container__close {
position: absolute;
right: -10rpx;
top: -70rpx;
height: 48rpx;
width: 48rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/tc_close.png") no-repeat;
background-size: 100% 100%;
}
.logistics-modal-container__content-item {
width:621rpx;
height:217rpx;
background:rgba(255,255,255,1);
border-radius:10rpx;
padding: 34rpx 0 0 34rpx;
display: flex;
}
.logistics-modal-container__content-left {
width: 120rpx;
height:120rpx;
background:rgba(244,244,244,1);
}
.logistics-modal-container__content-left image {
width: 100%;
height: 100%;
}
.logistics-modal-container__content-right {
margin-left: 40rpx;
display: flex;
flex-direction: column;
}
.logistics-modal-container__content-name view{
font-size:28rpx;
font-family:SourceHanSansSC;
font-weight:400;
color:rgba(51,51,51,1);
}
.logistics-modal-container__content-desc {
font-size:20rpx;
margin-top: 15rpx;
}
.logistics-modal-container__content-copy {
display: flex;
align-items: center;
height: 30rpx;
margin-top: 15rpx;
}
.logistics-modal-container__content-copy__code {
font-size:20rpx;
}
.logistics-modal-container__content-copy__img {
width: 20rpx;
height: 20rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/icon_copy_1.png") no-repeat;
background-size: 100% 100%;
margin-left: 20rpx;
}
\ No newline at end of file
<view class="logistics-modal-container">
<view class="logistics-modal-container__content">
<view class="logistics-modal-container__close" onTap="closeModal"></view>
<view class="logistics-modal-container__content-item">
<view class="logistics-modal-container__content-left">
<image mode="scaleToFill" src="{{prizeItem.image}}"/>
</view>
<view class="logistics-modal-container__content-right">
<view class="logistics-modal-container__content-name">{{prizeItem.name}}</view>
<view class="logistics-modal-container__content-desc">{{(prizeItem.shipStatus - 0) == 2?'发货状态:已发货':'发货状态:未发货'}}</view>
<view class="logistics-modal-container__content-desc" a:if="{{prizeItem.shipStatus != 2}}">温馨提示:奖品将在活动结束7天内陆续发出</view>
<view class="logistics-modal-container__content-copy" a:else>
<view class="logistics-modal-container__content-copy__code">{{'物流单号:'+prizeItem.shipNum}}</view>
<view class="logistics-modal-container__content-copy__img" onTap="copyCode"></view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
import { commonToast } from '../../utils/utils';
Component({
mixins: [],
data: {},
props: {
prizeItem: {},
onCloseModal: () => {}
},
didMount() {},
didUpdate() {},
didUnmount() {},
methods: {
closeModal() {
this.props.onCloseModal()
},
//复制运单号
copyCode() {
let { shipNum } = this.props.prizeItem
my.setClipboard({
text: shipNum+'',
success: () =>{
commonToast('复制成功')
}
});
}
},
});
{
"component": true
}
\ No newline at end of file
.small-kid-modal-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 20;
}
.small-kid-modal-container__content {
width:750rpx;
height:762rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/tc_xy_icon.png") no-repeat;
background-size: 100%;
position: absolute;
top: 50%;
margin-top: -431rpx;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
.small-kid-modal-container__close {
position: absolute;
right: 40rpx;
top: 0;
height: 48rpx;
width: 48rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/tc_close.png") no-repeat;
background-size: 100% 100%;
}
.small-kid-modal-container__title {
margin-top: 140rpx;
}
.small-kid-modal-container__title view {
font-size:24rpx;
font-family:SourceHanSansSC;
font-weight:300;
color:rgba(92,89,177,1);
line-height:36rpx;
text-align: center;
}
.small-kid-modal-container__prize {
width:220rpx;
height:219rpx;
background:rgba(255,255,255,1);
border:1rpx solid rgba(92,89,177,1);
margin: 20rpx 0 60rpx;
}
.small-kid-modal-container__prize image{
width: 100%;
height: 100%;
}
.small-kid-modal-container__desc {
font-size:24rpx;
font-family:SourceHanSansSC;
font-weight:300;
color:rgba(92,89,177,1);
line-height:36rpx;
text-align: center;
}
.small-kid-modal-container__btn {
margin-top: 20rpx;
display: flex;
justify-content: center;
align-items: center;
}
.small-kid-modal-container__btn-left,.small-kid-modal-container__btn-right {
width:256rpx;
height:85rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/kid_btn_01.png") no-repeat;
background-size: 100% 100%;
font-size:36rpx;
font-family:SourceHanSansSC;
font-weight:300;
color:rgba(255,255,255,1);
text-shadow:0px 3rpx 8rpx rgba(245,154,71,0.67);
display: flex;
justify-content: center;
align-items: center;
line-height: 86rpx;
}
.small-kid-modal-container__btn-right {
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/kid_icon_02.png") no-repeat;
background-size: 100% 100%;
}
\ No newline at end of file
<view class="small-kid-modal-container">
<view class="small-kid-modal-container__content">
<view class="small-kid-modal-container__close" onTap="closeModal"></view>
<view class="small-kid-modal-container__title">
<view>您的好友赠送了你一份84元小样, </view>
<view>现在购买88元及以上商品即可随单包邮寄送,</view>
<view>或支付14.9元邮费即可带回家~ </view>
</view>
<view class="small-kid-modal-container__prize">
<image mode="scaleToFill" src="//yun.duiba.com.cn/aurora/assets/c5f66927bb6fb83b832bb5fbed106c72c63b4967.png"/>
</view>
<view class="small-kid-modal-container__desc">图片仅供参考,具体以收到的实物为准</view>
<view class="small-kid-modal-container__btn">
<view class="small-kid-modal-container__btn-left" onTap="goToBuy">去下单</view>
<view class="small-kid-modal-container__btn-right" onTap="goToPay">支付邮费</view>
</view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {},
props: {
onCloseModal: () => {},
onGoToBuy: () => {},
onGoToPay: () => {},
},
didMount() {},
didUpdate() {},
didUnmount() {},
methods: {
closeModal() {
this.props.onCloseModal()
},
//去下单
goToBuy() {
this.props.onGoToBuy()
},
//支付邮费
goToPay() {
this.props.onGoToPay()
},
},
});
{
"component": true
}
\ No newline at end of file
// 分享配置
export const SHARE_CONFIG = {
title: '分享测试标题',
desc: '分享测试描述',
imageUrl: '', // 分享图片URL
path: 'pages/index/index'
};
// 链接配置
export const REDIRECT_URL = {
'testpage': '/pages/testPage/testPage',
'tmall': 'https://www.tmall.com'
};
// 领取状态 (1待领取,2处理中,3领取成功,4领取失败,5已过期,6重新领取) 针对小样奖品:(0待解锁,7:淘宝查看)
export const DRAW_STATUS_PARAMS = {
'stock': 0,
'wait': 1,
'processing': 2,
'done': 3,
'fail': 4,
'expired': 5,
'retry': 6,
'view': 7
};
// 我的奖品页-领取按钮状态 (1待领取,2处理中,3领取成功,4领取失败,5已过期,6重新领取)
export const DRAW_STATUS_MAP = {
[DRAW_STATUS_PARAMS.stock]: {
btnText: '领取奖品',
},
[DRAW_STATUS_PARAMS.wait]: {
btnText: '立即领取',
},
[DRAW_STATUS_PARAMS.processing]: {
btnText: '处理中',
btnDisabled: 'myprize-btn-status-disabled'
},
[DRAW_STATUS_PARAMS.done]: {
btnText: '已领取',
btnDisabled: 'myprize-btn-status-get'
},
[DRAW_STATUS_PARAMS.fail]: {
btnText: '领取失败',
btnDisabled: 'myprize-btn-status-disabled'
},
[DRAW_STATUS_PARAMS.expired]: {
btnText: '已失效',
btnDisabled: 'myprize-btn-status-disabled'
},
[DRAW_STATUS_PARAMS.retry]: {
btnText: '重新领取',
btnUse: 'myprize-btn-status-use'
},
[DRAW_STATUS_PARAMS.view]: {
btnText: '淘宝查看',
btnDisabled: 'myprize-btn-status-disabled'
},
};
// 奖品类型(1 权益(优惠券/红包),2积分,3实物,5谢谢参与)
export const PRIZE_TYPE = {
1: 'coupon',
2: 'credits',
3: 'object',
5: 'thanks'
};
This diff is collapsed.
{
"_args": [
[
"@tbmp/mp-cloud-sdk@1.4.1",
"/Users/wanghongyuan/taobao_mini/aupres_bubbleSurviva/aupres_c_client/client"
]
],
"_from": "@tbmp/mp-cloud-sdk@1.4.1",
"_id": "@tbmp/mp-cloud-sdk@1.4.1",
"_inBundle": false,
"_integrity": "sha512-h3xz4q22WGgxlSe5kqkaHK3C1fjWVlXHRQWKbIiecRJQPPoa5jok0LAkZlsLxvfa24ub4Pi34+a8Xjja2hlFTw==",
"_location": "/@tbmp/mp-cloud-sdk",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@tbmp/mp-cloud-sdk@1.4.1",
"name": "@tbmp/mp-cloud-sdk",
"escapedName": "@tbmp%2fmp-cloud-sdk",
"scope": "@tbmp",
"rawSpec": "1.4.1",
"saveSpec": null,
"fetchSpec": "1.4.1"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/@tbmp/mp-cloud-sdk/-/mp-cloud-sdk-1.4.1.tgz",
"_spec": "1.4.1",
"_where": "/Users/wanghongyuan/taobao_mini/aupres_bubbleSurviva/aupres_c_client/client",
"author": "",
"description": "",
"gitHead": "f69d455f62dcf8b82983b291a0de742bc91b3390",
"license": "ISC",
"main": "index.js",
"name": "@tbmp/mp-cloud-sdk",
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"types": "./types/platforms/mp/index.d.ts",
"version": "1.4.1"
}
import { Db } from "./db";
export interface IFindOptions {
/**
* 查询的文档数量限制
*/
limit?: number;
/**
* 跳过的文档数量
*/
skip?: number;
/**
* 排序规则
*/
sort?: object;
/**
* 查询后过滤的字段
*/
projection?: object;
}
export declare class CollectionReference {
/**
* 初始化
*
* @internal
*
* @param db - 数据库的引用
* @param coll - 集合名称
*/
private _db;
private _coll;
constructor(db: Db, coll: string);
/**
* 读取集合名字
*/
readonly name: string;
/**
* 对集合执行聚合查询
* @param pipeline 聚合查询对象
*/
aggregate(pipeline: object | object[]): Promise<any>;
/**
* 获取集合中复合条件的记录数量
* @param filter 过滤条件
*/
count(filter: object): Promise<any>;
/**
* 删除集合中的一批记录
* @param filter 过滤条件
*/
deleteMany(filter: object): Promise<any>;
/**
* 查找集合中符合条件的所有记录
* @param filter 过滤条件
* @param options 查询配置项
*/
find(filter: any, options?: IFindOptions): Promise<any>;
/**
* 替换一条数据
* @param filter 过滤条件
* @param data 新数据
*/
replaceOne(filter: object, data: object): Promise<any>;
/**
* 在集合中添加一条记录
* @param data 带插入的数据
*/
insertOne(data: object): Promise<any>;
/**
* 在集合中添加一批记录
* @param data 待插入的数据,只能为数组
*/
insertMany(data: object[]): Promise<any>;
/**
*
* @param filter 过滤条件
* @param data 更新规则
*
*/
updateMany(filter: object, data: object): Promise<any>;
}
import { CollectionReference } from "./collection";
import { IAsyncInvokeOptions } from "../../shared/types";
import { ICloudService } from "../interface/cloudService";
export declare class Db extends ICloudService {
/**
* 获取集合的引用
*
* @param collName - 集合名称
*/
collection(collName: string): CollectionReference;
/**
* 创建集合
*/
createCollection(name: string, options: {
collName: string;
} & IAsyncInvokeOptions): Promise<any>;
dbRequest(action?: string, params?: any): Promise<any>;
}
import { IAsyncInvokeOptions } from '../../shared/types';
import { ICloudService } from '../interface/cloudService';
export interface ICallFunctionOptions extends IAsyncInvokeOptions {
name: string;
data: any;
}
export interface IInvokeMethod {
(IAsyncInvokeOptions: any): void;
}
export default class CloudFunction extends ICloudService {
invoke(name: string, data?: object, handler?: string): Promise<any>;
private fcRequest;
}
import { Request } from "../../shared/request";
export interface ICloudServiceOptions {
env?: 'test' | 'online' | 'pre';
}
export declare abstract class ICloudService {
options: ICloudServiceOptions;
request: Request;
constructor(options: ICloudServiceOptions, request: Request);
init?(): void;
}
import Powermsg from '@ali/lib-powermsg-sdk';
import { Env } from '../../shared/types';
export default class Client {
env: Env;
pmg: Powermsg;
deviceId: string;
initing: boolean;
queue: (() => void)[];
config: any;
constructor(env: Env);
init: () => Promise<any>;
onMessage: (callback: any) => Promise<() => void>;
private createPwgInstance;
}
import { ICloudService, ICloudServiceOptions } from "../interface/cloudService";
import Client from './client';
import Server from './server';
export default class Message extends ICloudService {
server: Server;
client: Client;
constructor(options: ICloudServiceOptions);
}
import { Request } from '../../shared/request';
import { Env } from "../../../packages/mp-cloud-node-sdk/types/shared/types";
interface IPushOptions {
subType: number;
deviceId?: string;
data: object;
pushType: string;
}
export default class Server {
env: Env;
request: Request;
constructor(env: Env, request: Request);
push(options: IPushOptions): Promise<any>;
}
export {};
import {ICloudService} from "../../interface/cloudService";
export default class Application extends ICloudService {
httpRequest(options: {path: string, params?: any, body?: any, headers?: any, method?: string, exts?: any}): Promise<any>;
}
import {ICloudService} from "../../interface/cloudService";
export default class Process extends ICloudService {
invoke(options: { api: string, data?: any, headers?: any }): Promise<any>;
private topRequest;
}
import {ICloudService} from "../../interface/cloudService";
export default class Qimen extends ICloudService {
invoke(options: { api: string, data?: any, targetAppKey?: any, headers?: any }): Promise<any>;
private topRequest;
}
import {ICloudService} from "../../interface/cloudService";
export default class Top extends ICloudService {
invoke(options: { api: string, data?: any, headers?: any, authScope?: string }): Promise<any>;
private topRequest;
}
import { IAsyncInvokeOptions } from "../../shared/types";
import { ICloudService } from "../interface/cloudService";
export interface IUploadFileOptions extends IAsyncInvokeOptions {
/**
* 选择到的本地文件路径
*/
filePath: string;
/**
* 文件类型, image/audio/video
*/
fileType: FileTypes;
/**
* 云存储文件名可带路径, 如a/xxx.jpg
*/
fileName?: string;
/**
* web环境上传 file对象
*/
file?: any;
}
export interface IDownloadFileOptions extends IAsyncInvokeOptions {
fileType?: FileTypes;
fileId: string;
}
export interface ITempFileURLOptions extends IAsyncInvokeOptions {
fileList: string[];
}
export declare type IDeleteFileOptions = IDownloadFileOptions;
export declare type FileTypes = "image" | "video" | "audio";
export default class CloudStorage extends ICloudService {
private parseUploadResult;
private parsePostUploadResult;
private parseAusUploadResult;
/**
* 文件上传
* 1.获取上传配置
* 2.调用my.api上传
* 3.建立存储关系
* @param options
*/
uploadFile(options: IUploadFileOptions): Promise<any>;
/**
* 删除文件
* @param options
*/
deleteFile(options: IDeleteFileOptions): Promise<boolean>;
/**
* 根据文件id(cloud://)获取授权的url
* @param options
*/
getTempFileURL(options: IAsyncInvokeOptions & {
fileType: string;
fileId: string | string[];
}): Promise<any>;
/**
* 从服务端获取文件并在本地读取
* @param options
*/
readRemoteFile(options: IAsyncInvokeOptions & {
url: string;
}): Promise<ArrayBuffer>;
/**
* 存储的请求代理, 统一sdk环境和存储环境
* @param action
* @param data
* @param requestType
*/
private storageRequest;
}
import { Cloud } from '../mp';
declare const cloudInstance: Cloud;
export default cloudInstance;
import { Cloud as MpCloud } from '../mp';
import { ICloudOptions } from '../../shared/types';
import Client from '../../core/message/client';
import { IProxy } from '../../shared/request';
export declare class Cloud extends MpCloud {
message: {
client: Client;
};
init(options: ICloudOptions, proxy: IProxy): Promise<boolean>;
}
declare const _default: Cloud;
export default _default;
import {IProxy} from '../../shared/request';
import {ICloudOptions} from '../../shared/types';
import CloudFunction from '../../core/functions';
import CloudStorage from '../../core/storage';
import Db from '../../core/db';
import Top from '../../core/openApi/client/top';
import Qimen from '../../core/openApi/client/qimen';
import Process from '../../core/openApi/client/process';
import Application from '../../core/openApi/client/application';
export declare class Cloud {
function: CloudFunction;
file: CloudStorage;
db: Db;
topApi: Top;
qimenApi: Qimen;
processApi: Process;
application: Application;
init(options: ICloudOptions, proxy?: IProxy): Promise<boolean>;
}
declare const _default: Cloud;
export default _default;
import { IProxy, IRequestOptions } from '../../shared/request';
import { ICloudOptions } from '../../shared/types';
import CloudFunction from '../../core/functions';
import Database from '../../core/db';
import Server from '../../core/message/server';
import Top from '../../core/openApi/server/top';
export declare class Cloud {
private _options;
db: Database;
function: CloudFunction;
message: {
server: Server;
};
private request;
topApi: Top;
setEnv(env: any): void;
init(options: ICloudOptions & IRequestOptions, proxy: IProxy): void;
}
export declare function cloud(context: any, options: ICloudOptions): Cloud;
export declare const BASE_APIS: {
GET_SESSION: string;
GET_SECRET: string;
};
export declare const STORAGE_KEYS: {
SECRET: string;
};
export declare const ENV_CONFIG: {
pre: {
gw: string;
};
online: {
gw: string;
};
};
import { IAsyncInvokeOptions } from "./types";
export declare function invokeCallback(options: IAsyncInvokeOptions, asyncTask: Promise<any>): Promise<void>;
export declare function myApiPromisify(method: (options: any) => void, options?: any): Promise<any>;
export declare function getUserId(): Promise<string>;
export declare function noop(): void;
export declare function invokeTaskCallback(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
export declare function safeAccess(props: any, keys: string[] | string, def?: any): any;
export declare function getValue(key: string): Promise<any>;
export declare function setValue(key: string, data: any): Promise<any>;
export interface IRequestOptions {
appKey?: string,
sourceAppKey?: string,
requestAppKey?:string,
miniappId?: string,
sourceMiniAppId?: string,
appOwnerOpenId?: string,
signSecret?: string;
sessionKey?: string;
requestId?: string;
cloudId?: string;
openId?: string;
unionId?: string;
userNick?: string,
mixNick?: string,
session?: string;
accessToken?: string;
env?: string;
}
export declare enum RequestTypes {
MTOP = 1,
MY = 2,
GATEWAY = 3
}
export interface IGatewayResponse {
error_response: {
code: string;
};
}
export interface IRequestDetail {
url: string;
data?: any;
rawData?: any;
method?: string;
headers?: any;
dataType?: string;
v?: string;
__is_retry_task__?: boolean;
env?: string;
mtopOptions?: any;
}
export interface IProxyOptions {
gatewayUrl?: string;
dataProxyGatewayUrl?: string;
}
export declare abstract class IProxy {
options: IProxyOptions;
abstract apply(task: IRequestDetail, requestType?: RequestTypes): Promise<any>;
constructor(options?: IProxyOptions);
}
export declare class Request {
networkType?: string;
options: IRequestOptions;
tasks: {
detail: IRequestDetail;
success?: (res: any) => void;
fail?: (res: any) => void;
}[];
proxy: IProxy;
inited: boolean;
pauseExecTask: boolean;
init(options: IRequestOptions, proxy: IProxy): Promise<void>;
listenNetworkChange(): Promise<void>;
static getRequestType(url: string): RequestTypes;
/**
* 验证响应结果, 特定情况下重试请求
* @param res
*/
private verifyResponse;
private tryThrowError;
private sendGatewayRequest;
flushGatewayRequestQueue(reject?: boolean): void;
exec(detail: IRequestDetail, requestType?: RequestTypes): Promise<any>;
/**
*
* @param url 网关请求
* @param method 请求方法
* @param queryString
* @param headers mc_开头的http header
* @param content json body
*/
private getHttpRequestSign;
/**
* 对网关请求签名
* @param detail
*/
private createGatewayRequest;
}
export declare const request: Request;
export interface ICallback {
(res: any): void;
}
export interface IHttpRequestOptions extends IAsyncInvokeOptions {
url: string;
method?: string;
headers?: any;
data?: any;
dataType?: string;
}
export declare type Env = 'test' | 'pre' | 'online';
export declare type Envs = {
database: Env;
file: Env;
function: Env;
message: Env;
};
export interface ICloudOptions {
env?: Env | Envs;
appKey?: string;
}
declare global {
interface Window {
}
var my: {
httpRequest: (options: IHttpRequestOptions) => void;
sendMtop: (options: any) => void;
alert: (options: {
title?: string;
content?: string;
}) => void;
};
var NODE_PLATFORM: boolean;
var SDK_VERSION: string;
}
export interface IAsyncInvokeOptions {
success?: ICallback;
fail?: ICallback;
complete?: ICallback;
}
export declare type AsyncInvokeResult = Promise<any> | void;
export declare type Constructor<T = {}> = new (...args: any[]) => T;
import { IAsyncInvokeOptions, Env, Envs } from "./types";
export declare function noop(): void;
export declare function invokeTaskCallback(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
export declare function safeAccess(props: any, keys: string[] | string, def?: any): any;
export declare function invokeCallback(options: IAsyncInvokeOptions, asyncTask: Promise<any>): Promise<void>;
export declare function myApiPromisify(method: (options: any) => void, options?: any): Promise<any>;
export declare function getUserId(): Promise<string>;
export declare function getEnvs(env: Env | Envs): Envs;
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"_args": [
[
"fyge-tbmini@1.2.8",
"/Users/wanghongyuan/taobao_mini/aupres_bubbleSurviva/aupres_c_client/client"
]
],
"_from": "fyge-tbmini@1.2.8",
"_id": "fyge-tbmini@1.2.8",
"_inBundle": false,
"_integrity": "sha512-Gf/RRC7qNZ0fMkb1xL9Rl+y8isK1noGoDrm2UVdAQsxCa+Mn8o7CMHaf+AkNvJcitsh0kgXqI/bQVioSF3PQIg==",
"_location": "/fyge-tbmini",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "fyge-tbmini@1.2.8",
"name": "fyge-tbmini",
"escapedName": "fyge-tbmini",
"rawSpec": "1.2.8",
"saveSpec": null,
"fetchSpec": "1.2.8"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/fyge-tbmini/-/fyge-tbmini-1.2.8.tgz",
"_spec": "1.2.8",
"_where": "/Users/wanghongyuan/taobao_mini/aupres_bubbleSurviva/aupres_c_client/client",
"author": {
"name": "MrKwon"
},
"dependencies": {},
"description": "淘宝小程序canvas渲染引擎",
"devDependencies": {
"dts-bundle": "^0.7.3",
"glob": "^7.1.6",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-typescript2": "^0.25.2",
"rollup-plugin-uglify": "^6.0.3",
"ts-loader": "^4.0.0",
"typescript": "^2.7.2",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.1.0",
"webpack-cli": "^3.3.2"
},
"keywords": [
"淘宝小程序,canvas,webgl"
],
"license": "ISC",
"main": "./build/fyge.min.js",
"name": "fyge-tbmini",
"scripts": {
"build": "webpack",
"declare": "node scripts/declare.js src/index.ts",
"dev": "webpack -w",
"dev1": "rollup -c -m -w",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch"
},
"types": "./build/FYGE.d.ts",
"version": "1.2.8"
}
# SvgaParser
1.0.2版本支持web版本解析,包体小,web应用尽量用这个
1.1.0及以后版本同时支持web和微信小程序及淘宝小程序解析
(淘宝小程序使用,链接必须使用阿里系的白名单域名,或者云存储cloud://链接)
其他版本都是坏的
单纯将svga文件解析成动画图片及动画数据。
### 网页使用
```html
<script type="text/javascript" src="../build/svgaParser.min.js"></script>
<script>
SvgaParser.loadSvga("./svga/step1-1.svga", (v) => {
console.log(v)
}, (err) => { console.log(err) })
</script>
```
### npm使用
```js
npm install svga-parser
import { loadSvga } from "svga-parser";
loadSvga("./svga/step1-1.svga", (v) => {
console.log(v)
}, (err) => { console.log(err) })
```
declare module SvgaParser {
/**
* 加载方法
* @param url 资源路径
* @param success
* @param failure
*/
export function loadSvga(url: string, success: (videoItem: VideoEntity) => void, failure: (err: string) => void): void;
/**
* 导出只是当作类型接口用
*/
export interface VideoEntity {
/**
* SVGA 文件版本
*/
version: string;
/**
* 影片尺寸
*/
videoSize: {
width: number;
height: number;
};
/**
* 帧率,60,30等每秒
*/
FPS: number;
/**
* 总帧数
*/
frames: number;
/**
* base64图片数据记录
*/
images: {
[key: string]: string
};
/**
* 图片是否已被缓存,缓存全局,注意名字覆盖
*/
hasBeenCached: boolean;
/**
* sprite对象数据
*/
sprites: SpriteEntity[];
}
interface SpriteEntity {
/**
* 标识
*/
matteKey: string;
/**
* 图片key值
*/
imageKey: string;
/**
* 帧数据数组
*/
frames: FrameEntity[];
}
/**
* 还有很多其他数据,暂不需要,比如矢量路径和遮罩路径暂时都无
*/
interface FrameEntity {
/**
* 透明度
*/
alpha: number;
/**
* 2维矩阵数据
*/
transform: {
a: number,
b: number,
c: number,
d: number,
tx: number,
ty: number,
};
}
}
declare module "svga-parser" { export = SvgaParser; }
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"_args": [
[
"svga-parser@1.1.0",
"/Users/wanghongyuan/taobao_mini/aupres_bubbleSurviva/aupres_c_client/client"
]
],
"_from": "svga-parser@1.1.0",
"_id": "svga-parser@1.1.0",
"_inBundle": false,
"_integrity": "sha512-OjjtzPGC1ZdCWSWvldhXcB0CAz4ZOeoWEp0P9l4Lz7UtLM9f+DAYAYXKCXBWnRZvJevgkY/gniO/Bt89X0cKKw==",
"_location": "/svga-parser",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "svga-parser@1.1.0",
"name": "svga-parser",
"escapedName": "svga-parser",
"rawSpec": "1.1.0",
"saveSpec": null,
"fetchSpec": "1.1.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/svga-parser/-/svga-parser-1.1.0.tgz",
"_spec": "1.1.0",
"_where": "/Users/wanghongyuan/taobao_mini/aupres_bubbleSurviva/aupres_c_client/client",
"author": {
"name": "MrKwon"
},
"dependencies": {},
"description": "1.0.2版本支持web版本解析,包体小,web应用尽量用这个",
"devDependencies": {
"eval5": "^1.4.5",
"protobufjs": "^6.8.0",
"ts-loader": "^4.0.0",
"typescript": "^2.7.2",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.1.0",
"webpack-cli": "^3.3.2"
},
"keywords": [
"svga"
],
"license": "ISC",
"main": "build/svgaParser.min.js",
"name": "svga-parser",
"scripts": {
"build": "webpack",
"dev": "webpack -w",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch"
},
"types": "build/SvgaParser.d.ts",
"version": "1.1.0"
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<!-- <meta name="viewport" content="width=device-width,minimum-scale=1.0,user-scalable=no"> -->
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: white;
}
/* .top {
width: 100%;
height: 100px;
} */
</style>
</head>
<body>
<script type="text/javascript" src="../build/svgaParser.min.js"></script>
<script>
SvgaParser.loadSvga("./svga/step1-1.svga", (v) => {
console.log(v)
}, (err) => { console.log(err) })
</script>
</body>
</html>
\ No newline at end of file
{
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@tbmp/mp-cloud-sdk": {
"version": "1.4.2",
"resolved": "https://registry.npm.taobao.org/@tbmp/mp-cloud-sdk/download/@tbmp/mp-cloud-sdk-1.4.2.tgz",
"integrity": "sha1-/49BtdDaNJ6H9+f9DDBMPgt/BbQ="
}
"name": "threeSquirrel",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@tbmp/mp-cloud-sdk": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@tbmp/mp-cloud-sdk/-/mp-cloud-sdk-1.4.1.tgz",
"integrity": "sha512-h3xz4q22WGgxlSe5kqkaHK3C1fjWVlXHRQWKbIiecRJQPPoa5jok0LAkZlsLxvfa24ub4Pi34+a8Xjja2hlFTw=="
},
"fyge-tbmini": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/fyge-tbmini/-/fyge-tbmini-1.2.8.tgz",
"integrity": "sha512-Gf/RRC7qNZ0fMkb1xL9Rl+y8isK1noGoDrm2UVdAQsxCa+Mn8o7CMHaf+AkNvJcitsh0kgXqI/bQVioSF3PQIg=="
},
"svga-parser": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/svga-parser/-/svga-parser-1.1.0.tgz",
"integrity": "sha512-OjjtzPGC1ZdCWSWvldhXcB0CAz4ZOeoWEp0P9l4Lz7UtLM9f+DAYAYXKCXBWnRZvJevgkY/gniO/Bt89X0cKKw=="
}
}
}
{
"name": "",
"name": "threeSquirrel",
"version": "1.0.0",
"main": "",
"license": "MIT",
"dependencies": {
"@tbmp/mp-cloud-sdk": "*",
"fyge-tbmini": "^1.3.7"
"fyge-tbmini": "^1.2.8",
"svga-parser": "^1.1.0"
}
}
.goods-page-container {
width: 100%;
min-height: 100vh;
background: url('//yun.duiba.com.cn/taobaomini/aupresViva/page_bg.png') no-repeat;
background-size: 100% 1624rpx;
overflow: hidden;
}
.goods-page-container__title {
width: 750rpx;
height: 103rpx;
background: url('//yun.duiba.com.cn/taobaomini/aupresViva/goods_bg.png') no-repeat;
background-size: 100% 100%;
display: table-cell;
text-align: center;
vertical-align: middle;
}
.goods-page-container__title text {
display: inline-block;
font-size:40rpx;
font-family:SourceHanSansSC;
font-weight:400;
color:rgba(92,89,177,1);
}
.goods-page-container-scroll {
width: 100%;
height: 90vh;
}
.goods-page-container__content {
width: 100%;
padding: 0 32rpx;
display: flex;
flex-wrap: wrap;
}
.goods-page-container__content-item {
width:326rpx;
height:410rpx;
background: #F7F5FF;
border-radius:14rpx 13rpx 14rpx 14rpx;
margin-bottom: 37rpx;
}
.goods-page-container__content-item:nth-child(even) {
margin-left: 16rpx;
}
.goods-page-container__content-item__img {
width:326rpx;
height: 281rpx;
}
.goods-page-container__content-item__img image {
width: 100%;
height: 100%;
}
.goods-page-container__content-item__desc {
width: 100%;
height: 129rpx;
background:rgba(243,240,255,1);
padding: 20rpx 0 0 20rpx;
}
.goods-page-container__content-item__desc-name {
width: 100%;
font-size:24rpx;
font-family:SourceHanSansSC;
font-weight:300;
color:rgba(107,107,107,1);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.goods-page-container__content-item__desc-prize {
margin-top: 22rpx;
font-size:36rpx;
font-family:SourceHanSansSC;
font-weight:bold;
color:rgba(239,82,95,1);
}
\ No newline at end of file
<view class="goods-page-container">
<view class="goods-page-container__title"><text>购买商品得游戏次数</text></view>
<scroll-view scroll-y="{{true}}" class="goods-page-container-scroll">
<view class="goods-page-container__content">
<view class="goods-page-container__content-item" a:for="{{goodsList}}" data-item="{{item}}" onTap="goToBuy">
<view class="goods-page-container__content-item__img">
<image mode="scaleToFill" src="{{item.image}}"/>
</view>
<view class="goods-page-container__content-item__desc">
<view class="goods-page-container__content-item__desc-name">{{item.name}}</view>
<view class="goods-page-container__content-item__desc-prize">{{'¥'+item.price || 0.00}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
import {
commonToast,
openDetail,
navigateToOutside,
navigateTo, } from '../../utils/utils';
import API from '../../api'
const app = getApp();
Page({
data: {
goodsList: []
},
onLoad() {
this.initPage()
},
async initPage() {
let { activityId } = app
let { success, data } = await API.getGoodsList({ activityId }).catch(res => {
res && commonToast(res)
}) || {}
if(success) {
this.setData({ goodsList: data })
}
},
/**跳转购买商品页 */
async goToBuy(e) {
let { item: { id, url } } = e.target.dataset
let { success } = await openDetail(id+'')
}
});
{
"window": {
"defaultTitle": "商品详情"
}
}
\ No newline at end of file
.help-page-container {
width: 100%;
min-height: 100vh;
background: url('//yun.duiba.com.cn/taobaomini/aupresViva/help_bg.png') no-repeat;
background-size: 100% 1624rpx;
overflow: hidden;
}
.help-page-blank{
position: absolute;
width: 100%;
height: 100vh;
overflow: hidden;
}
.help-page-content {
position: absolute;
top: -208rpx;
left: 0;
right: 0;
bottom: -208rpx;
width: 100%;
background: url('//yun.duiba.com.cn/taobaomini/aupresViva/help_content_bg.png') no-repeat;
background-size: 100% 1664rpx;
}
.help-page-content__card {
width: 672rpx;
height: 580rpx;
background: url('//yun.duiba.com.cn/taobaomini/aupresViva/card_bg_05.png') no-repeat;
background-size: 100% 100%;
position: absolute;
left: 50%;
margin-left: -336rpx;
top: 632rpx;
display: flex;
justify-content: flex-start;
flex-direction: column;
align-items: center;
}
.help-page-content__card-title {
height: 40rpx;
width: 100%;
text-align: center;
font-size:40rpx;
font-family:SourceHanSansSC;
font-weight:400;
color:rgba(92,89,177,1);
margin: 74rpx auto 48rpx;
}
.help-page-content__card-content {
width:455rpx;
height:76rpx;
font-size:30rpx;
margin: 0 auto;
font-family:SourceHanSansSC;
font-weight:300;
line-height: 48rpx;
color:rgba(92,89,177,1);
text-align: center;
}
.help-page-content__card-btn {
width: 100%;
position: absolute;
bottom: 72rpx;
left: 0;
}
.help-page-content__card-btn-succes,.help-page-content__card-btn-fails {
display: flex;
justify-content: center;
align-content: center;
}
.help-page-content__card-btn-left,.help-page-content__card-btn-right,.help-page-content__card-btn-box {
width:251rpx;
height:79rpx;
background:#C386FF;
border-radius:40rpx;
border: 3rpx solid #ffffff;
display: flex;
justify-content: center;
align-content: center;
font-size:30rpx;
font-family:SourceHanSansSC;
font-weight:300;
color:rgba(255,255,255,1);
text-shadow:0px 3px 8px rgba(245,154,71,0.67);
line-height: 73rpx;
}
.help-page-content__card-btn-right {
background: #F3A867;
margin-left: 37rpx;
}
.help-page-content__card-btn-box {
width: 436rpx;
background: #F3A867;
}
\ No newline at end of file
<view class="help-page-container">
<view class="help-page-blank">
<view class="help-page-content">
<view class="help-page-content__card">
<view class="help-page-content__card-title">{{isMember?'助力成功!':''}}</view>
<view class="help-page-content__card-content">{{isMember?'精美小样已收入~':'你的集美为你准备了一份精美小样,领取就可助力成功哦~'}}</view>
<view class="help-page-content__card-btn">
<view a:if="{{isMember}}" class="help-page-content__card-btn-succes">
<view class="help-page-content__card-btn-left" onTap="getMyPrize">查看奖励</view>
<view class="help-page-content__card-btn-right" onTap="goToIndex">我也要赢大奖</view>
</view>
<view a:if="{{!isMember}}" class="help-page-content__card-btn-fails">
<view class="help-page-content__card-btn-box" onTap="getSmallKid">领取助力小样</view>
</view>
</view>
</view>
</view>
</view>
<!-- 获取小样 -->
<small-kid-modal a:if="{{isSmallKid}}" onGoToBuy="onGoToBuy" onGoToPay="onGoToPay" onCloseModal="onCloseModal" />
</view>
\ No newline at end of file
import {
commonToast,
navigateToOutside,
navigateTo,
openDetail,
getAuthUserInfo } from '../../utils/utils';
import API from '../../api'
const app = getApp();
Page({
inviteId: '',
isStock: false,
data: {
isInvite: false,
isSmallKid: false,
isMember: false,
inviteId: '',
objText: {}
},
async onLoad(query) {
let { inviteId } = query
if(inviteId) this.inviteId = inviteId;
await this.login()
await this.canAssistHandle()
},
onShow() {
if(this.isInvite) {
this.initPage()
}
if(this.isStock) {
this.getSamplePop()
}
},
//登陆
async login() {
const { activityId } = app
const userInfo = await getAuthUserInfo().catch(() => {
commonToast('未授权成功');
})
if (!userInfo) return
const { nickName, avatar } = userInfo
let result = await API.login({ activityId, userNick: nickName, avatar, inviteId: this.inviteId })
},
//是否可助力
async canAssistHandle() {
let { activityId } = app
let { success, data, message } = await API.canAssist({ activityId, inviteId: this.inviteId }).catch(res => {
my.showToast({
content: res.message,
success: () => {
navigateTo(`/pages/index/index?inviteId=${this.inviteId}`)
}
});
}) || {}
if(success) {
let { isvip, url } = data || {}
this.setData({ isMember: isvip || false, url })
if(isvip) {
this.initPage()
}
}
},
//小样奖品弹框提示
async getSamplePop() {
let { activityId } = app
let { success, data } = await API.samplePop({ activityId }).catch(res => {
}) || {}
if(success) {
let { sampleStatus} = data
if(sampleStatus == 2 || sampleStatus == 3) {
this.isStock = false
navigateTo(`/pages/index/index?page=help`)
}
}
},
async initPage() {
let { activityId } = app
let { success, data } = await API.assist({ activityId, inviteId: this.inviteId }).catch(res => {
}) || {}
if(success) {
this.setData({ isMember: true })
}
let objText = {
0: {
titile: '',
content: '你的集美为你准备了一份精美小样领取就可助力成功哦~',
leftText: '',
rightText: '领取助力小样',
},
1: {
titile: '助力成功!',
content: '精美小样已收入~',
leftText: '查看奖励',
rightText: '我也要赢大奖',
},
2: {
titile: '',
content: '你的集美为你准备了一份精美小样领取就可助力成功哦~',
leftText: '',
rightText: '领取助力小样',
}
}
},
//查看奖励
getMyPrize() {
this.setData({ isSmallKid: true })
this.addDataUv(1010)
},
onCloseModal() {
this.setData({ isSmallKid: false })
},
//我也要赢大奖
goToIndex() {
this.addDataUv(1011)
navigateTo(`/pages/index/index?inviteId=${this.inviteId}`)
},
//会员判断
async getSmallKid() {
this.isInvite = true
my.showToast({
content: '加入会员才能完成助力哦~',
success: () => {
navigateToOutside(this.data.url)
}
});
this.addDataUv(1008)
},
//去下单
onGoToBuy() {
this.setData({ isSmallKid: false })
this.isStock = true
navigateTo('/pages/goodsPage/goodsPage')
this.addDataUv(1012)
},
//支付邮票
async onGoToPay() {
let { activityId, smallKidItemId } = app
let { success, data } = await API.postageMark({ activityId, itemId:smallKidItemId }) || {}
if(success) {
this.isStock = true
this.setData({ isSmallKid: false })
let result = await openDetail(smallKidItemId)
}
this.addDataUv(1013)
},
//数据埋点
async addDataUv(type) {
let { activityId } = app
await API.addDataUv({ activityId, type })
}
});
{
"usingComponents": {
"small-kid-modal": "/components/smallKidModal/smallKidModal"
}
}
\ No newline at end of file
<view disable-scroll="true" class="page-game">
<canvas disable-scroll="true" id="canvas" type="2d" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas>
</view>
\ No newline at end of file
This diff is collapsed.
{
}
\ No newline at end of file
This diff is collapsed.
.my-prize-container {
width: 100%;
min-height: 100vh;
background: url('//yun.duiba.com.cn/taobaomini/aupresViva/page_bg.png') no-repeat;
background-size: 100% 1624rpx;
overflow: hidden;
padding-top: 40rpx;
}
.my-prize-container__title {
width: 750rpx;
height: 68rpx;
background: url('//yun.duiba.com.cn/taobaomini/aupresViva/titile_bg.png') no-repeat;
background-size: 100% 100%;
display: table-cell;
text-align: center;
vertical-align: middle;
}
.my-prize-container__title text {
display: inline-block;
font-size:40rpx;
font-family:SourceHanSansSC;
font-weight:400;
color:rgba(92,89,177,1);
}
.my-prize-container-scroll {
margin-top: 30rpx;
width: 100%;
height: 90vh;
}
.my-prize-container__content {
width: 100%;
padding: 0 25rpx;
}
.my-prize-container__content-item {
width:100%;
height:160rpx;
background:rgba(255,255,255,1);
border-radius:10px;
margin-bottom: 24rpx;
padding: 20rpx 27rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.my-prize-container__content-item-left {
display: flex;
max-width: 470rpx;
}
.my-prize-container__content-item__img {
width:120rpx;
height:120rpx;
background:rgba(244,244,244,1);
}
.my-prize-container__content-item__img image {
width: 100%;
height: 100%;
}
.my-prize-container__content-item__desc {
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
}
.my-prize-container__content-item__name {
font-size:28rpx;
font-family:SourceHanSansSC;
font-weight:400;
color:rgba(51,51,51,1);
margin-bottom: 15rpx;
}
.my-prize-container__content-item__code {
font-size:18rpx;
font-family:SourceHanSansSC;
font-weight:300;
color:rgba(51,51,51,1);
}
.my-prize-container__content-item__time {
font-size:18rpx;
font-family:SourceHanSansSC;
font-weight:300;
color:rgba(51,51,51,1);
margin-top: 5rpx;
width: 310rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.my-prize-container__content-item__btn {
width:150rpx;
height:40rpx;
background:linear-gradient(90deg,rgba(255,101,174,1) 0%,rgba(255,152,208,1) 100%);
border-radius:20rpx;
display: flex;
justify-content: center;
align-items: center;
}
.myprize-btn-status-disabled {
width:150rpx;
height:40rpx;
background:#E9E9E9;
border-radius:20rpx;
display: flex;
justify-content: center;
align-items: center;
}
.my-prize-container__content-item__btn text{
font-size:24rpx;
font-family:SourceHanSansSC;
font-weight:400;
color:rgba(255,255,255,1);
}
\ No newline at end of file
<view class="my-prize-container">
<view class="my-prize-container__title"><text>我的奖品</text></view>
<scroll-view scroll-y="{{true}}" class="my-prize-container-scroll">
<view class="my-prize-container__content">
<view class="my-prize-container__content-item" a:for="{{myPrizeList}}">
<view class="my-prize-container__content-item-left">
<view class="my-prize-container__content-item__img">
<image mode="scaleToFill" src="{{item.image}}"/>
</view>
<view class="my-prize-container__content-item__desc">
<view class="my-prize-container__content-item__name">{{item.name}}</view>
<view class="my-prize-container__content-item__code" a:if="{{item.endPrizeDesc}}">{{item.endPrizeDesc}}</view>
<view class="my-prize-container__content-item__time" a:if="{{item.remark}}">{{item.remark}}</view>
</view>
</view>
<view class="my-prize-container__content-item__btn {{item.btnDisabled}}" data-item="{{item}}" onTap="prizeHandle"><text>{{item.btnText}}</text></view>
</view>
</view>
</scroll-view>
<!-- 物流信息 -->
<logistic-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" />
<!-- 领取小样 -->
<small-kid-modal a:if="{{isSmallKid}}" onCloseModal="closeSmallModal" onGoToBuy="onGoToBuy" onGoToPay="onGoToPay" />
<!-- 获得小样 -->
<get-small-modal a:if="{{isGetSmallModal}}" onCloseModal="closeGetSmallModal" />
</view>
\ No newline at end of file
import {
getSystemInfo,
versionCompare,
commonToast,
dateFormatter,
getServerTime,
navigateToOutside,
navigateTo,
openDetail,
getUserAddress } from '../../utils/utils';
import { DRAW_STATUS_MAP } from '../../constants'
import API from '../../api'
const app = getApp();
Page({
data: {
isGetSmall: false,
myPrizeList: [],
isLogistic: false,
isSmallKid: false,
isGetSmallModal: false
},
onLoad() {
this.initPage()
},
onShow() {
if(this.isGetSmall) {
this.getSamplePop()
}
},
//小样奖品弹框提示
async getSamplePop() {
let { activityId } = app
let { success, data } = await API.samplePop({ activityId }).catch(res => {
}) || {}
if(success) {
let { sampleStatus} = data
if(sampleStatus == 2 || sampleStatus == 3) {
this.setData({ isGetSmallModal: true })
this.initPage()
this.isGetSmall = false
}
}
},
//关闭获得小样弹窗
closeGetSmallModal() {
this.setData({ isGetSmallModal: false })
},
//初始化页面数据
async initPage() {
let { activityId } = app
let { success, data: { endPrizeTime, list } } = await API.getMyPrizeList({ activityId }).catch( res => {
res && commonToast(res)
}) || {}
if(success) {
let nowTime = await getServerTime()
let myPrizeList = list && list.map(el => {
el.btnText = DRAW_STATUS_MAP[el.drawStatus].btnText
if(el.drawStatus == 1 && (el.type == 3 || el.type == 6)) {
el.btnText = '填写地址'
}
if(el.drawStatus == 3 && el.type == 3) {
el.btnText = '查看物流'
}
if(el.type !== 3) {
el.btnText = DRAW_STATUS_MAP[el.drawStatus].btnText
if(el.type == 6 && el.drawStatus == 0) {
el.btnText = '领取奖品'
}
if(el.type == 6 && el.drawStatus == 1) {
el.btnText = '填写地址'
}
if(el.type == 6 && el.drawStatus == 3) {
el.btnText = '查看物流'
}
}
if((el.drawStatus == 1 || el.drawStatus == 5) && nowTime > endPrizeTime) {
el.endPrizeDesc = '奖品已过期'
}
else {
el.endPrizeDesc = el.drawStatus == 1 ? `请于${dateFormatter(endPrizeTime,'yyyy-MM-dd hh:mm:ss')}前领取`:''
}
el.btnDisabled = DRAW_STATUS_MAP[el.drawStatus].btnDisabled
if(el.drawStatus == 3) {
if(el.type == 1) {
el.btnDisabled = 'myprize-btn-status-disabled'
}
}
el.remark = el.remark ? el.remark : ''
return el
})
console.warn(myPrizeList)
this.setData({
myPrizeList,
endPrizeTime
})
}
},
/**
* 关闭物流弹窗
*/
closeLogisticModal() {
this.setData({ isLogistic: false })
},
//奖品操作
async prizeHandle(e) {
let { item } = e.target.dataset
let { type,drawStatus } = item
this.setData({ currentPrize:item })
switch(drawStatus) {
case 0: this.setData({ isSmallKid:true });break;
case 6:
case 1: this.receivePrize(item);break;
case 3: this.handleStatus(type);break;
case 7: commonToast('请前往淘宝查看');break;
}
},
//已领取奖品操作
handleStatus(type) {
switch(type) {
case 6:
case 3: this.setData({ isLogistic: true });break;
case 1: this.couponsHandle();
}
},
//使用优惠券
couponsHandle() {
//navigateToOutside()
},
/**
* 奖品领取
*/
async receivePrize() {
const { activityId } = app;
const { type, _id } = this.data.currentPrize;
switch(+type) {
// 实物
case 6:
case 3:
const isValid = await this.checkSystem()
if (!isValid) {
commonToast('请升级淘宝版本');
return;
}
const userAddress = await getUserAddress().catch(res => {
commonToast(res && res.errorMessage);
});
if (userAddress) {
const { name, phone, address } = userAddress.duibaAddress;
this.setData({ userAddress })
my.confirm({
title: '温馨提示',
content: `确认使用该地址:${name},${phone},${address}`,
confirmButtonText: '确认',
cancelButtonText: '取消',
success: (result) => {
this.receiveObject()
},
});
}
break;
// 优惠券
case 1:
const {success} = await API.receivePrize({_id, activityId}).catch(res => {
commonToast(res && res.message);
this.initPage()
}) || {};
if (success) {
commonToast('奖品领取成功,已发放至我的卡包');
this.initPage()
}
break;
default:
break;
}
},
// TODO: 确认天猫是否也是9.3.0以下有问题
async checkSystem() {
const { version, app } = await getSystemInfo();
return versionCompare(version, '9.3.0');
},
async receiveObject() {
const { activityId } = app;
const { _id } = this.data.currentPrize;
const { name, phone, address } = this.data.userAddress.duibaAddress;
let { provinceName, cityName, countyName, cityCode, streetName } = this.data.userAddress
const {success} = await API.receiveObjectPrize({name, phone, detailInfo:address, cityCode, provinceName, cityName, countyName, streetName, _id, activityId}).catch(res => {
commonToast(res && res.message);
this.initPage()
}) || {};
if (success) {
commonToast('领取成功');
this.initPage();
}
},
/**关闭小样弹窗 */
closeSmallModal() {
this.setData({ isSmallKid:false })
},
//去下单
onGoToBuy() {
this.isGetSmall = true
this.setData({ isSmallKid:false })
navigateTo('/pages/goodsPage/goodsPage')
this.addDataUv(1012)
},
//支付邮票
async onGoToPay() {
let { activityId, smallKidItemId } = app
let { success, data } = await API.postageMark({ activityId, itemId:smallKidItemId })
if(success) {
this.isGetSmall = true
this.setData({ isSmallKid:false })
let result = await openDetail(smallKidItemId)
}
this.addDataUv(1013)
},
//数据埋点
async addDataUv(type) {
let { activityId } = app
await API.addDataUv({ activityId, type })
}
});
{
"usingComponents": {
"logistic-modal": "/components/logisticsModal/logisticsModal",
"small-kid-modal": "/components/smallKidModal/smallKidModal",
"get-small-modal": "/components/getSmallModal/getSmallModal"
}
}
\ No newline at end of file
This diff is collapsed.
<view disable-scroll="true" class="page-game">
<canvas disable-scroll="true" id="canvas" type="2d" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas>
</view>
\ No newline at end of file
'use strict';
import { Main } from './output';
//import API from '../../api';
Page({
data: {},
onLoad(props) {
this.setData(this.data || {});
},
onReady() {
console.log('on ready')
// let main = this.spark_startEngine(); //main.addEventListener....
},
spark_startEngine() {
console.log('spark_startEngine')
var self = this;
my.createCanvas({
id: 'canvas',
success: ccc => {
const dpr = my.getSystemInfoSync().pixelRatio;
const windowWidth = my.getSystemInfoSync().windowWidth;
const windowHeight = my.getSystemInfoSync().windowHeight;
ccc.width = windowWidth * dpr + dpr; //重新修改会有误差
ccc.height = windowHeight * dpr + dpr;
if (!this.main) {
this.main = new Main(ccc); //添加事件,为了和main里的通信
this.main.addGlobalEvent("onMessage", self.onMessage, self);
}
}
});
},
onCanvasReady() {
console.log('onCanvasReady')
this.spark_startEngine();
},
postMessage(netName, data) {
this.main.dispatchGlobalEvent({
type: netName
}, data); //以防复用事件event串了,就用这种方式
},
//和main通信的方法,接收main的信息
onMessage(e) {
//接口名字
let netName = e.data.netName; //接口参数
let parameter = e.data.parameter; //暂时发现3个需要用户操作的接口
//定制的授权
if (netName.indexOf("mine") == 0) {
var data = {
success: true
};
switch (netName) {
case "mine.getAppData":
//获取信息
let tmpApp = getApp();
console.log('app信息', tmpApp);
data = {
success: true,
data: {
activityId: tmpApp.activityId,
//|| "5e7c40e98564b57d7fb95812",
nickName: tmpApp.nickName,
avatar: tmpApp.avatar,
openId: tmpApp.openId,
isFocusShop: tmpApp.isFollow || false
}
};
break;
case 'test':
console.log('测试一下', parameter.hint);
break;
}
this.postMessage(netName, data);
} else {
var app = getApp(); //获取后端接口
const {
function: fc
} = app.cloud;
const [myCloudName, handler] = netName.split("."); //待写,
fc.invoke(myCloudName, parameter, handler).then(res => {
this.postMessage(netName, res);
});
}
},
//鼠标事件
onMouseEvent(e) {
if (this.main) this.main.stage.onMouseEvent(e);
},
onShow() {
// 页面显示
if (this.main) {
this.main.run();
this.main.dispatchGlobalEvent("onShow");
}
},
onHide() {
// 页面隐藏
if (this.main) {
this.main.pause();
this.main.dispatchGlobalEvent("onHide");
}
}
});
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
.mycanvaspage {
top: 0rpx;
left: 0rpx;
width: 750rpx;
height: 1624rpx;
display: block;
position: absolute;
}
.mycanvaspage .canvas {
width: 300rpx;
height: 300rpx;
opacity: 1;
display: block;
left: 0rpx;
top: 0rpx;
position: absolute;
}
<view class="mycanvaspage">
<view>
<canvas id="canvas" type="2d" class="canvas" disable-scroll="true" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady"></canvas>
</view>
</view>
\ No newline at end of file
'use strict';
import resList from '../../resconfig/resList'; //import API from '../../api';
Page({
data: {},
onLoad(props) {
this.setData(this.data || {
resList: resList
});
}
});
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
/**
* 目前没有用到
* @param {*} resList
* @param {*} uuid
*/
const getSrcByUuid = (resList, uuid) => {
resList = resList || [];
for (let i = 0; i < resList.length; i++) {
if (resList[i].uuid == uuid) {
return resList[i].url
}
}
}
module.exports = {
getSrcByUuid
}
\ No newline at end of file
const resList = {
'4ee17a9c-5deb-43be-b205-16fb7593d172': {
name: 'spark',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/spark.810e94665ad6f7d7684f9b25b764e040a0cce7bf.png',
uuid: '4ee17a9c-5deb-43be-b205-16fb7593d172'
}
};
export default resList;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tb = require("./lib/tb");
const tbMock = require("./lib/tbMock");
const utils = require("./lib/utils");
const constants = require("./lib/constants");
const capi_1 = require("./lib/capi");
const request_1 = require("./lib/request");
const isH5 = 'undefined' !== typeof window;
// 如果为h5环境走mock数据
let _tb = {};
Object.entries(tb).forEach(([key, value]) => {
_tb[key] = isH5 ? tbMock[key] : value;
});
exports.default = {
capi: capi_1.default,
tb: _tb,
utils,
request: request_1.default,
constants
};
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/packages/jsx2taobao/template/api/tbcc-sdk/index.js"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,uCAAuC;AACvC,qCAAqC;AACrC,6CAA6C;AAC7C,qCAA8B;AAC9B,2CAAoC;AAEpC,MAAM,IAAI,GAAG,WAAW,KAAK,OAAO,MAAM,CAAC;AAE3C,iBAAiB;AACjB,IAAI,GAAG,GAAG,EAAE,CAAC;AACb,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;IAC1C,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACxC,CAAC,CAAC,CAAC;AAEH,kBAAe;IACb,IAAI,EAAJ,cAAI;IACJ,EAAE,EAAE,GAAG;IACP,KAAK;IACL,OAAO,EAAP,iBAAO;IACP,SAAS;CACV,CAAC"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const capi = {
getMyPrizeList: {
handle: 'getMyPrizeList',
isShowLoading: true
},
receiveObjectPrize: 'receiveObjectPrize',
receiveEnamePrize: 'receiveEnamePrize'
};
exports.default = capi;
//# sourceMappingURL=capi.js.map
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment