Browse Source

fix no tplid bug

张延森 5 years ago
parent
commit
10c9a74280

+ 1
- 1
project.config.json View File

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

+ 1
- 1
src/components/consultant/index.js View File

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 View File

413
   // 立即参团
413
   // 立即参团
414
   joinGroup = () => {
414
   joinGroup = () => {
415
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     const { submitting, detail, recordDetail, memberList = [] } = this.state
418
     const { submitting, detail, recordDetail, memberList = [] } = this.state
419
     const person = this.props.userInfo.person
419
     const person = this.props.userInfo.person
484
     const detail = this.state.detail
484
     const detail = this.state.detail
485
     const person = this.props.userInfo.person
485
     const person = this.props.userInfo.person
486
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     Taro.showModal({
490
     Taro.showModal({
536
   // 请求好友参团
536
   // 请求好友参团
537
   groupBuyInvite = () => {
537
   groupBuyInvite = () => {
538
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     const that = this
540
     const that = this
541
 
541
 
542
     // 必须授权头像
542
     // 必须授权头像

+ 3
- 3
src/pages/activity/detail/assistance.js View File

418
   // 助力好友
418
   // 助力好友
419
   handleHelp = () => {
419
   handleHelp = () => {
420
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     const that = this
422
     const that = this
423
     wx.requestSubscribeMessage({
423
     wx.requestSubscribeMessage({
424
       tmplIds: [tplId],
424
       tmplIds: [tplId],
519
 
519
 
520
     return new Promise((resolve, reject) => {
520
     return new Promise((resolve, reject) => {
521
       const { userInfo: { miniApp: { tpls } } } = this.props
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
       wx.requestSubscribeMessage({
524
       wx.requestSubscribeMessage({
525
         tmplIds: [tplId],
525
         tmplIds: [tplId],
545
         })
545
         })
546
       } else {
546
       } else {
547
         const { userInfo: { miniApp: { tpls } } } = this.props
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
         const that = this
549
         const that = this
550
         wx.requestSubscribeMessage({
550
         wx.requestSubscribeMessage({
551
           tmplIds: [tplId],
551
           tmplIds: [tplId],

+ 1
- 1
src/pages/card/list/index.js View File

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 View File

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 View File

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 View File

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 View File

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 View File

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 View File

394
     getUserPhone(e, (phoneNumber) => {
394
     getUserPhone(e, (phoneNumber) => {
395
       const { userInfo: { person: { personId, nickname, name } } } = this.props
395
       const { userInfo: { person: { personId, nickname, name } } } = this.props
396
       const { userInfo: { miniApp: { tpls } } } = this.props
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
       wx.requestSubscribeMessage({
399
       wx.requestSubscribeMessage({
400
         tmplIds: [tplId],
400
         tmplIds: [tplId],
513
     // e.stopPropagation()
513
     // e.stopPropagation()
514
     const { userInfo: { person: { personId, nickname, name } } } = this.props
514
     const { userInfo: { person: { personId, nickname, name } } } = this.props
515
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     wx.requestSubscribeMessage({
517
     wx.requestSubscribeMessage({
518
       tmplIds: [tplId],
518
       tmplIds: [tplId],
519
       success(res) {
519
       success(res) {