Commit 65d8f033 by 严立

LL - 下单问题更新

parent d79ef437
......@@ -84,6 +84,8 @@ Page({
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品类型
'inventoriesId': funcResponse[i].inventorie[0].inventoriesId, // 仓库标识
'dateValid': App.modular.miment().format('YYYY.MM.DD'), // 有效时间
'dateInvalid': funcResponse[i].inventorie[0].cardNam, // 失效时间
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].inventorie[0].sightseerPrice, // 普通价
......@@ -126,6 +128,8 @@ Page({
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'dateValid': App.modular.miment().format('YYYY.MM.DD'), // 有效时间
'dateInvalid': App.modular.miment().format('YYYY.MM.DD'), // 失效时间
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价
......@@ -191,6 +195,8 @@ Page({
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品类型
'inventoriesId': funcResponse[i].inventorie[0].inventoriesId, // 仓库标识
'dateValid': App.modular.miment().format('YYYY.MM.DD'), // 有效时间
'dateInvalid': funcResponse[i].inventorie[0].cardNam, // 失效时间
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].inventorie[0].sightseerPrice, // 普通价
......@@ -233,6 +239,8 @@ Page({
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'dateValid': App.modular.miment().format('YYYY.MM.DD'), // 有效时间
'dateInvalid': App.modular.miment().format('YYYY.MM.DD'), // 失效时间
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价
......
// pages/myActivity/myActivity.js
// pages/myAppointment/myAppointment.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
navItem: [{
content: '全部',
type: '0'
},
navItem: [
// {content:'全部',type:'0'},
{
content: '未开始',
content: '夜间入园预约',
type: '1'
},
{
content: '进行中',
content: '看房预约',
type: '2'
},
{
content: '已结束',
type: '3'
},
],
height: 0,
data: [],
data: [ // 假数据数组,type=0入园预约,type=1 看房预约
// {title:'夜间入园预约',type:'0',time:'6月30日 20:00-24:00',num:3,url:'http://upload.miaomiao-bao.com/36acd202008141719598303.jpg'},
// {title:'看房预约',type:'1',time:'6月30日',num:3,url:' http://upload.miaomiao-bao.com/4c644202008141702599692.jpg'},
],
active: 0,
pageNo: 1,
pageSize: 10,
loading: false,
moreData: true,
},
goPlay() {
wx.switchTab({
url: '../../pages/play/play',
})
height: 0,
},
// 点击导航切换,默认是全部的
chageNav(e) {
let index = e.currentTarget.dataset.index
this.setData({
active: index,
pageNo: 1,
active: index
})
this.getMyActivityList()
this.getList(index)
},
activityDetail(e) {
//预约凭证
gohotelAccommodation(e) {
console.log(e)
wx.navigateTo({
url: '../activityDetail/activityDetail?enrollid=' + e.currentTarget.dataset.enrollid,
url: '../hotelAccommodation/hotelAccommodation?detail=' + JSON.stringify(e.currentTarget.dataset.item),
})
},
//预约
goAppoint(e) {
let type = e.currentTarget.dataset.index;
wx.navigateTo({
url: '/pages/appointment/appointment?type=' + type,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
height: wx.getSystemInfoSync().windowHeight, //获取屏幕的高度
})
this.getMyActivityList()
this.getList(this.data.active)
},
// 我的活动
getMyActivityList() {
let state = ''
switch (Number(this.data.active)) {
// 预约列表/我的预约
getList(index) {
let type = ''
switch (index) {
case 0:
state = '';
type = 0;
break;
case 1:
state = 0;
break;
case 2:
state = 1;
break;
case 3:
state = 2;
type = 1;
break;
}
var that = this
app.login({
success: function() {
that.setData({
loading: true
})
app.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: {
activeState: state,
pageSize: that.data.pageSize,
pageNo: that.data.pageNo
},
success: function(res) {
let list = res.data.list
let tmpArr = []
list.forEach(item => {
let state = item.activeState * 1
let type = 0
switch (state) {
case 0:
type = 1;
break;
case 1:
type = 0;
break;
case 2:
type = 2;
break;
}
let obj = {
time: item.enrollDate, //item.activeDate + ' ' + item.activeTime,
type: type,
content: item.address,
title: item.name,
enrollId: item.enrollId,
cover: item.cover,
}
tmpArr.push(obj)
})
if (that.data.pageNo != 1) {
tmpArr = that.data.data.concat(tmpArr)
}
that.setData({
data: tmpArr,
loading: false,
})
that.setData({
moreData: (that.data.data.length >= res.data.count * 1) ? false : true
})
},
fail: function(err) {
that.setData({
loading: false
})
let that = this
app.wxRequest({
url: '/api/v1/subscribe/getList',
data: {
state: '',
type: type //0 入园预约 1 看房预约 全部 空字符
},
success: function(res) {
let tmpArr = []
res.data.forEach(item => {
let type = item.type * 1
let title = ''
let url = ''
switch (type) {
case 0:
title = '夜间入园预约'
url = 'http://upload.miaomiao-bao.com/36acd202008141719598303.jpg'
break;
case 1:
title = '看房预约'
url = 'http://upload.miaomiao-bao.com/4c644202008141702599692.jpg'
break;
}
let obj = {
title: title,
type: type,
time: item.subscribeDate.substring(5, 11).replace('-', '月').replace(' ', '日') + ((type == 0) ? ' 20:00-24:00' : ''),
num: item.subscribeNum,
url: url,
id: item.id,
mobile: item.mobile,
name: item.name,
}
tmpArr.push(obj)
})
that.setData({
data: tmpArr
})
}
})
},
onReachBottom: function() {
if (this.data.loading || !this.data.moreData) {
return
}
this.data.pageNo += 1
this.getMyActivityList()
},
}
})
\ No newline at end of file
<navigation class="navigation" titleText="我的活动" backIcon="/image/back.png"></navigation>
<!--pages/myAppointment/myAppointment.wxml-->
<navigation class="navigation" titleText="我的预约" backIcon="/image/back.png"></navigation>
<view class="container all">
<view class="myActivity-container" style="min-height:{{height}}px;">
<view class="activity-nav">
<view class="myAppointment-nav">
<!-- 遍历头部导航 -->
<view bindtap="chageNav" data-index="{{index}}" wx:for="{{navItem}}" wx:key="index" class="navItem {{index == active? 'active':''}}">{{item.content}}</view>
</view>
<view class="activity-body">
<view class="my-activities-item " data-enrollid="{{item.enrollId}}" wx:for="{{data}}" wx:key="index" bindtap="activityDetail">
<view class="my-activities-top {{item.type == 2?'timeendColor':''}}">
{{item.time}}
</view>
<view class="my-activities-bottom">
<view class="activity-status {{item.type == 1 ?'stautsColor':(item.type == 2?'contentEndColor':'')}}">{{status.status(item.type)}}</view>
<view class="activity-contanier">
<image class="activity-contanier-img {{item.type == 2?'opcity':''}}" src="{{item.cover}}"></image>
<view class="my-activities-content">
<view class="my-activities-title {{item.type == 2?'contentEndColor':''}} clamp-ellipsis">{{item.title}}</view>
<view class="ellipsis itemContent {{item.type == 2?'contentEndColor':''}}">{{item.content}}</view>
</view>
<view style="width:80rpx;height:100%;display:flex;align-items: center;flex-direction: row-reverse;">
<l-icon name="right" color="rgb(172,172,174)" size="26" />
</view>
</view>
<view class="myAppointment-body">
<view class="myAppointment-item" wx:for="{{data}}" wx:key="index">
<image src="{{item.url}}" class="item-img"></image>
<view class="item-content">
<view class="item-title {{item.type == 0 ?'item-num-1' : ''}}">{{item.title}}</view>
<view class="item-time {{item.type == 1 ?'item-time-1' : ''}}">预约时间 {{item.time}}</view>
<view wx:if="{{item.type == 0}}" class="item-num">预约人数 {{item.num}}人</view>
</view>
<view class="button" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证</view>
</view>
</view>
<view class="noActive" hidden="{{data.length > 0}}">
<view class="noActive-title">暂无已报名的活动</view>
<view class="noActive-botton" bindtap="goPlay">发现畅玩活动</view>
</view>
</view>
<view class="noActive" hidden="{{data.length > 0 || active == 1}}">
<view class="noActive-title">暂无夜间入园预约</view>
<view class="noActive-rule">20:00后入园需要提前预约,每日限流200人</view>
<view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view>
</view>
<view class="noActive" hidden="{{data.length > 0 || active == 0}}">
<view class="noActive-title">暂无看房预约</view>
<view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view>
</view>
</view>
<!-- 状态值格式化 -->
<wxs module="status">
var status = function(type) {
if (type == 0) {
return '进行中'
} else if (type == 1) {
return '未开始'
} else {
return '已结束'
}
<wxs module="m1">
var getDate = function(date, type) {
return date.substring(5, 11).replace('-', '月').replace(' ', '日') + ((type == 0) ? ' 20:00-24:00' : '');
}
module.exports.status = status;
module.exports.getDate = getDate;
</wxs>
\ No newline at end of file
/* pages/myActivity/myActivity.wxss */
/* pages/myAppointment/myAppointment.wxss */
.myAppointment-nav {
width: 750rpx;
padding-top: 150rpx;
/* height: 95rpx; */
border-bottom: 1px solid rgb(238, 238, 238);
background: -webkit-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Safari 5.1 - 6.0 */
background: -o-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Firefox 3.6 - 15 */
background: linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* 标准的语法(必须放在最后) */
display: flex;
justify-content: space-around;
}
.all {
background-color: rgba(243, 244, 246, 1);
}
.myActivity-container {
.navItem {
font-size: 26rpx;
line-height: 95rpx;
color: rgb(156, 158, 163);
}
.active {
border-bottom: 3px solid rgb(0, 0, 2);
color: rgb(28, 27, 30);
}
.myAppointment-body {
width: 750rpx;
height: 100%;
/* min-height: 1000rpx; */
height: auto;
/* background-color: rgb(245, 244, 249); */
padding-top: 50rpx;
}
.noActive {
......@@ -47,167 +74,68 @@
margin-top: 64rpx;
}
.activity-nav {
width: 750rpx;
padding-top: 224rpx;
/* height: 95rpx; */
border-bottom: 1px solid rgb(238, 238, 238);
background: -webkit-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Safari 5.1 - 6.0 */
background: -o-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* Firefox 3.6 - 15 */
background: linear-gradient(rgb(255, 255, 255), rgb(249, 249, 251)); /* 标准的语法(必须放在最后) */
display: flex;
justify-content: space-around;
}
.navItem {
line-height: 95rpx;
color: #959da9;
}
.active {
border-bottom: 3px solid rgb(0, 0, 2);
color: #15191f;
}
.itemContent {
font-size: 26rpx;
color: rgba(149, 157, 169, 1);
}
.activity-body {
width: 750rpx;
/* min-height: 1400rpx; */
padding-top: 50rpx;
background-color: rgb(243, 244, 246, 1);
height: auto;
position: relative;
}
.my-activities-item {
width: 675rpx;
height: 280rpx;
position: relative;
margin: 0 auto;
.myAppointment-item {
width: 670rpx;
height: 360rpx;
margin: auto;
margin-bottom: 50rpx;
background-color: rgb(220, 214, 220);
border-radius: 4px;
position: relative;
overflow: hidden;
}
.my-activities-top {
position: absolute;
top: 0;
padding: 0 25rpx 0 25rpx;
height: 60rpx;
background-color: rgb(2, 0, 2);
color: white;
line-height: 60rpx;
z-index: 2;
border-radius: 3px;
font-size: 30rpx;
}
.my-activities-bottom {
.item-img {
width: 100%;
height: 250rpx;
position: absolute;
bottom: 0;
background-color: white;
border-radius: 3px;
}
.my-activities-title {
line-height: 2;
color: rgba(21, 25, 31, 1);
font-size: 30rpx;
height: 360rpx;
}
.my-activities-content {
color: rgb(169, 174, 181);
font-size: 26rpx;
padding-left: 50rpx;
line-height: 2;
.item-content {
width: 610rpx;
height: auto;
position: absolute;
bottom: 45rpx;
left: 30rpx;
}
.subscribe {
width: 150rpx;
height: 70rpx;
position: absolute;
border: 1px solid rgb(134, 137, 145);
border-radius: 3px;
right: 50rpx;
.item-title {
font-size: 36rpx;
line-height: 70rpx;
text-align: center;
font-size: 26rpx;
top: 92rpx;
}
.activity-status {
text-align: right;
/* line-height: 65rpx; */
padding-top: 32rpx;
padding-right: 30rpx;
color: rgb(154, 192, 227);
.item-time {
line-height: 48rpx;
font-size: 28rpx;
color: rgb(220, 214, 220);
}
.activity-contanier {
height: 160rpx;
width: 600rpx;
margin: auto;
display: flex;
align-items: center;
}
.activity-contanier-img {
width: 140rpx;
height: 136rpx;
}
.my-activities-content {
height: 140rpx;
width: 380rpx;
display: flex;
flex-direction: column;
justify-content: center;
}
.my-activities-title {
font-weight: 500;
letter-spacing: 1px;
}
/* 超出部分省略 */
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 两行超出部分省略 */
.clamp-ellipsis {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
.item-num {
font-size: 28rpx;
color: rgb(220, 214, 220);
line-height: 48rpx;
}
.opcity {
opacity: 0.6;
}
/* 入园标题样式 */
.timeendColor {
background: rgba(217, 222, 231, 1);
.item-num-1 {
color: rgb(244, 254, 255);
}
.contentEndColor {
color: rgba(194, 199, 207, 1);
.item-time-1 {
color: rgb(40, 50, 56);
}
/* 未开始字体颜色 */
.stautsColor {
color: rgb(164, 183, 133) !important;
.button {
width: 170rpx;
height: 70rpx;
position: absolute;
bottom: 45rpx;
right: 30rpx;
line-height: 70rpx;
text-align: center;
color: white;
background: rgba(255, 255, 255, 0.53);
border-radius: 3px;
font-size: 28rpx;
}
......@@ -18,6 +18,7 @@ Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
animation: {},
shopInfo: {},
orderId: '',
......@@ -113,7 +114,6 @@ Page({
case 1:
this.setData({
orderType: logicData.option.type,
buyContent: this.data.shoppingCartList[0].cover,
quantityTitle: '选择购买数量',
quantityTipText: '剩余库存',
......@@ -158,7 +158,6 @@ Page({
case 3:
this.setData({
orderType: logicData.option.type,
buyContent: this.data.shoppingCartList[0].cover,
quantityTitle: '选择购买数量',
quantityTipText: '剩余库存',
contactTitle: '填写购票人信息',
......@@ -340,6 +339,8 @@ Page({
shoppingCartList: funcShoppingCart,
payAmount: App.modular.utils.formatAmount(funcPayAmount),
})
console.log('shoppingCartList', this.data.shoppingCartList)
},
/**
......@@ -397,8 +398,42 @@ Page({
if (funcResponse.inventorie) {
funcRegisterTitle = funcResponse.inventorie[0].cardName
funcQuantityStock = funcResponse.inventorie[0].number
switch (funcRegisterTitle) {
case '年卡':
this.setData({
buyContent: 'pay/order-input/card-1.png',
})
break
case '月卡':
this.setData({
buyContent: 'pay/order-input/card-2.png',
})
break
case '':
this.setData({
buyContent: 'pay/order-input/card-3.png',
})
break
}
} else {
funcQuantityStock = funcResponse.number
switch (this.data.shopInfo.appId) {
case 1:
this.setData({
buyContent: 'pay/order-input/card-4.png',
})
break
case 3:
this.setData({
buyContent: 'pay/order-input/card-3.png',
})
break
}
}
this.setData({
registerTitle: funcRegisterTitle,
......@@ -662,7 +697,10 @@ Page({
'totalMoney': Number(this.data.payAmount),
'office': { 'id': this.data.shopInfo.id },
'smOrderDetails': funcCommodity,
'smPersonalDetails': funcUserInfo
'smPersonalDetails': funcUserInfo,
'name': funcRegisterInfo[0].name,
'mobilePhone': funcRegisterInfo[0].phone,
'goodType': this.data.shopInfo.shopType,
},
success: (response) => {
if (/价格不一致/.test(response.data.msg)) {
......
......@@ -5,7 +5,23 @@
<view class="buy-content" wx:if="{{winBuyContent}}">
<!-- 年卡月卡 -->
<view class="buy-content-pass" wx:if="{{orderType === 1}}">
<image src="{{buyContent}}"></image>
<image src="{{resourcesBase + buyContent}}"></image>
<view class="buy-content-pass-content col con-b">
<view class="col">
<text class="pass-content-title">{{shoppingCartList[0].name}}</text>
<text class="pass-content-price">{{'¥' + shoppingCartList[0].priceFinal + '/人'}}</text>
</view>
<view class="col">
<view class="row align-c">
<text class="pass-content-tip">{{'使用次数 '}}</text>
<text class="pass-content-tip">{{'不限'}}</text>
</view>
<view class="row align-c">
<text class="pass-content-tip">{{'有效期 '}}</text>
<text class="pass-content-tip">{{shoppingCartList[0].dateValid + ' - ' + shoppingCartList[0].dateInvalid}}</text>
</view>
</view>
</view>
</view>
<!-- 普通商品 -->
......@@ -21,7 +37,23 @@
<!-- 次票 -->
<view class="buy-content-pass" wx:if="{{orderType === 3}}">
<image src="{{buyContent}}"></image>
<image src="{{resourcesBase + buyContent}}"></image>
<view class="buy-content-pass-content col con-b">
<view class="col">
<text class="pass-content-title">{{shoppingCartList[0].name}}</text>
<text class="pass-content-price">{{'¥' + shoppingCartList[0].priceFinal + '/人'}}</text>
</view>
<view class="col">
<view class="row align-c">
<text class="pass-content-tip">{{'使用次数 '}}</text>
<text class="pass-content-tip">{{'1次'}}</text>
</view>
<view class="row align-c">
<text class="pass-content-tip">{{'有效期 '}}</text>
<text class="pass-content-tip">{{shoppingCartList[0].dateValid + ' - ' + shoppingCartList[0].dateInvalid}}</text>
</view>
</view>
</view>
</view>
<!-- 文创商品 -->
......
......@@ -52,6 +52,7 @@
/* 购买内容 - pass */
.buy-content-pass {
position: relative;
width: 670rpx;
height: 356rpx;
border-radius: 4px;
......@@ -64,6 +65,40 @@
height: 356rpx;
}
.buy-content-pass-content {
position: absolute;
top: 30rpx;
left: 24rpx;
width: 606rpx;
height: 276rpx;
}
.pass-content-title {
height: 58rpx;
font-size: 42rpx;
font-weight: 500;
line-height: 58rpx;
color: #FFFFFF;
}
.pass-content-price {
height: 58rpx;
margin-top: 8rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #FFFFFF;
}
.pass-content-tip {
height: 32rpx;
margin-top: 8rpx;
font-size: 22rpx;
font-weight: 500;
line-height: 32rpx;
color: #FFFFFF;
}
/* 购买内容 - service */
.buy-content-service {
width: 670rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment