|
@@ -15,6 +15,17 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function payCharge(a,b){
|
|
|
+ console.log($(a));
|
|
|
+ var c=parseInt($(a).text());
|
|
|
+ if(b){
|
|
|
+ c++;
|
|
|
+ }else {
|
|
|
+ c--;
|
|
|
+ }
|
|
|
+ $(a).text(c)
|
|
|
+ }
|
|
|
+
|
|
|
var cachePageData = {}; //page内部的数据传递
|
|
|
|
|
|
return {
|
|
@@ -41,29 +52,62 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
$('.type-container', $view).hide();
|
|
|
switch (type) {
|
|
|
case 1:
|
|
|
- $('#descContainer').show();
|
|
|
- setTimeout(function () {
|
|
|
- pageData.scroll = new IScroll('#productDescScroll');
|
|
|
- }, 100);
|
|
|
- break;
|
|
|
+ $('#descContainer').show();
|
|
|
+ setTimeout(function () {
|
|
|
+ pageData.scroll = new IScroll('#productDescScroll');
|
|
|
+ }, 100);
|
|
|
+ break;
|
|
|
case 2:
|
|
|
- $('#reviewContainer').show();
|
|
|
- setTimeout(function () {
|
|
|
- pageData.scroll = new IScroll('#orderContainer');
|
|
|
- }, 100);
|
|
|
- break;
|
|
|
+ $('#reviewContainer').show();
|
|
|
+ setTimeout(function () {
|
|
|
+ pageData.scroll = new IScroll('#orderContainer');
|
|
|
+ }, 100);
|
|
|
+ break;
|
|
|
}
|
|
|
}, $view);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
// 切换时间
|
|
|
- $.newTouch('.month', function (event) {
|
|
|
+ $.newTouch('.time-year', function (event) {
|
|
|
event.preventDefault();
|
|
|
- // var year = $('.year').text();
|
|
|
- // var month = $('.month').text();
|
|
|
- console.log(year);
|
|
|
- console.log(month);
|
|
|
+ if($('.modal-box').css('display')=='none'){
|
|
|
+ $('.modal-box').css('display','block')
|
|
|
+ }
|
|
|
+ $('.modal-box-year').text($('.year-span').text());
|
|
|
+ $('.modal-box-month').text($('.month-span').text());
|
|
|
}, $view);
|
|
|
|
|
|
+ // 加减
|
|
|
+ $.newTouch('.btn-year-add',function(event){
|
|
|
+ event.preventDefault();
|
|
|
+ payCharge($('.modal-box-year'),true);
|
|
|
+ },$view);
|
|
|
+ $.newTouch('.btn-year-sub',function(event){
|
|
|
+ event.preventDefault();
|
|
|
+ payCharge($('.modal-box-year'),false);
|
|
|
+ },$view);
|
|
|
+ $.newTouch('.btn-month-add',function(event){
|
|
|
+ event.preventDefault();
|
|
|
+ payCharge($('.modal-box-month'),true);
|
|
|
+ },$view);
|
|
|
+ $.newTouch('.btn-month-sub',function(event){
|
|
|
+ event.preventDefault();
|
|
|
+ payCharge($('.modal-box-month'),false);
|
|
|
+ },$view);
|
|
|
+ // 取消
|
|
|
+ $.newTouch('.cancel',function(event){
|
|
|
+ event.preventDefault();
|
|
|
+ $('.modal-box').css('display','none')
|
|
|
+ console.log('测试');
|
|
|
+ },$view);
|
|
|
+ // 确定
|
|
|
+ $.newTouch('.determine',function(event){
|
|
|
+ event.preventDefault();
|
|
|
+ $('.modal-box').css('display','none')
|
|
|
+ console.log('测试');
|
|
|
+ },$view);
|
|
|
+
|
|
|
|
|
|
dtd.resolve();
|
|
|
},
|
|
@@ -81,7 +125,7 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
var balanceLog = res.message;
|
|
|
if (!cachePageData.massage) {
|
|
|
if(month<10){
|
|
|
- month='0'+(parseInt(month)+1);
|
|
|
+ month=(parseInt(month)+1);
|
|
|
}
|
|
|
var startTime = year+'-'+month+'-01';
|
|
|
var endTime = year+'-'+month+'-30';
|