Compare commits

...

2 Commits

Author SHA1 Message Date
小李 bd3a2e9cce 安卓沉浸适配 2026-07-25 17:20:57 +08:00
小李 d9459b1bd0 接口加密 2026-07-20 10:10:55 +08:00
86 changed files with 1224 additions and 831 deletions

View File

@ -9,6 +9,10 @@
"customPlaygroundType" : "local", "customPlaygroundType" : "local",
"playground" : "custom", "playground" : "custom",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
},
{
"playground" : "standard",
"type" : "uni-app:app-harmony"
} }
] ]
} }

62
App.vue
View File

@ -142,28 +142,45 @@
*/ */
initFromExtraData(extraData) { initFromExtraData(extraData) {
// Storage I/O // Storage I/O
const storageData = { let storageData={}
host: extraData.host, if(uni.getStorageSync('isTest')){
header: { storageData = {
"x-token": extraData['x-token'], host: extraData.host,
"x-version": extraData['x-version'], header: {
"x-platform": extraData['x-platform'], "x-token": extraData['x-token'],
"x-device-id": extraData['x-device-id'], "x-version": extraData['x-version'],
"x-mobile-brand": extraData['x-mobile-brand'], "x-platform": extraData['x-platform'],
"x-mobile-model": extraData['x-mobile-model'], "x-device-id": extraData['x-device-id'],
"x-channel": extraData['x-channel'], "x-mobile-brand": extraData['x-mobile-brand'],
"x-package": extraData['x-package'], "x-mobile-model": extraData['x-mobile-model'],
"x-click-id": extraData['x-click-id'], "x-channel": extraData['x-channel'],
// #ifdef APP-PLUS "x-package": extraData['x-package'],
"header": { "x-click-id": extraData['x-click-id'],
"version": this.$version, // #ifdef APP-PLUS
"header": {
"version": this.$version,
}
// #endif
},
encrypt: extraData['encrypt'],
decrypt: extraData['decrypt']
}
}else{
if (extraData['safeBottom']) {
this.$store.state["safeBottomAz"]=Number(extraData['safeBottom'])||0
}
storageData = {
host: extraData.host,
header: {
// #ifdef APP-PLUS
"header": {
"version": this.$version,
}
// #endif
} }
// #endif }
},
encrypt: extraData['encrypt'],
decrypt: extraData['decrypt']
} }
// //
Object.keys(storageData).forEach(key => { Object.keys(storageData).forEach(key => {
uni.setStorageSync(key, storageData[key]) uni.setStorageSync(key, storageData[key])
@ -171,6 +188,9 @@
if (extraData['isCombo']) { if (extraData['isCombo']) {
uni.setStorageSync('isCombo', extraData['isCombo']) uni.setStorageSync('isCombo', extraData['isCombo'])
} }
if (extraData['paytype']) {
uni.setStorageSync('isCombo', extraData['paytype'] == 'combo' ? 'ok' : '')
}
}, },
/** /**
@ -183,7 +203,7 @@
const devConfig = { const devConfig = {
host: "https://flaunt.batiao8.com/", host: "https://flaunt.batiao8.com/",
header: { header: {
"x-token": "ebe42caa-845a-4cb2-a324-18abe8ced7c0" "x-token": "55e2481e-cbd2-4d2d-82d3-b47e191fcfc0"
}, },
decrypt: "e4rOtnF8tJjtHO7ecZeJHN1rapED5ImB", decrypt: "e4rOtnF8tJjtHO7ecZeJHN1rapED5ImB",
encrypt: "xn08hYoizXhZ1zHP8DVqfCm2yHxPmhil" encrypt: "xn08hYoizXhZ1zHP8DVqfCm2yHxPmhil"

View File

@ -1,11 +1,11 @@
<template> <template>
<view class="footer" :class="['footer_'+type]" :style="data.style"> <view class="footer" :class="['footer_'+type]" :style="data.style" >
<view class="item" v-for="(item,index) in list" :key="index"> <view class="item" v-for="(item,index) in list" :key="index" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<image :src="`/static/image/call/${type}TabbarImg${index+1}.png`" mode=""></image> <image :src="`/static/image/call/${type}TabbarImg${index+1}.png`" mode=""></image>
<text>{{item}}</text> <text>{{item}}</text>
</view> </view>
</view> </view>
<view class="footer footerZhangwei" :class="['footer_'+type]"> <view class="footer footerZhangwei" :class="['footer_'+type]" :style="{'margin-top':$store.state.safeBottomAz+'px'}">
</view> </view>
</template> </template>

View File

@ -53,7 +53,7 @@
</scroll-view> </scroll-view>
</view> </view>
<view class="bottom-box fixed-bottom-box" :class="{ 'safe-area': $system == 'iOS' && data.keyboardHeight == 0 }" <view class="bottom-box fixed-bottom-box" :class="{ 'safe-area': $system == 'iOS' && data.keyboardHeight == 0 }"
:style="{ bottom: data.keyboardHeight + 'px' }"> :style="{ bottom: data.keyboardHeight + 'px' ,'margin-bottom':$store.state.safeBottomAz+'px'}">
<slot name="bottom"> <slot name="bottom">
<view class="bottom-container flex-align-center" v-show="!sortMode"> <view class="bottom-container flex-align-center" v-show="!sortMode">
<image v-if="phone != 'huawei' && phone != 'vivo'" class="add-img shrink-0" <image v-if="phone != 'huawei' && phone != 'vivo'" class="add-img shrink-0"
@ -104,7 +104,7 @@
</view> </view>
</slot> </slot>
</view> </view>
<view class="bottom-placeholder" :style="{ height: (data.bottomBoxHeight) + 'px' }"> <view class="bottom-placeholder" :style="{ height: (data.bottomBoxHeight+$store.state.safeBottomAz) + 'px' }">
</view> </view>
</view> </view>
</template> </template>

View File

@ -0,0 +1,41 @@
<template>
<view class="safeBottomBox">
<view class="safeBottomFiexd" :style="{ height: safeBottomAz + 'px', backgroundColor: bgColor }">
</view>
<view class="safeBottomZhangwei" :style="{ height: safeBottomAz + 'px' }">
</view>
</view>
</template>
<script setup>
import { computed, getCurrentInstance } from 'vue'
const props = defineProps({
bgColor: {
type: String,
default: '#EDEDED'
}
})
const instance = getCurrentInstance()
const safeBottomAz = computed(() => {
const store = instance?.appContext?.config?.globalProperties?.$store
const height = store?.state?.safeBottomAz
return Number(height) || 0
})
</script>
<style lang="scss" scoped>
.safeBottomBox {
width: 100vw;
position: relative;
z-index: 999;
overflow: hidden;
.safeBottomFiexd {
width: 100vw;
position: fixed;
left: 0;
bottom: 0;
}
}
</style>

Binary file not shown.

65
main.js
View File

@ -24,13 +24,70 @@ export function createApp() {
if (!systemInfo.platform) { if (!systemInfo.platform) {
systemInfo = uni.getSystemInfoSync() || {} systemInfo = uni.getSystemInfoSync() || {}
} }
const windowInfo = uni.getWindowInfo();
app.config.globalProperties.$store = {
state: {
safeBottom: windowInfo.safeAreaInsets?.bottom || 0,
safeBottomAz: 0
}
}
app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android' app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android'
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
app.config.globalProperties.$system = plus.os.name; app.config.globalProperties.$system = plus.os.name;
// #endif // #endif
app.config.globalProperties.$systemInfo = systemInfo app.config.globalProperties.$systemInfo = systemInfo;
uni.setStorageSync('version', '1.0.6.sp22') uni.setStorageSync('version', '1.0.7.sp5');
app.config.globalProperties.$version = uni.getStorageSync('version') app.config.globalProperties.$version = uni.getStorageSync('version');
// 环境development→测试production→正式跟构建环境走无需手改
const isTest = process.env.NODE_ENV === 'development';
app.config.globalProperties.$isTest = isTest;
// #ifdef APP-PLUS&&!APP-HARMONY
const version = plus.runtime.version;
// #endif
const compareVersion = (v1, v2) => {
const a = String(v1).split('.')
const b = String(v2).split('.')
const len = Math.max(a.length, b.length)
for (let i = 0; i < len; i++) {
const n1 = parseInt(a[i] || '0', 10)
const n2 = parseInt(b[i] || '0', 10)
if (n1 > n2) return 1
if (n1 < n2) return -1
}
return 0
}
//安卓和ios
// #ifdef APP-PLUS && !APP-HARMONY
if (plus.os.name == 'iOS') {
if (compareVersion(version, '1.9') >= 0 && !isTest) {
uni.setStorageSync('isTest', false)
} else {
uni.setStorageSync('isTest', true)
}
} else {
if (compareVersion(version, '2.2.0') >= 0 && !isTest) {
uni.setStorageSync('isTest', false)
} else {
uni.setStorageSync('isTest', true)
}
}
// #endif
//鸿蒙
// #ifdef APP-PLUS && APP-HARMONY
if (compareVersion(version, '2.1.7') >= 0&&!isTest) {
uni.setStorageSync('isTest', false)
} else {
uni.setStorageSync('isTest', true)
}
// #endif
//h5环境
// #ifndef APP-PLUS
uni.setStorageSync('isTest', true)
// #endif
app.use(globalMethods); app.use(globalMethods);
return { return {
app app

View File

@ -11,7 +11,19 @@
"splashScreens" : { "splashScreens" : {
"startWindowIcon" : "resource/icon.png", // "startWindowIcon" : "resource/icon.png", //
"startWindowBackground" : "#123456" // "startWindowBackground" : "#123456" //
} },
"bundleName" : "cn.zuom8.jsloction",
"signingConfigs" : {
"default" : {
"certpath" : "C:\\Users\\Administrator\\Desktop\\jisuloca\\test\\debug.cer",
"keyAlias" : "__uni__1be0b2f",
"keyPassword" : "000000189B31358AF1B1A6FD1CB2D1011E32DF02389A1F92604ECEB091A66654CDCDF6DB4DD18BC3",
"profile" : "C:\\Users\\Administrator\\Desktop\\jisuloca\\test\\jsloction_debugDebug.p7b",
"signAlg" : "SHA256withECDSA",
"storeFile" : "C:\\Users\\Administrator\\Desktop\\jisuloca\\hmos.p12",
"storePassword" : "000000185660236954705CE2E46C7A2FA76565A93989A8DDD5810CC2760ED8D2B479EDD9C488B982"
}
}
} }
}, },
"app-plus" : { "app-plus" : {
@ -25,6 +37,12 @@
"autoclose" : false, "autoclose" : false,
"delay" : 0 "delay" : 0
}, },
"compatible" : {
"runtimeVersion": "4.75",
"compilerVersion": "5.14",
"ignoreVersion" : true
},
"optimization" : { "optimization" : {
"subPackages" : true "subPackages" : true
}, },

7
package-lock.json generated
View File

@ -8,6 +8,7 @@
"name": "video-player 视频播放器 html5视频播放器-解决频层级、覆盖", "name": "video-player 视频播放器 html5视频播放器-解决频层级、覆盖",
"version": "2.0.0", "version": "2.0.0",
"dependencies": { "dependencies": {
"@batiao/batiao-sdk-uniapp-unimp": "1.0.374",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"lottie-web": "^5.13.0", "lottie-web": "^5.13.0",
"uuid": "^13.0.0" "uuid": "^13.0.0"
@ -19,6 +20,12 @@
"lint-staged": "^16.4.0" "lint-staged": "^16.4.0"
} }
}, },
"node_modules/@batiao/batiao-sdk-uniapp-unimp": {
"version": "1.0.374",
"resolved": "http://maven.batiao8.com/repository/mpnpm-releases/@batiao/batiao-sdk-uniapp-unimp/-/batiao-sdk-uniapp-unimp-1.0.374.tgz",
"integrity": "sha512-jEQBgTwaZewB2ZzJHYQjWsA4UhZnd7xnSIzUdoYTLKJ3B+gXHmGWSNhJ5MzaXKH3Uxbot2mmWT+TSw8WSZN2Sg==",
"license": "UNLICENSED"
},
"node_modules/@eslint-community/eslint-utils": { "node_modules/@eslint-community/eslint-utils": {
"version": "4.9.1", "version": "4.9.1",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",

View File

@ -18,6 +18,7 @@
] ]
}, },
"dependencies": { "dependencies": {
"@batiao/batiao-sdk-uniapp-unimp": "1.0.374",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"lottie-web": "^5.13.0", "lottie-web": "^5.13.0",
"uuid": "^13.0.0" "uuid": "^13.0.0"

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark :dark="data.dark" source="uni_alipay_huabei" /> <watermark :dark="data.dark" source="uni_alipay_huabei" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_huabei')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_huabei')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="page-container"> <view class="page-container">
@ -118,6 +118,7 @@
</view> </view>
<canvas canvas-id="crop-canvas" <canvas canvas-id="crop-canvas"
style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas> style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas>
<ZdySafeBottom bgColor="#fff"/>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<uni-popup ref="popup" type="center" :mask-click="false"> <uni-popup ref="popup" type="center" :mask-click="false">
<view class="popup-content"> <view class="popup-content">
@ -190,6 +191,7 @@
<script setup> <script setup>
import NavBar from '@/components/nav-bar/nav-bar' import NavBar from '@/components/nav-bar/nav-bar'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
numberUtil, numberUtil,
util util
@ -340,7 +342,7 @@ onLoad((option) => {
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
@ -463,7 +465,9 @@ const confirmImage = () => {
data.huabeiInfo.image = saveRes.savedFilePath data.huabeiInfo.image = saveRes.savedFilePath
selectedImage.value = '' // selectedImage.value = '' //
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
}, 200) }, 200)
// //
uni.setStorageSync(data.huabeiInfoStorageKey, data.huabeiInfo) uni.setStorageSync(data.huabeiInfoStorageKey, data.huabeiInfo)
@ -524,7 +528,9 @@ const chooseImage = () => {
selectedImage.value = res.tempFilePaths[0] selectedImage.value = res.tempFilePaths[0]
data.showMask = true data.showMask = true
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
// #endif
}, 500) }, 500)
} }
}) })
@ -561,7 +567,9 @@ const handleTouchEnd = () => {
const closeImage = () => { const closeImage = () => {
selectedImage.value = '' selectedImage.value = ''
data.showMask = false data.showMask = false
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
return false return false
} }

View File

@ -1,4 +1,4 @@
<template> <template>
<view class="page-container"> <view class="page-container">
<view class="main-container"> <view class="main-container">
@ -208,7 +208,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark :dark="data.dark" source="uni_alipay_huabei" /> <watermark :dark="data.dark" source="uni_alipay_huabei" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_huabei')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_huabei')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>
@ -407,18 +407,22 @@ onPageScroll((e) => {
data.navBar.bgColor = '#F6F6F6' data.navBar.bgColor = '#F6F6F6'
data.navBar.textColor = '#1a1a1a' data.navBar.textColor = '#1a1a1a'
data.isTop = false data.isTop = false
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
// #endif
} else { } else {
// //
data.navBar.bgColor = '#717E91' data.navBar.bgColor = '#717E91'
data.navBar.textColor = '#fff' data.navBar.textColor = '#fff'
data.isTop = true data.isTop = true
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
} }
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#F6F6F6') util.setAndroidSystemBarColor('#F6F6F6')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");

View File

@ -1,9 +1,9 @@
<template> <template>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark :dark="data.dark" source="uni_alipay_balance" /> <watermark :dark="data.dark" source="uni_alipay_balance" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_balance')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_balance')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container" :style="{ height: data.windowHeight + 'px' }"> <view class="container" :style="{ height: data.windowHeight + 'px' }">
@ -58,7 +58,7 @@
<scroll-view class="menu-scroll-view" scroll-x="true" @scroll="onMenuScroll" <scroll-view class="menu-scroll-view" scroll-x="true" @scroll="onMenuScroll"
:show-scrollbar="false"> :show-scrollbar="false">
<view class="menu-content"> <view class="menu-content">
<view class="item menu-icon-box" v-for="item in menuList"> <view class="item menu-icon-box" v-for="(item, index) in menuList" :key="index" >
<image class="menu-icon" :src="`/static/image/balance/menu-icon/${item.label}.png`" <image class="menu-icon" :src="`/static/image/balance/menu-icon/${item.label}.png`"
mode=""> mode="">
</image> </image>
@ -89,6 +89,8 @@
<view class="blue-text">我的客服</view> <view class="blue-text">我的客服</view>
<view class="footer-text">余额升级服务由支付宝和网商银行提供</view> <view class="footer-text">余额升级服务由支付宝和网商银行提供</view>
</view> </view>
<safeBottom bgColor="#F0F3F8"/>
</view> </view>
</scroll-view> </scroll-view>
@ -113,6 +115,8 @@
<script setup> <script setup>
//import NavBar from '@/components/nav-bar/nav-bar' //import NavBar from '@/components/nav-bar/nav-bar'
import BalanceList from '@/components/balance-list/balance-list.vue' import BalanceList from '@/components/balance-list/balance-list.vue'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { fastEntranceList } from '@/static/json/initial.json' import { fastEntranceList } from '@/static/json/initial.json'
import { import {
util, util,

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_pay-successful" /> <watermark dark="light" source="uni_alipay_pay-successful" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_pay-successful')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_pay-successful')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container"> <view class="container">
@ -218,9 +218,10 @@
<!-- 底部操作区 --> <!-- 底部操作区 -->
<view class="footer-section"> <view class="footer-section" :style="{'padding-bottom':($store.state.safeBottomAz+24)+'px'}">
<view class="finish-btn" @click="goBack">完成</view> <view class="finish-btn" @click="goBack">完成</view>
</view> </view>
<ZdySafeBottom bgColor="#f5f5f5"/>
</view> </view>
</template> </template>
@ -242,6 +243,8 @@ import {
import { import {
defaultData defaultData
} from './data.json'; } from './data.json';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const { const {
appContext, appContext,
proxy proxy
@ -307,7 +310,7 @@ onMounted(() => {
onShow(() => { onShow(() => {
loadStorageData(); loadStorageData();
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#F5F5F5') util.setAndroidSystemBarColor('#F5F5F5')
uni.setNavigationBarColor({ uni.setNavigationBarColor({
animation: { // animation: { //

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_transfer" /> <watermark dark="light" source="uni_alipay_transfer" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_transfer')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_transfer')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container"> <view class="container">
@ -149,9 +149,10 @@
</view> </view>
</view> </view>
<!-- 底部操作区 --> <!-- 底部操作区 -->
<view class="footer-section"> <view class="footer-section" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="finish-btn" @click="goBack">完成</view> <view class="finish-btn" @click="goBack">完成</view>
</view> </view>
<ZdySafeBottom bgColor="#f5f5f5"/>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<uni-popup ref="editPopup" type="center"> <uni-popup ref="editPopup" type="center">
@ -251,6 +252,7 @@ import {
util, util,
numberUtil numberUtil
} from '@/utils/common.js'; } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const { const {
appContext, appContext,
proxy proxy
@ -487,7 +489,7 @@ onMounted(() => {
}); });
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#F5F5F5') util.setAndroidSystemBarColor('#F5F5F5')
uni.setNavigationBarColor({ uni.setNavigationBarColor({
animation: { // animation: { //

View File

@ -609,7 +609,7 @@ let {
} = toRefs(data) } = toRefs(data)
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#F5F5F5') util.setAndroidSystemBarColor('#F5F5F5')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");

View File

@ -1,9 +1,9 @@
<template> <template>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark :dark="data.dark" source="uni_alipay_bill_details" /> <watermark :dark="data.dark" source="uni_alipay_bill_details" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_bill_details')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_bill_details')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view style="overflow: hidden;overflow-y: scroll; height: 100vh;"> <view style="overflow: hidden;overflow-y: scroll; height: 100vh;">
@ -241,6 +241,8 @@
</view> </view>
</view> </view>
<ZdySafeBottom bgColor="#F5F5F5"/>
</view> </view>
@ -251,6 +253,7 @@
import navBar from '@/components/nav-bar/nav-bar.vue' import navBar from '@/components/nav-bar/nav-bar.vue'
import billManagementPopup from '@/components/bill-management-popup/bill-management-popup.vue' import billManagementPopup from '@/components/bill-management-popup/bill-management-popup.vue'
import addBillJson from '@/static/json/add-bill.json' import addBillJson from '@/static/json/add-bill.json'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const { const {
billBottomIconList, billBottomIconList,
classifyTabBar classifyTabBar
@ -364,7 +367,7 @@ const visibleItemInfoList = computed(() => {
onShow(() => { onShow(() => {
getBillData(data.billId) getBillData(data.billId)
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#F5F5F5') util.setAndroidSystemBarColor('#F5F5F5')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");

View File

@ -1,9 +1,9 @@
<template> <template>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark :dark="data.dark" source="uni_alipay_bill" /> <watermark :dark="data.dark" source="uni_alipay_bill" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_bill')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_bill')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view style="overflow: hidden;height: 100vh;;"> <view style="overflow: hidden;height: 100vh;;">
@ -112,6 +112,7 @@
<view class="bill-list"> <view class="bill-list">
<BalanceList :isBalance="false" :list="item.list" @longPress="onLongPress" @onBill="billClick" /> <BalanceList :isBalance="false" :list="item.list" @longPress="onLongPress" @onBill="billClick" />
</view> </view>
<ZdySafeBottom bgColor="#F5F5F5"/>
</view> </view>
</scroll-view> </scroll-view>
@ -134,6 +135,7 @@ import {
} from '@/utils/common.js' } from '@/utils/common.js'
import navBar from '@/components/nav-bar/nav-bar.vue' import navBar from '@/components/nav-bar/nav-bar.vue'
import BalanceList from '@/components/balance-list/balance-list.vue' import BalanceList from '@/components/balance-list/balance-list.vue'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
reactive, reactive,
@ -247,7 +249,7 @@ onShow(() => {
// //
updateStatusBarHeight() updateStatusBarHeight()
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#F5F5F5') util.setAndroidSystemBarColor('#F5F5F5')
uni.setNavigationBarColor({ uni.setNavigationBarColor({
animation: { // animation: { //

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_call" /> <watermark dark="light" source="uni_alipay_other_call" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_call')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_call')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container"> <view class="container">
@ -13,7 +13,7 @@
<callList :type="data.type" ref="callLogList"></callList> <callList :type="data.type" ref="callLogList"></callList>
<tabbar :type="data.type" /> <tabbar :type="data.type" />
<image v-if="data.type != 'ios'" :src="`/static/image/call/${data.type}BtnImg.png`" mode="" class="btnImg" <image v-if="data.type != 'ios'" :src="`/static/image/call/${data.type}BtnImg.png`" mode="" class="btnImg"
:class="['btnImg_' + data.type]"></image> :class="['btnImg_' + data.type]" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}"></image>
</view> </view>
</template> </template>
@ -39,6 +39,7 @@ onReady(() => {
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
try { try {
if (plus.os.name === 'Android') { if (plus.os.name === 'Android') {
let colorTabbar = "#FAFAFA" let colorTabbar = "#FAFAFA"
@ -55,6 +56,7 @@ onShow(() => {
} catch (error) { } catch (error) {
console.log("修改导航条颜色失败", error); console.log("修改导航条颜色失败", error);
} }
// #endif
}) })
onPageScroll((e) => { onPageScroll((e) => {
// console.log(e) // console.log(e)

View File

@ -4,7 +4,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_call" /> <watermark dark="light" source="uni_alipay_other_call" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_call')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_call')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="ios" v-if="data.type=='ios'"> <view class="ios" v-if="data.type=='ios'">
@ -106,7 +106,7 @@
<tabbar type2='ios'/> <tabbar type2='ios'/>
</view> </view>
<view class="xiaomi" v-else-if="data.type=='xiaomi'" style="padding-bottom: 30px;"> <view class="xiaomi" v-else-if="data.type=='xiaomi'" style="padding-bottom: 30px;">
<view class="container" > <view class="container" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="status" :style="{height:$systemInfo.statusBarHeight+'px'}"> </view> <view class="status" :style="{height:$systemInfo.statusBarHeight+'px'}"> </view>
<view class="header" @click="openEditModalDetail()"> <view class="header" @click="openEditModalDetail()">
<image @click.stop="back()" class="back-icon" src="/static/image/call/detail/xiaomiBack.png" :style="{position: 'fixed', <image @click.stop="back()" class="back-icon" src="/static/image/call/detail/xiaomiBack.png" :style="{position: 'fixed',
@ -161,7 +161,7 @@
</view> </view>
</view> </view>
<view class="oppo" v-else-if="data.type=='oppo'"> <view class="oppo" v-else-if="data.type=='oppo'">
<view class="group_47573"> <view class="group_47573" >
<view class="status" :style="{height:$systemInfo.statusBarHeight+'px'}"> </view> <view class="status" :style="{height:$systemInfo.statusBarHeight+'px'}"> </view>
<view class="rectangle_22291"> <view class="rectangle_22291">
<!-- 顶部 --> <!-- 顶部 -->
@ -247,7 +247,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="flexcontainer_12"> <view class="flexcontainer_12" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="group_48097"> <view class="group_48097">
<image class="group_13967" src="/static/image/call/detail/oppoIcon6.png" /><text class="text_20"> 收藏 </text> <image class="group_13967" src="/static/image/call/detail/oppoIcon6.png" /><text class="text_20"> 收藏 </text>
</view> </view>
@ -327,7 +327,7 @@
<text class="text_4">通话记录</text> <text class="text_4">通话记录</text>
<image class="group_13972" mode="aspectFill" src="/static/image/call/detail/huaweiIcon6.png" /> <image class="group_13972" mode="aspectFill" src="/static/image/call/detail/huaweiIcon6.png" />
</view> </view>
<view class="group_48119"> <view class="group_48119" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="rectangle_23184_1" @click="openEditModal()"> <view class="rectangle_23184_1" @click="openEditModal()">
<!-- 第一条 --> <!-- 第一条 -->
<view class="group_13973" v-for="(item,index) in data.list" :key="index"> <view class="group_13973" v-for="(item,index) in data.list" :key="index">

View File

@ -1,9 +1,9 @@
<template> <template>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark :dark="data.dark" /> <watermark :dark="data.dark" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container"> <view class="container">
@ -156,7 +156,7 @@
<!-- <view v-if="$isVip()"> <!-- <view v-if="$isVip()">
<watermark :dark="data.dark" /> <watermark :dark="data.dark" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> --> </view> -->
</template> </template>

View File

@ -113,6 +113,9 @@
<view class="text text1">我们不会自动扣费,会员到期后需要您手动续费</view> <view class="text text1">我们不会自动扣费,会员到期后需要您手动续费</view>
</view> </view>
</view> </view>
<view class="" :style="{'height':$store.state.safeBottomAz+'px'}">
</view>
</view> </view>
<view class="footer-container"> <view class="footer-container">
@ -126,7 +129,7 @@
<text class="name">{{ item.name }}</text> <text class="name">{{ item.name }}</text>
</view> </view>
</view> </view>
<view class="buttonBoxs " :class="{ 'christmas': data.isChristmas }"> <view class="buttonBoxs " :class="{ 'christmas': data.isChristmas }" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<view class="hongbao" v-if="data.ishongBao"> <view class="hongbao" v-if="data.ishongBao">
<c-lottie ref="cLottieRef" :loop="false" src='/static/lottie/hongbao.json' width="100vw" <c-lottie ref="cLottieRef" :loop="false" src='/static/lottie/hongbao.json' width="100vw"
height='216vw'></c-lottie> height='216vw'></c-lottie>
@ -667,6 +670,7 @@
// uni.offNativeEventReceive() // uni.offNativeEventReceive()
}) })
onReady(() => { onReady(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
try { try {
if (plus.os.name === 'Android') { if (plus.os.name === 'Android') {
let color = plus.android.newObject("android.graphics.Color"); let color = plus.android.newObject("android.graphics.Color");
@ -697,6 +701,7 @@
} catch (error) { } catch (error) {
//TODO handle the exception //TODO handle the exception
} }
// #endif
}) })
@ -916,7 +921,7 @@
activity_id = activity_id.replace(',', '') activity_id = activity_id.replace(',', '')
if (activity_id != "") { if (activity_id != "") {
console.log("activity_id", activity_id); console.log("activity_id", activity_id);
let activityRes = await postJson('q', 'api/activity', { let activityRes = await postJson('', 'api/activity', {
activity_id: activity_id //activity_id+"=" activity_id: activity_id //activity_id+"="
}) })
console.log(activityRes) console.log(activityRes)

View File

@ -16,6 +16,8 @@
<uni-icons type="forward" size="18" color="#AEAEAE"></uni-icons> <uni-icons type="forward" size="18" color="#AEAEAE"></uni-icons>
</view> </view>
</view> </view>
<ZdySafeBottom bgColor="#f0f3f8"/>
</view> </view>
</template> </template>
@ -29,6 +31,7 @@ import {
} from '@/utils/common.js' } from '@/utils/common.js'
const videoHelpList = ref([]); const videoHelpList = ref([]);
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
onLoad(() => { onLoad(() => {
const configData = storage.get("config") const configData = storage.get("config")

View File

@ -84,7 +84,7 @@
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");

View File

@ -1,9 +1,9 @@
<template> <template>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_finance" /> <watermark dark="light" source="uni_alipay_finance" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_finance')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_finance')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container flex flex-column" @touchstart="handleTouchStart" @touchmove.stop.prevent="handleTouchMove" <view class="container flex flex-column" @touchstart="handleTouchStart" @touchmove.stop.prevent="handleTouchMove"
@ -163,7 +163,7 @@
</view> </view>
</view> </view>
<view v-if="!selectedImage" class="content flex-1 flex-column flex" @touchstart="clickHandleTouchStart" <view v-if="!selectedImage" class="content flex-1 flex-column flex" @touchstart="clickHandleTouchStart" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}"
@touchend="clickHandleTouchEnd"> @touchend="clickHandleTouchEnd">
<view v-if="financeInfo.bgImage" class="w100 h100" style="margin-top: -1px;"> <view v-if="financeInfo.bgImage" class="w100 h100" style="margin-top: -1px;">
<image class="w100 h100" :src="financeInfo.bgImage" mode="widthFix"> <image class="w100 h100" :src="financeInfo.bgImage" mode="widthFix">
@ -188,13 +188,13 @@
</view> </view>
<canvas canvas-id="crop-canvas" <canvas canvas-id="crop-canvas"
style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas> style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas>
</view> </view>
<!-- 底部导航栏 --> <!-- 底部导航栏 -->
<view class="bottom-box" <view class="bottom-box"
:class="`navigation-menu-${financeInfo.navigationMenuStyle}` + ($system == 'iOS' ? ' ios-bottom-box' : '')"> :class="`navigation-menu-${financeInfo.navigationMenuStyle}` + ($system == 'iOS' ? ' ios-bottom-box' : '')">
<view class="bottom-item" v-for="item in navigationMenu" :key="item.name" @click="clickBottomItem(item)"> <view class="bottom-item" v-for="item in navigationMenu" :key="item.name" @click="clickBottomItem(item)" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<image <image
:src="`/static/image/finance-management/navigation-menu/${financeInfo.navigationMenuStyle}/${item.icon}.png`"> :src="`/static/image/finance-management/navigation-menu/${financeInfo.navigationMenuStyle}/${item.icon}.png`">
</image> </image>
@ -264,6 +264,7 @@ import {
navigationMenu, navigationMenu,
myAssets myAssets
} from '@/static/json/fortune.json' } from '@/static/json/fortune.json'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
numberUtil, numberUtil,
util util
@ -365,7 +366,7 @@ onShow(async () => {
...uni.getStorageSync('financeInfo') ...uni.getStorageSync('financeInfo')
} }
console.log("financeInfo.value", financeInfo.value) console.log("financeInfo.value", financeInfo.value)
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor(financeInfo.value.navigationMenuStyle == 'style-1' ? '#ffffff' : '#F8F8F8') util.setAndroidSystemBarColor(financeInfo.value.navigationMenuStyle == 'style-1' ? '#ffffff' : '#F8F8F8')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
@ -584,7 +585,9 @@ const chooseImage = () => {
selectedImage.value = res.tempFilePaths[0] selectedImage.value = res.tempFilePaths[0]
data.showMask = true data.showMask = true
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
// #endif
}, 500) }, 500)
} }
}) })
@ -663,7 +666,9 @@ const confirmImage = () => {
financeInfo.value.bgImage = saveRes.savedFilePath financeInfo.value.bgImage = saveRes.savedFilePath
selectedImage.value = '' // selectedImage.value = '' //
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
}, 200) }, 200)
// //
uni.setStorageSync("financeInfo", financeInfo.value) uni.setStorageSync("financeInfo", financeInfo.value)
@ -712,7 +717,9 @@ const clickHandleTouchEnd = () => {
const closeImage = () => { const closeImage = () => {
selectedImage.value = '' selectedImage.value = ''
data.showMask = false data.showMask = false
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
return false return false
} }
@ -750,7 +757,7 @@ const closeStyleDialog = () => {
const confirmStyleDialog = (type) => { const confirmStyleDialog = (type) => {
financeInfo.value.navigationMenuStyle = type financeInfo.value.navigationMenuStyle = type
uni.setStorageSync('financeInfo', financeInfo.value) uni.setStorageSync('financeInfo', financeInfo.value)
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor(financeInfo.value.navigationMenuStyle == 'style-1' ? '#ffffff' : '#F8F8F8') util.setAndroidSystemBarColor(financeInfo.value.navigationMenuStyle == 'style-1' ? '#ffffff' : '#F8F8F8')
// #endif // #endif
stylePopup.value.close() stylePopup.value.close()

View File

@ -125,13 +125,17 @@
</view> </view>
</view> </view>
<!-- <view style="border: 1px solid red; text-align: center;padding: 10px;" @click="exit">退出模拟器</view> --> <!-- <view style="border: 1px solid red; text-align: center;padding: 10px;" @click="exit">退出模拟器</view> -->
<view class="footer-box" :class="{ 'ios-padding-bottom': platform === 'ios' }"> <view class="footer-box" :class="{ 'ios-padding-bottom': platform === 'ios' }">
<text class="vision-text">版本:{{ vision }}</text> <text class="vision-text">版本:{{ vision }}</text>
<text class="vision-text margin-l-6" v-if="qqgroup.enable">{{ qqgroup.text }}</text> <text class="vision-text margin-l-6" v-if="qqgroup.enable">{{ qqgroup.text }}</text>
<text class="vision-text" @click="copyNumber(qqgroup.number)">{{ qqgroup.number }}</text> <text class="vision-text" @click="copyNumber(qqgroup.number)">{{ qqgroup.number }}</text>
</view> </view>
<view v-if="platform != 'ios'" :style="{'height':'40px','background':'#F0F4F9'}">
</view>
<view v-if="platform != 'ios'" class="footer-box-safeBottom" :style="{'height':'40px','background':'#F0F4F9',width:data.windowWidth+'px'}">
</view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
@ -161,10 +165,11 @@ import {
onUnload, onUnload,
onReady onReady
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
onReady(() => { onReady(() => {
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.closeSplashscreen(); plus.navigator.closeSplashscreen();
// #endif // #endif
}, 500); }, 500);
@ -630,7 +635,9 @@ const exit = () => {
console.log('宿主App回传的数据' + ret); console.log('宿主App回传的数据' + ret);
}); });
} else { } else {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.runtime.quit(); plus.runtime.quit();
// #endif
} }
} }
@ -764,6 +771,11 @@ onUnload(() => {
}) })
</script> </script>
<style> <style>
.footer-box-safeBottom{
position: fixed;
left: 0;
bottom: 0;
}
.container { .container {
background-color: #F0F4F9; background-color: #F0F4F9;
} }
@ -1065,6 +1077,7 @@ onUnload(() => {
justify-content: center; justify-content: center;
margin-top: 40rpx; margin-top: 40rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
padding-bottom: 20px;
} }
.vision-text { .vision-text {

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_message" /> <watermark dark="light" source="uni_alipay_other_message" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_message')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_message')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view :class="`${data.phone}-style`"> <view :class="`${data.phone}-style`">
@ -619,7 +619,7 @@ onLoad((options) => {
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
if (data.phone == 'oppo') { if (data.phone == 'oppo') {
util.setAndroidSystemBarColor('#FAFAFA') util.setAndroidSystemBarColor('#FAFAFA')
} else { } else {

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_message" /> <watermark dark="light" source="uni_alipay_other_message" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_message')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_message')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view> <view>
@ -22,7 +22,7 @@
@edit-item="editItem"> @edit-item="editItem">
</MessageList> </MessageList>
</MessageNavBar> </MessageNavBar>
<ZdySafeBottom v-if="data.phone!='oppo'&&data.phone!='xiaomi'" bgColor="#fff"/>
<!-- 添加短信弹窗 --> <!-- 添加短信弹窗 -->
<view v-if="showAddPopup" class="add-mask" @tap="closeAddPopup"> <view v-if="showAddPopup" class="add-mask" @tap="closeAddPopup">
<view class="add-popup" @tap.stop> <view class="add-popup" @tap.stop>
@ -136,6 +136,8 @@
<script setup> <script setup>
import MessageNavBar from '@/components/message/list/message-nav-bar.vue' import MessageNavBar from '@/components/message/list/message-nav-bar.vue'
import MessageList from '@/components/message/list/list.vue' import MessageList from '@/components/message/list/list.vue'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import defaultData from './defaultData.json' import defaultData from './defaultData.json'
import { import {
ref, ref,
@ -194,7 +196,7 @@ onLoad((options) => {
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
if (data.phone == 'oppo') { if (data.phone == 'oppo') {
util.setAndroidSystemBarColor('#FAFAFA') util.setAndroidSystemBarColor('#FAFAFA')
} else { } else {

View File

@ -1,4 +1,4 @@
<template> <template>
<view> <view>
<!-- Custom Nav Bar --> <!-- Custom Nav Bar -->
<view class="custom-nav-bar" :class="{ 'android-nav': isAndroid }"> <view class="custom-nav-bar" :class="{ 'android-nav': isAndroid }">
@ -56,13 +56,14 @@
</view> </view>
</view> </view>
</view> </view>
<ZdySafeBottom bgColor="#f0f3f8"/>
</view> </view>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_shopping_about_iphone" /> <watermark dark="light" source="uni_alipay_shopping_about_iphone" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_about_iphone')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_about_iphone')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>
@ -73,6 +74,7 @@ import { util } from '@/utils/common.js'
import { onShow, onLoad, onPageScroll } from '@dcloudio/uni-app' import { onShow, onLoad, onPageScroll } from '@dcloudio/uni-app'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const CACHE_KEY = 'about_iphone_data'; const CACHE_KEY = 'about_iphone_data';
// Removed scroll logic, styling is now fully CSS-driven // Removed scroll logic, styling is now fully CSS-driven
@ -146,7 +148,7 @@ const statusBarHeight = ref(0);
const isAndroid = ref(false); const isAndroid = ref(false);
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#F2F1F6') util.setAndroidSystemBarColor('#F2F1F6')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");

View File

@ -4,7 +4,7 @@
<watermark dark="light" source="uni_alipay_other_airTickets_ctrip" /> <watermark dark="light" source="uni_alipay_other_airTickets_ctrip" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_airTickets_ctrip')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_airTickets_ctrip')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="codefun-flex-col page" :style="{ '--font-weight-bold': $system == 'iOS' ? 500 : 700 }"> <view class="codefun-flex-col page" :style="{ '--font-weight-bold': $system == 'iOS' ? 500 : 700 }">
@ -309,8 +309,8 @@
<image class="image_19 pos_15" src="/static/image/other/air-tickets/ctrip-air/connect-icon.png" /> <image class="image_19 pos_15" src="/static/image/other/air-tickets/ctrip-air/connect-icon.png" />
</view> </view>
</view> </view>
<view class="codefun-flex-col codefun-mt-8"> <view class="codefun-flex-col codefun-mt-8" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="codefun-flex-col section_12"> <view class="codefun-flex-col section_12" >
<text class="codefun-self-start font_6 text_52">出行服务</text> <text class="codefun-self-start font_6 text_52">出行服务</text>
<view class="codefun-self-stretch grid_2 mt-19"> <view class="codefun-self-stretch grid_2 mt-19">
<view class="codefun-flex-col codefun-items-center grid-item_4"> <view class="codefun-flex-col codefun-items-center grid-item_4">
@ -344,7 +344,7 @@
<text class="font_8 text_54">更多服务</text> <text class="font_8 text_54">更多服务</text>
<image class="image_11 codefun-ml-6" src="/static/image/other/air-tickets/ctrip-air/more.png" /> <image class="image_11 codefun-ml-6" src="/static/image/other/air-tickets/ctrip-air/more.png" />
</view> </view>
<view class="codefun-flex-col codefun-justify-start section_14"> <view class="codefun-flex-col codefun-justify-start section_14" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="codefun-flex-row equal-division_3"> <view class="codefun-flex-row equal-division_3">
<view <view
class="codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_5 text-wrapper_1"> class="codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_5 text-wrapper_1">
@ -373,6 +373,8 @@ import { util } from '@/utils/common.js';
import defualtData from '@/pages/other/air-tickets/commom/defualt.json'; import defualtData from '@/pages/other/air-tickets/commom/defualt.json';
import airlineJson from '@/static/json/air-line.json'; import airlineJson from '@/static/json/air-line.json';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const buttonGroup = [{ const buttonGroup = [{
name: "编辑机票信息", name: "编辑机票信息",
click: () => { click: () => {
@ -426,7 +428,7 @@ onShow(() => {
if (stored) { if (stored) {
Object.assign(data.airTicketsInfo, stored); Object.assign(data.airTicketsInfo, stored);
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");

View File

@ -4,7 +4,7 @@
<watermark dark="light" source="uni_alipay_other_airTickets_fliggy" /> <watermark dark="light" source="uni_alipay_other_airTickets_fliggy" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_airTickets_fliggy')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_airTickets_fliggy')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="page-container"> <view class="page-container">
@ -279,10 +279,13 @@
<!-- Note: User image shows floating bottom bar but cut off. Assuming standard action buttons --> <!-- Note: User image shows floating bottom bar but cut off. Assuming standard action buttons -->
</view> </view>
<view class="safe-area-inset-bottom"></view> <!-- Spacer --> <view class="safe-area-inset-bottom"></view> <!-- Spacer -->
<view class="" :style="{'height':$store.state.safeBottomAz+'px'}">
</view>
</scroll-view> </scroll-view>
<view class="footer-bar"> <view class="footer-bar">
<view class="flex flex-justify-between"> <view class="flex flex-justify-between" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="flex-1 flex flex-align-center flex-justify-center"> <view class="flex-1 flex flex-align-center flex-justify-center">
<image class="footer-icon" src="/static/image/other/air-tickets/fliggy-air/zhibo.png" /> <image class="footer-icon" src="/static/image/other/air-tickets/fliggy-air/zhibo.png" />
<text class="text">联系飞猪</text> <text class="text">联系飞猪</text>
@ -392,7 +395,7 @@ onShow(() => {
const mergedData = deepMerge(baseData, stored); const mergedData = deepMerge(baseData, stored);
Object.assign(data.airTickrtInfo, mergedData); Object.assign(data.airTickrtInfo, mergedData);
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");

View File

@ -4,7 +4,7 @@
<watermark dark="light" source="uni_alipay_other_airTickets_qunar" /> <watermark dark="light" source="uni_alipay_other_airTickets_qunar" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_airTickets_qunar')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_airTickets_qunar')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="page-container"> <view class="page-container">
@ -334,16 +334,19 @@
</view> </view>
<!-- Branding --> <!-- Branding -->
<view class="branding-area"> <view class="branding-area" >
<image class="image" src="/static/image/other/air-tickets/qunar/branding-area-image.png" <image class="image" src="/static/image/other/air-tickets/qunar/branding-area-image.png"
mode="widthFix"> mode="widthFix">
</image> </image>
</view> </view>
<view class="" :style="{'height':$store.state.safeBottomAz+'px'}">
</view>
</view> </view>
</view> </view>
<!-- Bottom Fixed --> <!-- Bottom Fixed -->
<view class="bottom-bar"> <view class="bottom-bar" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<button class="invoice-btn">开具发票</button> <button class="invoice-btn">开具发票</button>
</view> </view>
</view> </view>
@ -404,7 +407,7 @@ onShow(() => {
Object.assign(data.ticketData, stored); Object.assign(data.ticketData, stored);
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");

View File

@ -3,7 +3,7 @@
<view v-if="$isVip() && !selectedImage"> <view v-if="$isVip() && !selectedImage">
<watermark dark="light" source="uni_alipay_other_bank" /> <watermark dark="light" source="uni_alipay_other_bank" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="group_45764" v-if="!selectedImage" :style="{'padding-top':$systemInfo.statusBarHeight+'px'}"> <view class="group_45764" v-if="!selectedImage" :style="{'padding-top':$systemInfo.statusBarHeight+'px'}">
@ -185,7 +185,7 @@
</view> </view>
<image class="dee351fc65540488ca79ac78c10072f2" src="/static/image/other/bank/gsyh/bottomImg.png" /> <image class="dee351fc65540488ca79ac78c10072f2" src="/static/image/other/bank/gsyh/bottomImg.png" />
<view class="footer"></view> <view class="footer"></view>
<ZdySafeBottom bg-color="#fff"/>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<view v-if="editDialog.show" class="editDialog"> <view v-if="editDialog.show" class="editDialog">
<view class="editDialog_bg"> <view class="editDialog_bg">
@ -294,6 +294,7 @@
import { reactive, onMounted, ref, getCurrentInstance } from 'vue'; import { reactive, onMounted, ref, getCurrentInstance } from 'vue';
import NavBar from '@/components/nav-bar/nav-bar' import NavBar from '@/components/nav-bar/nav-bar'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const instance = getCurrentInstance(); const instance = getCurrentInstance();
const CACHE_KEY = 'gsyh_account_info'; const CACHE_KEY = 'gsyh_account_info';
const BANNER_IMAGE_KEY = 'gsyh_banner_image'; const BANNER_IMAGE_KEY = 'gsyh_banner_image';

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_bank" /> <watermark dark="light" source="uni_alipay_other_bank" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<NavBar v-if="selectedImage" title="拼图" bgColor="#EFEFEF" noBack @back="closeImageEdit" isRightButton <NavBar v-if="selectedImage" title="拼图" bgColor="#EFEFEF" noBack @back="closeImageEdit" isRightButton
@ -128,6 +128,7 @@
</view> </view>
<Home class="home" /> <Home class="home" />
<ZdySafeBottom bgColor="#f8f8f8"/>
<!-- 卡号信息弹窗 --> <!-- 卡号信息弹窗 -->
<view class="dask" v-if="data.isShow"> <view class="dask" v-if="data.isShow">
<view class="info"> <view class="info">
@ -221,6 +222,7 @@
</template> </template>
<script setup> <script setup>
import { imgLocal } from '@/utils/common.js'; import { imgLocal } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
reactive, reactive,
onMounted, onMounted,

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_bank" /> <watermark dark="light" source="uni_alipay_other_bank" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="flexcontainer"> <view class="flexcontainer">
@ -98,6 +98,7 @@
</view> </view>
</view> </view>
</view> </view>
<ZdySafeBottom bgColor="#f7f7f7"/>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<view v-if="editDialog.show" class="editDialog"> <view v-if="editDialog.show" class="editDialog">
@ -181,6 +182,7 @@
} from 'vue'; } from 'vue';
const CACHE_KEY = 'nyyh_account_info'; const CACHE_KEY = 'nyyh_account_info';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const data = reactive({ const data = reactive({
form: { form: {
@ -358,7 +360,6 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
z-index: 0;
// margin-top: -86rpx; // margin-top: -86rpx;
margin-left: 0; margin-left: 0;
background-color: $color-white; background-color: $color-white;
@ -1184,6 +1185,8 @@
left: 0; left: 0;
top: 0; top: 0;
width: 750rpx; width: 750rpx;
z-index: 99;
} }
.header { .header {
display: flex; display: flex;
@ -1191,7 +1194,7 @@
width: 750rpx; width: 750rpx;
height: 96rpx; height: 96rpx;
justify-content: space-between; justify-content: space-between;
background-color: #fff;
image { image {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_bank" /> <watermark dark="light" source="uni_alipay_other_bank" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_bank')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="flexcontainer"> <view class="flexcontainer">
@ -170,7 +170,9 @@
</view> </view>
<canvas canvas-id="crop-canvas" <canvas canvas-id="crop-canvas"
style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas> style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas>
<ZdySafeBottom bgColor="#f8f8f8"/>
</view> </view>
<view v-if="editDialog.show" class="editDialog"> <view v-if="editDialog.show" class="editDialog">
<view class="editDialog_bg"> <view class="editDialog_bg">
<view class="editDialog_header"> <view class="editDialog_header">
@ -258,6 +260,7 @@
<script setup> <script setup>
import { imgLocal } from '@/utils/common.js'; import { imgLocal } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
ref, ref,
reactive, reactive,

View File

@ -12,12 +12,14 @@
<view class="button-container"> <view class="button-container">
<button class="btn-save-image" @click="saveImage">保存图片</button> <button class="btn-save-image" @click="saveImage">保存图片</button>
</view> </view>
<view style="width: 0px;height: 0;overflow: hidden;" v-if="data.shuaxing"> <view style="width: 0px;height: 0;overflow: hidden;" v-if="data.shuaxing && data.bgImg">
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress"
:css="`width:${data.width}px;height:${data.height }px;background-color:#fff;`"> :css="`width:${data.width}px;height:${data.height }px;background-color:#fff;`">
<l-painter-view <l-painter-view
:css="`margin-top:109px;margin-left:75px;position: relative;width:666px;height:406px;background-image: url('${data.bgImg}');background-size:6660px 406px;`"> :css="`margin-top:109px;margin-left:75px;position: relative;width:666px;height:406px;`">
<!-- 头部年月 --> <!-- 背景图 image 替代 background-image避免鸿蒙本地路径不生效 -->
<l-painter-image :src="data.bgImg" css="width:666px;height:406px;position:absolute;left:0;top:0;object-fit:fill;" />
<!-- 姓名 -->
<l-painter-view :css="`position: absolute;left:122px;top:54px;`"> <l-painter-view :css="`position: absolute;left:122px;top:54px;`">
<l-painter-text :css="data.textCss+data.textCssLeft" :text="data.form.name" /> <l-painter-text :css="data.textCss+data.textCssLeft" :text="data.form.name" />
</l-painter-view> </l-painter-view>
@ -27,25 +29,36 @@
<l-painter-view :css="`position: absolute;left:262px;top:102px;`"> <l-painter-view :css="`position: absolute;left:262px;top:102px;`">
<l-painter-text :css="data.textCss2+data.textCssLeft" :text="data.form.nation" /> <l-painter-text :css="data.textCss2+data.textCssLeft" :text="data.form.nation" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:122px;top:152px;`"> <!-- 出生年逐字绝对定位避免鸿蒙下多 text 竖排/重叠 -->
<l-painter-text v-for="(item,index) in data.form.year.toString()" :css="data.textCss3+data.textCssLeft" <l-painter-text
:text="item" :key="index" /> v-for="(item, index) in String(data.form.year)"
:key="'year-' + index"
:css="data.textCssDigit + `position:absolute;left:${122 + index * 18}px;top:152px;`"
:text="item"
/>
<!-- / -->
<l-painter-view :css="`position: absolute;left:216px;top:152px;`">
<l-painter-text :css="data.textCssMonthDay" :text="String(data.form.month)" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:192px;top:152px;`"> <l-painter-view :css="`position: absolute;left:278px;top:152px;`">
<l-painter-text :css="data.textCss2+data.textCssCenter" :text="data.form.month.toString()" /> <l-painter-text :css="data.textCssMonthDay" :text="String(data.form.day)" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:254px;top:152px;`"> <!-- 住址 -->
<l-painter-text :css="data.textCss2+data.textCssCenter" :text="data.form.day.toString()" /> <l-painter-text
</l-painter-view> v-for="(item, index) in addressChars"
<l-painter-view :css="`position: absolute;left:122px;top:200px;width:274px;`"> :key="'addr-' + index"
<l-painter-text v-for="(item,index) in data.form.address" :css="data.textCss3+data.textCssLeft" :text="item" :css="data.textCssDigit + `position:absolute;left:${item.left}px;top:${item.top}px;`"
:key="index" /> :text="item.text"
</l-painter-view> />
<l-painter-view :css="`position: absolute;left:223px;top:322px;`"> <!-- 身份证号 -->
<l-painter-text v-for="(item,index) in data.form.idNumber" :css="data.textCss4+data.textCssLeft" :text="item" <l-painter-text
:key="index" /> v-for="(item, index) in String(data.form.idNumber || '')"
</l-painter-view> :key="'id-' + index"
<l-painter-view :css="`position: absolute;right:48px;top:62px;`"> :css="data.textCssId + `position:absolute;left:${223 + index * 20}px;top:322px;`"
:text="item"
/>
<!-- 照片right 在鸿蒙易失效改为 left -->
<l-painter-view :css="`position: absolute;left:422px;top:62px;`">
<l-painter-image v-if="data.form.photo" :src="data.form.photo" css="width: 196px; height: 230px;" /> <l-painter-image v-if="data.form.photo" :src="data.form.photo" css="width: 196px; height: 230px;" />
<l-painter-view v-else css="width: 196px; height: 230px;background-color:#fff;"> <l-painter-view v-else css="width: 196px; height: 230px;background-color:#fff;">
</l-painter-view> </l-painter-view>
@ -114,7 +127,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_card')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_card')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</view> </view>
@ -128,6 +141,7 @@ import { imgLocal } from '@/utils/common.js';
import { import {
ref, ref,
reactive, reactive,
computed,
watch, watch,
nextTick, nextTick,
getCurrentInstance getCurrentInstance
@ -145,7 +159,7 @@ import { imgLocal } from '@/utils/common.js';
proxy proxy
} = getCurrentInstance(); } = getCurrentInstance();
const data = reactive({ const data = reactive({
shuaxing:true, shuaxing: false,
navbar: { navbar: {
title: "身份证", title: "身份证",
bgColor: '#EDEDED', bgColor: '#EDEDED',
@ -153,7 +167,7 @@ import { imgLocal } from '@/utils/common.js';
width: 800, width: 800,
height: 600, height: 600,
code: '', code: '',
bgImg:'', bgImg: '',
form: { form: {
name: '某某', name: '某某',
gender: '男', gender: '男',
@ -165,23 +179,70 @@ import { imgLocal } from '@/utils/common.js';
idNumber: '110000200001010000', idNumber: '110000200001010000',
photo: '', photo: '',
}, },
textCss: 'word-spacing: 20px;font-family: "SimHei", "Microsoft YaHei", sans-serif;width:100px;color:#3D3D3D;font-size:24px; mix-blend-mode: overlay;', textCss: 'font-family: "SimHei", "Microsoft YaHei", sans-serif;width:100px;color:#3D3D3D;font-size:24px;',
textCss2: 'word-spacing: 20px;font-family: "SimHei", "Microsoft YaHei", sans-serif;width:100px;text-align: left;color:#3D3D3D;font-size:22px;mix-blend-mode: overlay;', textCss2: 'font-family: "SimHei", "Microsoft YaHei", sans-serif;width:100px;text-align: left;color:#3D3D3D;font-size:22px;',
textCss3: 'word-spacing: 20px;letter-spacing: 10px;margin-right:2px;font-family: "SimHei", "Microsoft YaHei", sans-serif;text-align: left;color:#3D3D3D;font-size:22px;mix-blend-mode: overlay;', // ///
textCss4: 'word-spacing: 20px;margin-right:3px;letter-spacing: 10px;font-family: "card", "Microsoft YaHei", sans-serif;text-align: left;color:#1a1a1a;font-size:28px;mix-blend-mode: overlay;display:flex;', textCssDigit: 'font-family: "SimHei", "Microsoft YaHei", sans-serif;width:22px;color:#3D3D3D;font-size:22px;',
textCssMonthDay: 'font-family: "SimHei", "Microsoft YaHei", sans-serif;width:40px;text-align:center;color:#3D3D3D;font-size:22px;',
//
textCssId: 'font-family: "card", "Microsoft YaHei", sans-serif;width:22px;color:#1a1a1a;font-size:28px;',
textCssLeft: 'text-align: left;', textCssLeft: 'text-align: left;',
textCssCenter: 'text-align: center;' textCssCenter: 'text-align: center;'
}) })
/** 住址逐字坐标(固定字宽换行,避免鸿蒙流式布局异常) */
const addressChars = computed(() => {
const chars = String(data.form.address || '').split('')
const startLeft = 122
const startTop = 200
const step = 26
const lineHeight = 32
const perLine = 10
return chars.map((text, index) => ({
text,
left: startLeft + (index % perLine) * step,
top: startTop + Math.floor(index / perLine) * lineHeight
}))
})
function loadCardFont() {
return new Promise((resolve) => {
uni.loadFontFace({
family: 'card',
source: 'url("/static/font/card.ttf")',
success: () => resolve(true),
fail: (err) => {
console.warn('身份证号码字体加载失败', err)
resolve(false)
}
})
})
}
async function loadCardBg() {
try {
const localPath = await imgLocal.getLocalImage('other/card/cardBGImg.png')
return localPath || ''
} catch (e) {
console.error('身份证背景图加载失败', e)
return ''
}
}
// //
const showEditPopup = ref(false); const showEditPopup = ref(false);
const editForm = ref({}); const editForm = ref({});
onLoad(async(option) => { onLoad(async(option) => {
data.bgImg= await imgLocal.getLocalImage('other/card/cardBGImg.png');
uni.showLoading({ uni.showLoading({
title: "生成中" title: "生成中"
}) })
await loadCardFont()
data.bgImg = await loadCardBg()
data.shuaxing = !!data.bgImg
if (!data.bgImg) {
uni.hideLoading()
uni.showToast({ title: '背景图加载失败', icon: 'none' })
}
// //
proxy.$apiUserEvent('all', { proxy.$apiUserEvent('all', {
type: 'event', type: 'event',
@ -288,6 +349,7 @@ import { imgLocal } from '@/utils/common.js';
*/ */
function convertLocalImageToFile(localPath) { function convertLocalImageToFile(localPath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// #ifdef APP-PLUS&&!APP-HARMONY
// 1. Base64 Image // 1. Base64 Image
plus.io.resolveLocalFileSystemURL(localPath, (entry) => { plus.io.resolveLocalFileSystemURL(localPath, (entry) => {
entry.file((file) => { entry.file((file) => {
@ -300,7 +362,10 @@ import { imgLocal } from '@/utils/common.js';
reader.readAsDataURL(file); // DataURL reader.readAsDataURL(file); // DataURL
}, reject); }, reject);
}, reject); }, reject);
// #endif
// #ifndef APP-PLUS
reject(new Error('plus.io not supported'))
// #endif
}); });
} }
// //

View File

@ -3,8 +3,8 @@
<!-- 自定义头部导航栏 --> <!-- 自定义头部导航栏 -->
<ZdyNavbar @right-click="edit" isRightButton rightButtonText="编辑" :title="data.navbar.title" <ZdyNavbar @right-click="edit" isRightButton rightButtonText="编辑" :title="data.navbar.title"
:bgColor="data.navbar.bgColor" :isBack="true" /> :bgColor="data.navbar.bgColor" :isBack="true" />
<view class="footer-box" v-if="data.typeList.length>1"> <view class="footer-box" v-if="data.typeList.length>1" >
<view class="btn" v-for="(item, index) in data.typeList" :key="index" :class="{ active: data.type == getType(index) }" <view class="btn" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}" v-for="(item, index) in data.typeList" :key="index" :class="{ active: data.type == getType(index) }"
@click="setType(index)"> @click="setType(index)">
{{ item }} {{ item }}
</view> </view>
@ -20,9 +20,10 @@
</view> </view>
<view style="width: 0px;height: 0;overflow: hidden;" v-if="data.shuaxing"> <view style="width: 0px;height: 0;overflow: hidden;" v-if="data.shuaxing">
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:250px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:250px;"
v-if="data.type == 0"> v-if="data.type == 0 && data.bgImg1">
<l-painter-view <l-painter-view
:css="`width:351px;height:250px;background-image: url('${data.bgImg1}');position: relative;`"> :css="`width:351px;height:250px;position: relative;`">
<l-painter-image :src="data.bgImg1" css="width:351px;height:250px;position:absolute;left:0;top:0;object-fit:fill;" />
<!-- 标题 --> <!-- 标题 -->
<l-painter-view :css="`position: absolute;left:${data.graduate.type == 0 ? 46 : 85}px;top:67px;`"> <l-painter-view :css="`position: absolute;left:${data.graduate.type == 0 ? 46 : 85}px;top:67px;`">
<l-painter-image :src="data.graduate.title" <l-painter-image :src="data.graduate.title"
@ -88,9 +89,10 @@
</l-painter-view> </l-painter-view>
</l-painter> </l-painter>
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:262px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:262px;"
v-else-if="data.type == 1"> v-else-if="data.type == 1 && data.bgImg2">
<l-painter-view <l-painter-view
:css="`width:351px;height:262px;background-image: url('${data.bgImg2}');position: relative;`"> :css="`width:351px;height:262px;position: relative;`">
<l-painter-image :src="data.bgImg2" css="width:351px;height:262px;position:absolute;left:0;top:0;object-fit:fill;" />
<l-painter-view :css="`position: absolute;right:126px;bottom:113px;`"> <l-painter-view :css="`position: absolute;right:126px;bottom:113px;`">
<l-painter-text :css="data.textCss2 + 'text-align: right;color:#838383;'" :text="data.graduate.name" /> <l-painter-text :css="data.textCss2 + 'text-align: right;color:#838383;'" :text="data.graduate.name" />
</l-painter-view> </l-painter-view>
@ -102,34 +104,37 @@
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:350px;height:552px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:350px;height:552px;"
v-else-if="data.type == 2"> v-else-if="data.type == 2">
<l-painter-view <l-painter-view
:css="`width:350px;height:552px;background-image: url('/static/image/other/certificate/couple/bgImage.png');position: relative;`"> :css="`width:350px;height:552px;position: relative;`">
<l-painter-view :css="`position: absolute;left:39px;top:123px;display: flex;align-items: center;`"> <l-painter-image src="/static/image/other/certificate/couple/bgImage.png"
<l-painter-text :css="data.textCss3" :text="data.graduate.name" /> css="width:350px;height:552px;position:absolute;left:0;top:0;object-fit:fill;" />
<l-painter-image src="/static/image/other/certificate/couple/love.png" <!-- 持证人绝对定位避免鸿蒙 flex 错位 -->
css="width: 10px;height: 9px;margin: 0 5px;" /> <l-painter-text :css="data.textCssCouple + `position:absolute;left:39px;top:123px;`"
<l-painter-text :css="data.textCss3" :text="data.graduate.name2" /> :text="data.graduate.name" />
<l-painter-image src="/static/image/other/certificate/couple/love.png"
:css="`position:absolute;left:${coupleHolder.iconLeft}px;top:125px;width:10px;height:9px;`" />
<l-painter-text :css="data.textCssCouple + `position:absolute;left:${coupleHolder.name2Left}px;top:123px;`"
:text="data.graduate.name2" />
<l-painter-view :css="`position: absolute;left:39px;top:175px;`">
<l-painter-text :css="data.textCssCouple" :text="data.graduate.time" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:39px;top:175px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:39px;top:224px;width:180px;`">
<l-painter-text :css="data.textCss3" :text="data.graduate.time" /> <l-painter-text :css="data.textCssCouple + 'width:180px;'" :text="data.graduate.dec" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:39px;top:224px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:33px;bottom:45px;`">
<l-painter-text :css="data.textCss3 + 'width: 180px;'" :text="data.graduate.dec" /> <l-painter-text :css="data.textCssCouple" :text="'发证时间: ' + data.graduate.time" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:33px;bottom:45px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:33px;bottom:27px;`">
<l-painter-text :css="data.textCss3 + 'width: 180px;'" :text="'发证时间: ' + data.graduate.time" /> <l-painter-text :css="data.textCssCouple"
</l-painter-view>
<l-painter-view :css="`position: absolute;left:33px;bottom:27px;display: flex;align-items: center;`">
<l-painter-text :css="data.textCss3 + 'width: 180px;'"
:text="`发证单位: ${$isVip() ? '装样大师恋爱委员会' : '幸福恋爱委员会'}`" /> :text="`发证单位: ${$isVip() ? '装样大师恋爱委员会' : '幸福恋爱委员会'}`" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;right:34px;top:93px;`"> <l-painter-view :css="`position: absolute;left:156px;top:93px;`">
<l-painter-image :src="data.graduate.image" css="width: 160px;height: 110px;" /> <l-painter-image :src="data.graduate.image" css="width: 160px;height: 110px;" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;right:19px;top:181px;`"> <l-painter-view :css="`position: absolute;left:227px;top:181px;`">
<l-painter-image :src="`/static/image/other/certificate/couple/${$isVip() ? 'icon1' : 'icon2'}.png`" <l-painter-image :src="`/static/image/other/certificate/couple/${$isVip() ? 'icon1' : 'icon2'}.png`"
css="width: 104px;height: 92px;" /> css="width: 104px;height: 92px;" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;right:55px;bottom:21px;`"> <l-painter-view :css="`position: absolute;left:251px;bottom:21px;`">
<l-painter-qrcode text="http://u8t.cn/QJ?sc=DpK" image="/static/image/other/certificate/couple/image.png" <l-painter-qrcode text="http://u8t.cn/QJ?sc=DpK" image="/static/image/other/certificate/couple/image.png"
css="width: 44px; height: 44px" /> css="width: 44px; height: 44px" />
</l-painter-view> </l-painter-view>
@ -141,38 +146,41 @@
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:350px;height:552px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:350px;height:552px;"
v-else-if="data.type == 3"> v-else-if="data.type == 3">
<l-painter-view <l-painter-view
:css="`width:350px;height:552px;background-image: url('/static/image/other/certificate/couple/bgImage2.png');position: relative;`"> :css="`width:350px;height:552px;position: relative;`">
<l-painter-view :css="`position: absolute;left:39px;top:123px;display: flex;align-items: center;`"> <l-painter-image src="/static/image/other/certificate/couple/bgImage2.png"
<l-painter-text :css="data.textCss3" :text="data.graduate.name" /> css="width:350px;height:552px;position:absolute;left:0;top:0;object-fit:fill;" />
<l-painter-image src="/static/image/other/certificate/couple/noLove.png" <!-- 持证人 -->
css="width: 10px;height: 9px;margin: 0 5px;" /> <l-painter-text :css="data.textCssCouple + `position:absolute;left:39px;top:123px;`"
<l-painter-text :css="data.textCss3" :text="data.graduate.name2" /> :text="data.graduate.name" />
<l-painter-image src="/static/image/other/certificate/couple/noLove.png"
:css="`position:absolute;left:${coupleHolder.iconLeft}px;top:125px;width:10px;height:9px;`" />
<l-painter-text :css="data.textCssCouple + `position:absolute;left:${coupleHolder.name2Left}px;top:123px;`"
:text="data.graduate.name2" />
<l-painter-view :css="`position: absolute;left:39px;top:175px;`">
<l-painter-text :css="data.textCssCouple" :text="data.graduate.time" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:39px;top:175px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:39px;top:224px;width:180px;`">
<l-painter-text :css="data.textCss3" :text="data.graduate.time" /> <l-painter-text :css="data.textCssCouple + 'width:180px;'" :text="data.graduate.dec" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:39px;top:224px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:33px;bottom:45px;`">
<l-painter-text :css="data.textCss3 + 'width: 180px;'" :text="data.graduate.dec" /> <l-painter-text :css="data.textCssCouple" :text="'发证时间: ' + data.graduate.time" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:33px;bottom:45px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:33px;bottom:27px;`">
<l-painter-text :css="data.textCss3 + 'width: 180px;'" :text="'发证时间: ' + data.graduate.time" /> <l-painter-text :css="data.textCssCouple"
</l-painter-view>
<l-painter-view :css="`position: absolute;left:33px;bottom:27px;display: flex;align-items: center;`">
<l-painter-text :css="data.textCss3 + 'width: 180px;'"
:text="`发证单位: ${$isVip() ? '装样大师分手委员会' : '分手快乐委员会'}`" /> :text="`发证单位: ${$isVip() ? '装样大师分手委员会' : '分手快乐委员会'}`" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;right:34px;top:93px;`"> <l-painter-view :css="`position: absolute;left:156px;top:93px;`">
<l-painter-image :src="data.graduate.image" css="width: 160px;height: 110px;" /> <l-painter-image :src="data.graduate.image" css="width: 160px;height: 110px;" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;right:34px;top:93px;`"> <l-painter-view :css="`position: absolute;left:156px;top:93px;`">
<l-painter-image src="/static/image/other/certificate/couple/imageDask.png" <l-painter-image src="/static/image/other/certificate/couple/imageDask.png"
css="width: 160px;height: 110px;" /> css="width: 160px;height: 110px;" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;right:19px;top:181px;`"> <l-painter-view :css="`position: absolute;left:227px;top:181px;`">
<l-painter-image :src="`/static/image/other/certificate/couple/${$isVip() ? 'icon1' : 'icon2'}2.png`" <l-painter-image :src="`/static/image/other/certificate/couple/${$isVip() ? 'icon1' : 'icon2'}2.png`"
css="width: 104px;height: 92px;" /> css="width: 104px;height: 92px;" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;right:55px;bottom:21px;`"> <l-painter-view :css="`position: absolute;left:251px;bottom:21px;`">
<l-painter-qrcode text="http://u8t.cn/QJ?sc=DpK" image="/static/image/other/certificate/couple/image.png" <l-painter-qrcode text="http://u8t.cn/QJ?sc=DpK" image="/static/image/other/certificate/couple/image.png"
css="width: 44px; height: 44px" /> css="width: 44px; height: 44px" />
</l-painter-view> </l-painter-view>
@ -231,24 +239,26 @@
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:248px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:248px;"
v-else-if="data.type == 6"> v-else-if="data.type == 6">
<l-painter-view <l-painter-view
:css="`width:351px;height:248px;background-image: url('/static/image/other/certificate/god/bgImg.png');position: relative;`"> :css="`width:351px;height:248px;position: relative;`">
<l-painter-view :css="`position: absolute;left:74px;top:181px;display: flex;align-items: center;`"> <l-painter-image src="/static/image/other/certificate/god/bgImg.png"
css="width:351px;height:248px;position:absolute;left:0;top:0;object-fit:fill;" />
<l-painter-view :css="`position: absolute;left:74px;top:181px;`">
<l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.name" /> <l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.name" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:74px;top:204px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:74px;top:204px;`">
<l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.age" /> <l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.age" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:161px;top:44px;display: flex;align-items: center;`"> <!-- 兹证明手动换行鸿蒙下 width 自动折行不生效 -->
<l-painter-text :css="data.textCss6 +'width:166px;font-size:11px;'" <l-painter-view :css="`position: absolute;left:161px;top:44px;width:166px;`">
:text="' 兹证明 '+data.graduate.name+' 同志,肤白兹证明貌美,聪颖过人,身材窃窕,婉约温柔,沉鱼落雁,闭月羞花,迷倒一群高富帅,人称“女神”,通过外貌协会权威认证,特发此证。'" /> <l-painter-text :css="data.textCssGodBody" :text="goddessCertText" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:211px;top:171px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:211px;top:171px;`">
<l-painter-text :css="data.textCss6 " :text="data.graduate.time1" /> <l-painter-text :css="data.textCss6 " :text="data.graduate.time1" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:211px;top:190px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:211px;top:190px;`">
<l-painter-text :css="data.textCss6 " :text="data.graduate.time2" /> <l-painter-text :css="data.textCss6 " :text="data.graduate.time2" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:211px;top:208px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:211px;top:208px;`">
<l-painter-text :css="data.textCss6 " :text="'装样大师颜值委员会'" /> <l-painter-text :css="data.textCss6 " :text="'装样大师颜值委员会'" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:60px;top:84px;`"> <l-painter-view :css="`position: absolute;left:60px;top:84px;`">
@ -262,24 +272,25 @@
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:248px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:248px;"
v-else-if="data.type == 7"> v-else-if="data.type == 7">
<l-painter-view <l-painter-view
:css="`width:351px;height:248px;background-image: url('/static/image/other/certificate/god/bgImg2.png');position: relative;`"> :css="`width:351px;height:248px;position: relative;`">
<l-painter-view :css="`position: absolute;left:74px;top:181px;display: flex;align-items: center;`"> <l-painter-image src="/static/image/other/certificate/god/bgImg2.png"
css="width:351px;height:248px;position:absolute;left:0;top:0;object-fit:fill;" />
<l-painter-view :css="`position: absolute;left:74px;top:181px;`">
<l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.name" /> <l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.name" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:74px;top:204px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:74px;top:204px;`">
<l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.age" /> <l-painter-text :css="data.textCss6 +'width:60px;text-align:center;'" :text="data.graduate.age" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:161px;top:44px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:161px;top:44px;width:166px;`">
<l-painter-text :css="data.textCss6 +'width:166px;font-size:11px;'" <l-painter-text :css="data.textCssGodBody" :text="godCertText" />
:text="' 兹证明 '+data.graduate.name+'同志,肤若凝脂,气宇轩昂,聪慧果敢,身形挺拔,温润如玉,才貌双全,迷倒万千少女心,人称“男神”,经颜值与气质协会权威认证,特发此证。'" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:211px;top:171px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:211px;top:171px;`">
<l-painter-text :css="data.textCss6 " :text="data.graduate.time1" /> <l-painter-text :css="data.textCss6 " :text="data.graduate.time1" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:211px;top:190px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:211px;top:190px;`">
<l-painter-text :css="data.textCss6 " :text="data.graduate.time2" /> <l-painter-text :css="data.textCss6 " :text="data.graduate.time2" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:211px;top:208px;display: flex;align-items: center;`"> <l-painter-view :css="`position: absolute;left:211px;top:208px;`">
<l-painter-text :css="data.textCss6 " :text="'装样大师颜值委员会'" /> <l-painter-text :css="data.textCss6 " :text="'装样大师颜值委员会'" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;left:60px;top:84px;`"> <l-painter-view :css="`position: absolute;left:60px;top:84px;`">
@ -530,7 +541,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_certificate')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_certificate')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</view> </view>
@ -544,6 +555,7 @@
import { import {
ref, ref,
reactive, reactive,
computed,
watch, watch,
nextTick, nextTick,
getCurrentInstance getCurrentInstance
@ -588,7 +600,7 @@
"value": 1, "value": 1,
"text": "清华大学" "text": "清华大学"
}], }],
shuaxing: true, shuaxing: false,
navbar: { navbar: {
title: "证书", title: "证书",
bgColor: '#EDEDED', bgColor: '#EDEDED',
@ -600,9 +612,12 @@
textCssRight: 'word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;font-family: "SimSun", "宋体", sans-serif;width:100px;color:#3D3D3D;font-size:5px; mix-blend-mode: overlay;', textCssRight: 'word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;font-family: "SimSun", "宋体", sans-serif;width:100px;color:#3D3D3D;font-size:5px; mix-blend-mode: overlay;',
textCss2: 'word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;font-family: "宋体", sans-serif;width:100px;color:#3D3D3D;font-size:5.2px; mix-blend-mode: overlay;', textCss2: 'word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;font-family: "宋体", sans-serif;width:100px;color:#3D3D3D;font-size:5.2px; mix-blend-mode: overlay;',
textCss3: 'word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:12px; mix-blend-mode: overlay;', textCss3: 'word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:12px; mix-blend-mode: overlay;',
// / letter-spacing鸿
textCssCouple: 'font-family: "宋体", sans-serif;color:#3D3D3D;font-size:12px;',
textCss4: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:13px; mix-blend-mode: overlay;', textCss4: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:13px; mix-blend-mode: overlay;',
textCss5: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:13px; mix-blend-mode: overlay;', textCss5: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:13px; mix-blend-mode: overlay;',
textCss6: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:10px; mix-blend-mode: overlay;', textCss6: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:10px; mix-blend-mode: overlay;',
textCssGodBody: 'font-weight:bold;font-family:"宋体",sans-serif;color:#3D3D3D;font-size:11px;width:166px;line-height:1.45em;',
textCss7: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:13px; mix-blend-mode: overlay;', textCss7: 'font-weight: bold;font-family: "宋体", sans-serif;color:#3D3D3D;font-size:13px; mix-blend-mode: overlay;',
textFont:'font-family:"certificate";', textFont:'font-family:"certificate";',
textCssLeft: 'text-align: left;', textCssLeft: 'text-align: left;',
@ -619,12 +634,59 @@
] ]
}) })
/** 持证人:按姓名字数算爱心/第二姓名位置font-size 12 ≈ 每字 12px */
const coupleHolder = computed(() => {
const nameLen = String(data.graduate?.name || '').length
const charW = 12
const startLeft = 39
const gap = 5
const iconW = 10
const iconLeft = startLeft + nameLen * charW + gap
const name2Left = iconLeft + iconW + gap
return { iconLeft, name2Left }
})
/** 按字数插入换行(鸿蒙 canvas 窄宽不自动折行) */
function wrapTextByChars(text, charsPerLine = 15) {
const s = String(text || '')
const lines = []
for (let i = 0; i < s.length; i += charsPerLine) {
lines.push(s.slice(i, i + charsPerLine))
}
return lines.join('\n')
}
const goddessCertText = computed(() => {
const name = data.graduate?.name || ''
const text = ` 兹证明 ${name} 同志,肤白貌美,聪颖过人,身材窈窕,婉约温柔,沉鱼落雁,闭月羞花,迷倒一群高富帅,人称“女神”,通过外貌协会权威认证,特发此证。`
return wrapTextByChars(text, 15)
})
const godCertText = computed(() => {
const name = data.graduate?.name || ''
const text = ` 兹证明 ${name}同志,肤若凝脂,气宇轩昂,聪慧果敢,身形挺拔,温润如玉,才貌双全,迷倒万千少女心,人称“男神”,经颜值与气质协会权威认证,特发此证。`
return wrapTextByChars(text, 15)
})
// //
const showEditPopup = ref(false); const showEditPopup = ref(false);
const editForm = ref({}); const editForm = ref({});
onLoad(async(option) => { onLoad(async(option) => {
data.bgImg1= await imgLocal.getLocalImage('other/certificate/graduate/graduate1.png'); uni.showLoading({
data.bgImg2= await imgLocal.getLocalImage('other/certificate/graduate/graduate2.png'); title: "生成中"
})
try {
data.bgImg1 = await imgLocal.getLocalImage('other/certificate/graduate/graduate1.png')
} catch (e) {
console.error('毕业证书背景1加载失败', e)
data.bgImg1 = ''
}
try {
data.bgImg2 = await imgLocal.getLocalImage('other/certificate/graduate/graduate2.png')
} catch (e) {
console.error('毕业证书背景2加载失败', e)
data.bgImg2 = ''
}
data.styleType=option.styleType||0 data.styleType=option.styleType||0
if(data.styleType==0){ if(data.styleType==0){
data.navbar.title='毕业证书' data.navbar.title='毕业证书'
@ -660,9 +722,11 @@
] ]
setType(0) setType(0)
} }
// uni.showLoading({ data.shuaxing = true
// title: "" if (data.styleType == 0 && !data.bgImg1 && !data.bgImg2) {
// }) uni.hideLoading()
uni.showToast({ title: '背景图加载失败', icon: 'none' })
}
// //
proxy.$apiUserEvent('all', { proxy.$apiUserEvent('all', {
type: 'event', type: 'event',
@ -860,7 +924,7 @@
editForm.value.icon = '/static/image/other/certificate/graduate/icon1.png'; editForm.value.icon = '/static/image/other/certificate/graduate/icon1.png';
} }
} }
const getType = (index) => { const getType = (index) => {
switch (Number(data.styleType)) { switch (Number(data.styleType)) {
case 0: case 0:
return index return index
@ -945,6 +1009,7 @@
*/ */
function convertLocalImageToFile(localPath) { function convertLocalImageToFile(localPath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// #ifdef APP-PLUS&&!APP-HARMONY
// 1. Base64 Image // 1. Base64 Image
plus.io.resolveLocalFileSystemURL(localPath, (entry) => { plus.io.resolveLocalFileSystemURL(localPath, (entry) => {
entry.file((file) => { entry.file((file) => {
@ -957,7 +1022,10 @@
reader.readAsDataURL(file); // DataURL reader.readAsDataURL(file); // DataURL
}, reject); }, reject);
}, reject); }, reject);
// #endif
// #ifndef APP-PLUS
reject(new Error('plus.io not supported'))
// #endif
}); });
} }
// //

View File

@ -1,4 +1,4 @@
<template> <template>
<view class="honor-of-kings"> <view class="honor-of-kings">
<nav-bar title="和平精英" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText" <nav-bar title="和平精英" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText"
@right-click="onRightClick"> @right-click="onRightClick">
@ -41,7 +41,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_game_heping')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_game_heping')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
@ -50,10 +50,10 @@
</view> </view>
<!-- 主题选择区域 --> <!-- 主题选择区域 -->
<view class="theme-selector"> <view class="theme-selector" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false"> <scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false">
<view class="theme-list"> <view class="theme-list" >
<view class="theme-item" v-for="(item, index) in ['样式一', '样式二']" :key="index + 1" <view class="theme-item" v-for="(item, index) in ['样式一', '样式二']" :key="index + 1"
:class="{ active: hePingData.type == index + 1 }" @click="handleChangeTheme(index + 1)"> :class="{ active: hePingData.type == index + 1 }" @click="handleChangeTheme(index + 1)">
<text class="theme-text">{{ item }}</text> <text class="theme-text">{{ item }}</text>
</view> </view>
@ -356,6 +356,7 @@ const handleSave = () => {
*/ */
function convertLocalImageToFile(localPath) { function convertLocalImageToFile(localPath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// #ifdef APP-PLUS&&!APP-HARMONY
// 1. Base64 Image // 1. Base64 Image
plus.io.resolveLocalFileSystemURL(localPath, (entry) => { plus.io.resolveLocalFileSystemURL(localPath, (entry) => {
entry.file((file) => { entry.file((file) => {
@ -368,7 +369,10 @@ function convertLocalImageToFile(localPath) {
reader.readAsDataURL(file); // DataURL reader.readAsDataURL(file); // DataURL
}, reject); }, reject);
}, reject); }, reject);
// #endif
// #ifndef APP-PLUS
reject(new Error('plus.io not supported'))
// #endif
}); });
} }
</script> </script>

