@ -0,0 +1,16 @@
|
||||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
/unpackage/*
|
||||
/node_modules/*
|
||||
|
||||
######################################################################
|
||||
# Development Tools
|
||||
|
||||
/.idea/*
|
||||
/.vscode/*
|
||||
/.hbuilderx/*
|
||||
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
@ -0,0 +1,36 @@
|
||||
<script>
|
||||
import config from './config'
|
||||
import store from '@/store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
this.initApp()
|
||||
},
|
||||
methods: {
|
||||
// 初始化应用
|
||||
initApp() {
|
||||
// 初始化应用配置
|
||||
this.initConfig()
|
||||
// 检查用户登录状态
|
||||
//#ifdef H5
|
||||
this.checkLogin()
|
||||
//#endif
|
||||
},
|
||||
initConfig() {
|
||||
this.globalData.config = config
|
||||
},
|
||||
checkLogin() {
|
||||
if (!getToken()) {
|
||||
this.$tab.reLaunch('/pages/login')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/static/scss/index.scss';
|
||||
@import '@/uni_modules/uview-ui/index.scss'
|
||||
|
||||
</style>
|
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright © 2025 长江云息数字科技 出品
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -0,0 +1,11 @@
|
||||
import upload from '@/utils/upload'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 统计数据
|
||||
export function homeTjApi(params) {
|
||||
return request({
|
||||
url: '/app-api/app/task/produce/statistic',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 登录方法
|
||||
export function login(username, password) {
|
||||
const data = {
|
||||
username,
|
||||
password
|
||||
}
|
||||
return request({
|
||||
'url': '/admin-api/system/auth/login',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
'method': 'post',
|
||||
'data': data
|
||||
})
|
||||
}
|
||||
|
||||
// 注册方法
|
||||
export function register(data) {
|
||||
return request({
|
||||
url: '/admin-api/register',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户详细信息
|
||||
export function getInfo(userId) {
|
||||
const url = `/app-api/app/user/${userId}`
|
||||
return request({
|
||||
'url': url,
|
||||
'method': 'get'
|
||||
})
|
||||
}
|
||||
// 通过用户名获取租户id
|
||||
export function getUserId(name) {
|
||||
const url = `/admin-api/system/tenant/get-tenantId-by-userName?name=${name}`
|
||||
return request({
|
||||
'url': url,
|
||||
'method': 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 退出方法
|
||||
export function logout() {
|
||||
return request({
|
||||
'url': '/admin-api/system/auth/logout',
|
||||
'method': 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
export function getCodeImg() {
|
||||
return request({
|
||||
'url': '/captchaImage',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'get',
|
||||
timeout: 20000
|
||||
})
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
import upload from '@/utils/upload'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd(oldPassword, newPassword) {
|
||||
const data = {
|
||||
oldPassword,
|
||||
newPassword
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/profile/updatePwd',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户头像上传
|
||||
export function uploadAvatar(data) {
|
||||
return upload({
|
||||
url: '/system/user/profile/avatar',
|
||||
name: data.name,
|
||||
filePath: data.filePath
|
||||
})
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
import upload from '@/utils/upload'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 详情数据
|
||||
export function produceDetailApi(params) {
|
||||
return request({
|
||||
url: '/app-api/app/task/produce',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 报工
|
||||
export function produceReportApi(data) {return request({
|
||||
url: '/app-api/app/task/produce/report',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 领料接口
|
||||
export function produceRecieveApi(data) {return request({
|
||||
url: '/app-api/app/task/produce/receive',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 开始/结束任务
|
||||
export function produceOperateApi(data) {return request({
|
||||
url: '/app-api/app/task/produce/operate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
import upload from '@/utils/upload'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 任务列表数据
|
||||
export function taskListApi(params) {
|
||||
return request({
|
||||
url: '/app-api/app/task/produces',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<view class="drawer">
|
||||
<uni-drawer ref="showLeft" mode="left" :width="340">
|
||||
<view class="table">
|
||||
<uni-table ref="table" border stripe emptyText="暂无更多数据">
|
||||
<uni-tr>
|
||||
<uni-th width="100" align="center">物料名称</uni-th>
|
||||
<uni-th width="100" align="center">规格</uni-th>
|
||||
<uni-th align="center">计划领料数量</uni-th>
|
||||
</uni-tr>
|
||||
<uni-tr v-for="(item, index) in detailList" :key="index">
|
||||
<uni-td align="center">
|
||||
<view class="name">{{ item.productName }}</view>
|
||||
</uni-td>
|
||||
<uni-td align="center">{{ item.spec }}</uni-td>
|
||||
<uni-td align="center">
|
||||
<uni-number-box type="number" :max="item.receiveAmount" min="0" :value="item.amount" />
|
||||
</uni-td>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<view @click="closeDrawer" class="item close">关闭</view>
|
||||
<view @click="handelSubmit" class="item submit">提交</view>
|
||||
</view>
|
||||
</uni-drawer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "GoodDrawer",
|
||||
props: {
|
||||
detailList: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closeDrawer() {
|
||||
this.$emit('close')
|
||||
},
|
||||
handleBlur(item) {
|
||||
const obj = this.detailList.find(e => {
|
||||
return e.id == item.id
|
||||
})
|
||||
obj.amount = obj.amount > obj.receiveAmount ? obj.receiveAmount : item.amount;
|
||||
debugger
|
||||
},
|
||||
handelSubmit() {
|
||||
const detailList = this.detailList.map(e => {
|
||||
const obj = {
|
||||
id: e.id,
|
||||
productId: e.productId,
|
||||
amount: e.amount
|
||||
}
|
||||
return obj
|
||||
})
|
||||
this.$emit('submit', detailList)
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.drawer {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
.table {
|
||||
.uni-input {
|
||||
border-bottom: 2rpx solid #D5D6DB;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
.footer {
|
||||
margin: 30px 0;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
.item {
|
||||
flex: 1;
|
||||
border: 2rpx solid #D5D6DB;
|
||||
text-align: center;
|
||||
font-size: 16rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 20rpx 20rpx;
|
||||
margin: 0 20rpx;
|
||||
|
||||
&.close {
|
||||
background-color: #D5D6DB;
|
||||
color: #fff;
|
||||
}
|
||||
&.submit {
|
||||
background-color: #FF7D00;
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,25 @@
|
||||
// 应用全局配置
|
||||
module.exports = {
|
||||
baseUrl: 'http://222.71.165.187:9090',
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
// 应用名称
|
||||
name: "HL-app",
|
||||
// 应用版本
|
||||
version: "1.1.0",
|
||||
// 应用logo
|
||||
logo: "../static/images/login-logo.png",
|
||||
// 官方网站
|
||||
site_url: "http://www.chanko.cn/",
|
||||
// 政策协议
|
||||
agreements: [{
|
||||
title: "隐私政策",
|
||||
url: "http://www.chanko.cn/"
|
||||
},
|
||||
{
|
||||
title: "用户服务协议",
|
||||
url: "http://www.chanko.cn/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import store from './store' // store
|
||||
import plugins from './plugins' // plugins
|
||||
import './permission' // permission
|
||||
import uView from '@/uni_modules/uview-ui'
|
||||
|
||||
Vue.use(plugins)
|
||||
|
||||
Vue.use(uView)
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$store = store
|
||||
|
||||
App.mpType = 'app'
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
|
||||
app.$mount()
|
@ -0,0 +1,69 @@
|
||||
{
|
||||
"name" : "合立报工移动端",
|
||||
"appid" : "__UNI__E171CB7",
|
||||
"description" : "",
|
||||
"versionName" : "1.1.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueCompiler" : "uni-app",
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
"modules" : {},
|
||||
"distribute" : {
|
||||
"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" : {},
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
"quickapp" : {},
|
||||
"mp-weixin" : {
|
||||
"appid" : "wxa29fe397274614b5",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"es6" : true,
|
||||
"minified" : true,
|
||||
"postcss" : true
|
||||
},
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"vueVersion" : "2",
|
||||
"h5" : {
|
||||
"template" : "static/index.html",
|
||||
"devServer" : {
|
||||
"port" : 9090,
|
||||
"https" : false
|
||||
},
|
||||
"title" : "heli-App",
|
||||
"router" : {
|
||||
"mode" : "hash",
|
||||
"base" : "./"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
{
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "合立报工"
|
||||
}
|
||||
},{
|
||||
"path": "pages/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/register",
|
||||
"style": {
|
||||
"navigationBarTitleText": "注册"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/task-detail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/bg-detail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报工详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/task-list/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/task-center/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务中心"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/news/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/avatar/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改头像"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/info/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人信息"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/info/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑资料"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/pwd/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改密码"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/setting/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "应用设置"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/help/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/about/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/common/webview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览网页"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/common/textview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览文本"
|
||||
}
|
||||
}],
|
||||
"tabBar": {
|
||||
"color": "#000000",
|
||||
"selectedColor": "#000000",
|
||||
"borderStyle": "white",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [{
|
||||
"pagePath": "pages/index",
|
||||
"iconPath": "static/images/tabbar/home.png",
|
||||
"selectedIconPath": "static/images/tabbar/home_.png",
|
||||
"text": "首页"
|
||||
}, {
|
||||
"pagePath": "pages/task-center/index",
|
||||
"iconPath": "static/images/tabbar/work.png",
|
||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||
"text": "任务中心"
|
||||
},
|
||||
// {
|
||||
// "pagePath": "pages/news/index",
|
||||
// "iconPath": "static/images/tabbar/news.png",
|
||||
// "selectedIconPath": "static/images/tabbar/news_.png",
|
||||
// "text": "消息"
|
||||
// },
|
||||
{
|
||||
"pagePath": "pages/mine/index",
|
||||
"iconPath": "static/images/tabbar/mine.png",
|
||||
"selectedIconPath": "static/images/tabbar/mine_.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-card class="view-title" :title="title">
|
||||
<text class="uni-body view-content">{{ content }}</text>
|
||||
</uni-card>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.title = options.title
|
||||
this.content = options.content
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.title
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.view-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.view-content {
|
||||
font-size: 26rpx;
|
||||
padding: 12px 5px 0;
|
||||
color: #333;
|
||||
line-height: 24px;
|
||||
font-weight: normal;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<view v-if="params.url">
|
||||
<web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
params: {},
|
||||
webviewStyles: {
|
||||
progress: {
|
||||
color: "#FF3333"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
src: {
|
||||
type: [String],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
onLoad(event) {
|
||||
this.params = event
|
||||
if (event.title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: event.title
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,295 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 导航栏 -->
|
||||
<view class="module-tongji">
|
||||
<view class="title">统计</view>
|
||||
<view class="module-cont">
|
||||
<view class="left" @click="handleTJclick('RECEIVED')">
|
||||
<view class="hd">
|
||||
<view class="text1">已接单</view>
|
||||
<view class="text2">{{tjData.RECEIVED}}<text class="text3"> 单</text></view>
|
||||
</view>
|
||||
<image class="img" mode="aspectFit" src="http://118.195.155.9:8112/hl/yjd.png"></image>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="item" @click="handleTJclick('PROCESSING')">
|
||||
<view class="hd">
|
||||
<view class="text1">进行中</view>
|
||||
<view class="text2">{{tjData.PROCESSING}}<text class="text3"> 单</text></view>
|
||||
</view>
|
||||
<image class="img" mode="aspectFit" src="http://118.195.155.9:8112/hl/jxz.png"></image>
|
||||
</view>
|
||||
<view class="item" @click="handleTJclick('FINISHED')">
|
||||
<view class="hd">
|
||||
<view class="text1">已完成</view>
|
||||
<view class="text2">{{tjData.FINISHED}}<text class="text3"> 单</text></view>
|
||||
</view>
|
||||
<image class="img" mode="aspectFit" src="http://118.195.155.9:8112/hl/dwc.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="module-task">
|
||||
<view class="title">任务</view>
|
||||
<view class="module-cont">
|
||||
<view class="item" @click="handleTaskclick">
|
||||
<image class="img" mode="aspectFit" src="http://118.195.155.9:8112/hl/task-center.png"></image>
|
||||
<text class="name">任务中心</text>
|
||||
</view>
|
||||
<view class="item" @click="handleTaskKg">
|
||||
<image class="img" mode="aspectFit" src="http://118.195.155.9:8112/hl/yjkg.png"></image>
|
||||
<text class="name">一键开工</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {
|
||||
homeTjApi,
|
||||
} from '@/api/home'
|
||||
import {
|
||||
taskListApi
|
||||
} from '@/api/task-list'
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
tjData: {
|
||||
RECEIVED: 0,
|
||||
PROCESSING: 0,
|
||||
FINISHED: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
userInfo() {
|
||||
return this.$store.state.user.userInfo || {};
|
||||
},
|
||||
produceGroupType() {
|
||||
const produceGroupType = this.$store.state.user.userInfo.produceGroupType || '';
|
||||
return produceGroupType
|
||||
}
|
||||
// isLogin() {
|
||||
// return !!getToken()
|
||||
// }
|
||||
},
|
||||
onLoad() {
|
||||
console.log("页面数据加载完成");
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
onReady() {
|
||||
// console.log(uni.$u.getPx('18rpx')); // 以750物理像素(rpx)为基准 1rpx = 0.5px
|
||||
console.log("页面渲染完成");
|
||||
const isLogin = getToken()
|
||||
if (isLogin) {
|
||||
this.initData()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 统计跳转
|
||||
handleTJclick(status) {
|
||||
const url = '/pages/task-list/index?' + 'status=' + status
|
||||
this.$tab.navigateTo(url)
|
||||
},
|
||||
// 任务中心
|
||||
handleTaskclick() {
|
||||
const url = '/pages/task-center/index'
|
||||
this.$tab.switchTab(url)
|
||||
},
|
||||
getKGlist(status) {
|
||||
const params = {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
taskType: this.produceGroupType,
|
||||
status
|
||||
}
|
||||
return taskListApi(params)
|
||||
},
|
||||
// 一键开工
|
||||
handleTaskKg() {
|
||||
this.getKGlist('PROCESSING').then(res => {
|
||||
const { code, data, msg } = res
|
||||
if (data.list && data.list.length) {
|
||||
const id = data.list[0].id
|
||||
const url = `/pages/bg-detail/index?id=${id}&status=RECEIVED`
|
||||
this.$tab.navigateTo(url)
|
||||
} else {
|
||||
this.getKGlist('RECEIVED').then(res2 => {
|
||||
const { code, data, msg } = res2
|
||||
if (data.list && data.list.length) {
|
||||
const id = data.list[0].id
|
||||
const url = `/pages/bg-detail/index?id=${id}&status=RECEIVED`
|
||||
this.$tab.navigateTo(url)
|
||||
} else {
|
||||
this.$modal.showToast("任务中心没有已接单任务,请联系管理员分派~");
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
initData() {
|
||||
const taskType = this.$store.state.user.userInfo.produceGroupType
|
||||
const params = {
|
||||
taskType
|
||||
}
|
||||
homeTjApi(params).then(res => {
|
||||
const user = res.data
|
||||
this.tjData = {
|
||||
...this.tjData,
|
||||
...user
|
||||
}
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 覆盖组件内置样式方式
|
||||
.container ::v-deep {
|
||||
height: 100vh;
|
||||
background-color: #f2f2f2;
|
||||
|
||||
.module-tongji {
|
||||
background-color: #fff;
|
||||
margin: 20rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0px 0px 20rpx 0px rgba(0, 0, 0, 0.15);
|
||||
|
||||
.title {
|
||||
padding-bottom: 8rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #666666;
|
||||
border-bottom: 2rpx solid #f2f2f2;
|
||||
}
|
||||
|
||||
.module-cont {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
.left {
|
||||
width: 320rpx;
|
||||
height: 260rpx;
|
||||
padding: 20rpx;
|
||||
background: #F4F6F8;
|
||||
border-radius: 10rpx;
|
||||
position: relative;
|
||||
margin-right: 20rpx;
|
||||
.hd {
|
||||
.text1 {
|
||||
color: #0D0D26;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.text2 {
|
||||
color: #0D0D26;
|
||||
margin-top: 6rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.text3 {
|
||||
color: #0D0D26;
|
||||
font-size: 20rpx;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
}
|
||||
.img {
|
||||
width: 80px;
|
||||
height: 60px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0rpx;
|
||||
}
|
||||
|
||||
}
|
||||
.right {
|
||||
width: 320rpx;
|
||||
.item {
|
||||
background: #F4F6F8;
|
||||
height: 120rpx;
|
||||
width: 314rpx;
|
||||
margin: 10px 0;
|
||||
padding: 10px;
|
||||
border-radius: 10rpx;
|
||||
position: relative;
|
||||
.hd {
|
||||
.text1 {
|
||||
color: #0D0D26;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.text2 {
|
||||
color: #0D0D26;
|
||||
font-size: 32rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
.text3 {
|
||||
color: #0D0D26;
|
||||
font-size: 20rpx;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
}
|
||||
.img {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0rpx;
|
||||
width: 32px;
|
||||
height: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.module-task {
|
||||
background-color: #fff;
|
||||
margin: 20rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0px 0px 20rpx 0px rgba(0, 0, 0, 0.15);
|
||||
|
||||
.title {
|
||||
padding-bottom: 8rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #666666;
|
||||
border-bottom: 2rpx solid #f2f2f2;
|
||||
}
|
||||
|
||||
.module-cont {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
margin: 0 40rpx;
|
||||
.item {
|
||||
box-sizing: content-box;
|
||||
padding: 36rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 40rpx;
|
||||
|
||||
.img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.name {
|
||||
margin-top: 20rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<view class="about-container">
|
||||
<view class="header-section text-center">
|
||||
<image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix">
|
||||
</image>
|
||||
<uni-title type="h2" title="合立报工小程序"></uni-title>
|
||||
</view>
|
||||
|
||||
<view class="content-section">
|
||||
<view class="menu-list">
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>版本信息</view>
|
||||
<view class="text-right">v{{version}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>官方邮箱</view>
|
||||
<view class="text-right">heli@xx.com</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>服务热线</view>
|
||||
<view class="text-right">400-999-9999</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>公司网站</view>
|
||||
<view class="text-right">
|
||||
<uni-link :href="url" :text="url" showUnderLine="false"></uni-link>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="copyright">
|
||||
<view>Copyright © 2025 长江云息数字科技 出品.</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
url: getApp().globalData.config.appInfo.site_url,
|
||||
version: getApp().globalData.config.appInfo.version
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
margin-top: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.header-section {
|
||||
display: flex;
|
||||
padding: 30rpx 0 0;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<view class="help-container">
|
||||
<view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title">
|
||||
<view class="text-title">
|
||||
<view :class="item.icon"></view>{{ item.title }}
|
||||
</view>
|
||||
<view class="childList">
|
||||
<view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover"
|
||||
@click="handleText(child)">
|
||||
<view class="text-item">{{ child.title }}</view>
|
||||
<view class="line" v-if="zindex !== item.childList.length - 1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
icon: 'iconfont icon-github',
|
||||
title: '合立报工问题',
|
||||
childList: [{
|
||||
title: '合立报工开源吗?',
|
||||
content: '开源'
|
||||
}, {
|
||||
title: '合立报工可以商用吗?',
|
||||
content: '可以'
|
||||
}, {
|
||||
title: '合立报工官网地址多少?',
|
||||
content: 'http://ruoyi.vip'
|
||||
}, {
|
||||
title: '合立报工文档地址多少?',
|
||||
content: 'http://doc.ruoyi.vip'
|
||||
}]
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-help',
|
||||
title: '其他问题',
|
||||
childList: [{
|
||||
title: '如何退出登录?',
|
||||
content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录',
|
||||
}, {
|
||||
title: '如何修改用户头像?',
|
||||
content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像',
|
||||
}, {
|
||||
title: '如何修改登录密码?',
|
||||
content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码',
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleText(item) {
|
||||
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.help-container {
|
||||
margin-bottom: 100rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.list-title {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.childList {
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
|
||||
border-radius: 16rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.text-title {
|
||||
color: #303133;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-left: 10rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 16px;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.text-item {
|
||||
font-size: 28rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.question {
|
||||
color: #606266;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,247 @@
|
||||
<template>
|
||||
<view class="mine-container" :style="{height: `${windowHeight}px`}">
|
||||
<view class="header-section">
|
||||
<view class="header-people">
|
||||
<view class="left">
|
||||
<image class="img" mode="aspectFit" :src="userInfo.avatar"></image>
|
||||
<view class="people-info">
|
||||
<view class="name">{{userInfo.nickname || '默认name'}}</view>
|
||||
<view class="iphone">{{userInfo.mobile || '默认122'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
</view>
|
||||
</view>
|
||||
<view class="future">
|
||||
<image class="img" mode="aspectFit" src="http://118.195.155.9:8112/hl/mine-future.png"></image>
|
||||
</view>
|
||||
<view class="logout">
|
||||
<view class="title" v-if="!isLogin" @click="handleLogin">登录</view>
|
||||
<view class="title" v-else @click="handleLogout">退出账号</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth'
|
||||
import storage from "@/utils/storage";
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
current: 1,
|
||||
// name: this.$store.state.user.userInfo.name || 'name',
|
||||
// mobile: this.$store.state.user.userInfo.mobile || '111',
|
||||
version: getApp().globalData.config.appInfo.version
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userInfo() {
|
||||
return this.$store.state.user.userInfo || {};
|
||||
},
|
||||
avatar() {
|
||||
return this.$store.state.user.avatar;
|
||||
},
|
||||
windowHeight() {
|
||||
return uni.getSystemInfoSync().windowHeight - 50;
|
||||
},
|
||||
isLogin() {
|
||||
return !!getToken()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleToInfo() {
|
||||
this.$modal.showToast("模块建设中~");
|
||||
// this.$tab.navigateTo("/pages/mine/info/index");
|
||||
},
|
||||
handleToEditInfo() {
|
||||
this.$modal.showToast("模块建设中~");
|
||||
// this.$tab.navigateTo("/pages/mine/info/edit");
|
||||
},
|
||||
handleToSetting() {
|
||||
this.$tab.navigateTo("/pages/mine/setting/index");
|
||||
},
|
||||
handleToLogin() {
|
||||
this.$tab.reLaunch("/pages/login");
|
||||
},
|
||||
handleToAvatar() {
|
||||
this.$tab.navigateTo("/pages/mine/avatar/index");
|
||||
},
|
||||
handleLogin() {
|
||||
this.$tab.reLaunch("/pages/login");
|
||||
},
|
||||
handleLogout() {
|
||||
this.$modal.confirm("确定注销并退出系统吗?").then(() => {
|
||||
this.$store.dispatch("LogOut").then(() => {
|
||||
this.$tab.reLaunch("/pages/index");
|
||||
});
|
||||
});
|
||||
},
|
||||
handleHelp() {
|
||||
// this.$modal.showToast("模块建设中~");
|
||||
this.$tab.navigateTo("/pages/login");
|
||||
},
|
||||
handleAbout() {
|
||||
this.$modal.showToast("模块建设中~");
|
||||
// this.$tab.navigateTo("/pages/mine/about/index");
|
||||
},
|
||||
handleBuilding() {
|
||||
this.$modal.showToast("模块建设中~");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mine-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
|
||||
.header-section {
|
||||
padding: 16px 16px 0;
|
||||
|
||||
.header-people {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.people-info {
|
||||
.name {
|
||||
color: #0D0D26;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.iphone {
|
||||
margin-top: 6px;
|
||||
font-size: 14px;
|
||||
color: #95969D;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
padding: 4px 10px;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background-color: red;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.vip {
|
||||
color: #0D0D26;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.header-info {
|
||||
background-color: #fff;
|
||||
padding: 16px 10px;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.item {
|
||||
text-align: center;
|
||||
|
||||
.num {
|
||||
margin-bottom: 4px;
|
||||
color: #0D0D26;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
font-family: Source Han Sans;
|
||||
}
|
||||
|
||||
.txt {
|
||||
color: #95969D;
|
||||
font-size: 12px;
|
||||
font-family: Source Han Sans;
|
||||
}
|
||||
|
||||
&.warn {
|
||||
.num {
|
||||
margin-bottom: 4px;
|
||||
color: #E30000;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.txt {
|
||||
color: #E30000;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.future {
|
||||
min-height: 400rpx;
|
||||
.img {
|
||||
width: 100vw;
|
||||
height: 538rpx;
|
||||
}
|
||||
}
|
||||
.logout {
|
||||
width: 412rpx;
|
||||
margin: 60rpx auto;
|
||||
background: #356899;
|
||||
padding: 10px 20rpx;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
.title {
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.content-section {
|
||||
position: relative;
|
||||
top: -50px;
|
||||
|
||||
.mine-actions {
|
||||
margin: 15px 15px;
|
||||
padding: 20px 0px;
|
||||
border-radius: 8px;
|
||||
background-color: white;
|
||||
|
||||
.action-item {
|
||||
.icon {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.text {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
margin: 8px 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="example">
|
||||
<uni-forms ref="form" :model="user" labelWidth="80px">
|
||||
<uni-forms-item label="用户昵称" name="nickName">
|
||||
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="手机号码" name="phonenumber">
|
||||
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="邮箱" name="email">
|
||||
<uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="性别" name="sex" required>
|
||||
<uni-data-checkbox v-model="user.sex" :localdata="sexs" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<button type="primary" @click="submit">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserProfile } from "@/api/system/user"
|
||||
import { updateUserProfile } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
nickName: "",
|
||||
phonenumber: "",
|
||||
email: "",
|
||||
sex: ""
|
||||
},
|
||||
sexs: [{
|
||||
text: '男',
|
||||
value: "0"
|
||||
}, {
|
||||
text: '女',
|
||||
value: "1"
|
||||
}],
|
||||
rules: {
|
||||
nickName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '用户昵称不能为空'
|
||||
}]
|
||||
},
|
||||
phonenumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '手机号码不能为空'
|
||||
}, {
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
errorMessage: '请输入正确的手机号码'
|
||||
}]
|
||||
},
|
||||
email: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '邮箱地址不能为空'
|
||||
}, {
|
||||
format: 'email',
|
||||
errorMessage: '请输入正确的邮箱地址'
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getUser()
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.form.setRules(this.rules)
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data
|
||||
})
|
||||
},
|
||||
submit(ref) {
|
||||
this.$refs.form.validate().then(res => {
|
||||
updateUserProfile(this.user).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.example {
|
||||
padding: 15px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.segmented-control {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<uni-list>
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
|
||||
</uni-list>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserProfile } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {},
|
||||
roleGroup: "",
|
||||
postGroup: ""
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getUser()
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data
|
||||
this.roleGroup = response.roleGroup
|
||||
this.postGroup = response.postGroup
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<view class="pwd-retrieve-container">
|
||||
<uni-forms ref="form" :value="user" labelWidth="80px">
|
||||
<uni-forms-item name="oldPassword" label="旧密码">
|
||||
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="newPassword" label="新密码">
|
||||
<uni-easyinput type="password" v-model="user.newPassword" placeholder="请输入新密码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="confirmPassword" label="确认密码">
|
||||
<uni-easyinput type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
|
||||
</uni-forms-item>
|
||||
<button type="primary" @click="submit">提交</button>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateUserPwd } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
oldPassword: undefined,
|
||||
newPassword: undefined,
|
||||
confirmPassword: undefined
|
||||
},
|
||||
rules: {
|
||||
oldPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '旧密码不能为空'
|
||||
}]
|
||||
},
|
||||
newPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '新密码不能为空',
|
||||
},
|
||||
{
|
||||
minLength: 6,
|
||||
maxLength: 20,
|
||||
errorMessage: '长度在 6 到 20 个字符'
|
||||
}
|
||||
]
|
||||
},
|
||||
confirmPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '确认密码不能为空'
|
||||
}, {
|
||||
validateFunction: (rule, value, data) => data.newPassword === value,
|
||||
errorMessage: '两次输入的密码不一致'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.form.setRules(this.rules)
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.pwd-retrieve-container {
|
||||
padding-top: 36rpx;
|
||||
padding: 15px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<view class="setting-container" :style="{height: `${windowHeight}px`}">
|
||||
<view class="menu-list">
|
||||
<view class="list-cell list-cell-arrow" @click="handleToPwd">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-password menu-icon"></view>
|
||||
<view>修改密码</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleToUpgrade">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-refresh menu-icon"></view>
|
||||
<view>检查更新</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleCleanTmp">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-clean menu-icon"></view>
|
||||
<view>清理缓存</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item item-box">
|
||||
<view class="content text-center" @click="handleLogout">
|
||||
<text class="text-black">退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
windowHeight: uni.getSystemInfoSync().windowHeight
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleToPwd() {
|
||||
this.$tab.navigateTo('/pages/mine/pwd/index')
|
||||
},
|
||||
handleToUpgrade() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
},
|
||||
handleCleanTmp() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
},
|
||||
handleLogout() {
|
||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
this.$tab.reLaunch('/pages/index')
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
background-color: #FFFFFF;
|
||||
margin: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #303133;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="news-list">
|
||||
<view class="item" v-for="(item,index) in newsList" :key="item.id">
|
||||
<view class="msg">{{item.msg}}</view>
|
||||
<view class="time">{{item.time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
newsList: [{
|
||||
id: 1,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
msg: '您有新的工序质检,请及时处理',
|
||||
time: '2022-07-09 15:00:00'
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
backClick() {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
background: #f9f9f9;
|
||||
|
||||
.news-list {
|
||||
.item {
|
||||
margin: 10px 10px;
|
||||
border-radius: 4px;
|
||||
padding: 10px 10px 8px;
|
||||
background-color: #ffffff;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.15);
|
||||
|
||||
.msg {
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,39 @@
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
// 登录页面
|
||||
const loginPage = "/pages/login"
|
||||
|
||||
// 页面白名单
|
||||
const whiteList = [
|
||||
'/pages/login', '/pages/register', '/pages/common/webview/index'
|
||||
]
|
||||
|
||||
// 检查地址白名单
|
||||
function checkWhite(url) {
|
||||
const path = url.split('?')[0]
|
||||
return whiteList.indexOf(path) !== -1
|
||||
}
|
||||
|
||||
// 页面跳转验证拦截器
|
||||
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
|
||||
list.forEach(item => {
|
||||
uni.addInterceptor(item, {
|
||||
invoke(to) {
|
||||
// if (getToken()) {
|
||||
// if (to.url === loginPage) {
|
||||
// uni.reLaunch({ url: "/" })
|
||||
// }
|
||||
// return true
|
||||
// } else {
|
||||
// if (checkWhite(to.url)) {
|
||||
// return true
|
||||
// }
|
||||
// uni.reLaunch({ url: loginPage })
|
||||
// return false
|
||||
// }
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
})
|
@ -0,0 +1,60 @@
|
||||
import store from '@/store'
|
||||
|
||||
function authPermission(permission) {
|
||||
const all_permission = "*:*:*"
|
||||
const permissions = store.getters && store.getters.permissions
|
||||
if (permission && permission.length > 0) {
|
||||
return permissions.some(v => {
|
||||
return all_permission === v || v === permission
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function authRole(role) {
|
||||
const super_admin = "admin"
|
||||
const roles = store.getters && store.getters.roles
|
||||
if (role && role.length > 0) {
|
||||
return roles.some(v => {
|
||||
return super_admin === v || v === role
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
// 验证用户是否具备某权限
|
||||
hasPermi(permission) {
|
||||
return authPermission(permission)
|
||||
},
|
||||
// 验证用户是否含有指定权限,只需包含其中一个
|
||||
hasPermiOr(permissions) {
|
||||
return permissions.some(item => {
|
||||
return authPermission(item)
|
||||
})
|
||||
},
|
||||
// 验证用户是否含有指定权限,必须全部拥有
|
||||
hasPermiAnd(permissions) {
|
||||
return permissions.every(item => {
|
||||
return authPermission(item)
|
||||
})
|
||||
},
|
||||
// 验证用户是否具备某角色
|
||||
hasRole(role) {
|
||||
return authRole(role)
|
||||
},
|
||||
// 验证用户是否含有指定角色,只需包含其中一个
|
||||
hasRoleOr(roles) {
|
||||
return roles.some(item => {
|
||||
return authRole(item)
|
||||
})
|
||||
},
|
||||
// 验证用户是否含有指定角色,必须全部拥有
|
||||
hasRoleAnd(roles) {
|
||||
return roles.every(item => {
|
||||
return authRole(item)
|
||||
})
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import tab from './tab'
|
||||
import auth from './auth'
|
||||
import modal from './modal'
|
||||
|
||||
export default {
|
||||
install(Vue) {
|
||||
// 页签操作
|
||||
Vue.prototype.$tab = tab
|
||||
// 认证对象
|
||||
Vue.prototype.$auth = auth
|
||||
// 模态框对象
|
||||
Vue.prototype.$modal = modal
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
export default {
|
||||
// 消息提示
|
||||
msg(content) {
|
||||
uni.showToast({
|
||||
title: content,
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
// 错误消息
|
||||
msgError(content) {
|
||||
uni.showToast({
|
||||
title: content,
|
||||
icon: 'error'
|
||||
})
|
||||
},
|
||||
// 成功消息
|
||||
msgSuccess(content) {
|
||||
uni.showToast({
|
||||
title: content,
|
||||
icon: 'success'
|
||||
})
|
||||
},
|
||||
// 隐藏消息
|
||||
hideMsg(content) {
|
||||
uni.hideToast()
|
||||
},
|
||||
// 弹出提示
|
||||
alert(content, title) {
|
||||
uni.showModal({
|
||||
title: title || '系统提示',
|
||||
content: content,
|
||||
showCancel: false
|
||||
})
|
||||
},
|
||||
// 确认窗体
|
||||
confirm(content, title) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showModal({
|
||||
title: title || '系统提示',
|
||||
content: content,
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
resolve(res.confirm)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 提示信息
|
||||
showToast(option) {
|
||||
if (typeof option === "object") {
|
||||
uni.showToast(option)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: option,
|
||||
icon: "none",
|
||||
duration: 2500
|
||||
})
|
||||
}
|
||||
},
|
||||
// 打开遮罩层
|
||||
loading(content) {
|
||||
uni.showLoading({
|
||||
title: content,
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
// 关闭遮罩层
|
||||
closeLoading() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
{
|
||||
"appid": "wxa29fe397274614b5",
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.2.4",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"condition": false
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 4
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 2.6 KiB |
@ -0,0 +1,90 @@
|
||||
@font-face {
|
||||
font-family: "iconfont";
|
||||
src: url('@/static/font/iconfont.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
display: inline-block;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-user:before {
|
||||
content: "\e7ae";
|
||||
}
|
||||
|
||||
.icon-password:before {
|
||||
content: "\e8b2";
|
||||
}
|
||||
|
||||
.icon-code:before {
|
||||
content: "\e699";
|
||||
}
|
||||
|
||||
.icon-setting:before {
|
||||
content: "\e6cc";
|
||||
}
|
||||
|
||||
.icon-share:before {
|
||||
content: "\e739";
|
||||
}
|
||||
|
||||
.icon-edit:before {
|
||||
content: "\e60c";
|
||||
}
|
||||
|
||||
.icon-version:before {
|
||||
content: "\e63f";
|
||||
}
|
||||
|
||||
.icon-service:before {
|
||||
content: "\e6ff";
|
||||
}
|
||||
|
||||
.icon-friendfill:before {
|
||||
content: "\e726";
|
||||
}
|
||||
|
||||
.icon-community:before {
|
||||
content: "\e741";
|
||||
}
|
||||
|
||||
.icon-people:before {
|
||||
content: "\e736";
|
||||
}
|
||||
|
||||
.icon-dianzan:before {
|
||||
content: "\ec7f";
|
||||
}
|
||||
|
||||
.icon-right:before {
|
||||
content: "\e7eb";
|
||||
}
|
||||
|
||||
.icon-logout:before {
|
||||
content: "\e61d";
|
||||
}
|
||||
|
||||
.icon-help:before {
|
||||
content: "\e616";
|
||||
}
|
||||
|
||||
.icon-github:before {
|
||||
content: "\e628";
|
||||
}
|
||||
|
||||
.icon-aixin:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-clean:before {
|
||||
content: "\e607";
|
||||
}
|
||||
|
||||
.icon-refresh:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1014 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 441 B |
After Width: | Height: | Size: 456 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.9 KiB |
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<%= BASE_URL %>static/favicon.ico">
|
||||
<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>
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>本站点必须要开启JavaScript才能运行.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
</html>
|
@ -0,0 +1,90 @@
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.font-13 {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.font-12 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.font-11 {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.text-grey1 {
|
||||
color: #888;
|
||||
}
|
||||
.text-grey2 {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.list-cell-arrow::before {
|
||||
content: ' ';
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
border-width: 2px 2px 0 0;
|
||||
border-color: #c0c0c0;
|
||||
border-style: solid;
|
||||
-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
|
||||
transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
right: 30rpx;
|
||||
}
|
||||
|
||||
.list-cell {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
padding: 26rpx 30rpx;
|
||||
}
|
||||
|
||||
.list-cell:first-child {
|
||||
border-radius: 8rpx 8rpx 0 0;
|
||||
}
|
||||
|
||||
.list-cell:last-child {
|
||||
border-radius: 0 0 8rpx 8rpx;
|
||||
}
|
||||
|
||||
.list-cell::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
border-bottom: 1px solid #eaeef1;
|
||||
-webkit-transform: scaleY(0.5) translateZ(0);
|
||||
transform: scaleY(0.5) translateZ(0);
|
||||
transform-origin: 0 100%;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
.menu-list {
|
||||
margin: 15px 15px;
|
||||
|
||||
.menu-item-box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.menu-icon {
|
||||
color: #007AFF;
|
||||
font-size: 16px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
margin-left: auto;
|
||||
margin-right: 34rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
// global
|
||||
@import "./global.scss";
|
||||
// color-ui
|
||||
@import "@/static/scss/colorui.css";
|
||||
// iconfont
|
||||
@import "@/static/font/iconfont.css";
|
@ -0,0 +1,10 @@
|
||||
const getters = {
|
||||
token: state => state.user.token,
|
||||
statusMap: state => state.user.statusMap,
|
||||
// avatar: state => state.user.avatar,
|
||||
// name: state => state.user.name,
|
||||
// roles: state => state.user.roles,
|
||||
userInfo: state => state.user.userInfo,
|
||||
// permissions: state => state.user.permissions
|
||||
}
|
||||
export default getters
|
@ -0,0 +1,15 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import user from '@/store/modules/user'
|
||||
import getters from './getters'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const store = new Vuex.Store({
|
||||
modules: {
|
||||
user
|
||||
},
|
||||
getters
|
||||
})
|
||||
|
||||
export default store
|
@ -0,0 +1,167 @@
|
||||
import config from '@/config'
|
||||
import storage from '@/utils/storage'
|
||||
import constant from '@/utils/constant'
|
||||
import {
|
||||
login,
|
||||
logout,
|
||||
getInfo,
|
||||
getUserId
|
||||
} from '@/api/login'
|
||||
import {
|
||||
getToken,
|
||||
setToken,
|
||||
setUserId,
|
||||
removeToken,
|
||||
removeUserId
|
||||
} from '@/utils/auth'
|
||||
|
||||
const baseUrl = config.baseUrl
|
||||
|
||||
const user = {
|
||||
state: {
|
||||
token: getToken(),
|
||||
statusMap: {
|
||||
'RECEIVED': "已接单",
|
||||
'PROCESSING': "进行中",
|
||||
'FINISHED': "已完成"
|
||||
},
|
||||
// name: storage.get(constant.name),
|
||||
// avatar: storage.get(constant.avatar),
|
||||
// roles: storage.get(constant.roles),
|
||||
// permissions: storage.get(constant.permissions),
|
||||
userInfo: storage.get(constant.userInfo)
|
||||
},
|
||||
|
||||
mutations: {
|
||||
SET_TOKEN: (state, token) => {
|
||||
state.token = token
|
||||
},
|
||||
|
||||
|
||||
// SET_NAME: (state, name) => {
|
||||
// state.name = name
|
||||
// storage.set(constant.name, name)
|
||||
// },
|
||||
// SET_AVATAR: (state, avatar) => {
|
||||
// state.avatar = avatar
|
||||
// storage.set(constant.avatar, avatar)
|
||||
// },
|
||||
// SET_ROLES: (state, roles) => {
|
||||
// state.roles = roles
|
||||
// storage.set(constant.roles, roles)
|
||||
// },
|
||||
// SET_PERMISSIONS: (state, permissions) => {
|
||||
// state.permissions = permissions
|
||||
// storage.set(constant.permissions, permissions)
|
||||
// },
|
||||
SET_USER: (state, userInfo) => {
|
||||
state.userInfo = userInfo
|
||||
storage.set(constant.userInfo, userInfo)
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 登录
|
||||
GetUserId({
|
||||
commit
|
||||
}, userInfo) {
|
||||
const username = userInfo.username.trim()
|
||||
return new Promise((resolve, reject) => {
|
||||
getUserId(username).then(res => {
|
||||
const {
|
||||
code,
|
||||
data,
|
||||
msg
|
||||
} = res
|
||||
setUserId(data)
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
})
|
||||
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
Login({
|
||||
commit
|
||||
}, userInfo) {
|
||||
const username = userInfo.username.trim()
|
||||
const password = userInfo.password
|
||||
// const code = userInfo.code
|
||||
// const uuid = userInfo.uuid
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password).then(res => {
|
||||
const {
|
||||
code,
|
||||
data,
|
||||
msg
|
||||
} = res
|
||||
setToken(data.accessToken)
|
||||
commit('SET_TOKEN', data.accessToken)
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 获取用户信息
|
||||
GetInfo({
|
||||
commit,
|
||||
state
|
||||
}, userId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo(userId).then(res => {
|
||||
const user = res.data
|
||||
// const avatar = (user == null || user.avatar == "" || user.avatar == null) ?
|
||||
// require("@/static/images/profile.jpg") : baseUrl + user.avatar
|
||||
// const username = (user == null || user.username == "" || user.username ==
|
||||
// null) ? "" : user.username
|
||||
// if (res.roles && res.roles.length > 0) {
|
||||
// commit('SET_ROLES', res.roles)
|
||||
// commit('SET_PERMISSIONS', res.permissions)
|
||||
// } else {
|
||||
// commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
// }
|
||||
|
||||
// const newUser = {
|
||||
// ...user,
|
||||
// avatar,
|
||||
// username
|
||||
// }
|
||||
commit('SET_USER', user)
|
||||
// commit('SET_NAME', username)
|
||||
// commit('SET_AVATAR', avatar)
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 退出系统
|
||||
LogOut({
|
||||
commit,
|
||||
state
|
||||
}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(state.token).then(() => {
|
||||
commit('SET_TOKEN', '')
|
||||
commit('SET_USER', {})
|
||||
// commit('SET_ROLES', [])
|
||||
// commit('SET_PERMISSIONS', [])
|
||||
removeToken()
|
||||
removeUserId()
|
||||
storage.clean()
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default user
|
@ -0,0 +1,180 @@
|
||||
import {ConsoleData,RequestData,StorageData,AppDataClass,CurrentPagesClass} from './../data.js'
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
// #endif
|
||||
|
||||
|
||||
/* 拦截日志文件 */
|
||||
export class consoleInit {
|
||||
DATA = []
|
||||
NAME = 'Console'
|
||||
consoleNameArr = ['log', 'error', 'info', 'warn']
|
||||
componentsName='Console'
|
||||
app = {}
|
||||
constructor(arg) {
|
||||
this.DATA = new ConsoleData()
|
||||
this._init()
|
||||
}
|
||||
|
||||
_init() {
|
||||
const consoleNameArr = this.consoleNameArr
|
||||
this.consoleArrFunc = consoleNameArr.map(item => console[item])
|
||||
// global.$_log = this.consoleArrFunc[0]
|
||||
consoleNameArr.map((item,index) => {
|
||||
console[item] = this._record(item,this.consoleArrFunc[index])
|
||||
})
|
||||
this.app = this.$HFdebugging.options.app
|
||||
// #ifdef VUE3
|
||||
this._vue3Error(this.app)
|
||||
window&&(window.$_log = this.consoleArrFunc[0])
|
||||
// #endif
|
||||
// #ifndef VUE3
|
||||
this._vueError()
|
||||
global.$_log = this.consoleArrFunc[0]
|
||||
// #endif
|
||||
}
|
||||
_record(type,consoleFunc=()=>{}) {
|
||||
return (...args) => {
|
||||
this.addRecord(type,...args)
|
||||
consoleFunc&&consoleFunc(...args);
|
||||
}
|
||||
}
|
||||
addRecord(type,...args){
|
||||
let time = this._getDate()
|
||||
this.DATA.push({
|
||||
time,
|
||||
type,
|
||||
objects: [...args]
|
||||
})
|
||||
}
|
||||
|
||||
_getDate() {
|
||||
let d = new Date
|
||||
let a = d.toString()
|
||||
if(a.split(' ')[4]){
|
||||
return a.split(' ')[4] + '.' + d.getMilliseconds()
|
||||
}else{
|
||||
return a
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
_vueError() {
|
||||
let errorHandler
|
||||
let warnHandler
|
||||
if(typeof Vue.config.errorHandler == 'function'){
|
||||
errorHandler = Vue.config.errorHandler
|
||||
}
|
||||
Vue.config.errorHandler = (...err) => {
|
||||
errorHandler&&errorHandler(...err)
|
||||
this.addRecord('error',...err)
|
||||
throw err
|
||||
}
|
||||
if(typeof Vue.config.errorHandler == 'function'){
|
||||
errorHandler = Vue.config.errorHandler
|
||||
}
|
||||
Vue.config.warnHandler = (...err) => {
|
||||
warnHandler&&warnHandler(...err)
|
||||
this.addRecord('warn',...err)
|
||||
}
|
||||
}
|
||||
_vue3Error(app){
|
||||
let errorHandler
|
||||
let warnHandler
|
||||
if(typeof app.config.errorHandler == 'function'){
|
||||
errorHandler = app.config.errorHandler
|
||||
}
|
||||
app.config.errorHandler = (...err) => {
|
||||
errorHandler&&errorHandler(...err)
|
||||
this.addRecord('error',...err)
|
||||
throw err
|
||||
}
|
||||
if(typeof app.config.errorHandler == 'function'){
|
||||
errorHandler = app.config.errorHandler
|
||||
}
|
||||
app.config.warnHandler = (...err) => {
|
||||
warnHandler&&warnHandler(...err)
|
||||
this.addRecord('warn',...err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 拦截请求 */
|
||||
export class InterceptorRequest {
|
||||
NAME='Request'
|
||||
DATA = []
|
||||
componentsName='InterceptorRequest'
|
||||
constructor(arg) {
|
||||
this.DATA = new RequestData()
|
||||
this.init()
|
||||
}
|
||||
init() {
|
||||
let that = this
|
||||
wx.request = uni.request
|
||||
uni.addInterceptor('request', {
|
||||
invoke(args) {
|
||||
// request 触发前拼接 url
|
||||
const addInterceptorRequestData = {
|
||||
Headers: {...args}
|
||||
}
|
||||
let _complete = args.complete;
|
||||
args.complete = function (e) {
|
||||
_complete && _complete(e)
|
||||
addInterceptorRequestData.Preview = {...e}
|
||||
that.DATA.push(addInterceptorRequestData)
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
addRequestData(addInterceptorRequestData={}){
|
||||
this.DATA.push(addInterceptorRequestData)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* 存储信息 */
|
||||
export class StorageInit {
|
||||
DATA = []
|
||||
NAME = 'Storage'
|
||||
componentsName='StorageInit'
|
||||
constructor(){
|
||||
this.DATA = new StorageData()
|
||||
this._init()
|
||||
}
|
||||
|
||||
_init() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* AppData */
|
||||
export class AppDataInit{
|
||||
DATA = []
|
||||
NAME = 'AppData'
|
||||
componentsName='AppData'
|
||||
constructor(){
|
||||
this.DATA = new AppDataClass()
|
||||
this._init()
|
||||
}
|
||||
|
||||
_init() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* AppData */
|
||||
export class CurrentPagesInit{
|
||||
DATA = []
|
||||
NAME = 'CurrentPages'
|
||||
componentsName='CurrentPages'
|
||||
constructor(){
|
||||
this.DATA = new CurrentPagesClass()
|
||||
this._init()
|
||||
}
|
||||
|
||||
_init() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,219 @@
|
||||
// #ifdef VUE3
|
||||
import { ref,reactive,computed } from 'vue'
|
||||
// #endif
|
||||
export class ConsoleData {
|
||||
DATA = []
|
||||
FILTRATE = {}
|
||||
constructor(arg) {
|
||||
this._isConsoleData = true
|
||||
this.init()
|
||||
}
|
||||
|
||||
init() {
|
||||
this.DATA = [{
|
||||
type: 'log',
|
||||
objects: ["欢迎使用HF调试器~~~"]
|
||||
}]
|
||||
// #ifdef VUE3
|
||||
this.DATA_REF = ref(this.DATA)
|
||||
this.DATA = computed(()=>this.DATA_REF.value).value
|
||||
this.FILTRATE_REF = ref(this.FILTRATE)
|
||||
this.FILTRATE = computed(()=>this.FILTRATE_REF.value).value
|
||||
// #endif
|
||||
}
|
||||
|
||||
push(args) {
|
||||
if (this.DATA.length > 512) {
|
||||
this.DATA.shift()
|
||||
}
|
||||
this.DATA.push(args)
|
||||
this.initFiltrate(args)
|
||||
|
||||
}
|
||||
|
||||
initFiltrate(args){
|
||||
if(!this.FILTRATE[args.type]){
|
||||
this.FILTRATE[args.type] = []
|
||||
}
|
||||
if (this.FILTRATE[args.type].length > 256) {
|
||||
this.FILTRATE[args.type].shift()
|
||||
}
|
||||
this.FILTRATE[args.type].push(args)
|
||||
}
|
||||
|
||||
filtrate(type){
|
||||
if(!type)return this.DATA
|
||||
return this.FILTRATE[type]||[]
|
||||
}
|
||||
|
||||
eliminateAll(){
|
||||
this.init()
|
||||
this.FILTRATE={}
|
||||
}
|
||||
remove(type){
|
||||
if(this.FILTRATE[type]){
|
||||
this.FILTRATE[type] = []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class RequestData {
|
||||
DATA = []
|
||||
constructor(arg) {
|
||||
this._requestData = true
|
||||
this.init()
|
||||
}
|
||||
init() {
|
||||
this.DATA = []
|
||||
// #ifdef VUE3
|
||||
this.DATA_REF = ref([])
|
||||
this.DATA = computed(()=>this.DATA_REF.value).value
|
||||
// #endif
|
||||
}
|
||||
push(args) {
|
||||
|
||||
if (this.DATA.length > 512) {
|
||||
this.DATA.shift()
|
||||
}
|
||||
this.DATA.push(args)
|
||||
}
|
||||
eliminateAll(){
|
||||
this.DATA = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class StorageData {
|
||||
DATAC = []
|
||||
|
||||
constructor(arg) {
|
||||
this._storageData = true
|
||||
this.init()
|
||||
}
|
||||
|
||||
init() {
|
||||
this.DATAC = []
|
||||
// #ifdef VUE3
|
||||
this.DATA_REF = ref(this.DATAC)
|
||||
this.DATAC = computed(()=>this.DATA_REF.value).value
|
||||
// #endif
|
||||
}
|
||||
|
||||
push(args) {
|
||||
if (this.DATAC.length > 512) {
|
||||
this.DATAC.shift()
|
||||
}
|
||||
this.DATAC.push(args)
|
||||
}
|
||||
|
||||
eliminateAll(){
|
||||
uni.clearStorageSync();
|
||||
this.DATAC = [];
|
||||
}
|
||||
|
||||
remove(key,index){
|
||||
uni.removeStorageSync(key)
|
||||
this.DATAC.splice(index,1)
|
||||
}
|
||||
|
||||
edit(storageItem,storageIndex){
|
||||
this.DATAC[storageIndex] = storageItem
|
||||
uni.setStorageSync(storageItem.key,storageItem.obj)
|
||||
}
|
||||
|
||||
get DATA() {
|
||||
/* 获取storage */
|
||||
let storageAllData = []
|
||||
let that = this
|
||||
uni.getStorageInfo({
|
||||
success(res) {
|
||||
res.keys.forEach(item => {
|
||||
// storageAllData[item] = JSON.stringify(uni.getStorageSync(item))
|
||||
storageAllData.push({
|
||||
key: item,
|
||||
obj: uni.getStorageSync(item)
|
||||
})
|
||||
})
|
||||
that.DATAC = storageAllData
|
||||
}
|
||||
})
|
||||
return this.DATAC
|
||||
}
|
||||
|
||||
// 设置时更改 全局storageAllData
|
||||
/* set DATA(){
|
||||
|
||||
return this.DATA
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
|
||||
export class AppDataClass {
|
||||
DATAC = []
|
||||
constructor(arg) {
|
||||
this._appDataClass = true
|
||||
this.init()
|
||||
}
|
||||
init() {
|
||||
this.DATAC = []
|
||||
// #ifdef VUE3
|
||||
this.DATA_REF = ref(this.DATAC)
|
||||
this.DATAC = computed(()=>this.DATA_REF.value).value
|
||||
// #endif
|
||||
}
|
||||
push(args) {
|
||||
if (this.DATAC.length > 512) {
|
||||
this.DATAC.shift()
|
||||
}
|
||||
this.DATAC.push(args)
|
||||
}
|
||||
get DATA() {
|
||||
/* 获取 */
|
||||
let arr = [...getCurrentPages()].reverse()
|
||||
// #ifndef VUE3
|
||||
this.DATAC = arr.map(item=>item.$vm._data)
|
||||
// #endif
|
||||
// #ifdef VUE3
|
||||
this.DATAC = arr.map(item=>item.$vm.$data)
|
||||
// #endif
|
||||
return this.DATAC
|
||||
}
|
||||
}
|
||||
|
||||
export class CurrentPagesClass {
|
||||
DATAC = []
|
||||
constructor(arg) {
|
||||
this._appDataClass = true
|
||||
this.init()
|
||||
}
|
||||
init() {
|
||||
this.DATAC = []
|
||||
// #ifdef VUE3
|
||||
this.DATA_REF = ref(this.DATAC)
|
||||
this.DATAC = computed(()=>this.DATA_REF.value).value
|
||||
// #endif
|
||||
}
|
||||
push(args) {
|
||||
if (this.DATAC.length > 512) {
|
||||
this.DATAC.shift()
|
||||
}
|
||||
this.DATAC.push(args)
|
||||
}
|
||||
get DATA() {
|
||||
/* 获取 */
|
||||
var CurrentPages = getCurrentPages()
|
||||
// #ifdef APP
|
||||
let keyArr = ['_data','data','$refs','route','options']
|
||||
CurrentPages = [...CurrentPages].map(item=>{
|
||||
let a = {...item}
|
||||
// a.$vm = JSON.parse(JSON.stringify(item.$vm,['$vm']))
|
||||
a.$vm = "[Object,$vm]"
|
||||
return a
|
||||
})
|
||||
// #endif
|
||||
this.DATAC =[...CurrentPages].reverse()
|
||||
return this.DATAC
|
||||
}
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
import {consoleInit,InterceptorRequest,StorageInit,AppDataInit,CurrentPagesInit} from './PlugIn/index.js'
|
||||
// #ifdef H5
|
||||
import BntBoxConfirm from './../components/BntBox/index.js'
|
||||
// #endif
|
||||
import {information,HFDebuggingInformation } from './store.js'
|
||||
const wx_request = wx.request
|
||||
// consoleInit,AppDataInit,CurrentPagesInit,InterceptorRequest,StorageInit
|
||||
let informationArr = [consoleInit,AppDataInit,CurrentPagesInit,InterceptorRequest,StorageInit]
|
||||
export class HFdebugging {
|
||||
wx_request = wx_request
|
||||
view = null
|
||||
|
||||
/* 挂载的插件数据 */
|
||||
information = []
|
||||
|
||||
/* 设置内容 */
|
||||
settingData = {
|
||||
invert:{
|
||||
name:'深浅色',
|
||||
type:'switch',
|
||||
value:false,
|
||||
}
|
||||
}
|
||||
// 选项
|
||||
options={}
|
||||
|
||||
constructor(options={}) {
|
||||
this.options = options
|
||||
// #ifdef App
|
||||
uni.onThemeChange((res)=>{
|
||||
this.settingData.invert.value=(res.theme!='dark');
|
||||
});
|
||||
// #endif
|
||||
this._init()
|
||||
this._eventInit()
|
||||
HFDebuggingInformation.push(this)
|
||||
}
|
||||
|
||||
|
||||
_init() {
|
||||
if(this.options.plugIn&& this.options.plugIn.isArray()){
|
||||
informationArr.map(item=>{
|
||||
this.loadPlugIn(item)
|
||||
})
|
||||
}else{
|
||||
informationArr.map(item=>{
|
||||
this.loadPlugIn(item)
|
||||
})
|
||||
}
|
||||
this.information = information
|
||||
// #ifdef H5
|
||||
BntBoxConfirm()
|
||||
// #endif
|
||||
|
||||
// #ifdef APP
|
||||
this.view = createView();
|
||||
this.show();
|
||||
// #endif
|
||||
|
||||
}
|
||||
|
||||
_eventInit(){
|
||||
uni.$on("HFshow", () => {
|
||||
const pages = getCurrentPages()
|
||||
if (pages[pages.length - 1].route == 'uni_modules/HF-HF_debugging/pages/next/next') {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/uni_modules/HF-HF_debugging/pages/next/next",
|
||||
animationType: "slide-in-bottom"
|
||||
})
|
||||
this.view?.hide()
|
||||
}
|
||||
|
||||
})
|
||||
uni.$on("viewShow", () => {
|
||||
this.show()
|
||||
})
|
||||
uni.$on("viewHide", () => {
|
||||
this.hide()
|
||||
})
|
||||
}
|
||||
|
||||
show(){
|
||||
this.view?.show()
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.view?.hide()
|
||||
}
|
||||
|
||||
// 挂在插件
|
||||
loadPlugIn(PlugIn) {
|
||||
PlugIn.prototype.$HFdebugging = this
|
||||
information.push(new PlugIn())
|
||||
}
|
||||
|
||||
// 筛选插件实例
|
||||
getPlugIn(plugInName=''){
|
||||
return this.information.filter(item=>item.NAME==plugInName)[0]
|
||||
}
|
||||
|
||||
// 删除实例
|
||||
removePlugIn(plugInName=''){
|
||||
let index = this.information.findIndex(item=>item.NAME==plugInName)
|
||||
if(index>-1){
|
||||
this.information.splice(index,1)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function createView() {
|
||||
let page = {},
|
||||
onType = false
|
||||
const view = new plus.nativeObj.View('HF', {
|
||||
bottom: '100px',
|
||||
left: '60%',
|
||||
height: '40px',
|
||||
width: '100px',
|
||||
zIndex: '999'
|
||||
});
|
||||
view.drawRect({
|
||||
color: '#FF4A46',
|
||||
radius: '5px'
|
||||
}, {
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
});
|
||||
view.drawText('HF调试器', {
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}, {
|
||||
size: '16px',
|
||||
color: '#FFFFFF'
|
||||
});
|
||||
view.addEventListener("touchstart", (touch) => {
|
||||
page = touch
|
||||
})
|
||||
view.addEventListener("touchmove", (touch) => {
|
||||
if ((touch.pageY - 20 > 0 && touch.pageX - 50 > 0) &&
|
||||
(Math.abs(touch.pageX - page.pageX) > 20 ||
|
||||
Math.abs(touch.pageY - page.pageY) > 20)) {
|
||||
view.setStyle({
|
||||
top: (touch.pageY - 20) + 'px',
|
||||
left: (touch.pageX - 50) + 'px'
|
||||
})
|
||||
onType = true
|
||||
} else {
|
||||
onType = false
|
||||
}
|
||||
})
|
||||
view.addEventListener("click", (e) => {
|
||||
!onType && uni.$emit("HFshow")
|
||||
})
|
||||
return view
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
export const information = []
|
||||
export const HFDebuggingInformation = []
|
@ -0,0 +1,41 @@
|
||||
export function isFunction(value) {
|
||||
return Object.prototype.toString.call(value) == '[object Function]';
|
||||
}
|
||||
export function isNumber(value) {
|
||||
return Object.prototype.toString.call(value) == '[object Number]';
|
||||
}
|
||||
export function isString(value) {
|
||||
return Object.prototype.toString.call(value) == '[object String]';
|
||||
}
|
||||
export function isArray(value) {
|
||||
return Object.prototype.toString.call(value) == '[object Array]';
|
||||
}
|
||||
export function isBoolean(value) {
|
||||
return Object.prototype.toString.call(value) == '[object Boolean]';
|
||||
}
|
||||
export function isUndefined(value) {
|
||||
return value === undefined;
|
||||
}
|
||||
export function isNull(value) {
|
||||
return value === null;
|
||||
}
|
||||
export function isSymbol(value) {
|
||||
return Object.prototype.toString.call(value) == '[object Symbol]';
|
||||
}
|
||||
export function isObject(value) {
|
||||
return (
|
||||
Object.prototype.toString.call(value) == '[object Object]'
|
||||
||
|
||||
// if it isn't a primitive value, then it is a common object
|
||||
(
|
||||
!isNumber(value) &&
|
||||
!isString(value) &&
|
||||
!isBoolean(value) &&
|
||||
!isArray(value) &&
|
||||
!isNull(value) &&
|
||||
!isFunction(value) &&
|
||||
!isUndefined(value) &&
|
||||
!isSymbol(value)
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
|
||||
import BntBox from './index.vue'
|
||||
let defaultOptions = {
|
||||
show:true
|
||||
};
|
||||
let body = document.body,
|
||||
bindPhone = document.createElement('div')
|
||||
bindPhone.setAttribute('id', 'HFBntBox-id')
|
||||
body.appendChild(bindPhone)
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
const VueComponent = Vue.extend(BntBox);
|
||||
const BntBoxConfirm = function (options={}) {
|
||||
const vm = new VueComponent().$mount('#HFBntBox-id');
|
||||
Object.assign(vm,defaultOptions , options);
|
||||
document.body.appendChild(vm.$el);
|
||||
return
|
||||
};
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createApp,h } from 'vue'
|
||||
const VueComponent = createApp({
|
||||
render: () => {
|
||||
return h(BntBox)
|
||||
}})
|
||||
const BntBoxConfirm = function (options={}) {
|
||||
|
||||
const vm = VueComponent.mount('#HFBntBox-id');
|
||||
console.log("vm",vm)
|
||||
// Object.assign(vm,defaultOptions , options);
|
||||
document.body.appendChild(vm.$el);
|
||||
return
|
||||
};
|
||||
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
|
||||
export default BntBoxConfirm;
|
@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<view ref="HF" id="HF" class="" @click="onclick" @touchstart="ontouchstart" @touchmove="ontouchmove"
|
||||
:style="{top:startY,left:startX}">
|
||||
HF调试器
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let onType = true
|
||||
export default {
|
||||
name: 'BntBox',
|
||||
data() {
|
||||
return {
|
||||
startY: '90%',
|
||||
startX: '60%',
|
||||
start: {},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
onclick(e) {
|
||||
uni.$emit("HFshow")
|
||||
},
|
||||
ontouchmove(touch) {
|
||||
touch = touch.touches[0]
|
||||
let page = this.start
|
||||
if ((touch.pageY - 20 > 0 && touch.pageX - 50 > 0) &&
|
||||
(Math.abs(touch.pageX - page.pageX) > 20 ||
|
||||
Math.abs(touch.pageY - page.pageY) > 20)) {
|
||||
this.startY = (touch.pageY + uni.upx2px(60) / 2) + 'px'
|
||||
this.startX = (touch.pageX - uni.upx2px(180) / 2) + 'px'
|
||||
onType = true
|
||||
} else {
|
||||
onType = false
|
||||
}
|
||||
},
|
||||
ontouchstart(e) {
|
||||
this.start = e.touches[0]
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#HF {
|
||||
text-align: center;
|
||||
position: fixed;
|
||||
border-radius: 10rpx;
|
||||
background: #FF4A46;
|
||||
color: #FFFFFF;
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
z-index: 999;
|
||||
left: 60%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<view >
|
||||
<view :class="item.type" class="content" v-for="(item,index) in exDataFiltrate(type)" :key="index">
|
||||
<text class="time">{{item.time}}</text>
|
||||
<text class="text-type" >{{item.type}}</text>
|
||||
<objTree :isShowKey="false" :objects="analysis(item.objects)" :isAt="true"></objTree>
|
||||
</view>
|
||||
<view class="" style="height: 200rpx;"></view>
|
||||
<view class="content-bottom-view">
|
||||
<scroll-view scroll-x="true" class="content-bottom">
|
||||
<text :class="{hit:type==''}" @click="type=''">All</text>
|
||||
<text :class="{hit:type==item}" @click="type=item" v-for="(item,index) in livingExample.consoleNameArr" :key="index" >{{item}}</text>
|
||||
<text @click="eliminateAll">eliminateAll</text>
|
||||
<text @click="remove">remove</text>
|
||||
</scroll-view>
|
||||
<view class="textarea-view">
|
||||
<textarea v-model="evalJsCode" placeholder="请入指令(实验性的)" @confirm="confirm" />
|
||||
<text @click="confirm" style="color: #FFFFFF;">{{'执行 \n 🛠'}} </text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import objTree from './objTree.vue'
|
||||
import * as tool from './../common/tool.js'
|
||||
export default {
|
||||
name: 'Console',
|
||||
components: {
|
||||
objTree
|
||||
},
|
||||
props: {
|
||||
livingExample: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type:'',
|
||||
evalJsCode:''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
exData() {
|
||||
return this.livingExample.DATA.DATA
|
||||
},
|
||||
exDataFiltrate() {
|
||||
return (type)=>this.livingExample.DATA.filtrate(type)
|
||||
},
|
||||
analysis(){
|
||||
return (item)=>this.solveLogItem(item)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$emit("setScrollToLower")
|
||||
},
|
||||
methods:{
|
||||
scrolltolower(e){
|
||||
// console.log("e",e)
|
||||
},
|
||||
solveLogItem(k) {
|
||||
// #ifndef VUE3
|
||||
if(typeof k === 'object' && !k.toString().includes(' at ') )return k
|
||||
// #endif
|
||||
// #ifdef VUE3
|
||||
if(typeof k === 'object')return k
|
||||
// #endif
|
||||
|
||||
if(!k)return '';
|
||||
const solve = (str) => {
|
||||
const finalArr = [];
|
||||
let next_speical = '';
|
||||
const str_arr = str.split('---');
|
||||
for(let i = 0; i < str_arr.length; i++) {
|
||||
const str_item = str_arr[i];
|
||||
if(str_item == 'UNDEFINED') {
|
||||
finalArr.push(undefined);
|
||||
} else if(str_item.indexOf('BEGIN:') == 0) {
|
||||
next_speical = str_item.substr(6);
|
||||
} else if(str_item.indexOf('END:') == 0) {
|
||||
if(next_speical == str_item.substr(4)) {
|
||||
next_speical = '';
|
||||
}
|
||||
} else {
|
||||
switch(next_speical) {
|
||||
case 'BOOLEAN':
|
||||
finalArr.push(new Boolean(str_item) ? true : false);
|
||||
break;
|
||||
case 'NUMBER':
|
||||
finalArr.push(parseFloat(str_item));
|
||||
break;
|
||||
case 'JSON':
|
||||
finalArr.push(JSON.parse(str_item));
|
||||
break;
|
||||
default:
|
||||
str_item&&finalArr.push(str_item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return finalArr
|
||||
};
|
||||
const atArr = (k[0]+'').split(' at ');
|
||||
const obj_arr = atArr[0].split('---COMMA---');
|
||||
const kArr = []
|
||||
if(obj_arr.length > 1) {
|
||||
for (let i = 0; i < obj_arr.length; i++){
|
||||
kArr.push(...solve(obj_arr[i]))
|
||||
}
|
||||
}else {
|
||||
kArr.push(...solve(obj_arr[0]));
|
||||
}
|
||||
kArr.push(' at '+atArr[1])
|
||||
return kArr;
|
||||
},
|
||||
eliminateAll(){
|
||||
this.livingExample.DATA.eliminateAll()
|
||||
},
|
||||
remove(){
|
||||
this.livingExample.DATA.remove(this.type)
|
||||
},
|
||||
confirm() {
|
||||
this.livingExample.addRecord('eval',(this.evalJsCode || 'undefined'))
|
||||
let result = ''
|
||||
let $content = ''
|
||||
try {
|
||||
result = eval.call(global, '(' + this.evalJsCode + ')');
|
||||
} catch (e) {
|
||||
try {
|
||||
result = eval.call(global, this.evalJsCode);
|
||||
} catch (e) {
|
||||
this.livingExample.addRecord('error','eval-error:',e)
|
||||
}
|
||||
}
|
||||
if (tool.isArray(result) || tool.isObject(result)) {
|
||||
result = getApp()!=result?result:' isObject - getApp'
|
||||
} else {
|
||||
if (tool.isNull(result)) {
|
||||
result = 'null';
|
||||
} else if (tool.isUndefined(result)) {
|
||||
result = 'undefined';
|
||||
} else if (tool.isFunction(result)) {
|
||||
result = 'function()'
|
||||
} else if (tool.isString(result)) {
|
||||
result = '"' + result + '"';
|
||||
}
|
||||
}
|
||||
this.livingExample.addRecord('eval',(result || 'undefined'))
|
||||
this.evalJsCode = ""
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
box-shadow: 0rpx 0rpx 1rpx #C0C0C0;
|
||||
padding: 4rpx 0;
|
||||
.time{
|
||||
padding: 0 8rpx;
|
||||
}
|
||||
}
|
||||
.log{
|
||||
// color: ;
|
||||
}
|
||||
.error{
|
||||
color: #d50000;
|
||||
background: rgba($color: #7c3615, $alpha: .3);
|
||||
box-shadow: 0 0 1rpx #d50000;
|
||||
}
|
||||
.warn{
|
||||
color: #f8b251;
|
||||
background: rgba($color: #c3a356, $alpha: .2);
|
||||
box-shadow: 0 0 1rpx #f8b251;
|
||||
}
|
||||
.info{
|
||||
color: #5099f8;
|
||||
background: rgba($color: #5099f8, $alpha: .2);
|
||||
box-shadow: 0 0 1rpx #2500f8;
|
||||
}
|
||||
.eval{
|
||||
color: #aaaaff;
|
||||
background: rgba($color: #aaaaff, $alpha: .2);
|
||||
box-shadow: 0 0 1rpx #7979b5;
|
||||
}
|
||||
.text-type{
|
||||
padding:0 6rpx;
|
||||
/* border: 1rpx solid #3F536E;
|
||||
border-radius: 8rpx;
|
||||
background: #aaff7f; */
|
||||
}
|
||||
.content-bottom-view{
|
||||
position: fixed;
|
||||
z-index: 99;
|
||||
bottom: 0rpx;
|
||||
left: 0;
|
||||
background: #FFFFFF;
|
||||
.content-bottom{
|
||||
width: 100vw;
|
||||
height: 70rpx;
|
||||
text{
|
||||
padding: 4rpx 8rpx;
|
||||
border: 1rpx solid #999999;
|
||||
}
|
||||
}
|
||||
.textarea-view{
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
text{
|
||||
width: 100rpx;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
background: #FF4A46;
|
||||
}
|
||||
}
|
||||
textarea{
|
||||
width: calc(100vw - 100rpx);
|
||||
max-height: 100rpx;
|
||||
// background: #007AFF;
|
||||
}
|
||||
.hit{
|
||||
background: #C8C7CC;
|
||||
}
|
||||
|
||||
}
|
||||
.flex{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 背景 -->
|
||||
<view class="mark" @click="onClickMack"></view>
|
||||
<!-- 主体 -->
|
||||
<view class="main" @click="setting=false" :class="{invert:settingData.invert.value}">
|
||||
<!-- 标题 -->
|
||||
<scroll-view class="headline-scroll-view" scroll-x="true">
|
||||
<text :class="{hit:plugInId==index}" class="headline" @click="plugInId=index,setPlugInId(index)" v-for="(item,index) in plugInName" :key="index">{{item}}</text>
|
||||
<text style="padding-right: 40rpx;"></text>
|
||||
<text @click.stop="setting=!setting" class="setting">🔧</text>
|
||||
</scroll-view>
|
||||
<!-- 组件模板-->
|
||||
<scroll-view :scroll-into-view="scrollToLowerId" :scroll-top="scrollTop" class="plug-in-scroll-view" scroll-y="true" @scrolltolower="scrolltolower" @scrolltoupper="scrolltoupper">
|
||||
<component ref="informationComponents" :is="information[plugInId].componentsName" :livingExample="information[plugInId]"
|
||||
@setScrollTop="setScrollTop" @setScrollToLower="setScrollToLower" ></component>
|
||||
<text id="scroll-bot"></text>
|
||||
</scroll-view>
|
||||
<setting v-if="setting"></setting>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
HFDebuggingInformation,information
|
||||
} from './../common/store.js'
|
||||
|
||||
import Console from './../components/Console.vue'
|
||||
import StorageInit from './../components/StorageInit.vue'
|
||||
import InterceptorRequest from './../components/InterceptorRequest.vue'
|
||||
import setting from './../components/setting.vue'
|
||||
import AppData from './../components/AppData.vue'
|
||||
import CurrentPages from './../components/CurrentPages.vue'
|
||||
|
||||
export default {
|
||||
name:'HFBox',
|
||||
components: {
|
||||
InterceptorRequest,
|
||||
StorageInit,
|
||||
Console,
|
||||
setting,
|
||||
AppData,
|
||||
CurrentPages
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
setting:false,
|
||||
plugInId:uni.getStorageSync("plugInId")||0,
|
||||
information,
|
||||
plugInName: [],
|
||||
componentsName: '',
|
||||
scrollTop:'100%',
|
||||
scrollToLowerId:'',
|
||||
settingData:HFDebuggingInformation[0].settingData
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.plugInName = information.map((item,index) => {
|
||||
return item.NAME
|
||||
})
|
||||
},
|
||||
methods:{
|
||||
scrolltolower(e){
|
||||
if(this.$refs?.informationComponents?.scrolltolower){
|
||||
this.$refs?.informationComponents?.scrolltolower(e)
|
||||
}
|
||||
},
|
||||
scrolltoupper(e){
|
||||
if(this.$refs?.informationComponents?.scrolltoupper){
|
||||
this.$refs?.informationComponents?.scrolltoupper(e)
|
||||
}
|
||||
},
|
||||
onClickMack(){
|
||||
uni.$emit("viewShow")
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
setScrollTop(e){
|
||||
this.scrollTop = e
|
||||
},
|
||||
setScrollToLower(){
|
||||
this.scrollToLowerId = ''
|
||||
this.$nextTick(()=>{
|
||||
this.scrollToLowerId = 'scroll-bot'
|
||||
})
|
||||
},
|
||||
setPlugInId(index){
|
||||
uni.setStorageSync("plugInId",index)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* *{
|
||||
font-size: 24rpx;
|
||||
} */
|
||||
.invert{
|
||||
filter: invert(100%);
|
||||
}
|
||||
.mark {
|
||||
position: fixed;
|
||||
z-index: 998;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
.main {
|
||||
padding:20rpx 0rpx;
|
||||
font-size: 24rpx;
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 80vh;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
.headline-scroll-view{
|
||||
// position: relative;
|
||||
width: 100vw;
|
||||
height: 44rpx;
|
||||
}
|
||||
.headline{
|
||||
padding: 6rpx;
|
||||
border: solid 1rpx #999999;
|
||||
}
|
||||
.hit{
|
||||
background: #b1b1b1;
|
||||
}
|
||||
.plug-in-scroll-view{
|
||||
width: 100vw;
|
||||
height: calc(80vh - 50rpx);
|
||||
}
|
||||
.setting{
|
||||
padding: 0 4rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
border: 1rpx solid #999999;
|
||||
}
|
||||
#scroll-bot{
|
||||
width: 100vw;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<view>
|
||||
<text class="del-text" @click="onDel">🚫</text>
|
||||
<text>🚫</text>
|
||||
<view class="headline">
|
||||
<text class="method-text">Method</text>
|
||||
<text class="url-text">Url</text>
|
||||
<text class="status-text">Status</text>
|
||||
<text class="status-text">选项</text>
|
||||
</view>
|
||||
<view :class="{error:item.Preview.statusCode>200&&item.Preview.statusCode<500||!item.Preview.statusCode,warn:item.Preview.statusCode>500 }" class="content"
|
||||
v-for="(item,index) in exData" :key="index">
|
||||
<view @click="openIndex == index?openIndex=-1:openIndex=index" class="headline">
|
||||
<text class="method-text">{{item.Headers.method}}</text>
|
||||
<text class="url-text">{{item.Headers.url}}</text>
|
||||
<text class="status-text">{{item.Preview.statusCode||(0+'\n[推测CORS]')}}</text>
|
||||
<text @click.stop="showUp(item,index)" class="status-text">重发🆙</text>
|
||||
</view>
|
||||
<view v-if="openIndex == index" class="details-view">
|
||||
<block>
|
||||
<view @click="nthChild=0" class="">
|
||||
<text class="fw600 link">Headers</text>
|
||||
</view>
|
||||
<view v-if="nthChild==0" class="details-top">
|
||||
<view v-for="(ite,indx) of item.Headers" :key="indx" class="details">
|
||||
<text>{{indx}}</text>
|
||||
<text v-if="indx=='data'">{{JSON.stringify(ite,null,2)}}</text>
|
||||
<text v-else>{{ite}}</text>
|
||||
<text @click="copy(ite)">{{'📋'}}</text>
|
||||
</view>
|
||||
<!-- <view class="details">
|
||||
<text>data-json-stringify</text>
|
||||
<view class="body-json">
|
||||
<objTree :objects="{body:item.Headers.data}"></objTree>
|
||||
</view>
|
||||
<text @click="copy(item.Headers.data)">{{'📋'}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</block>
|
||||
<block>
|
||||
<view @click="nthChild=1" class="">
|
||||
<text class="fw600 link">Preview</text>
|
||||
</view>
|
||||
<view v-if="nthChild==1" class="details-top">
|
||||
<view v-for="(ite,indx) of item.Preview" :key="indx" class="details">
|
||||
<text>{{indx}}</text>
|
||||
<text>{{ite}}</text>
|
||||
<text @click="copy(ite)">{{'📋'}}</text>
|
||||
</view>
|
||||
<view v-if="item.Preview.statusCode>=200&&item.Preview.statusCode<400" class="details">
|
||||
<text>body-json</text>
|
||||
<view class="body-json">
|
||||
<objTree :isShowKey="false" :objects="{body:item.Preview.data}"></objTree>
|
||||
</view>
|
||||
<text @click="copy(item.Preview.data)">{{'📋'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="item.Preview.statusCode>=500||(item.Preview.data+'').includes('<!DOCTYPE HTML PUBLIC')">
|
||||
<view @click="nthChild=2" class="">
|
||||
<text class="fw600 link">ServerHtml</text>
|
||||
</view>
|
||||
<view v-if="nthChild==2" class="details-top">
|
||||
<rich-text v-html="item.Preview.data" :nodes="item.Preview.data"></rich-text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import objTree from './objTree.vue'
|
||||
export default {
|
||||
name:"InterceptorRequest",
|
||||
components:{
|
||||
objTree
|
||||
},
|
||||
props:{
|
||||
livingExample:{
|
||||
type:Object,
|
||||
default:()=>{
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
exData() {
|
||||
return this.livingExample.DATA.DATA
|
||||
},
|
||||
exDataLength() {
|
||||
return this.livingExample.DATA.DATA.length
|
||||
},
|
||||
analysis(){
|
||||
return (item)=>this.solveLogItem(item)
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
openIndex:0,
|
||||
nthChild:0,
|
||||
list:[]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$emit("setScrollToLower")
|
||||
},
|
||||
methods:{
|
||||
copy(item){
|
||||
uni.setClipboardData({
|
||||
data:''+JSON.stringify(item),
|
||||
success() {
|
||||
uni.showToast({
|
||||
title:"复制成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
showUp(item,index){
|
||||
uni.request({...item.Headers})
|
||||
},
|
||||
onDel(){
|
||||
this.livingExample.DATA.init()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.warn{
|
||||
color: #f8b251;
|
||||
background: rgba($color: #c3a356, $alpha: .2);
|
||||
box-shadow: 0 0 1rpx #f8b251;
|
||||
}
|
||||
.error{
|
||||
color: #d50000;
|
||||
background: rgba($color: #7c3615, $alpha: .3);
|
||||
box-shadow: 0 0 1rpx #d50000;
|
||||
}
|
||||
*{
|
||||
word-break: break-all;
|
||||
}
|
||||
.headline{
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border: 1rpx solid #303030;
|
||||
|
||||
text{
|
||||
padding: 0 8rpx;
|
||||
border-right: 1rpx solid #303030;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.method-text{
|
||||
flex: 1;
|
||||
}
|
||||
.url-text{
|
||||
flex: 3;
|
||||
max-width: 50%;
|
||||
text-align: right;
|
||||
text-overflow: overflow;
|
||||
}
|
||||
.status-text{
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.fw600{
|
||||
font-weight: 600;
|
||||
}
|
||||
.link{
|
||||
margin-bottom: 4rpx;
|
||||
width: 100%;
|
||||
border-bottom: 2rpx solid #999999;
|
||||
}
|
||||
.details{
|
||||
display: flex;
|
||||
text{
|
||||
border-bottom: 1rpx solid #999999;
|
||||
border-right: 1rpx solid #999999;
|
||||
&:nth-child(1){
|
||||
flex: 1;
|
||||
}
|
||||
&:nth-child(2){
|
||||
flex: 6;
|
||||
}
|
||||
}
|
||||
.body-json{
|
||||
flex: 6;
|
||||
}
|
||||
|
||||
}
|
||||
.details-view{
|
||||
width: 100%;
|
||||
}
|
||||
.details-top{
|
||||
border-top: 1rpx solid #999999;
|
||||
}
|
||||
.del-text{
|
||||
position: fixed;
|
||||
top: calc(20vh + 24rpx);
|
||||
}
|
||||
</style>
|
@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="">
|
||||
<text @click="eliminateAll">🚫</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<!-- {{exData}} -->
|
||||
<view class="details-top">
|
||||
<view @click="openIndex==indx?openIndex=-1:openIndex=indx" v-for="(item,indx) in exData" :key="indx" class="details">
|
||||
<text>{{item.key}}</text>
|
||||
<text v-if="openIndex==indx">{{item.obj}}</text>
|
||||
<text v-else style="max-height: 100rpx;overflow: hidden;text-overflow: ellipsis;">{{item.obj}}</text>
|
||||
<text @click.stop="edit(item,indx)"> {{'✍'}} </text>
|
||||
<text @click.stop="copy(item)">{{'📋'}} </text>
|
||||
<text @click.stop="remove(item,indx)">{{'❌'}} </text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="editState" class="edit-view">
|
||||
<text>key:</text>
|
||||
<input type="text" v-model="storageItem.key" />
|
||||
<text>obj:</text>
|
||||
<textarea :value="analysis" placeholder="" @input="textAreaInput" />
|
||||
<text class="bnt" @click.stop="editOK()">{{'💾'}}</text>
|
||||
<text class="bnt" @click.stop="editState=false">{{'❎'}}</text>
|
||||
<text>{{'待验证的'}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let textValue = ''
|
||||
export default {
|
||||
name:'StorageInit',
|
||||
components:{
|
||||
|
||||
},
|
||||
props:{
|
||||
livingExample:{
|
||||
type:Object,
|
||||
default:()=>{
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
exData() {
|
||||
return this.livingExample.DATA.DATA
|
||||
},
|
||||
analysis:{
|
||||
get(){
|
||||
return JSON.stringify(this.storageItem.obj)
|
||||
},
|
||||
set(val){
|
||||
if(typeof val == 'string'){
|
||||
try{
|
||||
val = JSON.parse(val)
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
}
|
||||
return this.storageItem.obj = val
|
||||
}
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
openIndex:0,
|
||||
storageItem:{},
|
||||
storageIndex:-1,
|
||||
editState:false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
copy(item){
|
||||
uni.setClipboardData({
|
||||
data:''+ JSON.stringify(item),
|
||||
success() {
|
||||
uni.showToast({
|
||||
title:"复制成功"
|
||||
})
|
||||
},
|
||||
fail() {
|
||||
uni.showToast({
|
||||
title:"复制失败"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
eliminateAll(){
|
||||
this.livingExample.DATA.eliminateAll()
|
||||
},
|
||||
remove(item,index){
|
||||
this.livingExample.DATA.remove(item.key,index)
|
||||
},
|
||||
edit(item,index){
|
||||
this.storageItem = item
|
||||
this.storageIndex = index
|
||||
this.editState = true
|
||||
},
|
||||
editOK(){
|
||||
this.analysis = textValue
|
||||
this.livingExample.DATA.edit(this.storageItem,this.storageIndex)
|
||||
this.editState = false
|
||||
},
|
||||
textAreaInput(e){
|
||||
textValue = e.detail.value
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
*{
|
||||
word-break: break-all;
|
||||
}
|
||||
.details{
|
||||
display: flex;
|
||||
border-bottom: 1rpx solid #999999;
|
||||
text{
|
||||
border-right: 1rpx solid #999999;
|
||||
&:nth-child(1){
|
||||
flex: 1;
|
||||
}
|
||||
&:nth-child(2){
|
||||
flex: 6;
|
||||
}
|
||||
}
|
||||
view{
|
||||
border-bottom: 1rpx solid #999999;
|
||||
border-right: 1rpx solid #999999;
|
||||
flex: 6;
|
||||
}
|
||||
|
||||
}
|
||||
.details-view{
|
||||
width: 100%;
|
||||
}
|
||||
.details-top{
|
||||
border-top: 1rpx solid #999999;
|
||||
}
|
||||
.edit-view{
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
padding: 20rpx;
|
||||
top: 20rpx;
|
||||
left: 10vw;
|
||||
// margin: 0 auto;
|
||||
width: 80vw;
|
||||
max-height: 60vh;
|
||||
background: #ffffff;
|
||||
border: 1rpx solid #999999;
|
||||
box-shadow: 0rpx 10rpx 30rpx #333333;
|
||||
text{
|
||||
padding: 8rpx 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
input{
|
||||
margin: 20rpx 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid #999999;
|
||||
}
|
||||
textarea{
|
||||
margin: 20rpx 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid #999999;
|
||||
}
|
||||
.bnt{
|
||||
margin-right: 80rpx;
|
||||
padding: 0 40rpx;
|
||||
border: 1rpx solid #999999;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<view @click.stop >
|
||||
<view class="setting">
|
||||
<text>这里是设置箱</text>
|
||||
<text>❌</text>
|
||||
<text>🚫</text>
|
||||
<br/>
|
||||
<text>请期待更多设置</text>
|
||||
<view v-for="(item,index) of HFDebuggingInformation.settingData" :key="index">
|
||||
<block v-if="item.type == 'switch'" >
|
||||
<text>{{item.name}}</text>
|
||||
<switch class="switch" :checked="item.value" @change="switchFunc(item,index,$event)" />
|
||||
</block>
|
||||
<text>{{index}}:</text>
|
||||
<text>{{item.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
HFDebuggingInformation
|
||||
} from './../common/store.js'
|
||||
export default {
|
||||
name: 'setting',
|
||||
components: {
|
||||
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
HFDebuggingInformation
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.HFDebuggingInformation = HFDebuggingInformation[0]
|
||||
},
|
||||
methods:{
|
||||
switchFunc(item,index,$event){
|
||||
this.HFDebuggingInformation.settingData[index].value = !this.HFDebuggingInformation.settingData[index].value
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.setting {
|
||||
position: fixed;
|
||||
min-height: calc(80vh - 20rpx);
|
||||
width: 100vw;
|
||||
z-index: 999;
|
||||
left: 0;
|
||||
bottom: 0rpx;
|
||||
background: #333333;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.switch{
|
||||
transform:scale(0.6)
|
||||
}
|
||||
</style>
|
@ -0,0 +1,84 @@
|
||||
{
|
||||
"id": "HF-HF_debugging",
|
||||
"displayName": "uni_modules插件 - 类Vconsole APP端调试工具 - HF调试器",
|
||||
"version": "0.0.2-rc-5",
|
||||
"description": "类Vconsole调试工具 ",
|
||||
"keywords": [
|
||||
"辅助脚本",
|
||||
"Vconsole",
|
||||
"调试",
|
||||
"",
|
||||
"APP端调试工具"
|
||||
],
|
||||
"repository": "https://gitee.com/hf4514/hf_debugging",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"JS SDK",
|
||||
"通用 SDK"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "u"
|
||||
},
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "u",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "u",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<view>
|
||||
<HFBox></HFBox>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HFBox from './../../components/HFBox.vue'
|
||||
export default {
|
||||
components:{
|
||||
HFBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tets:'测试'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
// ||getCurrentPages().lengt<=1
|
||||
/* uni.navigateBack({
|
||||
delta: 1
|
||||
}) */
|
||||
},
|
||||
onBackPress(){
|
||||
uni.$emit("viewShow")
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
onHide() {
|
||||
uni.$emit("viewShow")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
@ -0,0 +1,429 @@
|
||||
<template>
|
||||
<view class="bg_HFconsole">
|
||||
<view class="mark" @click="onMark"></view>
|
||||
<view class="bg_kuang">
|
||||
|
||||
<view class="flex">
|
||||
<text @click="onTlite(0)" :style="tliteIndex==0?'background-color: #ffaa7f;':''"
|
||||
class="tlite-one">Log</text>
|
||||
<text @click="onTlite(1)" :style="tliteIndex==1?'background-color: #ffaa7f;':''"
|
||||
class="tlite-one">Network</text>
|
||||
<text @click="onTlite(2)" :style="tliteIndex==2?'background-color: #ffaa7f;':''"
|
||||
class="tlite-one">Storage</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="tliteIndex==0" class="Log">
|
||||
<scroll-view :scroll-into-view="log_scroll_bot" style="height: 1100rpx;" scroll-y="true">
|
||||
<view :style="item[0]=='error'?'background-color: #ef918a;':''" class="item flex"
|
||||
v-for="(item,index) in CONSOLE_DATA_LOG">
|
||||
<text :style="item[0]=='error'?'background-color: #ef513c;':''"
|
||||
class="item_name">{{item[0]}}</text>
|
||||
<!-- <text class="flex item_cent">{{item[1]}}</text> -->
|
||||
<text v-for="(it,ind) in item[1]" :key="ind" class="flex item_cent">{{JSONString(it)}}</text>
|
||||
</view>
|
||||
<view v-if="!CONSOLE_DATA_LOG.length" class="">
|
||||
{{logType+'-'}}空~
|
||||
</view>
|
||||
<!-- style="background: #2C405A; width: 100%; justify-content: space-between;" -->
|
||||
<view class="flex" >
|
||||
<view class="flex" >
|
||||
<view @click="logType = 'All',setLogScrollBot()" class="bnt-view" :class="{'bnt-hit':logType=='All'}">
|
||||
All
|
||||
</view>
|
||||
<view @click="logType = 'Log',setLogScrollBot()" class="bnt-view" :class="{'bnt-hit':logType=='Log'}">
|
||||
Log
|
||||
</view>
|
||||
<view @click="logType = 'Error',setLogScrollBot()" class="bnt-view" :class="{'bnt-hit':logType=='Error'}">
|
||||
Error
|
||||
</view>
|
||||
</view>
|
||||
<view @click="eliminate" class="bnt-view-1">
|
||||
清除
|
||||
</view>
|
||||
</view>
|
||||
<view class="log_scroll_bot flex" id="log_scroll_bot0">
|
||||
|
||||
<textarea v-model="valLog" @confirm="confirmLog" placeholder="可输入指令进行执行(实验性的)" />
|
||||
<view class="" @click="confirmLog">执行</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view v-if="tliteIndex==1" class="Network">
|
||||
<scroll-view :scroll-into-view="log_scroll_bot" style="height: 1100rpx;" scroll-y="true">
|
||||
<view :style="(+item.Preview.statusCode)>=400?'background:#c24346;':'background-color: #aaaa7f;'"
|
||||
class="item flex Network_item" v-for="(item,index) in CONSOLE_DATA.request">
|
||||
<text class="GET">{{index}}.</text>
|
||||
<text :class="item.Headers.method">{{item.Headers.method}}</text>
|
||||
<text class="GET">{{item.Preview.statusCode==undefined?'CORS ERR':item.Preview.statusCode}}</text>
|
||||
<text class="URL" @click="onClickCent(item.Headers.url,index)">{{item.Headers.url}}</text>
|
||||
<view class="requestInitData" @click="onClickCent(item.Headers,index.data)"
|
||||
v-for="(it,ind) in requestInitData(item.Headers.data)">
|
||||
<text class="">{{ind}}:</text>
|
||||
<text class="">{{it}}</text>
|
||||
</view>
|
||||
<rich-text v-if="(+item.Preview.statusCode)>=400" class="preview_data"
|
||||
v-html="item.Preview.data" style=""></rich-text>
|
||||
<text v-else class="preview_data">{{item.Preview.data}}</text>
|
||||
</view>
|
||||
<view class="log_scroll_bot" id="log_scroll_bot1"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view v-if="tliteIndex==2" class="Storage">
|
||||
<scroll-view :scroll-into-view="log_scroll_bot" style="height: 1100rpx;" scroll-y="true">
|
||||
<view class="item_storage flex" v-for="(item,index) of CONSOLE_DATA.storage">
|
||||
|
||||
<text class="text_name">{{index}}</text>
|
||||
<view @click="onClickCent(item,index)" class="text_name_cent">
|
||||
<text>{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="log_scroll_bot" id="log_scroll_bot2"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as tool from './../../common/tool.js'
|
||||
import HFTool from './../../common/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
valLog: "",
|
||||
tliteIndex: -1,
|
||||
CONSOLE_DATA:HFTool.CONSOLE_DATA,
|
||||
/* CONSOLE_DATA: {
|
||||
request: [],
|
||||
console: [
|
||||
["log", "欢迎使用HF调试器~~~"]
|
||||
],
|
||||
storage: {},
|
||||
URL: "",
|
||||
}, */
|
||||
scrollTop: 0,
|
||||
log_scroll_bot: '',
|
||||
logType:'All'
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
CONSOLE_DATA_LOG(){
|
||||
if(this.logType == 'All'){
|
||||
return HFTool.CONSOLE_DATA.console
|
||||
}else if(this.logType == 'Log'){
|
||||
return HFTool.CONSOLE_DATA.consoleData.log
|
||||
}else{
|
||||
return HFTool.CONSOLE_DATA.consoleData.error
|
||||
}
|
||||
}
|
||||
},
|
||||
/* watch:{
|
||||
['CONSOLE_DATA.console'](){
|
||||
this.log_scroll_bot = "log_scroll_bot"
|
||||
this.$nextTick(() => {
|
||||
this.log_scroll_bot = 'log_scroll_bot' + this.type
|
||||
})
|
||||
}
|
||||
}, */
|
||||
onShow() {
|
||||
// ||getCurrentPages().lengt<=1
|
||||
if (this.tliteIndex == -1) {
|
||||
this.onTlite(0)
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
JSONString(it){
|
||||
try{
|
||||
JSON.stringify(it)
|
||||
return it
|
||||
}catch(e){
|
||||
return it.toString()
|
||||
}
|
||||
},
|
||||
eliminate(){
|
||||
HFTool.CONSOLE_DATA.consoleData={
|
||||
log:[],
|
||||
error:[]
|
||||
}
|
||||
HFTool.CONSOLE_DATA.console=[
|
||||
["log", ["欢迎使用HF调试器~~~"]]
|
||||
]
|
||||
},
|
||||
confirmLog() {
|
||||
this.CONSOLE_DATA.console.push(["eval-cmd>", [this.valLog]])
|
||||
let result = ''
|
||||
let $content = ''
|
||||
try {
|
||||
result = eval.call(global, '(' + this.valLog + ')');
|
||||
} catch (e) {
|
||||
try {
|
||||
result = eval.call(global, this.valLog);
|
||||
} catch (e) {
|
||||
;
|
||||
}
|
||||
}
|
||||
if (tool.isArray(result) || tool.isObject(result)) {
|
||||
result = getApp()!=result?result:'isObject - getApp'
|
||||
} else {
|
||||
if (tool.isNull(result)) {
|
||||
result = 'null';
|
||||
} else if (tool.isUndefined(result)) {
|
||||
result = 'undefined';
|
||||
} else if (tool.isFunction(result)) {
|
||||
result = 'function()'
|
||||
} else if (tool.isString(result)) {
|
||||
result = '"' + result + '"';
|
||||
}
|
||||
}
|
||||
HFTool.CONSOLE_DATA.console.push(["eval<", [result || 'undefined']])
|
||||
this.valLog = ""
|
||||
this.log_scroll_bot = 'log_scroll_bot'
|
||||
this.$nextTick(() => {
|
||||
this.log_scroll_bot = 'log_scroll_bot' + this.type
|
||||
})
|
||||
},
|
||||
setLogScrollBot(){
|
||||
this.log_scroll_bot = 'log_scroll_bot'
|
||||
this.$nextTick(() => {
|
||||
this.log_scroll_bot = 'log_scroll_bot0'
|
||||
})
|
||||
},
|
||||
onMark() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
onTlite(type) {
|
||||
if (!HFTool.CONSOLE_DATA) {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
this.tliteIndex = type
|
||||
// this.CONSOLE_DATA = HFTool.CONSOLE_DATA || this.CONSOLE_DATA
|
||||
this.log_scroll_bot = 'log_scroll_bot'
|
||||
this.$nextTick(() => {
|
||||
this.log_scroll_bot = 'log_scroll_bot' + type
|
||||
})
|
||||
},
|
||||
onClickCent(item, index) {
|
||||
uni.setClipboardData({
|
||||
data: '' + item,
|
||||
success: function() {
|
||||
uni.showToast({
|
||||
title: "复制成功"
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
requestInitData(item) {
|
||||
if (typeof item == 'String') {
|
||||
let OBJ = {}
|
||||
item.split("&").forEach(item => {
|
||||
let itema = item.split("=")
|
||||
OBJ[itema[0]] = itema[1]
|
||||
})
|
||||
return OBJ
|
||||
}
|
||||
return item
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: rgba(220, 38, 38, 0.0) !important;
|
||||
}
|
||||
|
||||
view,
|
||||
scroll-view,
|
||||
swiper,
|
||||
button,
|
||||
input,
|
||||
textarea,
|
||||
label,
|
||||
navigator,
|
||||
image {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.place {
|
||||
width: 100%;
|
||||
color: #007AFF;
|
||||
}
|
||||
|
||||
.GET,
|
||||
.POST,
|
||||
.put,
|
||||
.patch,
|
||||
.head,
|
||||
.delete {
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 9rpx;
|
||||
padding: 8rpx;
|
||||
border: #00aa00 1px;
|
||||
background-color: #55aa7f;
|
||||
color: #ffffff;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.URL {
|
||||
width: 100%;
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 9rpx;
|
||||
padding: 8rpx;
|
||||
border: #ff5500 1px;
|
||||
background-color: #ffaa7f;
|
||||
color: #ffffff;
|
||||
border-radius: 8rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.Network_item {
|
||||
width: 100%;
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 9rpx;
|
||||
padding: 8rpx;
|
||||
border: #005500 1px;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.requestInitData {
|
||||
width: 100%;
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 9rpx;
|
||||
padding: 8rpx;
|
||||
border: #aaff00 1px;
|
||||
background-color: #df8d3a;
|
||||
color: #ffffff;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.preview_data {
|
||||
width: 100%;
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 9rpx;
|
||||
padding: 8rpx;
|
||||
border: #aaff00 1px;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.item_name {
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 9rpx;
|
||||
padding: 8rpx;
|
||||
border: #00aa00 1px;
|
||||
background-color: #55aa7f;
|
||||
color: #ffffff;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.item_cent {
|
||||
width: 90%;
|
||||
padding: 8rpx;
|
||||
white-space: wrap;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow: auto;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.text_name {
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 9rpx;
|
||||
padding: 8rpx;
|
||||
border: #ff6a06 1px;
|
||||
background-color: #ffaa00;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.text_name_cent {
|
||||
padding: 8rpx;
|
||||
border: #55aa00 1px;
|
||||
background-color: #aaff7f;
|
||||
border-radius: 8rpx;
|
||||
white-space: wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.item_storage {
|
||||
padding: 8rpx;
|
||||
margin: 2rpx;
|
||||
}
|
||||
|
||||
.mark {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 750rpx;
|
||||
height: 1920rpx;
|
||||
background-color: #2F364E;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
// flex-wrap: wrap;
|
||||
|
||||
}
|
||||
|
||||
.bg_HFconsole {
|
||||
display: flex;
|
||||
background-color: rgba(220, 38, 38, 0.0);
|
||||
}
|
||||
|
||||
.bg_kuang {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #FFFFFF;
|
||||
height: 1200rpx;
|
||||
width: 750rpx;
|
||||
}
|
||||
|
||||
.tlite-one {
|
||||
padding: 20rpx;
|
||||
background-color: #e7e7e7;
|
||||
border: 1px #9c9c9c;
|
||||
}
|
||||
|
||||
.Log {}
|
||||
|
||||
.item {
|
||||
padding: 8rpx 20rpx;
|
||||
border: 1px #424242;
|
||||
background-color: #e3e3e3;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.log_scroll_bot {
|
||||
padding: 32rpx;
|
||||
width: 750rpx;
|
||||
min-height: 100rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.bnt-view{
|
||||
background: #F1F1F1;
|
||||
border: #55557f 2rpx solid;
|
||||
padding: 18rpx 30rpx;
|
||||
}
|
||||
.bnt-view-1{
|
||||
background: #ff5650;
|
||||
border: #55557f 2rpx solid;
|
||||
padding: 18rpx 40rpx;
|
||||
// margin-left: 200rpx;
|
||||
}
|
||||
.bnt-hit{
|
||||
background: #aaaa7f;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<view class="bg" @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" >
|
||||
<!-- <text @click="onClick" class="name">HF调试器</text> -->
|
||||
<text @click="onClick" class="name">HF调试器</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type:0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClick(){
|
||||
uni.$emit("HFshow")
|
||||
|
||||
},
|
||||
drawStart(event){
|
||||
this.startX = event.touches[0].clientX;
|
||||
},
|
||||
drawMove(event){
|
||||
/* const subNVue = uni.getSubNVueById('concat');
|
||||
subNVue.setStyle({
|
||||
"position": "fixed",
|
||||
"right":event.touches[0].clientX,
|
||||
"bottom":event.touches[0].clientY,
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"background": "transparent"
|
||||
}) */
|
||||
|
||||
|
||||
},
|
||||
drawEnd(event){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bg{
|
||||
/* width: 100%;
|
||||
height: 100%; */
|
||||
}
|
||||
.name{
|
||||
border-radius: 10rpx;
|
||||
position: fixed;
|
||||
right: 0rpx;
|
||||
bottom: 0rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
width: 200rpx;
|
||||
height: 80rpx;
|
||||
background-color: #FF4A46;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
</style>
|
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" ></div>
|
||||
|
||||
121212
|
||||
<script src="__uniappes6.js"></script>
|
||||
<script src="view.umd.min.js"></script>
|
||||
<script src="app-view.js"></script>
|
||||
<script type="text/javascript">
|
||||
document.getElementById("app").innerHTML="DDDDDDDD"
|
||||
|
||||
var onType = false
|
||||
var div = document.createElement('div');
|
||||
var startX = 0
|
||||
var startY = 0
|
||||
let body = document.getElementsByTagName('body')
|
||||
div.id = 'HF2';
|
||||
div.innerText = 'HF调试器';
|
||||
div.style.borderRadius = '5px';
|
||||
div.style.backgroundColor = '#FF4A46';
|
||||
div.style.color = '#FFFFFF';
|
||||
div.style.width = '100px';
|
||||
div.style.height = '40px';
|
||||
div.style.position = 'fixed';
|
||||
div.style.right = '0px';
|
||||
div.style.bottom = '0px';
|
||||
div.style.lineHeight='40px';
|
||||
div.style.textAlign= 'center';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
div.onclick = (e)=>{
|
||||
UniViewJSBridge.publishHandler('BNT_VIEW',e);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": "uni-badge",
|
||||
"displayName": "uni-badge 数字角标",
|
||||
"version": "1.2.2",
|
||||
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
|
||||
"keywords": [
|
||||
"",
|
||||
"badge",
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"数字角标",
|
||||
"徽章"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": ["uni-scss"],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
{
|
||||
"id": "uni-breadcrumb",
|
||||
"displayName": "uni-breadcrumb 面包屑",
|
||||
"version": "0.1.2",
|
||||
"description": "Breadcrumb 面包屑",
|
||||
"keywords": [
|
||||
"uni-breadcrumb",
|
||||
"breadcrumb",
|
||||
"uni-ui",
|
||||
"面包屑导航",
|
||||
"面包屑"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
},
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "n"
|
||||
},
|
||||
"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",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|