Commit 0c6ff6c8 by 前端

Merge branch 'SAAS+V5.7.1' into 'master'

上线合并

See merge request !2
2 parents 93877bd2 5e7dab3e
......@@ -24,5 +24,5 @@
<% } %>
<!-- built files will be auto injected -->
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
</html>
......@@ -13,6 +13,7 @@
</div>
</template>
<script>
import { wxConfig } from '@/api'
export default {
name: 'App',
data () {
......@@ -34,7 +35,12 @@ export default {
return this.$store.state.app.showWindow
}
},
mounted () { },
mounted () {
wxConfig.init(['hideOptionMenu']).then(res => {
wx.hideOptionMenu()
})
},
methods: {}
}
......
......@@ -8,8 +8,10 @@
*/
import ssoApi from './ssoApi'
import reportApi from './reportApi'
import wxConfig from './wxConfig'
export {
ssoApi,
reportApi,
wxConfig,
}
\ No newline at end of file
......@@ -45,12 +45,12 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn
Vue.use(cfg)
window.$fetchConfig = res
// if (res.vconsole) new VConsole()
if (res.vconsole) new VConsole()
/**登录过期 重新登录 */
window.reLogin = () => {
util.removeLocalStorage('ww_userInfo')
util.clearSessionId()
store.dispatch('navigation')
store.dispatch('navigation', true)
}
window.vm = new Vue({
el: '#app',
......
......@@ -114,8 +114,9 @@ export default {
})
},
shareReport () {
const { reportStartDate, reportEndDate, reportType, corpId } = this.query
utils.setClipboardData(`${window.location.origin}/#/mobile/report?reportStartDate=${reportStartDate}&reportEndDate=${reportEndDate}&reportType=${reportType}&corpId=${corpId}`, '链接复制成功,快去粘贴吧~')
const { reportStartDate, reportEndDate, reportType, corpId } = this.query,
url = window.$fetchConfig.shareReportUrl
utils.setClipboardData(`${url}?reportStartDate=${reportStartDate}&reportEndDate=${reportEndDate}&reportType=${reportType}&corpId=${corpId}`, '链接复制成功,快去粘贴吧~',true)
window.parent.postMessage(
{ type: 'COPY_SUCCESS' },
'*'
......
export const mobilePages = {
mobile: [
{
name: 'settings'
name: 'settings',
},
{
name: 'report',
......@@ -23,6 +23,12 @@ export const mobilePages = {
meta: {
noAuth: true
}
},
{
name:'aiWebView',
meta: {
noAuth: true
}
}
]
}
......@@ -34,6 +34,7 @@ function createRouter () {
router.beforeEach((to, from, next) => {
const ua = navigator.userAgent.toLowerCase()
const isWxWork = ua.includes('wxwork')
const { devOff } = window.$fetchConfig
store.commit('SET_LAST_PATH', to.name)
/* 路由发生变化修改页面title */
store.dispatch('setPageMeta', to.meta)
......@@ -45,8 +46,8 @@ router.beforeEach((to, from, next) => {
store.state.app.showWindow = true
store.dispatch('registerHttp')
} else {
if (!isWxWork && to.name !== 'notWxWork') return next('/mobile/notWxWork') //上线打开
store.dispatch('navigation', to)
if (!isWxWork && to.name !== 'notWxWork' && !devOff) return next('/mobile/notWxWork')
store.dispatch('navigation')
}
next()
})
......
......@@ -74,7 +74,8 @@ const actions = {
})
if (corpInfo) {
const { agentId } = corpInfo
window.location.href = `${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}&backLoginCode=BACKCODE`
// window.location.href = `${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}&backLoginCode=BACKCODE`
window.location.replace(`${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}&backLoginCode=BACKCODE`)
} else throw '获取企业信息失败'
console.log(corpInfo)
}
......@@ -83,7 +84,7 @@ const actions = {
if (error) Notify(typeof error === 'string' ? error : error.toString())
}
},
navigation ({ dispatch }, to) {
navigation ({ dispatch }, isReLogin) {
let { corpId, sessionId } = getParams(),
userInfo = util.getLocalStorage('ww_userInfo')
dispatch('registerHttp', sessionId || '')
......@@ -92,10 +93,13 @@ const actions = {
ww_storage_info.corpId = corpId
util.setLocalStorage('ww_storage_info', ww_storage_info)
}
if (userInfo) {
if (isReLogin) {
dispatch('login')
return
}
if (userInfo || sessionId) {
state.showWindow = true
} else {
util.showLoading()
dispatch('login')
}
}
......
......@@ -120,7 +120,7 @@ const jumpChildrenPage = (to, params) => {
}
/**拷贝 */
const setClipboardData = (data, tips) => {
const setClipboardData = (data, tips, hideToast) => {
let transfer = document.createElement('input')
document.body.appendChild(transfer)
transfer.value = data
......@@ -128,7 +128,7 @@ const setClipboardData = (data, tips) => {
transfer.select()
if (document.execCommand('copy')) document.execCommand('copy')
transfer.blur()
Toast(tips || '内容已复制')
if (!hideToast) Toast(tips || '内容已复制')
document.body.removeChild(transfer)
}
......
<template>
<iframe
:src="src"
frameborder="0"
width="100%"
height="100%"
></iframe>
</template>
<script type='text/ecmascript-6'>
import { util } from 'utils'
export default {
name: '',
data () {
return {
src: ''
}
},
mounted () {
document.title = 'AI智能问数'
let baseUrl = window.$fetchConfig.aiDataLink;
let { phone, staffUuid, role_type, sessionId, corpId } = util.getQuery()
this.src = `${baseUrl}?platformType=1&domain=https://aiassistant.glsx.com.cn&phone=${phone}&staffUuid=${staffUuid}&role_type=${role_type}&sessionId=${sessionId}&corpId=${corpId}`
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file
<template>
<div class="report-component " :class="{ 'is-card': isCard }">
<div
class="report-component "
:class="{ 'is-card': isCard }"
>
<template v-if="reportIndex == 1">
<div class="date">统计周期:{{dayjs(reportItem.reportStartDate).format('YYYY年M月')}} ({{ reportItem.reportStartDate }}至{{ reportItem.reportEndDate }})</div>
</template>
......@@ -32,10 +35,12 @@
<!-- 1.2 业务数据汇总 -->
<div class="sub-title">{{ reportIndex }}.2 业务数据汇总</div>
<template v-for="(b,bindex) in reportItem.brandList">
<div
:key="'b'+ bindex"
class="business-data"
>
<div class="brand-title">🚗 {{ b.brandName }}</div>
<div class="data-table">
<table>
<thead>
......@@ -83,8 +88,10 @@
<span class="dot">●</span>
整体结论
</div>
<div class="content-text">
{{ b.overallConclusion || '暂无整体结论' }}
<div
class="content-text"
v-html="formatText(b.overallConclusion)"
>
</div>
<!-- 行动建议 -->
......@@ -92,8 +99,10 @@
<span class="dot">●</span>
行动建议
</div>
<div class="content-text">
{{ b.actionSuggestion || '暂无行动建议' }}
<div
class="content-text"
v-html="formatText(b.actionSuggestion)"
>
</div>
</div>
</template>
......@@ -143,6 +152,12 @@ export default {
}
},
methods: {
// 格式化文本,将 \n 转换为 <br>
formatText (text) {
if (!text) return '暂无内容'
// 将换行符转换为 <br> 标签
return text.replace(/\n/g, '<br>')
},
// 格式化变化值
formatChange (value) {
if (value === null || value === undefined) return '-'
......@@ -182,7 +197,13 @@ export default {
font-size: 14px;
margin-bottom: 8px;
}
.brand-title{
height: 20px;
color: #133368;
font-size: 14px;
font-weight: 500;
margin-bottom: 12px;
}
// 门店数据汇总
.merchant-list {
display: flex;
......@@ -230,7 +251,7 @@ export default {
margin-bottom: 16px;
border-radius: 8px;
overflow: auto;
border: 1px solid #D8E6F0;
border: 1px solid #d8e6f0;
table {
width: 100%;
......@@ -246,7 +267,7 @@ export default {
text-align: left;
font-weight: 600;
color: #333;
border: 1px solid #D8E6F0;
border: 1px solid #d8e6f0;
border-top: none;
&:first-child {
......@@ -263,11 +284,11 @@ export default {
tbody {
tr {
background: #fff;
td{
border-left: none !important;
&:last-child {
border-right: none !important;
}
td {
border-left: none !important;
&:last-child {
border-right: none !important;
}
}
&:last-child {
td {
......@@ -277,13 +298,11 @@ export default {
}
}
}
td {
padding: 6px 8px;
text-align: left;
border: 1px solid #D8E6F0;
border: 1px solid #d8e6f0;
&.change-up {
color: #ff2d55;
......@@ -326,10 +345,30 @@ export default {
}
}
.is-card{
.content-text,.section-title{
font-size: 15.31px;
.is-card {
.date {
font-size: 14.31px !important;
}
.content-text,
.section-title,
.business-title,
.sub-title {
font-size: 15.31px !important;
}
.merchant-list .merchant-item {
.value{
font-size: 19.68px !important;
}
.label,
.unit {
font-size: 15.31px !important;
}
}
.data-table table{
font-size: 14.31px !important;
}
.brand-title{
font-size: 15.31px !important;
}
}
</style>
\ No newline at end of file
......@@ -54,7 +54,8 @@ export default {
let userInfo = util.getLocalStorage('ww_userInfo');
let sessionId = util.getSessionId();
let { phone, uuid, loginRole } = userInfo
window.open(`${baseUrl}?phone=${phone}&uuid=${uuid}&loginRole=${loginRole}&sessionId=${sessionId}&corpId=${corpId}`)
// window.open(`${baseUrl}?platformType=1&domain=https://aiassistant.glsx.com.cn&phone=${phone}&staffUuid=${uuid}&role_type=${loginRole}&sessionId=${sessionId}&corpId=${corpId}`)
window.location.href = `${baseUrl}?platformType=1&domain=https://aiassistant.glsx.com.cn&phone=${phone}&staffUuid=${uuid}&role_type=${loginRole}&sessionId=${sessionId}&corpId=${corpId}`
} catch (error) {
console.log(error)
}
......
......@@ -50,11 +50,20 @@ export default {
return 150
}
// 存储 reportId
let currentReportId = ''
window.addEventListener('message', function (event) {
if (event.data && event.data.type === 'GET_IFRAME_HEIGHT') {
// 保存 reportId
currentReportId = event.data.reportId || ''
// 发送 report-card 的高度给父页面
window.parent.postMessage(
{ type: 'RESIZE_IFRAME', height: getReportCardHeight() },
{
type: 'RESIZE_IFRAME',
height: getReportCardHeight(),
reportId: currentReportId
},
'*'
)
}
......@@ -64,7 +73,11 @@ export default {
window.addEventListener('load', function () {
setTimeout(function () {
window.parent.postMessage(
{ type: 'RESIZE_IFRAME', height: getReportCardHeight() },
{
type: 'RESIZE_IFRAME',
height: getReportCardHeight(),
reportId: currentReportId
},
'*'
)
}, 200)
......@@ -73,7 +86,11 @@ export default {
// 监听 DOM 变化,动态调整高度
const observer = new MutationObserver(function () {
window.parent.postMessage(
{ type: 'RESIZE_IFRAME', height: getReportCardHeight() },
{
type: 'RESIZE_IFRAME',
height: getReportCardHeight(),
reportId: currentReportId
},
'*'
)
})
......
......@@ -15,6 +15,7 @@
active-color="#0088FF"
size="18"
@change="switchChange($event, '展业周报', 'updateWeeklySubscribeStatus')"
inactive-color="#E6E6E6"
/>
</div>
......@@ -26,6 +27,7 @@
active-color="#0088FF"
size="18"
@change="switchChange($event, '展业月报','updateMonthlySubscribeStatus')"
inactive-color="#E6E6E6"
/>
</div>
</div>
......
......@@ -27,7 +27,7 @@ const spritesmithFunction = data => {
module.exports = {
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-zhangls/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
......@@ -35,7 +35,7 @@ module.exports = {
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: {
disableHostCheck: true,
port: 8081, // 端口 dj-scrm-wx-work-lwk
port: 9527, // 端口 dj-scrm-wx-work-lwk
// port: 9528, // 端口 dj-scrm-wx-work-main-lwk
open: false, // 启动后打开浏览器.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!