Commit 0c78f968 authored by mqf_0707's avatar mqf_0707

浏览等页面更新接收数据返回参数

parent d51c4044
...@@ -6,7 +6,7 @@ cloud.init({ ...@@ -6,7 +6,7 @@ cloud.init({
}); });
App({ App({
requestType: 'tornadoAPI', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口 requestType: 'yapi', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName: 'CommonToC', // 主云函数项目名 cloudName: 'CommonToC', // 主云函数项目名
tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=xxx&proxyIp=xxx', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址 tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=xxx&proxyIp=xxx', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
cloud, cloud,
......
...@@ -11,31 +11,31 @@ ...@@ -11,31 +11,31 @@
<!-- 复制按钮 --> <!-- 复制按钮 -->
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" /> <image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" />
</view> </view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FAILURE}}">{{item.remark}}</view> <view class="my-prize-tip" a:if="{{item.drawStatus === DRAW_STATUS.FAIL}}">{{item.remark}}</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE)}}">请于{{endTime}}前领取</view> <view class="my-prize-tip" a:if="{{item.drawStatus === DRAW_STATUS.RETRY || (item.drawStatus === DRAW_STATUS.WAITAWARD)}}">请于{{endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view> <view class="my-prize-tip" a:if="{{item.drawStatus === DRAW_STATUS.EXPIRED }}">奖品已过期失效</view>
</view> </view>
<view class="prize-status" style="{{task.btnStyle}}"> <view class="prize-status" style="{{task.btnStyle}}">
<!-- 未领取 --> <!-- 未领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.RECEIVE}}"> <block a:if="{{item.drawStatus===DRAW_STATUS.WAITAWARD}}">
<!-- 实物填写地址 --> <!-- 实物填写地址 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" /> <image a:if="{{item.type === PRIZE_TYPE.OBJECT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" />
<!-- 优惠券立即领取 --> <!-- 优惠券立即领取 -->
<image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.getBth}}" /> <image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.getBth}}" />
</block> </block>
<!-- 已领取 --> <!-- 已领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.SUCCESS}}"> <block a:if="{{item.drawStatus===DRAW_STATUS.SUCCESS}}">
<!-- 实物查看物流 --> <!-- 实物查看物流 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" /> <image a:if="{{item.type === PRIZE_TYPE.OBJECT}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" />
<!-- 优惠券去使用 --> <!-- 优惠券去使用 -->
<image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" /> <image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" />
</block> </block>
<!-- 重新领取 --> <!-- 重新领取 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.REPEAT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" /> <image a:if="{{item.drawStatus===DRAW_STATUS.RETRY}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
<!-- 已失效 --> <!-- 已失效 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FINISHED}}" src="{{task.image.invalidBtn}}" /> <image a:if="{{item.drawStatus===DRAW_STATUS.EXPIRED}}" src="{{task.image.invalidBtn}}" />
<!-- 领取失败 --> <!-- 领取失败 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FAILURE}}" src="{{task.image.failBth}}" /> <image a:if="{{item.drawStatus===DRAW_STATUS.FAIL}}" src="{{task.image.failBth}}" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb; const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb;
const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants; const { PRIZE_TYPE, DRAW_STATUS } = tbcc.constants;
Component({ Component({
mixins: [], mixins: [],
data: { data: {
PRIZE_TYPE_MAP, PRIZE_TYPE,
PRIZE_DRAW_STATUS_MAP, DRAW_STATUS,
currentPrize: {}, currentPrize: {},
isLogistic: false, isLogistic: false,
}, },
......
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
"version": "1.3.4", "version": "1.3.4",
"resolved": "https://registry.npm.taobao.org/@tbmp/mp-cloud-sdk/download/@tbmp/mp-cloud-sdk-1.3.4.tgz", "resolved": "https://registry.npm.taobao.org/@tbmp/mp-cloud-sdk/download/@tbmp/mp-cloud-sdk-1.3.4.tgz",
"integrity": "sha1-+1HCYryYfVc0kze0SOWv1oL6xgk=" "integrity": "sha1-+1HCYryYfVc0kze0SOWv1oL6xgk="
},
"crypto": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/crypto/download/crypto-1.0.1.tgz",
"integrity": "sha1-KvG3ytgXXSTIobB3glV5SiGAMDc="
} }
} }
} }
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
onCompleteTask="onCompleteTask" /> onCompleteTask="onCompleteTask" />
<!-- 倒计时 --> <!-- 倒计时 -->
<count-down-modal a:if="{{isShowCountdown}}" percent="{{percent}}" hasPercent="{{(10 - usePercent)}}" styleType="{{'01'}}" /> <count-down-modal a:if="{{isShowCountdown && completeType == 1}}" percent="{{percent}}" hasPercent="{{(10 - usePercent)}}" styleType="{{'01'}}" />
</view> </view>
\ No newline at end of file
...@@ -14,15 +14,16 @@ ...@@ -14,15 +14,16 @@
* color: //商品名称:文字颜色 * color: //商品名称:文字颜色
* } * }
*/ */
import API from '../../api';
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast } = tbcc.tb; const { commonToast } = tbcc.tb;
import API from '../../api'; const completeType = 1 // 1 浏览完成 2 点击任意商品完成
Page({ Page({
completeType: '01',//01:浏览完成 02点击任意商品完成
timer: null, timer: null,
data: { data: {
completeType: completeType,
usePercent: 0, // 已进行的进度条 usePercent: 0, // 已进行的进度条
percent: 0,// 进度条 percent: 0,// 进度条
isShowCountdown: true, // 是否显示倒计时 isShowCountdown: true, // 是否显示倒计时
...@@ -36,7 +37,7 @@ Page({ ...@@ -36,7 +37,7 @@ Page({
}, },
onShow() { onShow() {
//重新回到页面开启倒计时 //重新回到页面开启倒计时
if(!this.timer && this.completeType == '01') { if(!this.timer && completeType == 1) {
this.setData({ usePercent: this.data.percent }) this.setData({ usePercent: this.data.percent })
this.browseGoodsTimes() this.browseGoodsTimes()
console.log(10 - this.usePercent) console.log(10 - this.usePercent)
...@@ -80,7 +81,7 @@ Page({ ...@@ -80,7 +81,7 @@ Page({
res && commonToast(res) res && commonToast(res)
}) || {} }) || {}
if(success) { if(success) {
this.setData({ goodsList: data || [] }) this.setData({ goodsList: data.list || [] })
} }
}, },
//任务完成 //任务完成
...@@ -97,7 +98,7 @@ Page({ ...@@ -97,7 +98,7 @@ Page({
* 跳转商品详情页 * 跳转商品详情页
*/ */
onOpenDetail(itemId = '') { onOpenDetail(itemId = '') {
if(this.completeType == '01') { if(completeType == 1) {
this.setData({ this.setData({
percent: this.data.usePercent, percent: this.data.usePercent,
}, () => { }, () => {
......
...@@ -57,7 +57,7 @@ Page({ ...@@ -57,7 +57,7 @@ Page({
res && commonToast(res) res && commonToast(res)
}) || {} }) || {}
if(success) { if(success) {
this.setData({ goodsList: data || [] }) this.setData({ goodsList: data.list || [] })
} }
}, },
//任务完成 616444374083 //任务完成 616444374083
......
...@@ -5,12 +5,12 @@ const app = getApp(); ...@@ -5,12 +5,12 @@ const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb; const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb;
const { dateFormatter, throttleHandle } = tbcc.utils; const { dateFormatter, throttleHandle } = tbcc.utils;
const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants; const { PRIZE_TYPE, DRAW_STATUS } = tbcc.constants;
Page({ Page({
data: { data: {
PRIZE_TYPE_MAP, PRIZE_TYPE,
PRIZE_DRAW_STATUS_MAP, DRAW_STATUS,
myPrizeList: null, //我的奖品 myPrizeList: null, //我的奖品
endTime: null,//到期时间 endTime: null,//到期时间
task: { task: {
...@@ -85,11 +85,11 @@ Page({ ...@@ -85,11 +85,11 @@ Page({
handleClick: throttleHandle(async function(e) { handleClick: throttleHandle(async function(e) {
const { item } = e.target.dataset; const { item } = e.target.dataset;
// 领取权益 // 领取权益
if (item.type === PRIZE_TYPE_MAP.EQUITY) return this.handleGetEquity(e) if (item.type === PRIZE_TYPE.ENAME) return this.handleGetEquity(e)
// 领取实物 // 领取实物
if (item.type === PRIZE_TYPE_MAP.ENTITY) return this.handleGetEntity(e) if (item.type === PRIZE_TYPE.OBJECT) return this.handleGetEntity(e)
// 领取积分 // 领取积分
if (item.type === PRIZE_TYPE_MAP.INTEGRATION) return this.handleGetIntergation(e) if (item.type === PRIZE_TYPE.CREDITS) return this.handleGetIntergation(e)
},1000), },1000),
// 优惠券 // 优惠券
async handleGetEquity(e) { async handleGetEquity(e) {
......
...@@ -58,7 +58,7 @@ Page({ ...@@ -58,7 +58,7 @@ Page({
res && commonToast(res) res && commonToast(res)
}) || {} }) || {}
if(success) { if(success) {
this.setData({ goodsList: data || [] }) this.setData({ goodsList: data.list || [] })
} }
}, },
}); });
...@@ -8,10 +8,10 @@ const capi = { ...@@ -8,10 +8,10 @@ const capi = {
receiveEnamePrize: { method: 'GET', handle: 'receiveEnamePrize' }, receiveEnamePrize: { method: 'GET', handle: 'receiveEnamePrize' },
getItemListByItemIds: { method: 'GET', handle: 'getItemListByItemIds' }, getItemListByItemIds: { method: 'GET', handle: 'getItemListByItemIds' },
getCollectGoodsList: { method: 'GET', handle: 'getCollectGoodsList' }, getCollectGoodsList: { method: 'GET', handle: 'getCollectGoodsList' },
doCollectGoodsTask: { method: 'GET', handle: 'doCompleteTask', dedaultParams: { taskType: 'collectGoods'} }, doCollectGoodsTask: { method: 'GET', handle: 'doCompleteTask', defaultParams: { taskType: 'collectGoods'} },
doBrowseGoodsTask: { method: 'GET', handle: 'doCompleteTask', dedaultParams: { taskType: 'browseGoods'} }, doBrowseGoodsTask: { method: 'GET', handle: 'doCompleteTask', defaultParams: { taskType: 'browseGoods'} },
doJumpLinkTask: { method: 'GET', handle: 'doCompleteTask', dedaultParams: { taskType: 'jumpLink'} }, doJumpLinkTask: { method: 'GET', handle: 'doCompleteTask', defaultParams: { taskType: 'jumpLink'} },
doExchangeCreditsTask: { method: 'GET', handle: 'doCompleteTask', dedaultParams: { taskType: 'exchangeCredits'} }, doExchangeCreditsTask: { method: 'GET', handle: 'doCompleteTask', defaultParams: { taskType: 'exchangeCredits'} },
getVipInfo: { method: 'GET', handle: 'getVipInfo' } getVipInfo: { method: 'GET', handle: 'getVipInfo' }
}; };
......
...@@ -35,20 +35,3 @@ export const PRIZE_TYPE = { ...@@ -35,20 +35,3 @@ export const PRIZE_TYPE = {
OBJECT: 3, OBJECT: 3,
THANKS: 5 THANKS: 5
}; };
// 我的奖品状态
export const PRIZE_DRAW_STATUS_MAP = {
RECEIVE: 1, // 待领取
DEALING: 2, // 处理中
SUCCESS: 3, // 领取成功
FAILURE: 4, // 领取失败
FINISHED: 5, // 已过期
REPEAT: 6, // 重新领取
}
// 奖品类型
export const PRIZE_TYPE_MAP = {
EQUITY: 1, // 权益
INTEGRATION: 2, // 积分
ENTITY: 3, // 实物
THANKS: 5 // 谢谢参与
}
\ No newline at end of file
...@@ -68,11 +68,11 @@ export const getRequestParams = value => { ...@@ -68,11 +68,11 @@ export const getRequestParams = value => {
ext: {} ext: {}
} }
} else if (typeof value === 'object') { } else if (typeof value === 'object') {
const { handle, method = 'POST', dedaultParams = {}, ...ext } = value; const { handle, method = 'POST', defaultParams = {}, ...ext } = value;
return { return {
handle, handle,
method, method,
dedaultParams, defaultParams,
ext: { ...ext } ext: { ...ext }
} }
} else { } else {
......
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