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
cde25617
Commit
cde25617
authored
Sep 26, 2024
by
ly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多典花
parent
d7d3e63c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
242 additions
and
13 deletions
+242
-13
.DS_Store
.DS_Store
+0
-0
App.vue
App.vue
+6
-6
.DS_Store
components/.DS_Store
+0
-0
upgradePopup.vue
components/showModal/upgradePopup.vue
+229
-0
app-service.js
unpackage/dist/dev/app-plus/app-service.js
+6
-6
header.js
utils/header.js
+1
-1
No files found.
.DS_Store
View file @
cde25617
No preview for this file type
App.vue
View file @
cde25617
...
@@ -26,17 +26,17 @@
...
@@ -26,17 +26,17 @@
})
})
plus
.
screen
.
lockOrientation
(
"portrait-primary"
)
plus
.
screen
.
lockOrientation
(
"portrait-primary"
)
console
.
log
(
'App Launch'
)
/*** tabbar*/
/*** tabbar*/
this
.
switchShowTabbar
()
this
.
switchShowTabbar
()
//app更新版本
//app更新版本
silentlyAppUpdate
()
silentlyAppUpdate
()
if
(
plus
.
runtime
.
isAgreePrivacy
())
{
const
isAgree
=
uni
.
getStorageSync
(
'm-agreement'
)
// initHeaderInfo()
if
(
isAgree
&&
plus
.
os
.
name
==
'iOS'
)
{
console
.
log
(
333
)
silentlyAppUpdate
()
silentlyAppUpdate
()
}
}
// this.getAppVersion()
// this.getAppVersion()
console
.
log
(
'App Launch'
)
},
},
methods
:{
methods
:{
getAppVersion
(){
getAppVersion
(){
...
...
components/.DS_Store
View file @
cde25617
No preview for this file type
components/showModal/upgradePopup.vue
0 → 100644
View file @
cde25617
<
template
>
<view>
<!-- 遮罩滚动锁定组件 -->
<page-meta
:page-style=
"'overflow:'+(popupShow?'hidden':'visible')"
></page-meta>
<uni-popup
ref=
"upgradePopup"
background-color=
"#fff"
class=
"upgradePopup"
@
change=
"upgradePopupChange"
:mask-click=
"false"
>
<view
class=
"rocket-content"
>
<view
class=
"rocket-img"
></view>
</view>
<view
class=
"title"
>
发现新版本
</view>
<view
class=
"update-content"
>
<text
space=
"nbsp"
>
{{
appUpgeadeObj
.
updateContent
}}
</text>
</view>
<view
v-if=
"updateButtonBoolean"
class=
"update-button"
>
<button
class=
"not-updated-button"
:disabled=
"noUpdatedDisabled"
v-if=
"appUpgeadeObj.versionUpdateEnum == 'REQUIRED'"
type=
"warn"
@
tap
.
stop=
"noUpdate"
>
暂不更新
</button>
<button
class=
"updated-button"
type=
"warn"
@
tap
.
stop=
"upgradeNow"
>
立即升级
</button>
</view>
<!-- v-if="progressBolean" -->
<!--
{{
progressBolean
}}
-->
<view
v-if=
"progressBolean"
class=
"progress-bar"
>
<progress
border-radius=
"90"
font-size=
"24"
activeColor=
"#DB4032"
backgroundColor=
"#f0f0f0"
show-info
:percent=
"progressData.percent"
stroke-width=
"15"
/>
</view>
</uni-popup>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
appUpgeadeObj
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
}
},
components
:
{
},
data
()
{
return
{
popupShow
:
false
,
updateButtonBoolean
:
true
,
// 按钮的显示和隐藏
// 进度条数据
progressData
:
{
percent
:
0
,
//百分比
},
progressBolean
:
false
,
// 进度条的显示和隐藏
noUpdatedDisabled
:
false
,
// viewTop: null, // 创建原生View控件
// viewBottom: null // 创建原生View控件
};
},
watch
:
{
'progressData.percent'
:
{
handler
(
newdata
)
{
if
(
newdata
)
{
this
.
progressBolean
=
true
this
.
updateButtonBoolean
=
false
}
if
(
newdata
==
100
)
{
this
.
noUpdatedDisabled
=
false
}
},
immediate
:
true
,
},
},
beforeMount
()
{
uni
.
hideTabBar
()
},
mounted
()
{
this
.
$refs
.
upgradePopup
.
open
(
'center'
)
},
methods
:
{
// 升级弹窗的change事件
upgradePopupChange
(
e
)
{
this
.
popupShow
=
e
.
show
},
// 暂不更新按钮事件
noUpdate
()
{
uni
.
showTabBar
()
this
.
$emit
(
'pause'
)
},
// 立即升级事件
upgradeNow
()
{
this
.
noUpdatedDisabled
=
true
let
that
=
this
let
platform
=
uni
.
getSystemInfoSync
().
platform
const
index
=
this
.
appUpgeadeObj
.
url
.
indexOf
(
'apps.apple.com'
)
if
(
platform
==
'ios'
&&
index
!==
-
1
)
return
plus
.
runtime
.
openURL
(
this
.
appUpgeadeObj
.
url
);
plus
.
runtime
.
getProperty
(
plus
.
runtime
.
appid
,
(
wgtinfo
)
=>
{
var
downloadTask
=
uni
.
downloadFile
({
url
:
that
.
appUpgeadeObj
.
url
,
success
:
(
downloadResult
)
=>
{
if
(
downloadResult
.
statusCode
===
200
)
{
plus
.
runtime
.
install
(
downloadResult
.
tempFilePath
,
{
force
:
false
},
function
()
{
plus
.
cache
.
clear
();
plus
.
runtime
.
restart
();
},
function
(
err
)
{
console
.
log
(
'err--------安装升级包失败'
,
err
)
uni
.
showToast
({
title
:
'安装升级包失败'
,
icon
:
'none'
});
});
}
},
});
downloadTask
.
onProgressUpdate
((
res
)
=>
{
this
.
progressData
.
percent
=
res
.
progress
});
})
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.upgradePopup
{
z-index
:
999
;
/
deep
/
.uni-popup__wrapper
{
width
:
602rpx
;
background-image
:
url('~@/static/imgs/home/upgradeBackground.png')
;
background-repeat
:
no-repeat
;
background-size
:
100%
100%
;
border-radius
:
15rpx
;
// border: solid 1px red;
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
.rocket-content
{
height
:
368rpx
;
.rocket-img
{
background-image
:
url('~@/static/imgs/home/rocket.png')
;
background-repeat
:
no-repeat
;
background-size
:
100%
100%
;
width
:
152rpx
;
height
:
212rpx
;
position
:
absolute
;
top
:
-105rpx
;
left
:
225rpx
;
}
}
.title
{
display
:
flex
;
justify-content
:
center
;
font-size
:
36rpx
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
font-weight
:
500
;
color
:
#282828
;
}
.update-content
{
margin-top
:
44rpx
;
// border: solid 1rpx red;
padding-left
:
100rpx
;
display
:
flex
;
flex-direction
:
column
;
uni-text
{
font-size
:
28rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#989899
;
margin-bottom
:
8rpx
;
}
}
.update-button
{
// border: solid 1rpx yellow;
display
:
flex
;
width
:
482rpx
;
margin
:
0
auto
;
margin-top
:
48rpx
;
uni-button
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
28rpx
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
font-weight
:
500
;
color
:
#FFFFFF
;
margin
:
0rpx
;
flex
:
1
;
height
:
80rpx
;
margin-bottom
:
80rpx
;
}
.not-updated-button
{
margin-right
:
40rpx
;
}
}
.progress-bar
{
width
:
538rpx
;
// border: solid 1px red;
margin
:
0
auto
;
margin-top
:
96rpx
;
margin-bottom
:
102rpx
;
uni-progress
{
.uni-progress-bar
{
border-radius
:
50rpx
;
.uni-progress-inner-bar
{
border-radius
:
50rpx
;
}
}
}
}
}
}
</
style
>
\ No newline at end of file
unpackage/dist/dev/app-plus/app-service.js
View file @
cde25617
This source diff could not be displayed because it is too large. You can
view the blob
instead.
utils/header.js
View file @
cde25617
...
@@ -70,7 +70,7 @@ export const initHeaderDevice = function () {
...
@@ -70,7 +70,7 @@ export const initHeaderDevice = function () {
}
}
if
(
locationInfo
)
{
if
(
locationInfo
)
{
//
device = Object.assign(device, common, JSON.parse(locationInfo))
device
=
Object
.
assign
(
device
,
common
,
JSON
.
parse
(
locationInfo
))
}
}
if
(
loadUuid
){
if
(
loadUuid
){
device
=
Object
.
assign
(
device
,
common
,
JSON
.
parse
(
loadUuid
))
device
=
Object
.
assign
(
device
,
common
,
JSON
.
parse
(
loadUuid
))
...
...
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