一级毛片视频在线观看-一级毛片视频免费-一级毛片视频播放-一级毛片看真人在线视频-国产高清在线精品一区a-国产高清在线精品一区二区

微官網怎么制作,微網站設計圖解,微站建設方法

作者:網站建設公司 來源:佛山網站建設日期:2020-11-11 瀏覽:

網站建設 - 建站教程 - 網頁設計 - 微官網怎么制作,微網站設計圖解,微站建設方法

近發現特別多的人在問微網站是什么,微網站有什么用,微網站怎么做,微網站建設流程等問題,今天,在這里為大家統一解答,希望能對各位愛學習人士有所幫助。

第一步:需要在微信公眾平臺上注冊一個自己的服務號或者訂閱號。

第二步:申請公眾賬號成功后,便可以使用其基本功能了,當然,要想做成自己的微信官網,則需要進入開發模式,接入第三方接口。

第三步:注冊成功并登陸第三方接口,將注冊好的微信公眾號添加到第三方接口上,所需信息在微信公眾號設置下的賬號信息里。

第四步:添加公眾賬號后,連接公眾平臺與第三方接口,如圖:登錄微信公眾平臺,點擊左側下方的【開發者中心】,點擊開發模式。

第五步:后,設計自己的微信官網。并且可在線預覽。

完成以上步驟后,并且認證訂閱號或服務號后就可以做微信的二次開發了,比如我要制作一個群發功能的接口,需要使用一下微信接口:

1、獲取access token

2、新增臨時素材接口

3、上傳圖文消息素材接口

4、調用群發接口

接口代碼示例:WeixinApi.class.php

<?php
class WeixinApi{
private $appid,$appsecret,$media_id;
public function __construct($appid="",$appsecret=""){
$this->appid=$appid;
$this->appsecret=$appsecret;
}

//獲取token
public function getToken(){
if($_COOKIE["exptime"]=="" || time()-$_COOKIE["create_time"]>=$_COOKIE["exptime"]){
$token=@file_get_contents("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appid}&secret={$this->appsecret}");
$tokenarr=json_decode($token,true);
setcookie("exptime",$tokenarr["expires_in"],0,'/');
setcookie("access_token",$tokenarr["access_token"],0,'/');
setcookie("create_time",time(),0,'/');
}else{
$tokenarr=array(
"access_token"=>$_COOKIE["access_token"],
"expires_in"=>$_COOKIE["exptime"],
"create_time"=>$_COOKIE["create_time"]
);
}
return $tokenarr;
}

private function sockupload($phost,$pport,$purl,$filename,$file_data=array()){
$host = $phost;
$port = $pport;
$errno = '';
$errstr = '';
$timeout = 30;
$url = $purl;

/*$form_data = array(
'name' => 'lijie',
'gender' => 'man',
);*/

$file_data = array(
array(
'name' => 'media',
'filename' => $filename,
//'path' =>'1.jpg'
)
);

// create connect
$fp = fsockopen($host, $port, $errno, $errstr, $timeout);

if(!$fp){
return false;
}

// send request
srand((double)microtime()*1000000);
$boundary = "---------------------------".substr(md5(rand(0,32000)),0,10);

$data = "--$boundaryrn";

// form data
if(count($form_data)>0){
foreach($form_data as $key=>$val){
$data .= "Content-Disposition: form-data; name="".$key.""rn";
$data .= "Content-type:text/plainrnrn";
$data .= rawurlencode($val)."rn";
$data .= "--$boundaryrn";
}
}

// file data
if($filename!=""){
foreach($file_data as $file){
$data .= "Content-Disposition: form-data; name="".$file['name'].""; filename="".$file['filename'].""rn";
$pinfo=pathinfo($file['filename']);
$data .= "Content-Type: ".$pinfo["extension"]."rnrn";
$data .= implode("",file($file['filename']))."rn";
$data .= "--$boundaryrn";
}
}

$data .="--rnrn";

$out = "POST ${url} HTTP/1.1rn";
$out .= "Host:${host}rn";
$out .= "Content-type:multipart/form-data; boundary=$boundaryrn"; // multipart/form-data
$out .= "Content-length:".strlen($data)."rn";
$out .= "Connection:closernrn";
$out .= "${data}";

fputs($fp, $out);

// get response
$response = '';
while($row=fread($fp, 4096)){
$response .= $row;
}

$pos = strpos($response, "rnrn");
$response = substr($response, $pos+4);

return $response;
}

//json數據提交
private function jsonUpload($url,$jsdata){
$data_string = $jsdata;
$ch = curl_init();
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json;charset=utf-8',
'Content-Length: ' . strlen($data_string))
);

