Commit b32a8b99 authored by wildfirecode13's avatar wildfirecode13

1

parent 9572f489
......@@ -9,7 +9,7 @@ cloud.init({
App({
env,
requestType: 'cloud', // yapi,cloud: 云函数
// requestType: 'local', // yapi,cloud: 云函数
requestType: 'local', // yapi,cloud: 云函数
cloudName: 'tmallCat', // 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud,
......
......@@ -17,10 +17,10 @@
}
.my-prize-page .my-prize-label {
width: 286rpx;
height: 49rpx;
margin: 140rpx auto 40rpx;
background: url('//yun.duiba.com.cn/aurora/assets/a15fe07a819f3f6deb271725b37468030523dc05.png') no-repeat;
width: 171rpx;
height: 50rpx;
margin: 40rpx auto;
background: url('//yun.duiba.com.cn/aurora/assets/2f075d102e58cd42fa938d6e23cb6ffd4a2a9486.png') no-repeat;
background-size: 100% 100%;
}
......@@ -46,8 +46,8 @@
width: 700rpx;
height: 161rpx;
background-color: #ffffff;
border-color:rgb(255, 63, 38);
border-width: 1rpx;
border-color:#7f674e;
border-width: 5rpx;
border-style: solid;
/* box-shadow: 2rpx 3rpx 18rpx 0 rgb(255, 63, 38); */
border-radius: 10rpx;
......
......@@ -16,16 +16,16 @@ Page({
endTime: null,//到期时间
task: {
image: {
bg: '//yun.duiba.com.cn/aurora/assets/7283d715cc5c7d13a5f498d15f5f5b9f4d9c29e5.jpg', //背景图
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制
addressBth: '//yun.duiba.com.cn/aurora/assets/82cc3c6d8861334ebaf128c98e3341b687bdc007.png', //填写地址(实物奖品)
getBth: '//yun.dui88.com/duiba-components-c-myprizeget_now.png', //立即领取(除实物奖品外)
bg: '//yun.duiba.com.cn/aurora/assets/8fa7cea57cc7071bcc1cbada32f5bfaeb2203981.jpg', //背景图
copyIcon: '//yun.duiba.com.cn/aurora/assets/721e5319d26a4edbb0282558fb87d9bda1de4887.png', //复制
addressBth: '//yun.duiba.com.cn/aurora/assets/7ff6342492c2ce1a94ccfce39c88983b296b35fb.png', //填写地址(实物奖品)
getBth: '//yun.duiba.com.cn/aurora/assets/0725f0f5569ad12d37853ad5c40d163fbe247abf.png', //立即领取(除实物奖品外)
logisticsBth: '//yun.duiba.com.cn/aurora/assets/661f86ff3392cb3b56922b048acf74bebc07bb23.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', //领取失败
gotBtn: '//yun.duiba.com.cn/aurora/assets/30fa200ba1dcd345247f957c16a03a9706895112.png', //已领取(优惠券)
getAgainBtn: '//yun.duiba.com.cn/aurora/assets/f2bc6220c3b210a4b315ab1bfcc4ebeffcf854ba.png', //重新领取
invalidBtn: '//yun.duiba.com.cn/aurora/assets/2790bbc504bd94bd7914771e5ba1202e9f011a1a.png', //已失效
failBth: '//yun.duiba.com.cn/aurora/assets/7bdd43b0b86094c3cf121abb204824985a13035b.png', //领取失败
},
logisticsImage: {
shipped: '//yun.duiba.com.cn/aurora/assets/3a7b68ec171ee339ce619d19f6ae3f9c1e6d801a.png', // 已发货物理弹窗
......@@ -33,8 +33,8 @@ Page({
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制
},
btnStyle: { // 按钮自定义样式
width: '150rpx',
height: '41rpx',
width: '154rpx',
height: '49rpx',
}
}
},
......@@ -100,23 +100,63 @@ Page({
// 领取积分
if (item.type === PRIZE_TYPE_MAP.INTEGRATION) return this.handleGetIntergation(e)
},
/**
* 发奖
*/
async cloudTBIssue(params) {
const { cloud } = app;
return new Promise((resolve, reject) => {
my.authorize({
scopes: "scope.latourBenefit",
success: async () => {
const result = await cloud.topApi
.invoke({
api: "alibaba.latour.strategy.issue",
data: {
channel: params.channel || "",
strategy_code: params.strategyCode || "",
selected_benefit_code: params.code || "",
},
})
.catch((err) => {
console.log("alibaba.latour.strategy.issue------catch", err);
});
console.log(result, "result");
resolve(result);
},
fail: (err) => {
console.log("scope.latourBenefit----fail", err);
reject(err);
},
});
})
},
// 优惠券
async handleGetEquity(e) {
if (flag) {
return
}
flag = true;
const { activityId } = app;
const { item } = e.target.dataset;
console.log(item, '领取权益')
const { success, data, message } = await API.receiveEnamePrize({ activityId, _id: item._id }).catch(res => {
this.getMyPrize('noLoading')
commonToast(res && res.message)
}) || {};
if (success && data) {
commonToast('领取成功')
this.getMyPrize()
}
const { item:{strategyCode,code} } = e.target.dataset;
this.cloudTBIssue({strategyCode,code})
// const { activityId } = app;
// console.log(item, '领取权益')
// const { success, data, message } = await API.receiveEnamePrize({ activityId, _id: item._id }).catch(res => {
// this.getMyPrize('noLoading')
// commonToast(res && res.message)
// }) || {};
// if (success && data) {
// commonToast('领取成功')
// this.getMyPrize()
// }
setTimeout(() => {
flag = false
}, 500)
......@@ -130,9 +170,9 @@ Page({
flag = true;
const { activityId } = app;
const { item } = e.target.dataset;
const userAddress = await getUserAddress({ joinTag: " " }).catch((data)=>{
const userAddress = await getUserAddress({ joinTag: " " }).catch((data) => {
flag = false
console.log('getUserAddress出错了,错误信息是',data);
console.log('getUserAddress出错了,错误信息是', data);
})
// my.hideLoading();
if (!userAddress) return
......@@ -140,15 +180,15 @@ Page({
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
const params = {
activityId,
area:countyName,
addressdetail:detailInfo,
area: countyName,
addressdetail: detailInfo,
name,
phone: telNumber,
detailInfo,
cityCode,
cityName,
city:cityName,
province:provinceName,
city: cityName,
province: provinceName,
provinceName,
countyName,
streetName,
......@@ -186,7 +226,7 @@ Page({
commonToast(message)
}
this.getMyPrize()
},(rej)=>{
}, (rej) => {
commonToast(rej.message)
});
},
......
......@@ -104,9 +104,9 @@ Page({
this.main && this.main.dispatchGlobalEvent("UPDATE_USERINFO")
}
// setTimeout(() => {
// my.__pageTo__('myprize')
// }, 2000);
setTimeout(() => {
my.__pageTo__('myprize')
}, 100);
},
initCanvas() {
......
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