diff --git a/app.json b/app.json index 7fd6e48..e10756e 100644 --- a/app.json +++ b/app.json @@ -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": "停车" diff --git a/assets/img/qidai.png b/assets/img/qidai.png new file mode 100644 index 0000000..d9cf5d6 Binary files /dev/null and b/assets/img/qidai.png differ diff --git a/config/config.js b/config/config.js index 02c30d4..6002ebf 100755 --- a/config/config.js +++ b/config/config.js @@ -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: { /** diff --git a/pages/cartest/cartest.js b/pages/cartest/cartest.js new file mode 100644 index 0000000..d74b03a --- /dev/null +++ b/pages/cartest/cartest.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/cartest/cartest.json b/pages/cartest/cartest.json new file mode 100644 index 0000000..9ec9737 --- /dev/null +++ b/pages/cartest/cartest.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "停车" + } \ No newline at end of file diff --git a/pages/cartest/cartest.wxml b/pages/cartest/cartest.wxml new file mode 100644 index 0000000..1e01fb6 --- /dev/null +++ b/pages/cartest/cartest.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pages/cartest/cartest.wxss b/pages/cartest/cartest.wxss new file mode 100644 index 0000000..d3da5db --- /dev/null +++ b/pages/cartest/cartest.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index ce9c589..a83b2a5 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -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({ }); } } -}); +}); \ No newline at end of file diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index ce3622f..30eb95e 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -9,6 +9,7 @@ {{data.title}}限购{{data.useLimitQuantity}}件 剩余时间:{{endtime}} 剩余时间:即将到期 + 自领取之日起{{data.validDays}}天内有效 当次有效 剩余件数:{{data.remainInventory}}件 diff --git a/pages/couponorder/index/index.js b/pages/couponorder/index/index.js index 4e9d429..a79ef6d 100644 --- a/pages/couponorder/index/index.js +++ b/pages/couponorder/index/index.js @@ -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); diff --git a/pages/index/index.js b/pages/index/index.js index c94f220..48c4be7 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -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({ } }; } -}); +}); \ No newline at end of file diff --git a/pages/index/rushToBuy/index.js b/pages/index/rushToBuy/index.js index abc0778..60d215a 100644 --- a/pages/index/rushToBuy/index.js +++ b/pages/index/rushToBuy/index.js @@ -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 diff --git a/pages/index/rushToBuy/index.wxml b/pages/index/rushToBuy/index.wxml index 891c75e..d2ae3b0 100644 --- a/pages/index/rushToBuy/index.wxml +++ b/pages/index/rushToBuy/index.wxml @@ -1,5 +1,5 @@ - 限时抢购查看更多 + 限时抢购查看更多 diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index bc70beb..619f784 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -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 () {} +}); \ No newline at end of file diff --git a/pages/order/index/index.js b/pages/order/index/index.js index 86aab37..576521e 100644 --- a/pages/order/index/index.js +++ b/pages/order/index/index.js @@ -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; i0){ - // console.log('>>>'+that.data.couponList.length) - // that.bindCoupon(e); - // } - // }, //券绑定车牌 bindCoupon: function(e) { var that = this; diff --git a/pages/passCar/passCar.wxml b/pages/passCar/passCar.wxml index 53eafba..7223fa7 100644 --- a/pages/passCar/passCar.wxml +++ b/pages/passCar/passCar.wxml @@ -28,7 +28,7 @@ 停车费用:¥{{item.stopFee.parkingFee}} - + diff --git a/pages/rushToBuy/index.js b/pages/rushToBuy/index.js index 4d823fa..a9486fb 100644 --- a/pages/rushToBuy/index.js +++ b/pages/rushToBuy/index.js @@ -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 diff --git a/pages/rushToBuy/index.wxml b/pages/rushToBuy/index.wxml index 4f6f930..341db25 100644 --- a/pages/rushToBuy/index.wxml +++ b/pages/rushToBuy/index.wxml @@ -1,7 +1,6 @@ - + @@ -24,12 +23,16 @@ {{item.endtime}} - 剩余件数:{{item.remainInventory}}件 + + 剩余件数: + {{item.remainInventory}}件 + 购买 领取 - {{content}} + + {{content}} \ No newline at end of file diff --git a/pages/user/index.js b/pages/user/index.js index 0ec76ee..a63c4f3 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -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" + }) + } + }, /** * 生命周期函数--监听页面隐藏 diff --git a/pages/user/index.wxml b/pages/user/index.wxml index b7d0fbc..79ef2b1 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -39,11 +39,12 @@ 券包 + - + 智能停车 @@ -53,5 +54,5 @@ - + \ No newline at end of file diff --git a/pages/user/index.wxss b/pages/user/index.wxss index 50970b2..9f483f0 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -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%;