@@ -1,6 +1,7 @@ | |||||
{ | { | ||||
"pages": [ | "pages": [ | ||||
"pages/index/index", | "pages/index/index", | ||||
"pages/complete/index", | |||||
"pages/login/index", | "pages/login/index", | ||||
"pages/bargain/bargainDatail/bargainDatail", | "pages/bargain/bargainDatail/bargainDatail", | ||||
"pages/bargain/bargain", | "pages/bargain/bargain", | ||||
@@ -1,11 +1,11 @@ | |||||
var extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; | var extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; | ||||
var appId = extConfig.appId; | var appId = extConfig.appId; | ||||
var config = { | var config = { | ||||
url: "https://ciformall.youlane.cn/C/api", | |||||
// url: "https://ciformall.youlane.cn/C/api", | |||||
// url:"https://c.malls.iformall.com/C/api", | // url:"https://c.malls.iformall.com/C/api", | ||||
// url:'https://ctest.malls.iformall.com/C/api', | // url:'https://ctest.malls.iformall.com/C/api', | ||||
// url: 'http://10.100.33.70:7000/C/api', | // url: 'http://10.100.33.70:7000/C/api', | ||||
// url:'http://10.100.35.202:7000/C/api', | |||||
url:'http://10.100.35.202:7000/C/api', | |||||
// url: 'http://202.165.179.86:4000/C/api', | // url: 'http://202.165.179.86:4000/C/api', | ||||
api: { | api: { | ||||
/** | /** | ||||
@@ -54,7 +54,8 @@ Page({ | |||||
height: "", | height: "", | ||||
more: "点击查看更多", | more: "点击查看更多", | ||||
showMore: true, | showMore: true, | ||||
supportTransfer:1 | |||||
supportTransfer:1, | |||||
showIndexReuturn:false | |||||
}, | }, | ||||
phone: function(e) { | phone: function(e) { | ||||
let that = this; | let that = this; | ||||
@@ -62,6 +63,11 @@ Page({ | |||||
phoneNumber: e.target.dataset.merchantlinkphone | phoneNumber: e.target.dataset.merchantlinkphone | ||||
}); | }); | ||||
}, | }, | ||||
gotoIndex(){ | |||||
wx.navigateTo({ | |||||
url: '/pages/index/index', | |||||
}) | |||||
}, | |||||
goToTranser(){ | goToTranser(){ | ||||
this.onShareAppMessage(); | this.onShareAppMessage(); | ||||
// wx.navigateTo({ | // wx.navigateTo({ | ||||
@@ -72,7 +78,7 @@ Page({ | |||||
let _this = this; | let _this = this; | ||||
return { | return { | ||||
title: '领取卡', | title: '领取卡', | ||||
path: '/pages/index/index?couponChannelId=' + this.data.cardDetail.couponChannelId + '&cuserId=' + this.data.cardDetail.cuserId + '&couponId=' + this.data.cardDetail.couponId + '&coverImg=' + this.data.cardDetail.coverImg + '&userName=' + this.data.userName + '&avatarUrl=' + this.data.avatarUrl + '&couponOrderId=' + this.data.cardDetail.id, | |||||
path: '/pages/index/index?couponChannelId=' + this.data.cardDetail.couponChannelId + '&cuserId=' + this.data.cardDetail.ownerId + '&couponId=' + this.data.cardDetail.couponId + '&coverImg=' + this.data.cardDetail.coverImg + '&userName=' + this.data.userName + '&avatarUrl=' + this.data.avatarUrl + '&couponOrderId=' + this.data.cardDetail.id, | |||||
imageUrl: this.data.cardDetail.coverImg, | imageUrl: this.data.cardDetail.coverImg, | ||||
success: function (res) { | success: function (res) { | ||||
// 转发成功 | // 转发成功 | ||||
@@ -107,6 +113,11 @@ Page({ | |||||
console.log(options.cardId) | console.log(options.cardId) | ||||
that.cardpayList(options.cardId); | that.cardpayList(options.cardId); | ||||
that.cardDetail(options.cardId); | that.cardDetail(options.cardId); | ||||
if (options.from){ | |||||
this.setData({ | |||||
showIndexReuturn:true | |||||
}) | |||||
} | |||||
}, | }, | ||||
cardpayList: function(cardId) { | cardpayList: function(cardId) { | ||||
let that = this; | let that = this; | ||||
@@ -37,4 +37,5 @@ | |||||
<text>暂无交易明细</text> | <text>暂无交易明细</text> | ||||
</view> | </view> | ||||
<button type="primary" open-type="share" wx:if="{{supportTransfer==1}}" class='support-tansfer'><image src="{{weixinTitle}}" class='share' mode="widthFix"></image>转赠给微信好友</button> | <button type="primary" open-type="share" wx:if="{{supportTransfer==1}}" class='support-tansfer'><image src="{{weixinTitle}}" class='share' mode="widthFix"></image>转赠给微信好友</button> | ||||
<button type="primary" wx:if="{{showIndexReuturn}}" class='support-tansfer' bindtap='gotoIndex'>返回首页</button> | |||||
</view> | </view> |
@@ -0,0 +1,75 @@ | |||||
// pages/complete/index.js | |||||
const imgurl = require("../../utils/imgurl"); | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
success01: imgurl.success01.url, | |||||
couponOrderId:'' | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad: function (options) { | |||||
this.setData({ | |||||
couponOrderId: options.couponOrderId | |||||
}) | |||||
}, | |||||
//跳转 | |||||
closeAlert(){ | |||||
wx.navigateTo({ | |||||
url: '/pages/ConsumeDetail/ConsumeDetail?cardId=' + this.data.couponOrderId+'&from=zhuanzeng', | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload: function () { | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh: function () { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function () { | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function () { | |||||
} | |||||
}) |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"usingComponents": {} | |||||
} |
@@ -0,0 +1,15 @@ | |||||
<view class="container"> | |||||
<view class='c-top'> | |||||
<view class='c-top-top'></view> | |||||
<view class='c-top-center'> | |||||
<view class='content-left'> | |||||
<image src='{{success01}}'></image> | |||||
</view> | |||||
<view class='content-right'> | |||||
<view class='title'>领取成功</view> | |||||
<view class='text'>消费卡已放入卡包</view> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<button type="primary" class='support-tansfer' bindtap='closeAlert'>进卡包查看</button> | |||||
</view> |
@@ -0,0 +1,59 @@ | |||||
/* pages/complete/index.wxss */ | |||||
page { | |||||
background-color: #f4f4f4; | |||||
} | |||||
.container{ | |||||
} | |||||
.c-top-top{ | |||||
margin: 60rpx auto 0; | |||||
width:657rpx; | |||||
height:11rpx; | |||||
background:rgba(2,192,255,1); | |||||
border-radius:6px; | |||||
} | |||||
.c-top-center{ | |||||
display: flex; | |||||
margin: -4rpx auto 0; | |||||
width:636rpx; | |||||
height:328rpx; | |||||
background:rgba(255,255,255,1); | |||||
box-shadow:0px 8px 25px 2px rgba(165,165,165,0.1); | |||||
border-radius:0px 0px 20px 20px; | |||||
} | |||||
.content-left{ | |||||
position: relative; | |||||
width: 240rpx; | |||||
align-self: left; | |||||
} | |||||
.content-left image{ | |||||
display: block; | |||||
position: absolute; | |||||
top: 129rpx; | |||||
/* margin-top: -35rpx; */ | |||||
right: 60rpx; | |||||
width: 70rpx; | |||||
height: 70rpx; | |||||
align-self: left; | |||||
} | |||||
.title{ | |||||
margin-top: 108rpx; | |||||
font-size:40rpx; | |||||
font-family:PingFang-SC-Bold; | |||||
font-weight:bold; | |||||
color:rgba(51,51,51,1); | |||||
line-height:50rpx; | |||||
} | |||||
.text{ | |||||
font-size:28rpx; | |||||
font-family:PingFang-SC-Regular; | |||||
font-weight:400; | |||||
color:rgba(51,51,51,1); | |||||
line-height:50rpx; | |||||
} | |||||
.support-tansfer{ | |||||
width: 636rpx; | |||||
border-radius: 50rpx; | |||||
margin-top: 30rpx; | |||||
background: #02C0FF!important; | |||||
} |
@@ -52,7 +52,8 @@ Page({ | |||||
showCardOffer:false, | showCardOffer:false, | ||||
isSamePeople:true, | isSamePeople:true, | ||||
statusText:'', | statusText:'', | ||||
isReceived:false | |||||
isReceived:false, | |||||
receivedDisabled:false | |||||
}, | }, | ||||
phone: function (e) { | phone: function (e) { | ||||
let that = this; | let that = this; | ||||
@@ -103,10 +104,14 @@ Page({ | |||||
}, | }, | ||||
receiveCard(){ | receiveCard(){ | ||||
let that=this; | |||||
let param = { | let param = { | ||||
id: this.data.cardData.couponOrderId, | id: this.data.cardData.couponOrderId, | ||||
cUserId: this.data.cardData.cuserId | cUserId: this.data.cardData.cuserId | ||||
} | } | ||||
this.setData({ | |||||
receivedDisabled:true | |||||
}) | |||||
Http.post({ | Http.post({ | ||||
url: config.api.cardAccept, | url: config.api.cardAccept, | ||||
data: param | data: param | ||||
@@ -119,7 +124,21 @@ Page({ | |||||
duration: 2000, | duration: 2000, | ||||
mask: false | mask: false | ||||
}); | }); | ||||
wx.navigateTo({ | |||||
url: '/pages/complete/index?couponOrderId=' + this.data.cardData.couponOrderId, | |||||
}) | |||||
}) | }) | ||||
.catch(err => { | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
that.setData({ | |||||
receivedDisabled: false | |||||
}) | |||||
}) | |||||
}, | }, | ||||
closeAlert(){ | closeAlert(){ | ||||
this.setData({ | this.setData({ | ||||
@@ -449,12 +468,12 @@ Page({ | |||||
* | * | ||||
*/ | */ | ||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: "/pages/getphoneInfo/index?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&couponId=" + that.data.cardData.couponId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl, | |||||
url: "/pages/getphoneInfo/index?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&couponId=" + that.data.cardData.couponId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId, | |||||
}); | }); | ||||
} else if (err.code == 11006) { | } else if (err.code == 11006) { | ||||
// 用户手机已加密 | // 用户手机已加密 | ||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: "/pages/phoneinput/phoneinput?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&couponId=" + that.data.cardData.couponId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl, | |||||
url: "/pages/phoneinput/phoneinput?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&couponId=" + that.data.cardData.couponId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId, | |||||
}); | }); | ||||
} else { | } else { | ||||
wx.showToast({ | wx.showToast({ | ||||
@@ -1,3 +1,4 @@ | |||||
{ | { | ||||
"navigationBarTitleText": "券详情" | |||||
"navigationBarTitleText": "券详情", | |||||
"backgroundColor":"#f4f4f4" | |||||
} | } |
@@ -141,7 +141,7 @@ | |||||
<image src='{{cardData.coverImg}}'></image> | <image src='{{cardData.coverImg}}'></image> | ||||
<view class='a-received' wx:if="{{isReceived}}">{{statusText}}</view> | <view class='a-received' wx:if="{{isReceived}}">{{statusText}}</view> | ||||
</view> | </view> | ||||
<button type="primary" wx:if='{{!isSamePeople&&!isReceived}}' class='support-tansfer' bindtap='checkPhoneStatus'>领取</button> | |||||
<button type="primary" wx:if='{{!isSamePeople&&!isReceived}}' disabled='{{receivedDisabled}}' class='support-tansfer' bindtap='checkPhoneStatus'>领取</button> | |||||
<button type="primary" wx:if='{{isSamePeople||isReceived}}' class='support-tansfer' bindtap='closeAlert'>关闭</button> | <button type="primary" wx:if='{{isSamePeople||isReceived}}' class='support-tansfer' bindtap='closeAlert'>关闭</button> | ||||
</view> | </view> | ||||
</view> | </view> |
@@ -572,16 +572,17 @@ button::after{ border: none; } | |||||
.close{ | .close{ | ||||
position: absolute; | position: absolute; | ||||
z-index: 300; | z-index: 300; | ||||
right: 26rpx; | |||||
top: 26rpx; | |||||
width: 26rpx; | |||||
height: 26rpx; | |||||
right: 0; | |||||
top: 0; | |||||
width: 100rpx; | |||||
height: 100rpx; | |||||
overflow: hidden; | overflow: hidden; | ||||
} | } | ||||
.close image{ | .close image{ | ||||
display: block; | display: block; | ||||
width: 26rpx; | width: 26rpx; | ||||
height: 26rpx; | height: 26rpx; | ||||
margin: 20rpx 0 0 52rpx; | |||||
} | } | ||||
.a-title{ | .a-title{ | ||||
text-align: center; | text-align: center; | ||||
@@ -70,7 +70,7 @@ Page({ | |||||
}) | }) | ||||
} else if (that.path == 'index' && that.data.paramData.cuserId){ | } else if (that.path == 'index' && that.data.paramData.cuserId){ | ||||
wx.reLaunch({ | wx.reLaunch({ | ||||
url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId='+that.data.paramData.couponChannelId + '&couponId=' + that.data.paramData.couponId + '&coverImg=' +that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' +that.data.paramData.userName | |||||
url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&couponId=' + that.data.paramData.couponId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId | |||||
}) | }) | ||||
} else { | } else { | ||||
wx.showToast({ | wx.showToast({ | ||||
@@ -8,7 +8,8 @@ Page({ | |||||
couponChannelId: null, | couponChannelId: null, | ||||
couponId:null, | couponId:null, | ||||
cuserId:null, | cuserId:null, | ||||
coverImg:null | |||||
coverImg:null, | |||||
couponOrderId:null | |||||
}, | }, | ||||
onLoad: function(options) { | onLoad: function(options) { | ||||
var that = this; | var that = this; | ||||
@@ -23,7 +24,7 @@ Page({ | |||||
* 来自转赠 | * 来自转赠 | ||||
*/ | */ | ||||
if (options.couponChannelId && options.cuserId){ | if (options.couponChannelId && options.cuserId){ | ||||
console.log(1231231231) | |||||
console.log(1231231231,options) | |||||
that.setData({ | that.setData({ | ||||
couponChannelId: options.couponChannelId, | couponChannelId: options.couponChannelId, | ||||
couponId: options.couponId, | couponId: options.couponId, | ||||
@@ -89,7 +90,7 @@ Page({ | |||||
* 来自转赠 | * 来自转赠 | ||||
*/ | */ | ||||
wx.reLaunch({ | wx.reLaunch({ | ||||
url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.couponId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}couponOrderId=${that.data.couponOrderId}` | |||||
url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.couponId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}` | |||||
}); | }); | ||||
} else if (that.data.orderId) { | } else if (that.data.orderId) { | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
@@ -55,7 +55,7 @@ Page({ | |||||
*/ | */ | ||||
if (this.data.paramData.cuserId){ | if (this.data.paramData.cuserId){ | ||||
wx.reLaunch({ | wx.reLaunch({ | ||||
url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + + that.data.paramData.couponChannelId + '&couponId=' + + that.data.paramData.couponId + '&coverImg=' + + that.data.paramData.coverImg + '&avatarUrl=' + + that.data.paramData.avatarUrl + '&userName=' + + that.data.paramData.userName | |||||
url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&couponId=' + that.data.paramData.couponId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId | |||||
}) | }) | ||||
}else{ | }else{ | ||||
wx.redirectTo({ | wx.redirectTo({ | ||||
@@ -352,4 +352,8 @@ module.exports = { | |||||
'url': baseUrl + 'close02.png', | 'url': baseUrl + 'close02.png', | ||||
'name': '关闭图标' | 'name': '关闭图标' | ||||
}, | }, | ||||
'success01': { | |||||
'url': baseUrl + 'success01.png', | |||||
'name': '卡领取成功图标' | |||||
}, | |||||
} | } |