Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uni-app-ddh-shop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanhai
uni-app-ddh-shop
Commits
3c5ac780
Commit
3c5ac780
authored
Nov 01, 2024
by
ly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
681683d8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
34 deletions
+92
-34
.DS_Store
.DS_Store
+0
-0
App.vue
App.vue
+7
-5
api.js
config/api.js
+1
-1
manifest.json
manifest.json
+1
-1
index.vue
pages/index/index.vue
+2
-1
login.vue
pages/login/login.vue
+29
-12
index.vue
pages/my/index.vue
+50
-14
authPerission.js
utils/authPerission.js
+2
-0
No files found.
.DS_Store
View file @
3c5ac780
No preview for this file type
App.vue
View file @
3c5ac780
...
...
@@ -7,7 +7,8 @@ export default {
H5
:
null
,
APP
:
null
},
onLaunch
:
function
()
{
onLaunch
:
function
()
{
console
.
log
(
'764'
)
// 手机型号
uni
.
getSystemInfo
({
success
:
function
(
res
)
{
...
...
@@ -49,10 +50,11 @@ export default {
/*** tabbar*/
switchShowTabbar
()
},
async
onShow
()
{
await
this
.
initLoanSetting
();
await
this
.
initSetting
()
await
initSettings
()
async
onShow
()
{
await
this
.
initLoanSetting
();
await
this
.
initSetting
()
await
initSettings
()
},
/** 切换到后台 */
onHide
()
{
...
...
config/api.js
View file @
3c5ac780
...
...
@@ -38,7 +38,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV
*/
// #ifdef APP-PLUS
env
=
"
stest
"
;
env
=
"
prod
"
;
// #endif
const
api
=
{
...
...
manifest.json
View file @
3c5ac780
...
...
@@ -2,7 +2,7 @@
"name"
:
"多典花"
,
"appid"
:
"__UNI__DE04B13"
,
"description"
:
""
,
"versionName"
:
"1.0.
3
"
,
"versionName"
:
"1.0.
4
"
,
"versionCode"
:
104
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
...
...
pages/index/index.vue
View file @
3c5ac780
...
...
@@ -88,7 +88,7 @@
</
template
>
<
script
>
import
{
switchShowTabbar
,
isLogin
}
from
'@/utils/index'
import
{
switchShowTabbar
,
isLogin
,
initSettings
}
from
'@/utils/index'
export
default
{
data
()
{
return
{
...
...
@@ -141,6 +141,7 @@ export default {
// console.log(storage.getUserInfo().mobile,'uuuuuu')
await
this
.
initAjax
();
await
this
.
getAppVersion
()
await
initSettings
()
},
async
onShow
()
{
// 显示隐藏tabBar
...
...
pages/login/login.vue
View file @
3c5ac780
...
...
@@ -53,19 +53,36 @@ export default {
this
.
buryingPoint
(
'app:login_pageView'
)
},
methods
:
{
init
()
{
const
$App_Setting
=
uni
.
getStorageSync
(
"APP-SETTING"
)
if
(
$App_Setting
)
{
const
{
protocolList
}
=
JSON
.
parse
(
$App_Setting
)
protocolList
.
map
((
item
)
=>
{
if
(
item
.
protocolName
==
'隐私协议'
)
{
this
.
protocols
=
item
}
else
if
(
item
.
protocolName
==
'用户服务协议'
)
{
this
.
protocolf
=
item
}
})
async
init
()
{
// const $App_Setting = uni.getStorageSync("APP-SETTING")
// if ($App_Setting) {
// const { protocolList } = JSON.parse($App_Setting)
// protocolList.map((item) => {
// if (item.protocolName == '隐私协议') {
// this.protocols = item
// } else if (item.protocolName == '用户服务协议') {
// this.protocolf = item
// }
// })
// }
try
{
const
{
success
,
result
}
=
await
this
.
$request
(
'/app/v1/settings'
,
'GET'
);
if
(
success
)
{
// this.globalData.APP = result
console
.
log
(
result
,
'result333'
)
const
{
protocolList
}
=
result
protocolList
.
map
((
item
)
=>
{
if
(
item
.
protocolName
==
'隐私协议'
)
{
this
.
protocols
=
item
}
else
if
(
item
.
protocolName
==
'用户服务协议'
)
{
this
.
protocolf
=
item
}
})
uni
.
setStorageSync
(
'APP-SETTING'
,
JSON
.
stringify
(
result
))
}
}
catch
(
err
)
{
console
.
log
(
err
,
'初始化APP配置报错'
)
}
},
btnIcon
()
{
this
.
clickStatus
=
!
this
.
clickStatus
...
...
pages/my/index.vue
View file @
3c5ac780
...
...
@@ -23,7 +23,7 @@
<!-- 金刚栏位 -->
<
template
v-if=
"extMenuBarList && extMenuBarList.length"
>
<
template
v-if=
"extMenuBarList && extMenuBarList.length
>0
"
>
<view
class=
'my-box-s'
>
<view
class=
's-con'
>
<view
class=
'con-item'
@
click=
"goPage(item)"
v-for=
"item in extMenuBarList"
:key=
"item.id"
>
...
...
@@ -36,7 +36,7 @@
<!-- 更多服务 -->
<view
v-if=
"menuList && menuList.length"
class=
"my-contain"
>
<view
v-if=
"menuList && menuList.length
>0
"
class=
"my-contain"
>
<i
class=
'con-top'
></i>
<view
class=
'con-box'
v-if=
'menuList && menuList.length > 0'
>
<view
class=
"box-line"
v-for=
"item in menuList"
@
click=
'goItem(item)'
:key=
"item.id"
>
...
...
@@ -69,8 +69,8 @@
<
script
>
import
{
switchShowTabbar
}
from
'@/utils/index'
const
APP
=
JSON
.
parse
(
uni
.
getStorageSync
(
'APP-SETTING'
));
const
H5
=
JSON
.
parse
(
uni
.
getStorageSync
(
'H5-SETTING'
));
//
const APP = JSON.parse(uni.getStorageSync('APP-SETTING'));
//
const H5 = JSON.parse(uni.getStorageSync('H5-SETTING'));
export
default
{
data
()
{
...
...
@@ -79,18 +79,24 @@ export default {
menuList
:
[],
mobileNum
:
''
,
menuBar
:
[],
serviceCall
:
APP
.
serviceCall
,
extMenuBarList
:
[]
// serviceCall: APP.serviceCall,
serviceCall
:
''
,
extMenuBarList
:
[],
hFUrl
:
''
}
},
onLoad
()
{
this
.
init
();
this
.
initSetting
()
this
.
initLoanSetting
()
},
onShow
()
{
// 显示隐藏tabBar
switchShowTabbar
()
this
.
init
();
this
.
initSetting
()
this
.
initLoanSetting
()
// 埋点
this
.
buryingPoint
(
'app:my_pageView'
)
},
...
...
@@ -105,8 +111,6 @@ export default {
},
methods
:
{
toJSON
()
{
},
// 初始化
init
()
{
const
token
=
uni
.
getStorageSync
(
'token'
)
...
...
@@ -139,8 +143,39 @@ export default {
console
.
log
(
err
,
'请求出错'
)
})
},
// 初始化APP配置
async
initSetting
()
{
try
{
const
{
success
,
result
}
=
await
this
.
$request
(
'/app/v1/settings'
,
'GET'
);
if
(
success
)
{
// this.globalData.APP = result
console
.
log
(
result
,
'result333'
)
this
.
serviceCall
=
result
.
serviceCall
uni
.
setStorageSync
(
'APP-SETTING'
,
JSON
.
stringify
(
result
))
}
}
catch
(
err
)
{
console
.
log
(
err
,
'初始化APP配置报错'
)
}
},
// 初始化贷超H5配置
async
initLoanSetting
()
{
try
{
/**
* h5Url,
* protocol,
* phone
* */
const
{
success
,
result
}
=
await
this
.
$request
(
'/pawn/setting'
,
'GET'
);
if
(
success
)
{
// this.globalData.H5 = result
console
.
log
(
result
,
'result4444'
)
this
.
hFUrl
=
result
.
h5Url
uni
.
setStorageSync
(
'H5-SETTING'
,
JSON
.
stringify
(
result
))
}
}
catch
(
err
)
{
console
.
log
(
err
,
'初始化贷超配置报错'
)
}
},
goPage
(
item
)
{
console
.
log
(
item
.
title
)
switch
(
item
.
title
)
{
...
...
@@ -172,7 +207,8 @@ export default {
case
"我的还款"
:
this
.
buryingPoint
(
'app:my_repayment_click'
)
// const url='http://192.168.0.82:8080/#/'
newPath
=
H5
.
h5Url
+
item
.
linkUrl
// newPath = H5.h5Url + item.linkUrl //app.vue中的全局写法
newPath
=
this
.
hFUrl
+
item
.
linkUrl
uni
.
navigateTo
({
url
:
`/pages/web/websrc?url=
${
newPath
}
`
})
...
...
@@ -180,7 +216,8 @@ export default {
case
"申请记录"
:
this
.
buryingPoint
(
'app:my_application_record_click'
)
// const url='http://192.168.0.82:8080/#/loanRecord'
newPath
=
H5
.
h5Url
+
item
.
linkUrl
// newPath = H5.h5Url + item.linkUrl
newPath
=
this
.
hFUrl
+
item
.
linkUrl
uni
.
navigateTo
({
url
:
`/pages/web/websrc?url=
${
newPath
}
`
})
...
...
@@ -190,8 +227,7 @@ export default {
}
},
goTel
()
{
this
.
buryingPoint
(
'app:my_contact_us_click'
)
this
.
handleCall
(
APP
.
serviceCall
)
// this.handleCall(APP.serviceCall)
const
self
=
this
self
.
buryingPoint
(
'app:my_contact_us_click'
)
const
telPhone
=
uni
.
getStorageSync
(
'telPhone'
)
...
...
utils/authPerission.js
View file @
3c5ac780
...
...
@@ -19,10 +19,12 @@ const onPermissionModal = function () {
// 检测通讯录权限
export
const
CheckContactPermission
=
function
(
callback
)
{
console
.
log
(
callback
,
'callback'
)
// 获取通讯录对象
plus
.
contacts
.
getAddressBook
(
plus
.
contacts
.
ADDRESSBOOK_PHONE
,
function
(
addressBook
)
{
// 查找联系人
addressBook
.
find
([
"displayName"
,
"phoneNumbers"
],
function
(
contacts
)
{
console
.
log
(
contacts
,
'contacts'
)
//此处的缓存是为了解决ios中的相关问题
uni
.
setStorage
({
key
:
"m-contact"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment