Commit 3be4a23ce2edc12daaf3289de77da81c519c2e3a

Authored by fengtao
1 parent 2da23875

fix:修改通知详情和通知类型判断,refractor:修改告警分页文本样式

... ... @@ -5,12 +5,12 @@
5 5 <view class="alarm-detail-column">
6 6 <view class="u-flex detail-column">
7 7 <view class="u-flex column">
8   - <text class="text">{{ list.deviceName == null ? '暂无数据' : list.deviceName }}</text>
9   - <image class="image" src="../../static/alert-detail.png"></image>
  8 + <text class="text-org-bold">{{ list.deviceName == null ? '暂无数据' : list.deviceName }}</text>
  9 + <image class="image" src="/static/alarm-device.png"></image>
10 10 </view>
11 11 <view class="column">
12   - <text class="text-alarm-level">告警级别:</text>
13   - <text class="text-alarm-level" style="color:#DE4437">
  12 + <text class="text-org-bold ">告警级别:</text>
  13 + <text class="text-device-muted" style="color:#DE4437">
14 14 {{
15 15 list.severity == 'CRITICAL'
16 16 ? '危险'
... ... @@ -25,20 +25,20 @@
25 25 </text>
26 26 </view>
27 27 <view class="column">
28   - <text class="text-alarm-level-lg">所属组织:</text>
29   - <text class="text-alarm-lg">{{ list.originatorType }}</text>
  28 + <text class="text-org-bold">所属组织:</text>
  29 + <text class="text-device-muted">{{ list.organizationName }}</text>
30 30 </view>
31 31 <view class="column">
32   - <text class="text-alarm-level-lg">告警值:</text>
33   - <text class="text-alarm-lg">{{ list.details == null ? '暂无数据' : list.details.data }}</text>
  32 + <text class="text-org-bold">告警值:</text>
  33 + <text class="text-device-muted">{{ list.details == null ? '暂无数据' : formatDetailText(list.details.data) }}</text>
34 34 </view>
35 35 <view class="column">
36   - <text class="text-alarm-level-lg">告警时间:</text>
37   - <text class="text-alarm-lg">{{ list.createdTime }}</text>
  36 + <text class="text-org-bold">告警时间:</text>
  37 + <text class="text-device-muted">{{ list.createdTime }}</text>
38 38 </view>
39 39 <view class="column">
40   - <text class="text-alarm-level-lg">告警状态:</text>
41   - <text class="text-alarm-status">
  40 + <text class="text-org-bold">告警状态:</text>
  41 + <text class="text-device-muted">
42 42 {{
43 43 list.status == 'CLEARED_UNACK'
44 44 ? '清除未确认'
... ... @@ -53,17 +53,19 @@
53 53 </view>
54 54 </view>
55 55 <!-- #ifdef MP -->
56   - <view class="handle-result" style="">处理结果</view>
  56 + <view class="handle-result text-org-bold" style="">处理结果</view>
57 57 <view class="hanle-main">
58 58 <u--form :label-style="{ 'font-size': '0rpx' }" style="padding-left: 26rpx;" labelPosition="left" :model="formModel" ref="form1">
59 59 <u-form-item label="." prop="result" ref="item3">
60   - <view style="margin-left: -60rpx;"><u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea></view>
  60 + <view style="position: relative;left: -60rpx;">
  61 + <u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea>
  62 + </view>
61 63 </u-form-item>
62 64 </u--form>
63 65 </view>
64 66 <!-- #endif -->
65 67 <!-- #ifdef APP-PLUS -->
66   - <view class="handle-result">处理结果</view>
  68 + <view class="handle-result text-org-bold">处理结果</view>
67 69 <view class="hanle-main">
68 70 <view><u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea></view>
69 71 </view>
... ... @@ -94,28 +96,37 @@ export default {
94 96 },
95 97 methods: {
96 98 handleSubmit() {
97   - uni.$u.http
98   - .post(`/alarm/${this.list.id}/ack`)
99   - .then(res => {
100   - if (res == '') {
101   - uni.showToast({
102   - title: '处理成功~',
103   - icon: 'none'
104   - });
105   - let pages = getCurrentPages(); //获取所有页面栈实例列表
106   - let nowPage = pages[pages.length - 1]; //当前页页面实例
107   - let prevPage = pages[pages.length - 2]; //上一页页面实例
108   - prevPage.$vm.detailStatus = true;
109   - setTimeout(() => {
110   - uni.navigateBack({
111   - delta: 1
  99 + if (this.formModel.result == '') return uni.$u.toast('请输入处理结果');
  100 + else
  101 + uni.$u.http
  102 + .post(`/alarm/${this.list.id}/ack`)
  103 + .then(res => {
  104 + if (res == '') {
  105 + uni.showToast({
  106 + title: '处理成功~',
  107 + icon: 'none'
112 108 });
113   - }, 500);
114   - }
115   - })
116   - .catch(e => {
117   - uni.$u.toast(e.data?.message);
118   - });
  109 + let pages = getCurrentPages(); //获取所有页面栈实例列表
  110 + let nowPage = pages[pages.length - 1]; //当前页页面实例
  111 + let prevPage = pages[pages.length - 2]; //上一页页面实例
  112 + prevPage.$vm.detailStatus = true;
  113 + setTimeout(() => {
  114 + uni.navigateBack({
  115 + delta: 1
  116 + });
  117 + }, 500);
  118 + }
  119 + })
  120 + .catch(e => {
  121 + uni.$u.toast(e.data?.message);
  122 + });
  123 + },
  124 + formatDetailText(e) {
  125 + //去除字符串双引号
  126 + const jsonStr = JSON.stringify(e);
  127 + const str = jsonStr.substring(1, jsonStr.length - 1);
  128 + const newStr = str.replace(/\"/g, '');
  129 + return newStr;
119 130 }
120 131 }
121 132 };
... ...
1 1 <template>
2 2 <view class="f-navbar">
3   - <view :class="[navbarType==1?'f-relative':'f-fixed']"
4   - :style="[navbarType==1?{height:systemInfo.navBarH+'px'}:{paddingTop:systemInfo.statusBarHeight+'px'}]">
  3 + <view
  4 + :class="[navbarType == 1 ? 'f-relative' : 'f-fixed']"
  5 + :style="[navbarType == 1 ? { height: systemInfo.navBarH + 'px' } : { paddingTop: systemInfo.statusBarHeight + 'px' }]"
  6 + >
5 7 <!-- 背景色 -->
6   - <view class="bgColor"
7   - :style="{height:systemInfo.navBarH+'px',background: bgColor,backgroundImage: gradient, opacity: navbarType == 5 ? transparentValue :''}">
8   - <image :src="image" :mode="imageMode" style="width: 750rpx;" :style="{height:systemInfo.navBarH+'px'}"
9   - v-if="image"></image>
  8 + <view class="bgColor" :style="{ height: systemInfo.navBarH + 'px', background: bgColor, backgroundImage: gradient, opacity: navbarType == 5 ? transparentValue : '' }">
  9 + <image :src="image" :mode="imageMode" style="width: 750rpx;" :style="{ height: systemInfo.navBarH + 'px' }" v-if="image"></image>
10 10 </view>
11   - <view class="u-flex content"
12   - :style="{height:systemInfo.titleBarHeight+'px',top:systemInfo.statusBarHeight+'px'}">
13   - <block v-if="navbarType!=4 && isShowLeft">
14   - <view class="u-flex left" hover-class="left--hover" hover-start-time="150" v-if="navbarType==3">
15   - <view class="u-flex u-home-arrow-left"
16   - :style="{borderColor:isWhite?'rgba(255,255,255,.5)':'#dadbde'}">
17   - <view @click="onBack">
18   - <u-icon name="arrow-left" size="19" :color="leftColor"></u-icon>
19   - </view>
20   - <u-line direction="column" :hairline="false" length="16" margin="0 8px"
21   - :color="isWhite?'rgba(255,255,255,.3)':'#dadbde'"></u-line>
22   - <view @click="onHome">
23   - <u-icon name="home" size="20" :color="leftColor"></u-icon>
24   - </view>
  11 + <view class="u-flex content" :style="{ height: systemInfo.titleBarHeight + 'px', top: systemInfo.statusBarHeight + 'px' }">
  12 + <block v-if="navbarType != 4 && isShowLeft">
  13 + <view class="u-flex left" hover-class="left--hover" hover-start-time="150" v-if="navbarType == 3">
  14 + <view class="u-flex u-home-arrow-left" :style="{ borderColor: isWhite ? 'rgba(255,255,255,.5)' : '#dadbde' }">
  15 + <view @click="onBack"><u-icon name="arrow-left" size="19" :color="leftColor"></u-icon></view>
  16 + <u-line direction="column" :hairline="false" length="16" margin="0 8px" :color="isWhite ? 'rgba(255,255,255,.3)' : '#dadbde'"></u-line>
  17 + <view @click="onHome"><u-icon name="home" size="20" :color="leftColor"></u-icon></view>
25 18 </view>
26 19 </view>
27   - <view class="u-flex left" hover-class="left--hover" hover-start-time="150" @click="leftClick"
28   - v-else>
  20 + <view class="u-flex left" hover-class="left--hover" hover-start-time="150" @click="leftClick" v-else>
29 21 <slot name="left">
30 22 <!-- 左边箭头背景渐变 -->
31   - <view class="iconBg u-flex"
32   - :style="{background: 'rgba(0,0,0,'+(navbarType == 5 ?(1-transparentValue)>0.4?.4:(1-transparentValue):0)+')'}">
  23 + <view
  24 + class="iconBg u-flex"
  25 + :style="{ background: 'rgba(0,0,0,' + (navbarType == 5 ? (1 - transparentValue > 0.4 ? 0.4 : 1 - transparentValue) : 0) + ')' }"
  26 + >
33 27 <u-icon :name="iconLeft" size="16" :color="leftColor"></u-icon>
34 28 </view>
35   - <text v-if="leftText" class="left__text" :style="{color: leftColor}">{{ leftText }}</text>
  29 + <text v-if="leftText" class="left__text" :style="{ color: leftColor }">{{ leftText }}</text>
36 30 </slot>
37 31 </view>
38 32 </block>
39   - <view class="center" :style="{width:titleWidth+'rpx'}">
  33 + <view class="center" :style="{ width: titleWidth + 'rpx' }">
40 34 <slot name="default">
41   - <view class="title u-line-1"
42   - :style="[isShowTransparentTitle?{}:{opacity: navbarType == 5 ? transparentValue :''},{color:fontColor,width:titleWidth+'rpx',fontSize:fontSize+'rpx'}]">
43   - {{title}}</view>
  35 + <view
  36 + class="title u-line-1"
  37 + :style="[
  38 + isShowTransparentTitle ? {} : { opacity: navbarType == 5 ? transparentValue : '' },
  39 + { color: fontColor, width: titleWidth + 'rpx', fontSize: fontSize + 'rpx' }
  40 + ]"
  41 + >
  42 + {{ title }}
  43 + </view>
44 44 </slot>
45 45 </view>
46   - <view class="u-flex right" @click="rightClick">
47   - <slot name="right"></slot>
48   - </view>
  46 + <view class="u-flex right" @click="rightClick"><slot name="right"></slot></view>
49 47 </view>
50 48 </view>
51 49 <!-- 防止塌陷高度 -->
52   - <view v-if="isFillHeight && navbarType!=5 && navbarType!=1" :style="{height:systemInfo.navBarH+'px'}"></view>
  50 + <view v-if="isFillHeight && navbarType != 5 && navbarType != 1" :style="{ height: systemInfo.navBarH + 'px' }"></view>
53 51 </view>
54 52 </template>
55 53
56 54 <script>
57   - // 主页页面的页面路径
58   - // 关联功能:打开的页面只有一个的时候右上角自动显示返回首页按钮,下面这个数组是排除显示返回首页的页面。
59   - // 主页使用场景:小程序分享出去的页面,用户点击开是分享页面,很多情况下是没有返回首页按钮的
60   - const mainPagePath = ['pages/index/index', 'pages/goods/goods', 'pages/device/device', 'pages/personal/personal','pages/alarm/alarm', ];
61   - //返回首页的地址
62   - const homePath = '/pages/index/index';
63   - //白色表达值
64   - const whiteList = ['#FFF', '#fff', '#FFFFFF', '#ffffff', 'white', 'rgb(255,255,255)', 'rgba(255,255,255,1)'];
65   - // import base from '@/config/baseUrl.js';
66   - export default {
67   - name: 'f-navbar',
68   - props: {
69   - title: {
70   - type: String,
71   - },
72   - // navbarType等于5透明背景时title是否显示
73   - isShowTransparentTitle: {
74   - type: Boolean,
75   - default: function() {
76   - return true;
77   - }
78   - },
79   - // 左边文字
80   - leftText: {
81   - type: String
82   - },
83   - // 背景颜色
84   - bgColor: {
85   - type: String,
86   - default: '#fff'
87   - },
88   - // 背景图片
89   - image: {
90   - type: String
91   - },
92   - // 背景图片mode
93   - imageMode: {
94   - type: String,
95   - default: 'aspectFill'
96   - },
97   - // 导航状态 0、默认固定在顶部 1、不固定在顶部 2、自定义点击事件 3、同时显示箭头和去首页按钮 4、不显示左侧内容 5、上拉渐变显示背景色
98   - navbarType: {
99   - type: [String, Number],
100   - default: 0
101   - },
102   - // 是否显示左侧内容
103   - isShowLeft: {
104   - type: Boolean,
105   - default: function() {
106   - return true;
107   - }
108   - },
109   - // 左边按钮icon
110   - leftIcon: {
111   - type: String,
112   - default: 'arrow-left'
113   - },
114   - // 左边icon颜色
115   - leftIconColor: {
116   - type: String,
117   - default: '#303133'
118   - },
119   - // 屏幕滑动距离顶部距离(透明固定导航比传)
120   - scrollTop: {
121   - type: Number,
122   - default: 0
123   - },
124   - //导航字体颜色,字体颜色为白色的时候会把手机状态栏设置为白色,否则为黑色
125   - fontColor: {
126   - type: String,
127   - default: '#303133'
128   - },
129   - titleWidth: {
130   - type: [String, Number],
131   - default: 400
132   - },
133   - fontSize: {
134   - type: [String, Number],
135   - default: 30
136   - },
137   - gradient: {
138   - type: String
139   - },
140   - // 是否设置防止塌陷高度
141   - isFillHeight: {
142   - type: Boolean,
143   - default: function() {
144   - return true;
145   - }
146   - },
  55 +// 主页页面的页面路径
  56 +// 关联功能:打开的页面只有一个的时候右上角自动显示返回首页按钮,下面这个数组是排除显示返回首页的页面。
  57 +// 主页使用场景:小程序分享出去的页面,用户点击开是分享页面,很多情况下是没有返回首页按钮的
  58 +const mainPagePath = ['pages/index/index', 'pages/device/device', 'pages/alarm/alarm', 'pages/personal/personal'];
  59 +//返回首页的地址
  60 +const homePath = '/pages/index/index';
  61 +//白色表达值
  62 +const whiteList = ['#FFF', '#fff', '#FFFFFF', '#ffffff', 'white', 'rgb(255,255,255)', 'rgba(255,255,255,1)'];
  63 +// import base from '@/config/baseUrl.js';
  64 +export default {
  65 + name: 'f-navbar',
  66 + props: {
  67 + title: {
  68 + type: String
147 69 },
148   - data() {
149   - return {
150   - // systemInfo:base.systemInfo,
151   - systemInfo: {
152   - statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
153   - // #ifdef MP-ALIPAY
154   - navBarH: uni.getSystemInfoSync().statusBarHeight + uni.getSystemInfoSync()
155   - .titleBarHeight, //菜单栏总高度--单位px
156   - titleBarHeight: uni.getSystemInfoSync().titleBarHeight, //标题栏高度--单位px
157   - // #endif
158   - // #ifndef MP-ALIPAY
159   - navBarH: uni.getSystemInfoSync().statusBarHeight + 44, //菜单栏总高度--单位px
160   - titleBarHeight: 44, //标题栏高度--单位px
161   - // #endif
162   - },
163   - //当前页面是否是第一个页面
164   - firstPage: false,
165   - //透明度值
166   - transparentValue: 0,
167   - iconLeft: 'arrow-left', //左边icon
168   - // 上次显示的导航栏颜色
169   - lastFrontColor: '',
170   - //字体色
171   - navFontColor: '#303133',
172   - isWhite: false, //是否白色
  70 + // navbarType等于5透明背景时title是否显示
  71 + isShowTransparentTitle: {
  72 + type: Boolean,
  73 + default: function() {
  74 + return true;
173 75 }
174 76 },
175   - watch: {
176   - leftIcon: {
177   - immediate: true,
178   - handler(val) {
179   - this.iconLeft = val
180   - }
181   - },
182   - fontColor: {
183   - immediate: true,
184   - handler(val) {
185   - this.navFontColor = val;
186   - this.settingColor();
187   - }
188   - },
189   - navbarType: {
190   - immediate: true,
191   - handler(val) {
192   - console.log(val, 'navbarType')
193   - if (val == 5) {
194   - if (this.scrollTop > 180) {
195   - this.transparentValue = 1;
196   - } else {
197   - this.transparentValue = this.scrollTop / 180;
198   - }
199   - }
200   - }
  77 + // 左边文字
  78 + leftText: {
  79 + type: String
  80 + },
  81 + // 背景颜色
  82 + bgColor: {
  83 + type: String,
  84 + default: '#fff'
  85 + },
  86 + // 背景图片
  87 + image: {
  88 + type: String
  89 + },
  90 + // 背景图片mode
  91 + imageMode: {
  92 + type: String,
  93 + default: 'aspectFill'
  94 + },
  95 + // 导航状态 0、默认固定在顶部 1、不固定在顶部 2、自定义点击事件 3、同时显示箭头和去首页按钮 4、不显示左侧内容 5、上拉渐变显示背景色
  96 + navbarType: {
  97 + type: [String, Number],
  98 + default: 0
  99 + },
  100 + // 是否显示左侧内容
  101 + isShowLeft: {
  102 + type: Boolean,
  103 + default: function() {
  104 + return true;
  105 + }
  106 + },
  107 + // 左边按钮icon
  108 + leftIcon: {
  109 + type: String,
  110 + default: 'arrow-left'
  111 + },
  112 + // 左边icon颜色
  113 + leftIconColor: {
  114 + type: String,
  115 + default: '#303133'
  116 + },
  117 + // 屏幕滑动距离顶部距离(透明固定导航比传)
  118 + scrollTop: {
  119 + type: Number,
  120 + default: 0
  121 + },
  122 + //导航字体颜色,字体颜色为白色的时候会把手机状态栏设置为白色,否则为黑色
  123 + fontColor: {
  124 + type: String,
  125 + default: '#303133'
  126 + },
  127 + titleWidth: {
  128 + type: [String, Number],
  129 + default: 400
  130 + },
  131 + fontSize: {
  132 + type: [String, Number],
  133 + default: 30
  134 + },
  135 + gradient: {
  136 + type: String
  137 + },
  138 + // 是否设置防止塌陷高度
  139 + isFillHeight: {
  140 + type: Boolean,
  141 + default: function() {
  142 + return true;
  143 + }
  144 + }
  145 + },
  146 + data() {
  147 + return {
  148 + // systemInfo:base.systemInfo,
  149 + systemInfo: {
  150 + statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  151 + // #ifdef MP-ALIPAY
  152 + navBarH: uni.getSystemInfoSync().statusBarHeight + uni.getSystemInfoSync().titleBarHeight, //菜单栏总高度--单位px
  153 + titleBarHeight: uni.getSystemInfoSync().titleBarHeight, //标题栏高度--单位px
  154 + // #endif
  155 + // #ifndef MP-ALIPAY
  156 + navBarH: uni.getSystemInfoSync().statusBarHeight + 35, //菜单栏总高度--单位px
  157 + titleBarHeight: 35 //标题栏高度--单位px
  158 + // #endif
201 159 },
202   - scrollTop(val) {
203   - this.pageScroll({
204   - scrollTop: val
205   - });
  160 + //当前页面是否是第一个页面
  161 + firstPage: false,
  162 + //透明度值
  163 + transparentValue: 0,
  164 + iconLeft: 'arrow-left', //左边icon
  165 + // 上次显示的导航栏颜色
  166 + lastFrontColor: '',
  167 + //字体色
  168 + navFontColor: '#303133',
  169 + isWhite: false //是否白色
  170 + };
  171 + },
  172 + watch: {
  173 + leftIcon: {
  174 + immediate: true,
  175 + handler(val) {
  176 + this.iconLeft = val;
206 177 }
207 178 },
208   - computed: {
209   - leftColor() {
210   - let color = '#303133'
211   - if (this.leftIconColor == '#303133') { //如果等于默认值
212   - // 背景不是白色或者背景是渐变色
213   - if (!whiteList.includes(this.bgColor) || this.gradient) {
214   - color = '#fff'
  179 + fontColor: {
  180 + immediate: true,
  181 + handler(val) {
  182 + this.navFontColor = val;
  183 + this.settingColor();
  184 + }
  185 + },
  186 + navbarType: {
  187 + immediate: true,
  188 + handler(val) {
  189 + console.log(val, 'navbarType');
  190 + if (val == 5) {
  191 + if (this.scrollTop > 180) {
  192 + this.transparentValue = 1;
  193 + } else {
  194 + this.transparentValue = this.scrollTop / 180;
215 195 }
216   - } else {
217   - color = this.leftIconColor
218 196 }
219   - return color
220 197 }
221 198 },
222   - created() {
  199 + scrollTop(val) {
223 200 this.pageScroll({
224   - scrollTop: this.scrollTop
  201 + scrollTop: val
225 202 });
226   - //获取所有页面
227   - let currentPages = getCurrentPages();
228   - let pageLen = currentPages.length;
229   - //判断是否是第一个页面,如果是有设置back为true的页面,将不显示返回箭头,而显示返回首页按钮
230   - if (pageLen == 1 && !mainPagePath.includes(currentPages[0].route)) {
231   - this.firstPage = true;
232   - this.iconLeft = 'home'
233   - console.log(this.firstPage, 'this.firstPage')
234   - }
235   - },
236   - methods: {
237   - onBack() {
238   - if (this.firstPage) {
239   - uni.reLaunch({
240   - url: homePath
241   - });
242   - } else {
243   - uni.navigateBack();
  203 + }
  204 + },
  205 + computed: {
  206 + leftColor() {
  207 + let color = '#303133';
  208 + if (this.leftIconColor == '#303133') {
  209 + //如果等于默认值
  210 + // 背景不是白色或者背景是渐变色
  211 + if (!whiteList.includes(this.bgColor) || this.gradient) {
  212 + color = '#fff';
244 213 }
245   - },
246   - onHome() {
247   - uni.switchTab({
  214 + } else {
  215 + color = this.leftIconColor;
  216 + }
  217 + return color;
  218 + }
  219 + },
  220 + created() {
  221 + this.pageScroll({
  222 + scrollTop: this.scrollTop
  223 + });
  224 + //获取所有页面
  225 + let currentPages = getCurrentPages();
  226 + let pageLen = currentPages.length;
  227 + //判断是否是第一个页面,如果是有设置back为true的页面,将不显示返回箭头,而显示返回首页按钮
  228 + if (pageLen == 1 && !mainPagePath.includes(currentPages[0].route)) {
  229 + this.firstPage = true;
  230 + this.iconLeft = 'home';
  231 + console.log(this.firstPage, 'this.firstPage');
  232 + }
  233 + },
  234 + methods: {
  235 + onBack() {
  236 + if (this.firstPage) {
  237 + uni.reLaunch({
248 238 url: homePath
249 239 });
250   - },
251   - leftClick() {
252   - if (this.navbarType == 2) {
253   - this.$emit('leftClick');
254   - } else {
255   - this.onBack()
256   - }
257   - },
258   - rightClick() {
259   - this.$emit('rightClick');
260   - },
261   - pageScroll(e) {
262   - if (this.navbarType == 5) {
263   - if (e.scrollTop && e.scrollTop > 0) {
264   - if (e.scrollTop > 180) {
265   - this.transparentValue = 1;
266   - } else {
267   - this.transparentValue = e.scrollTop / 180;
268   - }
  240 + } else {
  241 + uni.navigateBack();
  242 + }
  243 + },
  244 + onHome() {
  245 + uni.switchTab({
  246 + url: homePath
  247 + });
  248 + },
  249 + leftClick() {
  250 + if (this.navbarType == 2) {
  251 + this.$emit('leftClick');
  252 + } else {
  253 + this.onBack();
  254 + }
  255 + },
  256 + rightClick() {
  257 + this.$emit('rightClick');
  258 + },
  259 + pageScroll(e) {
  260 + if (this.navbarType == 5) {
  261 + if (e.scrollTop && e.scrollTop > 0) {
  262 + if (e.scrollTop > 180) {
  263 + this.transparentValue = 1;
269 264 } else {
270   - this.transparentValue = 0;
  265 + this.transparentValue = e.scrollTop / 180;
271 266 }
272   - // this.settingColor();
273   - }
274   - },
275   - //设置手机状态栏颜色
276   - settingColor() {
277   - let navColor = this.navFontColor;
278   - console.log(navColor, 'settingColor')
279   - let frontColor = '#000000';
280   - if (whiteList.includes(navColor)) {
281   - frontColor = '#ffffff';
282   - this.isWhite = true
283   - }
284   - if (this.lastFrontColor == frontColor) {
285   - return;
  267 + } else {
  268 + this.transparentValue = 0;
286 269 }
287   - setTimeout(() => {
288   - this.lastFrontColor = frontColor;
289   - // 改变手机状态栏颜色
290   - // #ifndef MP-ALIPAY
291   - uni.setNavigationBarColor({
292   - frontColor: frontColor,
293   - backgroundColor: '#FFFFFF'
294   - });
295   - // #endif
296   - // #ifdef MP-ALIPAY
297   - uni.setNavigationBarColor({
298   - backgroundColor: frontColor == '#000000' ? '#ffffff' : '#000000'
299   - });
300   - // #endif
301   - }, 150);
302   -
  270 + // this.settingColor();
  271 + }
  272 + },
  273 + //设置手机状态栏颜色
  274 + settingColor() {
  275 + let navColor = this.navFontColor;
  276 + console.log(navColor, 'settingColor');
  277 + let frontColor = '#000000';
  278 + if (whiteList.includes(navColor)) {
  279 + frontColor = '#ffffff';
  280 + this.isWhite = true;
  281 + }
  282 + if (this.lastFrontColor == frontColor) {
  283 + return;
303 284 }
  285 + setTimeout(() => {
  286 + this.lastFrontColor = frontColor;
  287 + // 改变手机状态栏颜色
  288 + // #ifndef MP-ALIPAY
  289 + uni.setNavigationBarColor({
  290 + frontColor: frontColor,
  291 + backgroundColor: '#FFFFFF'
  292 + });
  293 + // #endif
  294 + // #ifdef MP-ALIPAY
  295 + uni.setNavigationBarColor({
  296 + backgroundColor: frontColor == '#000000' ? '#ffffff' : '#000000'
  297 + });
  298 + // #endif
  299 + }, 150);
304 300 }
305 301 }
  302 +};
306 303 </script>
307 304
308 305 <style scoped lang="scss">
309   - .u-flex {
310   - /* #ifndef APP-NVUE */
311   - display: flex;
312   - /* #endif */
313   - flex-direction: row;
314   - align-items: center;
315   - }
316   -
317   - .f-navbar {
318   - width: 750rpx;
  306 +.u-flex {
  307 + /* #ifndef APP-NVUE */
  308 + display: flex;
  309 + /* #endif */
  310 + flex-direction: row;
  311 + align-items: center;
  312 +}
319 313
320   - .f-fixed {
321   - position: fixed;
322   - top: 0;
323   - left: 0;
324   - right: 0;
325   - z-index: 1000;
326   - }
327   -
328   - .f-relative {
329   - position: relative;
330   - }
  314 +.f-navbar {
  315 + width: 750rpx;
331 316
332   - .bgColor {
333   - position: absolute;
334   - top: 0;
335   - left: 0;
336   - right: 0;
337   - }
  317 + .f-fixed {
  318 + position: fixed;
  319 + top: 0;
  320 + left: 0;
  321 + right: 0;
  322 + z-index: 1000;
  323 + }
338 324
339   - .content {
340   - position: absolute;
341   - top: 0;
342   - left: 0;
343   - right: 0;
344   - }
  325 + .f-relative {
  326 + position: relative;
  327 + }
345 328
346   - .title {
347   - text-align: center;
348   - color: #303133;
349   - }
  329 + .bgColor {
  330 + position: absolute;
  331 + top: 0;
  332 + left: 0;
  333 + right: 0;
  334 + }
350 335
351   - .center {
352   - margin: 0 auto;
353   - }
  336 + .content {
  337 + position: absolute;
  338 + top: 0;
  339 + left: 0;
  340 + right: 0;
  341 + }
354 342
355   - .left,
356   - .right {
357   - padding: 0 24rpx;
358   - position: absolute;
359   - top: 0;
360   - bottom: 0;
361   - }
  343 + .title {
  344 + text-align: center;
  345 + color: #303133;
  346 + }
362 347
363   - .left {
364   - left: 0;
  348 + .center {
  349 + margin: 0 auto;
  350 + }
365 351
366   - &--hover {
367   - opacity: 0.7;
368   - }
  352 + .left,
  353 + .right {
  354 + padding: 0 24rpx;
  355 + position: absolute;
  356 + top: 0;
  357 + bottom: 0;
  358 + }
369 359
370   - &__text {
371   - font-size: 30rpx;
372   - margin-left: 3px;
373   - }
  360 + .left {
  361 + left: 0;
374 362
375   - .iconBg {
376   - width: 50rpx;
377   - height: 50rpx;
378   - background: rgba(0, 0, 0, .4);
379   - border-radius: 25rpx;
380   - justify-content: center;
381   - }
  363 + &--hover {
  364 + opacity: 0.7;
382 365 }
383 366
384   - .right {
385   - right: 0;
  367 + &__text {
  368 + font-size: 30rpx;
  369 + margin-left: 3px;
386 370 }
387 371
388   - .u-home-arrow-left {
389   - justify-content: space-between;
390   - border-radius: 100px;
391   - padding: 3px 7px;
392   - opacity: .8;
393   - border: .5px solid #dadbde;
  372 + .iconBg {
  373 + width: 50rpx;
  374 + height: 50rpx;
  375 + background: rgba(0, 0, 0, 0.4);
  376 + border-radius: 25rpx;
  377 + justify-content: center;
394 378 }
395 379 }
  380 +
  381 + .right {
  382 + right: 0;
  383 + }
  384 +
  385 + .u-home-arrow-left {
  386 + justify-content: space-between;
  387 + border-radius: 100px;
  388 + padding: 3px 7px;
  389 + opacity: 0.8;
  390 + border: 0.5px solid #dadbde;
  391 + }
  392 +}
396 393 </style>
... ...
... ... @@ -111,7 +111,9 @@ export default {
111 111 ]
112 112 };
113 113 },
114   - onLoad() {},
  114 + onLoad() {
  115 + this.loadData();
  116 + },
115 117 created() {
116 118 //获取页面路径
117 119 let currentPages = getCurrentPages();
... ... @@ -130,23 +132,17 @@ export default {
130 132 page: 1,
131 133 pageSize: 10
132 134 };
133   - uni.$u.http
134   - .get('/yt/alarm', { params: httpData })
135   - .then(res => {
136   - this.list[2].badge = res.total;
137   - })
138   - .catch(e => {
139   - uni.$u.toast(e.data?.message);
140   - });
  135 + uni.$u.http.get('/yt/alarm', { params: httpData }).then(res => {
  136 + this.list[2].badge = res.total;
  137 + });
141 138 },
142 139 onTabbar(index) {
143   - if (index !== 5) {
144   - // this.loadData();
145   - }
146   - if (this.path !== this.list[index].url) {
147   - uni.switchTab({
148   - url: '/' + this.list[index].url
149   - });
  140 + if (this.list[index].url) {
  141 + if (this.path !== this.list[index].url) {
  142 + uni.switchTab({
  143 + url: '/' + this.list[index].url
  144 + });
  145 + }
150 146 }
151 147 }
152 148 }
... ...
1 1 import base from "@/config/baseUrl";
2 2 import store from "@/store";
3   -import { judgeLogin } from "@/config/login";
  3 +import {
  4 + judgeLogin
  5 +} from "@/config/login";
4 6
5 7 // 初始化请求配置
6 8 uni.$u.http.setConfig((config) => {
7   - const token =
8   - store.state.userInfo.isToken ||
9   - uni.getStorageSync("userInfo").isToken ||
10   - undefined;
11   - // #ifdef H5
12   - window.sessionStorage.getItem("userInfo").isToken;
13   - // #endif
14   - /* config 为默认全局配置*/
15   - config.baseURL = base.baseUrl; /* 根域名 */
16   - config.header = {
17   - "Content-Type": "application/json",
18   - Authorization: "Bearer " + token,
19   - };
20   - config.custom = {
21   - load: true, //是否显示加载动画
22   - isFactory: true, //true:返回的数据成功只返回data false:返回response
23   - catch: true, //默认数据返回不成功进入catch返回
24   - auth: true, //token
25   - };
26   - return config;
  9 + const token =
  10 + store.state.userInfo.isToken ||
  11 + uni.getStorageSync("userInfo").isToken ||
  12 + undefined;
  13 + // #ifdef H5
  14 + window.sessionStorage.getItem("userInfo").isToken;
  15 + // #endif
  16 + /* config 为默认全局配置*/
  17 + config.baseURL = base.baseUrl; /* 根域名 */
  18 + config.header = {
  19 + "Content-Type": "application/json",
  20 + Authorization: "Bearer " + token,
  21 + };
  22 + config.custom = {
  23 + load: true, //是否显示加载动画
  24 + isFactory: true, //true:返回的数据成功只返回data false:返回response
  25 + catch: true, //默认数据返回不成功进入catch返回
  26 + auth: true, //token
  27 + };
  28 + return config;
27 29 });
28 30
29 31 // 请求拦截
30 32 uni.$u.http.interceptors.request.use(
31   - (config) => {
32   - // 可使用async await 做异步操作
33   - // 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
34   - config.data = config.data || {};
35   - // 根据custom参数中配置的是否需要token,添加对应的请求头
36   - if (config?.custom?.auth) {
37   - config.header.Authorization =
38   - "Bearer " + store.state.userInfo.isToken ||
39   - uni.getStorageSync("userInfo").isToken ||
40   - undefined;
41   - }
42   - // console.log("请求开始", config);
43   - if (config?.custom?.load) {
44   - //打开加载动画
45   - store.commit("setLoadingShow", true);
46   - }
  33 + (config) => {
  34 + // 可使用async await 做异步操作
  35 + // 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
  36 + config.data = config.data || {};
  37 + // 根据custom参数中配置的是否需要token,添加对应的请求头
  38 + if (config?.custom?.auth) {
  39 + config.header.Authorization =
  40 + "Bearer " + store.state.userInfo.isToken ||
  41 + uni.getStorageSync("userInfo").isToken ||
  42 + undefined;
  43 + }
  44 + // console.log("请求开始", config);
  45 + if (config?.custom?.load) {
  46 + //打开加载动画
  47 + store.commit("setLoadingShow", true);
  48 + }
47 49
48   - return config;
49   - },
50   - (config) => {
51   - // 可使用async await 做异步操作
52   - return Promise.reject(config);
53   - }
  50 + return config;
  51 + },
  52 + (config) => {
  53 + // 可使用async await 做异步操作
  54 + return Promise.reject(config);
  55 + }
54 56 );
55 57
56 58 // 响应拦截
57 59 uni.$u.http.interceptors.response.use(
58   - (response) => {
59   - /* 对响应成功做点什么 可使用async await 做异步操作*/
60   - // 关闭加载动画
61   - store.commit("setLoadingShow", false);
62   - const data = response.data;
63   - // 自定义参数
64   - const custom = response.config?.custom;
65   - // code: 200、请求成功 其他,没有更多参数 401、被迫下线重新登录、
66   - if (response.statusCode == 200) {
67   - return Promise.resolve(data);
68   - // if (!custom.isFactory) {
69   - // return Promise.reject(response.data)
70   - // } else {
71   - // return data.data === undefined ? {} : Promise.reject(response.data)
72   - // }
73   - } else if (response.statusCode == 401) {
74   - //被迫下线重新登录
75   - // 清空登录信息
76   - store.commit("emptyUserInfo");
77   - // 20秒节流,弹窗登录
78   - uni.$u.throttle(judgeLogin(), 20000);
79   - return new Promise(() => {});
80   - } else {
81   - // 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
82   - if (custom.toast !== false) {
83   - uni.$u.toast(data.message || data.msg);
84   - }
85   - // 如果需要catch返回,则进行reject
86   - if (custom?.catch) {
87   - return Promise.reject(data);
88   - } else {
89   - // 否则返回一个pending中的promise,请求不会进入catch中
90   - return new Promise(() => {});
91   - }
92   - }
93   - },
94   - (response) => {
95   - // 关闭加载动画
96   - store.commit("setLoadingShow", false);
97   - // 对响应错误做点什么 (statusCode !== 200)
98   - let errorData = "请检查网络或服务器";
99   - let message = response.data?.message || response?.errMsg;
100   - if (message == "request:fail url not in domain list") {
101   - errorData = "检查请求域名是否添加了域名白名单";
102   - } else if (message == "request:fail timeout") {
103   - errorData = "请求超时:请检查网络";
104   - } else if (message == "Token has expired") {
105   - errorData = "Token失效,请重新登录";
106   - uni.reLaunch({
107   - url: "/publicLoginSubPage/public/login",
108   - });
109   - store.commit("emptyUserInfo");
110   - } else if (message == "Invalid username or password") {
111   - errorData = "用户名或者密码无效";
112   - uni.reLaunch({
113   - url: "/publicLoginSubPage/public/login",
114   - });
115   - store.commit("emptyUserInfo");
116   - } else {
117   - errorData = message || "请检查网络或服务器";
118   - }
119   - uni.$u.toast(errorData);
120   - return Promise.reject(response);
121   - }
  60 + (response) => {
  61 + /* 对响应成功做点什么 可使用async await 做异步操作*/
  62 + // 关闭加载动画
  63 + store.commit("setLoadingShow", false);
  64 + const data = response.data;
  65 + // 自定义参数
  66 + const custom = response.config?.custom;
  67 + // code: 200、请求成功 其他,没有更多参数 401、被迫下线重新登录、
  68 + if (response.statusCode == 200) {
  69 + return Promise.resolve(data);
  70 + // if (!custom.isFactory) {
  71 + // return Promise.reject(response.data)
  72 + // } else {
  73 + // return data.data === undefined ? {} : Promise.reject(response.data)
  74 + // }
  75 + } else if (response.statusCode == 401) {
  76 + //被迫下线重新登录
  77 + // 清空登录信息
  78 + store.commit("emptyUserInfo");
  79 + // 20秒节流,弹窗登录
  80 + uni.$u.throttle(judgeLogin(), 20000);
  81 + return new Promise(() => {});
  82 + } else {
  83 + // 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
  84 + if (custom.toast !== false) {
  85 + // uni.$u.toast(data.message || data.msg);
  86 + }
  87 + // 如果需要catch返回,则进行reject
  88 + if (custom?.catch) {
  89 + return Promise.reject(data);
  90 + } else {
  91 + // 否则返回一个pending中的promise,请求不会进入catch中
  92 + return new Promise(() => {});
  93 + }
  94 + }
  95 + },
  96 + (response) => {
  97 + // 关闭加载动画
  98 + store.commit("setLoadingShow", false);
  99 + // 对响应错误做点什么 (statusCode !== 200)
  100 + let errorData = "请检查网络或服务器";
  101 + let message = response.data?.message || response?.errMsg;
  102 + if (message == "request:fail url not in domain list") {
  103 + errorData = "检查请求域名是否添加了域名白名单";
  104 + } else if (message == "request:fail timeout") {
  105 + errorData = "请求超时:请检查网络";
  106 + } else if (message == "Token has expired") {
  107 + errorData = "Token失效,请重新登录";
  108 + uni.reLaunch({
  109 + url: "/publicLoginSubPage/public/login",
  110 + });
  111 + store.commit("emptyUserInfo");
  112 + } else if (message == "Invalid username or password") {
  113 + errorData = "用户名或者密码无效";
  114 + uni.reLaunch({
  115 + url: "/publicLoginSubPage/public/login",
  116 + });
  117 + store.commit("emptyUserInfo");
  118 + } else {
  119 + errorData = message || "请检查网络或服务器";
  120 + }
  121 + uni.$u.toast(errorData);
  122 + return Promise.reject(response);
  123 + }
122 124 );
... ...
... ... @@ -14,12 +14,6 @@
14 14 "navigationBarTitleText": "设备"
15 15 }
16 16 },
17   - // {
18   - // "path": "pages/device/deviceDetail",
19   - // "style": {
20   - // "navigationBarTitleText": "设备详情"
21   - // }
22   - // },
23 17 {
24 18 "path": "pages/device/org/org",
25 19 "style": {
... ...
1 1 <template>
2 2 <view class="alert-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
3 5 <f-navbar>
4 6 <view class="u-flex" slot="left">
5 7 <u-icon color="#fff"></u-icon>
... ... @@ -13,14 +15,12 @@
13 15 <view class="filter-icon"><image class="image" @click="openSearchDialog" src="../../static/shaixuan.png"></image></view>
14 16 </view>
15 17 </f-navbar>
16   - <!-- 公共组件-每个页面必须引入 -->
17   - <public-module></public-module>
18 18 <view @click="openOrg" class="org-sty">
19 19 <view class="org-item">
20   - <view class="u-flex item"><text class="text">组织关系</text></view>
  20 + <view class="u-flex item"><text class="text-bold">组织关系</text></view>
21 21 <view class="u-flex item-child">
22 22 <image class="image" src="../../static/org.png" mode=""></image>
23   - <text class="text">告警数:{{ alertTotal }}</text>
  23 + <text class="text-12">告警数:{{ alertTotal }}</text>
24 24 </view>
25 25 </view>
26 26 <view class="org-item "><image class="org-image" src="../../static/right-arrow.png"></image></view>
... ... @@ -30,15 +30,15 @@
30 30 <view class="device-list">
31 31 <view @click="openAlertDetail(item)" class="list-item" v-for="(item, index) in list" :key="index">
32 32 <view class="u-flex item">
33   - <view class="item-text">
34   - <text class="text-three">{{ item.deviceName == null ? '暂无数据' : item.deviceName }}</text>
  33 + <view class="item-text text-clip">
  34 + <text class="text-bold">{{ item.deviceName == null ? '暂无数据' : item.deviceName }}</text>
35 35 </view>
36 36 <view class="item-text">
37   - <text class="text">{{ item.details == null ? '暂无数据' : item.details.data }}</text>
  37 + <text class="text-muted">{{ item.details == null ? '暂无数据' : formatDetailText(item.details.data) }}</text>
38 38 </view>
39 39 <view class="item-text">
40   - <text class="text">
41   - {{
  40 + <text class="text-muted">
  41 + 告警状态:{{
42 42 item.status == 'CLEARED_UNACK'
43 43 ? '清除未确认'
44 44 : item.status == 'ACTIVE_UNACK'
... ... @@ -50,7 +50,7 @@
50 50 </text>
51 51 </view>
52 52 <view class="item-text">
53   - <text class="text-nine">{{ item.createdTime }}</text>
  53 + <text class="text-secondary">{{ item.createdTime }}</text>
54 54 </view>
55 55 </view>
56 56 <view class="item">
... ... @@ -58,6 +58,7 @@
58 58 <image class="right-image" :src="bindImageUrl(item.severity)"></image>
59 59 <view class="right-text">
60 60 <text
  61 + class="text-no-color"
61 62 :style="[
62 63 item.severity == 'CRITICAL'
63 64 ? { color: '#DE4437' }
... ... @@ -151,13 +152,7 @@
151 152 <view style="margin-top: 120rpx;">
152 153 <view class="u-flex popup-alarm-child">
153 154 <view>
154   - <u--form
155   - :label-style="{ 'font-size': '29rpx', 'margin-left': '10rpx' }"
156   - labelPosition="left"
157   - :model="timeData"
158   - :rules="rules"
159   - ref="form1"
160   - >
  155 + <u--form :label-style="{ 'font-size': '29rpx', 'margin-left': '10rpx' }" labelPosition="left" :model="timeData">
161 156 <u-form-item style="font-size: 14px" label="选择日期" prop="selectTime" labelWidth="80" borderBottom @click="openTime">
162 157 <u--input v-model="timeData.selectTime" placeholder="请选择日期" border="none"></u--input>
163 158 </u-form-item>
... ... @@ -421,6 +416,13 @@ export default {
421 416 url: '/alarmSubPage/alarmDetailPage/alarmDetail?data=' + JSON.stringify(obj)
422 417 // url: '/' + JSON.stringify(obj)
423 418 });
  419 + },
  420 + formatDetailText(e) {
  421 + //去除字符串双引号
  422 + const jsonStr = JSON.stringify(e);
  423 + const str = jsonStr.substring(1, jsonStr.length - 1);
  424 + const newStr = str.replace(/\"/g, '');
  425 + return newStr;
424 426 }
425 427 }
426 428 };
... ...
... ... @@ -55,8 +55,7 @@
55 55 }
56 56
57 57 .item-child {
58   - margin-top: 5rpx;
59   - margin-left: 15rpx;
  58 + margin-top: 28rpx;
60 59 flex-direction: row;
61 60
62 61 .image {
... ...
1 1 <template>
2   - <view class="personal">
3   - <!-- 公共组件-每个页面必须引入 -->
4   - <public-module></public-module>
5   - <view class="headBox">
6   - <!-- #ifdef MP -->
7   - <!-- 登录 -->
8   - <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30">
9   - <block v-if="userInfo.isToken">
10   - <view @click="openPersonalInfo" class="u-m-r-20"
11   - ><image
12   - class="avatar"
13   - mode="aspectFill"
14   - :src="userInfo.avatar || '/static/default.png'"
15   - ></image
16   - ></view>
17   - <view @click="openPersonalInfo" class="u-flex-1">
18   - <view class="nickName u-flex">
19   - <view class="name u-m-r-10" v-if="userInfo.realName">
20   - <text style="#FFFFFF;font-size: 18px;">{{
21   - userInfo.realName
22   - }}</text>
23   - </view>
24   - </view>
25   - <view style="#FFFFFF;font-size: 14px;" v-if="userInfo.phoneNumber"
26   - >手机号:{{ userInfo.phoneNumber | phone }}</view
27   - >
28   - <view v-else
29   - ><text style="#FFFFFF;font-size: 14px;">手机号:未绑定</text></view
30   - >
31   - </view>
32   - </block>
33   - <block v-else>
34   - <view class="u-m-r-20">
35   - <view class="avatar u-flex"
36   - ><u-icon name="account-fill" color="black" size="30"></u-icon
37   - ></view>
38   - </view>
39   - <view class="u-flex-1">
40   - <view @click="openLoginFunc" class="u-font-lg click-login"
41   - >请点击登录</view
42   - >
43   - <view @click="clickAccountFunc" class="detail"
44   - ><text class="text">绑定账号</text></view
45   - >
46   - </view>
47   - </block>
48   - <view
49   - ><u-icon name="arrow-right" color="black" size="13"></u-icon
50   - ></view>
51   - </view>
52   - <!-- #endif -->
53   - <!-- #ifndef MP -->
54   - <!-- 登录 -->
55   - <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30">
56   - <block v-if="userInfo.isToken">
57   - <view @click="openPersonalInfo" class="u-m-r-20"
58   - ><image
59   - class="avatar"
60   - mode="aspectFill"
61   - :src="userInfo.avatar || '/static/default.png'"
62   - ></image
63   - ></view>
64   - <view @click="openPersonalInfo" class="u-flex-1">
65   - <view class="nickName u-flex">
66   - <view class="name u-m-r-10" v-if="userInfo.realName">
67   - <text style="#FFFFFF;font-size: 18px;">{{
68   - userInfo.realName
69   - }}</text>
70   - </view>
71   - </view>
72   - <view style="#FFFFFF;font-size: 14px;" v-if="userInfo.phoneNumber"
73   - >手机号:{{ userInfo.phoneNumber | phone }}</view
74   - >
75   - <view v-else
76   - ><text style="#FFFFFF;font-size: 14px;">手机号:未绑定</text></view
77   - >
78   - </view>
79   - </block>
80   - <block v-else>
81   - <view class="u-m-r-20">
82   - <view class="avatar u-flex" style="justify-content: center"
83   - ><u-icon name="account-fill" color="black" size="30"></u-icon
84   - ></view>
85   - </view>
86   - <view class="u-flex-1">
87   - <view
88   - @click="openLoginFunc"
89   - class="u-font-lg"
90   - style="color: black; font-weight: bold"
91   - >登录</view
92   - >
93   - <view @click="clickAccountFunc" style="color: black" class="detail"
94   - >绑定账号</view
95   - >
96   - </view>
97   - </block>
98   - <view
99   - ><u-icon name="arrow-right" color="black" size="13"></u-icon
100   - ></view>
101   - </view>
102   - <!-- #endif -->
103   - </view>
104   - <view class="u-flex my-nav">
105   - <view class="nav-main">
106   - <view
107   - @click="onTokenJump('/sysNotifySubPage/sysNotifyPage/systemNotify')"
108   - class="u-flex nav-link"
109   - >
110   - <view class="nav-image"
111   - ><image class="image" src="../../static/sys-not.png"></image
112   - ></view>
113   - <view class="nav-center"><text class="text">系统通知</text></view>
114   - <view class="nav-right"
115   - ><image class="image" src="../../static/arrow-right.png"></image
116   - ></view>
117   - </view>
118   - <view
119   - @click="onTokenJump('/feedBackSubPage/feedback/feedback')"
120   - class="u-flex nav-link"
121   - >
122   - <view class="nav-image"
123   - ><image class="image" src="../../static/find-sugg.png"></image
124   - ></view>
125   - <view class="nav-center"><text class="text">意见反馈</text></view>
126   - <view class="nav-right"
127   - ><image class="image" src="../../static/arrow-right.png"></image
128   - ></view>
129   - </view>
130   - </view>
131   - <view
132   - v-if="userInfo.isToken"
133   - class="u-flex"
134   - style="justify-content: center; width: 600rpx"
135   - >
136   - <u-button
137   - @click="onLoginoutFunc"
138   - type="primary"
139   - shape="circle"
140   - text="退出账号"
141   - ></u-button>
142   - </view>
143   - </view>
144   - <!-- 绑定账号 -->
145   - <view>
146   - <u-modal :showConfirmButton="false" :show="show" :title="title">
147   - <view v-if="!bindPhone" class="loginPhone">
148   - <view class="form-row"
149   - ><u--input
150   - shape="circle"
151   - class="input"
152   - prefixIcon="account-fill"
153   - type="text"
154   - placeholder="登录账号"
155   - v-model="account"
156   - ></u--input
157   - ></view>
158   - <view class="form-row item-bind">
159   - <u--input
160   - class="input"
161   - shape="circle"
162   - prefixIcon="lock-fill"
163   - suffixIconStyle="color: #909399"
164   - type="password"
165   - placeholder="登录密码"
166   - v-model="password"
167   - @change="passwordChange"
168   - ></u--input>
169   - </view>
170   - <view class="u-flex item-phone">
171   - <view class="phone-hide">手机验证码登录</view>
172   - <view class="bind-phone-text" @click="bindPhoneFunc">手机绑定</view>
173   - </view>
174   - </view>
175   - <view v-else class="loginPhone">
176   - <view class="form-row">
177   - <u--input
178   - shape="circle"
179   - class="input"
180   - type="text"
181   - v-model="phone"
182   - placeholder="请输入手机号码"
183   - placeholder-style="font-weight:normal;color:#bbbbbb;"
184   - ></u--input>
185   - </view>
186   - <view class="form-row row-top">
187   - <u--input
188   - shape="circle"
189   - class="input"
190   - type="text"
191   - v-model="vCode"
192   - placeholder="请输入验证码"
193   - placeholder-style="font-weight:normal;color:#bbbbbb;"
194   - ></u--input>
195   - <view
196   - style="color: #377dff"
197   - class="getvcode"
198   - :class="{ forhidden: readonly }"
199   - @click="getVcode"
200   - >{{ codeText }}</view
201   - >
202   - </view>
203   - <view class="u-flex item-phone">
204   - <view class="phone-hide">手机验证码登录</view>
205   - <view class="bind-phone-text" @click="bindAccountFunc"
206   - >账号绑定</view
207   - >
208   - </view>
209   - </view>
210   - <view class="bottom-content">
211   - <view class="u-flex content">
212   - <view class="cancel"
213   - ><u-button
214   - @click="show = false"
215   - type="info"
216   - shape="circle"
217   - text="取消"
218   - ></u-button
219   - ></view>
220   - <view class="confrim"
221   - ><u-button
222   - @click="bindConfirm"
223   - type="primary"
224   - shape="circle"
225   - text="确认"
226   - ></u-button
227   - ></view>
228   - </view>
229   - </view>
230   - </u-modal>
231   - </view>
232   - <!-- 退出登录 -->
233   - <view>
234   - <u-popup
235   - bgColor="transparent"
236   - :overlay="true"
237   - :show="showLogout"
238   - mode="bottom"
239   - >
240   - <view class="u-flex logout-main">
241   - <view class="main"
242   - ><text style="color: #999999">确定要退出当前账号?</text></view
243   - >
244   - <view @click="logoutBtn" class="main"
245   - ><text style="color: #f95e5a">退出登录</text></view
246   - >
247   - <view class="main"
248   - ><text @click="closeLogout" style="color: #3478f7">取消</text></view
249   - >
250   - </view>
251   - </u-popup>
252   - </view>
253   - <!-- 退出登录 -->
254   - <f-tabbar></f-tabbar>
255   - </view>
  2 + <view class="personal">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <view class="headBox">
  6 + <!-- #ifdef MP -->
  7 + <!-- 登录 -->
  8 + <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30">
  9 + <block v-if="userInfo.isToken">
  10 + <view @click="openPersonalInfo" class="u-m-r-20"><image class="avatar" mode="aspectFill" :src="userInfo.avatar || '/static/default.png'"></image></view>
  11 + <view @click="openPersonalInfo" class="u-flex-1">
  12 + <view class="nickName u-flex">
  13 + <view class="name u-m-r-10" v-if="userInfo.realName">
  14 + <text style="#FFFFFF;font-size: 18px;">{{ userInfo.realName }}</text>
  15 + </view>
  16 + </view>
  17 + <view style="#FFFFFF;font-size: 14px;" v-if="userInfo.phoneNumber">手机号:{{ userInfo.phoneNumber | phone }}</view>
  18 + <view v-else><text style="#FFFFFF;font-size: 14px;">手机号:未绑定</text></view>
  19 + </view>
  20 + </block>
  21 + <block v-else>
  22 + <view class="u-m-r-20">
  23 + <view class="avatar u-flex"><u-icon name="account-fill" color="black" size="30"></u-icon></view>
  24 + </view>
  25 + <view class="u-flex-1">
  26 + <view @click="openLoginFunc" class="u-font-lg click-login">请点击登录</view>
  27 + <view @click="clickAccountFunc" class="detail"><text class="text">绑定账号</text></view>
  28 + </view>
  29 + </block>
  30 + <view><u-icon name="arrow-right" color="black" size="13"></u-icon></view>
  31 + </view>
  32 + <!-- #endif -->
  33 + <!-- #ifndef MP -->
  34 + <!-- 登录 -->
  35 + <view class="u-flex u-p-l-30 u-p-r-20 u-p-t-75 u-p-b-30">
  36 + <block v-if="userInfo.isToken">
  37 + <view @click="openPersonalInfo" class="u-m-r-20"><image class="avatar" mode="aspectFill" :src="userInfo.avatar || '/static/default.png'"></image></view>
  38 + <view @click="openPersonalInfo" class="u-flex-1">
  39 + <view class="nickName u-flex">
  40 + <view class="name u-m-r-10" v-if="userInfo.realName">
  41 + <text style="#FFFFFF;font-size: 18px;">{{ userInfo.realName }}</text>
  42 + </view>
  43 + </view>
  44 + <view style="#FFFFFF;font-size: 14px;" v-if="userInfo.phoneNumber">手机号:{{ userInfo.phoneNumber | phone }}</view>
  45 + <view v-else><text style="#FFFFFF;font-size: 14px;">手机号:未绑定</text></view>
  46 + </view>
  47 + </block>
  48 + <block v-else>
  49 + <view class="u-m-r-20">
  50 + <view class="avatar u-flex" style="justify-content: center"><u-icon name="account-fill" color="black" size="30"></u-icon></view>
  51 + </view>
  52 + <view class="u-flex-1">
  53 + <view @click="openLoginFunc" class="u-font-lg" style="color: black; font-weight: bold">登录</view>
  54 + <view @click="clickAccountFunc" style="color: black" class="detail">绑定账号</view>
  55 + </view>
  56 + </block>
  57 + <view><u-icon name="arrow-right" color="black" size="13"></u-icon></view>
  58 + </view>
  59 + <!-- #endif -->
  60 + </view>
  61 + <view class="u-flex my-nav">
  62 + <view class="nav-main">
  63 + <view @click="onTokenJump('/sysNotifySubPage/sysNotifyPage/systemNotify')" class="u-flex nav-link">
  64 + <view class="nav-image"><image class="image" src="../../static/sys-not.png"></image></view>
  65 + <view class="nav-center"><text class="text">系统通知</text></view>
  66 + <view class="nav-right"><image class="image" src="../../static/arrow-right.png"></image></view>
  67 + </view>
  68 + <view @click="onTokenJump('/feedBackSubPage/feedback/feedback')" class="u-flex nav-link">
  69 + <view class="nav-image"><image class="image" src="../../static/find-sugg.png"></image></view>
  70 + <view class="nav-center"><text class="text">意见反馈</text></view>
  71 + <view class="nav-right"><image class="image" src="../../static/arrow-right.png"></image></view>
  72 + </view>
  73 + </view>
  74 + <view v-if="userInfo.isToken || userInfo" class="u-flex" style="justify-content: center; width: 600rpx">
  75 + <u-button @click.top="onLoginoutFunc" type="primary" shape="circle" text="退出账号"></u-button>
  76 + </view>
  77 + </view>
  78 + <!-- 绑定账号 -->
  79 + <view>
  80 + <u-modal :showConfirmButton="false" :show="show" :title="title">
  81 + <view v-if="!bindPhone" class="loginPhone">
  82 + <view class="form-row"><u--input shape="circle" class="input" prefixIcon="account-fill" type="text" placeholder="登录账号" v-model="account"></u--input></view>
  83 + <view class="form-row item-bind">
  84 + <u--input
  85 + class="input"
  86 + shape="circle"
  87 + prefixIcon="lock-fill"
  88 + suffixIconStyle="color: #909399"
  89 + type="password"
  90 + placeholder="登录密码"
  91 + v-model="password"
  92 + @change="passwordChange"
  93 + ></u--input>
  94 + </view>
  95 + <view class="u-flex item-phone">
  96 + <view class="phone-hide">手机验证码登录</view>
  97 + <view class="bind-phone-text" @click="bindPhoneFunc">手机绑定</view>
  98 + </view>
  99 + </view>
  100 + <view v-else class="loginPhone">
  101 + <view class="form-row">
  102 + <u--input
  103 + shape="circle"
  104 + class="input"
  105 + type="text"
  106 + v-model="phone"
  107 + placeholder="请输入手机号码"
  108 + placeholder-style="font-weight:normal;color:#bbbbbb;"
  109 + ></u--input>
  110 + </view>
  111 + <view class="form-row row-top">
  112 + <u--input
  113 + shape="circle"
  114 + class="input"
  115 + type="text"
  116 + v-model="vCode"
  117 + placeholder="请输入验证码"
  118 + placeholder-style="font-weight:normal;color:#bbbbbb;"
  119 + ></u--input>
  120 + <view style="color: #377dff" class="getvcode" :class="{ forhidden: readonly }" @click="getVcode">{{ codeText }}</view>
  121 + </view>
  122 + <view class="u-flex item-phone">
  123 + <view class="phone-hide">手机验证码登录</view>
  124 + <view class="bind-phone-text" @click="bindAccountFunc">账号绑定</view>
  125 + </view>
  126 + </view>
  127 + <view class="bottom-content">
  128 + <view class="u-flex content">
  129 + <view class="cancel"><u-button @click="show = false" type="info" shape="circle" text="取消"></u-button></view>
  130 + <view class="confrim"><u-button @click="bindConfirm" type="primary" shape="circle" text="确认"></u-button></view>
  131 + </view>
  132 + </view>
  133 + </u-modal>
  134 + </view>
  135 + <!-- 退出登录 -->
  136 + <view>
  137 + <u-popup bgColor="transparent" :overlay="true" :show="showLogout" mode="bottom">
  138 + <view class="u-flex logout-main">
  139 + <view class="main"><text style="color: #999999">确定要退出当前账号?</text></view>
  140 + <view @click.top="logoutBtn" class="main"><text style="color: #f95e5a">退出登录</text></view>
  141 + <view class="main"><text @click.top="closeLogout" style="color: #3478f7">取消</text></view>
  142 + </view>
  143 + </u-popup>
  144 + </view>
  145 + <!-- 退出登录 -->
  146 + <f-tabbar></f-tabbar>
  147 + </view>
256 148 </template>
257 149
258 150 <script>
259 151 var clear;
260   -import base from "@/config/baseUrl";
261   -import fTabbar from "@/components/module/f-tabbar/f-tabbar";
262   -import fNavbar from "@/components/module/f-navbar/f-navbar";
263   -import { mapState, mapMutations } from "vuex";
  152 +import base from '@/config/baseUrl';
  153 +import fTabbar from '@/components/module/f-tabbar/f-tabbar';
  154 +import fNavbar from '@/components/module/f-navbar/f-navbar';
  155 +import { mapState, mapMutations } from 'vuex';
264 156
265 157 export default {
266   - components: {
267   - fTabbar,
268   - fNavbar,
269   - },
270   - data() {
271   - return {
272   - PrimaryColor: "#0079fe", //主题色
273   - showLogout: false,
274   - readonly: false,
275   - codeText: "获取验证码",
276   - phone: "", //号码
277   - vCode: "", //验证码
278   - tips: "验证码",
279   - bindPhone: false,
280   - show: false,
281   - title: "绑定账号",
282   - systemInfo: base.systemInfo,
283   - PrimaryButtonColor: "#0079fe", //主题色
284   - };
285   - },
286   - onLoad() {
287   - // 隐藏原生的tabbar
288   - uni.hideTabBar();
289   - },
290   - computed: {
291   - ...mapState(["userInfo"]),
292   - },
293   - methods: {
294   - ...mapMutations(["emptyUserInfo"]),
295   - // 跳转前判断登录
296   - onTokenJump(url) {
297   - this.judgeLogin(() => {
298   - uni.navigateTo({
299   - url: url,
300   - });
301   - });
302   - },
303   - onJump(url) {
304   - uni.navigateTo({
305   - url: url,
306   - });
307   - },
308   - openLoginFunc() {
309   - uni.navigateTo({
310   - url: "/publicLoginSubPage/public/login",
311   - });
312   - },
313   - openPersonalInfo() {
314   - let obj = {
315   - data: this.userInfo,
316   - };
317   - uni.navigateTo({
318   - url: "/publicLoginSubPage/other/set?data=" + JSON.stringify(obj),
319   - });
320   - },
321   - clickAccountFunc() {
322   - this.show = true;
323   - },
324   - bindConfirm() {},
325   - bindPhoneFunc() {
326   - this.bindPhone = true;
327   - },
328   - bindAccountFunc() {
329   - this.bindPhone = false;
330   - },
331   - //验证码按钮文字状态
332   - getCodeState() {
333   - const _this = this;
334   - this.readonly = true;
335   - this.codeText = "60S后重新获取";
336   - var s = 60;
337   - clear = setInterval(() => {
338   - s--;
339   - _this.codeText = s + "S后重新获取";
340   - if (s <= 0) {
341   - clearInterval(clear);
342   - _this.codeText = "获取验证码";
343   - _this.readonly = false;
344   - }
345   - }, 1000);
346   - },
347   - //获取验证码
348   - getVcode() {
349   - console.log("getVcode");
350   - if (this.readonly) {
351   - uni.showToast({
352   - title: "验证码已发送~",
353   - icon: "none",
354   - });
355   - return;
356   - }
357   - if (this.phone == "") {
358   - uni.showToast({
359   - title: "请输入手机号~",
360   - icon: "none",
361   - });
362   - return;
363   - }
364   - const phoneRegular = /^1\d{10}$/;
365   - if (!phoneRegular.test(this.phone)) {
366   - uni.showToast({
367   - title: "手机号格式不正确~",
368   - icon: "none",
369   - });
370   - return;
371   - }
372   - let httpData = {};
373   - // 获取验证码接口
374   - // uni.$u.http.post('您的接口', httpData).then(res => {
375   - this.getCodeState(); //开始倒计时
376   - // })
377   - },
378   - onLoginoutFunc() {
379   - this.showLogout = true;
380   - },
381   - closeLogout() {
382   - this.showLogout = false;
383   - },
384   - logoutBtn() {
385   - let that = this;
386   - uni.showModal({
387   - title: "退出登录",
388   - content: "你确定退出登录吗?",
389   - success(res) {
390   - if (res.confirm) {
391   - that.emptyUserInfo();
392   - that.showLogout = false;
393   - setTimeout(() => {
394   - uni.navigateTo({
395   - url: "/publicLoginSubPage/public/login",
396   - });
397   - }, 500);
398   - } else if (res.cancel) {
399   - }
400   - },
401   - });
402   - },
403   - },
  158 + components: {
  159 + fTabbar,
  160 + fNavbar
  161 + },
  162 + data() {
  163 + return {
  164 + PrimaryColor: '#0079fe', //主题色
  165 + showLogout: false,
  166 + readonly: false,
  167 + codeText: '获取验证码',
  168 + phone: '', //号码
  169 + vCode: '', //验证码
  170 + tips: '验证码',
  171 + bindPhone: false,
  172 + show: false,
  173 + title: '绑定账号',
  174 + systemInfo: base.systemInfo,
  175 + PrimaryButtonColor: '#0079fe' //主题色
  176 + };
  177 + },
  178 + onLoad() {
  179 + // 隐藏原生的tabbar
  180 + uni.hideTabBar();
  181 + },
  182 + computed: {
  183 + ...mapState(['userInfo'])
  184 + },
  185 + methods: {
  186 + ...mapMutations(['emptyUserInfo']),
  187 + // 跳转前判断登录
  188 + onTokenJump(url) {
  189 + this.judgeLogin(() => {
  190 + uni.navigateTo({
  191 + url: url
  192 + });
  193 + });
  194 + },
  195 + onJump(url) {
  196 + uni.navigateTo({
  197 + url: url
  198 + });
  199 + },
  200 + openLoginFunc() {
  201 + uni.navigateTo({
  202 + url: '/publicLoginSubPage/public/login'
  203 + });
  204 + },
  205 + openPersonalInfo() {
  206 + let obj = {
  207 + data: this.userInfo
  208 + };
  209 + uni.navigateTo({
  210 + url: '/publicLoginSubPage/other/set?data=' + JSON.stringify(obj)
  211 + });
  212 + },
  213 + clickAccountFunc() {
  214 + this.show = true;
  215 + },
  216 + bindConfirm() {},
  217 + bindPhoneFunc() {
  218 + this.bindPhone = true;
  219 + },
  220 + bindAccountFunc() {
  221 + this.bindPhone = false;
  222 + },
  223 + //验证码按钮文字状态
  224 + getCodeState() {
  225 + const _this = this;
  226 + this.readonly = true;
  227 + this.codeText = '60S后重新获取';
  228 + var s = 60;
  229 + clear = setInterval(() => {
  230 + s--;
  231 + _this.codeText = s + 'S后重新获取';
  232 + if (s <= 0) {
  233 + clearInterval(clear);
  234 + _this.codeText = '获取验证码';
  235 + _this.readonly = false;
  236 + }
  237 + }, 1000);
  238 + },
  239 + //获取验证码
  240 + getVcode() {
  241 + console.log('getVcode');
  242 + if (this.readonly) {
  243 + uni.showToast({
  244 + title: '验证码已发送~',
  245 + icon: 'none'
  246 + });
  247 + return;
  248 + }
  249 + if (this.phone == '') {
  250 + uni.showToast({
  251 + title: '请输入手机号~',
  252 + icon: 'none'
  253 + });
  254 + return;
  255 + }
  256 + const phoneRegular = /^1\d{10}$/;
  257 + if (!phoneRegular.test(this.phone)) {
  258 + uni.showToast({
  259 + title: '手机号格式不正确~',
  260 + icon: 'none'
  261 + });
  262 + return;
  263 + }
  264 + let httpData = {};
  265 + // 获取验证码接口
  266 + // uni.$u.http.post('您的接口', httpData).then(res => {
  267 + this.getCodeState(); //开始倒计时
  268 + // })
  269 + },
  270 + onLoginoutFunc() {
  271 + this.showLogout = true;
  272 + },
  273 + closeLogout() {
  274 + this.showLogout = false;
  275 + },
  276 + logoutBtn() {
  277 + let that = this;
  278 + uni.showModal({
  279 + title: '退出登录',
  280 + content: '你确定退出登录吗?',
  281 + success(res) {
  282 + if (res.confirm) {
  283 + that.emptyUserInfo();
  284 + that.showLogout = false;
  285 + setTimeout(() => {
  286 + uni.navigateTo({
  287 + url: '/publicLoginSubPage/public/login'
  288 + });
  289 + }, 500);
  290 + } else if (res.cancel) {
  291 + }
  292 + }
  293 + });
  294 + }
  295 + }
404 296 };
405 297 </script>
406 298
407 299 <style lang="scss" scoped>
408   -@import "./static/personal.scss";
  300 +@import './static/personal.scss';
409 301 </style>
... ...
... ... @@ -153,11 +153,12 @@ export default {
153 153 });
154 154 return;
155 155 }
156   - //限制图片类型
157   - let resType = res.tempFiles[0].type.substring(0, 5);
158   - if (resType != 'image' || res.tempFiles[0].type.substring(6, 7) == 'g') {
  156 + //获取图片扩展名
  157 + const fileTxt = res.tempFilePaths[0].split('.').pop();
  158 + const judgeType = fileTxt == 'jpg' || fileTxt == 'jpeg' || fileTxt == 'png';
  159 + if (!judgeType) {
159 160 uni.showToast({
160   - title: '限制图片类型以及过滤git图',
  161 + title: '请上传指定图片类型(jpg、jpeg、png)',
161 162 icon: 'none',
162 163 duration: 2000,
163 164 mask: true
... ...
... ... @@ -19,7 +19,7 @@
19 19 <view class="form-row u-flex">
20 20 <u-icon name="lock-fill"></u-icon>
21 21 <view class="v-input"><input type="text" v-model="loginForm.password" maxlength="32" placeholder="请输入登录密码" :password="!showPassword" /></view>
22   - <view class="v-password"><u-icon @click="showPasswordMode" :name="showPassword ? 'eye-fill' : 'eye-off'"></u-icon></view>
  22 + <view class="v-password" @click="showPasswordMode"><u-icon :name="showPassword ? 'eye-fill' : 'eye-off'"></u-icon></view>
23 23 <u-icon></u-icon>
24 24 </view>
25 25 <button class="submit" size="default" @click="onSubmitFunc"><text class="text">登录</text></button>
... ... @@ -123,9 +123,17 @@ export default {
123 123 title: '登录成功~',
124 124 icon: 'none'
125 125 }).then(res => {
126   - uni.reLaunch({
127   - url: '/pages/personal/personal'
128   - });
  126 + /**
  127 + * 有些时候不起作用
  128 + */
  129 + // uni.navigateBack({
  130 + // delta: 1
  131 + // });
  132 + // #ifdef APP-PLUS||MP
  133 + uni.reLaunch({
  134 + url: '/pages/personal/personal'
  135 + });
  136 + // #endif
129 137 });
130 138 this.saveUserInfo();
131 139 }
... ...
... ... @@ -6,7 +6,8 @@ text,
6 6 button,
7 7 image,
8 8 textarea,
9   -scroll-view,input {
  9 +scroll-view,
  10 +input {
10 11 box-sizing: border-box;
11 12 }
12 13 image {
... ... @@ -15,35 +16,111 @@ image {
15 16 button {
16 17 margin: 0;
17 18 padding: 0;
18   - background-color: #FFFF;
  19 + background-color: #ffff;
19 20 }
20 21 button::after {
21 22 border: none;
22 23 }
23 24 /* #endif */
24 25 /* #ifdef MP-ALIPAY */
25   -input{
26   - background: transparent;
  26 +input {
  27 + background: transparent;
27 28 }
28   -button{
29   - border:none;
  29 +button {
  30 + border: none;
30 31 }
31 32 /* #endif */
32   -.u-flex{
33   - /* #ifndef APP-NVUE */
34   - display: flex;
35   - /* #endif */
36   - flex-direction: row;
37   - align-items: center;
  33 +.u-flex {
  34 + /* #ifndef APP-NVUE */
  35 + display: flex;
  36 + /* #endif */
  37 + flex-direction: row;
  38 + align-items: center;
38 39 }
39 40 .u-flex-m {
40   - -webkit-box-flex: 1;
41   - -webkit-flex: 1;
42   - flex: 1;
43   - overflow: hidden
  41 + -webkit-box-flex: 1;
  42 + -webkit-flex: 1;
  43 + flex: 1;
  44 + overflow: hidden;
44 45 }
45 46 .scroll-view_H {
46   - white-space: nowrap;
  47 + white-space: nowrap;
  48 +}
  49 +///////////////////////////////////////////////////////////////小程序、app抽取公共样式/////////////////////////////////////////////////////////////////////
  50 +//通用(设备、告警、摄像头分页头部组织和设备数和设备、告警里面的详情(左边的文本)
  51 +.text-org-bold {
  52 + color: #333333;
  53 + font-family: PingFangSC-Medium, PingFang SC;
  54 + font-weight: 400;
  55 + font-size: 15px;
  56 +}
  57 +.text-org-total {
  58 + color: #666666;
  59 + font-family: PingFangSC-Medium, PingFang SC;
  60 + font-weight: 400;
  61 + font-size: 12px;
  62 +}
  63 +//通用(设备、告警分页)第一个文本
  64 +.text-bold {
  65 + color: #333333;
  66 + font-family: PingFangSC-Medium, PingFang SC;
  67 + font-weight: 500;
  68 + font-size: 15px;
  69 +}
  70 +//(设备、告警,适用设备详情基础信息文本(右边的值的文本))第二个文本
  71 +.text-device-muted {
  72 + font-size: 14px;
  73 + font-family: PingFangSC-Regular, PingFang SC;
  74 + font-weight: 400;
  75 + color: #666666;
  76 +}
  77 +//(设备不适用告警)左边在线离线文本
  78 +.text-device-color {
  79 + font-size: 13px;
  80 + font-family: PingFangSC-Regular, PingFang SC;
  81 + font-weight: 400;
  82 +}
  83 +//告警抽取(通用设备顶部的筛选文本)
  84 +.text-muted {
  85 + font-size: 14px;
  86 + font-family: PingFangSC-Regular, PingFang SC;
  87 + font-weight: 400;
  88 + color: #333333;
  89 +}
  90 +//告警抽取
  91 +.text-secondary {
  92 + font-size: 14px;
  93 + font-family: PingFangSC-Regular, PingFang SC;
  94 + font-weight: 400;
  95 + color: #999999;
  96 +}
  97 +//告警抽取
  98 +.text-no-color {
  99 + font-size: 14px;
  100 + font-family: PingFangSC-Regular, PingFang SC;
  101 + font-weight: 400;
  102 +}
  103 +//告警抽取
  104 +.text-12 {
  105 + font-size: 12px;
  106 + font-family: PingFangSC-Regular, PingFang SC;
  107 + font-weight: 400;
  108 +}
  109 +//文本溢出(通用)
  110 +.text-clip {
  111 + text-overflow: ellipsis;
  112 + overflow: hidden;
  113 + text-overflow: ellipsis;
  114 + white-space: nowrap;
  115 +}
  116 +//通用按钮提交(border框)
  117 +.btn-border {
  118 + background: #377dff;
  119 + border-radius: 20px !important;
  120 +}
  121 +//通用所有边框
  122 +.border-line {
  123 + border-radius: 20px;
47 124 }
48 125
49 126 // 定义flex等分
... ... @@ -55,54 +132,56 @@ button{
55 132
56 133 // 定义内外边距,历遍1-80
57 134 @for $i from 0 through 80 {
58   - // 定义字体大小
59   - .u-f-s-#{$i} {
60   - font-size: $i + rpx!important;
61   - }
  135 + // 定义字体大小
  136 + .u-f-s-#{$i} {
  137 + font-size: $i + rpx !important;
  138 + }
62 139 // 只要双数和能被5除尽的数
63 140 @if $i % 2 == 0 or $i % 5 == 0 {
64 141 // 得出:u-margin-30或者u-m-30
65   - .u-margin-#{$i}, .u-m-#{$i} {
66   - margin: $i + rpx!important;
  142 + .u-margin-#{$i},
  143 + .u-m-#{$i} {
  144 + margin: $i + rpx !important;
67 145 }
68   -
  146 +
69 147 // 得出:u-padding-30或者u-p-30
70   - .u-padding-#{$i}, .u-p-#{$i} {
71   - padding: $i + rpx!important;
  148 + .u-padding-#{$i},
  149 + .u-p-#{$i} {
  150 + padding: $i + rpx !important;
72 151 }
73   -
  152 +
74 153 @each $short, $long in l left, t top, r right, b bottom {
75 154 // 缩写版,结果如: u-m-l-30
76 155 // 定义外边距
77 156 .u-m-#{$short}-#{$i} {
78   - margin-#{$long}: $i + rpx!important;
  157 + margin-#{$long}: $i + rpx !important;
79 158 }
80   -
  159 +
81 160 // 定义内边距
82 161 .u-p-#{$short}-#{$i} {
83   - padding-#{$long}: $i + rpx!important;
  162 + padding-#{$long}: $i + rpx !important;
84 163 }
85   -
  164 +
86 165 // 完整版,结果如:u-margin-left-30
87 166 // 定义外边距
88 167 .u-margin-#{$long}-#{$i} {
89   - margin-#{$long}: $i + rpx!important;
  168 + margin-#{$long}: $i + rpx !important;
90 169 }
91   -
  170 +
92 171 // 定义内边距
93 172 .u-padding-#{$long}-#{$i} {
94   - padding-#{$long}: $i + rpx!important;
  173 + padding-#{$long}: $i + rpx !important;
95 174 }
96 175 }
97 176 }
98 177 }
99 178 @keyframes show {
100   - 0% {
101   - opacity: 0;
102   - transform: translateY(50px);
103   - }
104   - 100% {
105   - opacity: 1;
106   - transform: translateY(0px);
107   - }
108   -}
\ No newline at end of file
  179 + 0% {
  180 + opacity: 0;
  181 + transform: translateY(50px);
  182 + }
  183 + 100% {
  184 + opacity: 1;
  185 + transform: translateY(0px);
  186 + }
  187 +}
... ...
... ... @@ -4,18 +4,20 @@
4 4 <public-module></public-module>
5 5 <view class="notify-column">
6 6 <view class="u-flex column">
7   - <text class="text">{{ notifyList.receiverName }}</text>
  7 + <text class="text">{{ notifyList.title }}</text>
8 8 </view>
9 9 <view class="column-list">
10 10 <u-list height="140rpx">
11 11 <u-list-item>
12   - <u-cell :value="`${notifyList.createTime}`" :title="`${notifyList.receiverName}`">
13   - <u-avatar slot="icon" shape="circle" size="35" :src="avatar"></u-avatar>
  12 + <u-cell :value="`${notifyList.senderDate}`" :title="`${notifyList.senderName}`">
  13 + <u-avatar slot="icon" shape="circle" size="35" :src="notifyList.avatar"></u-avatar>
14 14 </u-cell>
15 15 </u-list-item>
16 16 </u-list>
17 17 <view class="bottom-text">
18   - <text class="text">{{ notifyList.receiverName }}</text>
  18 + <!-- 富文本解析 -->
  19 + <u-parse :content="notifyList.content"></u-parse>
  20 + <!-- 富文本解析 -->
19 21 </view>
20 22 </view>
21 23 </view>
... ... @@ -32,8 +34,7 @@ export default {
32 34 },
33 35 data() {
34 36 return {
35   - notifyList: {},
36   - avatar: ''
  37 + notifyList: {}
37 38 };
38 39 },
39 40 onLoad(e) {
... ... @@ -41,24 +42,10 @@ export default {
41 42 uni.hideTabBar();
42 43 if (e.data !== null) {
43 44 let params = JSON.parse(e.data);
44   - this.avatar = params.avatar;
45   - this.loadData(params.id);
  45 + if (params) this.notifyList = params;
46 46 }
47 47 },
48   - methods: {
49   - loadData(e) {
50   - uni.$u.http
51   - .get(`/yt/noticeUser/${e}`)
52   - .then(res => {
53   - if (res) {
54   - this.notifyList = res;
55   - }
56   - })
57   - .catch(e => {
58   - uni.$u.toast(e.data?.message);
59   - });
60   - }
61   - }
  48 + methods: {}
62 49 };
63 50 </script>
64 51
... ...
... ... @@ -3,7 +3,7 @@
3 3 <!-- 公共组件-每个页面必须引入 -->
4 4 <public-module></public-module>
5 5 <view>
6   - <u--form labelPosition="left" :model="model1" :rules="rules" ref="form1">
  6 + <u--form labelPosition="left" :model="model1" ref="form1">
7 7 <u-form-item label="类型" prop="userInfo.sex" @click="openTypeClick" ref="item1">
8 8 <u--input v-model="model1.userInfo.type" placeholder="请选择类型" border="surround"></u--input>
9 9 <u-icon slot="right" name="arrow-right"></u-icon>
... ... @@ -14,16 +14,16 @@
14 14 <view class="notify-main">
15 15 <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
16 16 <view class="u-flex main">
17   - <view @click="clickNotifyDetail(item)" class="u-flex main-item" v-for="(item, index) in list" :key="index">
  17 + <view @click="clickNotifyDetail(item.sysNotice)" class="u-flex main-item" v-for="(item, index) in list" :key="index">
18 18 <view class="u-flex item">
19   - <view class="item-avatar"><u-avatar class="avatar" shape="circle" size="40" :src="item.avatar"></u-avatar></view>
  19 + <view class="item-avatar"><u-avatar class="avatar" shape="circle" size="40" :src="item.sysNotice.avatar"></u-avatar></view>
20 20 <view class="u-flex item-content">
21   - <text class="text-top">{{ item.title }}</text>
22   - <text class="text-bottom">{{ item.createTime }}</text>
  21 + <text class="text-top">{{ item.sysNotice.title }}</text>
  22 + <text class="text-bottom">{{ item.sysNotice.createTime }}</text>
23 23 </view>
24 24 </view>
25 25 <view class="item-right">
26   - <text class="text">{{ item.type == 'OTHER' ? '其他' : item.type == 'MEETING' ? '会议' : '公告' }}</text>
  26 + <text class="text">{{ formatType(item.sysNotice) }}</text>
27 27 </view>
28 28 </view>
29 29 </view>
... ... @@ -80,6 +80,9 @@ export default {
80 80 this.stop();
81 81 },
82 82 methods: {
  83 + formatType(e) {
  84 + return e?.type == 'OTHER' ? '其他' : e?.type == 'MEETING' ? '会议' : '公告';
  85 + },
83 86 stop() {
84 87 let interval = setInterval(function() {
85 88 uni.hideKeyboard(); //隐藏软键盘
... ... @@ -124,20 +127,13 @@ export default {
124 127 uni.stopPullDownRefresh();
125 128 this.mescroll.endByPage(res.items.length, res.total);
126 129 if (pageNo == 1) {
127   - this.list = res.items.map(m => {
128   - return {
129   - title: m?.sysNotice?.title,
130   - avatar: m?.sysNotice?.avatar,
131   - id: m?.sysNotice?.id,
132   - createTime: m?.createTime
133   - };
134   - });
  130 + this.list = res.items;
135 131 } else {
136 132 this.list = this.list.concat(res.items);
137 133 }
138 134 })
139 135 .catch(e => {
140   - uni.$u.toast(e.data.message);
  136 + uni.$u.toast(e.data?.message);
141 137 this.mescroll.endErr();
142 138 });
143 139 },
... ...