Commit 73397f006a9c5b3b36d9543495bb1647d7c892d5

Authored by 郭伟龙
1 parent 27876a5a
Exists in develop and in 1 other branch charge

fix:0.1.0问题修复

App.vue
... ... @@ -14,6 +14,7 @@ export default {
14 14 // #endif
15 15 },
16 16 onShow: function () {
  17 + this.$store.dispatch('loadDictDatas')
17 18 console.log('App Show')
18 19 },
19 20 onHide: function () {
... ...
api/dict.js
1 1 const { http } = uni.$u
2 2  
3 3 // 查询全部字典数据列表
4   -export const listSimpleDictDatas = params => http.get('/ticket/dict-data/list-all-simple', params)
  4 +export const listSimpleDictDatas = params => http.get('/system/dict/type/getAllTypeData',params)
... ...
common/config.js
... ... @@ -2,7 +2,8 @@ module.exports = {
2 2 //后端接口地址
3 3 // baseUrl: 'http://10.11.38.240:9001', //内网开发环境
4 4 baseUrl: 'http://172.17.56.37:18082/api', //测试环境
5   - // baseUrl: 'http://172.17.56.16:18082/api', //正式环境
  5 + // baseUrl: 'http://172.17.56.16:18082/api', //ip正式环境
  6 + // baseUrl: 'https://scdcapp.chinagasholdings.com/api', //域名正式环境
6 7 // baseUrl: 'http://api-dashboard.yudao.iocoder.cn/app-api',
7 8 // 超时
8 9 timeout: 30000,
... ...
components/news-list/news-list.vue
... ... @@ -6,7 +6,7 @@
6 6 {{newItem.title}}
7 7 </view>
8 8 <view class="bomCss overflow-one-lines">
9   - <view class="overflow-one-lines" style="width: 130rpx;"> {{ $dict(newItem.plateName || "") }} </view>
  9 + <view class="overflow-one-lines" style="width: 130rpx;"> {{ getDictDataLabel(DICT_TYPE.SYS_PLATE_NAME, newItem.plateName) || "" }} </view>
10 10 <view class="">|</view>
11 11 <view class="overflow-one-lines"> {{newItem.organizeName || ""}} </view>
12 12 </view>
... ...
index.html
1 1 <!DOCTYPE html>
2 2 <html lang="en">
3 3 <head>
  4 + <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
4 5 <meta charset="UTF-8" />
5 6 <script>
6 7 let coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
... ...
main.js
... ... @@ -8,16 +8,21 @@ import echarts from &#39;@/components/echarts-uniapp/echarts-uniapp.vue&#39;;
8 8 // vuex
9 9 import store from './store'
10 10  
11   -import dict from '@/utils/dictionary.js'
12   -import state from '@/utils/dictionary.js'
  11 +import dayjs from 'dayjs'
  12 +
  13 +import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "./utils/dict";
13 14  
14 15  
15 16 // 将 dict 方法挂载到全局对象上
16 17  
17 18 Vue.config.productionTip = false
18 19 Vue.prototype.$store = store
19   -Vue.prototype.$state = state
20   -Vue.prototype.$dict = dict
  20 +
  21 +Vue.prototype.getDictDatas = getDictDatas
  22 +Vue.prototype.getDictDatas2 = getDictDatas2
  23 +Vue.prototype.getDictDataLabel = getDictDataLabel
  24 +Vue.prototype.$dayjs = dayjs
  25 +Vue.prototype.DICT_TYPE = DICT_TYPE
21 26  
22 27 Vue.component('echarts',echarts)
23 28  
... ...
package-lock.json
1 1 {
2   - "name": "market-insight-app",
3   - "lockfileVersion": 3,
  2 + "name": "echarts for uniapp",
  3 + "version": "0.0.1",
  4 + "lockfileVersion": 1,
4 5 "requires": true,
5   - "packages": {
6   - "": {
7   - "dependencies": {
8   - "echarts": "^5.4.3"
9   - }
10   - },
11   - "node_modules/tslib": {
12   - "version": "2.3.0",
13   - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
14   - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
15   - },
16   - "node_modules/zrender": {
17   - "version": "5.4.4",
18   - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.4.4.tgz",
19   - "integrity": "sha512-0VxCNJ7AGOMCWeHVyTrGzUgrK4asT4ml9PEkeGirAkKNYXYzoPJCLvmyfdoOXcjTHPs10OZVMfD1Rwg16AZyYw==",
20   - "dependencies": {
21   - "tslib": "2.3.0"
22   - }
  6 + "dependencies": {
  7 + "dayjs": {
  8 + "version": "1.11.10",
  9 + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz",
  10 + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
23 11 }
24 12 }
25 13 }
... ...
package.json
... ... @@ -12,5 +12,8 @@
12 12 "前端组件",
13 13 "通用组件"
14 14 ]
  15 + },
  16 + "dependencies": {
  17 + "dayjs": "^1.11.10"
15 18 }
16   -}
17 19 \ No newline at end of file
  20 +}
