| @@ -33,26 +33,29 @@ Component({ | |||||
| //获取砍价列表 | //获取砍价列表 | ||||
| getList() { | getList() { | ||||
| let that = this; | let that = this; | ||||
| let param ={ | |||||
| let param = { | |||||
| targetAd: 6, | targetAd: 6, | ||||
| } | } | ||||
| Http.get({ | Http.get({ | ||||
| url: config.api.change, | url: config.api.change, | ||||
| data:param, | data:param, | ||||
| }).then(res => { | }).then(res => { | ||||
| that.setData({ | |||||
| kData:res.data | |||||
| if(res.data){ | |||||
| that.setData({ | |||||
| kData:res.data, | |||||
| couponId: res.data.couponId | |||||
| }); | |||||
| } | |||||
| }) | |||||
| .catch(err => { | |||||
| console.log(err) | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | }); | ||||
| }) | }) | ||||
| .catch(err => { | |||||
| console.log(err) | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | }, | ||||
| //获取拼团列表 | //获取拼团列表 | ||||
| getptList() { | getptList() { | ||||
| @@ -63,38 +66,41 @@ Component({ | |||||
| url: config.api.change, | url: config.api.change, | ||||
| data: param1, | data: param1, | ||||
| }).then(res => { | }).then(res => { | ||||
| this.setData({ | |||||
| pData:res.data, | |||||
| couponId: res.data.couponId | |||||
| }); | |||||
| console.log( this.data.couponId) | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| if(res.data){ | |||||
| this.setData({ | |||||
| pData:res.data, | |||||
| couponId1: res.data.couponId | |||||
| }); | }); | ||||
| }) | |||||
| } | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | }, | ||||
| // 换一换 | // 换一换 | ||||
| getChange(){ | getChange(){ | ||||
| let param1 = { | |||||
| targetAd: 7, | |||||
| couponId: this.data.couponId1 | |||||
| } | |||||
| Http.get({ | |||||
| url: config.api.change, | |||||
| data: param1, | |||||
| }).then(res => { | |||||
| this.setData({ | |||||
| pData: res.data, | |||||
| couponId1: res.data.couponId | |||||
| }); | |||||
| }) | |||||
| if(this.data.couponId){ | |||||
| let that = this; | |||||
| let param = { | |||||
| targetAd: 6, | |||||
| couponid:this.data.couponId | |||||
| } | |||||
| Http.get({ | |||||
| url: config.api.change, | |||||
| data:param, | |||||
| }).then(res => { | |||||
| that.setData({ | |||||
| kData:res.data, | |||||
| couponId: res.data.couponId | |||||
| }); | |||||
| }) | |||||
| .catch(err => { | .catch(err => { | ||||
| console.log(err) | |||||
| wx.showToast({ | wx.showToast({ | ||||
| title: err.errMsg, | title: err.errMsg, | ||||
| icon: 'none', | icon: 'none', | ||||
| @@ -102,28 +108,31 @@ Component({ | |||||
| mask: false | mask: false | ||||
| }); | }); | ||||
| }) | }) | ||||
| let param = { | |||||
| targetAd: 6, | |||||
| couponId: this.data.couponId | |||||
| } | } | ||||
| Http.get({ | |||||
| url: config.api.change, | |||||
| data: param, | |||||
| }).then(res => { | |||||
| this.setData({ | |||||
| kData: res.data, | |||||
| couponId: res.data.couponId | |||||
| }); | |||||
| }) | |||||
| if(this.data.couponId1){ | |||||
| let param1 = { | |||||
| targetAd: 7, | |||||
| couponid1:this.data.couponId1 | |||||
| } | |||||
| Http.get({ | |||||
| url: config.api.change, | |||||
| data: param1, | |||||
| }).then(res => { | |||||
| this.setData({ | |||||
| pData:res.data, | |||||
| couponId1: res.data.couponId | |||||
| }); | |||||
| }) | |||||
| .catch(err => { | .catch(err => { | ||||
| console.log(err) | |||||
| wx.showToast({ | wx.showToast({ | ||||
| title: err.errMsg, | title: err.errMsg, | ||||
| icon: 'none', | icon: 'none', | ||||
| duration: 2000, | duration: 2000, | ||||
| mask: false | mask: false | ||||
| }); | }); | ||||
| }) | |||||
| }) | |||||
| } | |||||
| }, | }, | ||||
| //跳转砍价详情 | //跳转砍价详情 | ||||
| gotokjdetail: function (e) { | gotokjdetail: function (e) { | ||||
| @@ -155,6 +164,7 @@ Component({ | |||||
| Http.setToken(token); | Http.setToken(token); | ||||
| this.getList(); | this.getList(); | ||||
| this.getptList(); | this.getptList(); | ||||
| // this.getChange(); | |||||
| }; | }; | ||||
| if (app.globalData.token && app.globalData.token != null) { | if (app.globalData.token && app.globalData.token != null) { | ||||
| app.couponChannelListCallback(app.globalData.token); | app.couponChannelListCallback(app.globalData.token); | ||||
| @@ -34,29 +34,29 @@ | |||||
| "text": "首页", | "text": "首页", | ||||
| "iconPath": "assets/images/home.png", | "iconPath": "assets/images/home.png", | ||||
| "pagePath": "pages/main/index", | "pagePath": "pages/main/index", | ||||
| "selectedIconPath": "assets/images/home-a.png" | |||||
| "selectedIconPath": "assets/images/home-b.png" | |||||
| }, | }, | ||||
| { | { | ||||
| "text": "门店", | "text": "门店", | ||||
| "iconPath": "assets/images/mendian.png", | "iconPath": "assets/images/mendian.png", | ||||
| "pagePath": "pages/index/searchbar/index", | "pagePath": "pages/index/searchbar/index", | ||||
| "selectedIconPath": "assets/images/mendian-a.png" | |||||
| "selectedIconPath": "assets/images/mendian-b.png" | |||||
| }, | }, | ||||
| { | { | ||||
| "text": "停车", | "text": "停车", | ||||
| "iconPath": "assets/images/park.png", | "iconPath": "assets/images/park.png", | ||||
| "pagePath": "pages/passCar/passCar", | "pagePath": "pages/passCar/passCar", | ||||
| "selectedIconPath": "assets/images/park-a.png" | |||||
| "selectedIconPath": "assets/images/park-b.png" | |||||
| }, | }, | ||||
| { | { | ||||
| "text": "我的", | "text": "我的", | ||||
| "iconPath": "assets/images/user.png", | "iconPath": "assets/images/user.png", | ||||
| "pagePath": "pages/user/index", | "pagePath": "pages/user/index", | ||||
| "selectedIconPath": "assets/images/user-a.png" | |||||
| "selectedIconPath": "assets/images/user-b.png" | |||||
| } | } | ||||
| ], | ], | ||||
| "color": "#abb1be", | "color": "#abb1be", | ||||
| "selectedColor": "#b2743d" | |||||
| "selectedColor": "#FD832D" | |||||
| }, | }, | ||||
| "window": { | "window": { | ||||
| "backgroundTextStyle": "dark", | "backgroundTextStyle": "dark", | ||||
| @@ -5,7 +5,6 @@ const util = require("../../../utils/util"); | |||||
| const imgurl = require("../../../utils/imgurl"); | const imgurl = require("../../../utils/imgurl"); | ||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| isshowposter1: true,//是否显示发起砍价 | |||||
| isshowposter:false,//是否显示分享弹框 | isshowposter:false,//是否显示分享弹框 | ||||
| fenxiangUrl: imgurl.fenxiang.url, | fenxiangUrl: imgurl.fenxiang.url, | ||||
| clockUrl: imgurl.clock.url, | clockUrl: imgurl.clock.url, | ||||
| @@ -101,22 +100,7 @@ Page({ | |||||
| isshowposter: false, | isshowposter: false, | ||||
| }) | }) | ||||
| }, | }, | ||||
| /** | |||||
| * 显示发起砍价 | |||||
| */ | |||||
| showshare1: function () { | |||||
| this.setData({ | |||||
| isshowposter1: true, | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 隐藏发起砍价 | |||||
| */ | |||||
| hidemodal1: function () { | |||||
| this.setData({ | |||||
| isshowposter1: false, | |||||
| }) | |||||
| }, | |||||
| /** | /** | ||||
| * 跳转到门店列表的详情页面 | * 跳转到门店列表的详情页面 | ||||
| */ | */ | ||||
| @@ -151,11 +151,11 @@ | |||||
| <text>立即购买</text> | <text>立即购买</text> | ||||
| </button> | </button> | ||||
| </form> | </form> | ||||
| <view bindtap='showshare1' report-submit='true' class="fr"> | |||||
| <form bindsubmit="inviteFriend" report-submit='true' class="fr"> | |||||
| <button form-type="submit" style='background:transparent;color:#fff;font-size:32rpx;line-height:91rpx;' disabled='{{showbutton1}}' bindtap='showshare1'> | <button form-type="submit" style='background:transparent;color:#fff;font-size:32rpx;line-height:91rpx;' disabled='{{showbutton1}}' bindtap='showshare1'> | ||||
| 发起砍价 | 发起砍价 | ||||
| </button> | </button> | ||||
| </view> | |||||
| </form> | |||||
| </view> | </view> | ||||
| <!-- 问卷调查 --> | <!-- 问卷调查 --> | ||||
| @@ -219,6 +219,5 @@ | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <!-- 发起砍价弹框 --> | |||||
| <c-bargainDatail bindtap='hidemodal1' class="business" couponChannelId="{{data.id}}" wx:if="{{isshowposter1}}"/> | |||||
| </view> | </view> | ||||
| @@ -1,4 +1,7 @@ | |||||
| @import "../../../../app.wxss"; | @import "../../../../app.wxss"; | ||||
| page{ | |||||
| background: #F4F5F9; | |||||
| } | |||||
| .index-slide, swiper-item | .index-slide, swiper-item | ||||
| .index-slide-image { | .index-slide-image { | ||||
| display: block; | display: block; | ||||
| @@ -136,7 +139,7 @@ | |||||
| } | } | ||||
| .merchant-phones { | .merchant-phones { | ||||
| border-top:8px solid #efefef; | |||||
| /* border-top:8px solid #efefef; */ | |||||
| padding: 20rpx 0; | padding: 20rpx 0; | ||||
| display: block; | display: block; | ||||
| font-size: 30rpx; | font-size: 30rpx; | ||||
| @@ -198,7 +201,7 @@ | |||||
| .merchant-brand { | .merchant-brand { | ||||
| border: none !important; | border: none !important; | ||||
| width: 92%; | width: 92%; | ||||
| margin: 20rpx auto 20rpx; | |||||
| margin: 0 auto 20rpx; | |||||
| } | } | ||||
| .merchant-brand view:nth-child(2) text:nth-child(1) { | .merchant-brand view:nth-child(2) text:nth-child(1) { | ||||
| margin-top: 20rpx; | margin-top: 20rpx; | ||||
| @@ -345,6 +348,7 @@ | |||||
| /* margin: 30rpx auto 0; */ | /* margin: 30rpx auto 0; */ | ||||
| display:block; | display:block; | ||||
| text-align:center; | text-align:center; | ||||
| color: #999; | |||||
| } | } | ||||
| .modal { | .modal { | ||||
| width: 100%; | width: 100%; | ||||
| @@ -1,6 +1,7 @@ | |||||
| var config = require("../../config/config.js"); | var config = require("../../config/config.js"); | ||||
| const Http = require("../../utils/HttpBasics"); | const Http = require("../../utils/HttpBasics"); | ||||
| const imgurl = require("../../utils/imgurl"); | const imgurl = require("../../utils/imgurl"); | ||||
| const QR = require("../../utils/memberqrcode.js"); | |||||
| Page({ | Page({ | ||||
| /** | /** | ||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| @@ -92,11 +93,60 @@ Page({ | |||||
| .catch(err => { | .catch(err => { | ||||
| wx.showModal({ | wx.showModal({ | ||||
| title: '提示', | title: '提示', | ||||
| content: err.errMsg, | |||||
| content: err.message, | |||||
| showCancel: false | showCancel: false | ||||
| }) | }) | ||||
| }) | }) | ||||
| }, | }, | ||||
| //适配不同屏幕大小的canvas | |||||
| setCanvasSize: function () { | |||||
| var size = {}; | |||||
| try { | |||||
| var res = wx.getSystemInfoSync(); | |||||
| var scale = 750 / 500; | |||||
| //不同屏幕下canvas的适配比例;设计稿是750宽 | |||||
| var width = res.windowWidth / scale; | |||||
| var height = width; | |||||
| //canvas画布为正方形 | |||||
| size.w = width; | |||||
| size.h = height; | |||||
| } catch (e) { | |||||
| // Do something when catch error | |||||
| console.log("获取设备信息失败" + e); | |||||
| } | |||||
| return size; | |||||
| }, | |||||
| createQrCode: function (url, canvasId, cavW, cavH) { | |||||
| //调用插件中的draw方法,绘制二维码图片 | |||||
| QR.api.draw(url, canvasId, cavW, cavH); | |||||
| }, | |||||
| qrcode: function (e) { | |||||
| var that = this; | |||||
| that.setData({ | |||||
| showQrcode: true | |||||
| }) | |||||
| wx.showToast({ | |||||
| title: '生成中...', | |||||
| icon: 'loading', | |||||
| duration: 2000 | |||||
| }); | |||||
| var st = setTimeout(function () { | |||||
| wx.hideToast() | |||||
| var size = that.setCanvasSize(); | |||||
| var url = JSON.stringify({ | |||||
| END: "C", | |||||
| TYPE: "memberCode", | |||||
| ID: that.data.memberId, | |||||
| }) | |||||
| that.createQrCode(url, "mycanvas1", size.w, size.h); | |||||
| that.setData({ | |||||
| maskHidden: true | |||||
| }); | |||||
| clearTimeout(st); | |||||
| }, 1000) | |||||
| }, | |||||
| // 获得积分,渲染页面 | // 获得积分,渲染页面 | ||||
| getPoints(){ | getPoints(){ | ||||
| let that = this; | let that = this; | ||||
| @@ -578,9 +578,11 @@ Page({ | |||||
| wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
| }; | }; | ||||
| // 砍价下拉刷新 | // 砍价下拉刷新 | ||||
| that.selectComponent("#bargain").getList(); | |||||
| that.selectComponent("#spellGroup").getList(); | |||||
| that.selectComponent("#rushtobyCard").getList(); | |||||
| that.selectComponent("#hot").getList(); | |||||
| that.selectComponent("#hot").getptList(); | |||||
| // that.selectComponent("#bargain").getList(); | |||||
| // that.selectComponent("#spellGroup").getList(); | |||||
| // that.selectComponent("#rushtobyCard").getList(); | |||||
| wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
| }, | }, | ||||
| //加载更多 | //加载更多 | ||||
| @@ -49,7 +49,7 @@ | |||||
| <text>消费卡</text> | <text>消费卡</text> | ||||
| </view> | </view> | ||||
| <view class='kjBox' > | <view class='kjBox' > | ||||
| <image src='{{xingyun}}' mode='aspectFill' bindtap='gotoGame'></image> | |||||
| <image src='{{xingyun}}' mode='aspectFill' bindtap=''></image> | |||||
| <text>幸运卡牌</text> | <text>幸运卡牌</text> | ||||
| </view> | </view> | ||||
| <view class='kjBox' bindtap='gotoJfsc'> | <view class='kjBox' bindtap='gotoJfsc'> | ||||
| @@ -210,7 +210,7 @@ page { | |||||
| display: block; | display: block; | ||||
| } | } | ||||
| .classif > view:nth-child(3) view text:nth-child(2) { | .classif > view:nth-child(3) view text:nth-child(2) { | ||||
| padding-left: 15rpx; | |||||
| /* padding-left: 15rpx; */ | |||||
| } | } | ||||
| .classif > view:nth-child(6) text:nth-child(2) { | .classif > view:nth-child(6) text:nth-child(2) { | ||||
| @@ -435,6 +435,7 @@ radio { | |||||
| font-size: 36rpx !important; | font-size: 36rpx !important; | ||||
| font-weight: 400 !important; | font-weight: 400 !important; | ||||
| float: right; | float: right; | ||||
| margin-left: 10rpx; | |||||
| } | } | ||||
| .jine1 { | .jine1 { | ||||
| @@ -444,7 +445,7 @@ radio { | |||||
| } | } | ||||
| .buy-view { | .buy-view { | ||||
| background: #fff; | |||||
| /* background: #fff; */ | |||||
| position: fixed; | position: fixed; | ||||
| padding-top: 30rpx; | padding-top: 30rpx; | ||||
| height: 94rpx; | height: 94rpx; | ||||
| @@ -456,12 +457,12 @@ radio { | |||||
| } | } | ||||
| .buy { | .buy { | ||||
| background: #00c0ff; | |||||
| background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||||
| height: 94rpx; | height: 94rpx; | ||||
| width: 670rpx; | width: 670rpx; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| color: #fff; | color: #fff; | ||||
| font-size: 36rpx; | |||||
| font-size: 32rpx; | |||||
| line-height: 94rpx; | line-height: 94rpx; | ||||
| border-radius: 61rpx; | border-radius: 61rpx; | ||||
| } | } | ||||
| @@ -7,6 +7,7 @@ Page({ | |||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| */ | */ | ||||
| data: { | data: { | ||||
| noCoupon: imgurl.noCoupon.url, | |||||
| bannerUrl: imgurl.banner.url, | bannerUrl: imgurl.banner.url, | ||||
| loadingUrl: imgurl.loading.url, | loadingUrl: imgurl.loading.url, | ||||
| nodata: imgurl.nodata.url, | nodata: imgurl.nodata.url, | ||||
| @@ -5,12 +5,13 @@ | |||||
| <c-banner wx:key="unique" list="{{list}}" /> | <c-banner wx:key="unique" list="{{list}}" /> | ||||
| </view> | </view> | ||||
| </view> --> | </view> --> | ||||
| <view class='no-data01' style='{{"margin-top:"+(list.length>0?"320rpx":"20rpx")+";"+"height:"+(list.length>0?"calc(100vh - 460rpx)":"calc(100vh - 160rpx)")}}' wx:if='{{flag=="spellList"&&lists.length==0}}'> | |||||
| <image src='{{nodata}}'></image> | |||||
| <!-- style='{{"margin-top:"+(list.length>0?"320rpx":"20rpx")+";"+"height:"+(list.length>0?"calc(100vh - 460rpx)":"calc(100vh - 160rpx)")}}' --> | |||||
| <view class='no-data01' wx:if='{{flag=="spellList"&&lists.length==0}}'> | |||||
| <image src='{{noCoupon}}'></image> | |||||
| <view class='no-data-text'>暂无数据</view> | <view class='no-data-text'>暂无数据</view> | ||||
| </view> | </view> | ||||
| <view class='no-data' wx:if='{{flag=="myspellList"&&lists.length==0}}'> | <view class='no-data' wx:if='{{flag=="myspellList"&&lists.length==0}}'> | ||||
| <image src='{{nodata}}'></image> | |||||
| <image src='{{noCoupon}}'></image> | |||||
| <view class='no-data-text'>暂无数据</view> | <view class='no-data-text'>暂无数据</view> | ||||
| </view> | </view> | ||||
| <view class='content'> | <view class='content'> | ||||
| @@ -279,7 +279,7 @@ image{ | |||||
| margin: 0 auto; | margin: 0 auto; | ||||
| border-radius:15rpx; | border-radius:15rpx; | ||||
| box-sizing: border-box; | box-sizing: border-box; | ||||
| margin-top: 320rpx; | |||||
| margin-top: 20rpx; | |||||
| } | } | ||||
| .no-data{ | .no-data{ | ||||
| width: 690rpx; | width: 690rpx; | ||||