Browse Source

规格添加数量

master
Enzo 4 years ago
parent
commit
aa7c9fbbe4
  1. 324
      components/zwy-calendar/zwy-calendar.vue
  2. 62
      pages/goodsDetail/index.vue
  3. 410
      pages/order/confirm_order.vue
  4. 43
      pages/order/order_details.vue
  5. BIN
      static/defult_code.png
  6. BIN
      static/images/jieson.png
  7. BIN
      static/images/other.png
  8. BIN
      static/images/plane_ticket.png
  9. BIN
      static/images/strategy.png
  10. BIN
      static/images/travel.png
  11. BIN
      static/logo.png
  12. 3
      uview-ui/components/u-calendar/u-calendar.vue

324
components/zwy-calendar/zwy-calendar.vue

@ -1,324 +0,0 @@
<template>
<view class="calendar-box">
<view class="month lf-p-l-10 lf-p-r-10">
<view @click="lastMonth" v-if="havePre">上月</view>
<view>{{year}}{{month}}</view>
<view @click="nextMonth" v-if="haveNext">下月</view>
</view>
<view class="week">
<view v-for="weeks in weekArr">{{weeks}}</view>
</view>
<view class="day">
<view :class="[{'checkday':days.date==''},{'choose':days.flag==true}]"
:style="'background:'+(days.flag==true?bgday:'')+';'" v-for="(days,index) in dayArr" :key="index">
{{days.day}}
<view :class="[{'circle':days.flag},{'repair':days.day<day},{'sign':days.day==day}]"></view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
lang: {
type: String,
default: 'zh'
},
type: {
type: String,
default: 'calendar'
},
checkDate: {
type: Boolean,
default: false
},
bgweek: {
type: String,
default: '#1998FE'
},
bgday: {
type: String,
default: '#1998FE'
},
startTime: {
type: String,
default: ''
},
endTime: {
type: String,
default: ''
}
},
data() {
return {
weeked: '', //
dayArr: [], //
localDate: '', //
day: new Date().getDate(), //
year: new Date().getFullYear(), //
month: new Date().getMonth() + 1, //
weekArr: ['日', '一', '二', '三', '四', '五', '六'], //
selfDays: 0,
havePre: false,
haveNext: false
}
},
onShow() {
},
mounted() {
let that = this;
that.dateDiff(that.startTime,that.endTime);
//
that.initDate();
//
that.localDate = that.year + '-' + that.formatNum(that.month) + '-' + that.formatNum(that.day);
//
if (that.lang != 'zh') that.weekArr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
//
that.weeked = that.weekArr[new Date().getDay()];
//
if (that.type != 'calendar') {
for (let i in that.dayArr) {
let chooseList = []
if(that.selfDays) {
var dataStart = that.startTime.split('-');
var endStart = that.endTime.split('-');
let numberStart = Number(dataStart[2])
let nowMonth = new Date().getMonth() + 1;
let splitStartMonth = dataStart[1];
let splitEndMonth = endStart[1];
console.log('当前月',nowMonth)
console.log('传来的月份',that.month)
if(that.month < nowMonth) {
console.log('小于当前月')
this.havePre = true
}else if(splitEndMonth > nowMonth){
console.log('大于当前月')
this.haveNext = true
}
var totalDays = Number(that.selfDays) + Number(dataStart[2]);
for(let j = numberStart;j < totalDays;j++) {
if(that.dayArr[i].day == j && that.dayArr[i].date) {
that.$set(that.dayArr[i], 'flag', true);
}
}
}
// that.$set(that.dayArr[i], 'flag', false);
}
}
},
methods: {
//
changeDate(e) {
let that = this;
that.year = parseInt(e.detail.value.split('-')[0]);
that.month = parseInt(e.detail.value.split('-')[1]);
that.initDate();
},
//
signToday(obj, index) {
let that = this;
// 访
if (that.type == 'calendar') return;
//
if ((new Date().getMonth() + 1) != parseInt(obj.date.split('-')[1])) return;
//
if (obj.date != '' && obj.day <= that.day) {
//
if (that.dayArr[index].flag) {
uni.showToast({
title: '已签到',
icon: 'none'
});
} else {
uni.showToast({
title: that.day > obj.day ? '补签成功' : '签到成功',
icon: 'success'
});
that.$set(that.dayArr[index], 'flag', true);
that.$emit('change', obj.date);
}
}
},
dateDiff(sDate1,sDate2) {
var aDate, oDate1, oDate2, iDays;
aDate = sDate1.split('-');
console.log('addate',aDate[1])
if(aDate[1] == '01') {
this.month = 1
}else if (aDate[1] == '02') {
this.month = 2
}else if (aDate[1] == '03') {
this.month = 3
}else if (aDate[1] == '04') {
this.month = 4
}else if (aDate[1] == '05') {
this.month = 5
}else if (aDate[1] == '06') {
this.month = 6
}else if (aDate[1] == '07') {
this.month = 7
}else if (aDate[1] == '08') {
this.month = 8
}else if (aDate[1] == '09') {
this.month = 9
}else{
this.month = Number(aDate[1])
}
if(aDate[1])
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
aDate = sDate2.split('-');
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
iDays = parseInt(Math.abs(oDate1 - oDate2) /1000/60/60/24);
this.selfDays = iDays+1;
return iDays + 1;
},
//
initDate() {
let that = this;
that.dayArr = [];
//
let totalDay = new Date(that.year, that.month, 0).getDate();
//
for (let i = 1; i <= totalDay; i++) {
//
let value = (new Date(that.year, that.month - 1, i)).getDay();
//
if (i == 1 && value != 0) that.addBefore(value);
//
let obj = {};
obj.date = that.year + '-' + that.formatNum(that.month) + '-' + that.formatNum(i);
obj.day = i;
that.dayArr.push(obj);
if (i == totalDay && value != 6) that.addAfter(value);
}
},
//
addBefore(value) {
let that = this;
let totalDay = new Date(that.year, that.month - 1, 0).getDate();
for (let i = 0; i < value; i++) {
let obj = {};
obj.date = '';
obj.day = totalDay - (value - i) + 1;
that.dayArr.push(obj);
}
},
//
addAfter(value) {
let that = this;
for (let i = 0; i < (6 - value); i++) {
let obj = {};
obj.date = '';
obj.day = i + 1;
that.dayArr.push(obj);
}
},
//
formatNum(num) {
return num < 10 ? ('0' + num) : num;
},
//
lastMonth() {
let that = this;
if (that.month == 1) {
that.year -= 1;
that.month = 12;
} else {
that.month -= 1;
}
that.initDate();
},
//
nextMonth() {
let that = this;
if (that.month == 12) {
that.year += 1;
that.month = 1;
} else {
that.month += 1;
}
that.initDate();
}
}
}
</script>
<style scoped>
.calendar-box {
width: 100%;
flex-direction: column;
justify-content: center;
}
.calendar-box,
.month,
.week,
.day {
display: flex;
align-items: center;
justify-content: space-between;
}
.month,
.week,
.day {
width: 700rpx;
}
.month {
margin: 30rpx 0;
position: relative;
}
.picker {
width: 160rpx;
height: 40rpx;
position: absolute;
top: 20rpx;
left: 50%;
transform: translate(-50%, -50%);
}
.day {
flex-wrap: wrap;
}
.week>view,
.day>view {
width: 100rpx;
height: 100rpx;
text-align: center;
position: relative;
line-height: 100rpx;
}
.checkday {
color: #999;
}
.choose {
color: #FFFFFF;
border-radius: 50%;
}
.circle {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
position: absolute;
bottom: 10%;
left: 50%;
transform: translate(-50%, -50%);
}
.sign {
background-color: #0089fe;
}
.repair {
background-color: #1998FE;
}
</style>

