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

777 lines
18 KiB

9 months ago
<template>
<view class="recycling">
<view class="recycling-hd">
<image :src="$picUrl+'/static/news/recyling-banner-01.png'"></image>
</view>
<view class="recycling-bd">
<view class="tab">
<view class="a" v-if="type == 2">
<view class="item" @click="tabItem(1)"></view>
<view class="item" @click="tabItem(2)"></view>
<view class="item" @click="tabItem(3)"></view>
</view>
<view class="b" v-if="type == 2">
<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>
9 months ago
</view>
</view>
<view class="goods">
<!-- <view class="a">
<image src="@/static/news/icon-mall.jpg"></image>京送家电武隆路店
</view> -->
<view class="b">
<!-- <view class="l">
<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>
</view> -->
<view class="r">
<image class="pic" :src="info.server_image"></image>
<view class="info">
<view class="tel">{{info.server_name}}</view>
<view class="price">¥<text>{{info.line_price}}</text></view>
</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)">
<view class="select" :class="server_time?'select-on':''">{{server_time?server_time:'请选择预约到店时间'}}
</view>
<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':''">
9 months ago
{{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>
9 months ago
</view>
<view class="item">
<view class="a">联系人</view>
<view class="b">
<input class="box1" v-model="username" type="text" placeholder="联系人姓名" />
<!-- <view class="radio">
<u-radio-group v-model="radioValue" active-color="red">
<u-radio name="先生">先生</u-radio>
<u-radio name="女士">女士</u-radio>
</u-radio-group>
</view> -->
</view>
</view>
<view class="item">
<view class="a">联系电话</view>
<view class="b">
<input class="box" v-model="mobile" type="number" placeholder="联系人手机号码" />
</view>
11 months ago
</view>
<view class="item" v-if="type == 1">
11 months ago
<view class="a">所在城市</view>
9 months ago
<view class="b" @click="addrshow=true">
<input type="text" disabled style="font-size: 28rpx;" placeholder="请选择地址"
v-model="region">
<u-icon name="arrow-right" color="#8B8B8B" size="30"></u-icon>
<u-picker @confirm="changeRegion" v-model="addrshow" mode="region"></u-picker>
11 months ago
</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>
9 months ago
</view>
<view class="remark" style="margin-top: 20rpx;">
<view class="name">备注 </view>
<view class="xu">
<view class="li" @click="openPage(5,'可提前来')">可提前来</view>
<view class="li" @click="openPage(5,'来之前打电话')">来之前打电话</view>
<view class="li" @click="openPage(5,'请尽快联系我')">请尽快联系我</view>
</view>
<view class="content">
<u-input v-model="remake" height="260" type="textarea" placeholder="请输入您的留言,最多可留言100字"
:border="true" />
</view>
</view>
</view>
</view>
<view class="recycling-fd">
<view class="a" v-if="type==2">免支付预购</view>
<view class="c" v-else style="color: #FE483B;font-size: 30rpx;">{{pay_price}}</view>
<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">
9 months ago
<view class="item" @click="tabMItem(-1,'-9998')">
<view :class="couponIndex == -9998?'item-on':''">不使用</view>
</view>
<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>
9 months ago
</view>
11 months ago
</u-popup>
<!-- 时间选择器 -->
9 months ago
<u-picker mode="time" :params="params" v-model="show" confirm-color="#FE483B" :show-time-tag="false"
@confirm="confirm"></u-picker>
</view>
</template>
11 months ago
<script>
9 months ago
import * as newFunApi from '@/api/newFun'
export default {
data() {
11 months ago
return {
9 months ago
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true
11 months ago
},
11 months ago
userInfo: {},
orderInfo: {},
list2: [],
11 months ago
pay_price: 0,
11 months ago
show2: true,
11 months ago
isShow: false,
9 months ago
show: false,
addrshow: false,
11 months ago
info: {},
11 months ago
type: 1,
9 months ago
isClick: true,
11 months ago
radioValue: "男士",
9 months ago
couponIndex: -9999,
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: "",
9 months ago
order_id: ""
}
11 months ago
},
onLoad(o) {
this.type = o.type;
this.server_id = o.id;
9 months ago
if (this.type == 1 && o.id) {
11 months ago
this.getServerCheckOrder()
}
9 months ago
},
11 months ago
methods: {
9 months ago
tabMItem(a, i) {
11 months ago
this.couponIndex = i
9 months ago
this.coupon_id = (a ? a.coupon_id : "")
11 months ago
this.isShow = false;
this.getServerCheckOrder(1)
},
//获取优惠券列表
async getServerCheckOrder(type) {
9 months ago
const {
status,
data
} = await newFunApi.serverCheckOrder({
11 months ago
server_id: this.server_id,
coupon_id: this.coupon_id
})
9 months ago
if (status == 200) {
11 months ago
this.info = data.info
9 months ago
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
}
},
9 months ago
confirm(e) {
this.server_time = e.year + "-" + e.month + '-' + e.day + " " + e.hour + "-" + e.minute + '-' + e.second
},
tabItem(i) {
this.tabIndex = i
11 months ago
},
changeRegion(e) {
9 months ago
this.addrshow = false
this.region = e.province.name + e.city.name + e.area.name;
},
9 months ago
openPage(i, a) {
if (i == 1) {
11 months ago
this.show = true
9 months ago
} else if (i == 2) {
11 months ago
this.isShow = true
9 months ago
} else if (i == 3) {
if (!this.server_time) {
11 months ago
uni.showToast({
icon: "none",
title: "服务时间不能为空"
})
9 months ago
return;
11 months ago
}
9 months ago
if (!this.username) {
11 months ago
uni.showToast({
icon: "none",
title: "联系人不能为空"
})
9 months ago
return;
11 months ago
}
9 months ago
if (!this.mobile) {
11 months ago
uni.showToast({
icon: "none",
title: "联系号码不能为空"
})
9 months ago
return;
}
9 months ago
if (!/^1[2|3|4|5|6|7|8|9]\d{9}$/.test(this.mobile)) {
uni.showToast({
icon: "none",
title: "联系号码格式不正确"
})
9 months ago
return;
11 months ago
}
9 months ago
if (this.region.length == 0) {
11 months ago
uni.showToast({
icon: "none",
title: "请选择所在城市"
})
9 months ago
return;
11 months ago
}
9 months ago
if (!this.address) {
11 months ago
uni.showToast({
icon: "none",
title: "详细地址不能为空"
})
9 months ago
return;
11 months ago
}
9 months ago
if (this.isClick == false) {
11 months ago
return;
}
this.isClick = false;
this.toServerCreateOrder();
9 months ago
} else if (i == 5) {
11 months ago
this.remake = a
9 months ago
} else {
11 months ago
}
},
9 months ago
11 months ago
//创建订单
async toServerCreateOrder() {
9 months ago
let {
status,
data,
message
} = await newFunApi.serverCreateOrder({
11 months ago
server_id: this.server_id,
client: 'MP-WEIXIN',
9 months ago
server_address: this.region[0] + this.region[1] + this.region[2] + this.address,
11 months ago
server_time: this.server_time,
coupon_id: this.coupon_id,
remake: this.remake,
username: this.username,
mobile: this.mobile,
})
9 months ago
if (status == 200) {
11 months ago
this.isClick = true
this.order_id = data.order_id
uni.redirectTo({
9 months ago
url: "/pages/news/recycling/pay?type=fuwu&order_id=" + data.order_id
11 months ago
})
9 months ago
} else {
11 months ago
this.isClick = true
uni.showToast({
icon: "none",
title: message
})
9 months ago
setTimeout(() => {
uni.redirectTo({
url: "/pages/news/recycling/orderList"
})
9 months ago
}, 2000)
11 months ago
}
},
9 months ago
}
}
</script>
<style lang="scss" scoped>
.recycling {
min-height: 100vh;
background-color: #FFFFFF;
padding-bottom: 130rpx;
11 months ago
overflow: hidden;
9 months ago
&-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;
11 months ago
font-weight: 500;
9 months ago
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%;
11 months ago
text-align: center;
9 months ago
max-height: 560rpx;
.item {
text-overflow: ellipsis;
overflow: hidden;
height: 70rpx;
11 months ago
font-size: 28rpx;
9 months ago
font-weight: 400;
color: #303030;
white-space: nowrap;
line-height: 70rpx;
padding-left: 80rpx;
box-sizing: border-box;
text-align: left;
&-on {
color: #FF624F;
}
11 months ago
}
}
9 months ago
.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
}
}
9 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%;
height: 100%;
display: block;
image {
11 months ago
width: 100%;
9 months ago
height: 100%;
display: block;
}
}
.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;
border-left: 1px solid #F1F1F1;
border-right: 1px solid #F1F1F1;
.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;
11 months ago
font-weight: 400;
9 months ago
color: #989898;
display: flex;
align-items: center;
justify-content: space-between;
image {
width: 30rpx;
height: 30rpx;
display: block;
margin: 0 auto;
margin-bottom: 20rpx;
11 months ago
}
}
}
9 months ago
.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;
11 months ago
}
}
9 months ago
.num {
flex: 1;
text-align: center;
font-size: 30rpx;
font-weight: 400;
color: #989898;
text-align: right;
}
11 months ago
}
}
}
9 months ago
.form {
padding: 0 40rpx;
overflow: hidden;
border-left: 1px solid #F1F1F1;
border-right: 1px solid #F1F1F1;
11 months ago
border-bottom: 1px solid #F1F1F1;
9 months ago
.remark {
.name {
font-size: 28rpx;
font-weight: 400;
color: #313131;
}
9 months ago
.xu {
display: flex;
flex-wrap: wrap;
overflow: hidden;
9 months ago
.li {
line-height: 52rpx;
background: #FFFFFF;
border-radius: 6rpx;
border: 1px solid #EDEDED;
padding: 0 20rpx;
margin-right: 20rpx;
9 months ago
text-align: center;
font-size: 24rpx;
font-weight: 400;
color: #949494;
margin-top: 20rpx;
}
}
9 months ago
.content {
padding: 20rpx 0 50rpx;
font-size: 28rpx;
color: #212121;
}
}
9 months ago
.photo {
padding: 20rpx 0;
overflow: hidden;
9 months ago
}
.item {
padding: 20rpx 0;
border-bottom: 1px solid #F4F4F4;
display: flex;
align-items: center;
.a {
width: 160rpx;
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 {
flex: 1;
font-size: 28rpx;
color: #212121;
line-height: 45rpx;
}
9 months ago
.box1 {
width: 160rpx;
font-size: 28rpx;
color: #212121;
line-height: 45rpx;
9 months ago
}
.radio {
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
border-left: 1px solid #E6E6E6;
}
}
9 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>