소스 검색

fix tplid bug

张延森 5 년 전
부모
커밋
45e8c3bb6c

+ 1
- 1
src/components/consultant/index.js 파일 보기

47
         e.stopPropagation()
47
         e.stopPropagation()
48
         
48
         
49
         const { userInfo: { miniApp: { tpls }, person: { personId, name, nickname } } } = this.props
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
         const realname = name || nickname
51
         const realname = name || nickname
52
 
52
 
53
         wx.requestSubscribeMessage({
53
         wx.requestSubscribeMessage({

+ 3
- 3
src/pages/activity/detail/assemble.js 파일 보기

407
   // 立即参团
407
   // 立即参团
408
   joinGroup = () => {
408
   joinGroup = () => {
409
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     const { submitting, detail, recordDetail, memberList = [] } = this.state
412
     const { submitting, detail, recordDetail, memberList = [] } = this.state
413
     const person = this.props.userInfo.person
413
     const person = this.props.userInfo.person
478
     const detail = this.state.detail
478
     const detail = this.state.detail
479
     const person = this.props.userInfo.person
479
     const person = this.props.userInfo.person
480
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     Taro.showModal({
484
     Taro.showModal({
530
   // 请求好友参团
530
   // 请求好友参团
531
   groupBuyInvite = () => {
531
   groupBuyInvite = () => {
532
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     const that = this
534
     const that = this
535
 
535
 
536
     // 必须授权头像
536
     // 必须授权头像

+ 3
- 3
src/pages/activity/detail/assistance.js 파일 보기

412
   // 助力好友
412
   // 助力好友
413
   handleHelp = () => {
413
   handleHelp = () => {
414
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     const that = this
416
     const that = this
417
     wx.requestSubscribeMessage({
417
     wx.requestSubscribeMessage({
418
       tmplIds: [tplId],
418
       tmplIds: [tplId],
513
 
513
 
514
     return new Promise((resolve, reject) => {
514
     return new Promise((resolve, reject) => {
515
       const { userInfo: { miniApp: { tpls } } } = this.props
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
       wx.requestSubscribeMessage({
518
       wx.requestSubscribeMessage({
519
         tmplIds: [tplId],
519
         tmplIds: [tplId],
539
         })
539
         })
540
       } else {
540
       } else {
541
         const { userInfo: { miniApp: { tpls } } } = this.props
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
         const that = this
543
         const that = this
544
         wx.requestSubscribeMessage({
544
         wx.requestSubscribeMessage({
545
           tmplIds: [tplId],
545
           tmplIds: [tplId],

+ 1
- 1
src/pages/card/list/index.js 파일 보기

66
     e && e.stopPropagation()
66
     e && e.stopPropagation()
67
     const { userInfo: { person: { personId, nickname, name } } } = this.props
67
     const { userInfo: { person: { personId, nickname, name } } } = this.props
68
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     wx.requestSubscribeMessage({
70
     wx.requestSubscribeMessage({
71
       tmplIds: [tplId],
71
       tmplIds: [tplId],
72
       success(res) {
72
       success(res) {

+ 1
- 1
src/pages/im/list/index.js 파일 보기

75
 
75
 
76
   handleItemClick = ({ unReadNum }) => person => {
76
   handleItemClick = ({ unReadNum }) => person => {
77
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     const that = this
79
     const that = this
80
     wx.requestSubscribeMessage({
80
     wx.requestSubscribeMessage({
81
       tmplIds: [tplId],
81
       tmplIds: [tplId],

+ 1
- 1
src/pages/person/customerAnalysis/followUpCustomer/index.js 파일 보기

253
     e.stopPropagation()
253
     e.stopPropagation()
254
 
254
 
255
     const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
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
     wx.requestSubscribeMessage({
257
     wx.requestSubscribeMessage({
258
       tmplIds: [tplId],
258
       tmplIds: [tplId],
259
       success(res) {
259
       success(res) {

+ 1
- 1
src/pages/person/customerAnalysis/myCustomer.js 파일 보기

369
   handleChatClick(item, e) {
369
   handleChatClick(item, e) {
370
     e.stopPropagation()
370
     e.stopPropagation()
371
     const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
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
     wx.requestSubscribeMessage({
373
     wx.requestSubscribeMessage({
374
       tmplIds: [tplId],
374
       tmplIds: [tplId],
375
       success(res) {
375
       success(res) {

+ 1
- 1
src/pages/person/customerAnalysis/transactionCustomer/index.js 파일 보기

92
     e.stopPropagation()
92
     e.stopPropagation()
93
 
93
 
94
     const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
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
     wx.requestSubscribeMessage({
96
     wx.requestSubscribeMessage({
97
       tmplIds: [tplId],
97
       tmplIds: [tplId],
98
       success(res) {
98
       success(res) {

+ 1
- 1
src/pages/person/myShare/accessRecord.js 파일 보기

88
     e.stopPropagation()
88
     e.stopPropagation()
89
     const { userInfo: { person: { personId, nickname, name } } } = this.props
89
     const { userInfo: { person: { personId, nickname, name } } } = this.props
90
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     wx.requestSubscribeMessage({
92
     wx.requestSubscribeMessage({
93
       tmplIds: [tplId],
93
       tmplIds: [tplId],
94
       success(res) {
94
       success(res) {

+ 2
- 2
src/pages/project/detail/index.js 파일 보기

421
     getUserPhone(e, (phoneNumber) => {
421
     getUserPhone(e, (phoneNumber) => {
422
       const { userInfo: { person: { personId, nickname, name } } } = this.props
422
       const { userInfo: { person: { personId, nickname, name } } } = this.props
423
       const { userInfo: { miniApp: { tpls } } } = this.props
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
       wx.requestSubscribeMessage({
426
       wx.requestSubscribeMessage({
427
         tmplIds: [tplId],
427
         tmplIds: [tplId],
540
     // e.stopPropagation()
540
     // e.stopPropagation()
541
     const { userInfo: { person: { personId, nickname, name } } } = this.props
541
     const { userInfo: { person: { personId, nickname, name } } } = this.props
542
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     wx.requestSubscribeMessage({
544
     wx.requestSubscribeMessage({
545
       tmplIds: [tplId],
545
       tmplIds: [tplId],
546
       success(res) {
546
       success(res) {