瀏覽代碼

fix no tplid bug

张延森 5 年之前
父節點
當前提交
10c9a74280

+ 1
- 1
project.config.json 查看文件

@@ -2,7 +2,7 @@
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "mini-chengjiao",
4 4
 	"description": "知与行互动",
5
-	"appid": "wxd6f47a9bb3052175",
5
+	"appid": "wxe3b1e683853800b5",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,

+ 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 查看文件

@@ -413,7 +413,7 @@ export default class Detail extends Component {
413 413
   // 立即参团
414 414
   joinGroup = () => {
415 415
     const { userInfo: { miniApp: { tpls } } } = this.props
416
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true))[0].tplId
416
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true)[0] || {}).tplId
417 417
 
418 418
     const { submitting, detail, recordDetail, memberList = [] } = this.state
419 419
     const person = this.props.userInfo.person
@@ -484,7 +484,7 @@ export default class Detail extends Component {
484 484
     const detail = this.state.detail
485 485
     const person = this.props.userInfo.person
486 486
     const { userInfo: { miniApp: { tpls } } } = this.props
487
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true))[0].tplId
487
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true)[0] || {}).tplId
488 488
 
489 489
 
490 490
     Taro.showModal({
@@ -536,7 +536,7 @@ export default class Detail extends Component {
536 536
   // 请求好友参团
537 537
   groupBuyInvite = () => {
538 538
     const { userInfo: { miniApp: { tpls } } } = this.props
539
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true))[0].tplId
539
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_GROUP && x.isSubscribe == true)[0] || {}).tplId
540 540
     const that = this
541 541
 
542 542
     // 必须授权头像

+ 3
- 3
src/pages/activity/detail/assistance.js 查看文件

@@ -418,7 +418,7 @@ export default class Detail extends Component {
418 418
   // 助力好友
419 419
   handleHelp = () => {
420 420
     const { userInfo: { miniApp: { tpls } } } = this.props
421
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
421
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true)[0] || {}).tplId
422 422
     const that = this
423 423
     wx.requestSubscribeMessage({
424 424
       tmplIds: [tplId],
@@ -519,7 +519,7 @@ export default class Detail extends Component {
519 519
 
520 520
     return new Promise((resolve, reject) => {
521 521
       const { userInfo: { miniApp: { tpls } } } = this.props
522
-      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
522
+      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true)[0] || {}).tplId
523 523
 
524 524
       wx.requestSubscribeMessage({
525 525
         tmplIds: [tplId],
@@ -545,7 +545,7 @@ export default class Detail extends Component {
545 545
         })
546 546
       } else {
547 547
         const { userInfo: { miniApp: { tpls } } } = this.props
548
-        const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
548
+        const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true)[0] || {}).tplId
549 549
         const that = this
550 550
         wx.requestSubscribeMessage({
551 551
           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 查看文件

@@ -394,7 +394,7 @@ export default class Index extends Component {
394 394
     getUserPhone(e, (phoneNumber) => {
395 395
       const { userInfo: { person: { personId, nickname, name } } } = this.props
396 396
       const { userInfo: { miniApp: { tpls } } } = this.props
397
-      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
397
+      const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
398 398
 
399 399
       wx.requestSubscribeMessage({
400 400
         tmplIds: [tplId],
@@ -513,7 +513,7 @@ export default class Index extends Component {
513 513
     // e.stopPropagation()
514 514
     const { userInfo: { person: { personId, nickname, name } } } = this.props
515 515
     const { userInfo: { miniApp: { tpls } } } = this.props
516
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
516
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
517 517
     wx.requestSubscribeMessage({
518 518
       tmplIds: [tplId],
519 519
       success(res) {