Commit b32a8b99 authored by wildfirecode13's avatar wildfirecode13

1

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