瀏覽代碼

消息提示

xiuli.gao 2 年之前
父節點
當前提交
015ae71515

+ 10 - 0
ceshi.html

@@ -0,0 +1,10 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<body>
4
+
5
+<?php
6
+echo strlen("Hello");
7
+?>
8
+
9
+</body>
10
+</html>

+ 1 - 1
index.html

@@ -7,4 +7,4 @@
7 7
         hm.src = "https://hm.baidu.com/hm.js?d61b9e2caf4d46ccda7471b5385e2333";
8 8
         var s = document.getElementsByTagName("script")[0];
9 9
         s.parentNode.insertBefore(hm, s);
10
-      })();</script><link href=./static/css/app.2b0dfd779354ead704f8791d88407017.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.c20f75253d08152a4c31.js></script><script type=text/javascript src=./static/js/app.8c0f6e8492617ab7c119.js></script></body></html>
10
+      })();</script><link href=./static/css/app.9c78249d5b4e40a63dc3727c5001b4e9.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ab22ff568c2314851ba.js></script><script type=text/javascript src=./static/js/app.ee77755dd17754c288be.js></script></body></html>

+ 1 - 0
project/package.json

@@ -23,6 +23,7 @@
23 23
     "node-sass": "^4.12.0",
24 24
     "sass-loader": "^7.1.0",
25 25
     "switch-address": "^1.0.4",
26
+    "umy-ui": "^1.1.6",
26 27
     "vue": "^2.5.2",
27 28
     "vue-axios": "^3.2.5",
28 29
     "vue-masked-input": "^0.5.2",

+ 1 - 0
project/src/assets/config/interface_api.js

@@ -102,6 +102,7 @@ var api = {
102 102
   wxad_getAuthUrl: "/wxad/getAuthUrl",
103 103
   pitcher_dramaEdit: "/api/pitcher/dramaEdit",
104 104
   pitcher_dramaAdd: "/api/pitcher/dramaAdd",
105
+  php_strLength: "/api/welcomeMsg/strLength",
105 106
 };
106 107
 
107 108
 export { api };

+ 12 - 0
project/src/assets/js/common.js

@@ -208,4 +208,16 @@ export function timeStamp_to_date (unixtimestamp, hourFlag, sFlag) {//时间戳
208 208
     return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
209 209
   }
210 210
 
211
+}
212
+
213
+export function getStrBytes (string) {//获取对应的字节数
214
+  if (string) {
215
+    var blob = new Blob([string]);
216
+    let size = blob && blob.size;
217
+    let n = string.match(/\n/g, "");//一个\n加一个字节
218
+    size += n ? n.length : 0;
219
+    return size
220
+  } else {
221
+    return 0
222
+  }
211 223
 }

+ 69 - 16
project/src/components/assembly/editCon.vue

@@ -4,12 +4,15 @@
4 4
       <!-- <div class="insert" v-if="source=='welcom'">
5 5
         <span @click="insertAtCursor">「插入客户昵称」</span>
6 6
       </div> -->
7
-      <textarea class="textarea self-scrollbar-3" ref="textarea" v-if="!disabled" autocomplete="off" maxlength="1000" :placeholder="source=='welcom'?'请输入欢迎语':'请输入群发内容'" v-model="content" @input="contentChange"></textarea>
7
+      <textarea class="textarea self-scrollbar-3" ref="textarea" v-if="!disabled" autocomplete="off" :placeholder="source=='welcom'?'请输入欢迎语':'请输入群发内容'" v-model="content" @input="contentChange"></textarea>
8 8
       <!-- <div contentEditable='true' id="textarea" class="textarea self-scrollbar-3" v-if="!disabled" autocomplete="off" maxlength="1000" v-html="content" :placeholder="source=='welcom'?'请输入欢迎语':'请输入群发内容'" @input="contentChange">
9 9
         {{content}}
10 10
       </div> -->
11 11
       <div class="textarea self-scrollbar-3 pointer-drop" style="white-space: pre-wrap;color:#666" v-else>{{content}}</div>
12
-      <div class="maxFont">{{content.length}}/1000</div>
12
+      <div class="flex">
13
+        <div class="warning_hint" v-if="$getStrBytes(content)>4000"> <i class="el-icon-warning-outline"></i> 消息文本内容,最多4000个字节,已超出!</div>
14
+        <div class="maxFont" style="flex:1">{{$getStrBytes(content)}}/4000字节</div>
15
+      </div>
13 16
       <div class="fujian" v-if="attachments&&attachments.length>0">
