weex優(yōu)秀案例

# toutiao -weex

> 基于WEEX +Vue2.0仿照今日頭條的app項目(android/ios)

源碼地址:[toutiao_weex](https://github.com/weexext/weex-toutiao)

Apk地址:[android-demo](https://github.com/weexext/weex-toutiao/blob/master/app-debug.apk?raw=true)

## 前言

之前打算做個東西熟悉vue的使用,由于自己蠻喜歡刷手機看看新聞的,借鑒了其他同學(xué)的項目(鏈接在下面),自己也做了一個。項目中還有許多可以完善的地方,不足之處希望小伙伴們可以issue,我會在這里更新。目前還沒有全面地測試該項目,有問題提問,大家一起學(xué)習(xí)。

## 技術(shù)棧

1. 主要用到:vue、weex android ios

## 功能

- 各類新聞的查看

- 本地收藏新聞

- 新聞的搜索

- 待...

## 效果

![圖片描述][1]

![entry](https://github.com/weexext/weex-toutiao/blob/master/capture/v_02.gif?raw=true)

![collect](https://github.com/weexext/weex-toutiao/blob/master/capture/home.png)

![detail](https://github.com/weexext/weex-toutiao/blob/master/capture/detail.png)

## 目錄

```

|- src

|- assets

|- image? ? ? ? ? ? ? ? ? // 項目圖片

|- font? ? ? ? ? ? ? ? ? ? // iconfont字體庫

|- include? ? ? ? ? ? ? ? ? ? // 組件

|- navbar.vue? ? ? ? ? ? ? // 導(dǎo)航

|- tabbar.vue? ? ? ? ? ? ? // 底部導(dǎo)航

|- views? ? ? ? ? ? ? ? ? ? ? // 主體頁面

|- index.vue? ? ? ? ? ? ? // 主體頁面

|- Detail.vue? ? ? ? ? ? ? // 詳情頁

|- Care.vue? ? ? ? ? ? ? ? // 關(guān)注頁

|- Home.vue? ? ? ? ? ? ? ? // 主頁

|- My.vue? ? ? ? ? ? ? ? ? // 段子頁

|- manifast.json? ? ? ? ? ? ? // 清單文件

|- tools

|- android? ? ? ? ? ? ? ? ? ? // android copy

|- iso? ? ? ? ? ? ? ? ? ? ? ? // ios copy

|- packzip.js? ? ? ? ? ? ? ? // 打包

```

更多細(xì)節(jié)在源碼中會有一些注釋

## API

1. 獲取新聞:`https://m.toutiao.com/list/?tag=新聞類型&ac=wap&count=20&format=json_raw&as=A125A8CEDCF8987&cp=58EC18F948F79E1&min_behot_time=時間`

2. 獲取文章:`https://m.toutiao.com/i新聞ID/info/'`

3. 獲取段子:`https://www.toutiao.com/api/article/feed/?category=essay_joke&utm_source=toutiao&widen=1&max_behot_time=1500114422&max_behot_time_tmp=1500114422&tadrequire=true&as=A1F52966E9EEF00&cp=59692E6FD0E09E1`

4. 搜索: `https://www.toutiao.com/search_content/?offset=相對位置&format=json&keyword=關(guān)鍵詞&autoload=true&count=20&cur_tab=1`

還可以參考[今日頭條Api分析](https://github.com/iMeiji/Toutiao/wiki/%E4%BB%8A%E6%97%A5%E5%A4%B4%E6%9D%A1Api%E5%88%86%E6%9E%90)

Ps:多star多動力[捂臉]

## 參考

[u-weex開源地址](https://github.com/weexext)

[u-weex開源地址wiki](https://github.com/weexext/weex-ext-wiki/wiki)

[toutiao_Vue2.0的項目](https://github.com/Huahua-Chen/toutiao_Vue2.0)

## Build Setup

#### android

``` bash

npm install

npm run build

npm run packzip

npm run copy:android

cd platforms/android

gradle iD

```

![圖片描述][2]

[1]: /img/bVUcu3

[2]: /img/bVUcvx

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容