5beac84c by 华明祺

no message

1 parent 21da2d2a
Showing 218 changed files with 189 additions and 84 deletions
...@@ -10,9 +10,6 @@ function checkReport() { ...@@ -10,9 +10,6 @@ function checkReport() {
10 } 10 }
11 11
12 12
13
14
15
16 function getVenue() { 13 function getVenue() {
17 return request({ 14 return request({
18 url: `/systemj/venue/appId`, 15 url: `/systemj/venue/appId`,
...@@ -21,8 +18,6 @@ function getVenue() { ...@@ -21,8 +18,6 @@ function getVenue() {
21 } 18 }
22 19
23 20
24
25
26 function getSiteList(projectId) { 21 function getSiteList(projectId) {
27 return request({ 22 return request({
28 url: `/systemj/site/getSiteList/${projectId}`, 23 url: `/systemj/site/getSiteList/${projectId}`,
...@@ -99,6 +94,7 @@ function getMyBalance() { ...@@ -99,6 +94,7 @@ function getMyBalance() {
99 method: 'get' 94 method: 'get'
100 }) 95 })
101 } 96 }
97
102 function listCanUse() { 98 function listCanUse() {
103 return request({ 99 return request({
104 url: `/systemj/projectConfig/listCanUse`, 100 url: `/systemj/projectConfig/listCanUse`,
...@@ -144,6 +140,7 @@ function xfList(params) { ...@@ -144,6 +140,7 @@ function xfList(params) {
144 params: params 140 params: params
145 }) 141 })
146 } 142 }
143
147 function czList(params) { 144 function czList(params) {
148 return request({ 145 return request({
149 url: `/systemj/memberOrder/maList/recharge`, 146 url: `/systemj/memberOrder/maList/recharge`,
...@@ -167,7 +164,8 @@ function getCaptchaSms(params) { ...@@ -167,7 +164,8 @@ function getCaptchaSms(params) {
167 params: params 164 params: params
168 }) 165 })
169 } 166 }
170 function maRebindMemberCard(phonenumber,code) { 167
168 function maRebindMemberCard(phonenumber, code) {
171 const nowOpenId = uni.getStorageSync('nowOpenId'); 169 const nowOpenId = uni.getStorageSync('nowOpenId');
172 return request({ 170 return request({
173 url: `/systemj/member/maRebindMemberCard/${phonenumber}/${code}?openId=${nowOpenId}`, 171 url: `/systemj/member/maRebindMemberCard/${phonenumber}/${code}?openId=${nowOpenId}`,
...@@ -182,7 +180,7 @@ function getCancelHint(orderId) { ...@@ -182,7 +180,7 @@ function getCancelHint(orderId) {
182 }) 180 })
183 } 181 }
184 //充值提示 182 //充值提示
185 function getMemberLevelTip(phonenumber,amount) { 183 function getMemberLevelTip(phonenumber, amount) {
186 return request({ 184 return request({
187 url: `/systemj/member/generateMyMemberLevelRemian/${phonenumber}/${amount}`, 185 url: `/systemj/member/generateMyMemberLevelRemian/${phonenumber}/${amount}`,
188 method: 'get' 186 method: 'get'
...@@ -215,6 +213,7 @@ function miniappData(params) { ...@@ -215,6 +213,7 @@ function miniappData(params) {
215 213
216 214
217 215
218 export {checkReport, 216 export {
217 checkReport,
219 getVenue 218 getVenue
220 } 219 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -49,7 +49,7 @@ function pcLoginByOpenId(openId) { ...@@ -49,7 +49,7 @@ function pcLoginByOpenId(openId) {
49 let user = res.data; 49 let user = res.data;
50 // console.log("openId " + openId, user) 50 // console.log("openId " + openId, user)
51 51
52 uni.setStorageSync('token', 'Bearer ' + user.token); 52 uni.setStorageSync('token', user.token);
53 uni.setStorageSync('currUser', user); 53 uni.setStorageSync('currUser', user);
54 return user; 54 return user;
55 }).catch(() => { 55 }).catch(() => {
...@@ -70,7 +70,7 @@ function pcLoginByCode(code) { ...@@ -70,7 +70,7 @@ function pcLoginByCode(code) {
70 let user = res.data 70 let user = res.data
71 // console.log("code: " + code, user) 71 // console.log("code: " + code, user)
72 // getNowOpenId() 72 // getNowOpenId()
73 uni.setStorageSync('token', 'Bearer ' + user.token); 73 uni.setStorageSync('token', user.token);
74 uni.setStorageSync('currUser', user); 74 uni.setStorageSync('currUser', user);
75 return user; 75 return user;
76 }).catch((err) => { 76 }).catch((err) => {
...@@ -188,7 +188,7 @@ function h5Login(userName) { ...@@ -188,7 +188,7 @@ function h5Login(userName) {
188 username: userName 188 username: userName
189 } 189 }
190 }).then((res) => { 190 }).then((res) => {
191 uni.setStorageSync('token', 'Bearer ' + res.data.token); 191 uni.setStorageSync('token', res.data.token);
192 }) 192 })
193 } 193 }
194 194
......
...@@ -25,21 +25,19 @@ function getToken() { ...@@ -25,21 +25,19 @@ function getToken() {
25 25
26 // 获取请求头 26 // 获取请求头
27 function getHeaders() { 27 function getHeaders() {
28 const token = getToken() 28 let header
29 const header = { 29 if (config.localPort) {
30 "Authorization": token, 30 header = {
31 "Content-Type": "application/json",
32 }
33 return header
34 }
35
36 function getHeaders2() {
37 const token = getToken()
38 const header = {
39 "isToken": false, 31 "isToken": false,
40 "Authorization": token,
41 'content-type': 'application/x-www-form-urlencoded' 32 'content-type': 'application/x-www-form-urlencoded'
42 } 33 }
34 } else {
35 header = {
36 "Authorization": getToken(),
37 "Content-Type": "application/json",
38 }
39 }
40
43 return header 41 return header
44 } 42 }
45 43
...@@ -60,40 +58,68 @@ let request = function(req) { ...@@ -60,40 +58,68 @@ let request = function(req) {
60 // }) 58 // })
61 // } 59 // }
62 60
63 const baseUrl = config.localPort + '/jsintszxd/request' 61
62 const token = getToken()
63 let tempUrl = req.url
64 // if (token) {
65 if (tempUrl.indexOf('?') > -1) {
66 tempUrl += '&userNo=' + token
67 } else {
68 tempUrl += '?userNo=' + token
69 }
70 // }
71
64 let url, data 72 let url, data
73 if (config.localPort) {
74 const baseUrl = config.localPort + '/jsintszxd/request'
65 if (req.method === 'POST') { 75 if (req.method === 'POST') {
66 url = baseUrl 76 url = baseUrl
67 data = { 77 data = {
68 appSecretId: config.appSecretId, 78 appSecretId: config.appSecretId,
69 restApi: req.url, 79 restApi: encodeURIComponent(tempUrl),
70 params: 'jsonBody=' + JSON.stringify(req.params) 80 params: 'jsonBody=' + JSON.stringify(req.params)
71 } 81 }
72 } else { 82 } else {
73 url = `${baseUrl}?appSecretId=${config.appSecretId}&restApi=${encodeURIComponent(req.url)}` 83 if (req.params) {
84 for (const key of Object.keys(req.params)) {
85 if (tempUrl.indexOf('?') > -1) {
86 tempUrl += `&${key}=${req.params[key]}`
87 } else {
88 tempUrl += `?${key}=${req.params[key]}`
89 }
90 }
91 }
92 url = `${baseUrl}?appSecretId=${config.appSecretId}&restApi=${encodeURIComponent(tempUrl)}`
93 }
94 } else {
95 url = config.baseUrl_api + tempUrl
96 data = req.params
74 } 97 }
75 98
76 return new Promise((resolve, reject) => { 99 return new Promise((resolve, reject) => {
77 uni.request({ 100 uni.request({
78 // url: config.baseUrl_api + req.url,
79 url: url, 101 url: url,
80 method: req.method, 102 method: req.method,
81 // data: req.params,
82 // header: getHeaders(),
83 data: data, 103 data: data,
84 header: getHeaders2() 104 header: getHeaders()
85 }).then(res => { 105 }).then(res => {
86 switch (res.statusCode) { 106 switch (res.statusCode) {
87 case 200: 107 case 200:
88 // const data = res.data || {}; 108 let tempRes
89 const data = res.data.data || {}; 109 if (config.localPort) {
90 if (data.code == 200) { 110 tempRes = res.data
91 resolve(data) 111 } else {
112 tempRes = res
113 }
114
115 const resData = tempRes.data || {};
116 if (resData.code == 200) {
117 resolve(resData)
92 } else { 118 } else {
93 //登录超时 119 //登录超时
94 if (data.code == 60002 || data.code == 60001) { 120 if (resData.code == 60002 || resData.code == 60001) {
95 showLogin() 121 showLogin()
96 } else if (data.code == 401) { 122 } else if (resData.code == 401) {
97 h5LoginAuto() 123 h5LoginAuto()
98 .then(() => { 124 .then(() => {
99 uni.hideLoading(); 125 uni.hideLoading();
...@@ -105,17 +131,17 @@ let request = function(req) { ...@@ -105,17 +131,17 @@ let request = function(req) {
105 } else { 131 } else {
106 if (!excludeUrls.includes(req.url)) { 132 if (!excludeUrls.includes(req.url)) {
107 uni.showToast({ 133 uni.showToast({
108 title: data.msg, 134 title: resData.msg,
109 icon: 'none', 135 icon: 'none',
110 duration: 3000 136 duration: 3000
111 }) 137 })
112 } 138 }
113 } 139 }
114 reject(res) 140 reject(tempRes)
115 } 141 }
116 break 142 break
117 default: 143 default:
118 reject(res) 144 reject(tempRes)
119 } 145 }
120 }).catch(res => { 146 }).catch(res => {
121 reject(res) 147 reject(res)
...@@ -134,7 +160,7 @@ function reLogin() { ...@@ -134,7 +160,7 @@ function reLogin() {
134 pcLoginByOpenId(accountInfo.miniProgram.appId, currUser.openId) 160 pcLoginByOpenId(accountInfo.miniProgram.appId, currUser.openId)
135 .then((res) => { 161 .then((res) => {
136 let user = res.data; 162 let user = res.data;
137 uni.setStorageSync('token', 'Bearer ' + user.token); 163 uni.setStorageSync('token', user.token);
138 uni.setStorageSync('currUser', user); 164 uni.setStorageSync('currUser', user);
139 165
140 uni.showToast({ 166 uni.showToast({
......
1 // prod 1 const baseUrl_api = "/dev-api";
2 // const baseUrl_api = 'https://research.wtwuxicenter.com/';
3
4
5 // staging
6 const baseUrl_api = "http://192.168.1.118:6688";
7 // const baseUrl_api = "http://123.60.96.243:6688";
8 // const baseUrl_api = "http://121.4.115.48:27001/jsintszxd/request";
9 const appSecretId = 'af14ef3f-ebec-446c-8d1f-c4afa60dd095'; 2 const appSecretId = 'af14ef3f-ebec-446c-8d1f-c4afa60dd095';
10 const localPort = localStorage.getItem('localPort') 3 const localPort = localStorage.getItem('localPort')
11 4
......
1 <template> 1 <template>
2 <view class="pb50"> 2 <view class="pb50">
3 <view style="padding:0 30rpx;"> 3 <view style="padding:0 30rpx;">
4 <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#15CFAB"></uni-segmented-control> 4 <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
5 activeColor="#15CFAB"></uni-segmented-control>
5 </view> 6 </view>
6 <view> 7 <view>
7 <view class="active" v-for="(item, index) in showList" :key="index" @click="goDetail(item)"> 8 <view class="active" v-for="(item, index) in showList" :key="index" @click="goDetail(item)">
...@@ -13,7 +14,9 @@ ...@@ -13,7 +14,9 @@
13 14
14 <view class="name">{{item.name}}</view> 15 <view class="name">{{item.name}}</view>
15 <view class="pp" style="display: flex;">报到时间:{{item.reportDate.substring(0, 10)}}</view> 16 <view class="pp" style="display: flex;">报到时间:{{item.reportDate.substring(0, 10)}}</view>
16 <view class="pp" style="display: flex;">培训时间:{{item.trainStart.substring(0, 10)}}{{item.trainEnd.substring(0, 10)}}</view> 17 <view class="pp" style="display: flex;">培训时间:{{item.trainStart.substring(0, 10)}}
18 {{item.trainEnd.substring(0, 10)}}
19 </view>
17 <!-- <view class="pp" style="display: flex;">主办单位:{{item.organizer}}</view> --> 20 <!-- <view class="pp" style="display: flex;">主办单位:{{item.organizer}}</view> -->
18 <!-- <view class="pp" style="display: flex;">承办单位:{{item.manager}}</view> --> 21 <!-- <view class="pp" style="display: flex;">承办单位:{{item.manager}}</view> -->
19 <!-- <view class="pp" style="display: flex;">培训地点:{{item.address}}</view> --> 22 <!-- <view class="pp" style="display: flex;">培训地点:{{item.address}}</view> -->
...@@ -28,25 +31,43 @@ ...@@ -28,25 +31,43 @@
28 </template> 31 </template>
29 32
30 <script setup> 33 <script setup>
31 import { reactive, toRefs, getCurrentInstance } from 'vue'; 34 import {
35 reactive,
36 toRefs,
37 getCurrentInstance
38 } from 'vue';
32 import * as hotel from '@/common/hotel.js'; 39 import * as hotel from '@/common/hotel.js';
33 import {onShow,onPullDownRefresh} from '@dcloudio/uni-app'; 40 import {
41 onShow,
42 onPullDownRefresh
43 } from '@dcloudio/uni-app';
34 const app = getApp(); 44 const app = getApp();
35 import config from '@/config'; 45 import config from '@/config';
36 const { proxy } = getCurrentInstance(); 46 const {
47 proxy
48 } = getCurrentInstance();
37 const data = reactive({ 49 const data = reactive({
38 showList: [], 50 showList: [],
39 list: [], 51 list: [],
40 list0: [], 52 list0: [],
41 list1: [], 53 list1: [],
42 query: {}, 54 query: {},
43 autoplay:true, 55 autoplay: true,
44 items: ['全部', '进行中', '已过期'], 56 items: ['全部', '进行中', '已过期'],
45 current: 1 57 current: 1
46 }); 58 });
47 const { showList,list,list0,list1,query,autoplay,items,current } = toRefs(data); 59 const {
60 showList,
61 list,
62 list0,
63 list1,
64 query,
65 autoplay,
66 items,
67 current
68 } = toRefs(data);
48 69
49 onShow(option =>{ 70 onShow(option => {
50 if (app.globalData.isLogin) { 71 if (app.globalData.isLogin) {
51 getList(); 72 getList();
52 } else { 73 } else {
...@@ -58,36 +79,40 @@ ...@@ -58,36 +79,40 @@
58 onPullDownRefresh(() => { 79 onPullDownRefresh(() => {
59 getList(); 80 getList();
60 }); 81 });
61 function getList(){ 82
83 function getList() {
62 list0.value = [] 84 list0.value = []
63 list1.value = [] 85 list1.value = []
64 hotel.getTrainList().then(res => { 86 hotel.getTrainList().then(res => {
65 list.value = res.rows 87 list.value = res.rows
66 for(var n of list.value){ 88 for (var n of list.value) {
67 if(n.status == 0){ 89 if (n.status == 0) {
68 list0.value.push(n) 90 list0.value.push(n)
69 } 91 }
70 if(n.status == 1){ 92 if (n.status == 1) {
71 list1.value.push(n) 93 list1.value.push(n)
72 } 94 }
73 } 95 }
74 getShowList(current.value) 96 getShowList(current.value)
75 }); 97 });
76 } 98 }
77 function goDetail(item){ 99
100 function goDetail(item) {
78 let path = `/pages_hotel/hotel/detail?id=${item.trainId}&isApply=${item.isApply}`; 101 let path = `/pages_hotel/hotel/detail?id=${item.trainId}&isApply=${item.isApply}`;
79 uni.navigateTo({ 102 uni.navigateTo({
80 url: path 103 url: path
81 }); 104 });
82 } 105 }
83 function onClickItem(e){ 106
84 if(current.value != e.currentIndex){ 107 function onClickItem(e) {
108 if (current.value != e.currentIndex) {
85 current.value = e.currentIndex 109 current.value = e.currentIndex
86 } 110 }
87 getShowList(e.currentIndex) 111 getShowList(e.currentIndex)
88 } 112 }
89 function getShowList(n){ 113
90 switch (n){ 114 function getShowList(n) {
115 switch (n) {
91 case 0: 116 case 0:
92 showList.value = list.value 117 showList.value = list.value
93 break; 118 break;
...@@ -102,22 +127,72 @@ ...@@ -102,22 +127,72 @@
102 </script> 127 </script>
103 128
104 <style lang="scss" scoped> 129 <style lang="scss" scoped>
105 .iconSquera{width: 40rpx;height: 40rpx;} 130 .iconSquera {
106 .topSearch{ display: flex; align-items: center;background: #fff;} 131 width: 40rpx;
107 .active{background:#fff;width: 700rpx;margin:30rpx auto 30rpx;box-shadow: 0rpx 0rpx 27rpx 0rpx #DEDEDE; 132 height: 40rpx;
108 border-radius:20rpx 20rpx;position: relative;padding: 0 0 30rpx; 133 }
109 .cover{width: 700rpx;height: 320rpx;} 134
110 .name{font-size: 32rpx;padding:10rpx 15rpx 0; 135 .topSearch {
111 color: #000000;} 136 display: flex;
112 .pp{padding:0 15rpx;margin: 6rpx 0; 137 align-items: center;
113 color: #595959; 138 background: #fff;
114 font-size: 28rpx;} 139 }
115 .btn1{position: absolute; right: 0rpx; bottom: 30rpx; width: 150rpx; 140
116 line-height: 30px; height: 60rpx; font-size: 28rpx;padding: 0;} 141 .active {
117 } 142 background: #fff;
118 .activeSwiper{height: 320rpx;} 143 width: 700rpx;
119 .myEnter{position: fixed;right: 0;bottom: 10%; 144 margin: 30rpx auto 30rpx;
120 image{width: 150rpx;height: 150rpx;} 145 box-shadow: 0rpx 0rpx 27rpx 0rpx #DEDEDE;
121 } 146 border-radius: 20rpx 20rpx;
122 .pb50{padding-bottom: 50rpx;} 147 position: relative;
148 padding: 0 0 30rpx;
149
150 .cover {
151 width: 700rpx;
152 height: 320rpx;
153 }
154
155 .name {
156 font-size: 32rpx;
157 padding: 10rpx 15rpx 0;
158 color: #000000;
159 }
160
161 .pp {
162 padding: 0 15rpx;
163 margin: 6rpx 0;
164 color: #595959;
165 font-size: 28rpx;
166 }
167
168 .btn1 {
169 position: absolute;
170 right: 0rpx;
171 bottom: 30rpx;
172 width: 150rpx;
173 line-height: 30px;
174 height: 60rpx;
175 font-size: 28rpx;
176 padding: 0;
177 }
178 }
179
180 .activeSwiper {
181 height: 320rpx;
182 }
183
184 .myEnter {
185 position: fixed;
186 right: 0;
187 bottom: 10%;
188
189 image {
190 width: 150rpx;
191 height: 150rpx;
192 }
193 }
194
195 .pb50 {
196 padding-bottom: 50rpx;
197 }
123 </style> 198 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -11,5 +11,17 @@ export default defineConfig({ ...@@ -11,5 +11,17 @@ export default defineConfig({
11 targets: ['defaults', 'not IE 11'], 11 targets: ['defaults', 'not IE 11'],
12 }), 12 }),
13 ], 13 ],
14 // base: '/train/' 14 // base: '/train/',
15 server: {
16 port: 5173,
17 host: true,
18 open: true,
19 proxy: {
20 '/dev-api': {
21 target: 'http://192.168.43.161:6688',
22 changeOrigin: true,
23 rewrite: (p) => p.replace(/^\/dev-api/, '')
24 }
25 }
26 },
15 }) 27 })
...\ 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!