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,18 +25,10 @@ function getToken() { ...@@ -25,18 +25,10 @@ function getToken() {
25 25
26 // 获取请求头 26 // 获取请求头
27 function getHeaders() { 27 function getHeaders() {
28 let header 28 const header = {
29 if (config.localPort) {
30 header = {
31 "isToken": false, 29 "isToken": false,
32 'content-type': 'application/x-www-form-urlencoded' 30 'content-type': 'application/x-www-form-urlencoded'
33 } 31 }
34 } else {
35 header = {
36 "Authorization": getToken(),
37 "Content-Type": "application/json",
38 }
39 }
40 32
41 return header 33 return header
42 } 34 }
...@@ -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
69 } 61 }
70 // } 62 }
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) => {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
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">
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
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 <!-- 底部提交 -->
...@@ -72,50 +72,64 @@ ...@@ -72,50 +72,64 @@
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,
95 detail,
96 orderType,
97 info,
98 status,
99 tdpopup
90 } = toRefs(data); 100 } = toRefs(data);
91 101
92 let trainId = '' 102 let trainId = ''
93 onLoad((options)=>{ 103 onLoad((options) => {
94 trainId = options.trainId 104 trainId = options.trainId
95 orderType.value = options.orderType 105 orderType.value = options.orderType
96 console.log(orderType.value) 106 console.log(orderType.value)
97 status.value = options.status 107 status.value = options.status
98 init() 108 init()
99 }) 109 })
100 function init(){ 110
111 function init() {
101 getData() 112 getData()
102 } 113 }
103 function getData(){ 114
115 function getData() {
104 // 培训详情 116 // 培训详情
105 hotel.getTrainDetail(trainId).then(res => { 117 hotel.getTrainDetail(trainId).then(res => {
106 form.value = res.data 118 form.value = res.data
107 }) 119 })
108 // 用户信息 120 // 用户信息
109 api.checkReport().then((res)=>{ 121 // api.checkReport().then((res)=>{
110 detail.value = res.data 122 // detail.value = res.data
111 }) 123 // })
112 } 124 }
113 function unsubscribe(){ 125
114 hotel.cancelOrder().then(res=>{ 126 function unsubscribe() {
127 hotel.cancelOrder().then(res => {
115 info.value = res.data 128 info.value = res.data
116 tdpopup.value.open() 129 tdpopup.value.open()
117 }) 130 })
118 } 131 }
132
119 function callphone(number) { 133 function callphone(number) {
120 uni.makePhoneCall({ 134 uni.makePhoneCall({
121 phoneNumber: number 135 phoneNumber: number
...@@ -124,21 +138,45 @@ function unsubscribe(){ ...@@ -124,21 +138,45 @@ function unsubscribe(){
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
145 :deep(.uni-forms-item__content) {
146 line-height: 36px;
131 } 147 }
132 .whiteItem{ width: 700rpx; 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 {
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 }
142 180
143 .bbfix { 181 .bbfix {
144 background: #fff; 182 background: #fff;
...@@ -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
214 .subBtn.gray {
215 color: #999;
216 border: 1px solid #999;
217 }
173 } 218 }
174 .ccitem{display: flex;justify-content: space-between;font-size: 28rpx; 219
175 color: #666;margin: 0 0 10rpx; 220 .ccitem {
176 label{font-size: 32rpx;color: #000;} 221 display: flex;
177 text{color: #1EC886;} 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;
178 } 250 }
179 .colorfulBg{background:#1EC886;padding: 20rpx 10rpx 10rpx;
180 .whiteItem{border-radius: 0;margin: 0;width: 730rpx;}
181 .name{color: #fff;margin: 0 0 20rpx;}
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!