升级弹窗以及交易申请优化

This commit is contained in:
jia 2023-09-20 14:58:51 +08:00
parent 3ae87e293a
commit d1366e2425
6 changed files with 359 additions and 341 deletions

View File

@ -291,6 +291,7 @@
this.getUniMp(data); this.getUniMp(data);
break; break;
case 2: case 2:
this.navigator(data); this.navigator(data);
break; break;
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="gather"> <view class="gather">
<block v-if="isShow"> <block v-if="isShow&&userInfoData.mer_info.mer_name">
<view class="" v-if="userInfoData.mer_info.business_status==2"> <view class="" v-if="userInfoData.mer_info.business_status==2">
<view class="special_work com" v-if="userInfoData.mer_info.type_code === 'TypeSupplyChain'"> <view class="special_work com" v-if="userInfoData.mer_info.type_code === 'TypeSupplyChain'">
<view class="special_work com" v-if="true"> <view class="special_work com" v-if="true">
@ -363,14 +363,7 @@
</view> </view>
</block> </block>
<!-- <m-tabbar native> <view class="" style="padding-top: 1px;" v-else>
<template v-slot:tabbar_index_2>
<view class="custom_style">
<view class="custom_style_icon"></view>
</view>
</template>
</m-tabbar> -->
<view class="" style="padding-top: 1px;" v-if='jurisdiction==false&&isShow==false'>
<emptyPage title="暂无信息"></emptyPage> <emptyPage title="暂无信息"></emptyPage>
</view> </view>

View File

