From 39ffb4ac55377a9adc85a7415e06bfb35df430cd Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Mon, 3 Sep 2018 11:41:42 +0800 Subject: [PATCH 1/6] =?UTF-8?q?[=E6=88=91=E7=9A=84=E5=88=B8=E5=8C=85][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E6=88=91=E7=9A=84=E5=88=B8=E5=8C=85?= =?UTF-8?q?=E6=A0=B8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/couponorder/detail/index.js | 39 ++++++++++++++++++------ pages/couponorder/index/index.js | 5 ++-- pages/couponorder/index/index.wxml | 6 ++-- pages/order/detail/index.js | 3 +- pages/orderquanma/index.js | 48 +++++++++++++++++++++++------- project.config.json | 4 +-- 6 files changed, 75 insertions(+), 30 deletions(-) diff --git a/pages/couponorder/detail/index.js b/pages/couponorder/detail/index.js index 153f578..0e0ad4a 100644 --- a/pages/couponorder/detail/index.js +++ b/pages/couponorder/detail/index.js @@ -25,11 +25,13 @@ Page({ }); //获得优惠券的详情 - if ( - options.quancode != null && - (options.quancode != "" && options.quancode) != undefined - ) { - that.data.setInter = setInterval(function(){ + that.data.setInter = setInterval(function() { + if ( + options.quancode != null && + options.quancode != "" && + options.quancode != undefined && + options.couponorderstatus == 0 + ) { Http.get({ url: config.api.couponOrderDetail, data: { @@ -46,10 +48,29 @@ Page({ createDate: util.fmtDate(that.data.data.createDate) }); }); - }, 200); - } - util.barcode("barcode", options.quancode, 510, 100); - util.qrcode("qrcode", options.quancode, 350, 350); + } + }, 2000); + + // if (options.couponorderstatus != "0") { + Http.get({ + url: config.api.couponOrderDetail, + data: { + couponOrderId: options.quancode + } + }).then(res => { + console.log(res); + that.setData({ + data: res.data + }); + that.setData({ + expiredTime: util.fmtDate(that.data.data.expiredTime), + updateDate: util.fmtDate(that.data.data.updateDate), + createDate: util.fmtDate(that.data.data.createDate) + }); + util.barcode("barcode", options.quancode, 510, 100); + util.qrcode("qrcode", options.quancode, 350, 350); + }); + // } }, phone: function() { let that = this; diff --git a/pages/couponorder/index/index.js b/pages/couponorder/index/index.js index b718208..814bf38 100644 --- a/pages/couponorder/index/index.js +++ b/pages/couponorder/index/index.js @@ -35,12 +35,11 @@ Page({ //点击跳转到券详情页面 gotouse: function(e) { - console.log(e.currentTarget.dataset.quancode); + console.log(e.currentTarget.dataset.couponorderstatus); console.log("点击跳转到券详情"); wx.navigateTo({ url: `/pages/couponorder/detail/index?quancode=${ - e.currentTarget.dataset.quancode - }` + e.currentTarget.dataset.quancode}&couponorderstatus=${e.currentTarget.dataset.couponorderstatus}` }); }, getList(key, pageNum) { diff --git a/pages/couponorder/index/index.wxml b/pages/couponorder/index/index.wxml index 340a8ec..8525e4d 100644 --- a/pages/couponorder/index/index.wxml +++ b/pages/couponorder/index/index.wxml @@ -12,7 +12,7 @@ - + - 立即使用 - 查看 + 立即使用 + 查看 diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index 5316b27..bc70beb 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -29,7 +29,7 @@ Page({ // 2 已过期 // 3 已经退款 console.log(e); - if (that.data.mystatus == null || that.data.mystatus == undefined) { + if (that.data.mystatus == "" || that.data.mystatus == undefined) { wx.navigateTo({ url: `/pages/orderquanma/index?quancode=${ e.currentTarget.dataset.quancode @@ -213,7 +213,6 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onShow: function() { - console.log(this.data.mystatus) }, /** diff --git a/pages/orderquanma/index.js b/pages/orderquanma/index.js index 3bce14b..4f70f7e 100644 --- a/pages/orderquanma/index.js +++ b/pages/orderquanma/index.js @@ -11,6 +11,8 @@ Page({ let that = this; util.barcode("barcode", options.quancode, 500, 100); util.qrcode("qrcode", options.quancode, 350, 350); + + console.log("zhuangtai"); that.setData({ code: options.quancode, title: options.title, @@ -18,6 +20,12 @@ Page({ remark: options.remark, couponorderstatus: options.couponorderstatus }); + + console.log(options.couponorderstatus); + console.log("我是状态"); + /** + * 如果没有核销 + */ that.data.setInter = setInterval(function() { if (that.data.couponorderstatus == 0) { Http.get({ @@ -30,20 +38,38 @@ Page({ that.setData({ couponorderstatus: res.data.CouponOrderStatus }); - - /** - * 动态改变上一级页面的核销状态 - */ - var pages = getCurrentPages(); - var currPage = pages[pages.length - 1]; //当前页面 - var prevPage = pages[pages.length - 2]; //上一个页面 - //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 - prevPage.setData({ - mystatus:res.data.CouponOrderStatus - }); + if (res.data.CouponOrderStatus == 1) { + /** + * 动态改变上一级页面的核销状态 + */ + var pages = getCurrentPages(); + var prevPage = pages[pages.length - 2]; //上一个页面 + //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 + prevPage.setData({ + mystatus: res.data.CouponOrderStatus + }); + } }); } }, 2000); + + if (that.data.couponorderstatus == 1) { + /** + * 如果已经核销 + * 不需要循环 + */ + Http.get({ + url: config.api.getStatus, + data: { + couponOrderId: options.quancode + } + }).then(res => { + console.log(res); + that.setData({ + couponorderstatus: res.data.CouponOrderStatus + }); + }); + } /** * couponorderstatus * 0 没有核销 diff --git a/project.config.json b/project.config.json index e71147c..9232e07 100644 --- a/project.config.json +++ b/project.config.json @@ -1,5 +1,5 @@ { - "description": "项目配置文件。", + "description": "项目配置文件, "packOptions": { "ignore": [] }, @@ -11,7 +11,7 @@ "newFeature": true }, "compileType": "miniprogram", - "libVersion": "2.2.4", + "libVersion": "2.2.5", "appid": "wxb11603577a84a86d", "projectname": "%E5%AF%8C%E8%8C%82%E9%93%BE%E5%AE%A2%E6%B5%8B%E8%AF%95", "isGameTourist": false, From fcff1d340e37ce8020057d195c0ad932a7c21016 Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Mon, 3 Sep 2018 12:20:29 +0800 Subject: [PATCH 2/6] =?UTF-8?q?[=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6][=E4=BF=AE=E6=94=B9]:=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B9=B1=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.config.json b/project.config.json index 9232e07..7b10aac 100644 --- a/project.config.json +++ b/project.config.json @@ -1,5 +1,5 @@ { - "description": "项目配置文件, + "description": "项目配置文件�", "packOptions": { "ignore": [] }, From 986106bed3ca14cb3525086f8a8e3de961d2e857 Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Mon, 3 Sep 2018 12:24:11 +0800 Subject: [PATCH 3/6] =?UTF-8?q?[=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B9=B1=E7=A0=81][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project.config.json b/project.config.json index 7b10aac..c219d11 100644 --- a/project.config.json +++ b/project.config.json @@ -1,5 +1,5 @@ { - "description": "项目配置文件�", + "description": "项目配置文件", "packOptions": { "ignore": [] }, @@ -13,7 +13,7 @@ "compileType": "miniprogram", "libVersion": "2.2.5", "appid": "wxb11603577a84a86d", - "projectname": "%E5%AF%8C%E8%8C%82%E9%93%BE%E5%AE%A2%E6%B5%8B%E8%AF%95", + "projectname": "富茂链客", "isGameTourist": false, "condition": { "search": { From 2b648d3f40073fdb09ee6fa8dacd3270b607ac80 Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Mon, 3 Sep 2018 13:15:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?[=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.config.json b/project.config.json index c219d11..d7c39ff 100644 --- a/project.config.json +++ b/project.config.json @@ -13,7 +13,7 @@ "compileType": "miniprogram", "libVersion": "2.2.5", "appid": "wxb11603577a84a86d", - "projectname": "富茂链客", + "projectname": "%E5%AF%8C%E8%8C%82%E9%93%BE%E5%AE%A2", "isGameTourist": false, "condition": { "search": { From 387dc53bced7a0116583edd871b2fd1138ad2b39 Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Mon, 3 Sep 2018 13:32:58 +0800 Subject: [PATCH 5/6] =?UTF-8?q?[banner=E5=9B=BE=E5=A2=9E=E5=8A=A0][?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0]:banner=E5=9B=BE=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index db85539..c94f220 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -24,7 +24,7 @@ Page({ }, onShow: function() { - this.userLogin() + this.userLogin(); }, onGetCode: function(e) { @@ -42,33 +42,32 @@ Page({ var that = this; // 登录 wx.login({ - success: ({ - code - }) => { + success: ({ code }) => { var usrdata = { appId: config.weapp.AppId, code: code, - sceneAddress: app.globalData.sceneAddress, - } + sceneAddress: app.globalData.sceneAddress + }; if (app.globalData.locationInfo) { usrdata = { appId: config.weapp.AppId, code: code, sceneAddress: app.globalData.sceneAddress, - latitude: '' + app.globalData.locationInfo.latitude, - longitude: '' + app.globalData.locationInfo.longitude, - } + latitude: "" + app.globalData.locationInfo.latitude, + longitude: "" + app.globalData.locationInfo.longitude + }; } 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; Http.setToken(res.data.token); that.checkUserCarStatus(); that.getUserInfo(); + that.getBannerlist(); if (app.couponChannelListCallback) { app.couponChannelListCallback(app.globalData.token); } @@ -99,6 +98,25 @@ Page({ }); }, + /** + * banner + */ + getBannerlist: function() { + let that = this; + Http.get({ + url: config.api.bannerlist, + data: { + pageNum: 1, + pageSize: 10 + } + }).then(res => { + console.log(res); + that.setData({ + list: res.data.list + }); + console.log(res.data.list); + }); + }, /** * 检查用户是否有车 */ From 2fffbb04081b3e7b202660d987e4fc26cb3d1f3f Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Mon, 3 Sep 2018 15:08:09 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/config/config.js b/config/config.js index 98a0aac..b808e51 100755 --- a/config/config.js +++ b/config/config.js @@ -129,7 +129,6 @@ var config = { */ getStatus:"/couponOrder/getStatus" }, - weapp: { AppId: "wxb11603577a84a86d" },