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