diff --git a/components/bargainDatail/index.js b/components/bargainDatail/index.js
new file mode 100644
index 0000000..41c800f
--- /dev/null
+++ b/components/bargainDatail/index.js
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/components/bargainDatail/index.json b/components/bargainDatail/index.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/components/bargainDatail/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/components/bargainDatail/index.wxml b/components/bargainDatail/index.wxml
new file mode 100644
index 0000000..b4ef481
--- /dev/null
+++ b/components/bargainDatail/index.wxml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+ {{data.title}}
+
+
+ 可砍至{{data.salePrice/100}}元
+
+
+
+
+
+ 已砍 {{already}}元
+ 还剩 {{remain}}元
+
+
+ 还剩 {{day}}天:{{hour}}:{{min}}:{{sec}} 结束
+
+ 砍价已取消
+
+
+ 好友的砍价已过期
+
+
+ 您的砍价已过期
+
+
+
+
+
+
+
+
+
+ 已砍至底价
+
+
+
+
+
+
+
+
+
+ 砍价人数{{data.orderPressList.length}}/{{data.pressLimitNum}}人
+
+
+
+
+
+
+
+ {{item.nickName}}
+ 砍掉{{item.pressValue/100}}元
+ {{item.createDate}}前
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/bargainDatail/index.wxss b/components/bargainDatail/index.wxss
new file mode 100644
index 0000000..abefd28
--- /dev/null
+++ b/components/bargainDatail/index.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/components/hot/index.js b/components/hot/index.js
index 97ce405..11af71b 100644
--- a/components/hot/index.js
+++ b/components/hot/index.js
@@ -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) {
diff --git a/components/hot/index.wxml b/components/hot/index.wxml
index a330e8c..b7f1b8f 100644
--- a/components/hot/index.wxml
+++ b/components/hot/index.wxml
@@ -5,7 +5,7 @@
爆款专区
-
+
换一换
@@ -13,18 +13,18 @@
-
+
-
+
- {{list[0].title}}
- ¥{{list[0].priceStr}}
- ¥{{list[0].salePriceStr}}
+ {{kData.title}}
+ ¥{{kData.priceStr}}
+ ¥{{kData.salePriceStr}}
砍价
-
+
@@ -35,18 +35,18 @@
-
+
-
+
- {{pintuanList[0].title}}
- ¥{{pintuanList[0].priceStr}}
- ¥{{pintuanList[0].salePriceStr}}
+ {{pData.title}}
+ ¥{{pData.priceStr}}
+ ¥{{pData.salePriceStr}}
拼团
-
+
diff --git a/config/config.js b/config/config.js
index f8864bf..480214f 100755
--- a/config/config.js
+++ b/config/config.js
@@ -48,6 +48,10 @@ var config = {
* 频道查询
*/
couponChannelList: "/wxCouponChannel/list",
+ /**
+ * 换一换change
+ */
+ change: "/wxCouponChannel/change",
/**
* 下订单
*/
diff --git a/pages/bargain/bargain.js b/pages/bargain/bargain.js
index f340a66..ec22719 100644
--- a/pages/bargain/bargain.js
+++ b/pages/bargain/bargain.js
@@ -6,6 +6,7 @@ Page({
* 页面的初始数据
*/
data: {
+ noCoupon: imgurl.noCoupon.url,
orangeImg: imgurl.orange.url,
blueImg: imgurl.blue.url,
grayImg: imgurl.gray.url,
diff --git a/pages/bargain/bargain.wxml b/pages/bargain/bargain.wxml
index 2d0b08d..ce8c842 100644
--- a/pages/bargain/bargain.wxml
+++ b/pages/bargain/bargain.wxml
@@ -73,11 +73,11 @@
-
+
暂无数据
-
+
暂无数据
diff --git a/pages/bargain/bargainDatail/bargainDatail.js b/pages/bargain/bargainDatail/bargainDatail.js
index f30f6c0..21303f2 100644
--- a/pages/bargain/bargainDatail/bargainDatail.js
+++ b/pages/bargain/bargainDatail/bargainDatail.js
@@ -9,6 +9,7 @@ Page({
* 页面的初始数据
*/
data: {
+ cancelH: imgurl.cancelH.url,
bannerUrl: imgurl.banner.url,
wmhome: imgurl.wmhome.url,
wmhelp: imgurl.wmhelp.url,
diff --git a/pages/bargain/bargainDatail/bargainDatail.json b/pages/bargain/bargainDatail/bargainDatail.json
index 6a4e232..05cc4b3 100644
--- a/pages/bargain/bargainDatail/bargainDatail.json
+++ b/pages/bargain/bargainDatail/bargainDatail.json
@@ -1,6 +1,6 @@
{
"navigationBarTitleText": "砍价详情",
- "navigationBarBackgroundColor":"#FF6F03",
- "navigationBarTextStyle": "white",
+ "navigationBarBackgroundColor":"#F4F5F9",
+ "navigationBarTextStyle": "black",
"enablePullDownRefresh": true
}
\ No newline at end of file
diff --git a/pages/bargain/bargainDatail/bargainDatail.wxml b/pages/bargain/bargainDatail/bargainDatail.wxml
index ebd0995..b4ef481 100644
--- a/pages/bargain/bargainDatail/bargainDatail.wxml
+++ b/pages/bargain/bargainDatail/bargainDatail.wxml
@@ -1,23 +1,27 @@
-
+
+
+
+
+
-
+
+
{{data.title}}
- {{data.subTitle}}
- {{data.price/100}}元
+
+
可砍至{{data.salePrice/100}}元
-
-
+
+
+
- 已砍 {{already}}元
- 还剩 {{remain}}元
+ 已砍 {{already}}元
+ 还剩 {{remain}}元
-
-
- 还剩 {{day}}天:{{hour}}:{{min}}:{{sec}} 结束
-
+
+ 还剩 {{day}}天:{{hour}}:{{min}}:{{sec}} 结束
砍价已取消
@@ -31,26 +35,26 @@
- 还需邀请{{data.pressLimitNum-data.orderPressList.length}}位好友,帮忙砍至底价
+
-
-
- 已砍至底价
-
-
-
-
+
+
+ 已砍至底价
+
+
+
+
+
-
-
+
砍价人数{{data.orderPressList.length}}/{{data.pressLimitNum}}人
-
+
- 发起人
+
{{item.nickName}}
@@ -58,6 +62,7 @@
{{item.createDate}}前
+
-
+
@@ -219,4 +219,6 @@
+
+
\ No newline at end of file
diff --git a/pages/coupon/detail/index.wxss b/pages/coupon/detail/index.wxss
index fbe7ada..2e0df69 100644
--- a/pages/coupon/detail/index.wxss
+++ b/pages/coupon/detail/index.wxss
@@ -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 {
diff --git a/pages/spellGroup/spellGroup.wxml b/pages/spellGroup/spellGroup.wxml
index 9e61407..9938bc1 100644
--- a/pages/spellGroup/spellGroup.wxml
+++ b/pages/spellGroup/spellGroup.wxml
@@ -1,10 +1,10 @@
-
+
暂无数据
@@ -13,7 +13,7 @@
暂无数据
-
+
diff --git a/utils/imgurl.js b/utils/imgurl.js
index 17de774..bc3bb55 100644
--- a/utils/imgurl.js
+++ b/utils/imgurl.js
@@ -661,5 +661,9 @@ module.exports = {
'url': baseUrl + "rightHr.png",
'name': ''
},
+ 'cancelH': {
+ 'url': baseUrl + "cancelH.png",
+ 'name': ''
+ },
}
\ No newline at end of file