Commit 8b98804f authored by zhengke's avatar zhengke

修改

parent a7895cad
......@@ -3,6 +3,7 @@
height: 100%;
background: #f5f5f5;
}
.place_order .orderItem {
background-color: #fff;
margin-bottom: 10px;
......@@ -98,13 +99,15 @@
text-align: right;
padding-right: 20px;
}
.Ordersku .count-box {
display: flex;
width:90%;
margin:40px auto 20px;
width: 90%;
margin: 40px auto 20px;
padding: 15px 0;
}
.Ordersku .count-box .label{
.Ordersku .count-box .label {
font-size: 14px;
color: #333;
width: 1px;
......@@ -112,32 +115,46 @@
-webkit-flex: 1;
flex: 1;
}
.place_order .orderNum_close {
position: absolute;
right: 15px;
top: 15px;
}
.order_Remark{
color:red;
font-size:12px;
.order_Remark {
color: red;
font-size: 12px;
text-align: right;
margin-bottom:10px;
margin-bottom: 10px;
}
.disBtn{
background-color: gray!important;
background-image: none!important;
.disBtn {
background-color: gray !important;
background-image: none !important;
}
.Agree_content{
.Agree_content {
padding: 24rpx;
text-align: center;
background: #fff;
position: relative;
}
.place_order .order_close{
.place_order .order_close {
position: absolute;
right:10px;
top:10px;
z-index:999;
right: 10px;
top: 10px;
z-index: 999;
}
.place_order .Shop_Address{
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
</style>
<template>
......@@ -189,13 +206,13 @@
<view class="order_GName" style="border-top:0;">
<view class="order_big order_comLeft">联系人</view>
<view style="display: flex;align-items: center;">
<input class="uni-input" v-model="orderMsg.Consignee" style="border:1px solid #e2e2e2;padding-left:5px;"/>
<input class="uni-input" v-model="orderMsg.Consignee" style="border:1px solid #e2e2e2;padding-left:5px;" />
</view>
</view>
<view class="order_GName" style="border-top:0;">
<view class="order_big order_comLeft">联系电话</view>
<view style="display: flex;align-items: center;">
<input class="uni-input" v-model="orderMsg.Mobile" style="border:1px solid #e2e2e2;padding-left:5px;"/>
<input class="uni-input" v-model="orderMsg.Mobile" style="border:1px solid #e2e2e2;padding-left:5px;" />
</view>
</view>
<view class="order_GName" style="border-top:0;">
......@@ -204,18 +221,24 @@
四川 成都市
</view>
</view>
<view class="order_GName">
<view class="order_GName" @click="openmap(),isShowStart=1">
<view class="order_big order_comLeft">出发地址</view>
<view style="display: flex;align-items: center;">
<image class="or_Image" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/o_address.png"></image>
<text>{{msg.ShoppingAddress}}</text>
<view style="display: flex;align-items: center;width:56%" v-if="msg.ShoppingAddress!=''">
<image class="or_Image" mode="aspectFit" style="width:30px;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/o_address.png"></image>
<text class="Shop_Address">{{msg.ShoppingAddress}}</text>
</view>
<view v-else>
<text>请选择</text>
</view>
<view class="order_GName" v-if="mchs[0].goods_list[0].goods_attr.car_type!=5">
</view>
<view class="order_GName" v-if="mchs[0].goods_list[0].goods_attr.car_type!=5" @click="openmap(),isShowStart=2">
<view class="order_big order_comLeft">目的地</view>
<view style="display: flex;align-items: center;">
<image class="or_Image" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/o_address.png"></image>
<text>锦江区阳光新野中心</text>
<view style="display: flex;align-items: center;width:56%" v-if="orderMsg.DestinationAddress!=''">
<image class="or_Image" mode="aspectFit" style="width:30px;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/o_address.png"></image>
<text>{{orderMsg.DestinationAddress}}</text>
</view>
<view v-else>
<text>请选择</text>
</view>
</view>
<view class="order_GName" style="height:90px;align-items: normal;">
......@@ -223,7 +246,7 @@
<view style="display: flex;align-items: center;" @click="gotime">
<view style="text-align: right;">
<view>{{STime.month}}{{STime.day}}{{STime.week+' '+STime.hour+':'+STime.minute}}</view>
<view style="margin:5px 0;"><text style="color:#4578FF;font-size:12px;">{{intervalDay}}</text></view>
<view style="margin:5px 0;"><text style="color:#4578FF;font-size:12px;">({{intervalDay==0.5?'半':intervalDay}}天)</text></view>
<view>{{ETime.month}}{{ETime.day}}{{ETime.week+' '+ETime.hour+':'+ETime.minute}}</view>
</view>
<view>
......@@ -284,7 +307,7 @@
</view>
<view class="order_GName">
<view style="text-align: right;width:100%;">
<text style="color:#ADADAD;margin-right:10px;">2</text>
<text style="color:#ADADAD;margin-right:10px;">{{intervalDay==0.5?'半':intervalDay}}</text>
<text>小计:<text style="color:#F20707;">¥{{mchs[0].total_price}}</text></text>
</view>
</view>
......@@ -298,7 +321,9 @@
<!-- 购买数量 -->
<u-popup mode="bottom" v-model="showPeopleDialog" border-radius="14" :mask-close-able="true" custom-style="padding:0;background:none;">
<view class="Ordersku">
<view class="orderNum_close"><u-icon name="cross" color="#9F9F9F" @click="showPeopleDialog=false" size="40" /></view>
<view class="orderNum_close">
<u-icon name="cross" color="#9F9F9F" @click="showPeopleDialog=false" size="40" />
</view>
<view class="count-box">
<text class="label">购买数量</text>
<u-number-box v-model="msg.DetailList[0].Number" :min="1" @change="valChange"></u-number-box>
......@@ -322,15 +347,29 @@
</scroll-view>
</view>
</u-popup>
<payCom v-if="payBtn" :payInfo="payInfo" @closePay="closePay"></payCom>
<u-popup v-model="payExit" mode="center" :mask-close-able="false">
<view style="background:#fff;width:500rpx">
<view style="padding:10px 0 0 10px">提交失败</view>
<view style="text-align:center;padding-bottom:40rpx">
<view style="margin:80rpx 0">支付取消</view>
<span @click="exitPay" style="padding:10rpx 50rpx;color:#fff;background:#19be6b;border-radius: 12px;">确定</span>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import amap from './components/amap-wx.js'
import AddressParse from '../address/zh-address-parse.min.js'
import coupon from '@/components/coupon/index';
import payCom from '@/components/pay/pay';
export default {
components: {
coupon
coupon,
payCom
},
data() {
return {
......@@ -343,7 +382,7 @@
GoodsId: 0, //商品id
Number: 0, //人数
}],
TripSTime: '2020-09-17 12:00:00', //预约日期
TripSTime: '', //预约日期
District: 0, //区id
City: 0, //市id
Province: 0, //省id
......@@ -361,70 +400,98 @@
color: '#FFF',
fontSize: '13px',
width: '90%',
background:'#EE4454',
marginBottom:'20px'
background: '#EE4454',
marginBottom: '20px'
},
//是否显示修改人数
showPeopleDialog:false,
showPeopleDialog: false,
//优惠券
couponList:[],
couponList: [],
//优惠券弹窗
showCoupon:false,
mchs:[],
dataList:[], //数据源
showCoupon: false,
mchs: [],
dataList: [], //数据源
userInt: false,
checked:true,
showAgree:false, //是否显示协议弹窗
contentHeight:0,
checked: true,
showAgree: false, //是否显示协议弹窗
contentHeight: 0,
//下单msg
orderMsg:{
Consignee:'', //联系人
Mobile:'', //联系电话
Province:0, //省id
City:0, //市id
District:0, //区id
ShoppingAddress:'', //接送地址
BuyerMessage:'', //买家留言
DetailList:[{
orderMsg: {
Consignee: '', //联系人
Mobile: '', //联系电话
Province: 0, //省id
City: 0, //市id
District: 0, //区id
ShoppingAddress: '', //接送地址
BuyerMessage: '', //买家留言
DetailList: [{
GoodsId: 0, //商品id
Number: 0, //人数
}],
User_Coupon_Id:0, //使用优惠券id
CouponMoney:'', //优惠金额
Income:'' ,//客人付款金额
Use_Integral:'', //使用积分数量
AnchorName:'', //主播名称
TripSTime:'', //预定起始时间
TripETime:'', //预定结束时间
CarType:'', //服务类型
DestinationAddress:'' //目的地
},
intervalDay:'',
StartTime:'',
EndTime:'',
STime:{},
ETime:{},
User_Coupon_Id: 0, //使用优惠券id
CouponMoney: '', //优惠金额
Income: '', //客人付款金额
Use_Integral: '', //使用积分数量
AnchorName: '', //主播名称
TripSTime: '', //预定起始时间
TripETime: '', //预定结束时间
CarType: '', //服务类型
DestinationAddress: '' //目的地
},
intervalDay: '',
StartTime: '',
EndTime: '',
STime: {},
ETime: {},
Pickcar: '成都', //取车城市
amapPlugin: null,
key: 'c785085c46d1eb41b1ebe8d1ec7fd945',
latitude: '',
longitude: '',
isShowStart:1, //1出发地址赋值 2目的地赋值
//支付信息
payInfo: {
OpenId: 'ow_7I5XC1-RGwwk8QANBmWKYKmOc',
OrderId: '',
OrderPayType: 1,
GoodsName: ''
},
payBtn:false,
payExit: false,
};
},
onLoad(options) {
console.log(options);
if(options){
if (options) {
console.log(options,'options');
this.msg.DetailList[0].GoodsId = options.GoodsId;
this.msg.DetailList[0].Number = options.Number;
this.msg.ShoppingAddress = options.ShoppingAddress;
//时间的处理
this.msg.TripSTime = options.StartTime;
this.STime = this.getTime(options.StartTime)
this.StartTime= options.StartTime
this.ETime = this.getTime(options.EndTime)
this.EndTime= options.EndTime;
this.STime = this.getTime(options.StartTime);
this.StartTime = options.StartTime;
this.ETime = this.getTime(options.EndTime);
this.EndTime = options.EndTime;
this.orderMsg.TripSTime = options.StartTime;
this.orderMsg.TripETime = options.EndTime;
this.payInfo.OpenId=uni.getStorageSync('mall_UserInfo').OpenId;
//地址处理
let parseResult = AddressParse(this.msg.ShoppingAddress, 0)
let nameList = [parseResult.province, parseResult.city, parseResult.area];
this.getDestination(nameList);
this.amapPlugin = new amap.AMapWX({
key: this.key
});
this.getRegeo()
}
},
created() {
......@@ -436,20 +503,57 @@
this.contentHeight = this.$utils.calcContentHeight(100) + "px";
},
methods: {
getRegeo() {
uni.showLoading({
title: '获取信息中'
});
this.amapPlugin.getRegeo({
success: (data) => {
console.log(data, 'data');
this.Pickcar = data[0].regeocodeData.addressComponent.city;
this.latitude = data[0].latitude;
this.longitude = data[0].longitude;
uni.hideLoading();
}
});
},
openmap() { //打开地图选择详情地址
let that = this
uni.chooseLocation({
latitude: this.latitude,
longitude: this.longitude,
success: function(res) {
console.log(res,'地址');
if(that.isShowStart==1){
that.latitude = res.latitude;
that.longitude = res.longitude;
that.msg.ShoppingAddress = res.address
let parseResult = AddressParse(that.msg.ShoppingAddress, 0)
let nameList = [parseResult.province, parseResult.city, parseResult.area];
that.getDestination(nameList);
}else{
that.orderMsg.DestinationAddress = res.address;
}
}
});
},
//获取数据
getData(){
getData() {
this.request2({
url: '/api/AppletGCOrder/GetAppletSDGoodsSettlementInfo',
data: this.msg
},
res => {
console.log(res,'列表数据');
if(res.resultCode==1){
console.log(res, '列表数据');
if (res.resultCode == 1) {
this.dataList = res.data;
this.mchs = res.data.mch_list;
this.intervalDay = this.dataList.mch_list[0].goods_list[0].goods_attr.use_day;//获取多少天
this.mchs.forEach(x=>{
x.goods_list.forEach(j=>{
this.intervalDay = this.dataList.mch_list[0].goods_list[0].goods_attr.use_day; //获取多少天
this.payInfo.GoodsName = this.mchs[0].goods_list[0].goods_attr.car_name.slice(0,10);
this.mchs.forEach(x => {
x.goods_list.forEach(j => {
j.marketingLogo = JSON.parse(j.marketingLogo)
})
})
......@@ -458,22 +562,27 @@
}
);
},
gotime(){
gotime() {
let GoodsId = this.msg.DetailList[0].GoodsId
uni.navigateTo({
url:'/pages/guidecar/rili?StartTime='+this.StartTime+'&EndTime='+this.EndTime+'&use_day='+this.intervalDay+'&GoodsId='+GoodsId
url: '/pages/guidecar/rili?StartTime=' + this.StartTime + '&EndTime=' + this.EndTime + '&use_day=' + this.intervalDay +
'&GoodsId=' + GoodsId
})
},
gotimeconfirm(StartTime,EndTime){//选择时间返回的参数
console.log(StartTime,EndTime)
gotimeconfirm(StartTime, EndTime) { //选择时间返回的参数
console.log(StartTime, EndTime)
this.STime = this.getTime(StartTime)
this.StartTime= StartTime
this.StartTime = StartTime
this.ETime = this.getTime(EndTime)
this.EndTime= EndTime;
this.EndTime = EndTime;
this.msg.TripSTime = StartTime;
this.orderMsg.TripSTime = StartTime
this.orderMsg.TripETime = EndTime
this.getData()
},
getTime(time){
getTime(time) {
let myDate = new Date(time);
let obj = {}
obj.year = myDate.getFullYear(); //年
......@@ -482,23 +591,23 @@
obj.hour = myDate.getHours(); //时
obj.minute = myDate.getMinutes(); //分
let days = myDate.getDay();
obj.week = this.getweek(days)//星期几
obj.week = this.getweek(days) //星期几
return obj
},
getweek(day){//根据值返回当前时间的星期几
if(day==1){
getweek(day) { //根据值返回当前时间的星期几
if (day == 1) {
return '星期一'
}else if(day==2){
} else if (day == 2) {
return '星期二'
}else if(day==3){
} else if (day == 3) {
return '星期三'
}else if(day==4){
} else if (day == 4) {
return '星期四'
}else if(day==5){
} else if (day == 5) {
return '星期五'
}else if(day==6){
} else if (day == 6) {
return '星期六'
}else if(day==0){
} else if (day == 0) {
return '星期日'
}
},
......@@ -511,7 +620,7 @@
}
},
res => {
if(res.resultCode==1){
if (res.resultCode == 1) {
if (res.data.length == 3) {
this.msg.Province = res.data[0].ID;
this.msg.City = res.data[1].ID;
......@@ -528,11 +637,11 @@
},
//人数
valChange(e) {
this.msg.DetailList[0].Number =e.value;
this.msg.DetailList[0].Number = e.value;
},
//点击确定
sureBuyNum(){
this.showPeopleDialog=false;
sureBuyNum() {
this.showPeopleDialog = false;
this.getData();
},
//关闭弹窗
......@@ -547,20 +656,20 @@
closeCouponHandler(e) {
if (e != -1) {
this.msg.User_Coupon_Id = e;
console.log(e,'e');
console.log(e, 'e');
this.getData();
}
this.showCoupon = false;
},
//选择是否用积分
changeUseInt(e){
changeUseInt(e) {
this.userInt = e.value;
this.msg.Use_Integral = this.userInt ? 1 : 0;
this.getData();
},
//点击始终同意协议
changeAgree(e){
this.checked=true;
changeAgree(e) {
this.checked = true;
},
//获取优惠券下拉数据
initCoupon() {
......@@ -575,46 +684,65 @@
ProductList.push(obj);
});
});
this.request2(
{
this.request2({
url: '/api/AppletCoupon/GetNoUseCouponList',
data: { ProductList: ProductList }
data: {
ProductList: ProductList
}
},
res => {
if (res.resultCode == 1) {
this.couponList = res.data;
console.log(this.couponList,'优惠券');
console.log(this.couponList, '优惠券');
}
}
);
},
//提交订单
subOrder(){
if(this.dataList.date_enable){
this.orderMsg.Province=this.msg.Province;
this.orderMsg.City=this.msg.City;
this.orderMsg.District=this.msg.District;
this.orderMsg.ShoppingAddress=this.msg.ShoppingAddress;
subOrder() {
if (this.dataList.date_enable) {
this.orderMsg.Province = this.msg.Province;
this.orderMsg.City = this.msg.City;
this.orderMsg.District = this.msg.District;
this.orderMsg.ShoppingAddress = this.msg.ShoppingAddress;
this.orderMsg.DetailList = this.msg.DetailList;
this.orderMsg.User_Coupon_Id=this.msg.User_Coupon_Id;
this.orderMsg.CouponMoney=this.dataList.mch_list[0].coupon.coupon_discount; //优惠金额
this.orderMsg.User_Coupon_Id = this.msg.User_Coupon_Id;
this.orderMsg.CouponMoney = this.dataList.mch_list[0].coupon.coupon_discount; //优惠金额
this.orderMsg.Income = this.dataList.total_price;
this.orderMsg.Use_Integral = this.msg.Use_Integral;
this.orderMsg.TripSTime = '' //待写
this.orderMsg.TripETime = '' //待写
this.orderMsg.CarType = this.dataList.mch_list[0].goods_list[0].goods_attr.car_type;
this.orderMsg.AnchorName = uni.getStorageSync("AnchorName")?uni.getStorageSync("AnchorName").AnchorName:''; //直播名称
console.log(this.orderMsg,'orderMsg');
this.request2({
url: '/api/AppletOrder/SetAppletSDGoodsOrderInfo',
data: this.orderMsg
},
res => {
if(res.resultCode==1){
if (res.resultCode == 1) {
this.payInfo.OrderId = res.data.OrderId;
this.payInfo.total_price = this.dataList.total_price;
this.payBtn = true;
}else{
this.$refs.uToast.show({
title: res.data.message,
type: 'warning'
});
}
}
);
}
}
},
closePay() {
this.payBtn = false;
this.payExit = true;
},
exitPay() {
this.payExit = false;
uni.redirectTo({
url: "/pages/guidecar/index",
});
},
},
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment