From e4f2e9ed0f0f7796d882a0c3b379bf807183e1f3 Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Mon, 27 Aug 2018 12:28:19 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=A6=96=E9=A1=B5=E4=B8=9A=E6=80=81=E9=80=89?= =?UTF-8?q?=E6=8B=A9,=E9=99=90=E6=97=B6=E6=8A=A2=E8=B4=AD=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=92=8C=E8=AF=A6=E6=83=85=EF=BC=8C=E5=81=9C=E8=BD=A6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=A6=96=E9=A1=B5=E4=B8=9A=E6=80=81=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E4=B8=8A=E6=8B=89=E5=88=B7=E6=96=B0]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 3 + components/banner/index.js | 1 - components/coupons/index.wxml | 22 ++--- components/coupons/index.wxss | 36 ++++---- config/config.js | 66 +++++++------- dist/tab/index.js | 84 +++++++++--------- dist/tab/index.wxml | 3 +- pages/addPark/addPark.wxss | 10 +-- pages/coupon/detail/index.js | 5 +- pages/coupon/detail/index.wxml | 8 +- pages/couponorder/detail/index.wxml | 4 +- pages/couponorder/detail/index.wxss | 1 - pages/couponorder/index/index.js | 2 +- pages/couponorder/index/index.wxml | 30 +++---- pages/couponorder/index/index.wxss | 5 +- pages/getuserinfo/index.wxss | 2 +- pages/index/coupons/index.js | 133 +++++++++++++++++++++------- pages/index/coupons/index.wxml | 6 +- pages/index/index.js | 50 +++++++---- pages/index/index.wxml | 4 +- pages/index/rushToBuy/index.js | 61 ++++++------- pages/index/rushToBuy/index.wxml | 6 +- pages/index/rushToBuy/index.wxss | 10 ++- pages/passCar/passCar.js | 15 ++++ pages/passCar/passCar.wxml | 9 +- pages/passCar/passCar.wxss | 27 +++--- pages/rushToBuy/index.js | 79 +++++++++++------ pages/rushToBuy/index.wxml | 100 +++++---------------- pages/rushToBuy/index.wxss | 3 +- pages/user/index.wxss | 2 +- 30 files changed, 436 insertions(+), 351 deletions(-) diff --git a/app.js b/app.js index ba1a33b..5062bfd 100644 --- a/app.js +++ b/app.js @@ -50,6 +50,9 @@ App({ if (that.couponListCallback) { that.couponListCallback(that.globalData.token); } + if (that.businessListCallback) { + that.businessListCallback(that.globalData.token); + } return Http.post({ url: config.api.checkUserStatus, data: {} diff --git a/components/banner/index.js b/components/banner/index.js index 0d6e5f2..bbf0dca 100644 --- a/components/banner/index.js +++ b/components/banner/index.js @@ -21,7 +21,6 @@ Component({ * 组件的方法列表 */ ready(){ - console.log(this.data.list) }, methods: { swiperChange: function (e) { diff --git a/components/coupons/index.wxml b/components/coupons/index.wxml index d2f977e..a780f28 100644 --- a/components/coupons/index.wxml +++ b/components/coupons/index.wxml @@ -1,25 +1,27 @@ - + - {{data.title}} + {{data.title}} {{data.subTitle}} - - 满¥{{data.usePriceStr}}可用 + + {{data.salePriceStr}} + + 满¥{{data.usePriceStr}}可用 + + + 仅限本店使用 + - - 仅限本店使用 - - 剩余库存: {{data.remainInventory}} - ¥{{data.salePriceStr}} - ¥{{data.priceStr}} + 剩余: {{data.remainInventory}} + 领取 购买 diff --git a/components/coupons/index.wxss b/components/coupons/index.wxss index bf90000..8d3d2aa 100644 --- a/components/coupons/index.wxss +++ b/components/coupons/index.wxss @@ -32,25 +32,27 @@ } .coupons-info-name { - font-size: 30rpx; + font-size: 28rpx; color: #000000; letter-spacing: 0; - line-height: 42rpx; - font-weight: bold; - margin-top: 10rpx; + line-height: 38rpx; } .coupons-info-price { - padding: 10rpx 0 15rpx; - height: 88rpx; + padding: 32rpx 0 0; +} +.i{ + font-size: 20rpx; + font-style: normal; } .coupons-info-price-p { - display: block; - text-align: center; + display: inline-block; font-size: 36rpx; - color: #ff3434; + color: #f96563; line-height: 50rpx; } - +.tit{ + margin-top: 32rpx; +} .coupons-info-price-o { display: block; text-align: center; @@ -96,15 +98,16 @@ line-height: 50rpx !important; } .subtitle { - font-size: 26rpx; + font-size: 22rpx; color: #333; font-weight: 100; + text-align: left; } .coupons-info-manjian { - color: #999; - font-size: 26rpx; + color: #fa7c7a; + font-size: 20rpx; line-height: 34rpx; - font-weight: 100; + display: inline-block; } /**上拉加载更多**/ @@ -124,7 +127,10 @@ .userinfo-nickname { color: #aaa; } - +.sy{ + display: block; + text-align: center; +} .usermotto { margin-top: 200px; } diff --git a/config/config.js b/config/config.js index ffee7c0..20eaace 100755 --- a/config/config.js +++ b/config/config.js @@ -6,125 +6,125 @@ var config = { /** * 接口用途:login */ - login: '/user/login', + login: "/user/login", /** * 授权后获取用户的昵称,unionId等信息 */ - getUserInfo: '/user/getUserInfo', + getUserInfo: "/user/getUserInfo", /** * 接口用途:授权后获取用户的手机号 */ - getUserPhone: '/user/getUserPhone', + getUserPhone: "/user/getUserPhone", /** * 检查用户授权状态 */ - checkUserStatus: '/user/checkUserStatus', + checkUserStatus: "/user/checkUserStatus", /** * 检查用户手机授权状态 */ - checkPhoneStatus: '/user/checkPhoneStatus', + checkPhoneStatus: "/user/checkPhoneStatus", /** * 优惠券查询 */ - couponList: '/wxCoupon/list', + couponList: "/wxCoupon/list", /** * 优惠券详情 */ - couponDetail: '/wxCoupon/findById', + couponDetail: "/wxCoupon/detail", /** * 业态查询 */ - businessList: '/wxBusiness/list', // TODO + businessList: "/wxBusiness/list", /** * 频道查询 */ - couponChannelList: '/wxCouponChannel/list', + couponChannelList: "/wxCouponChannel/list", /** * 下订单 */ - orderSave: '/order/save', + orderSave: "/order/save", /** * 支付订单 */ - payOrderCreate: '/pay/create', + payOrderCreate: "/pay/create", /** * 订单状态更新 */ - payOrderUpdate: '/pay/updatePayOrder', + payOrderUpdate: "/pay/updatePayOrder", /** * 订单列表 */ - orderList: '/order/list', + orderList: "/order/list", /** * 券包 */ - couponOrderList: '/couponOrder/list', + couponOrderList: "/couponOrder/list", /** * 券包详情 */ - couponOrderDetail: '/couponOrder/detail', /// TODO + couponOrderDetail: "/couponOrder/detail", /// TODO /** * 验证码发送 */ - sendValidationCode: '/wxMsgValidationcode/sendvalidationcode', + sendValidationCode: "/wxMsgValidationcode/sendvalidationcode", /** * 验证码确认 */ - validationCode: '/wxMsgValidationcode/hasvalidationcode', + validationCode: "/wxMsgValidationcode/hasvalidationcode", /** * 车场信息获取 */ - getParkInfo: '/wxPark/info', + getParkInfo: "/wxPark/info", /** * 用户所绑车牌获取 */ - userCarCount: '/user/carCount', + userCarCount: "/user/carCount", /** * 用户所绑车牌获取 */ - getUserCarList: '/user/carList', + getUserCarList: "/user/carList", /** * 联合登录 */ - carInit: '/car/init', + carInit: "/car/init", /** * 绑车牌 */ - bindCar: '/car/bindCar', + bindCar: "/car/bindCar", /** * 解绑车牌 */ - unbindCar: '/car/unbindCar', + unbindCar: "/car/unbindCar", /** * 停车费 */ - getCarStopFee: '/car/getCarStopFee', + getCarStopFee: "/car/getCarStopFee", /** * 停车费抵扣 (TJD) */ - deductionFee: '/car/deductionFee', + deductionFee: "/car/deductionFee", /** - * 优免券领取 - */ - getCoupon: '/car/getCoupon', + * 优免券领取 + */ + getCoupon: "/car/getCoupon", /** * banner */ - bannerlist:'/wxCampaign/list' + bannerlist: "/wxCampaign/list" }, weapp: { - AppId: 'wx8eb8275b78db4ede', + AppId: "wx8eb8275b78db4ede" }, ErrorCode: { NICK_NOT_AUTH: 11004, PHONE_NOT_AUTH: 11005, - PHONE_IS_ENCRYPTED: 11006, - }, + PHONE_IS_ENCRYPTED: 11006 + } }; /* for (var key in config.api) { config.api[key] = apiPrefix + config.api[key]; } */ -module.exports = config; \ No newline at end of file +module.exports = config; diff --git a/dist/tab/index.js b/dist/tab/index.js index c8d3079..eed380f 100644 --- a/dist/tab/index.js +++ b/dist/tab/index.js @@ -1,50 +1,50 @@ Component({ - externalClasses: ['i-class'], + externalClasses: ["i-class"], - relations: { - '../tabs/index': { - type: 'parent' - } - }, + relations: { + "../tabs/index": { + type: "parent" + } + }, - properties: { - key: { - type: String, - value: '' - }, - title: { - type: String, - value: '' - }, - dot: { - type: Boolean, - value: false - }, - count: { - type: Number, - value: 0 - } + properties: { + key: { + type: String, + value: "" }, - - data: { - current: false, - currentColor: '', - scroll: false + title: { + type: String, + value: "" }, + dot: { + type: Boolean, + value: false + }, + count: { + type: Number, + value: 0 + } + }, - methods: { - changeCurrent (current) { - this.setData({ current }); - }, - changeCurrentColor (currentColor) { - this.setData({ currentColor }); - }, - changeScroll (scroll) { - this.setData({ scroll }); - }, - handleClickItem () { - const parent = this.getRelationNodes('../tabs/index')[0]; - parent.emitEvent(this.data.key); - } + data: { + current: false, + currentColor: "", + scroll: false + }, + + methods: { + changeCurrent(current) { + this.setData({ current }); + }, + changeCurrentColor(currentColor) { + this.setData({ currentColor }); + }, + changeScroll(scroll) { + this.setData({ scroll }); + }, + handleClickItem() { + const parent = this.getRelationNodes("../tabs/index")[0]; + parent.emitEvent(this.data.key); } + } }); diff --git a/dist/tab/index.wxml b/dist/tab/index.wxml index 29d3955..c7079c2 100644 --- a/dist/tab/index.wxml +++ b/dist/tab/index.wxml @@ -1,7 +1,8 @@ - {{ title }} + {{ + title }} {{ title }} diff --git a/pages/addPark/addPark.wxss b/pages/addPark/addPark.wxss index b1879a0..4d5ec35 100644 --- a/pages/addPark/addPark.wxss +++ b/pages/addPark/addPark.wxss @@ -88,14 +88,14 @@ } .addpark-choose-font { - width: 66rpx; - height: 66rpx; + width: 80rpx; + height: 77rpx; background: #f8f8f8; text-align: center; - line-height: 66rpx; + line-height: 77rpx; border: 1 px solid #f8f8f8; border-radius: 8rpx; - margin: 10rpx; + margin: 5rpx; } .addpark-choose-font p{ @@ -104,6 +104,7 @@ .addpark-choose-font p image{ width:5vmin; height:3.5vmin; + margin-top: -0.8vmin; vertical-align: middle; } .addpark-choose-num { @@ -120,7 +121,6 @@ } .choose-title{ border:6rpx solid #ffd255; - } .addpark-button-submit{ diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index dc2589d..5343e8c 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -13,6 +13,8 @@ Page({ }, onLoad(options) { let that = this; + console.log(options.id); + console.log(options.targetAd); wx.showLoading({ title: "加载中..." }); @@ -23,7 +25,8 @@ Page({ Http.get({ url: config.api.couponDetail, data: { - id: options.id + couponId: options.id, + targetAd:options.targetAd } }).then(res => { console.log(res); diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index 5222995..b384ab6 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -1,3 +1,4 @@ + - - + - + \ No newline at end of file diff --git a/pages/index/rushToBuy/index.js b/pages/index/rushToBuy/index.js index 0875c64..51b66d0 100644 --- a/pages/index/rushToBuy/index.js +++ b/pages/index/rushToBuy/index.js @@ -12,51 +12,46 @@ Component({ * 组件的初始数据 */ data: { - list: [ - // { - // img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg", - // name: "海鲜焗饭", - // time: "2天12小时25分钟", - // oPrice: "59.00", - // pPrice: "1.00", - // }, - // { - // img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg", - // name: "海鲜焗饭", - // time: "2天12小时25分钟", - // oPrice: "59.00", - // pPrice: "1.00", - // }, - // { - // img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg", - // name: "海鲜焗饭", - // time: "2天12小时25分钟", - // oPrice: "59.00", - // pPrice: "1.00", - // }, - // { - // img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg", - // name: "海鲜焗饭", - // time: "2天12小时25分钟", - // oPrice: "59.00", - // pPrice: "1.00", - // }, - ] + list: [] }, /** * 组件的方法列表 */ - methods: {}, + methods: { + gotomore: function() { + wx.navigateTo({ + url: "/pages/rushToBuy/index", + success: function(res) { + // success + }, + fail: function() { + // fail + }, + complete: function() { + // complete + } + }); + }, + gotodetail: function(e) { + console.log(e); + console.log("出错啦 大哥") + console.log(e.currentTarget.dataset.couponid); + console.log(e.currentTarget.dataset.targetad); + wx.navigateTo({ + url: `/pages/coupon/detail/index?id=${e.currentTarget.dataset.couponid}&targetAd=${e.currentTarget.dataset.targetad}` + }); + } + }, ready() { app.couponChannelListCallback = token => { - console.log("couponChannelList init"); Http.setToken(token); Http.get({ url: config.api.couponChannelList, data: { pageNum: 1, - pageSize: 10 + pageSize: 2, + targetAd: 2 } }).then(res => { console.log(res); diff --git a/pages/index/rushToBuy/index.wxml b/pages/index/rushToBuy/index.wxml index 691add0..d10334f 100644 --- a/pages/index/rushToBuy/index.wxml +++ b/pages/index/rushToBuy/index.wxml @@ -1,8 +1,8 @@ - 限时抢购 + 限时抢购查看更多> - + {{item.subTitle}} @@ -11,7 +11,7 @@ ¥{{item.priceStr}} - + \ No newline at end of file diff --git a/pages/index/rushToBuy/index.wxss b/pages/index/rushToBuy/index.wxss index 1a01bd6..f31903a 100644 --- a/pages/index/rushToBuy/index.wxss +++ b/pages/index/rushToBuy/index.wxss @@ -11,6 +11,12 @@ padding-left: 30rpx; } +.index-rushToBuy-title text{ + float: right; + margin-right: 20rpx; + color: #f96563; + font-size: 26rpx; +} .index-scroll-view { width: 100%; white-space: nowrap; @@ -24,7 +30,7 @@ position: relative; background: #fff; /* border: 1rpx solid #dddee1; */ - width: 392rpx; + width: 355rpx; box-shadow: 0 0 10px 0 rgba(211,211,211,0.50); border-radius: 10rpx; } @@ -32,7 +38,7 @@ margin-right: 30rpx; } .index-scroll-view .commodity-img { - height: 187rpx; + height: 213rpx; } .index-scroll-view .commodity-img image{ width: 100%; diff --git a/pages/passCar/passCar.js b/pages/passCar/passCar.js index a06d878..fc196a7 100644 --- a/pages/passCar/passCar.js +++ b/pages/passCar/passCar.js @@ -7,6 +7,7 @@ Page({ park: null, carList: [], addCar: null, + tcq:2 }, onLoad: function(options) { var that = this @@ -28,6 +29,20 @@ Page({ }) } }, + //我的停车券的显示与消失 + showquan:function(){ + let that = this; + if(that.data.tcq==1){ + that.setData({ + tcq:2 + }) + } + else if (that.data.tcq == 2) { + that.setData({ + tcq: 1 + }) + } + }, jumpToAdd: function() { wx.navigateTo({ url: '/pages/addPark/addPark', diff --git a/pages/passCar/passCar.wxml b/pages/passCar/passCar.wxml index 7df7f59..b9ca435 100644 --- a/pages/passCar/passCar.wxml +++ b/pages/passCar/passCar.wxml @@ -25,18 +25,19 @@ - 点击添加我的爱车 + +添加爱车 - + 我的停车券 - + + - + 2小时免费停车券 ¥10.00元 diff --git a/pages/passCar/passCar.wxss b/pages/passCar/passCar.wxss index de8eb5e..09d747d 100644 --- a/pages/passCar/passCar.wxss +++ b/pages/passCar/passCar.wxss @@ -14,8 +14,8 @@ page{ .headBox image{ width: 150rpx; height: 150rpx; - margin-right: 62rpx; - border: 1px #cbcbcb solid; + margin-right: 30rpx; + border-radius:16rpx; } .numberBox{ width: 400rpx; @@ -24,12 +24,11 @@ page{ .titleName{ line-height: 60rpx; height:60rpx; - color: #333; - font-size: 36rpx; + color: #666; + font-size: 32rpx; width: 400rpx; word-break:break-all; text-align: justify; - } ::-webkit-scrollbar{ width: 0; @@ -38,10 +37,10 @@ color: transparent; } .carLocation,.locationNumber{ width: 400rpx; - height: 50rpx; - color: #333; - font-size: 28rpx; - line-height: 50rpx; + height: 40rpx; + color: #666; + font-size: 24rpx; + line-height: 30rpx; } .borderBox{ width: 750rpx; @@ -78,8 +77,14 @@ color: transparent; left: 50%; top: 50%; transform: translate(-50%,-50%); - font-size: 36rpx; - color: #333; + font-size: 34rpx; + color: #666; + border:2px dashed #eee; + padding: 30rpx 50rpx; + border-radius:16rpx; +} +.add text{ + font-size: 40rpx; } .bottonBox{ width: 750rpx; diff --git a/pages/rushToBuy/index.js b/pages/rushToBuy/index.js index daae2ca..bda8e9d 100644 --- a/pages/rushToBuy/index.js +++ b/pages/rushToBuy/index.js @@ -1,65 +1,94 @@ +// pages/index/sw/index.js +let config = require("../../config/config.js"); +let Http = require("../../utils/HttpBasics"); +const app = getApp(); Page({ - /** * 页面的初始数据 */ data: { - + list: [] }, /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { - - }, + onLoad: function(options) {}, /** * 生命周期函数--监听页面初次渲染完成 */ - onReady: function () { - - }, /** * 生命周期函数--监听页面显示 */ - onShow: function () { - + onReady: function() { + app.couponChannelListCallback = token => { + Http.setToken(token); + Http.get({ + url: config.api.couponChannelList, + data: { + pageNum: 2, + pageSize: 2, + targetAd: 2 + } + }).then(res => { + console.log(res); + console.log("限时抢购页面"); + this.setData({ + list: res.data.list + }); + }); + }; + if (app.globalData.token && app.globalData.token != null) { + console.log("couponChannelList init 1"); + app.couponChannelListCallback(app.globalData.token); + } + }, + //限时抢购的强请页面 + gotodetail: function(e) { + console.log(e) + console.log("姐姐在测试") + console.log(e.currentTarget.dataset.couponid); + console.log(e.currentTarget.dataset.targetad); + wx.navigateTo({ + url: `/pages/coupon/detail/index?id=${e.currentTarget.dataset.couponid}&targetAd=${e.currentTarget.dataset.targetad}`, + success: function(res) { + // success + }, + fail: function() { + // fail + }, + complete: function() { + // complete + } + }); }, - /** * 生命周期函数--监听页面隐藏 */ - onHide: function () { - - }, + onHide: function() {}, /** * 生命周期函数--监听页面卸载 */ - onUnload: function () { - - }, + onUnload: function() {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh: function () { - + onPullDownRefresh: function() { + console.log(""); }, /** * 页面上拉触底事件的处理函数 */ - onReachBottom: function () { - + onReachBottom: function() { }, /** * 用户点击右上角分享 */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file + onShareAppMessage: function() {} +}); diff --git a/pages/rushToBuy/index.wxml b/pages/rushToBuy/index.wxml index 1a9462b..fad732c 100644 --- a/pages/rushToBuy/index.wxml +++ b/pages/rushToBuy/index.wxml @@ -1,85 +1,31 @@ - + - + - - - - - - - 黑椒牛排 - 小程序专享 - - - ¥1.00 - ¥59.00 - - - - - 剩余时间:2天 12小时25分钟 - - 剩余件数:19件 - 购买 - - - + + + - - - - - - - - - - 黑椒牛排 - 小程序专享 - - - ¥1.00 - ¥59.00 - - + + + {{item.title}} + {{item.subTitle}} - - 剩余时间:2天 12小时25分钟 - - 剩余件数:19件 - 购买 - - + + ¥{{item.salePriceStr}} + ¥{{item.priceStr}} - - - - - - - - - - 黑椒牛排 - 小程序专享 - - - ¥1.00 - ¥59.00 - - - - - 剩余时间:2天12小时25分钟 - - 剩余件数:19件 - 购买 - - - + + + 剩余时间:2天 12小时25分钟 + + 剩余件数:{{item.remainInventory}}件 + 购买 + + - - + + + \ No newline at end of file diff --git a/pages/rushToBuy/index.wxss b/pages/rushToBuy/index.wxss index a857ddf..215d2b7 100644 --- a/pages/rushToBuy/index.wxss +++ b/pages/rushToBuy/index.wxss @@ -54,7 +54,7 @@ margin-top: 15rpx; } .flashSaleItemTopRBottom{ - margin-top: 50rpx; + margin-top: 24rpx; } .presentPrice{ font-size: 36rpx; @@ -101,4 +101,5 @@ border-radius: 10rpx; margin-left: 350rpx; font-size: 28rpx; + margin-top: -23rpx; } \ No newline at end of file diff --git a/pages/user/index.wxss b/pages/user/index.wxss index 818e47c..ed27b4a 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -62,7 +62,7 @@ display: flex; height: 88rpx; font-size: 30rpx; - color: #000; + color: #666; line-height: 88rpx; border-bottom: 1rpx solid #eee; }