diff --git a/api/interfaces/index.js b/api/interfaces/index.js index 8f256f5..1d7093e 100644 --- a/api/interfaces/index.js +++ b/api/interfaces/index.js @@ -73,6 +73,9 @@ const fridayPay = (trade_no) => req({url: "payments/welfare/wechat",method: "POS //洗车券-获取跳转地址 const washcarUrl = (welfare_id, right_config_id) => req({url: "washcar/infourl", data: {welfare_id: welfare_id, right_config_id: right_config_id}}) +//洗车券-获取跳转地址 +const washcarCoupon = (coupon) => req({url: "washcar/" + coupon + "/info",method: "POST"}) + //首页轮播-跳转本页面 --业务数据查看 const busineSee = (business) => req({url: "business/" + business}) @@ -107,6 +110,7 @@ export default({ fridayInfo, fridayPay, washcarUrl, + washcarCoupon, busineSee, busineForm, subscribe diff --git a/api/interfaces/user.js b/api/interfaces/user.js index 5c9cf81..0d0d979 100644 --- a/api/interfaces/user.js +++ b/api/interfaces/user.js @@ -52,6 +52,9 @@ const unicom = (mobile, channel, code) => req({url: "unicom/get", method: "POST" // 获取商家券信息 const merchant_card = (coupon_id) => req({url: "coupons/merchant_card", method: "GET", data:{coupon_id : coupon_id}}) +// 获取商家券信息 +const washcarBuy = () => req({url: "washcar/create"}) + export default({ index, mobiles, @@ -69,5 +72,6 @@ export default({ ungrants, send, unicom, - merchant_card + merchant_card, + washcarBuy }) diff --git a/app.json b/app.json index 57d1dad..a0a1713 100644 --- a/app.json +++ b/app.json @@ -27,7 +27,8 @@ "pages/welfare/welfare", "pages/classify/classify", "pages/washcar/washcar", - "pages/makeForm/makeForm" + "pages/makeForm/makeForm", + "pages/car/index" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/car/index.js b/pages/car/index.js new file mode 100644 index 0000000..9b12f68 --- /dev/null +++ b/pages/car/index.js @@ -0,0 +1,37 @@ +/* + * 本时生活 + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + console.log(options) + // this.couponInfo() + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + + }, + + /** + * 卡券列表 + */ + couponInfo() { + wx.$api.user.washcarBuy().then(res=>{ + console.log(res) + }) + } +}) \ No newline at end of file diff --git a/pages/car/index.json b/pages/car/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/car/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/car/index.wxml b/pages/car/index.wxml new file mode 100644 index 0000000..1065238 --- /dev/null +++ b/pages/car/index.wxml @@ -0,0 +1,2 @@ + +pages/car/index.wxml diff --git a/pages/car/index.wxss b/pages/car/index.wxss new file mode 100644 index 0000000..367ebdc --- /dev/null +++ b/pages/car/index.wxss @@ -0,0 +1 @@ +/* pages/car/index.wxss */ \ No newline at end of file diff --git a/pages/coupon/coupon.js b/pages/coupon/coupon.js index 18a1096..f906b50 100644 --- a/pages/coupon/coupon.js +++ b/pages/coupon/coupon.js @@ -92,5 +92,36 @@ Page({ delta: 1 }) } + }, + + // 优惠券跳转 + couponUrl(e) { + let newFrom = e.currentTarget.dataset.from, + newId = e.currentTarget.dataset.id, + newStatus = e.currentTarget.dataset.status + if(newStatus == 0) { + if(newFrom == 'washcar') { + wx.$api.index.washcarCoupon(newId).then(res=>{ + const newUrl = res.data + let url= encodeURIComponent(newUrl) + wx.redirectTo({ + // 跳转到webview页面 + url: `/pages/washcar/washcar?url=${url}` + }); + }).catch(err=>{ + if(!err.login){ + // 写入缓存 + wx.setStorage({ + key : 'token', + data : '' + }) + } + }) + return + } + wx.navigateTo({ + url: '/pages/couponDetails/couponDetails?id=' + newId + }) + } } }) \ No newline at end of file diff --git a/pages/coupon/coupon.wxml b/pages/coupon/coupon.wxml index ad60812..c200693 100644 --- a/pages/coupon/coupon.wxml +++ b/pages/coupon/coupon.wxml @@ -16,7 +16,8 @@ - + + @@ -54,7 +55,7 @@ - + 查看全部{{item.count}}张卡券 diff --git a/pages/couponArr/couponArr.js b/pages/couponArr/couponArr.js index 51856a7..d952bdf 100644 --- a/pages/couponArr/couponArr.js +++ b/pages/couponArr/couponArr.js @@ -64,6 +64,37 @@ Page({ pageNumber++ this.couponInfo(pageNumber) } + }, + + // 优惠券跳转 + couponUrl(e) { + let newFrom = e.currentTarget.dataset.from, + newId = e.currentTarget.dataset.id, + newStatus = e.currentTarget.dataset.status + if(newStatus == 0) { + if(newFrom == 'washcar') { + wx.$api.index.washcarCoupon(newId).then(res=>{ + const newUrl = res.data + let url= encodeURIComponent(newUrl) + wx.redirectTo({ + // 跳转到webview页面 + url: `/pages/washcar/washcar?url=${url}` + }); + }).catch(err=>{ + if(!err.login){ + // 写入缓存 + wx.setStorage({ + key : 'token', + data : '' + }) + } + }) + return + } + wx.navigateTo({ + url: '/pages/couponDetails/couponDetails?id=' + newId + }) + } } /** diff --git a/pages/couponArr/couponArr.wxml b/pages/couponArr/couponArr.wxml index 55ac026..3de02da 100644 --- a/pages/couponArr/couponArr.wxml +++ b/pages/couponArr/couponArr.wxml @@ -1,7 +1,8 @@ - + + @@ -47,7 +48,7 @@ - + 加载中... diff --git a/pages/frozen/frozen.js b/pages/frozen/frozen.js index adad58a..e6e5157 100644 --- a/pages/frozen/frozen.js +++ b/pages/frozen/frozen.js @@ -33,6 +33,7 @@ Page({ */ frozenInfo() { wx.$api.user.ungrants(this.data.type).then(res=>{ + console.log(res.data) this.setData({ frozenData: res.data }) diff --git a/pages/frozen/frozen.wxml b/pages/frozen/frozen.wxml index 96eb956..aa2a5d3 100644 --- a/pages/frozen/frozen.wxml +++ b/pages/frozen/frozen.wxml @@ -105,7 +105,7 @@ 返回上一个权益 - + 查看下一个权益 diff --git a/pages/rights/rights.js b/pages/rights/rights.js index 1a3bb53..461f4ef 100644 --- a/pages/rights/rights.js +++ b/pages/rights/rights.js @@ -219,6 +219,7 @@ Page({ * 选择收货地址 */ selectAddress(e){ + console.log(e) let new_addressId = e.currentTarget.dataset.id, addressId = this.data.address.id if (new_addressId != addressId) { diff --git a/pages/switchcity/switchcity.js b/pages/switchcity/switchcity.js index e7fb2c9..b0d55b9 100644 --- a/pages/switchcity/switchcity.js +++ b/pages/switchcity/switchcity.js @@ -133,6 +133,8 @@ Page({ this.setData({ regiList : res.data }) + + console.log(this.data.regiList) }) }, @@ -140,6 +142,7 @@ Page({ * 选择市区返回 */ regionOpt (e) { + console.log(e) let area_name = e.currentTarget.dataset.city var pages = getCurrentPages(); var prevPage = pages[pages.length - 2]; diff --git a/pages/washcar/washcar.js b/pages/washcar/washcar.js index 721259a..5bf4602 100644 --- a/pages/washcar/washcar.js +++ b/pages/washcar/washcar.js @@ -15,6 +15,8 @@ Page({ this.setData({ url : decodeURIComponent(options.url) }) + + console.log(this.data.url) }, /** diff --git a/project.private.config.json b/project.private.config.json index ef37021..171800e 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -114,6 +114,12 @@ "pathName": "pages/switchcity/switchcity", "query": "", "scene": null + }, + { + "name": "pages/car/index", + "pathName": "pages/car/index", + "query": "", + "scene": null } ] }