Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
gd_yc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
36d3ae2a
authored
2023-10-07 15:51:58 +0800
by
华明祺
1
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
731b1851
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
115 additions
and
127 deletions
App.vue
common/hotel.js
common/login.js
components/login/index.vue
config.js
main.js
node_modules/.vite/deps/_metadata.json
node_modules/.vite/deps/lodash.js
pages.json
pages/index/index.vue
pages_hotel/hotel/index.vue
App.vue
View file @
36d3ae2
...
...
@@ -3,101 +3,26 @@
import
*
as
api
from
'@/common/api.js'
;
import
config
from
'@/config.js'
;
let
firstload
=
false
export
default
{
onLaunch
:
function
()
{
console
.
log
(
'App Launch'
);
firstload
=
true
this
.
globalData
.
baseUrl
=
config
.
baseUrl
;
this
.
globalData
.
baseUrl_api
=
config
.
baseUrl_api
;
this
.
globalData
.
fileUrl
=
config
.
fileUrl
;
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
checkSession
({
success
:
res
=>
{
loginServer
.
getCurrUser
(
true
)
.
catch
(()
=>
{
return
loginServer
.
pcLogin
();
})
.
then
(
user
=>
{
resolve
(
user
);
});
},
fail
:
res
=>
{
loginServer
.
wxLogin
()
.
then
(
loginRes
=>
{
return
loginServer
.
pcLogin
(
loginRes
.
code
);
})
.
then
(
user
=>
{
resolve
(
user
);
});
}
});
})
.
then
(()
=>
{
return
loginServer
.
getNowOpenId
()
})
.
then
(()
=>
{
return
loginServer
.
initData
()
// console.log(22222222)
// const currUser = uni.getStorageSync('currUser');
// // console.log(currUser)
// return Promise.all([api.getVenue(), api.getOwnMemberInfo()]).then(res => {
// let ven = res[0].data;
// let men = res[1]?.data;
// if (ven.venuePic) {
// ven.venuePicArr = ven.venuePic.split(',');
// }
// if (ven.businessPeriod) {
// ven.startBus = ven.businessPeriod.split(',')[0];
// ven.endBus = ven.businessPeriod.split(',')[1];
// }
// ven.latitude = ven.lal.split(',')[0];
// ven.longitude = ven.lal.split(',')[1];
// this.globalData.venue = ven;
// this.globalData.isVip = men?.isVip;
// // this.globalData.relateProjectId = men.info.relateProjectId;
// this.globalData.relateProjectIdList = men?.info?.relateProjectIdList;
// this.globalData.relateVenueProjectIdList = men?.info?.relateVenueProjectIdList;
// this.globalData.venueConfig = {
// normalOverDay: ven.resSiteConfig?.normalOrderNum,
// normalPeriodStart: ven.resSiteConfig?.normalOrderPeriod.split(',')[0],
// normalPeriodEnd: ven.resSiteConfig?.normalOrderPeriod.split(',')[1]
// };
// if (men?.isVip) {
// this.globalData.venueConfig.memberOverDay = ven.resSiteConfig?.memberOrderNum;
// this.globalData.venueConfig.memberPeriodStart = ven.resSiteConfig?.memberOrderPeriod.split(',')[0];
// this.globalData.venueConfig.memberPeriodEnd = ven.resSiteConfig?.memberOrderPeriod.split(',')[1];
// }
// });
})
.
then
(()
=>
{
onShow
:
function
()
{
console
.
log
(
'App Show'
);
uni
.
getStorage
({
key
:
'token'
,
success
:
()
=>
{
this
.
globalData
.
isLogin
=
true
;
let
firstLoadCallback
=
getApp
().
firstLoadCallback
;
if
(
firstLoadCallback
)
{
firstLoadCallback
();
}
});
},
onShow
:
function
()
{
console
.
log
(
'App Show'
);
// loginServer.getNowOpenId()
if
(
!
firstload
)
{
loginServer
.
getCurrUser
(
true
)
.
catch
(()
=>
{
return
loginServer
.
pcLogin
().
then
(()
=>
{
uni
.
redirectTo
({
url
:
getCurrentPages
()[
getCurrentPages
().
length
-
1
].
$page
.
fullPath
})
});
})
fail
:
()
=>
{
this
.
globalData
.
isLogin
=
false
;
}
})
},
onHide
:
function
()
{
console
.
log
(
'App Hide'
);
...
...
common/hotel.js
View file @
36d3ae2
...
...
@@ -3,7 +3,7 @@ import config from '@/config.js'
function
getTrainList
(
venueId
)
{
return
request
({
url
:
`/train/info/
l
ist`
,
url
:
`/train/info/
h5L
ist`
,
method
:
'get'
})
}
...
...
common/login.js
View file @
36d3ae2
...
...
@@ -180,6 +180,18 @@ function getNowOpenId() {
})
}
function
h5Login
(
userName
)
{
return
request
({
url
:
`/h5Login`
,
method
:
'post'
,
params
:
{
username
:
userName
}
}).
then
((
res
)
=>
{
uni
.
setStorageSync
(
'token'
,
'Bearer '
+
res
.
data
.
token
);
})
}
function
initData
()
{
console
.
log
(
'initData'
)
...
...
@@ -189,7 +201,7 @@ function initData() {
let
ven
=
res
[
0
].
data
;
let
men
=
res
[
1
]?.
data
;
const
app
=
getApp
();
const
app
=
getApp
();
if
(
ven
.
venuePic
)
{
ven
.
venuePicArr
=
ven
.
venuePic
.
split
(
','
);
...
...
@@ -228,5 +240,6 @@ export {
getWxUser
,
getWxUserPhone
,
checkUserAuth
,
h5Login
,
initData
}
\ No newline at end of file
...
...
components/login/index.vue
0 → 100644
View file @
36d3ae2
<
template
>
<uni-popup
class=
"popYanZhengBox"
ref=
"popYanZheng"
type=
"center"
>
<view
class=
"popup-content"
>
<view
class=
"t"
>
温馨提示
</view>
<view
class=
"p"
>
该微信未绑定系统内手机号,绑定手机号后正常使用。
</view>
<button
class=
"start"
type=
"default"
@
click=
"login"
>
绑定手机号
</button>
</view>
</uni-popup>
</
template
>
<
script
setup
>
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
h5Login
}
from
'@/common/login.js'
;
const
app
=
getApp
();
const
popYanZheng
=
ref
(
null
);
onMounted
(()
=>
{
if
(
!
app
.
globalData
.
isLogin
)
{
popYanZheng
.
value
.
open
()
}
})
function
login
()
{
h5Login
(
'12000013583'
)
.
then
(()
=>
{
popYanZheng
.
value
.
close
()
})
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
config.js
View file @
36d3ae2
// prod
// const baseUrl = 'https://research.wtwuxicenter.com/';
// const baseUrl_api=`${baseUrl}/prod-api`;
// const baseUrl_api = 'https://research.wtwuxicenter.com/';
// uat
// const baseUrl = 'https://jxt.itechtop.cn';
const
baseUrl
=
'https://jxt.wtwuxicenter.com'
;
const
baseUrl_api
=
`
${
baseUrl
}
/prod-api`
;
// staging
// const baseUrl = 'https://5q5re1d432g2.ngrok2.xiaomiqiu123.top';
// const baseUrl = "http://192.168.1.118:8081";
// const baseUrl_api = `${baseUrl}`;
const
fileUrl
=
"http://r.itechtop.cn"
;
const
baseUrl_api
=
"http://192.168.1.118:8080"
;
export
default
{
baseUrl
:
baseUrl
,
fileUrl
:
fileUrl
,
baseUrl_api
:
baseUrl_api
,
baseUrl_api
:
baseUrl_api
};
\ No newline at end of file
...
...
main.js
View file @
36d3ae2
import
App
from
'./App'
// #ifndef VUE3
import
Vue
from
'vue'
Vue
.
config
.
productionTip
=
false
...
...
@@ -13,8 +14,12 @@ app.$mount()
import
{
createSSRApp
}
from
'vue'
import
login
from
'@/components/login'
export
function
createApp
()
{
const
app
=
createSSRApp
(
App
)
app
.
component
(
'showLogin'
,
login
)
return
{
app
}
...
...
node_modules/.vite/deps/_metadata.json
View file @
36d3ae2
{
"hash"
:
"
15550c90
"
,
"browserHash"
:
"
63dbbbb8
"
,
"hash"
:
"
3d4f5fa7
"
,
"browserHash"
:
"
a63ce521
"
,
"optimized"
:
{
"lodash"
:
{
"src"
:
"../../lodash/lodash.js"
,
"file"
:
"lodash.js"
,
"fileHash"
:
"
547f3844
"
,
"fileHash"
:
"
ab53c0da
"
,
"needsInterop"
:
true
}
},
...
...
node_modules/.vite/deps/lodash.js
View file @
36d3ae2
...
...
@@ -3,9 +3,9 @@ var __commonJS = (cb, mod) => function __require() {
return
mod
||
(
0
,
cb
[
__getOwnPropNames
(
cb
)[
0
]])((
mod
=
{
exports
:
{}
}).
exports
,
mod
),
mod
.
exports
;
};
// ../../../../../../Users/
yangyang/project
/gd_yc/node_modules/lodash/lodash.js
// ../../../../../../Users/
huamingqi/projects/train
/gd_yc/node_modules/lodash/lodash.js
var
require_lodash
=
__commonJS
({
"../../../../../../Users/
yangyang/project
/gd_yc/node_modules/lodash/lodash.js"
(
exports
,
module
)
{
"../../../../../../Users/
huamingqi/projects/train
/gd_yc/node_modules/lodash/lodash.js"
(
exports
,
module
)
{
(
function
()
{
var
undefined
;
var
VERSION
=
"4.17.21"
;
...
...
pages.json
View file @
36d3ae2
pages/index/index.vue
View file @
36d3ae2
<
template
>
<view
class=
"page"
>
<show-login></show-login>
<view
class=
"uni-margin-wrap"
>
<!--
<view
class=
"logobox"
>
<!--
<view
class=
"logobox"
>
<image
class=
"logo"
:src=
"venue.venueLogo"
></image>
<text>
{{
venue
.
venueName
}}
</text>
</view>
-->
<swiper
class=
"swiper"
circular
:indicator-dots=
"indicatorDots"
:autoplay=
"autoplay"
:interval=
"interval"
<
!--
<
swiper
class=
"swiper"
circular
:indicator-dots=
"indicatorDots"
:autoplay=
"autoplay"
:interval=
"interval"
:duration=
"duration"
indicator-color=
"rgba(255,255,255,0.6)"
indicator-active-color=
"#fff"
>
<swiper-item
v-for=
"(p, index) in venue.venuePicArr"
:key=
"index"
>
<view
class=
"swiper-item"
>
<image
mode=
"aspectFill"
:src=
"p"
></image>
</view>
</swiper-item>
</swiper>
</swiper>
-->
</view>
<view
class=
"infoArea"
>
<view
class=
"contentbox"
>
...
...
@@ -79,14 +80,17 @@
getWxUserPhone
}
from
'@/common/login.js'
;
import
{
onLoad
,
onShow
,
onLoad
,
onShow
,
onReady
,
onShareAppMessage
,
onShareTimeline
,
onPullDownRefresh
onShareTimeline
,
onPullDownRefresh
}
from
'@dcloudio/uni-app'
;
import
{
ref
,
getCurrentInstance
getCurrentInstance
,
nextTick
}
from
'vue'
;
...
...
@@ -117,9 +121,17 @@
let
proId
;
let
goPath
;
const
svId
=
ref
(
null
);
const
list
=
ref
([{
id
:
0
,
name
:
'培训助手'
,
path
:
'/pages_hotel/hotel/index'
},{
id
:
1
,
name
:
'我的'
,
path
:
'/pages_hotel/hotel/mycenter'
}]);
onShow
(()
=>
{
const
list
=
ref
([{
id
:
0
,
name
:
'培训助手'
,
path
:
'/pages_hotel/hotel/index'
},
{
id
:
1
,
name
:
'我的'
,
path
:
'/pages_hotel/hotel/mycenter'
}]);
onShow
(()
=>
{
if
(
app
.
globalData
.
isLogin
)
{
init
();
}
else
{
...
...
@@ -141,10 +153,11 @@
})
let
currUser
function
checkUserPhone
(
path
)
{
currUser
=
uni
.
getStorageSync
(
'currUser'
)
if
(
!
currUser
)
{
loginServer
.
pcLogin
().
then
(()
=>
{
if
(
!
currUser
)
{
loginServer
.
pcLogin
().
then
(()
=>
{
currUser
=
uni
.
getStorageSync
(
'currUser'
)
if
(
currUser
.
phonenumber
)
{
debugger
...
...
@@ -215,13 +228,13 @@
}
function
init
()
{
venue
.
value
=
app
.
globalData
.
venue
latitude
.
value
=
app
.
globalData
.
venue
.
latitude
longitude
.
value
=
app
.
globalData
.
venue
.
longitude
// 修改页头标题
uni
.
setNavigationBarTitle
({
title
:
venue
.
value
.
venueName
});
//
venue.value = app.globalData.venue
//
latitude.value = app.globalData.venue.latitude
//
longitude.value = app.globalData.venue.longitude
//
//
修改页头标题
//
uni.setNavigationBarTitle({
//
title: venue.value.venueName
//
});
}
function
open
()
{
...
...
@@ -269,7 +282,7 @@
url
:
item
.
path
});
// }
}
else
{
}
else
{
uni
.
showToast
({
title
:
`暂未开放`
,
icon
:
'none'
...
...
@@ -279,7 +292,11 @@
}
</
script
>
<
style
scope
lang=
"scss"
>
.singlePop
{
max-height
:
60vh
;
overflow
:
auto
;}
.singlePop
{
max-height
:
60vh
;
overflow
:
auto
;
}
.map
{
width
:
100
rpx
;
height
:
100
rpx
;
...
...
pages_hotel/hotel/index.vue
View file @
36d3ae2
...
...
@@ -48,8 +48,7 @@
getList
();
});
function
getList
(){
const
venueId
=
app
.
globalData
.
venue
.
id
hotel
.
getTrainList
(
venueId
).
then
(
res
=>
{
hotel
.
getTrainList
().
then
(
res
=>
{
list
.
value
=
res
.
rows
;
});
}
...
...
杨炀
@yangyang
mentioned in commit
2e2f984e
2023-10-07 09:10:56 UTC
mentioned in commit
2e2f984e
Toggle commit list
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment