diff --git a/pages/component/myCalendar/index.js b/pages/component/myCalendar/index.js index 30ffde8..d991505 100644 --- a/pages/component/myCalendar/index.js +++ b/pages/component/myCalendar/index.js @@ -1,5 +1,6 @@ // pages/component/myCalendar/index.js import util from "../../../utils/util" +let app = getApp() Component({ /** * 组件的属性列表 @@ -29,10 +30,12 @@ Component({ dateArr: [], isToday: 0, isTodayWeek: false, - todayIndex: 0 + todayIndex: 0, + isKj:null }, lifetimes: { attached: function() { + console.log(app.globalData) let now = new Date(); let year = now.getFullYear(); let month = now.getMonth() + 1; @@ -40,7 +43,8 @@ Component({ this.setData({ year: year, month: month, - isToday: '' + year + month + now.getDate() + isToday: '' + year + month + now.getDate(), + isKj:app.globalData.kjId }) let dates={} this.properties.datelist.map(item=>{ diff --git a/pages/component/myCalendar/index.wxml b/pages/component/myCalendar/index.wxml index d259512..5819e00 100644 --- a/pages/component/myCalendar/index.wxml +++ b/pages/component/myCalendar/index.wxml @@ -14,7 +14,7 @@ {{item.dateNum}} - ¥{{dates[item.date].price==0?'免费':(dates[item.date].price/100)}} + ¥{{dates[item.date].price==0 || isKj?'免费':(dates[item.date].price/100)}} 售罄 diff --git a/pages/index/index.js b/pages/index/index.js index ce4fbda..f55dbcd 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -57,12 +57,22 @@ Page({ }) }, + onTabItemTap:function(e){ + console.log(e,99999999) + }, // 一城百馆 city:function(){ wx.navigateToMiniProgram({ appId: 'wx114d514f39cb1fed', path:"pages/index/index" }) + commonApi._post("browse/burying_point",{ + drive:"mini", + title:"一城百馆", + uuid:app.globalData.uuid + }).then(res=>{ + + }) }, changeHotIndex:function(e){ this.setData({ @@ -162,6 +172,15 @@ Page({ wx.navigateTo({ url: e.currentTarget.dataset.path, }) + if(e.currentTarget.dataset.title){ + commonApi._post("browse/burying_point",{ + uuid:app.globalData.uuid, + drive:"mini", + title:e.currentTarget.dataset.title + }).then(res=>{ + + }) + } }, gotoUrl:function(e){ let url = e.currentTarget.dataset.url; @@ -191,6 +210,13 @@ Page({ appId: 'wx74f380bc721a0379', path:'/pages/listen/listen?title=君到苏州' }) + commonApi._post("browse/burying_point",{ + drive:"mini", + title:"语音导览", + uuid:app.globalData.uuid + }).then(res=>{ + + }) }, // 热门推荐 getList:function(){ diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 05256bc..70e6234 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -20,50 +20,50 @@ - + 活动日历 - + 景点门票 - + 酒店住宿 - + 姑苏八点半 - + 一卡游苏州 - + 场馆预约 - + 非遗专卖 - + 剧场演出 - + 文创特产 - + 电影购票 - + 限时特惠超值商品限时抢购 @@ -87,7 +87,7 @@ - + 精品线路精品线路精心挑选 @@ -115,9 +115,9 @@ - + - + @@ -130,56 +130,56 @@ 苏康码 --> - + 找厕所 - + 停车场 - + 安全服务 - - + 公共自行车 - + 书香借阅 - + 非遗传承 - + 投资导引图 - - + 文物查询 - + 在线鉴赏 - - + 垃圾分类 @@ -189,7 +189,7 @@ - + diff --git a/pages/kj/index.js b/pages/kj/index.js index 5999f53..11cae76 100644 --- a/pages/kj/index.js +++ b/pages/kj/index.js @@ -64,7 +64,6 @@ Page({ let data = e.currentTarget.dataset,that = this; if(data.index || data.index==0){ let item = this.data.list[data.index]; - console.log(item) // 已砍成已下单 if(item.buy_status=='end'){ wx.showModal({ @@ -73,7 +72,7 @@ Page({ confirmColor:"#e14135", success:function(res){ if(res.confirm){ - that.gotoProduct(item.goods_id) + that.gotoProduct(item) } } }) @@ -81,34 +80,20 @@ Page({ } // 已砍成未下单 if(item.buy_status=='over'){ - app.globalData.kjId = item.buy_id; // todo - util.goKjOrder(item).then(product=>{ - app.globalData.couponInfo = null; - if(item.type=='post'){ - app.globalData.postProduct = product; - wx.navigateTo({ - url: '/pages/order/postOrder/index', - }) - } - else if(item.type=='ticket' || item.type=='scene'){ - app.globalData.product = product; - wx.navigateTo({ - url: '/pages/order/scene/index', - }) - } - }) + app.globalData.kjId = item.buy_id; + that.gotoProduct(item) return; } // 已售罄 - if(item.act_stock<=0){ + if(item.remain_num<=0){ wx.showModal({ title:"提示", content:"此商品已售罄,是否原价购买", confirmColor:"#e14135", success:function(res){ if(res.confirm){ - that.gotoProduct(item.goods_id) + that.gotoProduct(item) } } }) @@ -120,11 +105,21 @@ Page({ url:"info/index?id="+data.id+"&sid="+data.sid+"&aid="+data.aid }) }, - gotoProduct:function(id){ - productApi._post("product/get_product_detail",{ - id:id - }).then(res=>{ - util.gotoDetail(res.data) + gotoProduct:function(item){ + util.goKjOrder(item).then(product=>{ + app.globalData.couponInfo = null; + if(item.type=='post'){ + app.globalData.postProduct = product; + wx.navigateTo({ + url: '/pages/order/postOrder/index', + }) + } + else if(item.type=='ticket' || item.type=='scene'){ + app.globalData.product = product[0]; + wx.navigateTo({ + url: '/pages/order/scene/index', + }) + } }) }, getMine:function(){ @@ -152,6 +147,8 @@ Page({ res.data.data.map(item=>{ item.showMoreFlag = false; item.showList = item.product.slice(0,2); + let t = new Date(item.act_begin_time.replace(/-/g,'/')); + item.timeText = t.getMonth()+1+"月"+t.getDate()+"日 "+t.getHours()+":"+(t.getMinutes()>9?t.getMinutes():('0'+t.getMinutes()))+" 开始"; }) this.setData({ nextList:this.data.nextList.concat(res.data.data), @@ -181,10 +178,10 @@ Page({ let index = e.currentTarget.dataset.index,nextList=this.data.nextList; nextList[index].showMoreFlag = !nextList[index].showMoreFlag; if(nextList[index].showMoreFlag){ - item.showList = item.product; + nextList[index].showList = nextList[index].product; } else { - item.showList = item.product.slice(0,2); + nextList[index].showList = nextList[index].product.slice(0,2); } this.setData({ nextList:nextList @@ -299,7 +296,7 @@ Page({ */ onReachBottom: function () { if(this.data.type==1){ - this.getList() + // this.getList() } else { this.getNext() diff --git a/pages/kj/index.wxml b/pages/kj/index.wxml index 0d108be..a224737 100644 --- a/pages/kj/index.wxml +++ b/pages/kj/index.wxml @@ -4,6 +4,7 @@ 进行中 活动预热 + 我参与的活动 @@ -37,10 +38,10 @@ ¥{{item.kj_money/100}} - 剩余库存:{{item.act_stock}} + 剩余库存:{{item.remain_num}} 已购买 前往下单 - 售罄 + 售罄 砍价免费领 @@ -51,7 +52,7 @@ - {{item.act_name}} + {{item.timeText}} @@ -67,7 +68,7 @@ - {{item.showMoreFlag?'点击收起':'点击查看更多'}} + {{item.showMoreFlag?'点击收起':'点击查看更多'}} 暂无活动 diff --git a/pages/kj/index.wxss b/pages/kj/index.wxss index 61d4182..6580f71 100644 --- a/pages/kj/index.wxss +++ b/pages/kj/index.wxss @@ -93,7 +93,7 @@ page { color: #fff; } .list { - padding-top: 80rpx; + padding-top: 0; padding-bottom: 20rpx; } .item-bottom { diff --git a/pages/kj/info/index.js b/pages/kj/info/index.js index 3eaa10a..42d02a0 100644 --- a/pages/kj/info/index.js +++ b/pages/kj/info/index.js @@ -24,46 +24,39 @@ Page({ */ onLoad: function (options) { // 获取用户信息 后面的砍价接口和发起活动接口需要用到 + let that = this; productApi.user_post("uservice/user/getMyInfo",{}).then(r=>{ this.setData({ userInfo:r.data }) let userid = r.data.id,service="activity.haggle/get_haggle_detail"; - // 如果不是当前用户并且打开了分享的页面的话 是砍价页面 - if(options.userid && userid && options.userid!=userid){ - this.setData({ - isKj:true - }) - } - else { - this.setData({ - isKj:false - }) - } - // 对于所有打开了分享页面的人来说 都调用的是邀请接口 - if(options.userid){ - service="activity.haggle/get_haggle_detail" - } - productApi.user_post(service+'?id='+options.id,{ - id:options.id + productApi.user_post(service+'?id='+options.id+(options.originate_id?('&originate_id='+options.originate_id):''),{ }).then(res=>{ if(!res.data.user_record || !res.data.user_record.id){ res.data.user_record = { bargined_money:0 } } + if(res.data.originate && res.data.originate.id && options.originate_id){ + res.data.user_record = res.data.originate; + } this.setData({ kjId:res.data.user_record.id }) - // 判断是否助力过 - res.data.isHelp = false; - if(res.data.myHelpKj && res.data.myHelpKj.id){ - res.data.isHelp = true; - } this.setData({ info:res.data }) - + // 判断是否是自己发起的活动 + if(!res.data.user_record.id || res.data.user_record.user_id==userid){ + this.setData({ + isKj:false + }) + } + else { + this.setData({ + isKj:true + }) + } // 只有发起了的活动才需要倒计时 if(res.data.user_record.id && res.data.user_record.over_time){ // 获取砍价记录 @@ -80,12 +73,7 @@ Page({ timer = setInterval(()=>{ this.setTime() },1000) - // 判断是否是自己发起的活动 - if(res.data.user_record.user_id==userid){ - this.setData({ - isKj:false - }) - } + if(this.data.isKj){ // 发起者状态是砍价完成,提示用户:我已经砍价完成了,你也快来试试吧,点击否停留当前页面,点击是,跳转砍价专区 if(res.data.user_record.flag=='over'){ @@ -102,10 +90,10 @@ Page({ }) } // 如果状态是砍价失败,提示用户:{发起者昵称}发起的砍价活动已结束,你也快来试试吧,点击否返回商城首页,点击是,跳转砍价专区 - else if(res.data.originOriginateInfo.flag=='fail' || res.data.originOriginateInfo.flag=='expired'){ + else if(res.data.user_record.flag=='fail' || res.data.user_record.flag=='expired'){ wx.showModal({ title:"提示", - content:res.data.user_record.user_phone+"发起的砍价活动已结束,你也快来试试吧", + content:res.data.user_record.user_name+"发起的砍价活动已结束,你也快来试试吧", success:function(r){ if(r.confirm){ wx.redirectTo({ @@ -121,6 +109,24 @@ Page({ }) } } + else if(res.data.user_record.flag=='fail' || res.data.user_record.flag=='expired'){ + wx.showModal({ + title:"提示", + content:"您未砍价成功,是否原价购买?", + success:function(r){ + if(r.confirm){ + // 去买 + that.gotoDetail({ + currentTarget:{ + dataset:{ + type:"none" + } + } + }) + } + } + }) + } } }) }) @@ -198,7 +204,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - if(this.data.info && this.data.info.originOriginateInfo && this.data.info.originOriginateInfo.id){ + if(this.data.info && this.data.info.user_record && this.data.info.user_record.id){ this.setTime(); timer = setInterval(()=>{ this.setTime() @@ -216,6 +222,7 @@ Page({ // 详情和下单的第一步 gotoDetail:function(e){ let info = this.data.info.detail || null,type=e?e.currentTarget.dataset.type:null; + let that = this; if(!info) return; if(type=='fail'){ wx.showModal({ @@ -224,85 +231,68 @@ Page({ confirmColor:"#E14135", success:function(res){ if(res.confirm){ - this.gotoProduct() + that.pushOrderData(null) } } }) } + else if(type=='none'){ + this.pushOrderData(null) + } else { - this.gotoProduct() + this.pushOrderData(this.data.info.user_record.id) } }, // 真实的获取产品信息去下单 - pushOrderData:function(){ - productApi._get('productfront/getProductInfo',{ - productId:this.data.info.baseInfo.productId - }).then(res=>{ - if(!res.data){ - wx.showToast({ - title:"该产品不存在或已下架", - icon:'none' + pushOrderData:function(kjId){ + app.globalData.kjId = kjId; + app.globalData.couponInfo = null; + util.goKjOrder(this.data.info.detail).then(product=>{ + if(this.data.info.detail.type=='post'){ + app.globalData.postProduct = product; + wx.navigateTo({ + url: '/pages/order/postOrder/index', }) - return; } - let skuIndex = res.data.skuInfo.findIndex(item=>item.id==this.data.info.baseInfo.skuId); - if(skuIndex==-1) { - wx.showToast({ - title:"该产品规格不存在", - icon:'none' + else if(this.data.info.detail.type=='ticket' || this.data.info.detail.type=='scene'){ + app.globalData.product = product[0]; + wx.navigateTo({ + url: '/pages/order/scene/index', }) - return; - } - let sku = res.data.skuInfo[skuIndex]; - app.globalData.shoppingCart=[{ - baseInfo:res.data.baseInfo, - modelInfo:sku.modelInfo, - skuInfo:sku, - productNum:1 - }]; - if(this.data.info.originOriginateInfo.flag=='over'){ - app.globalData.kjOrderId = this.data.info.originOriginateInfo.id || null; - } - else { - app.globalData.kjOrderId = null; } - app.globalData.discounts = 0; - wx.navigateTo({ - url: '../../order/index', - }) }) }, // 帮好友砍一刀 kanjia:function(){ - if(!this.data.isFollow){ - // 未关注需要先关注公众号 - this.setData({ - showShareFlag:true - }) - return; - } + // if(!this.data.isFollow){ + // // 未关注需要先关注公众号 + // this.setData({ + // showShareFlag:true + // }) + // return; + // } let userInfo = this.data.userInfo,info = this.data.info; productApi.user_post("activity.haggle/help_bargain",{ originate_id:info.user_record.id }).then(res=>{ - if(res.code==200){ + if(res.code==1){ wx.showToast({ title: '砍价成功', icon:'success' }) - this.onLoad({userid:info.user_record.user_id,id:info.user_record.id}) + this.onLoad({userid:info.user_record.user_id,id:info.detail.id,originate_id:info.user_record.id}) } }) }, // 发起砍价 startKj:function(){ - if(!this.data.isFollow){ - // 未关注需要先关注公众号 - this.setData({ - showShareFlag:true - }) - return; - } + // if(!this.data.isFollow){ + // // 未关注需要先关注公众号 + // this.setData({ + // showShareFlag:true + // }) + // return; + // } let info = this.data.info; let userInfo = this.data.userInfo; productApi.user_post('activity.haggle/bargain_launch',{ @@ -324,7 +314,7 @@ Page({ }, // 我也要参与 join:function(){ - this.onLoad({id:this.data.info.baseInfo.id}); + this.onLoad({id:this.data.info.detail.id}); }, /** * 生命周期函数--监听页面卸载 @@ -353,9 +343,9 @@ Page({ onShareAppMessage: function () { let kjId = this.data.kjId,info = this.data.info; let shareObj = { - title: kjId?"就差你这一刀了,快来帮帮我~":(info.detail.productName+info.detail.skuName), // 默认是小程序的名称(可以写slogan等) - path: kjId?('/pages/kj/info/index?userid='+info.user_record.user_id+'&id='+kjId):('/pages/kj/info/index?&id='+info.detail.id), // 默认是当前页面,必须是以‘/’开头的完整路径 - imageUrl: info.baseInfo.headImg, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 + title: kjId?"就差你这一刀了,快来帮帮我~":(info.detail.title+info.detail.sku_name), // 默认是小程序的名称(可以写slogan等) + path: kjId?('/pages/kj/info/index?userid='+info.user_record.user_id+'&id='+info.detail.id+'&originate_id='+kjId):('/pages/kj/info/index?&id='+info.detail.id), // 默认是当前页面,必须是以‘/’开头的完整路径 + imageUrl: info.detail.headimg, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 success: function(res){ // 转发成功之后的回调 if(res.errMsg == 'shareAppMessage:ok'){ diff --git a/pages/kj/info/index.wxml b/pages/kj/info/index.wxml index 473a902..bdbd0c1 100644 --- a/pages/kj/info/index.wxml +++ b/pages/kj/info/index.wxml @@ -1,7 +1,7 @@ - + 已结束 活动规则 @@ -47,22 +47,22 @@ 发起活动,喊好友砍一刀 点击上方“发起活动”按钮,邀请好友来砍价! - 原价购买 >> + 原价购买 >> - 预计再邀请{{info.detail.alert_num}}人后砍价完成 - 原价购买 >> + 预计再邀请{{info.detail.success_need_num}}人后砍价完成 + 原价购买 >> - + 帮好友砍一刀 - + 已帮好友砍价! 我也要参与 >> @@ -86,7 +86,7 @@ - + {{item.help_user_name}} -¥{{item.bargined_money/100}} @@ -96,7 +96,7 @@ - + diff --git a/pages/kj/mine/index.js b/pages/kj/mine/index.js index b169495..810964c 100644 --- a/pages/kj/mine/index.js +++ b/pages/kj/mine/index.js @@ -96,11 +96,21 @@ Page({ }, goProduct:function(e){ let item = e.currentTarget.dataset.item; - console.log(item); - productApi._post('product/get_product_detail',{ - id:item.goods_id - }).then(res=>{ - util.gotoDetail(res.data); + app.globalData.kjId = item.id; + app.globalData.couponInfo = null; + util.goKjOrder(item).then(product=>{ + if(item.type=='post'){ + app.globalData.postProduct = product; + wx.navigateTo({ + url: '/pages/order/postOrder/index', + }) + } + else if(item.type=='ticket' || item.type=='scene'){ + app.globalData.product = product[0]; + wx.navigateTo({ + url: '/pages/order/scene/index', + }) + } }) }, goOrder:function(e){ diff --git a/pages/map/index.js b/pages/map/index.js index f2941ba..176a461 100644 --- a/pages/map/index.js +++ b/pages/map/index.js @@ -3,6 +3,7 @@ let systemInfo = wx.getSystemInfoSync(),rect = wx.getMenuButtonBoundingClientRec let height = (rect.top - systemInfo.statusBarHeight) * 2 + rect.height + systemInfo.statusBarHeight; import commonApi from "../../utils/https/common" import util from "../../utils/util" +let app = getApp(); Page({ /** @@ -387,6 +388,15 @@ Page({ info:null }) this.getList() + if(e.currentTarget.dataset.title){ + commonApi._post("browse/burying_point",{ + uuid:app.globalData.uuid, + drive:"mini", + title:e.currentTarget.dataset.title + }).then(res=>{ + + }) + } }, changeArea:function(e){ this.setData({ diff --git a/pages/map/index.wxml b/pages/map/index.wxml index 41eca0a..690e077 100644 --- a/pages/map/index.wxml +++ b/pages/map/index.wxml @@ -10,35 +10,35 @@ - + 景点 - + 场馆 - + 特产 - + 美食 - + 文物 - + 影院 - + 运河十景 - + 江南小书场 diff --git a/pages/order/components/contact/index.js b/pages/order/components/contact/index.js index 2ebdd04..d75d75e 100644 --- a/pages/order/components/contact/index.js +++ b/pages/order/components/contact/index.js @@ -220,9 +220,20 @@ Component({ icon:'none' }) } + else if(app.globalData.kjId && num==1){ + wx.showToast({ + title: '最多只能选择一个出行人', + icon:'none' + }) + } else if(item.id==linkman.id){ linkman.selected = item.selected==1?0:1; - num++; + if(linkman.selected){ + num++; + } + else { + num--; + } } }) this.setData({ diff --git a/pages/order/components/date/index.js b/pages/order/components/date/index.js index 771c269..1536273 100644 --- a/pages/order/components/date/index.js +++ b/pages/order/components/date/index.js @@ -28,11 +28,15 @@ Component({ moreFlag:true, timelist:[], timeIndex:0, - isSzMuseum:false + isSzMuseum:false, + kjIdCom:null }, lifetimes: { attached: function() { - + console.log(app.globalData,11111111) + this.setData({ + kjIdCom:app.globalData.kjId + }) // 在组件实例进入页面节点树时执行 let product = app.globalData.product,today = util.formatDate(new Date()),end_date = util.formatDate(new Date(new Date().getTime() + 60 * 24 * 60 * 60 * 1000)); if(product.product.title.indexOf("苏州博物馆")!=-1){ @@ -75,6 +79,13 @@ Component({ // 在组件实例被从页面节点树移除时执行 }, }, + pageLifetimes:{ + show:function(){ + this.setData({ + kjIdCom:app.globalData.kjId + }) + } + }, /** * 组件的方法列表 */ diff --git a/pages/order/components/date/index.wxml b/pages/order/components/date/index.wxml index 977bf40..0adb5f3 100644 --- a/pages/order/components/date/index.wxml +++ b/pages/order/components/date/index.wxml @@ -4,7 +4,7 @@ {{item.date}} - {{item.price==0?'免费':('¥'+item.price/100)}} + {{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}} 售罄 @@ -21,7 +21,7 @@ {{activeDate.short_date}} - {{activeDate.price==0?'免费':('¥'+activeDate.price/100)}} + {{activeDate.price==0 || kjIdCom?'免费':('¥'+activeDate.price/100)}} @@ -35,6 +35,6 @@ - + \ No newline at end of file diff --git a/pages/order/pay/index.js b/pages/order/pay/index.js index 6b3fc73..5d5b385 100644 --- a/pages/order/pay/index.js +++ b/pages/order/pay/index.js @@ -11,7 +11,8 @@ Page({ id:null, info:null, second:"00", - minute:"00" + minute:"00", + payIndex:-1 }, /** @@ -39,19 +40,29 @@ Page({ this.daojishi(time); },1000) }, - + // 选择支付方式 + changePayMethod:function(e){ + let index = e.currentTarget.dataset.index; + this.setData({ + payIndex:index + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { - + payList:[] }, /** * 生命周期函数--监听页面显示 */ onShow: function () { - + commonApi.user_post("subwallet.ermb/wallet",{}).then(res=>{ + this.setData({ + payList:res.data + }) + }) commonApi.user_post("order/query",{ order_id:this.data.id }).then(res=>{ @@ -120,6 +131,42 @@ Page({ console.log(res) }) }, + // 电子钱包支付 + walletPay:function(){ + let item = this.data.payList[this.data.payIndex]; + commonApi.user_post("order/pay",{ + order_id:this.data.id, + pay_method:"SUBWALLET", + pay_platform:"MINI", + app_name:"WxXcxConfig", + ins_no:item.ins_no + }).then(res=>{ + let data = res.data?JSON.parse(res.data):{}; + if(data && data.RESULT && data.RESULT=='Y'){ + commonApi.user_post("order/query_pay_result",{ + order_id:this.data.id + }).then(res=>{ + if(res.data.code==1){ + wx.showToast({ + title: '支付成功', + icon:"success" + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '../payresult/index?tid='+this.data.id + }) + },1000) + } + }) + } + else { + wx.showToast({ + title: data.ERRORMSG || "支付失败,请重试", + icon:"none" + }) + } + }) + }, /** * 生命周期函数--监听页面隐藏 diff --git a/pages/order/pay/index.wxml b/pages/order/pay/index.wxml index adaeb82..6e6ba91 100644 --- a/pages/order/pay/index.wxml +++ b/pages/order/pay/index.wxml @@ -10,10 +10,17 @@ 支付方式: - + 微信支付 - + + + + + + {{item.bank_name}} + -立即付款 \ No newline at end of file +立即付款 +立即付款 \ No newline at end of file diff --git a/pages/order/pay/index.wxss b/pages/order/pay/index.wxss index f759b9a..3f738ef 100644 --- a/pages/order/pay/index.wxss +++ b/pages/order/pay/index.wxss @@ -44,7 +44,7 @@ page { display: flex; justify-content: space-between; align-items: center; - margin-top: 20rpx; + padding: 20rpx 0; } .pay-method .method-name { margin: 0 20rpx; @@ -59,4 +59,10 @@ page { } .icon-iconfontoptionbutton { font-size: 32rpx; +} +.pay-method image { + width: 72rpx; + height: 72rpx; + display: block; + flex-shrink: 0; } \ No newline at end of file diff --git a/pages/order/postOrder/index.js b/pages/order/postOrder/index.js index d8160ba..1d1245a 100644 --- a/pages/order/postOrder/index.js +++ b/pages/order/postOrder/index.js @@ -26,19 +26,22 @@ Page({ kjId:app.globalData.kjId }) let price = 0,sku_id=[]; + console.log(app.globalData.kjId) app.globalData.postProduct.map(item=>{ - if(app.globalData.kjId){ - item.sku.price = 0; + if(!app.globalData.kjId){ + price = price + item.sku.price * item.productNum; } - price = price + item.sku.price * item.productNum; sku_id.push(item.sku.id) }) this.setData({ product:app.globalData.postProduct, - showPrice:price, + showPrice:app.globalData.kjId?0:price, sku_id:sku_id.join(",") }) - this.couponCom = this.selectAllComponents("#coupon")[0]; + if(!this.data.kjId){ + this.couponCom = this.selectAllComponents("#coupon")[0]; + } + }, inputRemark:function(e){ let index = e.currentTarget.dataset.index,product = this.data.product; @@ -87,13 +90,15 @@ Page({ icon: 'none' }) app.globalData.couponInfo = null; - this.couponCom.setNullCoupon() + if(!this.data.kjId){ + this.couponCom.setNullCoupon() + } this.setData({ coupon:null }) } this.setData({ - showPrice:price + showPrice:app.globalData.kjId?0:price }) }, order:function(){ @@ -125,7 +130,13 @@ Page({ commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ - console.log(res) + if(app.globalData.kjId){ + app.globalData.kjId = null; + this.setData({ + kjId:null + }) + this.onLoad({}) + } }) }, getPostFee:function(){ @@ -162,7 +173,9 @@ Page({ icon: 'none' }) app.globalData.couponInfo = null; - this.couponCom.setNullCoupon() + if(!this.data.kjId){ + this.couponCom.setNullCoupon() + } this.setData({ coupon:null }) diff --git a/pages/order/postOrder/index.wxml b/pages/order/postOrder/index.wxml index 5db3486..df533c6 100644 --- a/pages/order/postOrder/index.wxml +++ b/pages/order/postOrder/index.wxml @@ -37,7 +37,7 @@ 小计:{{item.sku.price/100 * item.productNum}} - + 合计:¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}} diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index 6cd7a5a..36986d9 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -17,7 +17,8 @@ Page({ singlePrice:0, type:null, coupon:app.globalData.couponInfo, - isLogin:false + isLogin:false, + kjId:null }, /** @@ -25,18 +26,20 @@ Page({ */ onLoad: function (options) { this.setData({ - type:options.type + type:options.type, + kjId:app.globalData.kjId }) if(!app.globalData.product){ util.back(); return; } - console.log(app.globalData.product) this.setData({ product:app.globalData.product, singlePrice:app.globalData.product.sku.price }) - this.couponCom = this.selectAllComponents("#coupon")[0]; + if(!this.data.kjId){ + this.couponCom = this.selectAllComponents("#coupon")[0]; + } }, setLinkman:function(e){ let linkmanList = e.detail; @@ -45,7 +48,9 @@ Page({ title: '订单价格发生变化,请重新选择优惠券', icon: 'none' }) - this.couponCom.setNullCoupon() + if(!this.data.kjId){ + this.couponCom.setNullCoupon() + } app.globalData.couponInfo = null; this.setData({ coupon:null @@ -76,8 +81,9 @@ Page({ icon: 'none' }) } - // this.couponCom = this.selectAllComponents("#coupon") - this.couponCom.setNullCoupon() + if(!this.data.kjId){ + this.couponCom.setNullCoupon() + } app.globalData.couponInfo = null; this.setData({ productNum:(this.data.productNum-1), @@ -93,8 +99,9 @@ Page({ this.setData({ coupon:null }) - // this.couponCom = this.selectAllComponents("#coupon") - this.couponCom.setNullCoupon() + if(!this.data.kjId){ + this.couponCom.setNullCoupon() + } app.globalData.couponInfo = null; } this.setData({ @@ -153,12 +160,18 @@ Page({ visitors:linkmanIds.join(","), remark:remark, product_num:productNum - }] + }], + originate_order_id:this.data.kjId } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ - console.log(res) + if(app.globalData.kjId){ + this.setData({ + kjId:null + }); + app.globalData.kjId = null; + } }) }, @@ -198,7 +211,10 @@ Page({ * 生命周期函数--监听页面卸载 */ onUnload: function () { - + this.setData({ + kjId:null + }); + app.globalData.kjId = null; }, /** diff --git a/pages/order/scene/index.wxml b/pages/order/scene/index.wxml index 124d90d..61c0357 100644 --- a/pages/order/scene/index.wxml +++ b/pages/order/scene/index.wxml @@ -8,13 +8,13 @@ 购票数量 - + {{productNum}} - + - + 订单备注 @@ -23,7 +23,8 @@ - 合计:¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}} + 合计:¥0 + 合计:¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}} 提交订单 diff --git a/pages/pbService/index.js b/pages/pbService/index.js index e1a5424..4bc5d05 100644 --- a/pages/pbService/index.js +++ b/pages/pbService/index.js @@ -29,6 +29,15 @@ Page({ wx.navigateTo({ url: e.currentTarget.dataset.path, }) + if(e.currentTarget.dataset.title){ + commonApi._post("browse/burying_point",{ + uuid:app.globalData.uuid, + drive:"mini", + title:e.currentTarget.dataset.title + }).then(res=>{ + + }) + } }, jiesongji:function(){ if(!this.data.jsj) return; diff --git a/pages/pbService/index.wxml b/pages/pbService/index.wxml index 78cbea4..37edeca 100644 --- a/pages/pbService/index.wxml +++ b/pages/pbService/index.wxml @@ -7,15 +7,15 @@ 苏康码 --> - + 安全服务 - + 找厕所 - + 景区舒适度 @@ -28,19 +28,19 @@ 实时公交 --> - + 停车场 - + 公共自行车 - + 接送机 - + P+R停车场 @@ -49,11 +49,11 @@ 文体查询 - + 投资导引图 - + 非遗传承 @@ -61,27 +61,27 @@ 文保单位 --> - + 文物查询 - + 在线鉴赏 - + 书香借阅 - + 体育场馆 - + 垃圾分类 - + 博物馆查询 diff --git a/project.private.config.json b/project.private.config.json index be92d25..356af4e 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -13,14 +13,14 @@ "miniprogram": { "list": [ { - "name": "pages/kj/index", - "pathName": "pages/kj/index", - "query": "id=203", + "name": "pages/kj/info/index", + "pathName": "pages/kj/info/index", + "query": "user_id=25&id=68&originate_id=109", "scene": null }, { - "name": "pages/activity/graduate/index", - "pathName": "pages/activity/graduate/index", + "name": "pages/kj/index", + "pathName": "pages/kj/index", "query": "id=5", "scene": null }, diff --git a/utils/https.js b/utils/https.js index ebfd83b..bec3577 100644 --- a/utils/https.js +++ b/utils/https.js @@ -1,8 +1,8 @@ var app = getApp(); import util from "../utils/util" import userApi from "../utils/https/user.js"; -const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; -// const baseUrl = "https://api.cloud.sz-trip.com/api/"; +// const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; +const baseUrl = "https://api.cloud.sz-trip.com/api/"; const orders = ['','weight','distance','sale_number','sale_price','price']; //封装GET请求 function _get(url,data) { diff --git a/utils/util.js b/utils/util.js index e02d35e..1866ef6 100644 --- a/utils/util.js +++ b/utils/util.js @@ -322,11 +322,25 @@ const goKjOrder = function(item) { commonApi._post("product/get_product_detail",{ id:item.goods_id }).then(res=>{ + if(!res.data){ + wx.showToast({ + title: '该产品已下架', + icon:'none' + }) + return; + } let product = [{ product:res.data, sku:res.data.sku.find(s=>s.id==item.sku_id), productNum:1 }]; + if(!product[0].sku){ + wx.showToast({ + title: '该规格已下架', + icon:'none' + }) + return; + } // 因为util里面不好改app.globalData的数据 但是下单是把产品信息先保存到globalData的 所以只能在页面内操作 // 购买 只能把产品信息回传过去 可能还要改 暂时先回传整个的 resolve(product);