Commit 71c33687 authored by wildfirecode13's avatar wildfirecode13

1

parent 25428d83
......@@ -6,8 +6,8 @@ cloud.init({
});
App({
// requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'yapi', // yapi,cloud: 云函数
requestType: 'cloud', // yapi,cloud: 云函数
// requestType: 'yapi', // yapi,cloud: 云函数
cloudName: 'floor', // 主云函数项目名 base clientTemplate2C
cloud,
tbcc,
......
......@@ -11,7 +11,7 @@
<!-- 复制按钮 -->
<!-- <image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" /> -->
<!-- </view> -->
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAPPRIZE_DRAW_STATUS_MAP.FAILURE}}">{{item.remark}}</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 === PRIZE_DRAW_STATUS_MAP.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE)}}">请于{{endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view>
</view>
......@@ -28,7 +28,8 @@
<!-- 实物查看物流 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" />
<!-- 优惠券去使用 -->
<image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" />
<image a:else data-item="{{item}}" src="{{task.image.gotBtn}}" />
<!-- <image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" /> -->
</block>
<!-- 重新领取 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.REPEAT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
......
......@@ -17,11 +17,12 @@ Page({
image: {
bg: '//yun.duiba.com.cn/aurora/assets/7283d715cc5c7d13a5f498d15f5f5b9f4d9c29e5.jpg', //背景图
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制
addressBth: '//yun.dui88.com/duiba-components-c-myprizeto_address.png', //填写地址(实物奖品)
addressBth: '//yun.duiba.com.cn/aurora/assets/82cc3c6d8861334ebaf128c98e3341b687bdc007.png', //填写地址(实物奖品)
getBth: '//yun.dui88.com/duiba-components-c-myprizeget_now.png', //立即领取(除实物奖品外)
logisticsBth: '//yun.dui88.com/duiba-components-c-myprizelogistics.png', //查看物流
useBth: '//yun.dui88.com/duiba-components-c-myprizeto_use.png', //去使用(除实物奖品外)
getAgainBtn: '//yun.dui88.com/duiba-components-c-myprizeget_again.png', //重新领取
useBtn: '//yun.duiba.com.cn/aurora/assets/0829f92f771c5e9fdb05a258a46b2d038d3a9997.png', //去使用(除实物奖品外)
gotBtn: '//yun.duiba.com.cn/aurora/assets/1120dd6b6ce4abe2666e877e3ae33eb99a778009.png', //已领取(优惠券)
getAgainBtn: '//yun.duiba.com.cn/aurora/assets/716f0a388144945b169554a30ff4a16f7bcb95ab.png', //重新领取
invalidBtn: '//yun.duiba.com.cn/spark/assets/914ba8643c8abb8d710a3126ec312aecf6c4daf0.png', //已失效
failBth: '//yun.duiba.com.cn/spark/assets/8267375232058a6d0140270b1594427fb08d6ae3.png', //领取失败
},
......@@ -44,14 +45,19 @@ Page({
getEndTime(prizeList = []) {
if (!prizeList || !prizeList.length) return null
const endTime = prizeList[0].expiredTime
if (!endTime) return null
const t1 = new Date(endTime).toLocaleDateString() + '';//获取年月日
if (!endTime) return null;
const yy = new Date(endTime).getFullYear();
const mm = new Date(endTime).getMonth() + 1;
const dd = new Date(endTime).getDate();
const t1 = `${yy}${mm}${dd}日`;
// console.log(new Date(endTime).toLocaleDateString())
// const t1 = new Date(endTime).toLocaleDateString() + '';//获取年月日
const t2 = new Date(endTime).getHours() + '';//获取时
const t3 = new Date(endTime).getMinutes() + '';//获取分
const t4 = new Date(endTime).getMilliseconds() + '';//获取秒
console.log(endTime, new Date(endTime + 48 * 60 * 60 * 1000).toLocaleString(), 'endTime');
this.setData({
endTime: t1 + " " + t2.padStart(2, '0') + ":" + t3.padStart(2, '0') + ":" + t4.padStart(2, '0')
endTime: t1 + "" + t2.padStart(2, '0') + ":" + t3.padStart(2, '0') + ":" + t4.padStart(2, '0')
})
},
......@@ -123,14 +129,19 @@ Page({
const userAddress = await getUserAddress({ joinTag: " " })
my.hideLoading();
if (!userAddress) return
// commonToast(' getUserAddress =>'+JSON.stringify( userAddress))
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
const params = {
activityId,
area:countyName,
addressdetail:detailInfo,
name,
phone: telNumber,
detailInfo,
cityCode,
cityName,
city:cityName,
province:provinceName,
provinceName,
countyName,
streetName,
......@@ -155,13 +166,20 @@ Page({
},
// 领取实物
async receiveObjectPrize(params) {
const { success, data, message } = await API.receiveObjectPrize(params) || {}
if (success && data) {
commonToast('领取成功')
} else {
commonToast(message)
}
this.getMyPrize()
// commonToast('正在调用receiveObjectPrize'+JSON.stringify(params))
API.receiveObjectPrize(params).then((res) => {
setTimeout(() => {
commonToast(JSON.stringify(res))
}, 5000);
const { success, data, message } = res;
if (success && data) {
commonToast('领取成功')
} else {
commonToast(message)
}
this.getMyPrize()
});
},
// 积分
async handleGetIntergation(e) {
......
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