14 17
         <draggable class="syllable_ul" element="ul" :disabled="disabled" :list="attachments" :options="{group:'name', animation:100}">
15 18
           <div class="fujianItem" :class="disabled?'pointer-drop':''" v-for="(item,index) in attachments" :key="index">
@@ -121,13 +124,24 @@
121 124
     <el-dialog title="添加链接" :visible.sync="linkVisible" width="500px" center :close-on-click-modal="false">
122 125
       <div class="lineItem">
123 126
         <label><em>*</em>链接标题:</label>
124
-        <el-input class="input" size="small" placeholder="请输入链接标题" v-model="link.title" clearable>
125
-        </el-input>
127
+        <div class="input">
128
+          <div class="flex">
129
+            <el-input class="input" type="textarea" size="small" placeholder="请输入链接标题" v-model="link.title" clearable></el-input>
130
+            <span class="font_zj">{{$getStrBytes(link.title)}}/128字节</span>
131
+          </div>
132
+          <div class="warning_hint f12" style="margin-left:0" v-if="$getStrBytes(link.title)>128"> <i class="el-icon-warning-outline"></i> 链接标题,最多128个字节,已超出!</div>
133
+        </div>
126 134
       </div>
127 135
       <div class="lineItem">
128 136
         <label><em>*</em>链接地址:</label>
129
-        <el-input class="input" size="small" placeholder="请输入链接地址" v-model="link.url" clearable>
130
-        </el-input>
137
+        <div class="input">
138
+          <div class="flex">
139
+            <el-input class="input" type="textarea" size="small" placeholder="请输入链接地址" v-model="link.url" clearable></el-input>
140
+            <span class="font_zj">{{$getStrBytes(link.url)}}/2048字节</span>
141
+          </div>
142
+          <div class="warning_hint f12" style="margin-left:0" v-if="$getStrBytes(link.url)>2048"> <i class="el-icon-warning-outline"></i> 链接地址,最多2048个字节,已超出!</div>
143
+        </div>
144
+        <!-- <el-input class="input" size="small" placeholder="请输入链接地址" v-model="link.url" clearable></el-input> -->
131 145
       </div>
132 146
       <div class="lineItem">
133 147
         <label>图文封面:</label>
@@ -139,8 +153,14 @@
139 153
       <p class="uploadImgHint" style="margin-left:40px;">*图片仅支持png或jpg格式,且文件大小不得超过10M。</p>
140 154
       <div class="lineItem">
141 155
         <label>封面描述:</label>
142
-        <el-input class="input" size="small" placeholder="请输入封面描述" v-model="link.desc" clearable>
143
-        </el-input>
156
+        <div class="input">
157
+          <div class="flex">
158
+            <el-input class="input" type="textarea" size="small" placeholder="请输入封面描述" v-model="link.desc" clearable></el-input>
159
+            <span class="font_zj">{{$getStrBytes(link.desc)}}/512字节</span>
160
+          </div>
161
+          <div class="warning_hint f12" style="margin-left:0" v-if="$getStrBytes(link.desc)>512"> <i class="el-icon-warning-outline"></i> 封面描述,最多512个字节,已超出!</div>
162
+        </div>
163
+        <!-- <el-input class="input" size="small" placeholder="请输入封面描述" v-model="link.desc" clearable></el-input> -->
144 164
       </div>
145 165
       <div class="buttons">
146 166
         <el-button type="primary" plain size="mini" @click="linkVisible = false">取消</el-button>
@@ -148,7 +168,7 @@
148 168
       </div>
149 169
     </el-dialog>
150 170
     <!-- 小程序 -->
151
-    <el-dialog title="添加小程序" :visible.sync="miniprogramVisible" width="600px" center :close-on-click-modal="false">
171
+    <el-dialog title="添加小程序" :visible.sync="miniprogramVisible" width="650px" center :close-on-click-modal="false">
152 172
       <div style="padding:0 15px;">
153 173
         <div class="self-hint" style="margin-bottom:20px;border:none">
154 174
           <i class="el-icon-message-solid"></i>
@@ -156,13 +176,20 @@
156 176
         </div>
157 177
         <div class="lineItem">
158 178
           <label><em>*</em>小程序标题:</label>