View File

@ -30,48 +30,48 @@
:css="`position: absolute; left: ${honorData.type == 3 ? '230.3px' : '215.3px'}; top: ${$system == 'iOS' ? '83px' : '85.6px'}; width: ${honorData.nickname.length * 14.9}px;`"></l-painter-image> :css="`position: absolute; left: ${honorData.type == 3 ? '230.3px' : '215.3px'}; top: ${$system == 'iOS' ? '83px' : '85.6px'}; width: ${honorData.nickname.length * 14.9}px;`"></l-painter-image>
<!-- 收到花束 --> <!-- 收到花束 -->
<l-painter-text :text="honorData.receivedFlowers" <l-painter-text :text="honorData.receivedFlowers"
css="position: absolute; left: 358.5px; top: 131.4px; font-size: 9px; color: #DAF2FF;transform: translateX(-50%);font-family: WangZheFont2;"></l-painter-text> css="position: absolute; left: 338.5px; top: 131.4px; width: 40px; text-align: center; font-size: 9px; color: #DAF2FF;font-family: WangZheFont2;"></l-painter-text>
<!-- 热度数 --> <!-- 热度数 -->
<l-painter-text :text="honorData.popularityCount" <l-painter-text :text="honorData.popularityCount"
css="position: absolute; left: 386.3px; top: 131.4px; font-size: 9px; color: #DAF2FF;transform: translateX(-50%);font-family: WangZheFont2;"></l-painter-text> css="position: absolute; left: 366.3px; top: 131.4px; width: 40px; text-align: center; font-size: 9px; color: #DAF2FF;font-family: WangZheFont2;"></l-painter-text>
<!-- 点赞数 --> <!-- 点赞数 -->
<l-painter-text :text="honorData.likeCount" <l-painter-text :text="honorData.likeCount"
css="position: absolute; left: 414.0px; top: 131.4px; font-size: 9px; color: #DAF2FF;transform: translateX(-50%);font-family: WangZheFont2;"></l-painter-text> css="position: absolute; left: 394.0px; top: 131.4px; width: 40px; text-align: center; font-size: 9px; color: #DAF2FF;font-family: WangZheFont2;"></l-painter-text>
<!-- 荣誉一 --> <!-- 荣誉一 -->
<l-painter-text :text="honorData.honor1" <l-painter-text :text="honorData.honor1"
css="position: absolute; left: 247.5px; top: 145.6px; font-size: 9px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 207.5px; top: 145.6px; width: 80px; text-align: center; font-size: 9px; color: #71B1D3;"></l-painter-text>
<!-- 荣誉二 --> <!-- 荣誉二文案较长需足够宽度避免换行下移 -->
<l-painter-text :text="honorData.honor2" <l-painter-text :text="honorData.honor2"
css="position: absolute; left: 465.6px; top: 173.6px; font-size: 8px; color: #71B1D3;transform: scale(0.85),translateX(-50%);"></l-painter-text> css="position: absolute; left: 300.6px; top: 149px; width: 180px; text-align: center; font-size: 7px; line-height: 1em; color: #71B1D3;"></l-painter-text>
<!-- 巅峰万强 --> <!-- 巅峰万强 -->
<l-painter-text v-if="honorData.type == 4" :text="honorData.peakStrong" <l-painter-text v-if="honorData.type == 4" :text="honorData.peakStrong"
css="position: absolute; left: 257.3px; top: 192.8px; font-size: 8px; color: #E9F5FB;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 227.3px; top: 192.8px; width: 60px; text-align: center; font-size: 8px; color: #E9F5FB;"></l-painter-text>
<!-- 对战场次 --> <!-- 对战场次 -->
<l-painter-text :text="honorData.matchCount" <l-painter-text :text="honorData.matchCount"
css="position: absolute; left: 138.0px; top: 242.3px; font-size: 12px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 113.0px; top: 242.3px; width: 50px; text-align: center; font-size: 12px; color: #71B1D3;"></l-painter-text>
<!-- 对战被赞 --> <!-- 对战被赞 -->
<l-painter-text :text="honorData.matchLikeCount" <l-painter-text :text="honorData.matchLikeCount"
css="position: absolute; left: 199.5px; top: 242.3px; font-size: 12px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 174.5px; top: 242.3px; width: 50px; text-align: center; font-size: 12px; color: #71B1D3;"></l-painter-text>
<!-- 图鉴等级 --> <!-- 图鉴等级 -->
<l-painter-text :text="honorData.pokedexLevel" <l-painter-text :text="honorData.pokedexLevel"
css="position: absolute; left: 319.5px; top: 238.8px; font-size:9px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 299.5px; top: 238.8px; width: 40px; text-align: center; font-size:9px; color: #71B1D3;"></l-painter-text>
<!-- 皮肤数 --> <!-- 皮肤数 -->
<l-painter-text :text="honorData.skinCount" <l-painter-text :text="honorData.skinCount"
css="position: absolute; left: 377.3px; top: 238.8px; font-size:9px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 357.3px; top: 238.8px; width: 40px; text-align: center; font-size:9px; color: #71B1D3;"></l-painter-text>
<!-- 游戏天数 --> <!-- 游戏天数 -->
<l-painter-text v-if="honorData.type == 1 || honorData.type == 2" :text="honorData.gameDays" <l-painter-text v-if="honorData.type == 1 || honorData.type == 2" :text="honorData.gameDays"
css="position: absolute; left: 202.1px; top: 282.2px; font-size:10px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 177.1px; top: 282.2px; width: 50px; text-align: center; font-size:10px; color: #71B1D3;"></l-painter-text>
<!-- 峡谷对战局数 --> <!-- 峡谷对战局数 -->
<l-painter-text v-if="honorData.type == 1 || honorData.type == 2" <l-painter-text v-if="honorData.type == 1 || honorData.type == 2"
:text="honorData.riftMatchCount" :text="honorData.riftMatchCount"
css="position: absolute; left: 322.2px; top: 282.2px; font-size:10px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 297.2px; top: 282.2px; width: 50px; text-align: center; font-size:10px; color: #71B1D3;"></l-painter-text>
<!-- 大乱斗对战局数 --> <!-- 大乱斗对战局数 -->
<l-painter-text v-if="honorData.type == 1 || honorData.type == 2" <l-painter-text v-if="honorData.type == 1 || honorData.type == 2"
:text="honorData.aramMatchCount" :text="honorData.aramMatchCount"
css="position: absolute; left: 379.9px; top: 282.2px; font-size:10px; color: #71B1D3;transform: translateX(-50%);"></l-painter-text> css="position: absolute; left: 354.9px; top: 282.2px; width: 50px; text-align: center; font-size:10px; color: #71B1D3;"></l-painter-text>
<!-- 亲密度 --> <!-- 亲密度 -->
<l-painter-text v-if="honorData.type == 3 || honorData.type == 4" :text="honorData.intimacy" <l-painter-text v-if="honorData.type == 3 || honorData.type == 4" :text="honorData.intimacy"
css="position: absolute; left: 348.0px; top: 296.2px; font-size:10px; color: #71B1D3;transform: translateX(-50%);font-family: WangZheFont2;"></l-painter-text> css="position: absolute; left: 323.0px; top: 296.2px; width: 50px; text-align: center; font-size:10px; color: #71B1D3;font-family: WangZheFont2;"></l-painter-text>
<!-- 水印 --> <!-- 水印 -->
<l-painter-image v-if="$isVip()" src="/static/image/other/shuiying.png" <l-painter-image v-if="$isVip()" src="/static/image/other/shuiying.png"
@ -85,7 +85,7 @@
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_wangzhe')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_wangzhe')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
@ -94,7 +94,7 @@
</view> </view>
<!-- 主题选择区域 --> <!-- 主题选择区域 -->
<view class="theme-selector"> <view class="theme-selector" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false"> <scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false">
<view class="theme-list"> <view class="theme-list">
<view class="theme-item" v-for="(item, index) in ['样式一', '样式二', '样式三', '样式四']" :key="index + 1" <view class="theme-item" v-for="(item, index) in ['样式一', '样式二', '样式三', '样式四']" :key="index + 1"

