Browse Source

【优化】 商品详情页没有规格时的处理

【新增】 确认下单页日期时间选择并修复checkbox报错的问题
master
邓平艺 4 years ago
parent
commit
60af351a79
  1. 436
      pages/goodsDetail/index.vue
  2. 39
      pages/order/confirm_order.vue

436
pages/goodsDetail/index.vue

@ -98,55 +98,58 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 景区类型弹窗 -->
<u-calendar v-model="show" mode="date" zIndex="100000" :monthPrice="goods_detail.spec[type_index].list"
:min-date='goods_detail.spec[type_index].date_start'
:max-date="goods_detail.spec[type_index].date_end" @change="change" z-index="9999"></u-calendar>
<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*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*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 }}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" :key="index" @click="chooseType(index)">
{{item.name}}</view>
<block v-if="$isRight(goods_detail.spec)">
<!-- 景区类型弹窗 -->
<u-calendar v-model="show" mode="date" zIndex="100000" :monthPrice="goods_detail.spec[type_index].list"
:min-date='goods_detail.spec[type_index].date_start'
:max-date="goods_detail.spec[type_index].date_end" @change="change" z-index="9999"></u-calendar>
<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*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*buy_num || goods_detail.spec[type_index].original_price*buy_num}}</view>
</view> </view>
</view>
<view class="lf-m-t-30">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">使用时间</text>
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
使用时间{{ go_date }}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" :key="index" @click="chooseType(index)">
{{item.name}}</view>
</view> </view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
<view class="lf-m-t-30">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">使用时间</text>
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
</view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
</view> </view>
</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 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> </view>
</view> </view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
</view>
</u-popup>
</u-popup>
</block>
<!-- 餐厅类型 --> <!-- 餐厅类型 -->
<view v-if="goods_detail.product.extends && goods_detail.product && goods_detail.product.type == 3"> <view v-if="goods_detail.product.extends && goods_detail.product && goods_detail.product.type == 3">
<view class="goods-detail" <view class="goods-detail"
@ -183,7 +186,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 酒店类型 --> <!-- 酒店类型 -->
<view v-if="goods_detail.product && goods_detail.product.extends && goods_detail.product.type == 1"> <view v-if="goods_detail.product && goods_detail.product.extends && goods_detail.product.type == 1">
<view class="goods-detail" v-if="goods_detail.product.extends.field_1_name" <view class="goods-detail" v-if="goods_detail.product.extends.field_1_name"
@ -210,62 +212,66 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 酒店类型弹窗 -->
<u-calendar v-model="hotel_show_range" mode="range" zIndex="100000" :monthPrice="goods_detail.spec[type_index].list"
:min-date='goods_detail.spec[type_index].date_start'
:max-date="goods_detail.spec[type_index].date_end" @change="changeRange()" z-index="9999"></u-calendar>
<u-picker v-model="hotel_show_single" @confirm="changeArrive()" mode="time" :params="params" zIndex="100000"></u-picker>
<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*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*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}} <text class="lf-m-l-20" v-if="totalLive">{{totalLive}}</text>
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" :key="index"
@click="chooseTypehotel(index)">{{item.name}}</view>
<block v-if="$isRight(goods_detail.spec)">
<!-- 酒店类型弹窗 -->
<u-calendar v-model="hotel_show_range" mode="range" zIndex="100000" :monthPrice="goods_detail.spec[type_index].list"
:min-date='goods_detail.spec[type_index].date_start'
:max-date="goods_detail.spec[type_index].date_end" @change="changeRange()" z-index="9999"></u-calendar>
<u-picker v-model="hotel_show_single" @confirm="changeArrive()" mode="time" :params="params" zIndex="100000"></u-picker>
<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*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*buy_num || goods_detail.spec[type_index].original_price*buy_num }}</view>
</view> </view>
</view>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="hotel_show_range = true">住店时间</text>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
酒店住房日期{{live_date}}~{{leave_date}} <text class="lf-m-l-20" v-if="totalLive">{{totalLive}}</text>
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" :key="index"
@click="chooseTypehotel(index)">{{item.name}}</view>
</view> </view>
<view class="lf-flex">
<text @click="hotel_show_range = true">{{live_date}}~{{leave_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="hotel_show_range = true">住店时间</text>
</view>
<view class="lf-flex">
<text @click="hotel_show_range = true">{{live_date}}~{{leave_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
</view> </view>
</view> </view>
</view>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="hotel_show_single = true">到店时间</text>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="hotel_show_single = true">到店时间</text>
</view>
<view class="lf-flex">
<text @click="hotel_show_single = true">{{arrive_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
</view> </view>
<view class="lf-flex">
<text @click="hotel_show_single = true">{{arrive_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</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> </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 style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view> </view>
</view> </view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
</view>
</u-popup>
</u-popup>
</block>
<!-- 旅游路线类型 --> <!-- 旅游路线类型 -->
<view <view
v-if="goods_detail.product && goods_detail.product.type == 0 && goods_detail.product.extends.field_0_project"> v-if="goods_detail.product && goods_detail.product.type == 0 && goods_detail.product.extends.field_0_project">
@ -298,141 +304,145 @@
<!-- <zwyCalendar class="lf-m-t-20" type="sign" :startTime="'2021-10-01'" :endTime="'2021-11-01'"/> --> <!-- <zwyCalendar class="lf-m-t-20" type="sign" :startTime="'2021-10-01'" :endTime="'2021-11-01'"/> -->
</view> </view>
</view> </view>
<!-- 旅游路线类型弹窗 -->
<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*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*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}}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" @click="chooseType(index)" :key="index">
{{item.name}}</view>
<block v-if="$isRight(goods_detail.spec)">
<!-- 旅游路线类型弹窗 -->
<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*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*buy_num || goods_detail.spec[type_index].original_price*buy_num}}</view>
</view> </view>
</view>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
套餐类型{{goods_detail.spec[type_index].name}}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" @click="chooseType(index)" :key="index">
{{item.name}}</view>
</view>
</view>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
</view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
</view> </view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</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> </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 style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view> </view>
</view> </view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
</view>
</u-popup>
<!-- 车队 -->
<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*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*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}}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" @click="chooseType(index)" :key="index">
{{item.name}}</view>
</u-popup>
<!-- 车队 -->
<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*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*buy_num || goods_detail.spec[type_index].original_price*buy_num}}</view>
</view> </view>
</view>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
<view class="lf-font-24 lf-m-t-20 lf-color-555">
套餐类型{{goods_detail.spec[type_index].name}}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" @click="chooseType(index)" :key="index">
{{item.name}}</view>
</view> </view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
<view class="lf-m-t-30">
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
</view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
</view> </view>
</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 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>
</view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
</view>
</u-popup>
<!-- 单项 -->
<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*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*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}}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" @click="chooseType(index)" :key="index">
{{item.name}}</view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view> </view>
</view> </view>
<view class="lf-m-t-30">
<view class="lf-row-between">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">出行日期</text>
</u-popup>
<!-- 单项 -->
<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*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*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}}
</view>
<view style="margin-top: 60rpx;">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">套餐类型</text>
<view class="lf-m-t-30 choose-father">
<view class="choose-span" :class="type_index==index?'choose-active':''"
v-for="(item,index) of goods_detail.spec" @click="chooseType(index)" :key="index">
{{item.name}}</view>
</view>
</view> </view>
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
<view class="lf-m-t-30">
<view class="lf-row-between">
<text class="lf-font-32 lf-font-bold" style="color: #131315;">出行日期</text>
</view> </view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
<view class="lf-row-between list-item lf-m-t-20" style="padding: 0!important;">
<view class="lf-row-center">
<text class="lf-font-28 lf-color-gray" @click="show = true">使用时间</text>
</view>
<view class="lf-flex">
<!-- <picker mode="date" :end="goods_detail.spec[type_index].date_end" :start="goods_detail.spec[type_index].date_start" :value="go_date" @change="goChange">
<view class="lf-color-333 lf-text-right lf-font-28" style="width: 400rpx;">{{ go_date }}</view>
</picker> -->
<text @click="show = true">{{go_date}}</text>
<text class="lf-iconfont lf-icon-xiangyou lf-text-vertical lf-m-l-10"></text>
</view>
</view> </view>
</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 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> </view>
</view> </view>
<view style="margin-top: 60rpx;">
<button class="choose_btn" @click="toAddOrder()">立即购买</button>
</view>
</view>
</u-popup>
</u-popup>
</block>
<!-- 公共部分 --> <!-- 公共部分 -->
<!-- 商品详情 --> <!-- 商品详情 -->
<view class="goods-detail" v-if="goods_detail.know"> <view class="goods-detail" v-if="goods_detail.know">
@ -558,6 +568,16 @@
if(this.goods_detail) { if(this.goods_detail) {
this.getShopDistance(); this.getShopDistance();
} }
if(!this.$isRight(this.goods_detail.spec)){
uni.showModal({
title: '',
content: '该商品暂无规格,无法购买',
showCancel: false,
success: result => {
this.$toBack();
}
})
}
this.is_collect = Boolean(res.data.is_collect) || false; this.is_collect = Boolean(res.data.is_collect) || false;
}).catch(err => { }).catch(err => {
this.skeletonLoading = false; this.skeletonLoading = false;
@ -576,7 +596,7 @@
const self_latitude = res.latitude const self_latitude = res.latitude
const self_longitude = res.longitude const self_longitude = res.longitude
console.log('当前经纬度',self_latitude,self_longitude,res); console.log('当前经纬度',self_latitude,self_longitude,res);
if(that.$isRight(that.goods_detail.product.extends)) {
if(that.goods_detail.product && that.$isRight(that.goods_detail.product.extends)) {
const shop_latitude = that.goods_detail.product.extends.field_2_latitude; const shop_latitude = that.goods_detail.product.extends.field_2_latitude;
const shop_longitude = that.goods_detail.product.extends.field_2_longitude; const shop_longitude = that.goods_detail.product.extends.field_2_longitude;
console.log('商家经纬度',shop_latitude,shop_longitude); console.log('商家经纬度',shop_latitude,shop_longitude);

39
pages/order/confirm_order.vue

@ -14,7 +14,6 @@
<u-icon name="phone"></u-icon> <u-icon name="phone"></u-icon>
</button> </button>
</view> --> </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"> <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> <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"/> <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"/>
@ -42,6 +41,11 @@
</u-checkbox-group> </u-checkbox-group>
</view> </view>
<view class="lf-m-t-20" v-if="item.type == 'datetime'" @click="showDateTime = true">
<text>{{ info[item.field] || '请选择日期' }}</text>
<u-picker mode="time" v-model="showDateTime" :params="dateTimeParams" @confirm="dateTimeConfirm($event, item.field)"></u-picker>
</view>
<view class="lf-m-t-20" v-if="item.type == 'textarea'"> <view class="lf-m-t-20" v-if="item.type == 'textarea'">
<view class="cu-self menu" style="margin-top: 30rpx; position: relative;"> <view class="cu-self menu" style="margin-top: 30rpx; position: relative;">
<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="请输入内容" /> <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="请输入内容" />
@ -61,9 +65,6 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<self-line/> <self-line/>
<view class="lf-bg-white lf-p-t-30 lf-p-b-30 lf-p-l-32 lf-p-r-32"> <view class="lf-bg-white lf-p-t-30 lf-p-b-30 lf-p-l-32 lf-p-r-32">
@ -235,7 +236,16 @@
image_name: '', image_name: '',
if_image_complatet: false, if_image_complatet: false,
check_box_name: '', check_box_name: '',
buy_num: 0
buy_num: 0,
showDateTime: false ,//
dateTimeParams: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: false
}
} }
}, },
onLoad(e) { onLoad(e) {
@ -246,8 +256,18 @@
this.buy_num = e.buy_num; this.buy_num = e.buy_num;
console.log('出来的数量',this.buy_num) console.log('出来的数量',this.buy_num)
this.order_id = e.order_id; this.order_id = e.order_id;
this.form_type = JSON.parse(decodeURIComponent(e.form_type));;
this.form_list = this.form_type.fields;
this.form_type = JSON.parse(decodeURIComponent(e.form_type));
// checkbox
let form_list = this.form_type.fields.map(item => {
if(item.type == 'checkbox'){
item.options = item.options.map(o => {
return {name: o, checked: false};
})
}
return item;
})
this.form_list = form_list;
console.log('表单格式',this.form_list) console.log('表单格式',this.form_list)
var arr = e.spec_id.split(",") var arr = e.spec_id.split(",")
console.log(arr) console.log(arr)
@ -289,6 +309,11 @@
uni.$off('payState'); uni.$off('payState');
}, },
methods: { methods: {
//
dateTimeConfirm(event, info_key){
let { year, month, day, hour, minute } = event;
this.info[info_key] = `${year}-${month}-${day} ${hour}:${minute}`;
},
valChange(e) { valChange(e) {
this.buy_num = e.value; this.buy_num = e.value;
this.getGoodsData(this.pay_type); this.getGoodsData(this.pay_type);

Loading…
Cancel
Save