diff --git a/components/bargainDatail/index.js b/components/bargainDatail/index.js
index 41c800f..0c1f089 100644
--- a/components/bargainDatail/index.js
+++ b/components/bargainDatail/index.js
@@ -4,292 +4,292 @@ 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
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ cancelH: imgurl.cancelH.url,
+ bannerUrl: imgurl.banner.url,
+ wmhome: imgurl.wmhome.url,
+ wmhelp: imgurl.wmhelp.url,
+ wmsuccess01: imgurl.wmsuccess01.url,
+ successHr: imgurl.successHr.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) {
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ 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({
- orderId: options.orderId,
- from: "discount"
+ discountStatus: 1
})
- } else {
+ } else if (res.data.status == 2) {
that.setData({
- orderId: options.orderId
+ discountStatus: 2
})
- }
- 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)
+ } else if (res.data.status == 3) {
that.setData({
- nickName: res.data.nickName,
- avatarUrl: res.data.avatarUrl
+ discountStatus: 3
})
+ }
+ wx.stopPullDownRefresh();
+ })
+ .catch(err => {
+ console.log(err)
+ wx.stopPullDownRefresh();
+ wx.showToast({
+ title: err.errMsg,
+ icon: "none"
})
- },
- 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)
+},
+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
}
- },
- 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 是订单号
+ })
+ .then(res => {
+ console.log(res);
+ // id 是订单号
- that.pressOrderDetail(orderId);
- })
- .catch(err => {
- console.log(err)
- wx.showToast({
- title: err.message,
- icon: "none"
- })
+ 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
- }
+ })
+},
+// 订单详情
+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)
})
- .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);
+ that.countdown(res.data.pressEndDate);
+ that.setData({
+ pressEndDate: res.data.pressEndDate
})
- .catch(err => {
- wx.showToast({
- title: err.message,
- icon: "none"
- })
- wx.stopPullDownRefresh();
+ res.data.orderPressList.map(file => {
+ compare(file.first);
})
- },
-
- 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) {
+ console.log(res.data.orderPressList.sort(compare('first')))
that.setData({
- clock: obj,
- day: obj.a1,
- hour: obj.b1,
- min: obj.c1,
- sec: obj.d1,
+ 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
})
- } else {
- that.setData({
- clock: "00",
- day: "00",
- hour: "00",
- min: "00",
- sec: "00",
+ that.getPressOrderStatus(orderId);
+ })
+ .catch(err => {
+ wx.showToast({
+ title: err.message,
+ icon: "none"
})
- //如果倒计时结束,需要重新查询一下券的状态
- // 给getDetail一个标识
- }
- total_micro_second -= 1000;
- },
- countdown: function(end_time) {
- let that = this;
+ 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);
- that.data.setInterval = setInterval(function() {
- that.setIntervalTime(end_time);
- }, 1000)
- },
+ }, 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);
+// 时间格式化输出,如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
+ // 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
}
- },
- 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
- }`
- });
- }
+ })
+ .then(res => {
+ wx.hideLoading();
+ _this.setData({
+ display: "none!important",
})
- .catch(err => {
- console.log(err);
- if (!type) {
- setTimeout(function() {
- _this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this);
- }, 2000)
- }
- })
- },
+ // 有价券
+ 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)
+ }
+ })
+},
/**
* 按原价付款
*/
@@ -517,263 +517,263 @@ Page({
* 发起支付
*/
orderFunc(e) {
- var that = this;
- that.setData({
- showButton1: true
- })
- Http.get({
- url: config.api.checkPhoneStatus,
- data: {}
+ var that = this;
+ that.setData({
+ showButton1: true
+ })
+ Http.get({
+ url: config.api.checkPhoneStatus,
+ data: {}
+ })
+ .then(res => {
+ that.setData({
+ showButton1: false
})
- .then(res => {
+ if (typeof (res) != "undefined") {
+ let orderId = "" + e.currentTarget.dataset.orderid;
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 => {
+ 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);
/**
- * 支付失败,需要更新订单的状态
+ * 用户支付成功以后跳转到券包列表
*/
- 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
- });
- })
+ 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 {
- // 免费券
- 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"
- })
- }
+ wx.setStorage({
+ key: 'couponNum',
+ data: "couponNum"
+ })
}
}
+ }
+ })
+ .catch(err => {
+ that.setData({
+ showButton1: true
})
- .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',
- })
- }
+ 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') {}
+ }
+ })
+ } 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
+ });
}
- };
- // 来自页面内的按钮的转发
- if (options.from == 'button') {
- var orderId = options.target.dataset.orderid;
- shareObj.path = `/pages/index/index?orderId=${orderId}&from=${"discount"}`;
+ })
+},
+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') { }
}
- // 返回shareObj
- return shareObj;
- },
+ };
+ // 来自页面内的按钮的转发
+ 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) {
@@ -805,7 +805,7 @@ function diffTime(startDate) {
}
function compare(property) {
- return function(a, b) {
+ return function (a, b) {
var value1 = a[property];
var value2 = b[property];
return value2 - value1;
diff --git a/components/bargainDatail/index.wxml b/components/bargainDatail/index.wxml
index b4ef481..b6c5b32 100644
--- a/components/bargainDatail/index.wxml
+++ b/components/bargainDatail/index.wxml
@@ -37,7 +37,7 @@
-
+
已砍至底价
@@ -51,7 +51,8 @@
砍价人数{{data.orderPressList.length}}/{{data.pressLimitNum}}人
-
+
+
@@ -61,7 +62,9 @@
砍掉{{item.pressValue/100}}元
{{item.createDate}}前
+
+
diff --git a/components/bargainDatail/index.wxss b/components/bargainDatail/index.wxss
index abefd28..6824fab 100644
--- a/components/bargainDatail/index.wxss
+++ b/components/bargainDatail/index.wxss
@@ -50,7 +50,7 @@ page{
color: #fff;
height: 40rpx;
line-height: 40rpx;
- padding-top: 20rpx;
+ padding-top: 40rpx;
}
.help{
display: block;
@@ -116,7 +116,7 @@ page{
.listitem {
width: 538rpx;
- height: 624rpx;
+ /* height: 624rpx; */
position: relative;
padding: 60rpx 40rpx;
border-radius: 15rpx;
@@ -238,8 +238,8 @@ page{
.person{
/* border-bottom: 1px solid #F0CDB3; */
- padding-bottom: 31rpx;
- padding-top: 31rpx;
+ padding-bottom: 15rpx;
+ padding-top: 15rpx;
color: #fff;
}
.text02 text:nth-of-type(2){
@@ -249,13 +249,18 @@ page{
.people{
border-radius:16rpx;
padding:0 20rpx;
+
+}
+.kjr{
+ height: 300rpx;
+ overflow: auto;
}
.btns{
padding:33rpx;
position: fixed;
left: 0;
right: 0;
- bottom: 100rpx;
+ bottom: 0;
z-index: 100;
/* background: #fff; */
}
@@ -310,7 +315,7 @@ page{
}
.helpDiscount::after{ border: none; }
.success{
- margin-top: 50rpx;
+ margin-top: 15rpx;
}
.success image{
display: block;
@@ -321,9 +326,9 @@ page{
.success text{
display: block;
text-align: center;
- font-size:30rpx;
- line-height: 30rpx;
- color:rgba(51,51,51,1);
+ font-size:24rpx;
+ line-height: 24rpx;
+ color:#FFFFFF;
}
.btns01{
position: fixed;
@@ -334,10 +339,10 @@ page{
}
.btns01 button{
color:rgba(254,254,254,1);
- width:650rpx;
+ width:538rpx;
height:85rpx;
line-height: 85rpx;
- background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
+ background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%);
box-shadow:0px 8px 8px 1px rgba(246,93,51,0.32);
border-radius:43rpx;
}
diff --git a/pages/bargain/bargainDatail/bargainDatail.js b/pages/bargain/bargainDatail/bargainDatail.js
index 21303f2..b55358f 100644
--- a/pages/bargain/bargainDatail/bargainDatail.js
+++ b/pages/bargain/bargainDatail/bargainDatail.js
@@ -14,6 +14,7 @@ Page({
wmhome: imgurl.wmhome.url,
wmhelp: imgurl.wmhelp.url,
wmsuccess01: imgurl.wmsuccess01.url,
+ successHr: imgurl.successHr.url,
fail: imgurl.fail.url,
data: null,
from: null,
diff --git a/pages/bargain/bargainDatail/bargainDatail.wxml b/pages/bargain/bargainDatail/bargainDatail.wxml
index b4ef481..b6c5b32 100644
--- a/pages/bargain/bargainDatail/bargainDatail.wxml
+++ b/pages/bargain/bargainDatail/bargainDatail.wxml
@@ -37,7 +37,7 @@
-
+
已砍至底价
@@ -51,7 +51,8 @@
砍价人数{{data.orderPressList.length}}/{{data.pressLimitNum}}人
-
+
+
@@ -61,7 +62,9 @@
砍掉{{item.pressValue/100}}元
{{item.createDate}}前
+
+
diff --git a/pages/bargain/bargainDatail/bargainDatail.wxss b/pages/bargain/bargainDatail/bargainDatail.wxss
index abefd28..6824fab 100644
--- a/pages/bargain/bargainDatail/bargainDatail.wxss
+++ b/pages/bargain/bargainDatail/bargainDatail.wxss
@@ -50,7 +50,7 @@ page{
color: #fff;
height: 40rpx;
line-height: 40rpx;
- padding-top: 20rpx;
+ padding-top: 40rpx;
}
.help{
display: block;
@@ -116,7 +116,7 @@ page{
.listitem {
width: 538rpx;
- height: 624rpx;
+ /* height: 624rpx; */
position: relative;
padding: 60rpx 40rpx;
border-radius: 15rpx;
@@ -238,8 +238,8 @@ page{
.person{
/* border-bottom: 1px solid #F0CDB3; */
- padding-bottom: 31rpx;
- padding-top: 31rpx;
+ padding-bottom: 15rpx;
+ padding-top: 15rpx;
color: #fff;
}
.text02 text:nth-of-type(2){
@@ -249,13 +249,18 @@ page{
.people{
border-radius:16rpx;
padding:0 20rpx;
+
+}
+.kjr{
+ height: 300rpx;
+ overflow: auto;
}
.btns{
padding:33rpx;
position: fixed;
left: 0;
right: 0;
- bottom: 100rpx;
+ bottom: 0;
z-index: 100;
/* background: #fff; */
}
@@ -310,7 +315,7 @@ page{
}
.helpDiscount::after{ border: none; }
.success{
- margin-top: 50rpx;
+ margin-top: 15rpx;
}
.success image{
display: block;
@@ -321,9 +326,9 @@ page{
.success text{
display: block;
text-align: center;
- font-size:30rpx;
- line-height: 30rpx;
- color:rgba(51,51,51,1);
+ font-size:24rpx;
+ line-height: 24rpx;
+ color:#FFFFFF;
}
.btns01{
position: fixed;
@@ -334,10 +339,10 @@ page{
}
.btns01 button{
color:rgba(254,254,254,1);
- width:650rpx;
+ width:538rpx;
height:85rpx;
line-height: 85rpx;
- background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%);
+ background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%);
box-shadow:0px 8px 8px 1px rgba(246,93,51,0.32);
border-radius:43rpx;
}
diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js
index f881eaf..ea6a282 100644
--- a/pages/coupon/detail/index.js
+++ b/pages/coupon/detail/index.js
@@ -6,6 +6,7 @@ const imgurl = require("../../../utils/imgurl");
Page({
data: {
isshowposter:false,//是否显示分享弹框
+ isshowposter1:false,//是否显示分享弹框
fenxiangUrl: imgurl.fenxiang.url,
clockUrl: imgurl.clock.url,
teljpgUrl: imgurl.teljpg.url,
@@ -100,6 +101,22 @@ Page({
isshowposter: false,
})
},
+ /**
+ * 显示砍价弹框
+ */
+ showshare1: function() {
+ this.setData({
+ isshowposter1: true,
+ })
+ },
+ /**
+ * 隐藏砍价弹框
+ */
+ hidemodal1: function() {
+ this.setData({
+ isshowposter1: false,
+ })
+ },
/**
* 跳转到门店列表的详情页面
@@ -575,17 +592,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
+ })
+ },
/**
* 支付订单更新
*/
@@ -921,7 +938,7 @@ Page({
success: function (res) {
if (res.confirm) {
wx.navigateTo({
- url: `/components/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}`,
+ url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}`,
})
}
}
diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml
index 3678fdb..1f78c9f 100644
--- a/pages/coupon/detail/index.wxml
+++ b/pages/coupon/detail/index.wxml
@@ -219,5 +219,89 @@
-
+
+
+
+
+
+
+
+
+
+
+
+ {{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/pages/passCar/choicecoupon/choicecoupon.js b/pages/passCar/choicecoupon/choicecoupon.js
index d5d1459..8a1f3c7 100644
--- a/pages/passCar/choicecoupon/choicecoupon.js
+++ b/pages/passCar/choicecoupon/choicecoupon.js
@@ -6,6 +6,7 @@ const imgurl = require("../../../utils/imgurl");
Page({
data: {
couponUrl:imgurl.coupon.url,
+ gouHr: imgurl.gouHr.url,
gouUrl:imgurl.gou.url,
linessUrl:imgurl.liness.url,
loadingUrl:imgurl.loading.url,
diff --git a/pages/passCar/choicecoupon/choicecoupon.wxml b/pages/passCar/choicecoupon/choicecoupon.wxml
index 371491a..9820f31 100644
--- a/pages/passCar/choicecoupon/choicecoupon.wxml
+++ b/pages/passCar/choicecoupon/choicecoupon.wxml
@@ -12,7 +12,7 @@
温馨提示:请离场前使用优惠券
-
+
@@ -27,7 +27,7 @@
-
+
有效期至:
{{item.expiredTime}}
diff --git a/pages/passCar/choicecoupon/choicecoupon.wxss b/pages/passCar/choicecoupon/choicecoupon.wxss
index 5241412..6c5bdb5 100644
--- a/pages/passCar/choicecoupon/choicecoupon.wxss
+++ b/pages/passCar/choicecoupon/choicecoupon.wxss
@@ -27,10 +27,10 @@
.mms {
position: relative;
width: 690rpx;
- background: #fff;
- padding: 20rpx 0 0;
+ /* background: #fff; */
+ /* padding: 20rpx 0 0; */
margin: 0 auto 46rpx;
- border-top: 8rpx solid #02b7ff;
+ /* border-top: 8rpx solid #02b7ff; */
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10);
}
@@ -46,7 +46,7 @@
height: 50rpx;
line-height: 50rpx;
font-size: 22rpx;
- color: #999;
+ color: #A6A6A6;
letter-spacing: 0;
}
@@ -74,18 +74,20 @@
.info view:nth-child(1) {
display: flex;
justify-content: space-between;
- padding: 0 2%;
+ padding: 2% 2%;
}
.info {
width: 100%;
+ height: 126rpx;
+ background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%);
}
.info view:nth-child(1) text {
font-size: 32rpx;
line-height: 32rpx;
height: 32rpx;
- color: #333;
+ color: #FFFFFF;
letter-spacing: 0;
width: 400rpx;
display: inline-block;
@@ -97,7 +99,7 @@
.info view:nth-child(2) {
padding-left: 2%;
font-size: 22rpx;
- color: #333;
+ color: #FFFFFF;
letter-spacing: 0;
margin-top: 6rpx;
display: inline-block;
@@ -113,12 +115,12 @@
.btns {
position: absolute;
- right: 57rpx;
- top: 60rpx;
+ right: 120rpx;
+ top: 50rpx;
height: 48rpx;
line-height: 48rpx;
text-align: right;
- color: #f96563;
+ color: #FFF;
font-size: 40rpx;
}
@@ -132,13 +134,13 @@
font-size:26rpx;
}
.yuan {
- color: #333;
+ color: #FFF;
font-size: 26rpx;
}
.txt1 {
font-size: 22rpx;
- color: #333;
+ color: #A6A6A6;
letter-spacing: 0;
}
@@ -211,7 +213,7 @@
.gou {
position: absolute;
- top: -15rpx;
- right: -10rpx;
+ top:45rpx;
+ right: 30rpx;
width: 60rpx;
}
diff --git a/pages/user/myactivity/index.js b/pages/user/myactivity/index.js
index baca3d7..bd08c49 100644
--- a/pages/user/myactivity/index.js
+++ b/pages/user/myactivity/index.js
@@ -5,6 +5,7 @@ let app = getApp();
const imgurl = require("../../../utils/imgurl");
Page({
data: {
+ noCoupon: imgurl.noCoupon.url,
dingdanUrl: imgurl.dingdan.url,
loadingUrl: imgurl.loading.url,
wmhome: imgurl.wmhome.url,
diff --git a/pages/user/myactivity/index.wxml b/pages/user/myactivity/index.wxml
index 2566369..afd9bef 100644
--- a/pages/user/myactivity/index.wxml
+++ b/pages/user/myactivity/index.wxml
@@ -21,7 +21,7 @@
-
+
您还没有参加活动
diff --git a/pages/user/myactivity/index.wxss b/pages/user/myactivity/index.wxss
index 84c3f35..c82880b 100644
--- a/pages/user/myactivity/index.wxss
+++ b/pages/user/myactivity/index.wxss
@@ -266,7 +266,7 @@ button::after{ border: none; }
height:80rpx;
line-height: 80rpx;
border-radius:10rpx;
- background: orange;
+ background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%);
color: #fff;
font-size: 32rpx;
margin-top: 20rpx;
diff --git a/utils/imgurl.js b/utils/imgurl.js
index bc3bb55..3ecc13f 100644
--- a/utils/imgurl.js
+++ b/utils/imgurl.js
@@ -128,6 +128,10 @@ module.exports = {
'url': baseUrl + 'gou.png',
'name': ''
},
+ 'gouHr': {
+ 'url': baseUrl + 'gouHr.png',
+ 'name': ''
+ },
'grade': {
'url': baseUrl + 'grade.png',
'name': ''
@@ -508,6 +512,10 @@ module.exports = {
'url': baseUrl + 'wmsuccess01.png',
'name': '帮好友砍价成功对勾'
},
+ 'successHr': {
+ 'url': baseUrl + 'successHr.png',
+ 'name': '帮好友砍价成功对勾'
+ },
'pay_success': {
'url': baseUrl + 'pay-success.png',
'name': '消费卡付款成功'