Myth 5 years ago
parent
commit
d138125150
  1. 8
      pages/component/myCalendar/index.js
  2. 2
      pages/component/myCalendar/index.wxml
  3. 26
      pages/index/index.js
  4. 56
      pages/index/index.wxml
  5. 53
      pages/kj/index.js
  6. 9
      pages/kj/index.wxml
  7. 2
      pages/kj/index.wxss
  8. 162
      pages/kj/info/index.js
  9. 16
      pages/kj/info/index.wxml
  10. 20
      pages/kj/mine/index.js
  11. 10
      pages/map/index.js
  12. 16
      pages/map/index.wxml
  13. 11
      pages/order/components/contact/index.js
  14. 15
      pages/order/components/date/index.js
  15. 6
      pages/order/components/date/index.wxml
  16. 55
      pages/order/pay/index.js
  17. 13
      pages/order/pay/index.wxml
  18. 8
      pages/order/pay/index.wxss
  19. 25
      pages/order/postOrder/index.js
  20. 2
      pages/order/postOrder/index.wxml
  21. 32
      pages/order/scene/index.js
  22. 9
      pages/order/scene/index.wxml
  23. 9
      pages/pbService/index.js
  24. 30
      pages/pbService/index.wxml
  25. 10
      project.private.config.json
  26. 4
      utils/https.js
  27. 14
      utils/util.js

8
pages/component/myCalendar/index.js

