修改bug

main
ihzero 2024-04-26 06:16:25 +08:00
parent 9ffba47619
commit 5e69c343b6
18 changed files with 287 additions and 64 deletions

View File

@ -1,4 +1,4 @@
VITE_COMMON_API_PREFIX = /api-base
VITE_COMMON_API_URL = http://store-manage.hmily.club
VITE_COMMON_API_URL = http://store-manage.hmily.club/api

View File

@ -3,16 +3,25 @@ import { useUserStoreWithOut } from '@/store/modules/user'
export default {
onLaunch: function () {
const userStore = useUserStoreWithOut()
// if (userStore.isLogin) {
// userStore.fetchUserInfo()
// } else {
// uni.navigateTo({
// url: '/pages/login/index',
// })
// }
// #ifdef APP-PLUS
if (userStore.isLogin) {
userStore.fetchUserInfo()
plus.navigator.closeSplashscreen()
} else {
uni.navigateTo({
uni.reLaunch({
url: '/pages/login/index',
success: () => {
plus.navigator.closeSplashscreen()
},
})
}
console.log('App Launch')
// #endif
},
onShow: function () {
console.log('App Show')

View File

@ -11,11 +11,12 @@
>
<template #left>
<slot name="left">
<image
<!-- <image
v-if="isBack && !leftIcon"
class="w-54rpx h-54rpx"
src="/static/images/icon_back_def.svg"
></image>
></image> -->
<uv-icon size="36rpx" color="white" v-if="isBack && !leftIcon" name="arrow-left"></uv-icon>
</slot>
</template>
<template #center>

View File

@ -1,5 +1,5 @@
{
"name" : "aa",
"name" : "托管门店助手",
"appid" : "__UNI__ADB6360",
"description" : "",
"versionName" : "1.0.0",
@ -11,11 +11,11 @@
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"alwaysShowBeforeRender" : false,
"waiting" : true,
"autoclose" : true,
"autoclose" : false,
"delay" : 0
},
},
/* */
"modules" : {},
/* */

View File

@ -1,6 +1,20 @@
{
"pages": [
{
"path": "pages/guide/judge",
"style": {
"enablePullDownRefresh": false,
"onReachBottomDistance": 100,
"navigationStyle": "custom",
"app-plus": {
"contentAdjust": false,
"bounce": "none"
}
},
"meta": {
"login": false
}
},
{
"path": "pages/home/index",
"style": {
@ -30,6 +44,12 @@
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/message/index",
"style": {
"navigationBarTitleText": "消息"
}
}
],
"subPackages": [

View File

@ -0,0 +1,26 @@
<template>
<view class="content"></view>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
onLoad(() => {
checkLogin()
})
const checkLogin = () => {
if (!userStore.isLogin) {
uni.redirectTo({
url: '/pages/login/index',
})
} else {
uni.switchTab({
url: '/pages/home/index',
})
}
}
</script>

View File

@ -1,12 +1,15 @@
<template>
<view>
<view>
<StoreDropDown></StoreDropDown>
</view>
<CuNavbar :isBack="false" title="首页">
<template #center>
<view class="w-full">
<!-- <StoreDropDown></StoreDropDown> -->
</view>
</template>
</CuNavbar>
<view class="bg-primary p-base text-center text-white relative">
<view class="absolute top-20rpx right-20rpx">
<uv-icon color="#fff" size="48rpx" name="chat"></uv-icon>
<uv-icon @click="goPath('/pages/message/index')" color="#fff" size="48rpx" name="chat"></uv-icon>
</view>
<view class="mt-60rpx">昨日累计金额</view>
<view class="mt-20rpx">截止{{ yesterday }}</view>
@ -44,6 +47,7 @@
<script setup>
import { ref, reactive, computed } from 'vue'
import ChartComp from './components/chart.vue'
import CuNavbar from '@/components/cu-navbar/index'
import StoreDropDown from '@/pages/home/components/store-drop-down/index.vue'
import { http } from '@/utils/request'
import { onShow } from '@dcloudio/uni-app'
@ -104,4 +108,8 @@ const getData = () => {
detail.value = res
})
}
const goPath = (url) => {
uni.navigateTo({ url })
}
</script>

View File

@ -2,10 +2,10 @@
<template>
<view class="w-full flex flex-col">
<view class="mt-20vh">
<view class="b-1px b-solid h-120rpx"></view>
<view class="mt-20vh flex-center">
<image class="w-200rpx h-200rpx" src="@/static/logo.png"></image>
</view>
<view class="text-35rpx text-hex-333333 font-600 mt-80rpx">体彩管理系统</view>
<view class="text-35rpx text-hex-333333 font-600 mt-80rpx">托管门店助手</view>
<view class="text-27rpx text-hex-333333">欢迎登录</view>
<view class="flex-1 flex flex-col justify-end mt-0rpx">
<LoginForm></LoginForm>

View File

@ -0,0 +1,28 @@
<template>
<view class="card-shadow p-base">
<view class="flex items-center justify-between">
<view>{{ statusFun('system', 'messages', 'name') }}</view>
<view class="text-hex-999 text-24rpx">{{
timeFormat(item?.created_at, 'mm月dd日 hh:MM')
}}</view>
</view>
<view class="mt-14rpx text-hex-999 text-26rpx"> {{item?.content}} </view>
<!-- <view
v-if="item?.type != 'system'"
class="text-right text-hex-999 text-22rpx flex items-center justify-end"
>
<view>查看详情</view>
<uv-icon name="arrow-right" size="16rpx"></uv-icon>
</view> -->
</view>
</template>
<script setup>
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
import statusFun from '@/utils/status'
const props = defineProps({
item: {
type: Object,
default: () => {},
},
})
</script>

View File

@ -0,0 +1,96 @@
<template>
<view>
<CuNavbar title="消息">
<template #right>
<view class="text-24rpx text-white" @click="onRead"> </view>
</template>
</CuNavbar>
<uv-sticky bgColor="#fff">
<uv-tabs
height="44"
:activeStyle="{ color: '#ee2c37' }"
:scrollable="false"
:current="tabIndex"
lineColor="#ee2c37"
:list="tabList"
@change="tabChange"
></uv-tabs>
</uv-sticky>
<MescrollItem
ref="mescrollItem0"
:top="88"
:i="0"
:index="tabIndex"
:apiUrl="tabList[0].apiUrl"
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view v-for="(item, i) in list" :key="i">
<Item :item="item"></Item>
</view>
</view>
</template>
</MescrollItem>
<MescrollItem
ref="mescrollItem1"
:i="1"
:top="88"
:index="tabIndex"
:apiUrl="tabList[1].apiUrl"
:params="tabList[1].params"
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view v-for="(item, i) in list" :key="i">
<Item :item="item"></Item>
</view>
</view>
</template>
</MescrollItem>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import { computed, reactive, ref } from 'vue'
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
import MescrollItem from '@/components/mescroll-api/more.vue'
import Item from './components/item.vue'
import { http } from '@/utils/request'
const mescrollItem0 = ref(null)
const mescrollItem1 = ref(null)
const mescrollItems = [mescrollItem0, mescrollItem1]
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
mescrollItems,
onPageScroll,
onReachBottom
)
const tabList = ref([
{
name: '系统通知',
apiUrl: '/message/messages',
params: {
filter: 'filter',
},
},
{
name: '办公通知',
apiUrl: '/message/messages',
params: {
filter: 'work',
},
},
])
const tabChange = ({ index }) => {
tabIndex.value = index
scrollToLastY()
}
const onRead = () => {
http.post('/message/read-all').then(() => {
getMescroll(tabIndex.value).resetUpScroll()
})
}
</script>

View File

@ -1,6 +1,6 @@
<template>
<view>
<CuNavbar :isBack="isBack" title="上报"></CuNavbar>
<CuNavbar :isBack="false" title="上报"></CuNavbar>
<view
:class="[
@ -142,14 +142,14 @@
</view>
</uv-form>
</view>
<view class="h-130rpx" v-if="checkPermission(['store']) && form.allow_rereport">
<view class="h-130rpx">
<view
class="fixed bottom-0 left-0 right-0 h-120rpx bg-white flex-center box-border px-base"
:style="style"
>
<view class="w-full">
<uv-button
:disabled="!form.allow_rereport"
:disabled="!form.allow_rereport || !checkPermission(['store'])"
type="primary"
shape="circle"
block

View File

@ -3,11 +3,23 @@
<CuNavbar title="设置"></CuNavbar>
<view class="space-y-base mt-base">
<view class="card-shadow bg-white rounded-19rpx">
<Cell title="修改密码" :shadow="false" @onClick="goPath('/pages/setting/password')"></Cell>
<Cell
title="修改密码"
:shadow="false"
@onClick="goPath('/pages/setting/password')"
></Cell>
<uv-line color="#f5f5f5"></uv-line>
<Cell title="举报投诉" :shadow="false" @click="goPath('/pages/setting/complain')"></Cell>
<Cell
title="举报投诉"
:shadow="false"
@click="goPath('/pages/setting/complain')"
></Cell>
<uv-line color="#f5f5f5"></uv-line>
<Cell title="意见箱" :shadow="false" @click="goPath('/pages/setting/suggestion')"></Cell>
<Cell
title="意见箱"
:shadow="false"
@click="goPath('/pages/setting/suggestion')"
></Cell>
<uv-line color="#f5f5f5"></uv-line>
</view>
<view>
@ -19,20 +31,45 @@
</view>
</view>
<view class="mt-100rpx">
<uv-button block type="primary">退出登录</uv-button>
<uv-button @click="confirmLogout" block type="primary"
>退出登录</uv-button
>
</view>
<uv-modal
ref="modalRef"
title="提示"
content="确定退出?"
@confirm="logout"
></uv-modal>
</view>
</template>
<script setup>
import { ref } from 'vue'
import CuNavbar from '@/components/cu-navbar/index'
import Cell from '@/components/cell/index'
import { sys } from '@climblee/uv-ui/libs/function';
import { computed } from 'vue';
import { sys } from '@climblee/uv-ui/libs/function'
import { computed } from 'vue'
import { useUserStore } from '@/store/modules/user'
const modalRef = ref(null)
const userStore = useUserStore()
const sysInfo = sys()
const varsion = computed(() => sysInfo.appVersion)
const goPath = (url) => {
uni.navigateTo({
url
url,
})
}
const confirmLogout = () => {
modalRef.value.open()
}
const logout = () => {
userStore.logout()
uni.reLaunch({
url: '/pages/login/index',
})
}
</script>

View File

@ -1,37 +1,7 @@
<template>
<view>
<CuNavbar title="数据报表"></CuNavbar>
<view>
<uv-drop-down
ref="dropDown"
sign="dropDown_1"
text-active-color="#3c9cff"
:extra-icon="{ name: 'arrow-down-fill', color: '#666', size: '26rpx' }"
:extra-active-icon="{
name: 'arrow-up-fill',
color: '#3c9cff',
size: '26rpx',
}"
:defaultValue="['all', 'all']"
:custom-style="{ padding: '0 30rpx' }"
@click="selectMenu"
>
<uv-drop-down-item
name="area"
type="2"
:label="dropDownData.area.label"
:value="dropDownData.area.value"
>
</uv-drop-down-item>
<uv-drop-down-item
name="store"
type="2"
:label="dropDownData.store.label"
:value="dropDownData.store.value"
>
</uv-drop-down-item>
</uv-drop-down>
</view>
<view class="card">
<uv-tabs
:lineColor="'#ee2c37'"

View File

@ -44,4 +44,12 @@ $uv-info-light: #f4f4f5;
.uv-navbar--fixed{
z-index: 1000 !important;
}
.uv-form-item__body__left__content__label{
font-size: 26rpx !important;
}
.uv-modal__content__text{
text-align: center !important;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 349 KiB

View File

@ -56,7 +56,6 @@ const cfu = {
"formatter":{
"yAxisDemo1":function(val, index, opts){return val+'元'},
"ssss":function(val,index,opts){
console.log((index % 5)==0?val:'');
return (index % 8)==0?val:''
},
"yAxisDemo2":function(val, index, opts){return val.toFixed(2)},

View File

@ -8,7 +8,7 @@ http.setConfig((config) => {
config.baseURL = apiUrl;
config.timeout = 10000;
config.header = Object.assign({
// 'Content-Type': 'application/json;charset=UTF-8',
Accept: 'application/json'
}, config.header);
/* 设置全局配置 */
config.validateStatus = (statusCode) => {
@ -48,6 +48,14 @@ http.interceptors.response.use(async (response) => {
// 处理响应结果
const { statusCode, data } = response
if (statusCode >= 400) {
if(statusCode === 401) {
const userStore = useUserStoreWithOut();
userStore.logout();
uni.navigateTo({
url: '/pages/login/index'
})
return Promise.reject(response)
}
uni.showToast({
title: data.message || '服务器错误',
icon: 'none'

View File

@ -1,4 +1,17 @@
const data = {
messages:[{
value:'system',
name:'系统消息',
},{
value:'work',
name:'工作消息',
},{
value:'exam',
name:'考试通知',
},{
value:'approval',
name:'审批通知',
}],
statusExpense: [{
value: 1,
name: '待提审',