... ...
pages.json
... ... @@ -55,7 +55,7 @@
55 55 "color": "#8e8e8e",
56 56 "list": [{
57 57 "pagePath": "pages/market/index",
58   - "text": "首页",
  58 + "text": "市场资讯",
59 59 "iconPath": "/static/images/tabbar/message.png",
60 60 "selectedIconPath": "/static/images/tabbar/message-active.png"
61 61 },
... ... @@ -88,7 +88,7 @@
88 88 "globalStyle": {
89 89 "navigationStyle": "custom",
90 90 "navigationBarTextStyle": "black",
91   - "navigationBarTitleText": "市场资讯",
  91 + "navigationBarTitleText": "市场洞察",
92 92 "navigationBarBackgroundColor": "#ffffff",
93 93 "backgroundColor": "#ffffff"
94 94 }
... ...
pages/login/mobile.vue
... ... @@ -20,15 +20,19 @@
20 20 <!-- 登录表单 -->
21 21 <u--form labelPosition="left" :model="formData" :rules="rules" ref="form">
22 22 <u-form-item prop="username" ref="item-mobile">
23   - <u-input type="text" prefixIcon="account" maxlength="11" border="surround" shape="circle"
24   - v-model="formData.username" clearable placeholder="请输入您的用户名"></u-input>
  23 + <u-input type="text" maxlength="11" border="surround" shape="circle"
  24 + v-model="formData.username" clearable placeholder="请输入您的用户名" style="width: 610rpx;">
  25 + <u-icon slot="prefix" size="20" style="margin-right: 48rpx;" name="/static/images/icon/user.png"></u-icon>
  26 + <!-- <u--text text="http://" slot="prefix" margin="0 3px 0 0" type="tips"></u--text> -->
  27 + </u-input>
25 28 </u-form-item>
26 29  
27 30 <u-gap height="20"></u-gap>
28 31  
29 32 <u-form-item prop="password" ref="item-password">
30 33 <u-input :type="inputType" prefixIcon="lock" maxlength="16" border="surround" shape="circle"
31   - v-model="formData.password" placeholder="请输入登录密码">
  34 + v-model="formData.password" placeholder="请输入登录密码" style="width: 610rpx;">
  35 + <u-icon slot="prefix" size="20" style="margin-right: 48rpx;" name="/static/images/icon/pwd.png"></u-icon>
32 36 <template slot="suffix">
33 37 <u-icon v-if="inputType === 'password'" size="20" color="#666666" name="eye-fill"
34 38 @click="inputType = 'text'"></u-icon>
... ... @@ -39,7 +43,7 @@
39 43 </u-form-item>
40 44  
41 45 <view class="btn-group">
42   - <u-button class="auth-btn" customStyle="margin-top: 50px" @click="handleSubmit">登录</u-button>
  46 + <u-button class="auth-btn" customStyle="margin-top: 50px" @click="handleSubmit">登录</u-button>
43 47 </view>
44 48 </u--form>
45 49 </view>
... ... @@ -59,8 +63,8 @@
59 63 codeDisabled: false,
60 64 codeTips: '',
61 65 formData: {
62   - username: '',
63   - password: '',
  66 + username: 'xucfa',
  67 + password: 'admin123',
64 68 },
65 69 rules: {
66 70 username: {
... ... @@ -122,6 +126,9 @@
122 126 </script>
123 127  
124 128 <style lang="scss" scoped>
  129 + .containers{
  130 + max-width: 750rpx;
  131 + }
125 132 .auth-header {
126 133 height: 600rpx;
127 134 display: flex;
... ... @@ -172,7 +179,7 @@
172 179 }
173 180  
174 181 .btn-group {
175   - width: 600rpx;
  182 + width: 642rpx;
176 183  
177 184 .auth-btn {
178 185 height: 90rpx;
... ... @@ -190,7 +197,7 @@
190 197 }
191 198  
192 199 .u-input {
193   - height: 54rpx;
  200 + height: 60rpx;
194 201 background: #f5f7f7;
195 202 }
196 203 </style>
... ...
pages/market/index.vue
... ... @@ -3,18 +3,18 @@
3 3 <u-sticky bgColor="#fff" customNavHeight="0" offsetTop="0">
4 4 <view class="flexCss">
5 5 <view class="leftCss">
6   - <u-icon size="15" name="/static/images/empty/login-out.png"></u-icon>
  6 + <u-icon size="15" name="/static/images/icon/login-out.png"></u-icon>
7 7 <view class="loginOutCss" @click="loginOutMethod">
8 8 退出登录
9 9 </view>
10 10 </view>
11 11 <u-search placeholder="搜索感兴趣的内容" v-model="keyword" :show-action="false" margin="30rpx 34rpx 15rpx 34rpx"
12   - borderColor="rgb(230, 230, 230)" height="74rpx" bgColor="#F5F6FA" @search="search"></u-search>
  12 + borderColor="rgb(230, 230, 230)" height="74rpx" bgColor="#F5F6FA" @clear="clearInit" @search="search"></u-search>
13 13 </view>
14 14 <u-tabs :list="tabList" :activeStyle="{'color': '#cf000d','font-weight':'bold'}" lineWidth="30rpx"
15 15 lineHeight="4rpx" lineColor="#cf000d" :current="current" @click="tabChange"></u-tabs>
16 16 </u-sticky>
17   - <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="NewsList.length <= 0"></u-empty>
  17 + <u-empty text="暂无资讯" icon="/static/images/icon/nodata.png" v-if="NewsList.length <= 0"></u-empty>
18 18 <newsList v-for="(item,index) in NewsList" :key="index" :newItem="item" v-else></newsList>
19 19 <u-loadmore :status="status" v-if="NewsList.length > 0" />
20 20 <u-modal :show="loginOutShow" title="退出登录" showCancelButton confirmColor="red" @cancel="loginOutShow = false"
... ... @@ -49,7 +49,10 @@
49 49 total: null,
50 50 queryParameter: {
51 51 pageNum: 1,
52   - pageSize: 10
  52 + pageSize: 10,
  53 + publishStatusList:1,
  54 + roleId:this.$store.state.user.roleId,
  55 + organizeId:this.$store.state.user.entity,
53 56 },
54 57 tabList: [{
55 58 name: "全部",
... ... @@ -76,6 +79,7 @@
76 79 },
77 80 onLoad() {
78 81 this.initData()
  82 + console.log(this.$store.state.user);
79 83 },
80 84 onReachBottom() {
81 85 let allTotal = this.queryParameter.pageNum * this.queryParameter.pageSize
... ... @@ -105,15 +109,17 @@
105 109 },
106 110 resetQuery() {
107 111 this.NewsList = [];
108   - this.queryParameter = {
109   - pageNum: 1,
110   - pageSize: 10
111   - }
  112 + this.queryParameter.pageNum = 1;
  113 + this.queryParameter.pageSize = 10;
112 114 },
113 115 search() {
114 116 this.resetQuery();
115 117 this.updateList()
116 118 },
  119 + clearInit(){
  120 + this.keyword = ""
  121 + this.search()
  122 + },
117 123 checkTotal() {
118 124 let allTotal = this.queryParameter.pageNum * this.queryParameter.pageSize
119 125 if (this.total < allTotal) {
... ... @@ -121,26 +127,18 @@
121 127 }
122 128 },
123 129 updateList() {
124   - let Params
125   - if (this.keyword && this.current !== -1) {
126   - Params = {
127   - title: this.keyword,
128   - plateName: this.current
129   - }
130   - } else if (this.keyword !== "") {
131   - Params = {
132   - title: this.keyword,
133   - }
134   - } else if (this.current !== 0) {
135   - Params = {
136   - plateName: this.current - 1
137   - }
  130 + let Params = {};
  131 + if(this.keyword){
  132 + Params.title = this.keyword
  133 + }
  134 + if(this.current !== -1 && this.current !== 0){
  135 + Params.plateNameList = this.current - 1
138 136 }
139 137 Params = {
140 138 ...this.queryParameter,
141 139 ...Params
142 140 };
143   - // console.log(111111, Params);
  141 + console.log(111111, Params);
144 142 getInfoMarketInformationlist(Params).then(res => {
145 143 // console.log(res);
146 144 if (res.code === 200) {
... ...
pages/market/insight.vue
... ... @@ -42,7 +42,7 @@
42 42 </u-sticky>
43 43 <view class="listBodyCss">
44 44 <view class="" v-if="!current">
45   - <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="newList1.length <= 0"></u-empty>
  45 + <u-empty text="暂无报告" icon="/static/images/icon/nodata.png" v-if="newList1.length <= 0"></u-empty>
46 46 <view class="reportCss" v-for="(item,index) in newList1" :key="index">
47 47 <view class="topTitleCss">
48 48 <view class="top1 overflow-one-lines"> {{item.reportName || ""}} </view>
... ... @@ -63,7 +63,7 @@
63 63 <u-loadmore :status="status1" v-if="newList1.length > 0" />
64 64 </view>
65 65 <view v-else>
66   - <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="newList2.length <= 0"></u-empty>
  66 + <u-empty text="暂无内容" icon="/static/images/icon/nodata.png" v-if="newList2.length <= 0"></u-empty>
67 67 <view class="reportCss" @click="jumpUserDetails(item)" :style="'height:auto'" v-else
68 68 v-for="(item,index) in newList2" :key="index">
69 69 <view class="topTitleCss">
... ... @@ -115,7 +115,9 @@
115 115 total2: null,
116 116 queryParameter: {
117 117 pageNum: 1,
118   - pageSize: 10
  118 + pageSize: 10,
  119 + roleId:this.$store.state.user.roleId,
  120 + entity:this.$store.state.user.entity,
119 121 },
120 122 tabList1: [{
121 123 name: '全部'
... ... @@ -223,7 +225,7 @@
223 225 fiscalYear: this.fiscalYear
224 226 }
225 227 }
226   - console.log(Params);
  228 + console.log("市场摸底查询参数",Params);
227 229 Params = {
228 230 ...this.queryParameter,
229 231 ...Params
... ... @@ -242,14 +244,12 @@
242 244 })
243 245 },
244 246 updateList2() {
245   - let Params
  247 + let Params = {};
246 248 if (this.current2 === 0) {
247 249 if (this.keyword) {
248   - Params = {
249   - householdName: this.keyword,
250   - }
  250 + Params.householdName = this.keyword
251 251 }
252   - getPoolResidentlist(Params).then(res => {
  252 + getPoolResidentlist({...Params,...this.queryParameter}).then(res => {
253 253 // console.log(res);
254 254 if (res.code === 200) {
255 255 if (this.queryParameter.pageSize > 1) {
... ... @@ -262,11 +262,9 @@
262 262 })
263 263 } else if (this.current2 === 1) {
264 264 if (this.keyword) {
265   - Params = {
266   - householdName: this.keyword,
267   - }
  265 + Params.householdName = this.keyword
268 266 }
269   - getPoolCommercelist(Params).then(res => {
  267 + getPoolCommercelist({...Params,...this.queryParameter}).then(res => {
270 268 // console.log(res);
271 269 if (res.code === 200) {
272 270 if (this.queryParameter.pageSize > 1) {
... ... @@ -279,11 +277,9 @@
279 277 })
280 278 } else if (this.current2 === 2) {
281 279 if (this.keyword) {
282   - Params = {
283   - contactPerson: this.keyword,
284   - }
  280 + Params.contactPerson = this.keyword
285 281 }
286   - getPoolIndustrylist(Params).then(res => {
  282 + getPoolIndustrylist({...Params,...this.queryParameter}).then(res => {
287 283 // console.log(res);
288 284 if (res.code === 200) {
289 285 if (this.queryParameter.pageSize > 1) {
... ... @@ -294,8 +290,6 @@
294 290 this.total2 = res.total;
295 291 }
296 292 })
297   - } else {
298   -
299 293 }
300 294 this.checkTotal()
301 295 console.log("待开发", this.newList2);
... ... @@ -312,10 +306,8 @@
312 306 resetQuery() {
313 307 this.newList1 = [];
314 308 this.newList2 = [];
315   - this.queryParameter = {
316   - pageNum: 1,
317   - pageSize: 10
318   - }
  309 + this.queryParameter.pageNum = 1;
  310 + this.queryParameter.pageSize = 10;
319 311 },
320 312 tabChange1(e) {
321 313 console.log(e);
... ...
pages/market/userDetails.vue
... ... @@ -47,7 +47,7 @@
47 47 </view>
48 48 <view class="flexCss">
49 49 <view class="leftCss overflow-one-lines"> 房主年龄 </view>
50   - <view class="rightCss overflow-one-lines"> {{allData.householdAge}} </view>
  50 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_HOUSEHOLD_AGE, allData.householdAge) || "" }} </view>
51 51 </view>
52 52 <view class="flexCss">
53 53 <view class="leftCss overflow-one-lines"> 联系电话 </view>
... ... @@ -86,7 +86,7 @@
86 86 </view>
87 87 <view class="flexCss">
88 88 <view class="leftCss overflow-one-lines"> 经营业主年龄 </view>
89   - <view class="rightCss overflow-one-lines"> {{allData.householdAge}} </view>
  89 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_HOUSEHOLD_AGE, allData.householdAge) || "" }} </view>
90 90 </view>
91 91 <view class="flexCss">
92 92 <view class="leftCss overflow-one-lines"> 联系电话 </view>
... ... @@ -117,7 +117,7 @@
117 117 </view>
118 118 <view class="flexCss">
119 119 <view class="leftCss overflow-one-lines"> 职务 </view>
120   - <view class="rightCss overflow-one-lines"> {{allData.duties}} </view>
  120 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_INDUSTRY_DUTIES, allData.duties) || "" }} </view>
121 121 </view>
122 122 <view class="flexCss">
123 123 <view class="leftCss overflow-one-lines"> 电话 </view>
... ... @@ -138,7 +138,7 @@
138 138 <view class="" v-if="type == 0">
139 139 <view class="flexCss">
140 140 <view class="leftCss overflow-one-lines"> 居住人口 </view>
141   - <view class="rightCss overflow-one-lines"> {{allData.resideNumber}} </view>
  141 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_LIVE_NO, allData.resideNumber) || "" }} </view>
142 142 </view>
143 143 <view class="flexCss">
144 144 <view class="leftCss overflow-one-lines"> 房屋户型 </view>
... ... @@ -150,55 +150,55 @@
150 150 </view>
151 151 <view class="flexCss">
152 152 <view class="leftCss overflow-one-lines"> 房屋建设年限 </view>
153   - <view class="rightCss overflow-one-lines"> {{allData.houseYear}} </view>
  153 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_BUILD_YEAR, allData.houseYear) || "" }} </view>
154 154 </view>
155 155 <view class="flexCss">
156 156 <view class="leftCss overflow-one-lines"> 房屋居住性质 </view>
157   - <view class="rightCss overflow-one-lines"> {{allData.houseNature}} </view>
  157 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_HOUSE_NATURE, allData.houseNature) || "" }} </view>
158 158 </view>
159 159 <view class="flexCss">
160 160 <view class="leftCss overflow-one-lines"> 居住属性 </view>
161   - <view class="rightCss overflow-one-lines"> {{allData.resideAttribute}} </view>
  161 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_LIVE_ATTRIBUTE, allData.resideAttribute) || "" }} </view>
