Commit 9067d195 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 76132b49
......@@ -12,6 +12,66 @@ const request = tbccRequest({
// api handle 列表
const apiList = {
...capi,
pickShoes: {
handle: 'pickShoes',
method:'post',
isShowLoading: false
},
takeFirstPrize: {
handle: 'takeFirstPrize',
method:'post',
isShowLoading: false
},
takeRankPrize: {
handle: 'takeRankPrize',
method:'post',
isShowLoading: false
},
doCardDraw: {
handle: 'doCardDraw',
method:'post',
isShowLoading: false
},
takeCollectedPrize: {
handle: 'takeCollectedPrize',
method:'post',
isShowLoading: false
},
getUserCardInfo: {
handle: 'getUserCardInfo',
method:'post',
isShowLoading: false
},
getDrawTimes: {
handle: 'getDrawTimes',
method:'post',
isShowLoading: false
},
getChartList: {
handle: 'getChartList',
method:'post',
isShowLoading: false
},
takeInvitePrize: {
handle: 'takeInvitePrize',
method:'post',
isShowLoading: false
},
login: {
handle: 'login',
method:'post',
isShowLoading: false
},
getActivityBaseInfoById: {
handle: 'getActivityBaseInfoById',
method:'get',
isShowLoading: false
},
getMyPrizeList: {
handle: 'getMyPrizeList',
method:'get',
isShowLoading: false
},
receiveObjectPrize: {
handle: 'receiveObjectPrize',
method:'get',
......@@ -22,24 +82,24 @@ const apiList = {
method:'get',
isShowLoading: false
},
getMyPrizeList: {
handle: 'getMyPrizeList',
doHelp: {
handle: 'doHelp',
method:'get',
isShowLoading: false
},
getActivityBaseInfoById: {
handle: 'getActivityBaseInfoById',
getVipInfo: {
handle: 'getVipInfo',
method:'get',
isShowLoading: false
},
getUserInfo: {
handle: 'getUserInfo',
method:'get',
getInviteAwardsList: {
handle: 'getInviteAwardsList',
method:'post',
isShowLoading: false
},
login: {
handle: 'login',
method:'get',
getPickShoesList: {
handle: 'getPickShoesList',
method:'post',
isShowLoading: false
}
};
......
......@@ -7,7 +7,7 @@ cloud.init({
App({
requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'yapi', // yapi,cloud: 云函数
requestType: 'local', // yapi,cloud: 云函数
cloudName: 'tmallCat', // 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud,
......
{
"pages": [
"pages/index/index",
"pages/pageshop/pageshop",
"pages/myprize/myprize"
"pages/pageji_sui_pian_ye1/pageji_sui_pian_ye1",
"pages/pagepai_xingitem/pagepai_xingitem",
"pages/pagepin_tu_xian_shi/pagepin_tu_xian_shi",
"pages/pageshou_ye_xuan_zhong/pageshou_ye_xuan_zhong",
"pages/pagexiao_xie_zi/pagexiao_xie_zi"
],
"window": {
"enableSkia": "true",
"allowsBounceVertical": "NO"
}
"window": {}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
今日免费次数已用完 再召唤x位好友就能获得xxx
</label>
</view>
<image class="an_niu_guan_bi_dan_chuang209" src={{resList['a112b3c0-8002-48f5-aa63-8b8d50baa359'].url}} />
<image class="an_niu_guan_bi_dan_chuang209" src={{resList['a112b3c0-8002-48f5-aa63-8b8d50baa359'].url}} onTap="onModalClose" />
<image class="an_niu208" src={{resList['b3e41ca9-d486-47ca-8ed6-804d19e77aa8'].url}} />
</view>
</view>
......
......@@ -3,13 +3,20 @@
import resList from '../../resconfig/resList';
Component({
props: {},
data: {},
methods: {},
data: {
resList: resList
},
methods: {
onModalClose(){
const { onModalClose } = this.props;
onModalClose && onModalClose();
}
},
onInit(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
},
});
\ No newline at end of file
......@@ -7,7 +7,7 @@ Component({
methods: {},
onInit(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
......@@ -7,7 +7,7 @@ Component({
methods: {},
onInit(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
......@@ -7,7 +7,7 @@ Component({
methods: {},
onInit(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
......@@ -7,7 +7,7 @@ Component({
methods: {},
onInit(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
......@@ -3,11 +3,14 @@
import resList from '../../resconfig/resList';
Component({
props: {},
data: {},
data: {
ruleModalVisible:false,
},
methods: {},
onInit(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
const mock = {
getUserInfo:require('../../project/src/canvas/game/mock/miniTb/tmallCat.getUserInfo.json')
getUserInfo:require('./mocks/tmallCat.pickShoes.json'),
pickShoes:require('./mocks/tmallCat.pickShoes.json'),
}
export default mock;
{
"success": true,
"message":"",
"data": {
"cardType": 1,
"uncommon": false
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
"rule": "活动规则test233",
"startTime": 1601445959737,
"endTime": 1601455959737,
"awardReceiveExpiredTime":1601445959737,
"source1": 50,
"source2": "1",
"shoesList":{
"shoesType":1,
"shoesName":"山海"
}
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
"myData": {
"rank":3,
"userNick":"张三",
"count":13
},
"list": [
{
"rank":1,
"userNick":"张1",
"count":17
},
{
"rank":2,
"userNick":"张2",
"count":16
},
{
"rank":3,
"userNick":"张3",
"count":13
},
{
"rank":4,
"userNick":"张4",
"count":10
}
]
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
"drawTimes": 2
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"list": [
{
"type":1,
"status":1,
"rewards":3,
"times":5
},
{
"type":1,
"status":1,
"rewards":3,
"times":5
},
{
"type":1,
"status":1,
"rewards":3,
"times":5
},
{
"type":1,
"status":1,
"rewards":3,
"times":5
}
],
"inviteCount": 6
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
"list": []
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"list":[
{
"shoesType":1,
"count":1
},
{
"shoesType":2,
"count":1
},
{
"shoesType":3,
"count":1
},
{
"shoesType":4,
"count":1
},
{
"shoesType":5,
"count":1
}
]
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"shoesName": "山海",
"cardCountList": {
"1":1,
"2":1,
"3":1,
"4":1,
"5":1,
"6":1,
"7":1,
"8":1,
"9":0
},
"collectedCount": 100,
"canTakeRankPrize":false,
"shoesType": 1,
"inviteResult": {
"inviteCount":13,
"addDrawTimes":12
}
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
"catType": 2,
"userNick": "Edwise",
"energy": 100,
"happyCoin":1000,
"experience": 50,
"level": "1",
"avatar": "https://yun.duiba.com.cn/spark/assets/a3ae99684afa9a1f8d94f4c95ee6f1ed81de9996.png",
"sence": 3,
"catName": "喵喵喵"
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"isVip": true,
"url": ""
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"openId": "233"
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"drawStatus": 2,
"remark": "Edwise"
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"name": "山海",
"type": "test",
"image": ""
}
}
\ No newline at end of file
{
"success": true,
"message":"网络异常",
"data": {
"cardType": 2
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
"cardType": 2,
"uncommon": true,
"rewardType": 1,
"addDrawTimes":10
}
}
\ No newline at end of file
{
"success": true,
"message":"",
"data": {
"name": "奖品名称",
"type": 1,
"image": ""
}
}
\ No newline at end of file
......@@ -5,18 +5,18 @@
<image class="biao_ti372" src={{resList['a8f4ca0b-1d76-4102-9b09-db91e5433432'].url}} />
<image class="fu_biao_ti371" src={{resList['c7b16b65-2073-4990-a658-efcd93f7b396'].url}} />
</view>
<image class="gui_ze369" src={{resList['cc6b2cc6-4dbf-42f2-9572-778937b2e681'].url}} />
<image class="jiang_pin368" src={{resList['87b6a773-0837-452a-8c62-21f0b4c48c5e'].url}} />
<image class="gui_ze369" src={{resList['cc6b2cc6-4dbf-42f2-9572-778937b2e681'].url}} onTap="onshowRule" />
<image class="jiang_pin368" src={{resList['87b6a773-0837-452a-8c62-21f0b4c48c5e'].url}} onTap="changeScene" />
<image class="ren_qi_pai_ming367" src={{resList['6adbb53d-b804-4cba-8111-a6259a427427'].url}} />
<view class="pin_tu_shou_ye" />
<view class="tou_xiang">
<image class="tuo_yuan2" src={{resList['92692d66-bf25-4f1f-a7dc-0d3bf593f341'].url}} />
<image class="tu_ceng807" src={{resList['bf7dc60a-aca9-4da5-b98b-08e02f772376'].url}} />
<label class="x_ren_qi_wang358">X人气王</label>
<label class="ni_yi_shou_ji612_sui_pian">你已收集6/12碎片</label>
<label class="x_ren_qi_wang358">{{nickname}}</label>
<label class="ni_yi_shou_ji612_sui_pian">你已收集{{collectedCount}}/9碎片</label>
</view>
<image class="an_niu_li_ji_ji_sui_pian" src={{resList['30c5d013-608d-4765-b231-c1d435ee1f19'].url}} />
<image class="an_niu_dui_huan_xin_pin" src={{resList['c0e71c1a-8067-43f2-9113-a645a2bc39a7'].url}} />
<image class="an_niu_li_ji_ji_sui_pian" a:if="{{mainbtnV==1}}" src={{resList['30c5d013-608d-4765-b231-c1d435ee1f19'].url}} />
<image class="an_niu_dui_huan_xin_pin" a:if="{{mainbtnV!=1}}" src={{resList['c0e71c1a-8067-43f2-9113-a645a2bc39a7'].url}} onTap="getestapi" />
<label class="zai_zhao_huanxxh_hao_you_bi_de_xi_you_sui_pian">再召唤xxh好友必得稀有碎片</label>
<image class="sheng_yu_ci_shu" src={{resList['8f262c3b-86f1-4b1a-9e7e-8b844d5efbc9'].url}} />
<label class="label">3</label>
......@@ -44,10 +44,12 @@
<image class="jiang_li3_dai_ling_qu" src={{resList['6051efa0-3126-426e-a6af-42c6f69b0f61'].url}} />
<image class="jiang_li4_wei_jie_suo" src={{resList['555129ab-ec32-4ad5-a449-0046f119ec68'].url}} />
</view>
<image class="liang_xi_li_he" src={{resList['7fb3c7fb-a7f5-40dc-a162-531dfe5db559'].url}} />
<image class="ren_qi_chou_jiang" src={{resList['920fe1a1-ec52-4f1e-a210-ae8872b9cb0c'].url}} />
<image class="liang_xi_li_he" a:if="{{giftV==2}}" src={{resList['7fb3c7fb-a7f5-40dc-a162-531dfe5db559'].url}} />
<image class="ren_qi_chou_jiang" a:if="{{giftV==1}}" src={{resList['920fe1a1-ec52-4f1e-a210-ae8872b9cb0c'].url}} />
<image class="zhao_huan_hao_you" src={{resList['c4629d16-a5a5-412e-a741-7b5da6ced209'].url}} />
<image class="hui_yuan_zhuan_qu350" src={{resList['aaece988-6b4d-47fc-bdb5-279412a963fe'].url}} />
<image class="shuang11_hui_chang349" src={{resList['c74691ef-78ff-425c-94df-e62a72c9955b'].url}} />
</view>
</view>
\ No newline at end of file
</view>
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"></rule-modal>
\ No newline at end of file
'use strict';
const app = getApp();
const { tbcc } = app;
import resList from '../../resconfig/resList'; //import API from '../../api';
import API from '../../api';
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Page({
data: {},
data: {
ruleModalVisible: false,//规则弹窗
prizeVisible: false,//奖品
rankVisible: false,//排行榜
//活动基本信息
rule: "",
startTime: 0,
endTime: 0,
awardReceiveExpiredTime: 1,
source1: "",
source2: "",
shoesList: [],
//用户信息
selected:0,//0还未获得信息,1用户未选鞋,2用户已选鞋
mainbtnV: 1,//1收集碎片,2兑换新品
giftV: 1,//1新手礼包,2惊喜礼包,3锦鲤礼包
sharepro: 0,//累计召唤进度
nickname: "张三",
avatar: "//yun.duiba.com.cn/spark/assets/28092c7c919a2c8ea9b750fb79abd2416ba8f90f.png",
shoesName:"",
cardCountList:{},
collectedCount:0,
shoesType:0,
inviteResult:{},
},
onLoad(props) {
this.setData(this.data || {
// this.getAuth();
this.setData({
resList: resList
});
},
/**
* 获取用户授权信息
*/
async getAuth() {
const userInfo = await getAuthUserInfo().catch(err => {
console.log('未授权成功', err);
});
if (userInfo) {
console.log('userInfo', userInfo);
const { nickName, avatar } = userInfo;
app.nickName = nickName;
app.avatar = avatar;
this.login();
}
},
/**
* 登录接口
*/
async login() {
const { nickName, avatar } = app;
const { success } = await API.login({ userNick: nickName, avatar }).catch(res => {
commonToast(res && res.message);
}) || {};
if (success) {
this.init();
}
},
/**
* 登录完毕,请求其余数据
*/
async init() {
console.log("获取基本信息");
this.getactivityData();
},
/**
* 获取基本信息
*/
async getactivityData() {
const activityInfo = await API.getActivityBaseInfoById().catch(res => {
commonToast(res && res.message);
}) || {};
const { success, data } = activityInfo;
if (success) {
const { rule, startTime, endTime, awardReceiveExpiredTime, source1, source2, shoesList } = data;
this.setData({
rule: rule,
startTime: startTime,
endTime: endTime,
awardReceiveExpiredTime: awardReceiveExpiredTime,
source1: source1,
source2: source2,
shoesList: shoesList
})
}
},
/**
* 更新用户信息
*/
async getAuthUserInfo() {
const userinfo = await API.getUserCardInfo().catch(res => {
commonToast(res && res.message);
}) || {};
const { success, data } = userinfo;
if (success) {
const {shoesName,cardCountList,collectedCount,canTakeRankPrize,shoesType,inviteResult} = data;
let selected = 2;
if(!shoesName&&this.data.selected==0){//当前未选择鞋子
selected = 1;
}
this.setData({
selected:selected,
shoesName:shoesName,
cardCountList:cardCountList,
collectedCount:collectedCount,
canTakeRankPrize:canTakeRankPrize,
shoesType:shoesType,
inviteResult:inviteResult
});
} else {
if(this.data.selected==0){
this.setData({
selected:1
});
}
}
},
/**
* 新人礼
*/
checkOpenNgift(){
},
/**
* 进来新老会员区分
*/
async checkIsNew(){
const uvipinfo = await API.getVipInfo().catch(res=>{
commonToast(res && res.message);
})||{};
const {success,data} = uvipinfo;
if(success){
const {isVip,url} = data;
if(!isVip){//跳转到
}
}
},
onshowRule() {
this.setData({
ruleModalVisible: true
})
},
closeRuleModal() {
this.setData({
ruleModalVisible: false
})
},
changeScene() {
my.navigateTo({
url: '/pages/pageshou_ye_xuan_zhong/pageshou_ye_xuan_zhong'
});
},
async getestapi() {
const { success, data } = await API.doCardDraw().catch(res => {
commonToast(res && res.message);
}) || {};
if (success && data) {
console.log("api请求成功", data);
}
}
});
\ No newline at end of file
{
"usingComponents": {}
"usingComponents": {
"rule-modal": "/components/comci_shu_yong_wan/comci_shu_yong_wan"
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ Page({
data: {},
onLoad(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
......@@ -6,7 +6,7 @@ Page({
data: {},
onLoad(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
......@@ -13,6 +13,6 @@
<view class="xuan_xiescroll1" />
</view>
<view class="pin_tu_xuan_xie1" />
<image class="an_niu414" src={{resList['a996f17c-f61c-44ab-a337-0b96a1a8b5af'].url}} />
<image class="an_niu414" src={{resList['a996f17c-f61c-44ab-a337-0b96a1a8b5af'].url}} onTap="toshouye" />
</view>
</view>
\ No newline at end of file
......@@ -6,9 +6,11 @@ Page({
data: {},
onLoad(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
},
toshouye(){
my.navigateBack();
}
});
\ No newline at end of file
......@@ -6,7 +6,7 @@ Page({
data: {},
onLoad(props) {
this.setData(this.data || {
this.setData({
resList: resList
});
}
......
......@@ -53,7 +53,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const requestMock = () => {
const mockUrlPrefix = {
ams: 'https://ams.dui88.com/server/index.php?g=Web&c=Mock&o=simple&projectID=218&uri=',
yapi: 'https://docs.dui88.com/mock/140/'
local: 'http://localhost:3000/'
};
const mockUrl = null;
const requestPrefix = mockUrl || mockUrlPrefix[requestType];
......@@ -103,7 +103,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
// console.log('requestCloud', _cloudName, handle, params);
// return requestType === 'ams' ? requestAms() : requestCloud();
return (requestType === 'ams' || requestType === 'yapi') ? requestMock() : requestCloud();
return (requestType === 'ams' || requestType === 'local') ? requestMock() : requestCloud();
};
};
......
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