@@ -0,0 +1,813 @@ | |||
var config = require("../../config/config.js"); | |||
var app = getApp(); | |||
const Http = require("../../utils/HttpBasics"); | |||
const util = require("../../utils/util"); | |||
const imgurl = require("../../utils/imgurl"); | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
cancelH: imgurl.cancelH.url, | |||
bannerUrl: imgurl.banner.url, | |||
wmhome: imgurl.wmhome.url, | |||
wmhelp: imgurl.wmhelp.url, | |||
wmsuccess01: imgurl.wmsuccess01.url, | |||
fail: imgurl.fail.url, | |||
data: null, | |||
from: null, | |||
day: null, | |||
hour: null, | |||
min: null, | |||
sec: null, | |||
showPage: false, | |||
discountStatus: null, | |||
disabled: false, | |||
display: "block!important", | |||
showButton1: false | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function(options) { | |||
let that = this; | |||
if (options.orderId || options.orderId && options.from == 'discount') { | |||
if (options.from) { | |||
that.setData({ | |||
orderId: options.orderId, | |||
from: "discount" | |||
}) | |||
} else { | |||
that.setData({ | |||
orderId: options.orderId | |||
}) | |||
} | |||
app.globalData.wmorder = options.orderId | |||
that.pressOrderDetail(options.orderId); | |||
} | |||
this.getUserInfo() | |||
}, | |||
getUserInfo: function() { | |||
let that = this; | |||
// 获取用户信息 | |||
Http.get({ | |||
url: config.api.getScore, | |||
data: {} | |||
}) | |||
.then(res => { | |||
console.log(res) | |||
that.setData({ | |||
nickName: res.data.nickName, | |||
avatarUrl: res.data.avatarUrl | |||
}) | |||
}) | |||
}, | |||
onShow: function() { | |||
let that = this; | |||
var todayDate = new Date().getTime(); | |||
that.setData({ | |||
todayDate: todayDate, | |||
showButton1: false | |||
}) | |||
if (that.data.pressEndDate) { | |||
that.countdown(that.data.pressEndDate) | |||
} | |||
}, | |||
goback: function() { | |||
wx.switchTab({ | |||
url: '/pages/main/index', | |||
}) | |||
}, | |||
/** | |||
* 更多砍价商品 | |||
*/ | |||
gotomore: function() { | |||
wx.navigateTo({ | |||
url: '/pages/bargain/bargain', | |||
}) | |||
}, | |||
/** | |||
* @param {砍价状态(1:我发起的砍价,2:未参与的砍价, 3:已参与的砍价)} orderId | |||
*/ | |||
getPressOrderStatus: function(orderId) { | |||
let that = this; | |||
Http.get({ | |||
url: config.api.getPressOrderStatus, | |||
data: { | |||
orderId: orderId | |||
} | |||
}) | |||
.then(res => { | |||
if (res.data.status == 1) { | |||
that.setData({ | |||
discountStatus: 1 | |||
}) | |||
} else if (res.data.status == 2) { | |||
that.setData({ | |||
discountStatus: 2 | |||
}) | |||
} else if (res.data.status == 3) { | |||
that.setData({ | |||
discountStatus: 3 | |||
}) | |||
} | |||
wx.stopPullDownRefresh(); | |||
}) | |||
.catch(err => { | |||
console.log(err) | |||
wx.stopPullDownRefresh(); | |||
wx.showToast({ | |||
title: err.errMsg, | |||
icon: "none" | |||
}) | |||
}) | |||
}, | |||
helpDiscount: function() { | |||
let that = this; | |||
that.pressOrderJoin(that.data.orderId); | |||
}, | |||
//参与砍价 | |||
pressOrderJoin: function(orderId) { | |||
let that = this; | |||
Http.post({ | |||
url: config.api.pressOrderJoin, | |||
data: { | |||
orderId: orderId | |||
} | |||
}) | |||
.then(res => { | |||
console.log(res); | |||
// id 是订单号 | |||
that.pressOrderDetail(orderId); | |||
}) | |||
.catch(err => { | |||
console.log(err) | |||
wx.showToast({ | |||
title: err.message, | |||
icon: "none" | |||
}) | |||
}) | |||
}, | |||
// 订单详情 | |||
pressOrderDetail: function(orderId) { | |||
let that = this; | |||
Http.get({ | |||
url: config.api.pressOrderDetail, | |||
data: { | |||
orderId: orderId | |||
} | |||
}) | |||
.then(res => { | |||
console.log(res); | |||
res.data.orderPressList.map(file => { | |||
file.createDate = diffTime(file.createDate) | |||
}) | |||
that.countdown(res.data.pressEndDate); | |||
that.setData({ | |||
pressEndDate: res.data.pressEndDate | |||
}) | |||
res.data.orderPressList.map(file => { | |||
compare(file.first); | |||
}) | |||
console.log(res.data.orderPressList.sort(compare('first'))) | |||
that.setData({ | |||
data: res.data, | |||
already: (res.data.price / 100 - res.data.salePrice / 100 - res.data.pressCurrentValue / 100).toFixed(2), | |||
remain: (res.data.pressCurrentValue / 100).toFixed(2), | |||
showPage: true | |||
}) | |||
that.getPressOrderStatus(orderId); | |||
}) | |||
.catch(err => { | |||
wx.showToast({ | |||
title: err.message, | |||
icon: "none" | |||
}) | |||
wx.stopPullDownRefresh(); | |||
}) | |||
}, | |||
setIntervalTime(end_time) { | |||
let that = this; | |||
var EndTime = end_time; | |||
var NowTime = new Date().getTime(); | |||
var total_micro_second = EndTime - NowTime || []; | |||
// 渲染倒计时时钟 | |||
let obj = that.dateformat(total_micro_second); | |||
if (total_micro_second > 0) { | |||
that.setData({ | |||
clock: obj, | |||
day: obj.a1, | |||
hour: obj.b1, | |||
min: obj.c1, | |||
sec: obj.d1, | |||
}) | |||
} else { | |||
that.setData({ | |||
clock: "00", | |||
day: "00", | |||
hour: "00", | |||
min: "00", | |||
sec: "00", | |||
}) | |||
//如果倒计时结束,需要重新查询一下券的状态 | |||
// 给getDetail一个标识 | |||
} | |||
total_micro_second -= 1000; | |||
}, | |||
countdown: function(end_time) { | |||
let that = this; | |||
that.setIntervalTime(end_time); | |||
that.data.setInterval = setInterval(function() { | |||
that.setIntervalTime(end_time); | |||
}, 1000) | |||
}, | |||
// 时间格式化输出,如11:03 25:19 每1s都会调用一次 | |||
dateformat(micro_second) { | |||
// 总秒数 | |||
var second = Math.floor(micro_second / 1000); | |||
// 天数 | |||
var day = Math.floor(second / 3600 / 24) < 10 ? "0" + Math.floor(second / 3600 / 24) : Math.floor(second / 3600 / 24); | |||
// 小时 | |||
var hr = Math.floor(second / 3600 % 24) < 10 ? "0" + Math.floor(second / 3600 % 24) : Math.floor(second / 3600 % 24); | |||
// 分钟 | |||
var min = Math.floor(second / 60 % 60) < 10 ? "0" + Math.floor(second / 60 % 60) : Math.floor(second / 60 % 60); | |||
// 秒 | |||
var sec = Math.floor(second % 60) < 10 ? "0" + Math.floor(second % 60) : Math.floor(second % 60); | |||
// return day + "天" + hr + "小时" + min + "分钟" + sec + "秒"; | |||
return { | |||
a1: day, | |||
b1: hr, | |||
c1: min, | |||
d1: sec | |||
} | |||
}, | |||
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this) => { | |||
let that = this; | |||
console.log(that) | |||
console.log(_this) | |||
// 支付成功 | |||
Http.post({ | |||
url: config.api.payOrderUpdate, | |||
data: { | |||
payOrderId: payOrderId, | |||
orderId: orderId, | |||
status: status, | |||
reason: reason | |||
} | |||
}) | |||
.then(res => { | |||
wx.hideLoading(); | |||
_this.setData({ | |||
display: "none!important", | |||
}) | |||
// 有价券 | |||
if (!type && type != 'free') { | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
orderId | |||
}` | |||
}); | |||
} else if (type == 'free') { | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
orderId | |||
}` | |||
}); | |||
} | |||
}) | |||
.catch(err => { | |||
console.log(err); | |||
if (!type) { | |||
setTimeout(function() { | |||
_this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this); | |||
}, 2000) | |||
} | |||
}) | |||
}, | |||
/** | |||
* 按原价付款 | |||
*/ | |||
// orderFunc1(e) { | |||
// var that = this; | |||
// let formId = e.detail.formId; | |||
// that.setData({ | |||
// showButton: true | |||
// }) | |||
// Http.get({ | |||
// url: config.api.checkPhoneStatus, | |||
// data: {} | |||
// }) | |||
// .then(res => { | |||
// that.setData({ | |||
// showButton: false | |||
// }) | |||
// /** | |||
// * orderSave 下单 | |||
// */ | |||
// var data = { | |||
// couponChannelId:e.currentTarget.dataset.couponchannelid, | |||
// couponId:e.currentTarget.dataset.couponid, | |||
// formId:formId | |||
// } | |||
// return Http.post({ | |||
// url: config.api.orderSave, | |||
// data: data | |||
// }); | |||
// }) | |||
// .catch(err => { | |||
// that.setData({ | |||
// showButton: true | |||
// }) | |||
// if (err.code == 2011) { | |||
// wx.showToast({ | |||
// title: "商户信息没找到", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 2013) { | |||
// wx.showToast({ | |||
// title: "商户信息禁用", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 3000) { | |||
// wx.showToast({ | |||
// title: "库存不足", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 3001) { | |||
// wx.showToast({ | |||
// title: "您已超过限购", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 3002) { | |||
// wx.showToast({ | |||
// title: "订单失败", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 3003) { | |||
// wx.showToast({ | |||
// title: "订单不存在", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 3004) { | |||
// wx.showToast({ | |||
// title: "订单不存在", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 4003) { | |||
// wx.showToast({ | |||
// title: "卡券已作废", | |||
// image: './../../../assets/images/fail.png', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } else if (err.code == 3012) { | |||
// wx.showModal({ | |||
// title: '提示', | |||
// content: "您有未支付订单进行支付", | |||
// showCancel: false, | |||
// success: function (res) { | |||
// console.log(res.confirm) | |||
// if (res.confirm) { | |||
// } | |||
// } | |||
// }) | |||
// }else if (err.code == 11005) { | |||
// /** | |||
// * 将值传到用户手机号授权的页面 | |||
// * | |||
// */ | |||
// wx.redirectTo({ | |||
// url: "/pages/getphoneInfo/index?couponChannelId=" + | |||
// that.data.couponChannelId + | |||
// "&couponId=" + | |||
// that.data.couponId | |||
// }); | |||
// } else if (err.code == 11006) { | |||
// // 用户手机已加密 | |||
// wx.redirectTo({ | |||
// url: "/pages/phoneinput/phoneinput?couponChannelId=" + | |||
// that.data.couponChannelId + | |||
// "&couponId=" + | |||
// that.data.couponId | |||
// }); | |||
// } else { | |||
// wx.showToast({ | |||
// title: err.message, | |||
// icon: 'none', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// } | |||
// }).then(res => { | |||
// console.log(res); | |||
// if (typeof(res) != "undefined") { | |||
// let orderId = "" + res.data.id; | |||
// that.setData({ | |||
// orderId: orderId | |||
// }); | |||
// if (e.currentTarget.dataset.saleprice / 100 > 0 || e.currentTarget.dataset.price / 100 > 0) { | |||
// /** | |||
// * 支付订单创建 | |||
// */ | |||
// Http.post({ | |||
// url: config.api.payOrderCreate, | |||
// data: { | |||
// orderId: orderId | |||
// } | |||
// }) | |||
// .then(res => { | |||
// var payOrderId = "" + res.data.payOrderId; | |||
// wx.hideLoading(); | |||
// wx.requestPayment({ | |||
// timeStamp: res.data.timeStamp, | |||
// nonceStr: res.data.nonceStr, | |||
// package: res.data.package, | |||
// signType: (res.data.signType) ? res.data.signType : "MD5", | |||
// paySign: res.data.paySign, | |||
// success: res => { | |||
// wx.showLoading({ | |||
// title: '订单正在处理中...', | |||
// }) | |||
// setTimeout(function() { | |||
// wx.hideLoading() | |||
// }, 5000) | |||
// that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that); | |||
// if (res.errMsg == "requestPayment:ok") { | |||
// setTimeout(function() { | |||
// wx.hideLoading(); | |||
// }, 2000); | |||
// /** | |||
// * 用户支付成功以后跳转到券包列表 | |||
// */ | |||
// if (that.data.cardType == 100) { | |||
// wx.setStorage({ | |||
// key: 'couponNum2', | |||
// data: "couponNum2" | |||
// }) | |||
// } else { | |||
// wx.setStorage({ | |||
// key: 'couponNum', | |||
// data: "couponNum" | |||
// }) | |||
// } | |||
// } | |||
// }, | |||
// fail: res => { | |||
// /** | |||
// * 支付失败,需要更新订单的状态 | |||
// */ | |||
// that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that); | |||
// that.setData({ | |||
// showbutton: false | |||
// }) | |||
// return; | |||
// }, | |||
// complete: res => {} | |||
// }); | |||
// /// End payment -------- | |||
// }) | |||
// .catch(err => { | |||
// console.log(err); | |||
// wx.showToast({ | |||
// title: err.message, | |||
// icon: 'none', | |||
// duration: 2000, | |||
// mask: false | |||
// }); | |||
// }) | |||
// } else { | |||
// // 免费券 | |||
// that.payOrderUpdate(orderId, "0", 1, '', 'free', that); | |||
// if (that.data.cardType == 100) { | |||
// wx.setStorage({ | |||
// key: 'couponNum2', | |||
// data: "couponNum2" | |||
// }) | |||
// } else { | |||
// wx.setStorage({ | |||
// key: 'couponNum', | |||
// data: "couponNum" | |||
// }) | |||
// } | |||
// } | |||
// } | |||
// }) | |||
// }, | |||
/** | |||
* 发起支付 | |||
*/ | |||
orderFunc(e) { | |||
var that = this; | |||
that.setData({ | |||
showButton1: true | |||
}) | |||
Http.get({ | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}) | |||
.then(res => { | |||
that.setData({ | |||
showButton1: false | |||
}) | |||
if (typeof(res) != "undefined") { | |||
let orderId = "" + e.currentTarget.dataset.orderid; | |||
that.setData({ | |||
orderId: orderId | |||
}); | |||
if (e.currentTarget.dataset.saleprice / 100 > 0 || e.currentTarget.dataset.price / 100 > 0) { | |||
/** | |||
* 支付订单创建 | |||
*/ | |||
Http.post({ | |||
url: config.api.payOrderCreate, | |||
data: { | |||
orderId: orderId | |||
} | |||
}) | |||
.then(res => { | |||
var payOrderId = "" + res.data.payOrderId; | |||
wx.hideLoading(); | |||
wx.requestPayment({ | |||
timeStamp: res.data.timeStamp, | |||
nonceStr: res.data.nonceStr, | |||
package: res.data.package, | |||
signType: (res.data.signType) ? res.data.signType : "MD5", | |||
paySign: res.data.paySign, | |||
success: res => { | |||
wx.showLoading({ | |||
title: '订单正在处理中...', | |||
}) | |||
setTimeout(function() { | |||
wx.hideLoading() | |||
}, 5000) | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that); | |||
if (res.errMsg == "requestPayment:ok") { | |||
setTimeout(function() { | |||
wx.hideLoading(); | |||
}, 2000); | |||
/** | |||
* 用户支付成功以后跳转到券包列表 | |||
*/ | |||
if (that.data.cardType == 100) { | |||
wx.setStorage({ | |||
key: 'couponNum2', | |||
data: "couponNum2" | |||
}) | |||
} else { | |||
wx.setStorage({ | |||
key: 'couponNum', | |||
data: "couponNum" | |||
}) | |||
} | |||
} | |||
}, | |||
fail: res => { | |||
/** | |||
* 支付失败,需要更新订单的状态 | |||
*/ | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that); | |||
that.setData({ | |||
showbutton1: false | |||
}) | |||
return; | |||
}, | |||
complete: res => {} | |||
}); | |||
/// End payment -------- | |||
}) | |||
.catch(err => { | |||
console.log(err); | |||
wx.showToast({ | |||
title: err.message, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
}) | |||
} else { | |||
// 免费券 | |||
that.payOrderUpdate(orderId, "0", 1, '', 'free', that); | |||
if (that.data.cardType == 100) { | |||
wx.setStorage({ | |||
key: 'couponNum2', | |||
data: "couponNum2" | |||
}) | |||
} else { | |||
wx.setStorage({ | |||
key: 'couponNum', | |||
data: "couponNum" | |||
}) | |||
} | |||
} | |||
} | |||
}) | |||
.catch(err => { | |||
that.setData({ | |||
showButton1: true | |||
}) | |||
if (err.code == 2011) { | |||
wx.showToast({ | |||
title: "商户信息没找到", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 2013) { | |||
wx.showToast({ | |||
title: "商户信息禁用", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 3000) { | |||
wx.showToast({ | |||
title: "库存不足", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 3001) { | |||
wx.showToast({ | |||
title: "您已超过限购", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 3002) { | |||
wx.showToast({ | |||
title: "订单失败", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 3003) { | |||
wx.showToast({ | |||
title: "订单不存在", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 3004) { | |||
wx.showToast({ | |||
title: "订单不存在", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 4003) { | |||
wx.showToast({ | |||
title: "卡券已作废", | |||
image: './../../../assets/images/fail.png', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} else if (err.code == 3012) { | |||
wx.showModal({ | |||
title: '提示', | |||
content: '您有未支付订单,请先进行支付', | |||
confirmText: "去支付", | |||
success: function (res) { | |||
console.log(res.confirm) | |||
if (res.confirm) { | |||
wx.navigateTo({ | |||
url: '/pages/order/index/index?id=all', | |||
}) | |||
} | |||
} | |||
}) | |||
}else if (err.code == 11005) { | |||
/** | |||
* 将值传到用户手机号授权的页面 | |||
* | |||
*/ | |||
wx.redirectTo({ | |||
url: "/pages/getphoneInfo/index?couponChannelId=" + | |||
that.data.couponChannelId + | |||
"&couponId=" + | |||
that.data.couponId | |||
}); | |||
} else if (err.code == 11006) { | |||
// 用户手机已加密 | |||
wx.redirectTo({ | |||
url: "/pages/phoneinput/phoneinput?couponChannelId=" + | |||
that.data.couponChannelId + | |||
"&couponId=" + | |||
that.data.couponId | |||
}); | |||
} else { | |||
wx.showToast({ | |||
title: err.message, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
} | |||
}) | |||
}, | |||
onUnload: function() { | |||
let that = this; | |||
clearInterval(that.data.setInterval) | |||
}, | |||
onHide: function() { | |||
let that = this; | |||
clearInterval(that.data.setInterval) | |||
}, | |||
/** | |||
* | |||
* @param {朋友邀请砍价} e | |||
*/ | |||
barginAgain: function(e) { | |||
let that = this; | |||
let couponChannelId = e.currentTarget.dataset.couponchannelid; | |||
let couponId = e.currentTarget.dataset.couponid; | |||
wx.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | |||
}) | |||
}, | |||
/** | |||
* 刷新 | |||
*/ | |||
onPullDownRefresh: function(e) { | |||
let that = this; | |||
console.log(app.globalData.wmorder); | |||
if (app.globalData.wmorder) { | |||
that.pressOrderDetail(app.globalData.wmorder); | |||
} | |||
}, | |||
onShareAppMessage: function(options) { | |||
var that = this; | |||
var shareObj = { | |||
title: that.data.nickName + '邀请您帮砍' + that.data.data.title, | |||
path: `/pages/index/index?orderId=${that.data.data.id}&from=${"discount"}`, | |||
success: function(res) { | |||
if (res.errMsg == 'shareAppMessage:ok') {} | |||
}, | |||
fail: function(error) { | |||
if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {} | |||
} | |||
}; | |||
// 来自页面内的按钮的转发 | |||
if (options.from == 'button') { | |||
var orderId = options.target.dataset.orderid; | |||
shareObj.path = `/pages/index/index?orderId=${orderId}&from=${"discount"}`; | |||
} | |||
// 返回shareObj | |||
return shareObj; | |||
}, | |||
}) | |||
function diffTime(startDate) { | |||
var diff = new Date().getTime() - startDate; | |||
var days = Math.floor(diff / (24 * 3600 * 1000)); | |||
var leave1 = diff % (24 * 3600 * 1000); | |||
var hours = Math.floor(leave1 / (3600 * 1000)); | |||
var leave2 = leave1 % (3600 * 1000); | |||
var minutes = Math.floor(leave2 / (60 * 1000)); | |||
var leave3 = leave2 % (60 * 1000); | |||
var seconds = Math.round(leave3 / 1000); | |||
var returnStr = seconds + "秒"; | |||
if (minutes > 0) { | |||
returnStr = minutes + "分" + returnStr; | |||
} | |||
if (hours > 0) { | |||
returnStr = hours + "小时" + returnStr; | |||
} | |||
if (days > 0) { | |||
returnStr = days + "天" + returnStr; | |||
} | |||
if (returnStr.indexOf('-1') == -1) { | |||
return returnStr; | |||
} else { | |||
return '1秒' | |||
} | |||
} | |||
function compare(property) { | |||
return function(a, b) { | |||
var value1 = a[property]; | |||
var value2 = b[property]; | |||
return value2 - value1; | |||
} | |||
} |
@@ -0,0 +1,3 @@ | |||
{ | |||
"component": true | |||
} |
@@ -0,0 +1,80 @@ | |||
<!-- <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> --> | |||
<view class="bargainDetail" hover-class="none" hover-stop-propagation="false" wx:if="{{showPage}}"> | |||
<view class='cancleH'> | |||
<image src='{{cancelH}}' mode='aspectFit'></image> | |||
<!-- <view class='line'></view> --> | |||
</view> | |||
<view class="listitem clearfix" hover-class="none" hover-stop-propagation="false"> | |||
<view class='top'> | |||
<image src="{{data.coverImg}}" lazy-load="true" binderror="" bindload="" mode='aspectFill'></image> | |||
<view class="fl ri" hover-class="none" hover-stop-propagation="false"> | |||
<text class="txt01">{{data.title}}</text> | |||
<!-- <text class="txt02">{{data.subTitle}}</text> --> | |||
<!-- <text class="txt03">{{data.price/100}}元</text> --> | |||
<text class="txt04">可砍至<text class="money">{{data.salePrice/100}}</text>元</text> | |||
</view> | |||
</view> | |||
<view class="progress" hover-class="none" hover-stop-propagation="false"> | |||
<view class="clearfix progesstext" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9}}" hover-class="none" hover-stop-propagation="false"> | |||
<text class="fl">已砍 <text>{{already}}元</text></text> | |||
<text class="fr" wx:if="{{data.pressCurrentValue/100!=0}}">还剩 <text>{{remain}}元</text></text> | |||
</view> | |||
<progress percent="{{((data.price-data.salePrice-data.pressCurrentValue)/(data.price-data.salePrice))*100}}" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9}}" color="#FFB287" class="progressbar"border-radius="10px" backgroundColor="#FFF" stroke-width="10" /> | |||
<view class="time" hover-class="none" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9&&data.orderStatus != 7}}" hover-stop-propagation="false">还剩 <text>{{day}}</text>天:<text>{{hour}}</text>:<text>{{min}}</text>:<text>{{sec}}</text> 结束</view> | |||
<view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{data.orderStatus==9}}"> | |||
砍价已取消 | |||
</view> | |||
<view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{todayDate>data.pressEndDate && discountStatus !=1}}"> | |||
好友的砍价已过期 | |||
</view> | |||
<view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{todayDate>data.pressEndDate && discountStatus ==1}}"> | |||
您的砍价已过期 | |||
</view> | |||
<view class="status" hover-class="none" hover-stop-propagation="false" wx:if="{{discountStatus==3}}"> | |||
<button bindtap="barginAgain" data-couponChannelId="{{data.couponChannelId}}" data-couponId="{{data.productId}}" data-id="{{data.id}}">发起砍价</button> | |||
<button bindtap="gotomore">更多砍价商品</button> | |||
</view> | |||
<!-- <view class='help' wx:if="{{data.orderStatus != 7&&data.orderStatus != 1&&data.orderStatus != 9}}">还需邀请<text>{{data.pressLimitNum-data.orderPressList.length}}</text>位好友,帮忙砍至底价</view> --> | |||
<view class="success" wx:if="{{data.orderStatus == 7||data.orderStatus == 1}}" hover-class="none" hover-stop-propagation="false"> | |||
<image src="{{wmsuccess01}}" mode="widthFix"></image> | |||
<text class="" selectable="false" space="false" decode="false"> | |||
已砍至底价 | |||
</text> | |||
</view> | |||
<view class='helpDiscount' wx:if="{{data.orderStatus == 6&&discountStatus == 2}}"> | |||
<image bindtap='helpDiscount' src='{{wmhelp}}' mode='widthFix'></image> | |||
</view> | |||
</view> | |||
<view class="people" hover-class="none" hover-stop-propagation="false" wx:if="{{data.orderStatus!=9}}"> | |||
<view class='title'> | |||
砍价人数{{data.orderPressList.length}}/{{data.pressLimitNum}}人 | |||
</view> | |||
<view class="clearfix person" wx:for="{{data.orderPressList}}" wx:key="index"> | |||
<view class="head "> | |||
<image class="headicon" src="{{item.avatarUrl}}" mode="widthFix" lazy-load="true" binderror="" bindload="" /> | |||
<!-- <text wx:if="{{item.first==1}}">发起人</text> --> | |||
</view> | |||
<view class="text fl clearfix"> | |||
<text class="text01 fl"><text>{{item.nickName}}</text></text> | |||
<text class="text02 fl"><text class="fl">砍掉</text><text class="fl">{{item.pressValue/100}}元</text></text> | |||
<text class="text03 fr">{{item.createDate}}前</text> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<form bindsubmit="submit" report-submit='true' > | |||
<view class="btns clearfix" wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate&&data.orderStatus!=1&&data.orderStatus != 9}}" hover-class="none" hover-stop-propagation="false"> | |||
<!-- <button class="fl" form-type="submit" bindtap='orderFunc1' data-couponChannelId="{{data.couponChannelId}}" data-price="{{data.price/100}}" data-couponId="{{data.productId}}" disabled='{{showButton}}' data-rushtobuy='rushtobuy'> | |||
<text>{{data.price/100}}元</text> | |||
<text>立即购买</text> | |||
</button> --> | |||
<button class='share user-motto' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友砍价</button> | |||
</view> | |||
</form> | |||
<view style='display:{{display}}' wx:if="{{data.orderStatus == 7&&discountStatus == 1}}" class="btns01 clearfix" hover-class="none" hover-stop-propagation="false"> | |||
<button bindtap='orderFunc' disabled='{{showButton1}}' data-orderId="{{data.id}}" data-salePrice="{{data.salePrice/100}}" hover-class="other-button-hover">{{data.salePrice/100}}元 底价购买</button> | |||
</view> | |||
</view> |
@@ -0,0 +1,379 @@ | |||
page{ | |||
width: 100%; | |||
height: 100%; | |||
position: fixed; | |||
top: 0; | |||
left: 0; | |||
background: rgba(0, 0, 0, 0.5); | |||
overflow: hidden; | |||
/* z-index: 10000; */ | |||
color: #fff; | |||
} | |||
.cancleH{ | |||
width: 60rpx; | |||
height: 120rpx; | |||
position: absolute; | |||
right: 92rpx; | |||
top: 60rpx; | |||
} | |||
.cancleH image{ | |||
width: 60rpx; | |||
height: 60rpx; | |||
/* margin-top: 20rpx; */ | |||
} | |||
.line{ | |||
height: 50rpx; | |||
width: 4rpx; | |||
background:#ccc; | |||
margin: 0 auto; | |||
} | |||
.bargainDetail { | |||
padding: 0 33rpx 0; | |||
} | |||
.progress .fl { | |||
/* width: 150rpx; */ | |||
height: 60rpx; | |||
border-radius:16rpx; | |||
color: #FFF; | |||
} | |||
.listitem .icon { | |||
width: 140rpx; | |||
height: 116rpx; | |||
position: absolute; | |||
top: 12rpx; | |||
right: 0; | |||
} | |||
.title{ | |||
display: block; | |||
font-size: 30rpx; | |||
color: #fff; | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
padding-top: 20rpx; | |||
} | |||
.help{ | |||
display: block; | |||
text-align: center; | |||
font-size: 28rpx; | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
margin-top: 47rpx; | |||
} | |||
.help text{ | |||
color: red; | |||
} | |||
.listitem .ri { | |||
margin-left: 26rpx; | |||
width: 305rpx; | |||
} | |||
.ri text { | |||
display: block; | |||
text-align: left; | |||
} | |||
.ri .txt01 { | |||
width: 100%; | |||
color: #FFF; | |||
line-height: 32rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
margin-top: 12rpx; | |||
} | |||
.ri .txt02 { | |||
width: 100%; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
font-size: 24rpx; | |||
color: rgba(140, 140, 140, 1); | |||
} | |||
.ri .txt03 { | |||
width: 100%; | |||
font-size: 24rpx; | |||
text-decoration: line-through; | |||
color: rgba(140, 140, 140, 1); | |||
} | |||
.ri .txt04 { | |||
width: 100%; | |||
font-size: 24rpx; | |||
color: #FFF; | |||
line-height: 44rpx; | |||
margin-top: 16rpx; | |||
} | |||
.money { | |||
display: inline-block !important; | |||
font-size: 50rpx; | |||
font-weight: 500; | |||
color: #FFF; | |||
} | |||
.listitem { | |||
width: 538rpx; | |||
height: 624rpx; | |||
position: relative; | |||
padding: 60rpx 40rpx; | |||
border-radius: 15rpx; | |||
background: linear-gradient(160deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||
margin: 170rpx auto 30rpx; | |||
display: flex; | |||
flex-direction:column; | |||
} | |||
.top{ | |||
width:548rpx; | |||
height: 140rpx; | |||
margin: 0 auto 20rpx; | |||
padding: 0 20rpx; | |||
} | |||
.top image{ | |||
width:120rpx; | |||
height:120rpx; | |||
border-radius:16rpx; | |||
float: left; | |||
} | |||
.top tit{ | |||
margin-left:26rpx; | |||
width:305rpx; | |||
} | |||
.progress { | |||
width: 519rpx; | |||
height: 170rpx; | |||
margin: 0 auto; | |||
} | |||
.progesstext>text { | |||
font-size: 24rpx; | |||
color: #FFF; | |||
} | |||
.progesstext text text { | |||
color: #FFF; | |||
} | |||
.time { | |||
margin-top: 20rpx; | |||
font-size: 24rpx; | |||
color: #FFF; | |||
text-align:center; | |||
} | |||
.time text { | |||
font-size: 30rpx; | |||
color: #FD832D; | |||
display: inline-block; | |||
width: 40rpx; | |||
text-align: center; | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
background: #FFF; | |||
border-radius: 10rpx; | |||
margin: 0 4px; | |||
} | |||
.head{ | |||
width:52rpx; | |||
height: 52rpx; | |||
position: relative; | |||
float: left | |||
} | |||
.head image{ | |||
width: 52rpx; | |||
height: 52rpx; | |||
border-radius:26rpx; | |||
} | |||
.head text{ | |||
width: 70rpx; | |||
position: absolute; | |||
bottom: 0; | |||
left: 0; | |||
right: 0; | |||
font-size: 20rpx; | |||
background: #ED3F2E; | |||
color: #fff; | |||
text-align: center; | |||
border-radius: 20rpx; | |||
} | |||
.text{ | |||
width: 85%; | |||
padding-left: 3%; | |||
display: inline-block; | |||
height: 52rpx; | |||
line-height: 52rpx; | |||
font-size: 26rpx; | |||
} | |||
.text01{ | |||
width: 70rpx; | |||
margin-right: 6rpx; | |||
} | |||
.text01 text{ | |||
width: 100rpx; | |||
float: left; | |||
height: 52rpx; | |||
line-height: 52rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
} | |||
.text02{ | |||
display: inline-block; | |||
} | |||
.text02 .fl{ | |||
color: #FFF!important; | |||
} | |||
.text03{ | |||
/* width: 180rpx; */ | |||
text-align: right; | |||
font-size:24rpx; | |||
height: 52rpx; | |||
line-height: 52rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
} | |||
.person{ | |||
/* border-bottom: 1px solid #F0CDB3; */ | |||
padding-bottom: 31rpx; | |||
padding-top: 31rpx; | |||
color: #fff; | |||
} | |||
.text02 text:nth-of-type(2){ | |||
color: #FF3535; | |||
text-align: left; | |||
} | |||
.people{ | |||
border-radius:16rpx; | |||
padding:0 20rpx; | |||
} | |||
.btns{ | |||
padding:33rpx; | |||
position: fixed; | |||
left: 0; | |||
right: 0; | |||
bottom: 100rpx; | |||
z-index: 100; | |||
/* background: #fff; */ | |||
} | |||
.btns button{ | |||
width: 500rpx!important; | |||
height: 92rpx; | |||
border-radius:32rpx; | |||
text-align: center; | |||
margin: 0 auto; | |||
font-size: 32rpx; | |||
color: #fff; | |||
line-height: 92rpx; | |||
background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||
/* box-shadow:0px 8px 8px 1px rgba(204,26,13,0.32); */ | |||
} | |||
.goback{ | |||
position: fixed; | |||
right: 50rpx; | |||
top: 60rpx; | |||
width:100rpx!important; | |||
height:100rpx; | |||
z-index: 100; | |||
background:rgba(255,255,255,1); | |||
line-height: 95rpx; | |||
border:1rpx solid rgba(227,227,227,1); | |||
border-radius:50%; | |||
} | |||
.goback image{ | |||
position: absolute; | |||
width: 60rpx; | |||
left: 0; | |||
right: 0; | |||
top: 0; | |||
bottom: 0; | |||
margin: auto; | |||
} | |||
.helpDiscount{ | |||
display: block; | |||
width: 200rpx; | |||
height: 200rpx; | |||
border-radius:50%; | |||
font-size: 26rpx; | |||
text-align: center; | |||
line-height: 200rpx; | |||
margin: 30rpx auto 0; | |||
color: #fff!important; | |||
} | |||
.helpDiscount image{ | |||
display: block; | |||
width: 200rpx; | |||
height: 200rpx; | |||
} | |||
.helpDiscount::after{ border: none; } | |||
.success{ | |||
margin-top: 50rpx; | |||
} | |||
.success image{ | |||
display: block; | |||
width: 74rpx; | |||
height: 74rpx; | |||
margin: 0 auto; | |||
} | |||
.success text{ | |||
display: block; | |||
text-align: center; | |||
font-size:30rpx; | |||
line-height: 30rpx; | |||
color:rgba(51,51,51,1); | |||
} | |||
.btns01{ | |||
position: fixed; | |||
left: 0; | |||
right: 0; | |||
bottom: 0; | |||
padding: 30rpx 0; | |||
} | |||
.btns01 button{ | |||
color:rgba(254,254,254,1); | |||
width:650rpx; | |||
height:85rpx; | |||
line-height: 85rpx; | |||
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); | |||
box-shadow:0px 8px 8px 1px rgba(246,93,51,0.32); | |||
border-radius:43rpx; | |||
} | |||
.fail{ | |||
height:166rpx; | |||
background:rgba(226,226,226,1); | |||
border-radius:10rpx; | |||
font-size:30rpx; | |||
text-align: center; | |||
line-height: 166rpx; | |||
color:rgba(51,51,51,1); | |||
margin: 20rpx auto 0; | |||
} | |||
.status{ | |||
width: 520rpx; | |||
margin: 40rpx auto 0; | |||
} | |||
.status button{ | |||
display: block; | |||
width: 520rpx; | |||
height: 95rpx; | |||
line-height: 95rpx; | |||
text-align: center; | |||
border: none; | |||
} | |||
button::after{ border: none; } | |||
.status button:nth-of-type(1){ | |||
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); | |||
border:1px solid rgba(236,59,45,1); | |||
border-radius:48rpx; | |||
margin-bottom: 38rpx; | |||
color: #fff; | |||
} | |||
.status button:nth-of-type(2){ | |||
background:#fff; | |||
border:1px solid rgba(190,190,190,1); | |||
border-radius:48rpx; | |||
color: #333; | |||
} |
@@ -21,11 +21,10 @@ Component({ | |||
jianUrl: imgurl.jian.url, | |||
barginicon: imgurl.barginicon.url, | |||
wangmeimeibargin: imgurl.wangmeimeibargin.url, | |||
list: [], | |||
pintuanList:[], | |||
total: '', | |||
flag:false, | |||
page:1, | |||
kData:[], | |||
pData:[], | |||
couponId:'', | |||
couponId1: '', | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
@@ -34,17 +33,15 @@ Component({ | |||
//获取砍价列表 | |||
getList() { | |||
let that = this; | |||
let param ={ | |||
targetAd: 6, | |||
} | |||
Http.get({ | |||
url: config.api.couponChannelList, | |||
data: { | |||
pageNum: this.data.page++, | |||
pageSize: 1, | |||
targetAd: 6 | |||
} | |||
url: config.api.change, | |||
data:param, | |||
}).then(res => { | |||
that.setData({ | |||
list: res.data.list, | |||
total: res.data.total | |||
kData:res.data | |||
}); | |||
}) | |||
.catch(err => { | |||
@@ -59,20 +56,18 @@ Component({ | |||
}, | |||
//获取拼团列表 | |||
getptList() { | |||
let param1 = { | |||
targetAd: 7, | |||
} | |||
Http.get({ | |||
url: config.api.couponChannelList, | |||
data: { | |||
pageNum: this.data.page++, | |||
pageSize: 1, | |||
targetAd: 7 | |||
}, | |||
url: config.api.change, | |||
data: param1, | |||
}).then(res => { | |||
this.setData({ | |||
pintuanList: res.data.list, | |||
total: res.data.total, | |||
flag: true | |||
pData:res.data, | |||
couponId: res.data.couponId | |||
}); | |||
console.log(this.data.pintuanList) | |||
console.log( this.data.couponId) | |||
}) | |||
.catch(err => { | |||
wx.showToast({ | |||
@@ -82,11 +77,53 @@ Component({ | |||
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 | |||
}); | |||
}) | |||
.catch(err => { | |||
wx.showToast({ | |||
title: err.errMsg, | |||
icon: 'none', | |||
duration: 2000, | |||
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 | |||
}); | |||
}) | |||
.catch(err => { | |||
console.log(err) | |||
wx.showToast({ | |||
title: err.errMsg, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
}) | |||
}, | |||
//跳转砍价详情 | |||
gotokjdetail: function (e) { | |||
@@ -5,7 +5,7 @@ | |||
<view class='sql' style='background:{{sql}}'></view> | |||
<text>爆款专区</text> | |||
</view> | |||
<view class='titleR' bindtap='getList' > | |||
<view class='titleR' bindtap='getChange' > | |||
<text style='color:{{txt}}'>换一换</text> | |||
<view> | |||
<image src='{{change}}' bindtap='' mode='aspectFill'></image> | |||
@@ -13,18 +13,18 @@ | |||
</view> | |||
</view> | |||
<view class='hotCon' > | |||
<view class='kanjia' wx:if="{{list.length>0}}" bindtap="gotokjdetail" data-couponId='{{list[0].couponId}}' data-couponChannelId="{{list[0].id}}" data-targetAd="{{list[0].targetAd}}" > | |||
<view class='kanjia' wx:if="{{kData.id}}" bindtap="gotokjdetail" data-couponId='{{kData.couponId}}' data-couponChannelId="{{kData.id}}" data-targetAd="{{kData.targetAd}}" > | |||
<view > | |||
<image mode='aspectFill' lazy-load='true' src="{{list[0].coverImg}}" /> | |||
<image mode='aspectFill' lazy-load='true' src="{{kData.coverImg}}" /> | |||
</view> | |||
<view class='kjText'> | |||
<text class='title'>{{list[0].title}}</text> | |||
<text class='price'>¥{{list[0].priceStr}}</text> | |||
<text class='sale'><text>¥</text>{{list[0].salePriceStr}}</text> | |||
<text class='title'>{{kData.title}}</text> | |||
<text class='price'>¥{{kData.priceStr}}</text> | |||
<text class='sale'><text>¥</text>{{kData.salePriceStr}}</text> | |||
<view class=' btn btnk'>砍价</view> | |||
</view> | |||
</view> | |||
<view class='kanjia' wx:if="{{list.length==0}}"> | |||
<view class='kanjia' wx:if="{{!kData.id}}"> | |||
<view> | |||
<image src='{{None}}' bindtap='' mode='aspectFill'></image> | |||
</view> | |||
@@ -35,18 +35,18 @@ | |||
</view> | |||
</view> | |||
<view class='pintuan'wx:if="{{list.length>0}}" bindtap="gotoptdetail" data-couponId='{{pintuanList[0].couponId}}' data-couponChannelId="{{pintuanList[0].id}}" data-targetAd="{{pintuanList[0].targetAd}}"> | |||
<view class='pintuan' wx:if="{{pData.id}}" bindtap="gotoptdetail" data-couponId='{{pData.couponId}}' data-couponChannelId="{{pData.id}}" data-targetAd="{{pData.targetAd}}"> | |||
<view> | |||
<image mode='aspectFill' lazy-load='true' src="{{pintuanList[0].coverImg}}" /> | |||
<image mode='aspectFill' lazy-load='true' src="{{pData.coverImg}}" /> | |||
</view> | |||
<view class='ptText'> | |||
<text class='title'>{{pintuanList[0].title}}</text> | |||
<text class='price'>¥{{pintuanList[0].priceStr}}</text> | |||
<text class='sale'> <text>¥</text>{{pintuanList[0].salePriceStr}}</text> | |||
<text class='title'>{{pData.title}}</text> | |||
<text class='price'>¥{{pData.priceStr}}</text> | |||
<text class='sale'> <text>¥</text>{{pData.salePriceStr}}</text> | |||
<view class='btn btnp' >拼团</view> | |||
</view> | |||
</view> | |||
<view class='pintuan' wx:if="{{list.length==0}}"> | |||
<view class='pintuan' wx:if="{{!pData.id}}"> | |||
<view> | |||
<image src='{{None}}' bindtap='' mode='aspectFill'></image> | |||
</view> | |||
@@ -48,6 +48,10 @@ var config = { | |||
* 频道查询 | |||
*/ | |||
couponChannelList: "/wxCouponChannel/list", | |||
/** | |||
* 换一换change | |||
*/ | |||
change: "/wxCouponChannel/change", | |||
/** | |||
* 下订单 | |||
*/ | |||
@@ -6,6 +6,7 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
noCoupon: imgurl.noCoupon.url, | |||
orangeImg: imgurl.orange.url, | |||
blueImg: imgurl.blue.url, | |||
grayImg: imgurl.gray.url, | |||
@@ -73,11 +73,11 @@ | |||
</view> | |||
<view class='no-data01' wx:if='{{flag=="bargaingoods"&&lists.length==0}}' style='{{"height:"+(list.length>0?"calc(100vh - 460rpx)":"calc(100vh - 160rpx)")}}'> | |||
<image src='{{actUrl}}'></image> | |||
<image src='{{noCoupon}}'></image> | |||
<view class='no-data-text'>暂无数据</view> | |||
</view> | |||
<view class='no-data' wx:if='{{flag=="mybargain"&&lists.length==0}}'> | |||
<image src='{{actUrl}}'></image> | |||
<image src='{{noCoupon}}'></image> | |||
<view class='no-data-text'>暂无数据</view> | |||
</view> | |||
<view class='bottom'> | |||
@@ -9,6 +9,7 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
cancelH: imgurl.cancelH.url, | |||
bannerUrl: imgurl.banner.url, | |||
wmhome: imgurl.wmhome.url, | |||
wmhelp: imgurl.wmhelp.url, | |||
@@ -1,6 +1,6 @@ | |||
{ | |||
"navigationBarTitleText": "砍价详情", | |||
"navigationBarBackgroundColor":"#FF6F03", | |||
"navigationBarTextStyle": "white", | |||
"navigationBarBackgroundColor":"#F4F5F9", | |||
"navigationBarTextStyle": "black", | |||
"enablePullDownRefresh": true | |||
} |
@@ -1,23 +1,27 @@ | |||
<button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
<!-- <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> --> | |||
<view class="bargainDetail" hover-class="none" hover-stop-propagation="false" wx:if="{{showPage}}"> | |||
<view class='cancleH'> | |||
<image src='{{cancelH}}' mode='aspectFit'></image> | |||
<!-- <view class='line'></view> --> | |||
</view> | |||
<view class="listitem clearfix" hover-class="none" hover-stop-propagation="false"> | |||
<image class="fl" src="{{data.coverImg}}" lazy-load="true" binderror="" bindload="" mode='aspectFill'></image> | |||
<view class='top'> | |||
<image src="{{data.coverImg}}" lazy-load="true" binderror="" bindload="" mode='aspectFill'></image> | |||
<view class="fl ri" hover-class="none" hover-stop-propagation="false"> | |||
<text class="txt01">{{data.title}}</text> | |||
<text class="txt02">{{data.subTitle}}</text> | |||
<text class="txt03">{{data.price/100}}元</text> | |||
<!-- <text class="txt02">{{data.subTitle}}</text> --> | |||
<!-- <text class="txt03">{{data.price/100}}元</text> --> | |||
<text class="txt04">可砍至<text class="money">{{data.salePrice/100}}</text>元</text> | |||
</view> | |||
</view> | |||
<view class="progress" hover-class="none" hover-stop-propagation="false"> | |||
</view> | |||
<view class="progress" hover-class="none" hover-stop-propagation="false"> | |||
<view class="clearfix progesstext" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9}}" hover-class="none" hover-stop-propagation="false"> | |||
<text class="fl">已砍 <text>{{already}}元</text></text> | |||
<text class="fr" wx:if="{{data.pressCurrentValue/100!=0}}">还剩 <text>{{remain}}元</text></text> | |||
<text class="fl">已砍 <text>{{already}}元</text></text> | |||
<text class="fr" wx:if="{{data.pressCurrentValue/100!=0}}">还剩 <text>{{remain}}元</text></text> | |||
</view> | |||
<progress percent="{{((data.price-data.salePrice-data.pressCurrentValue)/(data.price-data.salePrice))*100}}" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9}}" color="#FF3535" class="progressbar"border-radius="10px" backgroundColor="#FECFCF" stroke-width="10" /> | |||
<view class="time" hover-class="none" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9&&data.orderStatus != 7}}" hover-stop-propagation="false"> | |||
还剩 <text>{{day}}</text>天:<text>{{hour}}</text>:<text>{{min}}</text>:<text>{{sec}}</text> 结束 | |||
</view> | |||
<progress percent="{{((data.price-data.salePrice-data.pressCurrentValue)/(data.price-data.salePrice))*100}}" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9}}" color="#FFB287" class="progressbar"border-radius="10px" backgroundColor="#FFF" stroke-width="10" /> | |||
<view class="time" hover-class="none" wx:if="{{data.orderStatus !=8&&data.orderStatus!=1&&data.orderStatus!=9&&data.orderStatus != 7}}" hover-stop-propagation="false">还剩 <text>{{day}}</text>天:<text>{{hour}}</text>:<text>{{min}}</text>:<text>{{sec}}</text> 结束</view> | |||
<view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{data.orderStatus==9}}"> | |||
砍价已取消 | |||
</view> | |||
@@ -31,26 +35,26 @@ | |||
<button bindtap="barginAgain" data-couponChannelId="{{data.couponChannelId}}" data-couponId="{{data.productId}}" data-id="{{data.id}}">发起砍价</button> | |||
<button bindtap="gotomore">更多砍价商品</button> | |||
</view> | |||
<view class='help' wx:if="{{data.orderStatus != 7&&data.orderStatus != 1&&data.orderStatus != 9}}">还需邀请<text>{{data.pressLimitNum-data.orderPressList.length}}</text>位好友,帮忙砍至底价</view> | |||
<!-- <view class='help' wx:if="{{data.orderStatus != 7&&data.orderStatus != 1&&data.orderStatus != 9}}">还需邀请<text>{{data.pressLimitNum-data.orderPressList.length}}</text>位好友,帮忙砍至底价</view> --> | |||
<view class="success" wx:if="{{data.orderStatus == 7||data.orderStatus == 1}}" hover-class="none" hover-stop-propagation="false"> | |||
<image src="{{wmsuccess01}}" mode="widthFix"></image> | |||
<text class="" selectable="false" space="false" decode="false"> | |||
已砍至底价 | |||
</text> | |||
</view> | |||
<view class='helpDiscount' wx:if="{{data.orderStatus == 6&&discountStatus == 2}}"> | |||
<image bindtap='helpDiscount' src='{{wmhelp}}' mode='widthFix'></image> | |||
<image src="{{wmsuccess01}}" mode="widthFix"></image> | |||
<text class="" selectable="false" space="false" decode="false"> | |||
已砍至底价 | |||
</text> | |||
</view> | |||
<view class='helpDiscount' wx:if="{{data.orderStatus == 6&&discountStatus == 2}}"> | |||
<image bindtap='helpDiscount' src='{{wmhelp}}' mode='widthFix'></image> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="people" hover-class="none" hover-stop-propagation="false" wx:if="{{data.orderStatus!=9}}"> | |||
<view class="people" hover-class="none" hover-stop-propagation="false" wx:if="{{data.orderStatus!=9}}"> | |||
<view class='title'> | |||
砍价人数{{data.orderPressList.length}}/{{data.pressLimitNum}}人 | |||
</view> | |||
<view class="clearfix person" wx:for="{{data.orderPressList}}" wx:key="index"> | |||
<view class="head fl"> | |||
<view class="head "> | |||
<image class="headicon" src="{{item.avatarUrl}}" mode="widthFix" lazy-load="true" binderror="" bindload="" /> | |||
<text wx:if="{{item.first==1}}">发起人</text> | |||
<!-- <text wx:if="{{item.first==1}}">发起人</text> --> | |||
</view> | |||
<view class="text fl clearfix"> | |||
<text class="text01 fl"><text>{{item.nickName}}</text></text> | |||
@@ -58,6 +62,7 @@ | |||
<text class="text03 fr">{{item.createDate}}前</text> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<form bindsubmit="submit" report-submit='true' > | |||
@@ -1,21 +1,42 @@ | |||
page{ | |||
height: auto; | |||
overflow: auto; | |||
background: #FF6F03; | |||
background-image: url('https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/bargindetailbg.jpg'); | |||
background-size: cover; | |||
background-repeat: no-repeat; | |||
width: 100%; | |||
height: 100%; | |||
position: fixed; | |||
top: 0; | |||
left: 0; | |||
background: rgba(0, 0, 0, 0.5); | |||
overflow: hidden; | |||
/* z-index: 10000; */ | |||
color: #fff; | |||
} | |||
.cancleH{ | |||
width: 60rpx; | |||
height: 120rpx; | |||
position: absolute; | |||
right: 92rpx; | |||
top: 60rpx; | |||
} | |||
.cancleH image{ | |||
width: 60rpx; | |||
height: 60rpx; | |||
/* margin-top: 20rpx; */ | |||
} | |||
.line{ | |||
height: 50rpx; | |||
width: 4rpx; | |||
background:#ccc; | |||
margin: 0 auto; | |||
} | |||
.bargainDetail { | |||
padding: 0 33rpx 0; | |||
padding: 0 33rpx 0; | |||
} | |||
.listitem .fl { | |||
width: 180rpx; | |||
height: 180rpx; | |||
border-radius:10rpx; | |||
.progress .fl { | |||
/* width: 150rpx; */ | |||
height: 60rpx; | |||
border-radius:16rpx; | |||
color: #FFF; | |||
} | |||
.listitem .icon { | |||
width: 140rpx; | |||
height: 116rpx; | |||
@@ -26,7 +47,7 @@ page{ | |||
.title{ | |||
display: block; | |||
font-size: 30rpx; | |||
color: #333; | |||
color: #fff; | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
padding-top: 20rpx; | |||
@@ -54,11 +75,12 @@ page{ | |||
.ri .txt01 { | |||
width: 100%; | |||
color: rgba(51, 51, 51, 1); | |||
line-height: 44rpx; | |||
color: #FFF; | |||
line-height: 32rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
margin-top: 12rpx; | |||
} | |||
.ri .txt02 { | |||
@@ -80,75 +102,89 @@ page{ | |||
.ri .txt04 { | |||
width: 100%; | |||
font-size: 24rpx; | |||
color: rgba(255, 50, 50, 1); | |||
color: #FFF; | |||
line-height: 44rpx; | |||
margin-top: 16rpx; | |||
} | |||
.money { | |||
display: inline-block !important; | |||
font-size: 50rpx; | |||
font-weight: 500; | |||
color: rgba(255, 50, 50, 1); | |||
color: #FFF; | |||
} | |||
.listitem { | |||
width: 538rpx; | |||
height: 624rpx; | |||
position: relative; | |||
padding: 31rpx 20rpx; | |||
padding: 60rpx 40rpx; | |||
border-radius: 15rpx; | |||
background: #fff; | |||
margin-bottom: 30rpx; | |||
margin-top:20rpx; | |||
background: linear-gradient(160deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||
margin: 170rpx auto 30rpx; | |||
display: flex; | |||
flex-direction:column; | |||
} | |||
.top{ | |||
width:548rpx; | |||
height: 140rpx; | |||
margin: 0 auto 20rpx; | |||
padding: 0 20rpx; | |||
} | |||
.top image{ | |||
width:120rpx; | |||
height:120rpx; | |||
border-radius:16rpx; | |||
float: left; | |||
} | |||
.top tit{ | |||
margin-left:26rpx; | |||
width:305rpx; | |||
} | |||
.progress { | |||
width: 519rpx; | |||
padding: 30rpx 84rpx; | |||
/* height: 136rpx; */ | |||
background: #fff; | |||
border-radius: 15rpx; | |||
height: 170rpx; | |||
margin: 0 auto; | |||
} | |||
.progesstext { | |||
margin-bottom: 13rpx; | |||
} | |||
.progesstext>text { | |||
font-size: 24rpx; | |||
color: rgba(51, 51, 51, 1); | |||
color: #FFF; | |||
} | |||
.progesstext text text { | |||
color: #FF3535; | |||
color: #FFF; | |||
} | |||
.time { | |||
margin-top: 20rpx; | |||
font-size: 24rpx; | |||
color: #333; | |||
color: #FFF; | |||
text-align:center; | |||
} | |||
.time text { | |||
font-size: 30rpx; | |||
color: #fff; | |||
color: #FD832D; | |||
display: inline-block; | |||
width: 40rpx; | |||
text-align: center; | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
background: rgba(51, 51, 51, 1); | |||
background: #FFF; | |||
border-radius: 10rpx; | |||
margin: 0 4px; | |||
} | |||
.head{ | |||
width:10%; | |||
height: 90rpx; | |||
width:52rpx; | |||
height: 52rpx; | |||
position: relative; | |||
float: left | |||
} | |||
.head image{ | |||
width: 70rpx; | |||
border-radius:10rpx; | |||
width: 52rpx; | |||
height: 52rpx; | |||
border-radius:26rpx; | |||
} | |||
.head text{ | |||
width: 70rpx; | |||
@@ -163,24 +199,22 @@ page{ | |||
border-radius: 20rpx; | |||
} | |||
.text{ | |||
width: 87%; | |||
width: 85%; | |||
padding-left: 3%; | |||
display: inline-block; | |||
height: 90rpx; | |||
line-height: 90rpx; | |||
height: 52rpx; | |||
line-height: 52rpx; | |||
font-size: 26rpx; | |||
} | |||
.text01{ | |||
width: 100rpx; | |||
width: 70rpx; | |||
margin-right: 6rpx; | |||
height: 76rpx; | |||
line-height: 76rpx; | |||
} | |||
.text01 text{ | |||
width: 100rpx; | |||
float: left; | |||
height: 90rpx; | |||
line-height: 90rpx; | |||
height: 52rpx; | |||
line-height: 52rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
@@ -188,20 +222,25 @@ page{ | |||
.text02{ | |||
display: inline-block; | |||
} | |||
.text02 .fl{ | |||
color: #FFF!important; | |||
} | |||
.text03{ | |||
width: 240rpx; | |||
/* width: 180rpx; */ | |||
text-align: right; | |||
font-size:24rpx; | |||
height: 76rpx; | |||
line-height: 76rpx; | |||
height: 52rpx; | |||
line-height: 52rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
} | |||
.person{ | |||
border-bottom: 1px solid #F0CDB3; | |||
/* border-bottom: 1px solid #F0CDB3; */ | |||
padding-bottom: 31rpx; | |||
padding-top: 31rpx; | |||
color: #fff; | |||
} | |||
.text02 text:nth-of-type(2){ | |||
color: #FF3535; | |||
@@ -209,31 +248,28 @@ page{ | |||
} | |||
.people{ | |||
border-radius:16rpx; | |||
background: #FFEADA; | |||
margin-top: 30rpx; | |||
padding:0 20rpx; | |||
margin-bottom: 165rpx; | |||
} | |||
.btns{ | |||
padding:33rpx; | |||
position: fixed; | |||
left: 0; | |||
right: 0; | |||
bottom: 0; | |||
bottom: 100rpx; | |||
z-index: 100; | |||
/* background: #fff; */ | |||
} | |||
.btns button{ | |||
width: 500rpx!important; | |||
height: 95rpx; | |||
border-radius:48rpx; | |||
height: 92rpx; | |||
border-radius:32rpx; | |||
text-align: center; | |||
margin: 0 auto; | |||
font-size: 30rpx; | |||
font-size: 32rpx; | |||
color: #fff; | |||
line-height: 95rpx; | |||
background:linear-gradient(90deg,rgba(229,54,40,1) 0%,rgba(243,75,30,1) 99%); | |||
box-shadow:0px 8px 8px 1px rgba(204,26,13,0.32); | |||
line-height: 92rpx; | |||
background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||
/* box-shadow:0px 8px 8px 1px rgba(204,26,13,0.32); */ | |||
} | |||
.goback{ | |||
position: fixed; | |||
@@ -5,6 +5,7 @@ const util = require("../../../utils/util"); | |||
const imgurl = require("../../../utils/imgurl"); | |||
Page({ | |||
data: { | |||
isshowposter1: true,//是否显示发起砍价 | |||
isshowposter:false,//是否显示分享弹框 | |||
fenxiangUrl: imgurl.fenxiang.url, | |||
clockUrl: imgurl.clock.url, | |||
@@ -84,7 +85,7 @@ Page({ | |||
maxLimit:0, | |||
dispressEndDate:false | |||
}, | |||
/** | |||
/** | |||
* 显示分享弹框 | |||
*/ | |||
showshare: function() { | |||
@@ -100,6 +101,22 @@ Page({ | |||
isshowposter: false, | |||
}) | |||
}, | |||
/** | |||
* 显示发起砍价 | |||
*/ | |||
showshare1: function () { | |||
this.setData({ | |||
isshowposter1: true, | |||
}) | |||
}, | |||
/** | |||
* 隐藏发起砍价 | |||
*/ | |||
hidemodal1: function () { | |||
this.setData({ | |||
isshowposter1: false, | |||
}) | |||
}, | |||
/** | |||
* 跳转到门店列表的详情页面 | |||
*/ | |||
@@ -574,17 +591,17 @@ Page({ | |||
/** | |||
* 邀请好友继续砍价 | |||
*/ | |||
inviteFriend: function(e) { | |||
let that = this; | |||
let formId = e.detail.formId; | |||
that.setData({ | |||
formId: formId | |||
}) | |||
that.orderFunc("discount"); | |||
that.setData({ | |||
showbutton1: true | |||
}) | |||
}, | |||
// inviteFriend: function(e) { | |||
// let that = this; | |||
// let formId = e.detail.formId; | |||
// that.setData({ | |||
// formId: formId | |||
// }) | |||
// that.orderFunc("discount"); | |||
// that.setData({ | |||
// showbutton1: true | |||
// }) | |||
// }, | |||
/** | |||
* 支付订单更新 | |||
*/ | |||
@@ -920,7 +937,7 @@ Page({ | |||
success: function (res) { | |||
if (res.confirm) { | |||
wx.navigateTo({ | |||
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}`, | |||
url: `/components/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}`, | |||
}) | |||
} | |||
} | |||
@@ -45,7 +45,7 @@ | |||
<text class='title'>{{data.title}}<text class="elecard" wx:if="{{data.type==100}}">电子卡</text></text> | |||
<text class="subTitle">{{data.subTitle}}</text> | |||
<view class='salePriceStr clearfix'> | |||
<text class='rmb'>¥</text> | |||
<!-- <text class='rmb'>¥</text> --> | |||
<view class="fl" wx:if="{{data.type!=8}}"> | |||
<text class="pri01" wx:if="{{data.type!=50&&data.type!=51}}">{{data.salePriceStr}}</text> | |||
<text class="pri01" wx:if="{{data.type==50||data.type==51}}">{{data.creditPrice}}积分</text> | |||
@@ -151,11 +151,11 @@ | |||
<text>立即购买</text> | |||
</button> | |||
</form> | |||
<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}}'> | |||
<view bindtap='showshare1' 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> | |||
</view> | |||
</view> | |||
<!-- 问卷调查 --> | |||
@@ -219,4 +219,6 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 发起砍价弹框 --> | |||
<c-bargainDatail bindtap='hidemodal1' class="business" couponChannelId="{{data.id}}" wx:if="{{isshowposter1}}"/> | |||
</view> |
@@ -1,7 +1,7 @@ | |||
@import "../../../app.wxss"; | |||
page { | |||
background: #fff; | |||
background: #F4F5F9; | |||
} | |||
button::after { | |||
@@ -740,10 +740,9 @@ button::after { | |||
} | |||
.presslimit { | |||
width: 172rpx; | |||
width: 300rpx; | |||
height: 34rpx; | |||
line-height: 34rpx; | |||
background:rgba(201,201,201,0.1); | |||
margin-top: 8rpx; | |||
margin-left: 12rpx; | |||
color: #FD782D; | |||
@@ -755,6 +754,7 @@ button::after { | |||
} | |||
.presslimit text{ | |||
margin-left: 22rpx; | |||
background:rgba(201,201,201,0.1); | |||
} | |||
checkbox-group, radio-group { | |||
@@ -1,10 +1,10 @@ | |||
<button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
<view class='content-box' style='{{"padding-bottom:"+(lists.length>0?"200rpx":"0")}}'> | |||
<view class='top' wx:if='{{flag=="spellList"&&list.length>0}}'> | |||
<!-- <view class='top' wx:if='{{flag=="spellList"&&list.length>0}}'> | |||
<view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false"> | |||
<c-banner wx:key="unique" list="{{list}}" /> | |||
</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> | |||
<view class='no-data-text'>暂无数据</view> | |||
@@ -13,7 +13,7 @@ | |||
<image src='{{nodata}}'></image> | |||
<view class='no-data-text'>暂无数据</view> | |||
</view> | |||
<view class='content' style='{{"margin-top:"+(flag=="spellList"&&list.length>0?"320rpx":"20rpx")}}'> | |||
<view class='content'> | |||
<view class='sepll-list' wx:if='{{flag=="spellList"}}' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'> | |||
<view class='spell-left'> | |||
<image src='{{item.coverImg}}' mode="aspectFill"></image> | |||
@@ -661,5 +661,9 @@ module.exports = { | |||
'url': baseUrl + "rightHr.png", | |||
'name': '' | |||
}, | |||
'cancelH': { | |||
'url': baseUrl + "cancelH.png", | |||
'name': '' | |||
}, | |||
} |