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 @@