@@ -1,6 +1,7 @@ | |||
{ | |||
"pages": [ | |||
"pages/index/index", | |||
"pages/cartest/cartest", | |||
"pages/bannerdetail/index", | |||
"pages/getuserinfo/index", | |||
"pages/phoneinput/phoneinput", | |||
@@ -35,7 +36,7 @@ | |||
"text": "首页" | |||
}, | |||
{ | |||
"pagePath": "pages/passCar/passCar", | |||
"pagePath": "pages/cartest/cartest", | |||
"iconPath": "assets/img/pass1.png", | |||
"selectedIconPath": "assets/img/pass0.png", | |||
"text": "停车" | |||
@@ -1,6 +1,7 @@ | |||
var config = { | |||
name: "富茂科技", | |||
url: "https://ciformall.youlane.cn/C/api", | |||
url:"https://c.malls.iformall.com", | |||
//url: "http://31adc9ce.ngrok.io/C/api", | |||
api: { | |||
/** | |||
@@ -0,0 +1,66 @@ | |||
// pages/cartest/cartest.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"navigationBarTitleText": "停车" | |||
} |
@@ -0,0 +1,3 @@ | |||
<view class="con"> | |||
<image src="./../../assets/img/qidai.png" mode="widthFix"></image> | |||
</view> |
@@ -0,0 +1,17 @@ | |||
.con{ | |||
position: absolute; | |||
left: 0; | |||
right: 0; | |||
top: 0; | |||
bottom: 0; | |||
} | |||
.con image{ | |||
position: absolute; | |||
width: 400rpx; | |||
height: 400rpx; | |||
left: 0; | |||
right: 0; | |||
top: 0rpx; | |||
bottom: 0; | |||
margin: auto; | |||
} |
@@ -13,7 +13,7 @@ Page({ | |||
hour: "", | |||
minute: "" | |||
}, | |||
phone: function() { | |||
phone: function () { | |||
let that = this; | |||
console.log(that.data); | |||
if (that.data.data.merchantLinkPhone) { | |||
@@ -73,14 +73,14 @@ Page({ | |||
payOrderUpdate: (orderId, payOrderId, status, reason) => { | |||
// 支付成功 | |||
Http.post({ | |||
url: config.api.payOrderUpdate, | |||
data: { | |||
payOrderId: payOrderId, | |||
orderId: orderId, | |||
status: status, | |||
reason: reason | |||
} | |||
}) | |||
url: config.api.payOrderUpdate, | |||
data: { | |||
payOrderId: payOrderId, | |||
orderId: orderId, | |||
status: status, | |||
reason: reason | |||
} | |||
}) | |||
.then(res => { | |||
console.log("payOrderUpdate then", res); | |||
// wx.showToast({ | |||
@@ -94,7 +94,7 @@ Page({ | |||
}, | |||
/** | |||
* 拉取车牌列表 | |||
*/ | |||
*/ | |||
init: function () { | |||
var that = this | |||
@@ -136,9 +136,9 @@ Page({ | |||
var that = this | |||
// 车场信息获取 | |||
Http.get({ | |||
url: config.api.getParkInfo, | |||
data: {} | |||
}) | |||
url: config.api.getParkInfo, | |||
data: {} | |||
}) | |||
.then(res => { | |||
console.log(res) | |||
that.setData({ | |||
@@ -175,12 +175,11 @@ Page({ | |||
console.log(1111111111111) | |||
} else { | |||
Http.post({ | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}) | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}) | |||
.then(res => { | |||
console.log(res); | |||
console.log("姐姐在检查手机号是否授权的情况"); | |||
var data = { | |||
couponChannelId: "" + that.data.couponChannelId, | |||
couponId: "" + that.data.couponId | |||
@@ -260,8 +259,7 @@ Page({ | |||
* | |||
*/ | |||
wx.redirectTo({ | |||
url: | |||
"/pages/getphoneInfo/index?couponChannelId=" + | |||
url: "/pages/getphoneInfo/index?couponChannelId=" + | |||
that.data.couponChannelId + | |||
"&couponId=" + | |||
that.data.couponId | |||
@@ -270,8 +268,7 @@ Page({ | |||
if (err.code == 11006) { | |||
// 用户手机已加密 | |||
wx.redirectTo({ | |||
url: | |||
"/pages/phoneinput/phoneinput?couponChannelId=" + | |||
url: "/pages/phoneinput/phoneinput?couponChannelId=" + | |||
that.data.couponChannelId + | |||
"&couponId=" + | |||
that.data.couponId | |||
@@ -306,23 +303,23 @@ Page({ | |||
timeStamp: res.data.timeStamp, | |||
nonceStr: res.data.nonceStr, | |||
package: res.data.package, | |||
signType: (res.data.signType)?res.data.signType:"MD5", | |||
signType: (res.data.signType) ? res.data.signType : "MD5", | |||
paySign: res.data.paySign, | |||
success: res => { | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | |||
console.log(res); | |||
if (res.errMsg == "requestPayment:ok") { | |||
wx.showToast({ | |||
title: "购买成功", | |||
image: "./../../../assets/img/success.png", | |||
duration: 2000, | |||
mask: false, | |||
success: function() { | |||
success: function () { | |||
wx.showLoading({ | |||
title: "加载中..." | |||
}); | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
wx.hideLoading(); | |||
}, 1600); | |||
setTimeout(() => { | |||
@@ -338,18 +335,10 @@ Page({ | |||
/** | |||
* 用户支付成功以后跳转到券包列表 | |||
*/ | |||
} | |||
}, | |||
fail: res => { | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2); // 支付失败 | |||
console.log(res); | |||
return; | |||
}, | |||
complete: res => { | |||
console.log(res); | |||
console.log("支付完成"); | |||
if (res.errMsg == "requestPayment:ok") { | |||
wx.setStorage({ | |||
key: 'couponNum', | |||
data: "couponNum", | |||
}) | |||
if (that.data.data.type == 5) { | |||
setTimeout(() => { | |||
wx.switchTab({ | |||
@@ -359,16 +348,35 @@ Page({ | |||
// this.initUsrCarList() | |||
// 领取 5.停车券 | |||
// TODO 选取用户下的车牌 | |||
} | |||
} else { | |||
wx.showToast({ | |||
title: "支付失败", | |||
image: "./../../../assets/img/fail.png", | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} | |||
} | |||
}, | |||
fail: res => { | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2); // 支付失败 | |||
console.log(res); | |||
wx.showToast({ | |||
title: "支付失败", | |||
image: "./../../../assets/img/fail.png", | |||
duration: 2000, | |||
mask: false | |||
}); | |||
return; | |||
}, | |||
complete: res => { | |||
// console.log(res); | |||
// console.log("支付完成"); | |||
// if (res.errMsg == "requestPayment:ok") { | |||
// } else { | |||
// wx.showToast({ | |||
// title: "支付失败", | |||
// image: "./../../../assets/img/fail.png", | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } | |||
// return; | |||
} | |||
}); | |||
/// End payment -------- | |||
@@ -381,7 +389,10 @@ Page({ | |||
} else { | |||
// 免费券 | |||
that.payOrderUpdate(orderId, "0", 1); | |||
wx.setStorage({ | |||
key: 'couponNum', | |||
data: "couponNum", | |||
}) | |||
wx.showToast({ | |||
title: "领取成功", | |||
duration: 3000, | |||
@@ -395,7 +406,7 @@ Page({ | |||
url: '/pages/passCar/passCar' | |||
}); | |||
}, 1600); | |||
} | |||
} | |||
} | |||
} | |||
}) | |||
@@ -404,4 +415,4 @@ Page({ | |||
}); | |||
} | |||
} | |||
}); | |||
}); |
@@ -9,6 +9,7 @@ | |||
<text>{{data.title}}<text>限购{{data.useLimitQuantity}}件</text></text> | |||
<text wx:if="{{data.endTime!=undefined&&data.endTime>=0&&data.type!=5}}">剩余时间:<text>{{endtime}}</text></text> | |||
<text wx:if="{{data.endTime!=undefined&&0>=data.endTime&&data.type!=5}}">剩余时间:<text>即将到期</text></text> | |||
<text wx:if="{{data.endTime==undefined}}">自领取之日起<text>{{data.validDays}}</text>天内有效</text> | |||
<text wx:if="{{data.type==5}}"><text>当次有效</text></text> | |||
<text>剩余件数:<text>{{data.remainInventory}}件</text></text> | |||
</view> | |||
@@ -33,7 +33,12 @@ Page({ | |||
onLoad() { | |||
this.getList(0, 0); | |||
}, | |||
onShow: function () { | |||
wx.setStorage({ | |||
key: 'couponNum', | |||
data: "couponNum1", | |||
}) | |||
}, | |||
//点击跳转到券详情页面 | |||
gotouse: function(e) { | |||
console.log(e.currentTarget.dataset.couponorderstatus); | |||
@@ -9,7 +9,7 @@ Page({ | |||
scrollTop: 0, | |||
page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 | |||
}, | |||
swiperChange: function(e) { | |||
swiperChange: function (e) { | |||
this.setData({ | |||
swiperCurrent: e.detail.current | |||
}); | |||
@@ -17,17 +17,17 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onLoad: function(options) { | |||
onLoad: function (options) { | |||
var that = this; | |||
var scene = decodeURIComponent(options.scene); | |||
app.getLocation(); | |||
}, | |||
onShow: function() { | |||
onShow: function () { | |||
this.userLogin(); | |||
}, | |||
onGetCode: function(e) { | |||
onGetCode: function (e) { | |||
//子组件传递给父组件的值 | |||
this.setData({ | |||
code: e.detail.val, | |||
@@ -38,11 +38,13 @@ Page({ | |||
/** | |||
* 用户登录 | |||
*/ | |||
userLogin: function() { | |||
userLogin: function () { | |||
var that = this; | |||
// 登录 | |||
wx.login({ | |||
success: ({ code }) => { | |||
success: ({ | |||
code | |||
}) => { | |||
var usrdata = { | |||
appId: config.weapp.AppId, | |||
code: code, | |||
@@ -58,9 +60,9 @@ Page({ | |||
}; | |||
} | |||
Http.post({ | |||
url: config.api.login, | |||
data: usrdata | |||
}) | |||
url: config.api.login, | |||
data: usrdata | |||
}) | |||
.then(res => { | |||
console.log("userlogin:app", res); | |||
app.globalData.token = res.data.token; | |||
@@ -101,13 +103,13 @@ Page({ | |||
/** | |||
* banner | |||
*/ | |||
getBannerlist: function() { | |||
getBannerlist: function () { | |||
let that = this; | |||
Http.get({ | |||
url: config.api.bannerlist, | |||
data: { | |||
pageNum: 1, | |||
pageSize: 10 | |||
pageSize: 7 | |||
} | |||
}).then(res => { | |||
console.log(res); | |||
@@ -117,10 +119,11 @@ Page({ | |||
console.log(res.data.list); | |||
}); | |||
}, | |||
/** | |||
* 检查用户是否有车 | |||
*/ | |||
checkUserCarStatus: function() { | |||
checkUserCarStatus: function () { | |||
var that = this; | |||
Http.get({ | |||
url: config.api.userCarCount, | |||
@@ -138,7 +141,7 @@ Page({ | |||
/** | |||
* car共同登录 | |||
*/ | |||
userCarLogin: function() { | |||
userCarLogin: function () { | |||
var that = this; | |||
if (!app.globalData.carLogin) { | |||
// 共同登录 | |||
@@ -160,7 +163,7 @@ Page({ | |||
/** | |||
* 获取用户信息 | |||
*/ | |||
getUserInfo: function() { | |||
getUserInfo: function () { | |||
// 获取用户信息 | |||
wx.getSetting({ | |||
success: res => { | |||
@@ -178,7 +181,7 @@ Page({ | |||
}); | |||
}, | |||
//下拉加载更多 | |||
onReachBottom: function() { | |||
onReachBottom: function () { | |||
let that = this; | |||
console.info("before++ " + that.data.page); | |||
that.data.page++; | |||
@@ -195,11 +198,11 @@ Page({ | |||
} | |||
}, | |||
// 用户点击右上角分享 | |||
onShareAppMessage: function() { | |||
onShareAppMessage: function () { | |||
return { | |||
title: "富茂链客", | |||
desc: "分享个小程序,希望你喜欢", | |||
success: function(res) { | |||
success: function (res) { | |||
wx.showToast({ | |||
title: "分享成功", | |||
duration: 1000, | |||
@@ -208,4 +211,4 @@ Page({ | |||
} | |||
}; | |||
} | |||
}); | |||
}); |
@@ -21,22 +21,11 @@ Component({ | |||
methods: { | |||
gotomore: function() { | |||
wx.navigateTo({ | |||
url: "/pages/rushToBuy/index", | |||
success: function(res) { | |||
// success | |||
}, | |||
fail: function() { | |||
// fail | |||
}, | |||
complete: function() { | |||
// complete | |||
} | |||
url: "/pages/rushToBuy/index" | |||
}); | |||
}, | |||
gotodetail: function(e) { | |||
console.log(e); | |||
console.log("出错啦 大哥"); | |||
console.log(e.currentTarget.dataset); | |||
wx.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${ | |||
e.currentTarget.dataset.couponchannelid | |||
@@ -1,5 +1,5 @@ | |||
<view class="index-rushToBuy"> | |||
<view class="index-rushToBuy-title">限时抢购<text bindtap="gotomore">查看更多</text></view> | |||
<view wx:if="{{list.length!=0}}" class="index-rushToBuy-title">限时抢购<text bindtap="gotomore">查看更多</text></view> | |||
<scroll-view scroll-x class="index-scroll-view"> | |||
<view class="commodity" wx:for="{{list}}" wx:key="unique"> | |||
<view bindtap="gotodetail" data-couponChannelId="{{item.id}}" data-couponId="{{item.couponId}}" data-targetAd="{{item.targetAd}}"> | |||
@@ -13,15 +13,11 @@ Page({ | |||
orderId: null, | |||
//存储计时器 | |||
setInter: "", | |||
mystatus:'' | |||
mystatus: '' | |||
}, | |||
/** | |||
* 点击弹出二维码 | |||
* 然后再关闭 | |||
*/ | |||
powerDrawer: function(e) { | |||
powerDrawer: function (e) { | |||
let that = this; | |||
// couponOrderStatus | |||
// 0 未使用 | |||
@@ -55,7 +51,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function(options) { | |||
onLoad: function (options) { | |||
let that = this; | |||
this.setData({ | |||
orderId: options.orderId | |||
@@ -63,7 +59,7 @@ Page({ | |||
wx.showLoading({ | |||
title: "加载中" | |||
}); | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
wx.hideLoading(); | |||
}, 500); | |||
// that.data.setInter = setInterval(function() { | |||
@@ -121,7 +117,6 @@ Page({ | |||
paySign: res.data.paySign, | |||
success: res => { | |||
console.log(res); | |||
console.log("姐在检查付款异常"); | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | |||
console.log(res); | |||
if (res.errMsg == "requestPayment:ok") { | |||
@@ -130,12 +125,12 @@ Page({ | |||
duration: 2000, | |||
image: "./../../../assets/img/success.png", | |||
mask: false, | |||
success: function() { | |||
success: function () { | |||
wx.showLoading({ | |||
title: "加载中..." | |||
}); | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
wx.hideLoading(); | |||
}, 1600); | |||
setTimeout(() => { | |||
@@ -150,37 +145,39 @@ Page({ | |||
} | |||
}, | |||
fail: res => { | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2); // 支付失败 | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2); | |||
console.log(res); | |||
wx.showToast({ | |||
title: "支付失败", | |||
image: "./../../../assets/img/fail.png", | |||
duration: 2000, | |||
mask: false | |||
}); | |||
return; | |||
}, | |||
complete: res => { | |||
console.log(res); | |||
if (res.errMsg == "requestPayment:ok") { | |||
} else { | |||
wx.showToast({ | |||
title: "支付失败", | |||
image: "./../../../assets/img/fail.png", | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} | |||
return; | |||
} | |||
// complete: res => { | |||
// console.log(res); | |||
// if (res.errMsg == "requestPayment:ok") {} else { | |||
// wx.showToast({ | |||
// title: "支付失败", | |||
// image: "./../../../assets/img/fail.png", | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } | |||
// return; | |||
// } | |||
}); | |||
/// End payment -------- | |||
}); | |||
} else { | |||
// 免费券 | |||
that | |||
.payOrderUpdate(orderId, "0", 1) // 支付成功 | |||
.then(res => { | |||
wx.showToast({ | |||
title: "支付成功", | |||
duration: 2000, | |||
image: "./../../../assets/img/success.png" | |||
}); | |||
}); | |||
that.payOrderUpdate(orderId, "0", 1) // 支付成功 | |||
wx.showToast({ | |||
title: "支付成功", | |||
duration: 2000, | |||
image: "./../../../assets/img/success.png", | |||
}); | |||
} | |||
}, | |||
/** | |||
@@ -189,14 +186,14 @@ Page({ | |||
payOrderUpdate: (orderId, payOrderId, status, reason) => { | |||
// 支付成功 | |||
Http.post({ | |||
url: config.api.payOrderUpdate, | |||
data: { | |||
payOrderId: payOrderId, | |||
orderId: orderId, | |||
status: status, | |||
reason: reason | |||
} | |||
}) | |||
url: config.api.payOrderUpdate, | |||
data: { | |||
payOrderId: payOrderId, | |||
orderId: orderId, | |||
status: status, | |||
reason: reason | |||
} | |||
}) | |||
.then(res => { | |||
console.log("payOrderUpdate then", res); | |||
// wx.showToast({ | |||
@@ -212,26 +209,25 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onShow: function() { | |||
}, | |||
onShow: function () {}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function() {}, | |||
onHide: function () {}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function() {}, | |||
onPullDownRefresh: function () {}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function() {}, | |||
onReachBottom: function () {}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function() {} | |||
}); | |||
onShareAppMessage: function () {} | |||
}); |
@@ -5,8 +5,7 @@ let app = getApp(); | |||
Page({ | |||
data: { | |||
tabs: [ | |||
{ | |||
tabs: [{ | |||
key: "all", | |||
name: "全部" | |||
}, | |||
@@ -25,7 +24,7 @@ Page({ | |||
page: 1, | |||
allow_load: true, | |||
loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
content:"", | |||
content: "", | |||
}, | |||
onLoad(e) { | |||
this.getList(e.id, 1); | |||
@@ -33,11 +32,12 @@ Page({ | |||
current_scroll: e.id | |||
}); | |||
}, | |||
gotopay:function(e){ | |||
console.log("orderId"+e.currentTarget.dataset.id); | |||
gotopay: function (e) { | |||
console.log("orderId" + e.currentTarget.dataset.id); | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&flag='pay'`}) | |||
url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&flag='pay'` | |||
}) | |||
}, | |||
getList(key, pageNum) { | |||
let that = this; | |||
@@ -50,21 +50,21 @@ Page({ | |||
var variable = { | |||
pageNum: pageNum, | |||
pageSize: 5, | |||
paymentType:0 | |||
paymentType: 0 | |||
}; | |||
} else { | |||
var variable = { | |||
pageNum: pageNum, | |||
pageSize: 5, | |||
orderStatus: key, | |||
paymentType:0 | |||
paymentType: 0 | |||
}; | |||
} | |||
if (that.data.allow_load) { | |||
that.setData({ | |||
loading:true, | |||
content:'小主,我在玩命加载中...' | |||
loading: true, | |||
content: '小主,我在玩命加载中...' | |||
}) | |||
Http.get({ | |||
@@ -76,15 +76,15 @@ Page({ | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
that.setData({ | |||
loading:false, | |||
loading: false, | |||
}) | |||
}, 1400); | |||
} | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
that.setData({ | |||
loading:false, | |||
loading: false, | |||
}) | |||
}, 1400); | |||
/** | |||
@@ -96,39 +96,43 @@ Page({ | |||
that.setData({ | |||
list: that.data.list | |||
}); | |||
for(let i=0; i<that.data.list.length; i++){ | |||
for (let i = 0; i < that.data.list.length; i++) { | |||
that.setData({ | |||
createDate:util.fmtDate(that.data.list[i].createDate) | |||
createDate: util.fmtDate(that.data.list[i].createDate) | |||
}) | |||
} | |||
}); | |||
} else { | |||
console.log("加载完成allow_load设置成false"); | |||
that.setData({ | |||
loading:true, | |||
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||
loading: true, | |||
content: "^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||
}) | |||
setTimeout(function(){ | |||
setTimeout(function () { | |||
that.setData({ | |||
loading:false, | |||
loading: false, | |||
}) | |||
},1400) | |||
}, 1400) | |||
} | |||
}, | |||
handleChange({ detail }) { | |||
handleChange({ | |||
detail | |||
}) { | |||
this.setData({ | |||
current: detail.key | |||
}); | |||
}, | |||
handleChangeScroll({ detail }) { | |||
handleChangeScroll({ | |||
detail | |||
}) { | |||
this.setData({ | |||
list:[], | |||
list: [], | |||
allow_load: true, | |||
current_scroll: detail.key | |||
}) | |||
this.getList(detail.key, 1); | |||
}, | |||
onReachBottom: function() { | |||
onReachBottom: function () { | |||
var that = this; | |||
that.data.page++; | |||
that.setData({ | |||
@@ -136,4 +140,4 @@ Page({ | |||
}); | |||
that.getList(that.data.current_scroll, that.data.page); | |||
} | |||
}); | |||
}); |
@@ -48,6 +48,7 @@ Page({ | |||
prevPage.setData({ | |||
mystatus: res.data.CouponOrderStatus | |||
}); | |||
} | |||
}); | |||
} | |||
@@ -66,17 +66,6 @@ Page({ | |||
title: "宝宝最可爱~" | |||
}); | |||
}, | |||
// orderPay: function () { | |||
// wx.redirectTo({ | |||
// url: '/pages/pay/pay' | |||
// }); | |||
// }, | |||
// payButton:function(){ | |||
// if (that.data.couponList.length>0){ | |||
// console.log('>>>'+that.data.couponList.length) | |||
// that.bindCoupon(e); | |||
// } | |||
// }, | |||
//券绑定车牌 | |||
bindCoupon: function(e) { | |||
var that = this; | |||
@@ -28,7 +28,7 @@ | |||
</view> | |||
<view class='priceBox right'> | |||
<text class="textRight">停车费用:¥{{item.stopFee.parkingFee}}</text> | |||
</view> | |||
</view> | |||
</view> | |||
@@ -1,4 +1,3 @@ | |||
// pages/index/sw/index.js | |||
let config = require("../../config/config.js"); | |||
let Http = require("../../utils/HttpBasics"); | |||
const util = require("../../utils/util"); | |||
@@ -52,9 +51,7 @@ Page({ | |||
} | |||
}).then(res => { | |||
console.log(res); | |||
//当前时间与优惠券下架时间做计算 | |||
console.log(that.data.day); | |||
if (page >= res.data.pages) { | |||
if (page > res.data.pages) { | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
@@ -72,6 +69,7 @@ Page({ | |||
/** | |||
* 页面上显示的时间 | |||
*/ | |||
console.log(that.data.list); | |||
that.data.list = that.data.list.concat(res.data.list); | |||
that.setData({ | |||
list: that.data.list | |||
@@ -119,10 +117,6 @@ Page({ | |||
}, | |||
//限时抢购的详情页面 | |||
gotodetail: function(e) { | |||
console.log(e); | |||
console.log("姐姐在测试"); | |||
console.log(e.currentTarget.dataset.couponchannelid); | |||
console.log("couponChannelId"); | |||
wx.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${ | |||
e.currentTarget.dataset.couponchannelid | |||
@@ -1,7 +1,6 @@ | |||
<!-- 限时抢购 查看更多对应的页面 --> | |||
<view class='flashSale'> | |||
<view wx:for="{{list}}" class='flashSaleItemWrap' data-couponId="{{item.couponId}}" data-couponChannelId="{{item.id}}" data-targetAd="{{item.targetAd}}" | |||
bindtap="gotodetail" wx:key="index"> | |||
<view wx:for="{{list}}" class='flashSaleItemWrap' data-couponId="{{item.couponId}}" data-couponChannelId="{{item.id}}" data-targetAd="{{item.targetAd}}" bindtap="gotodetail" wx:key="index"> | |||
<view class='flashSaleItem'> | |||
<view class='flashSaleItemTop'> | |||
<view class='flashSaleItemTopL'> | |||
@@ -24,12 +23,16 @@ | |||
<text class='realRemainingTime'>{{item.endtime}}</text> | |||
</view> | |||
<view class='flashSaleItemBottomBottm'> | |||
<view class="view1"><text class="remainingNumber">剩余件数:</text><text class='realnumber'>{{item.remainInventory}}件</text></view> | |||
<view class="view1"> | |||
<text class="remainingNumber">剩余件数:</text> | |||
<text class='realnumber'>{{item.remainInventory}}件</text> | |||
</view> | |||
<view class='buy' wx:if="{{item.salePriceStr!=0}}">购买</view> | |||
<view class='buy' wx:if="{{item.salePriceStr==0}}">领取</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"><image src="./../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view> | |||
<view class="loading" wx:if="{{loading}}"> | |||
<image src="./../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view> | |||
</view> |
@@ -1,3 +1,4 @@ | |||
let app = getApp(); | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
@@ -26,7 +27,22 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function() {}, | |||
onShow: function() { | |||
let num = wx.getStorageSync('couponNum'); | |||
console.log("我是渲染") | |||
if(num=='couponNum1'){ | |||
wx.setStorage({ | |||
key: 'couponNum', | |||
data: "couponNum1",}) | |||
this.setData({ | |||
couponNum:"couponNum1" | |||
}) | |||
}else{ | |||
this.setData({ | |||
couponNum:"couponNum" | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
@@ -39,11 +39,12 @@ | |||
<view class="user-btn app-border-bottom"> | |||
<view>券包</view> | |||
<view> | |||
<text class="couponnum" wx:if="{{couponNum=='couponNum'}}"></text> | |||
<text class="iconfont icon-right"></text> | |||
</view> | |||
</view> | |||
</navigator> | |||
<navigator url="/pages/passCar/passCar" open-type="switchTab"> | |||
<navigator url="/pages/cartest/cartest" open-type="switchTab"> | |||
<view class="user-btn app-border-bottom"> | |||
<view>智能停车</view> | |||
<view> | |||
@@ -53,5 +54,5 @@ | |||
</navigator> | |||
</view> | |||
<view class="margin"></view> | |||
<button bindtap="navigateTo" class="user-out-btn">退出登陆</button> | |||
<!-- <button bindtap="navigateTo" class="user-out-btn">退出登陆</button> --> | |||
</view> |
@@ -25,7 +25,18 @@ | |||
overflow: hidden; | |||
border: 1px solid red; | |||
} */ | |||
.couponnum{ | |||
display: inline-block; | |||
position: absolute; | |||
top: 20rpx; | |||
bottom: 0; | |||
left: 96rpx; | |||
width: 16rpx; | |||
height: 16rpx; | |||
border-radius: 50%; | |||
background: red; | |||
font-size: 22rpx; | |||
} | |||
.user-avatar open-data { | |||
display: block; | |||
width: 100%; | |||