162 162 </view>
163 163 <view class="flexCss">
164 164 <view class="leftCss overflow-one-lines"> 房屋性质 </view>
165   - <view class="rightCss overflow-one-lines"> {{allData.houseAttribute}} </view>
  165 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_HOUSE_ATTRIBUTE, allData.houseAttribute) || "" }} </view>
166 166 </view>
167 167 <view class="flexCss">
168 168 <view class="leftCss overflow-one-lines"> 房屋结构类型 </view>
169   - <view class="rightCss overflow-one-lines"> {{allData.houseStructure}} </view>
  169 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_HOUSE_STRUCTURE, allData.houseStructure) || "" }} </view>
170 170 </view>
171 171 <view class="flexCss">
172 172 <view class="leftCss overflow-one-lines"> 所在房屋距离中压管道 </view>
173   - <view class="rightCss overflow-one-lines"> {{allData.distance}} </view>
  173 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_DISTANCE, allData.distance) || "" }} </view>
174 174 </view>
175 175 <view class="flexCss">
176 176 <view class="leftCss overflow-one-lines"> 所在房屋是否有物业 </view>
177   - <view class="rightCss overflow-one-lines"> {{allData.isExist}} </view>
  177 + <view class="rightCss overflow-one-lines"> {{allData.isExist?'是':'否'}} </view>