62
pages/goodsDetail/index.vue

@ -88,9 +88,9 @@
<u-popup class="pop-self" v-model="scenic_spot" mode="bottom" :closeable="true" border-radius="20">
<view class="lf-p-32">
<view class="price lf-flex">
<lf-price :price="choose_date_price || goods_detail.spec[type_index].price"></lf-price>
<lf-price :price="choose_date_price*buy_num || goods_detail.spec[type_index].price*buy_num"></lf-price>
<view class="pop-price lf-m-l-20 lf-font-24">
¥{{ choose_date_orangilprice || goods_detail.spec[type_index].original_price }}</view>
¥{{ choose_date_orangilprice*buy_num || goods_detail.spec[type_index].original_price*buy_num}}</view>
</view>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
使用时间{{ go_date }}
@ -118,6 +118,12 @@
</view>
</view>
</view>
<view class="lf-m-t-30 lf-row-between">
<view class="lf-font-28 lf-color-gray">数量</view>
<view>
<u-number-box :min="1" v-model="buy_num" @change="valChange"></u-number-box>
</view>
</view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
@ -195,9 +201,9 @@
<u-popup v-model="hotel" mode="bottom" :closeable="true" border-radius="20">
<view class="lf-p-32">
<view class="price lf-flex">
<lf-price :price="total_hotel_price || goods_detail.spec[type_index].price"></lf-price>
<lf-price :price="total_hotel_price*buy_num || goods_detail.spec[type_index].price*buy_num"></lf-price>
<view class="pop-price lf-m-l-20 lf-font-24">
¥{{ total_hotel_orginalprice || goods_detail.spec[type_index].original_price }}</view>
¥{{ total_hotel_orginalprice*buy_num || goods_detail.spec[type_index].original_price*buy_num }}</view>
</view>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
酒店住房日期{{live_date}}~{{leave_date}}
@ -232,6 +238,12 @@
</view>
</view>
</view>
<view class="lf-m-t-30 lf-row-between">
<view class="lf-font-28 lf-color-gray">数量</view>
<view>
<u-number-box :min="1" v-model="buy_num" @change="valChange"></u-number-box>
</view>
</view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
@ -273,9 +285,9 @@
<u-popup v-model="travel_route" mode="bottom" :closeable="true" border-radius="20">
<view class="lf-p-32">
<view class="price lf-flex">
<lf-price :price="choose_date_price || goods_detail.spec[type_index].price"></lf-price>
<lf-price :price="choose_date_price*buy_num || goods_detail.spec[type_index].price*buy_num"></lf-price>
<view class="pop-price lf-m-l-20 lf-font-24">
¥{{ choose_date_orangilprice || goods_detail.spec[type_index].original_price }}</view>
¥{{ choose_date_orangilprice*buy_num || goods_detail.spec[type_index].original_price*buy_num}}</view>
</view>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
套餐类型{{goods_detail.spec[type_index].name}}
@ -302,6 +314,12 @@
</view>
</view>
</view>
<view class="lf-m-t-30 lf-row-between">
<view class="lf-font-28 lf-color-gray">数量</view>
<view>
<u-number-box :min="1" v-model="buy_num" @change="valChange"></u-number-box>
</view>
</view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
@ -311,9 +329,9 @@
<u-popup v-model="car" mode="bottom" :closeable="true" border-radius="20">
<view class="lf-p-32">
<view class="price lf-flex">
<lf-price :price="choose_date_price || goods_detail.spec[type_index].price"></lf-price>
<lf-price :price="choose_date_price*buy_num || goods_detail.spec[type_index].price*buy_num"></lf-price>
<view class="pop-price lf-m-l-20 lf-font-24">
¥{{ choose_date_orangilprice || goods_detail.spec[type_index].original_price }}</view>
¥{{ choose_date_orangilprice*buy_num || goods_detail.spec[type_index].original_price*buy_num}}</view>
</view>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
套餐类型{{goods_detail.spec[type_index].name}}
@ -340,6 +358,12 @@
</view>
</view>
</view>
<view class="lf-m-t-30 lf-row-between">
<view class="lf-font-28 lf-color-gray">数量</view>
<view>
<u-number-box :min="1" v-model="buy_num" @change="valChange"></u-number-box>
</view>
</view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
@ -349,9 +373,9 @@
<u-popup v-model="single" mode="bottom" :closeable="true" border-radius="20">
<view class="lf-p-32">
<view class="price lf-flex">
<lf-price :price="choose_date_price || goods_detail.spec[type_index].price"></lf-price>
<lf-price :price="choose_date_price*buy_num || goods_detail.spec[type_index].price*buy_num"></lf-price>
<view class="pop-price lf-m-l-20 lf-font-24">
¥{{ choose_date_orangilprice || goods_detail.spec[type_index].original_price }}</view>
¥{{ choose_date_orangilprice*buy_num || goods_detail.spec[type_index].original_price*buy_num}}</view>
</view>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
套餐类型{{goods_detail.spec[type_index].name}}
@ -381,6 +405,12 @@
</view>
</view>
</view>
<view class="lf-m-t-30 lf-row-between">
<view class="lf-font-28 lf-color-gray">数量</view>
<view>
<u-number-box :min="1" v-model="buy_num" @change="valChange"></u-number-box>
</view>
</view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
@ -433,7 +463,6 @@
</template>
<script>
import zwyCalendar from '@/components/zwy-calendar/zwy-calendar.vue'
export default {
data() {
return {
@ -445,6 +474,7 @@
minute: true,
second: false
},
buy_num: 1,
year: new Date().getFullYear(), //
month: new Date().getMonth() + 1, //
now_time: '',
@ -487,9 +517,6 @@
hotel_show_single: false
}
},
components: {
zwyCalendar
},
onLoad(options) {
this.goods_id = options.goods_id || options.id;
@ -504,6 +531,9 @@
}
},
methods: {
valChange(e) {
this.buy_num = e.value;
},
changeArrive(e) {
let arrrive_day = e.year+'-'+e.month+'-'+e.day;
this.compareDate(arrrive_day)
@ -703,7 +733,7 @@
this.$url('/pages/order/confirm_order?goods_id=' + goods_id + '&spec_id=' + spec_id +
'&goods_type=' + godds_type + '&check_in_time=' + check_in_time + '&goods_typetext=' +
type_text + '&check_out_time=' + check_out_time + '&arrival_time=' + arrival_timedate +
'&totalLive=' + totalLive+'&form_type='+form_type);
'&totalLive=' + totalLive+'&form_type='+form_type+'&buy_num='+this.buy_num);
}else {
if(this.go_date=='请选择使用时间') {
this.$msg('请选择使用时间!')
@ -717,7 +747,7 @@
let form_type = encodeURIComponent(JSON.stringify(this.goods_detail.product.diy_form));
this.$url('/pages/order/confirm_order?goods_id=' + goods_id + '&spec_id=' + spec_id +
'&goods_type=' + godds_type + '&departure_time=' + departure_time +
'&goods_typetext=' + type_text+'&form_type='+form_type);
'&goods_typetext=' + type_text+'&form_type='+form_type+'&buy_num='+this.buy_num);
}
},
//