@ -173,7 +173,7 @@
<script> <script>
import { import {
navigateBack,
Toast Toast
} from '@/libs/uniApi.js' } from '@/libs/uniApi.js'
import { import {
@ -396,15 +396,20 @@
merchantUpdateAPI(data).then(res => { merchantUpdateAPI(data).then(res => {
Toast(res.message) Toast(res.message)
setTimeout(() => { setTimeout(() => {
// uni.switchTab({
// url: '/pages/moreProject/moreProject',
// fail: (err) => {
// // console.log('err', err);
// }
// });
// uni.navigateTo({
// url:'/pages/moreProject/moreProject'
// })
uni.redirectTo({
url:'/pages/moreProject/moreProject'
})
uni.switchTab({ }, 1000)
url: '/pages/moreProject/moreProject',
fail: (err) => {
// console.log('err', err);
}
});
}, 2000)
}).catch(err => { }).catch(err => {
Toast(err) Toast(err)
}) })

View File

@ -11,15 +11,14 @@
</view> </view>
<view class="content_title_c" v-else-if="item.status==2"> <view class="content_title_c" v-else-if="item.status==2">
申请拒绝 拒绝
</view> </view>
<view class="content_title_b" v-else-if="item.status==0"> <view class="content_title_b" v-else-if="item.status==0">
审核中 审核中
</view> </view>
<view class="content_title_d"> <view class="content_title_d">
{{item.type_name}} {{item.mer_name}}
</view> </view>
</view> </view>
<view class="" v-if="item.fail_msg" style="margin-top: -50rpx;color: red;"> <view class="" v-if="item.fail_msg" style="margin-top: -50rpx;color: red;">

View File

@ -120,29 +120,14 @@ const actions = {
Appversion({ Appversion({
version: os.appWgtVersion, version: os.appWgtVersion,
type: apptype, type: apptype,
phone_brand: os.brand phone_brand:os.brand
}).then((res) => { }).then((res) => {
if (Object.keys(res.data.appInfo).length > 0) { if (Object.keys(res.data.appInfo).length > 0) {
// if(res.data.appInfo.version) uni.showLoading({ // if(res.data.appInfo.version) uni.showLoading({
// title: '检查更新中' // title: '检查更新中'
// }) // })
if (res.data.appInfo.phone_brand.length > 0) {
if (plus.os.name == "Android") {
// 跳转安卓应用市场
let appurl = res.data.appInfo.dow_url //这个是通用应用市场如果想指定某个应用商店需要单独查这个应用商店的包名或scheme及参数
plus.runtime.openURL(appurl)
} else {
// 跳转AppStore
plus.runtime.launchApplication({
action: res.data.appInfo.dow_url,
})
}
} else {
// 版本更新 // 版本更新
if (compareVersions(res.data.appInfo.version, os.appWgtVersion || wgt_v) == 1 && if (compareVersions(res.data.appInfo.version, os.appWgtVersion || wgt_v) == 1 &&
compareVersions(res.data.appInfo.version, compareVersions(res.data.appInfo.version,
@ -153,17 +138,19 @@ const actions = {
title: info.title || '发现新版本', title: info.title || '发现新版本',
content: info.content || '修复了部分BUG', content: info.content || '修复了部分BUG',
versionName: info.version || '1.0.1', versionName: info.version || '1.0.1',
brand:res.data.appInfo.phone_brand,
downUrl: info.dow_url || '', downUrl: info.dow_url || '',
force: info.force == 1 ? true : false, // 是否强制更新 force: info.force == 1 ? true : false, // 是否强制更新
quiet: info.quiet == 1 ? true : false // 是否静默更新 quiet: info.quiet == 1 ? true : false // 是否静默更新
} }
Updater.update(version);
Updater.update(version,res.data.appInfo);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
// uni.hideLoading(); // uni.hideLoading();
} }
}
} }
}).catch((err) => { }).catch((err) => {

View File

@ -9,7 +9,7 @@
<view class="version-name" v-if="updateParams.versionName">V{{ updateParams.versionName }}</view> <view class="version-name" v-if="updateParams.versionName">V{{ updateParams.versionName }}</view>
</view> </view>
<view class="title">更新内容</view> <view class="title">更新内容</view>
<view class="content" > <view class="content">
<rich-text :nodes="content" /> <rich-text :nodes="content" />
</view> </view>
@ -29,7 +29,7 @@
</view> </view>
</view> </view>
<view class="bottom" v-if="!updateParams.force" @click="back"> <view class="bottom" v-if="!updateParams.force" @click="back">
<view class="line"/> <view class="line" />
<image src="../assets/close.png" class="close" /> <image src="../assets/close.png" class="close" />
</view> </view>
@ -37,9 +37,12 @@
</template> </template>
<script> <script>
import { download, install } from "../updater"; import {
download,
install
} from "../updater";
export default { export default {
data() { data() {
const data = { const data = {
updateParams: {}, updateParams: {},
@ -54,7 +57,7 @@ export default {
content() { content() {
return (this.updateParams.content || '').replace(/[\r\n]/gim, '<br/>'); return (this.updateParams.content || '').replace(/[\r\n]/gim, '<br/>');
}, },
downloadText () { downloadText() {
if (this.downloadSucc) { if (this.downloadSucc) {
return this.updateParams.downSucTip; return this.updateParams.downSucTip;
} }
@ -68,6 +71,7 @@ export default {
}, },
}, },
onLoad(params) { onLoad(params) {
const data = { const data = {
title: '发现新版本', title: '发现新版本',
updateBtnText: '立即升级', updateBtnText: '立即升级',
@ -84,6 +88,7 @@ export default {
return this.updateParams.force; return this.updateParams.force;
}, },
methods: { methods: {
back() { back() {
if (!this.updateParams.force) { if (!this.updateParams.force) {
uni.navigateBack(); uni.navigateBack();
@ -96,7 +101,8 @@ export default {
} }
// ios appstore.apk.wgt // ios appstore.apk.wgt
const isResource = ['.apk', '.wgt'].some(ext => this.updateParams.downUrl.toLocaleLowerCase().includes(ext)); const isResource = ['.apk', '.wgt'].some(ext => this.updateParams.downUrl.toLocaleLowerCase().includes(
ext));
if (plus.os.name !== "Android" || !isResource) { if (plus.os.name !== "Android" || !isResource) {
plus.runtime.openURL(this.updateParams.downUrl); plus.runtime.openURL(this.updateParams.downUrl);
return; return;
@ -123,6 +129,28 @@ export default {
}); });
}, },
handleButton() { handleButton() {
if (this.updateParams.brand.length > 0) {
if (plus.os.name == "Android") {
//
let appurl = this.updateParams.downUrl //scheme
plus.runtime.openURL(appurl)
setTimeout((res) => {
this.back()
}, 1000)
} else {
// AppStore
plus.runtime.launchApplication({
action: this.updateParams.downUrl,
})
setTimeout((res) => {
this.back()
}, 1000)
}
} else {
if (!this.downloading) { if (!this.downloading) {
return this.start(); return this.start();
} }
@ -133,19 +161,22 @@ export default {
this.downloadError = true; this.downloadError = true;
return this.start(); return this.start();
} }
}
}, },
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
page { page {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background: transparent; background: transparent;
} }
.container { .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -153,16 +184,16 @@ page {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
} }
.main { .main {
width: 75%; width: 75%;
background-color: #fff; background-color: #fff;
border-radius: 8rpx; border-radius: 8rpx;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.header { .header {
position: relative; position: relative;
.bg1 { .bg1 {
@ -199,9 +230,9 @@ page {
padding: 8rpx 20rpx; padding: 8rpx 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
} }
} }
.title { .title {
background-color: #ff6d42; background-color: #ff6d42;
color: #fff; color: #fff;
display: inline-block; display: inline-block;
@ -211,18 +242,18 @@ page {
line-height: 26rpx; line-height: 26rpx;
padding: 8rpx 20rpx; padding: 8rpx 20rpx;
border-radius: 8rpx; border-radius: 8rpx;
} }
.content { .content {
margin-top: 12rpx; margin-top: 12rpx;
margin-left: 30rpx; margin-left: 30rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 2; line-height: 2;
max-height: 240rpx; max-height: 240rpx;
overflow-y: auto; overflow-y: auto;
} }
.button { .button {
margin: 20rpx 30rpx; margin: 20rpx 30rpx;
background-color: #ffaa00; background-color: #ffaa00;
color: #fff; color: #fff;
@ -241,9 +272,9 @@ page {
opacity: 1; opacity: 1;
pointer-events: initial; pointer-events: initial;
} }
} }
.progress { .progress {
padding: 50rpx 50rpx 18rpx; padding: 50rpx 50rpx 18rpx;
.slider { .slider {
@ -295,21 +326,23 @@ page {
} }
} }
} }
} }
.bottom { .bottom {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.line { .line {
width: 3rpx; width: 3rpx;
height: 50rpx; height: 50rpx;
background-color: #fff; background-color: #fff;
} }
.close { .close {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
margin-top: -4rpx; margin-top: -4rpx;
} }
} }
</style> </style>