Commit a2112175 吴良建

第一次提交

0 个父辈
正在显示 198 个修改的文件 包含 4953 行增加0 行删除
node_modules/
unpackage/
dist/**
package/android/HBuilder-Integrate-AS/simpleDemo/src/main/assets/apps/**
package/android/HBuilder-Integrate-AS/simpleDemo/release/**
.project
.DS_Store
.hbuilderx/
.vite/
此文件的差异被折叠, 点击展开。
<template>
<view>
<view v-if="loading"
style="width: 50vw; height: 70vh; display: flex; justify-items: center; align-items: center;">
<view
style="width: 50vw; height: 100%; display: flex; justify-items: center; align-items: center; align-content: center; justify-content: center; ">
<image style="width: 63px; height: 34px;" src="../../static/loading_icon.gif"></image>
</view>
</view>
<view v-if="!loading">
<view class="charts-box">
<qiun-data-charts type="radar" :opts="opts" :chartData="chartData" :canvas2d="true"/>
</view>
<view class="content"
style="display: flex; flex-direction: row; padding-left: 13px; padding-right: 13px; margin-top: 11px;">
<view
style="display: flex; flex: 1; flex-direction: column; padding-right: 14px ; padding-bottom: 7px; ">
<view class="text2" style="text-align: right;">{{host.win_avg_balls}}</view>
<view class="text" style="text-align: right;">主队均进球</view>
</view>
<view
style="display: flex; flex: 1; flex-direction: column; padding-left: 14px; border-left: 1px solid #E8EFFF; padding-bottom: 7px; ">
<view class="text2" style="text-align: left;">{{guest.win_avg_balls}}</view>
<view class="text" style="text-align: left;">客队均进球</view>
</view>
</view>
<view class="content"
style="display: flex; flex-direction: row; border-top:1px solid ; border-color: #E8EFFF; margin-bottom: 17px; margin-left: 13px; margin-right: 13px;">
<view style="display: flex; flex: 1; flex-direction: column; padding-right: 14px; padding-top: 7px">
<view class="text2" style="text-align: right;">{{host.lose_avg_balls}}</view>
<view class="text" style="text-align: right;">主队均失球</view>
</view>
<view
style="display: flex; flex: 1; flex-direction: column; padding-left: 14px; border-left: 1px solid #E8EFFF; padding-top: 7px">
<view class="text2" style="text-align: left;">{{guest.lose_avg_balls}}</view>
<view class="text" style="text-align: left;">客队均失球</view>
</view>
</view>
<view style="display: flex; justify-content: space-between; padding-left: 14px; padding-right: 14px;">
<image style="width: 18px; height: 18px; border-radius: 18px;" :src="data_info.HostTeam.LogoFullPath" />
<view class="title">综合能力</view>
<image style="width: 18px; height: 18px; border-radius: 18px;"
:src="data_info.GuestTeam.LogoFullPath" />
</view>
<view style="display: flex; width: 90%; margin-top: 15px; margin-left: 14px; margin-right: 14px;">
<view class="left-bar" :style="'width:' + host.rate">{{host.rate}}</view>
<view class="right-bar" :style="'width:' + guest.rate">{{guest.rate}}</view>
</view>
<view class="text3">{{radar_chart_data.predict_value}}</view>
<view class="button" @click="toDetail(select_data)">详情分析</view>
</view>
</view>
</template>
<script>
import {
default as http
} from "@/utils/http.js";
import common from '@/utils/common.js'
import {
setTimeout
} from "timers";
export default {
props: {
data_info: [Object]
},
data() {
return {
common,
canvasId: "yiqiu_id"+ this.data_info.YiqiuMatchId,
loading: true,
select_data: this.data_info,
host: {},
guest: {},
radar_chart_data: {},
chartData: {},
//您可以通过修改 config-ucharts.js 文件中下标为 ['radar'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
color: ["#2878FF", "#FFD03E", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: [0, 0, 0, 0],
dataLabel: false,
enableScroll: false,
fontSize: 12,
legend: {
show: true,
position: "bottom",
lineHeight: 25
},
extra: {
radar: {
gridType: "radar",
gridColor: "#CCCCCC",
gridCount: 2,
opacity: 0.2,
max: 100,
labelShow: true,
border: true
}
}
}
};
},
mounted() {
this.getServerData()
},
methods: {
async getServerData() {
console.log("getServerData:" + JSON.stringify(this.select_data))
var yiqiu_id = this.select_data.YiqiuMatchId;
// var yiqiu_id = 7065015
this.canvasId = "yiqiu_id:" + yiqiu_id
console.log(yiqiu_id)
this.loading = true
if (yiqiu_id) {
let result = await http.gql({
query: `query{
get_soccer_game_base_surface_detail(yiqiu_id:${yiqiu_id})
}`
})
//处理返回请求
if (result && result.data && result.data.get_soccer_game_base_surface_detail) {
if (result.data.get_soccer_game_base_surface_detail.error) {
clearInterval(this.timer);
this_.disabled = false;
uni.showToast({
icon: "none",
title: result.data.get_soccer_game_base_surface_detail.error,
});
} else {
this.radar_chart_data = result.data.get_soccer_game_base_surface_detail.result
.radar_chart_data
this.host = this.radar_chart_data.host_result;
this.guest = this.radar_chart_data.guest_result;
let res = {
categories: ["身价", "技术", "排名", "状态", "防守", "进攻"],
series: [{
name: "主队",
data: [this.host.team_worth, this.host.tech_score, this.host.team_rank,
this.host
.status_score, this.host.defend_total, this.host.attack_total
]
},
{
name: "客队",
data: [this.guest.team_worth, this.guest.tech_score, this.guest
.team_rank, this.guest
.status_score, this.guest.defend_total, this.guest.attack_total
]
}
]
};
console.log(JSON.stringify(res))
var this_ = this;
setTimeout(function() {
this_.chartData = JSON.parse(JSON.stringify(res));
}, 100)
}
}
} else {
uni.showToast({
icon: "none",
title: "暂无详情数据",
});
}
this.loading = false
},
toDetail(match) {
console.log("Detail:" + JSON.stringify(match))
let matchId = match.Sportsdt.SportsdtMatchId
let infoId = match.InfoId
let yiqiuMatchId = match.YiqiuMatchId
console.log(JSON.stringify(match))
if (common.info_config.match_url && yiqiuMatchId) {
let tempData = {
url: common.info_config.match_url.replace("%s", yiqiuMatchId),
}
uni.navigateTo({
url: `/pages/notitle_h5/notitle_h5?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
}
},
childmethods(item) {
console.log("childMethods:" + JSON.stringify(item))
this.select_data = item;
this.getServerData()
}
}
}
</script>
<style>
.charts-box {
width: 100%;
height: 200px;
}
.text {
color: #D8D8D8;
font-size: 12px;
text-align: left;
font-family: SourceHanSansSC-regular;
}
.text2 {
color: #20262E;
font-size: 14px;
text-align: right;
font-family: SourceHanSansSC-regular;
}
.content {
display: flex;
width: 100%;
justify-content: center;
justify-items: center;
}
.left-bar {
color: #fff;
font-size: 12px;
text-align: center;
background: #2878FF;
border-top-left-radius: 0.8rem;
border-bottom-left-radius: 0.8rem;
}
.right-bar {
color: #fff;
font-size: 12px;
text-align: center;
background: #FFD03E;
border-top-right-radius: 0.8rem;
border-bottom-right-radius: 0.8rem;
}
.text3 {
color: #42464C;
font-size: 12px;
text-align: left;
padding-left: 14px;
padding-right: 14px;
margin-top: 10px;
margin-bottom: 20px;
font-family: SourceHanSansSC-regular;
}
.button {
line-height: 20px;
border-radius: 20px;
background: linear-gradient(180deg, rgba(40, 120, 255, 1) 0%, rgba(40, 111, 234, 1) 100%);
color: rgba(255, 255, 255, 1);
font-size: 14px;
padding-top: 10px;
padding-bottom: 10px;
margin-left: 13px;
margin-right: 13px;
text-align: center;
font-family: Roboto;
}
</style>
<template>
<view>
<view v-if="isLoading"
style="width: 50vw; height: 70vh; display: flex; justify-items: center; align-items: center;">
<view
style="width: 50vw; height: 100%; display: flex; justify-items: center; align-items: center; align-content: center; justify-content: center; ">
<image style="width: 63px; height: 34px;" src="../../static/loading_icon.gif"></image>
</view>
</view>
<view v-if="!isLoading">
<view style="display: flex; justify-content: space-between; padding-left: 14px; padding-right: 14px;">
<image style="width: 18px; height: 18px; border-radius: 18px;"
:src="data_info.HostTeam ? data_info.HostTeam.LogoFullPath : ''" />
<view class="title">事件统计</view>
<image style="width: 18px; height: 18px; border-radius: 18px;"
:src="data_info.GuestTeam ? data_info.GuestTeam.LogoFullPath : ''" />
</view>
<view v-if="!data_list"
style="width: 50vw; height: 70vh; display: flex; justify-items: center; align-items: center;">
<text style="width: 50vw; height: 100%; display: flex; justify-items: center; align-items: center; align-content: center; justify-content: center;">
数据更新中,敬请期待</text>
</view>
<view v-if="data_list" v-for="(item, index) in data_list" :key="index">
<view v-if="!isNaN(parseInt(item.Home))"
style="display: flex; justify-content: space-between; padding-left: 14px; padding-right: 14px; margin-top: 14px; margin-bottom: 14px; ">
<view class="text">{{item.Home}}</view>
<view style="display: flex; align-items: center; width: 98%; justify-content: center; tes ">
<view class="bar_bg" style="display: flex; flex: 1.5; flex-direction: row-reverse;">
<view class="bar" :style="'width:' + changeWitch(item,item.Home) ">
</view>
</view>
<view class="text1" style="align-self: center;">{{item.Name}}</view>
<view class="bar_bg" style="display: flex; flex: 1.5;">
<view class="bar" style="align-content: flex-start;"
:style="'width:' + changeWitch(item,item.Away)"></view>
</view>
</view>
<view class="text">{{item.Away}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
default as http
} from "@/utils/http.js";
export default {
props: {
data_info: [Object]
},
data() {
return {
select_data: this.data_info,
data_list: null,
isLoading: false
}
},
methods: {
changeWitch(item, value) {
var v = parseInt((parseInt(value) / (parseInt(item.Home) + parseInt(item.Away))) * 100) + "%"
return v
},
async load_data() {
console.log("load_data:" + JSON.stringify(this.select_data))
this.isLoading = true
var gameid = this.select_data.Sportsdt ? this.select_data.Sportsdt.SportsdtMatchId : undefined;
if (gameid) {
let result = await http.gql({
query: `query{
getgamegoaldata(gameid:${gameid})
}`
})
//处理返回请求
console.log(result)
if (result && result.data && result.data.getgamegoaldata) {
if (result.data.getgamegoaldata.Error) {
clearInterval(this.timer);
this_.disabled = false;
this.data_list = null;
uni.showToast({
icon: "none",
title: result.data.getgamegoaldata.Error,
});
} else {
this.data_list = result.data.getgamegoaldata.Stat
}
} else {
this.data_list = null;
}
}
this.isLoading = false
},
childmethods(item) {
console.log("childMethods:" + JSON.stringify(item))
this.select_data = item;
this.load_data()
}
},
async mounted() {
this.load_data()
},
}
</script>
<style>
.title {
color: #797979;
font-size: 12px;
text-align: center;
font-family: SourceHanSansSC-regular;
}
.text {
width: 27px;
color: #42464C;
font-size: 12px;
text-align: center;
font-family: SourceHanSansSC-regular;
}
.text1 {
color: #8F9197;
width: 48px;
min-width: 48px;
font-size: 12px;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
display: block;
margin-left: 4px;
margin-right: 4px;
font-family: SourceHanSansSC-regular;
}
.bar {
height: 8px;
line-height: 17px;
border-radius: 18px;
background-color: rgba(40, 120, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 12px;
text-align: left;
font-family: Roboto;
}
.bar_bg {
height: 8px;
line-height: 17px;
border-radius: 18px;
background-color: rgba(246, 249, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 12px;
text-align: left;
font-family: Roboto;
}
</style>
<template>
<view class="request-loading-view" v-show="loadingShow">
<view class="loading-view"><view class="loading"></view></view>
</view>
</template>
<script>
export default {
data() {
return {};
},
computed: {
//计算属性判断vuex中的显示状态
loadingShow() {
return this.$store.state.requestLoading;
},
},
};
</script>
<style scoped>
.request-loading-view {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 198903060;
background-color: rgba(0, 0, 0, 0.001);
display: flex;
justify-content: center;
align-items: center;
}
.loading-view {
width: 160upx;
height: 160upx;
background-color: rgba(0, 0, 0, 0.6);
border-radius: 20upx;
display: flex;
justify-content: center;
align-items: center;
}
/* 动画样式 */
.loading {
border: 10upx solid rgba(0, 0, 0, 0.01);
border-radius: 50%;
border-top: 10upx solid #fff;
border-right: 10upx solid #fff;
border-bottom: 10upx solid #fff;
width: 60upx;
height: 60upx;
-webkit-animation: spin 1.4s linear infinite;
animation: spin 1.4s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
try {
function isPromise(obj) {
return (
!!obj &&
(typeof obj === "object" || typeof obj === "function") &&
typeof obj.then === "function"
);
}
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致
uni.addInterceptor({
returnValue(res) {
if (!isPromise(res)) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res) => {
if (res[0]) {
reject(res[0]);
} else {
resolve(res[1]);
}
});
});
},
});
} catch (error) { }
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
\ No newline at end of file
{
"name" : "JinQiuSports",
"appid" : "__UNI__E81960F",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}
此文件的差异太大,无法显示。
{
"name": "jinqiusports",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "npm run dev:h5",
"build": "npm run build:h5",
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
"build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
"build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
"build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build",
"build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",
"build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",
"build:mp-jd": "cross-env NODE_ENV=production UNI_PLATFORM=mp-jd vue-cli-service uni-build",
"build:mp-kuaishou": "cross-env NODE_ENV=production UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build",
"build:mp-lark": "cross-env NODE_ENV=production UNI_PLATFORM=mp-lark vue-cli-service uni-build",
"build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build",
"build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
"build:mp-xhs": "cross-env NODE_ENV=production UNI_PLATFORM=mp-xhs vue-cli-service uni-build",
"build:quickapp-native": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build",
"build:quickapp-webview": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build",
"build:quickapp-webview-huawei": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build",
"build:quickapp-webview-union": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build",
"dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
"dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
"dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
"dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch",
"dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",
"dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",
"dev:mp-jd": "cross-env NODE_ENV=development UNI_PLATFORM=mp-jd vue-cli-service uni-build --watch",
"dev:mp-kuaishou": "cross-env NODE_ENV=development UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build --watch",
"dev:mp-lark": "cross-env NODE_ENV=development UNI_PLATFORM=mp-lark vue-cli-service uni-build --watch",
"dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch",
"dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
"dev:mp-xhs": "cross-env NODE_ENV=development UNI_PLATFORM=mp-xhs vue-cli-service uni-build --watch",
"dev:quickapp-native": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch",
"dev:quickapp-webview": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch",
"dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch",
"dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch",
"info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",
"serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js",
"test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i",
"test:h5": "cross-env UNI_PLATFORM=h5 jest -i",
"test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i",
"test:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu jest -i",
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
},
"dependencies": {
"@dcloudio/uni-app": "2.0.2-3070320230222001",
"@dcloudio/uni-app-plus": "2.0.2-3070320230222001",
"@dcloudio/uni-h5": "2.0.2-3070320230222001",
"@dcloudio/uni-i18n": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-360": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-alipay": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-baidu": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-jd": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-kuaishou": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-lark": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-qq": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-toutiao": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-vue": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-weixin": "2.0.2-3070320230222001",
"@dcloudio/uni-mp-xhs": "2.0.2-3070320230222001",
"@dcloudio/uni-quickapp-native": "2.0.2-3070320230222001",
"@dcloudio/uni-quickapp-webview": "2.0.2-3070320230222001",
"@dcloudio/uni-stacktracey": "2.0.2-3070320230222001",
"@dcloudio/uni-stat": "2.0.2-3070320230222001",
"@vue/shared": "3.2.47",
"core-js": "^3.6.5",
"flyio": "0.6.14",
"image-tools": "^1.4.0",
"moment": "^2.29.1",
"node-sass-install": "^1.0.2",
"sass-loader": "^7.3.1",
"uuid": "^3.3.2",
"vue": "^2.6.11",
"vue-property-decorator": "^8.0.0",
"vuex": "3.6.2"
},
"devDependencies": {
"@babel/plugin-syntax-typescript": "^7.2.0",
"@dcloudio/types": "^3.0.4",
"@dcloudio/uni-automator": "2.0.2-3070320230222001",
"@dcloudio/uni-cli-i18n": "2.0.2-3070320230222001",
"@dcloudio/uni-cli-shared": "2.0.2-3070320230222001",
"@dcloudio/uni-helper-json": "*",
"@dcloudio/uni-migration": "2.0.2-3070320230222001",
"@dcloudio/uni-template-compiler": "2.0.2-3070320230222001",
"@dcloudio/vue-cli-plugin-hbuilderx": "2.0.2-3070320230222001",
"@dcloudio/vue-cli-plugin-uni": "2.0.2-3070320230222001",
"@dcloudio/vue-cli-plugin-uni-optimize": "2.0.2-3070320230222001",
"@dcloudio/webpack-uni-mp-loader": "2.0.2-3070320230222001",
"@dcloudio/webpack-uni-pages-loader": "2.0.2-3070320230222001",
"@vue/cli-plugin-babel": "~4.5.19",
"@vue/cli-plugin-typescript": "~4.5.19",
"@vue/cli-service": "~4.5.19",
"babel-plugin-import": "1.13.6",
"cross-env": "7.0.3",
"jest": "25.5.4",
"mini-types": "*",
"miniprogram-api-typings": "*",
"postcss-comment": "^2.0.0",
"typescript": "~4.1.5",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
"Android >= 4.4",
"ios >= 9"
],
"uni-app": {
"scripts": {}
}
}
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#25CDAA"
}
}
,{
"path" : "pages/study/study",
"style" :
{
"navigationBarTitleText": "研究",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#25CDAA"
}
}
,{
"path" : "pages/info/info",
"style" :
{
"navigationBarTitleText": "情报",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#25CDAA"
}
}
,{
"path" : "pages/mine/mine",
"style" :
{
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/login_pwd/login_pwd",
"style" :
{
"navigationBarTitleText": "账号登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/login_yzm/login_yzm",
"style" :
{
"navigationBarTitleText": "验证码登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/suggest/suggest",
"style" :
{
"navigationBarTitleText": "提建议",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/settings/settings",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/logout/logout",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/notitle_webview/notitle_webview",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/normal_webview/normal_webview",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"backgroundColor": "#F8F8F8",
"selectedColor": "#0a1b31",
"color": "#999999",
"list": [
{
"text": "首页",
"iconPath": "static/tab_icons/Home02.png",
"selectedIconPath": "static/tab_icons/Home01.png",
"pagePath": "pages/index/index"
},
{
"text": "研究",
"iconPath": "static/tab_icons/gc02.png",
"selectedIconPath": "static/tab_icons/gc01.png",
"pagePath": "pages/study/study"
},
{
"text": "情报",
"iconPath": "static/tab_icons/qb02.png",
"selectedIconPath": "static/tab_icons/qb01.png",
"pagePath": "pages/info/info"
},
{
"text": "我的",
"iconPath": "static/tab_icons/wd02.png",
"selectedIconPath": "static/tab_icons/wd01.png",
"pagePath": "pages/mine/mine"
}
]
},
"uniIdRouter": {}
}
<template>
<view class="content">
<v-tabs v-model="current" :tabs="tabs" @change="changeTab" line-height="5rpx" line-color="#25CDAA"></v-tabs>
</view>
</template>
<script>
export default {
data() {
return {
current: 0,
tabs: ['关注', '国内', '新闻新闻', '军事', '国内', '新闻', '军事', '国内', '新闻']
}
},
onLoad() {
},
methods: {
changeTab(index) {
console.log('当前选中的项:' + index)
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
<template>
<view>
<z-swiper ref="zSwiper" v-model="match_list"
@slideChange="onSwiperChange" :options="options">
<z-swiper-item v-for="(item, index) in match_list" :key="item.Id" :custom-style="{width:'46%'}">
<view class="match-info"
:style="{'background-color': (select_index === index)
? '#25CDAA' : '#ffffff'}" @click="change_match(item, index)">
<view style="display: flex; justify-content: space-between; width: 100%;">
<text class="title-text-one"
:style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{deal_match_time(item)}}</text>
<text class="title-text-one"
:style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{item.MatchState}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.HostTeam.LogoFullPath" />
<text class="title-text-two"
:style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.HostName}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.GuestTeam.LogoFullPath" />
<text class="title-text-two"
:style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.GuestName}}</text>
</view>
</view>
</z-swiper-item>
</z-swiper>
<z-swiper ref="zSwiperInfo" v-model="match_list" @slideChange="onSwiperInfoChange" :options="info_options">
<z-swiper-item v-for="(info_item, index) in match_list" :key="info_item.Id">
<view v-if="info_item.Info">
<view v-for="(strInfo, index) in info_item.Info" style="display: flex; flex-direction: row;">
<view class="text-index">{{index + 1}}</view>
<view>
<text class="text-item">{{strInfo}}</text>
</view>
</view>
</view>
<view v-else
style="width: 100%; height: 400px; display: flex; justify-content: center; align-items: center;">
<text style="color: #999999; font-size: 16px;">暂无情报</text>
</view>
</z-swiper-item>
</z-swiper>
</view>
</template>
<script>
import http from "@/utils/http";
export default {
data() {
return {
options: {
slidesPerView: 'auto'
},
info_options: {
centeredSlides: true,
centeredSlidesBounds: true
},
load_status: 0,
match_list: [],
view_point: null,
select_index : 0,
}
},
methods: {
onSwiperChange(swiper) {
this.select_index = swiper.activeIndex
this.$refs.zSwiperInfo.swiper.slideTo(this.select_index); //切换到第一个slide,速度为1秒
},
onSwiperInfoChange(swiper) {
this.select_index = swiper.activeIndex
this.$refs.zSwiper.swiper.slideTo(this.select_index); //切换到第一个slide,速度为1秒
},
deal_match_time(match) {
let temp_data = new Date(match.MatchTime).toJSON()
let bj_time = new Date(+new Date(temp_data) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(
/\.[\d]{3}Z/, '')
return match.GameName + ' ' + bj_time.substring(5, 16)
},
deal_viewpoint(item) {
var info = []
if (item) {
let viewpoint = JSON.parse(item.JcInfo)
if (viewpoint) {
info.push(...viewpoint.HostGood)
info.push(...viewpoint.HostBad)
info.push(...viewpoint.GuestGood)
info.push(...viewpoint.GuestBad)
}
}
return info
},
change_match(item, index) {
this.$refs.zSwiperInfo.swiper.slideTo(index); //切换到第一个slide,速度为1秒
}
},
async onLoad() {
let infoRes = await http.gql({
"query": `query{liveScore(lotId:72,matchState:"未"){count matchs{Id InfoId LotteryId IssueName MatchTime MatchNumber HostName GuestName GameName HostTeam{LogoFullPath} GuestTeam{LogoFullPath} MatchState MatchRound PreTotalScore Temperature SportsInjury SportsInfoCount Sportsdt{ SportsdtMatchId } JcInfoPrice JcInfo }}}`
})
let matchs = infoRes.data.liveScore.matchs
if (this.match_list.length > 0) {
this.match_list.length = 0
}
for (let m of matchs) {
if (m.SportsInfoCount > 0) {
m.Info = this.deal_viewpoint(m)
this.match_list.push(m)
}
}
if (this.match_list.length > 0) {
this.select_index = 0
}
console.log("==========>>>", this.match_list)
}
}
</script>
<style>
.match-info {
display: flex;
flex-direction: column;
margin: 10rpx;
padding: 10rpx;
background-color: #25CDAA;
}
.team-logo {
width: 20px;
height: 20px;
border-radius: 10px;
}
.team-h-g {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 3px;
color: white;
font-size: 25rpx;
}
.text-index {
width: 56rpx;
height: 56rpx;
margin: 11px;
background-color: #F5F5F5;
color: #888888;
font-size: 14px;
border-radius: 56rpx;
line-height: 56rpx;
text-align: center;
}
.text-item {
color: #333333;
font-size: 16px;
text-align: justify;
border-radius: 20px;
line-height: 20px;
}
.title-text-one {
font-size: 13px;
color: white;
}
.title-text-two {
font-size: 18rpx;
margin-left: 6px;
color: white;
font-weight: 700;
}
</style>
<template>
<view>
<view class="head-bg" :style="{'padding-top': statusBarHeight +'px'}">
<view style="align-items: center; display: flex; width: 100v; height: 5vh;">
<image src="../../static/common/icon_back.png" style="width: 34rpx; height: 34rpx; padding: 25rpx;"
v-on:click="onBack()" />
<text style="margin-left: 10rpx; color: white; align-self: center; font-size: 40rpx;">账号密码登陆</text>
</view>
</view>
<view class="input-group" style="margin-left: 35rpx; margin-right: 35rpx;">
<view class="input-row border">
<input class="m-input" type="text" clearable focus v-model="username" placeholder="请输入用户名/手机号"
style="padding-top: 20rpx; padding-bottom: 20rpx;" />
<view style=" height: 1px; background: #C6C6C6; "></view>
</view>
<view class="input-row border" style="padding-top: 10rpx;">
<input type="password" displayable v-model="password" placeholder="请输入密码"
style="padding-top: 20rpx; padding-bottom: 20rpx;" />
<view style=" height: 1px; background: #C6C6C6; "></view>
</view>
</view>
<view style="margin-top: 15rpx; margin-left: 35rpx;" @click="gotoCodeLogin()">
<text style="color: #4169E1; font-size: 28rpx;">切换验证码登陆</text>
</view>
<view class="btn-row">
<button style="background-color: transparent; color: white; " :loading="loginBtnLoading" @tap="bindLogin">
登录
</button>
</view>
<view style=" margin-left: 35rpx; display: flex; margin-top: 35rpx; align-items: center;">
<view @click="checkboxSelected()" :checked="agreeState"
:class="agreeState === true ? 'checkbox-check' : 'checkbox-uncheck'" />
<text style="font-size: 28rpx; color: #333333;">阅读并同意</text>
<text style="color: #4d90ff; font-size: 28rpx;" @click="onUserAgreement()">用户协议</text>
<text style="font-size: 28rpx; color: #333333;"></text>
<text style="color: #4d90ff; font-size: 28rpx;" @click="onPrivacyPolicy()">隐私政策</text>
</view>
</view>
</template>
<script>
import {
transformImageCodeToUri
} from "@/utils/image_utils.js";
import {
default as http
} from "@/utils/http.js";
import loginHelper from "../../utils/loginHelper.js"
export default {
data() {
return {
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
agreeState: false,
username: "",
password: "",
loginBtnLoading: false,
}
},
methods: {
async bindLogin() {
if (this.username.length < 3) {
uni.showToast({
icon: "none",
title: "账号最短为 3 个字符",
});
return;
}
if (this.password.length < 4) {
uni.showToast({
icon: "none",
title: "密码最短为 4 个字符",
});
return;
}
if (!this.agreeState) {
uni.showToast({
icon: "none",
title: "您还没有同意用户协议",
});
return;
}
this.loginBtnLoading = true;
let query_data = `mutation{
ydn_login(name:${JSON.stringify(this.username)},pass:${JSON.stringify(this.password)})
}`;
let result = await http.gql({
query: query_data
})
this.loginBtnLoading = false;
//处理返回请求
console.log("result:" + JSON.stringify(result))
if (result && result.data && result.data.ydn_login) {
if (!result.data.ydn_login.Error) {
result.data.ydn_login.Result.FaceImageCode = transformImageCodeToUri(result.data.ydn_login
.Result
.FaceImageCode);
loginHelper.login(result.data.ydn_login.Result,result.data.ydn_login.AppToken)
uni.navigateBack();
} else {
uni.showToast({
icon: "none",
title: result.data.ydn_login.Error,
});
}
} else {
uni.showToast({
icon: "none",
title: "登录异常",
});
return;
}
},
onBack() {
uni.navigateBack()
},
gotoCodeLogin() {
uni.redirectTo({
url: '/pages/login_yzm/login_yzm'
})
},
checkboxSelected(e) {
this.agreeState = !this.agreeState;
},
onUserAgreement() {
let tempData = {
url: 'http://www.qianhaiyilan.cn/ppolicy_user.html',
title: "用户协议"
}
uni.navigateTo({
url: `/pages/normal_webview/normal_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
},
onPrivacyPolicy() {
let tempData = {
url: 'http://www.qianhaiyilan.cn/ppolicy_app.html',
title: "隐私政策"
}
uni.navigateTo({
url: `/pages/normal_webview/normal_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
}
}
}
</script>
<style>
</style>
<style>
.login-type-btn.act {
color: #ecab80;
border-bottom: solid 1px #ecab80;
}
.send-code-btn {
width: 120px;
text-align: center;
background-color: #ecab80;
color: #ffffff;
margin: 12px;
padding: 4px;
}
.action-row {
display: flex;
flex-direction: row;
justify-content: center;
margin-top: 15px;
}
.oauth-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
flex-wrap: wrap;
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.oauth-image {
position: relative;
width: 50px;
height: 50px;
border: 1px solid #dddddd;
border-radius: 50px;
background-color: #ffffff;
}
.oauth-image image {
width: 30px;
height: 30px;
margin: 10px;
}
.oauth-image button {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.btn-row {
margin-top: 15px;
margin-left: 35rpx;
margin-right: 35rpx;
background: linear-gradient(to right, #58B8FF, #32CDFF);
border-radius: 15rpx;
}
.head-bg {
flex-direction: column;
background: url('~@/static/login/head_zm.webp');
background-color: transparent;
background-repeat: no-repeat;
background-size: 50% 100%;
width: 100vh;
height: 15vh;
display: flex;
}
.uni-status-bar {
// width: 750rpx;
height: 20px;
// height: var(--status-bar-height);
}
.checkbox-check {
background-image: url(../../static/common/authsdk_checkbox_checked_bg.png);
background-repeat: no-repeat;
background-size: cover;
margin-right: 15rpx;
width: 35rpx;
height: 35rpx;
}
.checkbox-uncheck {
background-image: url(../../static/common/authsdk_checkbox_uncheck_bg.png);
width: 35rpx;
height: 35rpx;
margin-right: 15rpx;
background-repeat: no-repeat;
background-size: cover;
}
.m-input::input-placeholder {
color: #0000EE;
}
</style>
<template>
<view>
<view class="head-bg" :style="{'padding-top': statusBarHeight +'px'}">
<view style="align-items: center; display: flex; width: 100vh; height: 5vh;">
<image src="../../static/common/icon_back.png" style="width: 34rpx; height: 34rpx; padding: 25rpx;"
v-on:click="onBack()" />
<text style="margin-left: 10rpx; color: white; font-size: 40rpx;">验证码登陆</text>
</view>
</view>
<view class="input-group" style="margin-left: 35rpx; margin-right: 35rpx;">
<view class="input-row border">
<input class="m-input" type="text" clearable focus v-model="phoneNumber" placeholder="请输入手机号"
style="padding-top: 20rpx; padding-bottom: 20rpx;" />
<view style=" height: 1px; background: #C6C6C6; "></view>
</view>
<view class="input-row border" style=" display: flex; padding-top: 30rpx; padding-bottom: 20rpx;">
<input type="number" displayable v-model="phone_code" placeholder="请输入验证码" />
<button size="mini" style="background-color: #787878; font-size: 20; color: #FFFFFF; "
@click="getPhoneCode()" :disabled="disabled">{{phoneCodeStr}}</button>
</view>
<view style="height: 1px; background: #C6C6C6;"></view>
</view>
<view style="margin-top: 15rpx; margin-left: 35rpx;" @click="gotoAccountLogin()">
<text style="color: #4169E1; font-size: 28rpx;">切换密码登陆</text>
</view>
<view class="btn-row">
<button style="background-color: transparent; color: white; " :loading="loginBtnLoading" @tap="bindLogin">
登录
</button>
</view>
<view style=" margin-left: 35rpx; display: flex; margin-top: 35rpx; align-items: center;">
<view @click="checkboxSelected()" :checked="agreeState"
:class="agreeState === true ? 'checkbox-check' : 'checkbox-uncheck'" />
<text style="font-size: 28rpx; color: #333333;">阅读并同意</text>
<text style="color: #4d90ff; font-size: 28rpx;" @click="onUserAgreement()">用户协议</text>
<text style="font-size: 28rpx; color: #333333;"></text>
<text style="color: #4d90ff; font-size: 28rpx;" @click="onPrivacyPolicy()">隐私政策</text>
</view>
</view>
</template>
<script>
import {
transformImageCodeToUri
} from "@/utils/image_utils.js";
import {
default as http
} from "@/utils/http.js";
import loginHelper from "../../utils/loginHelper.js"
export default {
data() {
return {
disabled: false,
phoneCodeStr: "获取验证码",
phoneCodeTime: 60,
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
phoneNumber: "",
password: "",
phone_code: "",
loginBtnLoading: false,
timer: null,
agreeState: false,
}
},
methods: {
async getPhoneCode() {
var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
var this_ = this;
if (this.phoneNumber.length != 11) {
uni.showToast({
icon: "none",
title: "请输入手机号码",
});
return;
}
if (!myreg.test(this.phoneNumber)) {
uni.showToast({
icon: "none",
title: "电话号码格式不对",
});
return;
}
this.phoneCodeTime = 60;
this.timer = setInterval(() => {
console.log(this_.phoneCodeTime)
if (this_.phoneCodeTime <= 0) {
clearInterval(this_.timer);
this_.phoneCodeStr = "获取验证码";
this_.disabled = false;
} else {
this_.phoneCodeStr = this_.phoneCodeTime + "s";
this_.phoneCodeTime--;
this_.disabled = true;
}
}, 1000);
this_.disabled = true;
let query_data = `query{
getMobileCode(mobile:${JSON.stringify(this.phoneNumber)},type:7)
}`;
let result = await http.gql({
query: query_data
})
console.info(result);
//处理返回请求
if (result && result.data && result.data.getMobileCode) {
if (result.data.getMobileCode.Error) {
clearInterval(this.timer);
this_.disabled = false;
uni.showToast({
icon: "none",
title: result.data.getMobileCode.Error,
});
} else {
}
} else {
clearInterval(this.timer);
this_.disabled = false;
uni.showToast({
icon: "none",
title: "请求异常",
});
return;
}
},
async bindLogin() {
if (this.phoneNumber.length < 11) {
uni.showToast({
icon: "none",
title: "请输入手机号码",
});
return;
}
var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
if (!myreg.test(this.phoneNumber)) {
uni.showToast({
icon: "none",
title: "电话号码格式不对",
});
return;
}
if (this.phone_code.length <= 0) {
uni.showToast({
icon: "none",
title: "请输入验证码",
});
return;
}
if (!this.agreeState) {
uni.showToast({
icon: "none",
title: "您还没有同意用户协议",
});
return;
}
this.loginBtnLoading = true;
let query_data = `mutation{
ydn_sms_login(mobile:${JSON.stringify(this.phoneNumber)},code:${JSON.stringify(this.phone_code)},type:"web")
}`;
let result = await http.gql({
query: query_data
})
this.loginBtnLoading = false;
console.info(result);
//处理返回请求
if (result && result.data && result.data.ydn_sms_login) {
if (result.data.ydn_sms_login.Error) {
uni.showToast({
icon: "none",
title: result.data.ydn_sms_login.Error,
});
} else {
result.data.ydn_sms_login.Result.FaceImageCode = transformImageCodeToUri(result.data
.ydn_sms_login.Result
.FaceImageCode);
loginHelper.login(result.data.ydn_sms_login.Result,result.data.ydn_sms_login.AppToken)
uni.navigateBack();
}
} else {
uni.showToast({
icon: "none",
title: "登录异常",
});
return;
}
},
onBack() {
uni.navigateBack()
},
gotoAccountLogin() {
uni.redirectTo({
url: '/pages/login_pwd/login_pwd'
})
},
onUserAgreement() {
let tempData = {
url: 'http://www.qianhaiyilan.cn/ppolicy_user.html',
title: "用户协议"
}
uni.navigateTo({
url: `/pages/normal_webview/normal_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
},
onPrivacyPolicy() {
let tempData = {
url: 'http://www.qianhaiyilan.cn/ppolicy_app.html',
title: "隐私政策"
}
uni.navigateTo({
url: `/pages/normal_webview/normal_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
},
checkboxSelected(e) {
this.agreeState = !this.agreeState;
}
}
}
</script>
<style>
.action-row {
display: flex;
flex-direction: row;
justify-content: center;
margin-top: 15rpx;
}
.btn-row {
margin-top: 15rpx;
margin-left: 35rpx;
margin-right: 35rpx;
background: linear-gradient(to right, #FDB559, #FF7E31);
border-radius: 15rpx;
}
.head-bg {
flex-direction: column;
background-image: url('~@/static/login/head.png');
background-size: 50% 100%;
width: 100vh;
height: 15vh;
display: flex;
background-color: transparent;
background-repeat: no-repeat;
}
.checkbox-check {
background-image: url(../../static/common/authsdk_checkbox_checked_bg.png);
background-repeat: no-repeat;
background-size: cover;
margin-right: 15rpx;
width: 30rpx;
height: 30rpx;
}
.checkbox-uncheck {
background-image: url(../../static/common/authsdk_checkbox_uncheck_bg.png);
width: 30rpx;
height: 30rpx;
margin-right: 15rpx;
background-repeat: no-repeat;
background-size: cover;
}
</style>
<template>
<view style="padding-left: 4%; padding-right: 4%; padding-top: 4%;">
<view style="display: flex; ">
<text space="emsp" style="font-size: 35rpx;">手机号</text>
<text style="margin-left: 25rpx; font-size: 35rpx;">{{phoneNume}}</text>
</view>
<view style="height: 2rpx; background-color: #eeeeee; margin-top: 5rpx; margin-bottom: 20rpx;"></view>
<view style="display: flex; align-items: center;">
<text space="emsp" style="font-size: 35rpx;">密 码</text>
<input style="font-size: 35rpx; margin-left: 25rpx;" password type="text" v-model="pwd"
placeholder="请输入密码" />
</view>
<view style="height: 2rpx; background-color: #eeeeee; margin-top: 5rpx; margin-bottom: 20rpx;"></view>
<view style="align-content: center; width: 100%;">
<text style="color: #D4383D; font-size: 22rpx;">账号注销后该账户下所有信息将被清除</text>
</view>
<button style="margin-top: 8%; background-color: #2a0d5c; border-radius: 13rpx; color: white;"
@click="bindLogout()">确实注销</button>
</view>
</template>
<script>
import http from "@/utils/http";
import loginHelper from '../../utils/loginHelper.js'
export default {
data() {
return {
pwd: "",
phoneNume: ""
}
},
onLoad: function(){
console.info("onLoad")
this.phoneNume = "******" + loginHelper.getUserInfo().Mobile.substring(7);
},
methods: {
bindLogout() {
{
this.logoutLogin();
}
},
async logoutLogin() {
if (this.pwd.length <= 0) {
uni.showToast({
icon: "none",
title: "请输入密码",
});
return;
}
let query_data = `mutation{
info_update_user(user:{ user_status:"-1"})
{
error
success
error_type
}
}`;
console.info(query_data);
let result = await http.gql({
query: query_data
})
this.loginBtnLoading = false;
console.info(result);
//处理返回请求
if (result && result.data && result.data.info_update_user &&
!result.data.info_update_user.error) {
loginHelper.logout();
uni.navigateBack();
} else {
uni.showToast({
icon: "none",
title: "注销异常",
});
return;
}
}
}
}
</script>
<style>
</style>
<template>
<view style="background-color: #F5F7FC; justify-content: center; height: 100vh; align-items: center;">
<view class="qh-u-header">
<text class="qh-u-title">我的</text>
<view
style="background-color: white; border-radius: 20rpx;
margin-left: 34rpx; margin-right: 34rpx;
display: flex; padding-top: 34rpx; padding-bottom: 61rpx; width: 92%; margin-top: 40rpx; align-items: center; justify-content: space-between;">
<image :src="headIcon"
style="background-color: transparent; width: 104rpx; height: 104rpx; border-radius: 52rpx; margin-left: 35rpx;"
@error="imageError" @click="bindLogin()"></image>
<view style="margin-left: 20rpx; flex-grow: 1;" @click="bindLogin()">
<text style="font-size: 36rpx; color: #333333; font-weight: 600;">
{{ this.hasLogin ? this.userName : '登陆/注册' }}</text>
<view style="margin-top: 15rpx;">
<text style="font-size: 26rpx; color: #999999;">欢迎来到千嗨体育</text>
</view>
</view>
<view style="border-top-left-radius: 30rpx;
border-bottom-left-radius: 30rpx; background: linear-gradient(to right, #e3b66a, #f6dc9f);
padding-left: 26rpx;
padding-right: 20rpx;
padding-top: 12rpx;
padding-bottom: 12rpx; font-size: 28rpx; color: #FFFFFF;" @click="gotoMember()">我的会员</view>
</view>
</view>
<view style="background-color: white; border-radius: 10rpx;
margin-left: 34rpx; margin-right: 34rpx;
padding-left: 20rpx ; padding-right: 20rpx; margin-top: 10%; align-self: center;">
<view class="qh-list-c" @click="gotoMyOrder()">
<view style="display: flex;">
<image src="../../static/mine_icons/mine_order_icon.png" style="width: 50rpx; height: 50rpx;" />
<text class="list-text">我的订单</text>
</view>
<image src="../../static/mine_icons/mine_right_arrow.png" style="width: 40rpx; height: 40rpx;" />
</view>
<view class="qh-list-c" @click="gotoSuggest()">
<view style="display: flex;">
<image src="../../static/mine_icons/mine_feedback_icon.png" style="width: 50rpx; height: 50rpx;" />
<text class="list-text">提建议/问题反馈</text>
</view>
<image src="../../static/mine_icons/mine_right_arrow.png" style="width: 40rpx; height: 40rpx;" />
</view>
<view class="qh-list-c" @tap="share">
<view style="display: flex;">
<image src="../../static/mine_icons/mine_share_icon.png" style="width: 50rpx; height: 50rpx;" />
<text class="list-text">分享给好友</text>
</view>
<image src="../../static/mine_icons/mine_right_arrow.png" style="width: 40rpx; height: 40rpx;" />
</view>
<view class="qh-list-c" @click="gotoSettings()">
<view style="display: flex;">
<image src="../../static/mine_icons/mine_settings_icon.png" style="width: 50rpx; height: 50rpx;" />
<text class="list-text">设置</text>
</view>
<image src="../../static/mine_icons/mine_right_arrow.png" style="width: 40rpx; height: 40rpx;" />
</view>
</view>
<view style="display: flex; justify-self: center; width: 100%; margin-top: 30rpx; justify-content: center;">
<view class="tip-text">在使用过程如遇问题,请咨询客服微信</view>
<view class="tip-text2" @click="copyweixin()">{{weixin}}</view>
</view>
</view>
</template>
<script setup>
import common from "../../utils/common";
import loginHelper from "../../utils/loginHelper.js"
import {
default as app_config
} from '../../utils/app.js';
export default {
data() {
return {
common,
hasLogin : false ,
userName : "",
headIcon : loginHelper.defaultHeadIcon ,
buttonRect: {},
weixin: "ydnkf002"
}
},
methods: {
async bindLogin() {
if (!loginHelper.hasLogin()) {
uni.navigateTo({
url: "/pages/login_pwd/login_pwd",
});
}
},
async gotoSuggest() {
if (loginHelper.hasLogin()) {
uni.navigateTo({
url: '/pages/suggest/suggest'
})
} else {
uni.navigateTo({
url: "/pages/login_pwd/login_pwd"
})
}
},
async gotoSettings() {
uni.navigateTo({
url: '/pages/settings/settings'
})
},
imageError(e) {
console.error('image发生error事件,携带值为' + e.detail.errMsg)
},
gotoMember() {
if (loginHelper.hasLogin()) {
let tempData = {
url: `${app_config.server_url.app_host}user/vip?vip_type=1`
}
uni.navigateTo({
url: `/pages/notitle_webview/notitle_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
} else {
uni.navigateTo({
url: '/pages/login_pwd/login_pwd'
})
}
},
gotoMyOrder() {
if (loginHelper.hasLogin()) {
let tempData = {
url: `${app_config.server_url.app_host}user/orders`
}
uni.navigateTo({
url: `/pages/notitle_webview/notitle_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
} else {
uni.navigateTo({
url: '/pages/login_pwd/login_pwd'
})
}
},
share() {
let _this = this;
uni.showActionSheet({
itemList: ['分享到微信', '复制链接'],
popover: {
top: _this.buttonRect.top * 2 + _this.buttonRect.height,
left: _this.buttonRect.left + _this.buttonRect.width / 2
},
success: e => {
if (e.tapIndex == 0) {
_this.clip_board("推荐一个很好用的体育APP给你玩,你试试看! http://www.qianhaiyilan.cn/");
plus.runtime.openURL("weixin://");
}
if (e.tapIndex == 1) {
_this.clip_board("推荐一个很好用的体育APP给你玩,你试试看! http://www.qianhaiyilan.cn/");
}
}
});
},
clip_board(value) {
uni.setClipboardData({
data: value,
success: function() {
uni.getClipboardData({
success: function(res) {
console.log(res.data);
uni.showToast({
title: "已复制到剪贴板",
icon: "none",
});
},
});
},
});
},
copyweixin() {
this.clip_board(this.weixin);
}
},
onLoad() {
},
onShow: function() {
var userInfo = uni.getStorageSync("userInfo")
if (userInfo) {
loginHelper.login(userInfo);
this.headIcon = userInfo.FaceImageCode
this.userName = userInfo.NickName
} else {
this.headIcon = loginHelper.getDefaultHeadIcon()
loginHelper.logout();
}
this.hasLogin = loginHelper.hasLogin()
if(common.info_config && common.info_config.me_help_note) {
this.weixin = common.info_config.me_help_note.weixin
}
console.log("onShow:" + this.weixin + "-" + JSON.stringify(userInfo))
}
}
</script>
<style scoped>
.qh-content {
background-color: aquamarine;
}
.qh-u-header {
display: flex;
flex-direction: column;
height: 270rpx;
background-color: transparent;
background-image: url("../../static/mine_icons/my_bg.png");
background-size: cover;
align-items: center;
padding-top: 67rpx;
}
.qh-u-title {
color: white;
font-size: 40rpx;
font-weight: 500;
margin-top: 20rpx;
}
.qh-list-c {
background-color: white;
display: flex;
height: 132rpx;
justify-content: space-between;
align-items: center;
}
.list-text {
font-size: 32rpx;
font-weight: 400;
color: #333333;
margin-left: 23rpx;
}
.tip-text {
text-align: center;
font-size: 25rpx;
color: #D8D8D8;
}
.tip-text2 {
text-align: center;
font-size: 25rpx;
color: blue;
}
</style>
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
import { default as app_config } from '@/utils/app.js';
import common from '@/utils/common.js'
var wv;//计划创建的webview
export default {
data() {
return {
app_config,
url: '',
}
},
methods: {
},
onLoad(val) {
let data = JSON.parse(decodeURIComponent(val.info))
this.url = data.url
if (data.title) {
uni.setNavigationBarTitle({
title: data.title
})
}
},
onReady() {
let appInfo = app_config.app_info;
let token = uni.getStorageSync('uni_cookie');
let header = {
'Cookie': token,
AppVersion: encodeURI(JSON.stringify(appInfo))
}
// #ifdef APP-PLUS
var nwating = plus.nativeUI.showWaiting();
wv = plus.webview.create("", "normal_h5-webview", {
additionalHttpHeaders: {
header: header,
},
plusrequire: "none", //禁止远程网页使用plus的API,有些使用mui制作的网页可能会监听plus.key,造成关闭页面混乱,可以通过这种方式禁止
'uni-app': 'none', //不加载uni-app渲染层框架,避免样式冲突
top: common.customBarH,
height: uni.getSystemInfoSync().windowHeight
})
let pages = getCurrentPages()
let currentPage = pages[pages.length - 1]
var currentWebview = currentPage.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
currentWebview.append(wv);
wv.loadURL(this.url, header);
wv.addEventListener('loaded', function () {
// wv.evalJS("$(\".header\").hide();");
nwating.close();
wv.show();
}, false);
// #endif
}
}
</script>
<style>
</style>
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
import { default as app_config } from '@/utils/app.js';
import common from '@/utils/common.js'
var wv;//计划创建的webview
export default {
data() {
return {
app_config,
url: '',
}
},
methods: {
},
onLoad(val) {
let data = JSON.parse(decodeURIComponent(val.info))
this.url = data.url
if (data.title) {
uni.setNavigationBarTitle({
title: data.title
})
}
},
onReady() {
let appInfo = app_config.app_info;
let token = uni.getStorageSync('uni_cookie');
let header = {
'Cookie': token,
AppVersion: encodeURI(JSON.stringify(appInfo))
}
// #ifdef APP-PLUS
var nwating = plus.nativeUI.showWaiting();
wv = plus.webview.create("", "normal_h5-webview", {
additionalHttpHeaders: {
header: header,
},
plusrequire: "none", //禁止远程网页使用plus的API,有些使用mui制作的网页可能会监听plus.key,造成关闭页面混乱,可以通过这种方式禁止
'uni-app': 'none', //不加载uni-app渲染层框架,避免样式冲突
top: common.customBarH,
height: uni.getSystemInfoSync().windowHeight
})
let pages = getCurrentPages()
let currentPage = pages[pages.length - 1]
var currentWebview = currentPage.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
currentWebview.append(wv);
console.log(header)
wv.loadURL(this.url, header);
wv.addEventListener('loaded', function () {
// wv.evalJS("$(\".header\").hide();");
nwating.close();
wv.show();
}, false);
// #endif
}
}
</script>
<style>
</style>
<template>
<view style="background-color: #F5F7FC; padding-top: 15rpx; height: 100vh; ">
<view class="qh-list-c" @click="onLogout()">
<view style="display: flex;">
<text class="list-text">账号注销</text>
</view>
<image src="@/static/mine_icons/arrow_right.png"
style="width: 50rpx; height: 50rpx; margin-right: 30rpx;" />
</view>
<view class="qh-list-c" @click="onUserAgreement()">
<view style="display: flex;">
<text class="list-text">用户协议</text>
</view>
<image src="@/static/mine_icons/arrow_right.png"
style="width: 50rpx; height: 50rpx; margin-right: 30rpx;" />
</view>
<view class="qh-list-c" @click="onPrivacyPolicy()">
<view style="display: flex;">
<text class="list-text">隐私政策</text>
</view>
<image src="@/static/mine_icons/arrow_right.png"
style="width: 50rpx; height: 50rpx; margin-right: 30rpx;" />
</view>
<view class="qh-list-c" @click="showUpdateVersion()">
<text class="update_text">{{this.versionName}}</text>
<view style="display: flex; " >
<text style="font-size: 27rpx;">{{this.updateInfoStr}}</text>
<image src="@/static/mine_icons/arrow_right.png"
style="width: 50rpx; height: 50rpx; margin-right: 30rpx;" />
</view>
</view>
<button style="background-color: white; margin: 35rpx; color: #469bf4;" @click="bindLogout()"> {{ this.hasLogin ? "退出登录" : '登陆/注册' }}</button>
</view>
</template>
<script>
import {
default as http
} from "@/utils/http.js";
import {
updateUseModal,
compare
} from '@/utils/check_update.js';
import {
default as app_config
} from '@/utils/app.js';
import loginHelper from "../../utils/loginHelper.js"
export default {
data() {
return {
app_config,
updateInfoStr : "已是最新版本",
versionData : null,
versionName : app_config.app_info.AppName,
}
},
onShow() {
console.log("onShow");
this.updateVersion();
},
methods: {
bindLogout() {
{
loginHelper.logout();
uni.reLaunch({
url: '/pages/user/user'
})
}
},
onLogout() {
if (!loginHelper.hasLogin()) {
uni.navigateTo({
url: '/pages/login_pwd/login_pwd',
});
} else {
uni.navigateTo({
url: "/pages/logout/logout",
});
}
},
onUserAgreement() {
let tempData = {
url: app_config.ppolicy_user,
title: "用户协议"
}
uni.navigateTo({
url: `/pages/normal_webview/normal_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
},
onPrivacyPolicy() {
let tempData = {
url: app_config.ppolicy_app,
title: "隐私政策"
}
uni.navigateTo({
url: `/pages/normal_webview/normal_webview?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
},
showUpdateVersion() {
if(this.versionData) {
updateUseModal({
title: "更新",
contents: this.versionData.Version_Content || '',
is_mandatory: false,
url: this.versionData.Package_Url,
platform: 'android',
type: "pkg" // 安装包类型
});
}
},
async updateVersion() {
let appInfo = app_config.app_info;
// #ifdef APP-PLUS
let query_data = `query{
update_app_version(App_Code:${JSON.stringify(appInfo.Version)}) {
App_Code
App_Name
Sys_Code
Sys_Name
Version_Code
Version_Type
Version_Content
Package_Url
Package_Weight
Version_Num
Update_Way
Download_Way
Update_Time
Publish_Time
Sys_Version
Promoter_Id
}
}`;
console.info(query_data);
let result = await http.gql({
query: query_data
})
console.info(result);
//处理返回请求
if (result && result.data && result.data.update_app_version) {
if (result.data.update_app_version.Error) {
uni.showToast({
icon: "none",
title: result.data.update_app_version.Error,
});
} else {
this.versionData = result.data.update_app_version;
if (this.versionData && this.versionData.Package_Url) {
this.updateInfoStr = "更新版本";
} else {
this.updateInfoStr = "已是最新版本";
}
}
}
// #endif
// #ifdef MP-WEIXIN
this.versionName = app_config.app_info.AppName
this.updateInfoStr = appInfo.Version
// #endif
}
}
}
</script>
<style>
button::after {
border: none
}
.qh-list-c {
margin-top: 4rpx;
background-color: white;
display: flex;
height: 100rpx;
font-weight: bold;
justify-content: space-between;
align-items: center;
}
.update_text {
font-size: 33rpx;
color: black; font-weight: bold;
margin-left: 35rpx;
}
.list-text {
margin-left: 35rpx;
font-size: 32rpx;
font-weight: 400;
color: black;
}
</style>
<template>
<view>
<z-swiper ref="zSwiper" v-model="match_list" @slideChange="onSwiperChange" :options="options">
<z-swiper-item v-for="(item, index) in match_list" :key="item.Id" :custom-style="{width:'46%'}">
<view class="match-info" :style="{'background-color': (select_index === index)
? '#25CDAA' : '#ffffff'}" @click="change_match(item, index)">
<view style="display: flex; justify-content: space-between; width: 100%;">
<text class="title-text-one" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{deal_match_time(item)}}</text>
<text class="title-text-one" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{item.MatchState}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.HostTeam.LogoFullPath" />
<text class="title-text-two" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.HostName}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.GuestTeam.LogoFullPath" />
<text class="title-text-two" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.GuestName}}</text>
</view>
</view>
</z-swiper-item>
</z-swiper>
<z-swiper ref="zSwiperInfo" v-model="match_list" @slideChange="onSwiperInfoChange" :options="info_options">
<z-swiper-item v-for="(info_item, index) in match_list" :key="info_item.Id">
<MatchEventStatistics ref="child" v-if="info_item.MatchState !== '未'" :data_info="info_item" />
<MatchEventAnalysis ref="child" v-else="info_item.MatchState === '未'" :data_info="info_item" />
</z-swiper-item>
</z-swiper>
</view>
</template>
<script>
import http from "@/utils/http";
import MatchEventStatistics from "@/components/match-list/MatchEventStatistics.vue";
import MatchEventAnalysis from "@/components/match-list/MatchEventAnalysis.vue";
export default {
components: {
MatchEventStatistics,
MatchEventAnalysis
},
data() {
return {
options: {
slidesPerView: 'auto'
},
info_options: {
centeredSlides: true,
centeredSlidesBounds: true
},
load_status: 0,
match_list: [],
view_point: null,
select_index: 0,
}
},
methods: {
onSwiperChange(swiper) {
this.select_index = swiper.activeIndex
this.$refs.zSwiperInfo.swiper.slideTo(this.select_index); //切换到第一个slide,速度为1秒
},
onSwiperInfoChange(swiper) {
this.select_index = swiper.activeIndex
this.$refs.zSwiper.swiper.slideTo(this.select_index); //切换到第一个slide,速度为1秒
},
deal_match_time(match) {
let temp_data = new Date(match.MatchTime).toJSON()
let bj_time = new Date(+new Date(temp_data) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(
/\.[\d]{3}Z/, '')
return match.GameName + ' ' + bj_time.substring(5, 16)
},
deal_viewpoint(item) {
var info = []
if (item) {
let viewpoint = JSON.parse(item.JcInfo)
if (viewpoint) {
info.push(...viewpoint.HostGood)
info.push(...viewpoint.HostBad)
info.push(...viewpoint.GuestGood)
info.push(...viewpoint.GuestBad)
}
}
return info
},
change_match(item, index) {
this.$refs.zSwiperInfo.swiper.slideTo(index); //切换到第一个slide,速度为1秒
}
},
async onLoad() {
let infoRes = await http.gql({
"query": `{
liveScore(lotId: 72, matchState: "未") {
count
matchs {
Id
InfoId
YiqiuMatchId
LotteryId
IssueName
MatchTime
MatchNumber
HostName
GuestName
GameName
HostTeam {
LogoFullPath
}
GuestTeam {
LogoFullPath
}
MatchState
MatchRound
PreTotalScore
Temperature
SportsInjury
SportsInfoCount
Sportsdt {
SportsdtMatchId
}
}
}
} `
})
let matchs = infoRes.data.liveScore.matchs
if (this.match_list.length > 0) {
this.match_list.length = 0
}
for (let m of matchs) {
if (m.SportsInfoCount > 0) {
m.Info = this.deal_viewpoint(m)
this.match_list.push(m)
}
}
if (this.match_list.length > 0) {
this.select_index = 0
}
console.log("==========>>>", this.match_list)
}
}
</script>
<style>
.match-info {
display: flex;
flex-direction: column;
margin: 10rpx;
padding: 10rpx;
background-color: #25CDAA;
}
.team-logo {
width: 20px;
height: 20px;
border-radius: 10px;
}
.team-h-g {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 3px;
color: white;
font-size: 25rpx;
}
.text-index {
width: 56rpx;
height: 56rpx;
margin: 11px;
background-color: #F5F5F5;
color: #888888;
font-size: 14px;
border-radius: 56rpx;
line-height: 56rpx;
text-align: center;
}
.text-item {
color: #333333;
font-size: 16px;
text-align: justify;
border-radius: 20px;
line-height: 20px;
}
.title-text-one {
font-size: 13px;
color: white;
}
.title-text-two {
font-size: 18rpx;
margin-left: 6px;
color: white;
font-weight: 700;
}
</style>
<template>
<view style="background-color: #F5F7FC; align-items: auto;">
<view style="align-items: center; display: flex;
justify-content: space-between; background-color:white; margin-top: 3vh;">
<image src="../../static/common/black_icon_back.png"
style="width: 35rpx; height: 35rpx; padding: 25rpx;"
v-on:click="onBack()" />
<text style="color: black;">问题反馈</text>
<text style="color: #298BF3; font-size: 18; margin-right: 35rpx; " v-on:click="commit()">提交</text>
</view>
<input class="uni-input" type="text" focus placeholder="欢迎提交您宝贵的建议" style="background-color:white; margin-top: 20rpx; padding: 35rpx;
height: 20;" v-model="suggest_content" />
<view class="uni-uploader-body">
<view class="uni-uploader__files">
<block v-for="(image, index) in imageList" :key="index">
<view class="uni-uploader__file" style="position: relative">
<view class="uni-close-view" @click="clear(index)">x</view>
<image class="uni-uploader__img" :src="image" @tap="previewImage(index)"></image>
</view>
</block>
<view class="uni-uploader__input-box" v-show="(imageList.length < 3)">
<view class="uni-uploader__input" @tap="chooseImg"></view>
</view>
</view>
</view>
</view>
</template>
<script>
import { pathToBase64 } from "image-tools";
import http from "@/utils/http";
export default {
data() {
return {
suggest_content: "",
imageList: []
}
},
methods: {
onBack() {
uni.navigateBack()
},
async commit() {
console.log("commit")
if (this.suggest_content.length < 5) {
uni.showToast({
icon: "none",
title: "最短为 5 个字符",
});
return;
}
let query_data = `mutation{
user_suggest_info(content:${JSON.stringify(this.suggest_content)})
}`;
if (this.imageList.length > 0) {
query_data = `mutation{
user_suggest_info(content:${JSON.stringify(this.suggest_content)}
,images:${JSON.stringify(this.imageList)})
}`;
}
console.log(query_data)
let result = await http.gql({
query: query_data
})
console.info(result);
//处理返回请求
if (result && result.data && result.data.user_suggest_info &&
!result.data.user_suggest_info.error) {
uni.showToast({
icon: "none",
title: "提交成功",
});
uni.navigateBack()
} else {
uni.showToast({
icon: "none",
title: "提交失败",
});
}
},
chooseImg() {
let _this = this;
uni.chooseImage({
count: 1, //最多可以选择的图片张数,默认9
sourceType: ['album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
sizeType: ['original'], //original 原图,compressed 压缩图,默认二者都有
success(res) {
console.log('选择图片完成', res)
// 调用上传图片的接口
let path = res.tempFilePaths[0];
_this.imgToBase64(path).then((base64) => {
let buffer = Buffer.from(base64, "base64");
let size = buffer.length / 1024 / 1024;
if (size > 5) {
uni.showToast({
icon: "none",
title: "图片文件最大不能超过5MB!",
});
return;
}
_this.imageList.push(base64);
});
},
fail() {
console.log('失败', err);
},
complete() {
console.log('结束');
},
})
},
previewImage(index) {
uni.previewImage({
urls: this.imageList,
current: this.imageList[index],
});
},
clear(index) {
this.imageList.splice(index, 1);
},
imgToBase64(data) {
return new Promise((resolve, reject) => {
pathToBase64(data)
.then((base64) => {
resolve(base64);
})
.catch((error) => {
console.error(error);
reject(error);
});
});
},
}
}
</script>
<style>
.head-bg {
width: 100%;
height: 20%;
}
</style>
此文件类型无法预览
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
<template>
<view class="chartsview">
<view class="charts-error"></view>
<view class="charts-font">{{errorMessage==null?'请点击重试':errorMessage}}</view>
</view>
</template>
<script>
export default {
name: 'qiun-error',
props: {
errorMessage: {
type: String,
default: null
},
},
data() {
return {
};
},
}
</script>
<style>
.chartsview {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
flex: 1;
justify-content: center;
align-items: center;
}
.charts-font{
font-size: 14px;
color: #CCCCCC;
margin-top: 10px;
}
.charts-error{
width: 128px;
height: 128px;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAUz0lEQVR4Xu1de3Bc1X3+zmp3jYVWfkPAgCWwY8zLEglNQCSW0yT9o2SQaDKdNulUykwfM+k09p+J3ImYIPJXi9yZzDSZZiwyaZuZBCwnNG1DMogEmUAAy7xs/MAyNhCMjWWtsK1deU/n23OvtLu6j3Pv3t29d71nxjOSde455/5+3/m9z7kCjRY4BR7eK7fkcmhrasLT37hbTAY+QYADigDHagwFYGhc7gZwHMAUgG4hMPzNe8RoWInTAECAnHl4r+yREt0DXWIbhx3cJ5fHP8TYjntFR4DTBDqUIwBmMrJDCtyPHDoQw0Q8jkeXinCLtECp43Gwh56R22IxTBbu+KFxOTbQJbo9DlW17rYASGdlNySeKl2JADpbkmKiait0mWhoXHZkmzE52CkocmvavvOsbMvl8MhAl+jlQrg2CQzu6BI9NV2Yw+T2AJiVo+DuL2kSeLQ1KfrC8kLcYbkYBv/pbjEWhjUNjUvSpk9KSAicm2tGXxjAaUcbewBkJAm6xeLBp1PJ2os06ttcDl8H0CEEaGnvGegSg2EAQZTW4B0AEntSS2ov0mhgJc5jmwT6IDEWi2E0zNZ2WEFhC4CZjCRxH7GwAfpbkmIkLC9E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vlsPUQJf/nHwt1///89bqDjCPWPAAAAAASUVORK5CYII=");
background-position: center;
}
</style>
<template>
<view class="container loading1">
<view class="shape shape1"></view>
<view class="shape shape2"></view>
<view class="shape shape3"></view>
<view class="shape shape4"></view>
</view>
</template>
<script>
export default {
name: 'loading1',
data() {
return {
};
}
}
</script>
<style scoped="true">
.container {
width: 30px;
height: 30px;
position: relative;
}
.container.loading1 {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.container .shape {
position: absolute;
width: 10px;
height: 10px;
border-radius: 1px;
}
.container .shape.shape1 {
left: 0;
background-color: #1890FF;
}
.container .shape.shape2 {
right: 0;
background-color: #91CB74;
}
.container .shape.shape3 {
bottom: 0;
background-color: #FAC858;
}
.container .shape.shape4 {
bottom: 0;
right: 0;
background-color: #EE6666;
}
.loading1 .shape1 {
-webkit-animation: animation1shape1 0.5s ease 0s infinite alternate;
animation: animation1shape1 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation1shape1 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(16px, 16px);
transform: translate(16px, 16px);
}
}
@keyframes animation1shape1 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(16px, 16px);
transform: translate(16px, 16px);
}
}
.loading1 .shape2 {
-webkit-animation: animation1shape2 0.5s ease 0s infinite alternate;
animation: animation1shape2 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation1shape2 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-16px, 16px);
transform: translate(-16px, 16px);
}
}
@keyframes animation1shape2 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-16px, 16px);
transform: translate(-16px, 16px);
}
}
.loading1 .shape3 {
-webkit-animation: animation1shape3 0.5s ease 0s infinite alternate;
animation: animation1shape3 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation1shape3 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(16px, -16px);
transform: translate(16px, -16px);
}
}
@keyframes animation1shape3 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(16px, -16px);
transform: translate(16px, -16px);
}
}
.loading1 .shape4 {
-webkit-animation: animation1shape4 0.5s ease 0s infinite alternate;
animation: animation1shape4 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation1shape4 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-16px, -16px);
transform: translate(-16px, -16px);
}
}
@keyframes animation1shape4 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-16px, -16px);
transform: translate(-16px, -16px);
}
}
</style>
<template>
<view class="container loading2">
<view class="shape shape1"></view>
<view class="shape shape2"></view>
<view class="shape shape3"></view>
<view class="shape shape4"></view>
</view>
</template>
<script>
export default {
name: 'loading2',
data() {
return {
};
}
}
</script>
<style scoped="true">
.container {
width: 30px;
height: 30px;
position: relative;
}
.container.loading2 {
-webkit-transform: rotate(10deg);
transform: rotate(10deg);
}
.container.loading2 .shape {
border-radius: 5px;
}
.container.loading2{
-webkit-animation: rotation 1s infinite;
animation: rotation 1s infinite;
}
.container .shape {
position: absolute;
width: 10px;
height: 10px;
border-radius: 1px;
}
.container .shape.shape1 {
left: 0;
background-color: #1890FF;
}
.container .shape.shape2 {
right: 0;
background-color: #91CB74;
}
.container .shape.shape3 {
bottom: 0;
background-color: #FAC858;
}
.container .shape.shape4 {
bottom: 0;
right: 0;
background-color: #EE6666;
}
.loading2 .shape1 {
-webkit-animation: animation2shape1 0.5s ease 0s infinite alternate;
animation: animation2shape1 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation2shape1 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(20px, 20px);
transform: translate(20px, 20px);
}
}
@keyframes animation2shape1 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(20px, 20px);
transform: translate(20px, 20px);
}
}
.loading2 .shape2 {
-webkit-animation: animation2shape2 0.5s ease 0s infinite alternate;
animation: animation2shape2 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation2shape2 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-20px, 20px);
transform: translate(-20px, 20px);
}
}
@keyframes animation2shape2 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-20px, 20px);
transform: translate(-20px, 20px);
}
}
.loading2 .shape3 {
-webkit-animation: animation2shape3 0.5s ease 0s infinite alternate;
animation: animation2shape3 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation2shape3 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(20px, -20px);
transform: translate(20px, -20px);
}
}
@keyframes animation2shape3 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(20px, -20px);
transform: translate(20px, -20px);
}
}
.loading2 .shape4 {
-webkit-animation: animation2shape4 0.5s ease 0s infinite alternate;
animation: animation2shape4 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation2shape4 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-20px, -20px);
transform: translate(-20px, -20px);
}
}
@keyframes animation2shape4 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-20px, -20px);
transform: translate(-20px, -20px);
}
}
</style>
<template>
<view class="container loading3">
<view class="shape shape1"></view>
<view class="shape shape2"></view>
<view class="shape shape3"></view>
<view class="shape shape4"></view>
</view>
</template>
<script>
export default {
name: 'loading3',
data() {
return {
};
}
}
</script>
<style scoped="true">
.container {
width: 30px;
height: 30px;
position: relative;
}
.container.loading3 {
-webkit-animation: rotation 1s infinite;
animation: rotation 1s infinite;
}
.container.loading3 .shape1 {
border-top-left-radius: 10px;
}
.container.loading3 .shape2 {
border-top-right-radius: 10px;
}
.container.loading3 .shape3 {
border-bottom-left-radius: 10px;
}
.container.loading3 .shape4 {
border-bottom-right-radius: 10px;
}
.container .shape {
position: absolute;
width: 10px;
height: 10px;
border-radius: 1px;
}
.container .shape.shape1 {
left: 0;
background-color: #1890FF;
}
.container .shape.shape2 {
right: 0;
background-color: #91CB74;
}
.container .shape.shape3 {
bottom: 0;
background-color: #FAC858;
}
.container .shape.shape4 {
bottom: 0;
right: 0;
background-color: #EE6666;
}
.loading3 .shape1 {
-webkit-animation: animation3shape1 0.5s ease 0s infinite alternate;
animation: animation3shape1 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation3shape1 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(5px, 5px);
transform: translate(5px, 5px);
}
}
@keyframes animation3shape1 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(5px, 5px);
transform: translate(5px, 5px);
}
}
.loading3 .shape2 {
-webkit-animation: animation3shape2 0.5s ease 0s infinite alternate;
animation: animation3shape2 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation3shape2 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-5px, 5px);
transform: translate(-5px, 5px);
}
}
@keyframes animation3shape2 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-5px, 5px);
transform: translate(-5px, 5px);
}
}
.loading3 .shape3 {
-webkit-animation: animation3shape3 0.5s ease 0s infinite alternate;
animation: animation3shape3 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation3shape3 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(5px, -5px);
transform: translate(5px, -5px);
}
}
@keyframes animation3shape3 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(5px, -5px);
transform: translate(5px, -5px);
}
}
.loading3 .shape4 {
-webkit-animation: animation3shape4 0.5s ease 0s infinite alternate;
animation: animation3shape4 0.5s ease 0s infinite alternate;
}
@-webkit-keyframes animation3shape4 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-5px, -5px);
transform: translate(-5px, -5px);
}
}
@keyframes animation3shape4 {
from {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
to {
-webkit-transform: translate(-5px, -5px);
transform: translate(-5px, -5px);
}
}
</style>
<template>
<view class="container loading5">
<view class="shape shape1"></view>
<view class="shape shape2"></view>
<view class="shape shape3"></view>
<view class="shape shape4"></view>
</view>
</template>
<script>
export default {
name: 'loading5',
data() {
return {
};
}
}
</script>
<style scoped="true">
.container {
width: 30px;
height: 30px;
position: relative;
}
.container.loading5 .shape {
width: 15px;
height: 15px;
}
.container .shape {
position: absolute;
width: 10px;
height: 10px;
border-radius: 1px;
}
.container .shape.shape1 {
left: 0;
background-color: #1890FF;
}
.container .shape.shape2 {
right: 0;
background-color: #91CB74;
}
.container .shape.shape3 {
bottom: 0;
background-color: #FAC858;
}
.container .shape.shape4 {
bottom: 0;
right: 0;
background-color: #EE6666;
}
.loading5 .shape1 {
animation: animation5shape1 2s ease 0s infinite reverse;
}
@-webkit-keyframes animation5shape1 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, 15px);
transform: translate(0, 15px);
}
50% {
-webkit-transform: translate(15px, 15px);
transform: translate(15px, 15px);
}
75% {
-webkit-transform: translate(15px, 0);
transform: translate(15px, 0);
}
}
@keyframes animation5shape1 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, 15px);
transform: translate(0, 15px);
}
50% {
-webkit-transform: translate(15px, 15px);
transform: translate(15px, 15px);
}
75% {
-webkit-transform: translate(15px, 0);
transform: translate(15px, 0);
}
}
.loading5 .shape2 {
animation: animation5shape2 2s ease 0s infinite reverse;
}
@-webkit-keyframes animation5shape2 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(-15px, 0);
transform: translate(-15px, 0);
}
50% {
-webkit-transform: translate(-15px, 15px);
transform: translate(-15px, 15px);
}
75% {
-webkit-transform: translate(0, 15px);
transform: translate(0, 15px);
}
}
@keyframes animation5shape2 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(-15px, 0);
transform: translate(-15px, 0);
}
50% {
-webkit-transform: translate(-15px, 15px);
transform: translate(-15px, 15px);
}
75% {
-webkit-transform: translate(0, 15px);
transform: translate(0, 15px);
}
}
.loading5 .shape3 {
animation: animation5shape3 2s ease 0s infinite reverse;
}
@-webkit-keyframes animation5shape3 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(15px, 0);
transform: translate(15px, 0);
}
50% {
-webkit-transform: translate(15px, -15px);
transform: translate(15px, -15px);
}
75% {
-webkit-transform: translate(0, -15px);
transform: translate(0, -15px);
}
}
@keyframes animation5shape3 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(15px, 0);
transform: translate(15px, 0);
}
50% {
-webkit-transform: translate(15px, -15px);
transform: translate(15px, -15px);
}
75% {
-webkit-transform: translate(0, -15px);
transform: translate(0, -15px);
}
}
.loading5 .shape4 {
animation: animation5shape4 2s ease 0s infinite reverse;
}
@-webkit-keyframes animation5shape4 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, -15px);
transform: translate(0, -15px);
}
50% {
-webkit-transform: translate(-15px, -15px);
transform: translate(-15px, -15px);
}
75% {
-webkit-transform: translate(-15px, 0);
transform: translate(-15px, 0);
}
}
@keyframes animation5shape4 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, -15px);
transform: translate(0, -15px);
}
50% {
-webkit-transform: translate(-15px, -15px);
transform: translate(-15px, -15px);
}
75% {
-webkit-transform: translate(-15px, 0);
transform: translate(-15px, 0);
}
}
</style>
<template>
<view class="container loading6">
<view class="shape shape1"></view>
<view class="shape shape2"></view>
<view class="shape shape3"></view>
<view class="shape shape4"></view>
</view>
</template>
<script>
export default {
name: 'loading6',
data() {
return {
};
}
}
</script>
<style scoped="true">
.container {
width: 30px;
height: 30px;
position: relative;
}
.container.loading6 {
-webkit-animation: rotation 1s infinite;
animation: rotation 1s infinite;
}
.container.loading6 .shape {
width: 12px;
height: 12px;
border-radius: 2px;
}
.container .shape {
position: absolute;
width: 10px;
height: 10px;
border-radius: 1px;
}
.container .shape.shape1 {
left: 0;
background-color: #1890FF;
}
.container .shape.shape2 {
right: 0;
background-color: #91CB74;
}
.container .shape.shape3 {
bottom: 0;
background-color: #FAC858;
}
.container .shape.shape4 {
bottom: 0;
right: 0;
background-color: #EE6666;
}
.loading6 .shape1 {
-webkit-animation: animation6shape1 2s linear 0s infinite normal;
animation: animation6shape1 2s linear 0s infinite normal;
}
@-webkit-keyframes animation6shape1 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, 18px);
transform: translate(0, 18px);
}
50% {
-webkit-transform: translate(18px, 18px);
transform: translate(18px, 18px);
}
75% {
-webkit-transform: translate(18px, 0);
transform: translate(18px, 0);
}
}
@keyframes animation6shape1 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, 18px);
transform: translate(0, 18px);
}
50% {
-webkit-transform: translate(18px, 18px);
transform: translate(18px, 18px);
}
75% {
-webkit-transform: translate(18px, 0);
transform: translate(18px, 0);
}
}
.loading6 .shape2 {
-webkit-animation: animation6shape2 2s linear 0s infinite normal;
animation: animation6shape2 2s linear 0s infinite normal;
}
@-webkit-keyframes animation6shape2 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(-18px, 0);
transform: translate(-18px, 0);
}
50% {
-webkit-transform: translate(-18px, 18px);
transform: translate(-18px, 18px);
}
75% {
-webkit-transform: translate(0, 18px);
transform: translate(0, 18px);
}
}
@keyframes animation6shape2 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(-18px, 0);
transform: translate(-18px, 0);
}
50% {
-webkit-transform: translate(-18px, 18px);
transform: translate(-18px, 18px);
}
75% {
-webkit-transform: translate(0, 18px);
transform: translate(0, 18px);
}
}
.loading6 .shape3 {
-webkit-animation: animation6shape3 2s linear 0s infinite normal;
animation: animation6shape3 2s linear 0s infinite normal;
}
@-webkit-keyframes animation6shape3 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(18px, 0);
transform: translate(18px, 0);
}
50% {
-webkit-transform: translate(18px, -18px);
transform: translate(18px, -18px);
}
75% {
-webkit-transform: translate(0, -18px);
transform: translate(0, -18px);
}
}
@keyframes animation6shape3 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(18px, 0);
transform: translate(18px, 0);
}
50% {
-webkit-transform: translate(18px, -18px);
transform: translate(18px, -18px);
}
75% {
-webkit-transform: translate(0, -18px);
transform: translate(0, -18px);
}
}
.loading6 .shape4 {
-webkit-animation: animation6shape4 2s linear 0s infinite normal;
animation: animation6shape4 2s linear 0s infinite normal;
}
@-webkit-keyframes animation6shape4 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, -18px);
transform: translate(0, -18px);
}
50% {
-webkit-transform: translate(-18px, -18px);
transform: translate(-18px, -18px);
}
75% {
-webkit-transform: translate(-18px, 0);
transform: translate(-18px, 0);
}
}
@keyframes animation6shape4 {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
25% {
-webkit-transform: translate(0, -18px);
transform: translate(0, -18px);
}
50% {
-webkit-transform: translate(-18px, -18px);
transform: translate(-18px, -18px);
}
75% {
-webkit-transform: translate(-18px, 0);
transform: translate(-18px, 0);
}
}
</style>
<template>
<view>
<Loading1 v-if="loadingType==1"/>
<Loading2 v-if="loadingType==2"/>
<Loading3 v-if="loadingType==3"/>
<Loading4 v-if="loadingType==4"/>
<Loading5 v-if="loadingType==5"/>
</view>
</template>
<script>
import Loading1 from "./loading1.vue";
import Loading2 from "./loading2.vue";
import Loading3 from "./loading3.vue";
import Loading4 from "./loading4.vue";
import Loading5 from "./loading5.vue";
export default {
components:{Loading1,Loading2,Loading3,Loading4,Loading5},
name: 'qiun-loading',
props: {
loadingType: {
type: Number,
default: 2
},
},
data() {
return {
};
},
}
</script>
<style>
</style>
/*
* uCharts®
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
* 复制使用请保留本段注释,感谢支持开源!
*
* uCharts®官方网站
* https://www.uCharts.cn
*
* 开源地址:
* https://gitee.com/uCharts/uCharts
*
* uni-app插件市场地址:
* http://ext.dcloud.net.cn/plugin?id=271
*
*/
// 通用配置项
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'];
const cfe = {
//demotype为自定义图表类型
"type": ["pie", "ring", "rose", "funnel", "line", "column", "area", "radar", "gauge","candle","demotype"],
//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型例如最后的"demotype"
"categories": ["line", "column", "area", "radar", "gauge", "candle","demotype"],
//instance为实例变量承载属性,option为eopts承载属性,不要删除
"instance": {},
"option": {},
//下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
"formatter":{
"tooltipDemo1":function(res){
let result = ''
for (let i in res) {
if (i == 0) {
result += res[i].axisValueLabel + '年销售额'
}
let value = '--'
if (res[i].data !== null) {
value = res[i].data
}
// #ifdef H5
result += '\n' + res[i].seriesName + ':' + value + ' 万元'
// #endif
// #ifdef APP-PLUS
result += '<br/>' + res[i].marker + res[i].seriesName + ':' + value + ' 万元'
// #endif
}
return result;
},
legendFormat:function(name){
return "自定义图例+"+name;
},
yAxisFormatDemo:function (value, index) {
return value + '元';
},
seriesFormatDemo:function(res){
return res.name + '年' + res.value + '元';
}
},
//这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在eopts参数,会将demotype与eopts中option合并后渲染图表。
"demotype":{
"color": color,
//在这里填写echarts的option即可
},
//下面是自定义配置,请添加项目所需的通用配置
"column": {
"color": color,
"title": {
"text": ''
},
"tooltip": {
"trigger": 'axis'
},
"grid": {
"top": 30,
"bottom": 50,
"right": 15,
"left": 40
},
"legend": {
"bottom": 'left',
},
"toolbox": {
"show": false,
},
"xAxis": {
"type": 'category',
"axisLabel": {
"color": '#666666'
},
"axisLine": {
"lineStyle": {
"color": '#CCCCCC'
}
},
"boundaryGap": true,
"data": []
},
"yAxis": {
"type": 'value',
"axisTick": {
"show": false,
},
"axisLabel": {
"color": '#666666'
},
"axisLine": {
"lineStyle": {
"color": '#CCCCCC'
}
},
},
"seriesTemplate": {
"name": '',
"type": 'bar',
"data": [],
"barwidth": 20,
"label": {
"show": true,
"color": "#666666",
"position": 'top',
},
},
},
"line": {
"color": color,
"title": {
"text": ''
},
"tooltip": {
"trigger": 'axis'
},
"grid": {
"top": 30,
"bottom": 50,
"right": 15,
"left": 40
},
"legend": {
"bottom": 'left',
},
"toolbox": {
"show": false,
},
"xAxis": {
"type": 'category',
"axisLabel": {
"color": '#666666'
},
"axisLine": {
"lineStyle": {
"color": '#CCCCCC'
}
},
"boundaryGap": true,
"data": []
},
"yAxis": {
"type": 'value',
"axisTick": {
"show": false,
},
"axisLabel": {
"color": '#666666'
},
"axisLine": {
"lineStyle": {
"color": '#CCCCCC'
}
},
},
"seriesTemplate": {
"name": '',
"type": 'line',
"data": [],
"barwidth": 20,
"label": {
"show": true,
"color": "#666666",
"position": 'top',
},
},
},
"area": {
"color": color,
"title": {
"text": ''
},
"tooltip": {
"trigger": 'axis'
},
"grid": {
"top": 30,
"bottom": 50,
"right": 15,
"left": 40
},
"legend": {
"bottom": 'left',
},
"toolbox": {
"show": false,
},
"xAxis": {
"type": 'category',
"axisLabel": {
"color": '#666666'
},
"axisLine": {
"lineStyle": {
"color": '#CCCCCC'
}
},
"boundaryGap": true,
"data": []
},
"yAxis": {
"type": 'value',
"axisTick": {
"show": false,
},
"axisLabel": {
"color": '#666666'
},
"axisLine": {
"lineStyle": {
"color": '#CCCCCC'
}
},
},
"seriesTemplate": {
"name": '',
"type": 'line',
"data": [],
"areaStyle": {},
"label": {
"show": true,
"color": "#666666",
"position": 'top',
},
},
},
"pie": {
"color": color,
"title": {
"text": ''
},
"tooltip": {
"trigger": 'item'
},
"grid": {
"top": 40,
"bottom": 30,
"right": 15,
"left": 15
},
"legend": {
"bottom": 'left',
},
"seriesTemplate": {
"name": '',
"type": 'pie',
"data": [],
"radius": '50%',
"label": {
"show": true,
"color": "#666666",
"position": 'top',
},
},
},
"ring": {
"color": color,
"title": {
"text": ''
},
"tooltip": {
"trigger": 'item'
},
"grid": {
"top": 40,
"bottom": 30,
"right": 15,
"left": 15
},
"legend": {
"bottom": 'left',
},
"seriesTemplate": {
"name": '',
"type": 'pie',
"data": [],
"radius": ['40%', '70%'],
"avoidLabelOverlap": false,
"label": {
"show": true,
"color": "#666666",
"position": 'top',
},
"labelLine": {
"show": true
},
},
},
"rose": {
"color": color,
"title": {
"text": ''
},
"tooltip": {
"trigger": 'item'
},
"legend": {
"top": 'bottom'
},
"seriesTemplate": {
"name": '',
"type": 'pie',
"data": [],
"radius": "55%",
"center": ['50%', '50%'],
"roseType": 'area',
},
},
"funnel": {
"color": color,
"title": {
"text": ''
},
"tooltip": {
"trigger": 'item',
"formatter": "{b} : {c}%"
},
"legend": {
"top": 'bottom'
},
"seriesTemplate": {
"name": '',
"type": 'funnel',
"left": '10%',
"top": 60,
"bottom": 60,
"width": '80%',
"min": 0,
"max": 100,
"minSize": '0%',
"maxSize": '100%',
"sort": 'descending',
"gap": 2,
"label": {
"show": true,
"position": 'inside'
},
"labelLine": {
"length": 10,
"lineStyle": {
"width": 1,
"type": 'solid'
}
},
"itemStyle": {
"bordercolor": '#fff',
"borderwidth": 1
},
"emphasis": {
"label": {
"fontSize": 20
}
},
"data": [],
},
},
"gauge": {
"color": color,
"tooltip": {
"formatter": '{a} <br/>{b} : {c}%'
},
"seriesTemplate": {
"name": '业务指标',
"type": 'gauge',
"detail": {"formatter": '{value}%'},
"data": [{"value": 50, "name": '完成率'}]
},
},
"candle": {
"xAxis": {
"data": []
},
"yAxis": {},
"color": color,
"title": {
"text": ''
},
"dataZoom": [{
"type": 'inside',
"xAxisIndex": [0, 1],
"start": 10,
"end": 100
},
{
"show": true,
"xAxisIndex": [0, 1],
"type": 'slider',
"bottom": 10,
"start": 10,
"end": 100
}
],
"seriesTemplate": {
"name": '',
"type": 'k',
"data": [],
},
}
}
export default cfe;
\ No newline at end of file
# uCharts JSSDK说明
1、如不使用uCharts组件,可直接引用u-charts.js,打包编译后会`自动压缩`,压缩后体积约为`120kb`
2、如果120kb的体积仍需压缩,请手到uCharts官网通过在线定制选择您需要的图表。
3、config-ucharts.js为uCharts组件的用户配置文件,升级前请`自行备份config-ucharts.js`文件,以免被强制覆盖。
4、config-echarts.js为ECharts组件的用户配置文件,升级前请`自行备份config-echarts.js`文件,以免被强制覆盖。
\ No newline at end of file
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
{
"id": "qiun-data-charts",
"displayName": "秋云 ucharts echarts 高性能跨全端图表组件",
"version": "2.5.0-20230101",
"description": "uCharts 新增正负柱状图!支持H5及APP用 ucharts echarts 渲染图表,uniapp可视化首选组件",
"keywords": [
"ucharts",
"echarts",
"f2",
"图表",
"可视化"
],
"repository": "https://gitee.com/uCharts/uCharts",
"engines": {
"HBuilderX": "^3.3.8"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": "474119"
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/~qiun",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
![logo](https://img-blog.csdnimg.cn/4a276226973841468c1be356f8d9438b.png)
[![star](https://gitee.com/uCharts/uCharts/badge/star.svg?theme=gvp)](https://gitee.com/uCharts/uCharts/stargazers)
[![fork](https://gitee.com/uCharts/uCharts/badge/fork.svg?theme=gvp)](https://gitee.com/uCharts/uCharts/members)
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![npm package](https://img.shields.io/npm/v/@qiun/ucharts.svg?style=flat-square)](https://www.npmjs.com/~qiun)
## uCharts简介
`uCharts`是一款基于`canvas API`开发的适用于所有前端应用的图表库,开发者编写一套代码,可运行到 Web、iOS、Android(基于 uni-app / taro )、以及各种小程序(微信/支付宝/百度/头条/飞书/QQ/快手/钉钉/淘宝)、快应用等更多支持 canvas API 的平台。
## 官方网站
## [https://www.ucharts.cn](https://www.ucharts.cn)
## 快速体验
一套代码编到多个平台,依次扫描二维码,亲自体验uCharts图表跨平台效果!其他平台请自行编译。
![](https://www.ucharts.cn/images/web/guide/qrcode20220224.png)
![](https://img-blog.csdnimg.cn/7d0115593ff24ac39a224fb7c6ed72a4.png)
## 致开发者
感谢各位开发者`五年`来对秋云及uCharts的支持,uCharts的进步离不开各位开发者的鼓励与贡献。为更好的帮助各位开发者使用图表工具,我们推出了新版官网,增加了在线定制、问答社区、在线配置等一些增值服务,为确保您能更好的应用图表组件,建议您先`仔细阅读官网指南`以及`常见问题`,而不是下载下来`直接使用`。如仍然不能解决,请到`官网社区`或开通会员后加入`专属VIP会员群`提问将会很快得到回答。
## 视频教程
## [uCharts新手入门教程](https://www.bilibili.com/video/BV1qA411Q7se/?share_source=copy_web&vd_source=42a1242f9aaade6427736af69eb2e1d9)
## 社群支持
uCharts官方拥有5个2000人的QQ群及专属VIP会员群支持,庞大的用户量证明我们一直在努力,请各位放心使用!uCharts的开源图表组件的开发,团队付出了大量的时间与精力,经过四来的考验,不会有比较明显的bug,请各位放心使用。如果您有更好的想法,可以在`码云提交Pull Requests`以帮助更多开发者完成需求,再次感谢各位对uCharts的鼓励与支持!
#### 官方交流群
- 交流群1:371774600(已满)
- 交流群2:619841586(已满)
- 交流群3:955340127(已满)
- 交流群4:641669795(已满)
- 交流群5:236294809(只能扫码加入)
![](https://www.ucharts.cn/images/web/qq5.jpg)
- 口令`uniapp`
#### 专属VIP会员群
- 开通会员后详见【账号详情】页面中顶部的滚动通知
- 口令`您的用户ID`
## 版权信息
uCharts始终坚持开源,遵循 [Apache Licence 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) 开源协议,意味着您无需支付任何费用,即可将uCharts应用到您的产品中。
注意:这并不意味着您可以将uCharts应用到非法的领域,比如涉及赌博,暴力等方面。如因此产生纠纷或法律问题,uCharts相关方及秋云科技不承担任何责任。
## 合作伙伴
[![DIY官网](https://www.ucharts.cn/images/web/guide/links/diy-gw.png)](https://www.diygw.com/)
[![HasChat](https://www.ucharts.cn/images/web/guide/links/haschat.png)](https://gitee.com/howcode/has-chat)
[![uViewUI](https://www.ucharts.cn/images/web/guide/links/uView.png)](https://www.uviewui.com/)
[![图鸟UI](https://www.ucharts.cn/images/web/guide/links/tuniao.png)](https://ext.dcloud.net.cn/plugin?id=7088)
[![thorui](https://www.ucharts.cn/images/web/guide/links/thorui.png)](https://ext.dcloud.net.cn/publisher?id=202)
[![FirstUI](https://www.ucharts.cn/images/web/guide/links/first.png)](https://www.firstui.cn/)
[![nProUI](https://www.ucharts.cn/images/web/guide/links/nPro.png)](https://ext.dcloud.net.cn/plugin?id=5169)
[![GraceUI](https://www.ucharts.cn/images/web/guide/links/grace.png)](https://www.graceui.com/)
## 更新记录
详见官网指南中说明,[点击此处查看](https://www.ucharts.cn/v2/#/guide/index?id=100)
## 相关链接
- [uCharts官网](https://www.ucharts.cn)
- [DCloud插件市场地址](https://ext.dcloud.net.cn/plugin?id=271)
- [uCharts码云开源托管地址](https://gitee.com/uCharts/uCharts) [![star](https://gitee.com/uCharts/uCharts/badge/star.svg?theme=gvp)](https://gitee.com/uCharts/uCharts/stargazers)
- [uCharts npm开源地址](https://www.ucharts.cn)
- [ECharts官网](https://echarts.apache.org/zh/index.html)
- [ECharts配置手册](https://echarts.apache.org/zh/option.html)
- [图表组件在项目中的应用 ReportPlus数据报表](https://www.ucharts.cn/v2/#/layout/info?id=1)
\ No newline at end of file
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
## 2.1.1(2022-09-16)
1. 将插件更新为`uni_modules`方式
## 2.1.0(2022-08-12)
1. 增加`disable`参数,控制是否可以点击,只能应用在数组对象中,见[disabled 的用法](#112-当tabs使用的数组对象的方式特定参数需要注意一下)
```js
export default {
data() {
return {
tabs: [{ id: 1, name: '' }]
}
}
}
```
## 2.0.10(2022-01-27)
1. 更新属性line-animation设置为false可以不要动画,这是好多朋友问到,特此加上
## 2.0.9(2020-10-12)
1. 修复 v-tabs 第一次可能出现第一个标签显示不完整的情况
2. 修改了 pages/tabs/order 示例文件
## 2.0.8(2020-09-21)
1. 修复添加 fixed 属性后,滚动条无效
2. 修复选项很少的情况下,下划线计算计算错误
3. 新增 paddingItem 属性,设置选项左右边距(上下边距需要设置 height 属性,或者设置 padding 属性)
## 2.0.7(2020-09-17)
1. 紧急修复 bug,横向滑动不了的情况
## 2.0.6(2020-09-16)
1. 新增 fixed 属性,是否固定在顶部,示例地址:pages/tabs/tabs-static
2. 优化之前的页面结构
## 2.0.5(2020-09-09)
1. 修复 width 错误,dom 加载的时候没有及时获取到 data 属性导致的 。
## 2.0.4(2020-08-29)
1. 优化异步改变 tabs 后,下划线不初始化问题
2. github 地址上有图 2 的源码,需要的自行下载,页面路径:pages/tabs/order.vue
## 2.0.3(2020-08-20)
1. 优化 节点查询 和 选中渲染
2. 优化支付宝中 createSelectorQuery() 的影响
**特别说明:**
> 支付宝中平铺方法和其他方法不能在一个页面中出现,不然有一个显示错误(具体什么原因没查到,有好心的人发现了,望告知一下,感谢
## 2.0.2(2020-08-19)
1. 优化 change 事件触发机制
## 2.0.1(2020-08-16)
1. 修改默认高度为 70rpx
2. 新增属性 bgColor,可设置背景颜色,默认 #fff
3. 新增整个 tab 的 padding 属性,默认 0
## 2.0.0(2020-08-13)
1. 全新的 v-tabs 2.0
2. 支持 H5 小程序 APP
3. 属性高度可配置
## 1.3.2(2020-07-21)
1. 新增 auto 的配置,是否平铺 tab
2. 修复文档上的错误示例(感谢 lushgwe@163.com 的反馈)
## 1.3.0(2020-07-05)
1. 新增 padding 的可配置
2. 修复 v-model 双向绑定问题
3. 修复初始化下划线没定位的为题
## 1.2.0(2020-06-19)
1. 添加注释
2. 修复 bug
## 1.1.8(2020-06-11)
1. 添加 change 事件
2. 修复插件内容问题
3. 修复下划线不居中问题
## 1.1.6(2020-06-11)
1. 添加 change 事件
2. 修复插件内容问题
## 1.1.4(2020-06-11)
1. 添加 change 事件
2. 修复插件内容问题
## 1.1.2(2020-06-11)
1. 添加 change 事件
## 1.1.1(2020-06-09)
1. 修复小程序端选中的下划线不显示问题
2. 新增 tab 高度设置
3. lineHeight 修改为只支持 String 方式
## 1.1.0(2020-06-09)
1. 修复小程序端选中的下划线不显示问题
2. 新增 tab 高度设置
3. lineHeight 修改为只支持 String 方式
## 1.0.0(2020-06-04)
1. 更新插件1.0.0
\ No newline at end of file
<template>
<view :id="elId" class="v-tabs">
<scroll-view
id="scrollContainer"
:scroll-x="scroll"
:scroll-left="scroll ? scrollLeft : 0"
:scroll-with-animation="scroll"
:style="{ position: fixed ? 'fixed' : 'relative', zIndex: 1993 }"
>
<view
class="v-tabs__container"
:style="{
display: scroll ? 'inline-flex' : 'flex',
whiteSpace: scroll ? 'nowrap' : 'normal',
background: bgColor,
height,
padding
}"
>
<view
:class="['v-tabs__container-item', { disabled: !!v.disabled }]"
v-for="(v, i) in tabs"
:key="i"
:style="{
color: current == i ? activeColor : color,
fontSize: current == i ? fontSize : fontSize,
fontWeight: bold && current == i ? 'bold' : '',
justifyContent: !scroll ? 'center' : '',
flex: scroll ? '' : 1,
padding: paddingItem
}"
@click="change(i)"
>
{{ field ? v[field] : v }}
</view>
<view
v-if="!pills"
:class="['v-tabs__container-line', { animation: lineAnimation }]"
:style="{
background: lineColor,
width: lineWidth + 'px',
height: lineHeight,
borderRadius: lineRadius,
left: lineLeft + 'px',
transform: `translateX(-${lineWidth / 2}px)`
}"
></view>
<view
v-else
:class="['v-tabs__container-pills', { animation: lineAnimation }]"
:style="{
background: pillsColor,
borderRadius: pillsBorderRadius,
left: pillsLeft + 'px',
width: currentWidth + 'px',
height
}"
></view>
</view>
</scroll-view>
<view
class="v-tabs__placeholder"
:style="{
height: fixed ? height : '0',
padding
}"
></view>
</view>
</template>
<script>
/**
* v-tabs
* @property {Number} value 选中的下标
* @property {Array} tabs tabs 列表
* @property {String} bgColor = '#fff' 背景颜色
* @property {String} color = '#333' 默认颜色
* @property {String} activeColor = '#2979ff' 选中文字颜色
* @property {String} fontSize = '28rpx' 默认文字大小
* @property {String} activeFontSize = '28rpx' 选中文字大小
* @property {Boolean} bold = [true | false] 选中文字是否加粗
* @property {Boolean} scroll = [true | false] 是否滚动
* @property {String} height = '60rpx' tab 的高度
* @property {String} lineHeight = '10rpx' 下划线的高度
* @property {String} lineColor = '#2979ff' 下划线的颜色
* @property {Number} lineScale = 0.5 下划线的宽度缩放比例
* @property {String} lineRadius = '10rpx' 下划线圆角
* @property {Boolean} pills = [true | false] 是否胶囊样式
* @property {String} pillsColor = '#2979ff' 胶囊背景色
* @property {String} pillsBorderRadius = '10rpx' 胶囊圆角大小
* @property {String} field 如果是对象,显示的键名
* @property {Boolean} fixed = [true | false] 是否固定
* @property {String} paddingItem = '0 22rpx' 选项的边距
* @property {Boolean} lineAnimation = [true | false] 下划线是否有动画
*
* @event {Function(current)} change 改变标签触发
*/
export default {
props: {
value: {
type: Number,
default: 0
},
tabs: {
type: Array,
default () {
return []
}
},
bgColor: {
type: String,
default: '#fff'
},
padding: {
type: String,
default: '0'
},
color: {
type: String,
default: '#333'
},
activeColor: {
type: String,
default: '#2979ff'
},
fontSize: {
type: String,
default: '28rpx'
},
activeFontSize: {
type: String,
default: '32rpx'
},
bold: {
type: Boolean,
default: true
},
scroll: {
type: Boolean,
default: true
},
height: {
type: String,
default: '70rpx'
},
lineColor: {
type: String,
default: '#2979ff'
},
lineHeight: {
type: String,
default: '10rpx'
},
lineScale: {
type: Number,
default: 0.5
},
lineRadius: {
type: String,
default: '10rpx'
},
pills: {
type: Boolean,
default: false
},
pillsColor: {
type: String,
default: '#2979ff'
},
pillsBorderRadius: {
type: String,
default: '10rpx'
},
field: {
type: String,
default: ''
},
fixed: {
type: Boolean,
default: false
},
paddingItem: {
type: String,
default: '0 22rpx'
},
lineAnimation: {
type: Boolean,
default: true
}
},
data () {
return {
elId: '',
lineWidth: 30,
currentWidth: 0, // 当前选项的宽度
lineLeft: 0, // 滑块距离左侧的位置
pillsLeft: 0, // 胶囊距离左侧的位置
scrollLeft: 0, // 距离左边的位置
containerWidth: 0, // 容器的宽度
current: 0 // 当前选中项
}
},
watch: {
value (newVal) {
this.current = newVal
this.$nextTick(() => {
this.getTabItemWidth()
})
},
current (newVal) {
this.$emit('input', newVal)
},
tabs (newVal) {
this.$nextTick(() => {
this.getTabItemWidth()
})
}
},
methods: {
// 产生随机字符串
randomString (len) {
len = len || 32
let $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678' /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
let maxPos = $chars.length
let pwd = ''
for (let i = 0; i < len; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos))
}
return pwd
},
// 切换事件
change (index) {
const isDisabled = !!this.tabs[index].disabled
if (this.current !== index && !isDisabled) {
this.current = index
this.$emit('change', index)
}
},
// 获取左移动位置
getTabItemWidth () {
let query = uni
.createSelectorQuery()
// #ifndef MP-ALIPAY
.in(this)
// #endif
// 获取容器的宽度
query
.select(`#scrollContainer`)
.boundingClientRect((data) => {
if (!this.containerWidth && data) {
this.containerWidth = data.width
}
})
.exec()
// 获取所有的 tab-item 的宽度
query
.selectAll('.v-tabs__container-item')
.boundingClientRect((data) => {
if (!data) {
return
}
let lineLeft = 0
let currentWidth = 0
if (data) {
for (let i = 0; i < data.length; i++) {
if (i < this.current) {
lineLeft += data[i].width
} else if (i == this.current) {
currentWidth = data[i].width
} else {
break
}
}
}
// 当前滑块的宽度
this.currentWidth = currentWidth
// 缩放后的滑块宽度
this.lineWidth = currentWidth * this.lineScale * 1
// 滑块作移动的位置
this.lineLeft = lineLeft + currentWidth / 2
// 胶囊距离左侧的位置
this.pillsLeft = lineLeft
// 计算滚动的距离左侧的位置
if (this.scroll) {
this.scrollLeft = this.lineLeft - this.containerWidth / 2
}
})
.exec()
}
},
mounted () {
this.elId = 'xfjpeter_' + this.randomString()
this.current = this.value
this.$nextTick(() => {
this.getTabItemWidth()
})
}
}
</script>
<style lang="scss" scoped>
.v-tabs {
width: 100%;
box-sizing: border-box;
overflow: hidden;
::-webkit-scrollbar {
display: none;
}
&__container {
min-width: 100%;
position: relative;
display: inline-flex;
align-items: center;
white-space: nowrap;
overflow: hidden;
&-item {
display: flex;
align-items: center;
height: 100%;
position: relative;
z-index: 10;
// padding: 0 11px;
transition: all 0.3s;
white-space: nowrap;
&.disabled {
opacity: 0.5;
color: #999;
}
}
&-line {
position: absolute;
bottom: 0;
}
&-pills {
position: absolute;
z-index: 9;
}
&-line,
&-pills {
&.animation {
transition: all 0.3s linear;
}
}
}
}
</style>
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!