Browse Source

聊天

master
parent
commit
d7223d174f
  1. 69
      App.vue
  2. 30
      components/cs-echart/index.vue
  3. 23
      components/cs-page/index.vue
  4. 2
      manifest.json
  5. 54
      pages.json
  6. 14
      pages/chat.vue
  7. 5
      pages/enterprise.vue
  8. 2
      pages/index.vue
  9. 4
      pages/owner.vue
  10. 7
      pages/task.vue
  11. 45
      static/echarts.esm.min.mjs
  12. BIN
      static/images/enterprise/zz.png
  13. 4
      sub/chat/index.vue
  14. 173
      sub/task/detail.vue
  15. 3
      uni.scss
  16. 45
      uni_modules/s-echarts/echarts.min.js

69
App.vue

@ -4,7 +4,15 @@ import store from '@/store'
import { getAccessToken } from '@/utils/auth'
export default {
onLaunch: function () {
data() {
return {
invateId: ''
}
},
onLaunch: function (options) {
if (options.query.invateId) {
this.invateId = options.query.invateId
}
this.initApp()
},
methods: {
@ -24,10 +32,65 @@ export default {
},
checkLogin() {
if (!getAccessToken()) {
this.$tab.reLaunch('/pages/login')
this.login()
} else {
this.$store.dispatch('GetInfo')
this.loginSuccess()
}
},
login() {
uni.login({
success: res => {
const data = {
type: 34,
code: res.code,
state: 'default',
userType: this.getUserType()
}
//
this.$store.dispatch('Login', data).then(() => {
this.loginSuccess()
})
}
})
},
getUserType() {
//
if (this.invateId) return 2
// if (this.type == 'internal') return 3
// return 1
return 3
},
loginSuccess() {
this.$store.dispatch('GetInfo').then(res => {
this.handlerNavigateTo(res.data.user)
})
},
handlerNavigateTo(user) {
//
if (this.invateId) {
uni.navigateTo({
url: `/sub/enterprise/edit?invateId=${this.invateId}`
})
return
}
//
if (user.audit == 1) {
uni.navigateTo({
url: '/sub/common/waiting'
})
return
}
//
if (user.audit == 2) {
return
}
//
uni.navigateTo({
url: '/sub/owner/edit'
})
}
}
}

30
components/cs-echart/index.vue

@ -0,0 +1,30 @@
<template>
<view ref="echartRef" id="chart"></view>
</template>
<script>
import * as echarts from '@/uni_modules/s-echarts/echarts.min.js'
export default {
name: 'cs-echart',
data() {
return {
echart: null
}
},
mounted() {
this.init()
},
methods: {
init() {
this.echart = echarts.init(this.$refs.echartRef)
}
}
}
</script>
<style lang="scss" scoped>
.chart {
width: 100%;
height: 100%;
}
</style>

23
components/cs-page/index.vue

@ -1,14 +1,19 @@
<template>
<view class="container">
<s-header :title="title" :isTab="isTab" :isCustom="isCustom" @goback="$emit('goback')">
<slot name="header"></slot>
</s-header>
<view class="view">
<view class="inner">
<slot></slot>
<view class="">
<view class="container" v-if="isTab">
<s-header :title="title" :isTab="isTab" :isCustom="isCustom" @goback="$emit('goback')">
<slot name="header"></slot>
</s-header>
<view class="view">
<view class="inner">
<slot></slot>
</view>
</view>
<s-tabber :selected="selected" :isTab="isTab" v-if="isTab" />
</view>
<view v-else>
<slot></slot>
</view>
<s-tabber :selected="selected" :isTab="isTab" />
</view>
</template>
@ -43,6 +48,8 @@ export default {
overflow: hidden;
.view {
position: relative;
width: 100%;
height: 100%;
.inner {
position: absolute;
overflow: hidden;

2
manifest.json

@ -41,7 +41,7 @@
},
"quickapp": {},
"mp-weixin": {
"appid": "wx6a07542e99f7fc98",
"appid": "wx6d80755768234f3b",
"setting": {
"urlCheck": false,
"es6": true,

54
pages.json

@ -2,18 +2,21 @@
"pages": [{
"path": "pages/index",
"style": {
"navigationBarTitleText": "首页"
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}
}, {
"path": "pages/login",
"style": {
"navigationBarTitleText": "登录"
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
},
{
"path": "pages/enterprise",
"style": {
"navigationBarTitleText": "企业",
"navigationStyle": "custom",
"usingComponents": {
"van-dropdown-menu": "/wxcomponents/vant/dropdown-menu/index",
"van-dropdown-item": "/wxcomponents/vant/dropdown-item/index",
@ -24,13 +27,15 @@
{
"path": "pages/chat",
"style": {
"navigationBarTitleText": "聊天"
"navigationBarTitleText": "聊天",
"navigationStyle": "custom"
}
},
{
"path": "pages/task",
"style": {
"navigationBarTitleText": "任务",
"navigationStyle": "custom",
"usingComponents": {
"van-dropdown-menu": "/wxcomponents/vant/dropdown-menu/index",
"van-dropdown-item": "/wxcomponents/vant/dropdown-item/index",
@ -41,7 +46,8 @@
{
"path": "pages/owner",
"style": {
"navigationBarTitleText": "个人中心"
"navigationBarTitleText": "个人中心",
"navigationStyle": "custom"
}
}
],
@ -55,19 +61,40 @@
"subPackages": [{
"root": "sub",
"pages": [{
"path": "owner/edit"
"path": "owner/edit",
"style": {
"navigationBarTitleText": "个人信息"
}
}, {
"path": "owner/invite"
"path": "owner/invite",
"style": {
"navigationBarTitleText": "邀请企业"
}
}, {
"path": "enterprise/edit"
"path": "enterprise/edit",
"style": {
"navigationBarTitleText": "企业填报"
}
}, {
"path": "common/waiting"
"path": "common/waiting",
"style": {
"navigationBarTitleText": ""
}
}, {
"path": "enterprise/detail"
"path": "enterprise/detail",
"style": {
"navigationBarTitleText": "企业详情"
}
}, {
"path": "chat/index"
"path": "chat/index",
"style": {
"navigationBarTitleText": "智慧生态"
}
}, {
"path": "task/detail"
"path": "task/detail",
"style": {
"navigationBarTitleText": "任务详情"
}
}]
}],
"tabBar": {
@ -89,6 +116,9 @@
]
},
"globalStyle": {
"navigationStyle": "custom"
"navigationBarTextStyle": "black",
"navigationBarTitleText": "智慧生态",
"navigationBarBackgroundColor": "#FFF",
"backgroundColor": "#FFF"
}
}

14
pages/chat.vue

@ -1,5 +1,7 @@
<template>
<cs-page :selected="2" isTab title="智慧生态"></cs-page>
<cs-page :selected="2" isTab title="智慧生态">
<view class="chat-container"></view>
</cs-page>
</template>
<script>
@ -8,11 +10,17 @@ export default {
return {}
},
onShow() {
uni.navigateTo({
uni.reLaunch({
url: '/sub/chat/index'
})
}
}
</script>
<style lang="scss"></style>
<style lang="scss" scoped>
.chat-container {
height: 100vh;
width: 100vw;
background: linear-gradient(180deg, #02815b 0%, #114636 100%);
}
</style>

5
pages/enterprise.vue

@ -63,7 +63,10 @@
<u-avatar :src="enterprise.files[0].url" shape="square" size="64"></u-avatar>
<view class="wd-flex wd-flex-col" style="gap: 4px">
<text class="wd-font-800 wd-text-15">{{ enterprise.enterprisesName }}</text>
<text class="address wd-text-12">{{ enterprise.address }}</text>
<view class="wd-flex wd-pb-8px">
<u-icon name="map" size="14" color="#17C653"></u-icon>
<text class="address wd-text-12" style="margin-left: 4px">{{ enterprise.address }}</text>
</view>
<view class="tagList">
<view class="tag" v-for="(tag, index) in enterprise.tagList" :key="index">
{{ tag }}

2
pages/index.vue

@ -1,5 +1,5 @@
<template>
<cs-page :selected="0" title="智慧环保" isTab></cs-page>
<cs-page :selected="0" title="智慧生态" isTab></cs-page>
</template>
<script>

4
pages/owner.vue

@ -93,8 +93,8 @@ export default {
},
invite() {
uni.navigateTo({
// url: '/sub/owner/invite'
url: '/sub/enterprise/edit'
url: '/sub/owner/invite'
// url: '/sub/enterprise/edit'
})
}
}

7
pages/task.vue

@ -61,8 +61,11 @@
</template>
</van-circle>
<view class="wd-flex wd-flex-col" style="gap: 4px">
<text class="wd-font-800 wd-text-15">{{ enterprise.enterprisesName }}</text>
<text class="address wd-text-12">{{ enterprise.address }}</text>
<text class="wd-font-800 wd-text-15 wd-pb-2px">{{ enterprise.enterprisesName }}</text>
<view class="wd-flex wd-pb-8px">
<u-icon name="clock" size="14" color="#17C653"></u-icon>
<text class="address wd-text-12" style="margin-left: 4px">于2024年12月15日结束</text>
</view>
<view class="tagList">
<view class="tag" v-for="(tag, index) in enterprise.tagList" :key="index">
{{ tag }}

45
static/echarts.esm.min.mjs

File diff suppressed because one or more lines are too long

BIN
static/images/enterprise/zz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

4
sub/chat/index.vue

@ -1,7 +1,5 @@
<template>
<view class="chat-container">
<web-view :webview-styles="webviewStyles" src="https://mb.jzce.com/ui/chat/313cf9e35628923a"></web-view>
</view>
<web-view src="https://mb.jzce.com/chat/313cf9e35628923a"></web-view>
</template>
<script>

173
sub/task/detail.vue

@ -0,0 +1,173 @@
<template>
<cs-page>
<view class="detail-container">
<view class="box detail">
<text class="wd-font-800 wd-text-16" style="margin-bottom: 4px">xxxx</text>
<view class="tagList">
<view v-for="(item, index) in 3" :key="index" class="tag">标签{{ index }}</view>
</view>
<view class="wd-flex wd-text-13" style="justify-content: space-between">
<view class="wd-flex" style="align-items: center; gap: 4px">
<u-icon name="calendar" color="#17C653" />
<text class="wd-text-13 wd-ml-4px">2024/12/15~2025/12/15</text>
</view>
<view class="wd-flex" style="align-items: center; gap: 4px">
<u-icon name="account" color="#17C653" />
<text class="wd-text-13 wd-font-800">姓名</text>
<text class="wd-text-13">部门</text>
</view>
</view>
<view class="" style="font-size: 13px; line-height: 160%">
任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求任务要求
</view>
<view class="audit">111</view>
</view>
<scroll-view scroll-y="true" class="list">
<view class="record" v-for="record in 10" :key="record.id">
<view :class="{ select: true, isSelect: false }" @tap="select()">
<u-icon name="checkbox-mark" size="16px" color="#fff"></u-icon>
</view>
<view class="info">
<view class="name">义县某某环保企业名称</view>
<view style="font-size: 13px">某某区工业产业园5-182</view>
<view class="tagList" style="margin-top: 8px">
<view v-for="(item, index) in 3" :key="index" class="tag">标签{{ index }}</view>
</view>
</view>
<view class="audit">111</view>
</view>
<u-loadmore :status="load" marginTop="20" />
</scroll-view>
</view>
</cs-page>
</template>
<script>
import { getEnterPrise } from '@/api/enterprise/index.js'
import { getDictBatchByType } from '@/api/system/dict.js'
export default {
data() {
return {
detail: {
id: ''
},
isSelect: false,
dictMap: {}
}
},
onLoad(res) {
if (res.id) {
this.detail.id = res.id
}
// this.getDict()
this.init()
},
methods: {
/**
* 获取字典
*/
async getDict() {
const dict = await getDictBatchByType({ type: ['enterprises_type', 'enterprise_qua'].join(',') })
this.dictMap = {
...dict.data
}
},
async init() {},
goBack() {
uni.switchTab({
url: '/pages/task'
})
},
select() {
this.isSelect = !this.isSelect
}
}
}
</script>
<style lang="scss" scoped>
.detail-container {
padding: 12px;
position: relative;
color: $cs-color-grey;
.box {
margin-bottom: 12px;
background-color: #fff;
border-radius: $cs-border-radius;
padding: 16px;
}
.detail {
display: flex;
flex-flow: column nowrap;
gap: 12px;
position: relative;
}
.tagList {
display: flex;
align-items: center;
gap: var(--Number-4px, 4px);
.tag {
display: flex;
padding: var(--Number-2px, 2px) var(--Number-6px, 6px);
justify-content: center;
align-items: center;
gap: var(--Number-4px, 4px);
border-radius: var(--Number-2px, 2px);
background: var(--LightMode-Grey-Grey-100, #f9f9f9);
color: var(--LightMode-Grey-Grey-600, #78829d);
text-align: center;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: normal;
}
}
.list {
height: 65vh;
padding-bottom: 30px;
.record {
background-color: #fff;
display: flex;
padding: var(--Number-12px, 12px);
align-items: center;
border-radius: var(--Number-8px, 8px);
border: 1px solid var(--LightMode-Grey-Grey-100, #f9f9f9);
margin-bottom: 12px;
position: relative;
.select {
width: 24px;
height: 24px;
border: 2px solid $cs-color-main;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
transition: 0.2s all;
margin-right: 16px;
}
.isSelect {
background-color: $cs-color-main;
}
.info {
font-size: 13px;
.name {
font-size: 16px;
font-weight: 600;
color: #071437;
margin-bottom: 4px;
}
}
}
}
.audit {
position: absolute;
right: -10px;
top: 6px;
transform: rotateZ(45deg);
transform-origin: 50% 50%;
padding: 4px 20px;
font-size: 12px;
text-align: center;
}
}
</style>

3
uni.scss

@ -66,4 +66,5 @@ $uni-font-size-paragraph: 15px;
$cs-shadow-color: #eaeaea;
$cs-border-radius: 8px;
$cs-gap: 10px;
$cs-main-color: #17c653;
$cs-color-main: #17c653;
$cs-color-grey: #4b5675;

45
uni_modules/s-echarts/echarts.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save