Myth 5 years ago
parent
commit
c9e75fdce6
  1. 4
      app.js
  2. 5
      app.json
  3. 7
      pages/component/myCalendar/index.js
  4. 248
      pages/group/index.js
  5. 5
      pages/group/index.json
  6. 62
      pages/group/index.wxml
  7. 234
      pages/group/index.wxss
  8. 311
      pages/group/info/index.js
  9. 5
      pages/group/info/index.json
  10. 115
      pages/group/info/index.wxml
  11. 329
      pages/group/info/index.wxss
  12. 224
      pages/group/mine/index.js
  13. 5
      pages/group/mine/index.json
  14. 60
      pages/group/mine/index.wxml
  15. 121
      pages/group/mine/index.wxss
  16. 55
      pages/info/museumInfo/index.js
  17. 3
      pages/info/museumInfo/index.json
  18. 1
      pages/info/museumInfo/index.wxml
  19. 16
      pages/kj/index.js
  20. 62
      pages/order/components/contact/index.js
  21. 52
      pages/order/components/date/index.js
  22. 18
      pages/order/components/date/index.wxml
  23. 33
      pages/order/postOrder/index.js
  24. 6
      pages/order/postOrder/index.wxml
  25. 43
      pages/order/scene/index.js
  26. 6
      pages/order/scene/index.wxml
  27. 4
      project.private.config.json
  28. 4
      utils/https.js
  29. 1
      utils/util.js

4
app.js

@ -100,6 +100,8 @@ App({
JIANSHEYINHANG:"建行支付",
ZHIFUBAO:"支付宝支付"
},
kjId:null
kjId:null,
gp_id:null,
team_id:null
}
})

5
app.json

