This commit is contained in:
zpc 2025-06-07 20:51:35 +08:00
parent 553163ca7c
commit 603bae7a95
6 changed files with 381 additions and 333 deletions

469
App.vue
View File

@ -1,263 +1,264 @@
<script>
import Vue from "vue";
//
import Vue from "vue";
//
export default {
data() {
return {
isFirstLaunch: true, //
}
},
onLaunch: function (options) {
// console.log("App Launch", options, window.location.href);
var that = this;
this.$config.init().then(async (data) => {
//
let src = await that.$config.getAppSettingAsync("win_audio");
if (src == null || src == "") {
src = that.$img("/static/mp3/open.mp3");
export default {
data() {
return {
isFirstLaunch: true, //
}
//
const openBgm = uni.createInnerAudioContext();
Vue.prototype.bgmCtx = {};
openBgm.src = src;
openBgm.sessionCategory="playback";
openBgm.onPlay(() => {
console.log('开始播放抽奖弹窗播放');
});
openBgm.onPause(() => {
console.log('播放抽奖弹窗音乐暂停');
});
openBgm.onStop(() => {
console.log('播放抽奖弹窗音乐停止');
});
openBgm.onError((res) => {
console.log('播放抽奖弹窗失败');
console.log(res.errMsg);
console.log(res.errCode);
});
Vue.prototype.bgmCtx.openBgm = openBgm;
//
let src2 = await that.$config.getAppSettingAsync("win_audio2");
if (src2 == null || src2 == "") {
src2 = that.$img("/static/mp3/slot_open.mp3");
}
//
const slotBgm = uni.createInnerAudioContext();
// Vue.prototype.bgmCtx = {};
slotBgm.src = src2;
Vue.prototype.bgmCtx.slotBgm = slotBgm;
},
onLaunch: function(options) {
// console.log("App Launch", options, window.location.href);
var that = this;
//
//
let src3 = await that.$config.getAppSettingAsync("win_audio3");
if (src3 == null || src3 == "") {
src3 = that.$img("/static/mp3/chaoshen.mp3");
}
//
const csBgm = uni.createInnerAudioContext();
// Vue.prototype.bgmCtx = {};
csBgm.src = src3;
Vue.prototype.bgmCtx.csBgm = csBgm;
});
//
this.callLoginRecordApi();
/* 重置首页公告弹窗状态 */
uni.setStorageSync("_is_this_show", false);
/* 清除缓存中的广告id */
uni.removeStorageSync("_ad_id");
/* 清除缓存中的click_id */
uni.removeStorageSync("_click_id");
//
this.$platform.AppLaunch(options);
},
onShow: function () {
console.log("App Show");
},
onHide: function () {
console.log("App Hide");
},
methods: {
//
callLoginRecordApi() {
//
const token = uni.getStorageSync('token');
if (!token) {
console.log('用户未登录,不调用登录记录接口');
return;
}
this.req({
url: 'login_record',
method: 'POST',
success: (res) => {
console.log('登录记录接口调用成功', res);
},
fail: (err) => {
console.log('登录记录接口调用失败', err);
this.$config.init().then(async (data) => {
//
let src = await that.$config.getAppSettingAsync("win_audio");
if (src == null || src == "") {
src = that.$img("/static/mp3/open.mp3");
}
//
const openBgm = uni.createInnerAudioContext();
Vue.prototype.bgmCtx = {};
openBgm.src = src;
openBgm.sessionCategory = "playback";
openBgm.onPlay(() => {
console.log('开始播放抽奖弹窗播放');
});
openBgm.onPause(() => {
console.log('播放抽奖弹窗音乐暂停');
});
openBgm.onStop(() => {
console.log('播放抽奖弹窗音乐停止');
});
openBgm.onError((res) => {
console.log('播放抽奖弹窗失败');
console.log(res.errMsg);
console.log(res.errCode);
});
Vue.prototype.bgmCtx.openBgm = openBgm;
//
let src2 = await that.$config.getAppSettingAsync("win_audio2");
if (src2 == null || src2 == "") {
src2 = that.$img("/static/mp3/slot_open.mp3");
}
//
const slotBgm = uni.createInnerAudioContext();
// Vue.prototype.bgmCtx = {};
slotBgm.src = src2;
Vue.prototype.bgmCtx.slotBgm = slotBgm;
//
let src3 = await that.$config.getAppSettingAsync("win_audio3");
if (src3 == null || src3 == "") {
src3 = that.$img("/static/mp3/chaoshen.mp3");
}
//
const csBgm = uni.createInnerAudioContext();
// Vue.prototype.bgmCtx = {};
csBgm.src = src3;
Vue.prototype.bgmCtx.csBgm = csBgm;
});
//
this.callLoginRecordApi();
/* 重置首页公告弹窗状态 */
uni.setStorageSync("_is_this_show", false);
/* 清除缓存中的广告id */
uni.removeStorageSync("_ad_id");
/* 清除缓存中的click_id */
uni.removeStorageSync("_click_id");
//
this.$platform.AppLaunch(options);
},
onShow: function() {
console.log("App Show");
},
onHide: function() {
console.log("App Hide");
},
methods: {
//
callLoginRecordApi() {
//
const token = uni.getStorageSync('token');
if (!token) {
console.log('用户未登录,不调用登录记录接口');
return;
}
this.req({
url: 'login_record',
method: 'POST',
success: (res) => {
console.log('登录记录接口调用成功', res);
},
fail: (err) => {
console.log('登录记录接口调用失败', err);
}
});
}
}
}
};
};
</script>
<style lang="scss">
/*每个页面公共css */
@import "./common/animate.css";
@import url("./common/common.css");
/*每个页面公共css */
@import "./common/animate.css";
@import url("./common/common.css");
uni-tabbar {
display: block;
box-sizing: border-box;
width: 100%;
z-index: 97 !important;
}
/* 引入字体 */
@font-face {
font-family: "YouSheBiaoTiHei";
src: url($imgurl + "font/YouSheBiaoTiHei.ttf") format("truetype");
}
@font-face {
font-family: "zihun152hao-jijiachaojihei";
src: url($imgurl + "font/zihun152hao-jijiachaojihei.TTF") format("truetype");
}
@font-face {
font-family: "zihun147hao-xingyuanhei";
src: url($imgurl + "font/zihun147hao-xingyuanhei.TTF") format("truetype");
}
page {
overflow-x: hidden;
&:before {
content: "";
position: fixed;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #1c1b20;
}
}
.ziti {
font-family: YouSheBiaoTiHei;
}
.flex_center {
display: flex;
align-items: center;
}
.hang2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-wrap: break-word;
word-break: break-all;
}
.hang1 {
overflow: hidden;
/*超出部分隐藏*/
white-space: nowrap;
/*不换行*/
text-overflow: ellipsis;
/*超出部分文字以...显示*/
}
.icon {
display: flex;
justify-content: center;
align-items: center;
image {
uni-tabbar {
display: block;
box-sizing: border-box;
width: 100%;
height: 100%;
z-index: 97 !important;
}
}
.common_bg {
background-repeat: no-repeat;
background-position: 0 0;
background-size: 100% 100%;
}
/* 引入字体 */
@font-face {
font-family: "YouSheBiaoTiHei";
src: url($imgurl + "font/YouSheBiaoTiHei.ttf") format("truetype");
}
.relative {
position: relative;
}
@font-face {
font-family: "zihun152hao-jijiachaojihei";
src: url($imgurl + "font/zihun152hao-jijiachaojihei.TTF") format("truetype");
}
button.hide {
position: absolute;
width: 100% !important;
height: 100% !important;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
@font-face {
font-family: "zihun147hao-xingyuanhei";
src: url($imgurl + "font/zihun147hao-xingyuanhei.TTF") format("truetype");
}
/* 重写组件样式 */
::v-deep.uni-noticebar {
padding: 0 !important;
margin: 0 !important;
}
page {
overflow-x: hidden;
::v-deep.mescroll-upwarp {
box-sizing: border-box;
min-height: 55px;
padding: 15px 0;
text-align: center;
clear: both;
}
&:before {
content: "";
position: fixed;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #1c1b20;
}
}
::v-deep.cmd-progress-outer {
line-height: 0;
.ziti {
font-family: YouSheBiaoTiHei;
}
.cmd-progress-bg {
.flex_center {
display: flex;
align-items: center;
}
.hang2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-wrap: break-word;
word-break: break-all;
}
.hang1 {
overflow: hidden;
/*超出部分隐藏*/
white-space: nowrap;
/*不换行*/
text-overflow: ellipsis;
/*超出部分文字以...显示*/
}
.icon {
display: flex;
justify-content: center;
align-items: center;
image {
width: 100%;
height: 100%;
}
}
.common_bg {
background-repeat: no-repeat;
background-position: 0 0;
background-size: 100% 100%;
}
.relative {
position: relative;
}
button.hide {
position: absolute;
width: 100% !important;
height: 100% !important;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
/* 重写组件样式 */
::v-deep.uni-noticebar {
padding: 0 !important;
margin: 0 !important;
}
}
.uni-tabbar__bd {
height: 50px !important;
}
.uni-tabbar__icon {
height: 50px !important;
}
@keyframes m-zoom {
0% {
transform: scale(1);
::v-deep.mescroll-upwarp {
box-sizing: border-box;
min-height: 55px;
padding: 15px 0;
text-align: center;
clear: both;
}
50% {
transform: scale(0.9);
::v-deep.cmd-progress-outer {
line-height: 0;
.cmd-progress-bg {
margin: 0 !important;
}
}
100% {
transform: scale(1);
.uni-tabbar__bd {
height: 50px !important;
}
.uni-tabbar__icon {
height: 50px !important;
}
@keyframes m-zoom {
0% {
transform: scale(1);
}
50% {
transform: scale(0.9);
}
100% {
transform: scale(1);
}
}
}
</style>

View File

@ -13,6 +13,7 @@ const wx_version = "111";
// 白名单页面(不需要登录即可访问)
export const whiteList = [
"pages/shouye/index", // 首页
"pages/index/index",
"pages/shouye/detail", // 详情页
"pages/shouye/huanxiang", // 换箱页面
"pages/mall/index", // 商城首页

View File

@ -2,12 +2,16 @@ import Vue from 'vue'
import App from './App'
import Mixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'
import common from '@/common/common.js'
import { gotopage } from '@/common/gotopage.js'
import {
gotopage
} from '@/common/gotopage.js'
import router from '@/common/router.js'
import ConfigManager from '@/common/config.js'
import RequestManager from '@/common/request.js'
import EnvConfig from '@/common/env.js'
import { platform } from '@/common/platform/PlatformFactory'
import {
platform
} from '@/common/platform/PlatformFactory'
// 全局注册uni-popup组件
import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
@ -48,7 +52,6 @@ function loadScript(url) {
loadScript('https://res.wx.qq.com/open/js/jweixin-1.6.0.js')
// #endif
Vue.config.productionTip = false
Vue.mixin(Mixin)

View File

@ -1,121 +1,164 @@
<template>
<view class="index-page">
<view class="about-container">
<image class="app-icon" src="https://image.zfunbox.cn/icon_108.png" mode="aspectFit" @click="handleIconClick">
</image>
<image src="https://image.zfunbox.cn/app/index_login.gif" style="width: 200rpx;height: 200rpx"></image>
<view class="index-page">
<view class="about-container">
<image class="app-icon" :src="icon" mode="aspectFit">
</image>
<image :src="login_icon" style="width: 200rpx;height: 200rpx"></image>
<view>{{ tips }}</view>
</view>
</view>
</view>
</template>
<script>
import PageContainer from '@/components/page-container/page-container.vue'
import PageContainer from '@/components/page-container/page-container.vue'
export default {
components: {
PageContainer
},
data() {
return {
userinfo: null,
clickCount: 0,
lastClickTime: 0,
isTestMode: false,
logEnabled: false,
version: '',
domain: ''
}
},
onLoad() {
this.load();
},
methods: {
async load() {
export default {
components: {
PageContainer
},
data() {
let icon = "https://image.zfunbox.cn/icon_108.png";
let login_icon = "https://image.zfunbox.cn/app/index_login.gif";
// #ifdef APP
icon = "/static/app-plus/icon_108.png";
login_icon = "/static/app-plus/index_login.gif";
// #endif
return {
icon: icon,
login_icon: login_icon,
tips: "正在加载中。。。"
}
},
onLoad() {
this.load();
},
methods: {
async load() {
var that = this;
uni.getNetworkType({
success(res) {
if (res.networkType === 'none') {
// uni.hi
uni.hideToast();
//
console.log('无网络连接或权限被拒绝');
that.tips = "无网络连接或权限被拒绝";
uni.onNetworkStatusChange(function(res) {
console.log('网络状态变化:', res.isConnected, res.networkType);
if (res.isConnected) {
//
that.tips = "正在加载中。。。";
// #ifdef APP
if (plus.runtime.restart) {
plus.runtime.restart();
} else {
uni.showToast({
title: "重启失败",
icon: "none"
});
}
// #endif
} else {
//
that.tips = "网络断开";
}
});
} else {
//
console.log('网络权限已授予');
}
},
fail() {
//
console.log('获取网络状态失败,可能无权限');
}
});
},
}
}
}
</script>
<style lang="scss">
.index-page {
width: 100vw;
height: 100vh;
background-color: #f8f8f8;
}
.about-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
.app-icon {
width: 96px;
height: 96px;
margin-top: 20vh;
border-radius: 50%;
.index-page {
width: 100vw;
height: 100vh;
background-color: #f8f8f8;
}
.app-info {
margin-top: 20px;
text-align: center;
.about-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
.app-name {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
.app-icon {
width: 96px;
height: 96px;
margin-top: 20vh;
border-radius: 50%;
}
.app-version {
font-size: 14px;
color: #666;
margin-bottom: 5px;
}
}
.test-mode-container {
margin-top: 30px;
border: 1px dashed #ff6600;
border-radius: 8px;
padding: 15px;
width: 80%;
.test-mode-content {
width: 100%;
}
.test-mode-title {
.app-info {
margin-top: 20px;
text-align: center;
font-weight: bold;
font-size: 16px;
color: #ff6600;
margin-bottom: 15px;
.app-name {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.app-version {
font-size: 14px;
color: #666;
margin-bottom: 5px;
}
}
.test-mode-item {
margin: 10px 0;
font-size: 14px;
}
.test-mode-container {
margin-top: 30px;
border: 1px dashed #ff6600;
border-radius: 8px;
padding: 15px;
width: 80%;
.button-group {
display: flex;
justify-content: space-between;
}
.test-mode-content {
width: 100%;
}
.log-button {
width: 48%;
margin: 0;
}
.test-mode-title {
text-align: center;
font-weight: bold;
font-size: 16px;
color: #ff6600;
margin-bottom: 15px;
}
.test-button {
margin-top: 15px;
background-color: #ff6600;
color: white;
font-size: 14px;
.test-mode-item {
margin: 10px 0;
font-size: 14px;
}
.button-group {
display: flex;
justify-content: space-between;
}
.log-button {
width: 48%;
margin: 0;
}
.test-button {
margin-top: 15px;
background-color: #ff6600;
color: white;
font-size: 14px;
}
}
}
}
</style>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB