diff --git a/app.json b/app.json index 73830d2..074078a 100644 --- a/app.json +++ b/app.json @@ -1,6 +1,5 @@ { "pages": [ - "pages/index/index", "pages/main/index", "index/searchbar", @@ -77,7 +76,8 @@ "pages/site/site", "pages/siteUser/siteUser", "pages/siteAdd/siteAdd", - "pages/fillIndent/fillIndent" + "pages/fillIndent/fillIndent", + "pages/coupon/childDetail/childDetail" ], "subpackages": [ { diff --git a/pages/coupon/childDetail/childDetail.js b/pages/coupon/childDetail/childDetail.js new file mode 100644 index 0000000..ed02c07 --- /dev/null +++ b/pages/coupon/childDetail/childDetail.js @@ -0,0 +1,1175 @@ +const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' +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: { + navigationBarHeight, + homeSelectedO: imgurl.homeSelectedO.url, + isshowposter: false, //是否显示分享弹框 + fenxiang: imgurl.fenxiang1.url, + fenxiangUrl: imgurl.fenxiang.url, + clockUrl: imgurl.clock.url, + yushouUrl: imgurl.yushou.url, + teljpgUrl: imgurl.teljpg.url, + closedUrl: imgurl.closed.url, + quesGouUrl: imgurl.ques_gou.url, + headbgUrl: imgurl.headbg.url, + quesBgUrl: imgurl.ques_bg.url, + close02: imgurl.close02.url, + share01: imgurl.share01.url, + fail: imgurl.fail.url, + wmhome: imgurl.wmhome.url, + swiperCurrent: 0, + detailPicture: [], + coverPicture: [], + couponList: [], + data: { + title: null + }, + showPage: false, + questions1: null, + questions2: null, + carList: [], + couponChannelId: null, + orderId: "", + hour: null, + day: null, + month: null, + year: null, + minute: "", + tempFilePaths: null, + userInfo: {}, + hasUserInfo: false, + canIUse: wx.canIUse('button.open-type.getUserInfo'), + id: null, + result: [], + end_time: null, + checked: false, + questionnaire: {}, + questionId: null, + widthScreen: null, + moveData: null, + rotateData: null, + alphaData: null, + scaleData: null, + skewData: null, + matrixData: null, + opacity: 0, + queueData: null, + zIndex: 11, + display: "none", + showbutton: false, + cardData: null, + showCardOffer: false, + isSamePeople: true, + statusText: '', + isReceived: false, + receivedDisabled: false, + clock: "结束", + day: "00", + hour: "00", + min: "00", + sec: "00", + clock02: "00", + day02: "00", + hour02: "00", + min02: "00", + sec02: "00", + countdown: "", + showbutton1: false, + limitCondition: "", + minLimit: 0, + maxLimit: 0, + dispressEndDate: false, + barTitle: "", + activityStatus: "", + //图文混排 + curHtml: '', + contentType: 0, + page: 1,//查询商户优惠券page + idList: [], + }, + /** + * 显示分享弹框 + */ + showshare: function () { + this.setData({ + isshowposter: true, + }) + }, + getCouponList: function (id) { + let that = this; + let data; + data = { + status: 0, + merchantIds: id, + pageNum: that.data.page, + pageSize: 5, + } + Http.post({ + url: config.api.listByMerchant, + data: data + }).then(res => { + if (res.data.page.list <= 0) { + return + } + let dataLsit = [] + // dataLsit = that.data.couponList + dataLsit = res.data.page.list + dataLsit.map((item, index) => { + if (item.id == that.data.couponChannelId) { + dataLsit.splice(index, 1) + } + }) + if (that.data.page > 1) { + let tmpeLsit = that.data.couponList + tmpeLsit.push(...dataLsit) + that.setData({ + couponList: tmpeLsit, + }) + } else { + that.setData({ + couponList: dataLsit, + }) + } + + + // if (res.data && res.data.qrCode){ + // that.setData({ + // qrCode: res.data.qrCode, + // }) + // } + }) + .catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + /** + * 隐藏分享弹框 + */ + hidemodal: function () { + this.setData({ + isshowposter: false, + }) + }, + /** + * 显示分享海报 + */ + /* showPoster: function() { + //跳转到海报生成页 + console.log(this.data.canIUse) + + // return; + wx.navigateTo({ + url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` + }) + }, */ + showPoster: function () { + //跳转到海报生成页 + let that = this; + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + wx.navigateTo({ + url: `/pages/canvas/index?couponChannelId=${that.data.data.id}` + }) + }).catch(err => { + console.log(err) + if (err.code == 11004) { + // 用户昵称未授权 + wx.redirectTo({ + url: `/pages/getuserinfo/index?couponChannelId=${that.data.data.id}&fromflag=poster` + }) + } + }) + + }, + swiperChange: function (e) { + this.setData({ + swiperCurrent: e.detail.current + }); + }, + gohome(e) { + console.log(e.currentTarget.dataset.id, "123") + wx.navigateTo({ + url: `/pages/fillIndent/fillIndent?couponChannelId=${e.currentTarget.dataset.couponchannelid}&couponId=${e.currentTarget.dataset.couponid}&shippingtype=${e.currentTarget.dataset.shippingtype}`, + }) + }, + + gochild(e) { + let id = e.currentTarget.dataset.id + wx.navigateTo({ + url: `/pages/coupon/detail/index?couponIds=${id}`, + }) + }, + //获取当前登录用户信息 + getUserInfo: function () { + let that = this; + // 获取用户信息 + Http.get({ + url: config.api.getScore, + data: {} + }) + .then(res => { + console.log(res) + that.getQueryCardStatus() + if (that.data.cardData.cuserId != res.data.id) { + console.log(2222, 6666) + that.setData({ + isSamePeople: false + }) + } + }) + }, + //获取卡转赠状态 + getQueryCardStatus() { + let that = this; + let param = { + id: this.data.cardData.couponOrderId, + cUserId: this.data.cardData.cuserId, + updateDate: util.formatTime(Number(that.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss") + } + Http.get({ + url: config.api.queryCardStatus, + data: param + }) + .then(res => { + console.log(res, 333333333333) + }) + .catch(err => { + that.setData({ + isReceived: true, + statusText: err.message + }) + }) + }, + receiveCard() { + let that = this; + let param = { + id: this.data.cardData.couponOrderId, + cUserId: this.data.cardData.cuserId, + updateDate: util.formatTime(Number(this.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss") + } + + this.setData({ + receivedDisabled: true + }) + Http.post({ + url: config.api.cardAccept, + data: param + }) + .then(res => { + wx.showToast({ + title: '领取成功!', + icon: 'none', + duration: 2000, + mask: false + }); + wx.reLaunch({ + url: '/pages/complete/index?couponOrderId=' + this.data.cardData.couponOrderId, + }) + }) + .catch(err => { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + that.setData({ + receivedDisabled: false + }) + }) + }, + closeAlert() { + this.setData({ + showCardOffer: false + }) + }, + goback: function () { + wx.switchTab({ + url: '/index/index', + }) + }, + /** + * 点击提交问题单选 + */ + formSubmit: function (e) { + console.log(e); + let that = this; + /** + * 多选 + */ + if (e.currentTarget.dataset.flags == 'multi') { + if (that.data.anwserId.length == 0) { + var answserIs = null + } else { + var answserIs = that.data.anwserId.join(","); + } + } else if (e.currentTarget.dataset.flags == 'single') { + var answserIs = e.detail.value; + } + console.log(answserIs) + console.log(e.currentTarget.dataset.questionid) + Http.post({ + url: config.api.answerQuestion, + data: { + answer: answserIs, + questionId: e.currentTarget.dataset.questionid + } + }) + .then(res => { + that.closeQuestion(); + }) + .catch(err => { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + /** + * 多选 + */ + checkboxChange: function (e) { + console.log(e) + this.setData({ + anwserId: e.detail.value + }) + }, + + closeQuestion: function () { + let that = this; + that.setData({ + display: "none", + zIndex: 11, + opacity: 0 + }) + setTimeout(function () { + that.orderFunc(); + }, 500) + }, + gotopay: function (e) { + app.globalData.previewFlag = true + /* 判断是否授权*/ + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + Http.get({ + url: config.api.checkPhoneStatus, + data: {} + }).then(res => { + let that = this; + console.log(e); + wx.showLoading(); + if (e.currentTarget.dataset.type == 51 || e.currentTarget.dataset.type == 50) { + wx.navigateTo({ + url: '/pages/integralmall/payIntegcoupondetail/index?couponChannelId=' + that.data.couponChannelId + '&couponId=' + that.data.couponId, + }) + } else { + let formId = e.detail.formId; + var discount = e.detail.target.dataset.discount; + that.setData({ + queueData: null, + showbutton: true, + formId: formId + }) + Http.get({ + url: config.api.getQuestion, + data: { + couponType: JSON.stringify(that.data.data.type) + } + }) + .then(res => { + wx.hideLoading(); + if (res.data == undefined) { + // 立即购买 + that.orderFunc(discount); + that.setData({ + flag: false + }) + } else if (res.data) { + var animation = wx.createAnimation({}); + animation.translate((that.data.widthScreen - that.data.widthScreen), 0).scale(1).opacity(1).step({ + duration: 500 + }) + that.setData({ + queueData: animation.export(), + zIndex: 9, + opacity: 1, + display: "block", + questionnaire: JSON.parse(res.data.content), + questionId: res.data.id + }); + } + }) + .catch(err => { + wx.hideLoading(); + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }) + } + }).catch(err => { + wx.redirectTo({ + url: `/pages/getphoneInfo/index?skipUrl=1` + }); + }) + + }).catch(err => { + wx.navigateTo({ + url: `/pages/getuserinfo/index?fromflag=coupondetail&couponChannelIdflag=${this.data.couponChannelId}`, + }) + }) + + }, + 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一个标识 + that.getDetail(that.data.couponChannelId, 'endclock'); + } + 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 + } + }, + /** + * 获取用户信息 + */ + onLoad(options) { + let that = this; + if (options.g) { + app.globalData.havePlayEd1 = true; + } + wx.showLoading({ + title: "加载中..." + }); + that.setData({ + onshow: false + }) + if (options && (options.couponChannelId || options.couponIds)) { + if (options.couponIds) { + this.setData({ + couponIds: options.couponIds + }) + that.getDetail(options.couponIds, 'notendclock'); + } else { + that.getDetail(options.couponChannelId, 'notendclock'); + } + + + } + /** + * 转赠判断 + */ + if (options.cuserId) { + this.setData({ + showCardOffer: true, + cardData: options + }) + this.getUserInfo() + } + that.setData({ + couponChannelId: options.couponChannelId, + title: that.data.data.title ? that.data.data.title : '', + }); + if (options.cardType) { + that.setData({ + cardType: options.cardType + }) + } + }, + getHtml(couponChannelId) { + Http.get({ + url: config.api.couponHtmlDetail, + data: { + couponChannelId: couponChannelId + } + }).then(res => { + console.log(res) + if (res.code == 200 && res.data.html) { + this.setData({ + curHtml: decodeURI(res.data.html) + }) + app.globalData.curHtml = this.data.curHtml; + console.log(app.globalData.curHtml) + } + }) + }, + getDetail: function (couponChannelId, flag) { + let that = this; + let data = {}; + if (that.data.couponIds) { + data.couponId = couponChannelId + } else { + data.couponChannelId = couponChannelId + } + var parmer = { + url: config.api.couponDetail, + data: data + }; + Http.get(parmer) + .then(res => { + + if (res.data.merchantVoList && res.data.merchantVoList.length) { + let merchantVoList = res.data.merchantVoList + let idList = [] + merchantVoList.map(item => { + idList.push(item.id) + }) + that.setData({ + idList: idList + }) + that.getCouponList(idList) + } + //aaa + if (res.data.contentType != undefined && res.data.contentType == 1) { + //获取图文展示详情html + this.setData({ + contentType: res.data.contentType + }) + this.getHtml(couponChannelId); + } + that.setData({ + couponId: res.data.couponId + }) + that.setData({ + showPage: true + }) + if (res && res.data && res.data.detailPicture) { + that.setData({ + detailPicture: JSON.parse(res.data.detailPicture) + }) + } + if (res && res.data && res.data.coverPicture) { + that.setData({ + coverPicture: JSON.parse(res.data.coverPicture) + }) + } + if (res && res.data && res.data.conditions) { + that.setData({ + limitCondition: JSON.parse(res.data.conditions).type + }) + if (JSON.parse(res.data.conditions).type == 2 && (JSON.parse(res.data.conditions).min || JSON.parse(res.data.conditions).min == 0)) { + that.setData({ + minLimit: JSON.parse(res.data.conditions).min + }) + } + if (JSON.parse(res.data.conditions).type == 2 && (JSON.parse(res.data.conditions).max) || JSON.parse(res.data.conditions).max == 0) { + that.setData({ + maxLimit: JSON.parse(res.data.conditions).max + }) + } + } + /** + * 将优惠券优惠卡的详情的BarTitle + * 设置成券的名称 + */ + // wx.setNavigationBarTitle({ + // title: res.data.title + // }) + that.setData({ + barTitle: res.data.title + }) + var EndTime = res.data.validStartDate; + var NowTime = new Date().getTime(); + + /** + * activityStatus==0 活动未开始 + * activityStatus==1 活动已开始 + * flag == endclock 说明倒计时已经结束 + */ + if (res.data.endTime && res.data.beginTime) { + that.setData({ + begin_time: res.data.beginTime, + end_time: res.data.endTime, + activityStatus: res.data.activityStatus ? res.data.activityStatus : '' + }) + if (res.data.activityStatus == 0 && flag != 'endclock') { + that.countdown(res.data.beginTime); + } else if (res.data.activityStatus != 0 && flag != 'endclock') { + that.countdown(res.data.endTime); + } else { + clearInterval(that.data.setInterval) + } + if (res.data.activityStatus == 0) { + var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); + if (util.timechuo(beginTime).indexOf('-') == 0) { + that.setData({ + beginTime: "活动已结束", + }); + } else { + that.setData({ + beginTime: util.timechuo(beginTime) + }); + } + } else { + var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss"); + if (util.timechuo(endTime).indexOf('-') == 0) { + that.setData({ + endtime: "活动已结束", + }); + } else { + that.setData({ + endtime: util.timechuo(endTime) + }); + } + } + } + wx.hideLoading(); + that.setData({ + data: res.data, + merchantVoList: res.data.merchantVoList + }); + if (res.data.type == 10) { + that.setData({ + salePriceStr: res.data.salePriceStr, + pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), + pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), + priceStr: res.data.priceStr, + tailPriceStr: res.data.tailPriceStr, + origPriceStr: res.data.origPriceStr + }) + } + if (res.data.validType == 1) { + that.setData({ + validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dd"), + validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dd"), + pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), + pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), + }); + } else { + if (res.data.validDays) { + that.setData({ + validDays: res.data.validDays + }); + } + } + }).catch(err => { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + /** + * 邀请好友继续砍价 + */ + inviteFriend: function (e) { + let that = this; + let formId = e.detail.formId; + that.setData({ + formId: formId, + showbutton1: true + }) + that.orderFunc("discount"); + }, + /** + * 支付订单更新 + */ + payOrderUpdate: (orderId, payOrderId, status, reason, type, _this, composeOrderType) => { + let that = this; + // 支付成功 + Http.post({ + url: config.api.payOrderUpdate, + data: { + payOrderId: payOrderId, + composeOrderId: orderId, + status: status, + reason: reason + } + }) + .then(res => { + wx.hideLoading() + // 有价券 + if (!type && type != 'free') { + wx.navigateTo({ + url: `/pages/order/detail/index?orderId=${ + orderId + }&cardIf=true&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` + }); + } else if (type == 'free') { + wx.navigateTo({ + url: `/pages/order/detail/index?orderId=${ + orderId + }&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` + }); + } + }) + .catch(err => { + console.log(err); + if (!type) { + setTimeout(function () { + _this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this, composeOrderType); + }, 2000) + } + }) + }, + checkPhoneStatus: function () { + let that = this; + Http.get({ + url: config.api.checkPhoneStatus, + data: {} + }) + .then(res => { + console.log(666, '授权成功!') + that.receiveCard() + }) + .catch(err => { + if (err.code == 11005) { + /** + * 手机号没有授权,将值传到用户手机号授权的页面 + * + */ + wx.redirectTo({ + url: "/pages/getphoneInfo/index?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId + "&updateDate=" + that.data.cardData.updateDate, + }); + } else if (err.code == 11006) { + // 用户手机已加密 + wx.redirectTo({ + url: "/pages/phoneinput/phoneinput?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId + "&updateDate=" + that.data.cardData.updateDate, + }); + } else { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + } + }) + }, + // 券包支付 + + /** + * 发起支付 + */ + orderFunc(discount) { + let that = this; + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + Http.get({ + url: config.api.checkPhoneStatus, + data: {} + }) + .then(res => { + // 发起砍价 + if (discount == 'discount') { + var data = { + couponChannelId: "" + that.data.couponChannelId, + couponId: "" + that.data.couponId, + formId: "" + that.data.formId, + press: true + } + } else if (discount == 'discount1') { + var data = { + couponChannelId: "" + that.data.couponChannelId, + couponId: "" + that.data.couponId, + formId: "" + that.data.formId, + press: false + } + } else if (that.data.couponChannelId == null) { + var data = { + couponId: "" + that.data.couponId, + formId: "" + that.data.formId, + }; + } else { + var data = { + couponChannelId: "" + that.data.couponChannelId, + couponId: "" + that.data.couponId, + formId: "" + that.data.formId, + } + } + console.log(data, "data") + let url = "" + let tempObj; + let tempArr = [] + if (that.data.data.type == 12) { + url = config.api.couponPackageSave + tempObj = { + signleOrder: { + couponChannelId: "" + that.data.couponChannelId, + couponId: "" + that.data.couponId, + formId: "" + that.data.formId, + }, + count: "1" + } + tempArr.push(tempObj) + } else { + url = config.api.orderSave + } + /** + * orderSave 下单 + */ + return Http.post({ + url: url, + data: that.data.data.type == 12 ? JSON.stringify(tempArr) : data + }); + }) + .catch(err => { + wx.hideLoading() + that.setData({ + showbutton: false, + showbutton1: false + }) + 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) { + that.getUnPaidOrder(that.data.couponId); + } else if (err.code == 11005) { + /** + * 将值传到用户手机号授权的页面 + * + */ + wx.redirectTo({ + url: "/pages/getphoneInfo/index?couponChannelId=" + + that.data.couponChannelId + }); + } else if (err.code == 11006) { + // 用户手机已加密 + wx.redirectTo({ + url: "/pages/phoneinput/phoneinput?couponChannelId=" + + that.data.couponChannelId + }); + } else { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + } + }) + .then(res => { + console.log(res, "res123") + if (discount != 'discount') { + if (typeof (res) != "undefined") { + let orderId = "" + res.data.mainOrderId; + that.setData({ + orderId: orderId, + composeOrderType: res.data.composeOrderType + }); + if (res.data.payment > 0) { + // 支付金额不为0 + /** + * 支付订单创建 + */ + Http.post({ + url: config.api.payOrderCreate, + data: { + orderId: orderId, + composeOrderType: res.data.composeOrderType + } + }) + .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: '订单正在处理中...', + }) + that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that, that.data.composeOrderType); + if (res.errMsg == "requestPayment:ok") { + /** + * 用户支付成功以后跳转到券包列表 + */ + if (that.data.cardType == 100) { + wx.setStorage({ + key: 'couponNum2', + data: "couponNum2" + }) + } else if (that.data.data.type != 5 && that.data.cardType != 100) { + wx.setStorage({ + key: 'couponNum', + data: "couponNum" + }) + } + } + }, + fail: res => { + wx.hideLoading(); + /** + * 支付失败,需要更新订单的状态 + */ + that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that, that.data.composeOrderType); + that.setData({ + showbutton: false + }) + return; + }, + complete: res => { } + }); + /// End payment -------- + }) + .catch(err => { + wx.hideLoading(); + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }) + } else { + // 免费券 + that.payOrderUpdate(orderId, "0", 1, '', 'free', that, that.data.composeOrderType); + if (that.data.cardType == 100) { + wx.setStorage({ + key: 'couponNum2', + data: "couponNum2" + }) + } else if (that.data.data.type != "5" && that.data.cardType != 100) { + wx.setStorage({ + key: 'couponNum', + data: "couponNum" + }) + } + } + } + } else { + if (res) { + wx.navigateTo({ + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.mainOrderId}&composeOrderType=${res.data.composeOrderType}`, + }) + } + } + }) + }).catch(err => { + console.log(err) + if (err.code == 11004) { + wx.redirectTo({ + url: `/pages/getuserinfo/index?fromflag=coupondetail&couponChannelIdflag=${that.data.couponChannelId}`, + }) + } else { + wx.showToast({ + title: err.message, + icon: "none", + duration: 2500 + }) + } + }) + }, + // 获得未支付的订单 + getUnPaidOrder(couponId) { + let that = this; + Http.get({ + url: config.api.getUnPaidOrder, + data: { + couponId: couponId + } + }).then(res => { + that.setData({ + disOrderNumber: res.data.orderNumber, + composeOrderType: res.data.composeOrderType + }) + if (res.data && res.data.pressEndDate) { + that.setData({ + dispressEndDate: true + }) + } else { + that.setData({ + dispressEndDate: false + }) + } + if (that.data.dispressEndDate) { + wx.showModal({ + title: '提示', + content: "您有未支付订单,请到“我的-我的砍价”进行支付", + confirmText: "我的砍价", + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}&composeOrderType=${that.data.composeOrderType}`, + }) + } + } + }) + } else { + wx.showModal({ + title: '提示', + content: '您有未支付订单,请先进行支付', + confirmText: "去支付", + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}&contentType=${that.data.contentType}&composeOrderType=${that.data.composeOrderType}`, + }) + } + } + }) + } + }).catch(error => { + wx.showToast({ + title: error.message, + icon: "none", + duration: 3000 + }) + }) + }, + onShow() { + this.setData({ + showbutton: false, + showbutton1: false + }) + if (this.data.end_time && this.data.activityStatus != 0) { + this.countdown(this.data.end_time) + } else if (this.data.begin_time && this.data.activityStatus == 0) { + this.countdown(this.data.begin_time) + } + }, + onUnload: function () { + let that = this; + clearInterval(that.data.setInterval) + }, + onHide: function () { + let that = this; + clearInterval(that.data.setInterval) + }, + + // 下拉刷新 + onPullDownRefresh: function () { + this.getDetail(this.data.couponChannelId); + wx.stopPullDownRefresh() + }, + onReachBottom: function () { + this.setData({ + page: this.data.page + 1 + }) + + if (this.data.idList.length > 0) { + this.getCouponList(this.data.idList) + } + } +}); \ No newline at end of file diff --git a/pages/coupon/childDetail/childDetail.json b/pages/coupon/childDetail/childDetail.json new file mode 100644 index 0000000..0af1d50 --- /dev/null +++ b/pages/coupon/childDetail/childDetail.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "c-shareposter": "../../../../components/shareposter/index", + "navbar": "../../../../components/navbar/navbar", + "store": "../../../../components/store/index", + "c-coupons": "../../../components/coupons/index" + }, + "navigationBarTitleText": "", + "backgroundColor": "#f4f4f4", + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/pages/coupon/childDetail/childDetail.wxml b/pages/coupon/childDetail/childDetail.wxml new file mode 100644 index 0000000..a02fc87 --- /dev/null +++ b/pages/coupon/childDetail/childDetail.wxml @@ -0,0 +1,255 @@ + + + + + + + + + + + + 分享 + + + + + + + 距结束 : + 距开始 : + + + 已经结束 + + + + {{day}}天: + + {{hour}}: + {{min}}: + {{sec}} + + + {{data.title}}电子卡 + {{data.subTitle}} + + + 定金: + ¥ {{salePriceStr}} + 尾款抵扣: + ¥ {{priceStr}} + + + 提货尾款: + ¥ {{tailPriceStr}} + {{origPriceStr}} + + 预购时间:{{validStartDate}}至{{validEndDate}} + + 提货时间:{{pickStartDate}}至{{pickEndDate}} + + + + + + {{data.salePriceStr}} + {{data.creditPrice}} + 积分 + + + {{data.priceStr}}元 + {{data.priceStr}}小时 + + 过期不退款 + + + + + {{data.salePriceStr}} + {{data.pressLimitNum+'人可砍至底价'}} + {{data.priceStr}}元 + + 过期不退款 + + + + + + + 自领取之日起 + {{validDays}}天内有效 + (请在有效期内使用) + + + {{validStartDate}}至{{validEndDate}} + + + 当次有效 + + + + 使用条件: + 满{{data.usePriceStr}}元可用 + + + + + 限购{{data.useLimitQuantity}}张 + (仅限新用户活动) + ({{minLimit}}-{{maxLimit}}成长值) + (大于{{minLimit}}成长值) + 剩余{{data.remainInventory}}张 + + + + + + + + + + + {{item.title}} + ¥{{item.priceStr}} + + + + + + 购买须知 + + + {{data.remark}} + + + + + + 其他活动 + + + + + + + + +
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ +
+
+ + + + + + + + + + {{questionnaire.title}} + + + + + + + + + 确定 + + + + + + + + + + + + + {{cardData.userName}} + {{cardData.userName+'送您一张消费卡'}} + 等待好友领取 + {{cardData.userName}} + + + {{statusText}} + + + + + + + + + + + + + 微信好友 + + + + 生成海报 + + + +
\ No newline at end of file diff --git a/pages/coupon/childDetail/childDetail.wxss b/pages/coupon/childDetail/childDetail.wxss new file mode 100644 index 0000000..d335604 --- /dev/null +++ b/pages/coupon/childDetail/childDetail.wxss @@ -0,0 +1,980 @@ +@import "../../../app.wxss"; + +page { + background: #f4f5f9; +} + +button::after { + border: none; +} + +.coupons { + width: 100%; + position: relative; + overflow: hidden; + padding-bottom: 170rpx; + background: #f4f5f9; +} + +.couponsL c-coupons { + width: 335rpx; + height: 354rpx; + margin-bottom: 22rpx; +} + +.couponsL c-coupons:nth-of-type(2n+1) { + float: left; +} + +.couponsL c-coupons:nth-of-type(2n) { + float: right; +} + +.banner { + position: relative; + width: 750rpx; + height: 454rpx; +} + +.banner swiper { + width: 750rpx; + height: 454rpx; +} + +.banner image { + width: 100%; + height: 454rpx; +} + +.moneyBox { + font-size: 24rpx; + overflow: hidden; +} + +.earnest { + float: left; + font-size: 28rpx; + color: #a6a6a6; +} + +.earnestNum { + float: left; + color: red; + font-size: 32rpx; +} + +.final { + float: left; + font-size: 28rpx; + color: #a6a6a6; + margin-left: 30rpx; +} + +.pickFinal_Box { + overflow: hidden; +} + +.earnestTime { + font-size: 28rpx; + color: #a6a6a6; +} + +.finalTime { + font-size: 28rpx; + color: #a6a6a6; +} + +.original { + float: left; + width: 100rpx; + margin-left: 10rpx; + text-decoration: line-through; + color: #a6a6a6; + font-size: 24rpx; + line-height: 50rpx; +} + +.dots { + position: absolute; + left: 0; + right: 0; + bottom: 50rpx; + display: flex; + justify-content: center; +} + +.dot { + margin: 0 8rpx; + width: 14rpx; + height: 14rpx; + background: #fff; + border-radius: 8rpx; + transition: all 0.6s; +} + +.home { + position: relative; + background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); + height: 94rpx; + width: 230rpx; + /* margin: 0 auto 30rpx; */ + margin-left: 40rpx; + float: left; + color: #fff; + font-size: 36rpx; + line-height: 94rpx; + border-radius: 21rpx; +} + +.arrive { + position: relative; + background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); + height: 94rpx; + width: 230rpx; + /* margin: 0 auto 30rpx; */ + margin-left: 40rpx; + float: left; + color: #fff; + font-size: 36rpx; + line-height: 94rpx; + border-radius: 21rpx; +} + +.dot.active { + width: 24rpx; + background: #f80; +} + +.refound { + border: 1rpx solid red; + padding: 3rpx 0; + display: block; + width: 130rpx; + text-align: center; + margin-left: 14rpx; +} + +.couponsL { + width: 92%; + margin: 20rpx auto; +} + +.coupons_info { + width: 92%; + padding: 0 4%; + background: #fff; + border-top-left-radius: 20rpx; + border-top-right-radius: 20rpx; + /* margin-top: -25rpx; */ +} + +.fenxiang { + position: absolute; + right: 28rpx; + top: 27rpx; + display: flex; + flex-direction: column; +} + +.fenxiang image { + width: 48rpx; + height: 48rpx; + margin: 0 auto; +} + +.gift { + color: #3c3c3c; + font-size: 20rpx; + margin: 0 auto; +} + +.user-motto { + width: 270rpx; + border: 0; + background: none; + height: 260rpx; + color: #fff; + position: fixed; +} + +.user-motto::after { + border: none; +} + +.title { + display: block; + font-weight: bold; + font-size: 32rpx; + color: #3c3c3c; + letter-spacing: 1.09rpx; + line-height: 45rpx; + width: 542rpx; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding-top: 30rpx; +} + +.subTitle { + display: block; + width: 588rpx; + /* height: 37rpx; */ + font-size: 26rpx; + color: #a6a6a6; + letter-spacing: 1.16rpx; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding: 6rpx 0; +} + +.rest { + font-size: 24rpx; + color: #919191; + letter-spacing: 0; + height: 50rpx; + line-height: 50rpx; + border-bottom: 1px solid #f9f9f9; +} + +.restNum { + font-size: 24rpx; + color: #999; + letter-spacing: 1.16rpx; + text-align: right; +} + +.time { + font-size: 24rpx; + color: #a6a6a6; + letter-spacing: 0; + line-height: 33rpx; + display: inline-block; +} + +.txt01 { + font-size: 24rpx; + color: #919191; + letter-spacing: 0; +} + +.price { + font-size: 24rpx; + color: #999; + letter-spacing: 0; +} + +.salePriceStr { + font-size: 24rpx; + color: #999; + letter-spacing: 0; +} + +.salePriceStr .rmb { + color: #fd782d; + font-size: 24rpx; + line-height: 40rpx; + float: left; +} + +.salePriceStr .pri01 { + font-size: 40rpx; + color: #fd782d; + letter-spacing: 0; + line-height: 40rpx; + float: left; +} + +.salePriceStr .pri01Hr { + font-size: 24rpx !important; +} + +.use { + color: #fd782d; + /* margin-left: 10rpx; */ +} + +.salePriceStr .yuan { + font-size: 24rpx; + color: #fd782d; + letter-spacing: 0; +} + +.price text { + font-size: 24rpx; + color: #333; + letter-spacing: 0; +} + +.throgh { + text-decoration: line-through; + margin-left: 10rpx; + color: #999 !important; + margin-top: 8rpx; + height: 32rpx; + line-height: 45rpx; +} + +.fl { + float: left; +} + +.fr { + float: right; +} + +.notes view:nth-child(1) { + height: 87rpx; + line-height: 87rpx; + background: #fff; + border-top: 1px solid #f9f9f9; +} + +.notes { + width: 100%; + background: #fff; + padding-bottom: 30rpx; +} + +.active { + opacity: 0.6; +} + +.notes view:nth-child(1) text { + color: #333; + letter-spacing: 0; + font-size: 30rpx; + height: 70rpx; + line-height: 70rpx; +} + +.notes view:nth-child(1) { + width: 92%; + margin: 0 auto; +} + +.notes view:nth-child(2) { + display: flex; + flex-direction: column; + width: 92%; + margin: 0 auto; +} + +.notes view:nth-child(2)>text { + font-size: 24rpx; + color: #919191; + letter-spacing: 0; + line-height: 42rpx; +} + +.buy-view { + /* background: #fff; */ + height: 92rpx; + bottom: 0; + left: 0; + right: 0; + padding-bottom: 22rpx; + padding-top: 22rpx; +} + +.buy { + position: relative; + background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); + height: 94rpx; + width: 560rpx; + margin: 0 auto 30rpx; + color: #fff; + font-size: 36rpx; + line-height: 94rpx; + border-radius: 61rpx; +} + +#noBuy { + position: relative; + background-color: rgba(0, 0, 0, 0.2); + height: 94rpx; + width: 560rpx; + margin: 0 auto 30rpx; + color: #fff; + font-size: 36rpx; + line-height: 94rpx; + border-radius: 61rpx; +} + +.buyHr { + background: #cecece !important; +} + +.goback { + position: relative; + float: left; + width: 132rpx !important; + height: 96rpx; + background: rgba(255, 255, 255, 1) !important; + line-height: 95rpx; + border-radius: 32rpx; + margin-left: 20rpx; +} + +.goback image { + position: absolute; + width: 52rpx; + height: 50rpx; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: 10rpx auto; +} + +.tel { + position: absolute; + right: 0; + top: 0; + bottom: 0; + margin: auto; + width: 50rpx; + height: 50rpx; +} + +.txt { + margin-right: 30rpx; +} + +.distance { + border: none; + border-radius: 16rpx; + width: 600rpx; + padding: 16rpx 6rpx 0 0; +} + +.distance .txt01 { + display: block; + font-size: 26rpx; + color: #ff4949; +} + +.clock { + width: 116rpx !important; + vertical-align: middle; + margin-right: 10rpx; + margin-top: -4rpx; +} + +.qiang { + position: inline-block; + width: 60rpx; + height: 40rpx; + line-height: 40rpx; + color: #ff4949; + text-align: center; + font-size: 28rpx; + margin-right: 10rpx; +} + +.times { + display: inline-block; + color: #ff4949; + font-weight: bold; + font-size: 26rpx; + text-align: center; +} + +.timess { + color: #fd782d; +} + +.times text { + display: inline-block; + margin: 6rpx; + height: 56rpx; + padding: 0 6rpx; + text-align: center; + font-size: 28rpx; + line-height: 60rpx; + border-radius: 12rpx; + color: #fff; + font-weight: bold; + background: #ff4949; +} + +.con { + position: absolute; + top: 35rpx; + right: 0; + bottom: 0; + left: 0; + margin: auto; + width: 587rpx; +} + +.con .image { + display: block; + width: 100%; +} + +.img { + margin-top: -50rpx; +} + +.question { + display: block; + width: 587rpx; + background: #fff; + border-bottom-left-radius: 22rpx; + border-bottom-right-radius: 22rpx; + overflow: hidden; +} + +.ques { + display: block; + width: 511rpx; + margin: 0 auto; + height: 95rpx; + line-height: 95rpx; + font-size: 30rpx; + color: #333; + border-bottom: 1rpx solid #eee; +} + +.titles { + width: 511rpx; + display: block; + text-align: center; + height: 50rpx; + margin: 0 auto; + padding-top: 10rpx; + padding-bottom: 20rpx; + font-size: 32rpx; + font-weight: bold; + line-height: 41rpx; + border-bottom: 1rpx solid #eee; +} + +.quessss >view:last-child { + border-bottom: 0; +} + +.wmclose { + position: relative; + z-index: 10000; + display: block; + width: 70rpx; +} + +.ques_gou { + position: absolute; + width: 20rpx; + top: 160rpx; + left: 23rpx; +} + +.btnss { + color: #f8755b; + font-weight: bold; + font-size: 30rpx !important; + text-align: center !important; +} + +.radios { + display: block; + font-size: 28rpx; + height: 95rpx; + line-height: 95rpx; + color: #333; + text-indent: 0.5em; +} + +.elecard { + display: inline-block; + margin-left: 6rpx; + color: rgba(254, 70, 20, 1); + border: 1px solid rgba(254, 70, 20, 1); + border-radius: 8rpx; + font-style: normal; + font-size: 30rpx; + line-height: 40rpx; + padding: 0 6rpx; +} + +.btns { + /* padding: 0 33rpx; */ + position: fixed; + left: 0; + right: 0; + bottom: 0; + padding-bottom: 22rpx; + padding-top: 22rpx; + z-index: 12; + /* background: #fff; */ +} + +.btnTxt { + width: 50rpx; + height: 30rpx; + line-height: 50rpx; + color: #fd782d; + font-size: 20rpx; + position: absolute; + right: 42rpx; + bottom: 15rpx; +} + +.btns .fr, .btns .fl { + width: 277rpx; + height: 95rpx; + border-radius: 48rpx; + text-align: center; +} + +.btns .fl { + margin-left: 20rpx; + color: #fff; + background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); +} + +.btns .fl text { + display: block; + font-size: 30rpx; + line-height: 34rpx; +} + +.btns .fl text:nth-of-type(1) { + margin-top: 12rpx; +} + +.btns .fr { + font-size: 30rpx; + color: #fff; + margin-right: 20rpx; + line-height: 95rpx; + background: linear-gradient(90deg, rgba(40, 179, 255, 1) 0%, rgba(48, 103, 255, 1) 100%); + /* box-shadow: 0px 8px 8px 1px rgba(246, 93, 51, 0.32); */ +} + +.support-tansfer { + width: 60%; + border-radius: 50rpx; + margin-top: 30rpx; + /* background: #02c0ff !important; */ + background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); +} + +.shaddow { + z-index: 100; + position: fixed; + width: 100%; + height: 100%; + top: 0px; + background: rgba(0, 0, 0, 0.8); + overflow: hidden; +} + +.alert-box { + position: fixed; + top: 50%; + margin-top: -270rpx; + left: 10%; + width: 80%; + height: auto; + padding-bottom: 20rpx; + background: #fff; + z-index: 200; + border-radius: 20rpx; +} + +.user-img { + position: absolute; + top: -50rpx; + left: 250rpx; + /* margin-left: -50rpx; */ + width: 100rpx; + height: 100rpx; + z-index: 300; + border-radius: 50rpx; + background: #fff; + overflow: hidden; +} + +.user-img image { + width: 100rpx; + height: 100rpx; +} + +.close { + position: absolute; + z-index: 300; + right: 0; + top: 0; + width: 100rpx; + height: 100rpx; + overflow: hidden; +} + +.close image { + display: block; + width: 26rpx; + height: 26rpx; + margin: 20rpx 0 0 52rpx; +} + +.a-title { + text-align: center; + margin-top: 76rpx; + font-size: 36rpx; + font-family: PingFang-SC-Medium; + font-weight: 500; + color: rgba(51, 51, 51, 1); + line-height: 44rpx; +} + +.a-img { + position: relative; + width: 80%; + border-radius: 20rpx; + height: 294rpx; + overflow: hidden; + text-align: center; + margin: 30rpx auto 0; +} + +.a-received { + position: absolute; + width: 100%; + height: 294rpx; + top: 0; + left: 0; + text-align: center; + line-height: 294rpx; + z-index: 320; + background: rgba(255, 255, 255, 1); + border: 0px solid rgba(151, 57, 117, 1); + opacity: 0.91; + font-size: 36rpx; + color: rgba(255, 51, 50, 1); + font-family: PingFang-SC-Medium; +} + +.a-img image { + width: 100%; + height: 100%; +} + +.bottom { + text-align: center; + height: 70rpx; + line-height: 70rpx; + color: #999; + font-size: 32rpx; + background: #fff; + padding-top: 20rpx; +} + +.presslimit { + height: 34rpx; + line-height: 34rpx; + margin-top: 8rpx; + margin-left: 12rpx; + color: #fd782d; + font-size: 20rpx; + letter-spacing: 1.16rpx; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.presslimit text { + margin-left: 15rpx; + background: rgba(201, 201, 201, 0.1); +} + +checkbox-group, radio-group { + height: 400rpx; + overflow-y: scroll; +} + +.detailImg { + width: 100%; + background: #fff; + margin: auto; +} + +.detailImg image { + display: block; + width: 92%; + padding: 0 4% 0 4%; + margin-bottom: 20rpx; +} + +.content { + margin: 0; + padding: 0; + width: 100%; + height: 100%; + background: #f3f3f3; + position: relative; +} + +.poster { + width: 100%; + height: 100%; + padding: 20rpx; + position: absolute; + top: 0; + left: 0; +} + +.bottomsave { + width: 100%; + height: 140rpx; + line-height: 140rpx; + margin: auto 0; + bottom: 0; + left: 0; + right: 0; + border-top: 1px solid #ccc; + box-shadow: 0 0rpx 150rpx #ccc; + background: #fff; +} + +.saveposter { + color: #fff; + width: 380rpx; + height: 80rpx; + border-radius: 50rpx; + background: #f08f04; + margin-top: 30rpx; + font-size: 32rpx; +} + +.modal { + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + background: rgba(0, 0, 0, 0.5); + overflow: hidden; + z-index: 10000; + color: #fff; +} + +.modal-content { + width: 540rpx; + height: 233rpx; + line-height: 60rpx; + overflow: hidden; + position: fixed; + top: 50%; + left: 0; + z-index: 11; + background: #f9f9f9; + margin: -16rpx 105rpx; + border-radius: 36rpx; + display: flex; +} + +.modal-content view { + display: inline-block; + flex: 1; + text-align: center; +} + +.modal-content view>text { + color: #000; + display: block; + font-size: 30rpx; +} + +.modal-content view>image { + margin-top: 40rpx; + width: 90rpx; + height: 90rpx; +} + +.wx-swiper-dots { + margin-bottom: 30rpx; +} + +.quan { + float: left; + margin: 18rpx 15rpx 0 0; + width: 12rpx; + height: 12rpx; + background: #e1e1e1; + border-radius: 50%; +} + +.swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal { + margin-bottom: 2rpx; +} + +.swiper-box .wx-swiper-dot { + width: 40rpx; + display: inline-flex; + height: 6rpx; + margin-left: 10rpx; + border-radius: 6rpx; + justify-content: space-between; +} + +.swiper-box .wx-swiper-dot::before { + content: ''; + flex-grow: 1; + background: #ccc8c8; +} + +.swiper-box .wx-swiper-dot-active::before { + background: #f6792b; +} + +.jifen { + font-size: 30rpx; +} + +.childText { + color: #333; + letter-spacing: 0; + font-size: 30rpx; + height: 70rpx; + line-height: 70rpx; + background-color: #fff; + width: 92%; + padding: 0 4%; +} + +.childBox { + width: 92%; + padding: 0 4%; + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + +.childItem { + width: 48%; + background-color: #fff; + border-radius: 10rpx; + overflow: hidden; + margin: 20rpx 0; +} + +.childImg { + width: 90%; + margin: 10px auto; + display: block; +} + +.childName { + margin-top: 10rpx; + margin: 10px; + font-size: 24rpx; + color: #919191; +} + +.childMoney { + color: #fd782d; + font-size: 24rpx; + margin: 10px; + text-decoration: line-through; +} diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 78fe302..f486506 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -210,7 +210,7 @@ Page({ gochild(e){ let id = e.currentTarget.dataset.id wx.navigateTo({ - url: `/pages/coupon/detail/index?couponIds=${id}`, + url: `/pages/coupon/childDetail/childDetail?couponIds=${id}`, }) }, //获取当前登录用户信息 diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index d58d3e4..533d204 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -20,7 +20,7 @@ - + 分享 @@ -119,7 +119,7 @@ - 购买须知 + @@ -156,10 +156,10 @@ - - diff --git a/pages/edit/edit.js b/pages/edit/edit.js index d2c63fa..58218f1 100644 --- a/pages/edit/edit.js +++ b/pages/edit/edit.js @@ -126,8 +126,8 @@ Page({ name: username, birthdate: birthdate, childrenList: tmeparr, - height: e.detail.value.height, - weight: e.detail.value.weight, + height: e.detail.value.height ? e.detail.value.height : that.data.height, + weight: e.detail.value.weight ? e.detail.value.weight : that.data.weight, } }) .then(res => { diff --git a/pages/edit/edit.wxml b/pages/edit/edit.wxml index 4d7cedb..3e1f223 100644 --- a/pages/edit/edit.wxml +++ b/pages/edit/edit.wxml @@ -16,13 +16,13 @@ 身高 - - + + 体重 - - + + 性别 diff --git a/pages/fillIndent/fillIndent.js b/pages/fillIndent/fillIndent.js index 6085d64..6592563 100644 --- a/pages/fillIndent/fillIndent.js +++ b/pages/fillIndent/fillIndent.js @@ -26,6 +26,7 @@ Page({ thenArr: {}, //选中的地址对象 contentType:0, shippingtype:1,//1是自提 2配送 + total:0,//合计 }, goAddStie() { wx.navigateTo({ @@ -95,6 +96,14 @@ Page({ }); }) }, + setTotal(){ + //计算总和 + let str = 0 + str = (Number(this.data.salePriceStr) * (this.data.num)) + Number(this.data.freightPriceStr) + this.setData({ + total: str.toFixed(2) + }) + }, addNum() { let num = this.data.num if (this.data.num >= this.data.remainInventory) { @@ -108,6 +117,7 @@ Page({ this.setData({ num: num }) + this.setTotal() } }, @@ -126,6 +136,7 @@ Page({ this.setData({ num: num }) + this.setTotal() } }, hieShade() { @@ -297,6 +308,7 @@ Page({ contentType: res.data.contentType }) + this.setTotal() }).catch(err => { wx.showToast({ title: err.message ? err.message : err.data, @@ -350,10 +362,10 @@ Page({ }, - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function() { + // /** + // * 用户点击右上角分享 + // */ + // onShareAppMessage: function() { - } + // } }) \ No newline at end of file diff --git a/pages/fillIndent/fillIndent.wxml b/pages/fillIndent/fillIndent.wxml index 356ff9e..75e8971 100644 --- a/pages/fillIndent/fillIndent.wxml +++ b/pages/fillIndent/fillIndent.wxml @@ -4,14 +4,15 @@ + + {{consignee}} + {{mobile}} + {{area}} - 默认 + {{address}} - - {{consignee}} - {{mobile}} - + 更换 添加收货地址 @@ -49,12 +50,16 @@ 合计 - ¥{{(salePriceStr*num)+(freightPriceStr*1)}} + ¥{{(salePriceStr*num)}} + ¥{{total}} + - ¥{{(salePriceStr*num)+(freightPriceStr*1)}} + ¥{{(salePriceStr*num)}} + ¥{{total}} + 支付 @@ -65,16 +70,20 @@ - - - {{item.regionStr}} - - {{item.address}} - + + {{item.consignee}} {{item.mobile}} + + + {{item.regionStr}} + + {{item.address}} + + 默认 + diff --git a/pages/fillIndent/fillIndent.wxss b/pages/fillIndent/fillIndent.wxss index baf9d2a..3e00d2d 100644 --- a/pages/fillIndent/fillIndent.wxss +++ b/pages/fillIndent/fillIndent.wxss @@ -22,6 +22,12 @@ overflow: hidden; margin: 20rpx ; } + +.siteTitleArr{ + overflow: hidden; + margin: 20rpx 0; +} + .text{ float: left; font-size: 26rpx; @@ -34,19 +40,21 @@ margin-left: 20rpx; } .siteText{ - font-size: 28rpx; + font-size: 26rpx; + color: #999; } .phoneBox{ + overflow: hidden; } .name{ float: left; - font-size: 24rpx; - color: #999; + font-size: 28rpx; + color: #000; } .phone{ - font-size: 24rpx; - color: #999; + font-size: 28rpx; + color: #000; float: left; margin-left: 30rpx } @@ -100,18 +108,33 @@ } .add{ float: right; - width: 30rpx; + width: 40rpx; + height: 40rpx; text-align: center; + border: 1rpx #999 solid; + border-radius: 50%; + color: #999; + + } .number{ float: right; width: 30rpx; + height: 40rpx; + line-height: 40rpx; text-align: center; + margin: 0 10rpx; + } .dle{ float: right; - width: 30rpx; + width: 40rpx; + height: 40rpx; text-align: center; + border: 1rpx #999 solid; + border-radius: 50%; + color: #999; + } .costBox{ overflow: hidden; @@ -184,4 +207,14 @@ max-height: 70vh; overflow: scroll; margin: 300rpx auto 0 auto; +} +.ditText{ + position: absolute; + top: 40rpx; + right: 40rpx; + background-color: #FD832D; + padding: 10rpx; + color: #fff; + font-size: 24rpx; + border-radius: 10rpx; } \ No newline at end of file diff --git a/pages/siteUser/siteUser.wxml b/pages/siteUser/siteUser.wxml index 8a8bd5e..90a8569 100644 --- a/pages/siteUser/siteUser.wxml +++ b/pages/siteUser/siteUser.wxml @@ -2,11 +2,16 @@ - {{item.regionSty}} + + + 默认 + {{item.consignee}} {{item.mobile}} + + + {{item.regionSty}} {{item.address}} - {{item.consignee}} {{item.mobile}} - - + + +新建收货地址 \ No newline at end of file diff --git a/pages/siteUser/siteUser.wxss b/pages/siteUser/siteUser.wxss index 0501782..d33e629 100644 --- a/pages/siteUser/siteUser.wxss +++ b/pages/siteUser/siteUser.wxss @@ -10,13 +10,33 @@ page{ border: 1rpx #fff solid; overflow: hidden; background-color: #fff; + position: relative; } .siteBox{ float: left; width: 90%; } +.titleBox{ + overflow: hidden; +} +.moTxet{ + background-color: #FD832D; + color: #fff; + float: left; + font-size: 22rpx; + padding: 5rpx; + border-radius: 6rpx; + margin: 10rpx; + +} .region{ padding: 10rpx; +} +.regionT{ + float: left; + margin: 10rpx; + + } .detail{ color: #999; @@ -30,8 +50,8 @@ page{ float: right; width: 60rpx; - height: 60rpx; - background-color: #fac; + height: 50rpx; + /* background-color: #fac; */ margin-top: 50rpx; margin-right: 2rpx } @@ -44,4 +64,4 @@ page{ border-radius: 100rpx; margin: 20rpx auto; line-height: 60rpx; -} \ No newline at end of file +} diff --git a/pages/topicDetail/index.js b/pages/topicDetail/index.js index 57513c4..e0145d3 100644 --- a/pages/topicDetail/index.js +++ b/pages/topicDetail/index.js @@ -84,5 +84,8 @@ Page({ }) } }, + onShareAppMessage: function (options) { + + } });