@ -1,5 +1,6 @@
// pages/component/myCalendar/index.js // pages/component/myCalendar/index.js
import util from "../../../utils/util" import util from "../../../utils/util"
let app = getApp()
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
@ -29,10 +30,12 @@ Component({
dateArr: [], dateArr: [],
isToday: 0, isToday: 0,
isTodayWeek: false, isTodayWeek: false,
todayIndex: 0 todayIndex: 0,
isKj:null
}, },
lifetimes: { lifetimes: {
attached: function() { attached: function() {
console.log(app.globalData)
let now = new Date(); let now = new Date();
let year = now.getFullYear(); let year = now.getFullYear();
let month = now.getMonth() + 1; let month = now.getMonth() + 1;
@ -40,7 +43,8 @@ Component({
this.setData({ this.setData({
year: year, year: year,
month: month, month: month,
isToday: '' + year + month + now.getDate() isToday: '' + year + month + now.getDate(),
isKj:app.globalData.kjId
}) })
let dates={} let dates={}
this.properties.datelist.map(item=>{ this.properties.datelist.map(item=>{

2
pages/component/myCalendar/index.wxml

@ -14,7 +14,7 @@
<view class='date-head{{(!dates[item.date] || dates[item.date].stock<=0 || dates[item.date].stock==null || dates[item.date].price==null)?" disable":""}}'> <view class='date-head{{(!dates[item.date] || dates[item.date].stock<=0 || dates[item.date].stock==null || dates[item.date].price==null)?" disable":""}}'>
<view>{{item.dateNum}}</view> <view>{{item.dateNum}}</view>
</view> </view>
<view class="date-tip" wx:if="{{dates[item.date] && dates[item.date].price!==null && dates[item.date].stock!=0 && dates[item.date].stock!==null}}">¥{{dates[item.date].price==0?'免费':(dates[item.date].price/100)}}</view> <view class="date-tip" wx:if="{{dates[item.date] && dates[item.date].price!==null && dates[item.date].stock!=0 && dates[item.date].stock!==null}}">¥{{dates[item.date].price==0 || isKj?'免费':(dates[item.date].price/100)}}</view>
<!-- <view class="date-tip disable" wx:if="{{dates[item.date] && (dates[item.date].stock==null || dates[item.date].price==null)}}">不可定</view> --> <!-- <view class="date-tip disable" wx:if="{{dates[item.date] && (dates[item.date].stock==null || dates[item.date].price==null)}}">不可定</view> -->
<view class="date-tip disable" wx:if="{{dates[item.date] && dates[item.date].stock==0}}">售罄</view> <view class="date-tip disable" wx:if="{{dates[item.date] && dates[item.date].stock==0}}">售罄</view>
<!-- <view class='date-weight'>{{item.weight}}</view> --> <!-- <view class='date-weight'>{{item.weight}}</view> -->

26
pages/index/index.js

@ -57,12 +57,22 @@ Page({
}) })
}, },
onTabItemTap:function(e){
console.log(e,99999999)
},
// 一城百馆 // 一城百馆
city:function(){ city:function(){
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx114d514f39cb1fed', appId: 'wx114d514f39cb1fed',
path:"pages/index/index" path:"pages/index/index"
}) })
commonApi._post("browse/burying_point",{
drive:"mini",
title:"一城百馆",
uuid:app.globalData.uuid
}).then(res=>{
})
}, },
changeHotIndex:function(e){ changeHotIndex:function(e){
this.setData({ this.setData({
@ -162,6 +172,15 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: e.currentTarget.dataset.path, 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){ gotoUrl:function(e){
let url = e.currentTarget.dataset.url; let url = e.currentTarget.dataset.url;
@ -191,6 +210,13 @@ Page({
appId: 'wx74f380bc721a0379', appId: 'wx74f380bc721a0379',
path:'/pages/listen/listen?title=君到苏州' path:'/pages/listen/listen?title=君到苏州'
}) })
commonApi._post("browse/burying_point",{
drive:"mini",
title:"语音导览",
uuid:app.globalData.uuid
}).then(res=>{
})
}, },
// 热门推荐 // 热门推荐
getList:function(){ getList:function(){

56
pages/index/index.wxml

@ -20,50 +20,50 @@
</block> </block>
</swiper> </swiper>
<view class="top-icons"> <view class="top-icons">
<view bindtap="gotoPath" data-path="/pages/list/activitynew/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="活动日历" data-path="/pages/list/activitynew/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon1.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon1.png" mode="widthFix"></image>
<view class="top-icon-text">活动日历</view> <view class="top-icon-text">活动日历</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/scene/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="景点门票" data-path="/pages/list/scene/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon3.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon3.png" mode="widthFix"></image>
<view class="top-icon-text">景点门票</view> <view class="top-icon-text">景点门票</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/hotel/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="酒店住宿" data-path="/pages/list/hotel/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon4.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon4.png" mode="widthFix"></image>
<view class="top-icon-text">酒店住宿</view> <view class="top-icon-text">酒店住宿</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/night/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="姑苏八点半" data-path="/pages/list/night/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon5.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon5.png" mode="widthFix"></image>
<view class="top-icon-text">姑苏八点半</view> <view class="top-icon-text">姑苏八点半</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/card/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="一卡游苏州" data-path="/pages/list/card/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon2.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon2.png" mode="widthFix"></image>
<view class="top-icon-text">一卡游苏州</view> <view class="top-icon-text">一卡游苏州</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/museum/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="场馆预约" data-path="/pages/list/museum/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon6.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon6.png" mode="widthFix"></image>
<view class="top-icon-text">场馆预约</view> <view class="top-icon-text">场馆预约</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/{{isTest?'scene':'feiyi'}}/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="非遗专卖" data-path="/pages/list/{{isTest?'scene':'feiyi'}}/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon7.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon7.png" mode="widthFix"></image>
<view class="top-icon-text">非遗专卖</view> <view class="top-icon-text">非遗专卖</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/{{isTest?'activity':'theatre'}}/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="剧场演出" data-path="/pages/list/{{isTest?'activity':'theatre'}}/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon8.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon8.png" mode="widthFix"></image>
<view class="top-icon-text">剧场演出</view> <view class="top-icon-text">剧场演出</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/{{isTest?'road':'techan'}}/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="文创特产" data-path="/pages/list/{{isTest?'road':'techan'}}/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon9.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon9.png" mode="widthFix"></image>
<view class="top-icon-text">文创特产</view> <view class="top-icon-text">文创特产</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/list/movieticket/index" class="top-icon-item"> <view bindtap="gotoPath" data-title="电影购票" data-path="/pages/list/movieticket/index" class="top-icon-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/icon10.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/icon10.png" mode="widthFix"></image>
<view class="top-icon-text">电影购票</view> <view class="top-icon-text">电影购票</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="sale-road-boxes"> <view class="sale-road-boxes">
<view class="sale-box" bindtap="gotoPath" data-path="/pages/list/{{isTest==false?'sale':'scene'}}/index" > <view class="sale-box" bindtap="gotoPath" data-title="限时特惠" data-path="/pages/list/{{isTest==false?'sale':'scene'}}/index" >
<view class="sale-title"><text>限时特惠</text>超值商品限时抢购</view> <view class="sale-title"><text>限时特惠</text>超值商品限时抢购</view>
<view class="sale-product" wx:if="{{saleProduct && isTest==false}}"> <view class="sale-product" wx:if="{{saleProduct && isTest==false}}">
<view class="sale-product-bg"></view> <view class="sale-product-bg"></view>
@ -87,7 +87,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="sale-box" bindtap="gotoPath" data-path="/pages/list/road/index"> <view class="sale-box" bindtap="gotoPath" data-title="精品线路" data-path="/pages/list/road/index">
<view class="sale-title"><text>精品线路</text>精品线路精心挑选</view> <view class="sale-title"><text>精品线路</text>精品线路精心挑选</view>
<view class="sale-product" wx:if="{{roadProduct}}"> <view class="sale-product" wx:if="{{roadProduct}}">
<view class="sale-product-bg road-product-bg"></view> <view class="sale-product-bg road-product-bg"></view>
@ -115,9 +115,9 @@
<image mode="widthFix" style="width:267rpx" src="https://static.ticket.sz-trip.com/xcxImages/index/title5.png"></image> <image mode="widthFix" style="width:267rpx" src="https://static.ticket.sz-trip.com/xcxImages/index/title5.png"></image>
</view> </view>
<view class="pic-list" style="margin-top:20rpx"> <view class="pic-list" style="margin-top:20rpx">
<image bindtap="gotoPath" data-path="/pages/list/{{isTest?'road':'food'}}/index" src="https://static.ticket.sz-trip.com/xcxImages/index/pic1.png" mode="aspectFill"></image> <image bindtap="gotoPath" data-title="街巷美食" data-path="/pages/list/{{isTest?'road':'food'}}/index" src="https://static.ticket.sz-trip.com/xcxImages/index/pic1.png" mode="aspectFill"></image>
<image bindtap="audioGuide" src="https://static.ticket.sz-trip.com/xcxImages/index/pic2.png" mode="aspectFill"></image> <image bindtap="audioGuide" src="https://static.ticket.sz-trip.com/xcxImages/index/pic2.png" mode="aspectFill"></image>
<image bindtap="gotoPath" data-path="/pages/list/strategy/index" src="https://static.ticket.sz-trip.com/xcxImages/index/pic3.png" mode="aspectFill"></image> <image bindtap="gotoPath" data-title="游记攻略" data-path="/pages/list/strategy/index" src="https://static.ticket.sz-trip.com/xcxImages/index/pic3.png" mode="aspectFill"></image>
<image bindtap="city" src="https://static.ticket.sz-trip.com/xcxImages/index/pic4.png" mode="aspectFill"></image> <image bindtap="city" src="https://static.ticket.sz-trip.com/xcxImages/index/pic4.png" mode="aspectFill"></image>
</view> </view>
<view class="sale-road-boxes" style="margin-top:0;align-items:center"> <view class="sale-road-boxes" style="margin-top:0;align-items:center">
@ -130,56 +130,56 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb1.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb1.png" mode="widthFix"></image>
<view>苏康码</view> <view>苏康码</view>
</view> --> </view> -->
<view bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=1" class="pbservice-item"> <view bindtap="gotoPath" data-title="找厕所" data-path="/pages/pbService/bike/index?type=1" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb2.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb2.png" mode="widthFix"></image>
<view>找厕所</view> <view>找厕所</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=2" class="pbservice-item"> <view bindtap="gotoPath" data-title="停车场" data-path="/pages/pbService/bike/index?type=2" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb3.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb3.png" mode="widthFix"></image>
<view>停车场</view> <view>停车场</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/pbService/security/index" class="pbservice-item"> <view bindtap="gotoPath" data-title="安全服务" data-path="/pages/pbService/security/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb4.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb4.png" mode="widthFix"></image>
<view>安全服务</view> <view>安全服务</view>
</view> </view>
<!-- <view bindtap="gotoPath" data-path="/pages/pbService/security/index" class="pbservice-item"> <!-- <view bindtap="gotoPath" data-title="景区舒适度" data-path="/pages/pbService/security/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb9.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb9.png" mode="widthFix"></image>
<view>景区舒适度</view> <view>景区舒适度</view>
</view> --> </view> -->
<view bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=0" class="pbservice-item"> <view bindtap="gotoPath" data-title="公共自行车" data-path="/pages/pbService/bike/index?type=0" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb10.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb10.png" mode="widthFix"></image>
<view>公共自行车</view> <view>公共自行车</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/pbService/library/index" class="pbservice-item"> <view bindtap="gotoPath" data-title="书香借阅" data-path="/pages/pbService/library/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb14.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb14.png" mode="widthFix"></image>
<view>书香借阅</view> <view>书香借阅</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/pbService/feiyi/index" class="pbservice-item"> <view bindtap="gotoPath" data-title="非遗传承" data-path="/pages/pbService/feiyi/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb5.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb5.png" mode="widthFix"></image>
<view>非遗传承</view> <view>非遗传承</view>
</view> </view>
<view bindtap="gotoUrl" data-url='https://hot-map.sz-trip.com/' class="pbservice-item"> <view bindtap="gotoUrl" data-title="投资导引图" data-url='https://hot-map.sz-trip.com/' class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb15.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb15.png" mode="widthFix"></image>
<view>投资导引图</view> <view>投资导引图</view>
</view> </view>
<!-- <view bindtap="gotoPath" data-path="/pages/pbService/wbdw/index" class="pbservice-item"> <!-- <view bindtap="gotoPath" data-title="文保单位" data-path="/pages/pbService/wbdw/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb6.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb6.png" mode="widthFix"></image>
<view>文保单位</view> <view>文保单位</view>
</view> --> </view> -->
<view bindtap="gotoPath" data-path="/pages/pbService/wwcx/index" class="pbservice-item"> <view bindtap="gotoPath" data-title="文物查询" data-path="/pages/pbService/wwcx/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb7.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb7.png" mode="widthFix"></image>
<view>文物查询</view> <view>文物查询</view>
</view> </view>
<view bindtap="gotoPath" data-path="/pages/pbService/appreciate/index" class="pbservice-item"> <view bindtap="gotoPath" data-title="在线鉴赏" data-path="/pages/pbService/appreciate/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb8.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb8.png" mode="widthFix"></image>
<view>在线鉴赏</view> <view>在线鉴赏</view>
</view> </view>
<!-- <view bindtap="gotoPath" data-path="/pages/pbService/gym/index" class="pbservice-item"> <!-- <view bindtap="gotoPath" data-title="体育场馆" data-path="/pages/pbService/gym/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb12.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb12.png" mode="widthFix"></image>
<view>体育场馆</view> <view>体育场馆</view>
</view> --> </view> -->
<view bindtap="garbage" class="pbservice-item"> <view bindtap="garbage" data-title="垃圾分类" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb11.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/index/pb11.png" mode="widthFix"></image>
<view>垃圾分类</view> <view>垃圾分类</view>
</view> </view>
@ -189,7 +189,7 @@
<image mode="widthFix" style="width:267rpx" src="https://static.ticket.sz-trip.com/xcxImages/index/title3.png"></image> <image mode="widthFix" style="width:267rpx" src="https://static.ticket.sz-trip.com/xcxImages/index/title3.png"></image>
</view> </view>
<view class="six-box"> <view class="six-box">
<image bindtap="gotoPath" data-path="/pages/list/six/index?area={{area_ids[index]}}" wx:for="{{10}}" src="https://static.ticket.sz-trip.com/xcxImages/index/six{{index+1}}.png" mode="widthFix"></image> <image bindtap="gotoPath" data-title="苏城六纪" data-path="/pages/list/six/index?area={{area_ids[index]}}" wx:for="{{10}}" src="https://static.ticket.sz-trip.com/xcxImages/index/six{{index+1}}.png" mode="widthFix"></image>
</view> </view>
<view class="sale-road-boxes" style="margin-top:0"> <view class="sale-road-boxes" style="margin-top:0">
<image mode="widthFix" style="width:267rpx" src="https://static.ticket.sz-trip.com/xcxImages/index/title4.png"></image> <image mode="widthFix" style="width:267rpx" src="https://static.ticket.sz-trip.com/xcxImages/index/title4.png"></image>

53
pages/kj/index.js

@ -64,7 +64,6 @@ Page({
let data = e.currentTarget.dataset,that = this; let data = e.currentTarget.dataset,that = this;
if(data.index || data.index==0){ if(data.index || data.index==0){
let item = this.data.list[data.index]; let item = this.data.list[data.index];
console.log(item)
// 已砍成已下单 // 已砍成已下单
if(item.buy_status=='end'){ if(item.buy_status=='end'){
wx.showModal({ wx.showModal({
@ -73,7 +72,7 @@ Page({
confirmColor:"#e14135", confirmColor:"#e14135",
success:function(res){ success:function(res){
if(res.confirm){ if(res.confirm){
that.gotoProduct(item.goods_id) that.gotoProduct(item)
} }
} }
}) })
@ -81,34 +80,20 @@ Page({
} }
// 已砍成未下单 // 已砍成未下单
if(item.buy_status=='over'){ if(item.buy_status=='over'){
app.globalData.kjId = item.buy_id;
// todo // todo
util.goKjOrder(item).then(product=>{ app.globalData.kjId = item.buy_id;
app.globalData.couponInfo = null; that.gotoProduct(item)
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',
})
}
})
return; return;
} }
// 已售罄 // 已售罄
if(item.act_stock<=0){ if(item.remain_num<=0){
wx.showModal({ wx.showModal({
title:"提示", title:"提示",
content:"此商品已售罄,是否原价购买", content:"此商品已售罄,是否原价购买",
confirmColor:"#e14135", confirmColor:"#e14135",
success:function(res){ success:function(res){
if(res.confirm){ 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 url:"info/index?id="+data.id+"&sid="+data.sid+"&aid="+data.aid
}) })
}, },
gotoProduct:function(id){ gotoProduct:function(item){
productApi._post("product/get_product_detail",{ util.goKjOrder(item).then(product=>{
id:id app.globalData.couponInfo = null;
}).then(res=>{ if(item.type=='post'){
util.gotoDetail(res.data) 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(){ getMine:function(){
@ -152,6 +147,8 @@ Page({
res.data.data.map(item=>{ res.data.data.map(item=>{
item.showMoreFlag = false; item.showMoreFlag = false;
item.showList = item.product.slice(0,2); 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({ this.setData({
nextList:this.data.nextList.concat(res.data.data), nextList:this.data.nextList.concat(res.data.data),
@ -181,10 +178,10 @@ Page({
let index = e.currentTarget.dataset.index,nextList=this.data.nextList; let index = e.currentTarget.dataset.index,nextList=this.data.nextList;
nextList[index].showMoreFlag = !nextList[index].showMoreFlag; nextList[index].showMoreFlag = !nextList[index].showMoreFlag;
if(nextList[index].showMoreFlag){ if(nextList[index].showMoreFlag){
item.showList = item.product; nextList[index].showList = nextList[index].product;
} }
else { else {
item.showList = item.product.slice(0,2); nextList[index].showList = nextList[index].product.slice(0,2);
} }
this.setData({ this.setData({
nextList:nextList nextList:nextList
@ -299,7 +296,7 @@ Page({
*/ */
onReachBottom: function () { onReachBottom: function () {
if(this.data.type==1){ if(this.data.type==1){
this.getList() // this.getList()
} }
else { else {
this.getNext() this.getNext()

9
pages/kj/index.wxml

@ -4,6 +4,7 @@
<view class="top-menu{{type==1?' active':''}}" bindtap="changeType" data-type="1">进行中</view> <view class="top-menu{{type==1?' active':''}}" bindtap="changeType" data-type="1">进行中</view>
<view class="top-menu{{type==2?' active':''}}" bindtap="changeType" data-type="2">活动预热</view> <view class="top-menu{{type==2?' active':''}}" bindtap="changeType" data-type="2">活动预热</view>
</view> </view>
<view style="height:90rpx"></view>
<view class="list" wx:if="{{type==1}}"> <view class="list" wx:if="{{type==1}}">
<view class="top-line-box">我参与的活动</view> <view class="top-line-box">我参与的活动</view>
<navigator class="item" wx:for="{{mineList}}" wx:key="id" url="info/index?userid={{item.user_id}}&id={{item.act_product_id}}"> <navigator class="item" wx:for="{{mineList}}" wx:key="id" url="info/index?userid={{item.user_id}}&id={{item.act_product_id}}">
@ -37,10 +38,10 @@
<view class="item-price">¥{{item.kj_money/100}}</view> <view class="item-price">¥{{item.kj_money/100}}</view>
</view> </view>
<view class="item-info-bottom"> <view class="item-info-bottom">
<view class="item-info-time">剩余库存:{{item.act_stock}}</view> <view class="item-info-time">剩余库存:{{item.remain_num}}</view>
<view class="info-btn disable" wx:if="{{item.buy_status=='end'}}">已购买</view> <view class="info-btn disable" wx:if="{{item.buy_status=='end'}}">已购买</view>
<view class="info-btn" wx:elif="{{item.buy_status=='over'}}">前往下单</view> <view class="info-btn" wx:elif="{{item.buy_status=='over'}}">前往下单</view>
<view class="info-btn disable" wx:elif="{{item.act_stock==0}}">售罄</view> <view class="info-btn disable" wx:elif="{{item.remain_num==0}}">售罄</view>
<view class="info-btn" wx:else>砍价免费领</view> <view class="info-btn" wx:else>砍价免费领</view>
</view> </view>
</view> </view>
@ -51,7 +52,7 @@
</view> </view>
</view> </view>
<view class="list" wx:if="{{type==2}}" wx:for="{{nextList}}" wx:key="id"> <view class="list" wx:if="{{type==2}}" wx:for="{{nextList}}" wx:key="id">
<view class="top-line-box">{{item.act_name}}</view> <view class="top-line-box">{{item.timeText}}</view>
<view wx:for="{{item.showList}}" wx:key="id" style="border-radius:20rpx !important" class="item" bindtap="nextShowInfo"> <view wx:for="{{item.showList}}" wx:key="id" style="border-radius:20rpx !important" class="item" bindtap="nextShowInfo">
<view class="item-top"> <view class="item-top">
<image src="{{item.headimg}}" mode="aspectFill"></image> <image src="{{item.headimg}}" mode="aspectFill"></image>
@ -67,7 +68,7 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{item.showList.length>2}}" class="morebtn" bindtap="showMore" data-index="{{index}}">{{item.showMoreFlag?'点击收起':'点击查看更多'}}</view> <view wx:if="{{item.product.length>2}}" class="morebtn" bindtap="showMore" data-index="{{index}}">{{item.showMoreFlag?'点击收起':'点击查看更多'}}</view>
<view wx:if="{{nextList.length==0}}" style="font-size:24rpx;color:#fff;text-align:center;line-height:100rpx">暂无活动</view> <view wx:if="{{nextList.length==0}}" style="font-size:24rpx;color:#fff;text-align:center;line-height:100rpx">暂无活动</view>
</view> </view>
<navigator url="mine/index" class="mine-btn"> <navigator url="mine/index" class="mine-btn">

2
pages/kj/index.wxss

@ -93,7 +93,7 @@ page {
color: #fff; color: #fff;
} }
.list { .list {
padding-top: 80rpx; padding-top: 0;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.item-bottom { .item-bottom {

162
pages/kj/info/index.js

@ -24,46 +24,39 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
// 获取用户信息 后面的砍价接口和发起活动接口需要用到 // 获取用户信息 后面的砍价接口和发起活动接口需要用到
let that = this;
productApi.user_post("uservice/user/getMyInfo",{}).then(r=>{ productApi.user_post("uservice/user/getMyInfo",{}).then(r=>{
this.setData({ this.setData({
userInfo:r.data userInfo:r.data
}) })
let userid = r.data.id,service="activity.haggle/get_haggle_detail"; let userid = r.data.id,service="activity.haggle/get_haggle_detail";
// 如果不是当前用户并且打开了分享的页面的话 是砍价页面 productApi.user_post(service+'?id='+options.id+(options.originate_id?('&originate_id='+options.originate_id):''),{
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
}).then(res=>{ }).then(res=>{
if(!res.data.user_record || !res.data.user_record.id){ if(!res.data.user_record || !res.data.user_record.id){
res.data.user_record = { res.data.user_record = {
bargined_money:0 bargined_money:0
} }
} }
if(res.data.originate && res.data.originate.id && options.originate_id){
res.data.user_record = res.data.originate;
}
this.setData({ this.setData({
kjId:res.data.user_record.id kjId:res.data.user_record.id
}) })
// 判断是否助力过
res.data.isHelp = false;
if(res.data.myHelpKj && res.data.myHelpKj.id){
res.data.isHelp = true;
}
this.setData({ this.setData({
info:res.data 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){ if(res.data.user_record.id && res.data.user_record.over_time){
// 获取砍价记录 // 获取砍价记录
@ -80,12 +73,7 @@ Page({
timer = setInterval(()=>{ timer = setInterval(()=>{
this.setTime() this.setTime()
},1000) },1000)
// 判断是否是自己发起的活动
if(res.data.user_record.user_id==userid){
this.setData({
isKj:false
})
}
if(this.data.isKj){ if(this.data.isKj){
// 发起者状态是砍价完成,提示用户:我已经砍价完成了,你也快来试试吧,点击否停留当前页面,点击是,跳转砍价专区 // 发起者状态是砍价完成,提示用户:我已经砍价完成了,你也快来试试吧,点击否停留当前页面,点击是,跳转砍价专区
if(res.data.user_record.flag=='over'){ 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({ wx.showModal({
title:"提示", title:"提示",
content:res.data.user_record.user_phone+"发起的砍价活动已结束,你也快来试试吧", content:res.data.user_record.user_name+"发起的砍价活动已结束,你也快来试试吧",
success:function(r){ success:function(r){
if(r.confirm){ if(r.confirm){
wx.redirectTo({ 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 () { 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(); this.setTime();
timer = setInterval(()=>{ timer = setInterval(()=>{
this.setTime() this.setTime()
@ -216,6 +222,7 @@ Page({
// 详情和下单的第一步 // 详情和下单的第一步
gotoDetail:function(e){ gotoDetail:function(e){
let info = this.data.info.detail || null,type=e?e.currentTarget.dataset.type:null; let info = this.data.info.detail || null,type=e?e.currentTarget.dataset.type:null;
let that = this;
if(!info) return; if(!info) return;
if(type=='fail'){ if(type=='fail'){
wx.showModal({ wx.showModal({
@ -224,85 +231,68 @@ Page({
confirmColor:"#E14135", confirmColor:"#E14135",
success:function(res){ success:function(res){
if(res.confirm){ if(res.confirm){
this.gotoProduct() that.pushOrderData(null)
} }
} }
}) })
} }
else if(type=='none'){
this.pushOrderData(null)
}
else { else {
this.gotoProduct() this.pushOrderData(this.data.info.user_record.id)
} }
}, },
// 真实的获取产品信息去下单 // 真实的获取产品信息去下单
pushOrderData:function(){ pushOrderData:function(kjId){
productApi._get('productfront/getProductInfo',{ app.globalData.kjId = kjId;
productId:this.data.info.baseInfo.productId app.globalData.couponInfo = null;
}).then(res=>{ util.goKjOrder(this.data.info.detail).then(product=>{
if(!res.data){ if(this.data.info.detail.type=='post'){
wx.showToast({ app.globalData.postProduct = product;
title:"该产品不存在或已下架", wx.navigateTo({
icon:'none' 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'
}) })
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 { else if(this.data.info.detail.type=='ticket' || this.data.info.detail.type=='scene'){
app.globalData.kjOrderId = null; app.globalData.product = product[0];
}
app.globalData.discounts = 0;
wx.navigateTo({ wx.navigateTo({
url: '../../order/index', url: '/pages/order/scene/index',
}) })
}
}) })
}, },
// 帮好友砍一刀 // 帮好友砍一刀
kanjia:function(){ kanjia:function(){
if(!this.data.isFollow){ // if(!this.data.isFollow){
// 未关注需要先关注公众号 // // 未关注需要先关注公众号
this.setData({ // this.setData({
showShareFlag:true // showShareFlag:true
}) // })
return; // return;
} // }
let userInfo = this.data.userInfo,info = this.data.info; let userInfo = this.data.userInfo,info = this.data.info;
productApi.user_post("activity.haggle/help_bargain",{ productApi.user_post("activity.haggle/help_bargain",{
originate_id:info.user_record.id originate_id:info.user_record.id
}).then(res=>{ }).then(res=>{
if(res.code==200){ if(res.code==1){
wx.showToast({ wx.showToast({
title: '砍价成功', title: '砍价成功',
icon:'success' 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(){ startKj:function(){
if(!this.data.isFollow){ // if(!this.data.isFollow){
// 未关注需要先关注公众号 // // 未关注需要先关注公众号
this.setData({ // this.setData({
showShareFlag:true // showShareFlag:true
}) // })
return; // return;
} // }
let info = this.data.info; let info = this.data.info;
let userInfo = this.data.userInfo; let userInfo = this.data.userInfo;
productApi.user_post('activity.haggle/bargain_launch',{ productApi.user_post('activity.haggle/bargain_launch',{
@ -324,7 +314,7 @@ Page({
}, },
// 我也要参与 // 我也要参与
join:function(){ 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 () { onShareAppMessage: function () {
let kjId = this.data.kjId,info = this.data.info; let kjId = this.data.kjId,info = this.data.info;
let shareObj = { let shareObj = {
title: kjId?"就差你这一刀了,快来帮帮我~":(info.detail.productName+info.detail.skuName), // 默认是小程序的名称(可以写slogan等) title: kjId?"就差你这一刀了,快来帮帮我~":(info.detail.title+info.detail.sku_name), // 默认是小程序的名称(可以写slogan等)
path: kjId?('/pages/kj/info/index?userid='+info.user_record.user_id+'&id='+kjId):('/pages/kj/info/index?&id='+info.detail.id), // 默认是当前页面,必须是以‘/’开头的完整路径 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.baseInfo.headImg, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 imageUrl: info.detail.headimg, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function(res){ success: function(res){
// 转发成功之后的回调 // 转发成功之后的回调
if(res.errMsg == 'shareAppMessage:ok'){ if(res.errMsg == 'shareAppMessage:ok'){

16
pages/kj/info/index.wxml

@ -1,7 +1,7 @@
<!--pages/kj/info/index.wxml--> <!--pages/kj/info/index.wxml-->
<title title="砍价详情"></title> <title title="砍价详情"></title>
<view class="content" wx:if="{{info}}"> <view class="content" wx:if="{{info}}">
<view class="top-info" wx:if="{{info.user_record && info.user_record.over_time && info.isOver}}"> <view class="top-info" wx:if="{{info.user_record && info.user_record.over_time && info.isOver || info.user_record && info.user_record.flag=='over'}}">
<image src="{{info.user_record.avatar}}" mode="aspectFill"></image> <image src="{{info.user_record.avatar}}" mode="aspectFill"></image>
<view class="time-tip time-tip1" style="margin-left:0">已结束</view> <view class="time-tip time-tip1" style="margin-left:0">已结束</view>
<view class="rule-box" bindtap="showRule">活动规则</view> <view class="rule-box" bindtap="showRule">活动规则</view>
@ -47,22 +47,22 @@
<view class="info-btn-kan" bindtap="startKj">发起活动,喊好友砍一刀</view> <view class="info-btn-kan" bindtap="startKj">发起活动,喊好友砍一刀</view>
</view> </view>
<view class="faqi-tip">点击上方“发起活动”按钮,邀请好友来砍价!</view> <view class="faqi-tip">点击上方“发起活动”按钮,邀请好友来砍价!</view>
<view class="buy-tip" bindtap="gotoDetail">原价购买 >></view> <view class="buy-tip" bindtap="gotoDetail" data-type="none">原价购买 >></view>
</view> </view>
<!-- 砍价已发起未结束的时候 --> <!-- 砍价已发起未结束的时候 -->
<view wx:if="{{isKj==false && info.user_record && info.user_record.flag=='ing'}}"> <view wx:if="{{isKj==false && info.user_record && info.user_record.flag=='ing'}}">
<view class="info-btns" style="border:none"> <view class="info-btns" style="border:none">
<button class="info-btn-kan" open-type="share">喊好友砍一刀</button> <button class="info-btn-kan" open-type="share">喊好友砍一刀</button>
</view> </view>
<view class="faqi-tip" wx:if="{{info.detail.alert_num}}">预计再邀请<text style="color:#E14135;font-size:30rpx;font-weight:bold;margin:0 5rpx">{{info.detail.alert_num}}</text>人后砍价完成</view> <view class="faqi-tip" wx:if="{{info.detail.success_need_num}}">预计再邀请<text style="color:#E14135;font-size:30rpx;font-weight:bold;margin:0 5rpx">{{info.detail.success_need_num}}</text>人后砍价完成</view>
<view class="buy-tip" bindtap="gotoDetail">原价购买 >></view> <view class="buy-tip" bindtap="gotoDetail" data-type="none">原价购买 >></view>
</view> </view>
<!-- 帮好友砍价前 --> <!-- 帮好友砍价前 -->
<view class="info-btns" style="border:none" wx:if="{{isKj && info.isHelp==false}}"> <view class="info-btns" style="border:none" wx:if="{{isKj && info.help_user==false}}">
<view class="info-btn-kan" bindtap="kanjia">帮好友砍一刀</view> <view class="info-btn-kan" bindtap="kanjia">帮好友砍一刀</view>
</view> </view>
<!-- 帮好友砍价后 --> <!-- 帮好友砍价后 -->
<view wx:if="{{isKj && info.isHelp}}" class="info-btns" style="border:none;background: rgba(255, 145, 36, 0.3);"> <view wx:if="{{isKj && info.help_user}}" class="info-btns" style="border:none;background: rgba(255, 145, 36, 0.3);">
<view class="info-disable-btn" style="background: linear-gradient(0deg, #E14135, #FF9124);">已帮好友砍价!</view> <view class="info-disable-btn" style="background: linear-gradient(0deg, #E14135, #FF9124);">已帮好友砍价!</view>
<view class="info-btn" bindtap="join">我也要参与 >></view> <view class="info-btn" bindtap="join">我也要参与 >></view>
</view> </view>
@ -86,7 +86,7 @@
</view> </view>
<view class="kanjia-list"> <view class="kanjia-list">
<view class="kanjia-item" wx:for="{{helpList}}"> <view class="kanjia-item" wx:for="{{helpList}}">
<image src="{{item.helpUserAvatar}}" mode="aspectFill"></image> <image src="{{item.avatar}}" mode="aspectFill"></image>
<view class="username">{{item.help_user_name}}</view> <view class="username">{{item.help_user_name}}</view>
<view class="userprice">-¥{{item.bargined_money/100}}</view> <view class="userprice">-¥{{item.bargined_money/100}}</view>
</view> </view>
@ -96,7 +96,7 @@
<view class="mask" wx:if="{{info && showRuleFlag}}"> <view class="mask" wx:if="{{info && showRuleFlag}}">
<view class="mask-bg" bindtap="showRule"></view> <view class="mask-bg" bindtap="showRule"></view>
<view class="mask-content" style="padding:20rpx;max-height:50%;overflow-y:auto;min-height:30%;"> <view class="mask-content" style="padding:20rpx;max-height:50%;overflow-y:auto;min-height:30%;">
<rich-text nodes="{{info.act.rule_content}}"></rich-text> <rich-text nodes="{{info.detail.act.rule_content}}"></rich-text>
</view> </view>
</view> </view>
<view class="mask" wx:if="{{showShareFlag}}"> <view class="mask" wx:if="{{showShareFlag}}">

20
pages/kj/mine/index.js

@ -96,11 +96,21 @@ Page({
}, },
goProduct:function(e){ goProduct:function(e){
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
console.log(item); app.globalData.kjId = item.id;
productApi._post('product/get_product_detail',{ app.globalData.couponInfo = null;
id:item.goods_id util.goKjOrder(item).then(product=>{
}).then(res=>{ if(item.type=='post'){
util.gotoDetail(res.data); 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){ goOrder:function(e){

10
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; let height = (rect.top - systemInfo.statusBarHeight) * 2 + rect.height + systemInfo.statusBarHeight;
import commonApi from "../../utils/https/common" import commonApi from "../../utils/https/common"
import util from "../../utils/util" import util from "../../utils/util"
let app = getApp();
Page({ Page({
/** /**
@ -387,6 +388,15 @@ Page({
info:null info:null
}) })
this.getList() 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){ changeArea:function(e){
this.setData({ this.setData({

16
pages/map/index.wxml

@ -10,35 +10,35 @@
</view> </view>
</picker> </picker>
<view class="right-menus" style="top:{{seachHeight}}px"> <view class="right-menus" style="top:{{seachHeight}}px">
<view class="right-menu-item{{type==1?' active':''}}" bindtap="changeType" data-type="1"> <view class="right-menu-item{{type==1?' active':''}}" bindtap="changeType" data-title="景点" data-type="1">
<text style="color:#0A9947" class="iconfont icon-location"></text> <text style="color:#0A9947" class="iconfont icon-location"></text>
<text>景点</text> <text>景点</text>
</view> </view>
<view class="right-menu-item{{type==2?' active':''}}" bindtap="changeType" data-type="2"> <view class="right-menu-item{{type==2?' active':''}}" bindtap="changeType" data-title="场馆" data-type="2">
<text style="color:#3D77D8" class="iconfont icon-location"></text> <text style="color:#3D77D8" class="iconfont icon-location"></text>
<text>场馆</text> <text>场馆</text>
</view> </view>
<view wx:if="{{isTest==false}}" class="right-menu-item{{type==3?' active':''}}" bindtap="changeType" data-type="3"> <view wx:if="{{isTest==false}}" class="right-menu-item{{type==3?' active':''}}" data-title="特产" bindtap="changeType" data-type="3">
<text style="color:#C02C2C" class="iconfont icon-location"></text> <text style="color:#C02C2C" class="iconfont icon-location"></text>
<text>特产</text> <text>特产</text>
</view> </view>
<view wx:if="{{isTest==false}}" class="right-menu-item{{type==4?' active':''}}" bindtap="changeType" data-type="4"> <view wx:if="{{isTest==false}}" class="right-menu-item{{type==4?' active':''}}" data-title="美食" bindtap="changeType" data-type="4">
<text style="color:#EE641B" class="iconfont icon-location"></text> <text style="color:#EE641B" class="iconfont icon-location"></text>
<text>美食</text> <text>美食</text>
</view> </view>
<view class="right-menu-item{{type==5?' active':''}}" bindtap="changeType" data-type="5"> <view class="right-menu-item{{type==5?' active':''}}" bindtap="changeType" data-title="文物" data-type="5">
<text style="color:#00B3C8" class="iconfont icon-location"></text> <text style="color:#00B3C8" class="iconfont icon-location"></text>
<text>文物</text> <text>文物</text>
</view> </view>
<view class="right-menu-item{{type==7?' active':''}}" bindtap="changeType" data-type="7"> <view class="right-menu-item{{type==7?' active':''}}" bindtap="changeType" data-title="影院" data-type="7">
<text style="color:#9342CB" class="iconfont icon-location"></text> <text style="color:#9342CB" class="iconfont icon-location"></text>
<text>影院</text> <text>影院</text>
</view> </view>
<view class="right-menu-item{{type==6?' active':''}}" bindtap="changeType" data-type="6"> <view class="right-menu-item{{type==6?' active':''}}" bindtap="changeType" data-title="运河十景" data-type="6">
<text style="color:#EB3C70" class="iconfont icon-location"></text> <text style="color:#EB3C70" class="iconfont icon-location"></text>
<text>运河十景</text> <text>运河十景</text>
</view> </view>
<view class="right-menu-item{{type==8?' active':''}}" bindtap="changeType" data-type="8"> <view class="right-menu-item{{type==8?' active':''}}" bindtap="changeType" data-title="江南小书场" data-type="8">
<text style="color:#9d6b00" class="iconfont icon-location"></text> <text style="color:#9d6b00" class="iconfont icon-location"></text>
<text>江南小书场</text> <text>江南小书场</text>
</view> </view>

11
pages/order/components/contact/index.js

@ -220,10 +220,21 @@ Component({
icon:'none' icon:'none'
}) })
} }
else if(app.globalData.kjId && num==1){
wx.showToast({
title: '最多只能选择一个出行人',
icon:'none'
})
}
else if(item.id==linkman.id){ else if(item.id==linkman.id){
linkman.selected = item.selected==1?0:1; linkman.selected = item.selected==1?0:1;
if(linkman.selected){
num++; num++;
} }
else {
num--;
}
}
}) })
this.setData({ this.setData({
linkmanList:linkmanList linkmanList:linkmanList

15
pages/order/components/date/index.js

@ -28,11 +28,15 @@ Component({
moreFlag:true, moreFlag:true,
timelist:[], timelist:[],
timeIndex:0, timeIndex:0,
isSzMuseum:false isSzMuseum:false,
kjIdCom:null
}, },
lifetimes: { lifetimes: {
attached: function() { 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)); 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){ if(product.product.title.indexOf("苏州博物馆")!=-1){
@ -75,6 +79,13 @@ Component({
// 在组件实例被从页面节点树移除时执行 // 在组件实例被从页面节点树移除时执行
}, },
}, },
pageLifetimes:{
show:function(){
this.setData({
kjIdCom:app.globalData.kjId
})
}
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */

6
pages/order/components/date/index.wxml

@ -4,7 +4,7 @@
<view class="dates-boxes"> <view class="dates-boxes">
<view bindtap="changeDate" data-date="{{item}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for="{{threeDays}}"> <view bindtap="changeDate" data-date="{{item}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for="{{threeDays}}">
<view>{{item.date}}</view> <view>{{item.date}}</view>
<view class="price" wx:if="{{item.stock!=0 && item.stock!=null && item.price!=null}}">{{item.price==0?'免费':('¥'+item.price/100)}}</view> <view class="price" wx:if="{{item.stock!=0 && item.stock!=null && item.price!=null}}">{{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}}</view>
<!-- <view class="price" wx:if="{{item.stock==null || item.price==null}}">不可定</view> --> <!-- <view class="price" wx:if="{{item.stock==null || item.price==null}}">不可定</view> -->
<view class="price" wx:if="{{item.stock==0}}">售罄</view> <view class="price" wx:if="{{item.stock==0}}">售罄</view>
</view> </view>
@ -21,7 +21,7 @@
</view> </view>
<view wx:else class="date-item more-item active" bindtap="showMoreDate"> <view wx:else class="date-item more-item active" bindtap="showMoreDate">
<view>{{activeDate.short_date}}</view> <view>{{activeDate.short_date}}</view>
<view class="price">{{activeDate.price==0?'免费':('¥'+activeDate.price/100)}}</view> <view class="price">{{activeDate.price==0 || kjIdCom?'免费':('¥'+activeDate.price/100)}}</view>
</view> </view>
</view> </view>
<view class="date-times" wx:if="{{timelist.length>0}}"> <view class="date-times" wx:if="{{timelist.length>0}}">
@ -35,6 +35,6 @@
<view class="mask" wx:if="{{showMoreDateFlag}}" style="z-index:101"> <view class="mask" wx:if="{{showMoreDateFlag}}" style="z-index:101">
<view class="mask-bg" bindtap="hideCalendar"></view> <view class="mask-bg" bindtap="hideCalendar"></view>
<view class="calendar-content"> <view class="calendar-content">
<calendar activeDay="{{activeDate.date}}" id="calendar" datelist="{{datelist}}" calendarConfig="{{calendarConfig}}" bind:afterCalendarRender="calendarReady" bind:onTapDay="onTapDay" bind:afterTapDay="afterTapDay"></calendar> <calendar activeDay="{{activeDate.date}}" kjId="{{kjIdCom}}" id="calendar" datelist="{{datelist}}" calendarConfig="{{calendarConfig}}" bind:afterCalendarRender="calendarReady" bind:onTapDay="onTapDay" bind:afterTapDay="afterTapDay"></calendar>
</view> </view>
</view> </view>

55
pages/order/pay/index.js

@ -11,7 +11,8 @@ Page({
id:null, id:null,
info:null, info:null,
second:"00", second:"00",
minute:"00" minute:"00",
payIndex:-1
}, },
/** /**
@ -39,19 +40,29 @@ Page({
this.daojishi(time); this.daojishi(time);
},1000) },1000)
}, },
// 选择支付方式
changePayMethod:function(e){
let index = e.currentTarget.dataset.index;
this.setData({
payIndex:index
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
payList:[]
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
commonApi.user_post("subwallet.ermb/wallet",{}).then(res=>{
this.setData({
payList:res.data
})
})
commonApi.user_post("order/query",{ commonApi.user_post("order/query",{
order_id:this.data.id order_id:this.data.id
}).then(res=>{ }).then(res=>{
@ -120,6 +131,42 @@ Page({
console.log(res) 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"
})
}
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏

13
pages/order/pay/index.wxml

@ -10,10 +10,17 @@
</view> </view>
<view class="pay-methods-box"> <view class="pay-methods-box">
<view>支付方式:</view> <view>支付方式:</view>
<view class="pay-method"> <view class="pay-method" bindtap="changePayMethod" data-index="-1">
<view class="iconfont icon-weixin1"></view> <view class="iconfont icon-weixin1"></view>
<view class="method-name">微信支付</view> <view class="method-name">微信支付</view>
<view class="iconfont icon-iconfontoptionbutton"></view> <view class="iconfont {{payIndex==-1?'icon-iconfontoptionbutton':'icon-quan'}}"></view>
</view> </view>
<view class="pay-method" wx:for="{{payList}}" style="border-top:1rpx solid #ccc" bindtap="changePayMethod" data-index="{{index}}">
<image src="{{item.bank_logo}}" mode="aspectFill"></image>
<!-- <view class="iconfont icon-weixin1"></view> -->
<view class="method-name">{{item.bank_name}}</view>
<view class="iconfont {{payIndex==index?'icon-iconfontoptionbutton':'icon-quan'}}"></view>
</view> </view>
<view class="btn" bindtap="pay">立即付款</view> </view>
<view class="btn" bindtap="pay" wx:if="{{payIndex==-1}}">立即付款</view>
<view class="btn" bindtap="walletPay" wx:else>立即付款</view>

8
pages/order/pay/index.wxss

@ -44,7 +44,7 @@ page {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 20rpx; padding: 20rpx 0;
} }
.pay-method .method-name { .pay-method .method-name {
margin: 0 20rpx; margin: 0 20rpx;
@ -60,3 +60,9 @@ page {
.icon-iconfontoptionbutton { .icon-iconfontoptionbutton {
font-size: 32rpx; font-size: 32rpx;
} }
.pay-method image {
width: 72rpx;
height: 72rpx;
display: block;
flex-shrink: 0;
}

25
pages/order/postOrder/index.js

@ -26,19 +26,22 @@ Page({
kjId:app.globalData.kjId kjId:app.globalData.kjId
}) })
let price = 0,sku_id=[]; let price = 0,sku_id=[];
console.log(app.globalData.kjId)
app.globalData.postProduct.map(item=>{ app.globalData.postProduct.map(item=>{
if(app.globalData.kjId){ if(!app.globalData.kjId){
item.sku.price = 0;
}
price = price + item.sku.price * item.productNum; price = price + item.sku.price * item.productNum;
}
sku_id.push(item.sku.id) sku_id.push(item.sku.id)
}) })
this.setData({ this.setData({
product:app.globalData.postProduct, product:app.globalData.postProduct,
showPrice:price, showPrice:app.globalData.kjId?0:price,
sku_id:sku_id.join(",") sku_id:sku_id.join(",")
}) })
if(!this.data.kjId){
this.couponCom = this.selectAllComponents("#coupon")[0]; this.couponCom = this.selectAllComponents("#coupon")[0];
}
}, },
inputRemark:function(e){ inputRemark:function(e){
let index = e.currentTarget.dataset.index,product = this.data.product; let index = e.currentTarget.dataset.index,product = this.data.product;
@ -87,13 +90,15 @@ Page({
icon: 'none' icon: 'none'
}) })
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
if(!this.data.kjId){
this.couponCom.setNullCoupon() this.couponCom.setNullCoupon()
}
this.setData({ this.setData({
coupon:null coupon:null
}) })
} }
this.setData({ this.setData({
showPrice:price showPrice:app.globalData.kjId?0:price
}) })
}, },
order:function(){ order:function(){
@ -125,7 +130,13 @@ Page({
commonApi.user_post("order/create",{ commonApi.user_post("order/create",{
data:JSON.stringify(data) data:JSON.stringify(data)
}).then(res=>{ }).then(res=>{
console.log(res) if(app.globalData.kjId){
app.globalData.kjId = null;
this.setData({
kjId:null
})
this.onLoad({})
}
}) })
}, },
getPostFee:function(){ getPostFee:function(){
@ -162,7 +173,9 @@ Page({
icon: 'none' icon: 'none'
}) })
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
if(!this.data.kjId){
this.couponCom.setNullCoupon() this.couponCom.setNullCoupon()
}
this.setData({ this.setData({
coupon:null coupon:null
}) })

2
pages/order/postOrder/index.wxml

@ -37,7 +37,7 @@
小计:<text class="unit">¥</text><text class="s-price">{{item.sku.price/100 * item.productNum}}</text> 小计:<text class="unit">¥</text><text class="s-price">{{item.sku.price/100 * item.productNum}}</text>
</view> </view>
</view> </view>
<coupon id="coupon" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon> <coupon id="coupon" wx:if="{{!kjId}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<view style="height:113rpx"></view> <view style="height:113rpx"></view>
<view class="fixed-bottom" wx:if="{{product}}"> <view class="fixed-bottom" wx:if="{{product}}">
<view class="fixed-price-box"><text>合计:</text><text class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text></view> <view class="fixed-price-box"><text>合计:</text><text class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text></view>

32
pages/order/scene/index.js

@ -17,7 +17,8 @@ Page({
singlePrice:0, singlePrice:0,
type:null, type:null,
coupon:app.globalData.couponInfo, coupon:app.globalData.couponInfo,
isLogin:false isLogin:false,
kjId:null
}, },
/** /**
@ -25,18 +26,20 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
type:options.type type:options.type,
kjId:app.globalData.kjId
}) })
if(!app.globalData.product){ if(!app.globalData.product){
util.back(); util.back();
return; return;
} }
console.log(app.globalData.product)
this.setData({ this.setData({
product:app.globalData.product, product:app.globalData.product,
singlePrice:app.globalData.product.sku.price singlePrice:app.globalData.product.sku.price
}) })
if(!this.data.kjId){
this.couponCom = this.selectAllComponents("#coupon")[0]; this.couponCom = this.selectAllComponents("#coupon")[0];
}
}, },
setLinkman:function(e){ setLinkman:function(e){
let linkmanList = e.detail; let linkmanList = e.detail;
@ -45,7 +48,9 @@ Page({
title: '订单价格发生变化,请重新选择优惠券', title: '订单价格发生变化,请重新选择优惠券',
icon: 'none' icon: 'none'
}) })
if(!this.data.kjId){
this.couponCom.setNullCoupon() this.couponCom.setNullCoupon()
}
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
this.setData({ this.setData({
coupon:null coupon:null
@ -76,8 +81,9 @@ Page({
icon: 'none' icon: 'none'
}) })
} }
// this.couponCom = this.selectAllComponents("#coupon") if(!this.data.kjId){
this.couponCom.setNullCoupon() this.couponCom.setNullCoupon()
}
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
this.setData({ this.setData({
productNum:(this.data.productNum-1), productNum:(this.data.productNum-1),
@ -93,8 +99,9 @@ Page({
this.setData({ this.setData({
coupon:null coupon:null
}) })
// this.couponCom = this.selectAllComponents("#coupon") if(!this.data.kjId){
this.couponCom.setNullCoupon() this.couponCom.setNullCoupon()
}
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
} }
this.setData({ this.setData({
@ -153,12 +160,18 @@ Page({
visitors:linkmanIds.join(","), visitors:linkmanIds.join(","),
remark:remark, remark:remark,
product_num:productNum product_num:productNum
}] }],
originate_order_id:this.data.kjId
} }
commonApi.user_post("order/create",{ commonApi.user_post("order/create",{
data:JSON.stringify(data) data:JSON.stringify(data)
}).then(res=>{ }).then(res=>{
console.log(res) if(app.globalData.kjId){
this.setData({
kjId:null
});
app.globalData.kjId = null;
}
}) })
}, },
@ -198,7 +211,10 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
this.setData({
kjId:null
});
app.globalData.kjId = null;
}, },
/** /**

9
pages/order/scene/index.wxml

@ -8,13 +8,13 @@
<view class="box"> <view class="box">
<view class="box-title"> <view class="box-title">
<view style="flex:1">购票数量</view> <view style="flex:1">购票数量</view>
<view class="iconfont icon-sami-select" bindtap="minus"></view> <view class="iconfont icon-sami-select" wx:if="{{!kjId}}" bindtap="minus"></view>
<view class="number-box">{{productNum}}</view> <view class="number-box">{{productNum}}</view>
<view class="iconfont icon-add-select" bindtap="add"></view> <view class="iconfont icon-add-select" wx:if="{{!kjId}}" bindtap="add"></view>
</view> </view>
</view> </view>
<contact wx:if="{{isLogin}}" bind:setLinkman="setLinkman"></contact> <contact wx:if="{{isLogin}}" bind:setLinkman="setLinkman"></contact>
<coupon id="coupon" money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon> <coupon wx:if="{{!kjId}}" id="coupon" money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon>
<view class="box"> <view class="box">
<view class="box-title"> <view class="box-title">
<view style="flex-shrink:0">订单备注</view> <view style="flex-shrink:0">订单备注</view>
@ -23,7 +23,8 @@
</view> </view>
<view style="{{type=='museum'?'height:138rpx':'height:113rpx'}}"></view> <view style="{{type=='museum'?'height:138rpx':'height:113rpx'}}"></view>
<view class="fixed-bottom" wx:if="{{type!='museum'}}"> <view class="fixed-bottom" wx:if="{{type!='museum'}}">
<view class="fixed-price-box"><text>合计:</text><text class="price">¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}}</text></view> <view class="fixed-price-box" wx:if="{{kjId}}"><text>合计:</text><text class="price">¥0</text></view>
<view class="fixed-price-box" wx:else><text>合计:</text><text class="price">¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}}</text></view>
<view class="fixed-btn" bindtap="order">提交订单</view> <view class="fixed-btn" bindtap="order">提交订单</view>
</view> </view>
<view class="fixed-bottom yuyue-box" wx:else> <view class="fixed-bottom yuyue-box" wx:else>

9
pages/pbService/index.js

@ -29,6 +29,15 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: e.currentTarget.dataset.path, 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(){ jiesongji:function(){
if(!this.data.jsj) return; if(!this.data.jsj) return;

30
pages/pbService/index.wxml

@ -7,15 +7,15 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb1.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb1.png" mode="widthFix"></image>
<view>苏康码</view> <view>苏康码</view>
</view> --> </view> -->
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/security/index"> <view class="pb-item" data-title="安全服务" bindtap="gotoPath" data-path="/pages/pbService/security/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb2.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb2.png" mode="widthFix"></image>
<view>安全服务</view> <view>安全服务</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=1"> <view class="pb-item" data-title="找厕所" bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=1">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb3.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb3.png" mode="widthFix"></image>
<view>找厕所</view> <view>找厕所</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/sceneComfort/index"> <view class="pb-item" data-title="景区舒适度" bindtap="gotoPath" data-path="/pages/pbService/sceneComfort/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb4.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb4.png" mode="widthFix"></image>
<view>景区舒适度</view> <view>景区舒适度</view>
</view> </view>
@ -28,19 +28,19 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb6.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb6.png" mode="widthFix"></image>
<view>实时公交</view> <view>实时公交</view>
</view> --> </view> -->
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=2"> <view class="pb-item" data-title="停车场" bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=2">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb5.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb5.png" mode="widthFix"></image>
<view>停车场</view> <view>停车场</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=0"> <view class="pb-item" data-title="公共自行车" bindtap="gotoPath" data-path="/pages/pbService/bike/index?type=0">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb7.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb7.png" mode="widthFix"></image>
<view>公共自行车</view> <view>公共自行车</view>
</view> </view>
<view class="pb-item" bindtap="jiesongji"> <view class="pb-item" data-title="接送机" bindtap="jiesongji">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb18.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb18.png" mode="widthFix"></image>
<view>接送机</view> <view>接送机</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/PRpark/index"> <view class="pb-item" data-title="P+R停车场" bindtap="gotoPath" data-path="/pages/pbService/PRpark/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb8.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb8.png" mode="widthFix"></image>
<view>P+R停车场</view> <view>P+R停车场</view>
</view> </view>
@ -49,11 +49,11 @@
<view class="pb-box"> <view class="pb-box">
<view class="pb-title">文体查询</view> <view class="pb-title">文体查询</view>
<view class="pb-list"> <view class="pb-list">
<view class="pb-item" bindtap="gotoUrl" data-url="https://hot-map.sz-trip.com/"> <view class="pb-item" data-title="投资导引图" bindtap="gotoUrl" data-url="https://hot-map.sz-trip.com/">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb17.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb17.png" mode="widthFix"></image>
<view>投资导引图</view> <view>投资导引图</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/feiyi/index"> <view class="pb-item" data-title="非遗传承" bindtap="gotoPath" data-path="/pages/pbService/feiyi/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb9.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb9.png" mode="widthFix"></image>
<view>非遗传承</view> <view>非遗传承</view>
</view> </view>
@ -61,27 +61,27 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb10.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb10.png" mode="widthFix"></image>
<view>文保单位</view> <view>文保单位</view>
</view> --> </view> -->
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/wwcx/index"> <view class="pb-item" data-title="文物查询" bindtap="gotoPath" data-path="/pages/pbService/wwcx/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb11.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb11.png" mode="widthFix"></image>
<view>文物查询</view> <view>文物查询</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/appreciate/index"> <view class="pb-item" data-title="在线鉴赏" bindtap="gotoPath" data-path="/pages/pbService/appreciate/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb12.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb12.png" mode="widthFix"></image>
<view>在线鉴赏</view> <view>在线鉴赏</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/library/index"> <view class="pb-item" data-title="书香借阅" bindtap="gotoPath" data-path="/pages/pbService/library/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb13.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb13.png" mode="widthFix"></image>
<view>书香借阅</view> <view>书香借阅</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/gym/index"> <view class="pb-item" data-title="体育场馆" bindtap="gotoPath" data-path="/pages/pbService/gym/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb14.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb14.png" mode="widthFix"></image>
<view>体育场馆</view> <view>体育场馆</view>
</view> </view>
<view class="pb-item" bindtap="garbage"> <view class="pb-item" data-title="垃圾分类" bindtap="garbage">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb16.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb16.png" mode="widthFix"></image>
<view>垃圾分类</view> <view>垃圾分类</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/museum/index"> <view class="pb-item" data-title="博物馆查询" bindtap="gotoPath" data-path="/pages/pbService/museum/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb19.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb19.png" mode="widthFix"></image>
<view>博物馆查询</view> <view>博物馆查询</view>
</view> </view>

10
project.private.config.json

@ -13,14 +13,14 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "pages/kj/index", "name": "pages/kj/info/index",
"pathName": "pages/kj/index", "pathName": "pages/kj/info/index",
"query": "id=203", "query": "user_id=25&id=68&originate_id=109",
"scene": null "scene": null
}, },
{ {
"name": "pages/activity/graduate/index", "name": "pages/kj/index",
"pathName": "pages/activity/graduate/index", "pathName": "pages/kj/index",
"query": "id=5", "query": "id=5",
"scene": null "scene": null
}, },

4
utils/https.js

@ -1,8 +1,8 @@
var app = getApp(); var app = getApp();
import util from "../utils/util" import util from "../utils/util"
import userApi from "../utils/https/user.js"; import userApi from "../utils/https/user.js";
const baseUrl = "https://test.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 baseUrl = "https://api.cloud.sz-trip.com/api/";
const orders = ['','weight','distance','sale_number','sale_price','price']; const orders = ['','weight','distance','sale_number','sale_price','price'];
//封装GET请求 //封装GET请求
function _get(url,data) { function _get(url,data) {

14
utils/util.js

@ -322,11 +322,25 @@ const goKjOrder = function(item) {
commonApi._post("product/get_product_detail",{ commonApi._post("product/get_product_detail",{
id:item.goods_id id:item.goods_id
}).then(res=>{ }).then(res=>{
if(!res.data){
wx.showToast({
title: '该产品已下架',
icon:'none'
})
return;
}
let product = [{ let product = [{
product:res.data, product:res.data,
sku:res.data.sku.find(s=>s.id==item.sku_id), sku:res.data.sku.find(s=>s.id==item.sku_id),
productNum:1 productNum:1
}]; }];
if(!product[0].sku){
wx.showToast({
title: '该规格已下架',
icon:'none'
})
return;
}
// 因为util里面不好改app.globalData的数据 但是下单是把产品信息先保存到globalData的 所以只能在页面内操作 // 因为util里面不好改app.globalData的数据 但是下单是把产品信息先保存到globalData的 所以只能在页面内操作
// 购买 只能把产品信息回传过去 可能还要改 暂时先回传整个的 // 购买 只能把产品信息回传过去 可能还要改 暂时先回传整个的
resolve(product); resolve(product);

Loading…
Cancel
Save