Commit 09bb006f by 严立

LL - 确认订单静态

parent 88f2e258
......@@ -9,7 +9,7 @@ App({
globalData: {
appImageBase: '../../../image/',
appResourcesBase: 'https://sm-web.meiqicloud.com/userfiles/appResources/',
appResourcesBase: 'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/',
token: '',
refreshToken: '',
userInfo: null,
......
{
"pages": [
"pages/pay/order-input/order-input",
"pages/home/home/home",
"pages/home/dynamic/dynamic",
"pages/home/dynamic-detail/dynamic-detail",
......@@ -40,7 +42,8 @@
"pages/mine/question/question",
"pages/mine/question-more/question-more",
"pages/pay/home/home",
"pages/pay/order-input/order-input",
"pages/pay/order-detail/order-detail",
"pages/pay/coupon/coupon",
"pages/pay/coupon-input/coupon-input",
......
let App = getApp()
Page({
data: {
orderType: '年卡',
required: false,
isOld: true,
showNotice: false,
formItemNum: 1,
formItem: {},
formList: [],
formName: '',
formPhone: '',
formIdNum: '',
isSubmit: false
imageBase: App.globalData.appImageBase,
orderType: 6, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
buyContent: '',
buyPass: [
App.globalData.appResourcesBase + 'pay/content-pass-1.png'
],
required: false,
isOld: true,
showNotice: false,
formItemNum: 1,
formItem: {},
formList: [],
formName: '',
formPhone: '',
formIdNum: '',
isSubmit: false,
// 购买内容
buyContentCover: '',
buyContentTitle: '肌底补水保湿焕肤提华SPA套餐SPA套餐',
buyContentTime: '周一至周日 10:00-12:00',
buyContentAmount: '36.00',
// 购买清单
shoppingCartList: [{
cover: '',
name: 'aaaaa',
quantity: 12,
price: '60.50',
}, {
cover: '',
name: 'aaaaa',
quantity: 12,
price: '60.50',
}],
noticeText: '购买须知',
// 预约选择组件属性
entryDate: '',
entryStartDate: '',
entryEndDate: '',
// 数量选择组件属性
quantityTitle: '选择购买数量',
quantityError: '每笔订单购买数量上限为20',
quantityTipText: '剩余库存',
quantityTipNumber: 0,
quantity: 0,
quantityMax: 20,
quantityMin: 0,
// 购买人员信息
contactTitle: '填写购票人信息',
contactName: '',
contactPhone: '',
// 立即支付
payAmount: '59.00',
// 以下变量均为界面控制
winBuyContent: false, // 购买内容
winShoppingCart: false, // 购买清单
winNotice: false, // 购买须知
winNoticeTip: false, // 购买提示
winEntry: false, // 预约选择
winQuantity: false, // 数量选择
winContact: false, // 联系信息
winRegister: false, // 注册信息
winButtonPay: false, // 立即支付
winButtonAppointment: false, // 确认预约
},
onLoad() {
if (this.data.orderType === '年卡') {
let formItem = {}
let formList = []
formItem.name = '姓名'
formItem.phone = '手机号'
formItem.idNum = '身份证'
formList.push(formItem)
this.setData({
formItem,
formList
})
}
// this.setData({
// buyContent: this.data.buyPass[0]
// })
// if (this.data.orderType === '年卡') {
// let formItem = {}
// let formList = []
// formItem.name = '姓名'
// formItem.phone = '手机号'
// formItem.idNum = '身份证'
// formList.push(formItem)
// this.setData({
// formItem,
// formList
// })
// }
},
handleNotice() {
let showNotice = true
this.setData({
showNotice
})
let showNotice = true
this.setData({
showNotice
})
},
payOrder() {
wx.reLaunch({
url: '/pages/paySucc/index',
})
wx.reLaunch({
url: '/pages/paySucc/index',
})
},
handleItemNumEdit(e) {
const operation = e.currentTarget.dataset.operation
let formItemNum = this.data.formItemNum
let formItem = this.data.formItem
let formList = this.data.formList
if (formItemNum === 1 && operation === -1) {
console.log('至少买一个')
} else if (formItemNum === 20 && operation === 1) {
console.log('最多买20个')
} else if (operation === 1) {
formItemNum += operation
formList.push(formItem)
} else if (operation === -1) {
formItemNum += operation
formList.pop()
}
this.setData({
formItemNum,
formList
})
},
onInputBlur: function (event) {
console.log(event)
let funcType = event.target.dataset.type
let funcValue = event.detail.value
console.log(funcType, funcValue)
switch (funcType) {
case 'name':
this.setData({
formName: funcValue
})
break
case 'phone':
this.setData({
formPhone: funcValue
})
break
case 'idNum':
this.setData({
formPhone: funcValue
})
break
const operation = e.currentTarget.dataset.operation
let formItemNum = this.data.formItemNum
let formItem = this.data.formItem
let formList = this.data.formList
if (formItemNum === 1 && operation === -1) {
console.log('至少买一个')
} else if (formItemNum === 20 && operation === 1) {
console.log('最多买20个')
} else if (operation === 1) {
formItemNum += operation
formList.push(formItem)
} else if (operation === -1) {
formItemNum += operation
formList.pop()
}
this.inspectForm()
},
inspectForm: function () {
console.log(1)
if (this.data.formName === '') {
this.setData({
isSubmit: false,
errorName: '请填写姓名'
})
} else {
this.setData({
errorName: ''
formItemNum,
formList
})
}
if (this.data.formPhone === '') {
this.setData({
isSubmit: false,
errorPhone: '请输入正确的手机号码'
})
} else if (this.data.formPhone.length != 11) {
this.setData({
isSubmit: false,
errorPhone: '请输入正确的手机号码'
})
} else {
this.setData({
errorPhone: ''
})
}
if (this.data.formIdNum === '') {
},
onInputBlur: function(event) {
console.log(event)
let funcType = event.target.dataset.type
let funcValue = event.detail.value
console.log(funcType, funcValue)
switch (funcType) {
case 'name':
this.setData({
formName: funcValue
})
break
case 'phone':
this.setData({
formPhone: funcValue
})
break
case 'idNum':
this.setData({
formPhone: funcValue
})
break
}
this.inspectForm()
},
inspectForm: function() {
console.log(1)
if (this.data.formName === '') {
this.setData({
isSubmit: false,
errorName: '请填写姓名'
})
} else {
this.setData({
errorName: ''
})
}
if (this.data.formPhone === '') {
this.setData({
isSubmit: false,
errorPhone: '请输入正确的手机号码'
})
} else if (this.data.formPhone.length != 11) {
this.setData({
isSubmit: false,
errorPhone: '请输入正确的手机号码'
})
} else {
this.setData({
errorPhone: ''
})
}
if (this.data.formIdNum === '') {
this.setData({
isSubmit: false,
errorIdNum: '请输入正确的身份证号'
})
} else if (this.data.formIdNum.length != 16) {
this.setData({
isSubmit: false,
errorIdNum: '请输入正确的身份证号'
})
} else {
this.setData({
errorIdNum: ''
})
}
this.setData({
isSubmit: false,
errorIdNum: '请输入正确的身份证号'
isSubmit: true
})
} else if (this.data.formIdNum.length != 16) {
},
onQuantityCut: function () {
this.setData({
isSubmit: false,
errorIdNum: '请输入正确的身份证号'
quantity: this.data.quantity - 1
})
} else {
},
onQuantityAdd: function () {
this.setData({
errorIdNum: ''
quantity: this.data.quantity + 1
})
}
this.setData({
isSubmit: true
})
},
})
\ No newline at end of file
})
\ No newline at end of file
{
"usingComponents": {
"Tips": "../../components/Tips/Tips",
"Blank": "../../components/Blank/Blank"
},
"navigationBarTitleText": "确认订单"
"usingComponents": {},
"navigationStyle": "default",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "确认订单",
"navigationBarBackgroundColor": "#FFFFFF"
}
\ No newline at end of file
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