@@ -33,26 +33,29 @@ Component({ | |||
//获取砍价列表 | |||
getList() { | |||
let that = this; | |||
let param ={ | |||
let param = { | |||
targetAd: 6, | |||
} | |||
Http.get({ | |||
url: config.api.change, | |||
data:param, | |||
}).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() { | |||
@@ -63,38 +66,41 @@ Component({ | |||
url: config.api.change, | |||
data: param1, | |||
}).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(){ | |||
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 => { | |||
console.log(err) | |||
wx.showToast({ | |||
title: err.errMsg, | |||
icon: 'none', | |||
@@ -102,28 +108,31 @@ Component({ | |||
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 => { | |||
console.log(err) | |||
wx.showToast({ | |||
title: err.errMsg, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
}) | |||
}) | |||
} | |||
}, | |||
//跳转砍价详情 | |||
gotokjdetail: function (e) { | |||
@@ -155,6 +164,7 @@ Component({ | |||
Http.setToken(token); | |||
this.getList(); | |||
this.getptList(); | |||
// this.getChange(); | |||
}; | |||
if (app.globalData.token && app.globalData.token != null) { | |||
app.couponChannelListCallback(app.globalData.token); | |||
@@ -34,29 +34,29 @@ | |||
"text": "首页", | |||
"iconPath": "assets/images/home.png", | |||
"pagePath": "pages/main/index", | |||
"selectedIconPath": "assets/images/home-a.png" | |||
"selectedIconPath": "assets/images/home-b.png" | |||
}, | |||
{ | |||
"text": "门店", | |||
"iconPath": "assets/images/mendian.png", | |||
"pagePath": "pages/index/searchbar/index", | |||
"selectedIconPath": "assets/images/mendian-a.png" | |||
"selectedIconPath": "assets/images/mendian-b.png" | |||
}, | |||
{ | |||
"text": "停车", | |||
"iconPath": "assets/images/park.png", | |||
"pagePath": "pages/passCar/passCar", | |||
"selectedIconPath": "assets/images/park-a.png" | |||
"selectedIconPath": "assets/images/park-b.png" | |||
}, | |||
{ | |||
"text": "我的", | |||
"iconPath": "assets/images/user.png", | |||
"pagePath": "pages/user/index", | |||
"selectedIconPath": "assets/images/user-a.png" | |||
"selectedIconPath": "assets/images/user-b.png" | |||
} | |||
], | |||
"color": "#abb1be", | |||
"selectedColor": "#b2743d" | |||
"selectedColor": "#FD832D" | |||
}, | |||
"window": { | |||
"backgroundTextStyle": "dark", | |||
@@ -5,7 +5,6 @@ const util = require("../../../utils/util"); | |||
const imgurl = require("../../../utils/imgurl"); | |||
Page({ | |||
data: { | |||
isshowposter1: true,//是否显示发起砍价 | |||
isshowposter:false,//是否显示分享弹框 | |||
fenxiangUrl: imgurl.fenxiang.url, | |||
clockUrl: imgurl.clock.url, | |||
@@ -101,22 +100,7 @@ Page({ | |||
isshowposter: false, | |||
}) | |||
}, | |||
/** | |||
* 显示发起砍价 | |||
*/ | |||
showshare1: function () { | |||
this.setData({ | |||
isshowposter1: true, | |||
}) | |||
}, | |||
/** | |||
* 隐藏发起砍价 | |||
*/ | |||
hidemodal1: function () { | |||
this.setData({ | |||
isshowposter1: false, | |||
}) | |||
}, | |||
/** | |||
* 跳转到门店列表的详情页面 | |||
*/ | |||
@@ -151,11 +151,11 @@ | |||
<text>立即购买</text> | |||
</button> | |||
</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> | |||
</view> | |||
</form> | |||
</view> | |||
<!-- 问卷调查 --> | |||
@@ -219,6 +219,5 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 发起砍价弹框 --> | |||
<c-bargainDatail bindtap='hidemodal1' class="business" couponChannelId="{{data.id}}" wx:if="{{isshowposter1}}"/> | |||
</view> |
@@ -1,4 +1,7 @@ | |||
@import "../../../../app.wxss"; | |||
page{ | |||
background: #F4F5F9; | |||
} | |||
.index-slide, swiper-item | |||
.index-slide-image { | |||
display: block; | |||
@@ -136,7 +139,7 @@ | |||
} | |||
.merchant-phones { | |||
border-top:8px solid #efefef; | |||
/* border-top:8px solid #efefef; */ | |||
padding: 20rpx 0; | |||
display: block; | |||
font-size: 30rpx; | |||
@@ -198,7 +201,7 @@ | |||
.merchant-brand { | |||
border: none !important; | |||
width: 92%; | |||
margin: 20rpx auto 20rpx; | |||
margin: 0 auto 20rpx; | |||
} | |||
.merchant-brand view:nth-child(2) text:nth-child(1) { | |||
margin-top: 20rpx; | |||
@@ -345,6 +348,7 @@ | |||
/* margin: 30rpx auto 0; */ | |||
display:block; | |||
text-align:center; | |||
color: #999; | |||
} | |||
.modal { | |||
width: 100%; | |||
@@ -1,6 +1,7 @@ | |||
var config = require("../../config/config.js"); | |||
const Http = require("../../utils/HttpBasics"); | |||
const imgurl = require("../../utils/imgurl"); | |||
const QR = require("../../utils/memberqrcode.js"); | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
@@ -92,11 +93,60 @@ Page({ | |||
.catch(err => { | |||
wx.showModal({ | |||
title: '提示', | |||
content: err.errMsg, | |||
content: err.message, | |||
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(){ | |||
let that = this; | |||
@@ -578,9 +578,11 @@ Page({ | |||
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(); | |||
}, | |||
//加载更多 | |||
@@ -49,7 +49,7 @@ | |||
<text>消费卡</text> | |||
</view> | |||
<view class='kjBox' > | |||
<image src='{{xingyun}}' mode='aspectFill' bindtap='gotoGame'></image> | |||
<image src='{{xingyun}}' mode='aspectFill' bindtap=''></image> | |||
<text>幸运卡牌</text> | |||
</view> | |||
<view class='kjBox' bindtap='gotoJfsc'> | |||
@@ -210,7 +210,7 @@ page { | |||
display: block; | |||
} | |||
.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) { | |||
@@ -435,6 +435,7 @@ radio { | |||
font-size: 36rpx !important; | |||
font-weight: 400 !important; | |||
float: right; | |||
margin-left: 10rpx; | |||
} | |||
.jine1 { | |||
@@ -444,7 +445,7 @@ radio { | |||
} | |||
.buy-view { | |||
background: #fff; | |||
/* background: #fff; */ | |||
position: fixed; | |||
padding-top: 30rpx; | |||
height: 94rpx; | |||
@@ -456,12 +457,12 @@ radio { | |||
} | |||
.buy { | |||
background: #00c0ff; | |||
background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||
height: 94rpx; | |||
width: 670rpx; | |||
margin: 0 auto; | |||
color: #fff; | |||
font-size: 36rpx; | |||
font-size: 32rpx; | |||
line-height: 94rpx; | |||
border-radius: 61rpx; | |||
} | |||
@@ -7,6 +7,7 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
noCoupon: imgurl.noCoupon.url, | |||
bannerUrl: imgurl.banner.url, | |||
loadingUrl: imgurl.loading.url, | |||
nodata: imgurl.nodata.url, | |||
@@ -5,12 +5,13 @@ | |||
<c-banner wx:key="unique" list="{{list}}" /> | |||
</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> | |||
<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> | |||
<view class='content'> | |||
@@ -279,7 +279,7 @@ image{ | |||
margin: 0 auto; | |||
border-radius:15rpx; | |||
box-sizing: border-box; | |||
margin-top: 320rpx; | |||
margin-top: 20rpx; | |||
} | |||
.no-data{ | |||
width: 690rpx; | |||