178 178 </view>
179 179 <view class="flexCss">
180 180 <view class="leftCss overflow-one-lines"> 房屋是否列入拆迁规划 </view>
181   - <view class="rightCss overflow-one-lines"> {{allData.isPlan}} </view>
  181 + <view class="rightCss overflow-one-lines"> {{allData.isPlan?'是':'否'}} </view>
182 182 </view>
183 183 <view class="flexCss">
184 184 <view class="leftCss overflow-one-lines"> 水/电表是否一户一表 </view>
185   - <view class="rightCss overflow-one-lines"> {{allData.isSingleMeter}} </view>
  185 + <view class="rightCss overflow-one-lines"> {{allData.isSingleMeter?'是':'否'}} </view>
186 186 </view>
187 187 <view class="flexCss">
188 188 <view class="leftCss overflow-one-lines"> 是否独立厨房 </view>
189   - <view class="rightCss overflow-one-lines"> {{allData.isSingleKitchen}} </view>
  189 + <view class="rightCss overflow-one-lines"> {{allData.isSingleKitchen?'是':'否'}} </view>
190 190 </view>
191 191 <view class="flexCss">
192 192 <view class="leftCss overflow-one-lines"> 是否集中供暖 </view>
193   - <view class="rightCss overflow-one-lines"> {{allData.isHeating}} </view>
  193 + <view class="rightCss overflow-one-lines"> {{allData.isHeating?'是':'否'}} </view>
