Commit 43861929 authored by ly's avatar ly

多典花

parent 4735acca
No preview for this file type
......@@ -30,44 +30,12 @@
//app更新版本
// silentlyAppUpdate()
const isAgree = uni.getStorageSync('m-agreement')
if (isAgree && plus.os.name ==='iOS') {
silentlyAppUpdate()
}
// const isAgree = uni.getStorageSync('m-agreement')
// if (isAgree && plus.os.name ==='iOS') {
// silentlyAppUpdate()
// }
},
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的信息
switchShowTabbar(){
const token=uni.getStorageSync('token')
......
No preview for this file type
......@@ -15,7 +15,7 @@
</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>
v-if="appUpgeadeObj.forceUpdate == false" type="warn" @tap.stop="noUpdate">暂不更新</button>
<button class="updated-button" type="warn" @tap.stop="upgradeNow">立即升级</button>
</view>
<!-- v-if="progressBolean" -->
......@@ -92,11 +92,11 @@
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);
const index = this.appUpgeadeObj.downloadUrl.indexOf('apps.apple.com')
if (platform == 'ios' && index !== -1) return plus.runtime.openURL(this.appUpgeadeObj.downloadUrl);
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
var downloadTask = uni.downloadFile({
url: that.appUpgeadeObj.url,
url: that.appUpgeadeObj.downloadUrl,
success: (downloadResult) => {
if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult
......@@ -132,7 +132,7 @@
/deep/.uni-popup__wrapper {
width: 602rpx;
background-image: url('~@/static/imgs/home/upgradeBackground.png');
background-image: url('./imgs/upgradeBackground.png');
background-repeat: no-repeat;
background-size: 100% 100%;
border-radius: 15rpx;
......@@ -145,7 +145,7 @@
height: 368rpx;
.rocket-img {
background-image: url('~@/static/imgs/home/rocket.png');
background-image: url('./imgs/rocket.png');
background-repeat: no-repeat;
background-size: 100% 100%;
width: 152rpx;
......
......@@ -7,10 +7,12 @@ App.mpType = 'app'
import mixin from './mixin/index'
import Modal from './components/modal/modal'
import goodsItem from './components/goodsItem/index'
import upgradePopup from './components/showModal/upgradePopup'
import request from './utils/request.js'
Vue.component('view-modal', Modal);
Vue.component('view-goods', goodsItem);
Vue.component('upgrade-Popup', upgradePopup);
Vue.prototype.$request = request
Vue.mixin(mixin)
......
......@@ -152,16 +152,17 @@
{
"path": "pages/app-update/index",
"style": {
"disableScroll": true,
"navigationStyle": "custom",
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"app-plus": {
"backgroundColorTop": "transparent",
"background": "transparent",
"titleNView": false,
"scrollIndicator": false,
"popGesture": "none",
"bounce": "none",
"animationType": "fade-in",
"animationDuration": 200,
"disableSwipeBack": true
"background": "transparent",
"backgroundColor": "rgba(0,0,0,0)",
"webviewBGTransparent": true,
"mask": "none",
"popGesture": "none"
}
}
},
......
......@@ -67,14 +67,46 @@ export default {
key: "m-agreement",
data: 'true',
success: function () {
// that.Back();
console.log('m-agreement缓存成功')
uni.navigateBack({
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() {
const self=this
......
......@@ -293,8 +293,8 @@ export default {
this.downloadSuccess = true;
this.installForBeforeFilePath = appDownLoadTempFilePath;
} else {
uni.clearStorageSync('appDownLoadTempFilePath');
uni.clearStorageSync('appDownLoadTempFilePathVersion');
uni.removeStorageSync('appDownLoadTempFilePath');
uni.removeStorageSync('appDownLoadTempFilePathVersion');
}
// 打开更新提示
......@@ -410,19 +410,6 @@ export default {
},
// 关闭更新框
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) {
console.log(1, '9')
uni.showModal({
......@@ -435,7 +422,10 @@ export default {
this.$refs.popup.close();
uni.switchTab({
url: '/pages/index/index'
});
});
// uni.navigateBack({
// delta: 1
// })
}
}
});
......@@ -445,7 +435,10 @@ export default {
// 如果用户短期内不更新
if (this.userNotRemind) {
this.updataUserRefuseTime();
}
}
// uni.navigateBack({
// delta: 1
// })
uni.switchTab({
url: '/pages/index/index'
});
......@@ -480,7 +473,12 @@ page {
background: transparent;
}
.appUploadAlertBox {
.appUploadAlertBox {
position: relative;
width: 100vw;
height: 100vh;
display: flex;
background: rgba(0,0,0,0.4);
.bg {
width: 100%;
}
......
......@@ -67,12 +67,14 @@
</scroll-view>
</view>
</view>
<upgrade-Popup :app-upgeade-obj="appUpgeadeObj"
v-if="appUpgeadeObj.downloadUrl" @pause='pauseClick'></upgrade-Popup>
</view>
</template>
<script>
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
import silentlyAppUpdate from '@/pages/app-update/js-sdk/silentlyAppUpdate'
export default {
data() {
return {
......@@ -95,7 +97,10 @@
loadFlag:true,
hasNextPage:false,
sort:'look_sum desc',
token:''
token:'',
appUpgeadeObj:{},
isFirstShow: true
}
},
onPageScroll(e) {
......@@ -117,12 +122,15 @@
this.Go('uni:/pages/agreement/index')
}
}
this.isFirstShow=uni.getStorageSync('isFirstShow')
console.log(this.isFirstShow,'isFirstShow1')
},
onLoad() {
const token=uni.getStorageSync('token')
this.token=token
this.init()
this.searchGood()
this.getAppVersion()
},
methods:{
switchShowTabbar(){
......@@ -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(){
const self=this
self.$request('/pawn/index','GET').then(res => {
......@@ -312,17 +342,13 @@
});
})
}else{
console.log('777655')
loadDevice();
loadNetwork();
loadLocation();
loadUuid()
}
this.token=token
this.init()
this.searchGood()
this.switchShowTabbar()
}
}
</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