Commit e13da015 authored by 刘杰's avatar 刘杰

企业微信前端

parent 3612bc13
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"default" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}
...@@ -16,6 +16,9 @@ export function searchBossCard(data) { ...@@ -16,6 +16,9 @@ export function searchBossCard(data) {
export function searchOrderEvent(data) { export function searchOrderEvent(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchOrderEvent`, data) return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchOrderEvent`, data)
} }
export function searchOrderEventDetail(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchOrderEventDetail`, data)
}
export function BindCompany(data) { export function BindCompany(data) {
return Request( return Request(
......
<template> <template>
<view class="report-container"> <view class="report-container">
<scroll-view class="scroll-list" scroll-y>
<!-- 顶部统计卡片 --> <!-- 顶部统计卡片 -->
<view class="top-stats-wrapper"> <view class="top-stats-wrapper">
<!-- 异常统计环状进度 --> <!-- 异常统计环状进度 -->
...@@ -56,8 +57,8 @@ ...@@ -56,8 +57,8 @@
<!-- 右侧数据统计 --> <!-- 右侧数据统计 -->
<view class="statistics" v-if="staffKind==='simulatedBoss'"> <view class="statistics">
<view class="stat-row"> <view class="stat-row" v-if="staffKind==='simulatedBoss'">
<view class="stat-item"> <view class="stat-item">
<view class="stat-block green "> <view class="stat-block green ">
<text class="number">{{currentSearchData.overview.stats.shippingCount}}</text> <text class="number">{{currentSearchData.overview.stats.shippingCount}}</text>
...@@ -221,8 +222,8 @@ ...@@ -221,8 +222,8 @@
</text> </text>
</view> </view>
</view> </view>
<scroll-view class="chart-scroll" scroll-x> <scroll-view class="chart-scroll" scroll-x @touchmove.prevent>
<view class="chart-wrapper" id="myLeaderChart"></view> <canvas class="chart-wrapper" id="myLeaderChart"></canvas>
</scroll-view> </scroll-view>
</view> </view>
...@@ -249,14 +250,15 @@ ...@@ -249,14 +250,15 @@
</text> </text>
</view> </view>
</view> </view>
<scroll-view class="chart-scroll" scroll-x> <scroll-view class="chart-scroll" scroll-x @touchmove.prevent>
<view class="chart-wrapper" id="myProjectChart"></view> <canvas class="chart-wrapper" id="myProjectChart"></canvas>
</scroll-view> </scroll-view>
</view> </view>
<!-- 项目运营表格 --> <!-- 项目运营表格 -->
<view class="table-container"> <view class="table-container">
<text class="table-title">模拟老板运营情况</text> <text class="table-title">模拟老板运营情况</text>
<scroll-view scroll-x class="table-scroll">
<view class="table-scroll"> <view class="table-scroll">
<uni-table :data="currentData.tableData" border :loading="loading" emptyText="暂无数据"> <uni-table :data="currentData.tableData" border :loading="loading" emptyText="暂无数据">
<uni-tr> <uni-tr>
...@@ -283,7 +285,9 @@ ...@@ -283,7 +285,9 @@
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</view> </view>
</scroll-view>
</view> </view>
</scroll-view>
</view> </view>
</template> </template>
...@@ -496,6 +500,9 @@ ...@@ -496,6 +500,9 @@
itemStyle: { itemStyle: {
color: '#52C41A', color: '#52C41A',
borderRadius: [4, 4, 0, 0] borderRadius: [4, 4, 0, 0]
},
emphasis: {
focus: 'series'
} }
}, },
{ {
...@@ -505,6 +512,9 @@ ...@@ -505,6 +512,9 @@
itemStyle: { itemStyle: {
color: '#FF4D4F', color: '#FF4D4F',
borderRadius: [4, 4, 0, 0] borderRadius: [4, 4, 0, 0]
},
emphasis: {
focus: 'series'
} }
}, },
{ {
...@@ -518,12 +528,20 @@ ...@@ -518,12 +528,20 @@
}, },
lineStyle: { lineStyle: {
width: 2 width: 2
},
emphasis: {
focus: 'series'
} }
} }
] ]
} }
this.myLeaderChart.setOption(option) this.myLeaderChart.setOption(option)
this.myLeaderChart.on('click', function(params) {
if (params.componentType === 'series') {
console.log('触碰到柱状图:', params);
}
});
}, },
initProjectChart() { initProjectChart() {
// 获取数据点数量 // 获取数据点数量
...@@ -650,10 +668,10 @@ ...@@ -650,10 +668,10 @@
lineStyle: { lineStyle: {
width: 2 width: 2
} }
} }
] ]
} }
this.myProjectChart.setOption(option) this.myProjectChart.setOption(option)
}, },
async switchTime(time) { async switchTime(time) {
...@@ -883,11 +901,17 @@ ...@@ -883,11 +901,17 @@
height: 100%; height: 100%;
} }
.scroll-list {
height: calc(100vh - 60px);
}
.report-container { .report-container {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
background-color: #F5F7FA; background-color: #F5F7FA;
min-height: 100vh; min-height: calc(100vh - 60px);
// max-height: 100vh;
>view { >view {
width: 100%; width: 100%;
......
...@@ -3,15 +3,23 @@ ...@@ -3,15 +3,23 @@
<!-- 顶部统计 --> <!-- 顶部统计 -->
<view class="report-stats"> <view class="report-stats">
<view class="stat-item" @click="selectReport('submit')"> <view class="stat-item" @click="selectReport('submit')">
<text class="number" style="color: #52c41a;">{{ searchDatas.submitted }}</text> <text class="number" style="color: #52c41a;">
{{ searchDatas.submitted }}
<text class="unit" style="color: #52c41a;"></text>
</text>
<text class="label">已提交</text> <text class="label">已提交</text>
</view> </view>
<view class="stat-item" @click="selectReport('unSubmit')"> <view class="stat-item" @click="selectReport('unSubmit')">
<text class="number" style="color: #ff4d4f;">{{ searchDatas.unSubmitted }}</text> <text class="number" style="color: #ff4d4f;">
{{ searchDatas.unSubmitted }}
<text class="unit" style="color: #ff4d4f;"></text>
</text>
<text class="label">未提交</text> <text class="label">未提交</text>
</view> </view>
<view class="stat-item" @click="selectReport('all')"> <view class="stat-item" @click="selectReport('all')">
<text class="number" style="color: #1890ff;">{{ searchDatas.total }}</text> <text class="number" style="color: #1890ff;">{{ searchDatas.total }}
<text class="unit" style="color: #1890ff;"></text></text>
<text class="label">总人数</text> <text class="label">总人数</text>
</view> </view>
...@@ -85,6 +93,9 @@ ...@@ -85,6 +93,9 @@
this.staffCode = uni.getStorageSync('staffCode'); this.staffCode = uni.getStorageSync('staffCode');
this.staffKind = uni.getStorageSync('uc_staff_kind'); this.staffKind = uni.getStorageSync('uc_staff_kind');
this.commonName = uni.getStorageSync('commonName'); this.commonName = uni.getStorageSync('commonName');
console.log("this.staffCode"+this.staffCode)
console.log("this.staffKind"+this.staffKind)
console.log("this.commonName"+this.commonName)
console.log('获取到的commonName:', this.commonName); console.log('获取到的commonName:', this.commonName);
...@@ -167,6 +178,12 @@ ...@@ -167,6 +178,12 @@
font-weight: bold; font-weight: bold;
color: #333; color: #333;
margin-bottom: 8px; margin-bottom: 8px;
.unit {
font-size: 12px;
color: #999;
margin-left: 5px;
}
} }
.label { .label {
...@@ -178,7 +195,7 @@ ...@@ -178,7 +195,7 @@
.report-list { .report-list {
// 调整高度,移除分页器的空间 // 调整高度,移除分页器的空间
height: calc(100vh - 120px); height: calc(100vh - 200px);
.report-card { .report-card {
display: block; display: block;
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<!-- 按钮组 --> <!-- 按钮组 -->
<view class="button-group"> <view class="button-group">
<button class="back-btn" @click="goBack">返回</button> <!-- <button class="back-btn" @click="goBack">返回</button> -->
<button class="submit-btn" @click="submitReport">提交日报</button> <button class="submit-btn" @click="submitReport">提交日报</button>
</view> </view>
</view> </view>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
"devServer" : { "devServer" : {
"https" : false, "https" : false,
"disableHostCheck" : true, "disableHostCheck" : true,
"port" : 8082, "port" : 8083,
"proxy" : { "proxy" : {
"/api" : { "/api" : {
// "target" : "http://122.112.220.204:8089", // "target" : "http://122.112.220.204:8089",
......
...@@ -16,75 +16,75 @@ import * as ww from "@wecom/jssdk"; ...@@ -16,75 +16,75 @@ import * as ww from "@wecom/jssdk";
module.exports = { module.exports = {
methods: { methods: {
initWeCom(callback = () => {}) { // initWeCom(callback = () => {}) {
getTicketByType({ // getTicketByType({
aux: { // aux: {
entryName: MINI.h5Uat, // entryName: MINI.h5Uat,
type: "app", // type: "app",
}, // },
}).then((res) => { // }).then((res) => {
const appTicket = res.data.data.ticket; // const appTicket = res.data.data.ticket;
getTicketByType({ // getTicketByType({
aux: { // aux: {
entryName: MINI.h5Uat, // entryName: MINI.h5Uat,
type: "company", // type: "company",
}, // },
}).then((res) => { // }).then((res) => {
const comTicket = res.data.data.ticket; // const comTicket = res.data.data.ticket;
const timestamp = new Date().getTime(); // const timestamp = new Date().getTime();
ww.register({ // ww.register({
corpId: CORP_ID, // corpId: CORP_ID,
agentId: AGENT_ID, // agentId: AGENT_ID,
jsApiList: JS_API_LIST, // jsApiList: JS_API_LIST,
async getConfigSignature(url) { // async getConfigSignature(url) {
const { // const {
signature // signature
} = ww.getSignature({ // } = ww.getSignature({
ticket: comTicket, // ticket: comTicket,
nonceStr: MINI.h5Uat, // nonceStr: MINI.h5Uat,
timestamp, // timestamp,
url, // url,
}); // });
return { // return {
timestamp, // timestamp,
nonceStr: MINI.h5Uat, // nonceStr: MINI.h5Uat,
signature, // signature,
}; // };
}, // },
async getAgentConfigSignature(url) { // async getAgentConfigSignature(url) {
const { // const {
signature // signature
} = ww.getSignature({ // } = ww.getSignature({
ticket: appTicket, // ticket: appTicket,
nonceStr: MINI.h5Uat, // nonceStr: MINI.h5Uat,
timestamp, // timestamp,
url, // url,
}); // });
return { // return {
timestamp, // timestamp,
nonceStr: MINI.h5Uat, // nonceStr: MINI.h5Uat,
signature, // signature,
}; // };
}, // },
onConfigSuccess(res) { // onConfigSuccess(res) {
console.log("onConfigSuccess", res); // console.log("onConfigSuccess", res);
}, // },
onConfigFail(res) { // onConfigFail(res) {
console.log("onConfigFail" + res); // console.log("onConfigFail" + res);
}, // },
onAgentConfigSuccess(res) { // onAgentConfigSuccess(res) {
console.log("onAgentConfigSuccess" + JSON.stringify(res)); // console.log("onAgentConfigSuccess" + JSON.stringify(res));
callback() // callback()
}, // },
onAgentConfigFail(res) { // onAgentConfigFail(res) {
console.log("onAgentConfigFail" + res); // console.log("onAgentConfigFail" + res);
}, // },
}); // });
}); // });
}); // });
}, // },
//获取微信token //获取微信token
getWxToken() { getWxToken() {
uni.login({ uni.login({
......
<template> <template>
<view class="abnormal-detail"> <view class="abnormal-detail">
<!-- 基本信息卡片 --> <!-- 基本信息卡片 -->
<scroll-view scroll-y :style="{ height: '100vh' }">
<view class="detail-card"> <view class="detail-card">
<view class="card-title">基本信息</view> <view class="card-title">基本信息</view>
<view class="info-grid"> <view class="info-grid">
<view class="header-row"> <view class="header-row">
<text class="abnormal-id" @click="copyText(detail.abnormalId)">{{ detail.abnormalId }}</text> <text class="abnormal-id"
<text class="time">{{ detail.occurTime }}</text> @click="copyText(detail.orderEventNo)">{{ detail.orderEventNo }}</text>
<text class="time">{{ detail.eventTime }}</text>
</view> </view>
<view class="full-width-item"> <view class="full-width-item">
<text class="label">客户</text> <text class="label">客户</text>
<text class="value">{{ detail.customer }}</text> <text class="value">{{ detail.customerName }}</text>
</view> </view>
<view class="full-width-item"> <view class="full-width-item">
...@@ -36,13 +38,13 @@ ...@@ -36,13 +38,13 @@
<view class="info-row"> <view class="info-row">
<view class="info-col"> <view class="info-col">
<text class="label">处理状态</text> <text class="label">处理状态</text>
<text class="value" :class="getProcessClass(detail.processStatus)"> <text class="value" :class="getProcessClass(detail.orderEventStatus)">
{{ detail.processStatus }} {{ detail.orderEventStatus }}
</text> </text>
</view> </view>
<view class="info-col"> <view class="info-col">
<text class="label">涉及金额</text> <text class="label">涉及金额</text>
<text class="value amount">¥{{ detail.amount }}</text> <text class="value amount">¥{{ detail.involvingAmount }}</text>
</view> </view>
</view> </view>
...@@ -53,7 +55,7 @@ ...@@ -53,7 +55,7 @@
</view> </view>
<view class="info-col"> <view class="info-col">
<text class="label">二级异常</text> <text class="label">二级异常</text>
<text class="value">{{ detail.secondaryAbnormal }}</text> <text class="value">{{ detail.childrenException }}</text>
</view> </view>
</view> </view>
...@@ -78,19 +80,19 @@ ...@@ -78,19 +80,19 @@
<view class="text-area"> <view class="text-area">
<view class="text-item"> <view class="text-item">
<view class="text-label">事件描述</view> <view class="text-label">事件描述</view>
<view class="text-content">{{ detail.description }}</view> <view class="text-content">{{ detail.content }}</view>
</view> </view>
<view class="text-item"> <view class="text-item">
<view class="text-label">围堵措施</view> <view class="text-label">围堵措施</view>
<view class="text-content">{{ detail.measures }}</view> <view class="text-content">{{ detail.containmentMeasure }}</view>
</view> </view>
<view class="text-item"> <view class="text-item">
<view class="text-label">原因分析</view> <view class="text-label">原因分析</view>
<view class="text-content">{{ detail.analysis }}</view> <view class="text-content">{{ detail.reason }}</view>
</view> </view>
<view class="text-item"> <view class="text-item">
<view class="text-label">改善措施</view> <view class="text-label">改善措施</view>
<view class="text-content">{{ detail.improvement }}</view> <view class="text-content">{{ detail.advice }}</view>
</view> </view>
<view class="text-item"> <view class="text-item">
<view class="text-label">备注</view> <view class="text-label">备注</view>
...@@ -104,16 +106,16 @@ ...@@ -104,16 +106,16 @@
<view class="card-title">附件信息</view> <view class="card-title">附件信息</view>
<view class="attachment-area"> <view class="attachment-area">
<!-- 图片展示 --> <!-- 图片展示 -->
<view class="images-list" v-if="detail.images && detail.images.length"> <view class="images-list" v-if="images && images.length">
<view class="image-item" v-for="(img, index) in detail.images" :key="index"> <view class="image-item" v-for="(img, index) in images" :key="index">
<image :src="img" mode="aspectFill" @click="previewImage(img)"></image> <image :src="img" @click="onPreviewImage(index, img)"></image>
</view> </view>
</view> </view>
<!-- 附件列表 --> <!-- 附件列表 -->
<view class="files-list" v-if="detail.files && detail.files.length"> <view class="files-list" v-if="detail.files && detail.files.length">
<view class="file-item" v-for="(file, index) in detail.files" :key="index"> <view class="file-item" v-for="(file, index) in detail.files" :key="index">
<text class="iconfont icon-file"></text> <text class="iconfont icon-file"></text>
<text class="file-name">{{ file.name }}</text> <text class="file-name">{{ file }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -128,41 +130,21 @@ ...@@ -128,41 +130,21 @@
</text> </text>
</view> </view>
</view> </view>
</scroll-view>
</view> </view>
</template> </template>
<script> <script>
export default { import {
searchOrderEventDetail,
downloadImg
} from '../../../api/apiList'
export default {
data() { data() {
return { return {
detail: { detail: {},
abnormalId: 'AB202403200001', images: [],
orderId: 'TR202403200001', files: []
customer: '某某物流有限公司',
startLocation: '上海市浦东新区',
endLocation: '北京市朝阳区',
occurTime: '2024-03-20 09:30',
abnormalType: '运输异常',
secondaryAbnormal: '货物损坏',
amount: '5000.00',
responsible: '承运方',
isKPI: true,
processStatus: '处理中',
description: '货物在运输过程中发生损坏,预计损失金额5000元。',
measures: '已第一时间联系客户,并安排人员前往现场处理。',
analysis: '装卸过程操作不当,导致货物受损。',
improvement: '加强装卸人员培训,完善操作规程。',
remarks: '已与客户达成初步赔偿方案。',
images: [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
],
files: [
{ name: '现场照片.zip', url: 'https://example.com/file1.zip' },
{ name: '处理报告.pdf', url: 'https://example.com/file2.pdf' }
],
approvalStatus: '审批中'
}
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -173,13 +155,23 @@ export default { ...@@ -173,13 +155,23 @@ export default {
}, },
methods: { methods: {
getDetail(id) { getDetail(id) {
// TODO: 调用接口获取详情数据 const data = {
console.log('获取详情数据', id) aux: {
orderEventId: id
}
}
searchOrderEventDetail(data).then(res => {
const data = res.data.data;
this.detail = data;
this.files = data.files;
this.downloadImgs(data.images);
})
}, },
getStatusClass(status) { getStatusClass(status) {
const classMap = { const classMap = {
'未审批': 'status-pending', '未审批': 'status-pending',
'审批中': 'status-processing', '待审批': 'status-processing',
'审批完成': 'status-completed' '审批完成': 'status-completed'
} }
return classMap[status] || '' return classMap[status] || ''
...@@ -192,10 +184,11 @@ export default { ...@@ -192,10 +184,11 @@ export default {
} }
return classMap[status] || '' return classMap[status] || ''
}, },
previewImage(url) { onPreviewImage(index, images) {
console.log("预览图片" + images)
uni.previewImage({ uni.previewImage({
urls: this.detail.images, current: index,
current: url urls: images
}) })
}, },
copyText(text) { copyText(text) {
...@@ -208,13 +201,28 @@ export default { ...@@ -208,13 +201,28 @@ export default {
}) })
} }
}) })
},
downloadImgs(paths) {
console.log("图片下载" + paths)
return new Promise((reslove, reject) => {
if (paths) {
const imgPaths = paths.split('|')
imgPaths.map((path, index) => {
downloadImg(path).then(res => {
this.images = this.images.concat(res)
})
})
} else {
reject()
}
})
},
} }
} }
}
</script> </script>
<style lang="scss"> <style lang="scss">
.abnormal-detail { .abnormal-detail {
padding: 15px; padding: 15px;
background: #f5f7fa; background: #f5f7fa;
min-height: 100vh; min-height: 100vh;
...@@ -224,7 +232,7 @@ export default { ...@@ -224,7 +232,7 @@ export default {
border-radius: 8px; border-radius: 8px;
padding: 0; padding: 0;
margin-bottom: 15px; margin-bottom: 15px;
box-shadow: 0 2px 12px rgba(0,0,0,0.05); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
.card-title { .card-title {
font-size: 16px; font-size: 16px;
...@@ -364,6 +372,7 @@ export default { ...@@ -364,6 +372,7 @@ export default {
.text-area { .text-area {
padding: 20px; padding: 20px;
.text-item { .text-item {
margin-bottom: 20px; margin-bottom: 20px;
...@@ -453,6 +462,7 @@ export default { ...@@ -453,6 +462,7 @@ export default {
.approval-status { .approval-status {
padding: 20px; padding: 20px;
.status-tag { .status-tag {
display: inline-block; display: inline-block;
padding: 6px 16px; padding: 6px 16px;
...@@ -462,5 +472,5 @@ export default { ...@@ -462,5 +472,5 @@ export default {
} }
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -5,18 +5,22 @@ ...@@ -5,18 +5,22 @@
<view class="stat-item" @click="selectReport('new')"> <view class="stat-item" @click="selectReport('new')">
<text class="number" style="color: #faad14;">{{ searchDatas.new }}</text> <text class="number" style="color: #faad14;">{{ searchDatas.new }}</text>
<text class="label">未审批</text> <text class="label">未审批</text>
<text class="number2" style="color: #faad14;">¥{{ searchDatas.newAmount }}</text>
</view> </view>
<view class="stat-item" @click="selectReport('approving')"> <view class="stat-item" @click="selectReport('approving')">
<text class="number" style="color: #1890ff;">{{ searchDatas.approving }}</text> <text class="number" style="color: #1890ff;">{{ searchDatas.approving }}</text>
<text class="label">审批中</text> <text class="label">审批中</text>
<text class="number2" style="color: #1890ff;">¥{{ searchDatas.approvingAmount }}</text>
</view> </view>
<view class="stat-item" @click="selectReport('approved')"> <view class="stat-item" @click="selectReport('approved')">
<text class="number" style="color:#52c41a;">{{ searchDatas.approved }}</text> <text class="number" style="color:#52c41a;">{{ searchDatas.approved }}</text>
<text class="label">审批完成</text> <text class="label">审批完成</text>
<text class="number2" style="color:#52c41a;">¥{{ searchDatas.approvedAmount }}</text>
</view> </view>
<view class="stat-item" @click="selectReport('total')"> <view class="stat-item" @click="selectReport('total')">
<text class="number" style="color:#ff4d4f;">{{ searchDatas.total }}</text> <text class="number" style="color:#ff4d4f;">{{ searchDatas.total }}</text>
<text class="label">总计</text> <text class="label">总计</text>
<text class="number2" style="color:#ff4d4f;">¥{{ searchDatas.totalAmount }}</text>
</view> </view>
</view> </view>
...@@ -32,7 +36,7 @@ ...@@ -32,7 +36,7 @@
{{ order.approvalStatus }} {{ order.approvalStatus }}
</text> </text>
</view> </view>
<text class="time">{{ order.occurTime }}</text> <text class="time">{{ order.eventTime }}</text>
</view> </view>
<view class="card-content"> <view class="card-content">
...@@ -70,7 +74,7 @@ ...@@ -70,7 +74,7 @@
return { return {
staffCode: "", staffCode: "",
staffKind: "", staffKind: "",
activeStatus:"total", activeStatus: "total",
searchDatas: {}, searchDatas: {},
orderList: [] orderList: []
} }
...@@ -79,9 +83,9 @@ ...@@ -79,9 +83,9 @@
this.initData() this.initData()
}, },
methods: { methods: {
selectReport(active){ selectReport(active) {
this.activeStatus=active this.activeStatus = active
this.orderList=[] this.orderList = []
this.initData() this.initData()
}, },
initData() { initData() {
...@@ -152,9 +156,10 @@ ...@@ -152,9 +156,10 @@
.stat-item { .stat-item {
text-align: center; text-align: center;
padding: 15px 24px; // padding: 15px 24px;
background: #f9f9f9; background: #f9f9f9;
border-radius: 6px; border-radius: 6px;
width: 25%;
transition: background 0.3s, transform 0.3s; transition: background 0.3s, transform 0.3s;
/* 添加过渡效果 */ /* 添加过渡效果 */
...@@ -173,6 +178,14 @@ ...@@ -173,6 +178,14 @@
margin-bottom: 8px; margin-bottom: 8px;
} }
.number2 {
display: block;
font-size: 28px;
// font-weight: bold;
color: #333;
margin-bottom: 8px;
}
.label { .label {
font-size: 14px; font-size: 14px;
color: #999; color: #999;
...@@ -241,6 +254,7 @@ ...@@ -241,6 +254,7 @@
.time { .time {
font-size: 14px; font-size: 14px;
color: #999; color: #999;
float: right;
} }
} }
......
...@@ -53,12 +53,10 @@ ...@@ -53,12 +53,10 @@
}, },
onLoad() { onLoad() {
console.log('index页面加载'); // 调试日志 console.log('index页面加载'); // 调试日志
this.uc_staff_kind = uni.getStorageSync(`uc_staff_kind`);
this.getUserInfo() this.updateTopUserList()
this.getBindCompanyResult() // this.getBindCompanyResult()
this.bindGroupChatCompany() // this.bindGroupChatCompany()
}, },
onShow() { onShow() {
...@@ -72,26 +70,23 @@ ...@@ -72,26 +70,23 @@
}, },
methods: { methods: {
updateTopUserList() { updateTopUserList() {
if (this.uc_staff_kind === 'boss') { if (this.uc_staff_kind === 'boss') {
this.topUserList = [{ this.topUserList = [{
name: '订单查询', name: '老板看板',
key: 'orderQuery', key: 'bossCard',
url: '/pages/index/index' url: '/pages/index/index'
}, },
{ {
name: '查看日报', name: '查看日报',
key: 'dailyReport', key: 'dailyReport',
url: '/pages/index/index' url: '/pages/index/index'
}, {
name: '老板看板',
key: 'bossCard',
url: '/pages/index/index'
}, },
]; ];
} else { } else if (this.uc_staff_kind === 'simulatedBoss') {
this.topUserList = [{ this.topUserList = [{
name: '订单查询', name: '老板看板',
key: 'orderQuery', key: 'bossCard',
url: '/pages/index/index' url: '/pages/index/index'
}, },
{ {
...@@ -102,12 +97,14 @@ ...@@ -102,12 +97,14 @@
name: '填写日报', name: '填写日报',
key: 'dailyReportCreate', key: 'dailyReportCreate',
url: '/pages/index/index' url: '/pages/index/index'
}, {
name: '老板看板',
key: 'bossCard',
url: '/pages/index/index'
}, },
]; ];
} else {
this.topUserList = [{
name: '填写日报',
key: 'dailyReportCreate',
url: '/pages/index/index'
}, ]
} }
}, },
...@@ -281,4 +278,4 @@ ...@@ -281,4 +278,4 @@
padding: 0px 12px 12px 12px; padding: 0px 12px 12px 12px;
} }
} }
</style> </style>s
\ No newline at end of file \ No newline at end of file
...@@ -17,6 +17,18 @@ ...@@ -17,6 +17,18 @@
</u-form-item> </u-form-item>
</template> </template>
</u-form> </u-form>
<!-- 复选框:是否记住密码 -->
<view style="width: 690rpx; display: flex; justify-content: space-between;">
<view class="search-input" style="display: flex; align-items: center;">
<u-checkbox-group placement="column" @change="onChanges">
<u-checkbox :checked="isChecked" iconSize="30rpx" shape="square" size="20spx" />
</u-checkbox-group>
<text style="color: black;font-size: 18px;">记住密码</text>
</view>
</view>
<!-- 登录按钮 --> <!-- 登录按钮 -->
<button class="loginBtn font_bolder" @click="submitForm">登录</button> <button class="loginBtn font_bolder" @click="submitForm">登录</button>
</view> </view>
...@@ -24,11 +36,20 @@ ...@@ -24,11 +36,20 @@
</template> </template>
<script> <script>
import { TokenPrefix, MINI } from '../../publicConfig/config.js' import {
import { userLogin, SendMessage } from '../../api/apiList.js'
const loginBehavior = require('../../mixins/loginBehavior.js') TokenPrefix,
MINI
export default { } from '../../publicConfig/config.js'
import {
userMobileOperation,
selectStaffByUsername,
userLogin,
SendMessage
} from '../../api/apiList.js'
const loginBehavior = require('../../mixins/loginBehavior.js')
export default {
mixins: [loginBehavior], mixins: [loginBehavior],
data() { data() {
return { return {
...@@ -42,14 +63,42 @@ export default { ...@@ -42,14 +63,42 @@ export default {
isVerifLogin: false, //是否为验证码登录 isVerifLogin: false, //是否为验证码登录
tips: '获取验证码', tips: '获取验证码',
disabled: false, //是否禁用获取验证码 disabled: false, //是否禁用获取验证码
rememberMe: false, // 复选框的状态
isChecked: false,
username: ""
} }
}, },
onLoad() { onLoad() {
this.loginBg = 'static/img/bg/loginBg.png' this.loginBg = 'static/img/bg/loginBg.png'
this.projectMini = getApp().globalData.projectMini this.projectMini = getApp().globalData.projectMini
this.rememberPd()
}, },
methods: { methods: {
rememberPd() {
let _this = this
// 赋值操作
var isCheckedS = wx.getStorageSync('isChecked'); //通过缓存获取密码
console.log("rememberPd ischeck" + isCheckedS)
if (isCheckedS) { //如果记住账号密码为true,则赋值
this.formData.userName = wx.getStorageSync('username2')
console.log("rememberPd username2" + wx.getStorageSync('username2'))
this.formData.password = wx.getStorageSync('password')
_this.isChecked = isCheckedS
} else { //用户没有勾选“记住密码”
// 清除缓存,并将输入框置为空
wx.setStorageSync('username2', '');
wx.setStorageSync('password', '');
wx.setStorageSync('isChecked', false);
this.formData.userName = "";
this.formData.password = "";
this.isChecked = false;
}
},
onChanges() {
this.isChecked = !this.isChecked;
wx.setStorageSync('isChecked', this.isChecked)
},
//手机验证码登录 //手机验证码登录
chooseVerifLogin() { chooseVerifLogin() {
...@@ -100,16 +149,45 @@ export default { ...@@ -100,16 +149,45 @@ export default {
//确认提交 //确认提交
submitForm() { submitForm() {
const { userName, password, phone, authCode } = this.formData const {
userName,
password,
phone,
authCode
} = this.formData
if (!this.onSubmitBeforeRule(userName, password, phone, authCode)) return //规则校验 if (!this.onSubmitBeforeRule(userName, password, phone, authCode)) return //规则校验
let { projectMini } = getApp().globalData let {
projectMini
} = getApp().globalData
let loginAction = 'loginByUserInfo' let loginAction = 'loginByUserInfo'
let reqData = { entryName: projectMini } let reqData = {
entryName: projectMini
}
if (this.isVerifLogin) { if (this.isVerifLogin) {
reqData = { ...reqData, params: { phone, authCode } } reqData = {
...reqData,
params: {
phone,
authCode
}
}
loginAction = 'loginByCustomAuth' loginAction = 'loginByCustomAuth'
} else { } else {
reqData = { ...reqData, userName, password } reqData = {
...reqData,
userName,
password
}
}
console.log("isChecked" + this.isChecked)
if (this.isChecked) {
// 记住密码的逻辑
console.log("isChecked" + this.formData.userName)
uni.setStorageSync('username2', this.formData.userName);
uni.setStorageSync('password', this.formData.password);
} else {
// 清除存储的密码
uni.removeStorageSync('password');
} }
this.h5Login(reqData, loginAction) this.h5Login(reqData, loginAction)
}, },
...@@ -117,10 +195,14 @@ export default { ...@@ -117,10 +195,14 @@ export default {
//H5提交 //H5提交
h5Login(reqData, loginAction) { h5Login(reqData, loginAction) {
// uni.setStorageSync(`staffCode`,"");
uni.setStorageSync(`uc_staff_kind`, "");
const _this = this const _this = this
let newCode = '' let newCode = ''
const { code } = _this.getH5Code() const {
code
} = _this.getH5Code()
newCode = code newCode = code
userLogin(loginAction, newCode, reqData).then(res => { userLogin(loginAction, newCode, reqData).then(res => {
let token = res.data.renewedToken let token = res.data.renewedToken
...@@ -131,10 +213,31 @@ export default { ...@@ -131,10 +213,31 @@ export default {
title: '登录成功!', title: '登录成功!',
duration: 1000 duration: 1000
}) })
userMobileOperation('getUserInfo').then(res => {
let data = res.data.data
data.mobile = data.userExt.mobile || '暂无'
this.username = data.username
uni.setStorageSync(`username`, data.username);
uni.setStorageSync(`commonName`, res.data.data.commonName);
const staffData = {
"aux": {
"username": this.username
}
}
selectStaffByUsername(staffData).then(res => {
let data2 = res.data.data
uni.setStorageSync(`staffCode`, data2.staffCode);
uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind);
uni.redirectTo({ uni.redirectTo({
url: "/pages/index/index", url: "/pages/index/index",
}) })
_this.initWeCom() _this.initWeCom()
})
})
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
...@@ -144,6 +247,9 @@ export default { ...@@ -144,6 +247,9 @@ export default {
}) })
}) })
}, },
getUserInfo() {
},
//提示文本 //提示文本
onTipsChange(text) { onTipsChange(text) {
...@@ -154,11 +260,11 @@ export default { ...@@ -154,11 +260,11 @@ export default {
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.content_box { .content_box {
color: #FFFFFF; color: #FFFFFF;
letter-spacing: 6rpx; letter-spacing: 6rpx;
background-size: 100%; background-size: 100%;
...@@ -245,6 +351,17 @@ export default { ...@@ -245,6 +351,17 @@ export default {
} }
} }
.remember-me {
margin-bottom: 20px; // 添加底部间距
display: flex; // 使用 flex 布局
align-items: center; // 垂直居中
}
.remember-checkbox {
color: black; // 设置复选框字体颜色为黑色
font-size: 14px; // 设置字体大小
z-index: 999;
}
// .user-agreement { // .user-agreement {
// margin-bottom: 95rpx; // margin-bottom: 95rpx;
...@@ -306,5 +423,5 @@ export default { ...@@ -306,5 +423,5 @@ export default {
background: linear-gradient(90deg, #2E75E6 0%, #5E58EE 100%); background: linear-gradient(90deg, #2E75E6 0%, #5E58EE 100%);
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -10,7 +10,7 @@ let BASEURL = { ...@@ -10,7 +10,7 @@ let BASEURL = {
// url: 'http://192.168.0.230:8080' // xiaohan // url: 'http://192.168.0.230:8080' // xiaohan
// url: "https://botms-demo.logwirecloud.com", // url: "https://botms-demo.logwirecloud.com",
url: "http://localhost:8083", //开发 url: "http://localhost:8083", //开发
// url: "http://122.112.220.204:8089", //开发/ // url: "http://122.112.220.204:8089", //开发
// url: "https://stms.bjzc-scs.com", //生产 // url: "https://stms.bjzc-scs.com", //生产
}; };
......
...@@ -3,83 +3,83 @@ ...@@ -3,83 +3,83 @@
"@amap/amap-jsapi-loader@^1.0.1": "@amap/amap-jsapi-loader@^1.0.1":
version "1.0.1" "integrity" "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
resolved "https://mirrors.cloud.tencent.com/npm/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz"
integrity sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw== "version" "1.0.1"
"@babel/runtime@^7.17.2": "@babel/runtime@^7.17.2":
version "7.26.7" "integrity" "sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ=="
resolved "https://mirrors.cloud.tencent.com/npm/@babel/runtime/-/runtime-7.26.7.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/@babel/runtime/-/runtime-7.26.7.tgz"
integrity sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ== "version" "7.26.7"
dependencies: dependencies:
regenerator-runtime "^0.14.0" "regenerator-runtime" "^0.14.0"
"@dcloudio/uni-ui@^1.5.7": "@dcloudio/uni-ui@^1.5.7":
version "1.5.7" "integrity" "sha512-DugxSIrQrze1FLdUOj9a+JEQ0bHGjnJTcGUK1mN/MivKg7nuKJBRWk5Ipa9sUdoBznX6ndz5h2e7Uao6x1CdCw=="
resolved "https://mirrors.cloud.tencent.com/npm/@dcloudio/uni-ui/-/uni-ui-1.5.7.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/@dcloudio/uni-ui/-/uni-ui-1.5.7.tgz"
integrity sha512-DugxSIrQrze1FLdUOj9a+JEQ0bHGjnJTcGUK1mN/MivKg7nuKJBRWk5Ipa9sUdoBznX6ndz5h2e7Uao6x1CdCw== "version" "1.5.7"
"@wecom/jssdk@^2.1.0": "@wecom/jssdk@^2.1.0":
version "2.2.5" "integrity" "sha512-qOBAsfqaiYM8jZHWYs/atHSpJhsLdZVNaxHQdmEQ7ZWul/GZMt4P5VY8Nf7GII7GhG8z/k+r37Dto6qtAaRqow=="
resolved "https://mirrors.cloud.tencent.com/npm/@wecom/jssdk/-/jssdk-2.2.5.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/@wecom/jssdk/-/jssdk-2.2.5.tgz"
integrity sha512-qOBAsfqaiYM8jZHWYs/atHSpJhsLdZVNaxHQdmEQ7ZWul/GZMt4P5VY8Nf7GII7GhG8z/k+r37Dto6qtAaRqow== "version" "2.2.5"
copy-text-to-clipboard@^3.0.1: "copy-text-to-clipboard@^3.0.1":
version "3.2.0" "integrity" "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q=="
resolved "https://mirrors.cloud.tencent.com/npm/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz"
integrity sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q== "version" "3.2.0"
core-js@^3.11.0: "core-js@^3.11.0":
version "3.40.0" "integrity" "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ=="
resolved "https://mirrors.cloud.tencent.com/npm/core-js/-/core-js-3.40.0.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/core-js/-/core-js-3.40.0.tgz"
integrity sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ== "version" "3.40.0"
echarts@^5.6.0: "echarts@^5.6.0":
version "5.6.0" "integrity" "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA=="
resolved "https://mirrors.cloud.tencent.com/npm/echarts/-/echarts-5.6.0.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/echarts/-/echarts-5.6.0.tgz"
integrity sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA== "version" "5.6.0"
dependencies: dependencies:
tslib "2.3.0" "tslib" "2.3.0"
zrender "5.6.1" "zrender" "5.6.1"
jweixin-module@^1.6.0: "jweixin-module@^1.6.0":
version "1.6.0" "integrity" "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
resolved "https://mirrors.cloud.tencent.com/npm/jweixin-module/-/jweixin-module-1.6.0.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/jweixin-module/-/jweixin-module-1.6.0.tgz"
integrity sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w== "version" "1.6.0"
mutation-observer@^1.0.3: "mutation-observer@^1.0.3":
version "1.0.3" "integrity" "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
resolved "https://mirrors.cloud.tencent.com/npm/mutation-observer/-/mutation-observer-1.0.3.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/mutation-observer/-/mutation-observer-1.0.3.tgz"
integrity sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA== "version" "1.0.3"
regenerator-runtime@^0.14.0: "regenerator-runtime@^0.14.0":
version "0.14.1" "integrity" "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
resolved "https://mirrors.cloud.tencent.com/npm/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== "version" "0.14.1"
tslib@2.3.0: "tslib@2.3.0":
version "2.3.0" "integrity" "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
resolved "https://mirrors.cloud.tencent.com/npm/tslib/-/tslib-2.3.0.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/tslib/-/tslib-2.3.0.tgz"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== "version" "2.3.0"
uview-ui@^2.0.31: "uview-ui@^2.0.31":
version "2.0.31" "integrity" "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw=="
resolved "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.31.tgz" "resolved" "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.31.tgz"
integrity sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw== "version" "2.0.31"
vconsole@^3.15.0: "vconsole@^3.15.0":
version "3.15.1" "integrity" "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g=="
resolved "https://mirrors.cloud.tencent.com/npm/vconsole/-/vconsole-3.15.1.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/vconsole/-/vconsole-3.15.1.tgz"
integrity sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g== "version" "3.15.1"
dependencies: dependencies:
"@babel/runtime" "^7.17.2" "@babel/runtime" "^7.17.2"
copy-text-to-clipboard "^3.0.1" "copy-text-to-clipboard" "^3.0.1"
core-js "^3.11.0" "core-js" "^3.11.0"
mutation-observer "^1.0.3" "mutation-observer" "^1.0.3"
zrender@5.6.1: "zrender@5.6.1":
version "5.6.1" "integrity" "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag=="
resolved "https://mirrors.cloud.tencent.com/npm/zrender/-/zrender-5.6.1.tgz" "resolved" "https://mirrors.cloud.tencent.com/npm/zrender/-/zrender-5.6.1.tgz"
integrity sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag== "version" "5.6.1"
dependencies: dependencies:
tslib "2.3.0" "tslib" "2.3.0"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment