@@ -1,9 +1,9 @@ | |||
var extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; | |||
var appId = extConfig.appId; | |||
var config = { | |||
url: "https://ciformall.youlane.cn/C/api", | |||
// url: "https://ciformall.youlane.cn/C/api", | |||
// url:"https://c.malls.iformall.com/C/api", | |||
// url:'https://ctest.malls.iformall.com/C/api', | |||
url:'https://ctest.malls.iformall.com/C/api', | |||
// url:'http://10.100.33.68:7000/C/api', | |||
// url: 'http://202.165.179.86:4000/C/api', | |||
api: { | |||
@@ -219,7 +219,7 @@ var config = { | |||
}, | |||
weapp: { | |||
AppId: "wxea71200db93d756b" | |||
AppId: "wx649b3be73c1afe47" | |||
}, | |||
ErrorCode: { | |||
@@ -21,10 +21,9 @@ Page({ | |||
loadingUrl: imgurl.loading.url, | |||
flag: 'bargaingoods', | |||
}, | |||
onShow: function () { | |||
onLoad: function () { | |||
let that = this; | |||
that.getBannerlist(); | |||
console.log("onShow") | |||
var todayDate=new Date().getTime(); | |||
that.setData({ | |||
todayDate:todayDate | |||
@@ -4,7 +4,7 @@ | |||
<c-banner wx:key="unique" list="{{list}}" /> | |||
</view> | |||
<view class="list" hover-class="none" hover-stop-propagation="false"> | |||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="{{index}}" hover-class="none" hover-stop-propagation="false" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'> | |||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="{{index}}" hover-stop-propagation="false" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'> | |||
<image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true" binderror="" | |||
bindload=""></image> | |||
<view class="fl ri" hover-class="none" hover-stop-propagation="false"> | |||
@@ -15,17 +15,12 @@ | |||
</view> | |||
<view class="botton" hover-class="none" hover-stop-propagation="false">发起砍价</view> | |||
</view> | |||
<view class='dingdan' wx:if="{{list.length==0}}"> | |||
<image src="{{actUrl}}" mode="widthFix"></image> | |||
<text>请您敬请期待</text> | |||
<text>我们正在筹备一大波优惠活动</text> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"><image src="{{loadingUrl}}" mode="widthFix"></image>{{content}}</view> | |||
<view class='loadingtext' wx:if="{{loadingtext}}">{{loadingtext}}</view> | |||
<!-- <view class='loadingtext' wx:if="{{loadingtext}}">{{loadingtext}}</view> --> | |||
</view> | |||
</view> | |||
<view class="list mybargain" wx:if="{{mybargain}}" hover-class="none" hover-stop-propagation="false"> | |||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="index" wx:if="{{item.orderStatus == 6||item.orderStatus == 7|| item.orderStatus == 8 || item.orderStatus == 9}}" hover-class="none" hover-stop-propagation="false"> | |||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="index" hover-stop-propagation="false"> | |||
<image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true"></image> | |||
<view class="fl ri" hover-class="none" hover-stop-propagation="false"> | |||
<text class="txt01">{{item.title}}</text> | |||
@@ -37,29 +32,31 @@ | |||
<view class='again' wx:if="{{item.orderStatus == 6&&todayDate<=item.pressEndDate}}" hover-class="none" hover-stop-propagation="false" data-id="{{item.id}}" bindtap="inviteFriend"> | |||
<view class="botton1">邀请好友砍价</view> | |||
</view> | |||
<view class='again' wx:if="{{item.orderStatus == 7}}" data-id="{{item.id}}" bindtap="inviteFriend"> | |||
<view class="botton2" hover-class="none" hover-stop-propagation="false">立即支付</view> | |||
<image class="icon" src="./../../assets/images/bargainsuccess.png" lazy-load="true"/> | |||
</view> | |||
<view class='again' wx:if="{{item.orderStatus == 1}}" data-id="{{item.id}}" bindtap="inviteFriend"> | |||
<!-- <view class="botton2" hover-class="none" hover-stop-propagation="false">立即支付</view> --> | |||
<image class="icon" style='margin-top:60rpx;' src="./../../assets/images/bargainsuccess.png" lazy-load="true"/> | |||
</view> | |||
<view class='again' wx:if="{{item.orderStatus == 8||item.orderStatus == 6&&todayDate>item.pressEndDate}}" data-couponChannelId="{{item.couponChannelId}}" data-couponId="{{item.productId}}" data-id="{{item.id}}" bindtap="barginAgain"> | |||
<view class="botton3" hover-class="none" hover-stop-propagation="false">重新砍价</view> | |||
<image class="icon" src="./../../assets/images/bargainfail.png" lazy-load="true"/> | |||
</view> | |||
<view wx:if="{{item.orderStatus == 9}}"> | |||
<image class="icon" src="./../../assets/images/bargaincancel.png" lazy-load="true"/> | |||
<view wx:if="{{item.orderStatus == 2}}"> | |||
<image class="icon" style="margin-top:60rpx;" src="./../../assets/images/bargaincancel.png" lazy-load="true"/> | |||
</view> | |||
</view> | |||
<view class='dingdan' wx:if="{{list.length==0}}"> | |||
<image src="{{actUrl}}" mode="widthFix"></image> | |||
<text>请您敬请期待</text> | |||
<text>我们正在筹备一大波优惠活动</text> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"><image src="{{loadingUrl}}" mode="widthFix"></image>{{content}}</view> | |||
<view class='loadingtext' wx:if="{{loadingtext}}">{{loadingtext}}</view> | |||
<!-- <view class='loadingtext' wx:if="{{loadingtext}}">{{loadingtext}}</view> --> | |||
</view> | |||
<view class='dingdan' wx:if="{{lists.length==0}}"> | |||
<image src="{{actUrl}}" mode="widthFix"></image> | |||
<text>请您敬请期待</text> | |||
<text>我们正在筹备一大波优惠活动</text> | |||
</view> | |||
<view class="clearfix buttonfix" hover-class="none" hover-stop-propagation="false"> | |||
<view class="{{bargaingoods?'active1':''}}" hover-class="none" hover-stop-propagation="false" bindtap="bargaingoods">砍价商品</view> | |||
<view class="{{ mybargain?'active1':''}} line" hover-class="none" hover-stop-propagation="false" bindtap="mybargain">我的砍价</view> | |||
@@ -78,7 +78,7 @@ page{ | |||
.listitem{ | |||
position: relative; | |||
padding: 21rpx 0; | |||
border-bottom: 1rpx solid #F9F9F9; | |||
border-bottom: 1rpx solid #ededed; | |||
} | |||
.botton{ | |||
position: absolute; | |||
@@ -413,4 +413,7 @@ page{ | |||
position: relative; | |||
width: 686rpx; | |||
height: 200rpx; | |||
} | |||
.banner{ | |||
margin-bottom: 20rpx; | |||
} |
@@ -348,13 +348,19 @@ Page({ | |||
data: {} | |||
}) | |||
.then(res => { | |||
if (discount == 'discount' || discount == 'discount1') { | |||
if (discount == 'discount') { | |||
var data = { | |||
couponChannelId: "" + that.data.couponChannelId, | |||
couponId: "" + that.data.couponId, | |||
press: true | |||
} | |||
} else if (that.data.couponChannelId == null) { | |||
} else if (discount == 'discount1'){ | |||
var data = { | |||
couponChannelId: "" + that.data.couponChannelId, | |||
couponId: "" + that.data.couponId, | |||
press: false | |||
} | |||
}else if (that.data.couponChannelId == null) { | |||
var data = { | |||
couponId: "" + that.data.couponId | |||
}; | |||
@@ -3,7 +3,7 @@ | |||
page { | |||
background: #fff; | |||
} | |||
button::after{ border: none; } | |||
.coupons { | |||
width: 100%; | |||
position: relative; | |||
@@ -2,6 +2,7 @@ var config = require("../../config/config.js"); | |||
var app = getApp(); | |||
const Http = require("../../utils/HttpBasics"); | |||
let util = require("../../utils/util"); | |||
const imgurl = require("../../utils/imgurl"); | |||
Page({ | |||
/** | |||
@@ -12,7 +13,9 @@ Page({ | |||
pageNum:1, | |||
list:[], | |||
showcontent:false, | |||
loading:"" | |||
loading:"", | |||
loadingUrl: imgurl.loading.url, | |||
allow_load: true | |||
}, | |||
/** | |||
@@ -32,55 +35,44 @@ Page({ | |||
onShow: function () { | |||
let that = this; | |||
that.getScore(); | |||
let pageNum = that.data.pageNum; | |||
let pageSize = that.data.pageSize; | |||
that.record(pageNum, pageSize); | |||
that.record(1, 15); | |||
}, | |||
record: function (pageNum) { | |||
let that = this; | |||
Http.get({ | |||
record(pageNum) { | |||
var that = this; | |||
console | |||
if (that.data.allow_load) { | |||
Http.get({ | |||
url: config.api.scoreHistory, | |||
data: { | |||
pageNum: pageNum, | |||
pageSize: 15 | |||
pageSize: 20, | |||
} | |||
}) | |||
.then(res => { | |||
console.log(res) | |||
if (res.data.list.length > 0 && res.data.pageNum >= pageNum) { | |||
var tmpArr = that.data.list.concat(res.data.list); | |||
tmpArr.map(file => { | |||
file.createDate = util.formatTime(file.createDate, "yyyy-MM-dd hh:mm:ss") | |||
}); | |||
}).then(res => { | |||
res.data.list.map(file => { | |||
file.createDate = util.formatTime( | |||
file.createDate, | |||
"yyyy-MM-dd hh:mm:ss" | |||
); | |||
}); | |||
if (pageNum >= res.data.pages) { | |||
that.setData({ | |||
list:tmpArr | |||
}) | |||
setTimeout(function(){ | |||
wx.hideLoading() | |||
},1200) | |||
} | |||
else if (res.data.list.length == 0){ | |||
that.setData({ | |||
loading:"暂无数据" | |||
}) | |||
setTimeout(function () { | |||
wx.hideLoading() | |||
}, 1200) | |||
} | |||
else{ | |||
setTimeout(function () { | |||
wx.hideLoading() | |||
}, 1200) | |||
allow_load: false | |||
}); | |||
} | |||
that.data.list = that.data.list.concat(res.data.list); | |||
that.setData({ | |||
list: that.data.list | |||
}); | |||
}) | |||
.catch(err => { | |||
wx.showModal({ | |||
title: '抱歉', | |||
content: err.message, | |||
showCancel:false | |||
.catch(err => { | |||
wx.showToast({ | |||
title: err.errMsg, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
}) | |||
}) | |||
} | |||
}, | |||
getScore: function() { | |||
let that = this; | |||
@@ -26,6 +26,6 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view class='loading'> | |||
{{loading}} | |||
<view class="loading" wx:if="{{loading}}"> | |||
<image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} | |||
</view> |
@@ -21,7 +21,8 @@ Page({ | |||
mystatus: '', | |||
staticGamedata: {}, | |||
showIf: false, | |||
showPage:false | |||
showPage:false, | |||
showButton:false | |||
}, | |||
phone: function (e) { | |||
@@ -139,12 +140,20 @@ Page({ | |||
}) | |||
}) | |||
}, | |||
onShow:function(){ | |||
let that = this; | |||
that.setData({ | |||
showButton: false | |||
}) | |||
}, | |||
/** | |||
* 发起支付 | |||
*/ | |||
orderFunc(e) { | |||
var that = this; | |||
that.setData({ | |||
showButton: true | |||
}) | |||
wx.showLoading({ | |||
title: "加载中..." | |||
}); | |||
@@ -159,6 +168,9 @@ Page({ | |||
} | |||
}).then(res => { | |||
/// Begin payment ---- | |||
that.setData({ | |||
showButton: false | |||
}) | |||
var payOrderId = "" + res.data.payOrderId; | |||
wx.hideLoading(); | |||
wx.requestPayment({ | |||
@@ -190,6 +202,9 @@ Page({ | |||
} | |||
}, | |||
fail: res => { | |||
that.setData({ | |||
showButton:false | |||
}) | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2,'','fail',that); | |||
return; | |||
}, | |||
@@ -72,7 +72,7 @@ | |||
</view> | |||
<!-- 待付款 显示立即购买的按钮 --> | |||
<view wx:if="{{order.orderStatus==0&&order.salePrice!=0||order.orderStatus==7&&order.salePrice!=0}}" class="buy-view app-border-top"> | |||
<button bindtap='orderFunc' hover-class='active' data-couponChannelId="{{order.id}}" class='buy'>立即支付</button> | |||
<button bindtap='orderFunc' hover-class='active' data-couponChannelId="{{order.id}}" disabled='{{showButton}}' class='buy'>立即支付</button> | |||
</view> | |||
<view class='game' bindtap="gotogame" wx-if="{{showIf&&order.orderStatus!=0}}"> | |||
<view class='game-entry'> | |||
@@ -60,7 +60,7 @@ Page({ | |||
"yyyy-MM-dd hh:mm:ss" | |||
); | |||
}); | |||
if (pageNum > res.data.pages) { | |||
if (pageNum >= res.data.pages) { | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
@@ -13,7 +13,7 @@ | |||
}, | |||
"compileType": "miniprogram", | |||
"libVersion": "2.0.9", | |||
"appid": "wxea71200db93d756b", | |||
"appid": "wx649b3be73c1afe47", | |||
"projectname": "C", | |||
"isGameTourist": false, | |||
"condition": { | |||