194 194 </view>
195 195 <view class="flexCss">
196 196 <view class="leftCss overflow-one-lines"> 楼前立管是否安装 </view>
197   - <view class="rightCss overflow-one-lines"> {{allData.isInstall}} </view>
  197 + <view class="rightCss overflow-one-lines"> {{allData.isInstall?'是':'否'}} </view>
198 198 </view>
199 199 <view class="flexCss">
200 200 <view class="leftCss overflow-one-lines"> 现使用能源 </view>
201   - <view class="rightCss overflow-one-lines"> {{allData.currentEnergy}} </view>
  201 + <view class="rightCss overflow-one-lines"> {{allData.currentEnergy?'是':'否'}} </view>
202 202 </view>
203 203 <view class="flexCss">
204 204 <view class="leftCss overflow-one-lines"> 现使用能源价格(元) </view>
... ... @@ -206,7 +206,7 @@
206 206 </view>
207 207 <view class="flexCss">
208 208 <view class="leftCss overflow-one-lines"> 用户报装意愿 </view>
209   - <view class="rightCss overflow-one-lines"> {{allData.inclinate}} </view>
  209 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_INSTALL_INCLINATE, allData.inclinate) || "" }} </view>
210 210 </view>
211 211 <view class="flexCss">
212 212 <view class="leftCss overflow-one-lines"> 不报装原因 </view>
... ... @@ -225,43 +225,43 @@
225 225 </view>
226 226 <view class="flexCss">
227 227 <view class="leftCss overflow-one-lines"> 经营范围 </view>
228   - <view class="rightCss overflow-one-lines"> {{allData.businessScope}} </view>
  228 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_BUSINESS_SCOPE, allData.businessScope) || "" }} </view>
229 229 </view>
230 230 <view class="flexCss">
231 231 <view class="leftCss overflow-one-lines"> 所在场所房屋性质 </view>
232   - <view class="rightCss overflow-one-lines"> {{allData.houseNature}} </view>
  232 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_HOUSE_NATURE, allData.houseNature) || "" }} </view>
233 233 </view>
234 234 <view class="flexCss">
235 235 <view class="leftCss overflow-one-lines"> 所在场所房屋类型 </view>
236   - <view class="rightCss overflow-one-lines"> {{allData.houseAttribute}} </view>
  236 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_COMMERCE_ATTRIBUTE, allData.houseAttribute) || "" }} </view>
