funeralreportmove.vue
5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
<view class="page">
<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
<view class="content">
<view class="message-list">
<view class="titleall-box">
<view class="titleall-left"><view class="titleall-left-line"></view>遗体接运信息<text style="color: red;">(必填)</text></view>
</view>
<view class="info-box">
<view class="info-box-list">
<view class="info-box-width width100">
<!-- <view @click="areashow = true">{{area}}</view> -->
<view>
<input v-model="area" class="input-text" type="text" placeholder="请输入详细地址" placeholder-class="inputtext" />
</view>
<view class="info-box-small">接运地点</view>
</view>
</view>
<u-picker :show="areashow" :columns="areacolumns" @confirm="areaconfirm" @close="areaclose"></u-picker>
<view class="info-box-list">
<view class="info-box-width width100">
<view @click="timeshow = true">
<label>{{accessTime}}</label>
</view>
<view class="info-box-small">接运时间</view>
</view>
</view>
<view class="info-box-list">
<view class="info-box-width width100">
<view>
<input v-model="remarks" class="input-text" type="text" placeholder="请输入" placeholder-class="inputtext" />
</view>
<view class="info-box-small">备注</view>
</view>
</view>
</view>
</view>
<u-datetime-picker
:show="timeshow"
mode="datetime"
v-model="accessTimeby"
@confirm="xztime"
@cancel="qxtime"
></u-datetime-picker>
<view class="page-footer">
<view class="footer-buy">
<view class="cart-add">
<view><image src="../../static/btn2.png"></image></view>
<view class="cart-add-text"><image src="../../static/phone.png"></image><text>联系电话</text></view>
</view>
<view class="buy-at" @click="funeralresult">
<image src="../../static/btn1.png"></image>
<text>下一步</text>
</view>
</view>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script>
export default {
data() {
return {
OrderType: 0,
nvConfig:{
title:"遗体接运",
bgColor:"#ffffff",
color:"#000000",
fixedAssist:{
hide:true,
},
},
accessLocation:"",
area:"",
xxarea:"",
areashow:false,
areacolumns:[
['地区1', '地区2']
],
accessTime:"请选择",
accessTimeby:2,
timeshow:false,
remarks:"",
info:{}
};
},
onPageScroll(e) {this.$refs.nv.pageScroll(e)},
computed:{
pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
},
onLoad(params) {
const timestamp = Date.now();
this.accessTime = this.timestampToTime(timestamp);
console.log("params",params);
this.info = JSON.parse(params.info)
console.log(this.info);
console.log("dh",uni.getStorageSync('dh'));
},
methods:{
xztime(value){
this.timeshow = false
var that = this;
let selectTime =this.timestampToTime(value.value);
that.accessTime = selectTime;
},
qxtime(){
this.timeshow = false
},
timestampToTime(timestamp) {
timestamp = timestamp ? timestamp : null;
let date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
return Y + M + D + h + m + s;
},
funeralresult(){
this.info.accessLocation = this.area
this.info.accessTime = this.accessTime
// this.info.obituaryType = "网上报丧"
if(uni.getStorageSync('dh') == 2){
this.info.obituaryType = "电话报丧"
}else{
this.info.obituaryType = "网上报丧"
}
this.info.remarks = this.remarks
this.info.userId = uni.getStorageSync("USERS_KEY").userId
console.log(this.info);
// return
if(this.area != '请输入详细地址' && this.accessTime != "请选择" && this.remarks != ''){
this.API.tjwsyy(this.info).then(res=>{
console.log("网上报丧",res);
})
uni.navigateTo({
url: '/pages/funeralresult/funeralresult',
})
}else{
console.log(1123);
this.$refs.uToast.show({
type: 'error',
title: '成功主题(带图标)',
message: "提交失败请填写完整信息",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
})
}
},
// 地区选择确认回调
areaconfirm(e){
this.areashow = false
this.area = e.value[0];
},
areaclose(){
this.areashow = false
},
timeclose(){
this.timeshow = false
},
}
}
</script>
<style scoped lang="scss">
@import 'funeralreportmove.scss';
</style>