first commit
This commit is contained in:
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"easycom": {
|
||||
// 注意一定要放在custom里,否则无效,https://ask.dcloud.net.cn/question/131175
|
||||
"custom": {
|
||||
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
|
||||
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
|
||||
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
|
||||
}
|
||||
},
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
|
||||
{
|
||||
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "门店运营",
|
||||
"navigationBarBackgroundColor": "#36394D",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/task",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务",
|
||||
"navigationBarBackgroundColor": "#36394D",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/income",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的收入",
|
||||
"navigationBarBackgroundColor": "#36394D",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"navigationBarBackgroundColor": "#36394D",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "v派商家",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"backgroundColor": "#000"
|
||||
},
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages/order",
|
||||
"pages": [
|
||||
{
|
||||
"path": "orderDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "项目中心",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "navigation",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "导航",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "abnormal",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "上报异常",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "grabOrder",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "incomeDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "收入详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "withdraw",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "提现申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "finish",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "订单完成"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "upAbnormal",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "异常上报"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "orderMap",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单地图"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/my",
|
||||
"pages": [{
|
||||
"path" : "edit",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "编辑资料"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "statusContro",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "上线管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "myKF",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "联系客服",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "AbnormalList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "异常订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "check",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "签到奖励"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "abnormalDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "异常详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "security",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "账号与安全"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "authentication",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "实名认证"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "login",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "noticeList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "消息通知",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "setConnect",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "紧急联系人"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "evaluate",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "评价中心"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "completeData",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "完善信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "withDrowList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "提现列表"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
|
||||
"tabBar": {
|
||||
"color": "#000",
|
||||
"selectedColor": "#000",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"list": [{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/tab/home.png",
|
||||
"selectedIconPath": "/static/tab/homed.png",
|
||||
"text": "主页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/index/income",
|
||||
"iconPath": "static/tab/income.png",
|
||||
"selectedIconPath": "static/tab/incomed.png",
|
||||
"text": "收入"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/index/user",
|
||||
"iconPath": "static/tab/user.png",
|
||||
"selectedIconPath": "static/tab/usered.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
export class UploadAssist {
|
||||
static Upload(url: string, path: string, fromData: any) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
uni.uploadFile({
|
||||
url: url, //仅为示例,非真实的接口地址
|
||||
filePath: path,
|
||||
name: 'file',
|
||||
formData: fromData,
|
||||
success: (uploadFileRes) => {
|
||||
resolve(uploadFileRes);
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Service } from '@/Service/Service';
|
||||
/*****腾讯云存储*****/
|
||||
class NvpTencentCosService {
|
||||
private static GetAuthorizationPath: string = '/TencentCos/GetAuthorization';
|
||||
/*****获取云存储配置*****/
|
||||
static GetAuthorization() {
|
||||
var result = Service.Request(this.GetAuthorizationPath, "GET", "");
|
||||
return result;
|
||||
}
|
||||
|
||||
private static GetUpLoadInfoPath: string = '/TencentCos/GetUpLoadInfo';
|
||||
/*****获取上传地址*****/
|
||||
static GetUpLoadInfo(code: string, fileName: string, desire: string) {
|
||||
var result = Service.Request(this.GetUpLoadInfoPath, "GET", { code, fileName, desire });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
export {
|
||||
Service,
|
||||
NvpTencentCosService
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import {Service} from "@/Service/Service"
|
||||
export class EventHandler {
|
||||
//处理事件
|
||||
static Events(data: any) {
|
||||
var result = JSON.parse(data.data);
|
||||
if (result.code == 'msg') {
|
||||
this.ChatEnent(result);
|
||||
} else if (result.code == 'order') {
|
||||
uni.$emit('newOrder', data);
|
||||
}
|
||||
}
|
||||
|
||||
static ChatEnent(data: any) {
|
||||
console.log(data,'xxx')
|
||||
var eventName = `chat_${data.chanId}`;
|
||||
uni.$emit(eventName, data);
|
||||
}
|
||||
|
||||
static ChatUserEnent(data: any) {
|
||||
var eventUserName = `chatUser_${data.sendId}`;
|
||||
uni.$emit('UpdatePrivateMsg', data);
|
||||
uni.$emit(eventUserName, data);
|
||||
this.plusPush();
|
||||
}
|
||||
|
||||
static plusPush() {
|
||||
//#ifdef APP-PLUS
|
||||
if(!Service.getIsHede()){
|
||||
return
|
||||
}
|
||||
|
||||
let content = '您有一条新的消息~';
|
||||
let options = {
|
||||
cover: false,
|
||||
when: new Date(),
|
||||
title: '通知消息'
|
||||
};
|
||||
let body = {
|
||||
id: 'id',
|
||||
key: 'key'
|
||||
};
|
||||
let payload = JSON.stringify(body);
|
||||
plus.push.createMessage(content, payload, options);
|
||||
//#endif
|
||||
}
|
||||
|
||||
static SystemEnent(data: any) {
|
||||
let obj = JSON.parse(data.data);
|
||||
if (obj.code == 'Like' || obj.code == 'Aite' || obj.code == 'Comment' || obj.code == 'Notice') {
|
||||
uni.$emit('MegEvent', obj);
|
||||
} else if (obj.code == 'Off') {
|
||||
uni.$emit('ImComOff', 'user');
|
||||
} else if (obj.code == 'UpdateUserInfo') {
|
||||
uni.$emit('UpdateUserInfo');
|
||||
} else if (obj.code == 'Friend') {
|
||||
uni.$emit('Friend');
|
||||
}
|
||||
}
|
||||
|
||||
static ConnectBus() {
|
||||
uni.$emit('UpdateChat');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<script setup lang="ts">
|
||||
import { onLaunch, onShow, onHide, onError } from '@dcloudio/uni-app'
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
|
||||
// 全局定时器引用
|
||||
let globalTimer = null
|
||||
|
||||
// 每分钟要执行的方法
|
||||
const minuteTask = () => {
|
||||
console.log('每分钟执行一次的任务', new Date().toLocaleTimeString())
|
||||
}
|
||||
|
||||
// 启动全局定时器
|
||||
const startGlobalTimer = () => {
|
||||
if (globalTimer) {
|
||||
clearInterval(globalTimer)
|
||||
}
|
||||
|
||||
// 立即执行一次
|
||||
minuteTask()
|
||||
|
||||
// 设置每分钟执行一次(60000毫秒 = 1分钟)
|
||||
globalTimer = setInterval(() => {
|
||||
minuteTask()
|
||||
}, 60000)
|
||||
}
|
||||
|
||||
// 停止全局定时器
|
||||
const stopGlobalTimer = () => {
|
||||
if (globalTimer) {
|
||||
clearInterval(globalTimer)
|
||||
globalTimer = null
|
||||
}
|
||||
}
|
||||
|
||||
onLaunch(() => {
|
||||
console.log('App Launch')
|
||||
// 应用启动时开始定时器
|
||||
startGlobalTimer()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
console.log('App Show')
|
||||
// 应用回到前台时重新开始定时器
|
||||
startGlobalTimer()
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('App Hide')
|
||||
// 应用进入后台时停止定时器,节省资源
|
||||
stopGlobalTimer()
|
||||
})
|
||||
|
||||
// Vue组件卸载时清理定时器
|
||||
onUnmounted(() => {
|
||||
stopGlobalTimer()
|
||||
})
|
||||
|
||||
// 全局错误处理
|
||||
onError((err) => {
|
||||
console.error('App Error:', err)
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "uview-plus/index.scss";
|
||||
@import "colorui/main.css";
|
||||
@import "colorui/icon.css";
|
||||
|
||||
page {
|
||||
--nav-mian: #1890FF; //全局颜色
|
||||
--nav-vice: #52C41A; //副颜色
|
||||
--nav-diluted: #FF4D4F; //次颜色
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user