2020 vPush
2121} = getApp ( ) ;
2222var app = getApp ( ) ;
23- const TxvContext = requirePlugin ( "tencentvideo" ) ;
23+ // const TxvContext = requirePlugin("tencentvideo");
2424//let txvContext = TxvContext.getTxvContext('txv1') // txv1即播放器组件的playerid值
2525
2626Page ( {
@@ -112,26 +112,25 @@ Page({
112112 }
113113
114114 } ,
115- // onLoad: function(options) {
116- // var self = this;
117- // this.fetchTopFivePosts();
118- // self.setData({
119- // topNav: config.getIndexNav
120- // });
121- // },
122-
123- onLoad : function ( options ) {
115+ // onLoad: function(options) {
116+ // var self = this;
117+ // this.fetchTopFivePosts();
118+ // self.setData({
119+ // topNav: config.getIndexNav
120+ // });
121+ // },
122+
123+ onLoad : function ( options ) {
124124 var that = this ;
125125 wx . request ( {
126126 //url: 'https://www.yeehee.cn/wp-json/watch-life-net/v1/post/static',
127- success : function ( res ) {
127+ success : function ( res ) {
128128 var statics = res . data . static ;
129129 that . setData ( {
130130 statics : statics ,
131131 } )
132132 } ,
133- fail : function ( ) {
134- }
133+ fail : function ( ) { }
135134 } )
136135
137136 var that = this ;
@@ -142,8 +141,6 @@ Page({
142141 that . setData ( {
143142 topNav : config . getIndexNav
144143 } ) ;
145- //this.txvContext = txvContext.getTxvContext('txv1');
146-
147144 } ,
148145
149146 /* vPush推送绑定事件 */
@@ -508,5 +505,31 @@ Page({
508505 wx . switchTab ( {
509506 url : url
510507 } ) ;
508+ } ,
509+
510+ //设置首页咨询按钮点击事件:当用户点击咨询按钮时,自动推送一条消息给管理员
511+ notifyAdmin : function ( ) {
512+ console . log ( '[*] 用户咨询,开始通知管理员。' ) ;
513+ wx . request ( {
514+ url : 'https://cloud.safedog.cc/vpush/functions/PUSH_API' ,
515+ method : 'POST' ,
516+ dataType : 'json' ,
517+ header : {
518+ 'Content-Type' : "application/json" ,
519+ "X-Parse-Application-Id" : "guren_cloud_vpush"
520+ } ,
521+ data : {
522+ "id" : "KgLSnOmGdS" ,
523+ "secret" : "448c2-1001c-ba07c-13bed" ,
524+ "path" : "pages/index/index" ,
525+ // 这里填写管理员的openId
526+ "openId" : "oRM4C0fPs_4PiCL9WStRkHj1kGek" ,
527+ "data" : [
528+ "叶赫先生" ,
529+ new Date ( ) . toLocaleDateString ( ) ,
530+ "有用户点击了反馈按钮,请前往客服系统mpkf.weixin.qq.com进行查看!"
531+ ]
532+ }
533+ } )
511534 }
512535} )
0 commit comments