View File

@ -1,4 +1,4 @@
<template> <template>
<view class="honor-of-kings"> <view class="honor-of-kings">
<nav-bar title="三角洲结算页" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText" <nav-bar title="三角洲结算页" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText"
@right-click="onRightClick"> @right-click="onRightClick">
@ -15,98 +15,65 @@
<l-painter-image :src="`/static/image/other/game/sanjiaozhou/style-${data.type}.jpg`" <l-painter-image :src="`/static/image/other/game/sanjiaozhou/style-${data.type}.jpg`"
css="width: 750.0px; display: block;"></l-painter-image> css="width: 750.0px; display: block;"></l-painter-image>
<l-painter-view css="position: absolute; left: 73px; top: 113px; white-space: nowrap;"> <!-- 顶部信息栏绝对定位避免鸿蒙 inline-block 竖排 -->
<!-- 地图 --> <!-- 地图 -->
<l-painter-image :src="`/static/image/other/game/sanjiaozhou/line.png`" <l-painter-image src="/static/image/other/game/sanjiaozhou/line.png"
css="display: inline-block; vertical-align: middle; height: 22px; width: 1px;"></l-painter-image> css="position:absolute;left:73px;top:113px;height:22px;width:1px;"></l-painter-image>
<l-painter-view <l-painter-text
css="display: inline-block; vertical-align: middle; padding-left: 4px; min-width: 60px;"> css="position:absolute;left:78px;top:113px;color:#CDCDCD;font-size:6px;line-height:1em;"
<l-painter-text :text="data.map.level"></l-painter-text>
css="display: block; color:#CDCDCD; font-size:6px; line-height:6px; margin-bottom: 4px; white-space: nowrap;" <l-painter-text
:text="data.map.level"></l-painter-text> css="position:absolute;left:78px;top:123px;color:#CDCDCD;font-size:10px;line-height:1em;"
<l-painter-text :text="data.map.name"></l-painter-text>
css="display: block; color:#CDCDCD; font-size:10px; line-height:10px; white-space: nowrap;" <!-- 撤离点 -->
:text="data.map.name"></l-painter-text> <l-painter-image src="/static/image/other/game/sanjiaozhou/line.png"
</l-painter-view> css="position:absolute;left:155px;top:113px;height:22px;width:1px;"></l-painter-image>
<!-- 撤离点 --> <l-painter-text
<l-painter-image :src="`/static/image/other/game/sanjiaozhou/line.png`" css="position:absolute;left:160px;top:113px;color:#CDCDCD;font-size:6px;line-height:1em;"
css="display: inline-block; vertical-align: middle; height: 22px; width: 1px;margin-left: 2px;"></l-painter-image> text="撤离点"></l-painter-text>
<l-painter-view <l-painter-text
css="display: inline-block; vertical-align: middle; padding-left: 4px; min-width: 60px;"> css="position:absolute;left:160px;top:123px;color:#CDCDCD;font-size:10px;line-height:1em;"
<l-painter-text :text="data.extractionPoint"></l-painter-text>
css="display: block; color:#CDCDCD; font-size:6px; line-height:6px; margin-bottom: 4px; white-space: nowrap;" <!-- 时长 -->
text="撤离点"></l-painter-text> <l-painter-image src="/static/image/other/game/sanjiaozhou/line.png"
<l-painter-text css="position:absolute;left:237px;top:113px;height:22px;width:1px;"></l-painter-image>
css="display: block; color:#CDCDCD; font-size:10px; line-height:10px; white-space: nowrap;" <l-painter-text
:text="data.extractionPoint"></l-painter-text> css="position:absolute;left:242px;top:113px;color:#CDCDCD;font-size:6px;line-height:1em;"
</l-painter-view> text="时长"></l-painter-text>
<!-- 时长 --> <l-painter-text v-for="(item, idx) in durationChars" :key="'durationNum_' + idx"
<l-painter-image :src="`/static/image/other/game/sanjiaozhou/line.png`" :css="item.css" :text="item.text"></l-painter-text>
css="display: inline-block; vertical-align: middle; height: 22px; width: 1px;margin-left: 2px;"></l-painter-image> <!-- 对局时间 -->
<l-painter-view <l-painter-image src="/static/image/other/game/sanjiaozhou/line.png"
css="display: inline-block; vertical-align: middle; padding-left: 4px; min-width: 60px;"> css="position:absolute;left:319px;top:113px;height:22px;width:1px;"></l-painter-image>
<l-painter-text <l-painter-text
css="display: block; color:#CDCDCD; font-size:6px; line-height:6px; margin-bottom: 4px; white-space: nowrap;" css="position:absolute;left:324px;top:113px;color:#CDCDCD;font-size:6px;line-height:1em;"
text="时长"></l-painter-text> text="对局时间"></l-painter-text>
<l-painter-text v-for="(char, idx) in String(data.duration).split('')" <l-painter-text v-for="(item, idx) in matchTimeChars" :key="'matchTimeNum_' + idx"
:key="'durationNum_' + idx" :css="getTimeCharStyle(char, idx, $system)" :css="item.css" :text="item.text"></l-painter-text>
:text="getDefeatIconText(char)"></l-painter-text>
</l-painter-view>
<!-- 对局时间 -->
<l-painter-image :src="`/static/image/other/game/sanjiaozhou/line.png`"
css="display: inline-block; vertical-align: middle; height: 22px; width: 1px;margin-left: 2px;"></l-painter-image>
<l-painter-view
css="display: inline-block; vertical-align: middle; padding-left: 4px; min-width: 60px;">
<l-painter-text
css="display: block; color:#CDCDCD; font-size:6px; line-height:6px; margin-bottom: 4px; white-space: nowrap;"
text="对局时间"></l-painter-text>
<!-- <l-painter-text
css="display: block; color:#CDCDCD; font-size:10px; line-height:10px; white-space: nowrap;"
:text="data.map.name"></l-painter-text> -->
<l-painter-text v-for="(char, idx) in String(data.matchTime).split('')"
:key="'matchTimeNum_' + idx" :css="getTimeCharStyle(char, idx, $system)"
:text="getDefeatIconText(char)"></l-painter-text>
</l-painter-view>
</l-painter-view>
<!-- 本局收获 --> <!-- 本局收获 -->
<l-painter-view <l-painter-text v-for="(item, idx) in harvestChars" :key="'harvestNum_' + idx"
css="position: absolute; left: 73px; top: 175px; white-space: nowrap; display: block;"> :css="item.css" :text="item.text"></l-painter-text>
<l-painter-text
v-for="(char, idx) in String(data.harvest).replace(/\B(?=(\d{3})+(?!\d))/g, ',').split('')"
:key="'harvestNum_' + idx" :css="getHarvestCharStyle(char, idx, $system)"
:text="getDefeatIconText(char)"></l-painter-text>
</l-painter-view>
<!-- 击败干员 --> <!-- 击败干员 -->
<l-painter-view <l-painter-text v-for="(item, idx) in defeatChars" :key="'bigNum_' + idx"
css="position: absolute; left: 73px; top: 250px; white-space: nowrap; display: block;"> :css="item.css" :text="item.text"></l-painter-text>
<l-painter-text v-for="(char, idx) in String(data.defeat).split('')"
:key="'bigNum_' + idx"
:css="`display: inline-block; color:#DBE5E6; font-size:22px; line-height:6px; margin-bottom: 4px; font-family: myIconFont; margin-left: ${idx === 0 ? '0' : '-2px'};`"
:text="getDefeatIconText(char)"></l-painter-text>
</l-painter-view>
<!-- 高光击败 --> <!-- 高光击败 -->
<l-painter-view v-for="(item, index) in data.defeatInfo" :key="index" <template v-for="(item, index) in data.defeatInfo" :key="'kill_' + index">
:css="`display: inline-block; vertical-align: middle;position: absolute; left: 73px; top: ${295 + index * 16}px; `"> <l-painter-image src="/static/image/other/game/sanjiaozhou/kill.png"
<l-painter-view css="display: inline-block;"> :css="`position:absolute;left:73px;top:${295 + index * 16}px;width:12px;height:12px;`"></l-painter-image>
<l-painter-image src="/static/image/other/game/sanjiaozhou/kill.png" <l-painter-text
css="width: 12px; height: 12px; display: inline-block;margin-right:2px"></l-painter-image> :css="`position:absolute;left:87px;top:${297 + index * 16}px;color:#DBE5E6;font-size:9px;line-height:1em;`"
<l-painter-text :text="`${item.name} [${item.rank}]`"></l-painter-text>
css="display: inline-block; color:#DBE5E6; font-size:9px; line-height:6px; margin-bottom: 4px; white-space: nowrap;" </template>
:text="`${item.name} [${item.rank}]`"></l-painter-text>
</l-painter-view>
</l-painter-view>
<!-- 玩家名称 --> <!-- 玩家名称鸿蒙不支持 rotate保持位置 -->
<l-painter-text <l-painter-text
css="display: block; color:#CDCDCD; font-size:10px; line-height:10px; white-space: nowrap;transform:rotate(10deg);position:absolute;left:424px;top:310px;" css="color:#CDCDCD;font-size:10px;line-height:1em;position:absolute;left:424px;top:310px;"
:text="data.name"></l-painter-text> :text="data.name"></l-painter-text>
<l-painter-text <l-painter-text
css="display: block; color:#CDCDCD; font-size:7px; line-height:10px; white-space: nowrap;transform:rotate(10deg);position:absolute;left:422px;top:321px;opacity: 0.6;" css="color:#CDCDCD;font-size:7px;line-height:1em;position:absolute;left:422px;top:321px;opacity:0.6;"
text="信守不渝"></l-painter-text> text="信守不渝"></l-painter-text>
<!-- 水印 --> <!-- 水印 -->
@ -122,7 +89,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_sanjiaozhou')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_sanjiaozhou')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
@ -131,7 +98,7 @@
</view> </view>
<!-- 主题选择区域 --> <!-- 主题选择区域 -->
<view class="theme-selector"> <view class="theme-selector" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false"> <scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false">
<view class="theme-list"> <view class="theme-list">
<view class="theme-item" v-for="(item, index) in ['样式一', '样式二', '样式三', '样式四']" :key="index + 1" <view class="theme-item" v-for="(item, index) in ['样式一', '样式二', '样式三', '样式四']" :key="index + 1"
@ -236,7 +203,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted, getCurrentInstance } from 'vue' import { ref, reactive, computed, onMounted, getCurrentInstance } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app' import { onLoad, onUnload } from '@dcloudio/uni-app'
const rightButtonText = ref("编辑"); const rightButtonText = ref("编辑");
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -283,36 +250,55 @@ const getDefeatIconText = (defeatStr) => {
return String(defeatStr).split('').map(char => digitIconMap[char] || char).join(''); return String(defeatStr).split('').map(char => digitIconMap[char] || char).join('');
}; };
const getTimeCharStyle = (char, idx, system) => { /** 时长/对局时间:按步进绝对定位(鸿蒙 inline-block 不横排) */
const fontSize = char === '-' ? 12 : (char === ':' ? 4 : 10); function layoutTimeChars(str, startLeft, startTop) {
let marginLeft = '-2px'; let x = startLeft
if (idx === 0 || system === 'iOS') { return String(str || '').split('').map((char) => {
marginLeft = char === '-' ? '2px' : '0px'; const fontSize = char === '-' ? 12 : (char === ':' ? 4 : 10)
} const step = char === ':' ? 4 : (char === '-' ? 10 : (char === ' ' ? 6 : 8))
let marginRight = '0'; const left = x
if ([' ', '-', ':'].includes(char)) { x += step
if (char === '-' && system === 'Android') { return {
marginLeft = '0px' text: getDefeatIconText(char),
css: `position:absolute;left:${left}px;top:${startTop}px;color:#CDCDCD;font-size:${fontSize}px;line-height:1em;font-family:myIconFont;`
} }
if (char === ':' && system === 'Android') { })
marginRight = '-1px'; }
marginLeft = '-1px'
} else if (char === ' ' && system === 'Android') {
marginRight = '2px';
} else {
marginRight = '1rpx';
}
}
return `display: inline-block; vertical-align: bottom; color:#CDCDCD; font-size:${fontSize}px; line-height:6px; margin-bottom: 4px; font-family:myIconFont; margin-left: ${marginLeft}; margin-right: ${marginRight};`;
};
const getHarvestCharStyle = (char, idx, system) => { /** 本局收获数字 */
const fontSize = char === ',' ? 6 : 22; function layoutHarvestChars(str, startLeft, startTop) {
let marginLeft = idx === 0 ? '0' : (char === ',' ? (system === 'iOS' ? '3px' : '1px') : (system === 'iOS' ? '2px' : '-3px')); const formatted = String(str || '').replace(/\B(?=(\d{3})+(?!\d))/g, ',')
let marginRight = char === ',' && system === 'Android' ? '2px' : '0'; let x = startLeft
let marginTop = char === ',' ? '3px' : '0'; return formatted.split('').map((char) => {
return `display: inline-block; vertical-align: bottom; color:#DBE5E6; font-size:${fontSize}px; margin-bottom: 4px; font-family: myIconFont; margin-left: ${marginLeft}; margin-right: ${marginRight}; margin-top: ${marginTop};`; const fontSize = char === ',' ? 6 : 22
}; const step = char === ',' ? 8 : 19
const top = char === ',' ? startTop + 3 : startTop
const left = x
x += step
return {
text: getDefeatIconText(char),
css: `position:absolute;left:${left}px;top:${top}px;color:#DBE5E6;font-size:${fontSize}px;line-height:1em;font-family:myIconFont;`
}
})
}
/** 击败干员数字 */
function layoutDefeatChars(str, startLeft, startTop) {
let x = startLeft
return String(str || '').split('').map((char) => {
const left = x
x += 20
return {
text: getDefeatIconText(char),
css: `position:absolute;left:${left}px;top:${startTop}px;color:#DBE5E6;font-size:22px;line-height:1em;font-family:myIconFont;`
}
})
}
const durationChars = computed(() => layoutTimeChars(data.duration, 242, 123))
const matchTimeChars = computed(() => layoutTimeChars(data.matchTime, 324, 123))
const harvestChars = computed(() => layoutHarvestChars(data.harvest, 73, 182))
const defeatChars = computed(() => layoutDefeatChars(data.defeat, 73, 250))
onLoad(() => { onLoad(() => {
const cachedData = uni.getStorageSync('sanjiaozhouData'); const cachedData = uni.getStorageSync('sanjiaozhouData');

View File

@ -1,4 +1,4 @@
<template> <template>
<view class="honor-of-kings"> <view class="honor-of-kings">
<nav-bar title="无畏契约" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText" <nav-bar title="无畏契约" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText"
@right-click="onRightClick"> @right-click="onRightClick">
@ -16,23 +16,27 @@
<!-- 人物图片 --> <!-- 人物图片 -->
<l-painter-image :src="wuweiData.imgUrl" :css="characterStyle"></l-painter-image> <l-painter-image :src="wuweiData.imgUrl" :css="characterStyle"></l-painter-image>
<!-- 击败 -->
<l-painter-text :text="wuweiData.killCount" :css="killCountStyle"></l-painter-text>
<template v-if="wuweiData.type == 1"> <template v-if="wuweiData.type == 1">
<!-- 击败 -->
<l-painter-text :text="wuweiData.killCount"
:css="`${style1TextCommonStyle}; left:61px;`"></l-painter-text>
<!-- 精准射击 --> <!-- 精准射击 -->
<l-painter-text :text="wuweiData.shooting" <l-painter-text :text="wuweiData.shooting"
:css="`${style1TextCommonStyle}; left:151px;`"></l-painter-text> :css="`${style1TextCommonStyle}; left:131px;`"></l-painter-text>
<!-- 输出伤害 --> <!-- 输出伤害 -->
<l-painter-text :text="wuweiData.output" <l-painter-text :text="wuweiData.output"
:css="`${style1TextCommonStyle}; left:221px;`"></l-painter-text> :css="`${style1TextCommonStyle}; left:201px;`"></l-painter-text>
<!-- 获得资金 --> <!-- 获得资金 -->
<l-painter-text :text="wuweiData.harvest" <l-painter-text :text="wuweiData.harvest"
:css="`${style1TextCommonStyle}; left:292px;`"></l-painter-text> :css="`${style1TextCommonStyle}; left:272px;`"></l-painter-text>
<!-- 三连击败 --> <!-- 三连击败 -->
<l-painter-text :text="wuweiData.threeKill" <l-painter-text :text="wuweiData.threeKill"
:css="`${style1TextCommonStyle}; left:362px;`"></l-painter-text> :css="`${style1TextCommonStyle}; left:342px;`"></l-painter-text>
</template> </template>
<template v-if="wuweiData.type == 2"> <template v-if="wuweiData.type == 2">
<!-- 击败 -->
<l-painter-text :text="wuweiData.killCount"
css="position: absolute; left: 70px; bottom: 122px; width:40px; text-align:center; font-size: 18px;font-weight: 700;color: #FFFFFF;line-height: 18px;"></l-painter-text>
<!-- 头像 --> <!-- 头像 -->
<l-painter-image :src="wuweiData.avatar" <l-painter-image :src="wuweiData.avatar"
css="position:absolute;left:65.5px;bottom:68.5px;width:42px;height:42px"></l-painter-image> css="position:absolute;left:65.5px;bottom:68.5px;width:42px;height:42px"></l-painter-image>
@ -41,13 +45,13 @@
css="position: absolute; left: 119px; bottom: 82px; font-size: 13px; font-family: Arial, sans-serif; color: #FFFFFF; width: 117px;"></l-painter-text> css="position: absolute; left: 119px; bottom: 82px; font-size: 13px; font-family: Arial, sans-serif; color: #FFFFFF; width: 117px;"></l-painter-text>
<!-- 阵败 --> <!-- 阵败 -->
<l-painter-text :text="wuweiData.defeatsCount" <l-painter-text :text="wuweiData.defeatsCount"
css="position: absolute; left: 152.5px; bottom: 122px; font-size: 18px;font-weight: 700;color: #FFFFFF;line-height: 18px;transform: translateX(-50%)"></l-painter-text> css="position: absolute; left: 132.5px; bottom: 122px; width: 40px; text-align: center; font-size: 18px;font-weight: 700;color: #FFFFFF;line-height: 18px;"></l-painter-text>
<!-- 助攻 --> <!-- 助攻 -->
<l-painter-text :text="wuweiData.assistCount" <l-painter-text :text="wuweiData.assistCount"
css="position: absolute; left: 215px; bottom: 122px; font-size: 18px;font-weight: 700;color: #FFFFFF;line-height: 18px;transform: translateX(-50%)"></l-painter-text> css="position: absolute; left: 195px; bottom: 122px; width: 40px; text-align: center; font-size: 18px;font-weight: 700;color: #FFFFFF;line-height: 18px;"></l-painter-text>
<!-- 战斗分 --> <!-- 战斗分 -->
<l-painter-text :text="`平均战斗评分:${wuweiData.battlePoints}`" <l-painter-text :text="`平均战斗评分:${wuweiData.battlePoints}`"
css="position: absolute; left: 150px; bottom: 153px; font-size:10px;color: #FFFFFF;line-height: 10px;transform: translateX(-50%)"></l-painter-text> css="position: absolute; left: 80px; bottom: 153px; width: 140px; text-align: center; font-size:10px;color: #FFFFFF;line-height: 10px;"></l-painter-text>
</template> </template>
<!-- 水印 --> <!-- 水印 -->
<l-painter-image v-if="$isVip()" src="/static/image/other/shuiying.png" <l-painter-image v-if="$isVip()" src="/static/image/other/shuiying.png"
@ -62,7 +66,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_game_wuweiqiyue')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_game_wuweiqiyue')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
@ -71,7 +75,7 @@
</view> </view>
<!-- 主题选择区域 --> <!-- 主题选择区域 -->
<view class="theme-selector"> <view class="theme-selector" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false"> <scroll-view scroll-x="true" class="theme-scroll" :show-scrollbar="false">
<view class="theme-list"> <view class="theme-list">
<view class="theme-item" v-for="(item, index) in ['样式一', '样式二']" :key="index + 1" <view class="theme-item" v-for="(item, index) in ['样式一', '样式二']" :key="index + 1"
@ -203,15 +207,7 @@ const characterStyle = computed(() => {
} }
}); });
const killCountStyle = computed(() => { const style1TextCommonStyle = `position: absolute; bottom:79px; width:40px; text-align:center; font-size: 16px;color: #FFFFFF;line-height: 16px;`;
if (wuweiData.type == 1) {
return `position: absolute; left: 81px; bottom:79px; font-size: 16px;color: #FFFFFF;line-height: 16px;transform: translateX(-50%)`;
} else {
return `position: absolute; left: 90px; bottom: 122px; font-size: 18px;font-weight: 700;color: #FFFFFF;line-height: 18px;transform: translateX(-50%)`;
}
});
const style1TextCommonStyle = `position: absolute; bottom:79px; font-size: 16px;color: #FFFFFF;line-height: 16px;transform: translateX(-50%)`;
// line-clamp // line-clamp
@ -450,6 +446,7 @@ const handleSave = () => {
*/ */
function convertLocalImageToFile(localPath) { function convertLocalImageToFile(localPath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// #ifdef APP-PLUS&&!APP-HARMONY
// 1. Base64 Image // 1. Base64 Image
plus.io.resolveLocalFileSystemURL(localPath, (entry) => { plus.io.resolveLocalFileSystemURL(localPath, (entry) => {
entry.file((file) => { entry.file((file) => {
@ -462,7 +459,10 @@ function convertLocalImageToFile(localPath) {
reader.readAsDataURL(file); // DataURL reader.readAsDataURL(file); // DataURL
}, reject); }, reject);
}, reject); }, reject);
// #endif
// #ifndef APP-PLUS
reject(new Error('plus.io not supported'))
// #endif
}); });
} }
</script> </script>