237 237 </view>
238 238 <view class="flexCss">
239 239 <view class="leftCss overflow-one-lines"> 所在场所房屋结构类型 </view>
240   - <view class="rightCss overflow-one-lines"> {{allData.houseStructure}} </view>
  240 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_HOUSE_STRUCTURE, allData.houseStructure) || "" }} </view>
241 241 </view>
242 242 <view class="flexCss">
243 243 <view class="leftCss overflow-one-lines"> 所在场所房屋建设年限 </view>
244   - <view class="rightCss overflow-one-lines"> {{allData.houseYear}} </view>
  244 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_BUILD_YEAR, allData.houseYear) || "" }} </view>
245 245 </view>
246 246 <view class="flexCss">
247 247 <view class="leftCss overflow-one-lines"> 所在房屋是否列入拆迁规划 </view>
248   - <view class="rightCss overflow-one-lines"> {{allData.isPlan}} </view>
  248 + <view class="rightCss overflow-one-lines"> {{allData.isPlan?'是':'否'}} </view>
249 249 </view>
250 250 <view class="flexCss">
251 251 <view class="leftCss overflow-one-lines"> 水/电表是否一户一表 </view>
252   - <view class="rightCss overflow-one-lines"> {{allData.isSingleMeter}} </view>
  252 + <view class="rightCss overflow-one-lines"> {{allData.isSingleMeter?'是':'否'}} </view>
253 253 </view>
254 254 <view class="flexCss">
255 255 <view class="leftCss overflow-one-lines"> 是否有供暖需求 </view>
256   - <view class="rightCss overflow-one-lines"> {{allData.isHeating}} </view>
  256 + <view class="rightCss overflow-one-lines"> {{allData.isHeating?'是':'否'}} </view>
257 257 </view>
258 258 <view class="flexCss">
259 259 <view class="leftCss overflow-one-lines"> 所在房屋距离中压管道 </view>
260   - <view class="rightCss overflow-one-lines"> {{allData.distance}} </view>
  260 + <view class="rightCss overflow-one-lines"> {{allData.distance?'是':'否'}} </view>
261 261 </view>
262 262 <view class="flexCss">
263 263 <view class="leftCss overflow-one-lines"> 现使用能源 </view>
264   - <view class="rightCss overflow-one-lines"> {{allData.currentEnergy}} </view>
  264 + <view class="rightCss overflow-one-lines"> {{allData.currentEnergy?'是':'否'}} </view>
265 265 </view>
266 266 <view class="flexCss">
267 267 <view class="leftCss overflow-one-lines"> 现使用能源价格(元) </view>
... ... @@ -292,15 +292,15 @@
292 292 <view class="" v-if="type == 2">
293 293 <view class="flexCss">
294 294 <view class="leftCss overflow-one-lines"> 是否已供气 </view>
295   - <view class="rightCss overflow-one-lines"> {{allData.isProvide}} </view>
  295 + <view class="rightCss overflow-one-lines"> {{allData.isProvide?'是':'否'}} </view>
296 296 </view>
297 297 <view class="flexCss">
298 298 <view class="leftCss overflow-one-lines"> 商业状态 </view>
299   - <view class="rightCss overflow-one-lines"> {{allData.commercialStatus}} </view>
  299 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_COMMERCIAL_STATUS, allData.commercialStatus) || "" }} </view>
300 300 </view>
301 301 <view class="flexCss">
302 302 <view class="leftCss overflow-one-lines"> 项目类别 </view>
303   - <view class="rightCss overflow-one-lines"> {{allData.projectType}} </view>
  303 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_PROJECT_TYPE, allData.projectType) || "" }} </view>
304 304 </view>
305 305 <view class="flexCss">
306 306 <view class="leftCss overflow-one-lines"> 行业分类 </view>
... ... @@ -308,7 +308,7 @@
308 308 </view>
309 309 <view class="flexCss">
310 310 <view class="leftCss overflow-one-lines"> 最近管道距离 </view>
311   - <view class="rightCss overflow-one-lines"> {{allData.distance}} </view>
  311 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_DISTANCE, allData.distance) || "" }} </view>
312 312 </view>
313 313 <view class="flexCss">
314 314 <view class="leftCss overflow-one-lines"> 预计最大开口气量 </view>
... ... @@ -316,11 +316,12 @@
316 316 </view>
317 317 <view class="flexCss">
318 318 <view class="leftCss overflow-one-lines"> 预计签约日期 </view>
319   - <view class="rightCss overflow-one-lines"> {{allData.predictSign}} </view>
  319 + <view class="rightCss overflow-one-lines"> {{ $dayjs().UTC(allData.predictSign).format('YYYY') || ""}} </view>
320 320 </view>
321 321 <view class="flexCss">
322 322 <view class="leftCss overflow-one-lines"> 预计安装日期 </view>
323   - <view class="rightCss overflow-one-lines"> {{allData.predictInstall}} </view>
  323 + <!-- <view class="rightCss overflow-one-lines"> {{ $dayjs(allData.predictInstall).format('yyyy') || ""}} </view> -->
  324 + <view class="rightCss overflow-one-lines"> {{ allData.predictInstall || ""}} </view>
