Browse Source

景点下单调整

master
shaojing 2 years ago
parent
commit
ae6f5113d8
  1. 2
      app.js
  2. BIN
      images/empty.png
  3. BIN
      images/empty2.png
  4. 297
      pages/order/components/contact/index.js
  5. 4
      pages/order/components/contact/index.json
  6. 110
      pages/order/components/contact/index.wxml
  7. 84
      pages/order/components/contact/index.wxss
  8. 6
      pages/order/orderList/index.js
  9. 19
      pages/order/orderList/index.wxml
  10. 98
      pages/order/scene/index.js
  11. 10
      pages/order/scene/index.wxml
  12. 9
      pages/user/order/museumOrderInfo/index.js
  13. 21
      pages/user/order/museumOrderInfo/index.wxml
  14. 2
      pages/user/order/sceneOrderInfo/index.js
  15. 33
      pages/user/order/sceneOrderInfo/index.wxml

2
app.js

@ -21,7 +21,7 @@ App({
unique_key: "wechatxcx"
}).then(res => {
let data = JSON.parse(res.data);
data.isTest = data.isTest115? true : false;
data.isTest = data.isTest116? true : false;
this.globalData.configJson = data
}).then(() => {
// 获取ui配置文件

BIN
images/empty.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

BIN
images/empty2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

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

@ -1,6 +1,7 @@
// pages/order/components/contact/index.js
import userApi from "../../../../utils/https/user"
import commonApi from "../../../../utils/https/common"
import util from "../../../../utils/util.js"
let app = getApp()
Component({
/**
@ -18,6 +19,26 @@ Component({
type:{
type:String,
value:""
},
productNum:{
type:Number,
value:1,
observer(nv, ov, path) {
if (nv) {
let num = nv-this.data.selectLinkman.length
this.setData({
showNum:num
})
}
}
},
is_authentication:{// 是否实名,0否1是,默认实名
type:String,
value:''
},
is_real_name:{// 是否是一证一票,0否1是,
type:String,
value:''
}
},
@ -29,11 +50,39 @@ Component({
linkmanList:[],
showMask:false,
editId:null,
isGroup:null
isGroup:null,
showManList:[],
showNum:0,
showAdd:false,
formData:{},
types:[],
selectIndex:0,
person:{},
personId:null,
r:[],
phone:'',//非实名时需要传的电话
},
lifetimes: {
attached: function() {
// 在组件实例进入页面节点树时执行
console.log(this.properties.productNum);
console.log(this.properties.is_real_name);
// if (this.properties.is_real_name == '1') {
this.setData({
showNum:this.properties.productNum
})
// }
// 不实名时直接获取手机号
if (this.properties.is_authentication) {
commonApi.user_post("uservice/user/getMyInfo",{}).then(res=>{
if(res.code==1){
this.setData({
phone:res.data.mobile
})
this.triggerEvent("setLinkman",{phone:this.data.phone})
}
})
}
// 获取默认联系人
commonApi.user_post("token/check").then(res=>{
this.setData({
@ -44,8 +93,11 @@ Component({
contactType:"CONTACT"
}).then(res=>{
if(res.data){
let length =[res.data].length
this.setData({
selectLinkman:[res.data]
selectLinkman:[res.data],
showNum:this.data.showNum-length,
showManList:[res.data]
})
this.triggerEvent("setLinkman",[res.data])
}
@ -53,6 +105,18 @@ Component({
})
}
})
// 获取证件列表
userApi.user_post("user/getCardTypeList", {}).then(r => {
console.log(r)
let data = [];
r.data.map(item=>{
data.push(item.title)
})
this.setData({
types: r.data,
typeList:data
})
})
},
detached: function() {
// 在组件实例被从页面节点树移除时执行
@ -61,7 +125,6 @@ Component({
pageLifetimes: {
show: function() {
// 页面被展示
if(this.data.editId){
let editId = this.data.editId;
userApi.user_post("user/getContactInfoById",{
@ -117,16 +180,60 @@ Component({
* 组件的方法列表
*/
methods: {
// getPhoneNumber:function(e) {
// console.log(e);
// const code = e.detail.code
// wx.request({
// url: `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${app.globalData.appId}&secret=${app.globalData.secret}`,
// method: 'GET',
// success:res=>{
// if(res.statusCode!==200) return
// const access_token = res.data.access_token
// wx.request({
// url: `https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=${access_token}`,
// method: 'POST',
// data: {
// code
// },
// success:data=>{
// if(data.statusCode!==200) return
// console.log(data.data.phone_info);
// debugger
// const { phoneNumber } = data.data.phone_info // 这里就是获取到的手机号
// }
// })
// }
// })
// },
gotoEdit:function(e){
this.setData({
editId:e.currentTarget.dataset.item.id
userApi.user_post("user/getContactInfoById", { id: e.currentTarget.dataset.item.id }).then(res => {
console.log(res);
res.data.isDefault = res.data.is_default == '1' ? true : false;
res.data.username = res.data.name;
res.data.mobile = res.data.tel;
res.data.idNumber = res.data.id_number;
console.log(res.data);
this.setData({
showMask:!this.data.showMask,
formData: res.data,
idTypeId: res.data.idcard_type,
editId:e.currentTarget.dataset.item.id,
selectIndex:this.data.types.findIndex(item=>item.type == res.data.idcard_type && item.code == res.data.document_type)
})
})
this.showAddMask()
},
showLinkman:function(){
this.setData({
showMask:!this.data.showMask
})
},
showAddMask:function(){
this.setData({
showAdd:!this.data.showAdd,
showMask:!this.data.showMask
})
},
cancel:function(){
let selectLinkman = this.data.selectLinkman,linkmanList = this.data.linkmanList;
linkmanList.map(linkman=>{
@ -142,6 +249,116 @@ Component({
})
this.showLinkman()
},
selectType:function(e){
this.setData({
selectIndex:e.detail.value
})
},
// 保存
save:function(){
if (!this.data.formData.username){
wx.showToast({
title: '请输入姓名!',
icon:"none"
})
return false;
}
if (!this.data.formData.mobile) {
wx.showToast({
title: '请输入手机号码!',
icon: "none"
})
return false;
}
if (!util.isTel(this.data.formData.mobile)) {
wx.showToast({
title: '请输入正确的手机号码!',
icon: "none"
})
return false;
}
// if (!this.data.idTypeId) {
// wx.showToast({
// title: '请选择证件类型!',
// icon: "none"
// })
// return false;
// }
// if (!this.data.formData.idNumber) {
// wx.showToast({
// title: '请输入证件号!',
// icon: "none"
// })
// return false;
// }
let data = this.data.formData;
data.idcard_type = this.data.types[this.data.selectIndex].type;
data.is_default = data.isDefault?'1':'0';
data.document_type = this.data.types[this.data.selectIndex].code;
data.id_number = this.data.formData.idNumber;
let service ="addNewContact";
if(this.data.editId){
data.contactId = this.data.editId;
service = "editContactById";
}
userApi.user_post("user/"+service,data).then(res=>{
if(res.code==1){
wx.showToast({
title: '保存成功!',
icon:"success",
success:function(){
// util.back();
}
})
this.setData({
showAdd:!this.data.showAdd
})
}
})
},
//取消添加出行人
del:function(){
this.setData({
formData:{},
showAdd:!this.data.showAdd
})
},
// 输入监听 不是双向绑定啊 绝望
nameInput:function(e){
var formData = this.data.formData;
formData.username = e.detail.value;
this.setData({
formData: formData
})
},
idNumberInput:function(e){
var formData = this.data.formData;
formData.idNumber = e.detail.value;
this.setData({
formData: formData
})
},
telInput:function(e){
var formData = this.data.formData;
formData.mobile = e.detail.value;
this.setData({
formData: formData
})
},
phoneInput:function(e){
this.setData({
phone: e.detail.value
})
this.triggerEvent("setLinkman",{phone:this.data.phone})
},
// 设为默认
setAddDefault:function(e){
var formData = this.data.formData;
formData.isDefault = e.detail.value;
this.setData({
formData: formData
})
},
confirm:function(){
let linkmanList = this.data.linkmanList,selectLinkman = [];
linkmanList.map(linkman=>{
@ -149,15 +366,23 @@ Component({
selectLinkman.push(linkman);
}
})
if(this.properties.maxNum!=-1 && selectLinkman.length>Number(this.properties.maxNum)){
wx.showToast({
title: '最多只能选择'+this.properties.maxNum+"个出行人",
icon:'none'
})
return;
}
// 需要 改成 根据父组件的购买数量
let showNum = this.properties.productNum
// let showNum = this.data.showNum
showNum = showNum-selectLinkman.length
let showManList = this.data.showManList
showManList = [...selectLinkman]
// if(this.properties.maxNum!=-1 && selectLinkman.length>Number(this.properties.maxNum)){
// wx.showToast({
// title: '最多只能选择'+this.properties.maxNum+"个出行人",
// icon:'none'
// })
// return;
// }
this.setData({
selectLinkman:selectLinkman
selectLinkman:selectLinkman,
showManList:showManList,
showNum:showNum
})
this.triggerEvent("setLinkman",selectLinkman)
this.showLinkman()
@ -210,17 +435,55 @@ Component({
wx.showLoading({
title: '加载中',
})
let index = e.currentTarget.dataset.index,selectLinkman = this.data.selectLinkman;
let index = e.currentTarget.dataset.index,selectLinkman = this.data.selectLinkman,showManList = this.data.showManList;
selectLinkman.splice(index,1);
showManList.splice(index,1);
this.triggerEvent("setLinkman",selectLinkman)
this.setData({
selectLinkman:selectLinkman
selectLinkman:selectLinkman,
showManList:showManList,
showNum:selectLinkman.length>0?this.data.showNum+1:1
})
wx.hideLoading()
},
select:function(e) {
console.log(e);
let item = e.target.dataset.item
if (this.properties.is_real_name == '1') { // 一证一票
this.selectIt(item)
} else {
this.selectOne(item)
}
},
// 一证一票不让他多选
selectOne:function(e) {
console.log(e);
let item = e,linkmanList = this.data.linkmanList,num = 0
linkmanList.map(linkman=>{
if(linkman.selected==1){
num++;
}
})
console.log(num);
linkmanList.map(linkman=>{
if(item.id==linkman.id){
// linkman.selected = linkman.selected==1?0:1;
linkman.selected = 1
}else {
linkman.selected = 0
}
})
console.log(linkmanList);
this.setData({
linkmanList
})
},
// 可多选
selectIt:function(e){
console.log(e,app.globalData.product)
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 && app.globalData.product.sku.sku_model.limit_type!=0?app.globalData.product.sku.sku_model.traveller_limit_num:-1);
console.log(e,app.globalData.product)
console.log(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 && app.globalData.product.sku.sku_model.limit_type!=0?app.globalData.product.sku.sku_model.traveller_limit_num:-1);
let item = e,linkmanList = this.data.linkmanList,num = 0,traveller_limit_num = this.properties.maxNum!=-1?this.properties.maxNum:(app.globalData.product.sku.sku_model && app.globalData.product.sku.sku_model.limit_type!=0?app.globalData.product.sku.sku_model.traveller_limit_num:-1);
// 先计算出全部选中的出行人
console.log(111)
linkmanList.map(linkman=>{

4
pages/order/components/contact/index.json

@ -1,4 +1,6 @@
{
"component": true,
"usingComponents": {}
"usingComponents": {
"add":"/pages/user/linkman/add"
}
}

110
pages/order/components/contact/index.wxml

@ -4,11 +4,20 @@
<view>{{isGroup==1?'发起人信息':'出行人信息'}}</view>
<view wx:if="{{isGroup==1}}" class="group-tip-text">(*预约发起后前往个人中心-团体预约订单中查看详情)</view>
</view>
<view class="contact-add" bindtap="showLinkman" wx:if="{{selectLinkman.length>0 && isGroup!=1}}"><text class="iconfont icon-add-select"></text>添加</view>
<view class="contact-add" bindtap="showLinkman" wx:if="{{selectLinkman.length>0 && isGroup!=1&&is_authentication != '0'}}"><text class="iconfont icon-add-select"></text>添加</view>
<view class="group-edit" bindtap="showLinkman" wx:if="{{isGroup==1 && selectLinkman.length>0}}">编辑</view>
</view>
<view wx:if="{{isGroup!=1}}">
<view class="contacts-list" wx:if="{{selectLinkman.length>0}}">
<!-- 不实名 -->
<view wx:if="{{is_authentication == '0'}}">
<view class="tel-input">
<text class="input-text">手机号</text>
<!-- <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button> -->
<input bindinput="phoneInput" type="number" value="{{phone}}" class="weui-input" placeholder="请输入手机号" />
</view>
</view>
<!-- 实名 -->
<!-- <view class="contacts-list" wx:if="{{selectLinkman.length>0}}">
<view class="contact-item" wx:for="{{selectLinkman}}">
<view class="iconfont icon-jian" bindtap="delLinkman" data-index="{{index}}"></view>
<view class="contact-info">
@ -18,11 +27,53 @@
</view>
<navigator bindtap="gotoEdit" data-item="{{item}}" url="/pages/user/linkman/add/index?id={{item.id}}&from=order" class="iconfont icon-bianji1"></navigator>
</view>
</view>
<view class="contacts-list" wx:else>
<view style="height:25rpx"></view>
</view> -->
<!-- <view class="contacts-list" wx:else> -->
<!-- <view style="height:25rpx"></view>
<view bindtap="showLinkman" class="add-btn1"><text class="iconfont icon-add-select"></text>添加</view>
<view style="height:25rpx"></view>
<view style="height:25rpx"></view> -->
<view class="contacts-list" wx:else>
<view wx:if="{{showManList.length>0}}" style="display: flex;position: relative;">
<view style="width: 550rpx;display: flex;overflow-x: scroll;">
<view class="name-box" wx:for="{{showManList}}">
<text>{{item.name}}</text>
<image class="name-selected-icon" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/scenicNew/dui.png" mode=""/>
</view>
</view>
<view class="more" bindtap="showLinkman">
更多>
</view>
</view>
<view class="contact-item" wx:for="{{selectLinkman}}" wx:if="{{selectLinkman.length>0}}">
<view class="iconfont icon-jian" bindtap="delLinkman" data-index="{{index}}"></view>
<view class="contact-info">
<view class="contact-name">{{item.name}}</view>
<view class="contact-other" style="margin-bottom:10rpx"><text>手机号</text>{{item.tel}}</view>
<view class="contact-other"><text>{{item.title}}</text>{{item.id_number}}</view>
</view>
<view bindtap="gotoEdit" data-item="{{item}}" class="iconfont icon-bianji1"></view>
<!-- <navigator bindtap="gotoEdit" data-item="{{item}}" url="/pages/user/linkman/add/index?id={{item.id}}&from=order" class="iconfont icon-bianji1"></navigator> -->
</view>
<view wx:if="{{is_real_name=='1'}}">
<view class="text1" bindtap="showLinkman" wx:for="{{showNum}}" wx:for-index="index" wx:if="{{showNum>0}}">
<view style="display: flex;align-items: center;">
<image style="width: 43.33rpx;height: 46rpx;margin-right: 28rpx;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/scenicNew/add.png" mode=""/>
<view style="margin-right: 36rpx;">出行人{{index+1}}</view>
<view>点击填写1位出行人信息</view>
</view>
<image style="width: 12rpx;height: 19.33rpx;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/scenicNew/rightIcon.png" mode=""/>
</view>
</view>
<view wx:if="{{is_real_name=='0' && selectLinkman.length==0}}">
<view class="text1" bindtap="showLinkman">
<view style="display: flex;align-items: center;">
<image style="width: 43.33rpx;height: 46rpx;margin-right: 28rpx;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/scenicNew/add.png" mode=""/>
<view style="margin-right: 36rpx;">出行人1</view>
<view>点击填写1位出行人信息</view>
</view>
<image style="width: 12rpx;height: 19.33rpx;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/scenicNew/rightIcon.png" mode=""/>
</view>
</view>
</view>
</view>
<view wx:else>
@ -43,18 +94,59 @@
<view bindtap="cancel">取消</view>
<view bindtap="confirm">确定</view>
</view>
<navigator url="/pages/user/linkman/add/index" class="add-btn">添加出行人</navigator>
<!-- <navigator url="/pages/user/linkman/add/index" class="add-btn">添加出行人</navigator> -->
<view class="add-btn" bindtap="showAddMask">添加出行人</view>
<view class="linkmanlist-item" wx:for="{{linkmanList}}">
<view class="linkmanlist-item-top">
<navigator bindtap="gotoEdit" data-item="{{item}}" url="/pages/user/linkman/add/index?id={{item.id}}&from=order" class="iconfont icon-bianji1"></navigator>
<!-- <navigator bindtap="gotoEdit" data-item="{{item}}" url="/pages/user/linkman/add/index?id={{item.id}}&from=order" class="iconfont icon-bianji1"></navigator> -->
<view bindtap="gotoEdit" data-item="{{item}}" class="iconfont icon-bianji1"></view>
<view class="linkman-nickname">{{item.name}}</view>
<view class="linkman-info">
<view class="linkman-tel" style="margin-bottom:20rpx">手机号 {{item.tel}}</view>
<view class="linkman-tel">{{item.title}}: {{item.id_number}}</view>
</view>
<view class="iconfont {{item.selected==1?'icon-gou':'icon-quan'}}" bindtap="selectIt" data-item="{{item}}"></view>
<view class="iconfont {{item.selected==1?'icon-gou':'icon-quan'}}" bindtap="select" data-item="{{item}}"></view>
</view>
<view class="linkmanlist-tip" bindtap="setDefault" data-item="{{item}}"><text class="iconfont {{item.is_default==1?'icon-iconfontoptionbutton':'icon-quan'}}"></text> 设为默认出行人</view>
</view>
</view>
</view>
<view wx:if="{{showAdd}}" class="mask">
<view class="mask-bg"></view>
<view style="position: fixed;bottom: 0;">
<view class="mask-content1">
<view class="btns1">
<view bindtap="del">取消</view>
<view>{{editId?'编辑':'添加'}}出行人</view>
<view bindtap="save">保存</view>
</view>
<view class="input-box" style="margin:0;padding: 0 24.67rpx;">
<view class="input-item">
<text class="input-label">姓名</text>
<input bindinput="nameInput" value="{{formData.username}}" class="weui-input" auto-focus placeholder="请输入姓名" />
</view>
<view class="input-item">
<text class="input-label">证件类型</text>
<picker class="weui-input select-card" bindchange="selectType" value="{{selectIndex}}" range="{{typeList}}">
<view class="picker" style="display: flex;justify-content: space-between;align-items: baseline;width: 480rpx;">
<view>{{typeList[selectIndex]}}</view>
<icon class="iconfont icon-xia"></icon>
</view>
</picker>
</view>
<view class="input-item">
<text class="input-label">证件号</text>
<input bindinput="idNumberInput" value="{{formData.idNumber}}" class="weui-input" placeholder="请输入证件号" />
</view>
<view class="input-item">
<text class="input-label">手机号</text>
<input bindinput="telInput" type="number" value="{{formData.mobile}}" class="weui-input" placeholder="请输入手机号" />
</view>
<view class="input-item">
<text class="input-label">设为默认</text>
<switch active-value="DEFAULT" inactive-value="NORMAL" checked="{{formData.isDefault}}" bindchange="setAddDefault" />
</view>
</view>
</view>
</view>
</view>

84
pages/order/components/contact/index.wxss

@ -10,11 +10,12 @@
}
.contacts-list {
border-top: 1rpx solid #ccc;
padding: 0 21rpx;
/* padding: 0 21rpx; */
padding: 42rpx 20rpx 18rpx;
}
.contact-item {
padding: 30rpx 0;
border-bottom: 1rpx solid #ccc;
/* border-bottom: 1rpx solid #ccc; */
display: flex;
align-items: center;
justify-content: space-between;
@ -69,6 +70,14 @@
margin-bottom: 10rpx;
line-height: 90rpx;
}
.btns1 {
display: flex;
justify-content: space-between;
font-size: 31rpx;
color: #000;
margin-bottom: 47.33rpx;
/* line-height: 90rpx; */
}
.add-btn {
line-height: 80rpx;
background: #FFFFFF;
@ -85,6 +94,13 @@
background: #F7F7F7;
max-height: 50%;
}
.mask-content1 {
width: 700rpx;
padding: 50rpx 20rpx 112rpx;
overflow-y: auto;
background: #F7F7F7;
max-height: 50%;
}
.linkmanlist-item {
background: white;
margin-bottom: 24rpx;
@ -167,4 +183,68 @@
color: #333333;
font-size: 30rpx;
justify-content: space-between;
}
.text1 {
display: flex;
padding: 16rpx 19.33rpx 17.33rpx 20rpx;
background: rgba(11,137,142,.06);
justify-content: space-between;
align-items: center;
font-weight: 400;
font-size: 27rpx;
color: #0B898E;
margin-bottom: 26.67rpx;
border-radius: 13rpx;
}
.name-box {
flex-shrink: 0;
margin-right: 15.33rpx;
width: 167rpx;
height: 73rpx;
background: rgba(11,137,142,0.06);
border-radius: 11rpx;
border: 2rpx solid #0B898E;
font-weight: 400;
font-size: 29rpx;
color: #000000;
text-align: center;
line-height: 73rpx;
position: relative;
}
.name-selected-icon {
width: 28rpx;
height: 28rpx;
position: absolute;
bottom: 0;
right: -2rpx;
}
.tel-input {
display: flex;
padding: 40rpx 20.67rpx 38.67rpx 21.33rpx;
border-top: 1rpx solid #ccc;
font-weight: 400;
font-size: 32rpx;
color: #000000;
}
.input-text {
margin-right: 70rpx;
}
.more {
width: 110rpx;
height: 73rpx;
background: #F1F1F1;
border-radius: 11rpx;
font-weight: 400;
font-size: 29rpx;
color: #0B898E;
line-height: 73rpx;
text-align: center;
position: absolute;
right: 0;
}

6
pages/order/orderList/index.js

@ -37,7 +37,8 @@ Page({
flag:options.flag,
// linkmanList: app.globalData.linkmanList
})
console.log('-------------',app.globalData.list);
console.log('-------------',this.data.ticketList);
// debugger
let price = 0, sku_id = [] ,postFee= 0;
app.globalData.postProduct.map(item => {
if (!app.globalData.kjId && !this.data.gp_id) {
@ -50,7 +51,8 @@ Page({
sku_id.push(item.sku.id)
})
app.globalData.list.map(item => {
price = price + item.sku.price * item.linkmanList.length;
// price = price + item.sku.price * item.linkmanList.length;
price = price + item.sku.price * item.num;
sku_id.push(item.sku.id)
})
this.setData({

19
pages/order/orderList/index.wxml

@ -42,15 +42,22 @@
{{item.sku.sku_name}}
</view>
<view>
<!-- X{{item.num}} -->
X{{item.linkmanList.length}}
X{{item.num}}
<!-- X{{item.linkmanList.length}} -->
</view>
</view>
<view style="padding-left: 10rpx;margin: 30rpx 0 22.67rpx;">出行人信息</view>
<view wx:for="{{item.linkmanList}}" style="padding-left: 10rpx;" wx:for-item="items">
<view class="text"><view class="text-left">姓名:</view>{{items.name}}</view>
<view class="text"><view class="text-left">证件号:</view>{{items.id_number}}</view>
<view class="text"><view class="text-left">手机号:</view>{{items.tel}}</view>
<view wx:if="{{item.sku.sku_model.is_authentication != 0}}">
<view wx:for="{{item.linkmanList}}" style="padding-left: 10rpx;" wx:for-item="items">
<view>
<view class="text"><view class="text-left">姓名:</view>{{items.name}}</view>
<view class="text"><view class="text-left">证件号:</view>{{items.id_number}}</view>
<view class="text"><view class="text-left">手机号:</view>{{items.tel}}</view>
</view>
</view>
</view>
<view wx:else>
<view class="text"><view class="text-left">手机号:</view>{{item.phone}}</view>
</view>
</view>
</view>

98
pages/order/scene/index.js

@ -33,6 +33,9 @@ Page({
showMask: false,
price:0,
is_need_idcard:1,
is_authentication:1, // 是否实名,0否1是,默认实名
phone:'', //不实名时传的手机号
is_real_name:1, // 是否是一证一票,0否1是,
},
/**
@ -50,10 +53,13 @@ Page({
date:null,
ticket_type:app.globalData.product.sku.ticket_type || 1,
isCar:options.isCar,
is_need_idcard:app.globalData.product.sku.sku_model.is_need_idcard
is_need_idcard:app.globalData.product.sku.sku_model.is_need_idcard,
is_authentication:app.globalData.product.sku.sku_model.is_authentication,
is_real_name:app.globalData.product.sku.sku_model.is_real_name,
})
console.log('-------',app.globalData.product.sku.sku_model.is_need_idcard);
console.log('---期票类型----',app.globalData.product.sku.ticket_type);
console.log('---是否实名----',app.globalData.product.sku.sku_model.is_authentication);
console.log('---一证一票----',app.globalData.product.sku.sku_model.is_real_name);
if (!app.globalData.product) {
util.back();
@ -65,7 +71,7 @@ Page({
})
}else{
this.setData({
productNum: app.globalData.product.num < 1 ? 1 : app.globalData.product.num
productNum: app.globalData.product.num == null ? 1 : app.globalData.product.num
})
}
this.setData({
@ -127,21 +133,27 @@ Page({
})
},
setLinkman: function (e) {
let linkmanList = e.detail;
if (this.data.productNum != linkmanList.length && this.data.coupon) {
wx.showToast({
title: '订单价格发生变化,请重新选择优惠券',
icon: 'none'
if (e.detail.phone) {
this.setData({
phone:e.detail.phone
})
// if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1) {
// this.couponCom.setNullCoupon()
// }
// app.globalData.couponInfo = null;
// this.setData({
// coupon: null
// })
}
let productNum = linkmanList.length == 0 ? 1 : this.data.productNum > linkmanList.length ? this.data.productNum : linkmanList.length;
}else {
console.log(e);
let linkmanList = e.detail;
if (this.data.productNum != linkmanList.length && this.data.coupon) {
wx.showToast({
title: '订单价格发生变化,请重新选择优惠券',
icon: 'none'
})
// if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1) {
// this.couponCom.setNullCoupon()
// }
// app.globalData.couponInfo = null;
// this.setData({
// coupon: null
// })
}
let productNum = linkmanList.length == 0 ? 1 : this.data.productNum < linkmanList.length ? linkmanList.length : this.data.productNum;
if (this.data.gp_id) {
productNum = app.globalData.product.maxNum;
}
@ -149,7 +161,9 @@ Page({
productNum: productNum,
linkmanList: linkmanList
})
this.changePrice()
// this.changePrice()
this.totalPrice(this.data.singlePrice)
}
},
add: function () {
if (this.data.productNum==undefined) {
@ -190,7 +204,7 @@ Page({
})
}
if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && !this.data.flag && this.data.type!='museum') {
this.couponCom.setNullCoupon()
// this.couponCom.setNullCoupon()
}
app.globalData.couponInfo = null;
@ -276,6 +290,13 @@ Page({
order:function() {
let linkmanList = this.data.linkmanList, productNum = this.data.productNum, date = this.data.date, time = this.data.time, remark = this.data.remark, product = this.data.product;
let linkmanIds = [];
if (linkmanList.length==0 && this.data.is_authentication == 1) {
wx.showToast({
title: '请选择出行人',
icon: 'none'
})
return
}
linkmanList.map(item => {
linkmanIds.push(item.id)
})
@ -291,12 +312,13 @@ Page({
use_date: date ? date.date : '',
visitors: linkmanIds.join(","),
remark: remark,
product_num: app.globalData.product.isGroup == 1 ? 1 : productNum
product_num: app.globalData.product.isGroup == 1 ? 1 : productNum,
phone:this.data.phone,// 不实名的时候传的手机号参数
}],
originate_order_id: this.data.kjId,
gp_id: app.globalData.gp_id,
team_id: app.globalData.team_id,
linkmanList:this.data.linkmanList
linkmanList:this.data.is_authentication == 1?this.data.linkmanList:[]
}
if (app.globalData.from) {
data.system_name = app.globalData.from;
@ -321,8 +343,14 @@ Page({
postData.type = 1;
}
if(app.globalData.list){
app.globalData.list[app.globalData.index] = this.data.product
app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList
app.globalData.list[app.globalData.index] = this.data.product
// app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList
if (app.globalData.list[app.globalData.index].sku.sku_model.is_authentication == 0) {
app.globalData.list[app.globalData.index].phone = this.data.phone
app.globalData.list[app.globalData.index].linkmanList = []
}else {
app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList
}
}
// app.globalData.linkmanList = this.data.linkmanList
app.globalData.ticketPrice += (this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0))/100;
@ -331,8 +359,9 @@ Page({
if(app.globalData.createDate){
app.globalData.createDate.product_list.push(data.product_list[0])
}else{
app.globalData.createDate = data
app.globalData.createDate = data
}
console.log(app.globalData.createDate);
app.globalData.index = app.globalData.index + 1
app.globalData.product = app.globalData.list[app.globalData.index]
wx.redirectTo({
@ -391,6 +420,20 @@ Page({
})
return
}
if (linkmanList.length!=productNum && this.data.is_authentication == 1 && this.data.is_real_name == 1) {
wx.showToast({
title: '购票数量要和出行人数量一致',
icon: 'none'
})
return
}
if (!util.isTel(this.data.phone) &&this.data.is_authentication == 0) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
return
}
if (!time && date && date.is_time_stock == true) {
wx.showToast({
title: '请选择使用时间',
@ -405,6 +448,13 @@ Page({
})
return;
}
// if (this.data.phone) {
// linkmanList.map(item => {
// linkmanIds.push(item.id)
// })
// }
// console.log(app.globalData);
// debugger
this.setData({
showMask:true
})

10
pages/order/scene/index.wxml

@ -21,7 +21,7 @@
<view class="iconfont icon-add-select" wx:if="{{!kjId && !gp_id && type!='activity'}}" bindtap="add"></view>
</view>
</view>
<contact wx:if="{{isLogin}}" type="{{type}}" bind:setLinkman="setLinkman"></contact>
<contact wx:if="{{isLogin}}" type="{{type}}" bind:setLinkman="setLinkman" productNum="{{productNum}}" is_authentication="{{is_authentication}}" is_real_name="{{is_real_name}}"></contact>
<!-- 补贴 -->
<view class="box">
<view class="box-title allowance" wx:if="{{allowance_price}}">
@ -64,7 +64,7 @@
<view class="dialog-top">
<view class="scene-title">{{product.product.title}}-{{product.sku.sku_name}}</view>
<view class="people-message">出行人信息</view>
<view style="max-height:430rpx;overflow: scroll;">
<view style="max-height:430rpx;overflow: scroll;" wx:if="{{is_authentication=='1'}}">
<view class="people" wx:for="{{linkmanList}}">
<view class="flex">
<view>姓名:</view>
@ -80,6 +80,12 @@
</view>
</view>
</view>
<view wx:else>
<view class="flex" style="margin: 10rpx 0 30rpx;">
<view>手机号:</view>
<view style="color: #333;">{{phone}}</view>
</view>
</view>
</view>
<view class="bottom-btn">
<view class="cancle" bindtap="cancel">取消</view>

9
pages/user/order/museumOrderInfo/index.js

@ -20,7 +20,9 @@ Page({
id:null,
minute:"",
second:"",
ids:[]
ids:[],
is_authentication:1, // 是否实名0否1是
phone:'',// 非实名时的电话
},
/**
@ -207,8 +209,11 @@ Page({
isRefund:state.indexOf("REFUND")!=-1,
info:res.data,
product_model:res.data.order_product_list[0].product_model,
ids: proId.join(",")
ids: proId.join(","),
is_authentication:res.data.order_product_list[0].sku_model.is_authentication,
phone:res.data.order_product_list[0].phone
})
console.log(res.data.order_product_list[0]);
this.getCodeImg()
// 获取行程规划
let that = this;

21
pages/user/order/museumOrderInfo/index.wxml

@ -71,15 +71,22 @@
</view>
<view class="box" wx:if="{{info}}">
<view class="box-title">出行人信息</view>
<view wx:for="{{info.order_product_list[0].contacts_info}}">
<view wx:if="{{is_authentication == 0}}">
<view class="detail-item">
<text>姓名:{{item.name}}</text>
<text>手机号:{{phone}}</text>
</view>
<view class="detail-item">
<text>{{item.title}}:{{item.id_number}}</text>
</view>
<view class="detail-item" wx:if="{{item.tel}}">
<text>手机号:{{item.tel}}</text>
</view>
<view wx:else>
<view wx:for="{{info.order_product_list[0].contacts_info}}">
<view class="detail-item">
<text>姓名:{{item.name}}</text>
</view>
<view class="detail-item">
<text>{{item.title}}:{{item.id_number}}</text>
</view>
<view class="detail-item" wx:if="{{item.tel}}">
<text>手机号:{{item.tel}}</text>
</view>
</view>
</view>
</view>

2
pages/user/order/sceneOrderInfo/index.js

@ -285,6 +285,8 @@ Page({
product_model:"ticket"||res.data.order_product_list[0].product_model,
ids: proId.join(",")
})
console.log(res.data);
// debugger
console.log('ids',this.data.ids);
this.getCodeImg()
// 获取行程规划

33
pages/user/order/sceneOrderInfo/index.wxml

@ -88,20 +88,27 @@
<view>出行人信息</view>
<view bindtap="showMsg" data-msg="cxr1" style="color: rgb(49, 154, 158);">{{cxr1Text}}</view>
</view>
<view wx:if="{{cxr1}}" wx:for="{{item.contacts_info}}">
<view class="line" wx:if="{{index!=0}}"></view>
<view class="detail-item">
<text>姓名: {{item.name}}</text>
<!-- <text>¥168</text> -->
</view>
<view class="detail-item">
<text>{{cardTypes[item.idcard_type]}}:{{item.id_number}}</text>
<!-- <text>-¥10</te、xt> -->
</view>
<view wx:if="{{item.sku_model.is_authentication == 0}}">
<view class="detail-item">
<text>手机号: {{item.tel}}</text>
<!-- <text>-¥10</text> -->
</view>
<text>手机号: {{item.phone}}</text>
</view>
</view>
<view wx:else>
<view wx:if="{{cxr1}}" wx:for="{{item.contacts_info}}">
<view class="line" wx:if="{{index!=0}}"></view>
<view class="detail-item">
<text>姓名: {{item.name}}</text>
<!-- <text>¥168</text> -->
</view>
<view class="detail-item">
<text>{{cardTypes[item.idcard_type]}}:{{item.id_number}}</text>
<!-- <text>-¥10</te、xt> -->
</view>
<view class="detail-item">
<text>手机号: {{item.tel}}</text>
<!-- <text>-¥10</text> -->
</view>
</view>
</view>
</view>
<view wx:if="{{item.product_model=='ticket'}}">

Loading…
Cancel
Save