Browse Source

日历选择器优化

master
Enzo 4 years ago
parent
commit
d504f6e8e3
  1. 672
      pages/goodsDetail/index.vue
  2. 3
      pages/order/confirm_order.vue
  3. 8
      uview-ui/components/u-calendar/u-calendar.vue

672
pages/goodsDetail/index.vue
File diff suppressed because it is too large
View File

3
pages/order/confirm_order.vue

@ -271,6 +271,7 @@
// //
hostImg: '', hostImg: '',
img_list: [], // img_list: [], //
form_type: ''
} }
}, },
onLoad(e) { onLoad(e) {
@ -279,6 +280,8 @@
this.goods_type = e.goods_type; this.goods_type = e.goods_type;
this.btn_type = e.btn_type; this.btn_type = e.btn_type;
this.order_id = e.order_id; this.order_id = e.order_id;
this.form_type = JSON.parse(decodeURIComponent(e.form_type));;
console.log('表单格式',this.form_type)
var arr = e.spec_id.split(",") var arr = e.spec_id.split(",")
console.log(arr) console.log(arr)
this.hotel_specid = arr this.hotel_specid = arr

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

@ -40,7 +40,8 @@
<view class="u-calendar__content__item__inner" :style="{color: getColor(index,2)}"> <view class="u-calendar__content__item__inner" :style="{color: getColor(index,2)}">
<view class="lf-flex-column" style="justify-content: center;align-items: center;"> <view class="lf-flex-column" style="justify-content: center;align-items: center;">
<text>{{ index + 1 }}</text> <text>{{ index + 1 }}</text>
<text class="lf-font-24" v-if="!openDisAbled(year,month,index+1)">788</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> </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> <!-- <view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="mode== 'range' && startDate==`${year}-${month}-${index+1}` && startDate!=endDate">{{startText}}</view>
@ -277,6 +278,11 @@
this.init() this.init()
} }
}, },
filters: {
filterFloat(val) {
return parseFloat(val).toString(); // .00
}
},
created() { created() {
this.init() this.init()
console.log('当前规格的价格',this.monthPrice) console.log('当前规格的价格',this.monthPrice)

Loading…
Cancel
Save