Commit 71c33687 authored by wildfirecode13's avatar wildfirecode13

1

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