@ -125,7 +125,10 @@
"pages/kj/index",
"pages/kj/his/index",
"pages/kj/info/index",
"pages/kj/mine/index"
"pages/kj/mine/index",
"pages/group/index",
"pages/group/mine/index",
"pages/group/info/index"
],
"permission": {
"scope.userLocation": {

7
pages/component/myCalendar/index.js

@ -31,11 +31,11 @@ Component({
isToday: 0,
isTodayWeek: false,
todayIndex: 0,
isKj:null
isKj:null,
isGp:null
},
lifetimes: {
attached: function() {
console.log(app.globalData)
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
@ -44,7 +44,8 @@ Component({
year: year,
month: month,
isToday: '' + year + month + now.getDate(),
isKj:app.globalData.kjId
isKj:app.globalData.kjId,
isGp:app.globalData.gp_id || app.globalData.team_id
})
let dates={}
this.properties.datelist.map(item=>{

248
pages/group/index.js

@ -0,0 +1,248 @@
// list//pages/group/index.js
import commonApi from "../../utils/https/common";
import util from "../../utils/util"
let timer = null,app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
showIngGroup:false,
pageNo:1,
isMore:true,
list:[],
hot:[],
ingGroup:{}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
commonApi.user_post("activity.groups/product_list",{
isHot:1,
page:1,
limit:10
}).then(res=>{
this.setData({
hot:res.data.data
})
})
this.getList()
},
getList:function(){
commonApi.user_post("activity.groups/product_list",{
isHot:0,
page:this.data.pageNo,
limit:10
}).then(res=>{
this.setData({
list:res.data.data
})
})
},
gotoDetail:function(e){
let item = e.currentTarget.dataset.item,that = this;
commonApi.user_post("activity.groups/is_join",{
id:item.id
}).then(res=>{
let isJoin = false;
if(res.data.length>0 && res.data[0].status==1){
// 已经参与了这个团购
res.data[0].gp_num = item.gp_num;
this.setData({
showIngGroup:true,
ingGroup:res.data
})
this.setTime();
}
else {
// 未参与该团购
// 售罄
if(item.left_stock_num<=0){
wx.showModal({
title:"提示",
content:"商品售罄是否进行原价购买",
success:function(res){
if(res.confirm){
// 去下单
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',
})
}
})
// that.goOrder(item)
}
}
})
return;
}
// 正常参团
else {
wx.navigateTo({
url: 'info/index?id='+item.id,
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
setTime:function(){
let info = this.data.ingGroup;
if(!this.data.showIngGroup || info.length==0) {
if(timer){
clearTimeout(timer);
timer=null;
}
this.setData({
showIngGroup:false
})
return;
}
let time = info[0].over_time;
let overTime = new Date(time.replace(/-/g,'/')).getTime(),now = new Date().getTime();
if(overTime<=now){
info[0].isOver=true;
}
else {
let t = (overTime - now)/1000;
let h = Math.floor(t/(60*60));
t = t - h * 60*60;
let m = Math.floor(t/60),s=Math.floor(t-m*60);
if(h<10) {
h="0"+h;
}
if(m<10) {
m="0"+m;
}
if(s<10) {
s="0"+s;
}
info[0].h=h;
info[0].m=m;
info[0].s=s;
}
this.setData({
ingGroup:info
})
timer = setTimeout(()=>{
this.setTime();
},1000)
},
goOrder:function(info){
commonApi._get('productfront/getProductInfo',{
productId:info.productId
}).then(res=>{
if(!res.data){
wx.showToast({
title:"该产品不存在或已下架",
icon:'none'
})
return;
}
let skuIndex = res.data.skuInfo.findIndex(item=>item.id==info.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
}];
app.globalData.groupId = null;
app.globalData.discounts = 0;
wx.navigateTo({
url: '/pages/order/index',
})
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if(this.data.ingGroup){
this.setTime();
}
},
hideGroup:function(){
this.setData({
showIngGroup:false
})
wx.navigateTo({
url: '/pages/group/info/index?id='+this.data.ingGroup[0].gp_product_id
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
if(timer){
clearTimeout(timer);
timer = null
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getList()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (e) {
if(e.from=='button'){
return {
title: "我正在发起团购,快来参加吧", // 默认是小程序的名称(可以写slogan等)
path: "/pages/group/info/index?id="+this.data.ingGroup.gpInitiateId, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: this.data.ingGroup.headImg, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
}
}
else {
return {
title: "团购专区", // 默认是小程序的名称(可以写slogan等)
path: "list/pages/group/index"
}
}
}
})

5
pages/group/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
}
}

62
pages/group/index.wxml

@ -0,0 +1,62 @@
<title title="团购专区"></title>
<view class="hot-box">
<view class="hot-title">热门团购<image src="https://resources.jszhwlpt.com/004e4591-a67a-4282-abf9-1c20feb5554e.png" mode="widthFix"></image></view>
<view class="hot-list">
<view wx:for="{{hot}}" bindtap="gotoDetail" data-item="{{item}}" class="hot-item">
<image src="{{item.headimg}}" mode="apsectFill"></image>
<view class="hot-info">
<view class="hot-title1">{{item.title+item.sku_name}}</view>
<view class="hot-bottom">
<text>¥{{item.event_price/100}}</text>
<view class="old-price">¥{{item.price/100}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="list-box">
<view class="hot-title">精品团购<image src="https://resources.jszhwlpt.com/b994d3ca-e77e-4ef3-84ae-ba6a31bed666.png" mode="widthFix"></image></view>
<view wx:for="{{list}}" bindtap="gotoDetail" data-item="{{item}}" class="item">
<image src="{{item.headimg}}" mode="aspectFill" class="headimg"></image>
<view class="item-num">{{item.gp_num}}人团</view>
<view class="info-box">
<view>
<view class="info-title">{{item.title+item.sku_name}}</view>
<view class="info-tip">剩余库存:{{item.left_stock_num}}</view>
<view class="info-tip">团购成功:{{item.stock_num-item.left_stock_num}}</view>
</view>
<view class="hot-bottom">
<text>¥{{item.event_price/100}}</text>
<view class="old-price">¥{{item.price/100}}</view>
<view class="btn" style="background:#ccc" wx:if="{{item.left_stock_num<=0}}">售罄</view>
<view class="btn" wx:else>团购</view>
</view>
</view>
</view>
</view>
<navigator url="mine/index" class="mine-btn">
<view>我的</view>
<view>团购</view>
</navigator>
<view class="mask" wx:if="{{showIngGroup && ingGroup.length>0}}" style="flex-direction:column">
<view class="mask-bg" bindtap="hideGroup"></view>
<view class="mask-content" style="text-align:center;font-size:26rpx;color:#666;padding-bottom:40rpx;z-index:100">
<view class="mask-title">您有一个团购正在进行中</view>
<view>倒计时</view>
<view class="time-box">
<view class="time-bg">{{ingGroup[0].h}}</view>
<text>:</text>
<view class="time-bg">{{ingGroup[0].m}}</view>
<text>:</text>
<view class="time-bg">{{ingGroup[0].s}}</view>
</view>
<view class="time-box headimglist">
<image src="{{item.avatar}}" wx:for="{{ingGroup}}" mode="aspectFill"></image>
<view wx:if="{{ingGroup[0].gp_num>ingGroup.length}}">
<button open-type="share" plain="true" style="border:none;padding:0;margin:0;"><image style="margin-right:0" src="https://resources.jszhwlpt.com/ffece698-001a-42be-8d8c-ff86985818e3.png" mode="aspectFill"></image></button>
</view>
</view>
<button open-type="share" plain="true" class="yq-btn">邀请好友</button>
</view>
<image class="closeimg" bindtap="hideGroup" src="https://resources.jszhwlpt.com/c34835f4-037d-441a-9282-b9e98c1ddae2.png" mode="widthFix"></image>
</view>

234
pages/group/index.wxss

@ -0,0 +1,234 @@
/* pages/user/pdd/index.wxss */
page {
background: #F2F2F2;
}
.mine-btn {
width: 100rpx;
height: 100rpx;
background: #F34922;
box-shadow: 0px 0px 12px 0px rgba(243, 73, 34, 0.35);
border-radius: 50%;
position: fixed;
right: 30rpx;
bottom: 80rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 26rpx;
color: #fff;
line-height: 34rpx;
}
.hot-box {
background: linear-gradient(-30deg, #FFCC24, #FF9124);
border-radius: 20rpx;
padding-bottom: 1rpx;
margin: 25rpx 20rpx;
}
.hot-title {
display: flex;
align-items: center;
height: 70rpx;
margin: 0 20rpx;
font-size: 32rpx;
font-weight: bold;
}
.hot-title image {
width: 30rpx;
display: block;
height: 30rpx;
margin-left: 11rpx;
}
.hot-list {
display: flex;
margin: 20rpx;
margin-top: 0;
overflow-x: auto;
}
.hot-item {
border-radius: 10rpx;
overflow: hidden;
background: white;
width: 210rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.hot-list .hot-item:last-child {
margin-right: 0;
}
.hot-item image {
width: 210rpx;
display: block;
height: 180rpx;
}
.hot-info {
height: 120rpx;
display: flex;
flex-direction: column;
font-size: 22rpx;
padding: 10rpx;
box-sizing: border-box;
justify-content: space-between;
padding-bottom: 20rpx;
line-height: 26rpx;
}
.hot-title1 {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.hot-bottom {
display: flex;
align-items: center;
}
.hot-bottom text {
color: #FF5555;
}
.old-price {
margin-left: 10rpx;
color: #999;
text-decoration: line-through;
font-size: 18rpx;
}
.list-box {
margin: 0 20rpx;
}
.item {
display: flex;
justify-content: space-between;
border-radius: 20rpx;
overflow: hidden;
background: white;
margin-bottom: 20rpx;
position: relative;
}
.item-num {
position: absolute;
width: 100rpx;
line-height: 40rpx;
text-align: center;
left: 0;
top: 0;
background: linear-gradient(270deg, #FFCC24, #FF9124);
border-radius: 20rpx 0px 20rpx 0px;
font-size: 24rpx;
color: #fff;
}
.item .headimg {
border-radius: 20rpx 20rpx 0px 20rpx;
display: block;
width: 220rpx;
height: 220rpx;
flex-shrink: 0;
}
.info-box {
flex: 1;
width: calc(100% - 300rpx);
margin:10rpx 20rpx;
height: 200rpx;
font-size: 26rpx;
color: #666;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.info-title {
font-size: 30rpx;
color: #333;
line-height: 42rpx;
margin-bottom: 10rpx;
font-weight: bold;
}
.info-box view {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.info-tip {
margin-bottom: 10rpx;
}
.info-box .hot-bottom text {
font-size: 30rpx;
}
.info-box .hot-bottom .old-price {
font-size: 24rpx;
flex: 1;
}
.info-box .btn {
width: 160rpx;
line-height: 50rpx;
background: linear-gradient(0deg, #FFCC24, #FF9124);
border-radius: 25rpx;
text-align: center;
color: #fff;
}
.info-box .btn.disable {
background: #CCCCCC;
}
.mask-title {
font-size: 36rpx;
font-weight: bold;
line-height: 120rpx;
color: #333;
}
.time-box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20rpx;
margin-bottom: 40rpx;
}
.time-bg {
width: 50rpx;
line-height: 50rpx;
background: #F2F2F2;
border-radius: 10rpx;
color: #F34922;
}
.time-box text {
width: 60rpx;
}
.headimglist image {
display: block;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 30rpx;
}
.headimglist view {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
}
.headimglist button {
display: block;
width: 80rpx;
height: 80rpx;
background-color: #fff !important;
background: #fff !important;
margin: 0 !important;
}
button {
border: none !important;
padding: 0 !important;
box-shadow: #fff !important;
color: #fff !important;
}
.closeimg {
width: 80rpx;
height: 80rpx;
display: block;
margin-top: 30rpx;
}
.yq-btn {
width: 400rpx;
line-height: 80rpx;
color: #fff;
margin: 0 auto;
background: linear-gradient(270deg, #FFCC24, #FF9124);
border-radius: 40rpx;
font-size: 36rpx;
margin-top: 40rpx;
}

311
pages/group/info/index.js

@ -0,0 +1,311 @@
// pages/info/groupInfo/index.js
import commonApi from "../../../utils/https/common";
let timer = null,app = getApp(),timer2=null;
import util from "../../../utils/util"
Page({
/**
* 页面的初始数据
*/
data: {
info:null,
list:[],
hot:[],
id:null,
isFollow:true,
showRuleFlag:false,
isOn:false,
myIngList:{}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
id:options.id
})
commonApi.user_post('activity.groups/detail?id='+options.id,{
id:options.id
}).then(res=>{
this.setData({
info:res.data.detail,
hot:res.data.hotProductList
})
if(res.data.self_team.status==-1){
this.setData({
isOn:false
})
commonApi.user_post("activity.groups/get_teams?limit=100&id="+options.id,{
id:options.id,
limit:10
}).then(res=>{
this.setData({
list:res.data.data
})
this.setListTime();
})
}
else {
this.setData({
isOn:true,
myIngList:res.data.self_team
})
this.setTime();
}
})
},
// 我的团购结束倒计时
setTime:function(){
let myIngList = this.data.myIngList,time = myIngList.team_list[0].over_time;
if(myIngList.isOver){
if(timer2){
clearTimeout(timer2);
timer2 = null;
}
return;
}
let overTime = new Date(time.replace(/-/g,'/')).getTime(),now = new Date().getTime();
if(overTime<=now){
myIngList.isOver=true;
}
else {
let t = (overTime - now)/1000;
let h = Math.floor(t/(60*60));
t = t - h * 60*60;
let m = Math.floor(t/60),s=Math.floor(t-m*60);
if(h<10) {
h="0"+h;
}
if(m<10) {
m="0"+m;
}
if(s<10) {
s="0"+s;
}
myIngList.h=h;
myIngList.m=m;
myIngList.s=s;
}
this.setData({
myIngList:myIngList
})
timer2 = setTimeout(()=>{
this.setTime()
},1000)
},
// 列表倒计时
setListTime:function(){
let list = this.data.list,now = new Date();
list.map(item=>{
let t = item.over_time;
t = new Date(t.replace(/-/g,'/')).getTime() - now;
if(t<=0) {
item.isEnd = true;
}
else {
let h = Math.floor(t / 3600000),m = Math.floor((t - h * 3600000)/60000),s = Math.floor((t - h * 3600000 - m * 60000)/1000);
item.h = h<10?('0'+h):h;
item.m = m<10?('0'+m):m;
item.s = s<10?('0'+s):s;
}
})
this.setData({
list:list
})
if(timer){
clearTimeout(timer);
}
timer = setTimeout(()=>{
this.setListTime()
},1000)
},
// 修改当前详情页id
gotoDetail:function(e){
clearTimeout(timer);
timer = null;
wx.redirectTo({
url: '/pages/info/groupInfo/index?id='+e.currentTarget.dataset.id
})
},
// 发起团购
startGroup:function(){
util.goKjOrder(this.data.info).then(product=>{
product.map(item=>{
item.productNum = this.data.info.purchase_quantity;
item.sku.event_price = this.data.info.event_price;
item.maxNum = this.data.info.purchase_quantity;
})
app.globalData.gp_id = this.data.info.id;
if(this.data.info.type=='post'){
app.globalData.postProduct = product;
wx.navigateTo({
url: '/pages/order/postOrder/index',
})
}
else if(this.data.info.type=='ticket' || this.data.info.type=='scene'){
app.globalData.product = product[0];
wx.navigateTo({
url: '/pages/order/scene/index',
})
}
})
},
// 加入拼团
join:function(e){
let item = e.currentTarget.dataset.item;
util.goKjOrder(this.data.info).then(product=>{
product.map(item=>{
item.productNum = this.data.info.purchase_quantity;
item.sku.event_price = this.data.info.event_price;
item.maxNum = this.data.info.purchase_quantity;
})
// app.globalData.gp_id = this.data.info.id;
app.globalData.team_id = item.team_id;
if(this.data.info.type=='post'){
app.globalData.postProduct = product;
wx.navigateTo({
url: '/pages/order/postOrder/index',
})
}
else if(this.data.info.type=='ticket' || this.data.info.type=='scene'){
app.globalData.product = product[0];
wx.navigateTo({
url: '/pages/order/scene/index',
})
}
})
},
// 原价购买
goBuy:function(){
this.goOrder(null,1);
},
// 去下单
goOrder:function(groupId){
commonApi._get('productfront/getProductInfo',{
productId:this.data.info.productDetail.productId
}).then(res=>{
if(!res.data){
wx.showToast({
title:"该产品不存在或已下架",
icon:'none'
})
return;
}
let skuIndex = res.data.skuInfo.findIndex(item=>item.id==this.data.info.productDetail.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,
purchaseQuantity:this.data.info.productDetail.purchaseQuantity
}];
app.globalData.groupId = groupId;
app.globalData.discounts = 0;
wx.navigateTo({
url: '../../order/index',
})
})
},
// 显示或者隐藏规则
showRule:function(){
this.setData({
showRuleFlag:!this.data.showRuleFlag
})
},
// 前往列表页 如果是从列表来的直接返回 防止嵌套
backList:function(){
let page = getCurrentPages();
if(page.length>=2 && page[page.length-2].route.indexOf('pages/group/index')!=-1){
wx.navigateBack()
}
else {
wx.navigateTo({
url: '/pages/group/index'
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if(this.data.list.length>0){
this.setListTime()
}
if(this.data.info && this.data.info.isGroupPurchasing==1){
this.setTime()
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
if(timer){
clearTimeout(timer)
timer = null;
}
if(timer2){
clearTimeout(timer2);
timer2 = null;
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function (e) {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (e) {
if(e.from=='button' || this.data.myIngList.status==1){
return {
title: "我正在发起团购,快来参加吧", // 默认是小程序的名称(可以写slogan等)
path: "/pages/group/info/index?gpId="+this.data.info.id, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: this.data.info.headimg, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
}
}
else {
return {
title: this.data.info.title+this.data.info.sku_name+"正在团购中~", // 默认是小程序的名称(可以写slogan等)
path: "/pages/group/info/index?id="+this.data.info.id, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: this.data.info.headimg, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
}
}
}
})

5
pages/group/info/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
}
}

115
pages/group/info/index.wxml

@ -0,0 +1,115 @@
<!--pages/info/groupInfo/index.wxml-->
<title title="团购详情"></title>
<view class="info-top-box" wx:if="{{info}}">
<view class="item">
<image src="{{info.headimg}}" mode="aspectFill" class="headimg"></image>
<view class="item-num">{{info.gp_num}}人团</view>
<view class="info-box">
<view>
<view class="info-title">{{info.title+info.sku_name}}</view>
<view class="info-tip">剩余库存:{{info.left_stock_num}}</view>
</view>
<view class="hot-bottom">
<text>¥{{info.event_price/100}}</text>
<view class="old-price">¥{{info.price/100}}</view>
</view>
</view>
<navigator url="/pages/info/{{info.type=='post'?'post':'scene'}}ProductInfo/index?id={{info.goods_id}}" class="info-btn">详情 ></navigator>
</view>
<!-- 进行中的拼团 -->
<view wx:if="{{isOn && myIngList && myIngList.status==1}}">
<view class="mask-title">还差<text>{{info.gp_num - myIngList.team_list.length}}</text>人</view>
<view class="top-tip">成团立享超值优惠</view>
<view>倒计时</view>
<view class="time-box">
<view class="time-bg">{{myIngList.h}}</view>
<text>:</text>
<view class="time-bg">{{myIngList.m}}</view>
<text>:</text>
<view class="time-bg">{{myIngList.s}}</view>
</view>
<view class="time-box headimglist">
<image wx:for="{{myIngList.team_list}}" src="{{item.avatar}}" mode="aspectFill"></image>
<view>
<button open-type="share" plain="true" style="border:none;padding:0;margin:0;"><image style="margin-right:0" src="https://resources.jszhwlpt.com/ffece698-001a-42be-8d8c-ff86985818e3.png" mode="aspectFill"></image></button>
</view>
</view>
<button open-type="share" plain="true" class="yq-btn">邀请好友</button>
</view>
<!-- 失败的拼团 -->
<view class="fail-box" wx:if="{{info.productDetail.status==0 && info.isGroupPurchasing==1}}">
<image src="https://resources.jszhwlpt.com/1fccfcab-2e85-4925-826e-4c35d35b8a9a.png" mode="widthFix"></image>
<view class="fail-text">团购未满规定人数 已失败</view>
<view class="fail-btns">
<view class="fail-btn border-btn" bindtap="goBuy">原价购买</view>
<view class="fail-btn" bindtap="startGroup">再开一单</view>
</view>
</view>
<!-- 成功的拼团 -->
<view class="fail-box" wx:if="{{info.productDetail.status==2 && info.isGroupPurchasing==1}}">
<image src="https://resources.jszhwlpt.com/fa6904a2-3063-4d90-8da0-d02424d4ac76.png" mode="widthFix"></image>
<view class="fail-text" style="color:#F34922">团购活动已人满 团购成功</view>
<view class="fail-btns">
<view class="fail-btn" style="width:600rpx" bindtap="startGroup">再开一单</view>
</view>
</view>
<!-- 活动结束 -->
<view class="fail-box" wx:if="{{info.productDetail.state==2}}">
<image src="https://resources.jszhwlpt.com/fdd3bdd5-7e78-4ab3-8cd7-e5dc08e234e9.png" mode="widthFix"></image>
<view class="fail-text">团购活动已结束</view>
<view class="fail-btns">
<view class="fail-btn" style="width:600rpx" bindtap="backList">查看其它活动</view>
</view>
</view>
<!-- 拼团未开始 -->
<view class="new-box" wx:if="{{isOn==false}}">
<view class="fail-btns">
<view class="fail-btn" style="width:600rpx" bindtap="startGroup">发起团购</view>
</view>
<view style="margin-top:30rpx" bindtap="showRule">拼团规则</view>
<view class="group-list">
<view class="group-item" wx:for="{{list}}">
<image src="{{item.avatar}}" mode="aspectFill"></image>
<view class="nickname">{{item.nickname}}</view>
<view class="group-num">还差<text>{{info.gp_num - item.team_num}}</text>人</view>
<view class="btn-box" bindtap="join" data-item="{{item}}">
<view class="btn-top">参团</view>
<view class="btn-time">剩余{{item.h}}:{{item.m}}:{{item.s}}</view>
</view>
</view>
</view>
</view>
<view style="margin-top:30rpx" wx:else bindtap="showRule">拼团规则</view>
</view>
<view class="hot-box">
<view class="hot-title">
<view>商品推荐</view>
<view class="more-btn" bindtap="backList">更多 ></view>
</view>
<view class="hot-list" wx:if="{{hot.length>0}}">
<view class="hot-item" wx:for="{{hot}}" bindtap="gotoDetail" data-id="{{item.id}}">
<image src="{{item.headImg}}" mode="apsectFill"></image>
<view class="hot-info">
<view class="hot-title1">{{item.productName+item.skuName}}</view>
<view class="hot-bottom">
<text>¥{{item.eventPrice/100}}</text>
<view class="old-price">¥{{item.price/100}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="mask" wx:if="{{showShareFlag}}">
<view class="mask-bg" bindtap="hideShare"></view>
<view class="mask-content" style="width:500rpx;overflow:hidden;text-align:center;color:#FF9124;padding:40rpx 0;">
<view>请先关注公众号</view>
<image bindlongpress="saveImg" style="width:260rpx;height:260rpx;display:block;margin:40rpx auto;border-radius:10rpx;border:1rpx solid" src="https://resources.jszhwlpt.com/d3c2d106-b893-474f-bf5c-091bd04f247f.jpeg" mode="aspectFill" class="codeimg"></image>
<view style="color:#333">长按保存二维码</view>
</view>
</view>
<view class="mask" wx:if="{{info && showRuleFlag}}">
<view class="mask-bg" bindtap="showRule"></view>
<view class="mask-content" style="padding:20rpx;max-height:50%;overflow-y:auto;min-height:30%;">
<rich-text nodes="{{info.rule_content}}"></rich-text>
</view>
</view>

329
pages/group/info/index.wxss

@ -0,0 +1,329 @@
/* pages/info/groupInfo/index.wxss */
.headimglist view {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
}
.headimglist button {
display: block;
width: 80rpx;
height: 80rpx;
background-color: #fff !important;
background: #fff !important;
margin: 0 !important;
}
button {
border: none !important;
padding: 0 !important;
box-shadow: #fff !important;
color: #fff !important;
}
.info-top-box {
text-align:center;
font-size:26rpx;
color:#666;
padding: 20rpx;
padding-bottom:40rpx;
margin: 20rpx;
border-radius: 20rpx;
background: white;
}
.mask-title {
font-size: 36rpx;
font-weight: bold;
line-height: 50rpx;
color: #333;
margin-top: 30rpx;
}
.top-tip {
font-size: 30rpx;
color: #333;
margin-bottom: 40rpx;
font-weight: bold;
}
.time-box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20rpx;
margin-bottom: 40rpx;
}
.time-bg {
width: 50rpx;
line-height: 50rpx;
background: #F2F2F2;
border-radius: 10rpx;
color: #F34922;
}
.time-box text {
width: 60rpx;
}
.headimglist image {
display: block;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 30rpx;
}
.headimglist image:last-child {
margin-right: 0;
}
.closeimg {
width: 80rpx;
height: 80rpx;
display: block;
margin-top: 30rpx;
}
.yq-btn {
width: 400rpx;
line-height: 80rpx;
color: #fff;
margin: 0 auto;
background: linear-gradient(270deg, #FFCC24, #FF9124);
border-radius: 40rpx;
font-size: 36rpx;
margin-top: 40rpx;
}
.item {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
position: relative;
text-align: left;
border-bottom: 1rpx solid #D8D8D8;
}
.item-num {
position: absolute;
width: 100rpx;
line-height: 40rpx;
text-align: center;
left: 0;
top: 0;
background: linear-gradient(270deg, #FFCC24, #FF9124);
border-radius: 10rpx 0px 10rpx 0px;
font-size: 24rpx;
color: #fff;
}
.item .headimg {
border-radius: 10rpx;
display: block;
width: 160rpx;
height: 160rpx;
flex-shrink: 0;
}
.info-box {
flex: 1;
width: calc(100% - 360rpx);
margin:0 20rpx;
height: 150rpx;
font-size: 26rpx;
color: #666;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.info-title {
font-size: 30rpx;
color: #333;
line-height: 42rpx;
margin-bottom: 10rpx;
font-weight: bold;
}
.info-box view {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.info-tip {
margin-bottom: 10rpx;
}
.info-box .hot-bottom text {
font-size: 30rpx;
font-weight: bold;
}
.info-box .hot-bottom .old-price {
font-size: 24rpx;
flex: 1;
}
.hot-bottom {
display: flex;
align-items: center;
}
.hot-bottom text {
color: #FF5555;
}
.old-price {
margin-left: 10rpx;
color: #999;
text-decoration: line-through;
font-size: 18rpx;
}
.info-btn {
flex-shrink: 0;
color: #F34922;
margin-top: 3rpx;
line-height: 30rpx;
height: 30rpx;
}
.more-btn {
color: #F34922;
font-size: 26rpx;
flex: 1;
font-weight: normal;
text-align: right;
}
.hot-box {
border-radius: 20rpx;
background: white;
padding-bottom: 1rpx;
margin: 25rpx 20rpx;
}
.hot-title {
display: flex;
align-items: center;
height: 70rpx;
margin: 0 20rpx;
font-size: 32rpx;
font-weight: bold;
}
.hot-title image {
width: 30rpx;
display: block;
height: 30rpx;
margin-left: 11rpx;
}
.hot-list {
display: flex;
margin:0 20rpx;
}
.hot-item {
border-radius: 10rpx;
overflow: hidden;
background: white;
width: 210rpx;
margin-right: 20rpx;
}
.hot-list .hot-item:last-child {
margin-right: 0;
}
.hot-item image {
width: 210rpx;
display: block;
height: 180rpx;
}
.hot-info {
height: 120rpx;
display: flex;
flex-direction: column;
font-size: 22rpx;
padding: 10rpx;
box-sizing: border-box;
justify-content: space-between;
padding-bottom: 20rpx;
line-height: 26rpx;
}
.hot-title1 {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 22rpx;
}
.fail-box {
padding-top: 70rpx;
text-align: center;
}
.fail-box image {
width: 200rpx;
display: block;
margin: 0 auto;
height: 200rpx;
}
.fail-text {
font-size: 36rpx;
font-weight: bold;
color: #000;
margin-top: 20rpx;
margin-bottom: 60rpx;
}
.fail-btns {
display: flex;
justify-content: space-between;
margin: 0 40rpx;
}
.fail-btns .fail-btn {
width: 280rpx;
box-sizing: border-box;
line-height: 80rpx;
height: 80rpx;
color: #fff;
background: linear-gradient(90deg, #FFCC24, #FF9124);
border-radius: 40rpx;
font-size: 36rpx;
}
.fail-btns .fail-btn.border-btn {
border: 2rpx solid #FF9124;
color: #FF9124;
background: white;
}
.new-box {
padding: 20rpx 0;
}
.group-list {
background: #FFF4E9;
margin: 0 20rpx;
margin-top: 30rpx;
border-radius: 10rpx;
}
.group-item {
margin: 0 20rpx;
border-bottom: 1rpx solid #FFFFFF;
display: flex;
justify-content: space-between;
align-items: center;
height: 140rpx;
font-size: 26rpx;
color: #333;
}
.group-item image {
width: 80rpx;
height: 80rpx;
display: block;
flex-shrink: 0;
border-radius: 50%;
}
.group-item .nickname {
margin: 0 20rpx;
font-size: 30rpx;
text-align: left;
flex: 1;
}
.group-num {
flex-shrink: 0;
margin-right: 30rpx;
}
.group-num text {
color: #F34922;
margin: 0 4rpx;
}
.btn-box {
width: 160rpx;
height: 80rpx;
background: #fff;
overflow: hidden;
border: 2rpx solid #FF9124;
border-radius: 20rpx;
color: #fff;
flex-shrink: 0;
}
.btn-top {
width: 100%;
background: #ff9124;
line-height: 50rpx;
}
.btn-time {
font-size: 20rpx;
line-height: 30rpx;
color: #666;
}

224
pages/group/mine/index.js

@ -0,0 +1,224 @@
// pages/user/pdd/index.js
import productApi from "../../../utils/https/common";
let timer = null,app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
type:1,
list:[],
over:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getList();
},
changeType:function(e){
let type = e.currentTarget.dataset.type;
if(this.data.type==type) return;
this.setData({
type:type
})
},
gotoDetail:function(e){
let data = e.currentTarget.dataset.item;
if(this.data.type==2){
this.goOrder(e);
return;
}
wx.navigateTo({
url:"/pages/group/info/index?id="+data.gp_product_id
})
},
getList:function(){
productApi.user_post("activity.groups/my_teams",{
limit:100,
status:1,
is_team:1
}).then(res=>{
this.setData({
list:{
launchList:res.data.data
}
})
productApi.user_post("activity.groups/my_teams",{
limit:100,
status:1,
is_team:0
}).then(r=>{
this.setData({
list:{
launchList:res.data.data,
joinList:r.data.data
}
})
this.setTime();
timer = setInterval(()=>{
this.setTime()
},1000)
})
})
productApi.user_post("activity.groups/my_teams",{
limit:100,
status:2,
is_team:1
}).then(res=>{
productApi.user_post("activity.groups/my_teams",{
limit:100,
status:2,
is_team:0
}).then(r=>{
this.setData({
over:{
launchList:res.data.data,
joinList:r.data.data
}
})
})
})
},
setTime:function(){
let list = this.data.list,now = new Date().getTime();
for(let i in list){
list[i].map(item=>{
let overTime = item.over_time;
overTime = new Date(overTime.replace(/-/g,'/')).getTime();
if(overTime<=now){
item.isOver=true;
}
else {
let t = (overTime - now)/1000;
let h = Math.floor(t/(60*60));
t = t - h * 60*60;
let m = Math.floor(t/60),s=Math.floor(t-m*60);
if(h<10) {
h="0"+h;
}
if(m<10) {
m="0"+m;
}
if(s<10) {
s="0"+s;
}
item.timeText=[h,m,s].join(" : ");
}
})
}
this.setData({
list:list
})
},
goProduct:function(e){
let item = e.currentTarget.dataset.item;
console.log(item);
productApi._get('productfront/getProductInfo',{
productId:item.productId
}).then(res=>{
if(!res.data){
wx.showToast({
title:"该产品不存在或已下架",
icon:'none'
})
return;
}
let skuIndex = res.data.skuInfo.findIndex(sku=>sku.id==item.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
}];
app.globalData.kjOrderId = item.id || null;
app.globalData.discounts = 0;
wx.navigateTo({
url: '/pages/order/index',
})
})
},
goOrder:function(e){
wx.navigateTo({
url: '/pages/info/orderInfo/index?id='+e.currentTarget.dataset.item.gpChildOrderNo,
})
},
gotoPdd:function(){
let page = getCurrentPages();
if(page[page.length-2] && page[page.length-2].route && page[page.length-2].route.indexOf('pages/group/index')!=-1){
// 如果是从专题页列表来的 那么直接返回
wx.navigateBack()
}
else {
wx.navigateTo({
url: '/pages/group/index',
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if(this.data.list.length>0){
this.setTime();
timer = setInterval(()=>{
this.setTime()
},1000)
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
if(timer){
clearInterval(timer);
timer = null;
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

5
pages/group/mine/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
}
}

60
pages/group/mine/index.wxml

@ -0,0 +1,60 @@
<!--pages/user/pdd/index.wxml-->
<title title="我的团购"></title>
<view class="top-menus">
<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>
<view class="list">
<view class="list-title" wx:if="{{type==1 && list.launchList.length>0 || type==2 && over.launchList.length>0}}">我发起的</view>
<view class="item" wx:for="{{type==1?list.launchList:over.launchList}}" bindtap="gotoDetail" data-item="{{item}}">
<view class="item-top">
<image src="{{item.g_headimg}}" mode="aspectFill"></image>
<view class="item-info">
<view class="item-info-top">
<view class="item-title">{{item.title+item.sku_name}}</view>
<view class="item-price">¥{{item.event_price/100}}</view>
</view>
<view class="item-info-bottom" wx:if="{{type==1}}">
<view class="item-info-time" wx:if="{{item.isOver}}">已结束</view>
<view class="item-info-time" wx:else><text>{{item.timeText}}</text>后结束</view>
<view class="info-btn">查看详情</view>
</view>
<view class="item-info-bottom" wx:else>
成团日期:{{item.finish_time}}
</view>
</view>
</view>
<view class="item-bottom" wx:if="{{type==2}}">
<view class="info-btn info-btn-new" catchtap="goOrder" data-item="{{item}}">查看订单</view>
</view>
</view>
<view class="list-title" wx:if="{{type==1 && list.joinList.length>0 || type==2 && over.joinList.length>0}}">我参与的</view>
<view class="item" wx:for="{{type==1?list.joinList:over.joinList}}" bindtap="gotoDetail" data-item="{{item}}">
<view class="item-top">
<image src="{{item.g_headimg}}" mode="aspectFill"></image>
<view class="item-info">
<view class="item-info-top">
<view class="item-title">{{item.title+item.sku_name}}</view>
<view class="item-price">¥{{item.event_price/100}}</view>
</view>
<view class="item-info-bottom" wx:if="{{type==1}}">
<view class="item-info-time" wx:if="{{item.isOver}}">已结束</view>
<view class="item-info-time" wx:else><text>{{item.timeText}}</text>后结束</view>
<view class="info-btn">查看详情</view>
</view>
<view class="item-info-bottom" wx:else>
成团日期:{{item.finish_time}}
</view>
</view>
</view>
<view class="item-bottom" wx:if="{{type==2}}">
<view class="info-btn info-btn-new" catchtap="goOrder" data-item="{{item}}">查看订单</view>
</view>
</view>
</view>
<view wx:if="{{list.joinList.length==0 && list.launchList.length==0 && type==1 || type==2 && over.joinList.length==0 && over.launchList.length==0}}" class="common-empty" style="z-index:-1">
<image style="width:200rpx" mode="widthFix" src="https://resources.jszhwlpt.com/d8f70d62-ad43-4347-962a-5b4c49f704ad.png"></image>
<view wx:if="{{type==1}}">您暂时还未参加拼团活动</view>
<view wx:if="{{type==2}}">您暂时还未参团成功</view>
<view wx:if="{{type==1}}" class="empty-btn" bindtap="gotoPdd">立即前往</view>
</view>

121
pages/group/mine/index.wxss

@ -0,0 +1,121 @@
/* pages/user/pdd/index.wxss */
.top-menus {
position: fixed;
left: 0;
right: 0;
height: 80rpx;
background: white;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 30rpx;
line-height: 80rpx;
}
.top-menu.active {
color: #FF9124;
position: relative;
font-weight: 500;
}
.top-menu.active::after {
content: "1";
font-size: 0;
width: 40rpx;
height: 6rpx;
background: linear-gradient(270deg, #FFCC24, #FF9124);
display: block;
border-radius: 3rpx;
position: absolute;
left: 50%;
margin-left: -20rpx;
bottom: 10rpx;
}
.title-header {
background: #fff !important;
}
.item {
margin: 20rpx 30rpx;
background: white;
border-radius: 20rpx;
font-size: 26rpx;
}
.item-top {
display: flex;
padding: 30rpx;
}
.item-top image {
width: 160rpx;
height: 160rpx;
display: block;
flex-shrink: 0;
}
.item-info {
margin-left: 30rpx;
color: #333333;
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
height: 160rpx;
width: 440rpx;
}
.item-info-top {
font-size: 30rpx;
}
.item-title {
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 6rpx;
}
.item-info-bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.item-info-bottom text {
color: #E14135;
}
.info-btn {
width: 160rpx;
text-align: center;
line-height: 50rpx;
height: 50rpx;
background: linear-gradient(0deg, #FFCC24, #FF9124);
border-radius: 25rpx;
color: #fff;
margin-left: 20rpx;
}
.list {
padding-top: 80rpx;
}
.item-bottom {
display: flex;
padding: 20rpx 30rpx;
border-top: 1rpx solid #d8d8d8;
justify-content: flex-end;
}
.info-btn-new {
background: #fff;
border: 2rpx solid;
color: #FF9124;
box-sizing: border-box;
}
.empty-btn {
width: 240rpx;
height: 80rpx;
background: linear-gradient(0deg, #E14135, #FF9124);
border-radius: 40rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
margin-top: 100rpx;
font-size: 30rpx;
}
.list-title {
line-height: 50rpx;
color: #333;
margin: 0 40rpx;
margin-top: 30rpx;
font-size: 30rpx;
}

55
pages/info/museumInfo/index.js

@ -17,7 +17,11 @@ Page({
actList:[],
actTotal:1,
id:null,
fixed:false
fixed:false,
isLogin:false,
product:null,
time:null,
date:null
},
/**
@ -31,9 +35,23 @@ Page({
id:options.id
}).then(res=>{
// res.data.listimg = res.data.listimg?res.data.listimg.split(","):[];
this.setData({
info:res.data
})
if(res.data.product_venue && res.data.product_venue.sku && res.data.product_venue.sku[0]){
let product = {
product:res.data.product_venue,
sku:res.data.product_venue.sku[0]
};
app.globalData.product = product;
this.setData({
info:res.data,
product:product
})
}
else {
this.setData({
info:res.data
})
}
this.BroswerRecord();
})
this.getAct()
@ -95,14 +113,29 @@ Page({
*/
onReady: function () {
},
// 修改日期
changeDate:function(e){
this.setData({
date:e.detail
})
},
// 修改分时
changeTime:function(e){
this.setData({
time:e.detail
})
},
order:function(){
if(!this.data.info.product_venue) return;
if(!this.data.info.product_venue.sku[0]) return;
app.globalData.couponInfo = null;
// 如果在当前的详情页面选择了日期时间的话 那么需要修改日期时间
app.globalData.product = {
product:this.data.info.product_venue,
sku:this.data.info.product_venue.sku[0]
sku:this.data.info.product_venue.sku[0],
infoDate:this.data.date,
infoTime:this.data.time
}
wx.navigateTo({
url: '/pages/order/scene/index?type=museum'
@ -113,7 +146,15 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
if(!this.data.isLogin){
commonApi.user_post("token/check").then(res=>{
if(res.code==1){
this.setData({
isLogin:true
})
}
})
}
},
/**
@ -127,7 +168,7 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
app.globalData.product = null;
},
/**

3
pages/info/museumInfo/index.json

@ -1,5 +1,6 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
"title":"/pages/component/TitleHeader",
"date":"/pages/order/components/date/index"
}
}

1
pages/info/museumInfo/index.wxml

@ -21,6 +21,7 @@
<view style="height:102rpx;" wx:if="{{fixed}}"></view>
<view id="content">
<view wx:if="{{type==1}}">
<date wx:if="{{isLogin && product && product.sku && product.product}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" product="{{product}}"></date>
<view class="detail-title">预订须知</view>
<rich-text wx:if="{{info}}" class="detail" nodes="{{tool.formateRichText(info.book_info)}}"></rich-text>
<view class="detail-title">场馆介绍</view>

16
pages/kj/index.js

@ -34,28 +34,20 @@ Page({
})
this.getList()
})
this.getNext()
},
changeType:function(e){
let type = e.currentTarget.dataset.type;
if(this.data.type==type) return;
this.setData({
type:type,
nextPage:1,
page:1,
nextTotal:1,
total:1,
list:[],
nextList:[]
type:type
})
this.onReachBottom()
},
changeMenu:function(e){
let index = e.currentTarget.dataset.index;
if(this.data.menuIndex==index) return;
this.setData({
menuIndex:index,
page:1,
total:1,
list:[]
})
this.getList()
@ -160,9 +152,7 @@ Page({
getList:function(){
if(this.data.total==this.data.list.length) return;
let dataStr = this.getStrParams({
act_id:this.data.menuList[this.data.menuIndex].id,
limit:100,
page:this.data.page
act_id:this.data.menuList[this.data.menuIndex].id
})
productApi.user_post("activity.haggle/get_act_products"+dataStr,{

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

@ -207,33 +207,45 @@ Component({
},
selectIt:function(e){
let item = e.currentTarget.dataset.item,linkmanList = this.data.linkmanList,num = 0,traveller_limit_num = this.properties.maxNum!=-1?this.properties.maxNum:app.globalData.product.sku.sku_model.traveller_limit_num;
// 先计算出全部选中的出行人
linkmanList.map(linkman=>{
if(this.properties.maxNum!=-1 && num==traveller_limit_num && item.id==linkman.id){
wx.showToast({
title: '最多只能选择'+this.properties.maxNum+"个出行人",
icon:'none'
})
}
else if(traveller_limit_num!=0 && num==traveller_limit_num && item.id==linkman.id){
wx.showToast({
title: '出行人限购'+traveller_limit_num+"份",
icon:'none'
})
}
else if(app.globalData.kjId && num==1){
wx.showToast({
title: '最多只能选择一个出行人',
icon:'none'
})
if(linkman.selected==1){
num++;
}
else if(item.id==linkman.id){
linkman.selected = item.selected==1?0:1;
if(linkman.selected){
num++;
}
else {
num--;
}
})
console.log(traveller_limit_num,num,item)
// 如果是要新增选中 并且当前选中数量已经超过或者等于了最大出行人限制
if((app.globalData.kjId) && num==1 && item.selected!=1){
wx.showToast({
title: '最多只能选择一个出行人',
icon:'none'
})
return;
}
else if((app.globalData.gp_id || app.globalData.team_id) && num>=app.globalData.product.maxNum && item.selected!=1){
wx.showToast({
title: '最多只能选择'+app.globalData.product.maxNum+'个出行人',
icon:'none'
})
return;
}
else if(this.properties.maxNum!=-1 && item.selected!=1 && num>=traveller_limit_num){
wx.showToast({
title: '最多只能选择'+this.properties.maxNum+"个出行人",
icon:'none'
})
return;
}
else if(item.selected!=1 && traveller_limit_num!=0 && num>=traveller_limit_num){
wx.showToast({
title: '出行人限购'+traveller_limit_num+"份",
icon:'none'
})
return;
}
linkmanList.map(linkman=>{
if(item.id==linkman.id){
linkman.selected = linkman.selected==1?0:1;
}
})
this.setData({

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

@ -29,13 +29,14 @@ Component({
timelist:[],
timeIndex:0,
isSzMuseum:false,
kjIdCom:null
kjIdCom:null,
gpIdCom:null
},
lifetimes: {
attached: function() {
console.log(app.globalData,11111111)
this.setData({
kjIdCom:app.globalData.kjId
kjIdCom:app.globalData.kjId,
gpIdCom:app.globalData.gp_id || app.globalData.team_id
})
// 在组件实例进入页面节点树时执行
let product = app.globalData.product,today = util.formatDate(new Date()),end_date = util.formatDate(new Date(new Date().getTime() + 60 * 24 * 60 * 60 * 1000));
@ -52,16 +53,33 @@ Component({
end_date:end_date,
sku_id:product.sku.id
}).then(res=>{
for(let i=0;i<res.data.length;i++){
if(res.data[i].stock>0){
this.setData({
activeDate:res.data[i]
})
this.getTimeStock()
this.triggerEvent("onChangeDate",this.data.activeDate)
break;
// 如果之前已经在详情页面选择了日期的话 默认日期不能是第一个有库存的日期了
if(app.globalData.product.infoDate){
this.setData({
activeDate:app.globalData.product.infoDate
})
this.getTimeStock()
this.triggerEvent("onChangeDate",app.globalData.product.infoDate)
}
else {
for(let i=0;i<res.data.length;i++){
if(res.data[i].stock>0){
this.setData({
activeDate:res.data[i]
})
this.getTimeStock()
this.triggerEvent("onChangeDate",this.data.activeDate)
break;
}
}
}
if(this.data.gpIdCom){
// 拼团的话 价格日历无效 所有价格都是sku里面的event_price
res.data.map(item=>{
item.price = product.sku.event_price
})
}
this.setData({
datelist:res.data
})
@ -82,7 +100,8 @@ Component({
pageLifetimes:{
show:function(){
this.setData({
kjIdCom:app.globalData.kjId
kjIdCom:app.globalData.kjId,
gpIdCom:app.globalData.gp_id || app.globalData.team_id
})
}
},
@ -138,6 +157,15 @@ Component({
sku_id:app.globalData.product.sku.id
}).then(res=>{
let timeIndex = -1;
if(app.globalData.product.infoTime){
this.triggerEvent("onChangeTime",app.globalData.product.infoTime);
timeIndex = res.data.findIndex(item=>item.start_time==app.globalData.product.infoTime.start_time)
this.setData({
timelist:res.data,
timeIndex:timeIndex
})
return;
}
for(let i=0;i<res.data.length;i++){
if(res.data[i].stock_number>0){
timeIndex = i;

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

@ -8,14 +8,6 @@
<!-- <view class="price" wx:if="{{item.stock==null || item.price==null}}">不可定</view> -->
<view class="price" wx:if="{{item.stock==0}}">售罄</view>
</view>
<!-- <view class="date-item disable">
<view>明天11-22</view>
<view class="price">不可定</view>
</view>
<view class="date-item">
<view>后天11-23</view>
<view class="price">免费</view>
</view> -->
<view wx:if="{{moreFlag}}" class="date-item more-item" bindtap="showMoreDate">
更多
</view>
@ -25,16 +17,16 @@
</view>
</view>
<view class="date-times" wx:if="{{timelist.length>0}}">
<view bindtap="selectTime" data-index="{{index}}" wx:for="{{timelist}}" class="textOver date-time{{timeIndex==index?' active':''}}{{item.stock_number>0?'':' disable'}}">{{item.start_time}}-{{item.end_time}}<text wx:if="{{isSzMuseum && (item.stock_number>10 || item.stock_number==-1)}}"> 有票</text><text wx:else>({{item.stock_number==-1?'无限':('余票'+item.stock_number)}})</text></view>
<!-- <view class="date-time disable">09:00-10:00(余票0)</view> -->
<!-- <view class="date-time">09:00-10:00(余票0)</view> -->
<!-- <view class="date-time">09:00-10:00(余票0)</view> -->
<view bindtap="selectTime" data-index="{{index}}" wx:for="{{timelist}}" class="textOver date-time{{timeIndex==index?' active':''}}{{item.stock_number>0?'':' disable'}}">{{item.start_time}}-{{item.end_time}}<text wx:if="{{(item.stock_number>=10 || item.stock_number==-1)}}"> 有票</text><text wx:elif="{{item.stock_number<=0}}"> 无票</text><text wx:else>({{item.stock_number==-1?'无限':('余票'+item.stock_number)}})</text></view>
</view>
<!-- <view class="date-times" wx:elif="{{activeDate.is_time_stock}}">
<view>已售罄</view>
</view> -->
</view>
<!-- 日历选择 -->
<view class="mask" wx:if="{{showMoreDateFlag}}" style="z-index:101">
<view class="mask-bg" bindtap="hideCalendar"></view>
<view class="calendar-content">
<calendar activeDay="{{activeDate.date}}" kjId="{{kjIdCom}}" id="calendar" datelist="{{datelist}}" calendarConfig="{{calendarConfig}}" bind:afterCalendarRender="calendarReady" bind:onTapDay="onTapDay" bind:afterTapDay="afterTapDay"></calendar>
<calendar activeDay="{{activeDate.date}}" kjId="{{kjIdCom}}" gpId="{{gpIdCom}}" id="calendar" datelist="{{datelist}}" calendarConfig="{{calendarConfig}}" bind:afterCalendarRender="calendarReady" bind:onTapDay="onTapDay" bind:afterTapDay="afterTapDay"></calendar>
</view>
</view>

33
pages/order/postOrder/index.js

@ -14,7 +14,8 @@ Page({
postFee:0,
coupon:null,
sku_id:'',
kjId:null
kjId:null,
gp_id:null
},
/**
@ -23,14 +24,17 @@ Page({
onLoad: function (options) {
this.setData({
from:options.from,
kjId:app.globalData.kjId
kjId:app.globalData.kjId,
gp_id:app.globalData.gp_id || app.globalData.team_id
})
let price = 0,sku_id=[];
console.log(app.globalData.kjId)
app.globalData.postProduct.map(item=>{
if(!app.globalData.kjId){
if(!app.globalData.kjId && !this.data.gp_id){
price = price + item.sku.price * item.productNum;
}
else if(this.data.gp_id){
price = price + item.sku.event_price * item.productNum;
}
sku_id.push(item.sku.id)
})
this.setData({
@ -38,7 +42,7 @@ Page({
showPrice:app.globalData.kjId?0:price,
sku_id:sku_id.join(",")
})
if(!this.data.kjId){
if(!this.data.kjId && !this.data.gp_id){
this.couponCom = this.selectAllComponents("#coupon")[0];
}
@ -90,7 +94,7 @@ Page({
icon: 'none'
})
app.globalData.couponInfo = null;
if(!this.data.kjId){
if(!this.data.kjId && !this.data.gp_id){
this.couponCom.setNullCoupon()
}
this.setData({
@ -125,7 +129,9 @@ Page({
source:"WECHATXCX",
product_list:product_list,
coupon:this.data.coupon?this.data.coupon.id:null,
originate_order_id:this.data.kjId
originate_order_id:this.data.kjId,
gp_id:app.globalData.gp_id,
team_id:app.globalData.team_id
};
commonApi.user_post("order/create",{
data:JSON.stringify(data)
@ -137,6 +143,12 @@ Page({
})
this.onLoad({})
}
app.globalData.gp_id = null;
app.globalData.team_id = null;
this.setData({
gp_id:null
})
this.onLoad({});
})
},
getPostFee:function(){
@ -173,7 +185,7 @@ Page({
icon: 'none'
})
app.globalData.couponInfo = null;
if(!this.data.kjId){
if(!this.data.kjId && !this.data.gp_id){
this.couponCom.setNullCoupon()
}
this.setData({
@ -215,9 +227,12 @@ Page({
*/
onUnload: function () {
this.setData({
kjId:null
kjId:null,
gp_id:null
});
app.globalData.kjId = null;
app.globalData.gp_id = null;
app.globalData.team_id = null;
},
/**

6
pages/order/postOrder/index.wxml

@ -21,9 +21,9 @@
</view>
<view class="box-title" wx:if="{{from!='cart'}}">
<view style="flex:1">购票数量</view>
<view wx:if="{{!kjId}}" class="iconfont icon-sami-select" bindtap="minus" data-index="{{index}}"></view>
<view wx:if="{{!kjId && !gp_id}}" class="iconfont icon-sami-select" bindtap="minus" data-index="{{index}}"></view>
<view class="number-box">{{item.productNum}}</view>
<view wx:if="{{!kjId}}" class="iconfont icon-add-select" bindtap="add" data-index="{{index}}"></view>
<view wx:if="{{!kjId && !gp_id}}" class="iconfont icon-add-select" bindtap="add" data-index="{{index}}"></view>
</view>
<view class="box-title">
<view style="flex:1">运费</view>
@ -37,7 +37,7 @@
小计:<text class="unit">¥</text><text class="s-price">{{item.sku.price/100 * item.productNum}}</text>
</view>
</view>
<coupon id="coupon" wx:if="{{!kjId}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<coupon id="coupon" wx:if="{{!kjId && !gp_id}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<view style="height:113rpx"></view>
<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>

43
pages/order/scene/index.js

@ -18,7 +18,8 @@ Page({
type:null,
coupon:app.globalData.couponInfo,
isLogin:false,
kjId:null
kjId:null,
gp_id:null
},
/**
@ -27,17 +28,23 @@ Page({
onLoad: function (options) {
this.setData({
type:options.type,
kjId:app.globalData.kjId
kjId:app.globalData.kjId,
gp_id:app.globalData.gp_id || app.globalData.team_id
})
if(!app.globalData.product){
util.back();
return;
}
if(app.globalData.product.productNum){
this.setData({
productNum:app.globalData.product.productNum<1?1:app.globalData.product.productNum
})
}
this.setData({
product:app.globalData.product,
singlePrice:app.globalData.product.sku.price
singlePrice:this.data.gp_id?app.globalData.product.sku.event_price:app.globalData.product.sku.price
})
if(!this.data.kjId){
if(!this.data.kjId && !this.data.gp_id){
this.couponCom = this.selectAllComponents("#coupon")[0];
}
},
@ -48,7 +55,7 @@ Page({
title: '订单价格发生变化,请重新选择优惠券',
icon: 'none'
})
if(!this.data.kjId){
if(!this.data.kjId && !this.data.gp_id){
this.couponCom.setNullCoupon()
}
app.globalData.couponInfo = null;
@ -56,8 +63,12 @@ Page({
coupon:null
})
}
let productNum = linkmanList.length==0?1:linkmanList.length;
if(this.data.gp_id){
productNum = app.globalData.product.maxNum;
}
this.setData({
productNum:linkmanList.length==0?1:linkmanList.length,
productNum:productNum,
linkmanList:linkmanList
})
},
@ -81,7 +92,7 @@ Page({
icon: 'none'
})
}
if(!this.data.kjId){
if(!this.data.kjId && !this.data.gp_id){
this.couponCom.setNullCoupon()
}
app.globalData.couponInfo = null;
@ -99,14 +110,14 @@ Page({
this.setData({
coupon:null
})
if(!this.data.kjId){
if(!this.data.kjId && !this.data.gp_id){
this.couponCom.setNullCoupon()
}
app.globalData.couponInfo = null;
}
this.setData({
date:e.detail,
singlePrice:e.detail.price
singlePrice:this.data.gp_id?this.data.product.sku.event_price:e.detail.price
})
console.log(e.detail)
},
@ -161,7 +172,9 @@ Page({
remark:remark,
product_num:productNum
}],
originate_order_id:this.data.kjId
originate_order_id:this.data.kjId,
gp_id:app.globalData.gp_id,
team_id:app.globalData.team_id
}
commonApi.user_post("order/create",{
data:JSON.stringify(data)
@ -172,6 +185,12 @@ Page({
});
app.globalData.kjId = null;
}
if(app.globalData.gp_id){
this.setData({
gp_id:null
});
app.globalData.gp_id = null;
}
})
},
@ -212,9 +231,11 @@ Page({
*/
onUnload: function () {
this.setData({
kjId:null
kjId:null,
gp_id:null
});
app.globalData.kjId = null;
app.globalData.gp_id = null;
},
/**

6
pages/order/scene/index.wxml

@ -8,13 +8,13 @@
<view class="box">
<view class="box-title">
<view style="flex:1">购票数量</view>
<view class="iconfont icon-sami-select" wx:if="{{!kjId}}" bindtap="minus"></view>
<view class="iconfont icon-sami-select" wx:if="{{!kjId && !gp_id}}" bindtap="minus"></view>
<view class="number-box">{{productNum}}</view>
<view class="iconfont icon-add-select" wx:if="{{!kjId}}" bindtap="add"></view>
<view class="iconfont icon-add-select" wx:if="{{!kjId && !gp_id}}" bindtap="add"></view>
</view>
</view>
<contact wx:if="{{isLogin}}" bind:setLinkman="setLinkman"></contact>
<coupon wx:if="{{!kjId}}" id="coupon" money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon>
<coupon wx:if="{{!kjId && !gp_id}}" id="coupon" money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon>
<view class="box">
<view class="box-title">
<view style="flex-shrink:0">订单备注</view>

4
project.private.config.json

@ -25,8 +25,8 @@
"scene": null
},
{
"name": "pages/list/activitynew/index",
"pathName": "pages/list/activitynew/index",
"name": "pages/group/index",
"pathName": "pages/group/index",
"query": "id=0000000000LINELINEINFO18082257199008",
"scene": null
},

4
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) {

1
utils/util.js

@ -317,6 +317,7 @@ const gotoOrder = function(item){
}
}
// 砍价的去下单
// 拼团去下单也适用
const goKjOrder = function(item) {
return new Promise((resolve,reject)=>{
commonApi._post("product/get_product_detail",{

Loading…
Cancel
Save