View File

@ -95,6 +95,7 @@
*/ */
function convertLocalImageToFile(localPath) { function convertLocalImageToFile(localPath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// #ifdef APP-PLUS&&!APP-HARMONY
// 1. Base64 Image // 1. Base64 Image
plus.io.resolveLocalFileSystemURL(localPath, (entry) => { plus.io.resolveLocalFileSystemURL(localPath, (entry) => {
entry.file((file) => { entry.file((file) => {
@ -107,7 +108,10 @@
reader.readAsDataURL(file); // DataURL reader.readAsDataURL(file); // DataURL
}, reject); }, reject);
}, reject); }, reject);
// #endif
// #ifndef APP-PLUS
reject(new Error('plus.io not supported'))
// #endif
}); });
} }
</script> </script>

View File

@ -1,4 +1,4 @@
<template> <template>
<view class="ranking-page"> <view class="ranking-page">
<nav-bar title="从夯到拉" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText" <nav-bar title="从夯到拉" bgColor="#F5F5F5" isRightButton :rightButtonText="rightButtonText"
@right-click="onRightClick"> @right-click="onRightClick">
@ -18,7 +18,7 @@
</image> </image>
<view class="ranking-table"> <view class="ranking-table">
<view v-for="(item, index) in tierList" :key="index" class="ranking-row"> <view v-for="(item, index) in tierList" :key="index" class="ranking-row">
<view class="label-box" :style="{ backgroundColor: item.bgColor }" <view class="label-box" :style="{ backgroundColor: item.bgColor }"
@click="changeRowBgColor(index)"> @click="changeRowBgColor(index)">
<!-- <text class="label-text" :class="{ 'with-stroke': item.hasStroke }" <!-- <text class="label-text" :class="{ 'with-stroke': item.hasStroke }"
@ -70,7 +70,7 @@
</view> </view>
</view> </view>
<view class="bottom-tabs"> <view class="bottom-tabs" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<view class="tab-item" :class="{ active: type == 'base' }" @click="switchType('base')">基础</view> <view class="tab-item" :class="{ active: type == 'base' }" @click="switchType('base')">基础</view>
<view class="tab-item" :class="{ active: type == 'skin' }" @click="switchType('skin')">皮肤</view> <view class="tab-item" :class="{ active: type == 'skin' }" @click="switchType('skin')">皮肤</view>
</view> </view>
@ -120,7 +120,7 @@
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_ranking')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_ranking')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>