159
-          <el-input class="input" size="small" placeholder="请输入小程序标题" v-model="miniprogram.title" clearable></el-input>
179
+          <div class="input">
180
+            <div class="flex">
181
+              <el-input class="input" type="textarea" size="small" placeholder="请输入小程序标题" v-model="miniprogram.title" clearable></el-input>
182
+              <span class="font_zj">{{$getStrBytes(miniprogram.title)}}/64字节</span>
183
+            </div>
184
+            <div class="warning_hint f12" style="margin-left:0" v-if="$getStrBytes(miniprogram.title)>64"> <i class="el-icon-warning-outline"></i> 小程序标题,最多64个字节,已超出!</div>
185
+          </div>
186
+          <!-- <el-input class="input" size="small" placeholder="请输入小程序标题" v-model="miniprogram.title" clearable></el-input> -->
160 187
         </div>
161 188
         <div class="lineItem">
162 189
           <label><em>*</em>小程序appID:</label>
163 190
           <div style="flex:1">
164 191
             <el-input class="input" size="small" placeholder="请输入小程序appID" v-model="miniprogram.appid" clearable></el-input>
165
-            <p class="otherHint"><a href="https://docs.qq.com/doc/p/cb25fa9e1aba98ce5f8b942f2900f0247b9e5dc6?dver=2.1.27292865" target="_blank">如何获取小程序appID?</a></p>
192
+            <p class="otherHint" style="color:#f9a527">*小程序appID<a href="https://docs.qq.com/doc/p/cb25fa9e1aba98ce5f8b942f2900f0247b9e5dc6?dver=2.1.27292865" target="_blank">(如何获取小程序appID)</a>,必须是关联到企业的小程序应用。</p>
166 193
           </div>
167 194
         </div>
168 195
         <div class="lineItem">
@@ -179,7 +206,7 @@
179 206
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
180 207
           </el-upload>
181 208
         </div>
182
-        <p class="uploadImgHint" style="margin-left:20px;">*图片仅支持png或jpg格式,且文件大小不得超过10M。</p>
209
+        <p class="uploadImgHint" style="margin-left:20px;">*图片仅支持png或jpg格式,且文件大小不得超过10M。封面图建议尺寸为520*416。</p>
183 210
         <div class="buttons">
184 211
           <el-button type="primary" plain size="mini" @click="miniprogramVisible = false">取消</el-button>
185 212
           <el-button type="primary" size="mini" @click="miniprogramDefine">确定</el-button>
@@ -317,9 +344,9 @@ export default {
317 344
       this.imgVisible = false;
318 345
     },