410
pages/order/confirm_order.vue

@ -1,7 +1,7 @@
<template>
<view v-if="$isRight(goods_details)">
<view class="bg-white" v-if="enter_type!=1">
<view class="cu-bar1 padding-lr">
<!-- <view class="cu-bar1 padding-lr">
<text class="lf-color-555 lf-font-28">联系人</text>
<input type="text" v-model="contact" class="lf-color-999 lf-font-28 lf-text-left" style="position:absolute;right:180rpx" placeholder="请输入联系人" />
</view>
@ -13,60 +13,42 @@
<button style="position: absolute;right: 0rpx;" class="lf-bg-white" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<u-icon name="phone"></u-icon>
</button>
</view>
<view class="cu-bar1 padding-lr" v-if="goods_type!=3">
<text class="lf-color-555 lf-font-28">身份证号码</text>
<input type="text" v-model="vertify_code" @blur="computedAge()" class="lf-color-999 lf-font-28 lf-text-left" style="position:absolute;right:180rpx" placeholder="请输入身份证号码"/>
</view>
<view class="cu-bar1 padding-lr" v-if="goods_type!=3">
<text class="lf-color-555 lf-font-28">性别</text>
<input type="text" v-model="sex" disabled class="lf-color-999 lf-font-28 lf-text-left" style="position:absolute;right:180rpx" placeholder="请输入性别"/>
</view>
<view class="cu-bar1 padding-lr" v-if="goods_type!=3">
<text class="lf-color-555 lf-font-28">年龄</text>
<input type="number" v-model="age" disabled class="lf-color-999 lf-font-28 lf-text-left" style="position:absolute;right:180rpx" placeholder="请输入年龄"/>
</view>
<view class="padding-lr lf-m-b-40 lf-m-t-30">
<text class="lf-color-555 lf-font-28">是否携带小孩(单选)</text>
<view class="lf-m-t-20">
<u-radio-group v-model="value" @change="radioGroupChange">
</view> -->
<view class="padding-lr lf-m-b-40 lf-m-t-30" :class="item.type == 'text'?'lf-row-between':''" v-for="(item,index) of form_list" :key="index">
<text class="lf-color-555 lf-font-28" v-once>{{item.field}}</text>
<input type="text" v-if="item.type == 'text'" v-model="info[item.field]" @blur="computedAge()" class="lf-color-999 lf-font-28 lf-text-left" style="position:absolute;right:180rpx" :placeholder="`请输入`+item.field"/>
<view class="lf-m-t-20" v-if="item.type == 'radio'">
<u-radio-group v-model="info[item.field]" @change="radioGroupChange">
<u-radio
@change="radioChange"
v-for="(item, index) in radion_list" :key="index"
:name="item.name"
:disabled="item.disabled"
v-for="(item2, index2) in item.options" :key="index2"
:name="item2"
>
{{item.name}}
{{item2}}
</u-radio>
</u-radio-group>
</view>
</view>
<view class="padding-lr lf-m-b-40">
<text class="lf-color-555 lf-font-28">添加人选(多选)</text>
<view class="lf-m-t-20">
<u-checkbox-group @change="checkboxGroupChange">
<view class="lf-m-t-20" v-if="item.type == 'checkbox'">
<u-checkbox-group @change="checkboxGroupChange()">
<u-checkbox
@change="checkboxChange"
v-model="item.checked"
@change="checkboxChange(item.field)"
shape="circle"
v-for="(item, index) in check_list" :key="index"
:name="item.name"
>{{item.name}}</u-checkbox>
v-model="item2.checked"
v-for="(item2, index2) in item.options" :key="index2"
:name="item2.name"
>{{item2.name}}</u-checkbox>
</u-checkbox-group>
</view>
</view>
<view class="padding-lr lf-m-b-40">
<text class="lf-color-555 lf-font-28">多行文本(不超过300字)</text>
<view class="lf-m-t-20">
<view class="lf-m-t-20" v-if="item.type == 'textarea'">
<view class="cu-self menu" style="margin-top: 30rpx; position: relative;">
<textarea :cursor-spacing="120" maxlength="300" :adjust-position="true" type="text" v-model="applyInfo" style="background-color: #F8F8F8;border-radius: 20rpx;" class="text-left lf-font-28 area-self lf-w-100 lf-p-20" placeholder="请输入内容" />
</view>
<textarea :cursor-spacing="120" maxlength="300" :adjust-position="true" type="text" v-model="info[item.field]" style="background-color: #F8F8F8;border-radius: 20rpx;" class="text-left lf-font-28 area-self lf-w-100 lf-p-20" placeholder="请输入内容" />
</view>
</view>
<view class="lf-flex-column lf-p-b-30 padding-lr">
<text class="lf-color-555 lf-font-28 lf-m-b-20">添加图片(最多三张)</text>
<view class="grid col-3 grid-square flex-sub">
<view class="grid col-3 grid-square flex-sub lf-m-t-30" v-if="item.type == 'image'">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(index)" :data-url="img_list[index]">
<image :src="img_list[index]" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index">
@ -74,11 +56,14 @@
<text class="lf-iconfont lf-icon-cuowu lf-font-40 lf-color-price"></text>
</view>
</view>
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="solids" @tap="ChooseImage" v-if="img_list.length<3">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="solids" @tap="ChooseImage(item.field)" v-if="img_list.length<3">
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
</view>
<self-line/>
<view class="lf-bg-white lf-p-t-30 lf-p-b-30 lf-p-l-32 lf-p-r-32">
@ -88,11 +73,15 @@
<view class="bref-box lf-font-32 lf-color-333 lf-line-2" style="height: 88rpx;line-height: 44rpx;">
{{goods_details.title}}
</view>
<view class="lf-row-between">
<view class="flex lf-m-t-25 align-center text-center">
<text class="block lf-color-gray lf-font-24" style="line-height: 40rpx;">数量</text>
<text class="lf-m-l-10 lf-color-gray lf-font-24">x {{goods_details.num}}</text>
<text class="lf-m-l-10 lf-color-gray lf-font-24">x {{buy_num}}</text>
</view>
<view>
<u-number-box :min="1" v-model="buy_num" @change="valChange"></u-number-box>
</view>
</view>
<view class="flex align-center text-center lf-m-t-25">
<lf-price :price="goods_details.price" />
<view class="lf-m-l-20 lf-line-through lf-color-gray">
@ -124,7 +113,7 @@
</view>
<view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">酒店住房日期</text>
<text class="lf-font-28" style="color: #131315;">{{check_in_time}}-{{check_out_time}}</text>
<text class="lf-font-28" style="color: #131315;">{{check_in_time}}~{{check_out_time}}</text>
</view>
<view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">到店时间</text>
@ -235,43 +224,18 @@
arrival_time: '',
totalLive: '',
hotel_specid: [],
//
radion_list: [
{
name: '是',
disabled: false
},
{
name: '否',
disabled: false
}
],
// u-radio-groupv-modelradioname
value: 'orange',
//
check_list: [
{
name: 'apple',
checked: false,
disabled: false
},
{
name: 'banner',
checked: false,
disabled: false
},
{
name: 'orange',
checked: false,
disabled: false
}
],
//
applyInfo: '',
//
hostImg: '',
img_list: [], //
form_type: ''
form_type: '',
form_list: [],
info: {},
image_name: '',
if_image_complatet: false,
check_box_name: '',
buy_num: 0
}
},
onLoad(e) {
@ -279,9 +243,12 @@
this.goods_id = e.goods_id;
this.goods_type = e.goods_type;
this.btn_type = e.btn_type;
this.buy_num = e.buy_num;
console.log('出来的数量',this.buy_num)
this.order_id = e.order_id;
this.form_type = JSON.parse(decodeURIComponent(e.form_type));;
console.log('表单格式',this.form_type)
this.form_list = this.form_type.fields;
console.log('表单格式',this.form_list)
var arr = e.spec_id.split(",")
console.log(arr)
this.hotel_specid = arr
@ -322,6 +289,135 @@
uni.$off('payState');
},
methods: {
valChange(e) {
this.buy_num = e.value;
this.getGoodsData(this.pay_type);
},
dynamicLength(){
return parseInt(this.applyInfo.length);
},
//
checkboxGroupChange(e) {
this.info[this.check_box_name] = e
console.log(this.info)
},
// checkbox
checkboxChange(name) {
this.check_box_name = name
console.log('chenckshushush',this.check_box_name)
},
//
radioChange(e) {
console.log(e);
},
// radioradio-group
radioGroupChange(e) {
console.log(e);
},
computedAge() {
this.$check(this.vertify_code,'card');
let judge_sex = this.vertify_code[16];
let judge_birthday = this.vertify_code.substring(6,14);
let now_date = new Date();
let now_date1 = this.$shared.recordTime(now_date, '-', 'date').replace(/-/g, "");
let age1 = now_date1-judge_birthday;
this.age = JSON.stringify(age1).substring(0,2)
if(judge_sex%2) {
this.sex = '男';
}else {
this.sex = '女';
}
if(this.vertify_code == '') {
this.sex = '请输入身份证号码获取';
this.age = '请输入身份证号码获取';
}
},
getPhoneNumber(event){
if(event.detail.errMsg == 'getPhoneNumber:ok'){
let encryptedData = event.detail.encryptedData;
let iv = event.detail.iv;
this.$http(this.API.API_WECHAT_SETPHONE, {
encryptedData,
iv,
// token: userInfo.token //
}).then(res => {
this.phone = res.data.mobile;
})
}
},
payStatus(type) {
if(type == this.pay_type) {
this.pay_type = type;
return
}else {
this.pay_type = type;
this.getGoodsData(type);
}
},
getGoodsData(type){
this.$http(this.API.API_CONFIRMDETAILS,{id: this.goods_id,num: this.buy_num,pay_type: type,spec_id: this.hotel_specid}).then(res => {
this.goods_details = res.data;
console.log('数据',res)
})
},
submit(url) {
if(this.order_id && this.enter_type == 1) {
this.payOnce()
return
}
this.upload()
if(!this.ifPay) return;
this.ifPay = false;
this.$http(this.API.API_CREATEORDER,{
id: this.goods_id,
num: this.buy_num,
pay_type: this.pay_type,
name:this.contact,
mobile:this.phone,
spec_id: this.hotel_specid,
enter_time: this.enter_time,
sex: this.sex,
age: this.age,
id_card: this.vertify_code,
departure_time: this.departure_time,
return_time: this.return_time,
check_in_time: this.check_in_time,
check_out_time: this.check_out_time,
arrival_time: this.arrival_time,
info: this.info
}).then(res => {
this.pay_order_id = res.data.id
if(this.pay_type == 1) {
this.ifPay = true
this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+res.data.id,{type: 'redirect'})
}else if(res.data.jump == true) {
let that = this;
wx.navigateToMiniProgram({
appId: res.data.jump_appid,
path: '/pages/order/confirm_atonce',
envVersion: 'release',
extraData: {
order_id: res.data.id
},
success(res) {
console.log('---res---');
that.ifPay = true;
console.log(res);
},
fail(err) {
console.log('---err---');
console.log(err);
that.ifPay = true;
}
})
}
}).catch(err => {
this.ifPay = true
})
},
checkImgInfo(tempFilePath, suc){
uni.getImageInfo({
src: tempFilePath,
@ -340,7 +436,7 @@
})
},
//
ChooseImage(e) {
ChooseImage(name,e) {
let that = this;
uni.chooseImage({
count: 1,
@ -375,7 +471,9 @@
})
} else{
that.img_list.push(tempFilePath);
console.log('图片数组',that.img_list)
console.log('图片数sadad组',name)
that.image_name = name
this.upload()
}
} else {
uni.showModal({
@ -408,7 +506,7 @@
}
}
if(uploads.length == 0) {
that.realSubmitInfo([]);
// that.submit([]);
return
}
Promise.all(uploads).then((result) => {
@ -417,10 +515,10 @@
img_url_list = result;
}
if(img_url_list) {
that.realSubmitInfo(img_url_list);
console.log('传来的名字',that.image_name)
that.info[that.image_name] = img_url_list;
console.log('=====图片数组',that.info)
}
}).catch(err => {
that.is_publish = false; //
uni.showModal({
@ -450,152 +548,10 @@
success: e => {
if (!e.confirm) return;
this.img_list.splice(index, 1);
this.upload()
}
});
},
dynamicLength(){
return parseInt(this.applyInfo.length);
},
//
checkboxGroupChange(e) {
console.log(e);
},
// checkbox
checkboxChange(e) {
//console.log(e);
},
//
radioChange(e) {
// console.log(e);
},
// radioradio-group
radioGroupChange(e) {
console.log(e);
},
computedAge() {
this.$check(this.vertify_code,'card');
let judge_sex = this.vertify_code[16];
let judge_birthday = this.vertify_code.substring(6,14);
let now_date = new Date();
let now_date1 = this.$shared.recordTime(now_date, '-', 'date').replace(/-/g, "");
let age1 = now_date1-judge_birthday;
this.age = JSON.stringify(age1).substring(0,2)
if(judge_sex%2) {
this.sex = '男';
}else {
this.sex = '女';
}
if(this.vertify_code == '') {
this.sex = '请输入身份证号码获取';
this.age = '请输入身份证号码获取';
}
},
getPhoneNumber(event){
if(event.detail.errMsg == 'getPhoneNumber:ok'){
let encryptedData = event.detail.encryptedData;
let iv = event.detail.iv;
this.$http(this.API.API_WECHAT_SETPHONE, {
encryptedData,
iv,
// token: userInfo.token //
}).then(res => {
this.phone = res.data.mobile;
})
}
},
payStatus(type) {
if(type == this.pay_type) {
this.pay_type = type;
return
}else {
this.pay_type = type;
this.getGoodsData(type);
}
},
getGoodsData(type){
this.$http(this.API.API_CONFIRMDETAILS,{id: this.goods_id,num: 1,pay_type: type,spec_id: this.hotel_specid}).then(res => {
this.goods_details = res.data;
console.log('数据',res)
})
},
submit() {
if(this.order_id && this.enter_type == 1) {
this.payOnce()
return
}
if(!this.contact) {
this.$msg('请输入联系人!');
return;
}
if(!this.phone) {
this.$msg('请输入联系电话!');
return;
}
if(this.goods_type != 3) {
if(!this.vertify_code) {
this.$msg('请输入身份证号!');
return;
}
if(!this.sex) {
this.$msg('请输入性别!');
return;
}
if(!this.age) {
this.$msg('请输入年龄!');
return;
}
}
if(!this.ifPay) return;
this.ifPay = false;
this.$http(this.API.API_CREATEORDER,{
id: this.goods_id,
num: 1,
pay_type: this.pay_type,
name:this.contact,
mobile:this.phone,
spec_id: this.hotel_specid,
enter_time: this.enter_time,
sex: this.sex,
age: this.age,
id_card: this.vertify_code,
departure_time: this.departure_time,
return_time: this.return_time,
check_in_time: this.check_in_time,
check_out_time: this.check_out_time,
arrival_time: this.arrival_time
}).then(res => {
this.pay_order_id = res.data.id
if(this.pay_type == 1) {
this.ifPay = true
this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+res.data.id,{type: 'redirect'})
}else if(res.data.jump == true) {
let that = this;
wx.navigateToMiniProgram({
appId: res.data.jump_appid,
path: '/pages/order/confirm_atonce',
envVersion: 'release',
extraData: {
order_id: res.data.id
},
success(res) {
console.log('---res---');
that.ifPay = true;
console.log(res);
},
fail(err) {
console.log('---err---');
console.log(err);
that.ifPay = true;
}
})
}
}).catch(err => {
this.ifPay = true
})
},
payOnce() {
this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => {
if(res.data.jump) {

43
pages/order/order_details.vue

@ -47,42 +47,23 @@
<text class="lf-color-555 lf-font-28">支付方式</text>
<text class="lf-font-28 text-black1">{{orderDetails.pay_type_text}}</text>
</view>
<view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">联系人</text>
<text class="lf-font-28 text-black1">{{orderDetails.name}}</text>
</view>
<view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">电话</text>
<text class="lf-font-28 text-black1">{{orderDetails.mobile}}</text>
<view class="cu-bar padding-lr" v-for="(item,index) of orderDetails.info" :key="index">
<text class="lf-color-555 lf-font-28">{{index}}</text>
<text class="lf-font-28 text-black1">{{item}}</text>
<view v-if="">
<view class="grid col-3 grid-square flex-sub lf-m-t-30" v-if="item.type == 'image'">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(index)" :data-url="img_list[index]">
<image :src="img_list[index]" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index">
<!-- <text class='cuIcon-close'></text> -->
<text class="lf-iconfont lf-icon-cuowu lf-font-40 lf-color-price"></text>
</view>
<self-line />
<view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">年龄</text>
<text class="lf-font-28 text-black1">{{orderDetails.info.age}}</text>
</view>
<view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">性别</text>
<text class="lf-font-28 text-black1">{{orderDetails.info.sex}}</text>
</view>
<view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">身份证号</text>
<text class="lf-font-28 text-black1">{{orderDetails.info.id_card}}</text>
</view>
<view class="cu-bar padding-lr" v-if="orderDetails.info.arrival_time">
<text class="lf-color-555 lf-font-28">到店时间</text>
<text class="lf-font-28 text-black1">{{orderDetails.info.arrival_time}}</text>
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="solids" @tap="ChooseImage(item.field)" v-if="img_list.length<3">
<text class='cuIcon-cameraadd'></text>
</view>
<view class="cu-bar padding-lr" v-else>
<text class="lf-color-555 lf-font-28">使用时间</text>
<text class="lf-font-28 text-black1">{{orderDetails.info.departure_time}}</text>
</view>
<view class="cu-bar padding-lr" v-if="orderDetails.info.check_in_time">
<text class="lf-color-555 lf-font-28">入住时间</text>
<text class="lf-font-28 text-black1">{{orderDetails.info.check_in_time}}</text>
</view>
<view class="cu-bar padding-lr" v-if="orderDetails.info.check_out_time">
<text class="lf-color-555 lf-font-28">离店时间</text>
<text class="lf-font-28 text-black1">{{orderDetails.info.check_out_time}}</text>
</view>
</view>
<view>

BIN
static/defult_code.png

Before

Width: 430  |  Height: 430  |  Size: 74 KiB

BIN
static/images/jieson.png

Before

Width: 40  |  Height: 40  |  Size: 1.4 KiB

BIN
static/images/other.png

Before

Width: 41  |  Height: 41  |  Size: 1.1 KiB

BIN
static/images/plane_ticket.png

Before

Width: 41  |  Height: 40  |  Size: 1.6 KiB

BIN
static/images/strategy.png

Before

Width: 40  |  Height: 40  |  Size: 2.1 KiB

BIN
static/images/travel.png

Before

Width: 40  |  Height: 40  |  Size: 2.0 KiB

BIN
static/logo.png

Before

Width: 72  |  Height: 72  |  Size: 3.9 KiB

3
uview-ui/components/u-calendar/u-calendar.vue

@ -39,9 +39,10 @@
@tap="dateClick(index)">
<view class="u-calendar__content__item__inner" :style="{color: getColor(index,2)}">
<view class="lf-flex-column" style="justify-content: center;align-items: center;">
<text>{{ index + 1 }}</text>
<text class="lf-m-t-20">{{ index + 1 }}</text>
<text class="lf-font-24" v-if="(year+'-'+formatNum(month)+'-'+formatNum((index + 1))) == item2.date && !openDisAbled(year,month,index+1)" v-for="(item2,index2) of monthPrice" :key="index2">{{item2.price | filterFloat}}</text>
<!-- <text class="lf-font-24" v-if="(year+'-'+formatNum(month)+'-'+formatNum((index + 1))) == item2.date && !openDisAbled(year,month,index+1)" v-for="(item2,index2) of monthPrice" :key="index2">:{{item2.stock}}</text> -->
<view style="color: #FFFFFF;font-size: 20rpx;position: absolute;opacity: 0.4;top: -10rpx;padding:4rpx 10rpx; border-radius:55rpx ;background: #0BCE5F;" v-if="(year+'-'+formatNum(month)+'-'+formatNum((index + 1))) == item2.date && !openDisAbled(year,month,index+1)" v-for="(item2,index2) of monthPrice" :key="index2">{{item2.stock}}</view>
</view>
</view>
<!-- <view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="mode== 'range' && startDate==`${year}-${month}-${index+1}` && startDate!=endDate">{{startText}}</view>

Loading…
Cancel
Save