View File

@ -1,5 +1,6 @@
<script setup> <script setup>
import { reactive, ref, onMounted, computed } from 'vue'; import { reactive, ref, onMounted, computed } from 'vue';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const CACHE_KEY = 'score_center_info'; const CACHE_KEY = 'score_center_info';
@ -69,7 +70,7 @@ function back(){
<view v-if="$isVip()" > <view v-if="$isVip()" >
<watermark dark="light" source="uni_alipay_other_score" /> <watermark dark="light" source="uni_alipay_other_score" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
@ -135,6 +136,8 @@ function back(){
<view class="home_indicator"></view> <view class="home_indicator"></view>
</view> </view>
<safeBottom bgColor="#f4f7fb" />
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<view v-if="editDialog.show" class="editDialog"> <view v-if="editDialog.show" class="editDialog">
<view class="editDialog_bg"> <view class="editDialog_bg">

View File

@ -1,5 +1,6 @@
<script setup> <script setup>
import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue'; import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
reactive, reactive,
ref, ref,
@ -126,7 +127,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_score" /> <watermark dark="light" source="uni_alipay_other_score" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
@ -199,6 +200,8 @@
</view> </view>
<safeBottom bgColor="#efefef" />
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<view v-if="editDialog.show" class="editDialog"> <view v-if="editDialog.show" class="editDialog">
<view class="editDialog_bg"> <view class="editDialog_bg">

View File

@ -1,7 +1,8 @@
<script setup> <script setup>
import { imgLocal } from '@/utils/common.js'; import { imgLocal } from '@/utils/common.js';
import wmWatermark from "@/components/wm-watermark/wm-watermark.vue" import wmWatermark from "@/components/wm-watermark/wm-watermark.vue"
import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue'; import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
reactive, reactive,
ref, ref,
@ -129,7 +130,7 @@ import { imgLocal } from '@/utils/common.js';
<view v-if="$isVip()" > <view v-if="$isVip()" >
<watermark dark="light" source="uni_alipay_other_score" /> <watermark dark="light" source="uni_alipay_other_score" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container"> <view class="container">
@ -267,6 +268,7 @@ import { imgLocal } from '@/utils/common.js';
</view> </view>
</view> </view>
<safeBottom bgColor="#F3F8FB" />
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<view v-if="editDialog.show" class="editDialog"> <view v-if="editDialog.show" class="editDialog">

View File

@ -1,5 +1,6 @@
<script setup> <script setup>
import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue'; import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
reactive, reactive,
ref, ref,
@ -21,7 +22,7 @@
physics: '66', physics: '66',
chemistry: '85', chemistry: '85',
geography: '86', geography: '86',
time:'2025-6-25' time: '2025-6-25'
} }
}); });
const total = computed(() => { const total = computed(() => {
@ -103,35 +104,39 @@
const clearAvatar = () => { const clearAvatar = () => {
editDialog.data.avatar = ''; editDialog.data.avatar = '';
}; };
function back(){
function back() {
uni.navigateBack() uni.navigateBack()
} }
function onChangeStartDate(e){
editDialog.data.time=e function onChangeStartDate(e) {
editDialog.data.time = e
console.log(e) console.log(e)
} }
function getTime(times,status){
let list=times.split('-') function getTime(times, status) {
if(status){ let list = times.split('-')
return list[0]+'年' if (status) {
}else{ return list[0] + '年'
return list[0]+'年'+list[1]+'月' } else {
return list[0] + '年' + list[1] + '月'
} }
} }
</script> </script>
<template> <template>
<view class="div"> <view class="div">
<view v-if="$isVip()" > <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_score" /> <watermark dark="light" source="uni_alipay_other_score" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_score')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;"></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="group_1" :style="{'padding-top':$systemInfo.statusBarHeight*2+'rpx'}"> <view class="group_1" :style="{'padding-top':$systemInfo.statusBarHeight*2+'rpx'}">
<view class="rectangle_273"> <view class="rectangle_273">
<image @click="back()" class="group_14010" src="/static/image/other/score/chongqing/close.png" /> <image @click="back()" class="group_14010" src="/static/image/other/score/chongqing/close.png" />
<view class="flexcontainer"><text class="text_1"> 成绩查询-河北省普通高校招生考试 </text><text class="text_2"> xxcx.hebeea.edu.cn <view class="flexcontainer"><text class="text_1"> 成绩查询-河北省普通高校招生考试 </text><text class="text_2">
xxcx.hebeea.edu.cn
</text></view> </text></view>
<image class="group_14011" src="/static/image/other/score/chongqing/more.png" /> <image class="group_14011" src="/static/image/other/score/chongqing/more.png" />
</view> </view>
@ -143,20 +148,22 @@
<image src="/static/image/other/score/hebei/heibeiheaderBg.png" mode="widthFix" style="width: 100%;"></image> <image src="/static/image/other/score/hebei/heibeiheaderBg.png" mode="widthFix" style="width: 100%;"></image>
<view class="group_48368"> <view class="group_48368">
<view class="rectangle_23396"> <view class="rectangle_23396">
<view class="flexcontainer"><text class="text_1"> {{ getTime(data.form.time,1) }}河北省普通高校招生考试<br>成绩查询 </text></view> <view class="flexcontainer"><text class="text_1"> {{ getTime(data.form.time,1) }}河北省普通高校招生考试<br>成绩查询 </text>
</view>
</view> </view>
<image src="/static/image/other/score/hebei/Watermark.png" mode="widthFix" class="watermark"></image> <image src="/static/image/other/score/hebei/Watermark.png" mode="widthFix" class="watermark"></image>
<view class="rectangle_23397" @click="openEditDialog"> <view class="rectangle_23397" @click="openEditDialog">
<view class="table2"> <view class="table2">
<view class="flexcontainer_1"> <view class="flexcontainer_1">
<view class="group_48370"> <view class="group_48370">
<view class="text_2"> <text style="margin-right: 20rpx;margin-left:10rpx;"> </text>{{data.form.name}} </view> <view class="text_2"> <text style="margin-right: 20rpx;margin-left:10rpx;"> </text>{{data.form.name}}
</view>
<text class="text_3"> 考生号{{data.form.examNumber}} </text> <text class="text_3"> 考生号{{data.form.examNumber}} </text>
<text class="text_4"> 证件号{{data.form.idNumber}} </text> <text class="text_4"> 证件号{{data.form.idNumber}} </text>
</view> </view>
<view class="group_48369"> <view class="group_48369">
<view class="rectangle_23389"> <view class="rectangle_23389">
<image :src="data.form.avatar||'/static/image/other/score/qrcode.png'" mode="aspectFill" /> <image :src="data.form.avatar||'/static/image/other/score/qrcode.png'" mode="aspectFill" />
</view> </view>
</view> </view>
</view> </view>
@ -208,7 +215,7 @@
<view class="group_48383"> <view class="group_48383">
<view class="flexcontainer_5"> <view class="flexcontainer_5">
<text class="text_25"> 版权所有 </text> <text class="text_25"> 版权所有 </text>
<image class="div_241" src="/static/image/other/score/hebei/Copyright.png" ></image> <image class="div_241" src="/static/image/other/score/hebei/Copyright.png"></image>
<text class="text_26"> 河北省教育考试院 </text> <text class="text_26"> 河北省教育考试院 </text>
</view> </view>
<text class="text_27"> 未经我单位书面许可不得链接此查询系统 </text> <text class="text_27"> 未经我单位书面许可不得链接此查询系统 </text>
@ -216,6 +223,8 @@
</view> </view>
</view> </view>
<safeBottom bgColor="#ffffff" />
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<view v-if="editDialog.show" class="editDialog"> <view v-if="editDialog.show" class="editDialog">
<view class="editDialog_bg"> <view class="editDialog_bg">
@ -276,7 +285,7 @@
<view class="formItem"> <view class="formItem">
<text>时间</text> <text>时间</text>
<view style="width:100%;"> <view style="width:100%;">
<DateTimePicker :defaultDate="editDialog.data.time" :mode="1" @onChange="onChangeStartDate" /> <DateTimePicker :defaultDate="editDialog.data.time" :mode="1" @onChange="onChangeStartDate" />
</view> </view>
</view> </view>
</view> </view>
@ -531,20 +540,17 @@
z-index: 0; z-index: 0;
margin-left: 16rpx; margin-left: 16rpx;
margin-top: 12rpx; margin-top: 12rpx;
/* 右侧渐隐 */ /* 右侧渐隐 */
-webkit-mask-image: linear-gradient( -webkit-mask-image: linear-gradient(to right,
to right, #000 0%,
#000 0%, #000 80%,
#000 80%, transparent 100%);
transparent 100%
); mask-image: linear-gradient(to right,
#000 0%,
#000 80%,
transparent 100%);
mask-image: linear-gradient(
to right,
#000 0%,
#000 80%,
transparent 100%
);
.text_1 { .text_1 {
position: relative; position: relative;
font-size: 36rpx; font-size: 36rpx;
@ -596,7 +602,8 @@
align-items: flex-start; align-items: flex-start;
margin-top: 0; margin-top: 0;
margin-left: 0; margin-left: 0;
.watermark{
.watermark {
position: absolute; position: absolute;
width: 650rpx; width: 650rpx;
left: 50rpx; left: 50rpx;
@ -604,6 +611,7 @@
z-index: 999; z-index: 999;
pointer-events: none; pointer-events: none;
} }
/* 矩形 23396 */ /* 矩形 23396 */
.rectangle_23396 { .rectangle_23396 {
position: relative; position: relative;
@ -661,6 +669,7 @@
z-index: 0; z-index: 0;
margin-top: 40rpx; margin-top: 40rpx;
margin-left: 30rpx; margin-left: 30rpx;
.group_48369 { .group_48369 {
position: relative; position: relative;
width: 188rpx; width: 188rpx;
@ -669,6 +678,7 @@
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
z-index: 0; z-index: 0;
.rectangle_23389 { .rectangle_23389 {
width: 188rpx; width: 188rpx;
height: 188rpx; height: 188rpx;
@ -678,6 +688,7 @@
margin-top: 0; margin-top: 0;
margin-left: 0; margin-left: 0;
overflow: hidden; overflow: hidden;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -1379,7 +1390,7 @@
margin-top: 40rpx; margin-top: 40rpx;
border: 1px solid #DBDBDB; border: 1px solid #DBDBDB;
padding-bottom: 1px; padding-bottom: 1px;
} }

View File

@ -96,7 +96,7 @@
prefix: '.uni.other.', prefix: '.uni.other.',
value:'高考查询' value:'高考查询'
}) })
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
// 便 // 便
setTimeout(() => { setTimeout(() => {

View File

@ -4,7 +4,7 @@
<ZdyNavbar @right-click="edit" isRightButton rightButtonText="编辑" :title="data.navbar.title" <ZdyNavbar @right-click="edit" isRightButton rightButtonText="编辑" :title="data.navbar.title"
:bgColor="data.navbar.bgColor" :isBack="true" /> :bgColor="data.navbar.bgColor" :isBack="true" />
<view class="footer-box"> <view class="footer-box">
<view class="btn" v-for="(item, index) in data.typeList" :key="index" :class="{ active: data.type == index }" <view class="btn" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}" v-for="(item, index) in data.typeList" :key="index" :class="{ active: data.type == index }"
@click="setType(index)"> @click="setType(index)">
{{item}} {{item}}
</view> </view>
@ -17,88 +17,92 @@
</view> </view>
<image :src="data.code" mode="widthFix" style="width:calc( 100vw - 24px);margin:0 12px;" @click="previewImage"> <image :src="data.code" mode="widthFix" style="width:calc( 100vw - 24px);margin:0 12px;" @click="previewImage">
</image> </image>
<view class="button-container"> <view class="button-container" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<button class="btn-save-image" @click="saveImage">保存图片</button> <button class="btn-save-image" @click="saveImage">保存图片</button>
</view> </view>
<view style="width: 0px;height: 0;overflow: hidden;" v-if="data.shuaxing"> <view style="width: 0px;height: 0;overflow: hidden;" v-if="data.shuaxing && currentBgImg">
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:460px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:460px;"
v-if="data.type == 0"> v-if="data.type == 0">
<l-painter-view <l-painter-view css="width:351px;height:460px;position: relative;">
:css="`width:351px;height:460px;background-image: url('${data.bgImg1}');position: relative;`"> <l-painter-image :src="data.bgImg1" css="width:351px;height:460px;position:absolute;left:0;top:0;object-fit:fill;" />
<!-- 落款日期 --> <!-- 落款日期 -->
<l-painter-view :css="`position: absolute;left:85px;bottom:94px;`"> <l-painter-view css="position: absolute;left:82px;bottom:100px;">
<l-painter-text :css="data.textFont+data.textCss" :text="data.banner.dateText" /> <l-painter-text :css="data.textFont+data.textCss" :text="toVerticalText(data.banner.dateText)" />
</l-painter-view> </l-painter-view>
<!-- 敬赠落款 --> <!-- 敬赠落款 -->
<l-painter-view :css="`position: absolute;left:100px;bottom:94px;`"> <l-painter-view css="position: absolute;left:100px;bottom:100px;">
<l-painter-text :css="data.textFont+data.textCss" :text="data.banner.donorLine" /> <l-painter-text :css="data.textFont+data.textCss" :text="toVerticalText(data.banner.donorLine)" />
</l-painter-view> </l-painter-view>
<!-- 受赠对象 --> <!-- 受赠对象画布宽351 right:72 left:267避免鸿蒙 right 定位失效 -->
<l-painter-view :css="`position: absolute;top:86px;right:74px;`"> <l-painter-view css="position: absolute;top:80px;left:267px;">
<l-painter-text :css="data.textFont+data.textCss" :text="data.banner.recipientLine" /> <l-painter-text :css="data.textFont+data.textCss" :text="toVerticalText(data.banner.recipientLine)" />
</l-painter-view> </l-painter-view>
<!-- 中心大字 --> <!-- 中心大字装饰 right 均改为 left字宽按 20px -->
<l-painter-view :css="`position: absolute;top:86px;left:171px;`"> <l-painter-view css="position: absolute;top:80px;left:168px;">
<l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" /> <l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:112px;left:124px;`"> <l-painter-view css="position: absolute;top:108px;left:120px;">
<l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" /> <l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:112px;right:116px;`"> <l-painter-view css="position: absolute;top:108px;left:219px;">
<l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" /> <l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:155px;left:107px;`"> <l-painter-view css="position: absolute;top:150px;left:102px;">
<l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" /> <l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:155px;right:101px;`"> <l-painter-view css="position: absolute;top:150px;left:235px;">
<l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" /> <l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:198px;left:141px;`"> <l-painter-view css="position: absolute;top:192px;left:136px;">
<l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" /> <l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:198px;right:126px;`"> <l-painter-view css="position: absolute;top:192px;left:211px;">
<l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" /> <l-painter-text :css="data.textFont+data.textCss1" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:112px;left:158px;`"> <!-- 中心主字 -->
<l-painter-text :css="data.textFont+data.textCss2+'width:50px;text-align: center;'" :text="data.banner.centerChar" /> <l-painter-view css="position: absolute;top:105px;left:135px;">
<l-painter-text :css="data.textFont+data.textCss2" :text="data.banner.centerChar" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;bottom:165px;left:10px;`"> <!-- 上句赞语 -->
<l-painter-view css="position: absolute;bottom:160px;left:0;">
<l-painter-text :css="data.textFont+data.textCss3" :text="data.banner.phraseTop" /> <l-painter-text :css="data.textFont+data.textCss3" :text="data.banner.phraseTop" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;bottom:118px;left:10px;`"> <!-- 下句赞语 -->
<l-painter-view css="position: absolute;bottom:118px;left:0;">
<l-painter-text :css="data.textFont+data.textCss3" :text="data.banner.phraseBottom" /> <l-painter-text :css="data.textFont+data.textCss3" :text="data.banner.phraseBottom" />
</l-painter-view> </l-painter-view>
<l-painter-view v-if="$isVip()" :css="`position: absolute;left:117px;bottom:127px;`"> <l-painter-view v-if="$isVip()" css="position: absolute;left:127px;bottom:132px;">
<l-painter-image src="/static/image/other/card/shuiyin2.png" css="width: 97px;height: 28px;" /> <l-painter-image src="/static/image/other/card/shuiyin2.png" css="width: 97px;height: 28px;" />
</l-painter-view> </l-painter-view>
</l-painter-view> </l-painter-view>
</l-painter> </l-painter>
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:460px;" <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" css="width:351px;height:460px;"
v-else-if="data.type == 1"> v-else-if="data.type == 1">
<l-painter-view <l-painter-view css="width:351px;height:460px;position: relative;">
:css="`width:351px;height:460px;background-image: url('${data.bgImg2}');position: relative;`"> <l-painter-image :src="data.bgImg2" css="width:351px;height:460px;position:absolute;left:0;top:0;object-fit:fill;" />
<!-- 落款日期 --> <!-- 落款日期 -->
<l-painter-view :css="`position: absolute;left:85px;bottom:94px;`"> <l-painter-view css="position: absolute;left:82px;bottom:100px;">
<l-painter-text :css="data.textFont+data.textCss" :text="data.banner.dateText" /> <l-painter-text :css="data.textFont+data.textCss" :text="toVerticalText(data.banner.dateText)" />
</l-painter-view> </l-painter-view>
<!-- 敬赠落款 --> <!-- 敬赠落款 -->
<l-painter-view :css="`position: absolute;left:100px;bottom:94px;`"> <l-painter-view css="position: absolute;left:100px;bottom:100px;">
<l-painter-text :css="data.textFont+data.textCss" :text="data.banner.donorLine" /> <l-painter-text :css="data.textFont+data.textCss" :text="toVerticalText(data.banner.donorLine)" />
</l-painter-view> </l-painter-view>
<!-- 受赠对象 --> <!-- 受赠对象 -->
<l-painter-view :css="`position: absolute;top:86px;right:74px;`"> <l-painter-view css="position: absolute;top:80px;left:267px;">
<l-painter-text :css="data.textFont+data.textCss" :text="data.banner.recipientLine" /> <l-painter-text :css="data.textFont+data.textCss" :text="toVerticalText(data.banner.recipientLine)" />
</l-painter-view>
<!-- 上句赞语右列 -->
<l-painter-view css="position: absolute;top:95px;left:188px;">
<l-painter-text :css="data.textFont+data.textCss4" :text="toVerticalText(data.banner.phraseTop)" />
</l-painter-view>
<!-- 下句赞语左列 -->
<l-painter-view css="position: absolute;top:95px;left:118px;">
<l-painter-text :css="data.textFont+data.textCss4" :text="toVerticalText(data.banner.phraseBottom)" />
</l-painter-view> </l-painter-view>
<l-painter-view :css="`position: absolute;top:102px;right:131px;`"> <l-painter-view v-if="$isVip()" css="position: absolute;left:127px;bottom:132px;">
<l-painter-text :css="data.textFont+data.textCss4" :text="data.banner.phraseTop" />
</l-painter-view>
<l-painter-view :css="`position: absolute;top:102px;left:142px;`">
<l-painter-text :css="data.textFont+data.textCss4" :text="data.banner.phraseBottom" />
</l-painter-view>
<l-painter-view v-if="$isVip()" :css="`position: absolute;left:117px;bottom:127px;`">
<l-painter-image src="/static/image/other/card/shuiyin2.png" css="width: 97px;height: 28px;" /> <l-painter-image src="/static/image/other/card/shuiyin2.png" css="width: 97px;height: 28px;" />
</l-painter-view> </l-painter-view>
</l-painter-view> </l-painter-view>
@ -147,7 +151,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_silkBanner')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_silkBanner')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</view> </view>
@ -156,7 +160,7 @@
<script setup> <script setup>
// //
import ZdyNavbar from "@/components/nav-bar/nav-bar.vue" import ZdyNavbar from "@/components/nav-bar/nav-bar.vue"
import { imgLocal } from '@/utils/common.js'; import { imgLocal } from '@/utils/common.js';
import { import {
ref, ref,
@ -204,6 +208,28 @@ import { imgLocal } from '@/utils/common.js';
return Object.assign(defaultBanner(type), raw && typeof raw === 'object' ? raw : {}) return Object.assign(defaultBanner(type), raw && typeof raw === 'object' ? raw : {})
} }
/** 竖排:用换行代替窄 width 自动折行(鸿蒙 canvas measureText 下窄宽不换行) */
function toVerticalText(text) {
return String(text ?? '').split('').join('\n')
}
async function loadBannerBg(path, fallback) {
try {
const localPath = await imgLocal.getLocalImage(path)
return localPath || fallback
} catch (e) {
console.error('背景图加载失败,使用本地兜底', path, e)
return fallback
}
}
function refreshPainter() {
data.shuaxing = false
setTimeout(() => {
data.shuaxing = true
}, 80)
}
const data = reactive({ const data = reactive({
isShow:false, isShow:false,
type: 0, type: 0,
@ -218,25 +244,26 @@ import { imgLocal } from '@/utils/common.js';
width: 800, width: 800,
height: 600, height: 600,
code: '', code: '',
textCss: 'text-align: center;font-weight: 400;word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;width:10px;color:#FFDD6D;font-size:10px; mix-blend-mode: overlay;', textCss: 'text-align:center;font-weight:400;width:12px;color:#FFDD6D;font-size:12px;line-height:1.15em;',
textCss1: 'text-align:center;font-weight:400;width:20px;color:#FFDD6D;font-size:20px;line-height:1em;',
textCss1: 'font-weight: 400;word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;color:#FFDD6D;font-size:20px; mix-blend-mode: overlay;', textCss2: 'text-align:center;font-weight:400;width:82px;color:#FFDD6D;font-size:78px;line-height:1em;',
textCss2: 'font-weight: 400;word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;color:#FFDD6D;font-size:80px; mix-blend-mode: overlay;', textCss3: 'text-align:center;width:351px;font-weight:400;letter-spacing:16px;color:#FFDD6D;font-size:28px;line-height:1em;',
textCss3: 'text-align: center;width:351px;font-weight: 400;word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;color:#FFDD6D;font-size:30px; mix-blend-mode: overlay;', textCss4: 'text-align:center;width:44px;font-weight:400;color:#FFDD6D;font-size:40px;line-height:1.15em;',
textCss4: 'text-align: center;width:20px;font-weight: 400;word-spacing: 50px;letter-spacing: 20px;word-spacing: 20px;color:#FFDD6D;font-size:40px; mix-blend-mode: overlay;',
textFont: 'font-family:"certificate2";', textFont: 'font-family:"certificate2";',
typeList: ['样式1', '样式2'] typeList: ['样式1', '样式2']
}) })
const currentBgImg = computed(() => data.type === 0 ? data.bgImg1 : data.bgImg2)
// //
const showEditPopup = ref(false); const showEditPopup = ref(false);
const editForm = ref({}); const editForm = ref({});
onLoad(async(option) => { onLoad(async(option) => {
data.bgImg1= await imgLocal.getLocalImage('other/silkBanner/banner1.png');
data.bgImg2= await imgLocal.getLocalImage('other/silkBanner/banner2.png');
uni.showLoading({ uni.showLoading({
title: "生成中" title: "生成中"
}) })
data.bgImg1 = await loadBannerBg('other/silkBanner/banner1.png', '/static/image/other/silkBanner/banner1.png')
data.bgImg2 = await loadBannerBg('other/silkBanner/banner2.png', '/static/image/other/silkBanner/banner2.png')
// //
proxy.$apiUserEvent('all', { proxy.$apiUserEvent('all', {
type: 'event', type: 'event',
@ -247,10 +274,20 @@ import { imgLocal } from '@/utils/common.js';
data.banner = mergeBanner(uni.getStorageSync("silkBanner" + data.type), data.type) data.banner = mergeBanner(uni.getStorageSync("silkBanner" + data.type), data.type)
const config = uni.getStorageSync('config') const config = uni.getStorageSync('config')
console.log("---config---", config); console.log("---config---", config);
const font = config.config['client.uniapp.font'] const font = config?.config?.['client.uniapp.font']
const startPaint = () => {
data.isShow = true
data.shuaxing = true
}
if (!font?.certificate2) {
console.warn('字体配置缺失,直接生成锦旗')
startPaint()
return
}
console.log("字体地址信息", font.certificate2); console.log("字体地址信息", font.certificate2);
// Font loading logic
const fontUrl = font.certificate2; const fontUrl = font.certificate2;
const fontName = 'certificate2'; const fontName = 'certificate2';
@ -259,26 +296,22 @@ import { imgLocal } from '@/utils/common.js';
family: fontName, family: fontName,
source: `url("${path}")`, source: `url("${path}")`,
success() { success() {
data.isShow=true startPaint()
data.shuaxing=true
console.log('字体加载成功'); console.log('字体加载成功');
}, },
fail(err) { fail(err) {
data.isShow=true startPaint()
data.shuaxing=true
console.error('字体加载失败', err); console.error('字体加载失败', err);
} }
}); });
}; };
// #ifdef H5 // #ifdef H5
// H5 URL
loadFont(fontUrl); loadFont(fontUrl);
// #endif // #endif
// #ifndef H5 // #ifndef H5
// H5 使 const savedFontPath = uni.getStorageSync('certificate2_font_path');
const savedFontPath = uni.getStorageSync(' ');
if (savedFontPath) { if (savedFontPath) {
loadFont(savedFontPath); loadFont(savedFontPath);
} else { } else {
@ -296,14 +329,16 @@ import { imgLocal } from '@/utils/common.js';
}, },
fail: (err) => { fail: (err) => {
console.error('保存文件失败', err); console.error('保存文件失败', err);
// Fallback:
loadFont(res.tempFilePath); loadFont(res.tempFilePath);
} }
}); });
} else {
startPaint()
} }
}, },
fail: (err) => { fail: (err) => {
console.error('下载字体失败', err); console.error('下载字体失败', err);
startPaint()
} }
}); });
} }
@ -322,11 +357,14 @@ import { imgLocal } from '@/utils/common.js';
}) })
function setType(index) { function setType(index) {
if (data.type === index) return
uni.showLoading({ uni.showLoading({
title: "生成中" title: "生成中"
}) })
data.type = index data.type = index
data.banner = mergeBanner(uni.getStorageSync("silkBanner" + data.type), data.type) data.banner = mergeBanner(uni.getStorageSync("silkBanner" + data.type), data.type)
data.code = ''
refreshPainter()
} }
function successImage(e) { function successImage(e) {
@ -354,11 +392,9 @@ import { imgLocal } from '@/utils/common.js';
uni.showLoading({ uni.showLoading({
title: "生成中" title: "生成中"
}) })
data.shuaxing = false
data.banner = mergeBanner(editForm.value, data.type) data.banner = mergeBanner(editForm.value, data.type)
setTimeout(() => { data.code = ''
data.shuaxing = true refreshPainter()
}, 100)
uni.setStorageSync("silkBanner" + data.type, data.banner) uni.setStorageSync("silkBanner" + data.type, data.banner)
// //
showEditPopup.value = false; showEditPopup.value = false;
@ -376,19 +412,21 @@ import { imgLocal } from '@/utils/common.js';
*/ */
function convertLocalImageToFile(localPath) { function convertLocalImageToFile(localPath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 1. Base64 Image // #ifdef APP-PLUS&&!APP-HARMONY
plus.io.resolveLocalFileSystemURL(localPath, (entry) => { plus.io.resolveLocalFileSystemURL(localPath, (entry) => {
entry.file((file) => { entry.file((file) => {
const reader = new plus.io.FileReader(); const reader = new plus.io.FileReader();
reader.onload = (e) => { reader.onload = (e) => {
const base64Data = e.target.result; // data:image/jpeg;base64,/9j/...
resolve(e.target.result) resolve(e.target.result)
}; };
reader.onerror = (err) => reject(err); reader.onerror = (err) => reject(err);
reader.readAsDataURL(file); // DataURL reader.readAsDataURL(file);
}, reject); }, reject);
}, reject); }, reject);
// #endif
// #ifndef APP-PLUS
reject(new Error('plus.io not supported'))
// #endif
}); });
} }
// //
@ -765,7 +803,13 @@ import { imgLocal } from '@/utils/common.js';
.button-container { .button-container {
display: flex; display: flex;
justify-content: center; justify-content: center;
padding: 30rpx 0; position: fixed;
left: 0;
bottom: 86px;
width: 100vw;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
z-index: 10;
} }
.btn-save-image { .btn-save-image {
@ -790,6 +834,9 @@ import { imgLocal } from '@/utils/common.js';
transform: translateY(0); transform: translateY(0);
box-shadow: 0 2rpx 6rpx rgba(7, 140, 193, 0.3); box-shadow: 0 2rpx 6rpx rgba(7, 140, 193, 0.3);
} }
.container {
padding-bottom: 220rpx;
}
.footer-box { .footer-box {
position: fixed; position: fixed;
left: 0; left: 0;
@ -799,6 +846,7 @@ import { imgLocal } from '@/utils/common.js';
justify-content: center; justify-content: center;
padding-bottom: constant(safe-area-inset-bottom); // IOS<11.2 padding-bottom: constant(safe-area-inset-bottom); // IOS<11.2
padding-bottom: env(safe-area-inset-bottom); // IOS>11.2 padding-bottom: env(safe-area-inset-bottom); // IOS>11.2
z-index: 10;
.btn { .btn {
font-size: 18px; font-size: 18px;
color: #767676; color: #767676;

View File

@ -5,12 +5,12 @@
:bgColor="data.navbar.bgColor" :isBack="true" /> :bgColor="data.navbar.bgColor" :isBack="true" />
<image :src="data.code" mode="widthFix" style="width: 100vw;" @click="previewImage"></image> <image :src="data.code" mode="widthFix" style="width: 100vw;" @click="previewImage"></image>
<view class="footer-box"> <view class="footer-box">
<view class="btn" v-for="(item, index) in data.typeList" :key="index" :class="{ active: data.type == index }" <view class="btn" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}" v-for="(item, index) in data.typeList" :key="index" :class="{ active: data.type == index }"
@click="setType(index)"> @click="setType(index)">
样式{{index+1}} 样式{{index+1}}
</view> </view>
</view> </view>
<view class="button-container"> <view class="button-container" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<button class="btn-save-image" @click="saveImage">保存图片</button> <button class="btn-save-image" @click="saveImage">保存图片</button>
</view> </view>
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" hidden <l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" hidden
@ -380,7 +380,7 @@
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_gongzhitiao')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_gongzhitiao')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</view> </view>

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_tickets_12306" /> <watermark dark="light" source="uni_alipay_other_tickets_12306" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_12306')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_12306')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container"> <view class="container">
@ -144,8 +144,7 @@
<!-- 分享区 --> <!-- 分享区 -->
<view class="share-section"> <view class="share-section">
<text class="share-tips">美好旅途快与朋友一起分享吧~</text> <text class="share-tips">美好旅途快与朋友一起分享吧~</text>
<image style="width: 158rpx;height: 50rpx;" <image style="width: 158rpx;height: 50rpx;" src="/static/image/other/train-tickets/12306-tickets/share.png">
src="/static/image/other/train-tickets/12306-tickets/share.png">
</image> </image>
</view> </view>
@ -157,11 +156,9 @@
<!-- 广告Banner --> <!-- 广告Banner -->
<view class="ad-banner"> <view class="ad-banner">
<image class="bg-image" src="/static/image/other/train-tickets/12306-tickets/hotel-bg.png" <image class="bg-image" src="/static/image/other/train-tickets/12306-tickets/hotel-bg.png" mode="widthFix">
mode="widthFix">
</image> </image>
<image class="bg-image" style="opacity: 0;position: relative;" <image class="bg-image" style="opacity: 0;position: relative;" src="/static/image/other/train-tickets/12306-tickets/hotel-bg.png" mode="widthFix">
src="/static/image/other/train-tickets/12306-tickets/hotel-bg.png" mode="widthFix">
</image> </image>
<view class="hotel-ad"> <view class="hotel-ad">
<view class="hotel-search-row"> <view class="hotel-search-row">
@ -190,6 +187,7 @@
src="/static/image/other/train-tickets/12306-tickets/bottom-bg.png" mode="widthFix"> src="/static/image/other/train-tickets/12306-tickets/bottom-bg.png" mode="widthFix">
</image> </image>
</view> </view>
<ZdySafeBottom bgColor="#fff"/>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -197,6 +195,8 @@
<script setup> <script setup>
import NavBar from '@/components/nav-bar/nav-bar.vue'; import NavBar from '@/components/nav-bar/nav-bar.vue';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
import { import {
ref, ref,
reactive, reactive,
@ -348,7 +348,7 @@ onShow(() => {
Object.assign(data.ticketsInfo, uni.getStorageSync('ticketsInfo')) Object.assign(data.ticketsInfo, uni.getStorageSync('ticketsInfo'))
calculateNightCount() calculateNightCount()
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_tickets_ctrip" /> <watermark dark="light" source="uni_alipay_other_tickets_ctrip" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_ctrip')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_ctrip')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="top-box"> <view class="top-box">
@ -302,6 +302,7 @@
<text class="font_22 text_45">是否可以刷身份证进站乘车需要取票吗</text> <text class="font_22 text_45">是否可以刷身份证进站乘车需要取票吗</text>
</view> </view>
</view> </view>
<ZdySafeBottom bgColor="#f0f3f8"/>
</view> </view>
<!-- 样式选择弹窗 --> <!-- 样式选择弹窗 -->
@ -331,6 +332,7 @@ import NavBar from '@/components/nav-bar/nav-bar.vue';
import { reactive, toRefs, ref } from 'vue'; import { reactive, toRefs, ref } from 'vue';
import { onShow, onPageScroll } from '@dcloudio/uni-app'; import { onShow, onPageScroll } from '@dcloudio/uni-app';
import { util } from '@/utils/common.js'; import { util } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const buttonGroup = [ const buttonGroup = [
{ {

View File

@ -4,7 +4,7 @@
<watermark dark="light" source="uni_alipay_other_tickets_fliggy" /> <watermark dark="light" source="uni_alipay_other_tickets_fliggy" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_fliggy')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_fliggy')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view> <view>
@ -195,7 +195,7 @@
<text class="codefun-shrink-0 font_6 text_31">{{ ticketsInfo.serviceText }}</text> <text class="codefun-shrink-0 font_6 text_31">{{ ticketsInfo.serviceText }}</text>
</view> </view>
</view> </view>
<view class="codefun-flex-col section_9"> <view class="codefun-flex-col section_9" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="codefun-flex-row codefun-justify-between codefun-items-center"> <view class="codefun-flex-row codefun-justify-between codefun-items-center">
<text class="font_14 text_33">您可能遇到的问题</text> <text class="font_14 text_33">您可能遇到的问题</text>
<view class="codefun-flex-row codefun-items-center"> <view class="codefun-flex-row codefun-items-center">
@ -203,7 +203,7 @@
<uni-icons type="right" size="12" color="#1A1A1A"></uni-icons> <uni-icons type="right" size="12" color="#1A1A1A"></uni-icons>
</view> </view>
</view> </view>
<view class="grid codefun-mt-14"> <view class="grid codefun-mt-14" >
<view class="codefun-flex-col codefun-justify-center codefun-items-center grid-item"> <view class="codefun-flex-col codefun-justify-center codefun-items-center grid-item">
<text class="font_1 text_36">如何取火车票</text> <text class="font_1 text_36">如何取火车票</text>
</view> </view>
@ -227,7 +227,7 @@
</view> </view>
</view> </view>
<view class="footer-box"> <view class="footer-box" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="codefun-flex-col codefun-justify-start codefun-items-center section_10"> <view class="codefun-flex-col codefun-justify-start codefun-items-center section_10">
<view class="codefun-flex-row codefun-items-center group_14"> <view class="codefun-flex-row codefun-items-center group_14">
<image class="codefun-shrink-0 image_12" <image class="codefun-shrink-0 image_12"
@ -244,6 +244,7 @@ import NavBar from '@/components/nav-bar/nav-bar.vue';
import { reactive, toRefs } from 'vue'; import { reactive, toRefs } from 'vue';
import { onShow } from '@dcloudio/uni-app'; import { onShow } from '@dcloudio/uni-app';
import { util, stringUtil } from '@/utils/common.js'; import { util, stringUtil } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const buttonGroup = [{ const buttonGroup = [{
name: "编辑车票信息", name: "编辑车票信息",

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_tickets_qunar" /> <watermark dark="light" source="uni_alipay_other_tickets_qunar" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_qunar')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_tickets_qunar')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="codefun-flex-col section"> <view class="codefun-flex-col section">
@ -136,6 +136,9 @@
</view> </view>
</view> </view>
<Box /> <Box />
<view class="" style="width: 100%;overflow: hidden;">
<ZdySafeBottom bgColor="#f0f3f8" />
</view>
</view> </view>
</template> </template>
@ -146,6 +149,7 @@ import Box from './components/box.vue';
import { reactive, toRefs } from 'vue'; import { reactive, toRefs } from 'vue';
import { onShow, onPageScroll } from '@dcloudio/uni-app'; import { onShow, onPageScroll } from '@dcloudio/uni-app';
import { util, stringUtil } from '@/utils/common.js'; import { util, stringUtil } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const buttonGroup = [{ const buttonGroup = [{
name: "编辑机票信息", name: "编辑机票信息",
@ -256,6 +260,8 @@ const formatDateTime = (timeStr, dateStr) => {
page { page {
background-color: #F2F5F9; background-color: #F2F5F9;
width: 100vw;
overflow: hidden;
} }
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
@ -401,7 +407,6 @@ page {
padding-bottom: 10rpx; padding-bottom: 10rpx;
padding-bottom: calc(10rpx + constant(safe-area-inset-bottom)); padding-bottom: calc(10rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(10rpx + env(safe-area-inset-bottom)); padding-bottom: calc(10rpx + env(safe-area-inset-bottom));
.ml-25 { .ml-25 {
margin-left: 50rpx; margin-left: 50rpx;
} }

View File

@ -5,7 +5,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_videoChat" /> <watermark dark="light" source="uni_alipay_other_videoChat" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_videoChat')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_videoChat')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<!-- 未接通内容 --> <!-- 未接通内容 -->
@ -99,7 +99,7 @@
<text class="control-label">翻转</text> <text class="control-label">翻转</text>
</view> </view>
</view> </view>
<view class="control-buttons" style="margin-bottom: 0;display: flex;justify-content: space-between;"> <view class="control-buttons" style="margin-bottom: 0;display: flex;justify-content: space-between;" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<!-- 挂断按钮 --> <!-- 挂断按钮 -->
<image class="hangup-btn" style="margin: 0;" @click="hangup" <image class="hangup-btn" style="margin: 0;" @click="hangup"
@ -382,7 +382,7 @@ const autoPlayVideos = () => {
} }
const getVideoUrl = (url) => { const getVideoUrl = (url) => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
if (url && !url.startsWith('http') && !url.startsWith('blob:')) { if (url && !url.startsWith('http') && !url.startsWith('blob:')) {
return plus.io.convertLocalFileSystemURL(url) return plus.io.convertLocalFileSystemURL(url)
} }
@ -620,7 +620,7 @@ onShow(() => {
// //
autoPlayVideos() autoPlayVideos()
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#FFFFFF') util.setAndroidSystemBarColor('#FFFFFF')
// //
@ -635,7 +635,7 @@ onShow(() => {
// #endif // #endif
}) })
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
// const restoreSystemNavigation = () => { // const restoreSystemNavigation = () => {
// if (plus.os.name === 'Android') { // if (plus.os.name === 'Android') {
// try { // try {
@ -768,7 +768,7 @@ const uploadMedia = (type, mediaType) => {
compressed: false, // iOS (Matrix) compressed: false, // iOS (Matrix)
success: (res) => { success: (res) => {
let tempPath = res.tempFilePath let tempPath = res.tempFilePath
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
tempPath = plus.io.convertLocalFileSystemURL(tempPath) tempPath = plus.io.convertLocalFileSystemURL(tempPath)
// #endif // #endif
uni.saveFile({ uni.saveFile({
@ -927,7 +927,10 @@ const chooseVideo = () => {
camera: 'back', camera: 'back',
success: async (res) => { success: async (res) => {
console.log('选择视频成功:', res) console.log('选择视频成功:', res)
const videoUrl = plus.io.convertLocalFileSystemURL(res.tempFilePath) let videoUrl = res.tempFilePath
// #ifdef APP-PLUS&&!APP-HARMONY
videoUrl = plus.io.convertLocalFileSystemURL(res.tempFilePath)
// #endif
const savedVideoUrl = await new Promise((resolve, reject) => { const savedVideoUrl = await new Promise((resolve, reject) => {
uni.saveFile({ uni.saveFile({
tempFilePath: videoUrl, tempFilePath: videoUrl,
@ -1058,7 +1061,7 @@ const removeFile = (filePath) => {
console.log('🗑️ 准备删除文件:', filePath) console.log('🗑️ 准备删除文件:', filePath)
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
// 使 plus.io ( file:// _downloads ) // 使 plus.io ( file:// _downloads )
if (filePath.startsWith('file://') || filePath.includes('_downloads') || filePath.includes('saved_video_')) { if (filePath.startsWith('file://') || filePath.includes('_downloads') || filePath.includes('saved_video_')) {
plus.io.resolveLocalFileSystemURL(filePath, (entry) => { plus.io.resolveLocalFileSystemURL(filePath, (entry) => {

View File

@ -3,7 +3,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_groupChat" /> <watermark dark="light" source="uni_alipay_other_groupChat" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_groupChat')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_groupChat')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
<view class="container"> <view class="container">
@ -97,7 +97,7 @@
</view> </view>
<!-- 挂断按钮 --> <!-- 挂断按钮 -->
<image class="hangup-btn" @click="hangup" src="/static/image/other/video-call/hangup.png"></image> <image class="hangup-btn" @click="hangup" src="/static/image/other/video-call/hangup.png" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}"></image>
<!-- <view class="hangup-btn" @click="hangup"> <!-- <view class="hangup-btn" @click="hangup">
</view> --> </view> -->
@ -268,7 +268,10 @@ onLoad(() => {
...videoData, ...videoData,
iconType: videoData.onMic ? videoData.iconType : 1, iconType: videoData.onMic ? videoData.iconType : 1,
videoList: videoData.videoList.map((item) => { videoList: videoData.videoList.map((item) => {
item.videoUrl = item.savedVideoUrl
// #ifdef APP-PLUS&&!APP-HARMONY
item.videoUrl = plus.io.convertLocalFileSystemURL(item.savedVideoUrl) item.videoUrl = plus.io.convertLocalFileSystemURL(item.savedVideoUrl)
// #endif
return item return item
}) })
} }
@ -293,7 +296,7 @@ onShow(() => {
} }
startTimer() startTimer()
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#232323') util.setAndroidSystemBarColor('#232323')
// 便 // 便
statusBarTimer = setTimeout(() => { statusBarTimer = setTimeout(() => {
@ -526,7 +529,10 @@ const chooseVideo = () => {
camera: 'back', camera: 'back',
success: async (res) => { success: async (res) => {
console.log('选择视频成功:', res) console.log('选择视频成功:', res)
const videoUrl = plus.io.convertLocalFileSystemURL(res.tempFilePath) let videoUrl = res.tempFilePath
// #ifdef APP-PLUS&&!APP-HARMONY
videoUrl = plus.io.convertLocalFileSystemURL(res.tempFilePath)
// #endif
const savedVideoUrl = await new Promise((resolve, reject) => { const savedVideoUrl = await new Promise((resolve, reject) => {
uni.saveFile({ uni.saveFile({
tempFilePath: videoUrl, tempFilePath: videoUrl,
@ -664,7 +670,7 @@ const removeFile = (filePath) => {
console.log('🗑️ 准备删除文件:', filePath) console.log('🗑️ 准备删除文件:', filePath)
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
// 使 plus.io ( file:// _downloads ) // 使 plus.io ( file:// _downloads )
if (filePath.startsWith('file://') || filePath.includes('_downloads') || filePath.includes('saved_video_')) { if (filePath.startsWith('file://') || filePath.includes('_downloads') || filePath.includes('saved_video_')) {
plus.io.resolveLocalFileSystemURL(filePath, (entry) => { plus.io.resolveLocalFileSystemURL(filePath, (entry) => {

View File

@ -1,4 +1,4 @@
<template> <template>
<view class="container"> <view class="container">
<nav-bar bgColor="transparent" :isBack="false"> <nav-bar bgColor="transparent" :isBack="false">
<template v-slot:center> <template v-slot:center>
@ -64,7 +64,7 @@
<watermark dark="light" source="uni_alipay_other_wx_pay_success" /> <watermark dark="light" source="uni_alipay_other_wx_pay_success" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_wx_pay_success')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_other_wx_pay_success')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>

View File

@ -87,6 +87,7 @@
<canvas canvas-id="crop-canvas" <canvas canvas-id="crop-canvas"
style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas> style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas>
</view> </view>
<ZdySafeBottom bgColor="#f0f3f8"/>
<!-- 长按操作气泡菜单 --> <!-- 长按操作气泡菜单 -->
<view v-if="showActionMenu" class="action-menu-mask" @click="showActionMenu = false"> <view v-if="showActionMenu" class="action-menu-mask" @click="showActionMenu = false">
@ -103,7 +104,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_shopping_jingdong" /> <watermark dark="light" source="uni_alipay_shopping_jingdong" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_jingdong')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_jingdong')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>
@ -114,6 +115,7 @@ import { onShow, onLoad } from '@dcloudio/uni-app';
import ShoppingCard from '@/components/shopping/jingdong/shopping-card.vue'; import ShoppingCard from '@/components/shopping/jingdong/shopping-card.vue';
import { util } from '@/utils/common.js'; import { util } from '@/utils/common.js';
import { shoppingType, waimaiType, defaultDataList } from './json/order.json'; import { shoppingType, waimaiType, defaultDataList } from './json/order.json';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -312,7 +314,7 @@ onLoad(() => {
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#FFFFFF') util.setAndroidSystemBarColor('#FFFFFF')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
@ -533,7 +535,9 @@ const confirmImage = () => {
screenshotImage.value = saveRes.savedFilePath screenshotImage.value = saveRes.savedFilePath
selectedImage.value = '' // selectedImage.value = '' //
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
}, 200) }, 200)
// //
uni.setStorageSync('jingdong_screenshot', screenshotImage.value) uni.setStorageSync('jingdong_screenshot', screenshotImage.value)

View File

@ -452,9 +452,11 @@
</view> </view>
</view> </view>
</template> </template>
<view class="" :style="{'height':$store.state.safeBottomAz+'px'}">
<view class="fixed-bottom ">
<view class="flex-align-center flex-justify-between w100"> </view>
<view class="fixed-bottom " >
<view class="flex-align-center flex-justify-between w100" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<text>{{ bottomText }}</text> <text>{{ bottomText }}</text>
<view class="btn-box"> <view class="btn-box">
<view v-if="order.status == '等待付款'" class="big-btn ">立即支付<text <view v-if="order.status == '等待付款'" class="big-btn ">立即支付<text
@ -475,7 +477,7 @@
<watermark dark="light" source="uni_alipay_shopping_jingdong_shoppingDetail" /> <watermark dark="light" source="uni_alipay_shopping_jingdong_shoppingDetail" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_jingdong_shoppingDetail')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_jingdong_shoppingDetail')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</view> </view>
@ -637,7 +639,7 @@ onShow(() => {
if (cachedImage) { if (cachedImage) {
screenshotImage.value = cachedImage; screenshotImage.value = cachedImage;
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#FFFFFF') util.setAndroidSystemBarColor('#FFFFFF')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");

View File

@ -442,21 +442,24 @@
</view> </view>
</view> </view>
<view class="w100 flex-center" style="margin-top: 40rpx;margin-bottom: 32rpx;"> <view class="w100 flex-center" style="margin-top: 40rpx;margin-bottom: 32rpx;" >
<image style="width: 32rpx;height: 20rpx;" src="/static/image/shopping/jingdong/detail/like-left.png"> <image style="width: 32rpx;height: 20rpx;" src="/static/image/shopping/jingdong/detail/like-left.png">
</image> </image>
<text style="font-size: 26rpx;color: #1A1A1A;line-height: 26rpx;font-weight: 500;margin: 0 10rpx;">你可能还喜欢</text> <text style="font-size: 26rpx;color: #1A1A1A;line-height: 26rpx;font-weight: 500;margin: 0 10rpx;">你可能还喜欢</text>
<image style="width: 32rpx;height: 20rpx;" src="/static/image/shopping/jingdong/detail/like-right.png"> <image style="width: 32rpx;height: 20rpx;" src="/static/image/shopping/jingdong/detail/like-right.png">
</image> </image>
</view> </view>
<view class="upload-screenshot-box"> <view class="upload-screenshot-box" >
<view class="upload-screenshot-content w100"> <view class="upload-screenshot-content w100">
<image class="w100" :src="screenshotImage" mode="widthFix"></image> <image class="w100" :src="screenshotImage" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="" :style="{'height':$store.state.safeBottomAz+'px'}">
</view>
<view v-if="order.status == '等待付款'" class="fixed-bottom"> <view v-if="order.status == '等待付款'" class="fixed-bottom">
<view class="btn-box"> <view class="btn-box" :style="{'margin-bottom':$store.state.safeBottomAz+'px'}">
<view class="big-btn wx-font-medium">立即支付¥{{ (Number(order.totalPrice) + <view class="big-btn wx-font-medium">立即支付¥{{ (Number(order.totalPrice) +
Number(order.carriage)) ? Number(order.carriage)) ?
(Number(order.totalPrice) (Number(order.totalPrice)
@ -464,14 +467,14 @@
0 }} </view> 0 }} </view>
</view> </view>
</view> </view>
<view v-if="order.status == '等待付款'" class="placeholder"></view> <view v-if="order.status == '等待付款'" class="placeholder" ></view>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_shopping_jingdong_waimaiDetail" /> <watermark dark="light" source="uni_alipay_shopping_jingdong_waimaiDetail" />
<liu-drag-button :canDocking="false" <liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_jingdong_waimaiDetail')"> @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_jingdong_waimaiDetail')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>

View File

@ -112,12 +112,12 @@
<view class="menu-item" @click="handleEdit">编辑</view> <view class="menu-item" @click="handleEdit">编辑</view>
<view class="menu-item text-red" @click="handleDelete">删除</view> <view class="menu-item text-red" @click="handleDelete">删除</view>
</view> </view>
<ZdySafeBottom bgColor="#f0f3f8"/>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_shopping_pdd" /> <watermark dark="light" source="uni_alipay_shopping_pdd" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_pdd')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_pdd')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
@ -179,6 +179,8 @@ import { defaultDataList } from '@/pages/shopping/pdd/json/order.json';
import { util } from '@/utils/common.js'; import { util } from '@/utils/common.js';
import { imgLocal } from '@/utils/common.js'; import { imgLocal } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const activeTab = ref(0); const activeTab = ref(0);
const scrollIntoId = ref(''); const scrollIntoId = ref('');
@ -461,7 +463,7 @@ onShow(async () => {
tab2List.value = cachedTab2; tab2List.value = cachedTab2;
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#FFFFFF') util.setAndroidSystemBarColor('#FFFFFF')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
@ -587,7 +589,9 @@ const confirmImage = () => {
screenshotImage.value = saveRes.savedFilePath screenshotImage.value = saveRes.savedFilePath
selectedImage.value = '' // selectedImage.value = '' //
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
}, 200) }, 200)
// //
uni.setStorageSync('pdd_screenshot', screenshotImage.value) uni.setStorageSync('pdd_screenshot', screenshotImage.value)

View File

@ -206,7 +206,7 @@
</view> </view>
<!-- 底部固定支付栏 --> <!-- 底部固定支付栏 -->
<view v-if="order.orderType == 'wait_pay'" class="fixed-bottom-bar flex-justify-between"> <view v-if="order.orderType == 'wait_pay'" class="fixed-bottom-bar flex-justify-between" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<!-- 样式 2先用后付 (activePayIndex === 2) --> <!-- 样式 2先用后付 (activePayIndex === 2) -->
<view class="left-info style-2 flex-column" v-if="order.activePayIndex === 2"> <view class="left-info style-2 flex-column" v-if="order.activePayIndex === 2">
<view class="line-top flex-align-end"> <view class="line-top flex-align-end">
@ -236,7 +236,7 @@
</view> </view>
<!-- 底部固定支付栏 --> <!-- 底部固定支付栏 -->
<view v-else class="fixed-bottom-bar flex-justify-between"> <view v-else class="fixed-bottom-bar flex-justify-between" :style="{'padding-bottom':$store.state.safeBottomAz+'px'}">
<view class="flex-align-center buttons"> <view class="flex-align-center buttons">
<view class="more">更多</view> <view class="more">更多</view>
<view class="button">再次拼单</view> <view class="button">再次拼单</view>
@ -251,7 +251,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_shopping_pdd_detail" /> <watermark dark="light" source="uni_alipay_shopping_pdd_detail" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_pdd_detail')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_pdd_detail')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>

View File

@ -123,8 +123,8 @@
</view> </view>
</scroll-view> </scroll-view>
<ZdySafeBottom bg-color="#f0f3f8"/>
</view> </view>
<!-- 自定义长按上下文菜单 --> <!-- 自定义长按上下文菜单 -->
<view v-if="menuState.show" class="menu-mask" @click="menuState.show = false" @touchmove.stop.prevent> <view v-if="menuState.show" class="menu-mask" @click="menuState.show = false" @touchmove.stop.prevent>
<view class="menu-content" :style="{ top: menuState.y + 'px', left: menuState.x + 'px' }"> <view class="menu-content" :style="{ top: menuState.y + 'px', left: menuState.x + 'px' }">
@ -174,7 +174,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_shopping_taobao" /> <watermark dark="light" source="uni_alipay_shopping_taobao" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_taobao')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_taobao')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>
@ -186,6 +186,7 @@ import { util } from '@/utils/common.js';
import listCard from './components/list-card/list-card.vue'; import listCard from './components/list-card/list-card.vue';
import { defualtData } from './json/order.json' import { defualtData } from './json/order.json'
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const instance = getCurrentInstance(); const instance = getCurrentInstance();
@ -220,7 +221,7 @@ onLoad(() => {
}) })
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#FFFFFF') util.setAndroidSystemBarColor('#FFFFFF')
setTimeout(() => { setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
@ -460,7 +461,9 @@ const confirmImage = () => {
screenshotImage.value = saveRes.savedFilePath screenshotImage.value = saveRes.savedFilePath
selectedImage.value = '' // selectedImage.value = '' //
setTimeout(() => { setTimeout(() => {
// #ifdef APP-PLUS&&!APP-HARMONY
plus.navigator.setStatusBarStyle("light"); plus.navigator.setStatusBarStyle("light");
// #endif
}, 200) }, 200)
// //
uni.setStorageSync('taobao_screenshot', screenshotImage.value) uni.setStorageSync('taobao_screenshot', screenshotImage.value)

View File

@ -293,13 +293,13 @@
<view> <view>
<image style="width: 100%;" :src="screenshotImage" mode="widthFix"></image> <image style="width: 100%;" :src="screenshotImage" mode="widthFix"></image>
</view> </view>
<ZdySafeBottom bg-color="#f0f3f8"/>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_taobao_shangou" /> <watermark dark="light" source="uni_alipay_taobao_shangou" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_taobao_shangou')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_taobao_shangou')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>
@ -311,6 +311,7 @@ import { util } from '@/utils/common.js';
import { defualtData } from '../json/order.json'; import { defualtData } from '../json/order.json';
import { imgLocal } from '@/utils/common.js'; import { imgLocal } from '@/utils/common.js';
import ZdySafeBottom from '@/components/safeBottom/safeBottom.vue'
const isScrolled = ref(false); const isScrolled = ref(false);
const screenshotImage = ref('') const screenshotImage = ref('')

View File

@ -341,14 +341,16 @@
<view class="btn">运费谁承担</view> <view class="btn">运费谁承担</view>
</view> </view>
</view> </view>
<view class="bottom-template"> <view class="bottom-template" >
</view>
</view>
<view class="" :style="{'height':$store.state.safeBottomAz+'px'}">
</view> </view>
</view>
<view v-if="order" class="bottom-box flex-justify-between flex-align-center" :style="{'padding-bottom':($store.state.safeBottomAz||$store.state.safeBottom)+'px'}">
<view v-if="order" class="bottom-box flex-justify-between flex-align-center">
<view class="left-icons flex"> <view class="left-icons flex">
<view class="icon-box" v-for="icon in bottomBtnList[order.statusType].icons" :key="icon.name"> <view class="icon-box" v-for="icon in bottomBtnList[order.statusType].icons" :key="icon.name">
<image style="width: 40rpx;height: 40rpx;" <image style="width: 40rpx;height: 40rpx;"
@ -386,7 +388,7 @@
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_shopping_taobao" /> <watermark dark="light" source="uni_alipay_shopping_taobao" />
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_taobao')"> <liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark', 'uni_alipay_shopping_taobao')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie> <image src='/static/lottie/watermark.gif' mode="widthFix" style="width:94px;height:74px;" ></image>
</liu-drag-button> </liu-drag-button>
</view> </view>
</template> </template>
@ -1133,9 +1135,9 @@ onUnmounted(() => {
} }
.bottom-template { .bottom-template {
height: 108rpx; min-height: 108rpx;
height: calc(108rpx + env(safe-area-inset-bottom)); // height: calc(108rpx + env(safe-area-inset-bottom));
height: calc(108rpx + constant(safe-area-inset-bottom)); // height: calc(108rpx + constant(safe-area-inset-bottom));
} }
.bottom-box { .bottom-box {
@ -1149,9 +1151,9 @@ onUnmounted(() => {
left: 0; left: 0;
right: 0; right: 0;
border-top: 0.5px solid #ECEDEF; border-top: 0.5px solid #ECEDEF;
height: 108rpx; min-height: 108rpx;
height: calc(108rpx + env(safe-area-inset-bottom)); // height: calc(108rpx + env(safe-area-inset-bottom));
height: calc(108rpx + constant(safe-area-inset-bottom)); // height: calc(108rpx + constant(safe-area-inset-bottom));
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
padding-bottom: constant(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom);

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

BIN
static/lottie/coupon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

BIN
static/lottie/couponTop.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
static/lottie/hongbao.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
static/lottie/watermark.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 KiB

176
test.js

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
export default function getfile(e,isIosDown=false) { export default function getfile(e,isIosDown=false) {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
let isIOS = plus.os.name==='iOS' let isIOS = plus.os.name==='iOS'
let url = plus.io.convertLocalFileSystemURL(e) let url = plus.io.convertLocalFileSystemURL(e)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View File

@ -45,7 +45,7 @@ export default {
default: 2000 default: 2000
}, },
// #endif // #endif
// #ifdef H5 || APP-PLUS // #ifdef H5 || APP-PLUS || APP-HARMONY
useCORS: Boolean, useCORS: Boolean,
hidpi: { hidpi: {
type: Boolean, type: Boolean,

View File

@ -164,7 +164,7 @@ export function base64ToPath(base64) {
}))) })))
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()) const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
bitmap.loadBase64Data(base64, () => { bitmap.loadBase64Data(base64, () => {
if (!format) { if (!format) {
@ -186,6 +186,27 @@ export function base64ToPath(base64) {
reject(error) reject(error)
}) })
// #endif // #endif
// #ifdef APP-HARMONY
if (!format) {
reject(new Error('ERROR_BASE64SRC_PARSE'))
return
}
const fs = uni.getFileSystemManager()
const filePath = `${uni.env.USER_DATA_PATH}/${Date.now()}.${format}`
fs.writeFile({
filePath,
data: base64.split(',')[1],
encoding: 'base64',
success() {
resolve(filePath)
},
fail(err) {
console.error(err)
reject(err)
}
})
// #endif
}) })
} }
@ -230,7 +251,7 @@ export function pathToBase64(path) {
} }
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => { plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => {
entry.file((file) => { entry.file((file) => {
const fileReader = new plus.io.FileReader() const fileReader = new plus.io.FileReader()
@ -244,6 +265,22 @@ export function pathToBase64(path) {
}, reject) }, reject)
}, reject) }, reject)
// #endif // #endif
// #ifdef APP-HARMONY
uni.getFileSystemManager().readFile({
filePath: path,
encoding: 'base64',
success: (res) => {
const ext = (path.split('.').pop() || 'png').toLowerCase().replace(/\?.*$/, '')
const mime = ext === 'jpg' || ext === 'jpeg' ? 'jpeg' : (ext === 'gif' ? 'gif' : 'png')
resolve(`data:image/${mime};base64,${res.data}`)
},
fail: (error) => {
console.error({error, path})
reject(error)
}
})
// #endif
}) })
} }
@ -258,7 +295,7 @@ export function getImageInfo(path, useCORS) {
resolve(cache[path]) resolve(cache[path])
} else { } else {
try { try {
// #ifdef MP || APP-PLUS // #ifdef MP || APP-PLUS || APP-HARMONY
if (isBase64(path) && (isCanvas2D ? isPC : true)) { if (isBase64(path) && (isCanvas2D ? isPC : true)) {
src = await base64ToPath(path) src = await base64ToPath(path)
} }
@ -313,7 +350,7 @@ export function getImageInfo(path, useCORS) {
img.src = src img.src = src
return return
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
// console.log('getImageInfo', +new Date() - time) // console.log('getImageInfo', +new Date() - time)
// ios 比较严格 可能需要设置跨域 // ios 比较严格 可能需要设置跨域
if(uni.getSystemInfoSync().osName == 'ios' && useCORS) { if(uni.getSystemInfoSync().osName == 'ios' && useCORS) {
@ -341,7 +378,7 @@ export function getImageInfo(path, useCORS) {
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
const getLocalFilePath = (path) => { const getLocalFilePath = (path) => {
if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path
.indexOf('_downloads') === 0) { .indexOf('_downloads') === 0) {

View File

@ -36,7 +36,7 @@ export function arrayBufferToFile(buffer: ArrayBuffer | Blob, name?: string, for
resolve(file) resolve(file)
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()) const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
const base64 = uni.arrayBufferToBase64(buffer) const base64 = uni.arrayBufferToBase64(buffer)
bitmap.loadBase64Data(base64, () => { bitmap.loadBase64Data(base64, () => {

View File

@ -48,7 +48,7 @@ export function base64ToPath(base64: string, filename?: string):Promise<string>
}))) })))
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()) const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
bitmap.loadBase64Data(base64, () => { bitmap.loadBase64Data(base64, () => {
if (!filename && !format) { if (!filename && !format) {
@ -71,5 +71,26 @@ export function base64ToPath(base64: string, filename?: string):Promise<string>
reject(error) reject(error)
}) })
// #endif // #endif
// #ifdef APP-HARMONY
if (!filename && !format) {
reject(new Error('ERROR_BASE64SRC_PARSE'))
return
}
const name = filename || `${new Date().getTime()}.${format}`
const filePath = `${uni.env.USER_DATA_PATH}/${name}`
uni.getFileSystemManager().writeFile({
filePath,
data: base64.split(',')[1],
encoding: 'base64',
success() {
resolve(filePath)
},
fail(err) {
console.error(err)
reject(err)
}
})
// #endif
}) })
} }

View File

@ -4,12 +4,19 @@ export const getLocalFilePath = (path : string) => {
if (typeof plus == 'undefined') return path if (typeof plus == 'undefined') return path
if (/^(_www|_doc|_documents|_downloads|file:\/\/|\/storage\/emulated\/0\/)/.test(path)) return path if (/^(_www|_doc|_documents|_downloads|file:\/\/|\/storage\/emulated\/0\/)/.test(path)) return path
if (/^\//.test(path)) { if (/^\//.test(path)) {
let handled = false
// #ifdef APP-PLUS&&!APP-HARMONY
const localFilePath = plus.io.convertAbsoluteFileSystem(path) const localFilePath = plus.io.convertAbsoluteFileSystem(path)
if (localFilePath !== path) { if (localFilePath !== path) {
return localFilePath return localFilePath
} else { } else {
path = path.slice(1) path = path.slice(1)
} }
handled = true
// #endif
if (!handled) {
path = path.slice(1)
}
} }
return '_www/' + path return '_www/' + path
} }

View File

@ -1,6 +1,6 @@
// @ts-nocheck // @ts-nocheck
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
import { getLocalFilePath } from '../getLocalFilePath' import { getLocalFilePath } from '../getLocalFilePath'
// #endif // #endif
function isImage(extension : string) { function isImage(extension : string) {
@ -102,7 +102,7 @@ export function pathToBase64(path : string) : Promise<string> {
} }
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => { plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => {
entry.file((file : any) => { entry.file((file : any) => {
const fileReader = new plus.io.FileReader() const fileReader = new plus.io.FileReader()
@ -117,5 +117,19 @@ export function pathToBase64(path : string) : Promise<string> {
}, reject) }, reject)
}, reject) }, reject)
// #endif // #endif
// #ifdef APP-HARMONY
uni.getFileSystemManager().readFile({
filePath: path,
encoding: 'base64',
success: (res) => {
resolve(`data:${prefix}${extension};base64,${res.data}`)
},
fail: (error) => {
console.error({ error, path })
reject(error)
}
})
// #endif
}) })
} }

View File

@ -86,7 +86,7 @@
return this.href.startsWith('tel:'); return this.href.startsWith('tel:');
}, },
openURL() { openURL() {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
if (this.isTel()) { if (this.isTel()) {
this.makePhoneCall(this.href.replace('tel:', '')); this.makePhoneCall(this.href.replace('tel:', ''));
} else { } else {

View File

@ -194,30 +194,27 @@
this.searchVal = "" this.searchVal = ""
this.show = false this.show = false
this.showSync = false this.showSync = false
// #ifndef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
uni.hideKeyboard()
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord() plus.key.hideSoftKeybord()
// #else
uni.hideKeyboard()
// #endif // #endif
}, },
confirm() { confirm() {
// #ifndef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
uni.hideKeyboard();
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord() plus.key.hideSoftKeybord()
// #else
uni.hideKeyboard();
// #endif // #endif
this.$emit("confirm", { this.$emit("confirm", {
value: this.searchVal value: this.searchVal
}) })
}, },
blur() { blur() {
// #ifndef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
uni.hideKeyboard();
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord() plus.key.hideSoftKeybord()
// #else
uni.hideKeyboard();
// #endif // #endif
this.$emit("blur", { this.$emit("blur", {
value: this.searchVal value: this.searchVal

View File

@ -473,7 +473,7 @@ export const util = {
const isAndroid = uni.getSystemInfoSync().platform === 'android'; const isAndroid = uni.getSystemInfoSync().platform === 'android';
if (isAndroid) { if (isAndroid) {
try { try {
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
if (plus.os.name === 'Android') { if (plus.os.name === 'Android') {
let color = plus.android.newObject("android.graphics.Color"); let color = plus.android.newObject("android.graphics.Color");
let activity = plus.android.runtimeMainActivity(); let activity = plus.android.runtimeMainActivity();
@ -641,16 +641,16 @@ export const imgLocal = {
// 2. 命中缓存 // 2. 命中缓存
if (cache[key]) { if (cache[key]) {
let resultPath = cache[key]; let resultPath = cache[key];
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
// iOS/Android 编译刷新后沙盒绝对路径的 UUID 会变!必须用相对路径重新计算最新绝对路径 // iOS/Android 编译刷新后沙盒绝对路径的 UUID 会变!必须用相对路径重新计算最新绝对路径
resultPath = plus.io.convertLocalFileSystemURL(`_doc/img_cache/${key}.jpg`); resultPath = plus.io.convertLocalFileSystemURL(`_doc/img_cache/${key}.jpg`);
// #endif // #endif
return resolve(resultPath); return resolve(resultPath);
} }
const config = uni.getStorageSync('config') const config = uni.getStorageSync('config')
let imgConfig = config.config['client.uniapp.img_path']?.alipay || 'http://cdn.u8t.cn/flaunt/uni_mp/img/alipay/static/image/' let imgConfig = config?.config?.['client.uniapp.img_path']?.alipay || 'http://cdn.u8t.cn/flaunt/uni_mp/img/alipay/static/image/'
url = imgConfig + url url = imgConfig + url
// #ifdef APP-PLUS // #ifdef APP-PLUS&&!APP-HARMONY
const filename = `_doc/img_cache/${key}.jpg`; const filename = `_doc/img_cache/${key}.jpg`;
const task = plus.downloader.createDownload( const task = plus.downloader.createDownload(
@ -672,9 +672,7 @@ export const imgLocal = {
); );
task.start(); task.start();
// #endif // #else
// #ifndef APP-PLUS
uni.downloadFile({ uni.downloadFile({
url, url,
success: (res) => { success: (res) => {

View File

@ -7,6 +7,7 @@ import pageData from "@/static/json/page.json"
import { import {
jsonString jsonString
} from "../uni_modules/uv-ui-tools/libs/function/test"; } from "../uni_modules/uv-ui-tools/libs/function/test";
import '@batiao/batiao-sdk-uniapp-unimp';
export default { export default {
install(app, options) { install(app, options) {
@ -156,48 +157,67 @@ export default {
}; };
// 请求 // 请求
app.config.globalProperties.$requestPromise = async (data, isCode = true) => { app.config.globalProperties.$requestPromise = async (data,isCode=true) => {
//头部header let isTest = uni.getStorageSync('isTest')
let header = uni.getStorageSync('header') //头部header浅拷贝避免改到 storage 缓存对象)
let header = { ...(uni.getStorageSync('header') || {}) }
//请求地址 //请求地址
let host = uni.getStorageSync('host') + data.url let host
// #ifdef H5
host = data.url
// #endif
// #ifndef H5
host = uni.getStorageSync('host') + data.url
// #endif
// 签名 // 签名
if (isCode) { if(isCode){
data = sign(data) if(isTest){
} else { data = sign(data)
host = "http://10.3.0.24:9209/" + data.url }
header['x-token'] = "bdf87a98-eef0-47df-9faf-41d547b0457e"
}else{
host="http://10.3.0.24:9209/"+ data.url
header['x-token']="bdf87a98-eef0-47df-9faf-41d547b0457e"
} }
// 排序 // 排序
const sortedKeys = Object.keys(data.data).sort(); const sortedKeys = Object.keys(data.data).sort();
let str = '' let str = ''
for (const key of sortedKeys) { for (const key of sortedKeys) {
if (!(data.url == 'api/image/segment/base64' && key == 'file')) { str += '&' + key + '=' + encodeURIComponent(
str += '&' + key + '=' + encodeURIComponent(data.data[key]); data.data[key] == null ? '' : String(data.data[key])
} );
} }
str = str.replace('&', '?') str = str.replace('&', '?')
host = host + str // 拼接URL
console.log(host) if(isTest){
console.log(data) host = host + str
}
// 鸿蒙 GET/DELETE 若再传 data 会二次拼进 query导致参数异常参数已在 URL 中
let requestData = data.data
// #ifdef APP-HARMONY
const method = (data.method || 'GET').toUpperCase()
if (method === 'GET' || method === 'DELETE') {
requestData = {}
}
// #endif
// 测试环境用 uni.request正式环境用宿主 nativeRequest
const api = isTest
? uni.request
: (uni.nativeRequest || uni.request)
const response = await new Promise((resolve, reject) => { const response = await new Promise((resolve, reject) => {
uni.request({ api({
url: host, url: host,
method: data.method, method: data.method,
data: data.data, data: requestData,
params: requestData,
header, header,
success: res => { success: res => {
console.log(res)
try { try {
if (isCode) { if(isCode&&isTest){
res.data = deCode(res.data.data) res.data = deCode(res.data.data)
console.log(res.data)
} else {
res.data = res.data.data
} }
} catch (err) { } catch (err) {
console.log(err);
} }
resolve(res.data); resolve(res.data);
}, },

View File

@ -4,7 +4,8 @@ import {
} from "../uni_modules/uv-ui-tools/libs/function/index.js"; } from "../uni_modules/uv-ui-tools/libs/function/index.js";
import CryptoJS from "crypto-js"; import CryptoJS from "crypto-js";
// import pageData from "@/static/json/page.json" import '@batiao/batiao-sdk-uniapp-unimp';
import pageData from "@/static/json/page.json";
async function apiUserEvent(type, adminData, uniData) { async function apiUserEvent(type, adminData, uniData) {
let uni_version = uni.getStorageSync("version") let uni_version = uni.getStorageSync("version")
@ -118,62 +119,69 @@ function generateUUID() {
// 主请求函数 // 主请求函数
const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json") => { const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json") => {
let isTest = uni.getStorageSync('isTest')
let currentUrl let currentUrl
// try { try {
// let pages = getCurrentPages(); let pages = getCurrentPages();
// let currentPage = pages[pages.length - 2]; let currentPage = pages[pages.length - 2];
// currentUrl = currentPage.route; currentUrl = currentPage.route;
// currentUrl = pageData[currentUrl] currentUrl = pageData[currentUrl]
// } catch (e) { } catch (e) {
// } }
let q = serverUrl let q=serverUrl
// 头部header // 头部header
let header = uni.getStorageSync('header') || {}; let header = uni.getStorageSync('header') || {};
// 请求地址 // 请求地址
serverUrl = uni.getStorageSync('host') || serverUrl; serverUrl = uni.getStorageSync('host') || serverUrl;
if (q == 'test') { if(q=='test'){
serverUrl = "http://10.3.0.24:9209/" serverUrl="http://10.3.0.24:9209/"
header['x-token'] = "bdf87a98-eef0-47df-9faf-41d547b0457e" header['x-token']="bdf87a98-eef0-47df-9faf-41d547b0457e"
} }
let url = domianUrl(serverUrl, domainUrl); let url = domianUrl(serverUrl, domainUrl);
if (q != 'test') { if(q!='test'){
params = deepClone(params); params = deepClone(params);
} }
var key = uni.getStorageSync('encrypt') || "default_encrypt_key"; var key = uni.getStorageSync('encrypt') || "default_encrypt_key";
let data = {}; let data = {};
console.log("传参", method === "GET" || method === "DELETE" || q == 'q') if (method === "GET" || method === "DELETE"||q=='q') {
if (method === "GET" || method === "DELETE" || q == 'q') { let urls = url
params.timestamp = Math.floor(new Date().getTime() / 1000); if(isTest){
params.nonce = generateUUID(); params.timestamp = Math.floor(new Date().getTime() / 1000);
let keys = Object.keys(params); params.nonce = generateUUID();
keys.sort(); let keys = Object.keys(params);
for (let i in keys) { keys.sort();
keys[i] = keys[i] + "=" + encodeURIComponent(params[keys[i]]); for (let i in keys) {
keys[i] = keys[i] + "=" + encodeURIComponent(params[keys[i]]);
}
let temp = keys.join("&") + "&" + CryptoJS.MD5(key).toString();
params.signature = CryptoJS.MD5(temp).toString();
urls = url + "?" + (isTest ? encodeParam(params): encodeParam(params));
} }
let temp = keys.join("&") + "&" + CryptoJS.MD5(key).toString();
params.signature = CryptoJS.MD5(temp).toString();
data = { data = {
url: url + "?" + encodeParam(params), url:urls,
method, method,
data: params,
header: header // setheader(dataType, header), header: header // setheader(dataType, header),
}; };
} else if (method === "POST" || method === "PUT") { } else if (method === "POST" || method === "PUT") {
let temp = decodeParam(url); if(isTest){
temp.timestamp = Math.floor(new Date().getTime() / 1000); let temp = decodeParam(url);
temp.nonce = generateUUID(); temp.timestamp = Math.floor(new Date().getTime() / 1000);
let keys = Object.keys(temp); temp.nonce = generateUUID();
keys.sort(); let keys = Object.keys(temp);
for (let i in keys) { keys.sort();
keys[i] = keys[i] + "=" + encodeURIComponent(temp[keys[i]]); for (let i in keys) {
keys[i] = keys[i] + "=" + encodeURIComponent(temp[keys[i]]);
}
let s = keys.join("&");
s += "&" + JSON.stringify(params);
s += "&" + CryptoJS.MD5(key).toString();
temp.signature = CryptoJS.MD5(s).toString();
url = url.split("?")[0] + "?" + temp;
url = url.split("?")[0] + "?" + encodeParam(temp);
} }
let s = keys.join("&");
s += "&" + JSON.stringify(params);
s += "&" + CryptoJS.MD5(key).toString();
temp.signature = CryptoJS.MD5(s).toString();
url = url.split("?")[0] + "?" + encodeParam(temp);
data = { data = {
url, url,
method, method,
@ -182,20 +190,21 @@ const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json"
}; };
} }
console.log("传参详情", data) console.log("传参详情",data)
// 测试环境用 uni.request正式环境用宿主 nativeRequest
const api = isTest
? uni.request
: (uni.nativeRequest || uni.request)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request(data).then(res => { api(data).then(res => {
console.log(deCode(res.data.data))
if (res.statusCode == 200) { if (res.statusCode == 200) {
if (res.data.encrypt) { if (res.data.encrypt) {
if (q != 'test') { if(q!='test'&&isTest){
res.data = deCode(res.data.data); res.data = deCode(res.data.data);
} else {
res.data = res.data.data
} }
console.log(res.data)
// res.data = res.data.data
} }
console.log(res.data)
if (res.data.code == 1001003 || res.data.code == 1001004 || res.data.code == 1001005) { if (res.data.code == 1001003 || res.data.code == 1001004 || res.data.code == 1001005) {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
@ -205,7 +214,6 @@ const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json"
return reject(res); return reject(res);
} else if (res.data.code != 0) { } else if (res.data.code != 0) {
if (data.method == 'POST' && domainUrl == 'api/order') { if (data.method == 'POST' && domainUrl == 'api/order') {
apiUserEvent('all', { apiUserEvent('all', {
type: "event", type: "event",
key: "order_fail", key: "order_fail",
@ -227,7 +235,6 @@ const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json"
title: res.data.message title: res.data.message
}) })
} }
uni.hideLoading(); uni.hideLoading();
return resolve(res); return resolve(res);
} }
@ -249,11 +256,11 @@ const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json"
} }
}) })
} }
console.log(123)
resolve(res.data); resolve(res.data);
} else { } else {
// InnerApp.addRequestLog(url, data, res) // InnerApp.addRequestLog(url, data, res)
reject(res); resolve(res);
} }
}).catch(err => { }).catch(err => {
if (err.errMsg == 'request:fail timeout') { if (err.errMsg == 'request:fail timeout') {
@ -272,12 +279,26 @@ const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json"
err: JSON.stringify(err) err: JSON.stringify(err)
} }
}) })
// uni.showModal({
// title: '提示',
// content: JSON.stringify(err),
// success: function (res) {
// if (res.confirm) {
// console.log('用户点击确定');
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// uniToast('服务器繁忙');
} }
// InnerApp.addRequestLog(url, data, err)
reject(err); reject(err);
}); });
}); });
}; };
/** /**
* 处理请求头 * 处理请求头
* @param dataType 是否json格式 * @param dataType 是否json格式
@ -330,16 +351,15 @@ const setheader = (dataType, baseHeader = {}) => {
* @param domainUrl 接口路径 * @param domainUrl 接口路径
*/ */
const domianUrl = (serveUrl, domainUrl) => { const domianUrl = (serveUrl, domainUrl) => {
let finalUrl=''
// #ifdef H5 // #ifdef H5
// H5环境下使用相对路径走 vite 代理,避免 CORS 跨域问题 // H5环境下使用相对路径走 vite 代理,避免 CORS 跨域问题
const finalUrl = domainUrl.startsWith('/') ? domainUrl : '/' + domainUrl; finalUrl = domainUrl.startsWith('/') ? domainUrl : '/' + domainUrl;
console.log('[H5代理] 原始URL:', domainUrl, '→ 代理URL:', finalUrl); console.log('[H5代理] 原始URL:', domainUrl, '→ 代理URL:', finalUrl);
return finalUrl;
// #endif // #endif
// #ifndef H5 // #ifndef H5
// 非H5环境APP、小程序等使用完整URL // 非H5环境APP、小程序等使用完整URL
let finalUrl;
if (serveUrl.endsWith('/') && domainUrl.startsWith('/')) { if (serveUrl.endsWith('/') && domainUrl.startsWith('/')) {
finalUrl = serveUrl + domainUrl.substring(1); finalUrl = serveUrl + domainUrl.substring(1);
} else if (!serveUrl.endsWith('/') && !domainUrl.startsWith('/')) { } else if (!serveUrl.endsWith('/') && !domainUrl.startsWith('/')) {
@ -348,8 +368,8 @@ const domianUrl = (serveUrl, domainUrl) => {
finalUrl = serveUrl + domainUrl; finalUrl = serveUrl + domainUrl;
} }
console.log('[非H5] 完整URL:', finalUrl); console.log('[非H5] 完整URL:', finalUrl);
return finalUrl;
// #endif // #endif
return finalUrl;
}; };
/** /**