123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <view>
- <u-cell-item title="手机号码" class="active">
- <view slot="right-icon" class="input">
- <input type="text" v-model="tel" maxlength="11" placeholder="请填写手机号"/>
- </view>
- </u-cell-item>
- <u-cell-item title="预订座位" :class="[seat?'active':'']" :value="seat?seat:'请选择预订座位'" @click="show=true"></u-cell-item>
- <u-cell-item title="上车点(留言)">
- <view slot="right-icon" class="input">
- <input type="text" v-model="message" placeholder="如:人民路与建设路交叉口"/>
- </view>
- </u-cell-item>
- <view style="margin-top: 580rpx;">
- <view class="mlr-36 mb-20 flex_l size-26">
- <u-radio-group active-color="#00C28E" @change="radioGroupChange">
- <u-radio name="1" :label-disabled="false"></u-radio>
- </u-radio-group>
- <view class="">
- <text class="gray-2">我已阅读并同意</text>
- <text class="blue" @click="goDetails(16,'合乘协议')">《合乘协议》</text>
- </view>
- </view>
- <view class="mlr-36">
- <u-button type="primary" :disabled="!tel || !seat " @click="submit">确认预订</u-button>
- </view>
- <bookTip class="fixed-bottom bg-white"></bookTip>
- </view>
- <!-- 选择座位 -->
- <u-select v-model="show" :list="list" @confirm="confirm"></u-select>
- </view>
- </template>
- <script>
- import {mapState} from 'vuex'
- export default {
- data() {
- return {
- id:'',
- tel:'',
- seat:'',
- message:'',
- radio:'',
- show:false,
- list:[{
- value:1,
- label:'1人'
- },
- {
- value:2,
- label:'2人'
- },
- {
- value:3,
- label:'3人'
- },
- {
- value:4,
- label:'4人'
- },
- {
- value:5,
- label:'5人'
- },
- {
- value:6,
- label:'6人'
- },
- {
- value:7,
- label:'7人'
- }],
- };
- },
- computed:{
- ...mapState(['userInfo'])
- },
- onLoad(option) {
- this.id = option.id
- this.seat = option.seat
- this.tel = this.userInfo.mobile
- },
- methods:{
- radioGroupChange(e){
- this.radio = e
- },
- confirm(e){
- this.seat = e[0].label
- },
- goDetails(id,title){
- uni.navigateTo({
- url:'/pages/my/details?id='+id+'&title=' + title
- })
- },
- submit(){
- if(this.radio){
- this.$http('/addons/ddrive/sforder/reserve_order',{
- order_id: this.id,
- tel: this.tel,
- people_num: this.seat.substr(0,1),
- remark: this.message
- },"POST").then(data=>{
- console.log(data);
- uni.redirectTo({
- url:'/pages/shunfeng/order-detail?id='+data.order_id
- })
- })
- }else{
- uni.showToast({
- title:'请先同意合乘协议',
- icon:'none'
- })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- /deep/.u-radio__label{
- margin-right: 0;
- }
- .active{
- /deep/.u-cell__value{
- color: #333;
- }
- }
- .input{
- input{
- font-size: 26rpx;
- text-align: right;
- }
- }
- </style>
|