319 346
     linkDefine () {//链接确定
320
-      if (this.link.title == '') {
347
+      if (this.link.title == '' || this.$getStrBytes(this.link.title) > 128) {
321 348
         this.$message({
322
-          message: '请输入链接标题',
349
+          message: '请正确输入链接标题',
323 350
           type: "warning"
324 351
         })
325 352
         return
@@ -331,6 +358,20 @@ export default {
331 358
         })
332 359
         return
333 360
       }
361
+      if (this.link && this.link.url != '' && this.$getStrBytes(this.link.url) > 2048) {
362
+        this.$message({
363
+          message: '请正确输入链接地址',
364
+          type: "warning"
365
+        })
366
+        return
367
+      }
368
+      if (this.link && this.link.desc != '' && this.$getStrBytes(this.link.desc) > 512) {
369
+        this.$message({
370
+          message: '请正确输入封面描述',
371
+          type: "warning"
372
+        })
373
+        return
374
+      }
334 375
       let obj = {
335 376
         "msgtype": "link",
336 377
         "link": this.link
@@ -345,9 +386,9 @@ export default {
345 386
       this.linkVisible = false;
346 387
     },
347 388
     miniprogramDefine () {//小程序确定
348
-      if (this.miniprogram.title == '') {
389
+      if (this.miniprogram.title == '' || this.$getStrBytes(this.miniprogram.title) > 64) {
349 390
         this.$message({
350
-          message: '请输入小程序标题',
391
+          message: '请正确输入小程序标题',
351 392
           type: "warning"
352 393
         })
353 394
         return
@@ -750,4 +791,16 @@ export default {
750 791
   margin-top: -10px;
751 792
   margin-bottom: 10px;
752 793
 }
794
+.warning_hint {
795
+  color: red;
796
+  font-size: 13px;
797
+  margin-left: 10px;
798
+  line-height: 20px;
799
+}
800
+.font_zj {
801
+  font-size: 12px;
802
+  width: 96px;
803
+  line-height: 20px;
804
+  padding-left: 6px;
805
+}
753 806
 </style>

+ 7 - 0
project/src/components/customOperate/createMassMsg.vue

@@ -294,6 +294,13 @@ export default {
294 294
         })
295 295
         return
296 296
       }
297
+      if (this.content != '' && this.$getStrBytes(this.content) > 4000) {
298
+        this.$message({
299
+          message: '请检查消息文本内容,最多4000个字节,已超出!',
300
+          type: "error"
301
+        })
302
+        return
303
+      }
297 304
       this.$loading(this.$loadingConfig)
298 305
       this.$axios.post(this.URL.BASEURL + this.URL.massMsg_set, {
299 306
         rule_id: this.$route.params.rule_id ? this.$route.params.rule_id : '',

+ 14 - 0
project/src/components/customOperate/welcom_message.vue

@@ -202,6 +202,13 @@ export default {
202 202
         })
203 203
         return
204 204
       }
205
+      if (this.main_msg_data.content != '' && this.$getStrBytes(this.main_msg_data.content) > 4000) {
206
+        this.$message({
207
+          message: '请检查【主】欢迎语内容,最多4000个字节,已超出!',
208
+          type: "error"
209
+        })
210
+        return
211
+      }
205 212
       let msg_data = []
206 213
       if (this.is_day_parting) {//开启分段欢迎语
207 214
         for (let i = 0; i < this.timeIntervalList.length; i++) {
@@ -213,6 +220,13 @@ export default {
213 220
             })
214 221
             return
215 222
           }
223
+          if (item.content != '' && this.$getStrBytes(item.content) > 4000) {
224
+            this.$message({
225
+              message: `请检查【时段${i + 1}】欢迎语内容,最多4000个字节,已超出!`,
226
+              type: "error"
227
+            })
228
+            return
229
+          }
216 230
           if (!item.weeks || item.weeks.length == 0) {
217 231
             this.$message({
218 232
               message: `请选择【时段${i + 1}】发送日期!`,

+ 2 - 1
project/src/main.js

@@ -24,7 +24,7 @@ import "@/assets/iconfont/iconfont.css"; // 阿里图标
24 24
 
25 25
 import { setLocal, getLocal, delLocal, delAllLocal } from '@/assets/js/storage.js'
26 26
 import { setCookie, getCookie, delCookie, delAllCookie } from '@/assets/js/cookie.js'
27
-import { copy, getDay, NumberHandle, isChn, formatNum, formateHours, formateMinute, day_format, date_compatible, timeStamp_to_date } from '@/assets/js/common.js'
27
+import { getStrBytes, copy, getDay, NumberHandle, isChn, formatNum, formateHours, formateMinute, day_format, date_compatible, timeStamp_to_date } from '@/assets/js/common.js'
28 28
 import exportToPdf from '@/assets/js/exportToPdf.js'
29 29
 Vue.use(exportToPdf)
30 30
 Vue.prototype.$getDay = getDay;
@@ -37,6 +37,7 @@ Vue.prototype.$isChn = isChn;
37 37
 Vue.prototype.$date_compatible = date_compatible;
38 38
 Vue.prototype.$day_format = day_format;
39 39
 Vue.prototype.$copy = copy;
40
+Vue.prototype.$getStrBytes = getStrBytes;
40 41
 Vue.prototype.$store = store;
41 42
 Vue.prototype.$localSelfStore = { setLocal, getLocal, delLocal, delAllLocal }
42 43
 Vue.prototype.$cookie = { setCookie, getCookie, delCookie, delAllCookie }

File diff suppressed because it is too large
+ 0 - 1
static/css/app.2b0dfd779354ead704f8791d88407017.css


File diff suppressed because it is too large
+ 1 - 0
static/css/app.9c78249d5b4e40a63dc3727c5001b4e9.css


File diff suppressed because it is too large
+ 8 - 0
static/js/3.4bc5f3c03b0df59408e1.js


File diff suppressed because it is too large
+ 8 - 0
static/js/4.69963fa8523e04a3fc4e.js


File diff suppressed because it is too large
+ 1 - 1
static/js/3.ad77b4211476f60746d7.js


File diff suppressed because it is too large
+ 0 - 1
static/js/5.e71cc17793683fbbf052.js


File diff suppressed because it is too large
+ 1 - 1
static/js/4.c082cdad09434c0eee75.js


File diff suppressed because it is too large
+ 0 - 1
static/js/6.4482ecd1256618ba0f6b.js


File diff suppressed because it is too large
+ 2 - 2
static/js/9.8177ef946198ee767b89.js


File diff suppressed because it is too large
+ 3 - 3
static/js/app.8c0f6e8492617ab7c119.js


File diff suppressed because it is too large
+ 1 - 1
static/js/manifest.c20f75253d08152a4c31.js