You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news/recycling/confirm.vue

707 lines
17 KiB

11 months ago
<template>
<view class="recycling">
<view class="recycling-hd">
10 months ago
<image :src="$picUrl+'/static/news/recyling-banner-01.png'"></image>
11 months ago
</view>
<view class="recycling-bd">
<view class="tab">
11 months ago
<view class="a" v-if="type == 2">
11 months ago
<view class="item" @click="tabItem(1)"></view>
<view class="item" @click="tabItem(2)"></view>
<view class="item" @click="tabItem(3)"></view>
</view>
11 months ago
<view class="b" v-if="type == 2">
10 months ago
<image v-if="tabIndex == 1" :src="$picUrl+'/static/news/icon-recyling-tab-01.png'"></image>
<image v-if="tabIndex == 2" :src="$picUrl+'/static/news/icon-recyling-tab-02.png'"></image>
<image v-if="tabIndex == 3" :src="$picUrl+'/static/news/icon-recyling-tab-03.png'"></image>
11 months ago
</view>
<view class="b" v-else>
10 months ago
<image :src="$picUrl+'/static/news/icon-recyling-tab-04.png'"></image>
11 months ago
</view>
</view>
<view class="goods">
11 months ago
<!-- <view class="a">
11 months ago
<image src="@/static/news/icon-mall.jpg"></image>京送家电武隆路店
11 months ago
</view> -->
11 months ago
<view class="b">
11 months ago
<!-- <view class="l">
11 months ago
<image class="pic" src="@/static/home/phone.jpg"></image>
<view class="info">
<view class="tel">13770577307</view>
<view class="address">杭州市萧山区宏达路234号 国际中心</view>
<view class="time">营业时间10:00-18:00</view>
</view>
<view class="do">
<view class="tel">
<image src="@/static/news/tel.png"></image>电话
</view>
<view class="tel">
<image src="@/static/news/address.png"></image>导航
</view>
</view>
11 months ago
</view> -->
11 months ago
<view class="r">
11 months ago
<image class="pic" :src="info.server_image"></image>
11 months ago
<view class="info">
11 months ago
<view class="tel">{{info.server_name}}</view>
<view class="price">¥<text>{{info.line_price}}</text></view>
11 months ago
</view>
<view class="num">
x1
</view>
</view>
</view>
</view>
<view class="form">
<view class="item">
<view class="a">服务时间</view>
<view class="b" @click="openPage(1)">
11 months ago
<view class="select" :class="server_time?'select-on':''">{{server_time?server_time:'请选择预约到店时间'}}</view>
11 months ago
<u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon>
</view>
11 months ago
</view>
<view class="item">
<view class="a">优惠券</view>
<view class="b" @click="openPage(2)">
11 months ago
<view class="select" :class="couponIndex >= 0?'select-on':''">
{{couponIndex >= 0? couponList[couponIndex].name:(couponList.length > 0?(couponIndex == -9998?'不使用优惠券':'请选择优惠券'):'暂无优惠券')}}
11 months ago
</view>
11 months ago
<u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon>
</view>
11 months ago
</view>
<view class="item">
<view class="a">联系人</view>
<view class="b">
11 months ago
<input class="box1" v-model="username" type="text" placeholder="联系人姓名" />
<!-- <view class="radio">
11 months ago
<u-radio-group v-model="radioValue" active-color="red">
<u-radio name="先生">先生</u-radio>
<u-radio name="女士">女士</u-radio>
</u-radio-group>
11 months ago
</view> -->
11 months ago
</view>
</view>
<view class="item">
<view class="a">联系电话</view>
<view class="b">
11 months ago
<input class="box" v-model="mobile" type="number" placeholder="联系人手机号码" />
11 months ago
</view>
11 months ago
</view>
<view class="item" v-if="type == 1">
11 months ago
<view class="a">所在城市</view>
11 months ago
<view class="b">
11 months ago
<picker @change="changeRegion" mode="region">
<view class="select" :class="region.length>0?'select-on':''">
{{
region.length > 0?region[0]+region[1]+region[2]:'请选择所在人城市'
}}</view>
11 months ago
</picker>
</view>
11 months ago
</view>
<view class="item" v-if="type == 1">
<view class="a">详细地址</view>
<view class="b">
<input class="box" v-model="address" type="text" placeholder="例:12幢1单元102室" />
</view>
11 months ago
</view>
11 months ago
<view class="remark" style="margin-top: 20rpx;">
<view class="name">备注 </view>
11 months ago
<view class="xu">
11 months ago
<view class="li" @click="openPage(5,'可提前来')">可提前来</view>
<view class="li" @click="openPage(5,'来之前打电话')">来之前打电话</view>
<view class="li" @click="openPage(5,'请尽快联系我')">请尽快联系我</view>
11 months ago
</view>
<view class="content">
11 months ago
<u-input v-model="remake" height="260" type="textarea" placeholder="请输入您的留言,最多可留言100字" :border="true" />
11 months ago
</view>
</view>
</view>
</view>
<view class="recycling-fd">
11 months ago
<view class="a" v-if="type==2">免支付预购</view>
<view class="c" v-else style="color: #FE483B;font-size: 30rpx;">{{pay_price}}</view>
11 months ago
<view class="b" @click="openPage(3)">提交订单</view>
11 months ago
</view>
<!-- 选择优惠券 -->
<u-popup v-model="isShow" mode="bottom" border-radius="12" mask-close-able="false" closeable>
<view class="recycling-classify">
<view class="recycling-classify-hd">优惠券列表</view>
<view class="recycling-classify-bd">
<scroll-view scroll-y class="m">
<view class="item" @click="tabMItem(-1,'-9998')"><view :class="couponIndex == -9998?'item-on':''">不使用</view></view>
11 months ago
<view class="item" v-for="(a,i) in couponList" :key="i" @click="tabMItem(a,i)"><view :class="couponIndex == i?'item-on':''">{{a.name}}</view></view>
11 months ago
</scroll-view>
</view>
</view>
</u-popup>
<!-- 时间选择器 -->
<u-picker mode="time" :params="params" v-model="show" confirm-color="#FE483B" :show-time-tag="false" @confirm="confirm"></u-picker>
11 months ago
</view>
</template>
11 months ago
<script>
import * as newFunApi from '@/api/newFun'
11 months ago
export default{
data(){
11 months ago
return {
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true
},
11 months ago
userInfo: {},
orderInfo: {},
list2: [],
11 months ago
pay_price: 0,
11 months ago
show2: true,
11 months ago
isShow: false,
show: false,
info: {},
11 months ago
type: 1,
isClick: true,
11 months ago
radioValue: "男士",
couponIndex: -9999,
11 months ago
tabIndex: 1,
fileList: [
{
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
11 months ago
],
tabMIndex: 0,
address: "",
coupon_id: "",
remake: "",
username: "",
mobile: "",
server_time: "",
region: [],
couponList: [],
11 months ago
server_id: "",
order_id: ""
11 months ago
}
11 months ago
},
onLoad(o) {
this.type = o.type;
this.server_id = o.id;
if(this.type == 1 && o.id){
this.getServerCheckOrder()
}
11 months ago
},
11 months ago
methods: {
11 months ago
tabMItem(a,i) {
11 months ago
this.couponIndex = i
this.coupon_id = (a?a.coupon_id:"")
11 months ago
this.isShow = false;
this.getServerCheckOrder(1)
},
//获取优惠券列表
async getServerCheckOrder(type) {
const { status, data } = await newFunApi.serverCheckOrder({
server_id: this.server_id,
coupon_id: this.coupon_id
})
if(status == 200){
this.info = data.info
this.couponList= data.coupon_list;
this.coupon_id= data.coupon_id
this.coupon_money= data.coupon_money
this.pay_price= data.pay_price
console.log(this.couponIndex)
11 months ago
}
},
confirm(e){
this.server_time = e.year+"-"+e.month+'-'+e.day+" "+e.hour+"-"+e.minute+'-'+e.second
},
changeRegion(e) {
11 months ago
console.log(e)
this.region = e.detail.value
11 months ago
},
11 months ago
tabItem(i) {
this.tabIndex = i
},
11 months ago
openPage(i,a){
if(i == 1){
11 months ago
this.show = true
}else if(i == 2) {
this.isShow = true
11 months ago
}else if(i == 3) {
if(!this.server_time){
uni.showToast({
icon: "none",
title: "服务时间不能为空"
})
return ;
}
if(!this.username){
uni.showToast({
icon: "none",
title: "联系人不能为空"
})
return ;
}
if(!this.mobile){
uni.showToast({
icon: "none",
title: "联系号码不能为空"
})
return ;
}
if (!/^1[2|3|4|5|6|7|8|9]\d{9}$/.test(this.mobile)) {
uni.showToast({
icon: "none",
title: "联系号码格式不正确"
})
return ;
11 months ago
}
if(this.region.length == 0){
uni.showToast({
icon: "none",
title: "请选择所在城市"
})
return ;
}
if(!this.address){
uni.showToast({
icon: "none",
title: "详细地址不能为空"
})
return ;
}
if(this.isClick == false){
return;
}
this.isClick = false;
this.toServerCreateOrder();
}else if(i == 5){
this.remake = a
}else {
11 months ago
}
},
11 months ago
//创建订单
async toServerCreateOrder() {
let {status, data, message } = await newFunApi.serverCreateOrder({
server_id: this.server_id,
client: 'MP-WEIXIN',
server_address: this.region[0]+this.region[1]+this.region[2]+this.address,
server_time: this.server_time,
coupon_id: this.coupon_id,
remake: this.remake,
username: this.username,
mobile: this.mobile,
})
if(status == 200){
this.isClick = true
this.order_id = data.order_id
uni.redirectTo({
url: "/pages/news/recycling/pay?type=fuwu&order_id="+data.order_id
11 months ago
})
}else{
this.isClick = true
uni.showToast({
icon: "none",
title: message
})
setTimeout(()=>{
uni.redirectTo({
url: "/pages/news/recycling/orderList"
})
},2000)
11 months ago
}
},
11 months ago
}
}
</script>
<style lang="scss" scoped>
.recycling{
min-height: 100vh;
background-color: #FFFFFF;
padding-bottom: 130rpx;
11 months ago
overflow: hidden;
&-classify{
width: 100%;
overflow: hidden;
&-hd{
padding: 30rpx 60rpx;
position: relative;
font-size: 32rpx;
font-weight: 500;
color: #303030;
text-align: center;
.a{
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: 500;
color: #FF624F;
position: absolute;
top: 30rpx;
left: 40rpx;
z-index: 2;
}
}
&-bd{
overflow: hidden;
display: flex;
align-items: flex-start;
.l{
width: 210rpx;
height: 560rpx;
background-color: #F7F8FA;
.item{
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 30rpx;
box-sizing: border-box;
text-align: left;
&-on{
background-color: #fff;
font-weight: 500;
}
}
}
.m{
width: 100%;
text-align: center;
max-height: 560rpx;
.item{
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 80rpx;
box-sizing: border-box;
text-align: left;
&-on{
color: #FF624F;
}
}
}
.r{
width: 540rpx;
height: 560rpx;
.item{
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
font-size: 28rpx;
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 80rpx;
box-sizing: border-box;
&-on{
color: #FF624F;
}
}
}
}
}
11 months ago
.slot-btn{
width: 80px;
height: 80px;
background: #FFFFFF;
border-radius: 10rpx;
border: 1px solid #C0C0C0;
text-align: center;
font-size: 24rpx;
font-weight: 500;
color: #D1D1D1;
image{
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}
}
&-hd{
width: 686rpx;
height: 152rpx;
border-radius: 8rpx;
overflow: hidden;
margin: 0 auto;
margin-top: 30rpx;
image{
width: 100%;
height: 100%;
}
}
&-bd{
width: 690rpx;
min-height: 280rpx;
overflow: hidden;
margin: 0 auto;
margin-top: 30rpx;
position: relative;
.tab{
width: 690rpx;
height: 280rpx;
.b{
width: 100%;
11 months ago
height: 100%;
display: block;
11 months ago
image{
width: 100%;
11 months ago
height: 100%;
display: block;
11 months ago
}
}
.a{
width: 100%;
height: 98rpx;
position: absolute;
left: 0;
top: 0;
z-index: 2;
display: flex;
align-items: center;
.item{
flex: 1;
height: 100%;
}
}
}
.goods{
padding: 30rpx 35rpx;
overflow: hidden;
11 months ago
border-left: 1px solid #F1F1F1;
border-right: 1px solid #F1F1F1;
11 months ago
.a{
display: flex;
align-items: center;
image{
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
font-size: 28rpx;
font-weight: 500;
color: #000000;
}
.b{
padding: 20rpx 0;
overflow: hidden;
.l{
display: flex;
align-items: center;
overflow: hidden;
.pic{
width: 182rpx;
height: 146rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
.info{
width: 305rpx;
margin-right: 20rpx;
.title{
font-size: 24rpx;
font-weight: 400;
color: #5C5C5C;
}
.address{
font-size: 24rpx;
font-weight: 400;
color: #5C5C5C;
height: 80rpx;
line-height: 40rpx;
overflow: hidden;
}
.time{
font-size: 24rpx;
font-weight: 400;
color: #5C5C5C;
}
}
.do{
flex: 1;
text-align: center;
font-size: 20rpx;
font-weight: 400;
color: #989898;
display: flex;
align-items: center;
justify-content: space-between;
image{
width: 30rpx;
height: 30rpx;
display: block;
margin: 0 auto;
margin-bottom: 20rpx;
}
}
}
.r{
display: flex;
align-items: flex-start;
overflow: hidden;
margin-top: 30rpx;
.pic{
width: 182rpx;
height: 146rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
.info{
width: 305rpx;
margin-right: 20rpx;
.title{
font-size: 28rpx;
font-weight: 400;
color: #212121;
}
.price{
font-size: 32rpx;
font-weight: 500;
color: #FF584D;
margin-top: 20rpx;
}
}
.num{
flex: 1;
text-align: center;
font-size: 30rpx;
font-weight: 400;
color: #989898;
text-align: right;
}
}
}
}
.form {
padding: 0 40rpx;
11 months ago
overflow: hidden;
border-left: 1px solid #F1F1F1;
border-right: 1px solid #F1F1F1;
border-bottom: 1px solid #F1F1F1;
.remark{
.name{
font-size: 28rpx;
font-weight: 400;
color: #313131;
}
.xu{
display: flex;
flex-wrap: wrap;
overflow: hidden;
.li{
line-height: 52rpx;
background: #FFFFFF;
border-radius: 6rpx;
border: 1px solid #EDEDED;
padding: 0 20rpx;
margin-right: 20rpx;
text-align: center;
font-size: 24rpx;
font-weight: 400;
color: #949494;
margin-top: 20rpx;
}
}
.content{
padding: 20rpx 0 50rpx;
font-size: 28rpx;
color: #212121;
}
}
.photo{
padding: 20rpx 0;
overflow: hidden;
}
11 months ago
.item{
padding: 20rpx 0;
border-bottom: 1px solid #F4F4F4;
display: flex;
align-items: center;
.a{
width: 160rpx;
11 months ago
font-size: 28rpx;
font-weight: 400;
color: #313131;
line-height: 45rpx;
}
.b{
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
.select{
flex: 1;
font-size: 28rpx;
font-weight: 400;
line-height: 45rpx;
color: #949494;
&-on{
color: #212121;
}
}
.box{
11 months ago
flex: 1;
font-size: 28rpx;
color: #212121;
line-height: 45rpx;
}
.box1{
width: 160rpx;
font-size: 28rpx;
color: #212121;
line-height: 45rpx;
11 months ago
}
.radio{
display: flex;
align-items: center;
justify-content: flex-end;
11 months ago
flex: 1;
border-left: 1px solid #E6E6E6;
}
}
11 months ago
}
}
}
&-fd{
width: 100%;
height: 120rpx;
background-color: #FFFFFF;
padding: 25rpx 25rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
.a{
font-size: 28rpx;
font-weight: 400;
color: #727272;
}
.b{
width: 502rpx;
height: 88rpx;
line-height: 88rpx;
background: #FE483B;
border-radius: 88rpx;
text-align: center;
font-size: 28rpx;
font-weight: 600;
color: #FFFFFF;
}
}
}
</style>