導航:首頁 > 源碼編譯 > 客車購票小程序源碼

客車購票小程序源碼

發布時間:2024-05-05 15:35:52

㈠ 微信小程序Demo源碼怎麼找在哪裡下載

微信小程序的Demo源碼有很多種。我平時找小程序的Demo源碼都是在即速應用bbs這個小程序開發論壇上找的,裡面的資源基本上可以滿足各類開發人群的需求。而且都是可以直接下載的。

㈡ 誰有微信小程序的源碼,一個簡單介紹頁+預約報名表單的功能

  1. 微信小程序的源碼一般都沒有開源的。

  2. 可以找一些公司有模板的功能,這個還是很容易的。

㈢ 做小程序到底要不要源碼

源碼這東西,其實大家還比較敏感的,這個問題分開來看:那種一鍵生成的模板式小程序源碼某種程度上來講也不值錢,要與不要沒有實際意義,要了還得自己部署伺服器。個性化定製的系統交付時肯定要源橘遲碼的啊,後面二開啥的需要,而且這屬於自己委託開發的,肯定要拿回的。如果你是單純做代理,沒必要要源碼,畢竟代理商不是純技術開發的公司,而且廠商哪有自己去買源碼革自己的命,掌客多這種宣稱自己後台可下載源碼的具體細節需咨詢對方了,而單個零售類的就看自己的實際需求了。小程序該花的錢就不要想著在念敗這地方圓高李省錢。

㈣ 有沒有微信小程序調用百度ai車輛識別介面的程序源碼,很簡單的就可以

class BaiDuAiBaseController extends BaseController
{
private $appid;
private $appKey;
private $secretKey;

public function __construct(){
$this->appid= config('api..appid');
$this->appKey = config('api..apikey');
$this->secretKey = config('api..secretkey');
}

//網路ai介面--文字識別--車牌號識別
public function getCarNumber($_imgurl,$_img=''){
$_token = $this->getToken();
$_url = 'https://aip.bce.com/rest/2.0/ocr/v1/license_plate?access_token='.$_token;
if($_img){
$_data = [
'image'=>$_img//圖像數據,base64編碼後進行urlencode,要求base64編碼和urlencode後大小不超過4M,最短邊至少15px,最長邊最大4096px,支持jpg/jpeg/png/bmp格式
];
}else{
$_data = [
'url'=>request()->domain().'/'.$_imgurl
];
}

$_res = json_decode(httpGet($_url,$_data),true);
//TODO 此處只返回false沒有終止,是因為程序執行流程需要,後期可能要改
if(isset($_res['error_msg'])) return false;
return $_res['words_result']['number'];
}

//獲取token
private function getToken(){
if(cache('_token')){
$_access_token = cache('_token');
}else{
$_url = 'https://aip.bce.com/oauth/2.0/token?grant_type=client_credentials&client_id='.$this->appKey.'&client_secret='.$this->secretKey;
$res = json_decode(httpGet($_url),true);
if(isset($res['error']))TApiException($res['error_description']);//終止程序並拋出異常
$_access_token = $res['access_token'];
$_expires_in = $res['expires_in'];
cache('_token',$_access_token,($_expires_in-1000));//我喜歡少存1000秒,沒有為什麼,問就是癖好
}
return $_access_token;
}
}

這是ThinkPhp5.1後端封裝的網路AI介面類,getToken()獲取憑證,getCarNumber()請求$_url 返回識別結果,這個是車牌號碼識別,車型識別等其他介面大部分都一樣,就換個請求地址$_url就行
//介面:
public function getImgCarNum(){
$_number = (new BaiDuAiBaseController())->getCarNumber(false,request()->param('img'));
return self::myShow('申請成功',['carNum'=>$_number]);
}
小程序端正常request請求上面的介面就行,下面是微信小程序拍照識別功能

//拍照
goImgSearch(){
uni.chooseImage({
count:1,
sizeType: ['compressed'],//original 原圖,compressed 壓縮
sourceType: ['album','camera'],//camera 相機 album相冊
success:(r)=>{
console.log(r)
//執行識別車牌號碼
this.img = r.tempFilePaths[0]
this.urlTobase64(r.tempFilePaths[0])
}
})
},
//識別車牌號碼
urlTobase64(url){
uni.showLoading({
title:'拚命識別車牌中..'
})
//#ifdef MP-WEIXIN
uni.getFileSystemManager().readFile({
filePath: url, //選擇圖片時返回的路徑
encoding: "base64",//這個是很重要的
success: res => { //成功的回調
//返回base64格式
let base64= 'data:image/jpeg;base64,' + res.data
//發送請求,識別車牌號碼
this.$H.post('/getImgCarNum',{
img:base64 //圖片數據
},{
token:true //必須登錄
}).then((res)=>{
console.log(res.carNum)
if(!res.carNum){
uni.hideLoading()
return uni.showModal({
title:'識別失敗',
content:'沒能識別到車牌號碼,請拍張清晰的圖片再試哦,謝謝',
showCancel:false
})
}
uni.showToast({
title:'識別車牌成功',
icon:'none'
})
this.searchUser = res.carNum
this.userCarNum = res.carNum
uni.hideLoading()
}).catch((e)=>{
uni.hideLoading()
return uni.showModal({
title:'識別失敗',
content:'沒能識別到車牌號碼,請拍張清晰的圖片再試哦,謝謝',
showCancel:false
})
})
},
fail:(e)=>{
console.log(e)
}
})
//#endif
},

閱讀全文

與客車購票小程序源碼相關的資料

熱點內容
比德電子采購平台加密 瀏覽:200
加密貨幣400億 瀏覽:524
植發2次加密 瀏覽:44
vc6查看編譯的錯誤 瀏覽:595
心理大全pdf 瀏覽:1002
區域鏈加密幣怎麼樣 瀏覽:343
查找命令符 瀏覽:95
壓縮工具zar 瀏覽:735
白盤怎麼解壓 瀏覽:474
辰語程序員學習筆記 瀏覽:47
程序員被公司勸退 瀏覽:523
java三子棋 瀏覽:692
加密空間怎麼強制進入 瀏覽:345
ug分割曲線命令 瀏覽:209
學碼思程序員 瀏覽:609
自考雲學習app為什麼登不上 瀏覽:410
domcer伺服器晝夜更替怎麼搞 瀏覽:436
plc和單片機哪個好 瀏覽:535
帝國神話組建雲伺服器 瀏覽:827
鄧散木pdf 瀏覽:199