Commit 43861929 authored by ly's avatar ly

多典花

parent 4735acca
No preview for this file type
...@@ -30,44 +30,12 @@ ...@@ -30,44 +30,12 @@
//app更新版本 //app更新版本
// silentlyAppUpdate() // silentlyAppUpdate()
const isAgree = uni.getStorageSync('m-agreement') // const isAgree = uni.getStorageSync('m-agreement')
if (isAgree && plus.os.name ==='iOS') { // if (isAgree && plus.os.name ==='iOS') {
silentlyAppUpdate() // silentlyAppUpdate()
} // }
}, },
methods:{ methods:{
getAppVersion(){
const self=this
uni.getSystemInfo({
success: (res) => {
let platform = res.platform;
// 获取本机版本号
let type;
platform === "android" ? (type = "ANDROID") : (type = "IOS");
self.$request(`/pawn/setting/other/appVersion/${type}`,'GET').then(res => {
if (res.success==true) {
let response = res.result.data;
let result = {};
result.versionCode = response.version;
result.versionName = response.versionName;
result.versionInfo = response.content || "暂无";
result.forceUpdate = response.forceUpdate;
result.downloadUrl = response.downloadUrl;
result.is_silently = response.is_silently || false;
result.platform = platform;
result.storeList = response.storeList || '';
result.title = response.title || '';
result.type = response.type || '';
uni.setStorageSync('appVersion-info',result)
// resolve(result);
}
})
}
});
},
//tab的信息 //tab的信息
switchShowTabbar(){ switchShowTabbar(){
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
......
No preview for this file type
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
<view v-if="updateButtonBoolean" class="update-button"> <view v-if="updateButtonBoolean" class="update-button">
<button class="not-updated-button" :disabled="noUpdatedDisabled" <button class="not-updated-button" :disabled="noUpdatedDisabled"
v-if="appUpgeadeObj.versionUpdateEnum == 'REQUIRED'" type="warn" @tap.stop="noUpdate">暂不更新</button> v-if="appUpgeadeObj.forceUpdate == false" type="warn" @tap.stop="noUpdate">暂不更新</button>
<button class="updated-button" type="warn" @tap.stop="upgradeNow">立即升级</button> <button class="updated-button" type="warn" @tap.stop="upgradeNow">立即升级</button>
</view> </view>
<!-- v-if="progressBolean" --> <!-- v-if="progressBolean" -->
...@@ -92,11 +92,11 @@ ...@@ -92,11 +92,11 @@
this.noUpdatedDisabled = true this.noUpdatedDisabled = true
let that = this let that = this
let platform = uni.getSystemInfoSync().platform let platform = uni.getSystemInfoSync().platform
const index = this.appUpgeadeObj.url.indexOf('apps.apple.com') const index = this.appUpgeadeObj.downloadUrl.indexOf('apps.apple.com')
if (platform == 'ios' && index !== -1) return plus.runtime.openURL(this.appUpgeadeObj.url); if (platform == 'ios' && index !== -1) return plus.runtime.openURL(this.appUpgeadeObj.downloadUrl);
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => { plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
var downloadTask = uni.downloadFile({ var downloadTask = uni.downloadFile({
url: that.appUpgeadeObj.url, url: that.appUpgeadeObj.downloadUrl,
success: (downloadResult) => { success: (downloadResult) => {
if (downloadResult.statusCode === 200) { if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult plus.runtime.install(downloadResult
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
/deep/.uni-popup__wrapper { /deep/.uni-popup__wrapper {
width: 602rpx; width: 602rpx;
background-image: url('~@/static/imgs/home/upgradeBackground.png'); background-image: url('./imgs/upgradeBackground.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
border-radius: 15rpx; border-radius: 15rpx;
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
height: 368rpx; height: 368rpx;
.rocket-img { .rocket-img {
background-image: url('~@/static/imgs/home/rocket.png'); background-image: url('./imgs/rocket.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
width: 152rpx; width: 152rpx;
......
...@@ -7,10 +7,12 @@ App.mpType = 'app' ...@@ -7,10 +7,12 @@ App.mpType = 'app'
import mixin from './mixin/index' import mixin from './mixin/index'
import Modal from './components/modal/modal' import Modal from './components/modal/modal'
import goodsItem from './components/goodsItem/index' import goodsItem from './components/goodsItem/index'
import upgradePopup from './components/showModal/upgradePopup'
import request from './utils/request.js' import request from './utils/request.js'
Vue.component('view-modal', Modal); Vue.component('view-modal', Modal);
Vue.component('view-goods', goodsItem); Vue.component('view-goods', goodsItem);
Vue.component('upgrade-Popup', upgradePopup);
Vue.prototype.$request = request Vue.prototype.$request = request
Vue.mixin(mixin) Vue.mixin(mixin)
......
...@@ -152,16 +152,17 @@ ...@@ -152,16 +152,17 @@
{ {
"path": "pages/app-update/index", "path": "pages/app-update/index",
"style": { "style": {
"disableScroll": true, "navigationStyle": "custom",
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"app-plus": { "app-plus": {
"backgroundColorTop": "transparent", "bounce": "none",
"background": "transparent",
"titleNView": false,
"scrollIndicator": false,
"popGesture": "none",
"animationType": "fade-in", "animationType": "fade-in",
"animationDuration": 200, "background": "transparent",
"disableSwipeBack": true "backgroundColor": "rgba(0,0,0,0)",
"webviewBGTransparent": true,
"mask": "none",
"popGesture": "none"
} }
} }
}, },
......
...@@ -67,14 +67,46 @@ export default { ...@@ -67,14 +67,46 @@ export default {
key: "m-agreement", key: "m-agreement",
data: 'true', data: 'true',
success: function () { success: function () {
// that.Back(); console.log('m-agreement缓存成功')
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
} }
}) })
}, },
getAppVersion(){
const self=this
uni.getSystemInfo({
success: (res) => {
let platform = res.platform;
// 获取本机版本号
let type;
platform === "android" ? (type = "ANDROID") : (type = "IOS");
self.$request(`/pawn/setting/other/appVersion/${type}`,'GET').then(res => {
if (res.success==true) {
let response = res.result.data;
let result = {};
result.versionCode = response.version;
result.versionName = response.versionName;
result.versionInfo = response.content || "暂无";
result.forceUpdate = response.forceUpdate;
result.downloadUrl = response.downloadUrl;
result.is_silently = response.is_silently || false;
result.platform = platform;
result.storeList = response.storeList || '';
result.title = response.title || '';
result.type = response.type || '';
uni.setStorageSync('appVersion-info',result)
// resolve(result);
}
})
}
});
},
// 初始化首页信息 // 初始化首页信息
async init() { async init() {
const self=this const self=this
......
...@@ -293,8 +293,8 @@ export default { ...@@ -293,8 +293,8 @@ export default {
this.downloadSuccess = true; this.downloadSuccess = true;
this.installForBeforeFilePath = appDownLoadTempFilePath; this.installForBeforeFilePath = appDownLoadTempFilePath;
} else { } else {
uni.clearStorageSync('appDownLoadTempFilePath'); uni.removeStorageSync('appDownLoadTempFilePath');
uni.clearStorageSync('appDownLoadTempFilePathVersion'); uni.removeStorageSync('appDownLoadTempFilePathVersion');
} }
// 打开更新提示 // 打开更新提示
...@@ -410,19 +410,6 @@ export default { ...@@ -410,19 +410,6 @@ export default {
}, },
// 关闭更新框 // 关闭更新框
closeUpdate() { closeUpdate() {
uni.setStorage({
key: "m-agreement",
data: 'true',
success: function () {
console.log('m-agreement成功')
}
})
// loadDevice()
// loadNetwork()
// loadLocation()
// loadUuid()
const headerDevice = uni.getStorageSync('m-header-device')
console.log(headerDevice, 'headerDevice')
if (this.downloading) { if (this.downloading) {
console.log(1, '9') console.log(1, '9')
uni.showModal({ uni.showModal({
...@@ -435,7 +422,10 @@ export default { ...@@ -435,7 +422,10 @@ export default {
this.$refs.popup.close(); this.$refs.popup.close();
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
// uni.navigateBack({
// delta: 1
// })
} }
} }
}); });
...@@ -445,7 +435,10 @@ export default { ...@@ -445,7 +435,10 @@ export default {
// 如果用户短期内不更新 // 如果用户短期内不更新
if (this.userNotRemind) { if (this.userNotRemind) {
this.updataUserRefuseTime(); this.updataUserRefuseTime();
} }
// uni.navigateBack({
// delta: 1
// })
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
...@@ -480,7 +473,12 @@ page { ...@@ -480,7 +473,12 @@ page {
background: transparent; background: transparent;
} }
.appUploadAlertBox { .appUploadAlertBox {
position: relative;
width: 100vw;
height: 100vh;
display: flex;
background: rgba(0,0,0,0.4);
.bg { .bg {
width: 100%; width: 100%;
} }
......
...@@ -67,12 +67,14 @@ ...@@ -67,12 +67,14 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<upgrade-Popup :app-upgeade-obj="appUpgeadeObj"
v-if="appUpgeadeObj.downloadUrl" @pause='pauseClick'></upgrade-Popup>
</view> </view>
</template> </template>
<script> <script>
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js' import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
import silentlyAppUpdate from '@/pages/app-update/js-sdk/silentlyAppUpdate'
export default { export default {
data() { data() {
return { return {
...@@ -95,7 +97,10 @@ ...@@ -95,7 +97,10 @@
loadFlag:true, loadFlag:true,
hasNextPage:false, hasNextPage:false,
sort:'look_sum desc', sort:'look_sum desc',
token:'' token:'',
appUpgeadeObj:{},
isFirstShow: true
} }
}, },
onPageScroll(e) { onPageScroll(e) {
...@@ -117,12 +122,15 @@ ...@@ -117,12 +122,15 @@
this.Go('uni:/pages/agreement/index') this.Go('uni:/pages/agreement/index')
} }
} }
this.isFirstShow=uni.getStorageSync('isFirstShow')
console.log(this.isFirstShow,'isFirstShow1')
}, },
onLoad() { onLoad() {
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
this.token=token this.token=token
this.init() this.init()
this.searchGood() this.searchGood()
this.getAppVersion()
}, },
methods:{ methods:{
switchShowTabbar(){ switchShowTabbar(){
...@@ -158,6 +166,28 @@ ...@@ -158,6 +166,28 @@
}) })
} }
}, },
getAppVersion(){
const self=this
uni.getSystemInfo({
success: (res) => {
let platform = res.platform;
// 获取本机版本号
let type;
platform === "android" ? (type = "ANDROID") : (type = "IOS");
self.$request(`/pawn/setting/other/appVersion/${type}`,'GET').then(res => {
if (res.success==true) {
const response = res.result.data;
console.log(response,'response')
self.appUpgeadeObj=response
}
})
}
})
},
pauseClick(data){
console.log(data,'ssss')
this.appUpgeadeObj.downloadUrl=''
},
init(){ init(){
const self=this const self=this
self.$request('/pawn/index','GET').then(res => { self.$request('/pawn/index','GET').then(res => {
...@@ -312,17 +342,13 @@ ...@@ -312,17 +342,13 @@
}); });
}) })
}else{
console.log('777655')
loadDevice();
loadNetwork();
loadLocation();
loadUuid()
} }
this.token=token this.token=token
this.init() this.init()
this.searchGood() this.searchGood()
this.switchShowTabbar() this.switchShowTabbar()
} }
} }
</script> </script>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment