2024.03.05~2024.03.06 工作代码提交

This commit is contained in:
sx 2025-03-06 22:00:21 +08:00
parent bcd5428f82
commit 4c8f2050e8
17 changed files with 451 additions and 279 deletions

View File

@ -31,6 +31,8 @@ onLaunch(() => {
// #ifdef APP
// app
init()
// APP
util.getAppVersion()
// #endif
})

View File

@ -123,6 +123,7 @@ const mine = {
url: '/coreplay/app/durian/getUserDataByAccount',
query: param.query,
method: 'GET',
load: true,
})
},

View File

@ -6,9 +6,11 @@ const config = {
// host: 'h5api',
// #endif
// #ifndef H5
// host: 'http://91f.xyz:8080',
host: 'http://3f609e6a.r24.cpolar.top',
host: 'http://91f.xyz:8080',
// host: 'http://3dd3096c.r24.cpolar.top',
// #endif
// 是否vivo显示
showVivo: true,
// 支付方式配置
payType: {
score: {

View File

@ -213,7 +213,7 @@ const util = {
responseType: params.responseType || 'text',
// 请求成功返回
success: res => {
// console.log('request success', url, res, params.data ? params.data : '')
console.log('request success', url, res, params.data ? params.data : '')
// 关闭加载效果
if (params.load) {
uni.hideLoading()
@ -623,7 +623,8 @@ const util = {
obj.success && obj.success({
value: result,
width: imageInfo.width,
height: imageInfo.height,
height: imageInfo
.height,
});
},
})
@ -1606,6 +1607,28 @@ const util = {
})
})
},
/**
* 获取app最新版本信息
* @param {Object} option
*/
getAppVersion(callback) {
// 获取最新版本信息
api.getAppVersion().then(rs => {
if (rs.code == 200) {
const result = rs.data
console.log('getAppVersion result', result)
// 同步修改云端数据
uni.$store.commit('setState', {
key: 'versionCloud',
value: result
})
if (callback) callback(result)
return
}
})
},
}
export default util

View File

