张延森 преди 5 години
родител
ревизия
45e8c3bb6c

+ 1
- 1
src/components/consultant/index.js Целия файл

@@ -47,7 +47,7 @@ export default class Index extends Component {
47 47
         e.stopPropagation()
48 48
         
49 49
         const { userInfo: { miniApp: { tpls }, person: { personId, name, nickname } } } = this.props
50
-        const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
50
+        const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
51 51
         const realname = name || nickname
52 52
 
53 53
         wx.requestSubscribeMessage({

+ 3
- 3
src/pages/activity/detail/assemble.js Целия файл

@@ -407,7 +407,7 @@ export default class Detail extends Component {
407 407
   // 立即参团
408 408
   joinGroup = () => {
409 409
     const { userInfo: { miniApp: { tpls } } } = this.props
410
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true))[0].tplId
410
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true)[0] || {}).tplId
411 411
 
412 412
     const { submitting, detail, recordDetail, memberList = [] } = this.state
413 413
     const person = this.props.userInfo.person
@@ -478,7 +478,7 @@ export default class Detail extends Component {
478 478
     const detail = this.state.detail
479 479
     const person = this.props.userInfo.person
480 480
     const { userInfo: { miniApp: { tpls } } } = this.props
481
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true))[0].tplId
481
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true)[0] || {}).tplId
482 482
 
483 483
 
484 484
     Taro.showModal({
@@ -530,7 +530,7 @@ export default class Detail extends Component {
530 530
   // 请求好友参团
531 531
   groupBuyInvite = () => {
532 532
     const { userInfo: { miniApp: { tpls } } } = this.props
533
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true))[0].tplId
533
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true)[0] || {}).tplId
534 534
     const that = this
535 535
 
536 536
     // 必须授权头像

+ 3
- 3
src/pages/activity/detail/assistance.js Целия файл

@@ -412,7 +412,7 @@ export default class Detail extends Component {
412 412
   // 助力好友
413 413
   handleHelp = () => {
414 414
     const { userInfo: { miniApp: { tpls } } } = this.props
415
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
415
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true)[0] || {}).tplId
416 416
     const that = this
417 417
     wx.requestSubscribeMessage({
418 418
       tmplIds: [tplId],
@@ -513,7 +513,7 @@ export default class Detail extends Component {
513 513
 
514 514
     return new Promise((resolve, reject) => {
515 515
       const { userInfo: { miniApp: { tpls } } } = this.props
516
-      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
516
+      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true)[0] || {}).tplId
517 517
 
518 518
       wx.requestSubscribeMessage({
519 519
         tmplIds: [tplId],
@@ -539,7 +539,7 @@ export default class Detail extends Component {
539 539
         })
540 540
       } else {
541 541
         const { userInfo: { miniApp: { tpls } } } = this.props
542
-        const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
542
+        const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true)[0] || {}).tplId
543 543
         const that = this
544 544
         wx.requestSubscribeMessage({
545 545
           tmplIds: [tplId],

+ 1
- 1
src/pages/card/list/index.js Целия файл

@@ -66,7 +66,7 @@ export default class Index extends Component {
66 66
     e && e.stopPropagation()
67 67
     const { userInfo: { person: { personId, nickname, name } } } = this.props
68 68
     const { userInfo: { miniApp: { tpls } } } = this.props
69
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
69
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
70 70
     wx.requestSubscribeMessage({
71 71
       tmplIds: [tplId],
72 72
       success(res) {

+ 1
- 1
src/pages/im/list/index.js Целия файл

@@ -75,7 +75,7 @@ export default class Index extends Component {
75 75
 
76 76
   handleItemClick = ({ unReadNum }) => person => {
77 77
     const { userInfo: { miniApp: { tpls } } } = this.props
78
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
78
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
79 79
     const that = this
80 80
     wx.requestSubscribeMessage({
81 81
       tmplIds: [tplId],

+ 1
- 1
src/pages/person/customerAnalysis/followUpCustomer/index.js Целия файл

@@ -253,7 +253,7 @@ export default class transactionCustomer extends Taro.Component {
253 253
     e.stopPropagation()
254 254
 
255 255
     const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
256
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
256
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
257 257
     wx.requestSubscribeMessage({
258 258
       tmplIds: [tplId],
259 259
       success(res) {

+ 1
- 1
src/pages/person/customerAnalysis/myCustomer.js Целия файл

@@ -369,7 +369,7 @@ export default class myCustomer extends Taro.Component {
369 369
   handleChatClick(item, e) {
370 370
     e.stopPropagation()
371 371
     const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
372
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
372
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
373 373
     wx.requestSubscribeMessage({
374 374
       tmplIds: [tplId],
375 375
       success(res) {

+ 1
- 1
src/pages/person/customerAnalysis/transactionCustomer/index.js Целия файл

@@ -92,7 +92,7 @@ export default class transactionCustomer extends Taro.Component {
92 92
     e.stopPropagation()
93 93
 
94 94
     const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
95
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
95
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
96 96
     wx.requestSubscribeMessage({
97 97
       tmplIds: [tplId],
98 98
       success(res) {

+ 1
- 1
src/pages/person/myShare/accessRecord.js Целия файл

@@ -88,7 +88,7 @@ export default class Person extends Component {
88 88
     e.stopPropagation()
89 89
     const { userInfo: { person: { personId, nickname, name } } } = this.props
90 90
     const { userInfo: { miniApp: { tpls } } } = this.props
91
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
91
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
92 92
     wx.requestSubscribeMessage({
93 93
       tmplIds: [tplId],
94 94
       success(res) {

+ 2
- 2
src/pages/project/detail/index.js Целия файл

@@ -421,7 +421,7 @@ export default class Index extends Component {
421 421
     getUserPhone(e, (phoneNumber) => {
422 422
       const { userInfo: { person: { personId, nickname, name } } } = this.props
423 423
       const { userInfo: { miniApp: { tpls } } } = this.props
424
-      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
424
+      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
425 425
 
426 426
       wx.requestSubscribeMessage({
427 427
         tmplIds: [tplId],
@@ -540,7 +540,7 @@ export default class Index extends Component {
540 540
     // e.stopPropagation()
541 541
     const { userInfo: { person: { personId, nickname, name } } } = this.props
542 542
     const { userInfo: { miniApp: { tpls } } } = this.props
543
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
543
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
544 544
     wx.requestSubscribeMessage({
545 545
       tmplIds: [tplId],
546 546
       success(res) {