324 325 </view>
325 326 <view class="flexCss">
326 327 <view class="leftCss overflow-one-lines"> 预计日用气量 </view>
... ... @@ -328,7 +329,7 @@
328 329 </view>
329 330 <view class="flexCss">
330 331 <view class="leftCss overflow-one-lines"> 耗能设备名称 </view>
331   - <view class="rightCss overflow-one-lines"> {{allData.machineName}} </view>
  332 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_MACHINE_NAME, allData.machineName) || "" }} </view>
332 333 </view>
333 334 <view class="flexCss">
334 335 <view class="leftCss overflow-one-lines"> 耗能设备型号 </view>
... ... @@ -336,7 +337,7 @@
336 337 </view>
337 338 <view class="flexCss">
338 339 <view class="leftCss overflow-one-lines"> 用能类型 </view>
339   - <view class="rightCss overflow-one-lines"> {{allData.userType}} </view>
  340 + <view class="rightCss overflow-one-lines"> {{ getDictDataLabel(DICT_TYPE.SYS_INDUSTRY_TYPE, allData.userType) || "" }} </view>
340 341 </view>
341 342 <view class="flexCss">
342 343 <view class="leftCss overflow-one-lines"> 更新时间 </view>
... ... @@ -433,7 +434,7 @@
433 434 box-sizing: border-box;
434 435 font-family: '苹方 中等', '苹方', sans-serif;
435 436 color: #2b3950;
436   - text-align: left;
  437 + text-align: right;
437 438 line-height: normal;
438 439 font-size: 26rpx;
439 440 }
... ...
static/images/empty/login-out.png

7.58 KB

static/images/icon/eyeOff.png 0 → 100644

3.41 KB

static/images/icon/eyeOn.png 0 → 100644

1.94 KB

static/images/icon/login-out.png 0 → 100644

2.41 KB

static/images/icon/nodata.png 0 → 100644

100 KB

static/images/icon/pwd.png 0 → 100644

2.46 KB

static/images/icon/user.png 0 → 100644

4.11 KB

store/mudules/dict.js
... ... @@ -32,12 +32,13 @@ const actions = {
32 32 }
33 33 // 处理 dictValue 层级
34 34 dictDataMap[dictData.dictType].push({
35   - value: dictData.value,
36   - label: dictData.label,
37   - colorType: dictData.colorType,
38   - cssClass: dictData.cssClass,
  35 + value: dictData.dictValue,
  36 + label: dictData.dictLabel,
  37 + // colorType: dictData.colorType,
  38 + // cssClass: dictData.cssClass,
39 39 })
40 40 })
  41 + console.log(dictDataMap);
