699dfdee by 华明祺

no message

1 parent 5beac84c
1 import request from './request.js' 1 import request from './request.js'
2 import config from '@/config.js'
3 2
4 function getTrainList(params) { 3 function getTrainList(params) {
5 return request({ 4 return request({
...@@ -19,9 +18,11 @@ function getComanyList(params) { ...@@ -19,9 +18,11 @@ function getComanyList(params) {
19 18
20 function getTrainDetail(id) { 19 function getTrainDetail(id) {
21 return request({ 20 return request({
22 url: `/train/info/getTrainByUser/${id}`, 21 url: `/train/info/getTrainByUser`,
23 method: 'get', 22 method: 'get',
24 params: id 23 params: {
24 id
25 }
25 }) 26 })
26 } 27 }
27 28
...@@ -115,8 +116,11 @@ function getInvoiceDetailBills(invoiceId) { ...@@ -115,8 +116,11 @@ function getInvoiceDetailBills(invoiceId) {
115 116
116 function getInvoiceDetail(invoiceId) { 117 function getInvoiceDetail(invoiceId) {
117 return request({ 118 return request({
118 url: `/train/invoice/${invoiceId}`, 119 url: `/train/invoice/getInvoiceById`,
119 method: 'get' 120 method: 'get',
121 params: {
122 id: invoiceId
123 }
120 }) 124 })
121 } 125 }
122 126
...@@ -126,26 +130,20 @@ function getInvoiceByUserId() { ...@@ -126,26 +130,20 @@ function getInvoiceByUserId() {
126 method: 'get' 130 method: 'get'
127 }) 131 })
128 } 132 }
129 // /-sss--sss--sssssss---ssssssssss-----////
130
131
132 133
133 134
134 function getbilllist(userId, venueId) { 135 function getbilllist(userId, venueId) {
135 return request({ 136 return request({
136 url: `/logex/order/list?createById=${userId}&venueId=${venueId}`, 137 url: `/logex/order/list?createById=${userId}&venueId=${venueId}`,
137 method: 'get', 138 method: 'get'
138 params: userId
139 }) 139 })
140 } 140 }
141 141
142 142
143 function getbilldetailbyId(orderId) { 143 function getbilldetailbyId(orderId) {
144 return request({ 144 return request({
145 // url: `/logex/order/${orderId}`,
146 url: `/logex/norder/${orderId}`, 145 url: `/logex/norder/${orderId}`,
147 method: 'get', 146 method: 'get'
148 params: orderId
149 }) 147 })
150 } 148 }
151 149
...@@ -178,8 +176,7 @@ function cancelOrder() { ...@@ -178,8 +176,7 @@ function cancelOrder() {
178 function cancelOrder2(orderId) { 176 function cancelOrder2(orderId) {
179 return request({ 177 return request({
180 url: `/logex/norder/cancelOrderBack//${orderId}`, 178 url: `/logex/norder/cancelOrderBack//${orderId}`,
181 method: 'post', 179 method: 'post'
182 params: orderId
183 }) 180 })
184 } 181 }
185 182
...@@ -188,8 +185,7 @@ function payForOrder(orderId) { ...@@ -188,8 +185,7 @@ function payForOrder(orderId) {
188 return request({ 185 return request({
189 // url: `/logex/order/payForOrder?orderId=${orderId}&openId=${nowOpenId}`, 186 // url: `/logex/order/payForOrder?orderId=${orderId}&openId=${nowOpenId}`,
190 url: `/train/order/payForOrder?orderId=${orderId}`, 187 url: `/train/order/payForOrder?orderId=${orderId}`,
191 method: 'post', 188 method: 'post'
192 params: orderId
193 }) 189 })
194 } 190 }
195 191
......
...@@ -25,17 +25,9 @@ function getToken() { ...@@ -25,17 +25,9 @@ function getToken() {
25 25
26 // 获取请求头 26 // 获取请求头
27 function getHeaders() { 27 function getHeaders() {
28 let header 28 const header = {
29 if (config.localPort) { 29 "isToken": false,
30 header = { 30 'content-type': 'application/x-www-form-urlencoded'
31 "isToken": false,
32 'content-type': 'application/x-www-form-urlencoded'
33 }
34 } else {
35 header = {
36 "Authorization": getToken(),
37 "Content-Type": "application/json",
38 }
39 } 31 }
40 32
41 return header 33 return header
...@@ -61,18 +53,19 @@ let request = function(req) { ...@@ -61,18 +53,19 @@ let request = function(req) {
61 53
62 const token = getToken() 54 const token = getToken()
63 let tempUrl = req.url 55 let tempUrl = req.url
64 // if (token) { 56 if (token) {
65 if (tempUrl.indexOf('?') > -1) { 57 if (tempUrl.indexOf('?') > -1) {
66 tempUrl += '&userNo=' + token 58 tempUrl += '&userNo=' + token
67 } else { 59 } else {
68 tempUrl += '?userNo=' + token 60 tempUrl += '?userNo=' + token
61 }
69 } 62 }
70 // }
71 63
72 let url, data 64 let url, data
73 if (config.localPort) { 65 if (config.localPort) {
74 const baseUrl = config.localPort + '/jsintszxd/request' 66 const baseUrl = config.localPort + '/jsintszxd/request'
75 if (req.method === 'POST') { 67 if (req.method === 'POST') {
68 req.params.userNo = token
76 url = baseUrl 69 url = baseUrl
77 data = { 70 data = {
78 appSecretId: config.appSecretId, 71 appSecretId: config.appSecretId,
...@@ -92,8 +85,23 @@ let request = function(req) { ...@@ -92,8 +85,23 @@ let request = function(req) {
92 url = `${baseUrl}?appSecretId=${config.appSecretId}&restApi=${encodeURIComponent(tempUrl)}` 85 url = `${baseUrl}?appSecretId=${config.appSecretId}&restApi=${encodeURIComponent(tempUrl)}`
93 } 86 }
94 } else { 87 } else {
88 if (req.method === 'POST') {
89 req.params.userNo = token
90 data = {
91 jsonBody: JSON.stringify(req.params)
92 }
93 } else {
94 if (req.params) {
95 for (const key of Object.keys(req.params)) {
96 if (tempUrl.indexOf('?') > -1) {
97 tempUrl += `&${key}=${req.params[key]}`
98 } else {
99 tempUrl += `?${key}=${req.params[key]}`
100 }
101 }
102 }
103 }
95 url = config.baseUrl_api + tempUrl 104 url = config.baseUrl_api + tempUrl
96 data = req.params
97 } 105 }
98 106
99 return new Promise((resolve, reject) => { 107 return new Promise((resolve, reject) => {
......
1 <template> 1 <template>
2 <view :style="orderType=='all'?'':'height: calc(100vh - 200rpx);overflow: auto;'"> 2 <view :style="orderType=='all'?'':'height: calc(100vh - 200rpx);overflow: auto;'">
3 <view class="colorfulBg"> 3 <view class="colorfulBg">
4 <view class="name">{{form.name}}</view> 4 <view class="name">{{form.name}}</view>
5 <view class="whiteItem" v-if="orderType==0||orderType=='all'"> 5 <view class="whiteItem" v-if="orderType==0||orderType=='all'">
6 <view class="pp">报到时间:{{form.reportDate?.substring(0, 10)}}</view> 6 <view class="pp">报到时间:{{form.reportDate?.substring(0, 10)}}</view>
7 <view class="pp">培训周期:{{form.trainStart?.substring(0, 10)}}{{form.trainEnd?.substring(0, 10)}}</view> 7 <view class="pp">培训周期:{{form.trainStart?.substring(0, 10)}}{{form.trainEnd?.substring(0, 10)}}</view>
8 <!-- <view class="pp">培训地点:{{form.address}}</view> --> 8 <!-- <view class="pp">培训地点:{{form.address}}</view> -->
9 </view> 9 </view>
10 10
11 <view class="whiteItem" v-if="orderType==1||orderType=='all'"> 11 <view class="whiteItem" v-if="orderType==1||orderType=='all'">
12 <view class="pp">入住时间:{{form.trainStart?.substring(0, 10)}}{{form.trainEnd?.substring(0, 10)}}</view> 12 <view class="pp">入住时间:{{form.trainStart?.substring(0, 10)}}{{form.trainEnd?.substring(0, 10)}}</view>
13 <view class="pp">房费:{{form.stayFee}}</view> 13 <view class="pp">房费:{{form.stayFee}}</view>
14 14
15 </view> 15 </view>
16 <view class="whiteItem" v-if="orderType==2||orderType=='all'"> 16 <view class="whiteItem" v-if="orderType==2||orderType=='all'">
17 <view class="pp">就餐次数:{{form.repastNum}}</view> 17 <view class="pp">就餐次数:{{form.repastNum}}</view>
18 <view class="pp">餐费:{{form.repastFee}}</view> 18 <view class="pp">餐费:{{form.repastFee}}</view>
19 19
20 </view> 20 </view>
21 </view> 21 </view>
22 22
23 <uni-forms> 23 <!-- <uni-forms>
24 <view> 24 <view>
25 <view class="t"> 培训人员信息 </view> 25 <view class="t"> 培训人员信息 </view>
26 <view class="whiteItem"> 26 <view class="whiteItem">
27 <view class="pp">工号:<text>{{detail.userNo}}</text></view> 27 <view class="pp">工号:<text>{{detail.userNo}}</text></view>
28 <view class="pp">姓名:<text>{{detail.nickName}}</text></view> 28 <view class="pp">姓名:<text>{{detail.nickName}}</text></view>
29 <view class="pp">性别:<text>{{detail.sex=='0'?'男':'女'}}</text></view> 29 <view class="pp">性别:<text>{{detail.sex=='0'?'男':'女'}}</text></view>
30 <view class="pp">身份证号码:<text>{{detail.card}}</text></view> 30 <view class="pp">身份证号码:<text>{{detail.card}}</text></view>
31 <view class="pp">单位名称:<text>{{detail.companyName}}</text></view> 31 <view class="pp">单位名称:<text>{{detail.companyName}}</text></view>
32 <view class="pp">部门:<text>{{detail.deptName}}</text></view> 32 <view class="pp">部门:<text>{{detail.deptName}}</text></view>
33 <view class="pp">岗位:<text>{{detail.postName}}</text></view> 33 <view class="pp">岗位:<text>{{detail.postName}}</text></view>
34 <view class="pp">联系方式:<text>{{detail.phonenumber}}</text></view> 34 <view class="pp">联系方式:<text>{{detail.phonenumber}}</text></view>
35 <view class="pp">备注信息:<text>{{detail.userNo}}</text></view> 35 <view class="pp">备注信息:<text>{{detail.userNo}}</text></view>
36 36
37 </view> 37 </view>
38 </view> 38 </view>
39 </uni-forms> 39 </uni-forms> -->
40 </view> 40 </view>
41 <view class="bbfix" v-if="orderType!='all'"> 41 <view class="bbfix" v-if="orderType!='all'">
42 <!-- 底部提交 --> 42 <!-- 底部提交 -->
43 <view class="price"> 43 <view class="price">
44 总价: 44 总价:
45 <text v-if="orderType==0">{{ form.trainFee }}</text> 45 <text v-if="orderType==0">{{ form.trainFee }}</text>
46 <text v-if="orderType==1">{{ form.stayFee }}</text> 46 <text v-if="orderType==1">{{ form.stayFee }}</text>
47 <text v-if="orderType==2">{{ form.repastFee }}</text> 47 <text v-if="orderType==2">{{ form.repastFee }}</text>
48 </view> 48 </view>
49 49
50 <view class="subBtn" @click="unsubscribe" v-if="status == '1'"> 退订</view> 50 <view class="subBtn" @click="unsubscribe" v-if="status == '1'"> 退订</view>
51 51
52 </view> 52 </view>
53 <uni-popup ref="tdpopup" background-color="#fff" class="popupMation" type="bottom"> 53 <uni-popup ref="tdpopup" background-color="#fff" class="popupMation" type="bottom">
54 <view class="popup-content"> 54 <view class="popup-content">
55 <view class="centertitle">退订说明</view> 55 <view class="centertitle">退订说明</view>
56 56
57 <view> 57 <view>
58 <view class="pp"> 58 <view class="pp">
59 退订联系人:<text>{{info.name}}</text> 59 退订联系人:<text>{{info.name}}</text>
60 </view> 60 </view>
61 <view class="pp" @click="callphone(info.tel)"> 61 <view class="pp" @click="callphone(info.tel)">
62 联系电话:<text>{{info.tel}}</text> 62 联系电话:<text>{{info.tel}}</text>
63 </view> 63 </view>
64 <view class="pp"> 64 <view class="pp">
65 邮箱:<text>{{info.email}}</text> 65 邮箱:<text>{{info.email}}</text>
66 </view> 66 </view>
67 </view> 67 </view>
68 </view> 68 </view>
69 69
70 </uni-popup> 70 </uni-popup>
71 71
72 </template> 72 </template>
73 73
74 <script setup> 74 <script setup>
75 import {reactive,toRefs} from 'vue'; 75 import {
76 import {onLoad,onShow} from '@dcloudio/uni-app'; 76 reactive,
77 import * as api from '@/common/api.js'; 77 toRefs
78 import * as hotel from '@/common/hotel.js'; 78 } from 'vue';
79 import {
80 onLoad,
81 onShow
82 } from '@dcloudio/uni-app';
83 import * as api from '@/common/api.js';
84 import * as hotel from '@/common/hotel.js';
79 const data = reactive({ 85 const data = reactive({
80 form: { 86 form: {},
81 }, 87 status: null,
82 status:null, 88 tdpopup: null,
83 tdpopup:null, 89 detail: {},
84 detail:{}, 90 info: {},
85 info:{}, 91 orderType: ''
86 orderType:''
87 }) 92 })
88 const { 93 const {
89 form,detail,orderType,info,status,tdpopup 94 form,
90 } = toRefs(data); 95 detail,
91 96 orderType,
92 let trainId = '' 97 info,
93 onLoad((options)=>{ 98 status,
94 trainId = options.trainId 99 tdpopup
95 orderType.value = options.orderType 100 } = toRefs(data);
96 console.log(orderType.value) 101
97 status.value = options.status 102 let trainId = ''
98 init() 103 onLoad((options) => {
99 }) 104 trainId = options.trainId
100 function init(){ 105 orderType.value = options.orderType
101 getData() 106 console.log(orderType.value)
102 } 107 status.value = options.status
103 function getData(){ 108 init()
104 // 培训详情 109 })
105 hotel.getTrainDetail(trainId).then(res => { 110
106 form.value = res.data 111 function init() {
107 }) 112 getData()
108 // 用户信息 113 }
109 api.checkReport().then((res)=>{ 114
110 detail.value = res.data 115 function getData() {
111 }) 116 // 培训详情
112 } 117 hotel.getTrainDetail(trainId).then(res => {
113 function unsubscribe(){ 118 form.value = res.data
114 hotel.cancelOrder().then(res=>{ 119 })
115 info.value = res.data 120 // 用户信息
116 tdpopup.value.open() 121 // api.checkReport().then((res)=>{
117 }) 122 // detail.value = res.data
118 } 123 // })
124 }
125
126 function unsubscribe() {
127 hotel.cancelOrder().then(res => {
128 info.value = res.data
129 tdpopup.value.open()
130 })
131 }
132
119 function callphone(number) { 133 function callphone(number) {
120 uni.makePhoneCall({ 134 uni.makePhoneCall({
121 phoneNumber: number 135 phoneNumber: number
122 }); 136 });
123 } 137 }
124 </script> 138 </script>
125 139
126 <style lang="scss" scoped> 140 <style lang="scss" scoped>
127 :deep(.uni-forms-item__inner){padding-bottom: 10rpx;} 141 :deep(.uni-forms-item__inner) {
128 :deep(.uni-forms-item__content){line-height: 36px;} 142 padding-bottom: 10rpx;
129 .t{padding: 20rpx;} 143 }
130 .hotel { 144
131 } 145 :deep(.uni-forms-item__content) {
132 .whiteItem{ width: 700rpx; 146 line-height: 36px;
147 }
148
149 .t {
150 padding: 20rpx;
151 }
152
153 .hotel {}
154
155 .whiteItem {
156 width: 700rpx;
133 box-sizing: border-box; 157 box-sizing: border-box;
134 margin: 0 auto 26rpx; 158 margin: 0 auto 26rpx;
135 padding: 26rpx; 159 padding: 26rpx;
136 background: #FFFFFF; 160 background: #FFFFFF;
137 box-shadow: 0rpx 0rpx 27rpx 0rpx #DEDEDE; 161 box-shadow: 0rpx 0rpx 27rpx 0rpx #DEDEDE;
138 border-radius: 15rpx;} 162 border-radius: 15rpx;
139 .roomType{color: #4C5359;font-size: 28rpx;margin:10rpx 0;} 163 }
140 .roomInfo{color: #4C5359;font-size: 28rpx;} 164
141 .tip{font-size: 28rpx;color: #E60012;} 165 .roomType {
142 166 color: #4C5359;
167 font-size: 28rpx;
168 margin: 10rpx 0;
169 }
170
171 .roomInfo {
172 color: #4C5359;
173 font-size: 28rpx;
174 }
175
176 .tip {
177 font-size: 28rpx;
178 color: #E60012;
179 }
180
143 .bbfix { 181 .bbfix {
144 background: #fff; 182 background: #fff;
145 height: 150rpx; 183 height: 150rpx;
...@@ -161,23 +199,54 @@ function unsubscribe(){ ...@@ -161,23 +199,54 @@ function unsubscribe(){
161 color: #ff8124; 199 color: #ff8124;
162 } 200 }
163 } 201 }
202
164 .subBtn { 203 .subBtn {
165 font-size: 32rpx; 204 font-size: 32rpx;
166 color: #1EC886;border: 1px solid #1EC886; 205 color: #1EC886;
206 border: 1px solid #1EC886;
167 background: transparent; 207 background: transparent;
168 height: 60rpx;margin: 15rpx; 208 height: 60rpx;
209 margin: 15rpx;
169 line-height: 60rpx; 210 line-height: 60rpx;
170 padding: 0 30rpx; 211 padding: 0 30rpx;
171 } 212 }
172 .subBtn.gray{color: #999;border: 1px solid #999;} 213
173 } 214 .subBtn.gray {
174 .ccitem{display: flex;justify-content: space-between;font-size: 28rpx; 215 color: #999;
175 color: #666;margin: 0 0 10rpx; 216 border: 1px solid #999;
176 label{font-size: 32rpx;color: #000;} 217 }
177 text{color: #1EC886;} 218 }
178 } 219
179 .colorfulBg{background:#1EC886;padding: 20rpx 10rpx 10rpx; 220 .ccitem {
180 .whiteItem{border-radius: 0;margin: 0;width: 730rpx;} 221 display: flex;
181 .name{color: #fff;margin: 0 0 20rpx;} 222 justify-content: space-between;
223 font-size: 28rpx;
224 color: #666;
225 margin: 0 0 10rpx;
226
227 label {
228 font-size: 32rpx;
229 color: #000;
230 }
231
232 text {
233 color: #1EC886;
234 }
235 }
236
237 .colorfulBg {
238 background: #1EC886;
239 padding: 20rpx 10rpx 10rpx;
240
241 .whiteItem {
242 border-radius: 0;
243 margin: 0;
244 width: 730rpx;
245 }
246
247 .name {
248 color: #fff;
249 margin: 0 0 20rpx;
250 }
182 } 251 }
183 </style> 252 </style>
...\ No newline at end of file ...\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!