@ -10,6 +10,7 @@
getCurrentInstance,
computed,
nextTick,
onMounted,
} from 'vue'
//
import util from '@/common/js/util';
@ -19,28 +20,25 @@
const {
proxy
} = getCurrentInstance()
//
const versionCloud = reactive({})
//
const versionkApp = reactive({})
// app
const versionCloud = computed(() => uni.$store.state.versionCloud)
onMounted(() => {
let system = uni.getSystemInfoSync()
Object.assign(versionkApp, system)
})
//
function init() {
//
api.getAppVersion().then(rs => {
if (rs.code == 200) {
console.log('getAppVersion', rs)
//
const result = rs.data
let system = uni.getSystemInfoSync()
Object.assign(versionCloud, result)
Object.assign(versionkApp, system)
console.log('if', system.appVersionCode, result.versionCode)
//
if (system.appVersionCode < result.versionCode || true) open()
console.log('versionCloud', versionCloud.value)
return
}
})
Object.assign(versionkApp, system)
// status 1 0
if (result.status != 1) return
// <
if (system.appVersionCode < result.versionCode) open()
}
//
@ -56,13 +54,19 @@
//
function handleConfirm() {
//
// let downloadUrl = 'https://www.doubao.com/chat/'
let downloadUrl = versionCloud.downloadUrl
let downloadUrl = versionCloud.value.downloadUrl
plus.runtime.openURL(downloadUrl, function(res) {
console.log('打开浏览器结果:', res);
}, function(err) {
console.log('打开浏览器失败:', err);
});
})
}
//
function handleCancel() {
//
if (versionCloud.value.isforce == 1) plus.runtime.quit()
else close()
}
defineExpose({
@ -73,10 +77,10 @@
</script>
<template>
<uni-popup ref="update" type="center">
<uni-popup ref="update" type="center" :is-mask-click="false">
<view class="updateAlt popMid ptb30 plr30 bfff">
<view class="header">
<view class="df aic">
<view class="header df fdc">
<view class="df fdc aic">
<image src="/static/logo.png" mode="aspectFit" class="wh120 br10" />
</view>
<text class="mt30 f48">九亿有新版本啦~</text>
@ -90,9 +94,15 @@
</view>
</view>
<view class="btn focus bar mlr50">
<view class="btns df fdr jcsb mlr30">
<view class="btn focus bar f1">
<text class="tac cfff f28" @click="handleConfirm">更新</text>
</view>
<view class="btn cancel bar f1">
<text class="tac c333 f28" @click="handleCancel">取消</text>
</view>
</view>
</view>
</uni-popup>
</template>

View File

@ -42,7 +42,8 @@ function getUserInfos(userRecommend) {
console.log(rs)
if (rs.data !== null) {
uni.navigateTo({
url: '/pages/index/beInvited?header=' + rs.data.userPortrait + '&userId=' + rs.data.userId + '&userNickname=' +
url: '/pages/index/beInvited?header=' + rs.data.userPortrait + '&userId=' + rs.data
.userId + '&userNickname=' +
rs.data.userNickname
});
}
@ -117,8 +118,9 @@ defineExpose({
<text class="text f1 c333 f28">我的钱包</text>
</navigator>
<navigator url="/pages/index/integralMall" class="item df fdr aic mtb15 ptb40 plr30 bfff br20"
hover-class="none">
<template v-if="util.config.showVivo">
<navigator url="/pages/index/integralMall"
class="item df fdr aic mtb15 ptb40 plr30 bfff br20" hover-class="none">
<image class="wh80 mr25" src="/static/leftMenu2.png" mode="aspectFit" />
<text class="text f1 c333 f28">卷轴积分</text>
</navigator>
@ -129,10 +131,12 @@ defineExpose({
<text class="text f1 c333 f28">榴莲果树</text>
</navigator>
<view @click="link('/pages/index/myTeam')" class="item df fdr aic mtb15 ptb40 plr30 bfff br20">
<view @click="link('/pages/index/myTeam')"
class="item df fdr aic mtb15 ptb40 plr30 bfff br20">
<image class="wh80 mr25" src="/static/leftMenu5.png" mode="aspectFit" />
<text class="text f1 c333 f28">我的团队</text>
</view>
</template>
<view @click="link('/pages/index/myQrCode')"
class="item df fdr aic mtb15 ptb40 plr30 bfff br20">

View File

@ -2,8 +2,8 @@
"name" : "九亿",
"appid" : "__UNI__08B31BC",
"description" : "",
"versionName" : "1.0.12",
"versionCode" : 1012,
"versionName" : "1.0.13",
"versionCode" : 1013,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -779,6 +779,13 @@
{
"navigationBarTitleText" : "流量点明细"
}
},
{
"path" : "pages/mine/setting/about",
"style" :
{
"navigationBarTitleText" : "关于九亿"
}
}
],
@ -866,11 +873,15 @@
}
},
"condition": {
"current": 0,
"current": 1,
"list": [
{
"name": "test",
"path": "pages/mine/homepage"
},
{
"name": "test",
"path": "pages/mine/setting/about"
}
]
},

View File

@ -801,9 +801,11 @@
</view>
<!-- 有效读秒唱片 -->
<template v-if="util.config.showVivo">
<view class="disc pf r0" :style="{top: discOffsetTop+'px'}" v-if="userinfo.id">
<disc ref="discRef" />
</view>
</template>
<template v-for="(item, index) in tab" :key="index">
<view class="container f1" v-if="tabIndex == index" ref="containerRef">

View File

@ -100,7 +100,7 @@
})
onReady(() => {
proxy.$refs.orderDetail.open()
// proxy.$refs.orderDetail.open()
})
onPullDownRefresh(() => {

View File

@ -13,10 +13,15 @@
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app'
import {
useStore
} from 'vuex'
//
import api from '@/api/index.js'
//
import util from '@/common/js/util.js'
//
const store = useStore()
//
const list = reactive({
pageSize: 10,
@ -48,6 +53,8 @@
])
//
const typeIndex = ref(0)
//
const userinfo = computed(() => store.state.userinfo)
onLoad(() => {
//
@ -83,7 +90,8 @@
query: {
pageSize: list.pageSize,
pageNum: list.pageNum,
type: typeList[typeIndex.value].id,
type: util.config.showVivo ? typeList[typeIndex.value].id : 'balance',
userId: userinfo.value.id,
}
}).then(rs => {
if (rs.code == 200) {
@ -120,6 +128,7 @@
<template>
<view class="app">
<template v-if="util.config.showVivo">
<view class="typeList df bfff shadow">
<view class="item f1 fmid fdc" v-for="(item,index) in typeList" :class="{active: index == typeIndex}"
@click="handleTypeIndex(index)">
@ -129,6 +138,7 @@
</view>
<view class="ghost"></view>
</template>
<view class="listBox mtb30 mlr30">
<view class="list oh mtb30 plr30 bfff br20" v-for="(item,index) in list.data" :key="item.id">

View File

@ -171,12 +171,9 @@
</view>
</view>
<template v-if="util.config.showVivo">
<view class="mtb10">可用积分 {{wallet.score || 0}}</view>
</view>
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="$refs.released.open()">
<text>待入账列表</text>
<uni-icons type="right" color="" />
</template>
</view>
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="link('/pages/index/wallet/bill')">
@ -184,6 +181,12 @@
<uni-icons type="right" color="" />
</view>
<template v-if="util.config.showVivo">
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="$refs.released.open()">
<text>待入账列表</text>
<uni-icons type="right" color="" />
</view>
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" v-if="userinfo.isShop == 1">
<text>商家明细</text>
<uni-icons type="right" c1olor="" />
@ -193,6 +196,7 @@
<text>我的收益</text>
<uni-icons type="right" color="" />
</view>
</template>
<!-- 待释放 -->
<uni-popup ref="released" type="center">

View File

@ -276,7 +276,7 @@
<view class="f24">账号{{userinfo.account}}</view>
</navigator>
<view class="tac" v-if="userinfo.isShop == 1">
<view class="tac" v-if="userinfo.isShop == 1" @click="link(util.setUrl('/pages/shop/store/index',{storeId:userinfo.merId}))">
<uni-icons type="shop" color="" size="60rpx" />
<view class="f24">我的产品</view>
</view>
@ -395,12 +395,14 @@
<image class="wh50" src="/static/userMenu.png" mode="aspectFit" />
<view class="txt ml20 f1">我的客服</view>
</view> -->
<template v-if="util.config.showVivo">
<view @click="isAuth('/pages/index/myQrCode')">
<view class="item rows ptb20">
<image class="wh50" src="/static/userMenu.png" mode="aspectFit" />
<view class="txt ml20 f1">我的分享</view>
</view>
</view>
</template>
<view @click="menuLink('/pages/mine/userinfo')">
<view class="item rows ptb20">
<image class="wh50" src="/static/userMenu.png" mode="aspectFit" />

View File

@ -0,0 +1,92 @@
<script setup>
// 亿
//
import {
ref,
reactive,
computed,
getCurrentInstance
} from 'vue'
import {
useStore
} from 'vuex'
import {
onLoad,
} from '@dcloudio/uni-app'
//
import util from '@/common/js/util.js'
//
import appVerUpdateAlt from '@/components/index/appVerUpdate.vue';
// app
const appVersion = reactive({})
//
const {
proxy
} = getCurrentInstance()
onLoad(() => {
// #ifdef APP
let system = uni.getSystemInfoSync()
Object.assign(appVersion, system)
// #endif
})
//
function handleUpdate() {
util.getAppVersion((result) => {
console.log('handleUpdate', result, appVersion)
if (appVersion.appVersionCode < result.versionCode) {
proxy.$refs.appVerUpdateRef.open()
} else util.alert('当前已是最新版本')
})
}
//
function link(url) {
uni.navigateTo({
url,
})
}
</script>
<template>
<view class="app">
<!-- 顶部 -->
<view class="header ver mt50">
<view class="logo">
<image class="logo wh200 br15" src="/static/logo.png" mode="aspectFit" />
</view>
<view class="version mt20 tac c999 f34">{{appVersion.appVersion}}</view>
</view>
<!-- 容器 -->
<view class="container mt50 mlr50 plr20 bfff br10">
<view class="line rows ptb30 plr10" @click="handleUpdate">
<view class="key">检查更新</view>
<view class="value">
<uni-icons type="right" color="#999" />
</view>
</view>
<view class="line rows ptb30 plr10" @click="link(util.setUrl('/pages/index/article', { id: 2, }))">
<view class="key">关于我们</view>
<view class="value">
<uni-icons type="right" color="#999" />
</view>
</view>
</view>
<!-- app版本更新弹窗 -->
<appVerUpdateAlt ref="appVerUpdateRef" />
</view>
</template>
<style lang="scss">
//
.container {
.line+.line {
border-top: 2rpx solid #eee;
}
}
</style>

View File

@ -269,7 +269,7 @@ function logOff() {
</view>
<!-- #ifdef APP -->
<view class="line rows ptb20 plr10">
<view class="line rows ptb20 plr10"@click="link(util.setUrl('/pages/mine/setting/about'))">
<view class="">版本号</view>
<view class="c999 f28">{{ appVersion }}</view>
</view>

View File

@ -32,6 +32,15 @@ export default createStore({
"EFFECTIVE_VIDEO_TIME": 20, //有效视频时间
"UNLOCK_FLOW_STATISTICS": 30, //解锁流量统计
},
// 云端最新版本信息
versionCloud: {
"status": "0",
"versionCode": 100,
"versionName": "1.0.0",
"downloadUrl": "",
"updateContent": "",
"isForce": 0
},
},
mutations: {

View File

@ -3,8 +3,8 @@ import {
} from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
// let target = 'http://91f.xyz:8080'
let target = 'http://3f609e6a.r24.cpolar.top'
let target = 'http://91f.xyz:8080'
// let target = 'http://3dd3096c.r24.cpolar.tops'
export default defineConfig({
plugins: [uni()],