41 42 // 存储到 Store 中
42 43 commit('SET_DICT_DATAS', dictDataMap)
43 44 })
... ...
store/mudules/user.js
... ... @@ -8,6 +8,9 @@ const user = {
8 8 state: {
9 9 accessToken: uni.getStorageSync(AccessTokenKey), // 访问令牌
10 10 refreshToken: uni.getStorageSync(RefreshTokenKey), // 刷新令牌
  11 + roleId:"",
  12 + entity:"",
  13 + entityName:"",
11 14 userInfo: {}
12 15 },
13 16 mutations: {
... ... @@ -28,8 +31,20 @@ const user = {
28 31 const { access_token, refresh_token } = data
29 32 state.accessToken = access_token
30 33 state.refreshToken = refresh_token
  34 + const sysUser = data.sysUser;
  35 + const ysEntities = sysUser.ysEntities || []
  36 + let roleIdString = sysUser.roles.map(role => role.roleId).join(',') || "";
  37 + let entityString = ysEntities.map(item => item.entity).join(',') || "";
  38 + let entityNameString = ysEntities.map(item => item.entityName).join(',') || "";
  39 + console.log(roleIdString,entityString,entityNameString);
  40 + state.roleId = roleIdString;
  41 + state.entity = entityString;
  42 + state.entityName = entityNameString;
  43 + uni.setStorageSync('roleId', roleIdString)
  44 + uni.setStorageSync('entity', entityString)
  45 + uni.setStorageSync('entityName', entityNameString)
31 46 uni.setStorageSync(AccessTokenKey, access_token)
32   - uni.setStorageSync(RefreshTokenKey, refresh_token)
  47 + // uni.setStorageSync(RefreshTokenKey, refresh_token)
33 48  
34 49 // 加载用户信息
35 50 // this.dispatch('ObtainUserInfo')
... ... @@ -45,6 +60,9 @@ const user = {
45 60 state.accessToken = ''
46 61 state.refreshToken = ''
47 62 state.userInfo = {}
  63 + uni.reLaunch({
  64 + url:'/pages/login/mobile'
  65 + })
48 66 }
49 67 },
50 68 actions: {
... ...
utils/dict.js 0 → 100644
... ... @@ -0,0 +1,89 @@
  1 +/**
  2 + * Created by 芋道源码
  3 + *
  4 + * 数据字典工具类
  5 + */
  6 +import store from '@/store'
  7 +
  8 +export const DICT_TYPE = {
  9 + // ========== APP模块 ==========
  10 + SYS_PLATE_NAME: 'sys_plate_name', // 板块名称
  11 + SYS_HOUSEHOLD_AGE: 'sys_household_age', // 户主年龄
  12 + SYS_LIVE_NO:'sys_live_no', //居住人口
  13 + SYS_BUILD_YEAR:'sys_build_year', //房屋建设年限
  14 + SYS_HOUSE_ATTRIBUTE:'sys_house_attribute', //房屋性质
  15 + SYS_LIVE_ATTRIBUTE:'sys_live_attribute', //居住属性
  16 + SYS_HOUSE_NATURE:'sys_house_nature', // 房屋居住性质
  17 + SYS_HOUSE_STRUCTURE:'sys_house_structure', //房屋结构类型
  18 + SYS_DISTANCE:'sys_distance', //到中压管道距离
  19 + SYS_CURRENT_ENERGY:'sys_current_energy', //现使用能源
  20 + SYS_BUSINESS_SCOPE:'sys_business_scope', //经营范围
  21 + SYS_COMMERCE_ATTRIBUTE:'sys_commerce_attribute', //商业所在场所房屋类型
  22 + SYS_MACHINE_NAME:'sys_machine_name', //耗能设备名称
  23 + SYS_INDUSTRY_TYPE:'sys_industry_type', //用能类型
  24 + SYS_INDUSTRY_DUTIES:'sys_industry_duties', //职务
  25 + SYS_REPORT_STATUS:'sys_report_status', //洞察报告状态
  26 + SYS_INSIGH_AREA:'sys_Insigh_area', //区域
  27 + SYS_INSTALL_INCLINATE:'sys_install_inclinate', //用户报装意愿
  28 + SYS_COMMERCIAL_STATUS:'sys_commercial_status', //商机状态
  29 + SYS_PROJECT_TYPE:'sys_project_type', //项目类别
  30 + SYS_KEYWORD:'sys_keyword', //市场咨询关键词
  31 + SYS_PUBLISH_STATUS:'sys_publish_status', //资讯状态
  32 +}
  33 +
  34 +/**
  35 + * 获取 dictType 对应的数据字典数组
  36 + *
  37 + * @param dictType 数据类型
  38 + * @returns {*|Array} 数据字典数组
  39 + */
  40 +export function getDictDatas(dictType) {
  41 + return store.getters.dict_datas[dictType] || []
  42 +}
  43 +
  44 +/**
  45 + * 获取 dictType 对应的数据字典数组
  46 + *
  47 + * @param dictType 数据类型
  48 + * @param values 数组、单个元素
  49 + * @returns {*|Array} 数据字典数组
  50 + */
  51 +export function getDictDatas2(dictType, values) {
  52 + if (values === undefined) {
  53 + return [];
  54 + }
  55 + // 如果是单个元素,则转换成数组
  56 + if (!Array.isArray(values)) {
  57 + values = [this.value];
  58 + }
  59 + // 获得字典数据
  60 + const results = [];
  61 + for (const value of values) {
  62 + const dict = getDictData(dictType, value);
  63 + if (dict) {
  64 + results.push(dict);
  65 + }
  66 + }
  67 + return results;
  68 +}
  69 +
  70 +export function getDictData(dictType, value) {
  71 + // 获取 dictType 对应的数据字典数组
  72 + const dictDatas = getDictDatas(dictType)
  73 + if (!dictDatas || dictDatas.length === 0) {
  74 + return ''
  75 + }
  76 + // 获取 value 对应的展示名
  77 + value = value + '' // 强制转换成字符串,因为 DictData 小类数值,是字符串
  78 + for (const dictData of dictDatas) {
  79 + if (dictData.value === value) {
  80 + return dictData;
  81 + }
  82 + }
  83 + return undefined
  84 +}
  85 +
  86 +export function getDictDataLabel(dictType, value) {
  87 + const dict = getDictData(dictType, value);
  88 + return dict ? dict.label : '';
  89 +}
... ...
utils/request/responseInterceptors.js
... ... @@ -31,6 +31,7 @@ module.exports = vm =&gt; {
31 31 isRefreshToken = true
32 32 // 1. 如果获取不到刷新令牌,则只能执行登出操作
33 33 if (!vm.$store.getters.refreshToken) {
  34 + console.log("token失效,退出登录");
34 35 vm.$store.commit('CLEAR_LOGIN_INFO')
35 36 return Promise.reject(res)
36 37 }
... ...
vue.config.js
... ... @@ -5,11 +5,12 @@ module.exports = {
5 5 // 调试时允许内网穿透,让外网的人访问到本地调试的H5页面
6 6 disableHostCheck: true,
7 7 // /本地调试时打开
8   - port: '8081', //代理端口,不固定8222,可以是其他的
  8 + port: '18082', //代理端口,不固定8222,可以是其他的
9 9 open: false, //项目启动时是否自动打开浏览器
10 10 proxy: {
11 11 '/api': {
12   - target: 'http://172.17.56.37/api', //接口地址
  12 + target: 'http://172.17.56.37/api', //测试接口地址
  13 + // target: 'http://172.17.56.16/api', //正式接口地址
13 14 // ws:true, //允许ws跨域
14 15 secure:true, //类型:https=false http=true
15 16 changeOrigin: true, //是否跨域
... ...