$result = curl_exec($ch);
curl_close ( $ch );
return $result;
}

//上傳媒體接口
public function upload($type,$filename){
$tokens=$this->getToken();
$result=$this->sockupload("api.weixin.qq.com",80,"/cgi-bin/media/upload?access_token=".$tokens["access_token"]."&type={$type}",$filename);
$media=json_decode($result,true);
$this->media_id=$media['media_id'];
return $this;
}

//上傳素材
public function uploadnews($title,$content,$author="",$url="",$digest="",$show_cover_pic="1"){
$articles=array(
"articles"=>array(
array(
"thumb_media_id"=>$this->media_id,
"author"=>$author,
"title"=>urlencode($title),
"content_source_url"=>$url,
"content"=>urlencode($content),
"digest"=>$digest,
"show_cover_pic"=>"1"
)
)
);

$tokens=$this->getToken();
$news=urldecode(json_encode($articles));
$result=$this->jsonUpload("api.weixin.qq.com/cgi-bin/media/uploadnews?access_token=".$tokens["access_token"]."",$news);
$newsdata=json_decode($result,true);
$this->media_id=$newsdata["media_id"];
return $this;
}

//群發接口
public function sendall(){
$arr=array(
"filter"=>array("is_to_all"=>true,"group_id"=>""),
"mpnews"=>array("media_id"=>$this->media_id),
"msgtype"=>"mpnews"
);
$json=json_encode($arr);
$tokens=$this->getToken();
$result=$this->jsonUpload("api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token=".$tokens["access_token"]."",$json);
return $result;
}

}

使用:

$weixin=new WeixinApi($appid,$appsecret);
$result=$weixin->upload("image","圖片路徑")->uploadnews("文章標題","文章內容")->sendall();
企業網站建設一條龍
找零度飛易網絡公司-fslingdu所做php網站建設方案、網站設計網站制作北京上海深圳龍崗衢州蘭州常州東營南通濟寧桂林淮安煙臺長春無錫天津昆山蘇州合肥洛陽昆明天津唐山泉州惠州萬州新鄉商丘臺州哈爾濱太原攝影海口隨州學校商丘廣東湖南廣西江西海南廣州企業中小企業武漢南山羅湖福田虎門肇慶汕尾汕頭廣州佛山成都杭州濟南重慶福州西安廈門昆山沈陽青島徐州鄭州南京南寧長沙大連淄博石家莊南昌溫州珠海番禺順德三水高明中山東莞合肥江門嘉興西寧大良容桂倫教勒流陳村均安杏壇龍江樂從北滘祖廟石灣南莊等地區企業網站建設(廣告)公司提供專業做網站價格規劃書及營銷型網站制作,網站建設基礎知識

網站建設費用

網站制作電話:137 1543 1176

網站開發QQ:378780108

E-mailsale@fslingdu.com如何制作網站QQ :378780108

網站建設服務

網站建設公司零度飛易是一家專業網站設計,網站制作、seo優化,網站推廣,網站建設的佛山網絡運營公司。零度飛易在家具網站建設小家電網站建設服裝網站建設、電器網站建設、機械網站建設等行業的網站設計、網絡運營都得到行業認可,在上海深圳北京廣州、佛山中山東莞地區有著良好的口碑品牌的網站建設公司。我們的使命是打造創新型的網站建設企業,能輕易地開展“互聯網+”業務、實現“互聯網+企業”的企業愿景。

Hi,Are you ready?

準備好開始了嗎?
那就與我們取得聯系吧

有一個互聯網項目想和我們談談嗎?您可以填寫右邊的表格,讓我們了解您的項目需求,這是一個良好的開始,我們將會盡快與你取得聯系。當然也歡迎您給我們寫信或是打電話,讓我們聽到你的聲音!

零度飛易 互聯網整合營銷

地址:佛山市順德區大良鳳翔商業廣場二座670

業務QQ:378780108

策劃專線:13715431176

E-mail:sale@fslingdu.com

合作意向表

您需要的服務

現有網站改版
我需要做微信營銷
建設全新的企業網站
要找長期合作公司,需要年度服務
我需要做購物商城
我需要做系統平臺

您最關注的地方

對功能要求比較高
對設計創意要求比較高
需要可以購物支付
搜索引擎排名

價格預算

1-3萬3-5萬5-8萬8-10萬10萬以上大型項目需要招標