Commit 25428d83 authored by 汪欢's avatar 汪欢

2

parent d693d44b
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
const g = typeof global !== 'undefined' ? global : self; const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = { g.appXAppJson = {
"app": { "app": {
"$homepage": "pages/pagehuo_dong_ye/pagehuo_dong_ye" "$homepage": "pages/pageshou_ye/pageshou_ye"
} }
}; };
require('@alipay/appx-compiler/lib/sjsEnvInit'); require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$'); require('./config$');
require('../../components/comyou_xi_gui_ze27/comyou_xi_gui_ze27?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comgou_mai_ji_lu32/comgou_mai_ji_lu32?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comgou_mai_ji_lu32/comgou_mai_ji_lu32?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comhui_yuan/comhui_yuan?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comhui_yuan/comhui_yuan?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comyou_xi_gui_ze27/comyou_xi_gui_ze27?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comgong_xi_huo_jiang/comgong_xi_huo_jiang?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comgong_xi_huo_jiang/comgong_xi_huo_jiang?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comhen_yi_han23/comhen_yi_han23?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comhen_yi_han23/comhen_yi_han23?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/logisticsModal/logisticsModal?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/logisticsModal/logisticsModal?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/prizeModal/prizeModal?hash=951cb6a7fcdd2a5332763295aa08b4f86b6fd2e1'); require('../../components/prizeModal/prizeModal?hash=951cb6a7fcdd2a5332763295aa08b4f86b6fd2e1');
require('../../pages/pageshou_ye/pageshou_ye?hash=f6ca2530b12f33cb12545f5a792a8e73d47ec084');
require('../../pages/pagehuo_dong_ye/pagehuo_dong_ye?hash=7ec0f338c71bf4e4819fe4b1de0280c7c068fa10'); require('../../pages/pagehuo_dong_ye/pagehuo_dong_ye?hash=7ec0f338c71bf4e4819fe4b1de0280c7c068fa10');
require('../../pages/pagejie_shu_ye/pagejie_shu_ye?hash=4990da67de8821c5cecd5d61ea1f930142c306d6'); require('../../pages/pagejie_shu_ye/pagejie_shu_ye?hash=4990da67de8821c5cecd5d61ea1f930142c306d6');
require('../../pages/pageshou_ye/pageshou_ye?hash=f6ca2530b12f33cb12545f5a792a8e73d47ec084');
require('../../pages/myprize/myprize?hash=74b7edb09b315961bb13059a83b72836912bfd2c'); require('../../pages/myprize/myprize?hash=74b7edb09b315961bb13059a83b72836912bfd2c');
require('../../pages/pagewo_de_jiang_pin_ye_mian1/pagewo_de_jiang_pin_ye_mian1?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68'); require('../../pages/pagewo_de_jiang_pin_ye_mian1/pagewo_de_jiang_pin_ye_mian1?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
...@@ -32,16 +32,16 @@ if(AFAppX.registerApp) { ...@@ -32,16 +32,16 @@ if(AFAppX.registerApp) {
function success() { function success() {
require('../../app'); require('../../app');
require('../../components/comyou_xi_gui_ze27/comyou_xi_gui_ze27?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comgou_mai_ji_lu32/comgou_mai_ji_lu32?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comgou_mai_ji_lu32/comgou_mai_ji_lu32?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comhui_yuan/comhui_yuan?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comhui_yuan/comhui_yuan?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comyou_xi_gui_ze27/comyou_xi_gui_ze27?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comgong_xi_huo_jiang/comgong_xi_huo_jiang?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comgong_xi_huo_jiang/comgong_xi_huo_jiang?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/comhen_yi_han23/comhen_yi_han23?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/comhen_yi_han23/comhen_yi_han23?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/logisticsModal/logisticsModal?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../components/logisticsModal/logisticsModal?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../components/prizeModal/prizeModal?hash=951cb6a7fcdd2a5332763295aa08b4f86b6fd2e1'); require('../../components/prizeModal/prizeModal?hash=951cb6a7fcdd2a5332763295aa08b4f86b6fd2e1');
require('../../pages/pageshou_ye/pageshou_ye?hash=f6ca2530b12f33cb12545f5a792a8e73d47ec084');
require('../../pages/pagehuo_dong_ye/pagehuo_dong_ye?hash=7ec0f338c71bf4e4819fe4b1de0280c7c068fa10'); require('../../pages/pagehuo_dong_ye/pagehuo_dong_ye?hash=7ec0f338c71bf4e4819fe4b1de0280c7c068fa10');
require('../../pages/pagejie_shu_ye/pagejie_shu_ye?hash=4990da67de8821c5cecd5d61ea1f930142c306d6'); require('../../pages/pagejie_shu_ye/pagejie_shu_ye?hash=4990da67de8821c5cecd5d61ea1f930142c306d6');
require('../../pages/pageshou_ye/pageshou_ye?hash=f6ca2530b12f33cb12545f5a792a8e73d47ec084');
require('../../pages/myprize/myprize?hash=74b7edb09b315961bb13059a83b72836912bfd2c'); require('../../pages/myprize/myprize?hash=74b7edb09b315961bb13059a83b72836912bfd2c');
require('../../pages/pagewo_de_jiang_pin_ye_mian1/pagewo_de_jiang_pin_ye_mian1?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68'); require('../../pages/pagewo_de_jiang_pin_ye_mian1/pagewo_de_jiang_pin_ye_mian1?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
} }
......
...@@ -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,
......
{ {
"pages": [ "pages": [
"pages/pageshou_ye/pageshou_ye",
"pages/pagehuo_dong_ye/pagehuo_dong_ye", "pages/pagehuo_dong_ye/pagehuo_dong_ye",
"pages/pagejie_shu_ye/pagejie_shu_ye", "pages/pagejie_shu_ye/pagejie_shu_ye",
"pages/pageshou_ye/pageshou_ye",
"pages/myprize/myprize", "pages/myprize/myprize",
"pages/pagewo_de_jiang_pin_ye_mian1/pagewo_de_jiang_pin_ye_mian1" "pages/pagewo_de_jiang_pin_ye_mian1/pagewo_de_jiang_pin_ye_mian1"
], ],
......
<view class="hen_yi_han23"> <view class="hen_yi_han23">
<image class="cha_cha0" src={{resList['b8bc26de-51ac-457f-bd3f-348e7df0af34'].url}} /> <image class="cha_cha0" onTap="" src={{resList['b8bc26de-51ac-457f-bd3f-348e7df0af34'].url}} />
<image class="zu142" src={{resList['d473d55e-e93b-4473-ae6f-065e3ba2e853'].url}} /> <image class="zu142" src={{resList['d473d55e-e93b-4473-ae6f-065e3ba2e853'].url}} />
<image class="zu9" src={{resList['519cfe3c-5920-4f09-906e-53c44890ead3'].url}} /> <image class="zu9" src={{resList['519cfe3c-5920-4f09-906e-53c44890ead3'].url}} />
<image class="ju_xing88724" src={{resList['7ec9f5ea-9e4e-4ba9-bd1d-4ad6a7e03a4e'].url}} /> <image class="ju_xing88724" src={{resList['7ec9f5ea-9e4e-4ba9-bd1d-4ad6a7e03a4e'].url}} />
......
...@@ -20,18 +20,34 @@ Component({ ...@@ -20,18 +20,34 @@ Component({
async consumeCredits(){ async consumeCredits(){
let vipCredits = this.props.vipCredits; let vipCredits = this.props.vipCredits;
// console.log(this.props,'datas') // console.log(this.props,'datas')
API.getCredits().catch((res)=>{ // API.getCredits().catch((res)=>{
console.log('resdata',res) // console.log('resdata',res)
// if(res.success){ // // if(res.success){
let data = res.data; // let data = res.data;
console.log(data,vipCredits.gradeCredits,'1111') // console.log(data,vipCredits.gradeCredits,'1111')
if(data >= vipCredits.gradeCredits){ // // if(data >= vipCredits.gradeCredits){
console.log('购买成功!') // // console.log('购买成功!')
} else { // // } else {
console.log('购买失败!') // // console.log('购买失败!')
} // // }
// } // // }
// })
// let {message,data,code,success} = API.submit({floor: vipCredits.canBuyFloor, grade:vipCredits.grade}) || {};
API.submit({floor: vipCredits.canBuyFloor, grade:vipCredits.grade}).then((res)=>{
console.log(res,'res');
}) })
// console.log('succ',success)
// if(success){
// console.log('success');
// }else{
// console.log('failed')
// }
// success
this.onOrderNowModalClose();
} }
}, },
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
<image class="an_niu2" onTap="buyFloors" src={{resList['34e91d1d-6c84-45f5-ab77-870939ca7b12'].url}} /> <image class="an_niu2" onTap="buyFloors" src={{resList['34e91d1d-6c84-45f5-ab77-870939ca7b12'].url}} />
<view class="dao_ji_shi87"> <view class="dao_ji_shi87">
<image class="di22" src={{resList['ad6e754e-6243-4acf-9ffd-9a7aeb3f4971'].url}} /> <image class="di22" src={{resList['ad6e754e-6243-4acf-9ffd-9a7aeb3f4971'].url}} />
<label class="tu_ceng2291" style="color:'white'">{{endTime.d}}</label> <label class="tu_ceng2291" style="color:'white'">{{endingTime.d}}</label>
<label class="tu_ceng22_kao_bei90">{{endTime.h}}</label> <label class="tu_ceng22_kao_bei90">{{endingTime.h}}</label>
<label class="tu_ceng2289">{{endTime.m}}</label> <label class="tu_ceng2289">{{endingTime.m}}</label>
<label class="tu_ceng22_kao_bei388">{{endTime.s}}</label> <label class="tu_ceng22_kao_bei388">{{endingTime.s}}</label>
</view> </view>
<view class="jiang_pin78"> <view class="jiang_pin78">
<image class="zu116" src={{resList['51ca8493-ed2a-4273-a6b6-300bd9b2eb93'].url}} /> <image class="zu116" src={{resList['51ca8493-ed2a-4273-a6b6-300bd9b2eb93'].url}} />
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<label class="xxx">{{canBuyFloor}}</label> <label class="xxx">{{canBuyFloor}}</label>
</view> </view>
<image class="zu4" src={{resList['cc3cb693-26d3-4f09-ac99-b709ca49af74'].url}} /> <image class="zu4" src={{resList['cc3cb693-26d3-4f09-ac99-b709ca49af74'].url}} />
<label class="xxxxxx">XXXXXX</label> <label class="xxxxxx">{{totalFloor}}</label>
<view class="ji_fen"> <view class="ji_fen">
<image class="di111" src={{resList['8cb47bc2-bc31-4713-86ba-c8738367cb82'].url}} /> <image class="di111" src={{resList['8cb47bc2-bc31-4713-86ba-c8738367cb82'].url}} />
<image class="zu3" onTap="orderRecord" src={{resList['0c7c2470-690e-43df-aa7e-ed9aa99fb859'].url}} /> <image class="zu3" onTap="orderRecord" src={{resList['0c7c2470-690e-43df-aa7e-ed9aa99fb859'].url}} />
......
...@@ -18,6 +18,12 @@ Page({ ...@@ -18,6 +18,12 @@ Page({
m: '', m: '',
s: '', s: '',
}, },
endingTime: {
d: '',
h: '',
m: '',
s: '',
},
// 奖品列表数据 // 奖品列表数据
prizeList: [], prizeList: [],
...@@ -29,6 +35,9 @@ Page({ ...@@ -29,6 +35,9 @@ Page({
vipCredits: '', vipCredits: '',
// 用户当前积分 // 用户当前积分
userCredits:'', userCredits:'',
// 总楼层
totalFloor:'',
countDown:'',
ruleModalVisible: false, ruleModalVisible: false,
myPrizeBtnVisible: false, myPrizeBtnVisible: false,
...@@ -39,6 +48,7 @@ Page({ ...@@ -39,6 +48,7 @@ Page({
this.setData({ this.setData({
resList: resList resList: resList
}); });
// this.countDown();
this.getUserCredits(); this.getUserCredits();
this.getBaseInfo(); this.getBaseInfo();
// this.getEndTime(); // this.getEndTime();
...@@ -100,14 +110,38 @@ Page({ ...@@ -100,14 +110,38 @@ Page({
async buyFloors() { async buyFloors() {
// 购买楼层数 // 购买楼层数
let { canBuyFloor } = this.data let { canBuyFloor } = this.data;
let { data: { isVip, grade, gradeName, gradeCredits } } = await API.getVipInfo() || {};
// 判断会员等级 // 判断会员等级
// let { data: { isVip, grade, gradeName, gradeCredits } } = await API.getVipInfo() || {}; this.setData({
API.getVipInfo().then(({ data: { grade } }) => { vipCredits:{
API.submit({ floor: canBuyFloor, grade: grade }).catch((res) => { gradeCredits,
console.log(res); canBuyFloor,
}) grade
}
}) })
// if(success){
// this.setData({
// vipCredits:{
// gradeCredits,
// canBuyFloor,
// }
// })
// }
// API.getVipInfo().then(({ data: { grade } }) => {
// API.submit({ floor: canBuyFloor, grade: grade }).catch((res) => {
// console.log(res);
// this.setData({
// vipCredits:{
// canBuyFloor,
// gradeCredits,
// gradeName,
// }
// })
// })
// })
// 显示 // 显示
this.setData({ this.setData({
...@@ -124,6 +158,7 @@ Page({ ...@@ -124,6 +158,7 @@ Page({
console.log(data, 'data') console.log(data, 'data')
let list = data.list; let list = data.list;
let prize = data.prize; let prize = data.prize;
let totalFloor = data.totalFloor;
// startTime = data.startTime; // startTime = data.startTime;
// endingTime = data.endTime; // endingTime = data.endTime;
...@@ -150,7 +185,8 @@ Page({ ...@@ -150,7 +185,8 @@ Page({
this.setData({ this.setData({
prizeList: list, prizeList: list,
startTime: data.startTime, startTime: data.startTime,
endingTime: data.endingTime endingTime: data.endingTime,
totalFloor
}) })
}, },
...@@ -280,6 +316,54 @@ Page({ ...@@ -280,6 +316,54 @@ Page({
}) })
}, 1000) }, 1000)
},
countDown(){
// var that=this;
const endtime = '2020-10-17T00:00:00'
var nowTime = new Date().getTime();//现在时间(时间戳)
var endTime = new Date(endtime).getTime();//结束时间(时间戳)
var time = (endTime-nowTime)/1000;//距离结束的毫秒数
// 获取天、时、分、秒
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
// console.log(day + "," + hou + "," + min + "," + sec)
day = this.timeFormin(day),
hou = this.timeFormin(hou),
min = this.timeFormin(min),
sec = this.timeFormin(sec)
let that = this;
this.setData({
endingTime:{
d: this.timeFormat(day),
h: this.timeFormat(hou),
m: this.timeFormat(min),
s: this.timeFormat(sec)
} }
})
// 每1000ms刷新一次
if (time>0){
this.setData({
countDown: true
})
setTimeout(this.countDown, 1000);
}else{
this.setData({
countDown:false
})
}
},
//小于10的格式化函数(2变成02)
timeFormat(param) {
return param < 10 ? '0' + param : param;
},
//小于0的格式化函数(不会出现负数)
timeFormin(param) {
return param < 0 ? 0: param;
},
}); });
\ No newline at end of file
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