├── wmapi
├── data
│ └── .gitignore
├── lib.php
├── wmapi_config.php
├── logout.php
├── report_error.php
├── forum.php
├── get_image.php
├── get_top_thread.php
├── login.php
├── get_forum.php
├── get_forum_info.php
├── register.php
├── get_token.php
├── add_post.php
├── wx_login.php
├── forum_post.php
├── get_self_post.php
├── get_self_thread.php
├── inc.php
├── get_user_info.php
├── error.php
├── get_thread.php
├── add_image.php
├── add_thread.php
├── wmapi_install.php
└── get_post_detail.php
├── wmapp
├── pages
│ ├── user
│ │ ├── user.json
│ │ ├── user.wxss
│ │ ├── user.wxml
│ │ └── user.js
│ ├── forum
│ │ ├── forum.json
│ │ ├── forum.wxss
│ │ ├── forum.wxml
│ │ └── forum.js
│ ├── login
│ │ ├── login.json
│ │ ├── login.wxss
│ │ ├── login.wxml
│ │ └── login.js
│ ├── register
│ │ ├── register.json
│ │ ├── register.wxss
│ │ ├── register.wxml
│ │ └── register.js
│ ├── add_article
│ │ ├── add_article.json
│ │ ├── add_article.wxss
│ │ └── add_article.wxml
│ ├── add_forum_article
│ │ ├── add_forum_article.json
│ │ ├── add_forum_article.wxss
│ │ ├── add_forum_article.wxml
│ │ └── add_forum_article.js
│ ├── detail
│ │ ├── detail.json
│ │ ├── detail.wxml
│ │ └── detail.wxss
│ ├── self_post
│ │ ├── self_post.json
│ │ ├── self_post.wxss
│ │ ├── self_post.wxml
│ │ └── self_post.js
│ ├── self_thread
│ │ ├── self_thread.wxss
│ │ ├── self_thread.json
│ │ ├── self_thread.wxml
│ │ └── self_thread.js
│ ├── forum_list
│ │ ├── forum_list.json
│ │ ├── forum_list.wxss
│ │ ├── forum_list.wxml
│ │ └── forum_list.js
│ └── index
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
├── wxParse
│ ├── emojis
│ │ ├── 00.gif
│ │ ├── 01.gif
│ │ ├── 02.gif
│ │ ├── 03.gif
│ │ ├── 04.gif
│ │ ├── 05.gif
│ │ ├── 06.gif
│ │ ├── 07.gif
│ │ ├── 08.gif
│ │ ├── 09.gif
│ │ ├── 10.gif
│ │ ├── 100.gif
│ │ ├── 101.gif
│ │ ├── 102.gif
│ │ ├── 103.gif
│ │ ├── 104.gif
│ │ ├── 105.gif
│ │ ├── 106.gif
│ │ ├── 107.gif
│ │ ├── 108.gif
│ │ ├── 109.gif
│ │ ├── 11.gif
│ │ ├── 110.gif
│ │ ├── 111.gif
│ │ ├── 112.gif
│ │ ├── 113.gif
│ │ ├── 114.gif
│ │ ├── 115.gif
│ │ ├── 116.gif
│ │ ├── 117.gif
│ │ ├── 118.gif
│ │ ├── 119.gif
│ │ ├── 12.gif
│ │ ├── 120.gif
│ │ ├── 121.gif
│ │ ├── 122.gif
│ │ ├── 123.gif
│ │ ├── 124.gif
│ │ ├── 125.gif
│ │ ├── 126.gif
│ │ ├── 127.gif
│ │ ├── 128.gif
│ │ ├── 129.gif
│ │ ├── 13.gif
│ │ ├── 130.gif
│ │ ├── 131.gif
│ │ ├── 132.gif
│ │ ├── 133.gif
│ │ ├── 134.gif
│ │ ├── 14.gif
│ │ ├── 15.gif
│ │ ├── 16.gif
│ │ ├── 17.gif
│ │ ├── 18.gif
│ │ ├── 19.gif
│ │ ├── 20.gif
│ │ ├── 21.gif
│ │ ├── 22.gif
│ │ ├── 23.gif
│ │ ├── 24.gif
│ │ ├── 25.gif
│ │ ├── 26.gif
│ │ ├── 27.gif
│ │ ├── 28.gif
│ │ ├── 29.gif
│ │ ├── 30.gif
│ │ ├── 31.gif
│ │ ├── 32.gif
│ │ ├── 33.gif
│ │ ├── 34.gif
│ │ ├── 35.gif
│ │ ├── 36.gif
│ │ ├── 37.gif
│ │ ├── 38.gif
│ │ ├── 39.gif
│ │ ├── 40.gif
│ │ ├── 41.gif
│ │ ├── 42.gif
│ │ ├── 43.gif
│ │ ├── 44.gif
│ │ ├── 45.gif
│ │ ├── 46.gif
│ │ ├── 47.gif
│ │ ├── 48.gif
│ │ ├── 49.gif
│ │ ├── 50.gif
│ │ ├── 51.gif
│ │ ├── 52.gif
│ │ ├── 53.gif
│ │ ├── 54.gif
│ │ ├── 55.gif
│ │ ├── 56.gif
│ │ ├── 57.gif
│ │ ├── 58.gif
│ │ ├── 59.gif
│ │ ├── 60.gif
│ │ ├── 61.gif
│ │ ├── 62.gif
│ │ ├── 63.gif
│ │ ├── 64.gif
│ │ ├── 65.gif
│ │ ├── 66.gif
│ │ ├── 67.gif
│ │ ├── 68.gif
│ │ ├── 69.gif
│ │ ├── 70.gif
│ │ ├── 71.gif
│ │ ├── 72.gif
│ │ ├── 73.gif
│ │ ├── 74.gif
│ │ ├── 75.gif
│ │ ├── 76.gif
│ │ ├── 77.gif
│ │ ├── 78.gif
│ │ ├── 79.gif
│ │ ├── 80.gif
│ │ ├── 81.gif
│ │ ├── 82.gif
│ │ ├── 83.gif
│ │ ├── 84.gif
│ │ ├── 85.gif
│ │ ├── 86.gif
│ │ ├── 87.gif
│ │ ├── 88.gif
│ │ ├── 89.gif
│ │ ├── 90.gif
│ │ ├── 91.gif
│ │ ├── 92.gif
│ │ ├── 93.gif
│ │ ├── 94.gif
│ │ ├── 95.gif
│ │ ├── 96.gif
│ │ ├── 97.gif
│ │ ├── 98.gif
│ │ └── 99.gif
│ ├── wxParse.js
│ ├── wxParse.wxss
│ ├── htmlparser.js
│ └── wxDiscode.js
├── resources
│ ├── icon
│ │ ├── index.png
│ │ └── share.png
│ ├── image
│ │ ├── add.png
│ │ ├── blue.jpg
│ │ ├── edit.png
│ │ ├── error.png
│ │ ├── home.png
│ │ ├── kind.png
│ │ ├── top.png
│ │ ├── user.png
│ │ ├── del-img.png
│ │ ├── add_gray.png
│ │ ├── arrowright.png
│ │ ├── home_gray.png
│ │ ├── kind_gray.png
│ │ ├── user_gray.png
│ │ └── user_icon.png
│ └── logo
│ │ └── mouldbbs300.png
├── utils
│ ├── wxSearch
│ │ ├── images
│ │ │ └── wxSearch-icon-delete.png
│ │ ├── wxSearch.wxss
│ │ ├── wxSearch.wxml
│ │ └── wxSearch.js
│ └── util.js
├── project.config.json
├── zanui
│ └── loadmore
│ │ └── index.wxml
├── app.json
├── app.wxss
└── app.js
├── README.md
└── update_log.md
/wmapi/data/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/wmapp/pages/user/user.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/wmapp/pages/forum/forum.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/wmapp/pages/login/login.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/wmapp/pages/register/register.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/wmapp/pages/add_article/add_article.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/wmapp/pages/add_forum_article/add_forum_article.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/wmapp/pages/detail/detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "onReachBottomDistance": "50px"
3 | }
--------------------------------------------------------------------------------
/wmapp/pages/self_post/self_post.json:
--------------------------------------------------------------------------------
1 | {
2 | "onReachBottomDistance": "50px"
3 | }
--------------------------------------------------------------------------------
/wmapp/pages/self_thread/self_thread.wxss:
--------------------------------------------------------------------------------
1 | @import "../index/index.wxss";
2 |
3 |
--------------------------------------------------------------------------------
/wmapp/pages/self_thread/self_thread.json:
--------------------------------------------------------------------------------
1 | {
2 | "onReachBottomDistance": "50px"
3 | }
--------------------------------------------------------------------------------
/wmapi/lib.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapi/lib.php
--------------------------------------------------------------------------------
/wmapp/pages/forum_list/forum_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "enablePullDownRefresh": true,
3 | "onReachBottomDistance": "50px"
4 | }
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/00.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/00.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/01.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/01.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/02.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/02.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/03.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/03.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/04.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/04.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/05.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/05.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/06.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/06.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/07.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/07.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/08.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/08.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/09.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/09.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/10.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/100.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/100.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/101.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/101.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/102.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/102.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/103.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/103.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/104.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/104.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/105.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/105.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/106.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/106.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/107.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/107.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/108.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/108.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/109.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/109.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/11.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/110.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/110.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/111.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/111.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/112.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/112.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/113.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/113.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/114.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/114.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/115.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/115.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/116.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/116.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/117.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/117.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/118.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/118.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/119.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/119.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/12.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/120.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/120.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/121.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/121.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/122.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/122.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/123.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/123.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/124.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/124.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/125.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/125.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/126.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/126.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/127.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/127.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/128.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/128.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/129.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/129.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/13.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/130.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/130.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/131.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/131.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/132.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/132.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/133.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/133.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/134.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/134.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/14.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/15.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/16.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/17.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/18.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/19.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/20.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/21.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/22.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/23.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/24.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/25.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/26.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/27.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/28.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/29.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/30.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/31.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/32.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/33.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/34.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/35.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/36.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/37.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/38.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/39.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/40.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/41.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/42.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/43.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/44.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/45.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/46.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/47.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/48.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/49.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/50.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/51.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/52.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/53.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/54.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/55.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/56.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/57.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/58.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/59.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/60.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/60.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/61.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/61.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/62.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/62.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/63.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/63.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/64.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/64.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/65.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/65.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/66.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/66.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/67.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/67.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/68.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/68.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/69.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/69.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/70.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/70.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/71.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/71.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/72.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/72.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/73.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/73.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/74.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/74.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/75.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/75.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/76.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/76.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/77.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/77.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/78.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/78.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/79.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/79.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/80.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/80.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/81.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/81.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/82.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/82.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/83.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/83.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/84.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/84.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/85.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/85.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/86.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/86.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/87.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/87.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/88.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/88.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/89.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/89.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/90.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/90.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/91.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/91.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/92.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/92.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/93.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/93.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/94.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/94.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/95.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/95.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/96.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/96.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/97.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/97.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/98.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/98.gif
--------------------------------------------------------------------------------
/wmapp/wxParse/emojis/99.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/wxParse/emojis/99.gif
--------------------------------------------------------------------------------
/wmapp/resources/icon/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/icon/index.png
--------------------------------------------------------------------------------
/wmapp/resources/icon/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/icon/share.png
--------------------------------------------------------------------------------
/wmapp/resources/image/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/add.png
--------------------------------------------------------------------------------
/wmapp/resources/image/blue.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/blue.jpg
--------------------------------------------------------------------------------
/wmapp/resources/image/edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/edit.png
--------------------------------------------------------------------------------
/wmapp/resources/image/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/error.png
--------------------------------------------------------------------------------
/wmapp/resources/image/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/home.png
--------------------------------------------------------------------------------
/wmapp/resources/image/kind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/kind.png
--------------------------------------------------------------------------------
/wmapp/resources/image/top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/top.png
--------------------------------------------------------------------------------
/wmapp/resources/image/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/user.png
--------------------------------------------------------------------------------
/wmapp/resources/image/del-img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/del-img.png
--------------------------------------------------------------------------------
/wmapp/resources/image/add_gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/add_gray.png
--------------------------------------------------------------------------------
/wmapp/resources/image/arrowright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/arrowright.png
--------------------------------------------------------------------------------
/wmapp/resources/image/home_gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/home_gray.png
--------------------------------------------------------------------------------
/wmapp/resources/image/kind_gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/kind_gray.png
--------------------------------------------------------------------------------
/wmapp/resources/image/user_gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/user_gray.png
--------------------------------------------------------------------------------
/wmapp/resources/image/user_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/image/user_icon.png
--------------------------------------------------------------------------------
/wmapp/resources/logo/mouldbbs300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/resources/logo/mouldbbs300.png
--------------------------------------------------------------------------------
/wmapp/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "enablePullDownRefresh": true,
3 | "onReachBottomDistance": "50px",
4 | "backgroundColor": "#f3f3f3"
5 | }
--------------------------------------------------------------------------------
/wmapp/utils/wxSearch/images/wxSearch-icon-delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/august6th/discuz-wechat-miniprogram/HEAD/wmapp/utils/wxSearch/images/wxSearch-icon-delete.png
--------------------------------------------------------------------------------
/wmapi/wmapi_config.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{ nodata_str || '暂无数据' }}
14 |
15 |
16 |
17 |
18 |
19 |
20 | 加载中...
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/wmapi/forum.php:
--------------------------------------------------------------------------------
1 | 0 and fid=' . $fid . ')';
16 | $sql_limit = ' order by dateline desc';
17 |
18 | $forum_thread_data = DB::fetch_all("SELECT * FROM " . DB::table('forum_thread') . $sql_where . $sql_limit);
19 | foreach ($forum_thread_data as &$value) {
20 | // 修改字段
21 | $value['create_time'] = date('Y-m-d', $value['dateline']);
22 | }
23 |
24 | $resp_data['top_thread_data'] = $forum_thread_data;
25 |
26 | // 获取版块信息
27 | $forum_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_forum') . " WHERE fid=" . $fid);
28 | $resp_data['forum_data'] = $forum_data;
29 |
30 | WmApiError::display_result('ok', $resp_data);
--------------------------------------------------------------------------------
/wmapi/login.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | 帖子:{{post.thread_subject}}
19 | {{post.create_time}}
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/wmapp/pages/login/login.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 账号
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 密码
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/wmapp/pages/forum/forum.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{item.name}}
8 |
9 |
10 |
11 |
12 |
13 | {{sub_group.name}}
14 |
15 | 主题: {{sub_group.threads}} 帖子: {{sub_group.posts}}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/wmapi/get_forum.php:
--------------------------------------------------------------------------------
1 | 0");
12 | foreach ($filter as $forum) {
13 | for ($i = 0; $i < count($forum_forum_data); $i++) {
14 | if ($forum_forum_data[$i]['fid'] == $forum['fid']) {
15 | unset($forum_forum_data[$i]);
16 | }
17 | }
18 | }
19 |
20 | $forum_group = array();
21 | foreach ($forum_forum_data as &$value) {
22 | if ($value['type'] == 'group') {
23 | array_push($forum_group, $value);
24 | }
25 | }
26 |
27 | foreach ($forum_group as &$value) {
28 | $sub_group = array();
29 | foreach ($forum_forum_data as &$sub_value) {
30 | if ($sub_value['fup'] == $value['fid']) {
31 | array_push($sub_group, $sub_value);
32 | }
33 | }
34 | $value['sub_group'] = $sub_group;
35 | if (!empty($sub_group)) {
36 | array_push($resp_data, $value);
37 | }
38 | }
39 |
40 | //dd($resp_data);
41 | WmApiError::display_result('ok', $resp_data);
42 |
43 |
44 |
--------------------------------------------------------------------------------
/wmapi/get_forum_info.php:
--------------------------------------------------------------------------------
1 | 0 and fid=' . $fid . ')';
17 | $sql_limit = ' order by dateline desc';
18 |
19 | $forum_thread_data = DB::fetch_all("SELECT * FROM " . DB::table('forum_thread') . $sql_where . $sql_limit);
20 | $resp_data['top_thread_data'] = $forum_thread_data;
21 | foreach ($forum_thread_data as &$value) {
22 | // 修改字段
23 | $value['create_time'] = date('Y-m-d', $value['dateline']);
24 | }
25 |
26 | $resp_data['has_top'] = (sizeof($forum_thread_data) > 0) ? 1 : 0;
27 |
28 | if (sizeof($forum_thread_data) > 2) {
29 | $resp_data['show_more'] = 1;
30 | $resp_data['few_top_thread_data'] = array_slice($forum_thread_data, 0, 2);
31 | } else {
32 | $resp_data['show_more'] = 0;
33 | $resp_data['few_top_thread_data'] = $forum_thread_data;
34 | }
35 |
36 | // 获取版块信息
37 | $forum_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_forum') . " WHERE fid=" . $fid);
38 | $resp_data['forum_data'] = $forum_data;
39 |
40 | WmApiError::display_result('ok', $resp_data);
41 |
--------------------------------------------------------------------------------
/wmapp/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/user/user",
5 | "pages/detail/detail",
6 | "pages/forum/forum",
7 | "pages/login/login",
8 | "pages/register/register",
9 | "pages/forum_list/forum_list",
10 | "pages/self_post/self_post",
11 | "pages/self_thread/self_thread"
12 | ],
13 | "window": {
14 | "backgroundTextStyle": "#323840",
15 | "navigationBarBackgroundColor": "#fff",
16 | "navigationBarTitleText": "中国模具论坛",
17 | "navigationBarTextStyle": "black",
18 | "enablePullDownRefresh": false
19 | },
20 | "tabBar": {
21 | "color": "#CDC9C9",
22 | "selectedColor": "#FF6A6A",
23 | "borderStyle": "white",
24 | "list": [
25 | {
26 | "pagePath": "pages/index/index",
27 | "text": "主页",
28 | "iconPath": "resources/image/home_gray.png",
29 | "selectedIconPath": "resources/image/home.png"
30 | },
31 | {
32 | "pagePath": "pages/forum/forum",
33 | "text": "版块",
34 | "iconPath": "resources/image/kind_gray.png",
35 | "selectedIconPath": "resources/image/kind.png"
36 | },
37 | {
38 | "pagePath": "pages/user/user",
39 | "text": "我的",
40 | "iconPath": "resources/image/user_gray.png",
41 | "selectedIconPath": "resources/image/user.png"
42 | }
43 | ]
44 | }
45 | }
--------------------------------------------------------------------------------
/wmapi/register.php:
--------------------------------------------------------------------------------
1 | insert($uid, $username, md5(random(10)), $email, '', '', $init_arr);
39 |
40 | $data = array();
41 | $data['token'] = WmApiLib::get_token($uid, $openid);
42 | $data['token_expire'] = 7200;
43 |
44 | WmApiError::display_result('ok',$data);
45 |
46 |
--------------------------------------------------------------------------------
/wmapp/pages/forum_list/forum_list.wxss:
--------------------------------------------------------------------------------
1 | @import '../index/index.wxss';
2 |
3 | .article-info .article-by{
4 | color:#c7c7c7;
5 | margin-right:20rpx;
6 | }
7 |
8 | .forum{
9 | padding: 20rpx;
10 | margin-top:20rpx;
11 | background-color:#fff;
12 | }
13 |
14 | .forum_info{
15 | padding:15rpx 0;
16 | }
17 |
18 | .top_subject{
19 | border-top: 1px solid #efefef;
20 | }
21 |
22 | .top_subject_item{
23 | font-size: 26rpx;
24 | color:#4b0;
25 | }
26 |
27 | .forum_title{
28 | font-size:36rpx;
29 | }
30 |
31 | .forum_note{
32 | color:#999;
33 | font-size:14px;
34 | }
35 |
36 | .top_subject .zan-tag{
37 | margin:20rpx 0 10rpx 0;
38 | }
39 |
40 | .top_subject .zan-ellipsis{
41 | margin: 8rpx 0;
42 | }
43 |
44 |
45 | .thread_order{
46 | width: 100%;
47 | display: flex;
48 | flex-direction: row;
49 | justify-content: space-around;
50 | background-color: white;
51 | margin-top: 20rpx;
52 | }
53 |
54 | .thread_order_item{
55 | padding-top: 10rpx;
56 | padding-bottom: 10rpx;
57 | width: 33%;
58 | text-align: center;
59 | }
60 |
61 | .thread_order_border{
62 | border-bottom: 5rpx solid #179b16;
63 | }
64 |
65 | .edit-cell{
66 | z-index: 100;
67 | position: fixed;
68 | right: 50rpx;
69 | bottom: 50rpx;
70 | width: 88rpx;
71 | height: 88rpx;
72 | }
73 |
74 | .edit-cell-img {
75 | width: 88rpx;
76 | height: 88rpx;
77 | border-radius: 50%;
78 | opacity: 0.8;
79 | }
--------------------------------------------------------------------------------
/wmapi/get_token.php:
--------------------------------------------------------------------------------
1 | {'openid'})) {
16 | WmApiError::display_result('param_code_error', '');
17 | exit();
18 | }
19 |
20 | $openid = $user_data->{'openid'};
21 |
22 | $uid = 0;
23 |
24 | $token = $_POST['token'];
25 | if (!empty($token)) {
26 | $result = WmApiLib::decode_token($token);
27 | if ($result['uid'] != 0) {
28 | $uid = $result['uid'];
29 | }
30 | }
31 |
32 | /* 注释掉,关闭微信登陆功能
33 | if ($uid == 0) {
34 | // 检查用户是否已经存在
35 | $wmapi_user = DB::fetch_first("SELECT * FROM " . DB::table('wmapi_user') . " WHERE openid='" . $openid . "'");
36 | if ($wmapi_user && $wmapi_user['uid'] > 0) {
37 | $uid = $wmapi_user['uid'];
38 | }
39 | }
40 | */
41 |
42 | $data = array();
43 | if ($uid == 0) {
44 | $data['has_login'] = 0;
45 | } else {
46 | $data['has_login'] = 1;
47 | }
48 | $data['token'] = WmApiLib::get_token($uid, $openid);
49 | $data['token_expire'] = 7200;
50 |
51 | WmApiError::display_result('ok', $data);
52 |
53 |
--------------------------------------------------------------------------------
/wmapp/pages/register/register.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 账号
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | 密码
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 邮箱
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/wmapp/pages/forum/forum.js:
--------------------------------------------------------------------------------
1 | // pages/forum/forum.js
2 | Page({
3 | /**
4 | * 页面的初始数据
5 | */
6 | data: {
7 | group_list: []
8 | },
9 |
10 | onShow: function() {
11 | var that = this;
12 | wx.request({
13 | url: getApp().globalData.svr_url + "get_forum.php",
14 | method: "post",
15 | header: { "content-type": "application/x-www-form-urlencoded" },
16 | data: {
17 | token: wx.getStorageSync("token"),
18 | },
19 | success: function (resp) {
20 | console.log(resp);
21 | var resp_dict = resp.data;
22 | if (resp_dict.err_code == 0) {
23 | // console.log(resp_dict.data)
24 | that.setData({
25 | group_list: resp_dict.data
26 | })
27 | } else {
28 | getApp().showSvrErrModal(resp);
29 | }
30 | }
31 | })
32 | },
33 |
34 | toForumList: function(e) {
35 | // console.log(e);
36 | var fid = e.currentTarget.dataset.fid;
37 | // console.log(fid);
38 | wx.navigateTo({
39 | url: '../forum_list/forum_list?fid='+fid,
40 | })
41 | },
42 |
43 | clickGroup: function(e) {
44 | // console.log(e)
45 | var fid = e.currentTarget.id;
46 | // console.log(fid)
47 | var group_list = this.data.group_list;
48 | for (var i = 0; i < group_list.length; i++) {
49 | if (group_list[i].fid == fid) {
50 | if (group_list[i].open) {
51 | group_list[i].open = 0;
52 | } else {
53 | group_list[i].open = 1;
54 | }
55 | }
56 | }
57 | this.setData({
58 | group_list: group_list
59 | })
60 | // console.log(this.data.group_list)
61 | }
62 | })
--------------------------------------------------------------------------------
/wmapp/pages/user/user.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{loading_msg}}
6 |
7 |
8 |
9 |
10 | {{userInfo.nickName}}
11 |
12 |
13 |
14 |
15 |
16 |
22 |
23 | 账号登录
24 |
25 |
26 |
32 |
33 |
34 |
35 |
36 | 我的帖子
37 |
38 |
39 |
40 | 我的回复
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/wmapp/utils/wxSearch/wxSearch.wxss:
--------------------------------------------------------------------------------
1 | .wxSearch{
2 | position: absolute;
3 | top: 43px;
4 | left: 0;
5 | width: 100%;
6 | height: 100%;
7 | border-top: 1px #eee solid;
8 | background-color: rgba(0, 0, 0, 0.2);
9 | }
10 | .wxSearchInner{
11 | background-color: #fff;
12 | }
13 | .wxSearch-section{
14 | background-color: #fff;
15 | padding: 5px 10px;
16 | border: 1px #eee solid;
17 | }
18 | .wxSearch-pancel{
19 | display: flex;
20 | flex-direction: row;
21 | }
22 | .wxSearch-input{
23 | flex: 8;
24 | background-color: #eee;
25 | padding: 5px 10px;
26 | }
27 | .wxSearch-button{
28 | flex: 1;
29 | border: none !important;
30 | color: cornflowerblue !important;
31 | }
32 |
33 | .wxSearchTitle{
34 | display: block;
35 | padding: 10px 5px 5px 10px;
36 | font-size: 12px;
37 | text-align: center;
38 | }
39 |
40 |
41 | .wxSearchMindKeyItem{
42 | padding: 10px 5px;
43 | border-bottom: 1px solid #eee;
44 | display: flex;
45 | font-size: 14px;
46 | color: cornflowerblue;
47 | }
48 |
49 | .wxSearchKeyList{
50 | display: flex;
51 | flex-direction: row;
52 | flex-wrap: wrap;
53 | }
54 |
55 | .wxSearchKeyItem{
56 | flex: 0 0 20%;
57 | font-size: 14px;
58 | text-align: center;
59 | border: 1px solid #eee;
60 | margin: 5px;
61 | padding: 5px 10px;
62 | border-radius: 5px;
63 | }
64 | .wxSearchHistoryItem{
65 | padding: 10px 5px;
66 | border-bottom: 1px solid #eee;
67 | display: flex;
68 | }
69 | .wxSearchHistoryItemText{
70 | flex: 8;
71 | font-size: 14px;
72 | }
73 | .wxSearchHistoryItemDel{
74 | flex: 1;
75 | font-size: 12px;
76 | text-align: center;
77 | padding: 3px 5px;
78 | border: 1px solid #eee;
79 | border-radius: 5px;
80 | }
81 | .wxSearchHistoryEmpty{
82 | text-align: center;
83 | height: 50px;
84 | line-height: 50px;
85 | font-size: 12px;
86 | }
87 | .wxSearchDeleteAllBtn{
88 | height: 50px;
89 | line-height: 50px;
90 | text-align: center;
91 | font-size: 12px;
92 | }
--------------------------------------------------------------------------------
/wmapp/pages/login/login.js:
--------------------------------------------------------------------------------
1 | // pages/login/login.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | username: '',
9 | password: '',
10 | },
11 |
12 | inputUsername: function(e) {
13 | this.setData({
14 | username: e.detail.value
15 | });
16 | },
17 |
18 | inputPassword: function(e) {
19 | this.setData({
20 | password: e.detail.value
21 | });
22 | },
23 |
24 | clickLogin: function(e) {
25 | var that = this;
26 |
27 | var username = that.data.username;
28 | if (username == null || username == undefined || username == ''){
29 | getApp().showErrModal('账号不能为空');
30 | return;
31 | }
32 |
33 | var password = that.data.password;
34 | if (password == null || password == undefined || password == ''){
35 | getApp().showErrModal('密码不能为空');
36 | return;
37 | }
38 |
39 | wx.request({
40 | url: getApp().globalData.svr_url + "login.php",
41 | method: "post",
42 | header: { "content-type": "application/x-www-form-urlencoded" },
43 | data: {
44 | token: wx.getStorageSync("token"),
45 | username: encodeURI(that.data.username),
46 | password: that.data.password
47 | },
48 | success: function (resp) {
49 | console.log(resp);
50 | var resp_dict = resp.data;
51 | if (resp_dict.err_code == 0) {
52 | wx.showToast({
53 | title: '登录成功',
54 | });
55 | wx.setStorage({
56 | key: 'token',
57 | data: resp_dict.data.token,
58 | });
59 | wx.setStorage({
60 | key: 'login',
61 | data: 1,
62 | });
63 | wx.setStorage({
64 | key: 'username',
65 | data: that.data.username,
66 | })
67 | wx.switchTab({
68 | url:"../user/user"
69 | });
70 | } else {
71 | getApp().showSvrErrModal(resp);
72 | }
73 | }
74 | })
75 | }
76 | })
--------------------------------------------------------------------------------
/wmapi/add_post.php:
--------------------------------------------------------------------------------
1 | null), 1);
46 | if ($pid < 0)
47 | {
48 | WmApiError::display_result('sys_error', '');
49 | exit();
50 | }
51 |
52 | // 添加贴子
53 | $insert_post = array(
54 | 'pid' => $pid,
55 | 'fid' => $fid,
56 | 'tid' => $tid,
57 | 'first' => 0,
58 | 'author' => $author,
59 | 'authorid' => $authorid,
60 | 'dateline' => $dateline,
61 | 'message' => $message,
62 | 'status' => 0
63 | );
64 |
65 | $post_id = DB::insert('forum_post', $insert_post, 1);
66 |
67 | // 更新版块
68 | DB::query("update ".DB::table('forum_forum').' set posts=posts+1 where fid='.$fid);
69 |
70 | // 更新主题
71 | DB::query("update ".DB::table('forum_thread').' set replies=replies+1 where tid='.$tid);
72 |
73 | $data = array();
74 | $data['pid'] = $pid;
75 | WmApiError::display_result('ok',$data);
76 |
--------------------------------------------------------------------------------
/wmapp/utils/wxSearch/wxSearch.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item}}
9 |
10 |
11 |
12 |
13 |
14 | 热门搜索
15 |
16 |
17 | {{item}}
18 |
19 |
20 |
21 |
22 | 搜索历史
23 |
24 |
25 |
26 | {{item}}
27 | 删除
28 |
29 |
30 | 清除历史
31 |
32 |
33 | 搜索历史为空
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/wmapp/pages/register/register.js:
--------------------------------------------------------------------------------
1 | // pages/login/login.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | username: '',
9 | password: '',
10 | email: '',
11 | },
12 |
13 | inputUsername: function(e) {
14 | this.setData({
15 | username: e.detail.value
16 | });
17 | },
18 |
19 | inputPassword: function(e) {
20 | this.setData({
21 | password: e.detail.value
22 | });
23 | },
24 |
25 | inputEmail: function(e) {
26 | this.setData({
27 | email: e.detail.value
28 | });
29 | },
30 |
31 | clickRegister: function(e) {
32 | var that = this;
33 |
34 | var username = that.data.username;
35 | if (username == null || username == undefined || username == ''){
36 | getApp().showErrModal('账号不能为空');
37 | return;
38 | }
39 |
40 | var password = that.data.password;
41 | if (password == null || password == undefined || password == ''){
42 | getApp().showErrModal('密码不能为空');
43 | return;
44 | }
45 |
46 | var email = that.data.email;
47 | if (email == null || email == undefined || email == ''){
48 | getApp().showErrModal('邮箱不能为空');
49 | return;
50 | }
51 |
52 | wx.request({
53 | url: getApp().globalData.svr_url + "register.php",
54 | method: "post",
55 | header: { "content-type": "application/x-www-form-urlencoded" },
56 | data: {
57 | token: wx.getStorageSync("token"),
58 | username: that.data.username,
59 | password: that.data.password,
60 | email: that.data.email
61 | },
62 | success: function (resp) {
63 | console.log(resp);
64 | var resp_dict = resp.data;
65 | if (resp_dict.err_code == 0) {
66 | wx.showToast({
67 | title: '注册成功',
68 | });
69 | wx.setStorage({
70 | key: 'token',
71 | data: resp_dict.data.token,
72 | });
73 |
74 | wx.switchTab({
75 | url:"../user/user"
76 | });
77 | } else {
78 | getApp().showSvrErrModal(resp);
79 | }
80 | }
81 | })
82 | }
83 |
84 | })
--------------------------------------------------------------------------------
/wmapi/wx_login.php:
--------------------------------------------------------------------------------
1 | 0) {
20 | $uid = $wmapi_user['uid'];
21 | if (time() > $wmapi_user['logintime'] + 7200) {
22 | $wmapi_user['nickname'] = $username;
23 | $wmapi_user['logintime'] = time();
24 | DB::insert('wmapi_user', $wmapi_user, 1, 1);
25 | WmApiLib::set_user_avatar($uid, $avatar_url);
26 | }
27 | } else {
28 | $wx_username = $username . '_wx' . substr($openid, -4) . rand(10, 99);
29 | $member = DB::fetch_first("SELECT * FROM " . DB::table('common_member') . " WHERE username='" . $wx_username . "'");
30 | if ($member) {
31 | WmApiError::display_result('sys_error');
32 | exit();
33 | }
34 |
35 | $insert_common_member = array(
36 | 'username' => $wx_username,
37 | 'password' => md5(random(10))
38 | );
39 |
40 | $uid = DB::insert('common_member', $insert_common_member, 1);
41 | if ($uid <= 0) {
42 | WmApiError::display_result('sys_error');
43 | exit();
44 | }
45 |
46 | $insert_wmapi_user = array(
47 | 'uid' => $uid,
48 | 'openid' => $openid,
49 | 'nickname' => $username,
50 | 'logintime' => time(),
51 | 'dateline' => time()
52 | );
53 |
54 | $wm_uid = DB::insert('wmapi_user', $insert_wmapi_user, 1);
55 | if ($wm_uid <= 0) {
56 | WmApiError::display_result('sys_error');
57 | exit();
58 | }
59 | WmApiLib::set_user_avatar($uid, $avatar_url);
60 | }
61 | */
62 |
63 | $data['token'] = WmApiLib::get_token($uid, $openid);
64 | $data['token_expire'] = 7200;
65 |
66 | WmApiError::display_result('ok', $data);
67 |
68 |
--------------------------------------------------------------------------------
/wmapi/forum_post.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 | {{article.subject}}
15 |
16 |
17 | {{article.author}}
18 | in
19 | {{article.fid_name}}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {{article.message}}
34 |
35 |
36 |
37 |
38 |
39 |
40 | {{article.views}}
41 |
42 | {{article.replies}}
43 |
44 | {{article.create_time}}
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/wmapi/get_self_post.php:
--------------------------------------------------------------------------------
1 | fetch_all_field_perm();
16 | $unselect_forum = array();
17 | foreach ($viewperms as $viewperm) {
18 | if ($viewperm['viewperm']) {
19 | array_push($unselect_forum, $viewperm['fid']);
20 | }
21 | }
22 |
23 | if (!empty($unselect_forum)) {
24 | $sql_not_in = " and fid not in ('" . implode("','", $unselect_forum) . "')";
25 | $sql_where = ' where invisible>=0 and first=0 and authorid=' . $uid . $sql_not_in;
26 | } else {
27 | $sql_where = ' where invisible>=0 and first=0 and authorid=' . $uid;
28 | }
29 |
30 | $page_size = $_POST['page_size'];
31 | if (!empty($page_size)) {
32 | if (!is_numeric($page_size)) {
33 | WmApiError::display_result('param_error', '');
34 | exit;
35 | }
36 | } else {
37 | $page_size = 100;
38 | }
39 |
40 | $page_index = $_POST['page_index'];
41 | if (!empty($page_index)) {
42 | if (!is_numeric($page_index)) {
43 | WmApiError::display_result('param_error', '');
44 | exit;
45 | }
46 | } else {
47 | $page_index = 0;
48 | }
49 |
50 | $sql_limit = ' order by dateline desc limit ' . ($page_index * $page_size) . ', ' . $page_size;
51 |
52 | $resp_data = array();
53 |
54 | $forum_post_data = DB::fetch_all("SELECT * FROM " . DB::table('forum_post') . $sql_where . $sql_limit);
55 |
56 |
57 | foreach ($forum_post_data as $key => &$value) {
58 |
59 | $thread_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_thread') . " where closed = 0 and tid=" . $value['tid']);
60 | // 修改字段
61 | // dd($value);
62 | // dd($thread_data['tid']);
63 | // dd($value);
64 | $value['create_time'] = date('Y-m-d', $value['dateline']);
65 | $value['thread_subject'] = $thread_data['subject'];
66 | $value['message'] = discuzcode(mini_pro_messagesafeclear($value['message']), 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
67 | }
68 | //dd($forum_post_data);
69 |
70 | $resp_data['self_post_list'] = $forum_post_data;
71 |
72 | //dd($resp_data);
73 |
74 | WmApiError::display_result('ok', $resp_data);
75 |
--------------------------------------------------------------------------------
/wmapi/get_self_thread.php:
--------------------------------------------------------------------------------
1 | =0 and closed = 0 and authorid='.$uid;
16 |
17 | $order_field = 'dateline';
18 |
19 | $page_size = $_POST['page_size'];
20 | if (!empty($page_size))
21 | {
22 | if(!is_numeric($page_size))
23 | {
24 | WmApiError::display_result('param_error', '');
25 | exit;
26 | }
27 | }
28 | else
29 | {
30 | $page_size = 5;
31 | }
32 |
33 | $page_index = $_POST['page_index'];
34 | if (!empty($page_index))
35 | {
36 | if(!is_numeric($page_index))
37 | {
38 | WmApiError::display_result('param_error', '');
39 | exit;
40 | }
41 | }
42 | else
43 | {
44 | $page_index = 0;
45 | }
46 |
47 | $sql_limit = ' order by '.$order_field.' desc limit '.($page_index*$page_size).', '.$page_size;
48 |
49 | $resp_data = array();
50 |
51 | $forum_thread_data = DB::fetch_all("SELECT * FROM ".DB::table('forum_thread').$sql_where.$sql_limit);
52 |
53 | foreach ($forum_thread_data as &$value)
54 | {
55 | $forum_post_data = DB::fetch_first("SELECT * FROM ".DB::table('forum_post')." where first=1 and tid=".$value['tid']);
56 | $pid = $forum_post_data['pid'];
57 |
58 | $image_list = array();
59 | // 获取图片
60 | /*
61 | if ($value['attachment'] == 2) {
62 | $forum_attachment = DB::fetch_all("SELECT * FROM ".DB::table('forum_attachment_'.($value['tid']%10))." where pid=".$pid);
63 | foreach ($forum_attachment as &$image_item)
64 | {
65 | $image_url = 'http://'.$_SERVER['HTTP_HOST'].'/'.dirname($_SERVER['PHP_SELF']).'/get_image.php?file_url='.$image_item['attachment'];
66 | array_push($image_list, $image_url);
67 | }
68 | $value['image_list'] = $image_list;
69 | }
70 | */
71 |
72 | // 获取版块
73 | $forum_forum_data = DB::fetch_first("SELECT * FROM ".DB::table('forum_forum')." WHERE status=1 and fid=".$value['fid']);
74 | if ($forum_forum_data)
75 | {
76 | $value['fid_name'] = $forum_forum_data['name'];
77 | }
78 |
79 | // 修改字段
80 | $value['create_time'] = date('Y-m-d', $value['dateline']);
81 | }
82 |
83 | $resp_data['forum_thread_data'] = $forum_thread_data;
84 |
85 | WmApiError::display_result('ok', $resp_data);
86 |
--------------------------------------------------------------------------------
/wmapp/pages/add_forum_article/add_forum_article.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{loading_msg}}
6 |
7 |
8 |
9 |
10 |
11 | 发布到版块:{{fname}}
12 |
13 |
14 |
15 |
16 |
17 | 标题
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 选择图片
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/wmapp/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{loading_msg}}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{article.subject}}
20 |
21 |
22 | by
23 | {{article.author}}
24 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | {{article.message}}
41 |
42 |
43 |
44 |
45 |
46 |
47 | {{article.views}}
48 |
49 | {{article.replies}}
50 |
51 | {{article.create_time}}
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/wmapi/inc.php:
--------------------------------------------------------------------------------
1 | cachelist = $cachelist;
10 | $discuz->init();
11 |
12 | //dd($_SERVER['HTTPS']);
13 | $http_type = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
14 |
15 | include_once 'wmapi_config.php';
16 | include_once 'error.php';
17 | include_once 'lib.php';
18 |
19 | function getDataForCharset($data)
20 | {
21 | return (CHARSET != 'UTF-8') ? dhtmlspecialchars(WmApiError::array_iconv($data)) : dhtmlspecialchars($data);
22 | }
23 |
24 | function get_url_content($url)
25 | {
26 | $ch = curl_init();
27 | curl_setopt($ch, CURLOPT_URL, $url);
28 | # curl_setopt($ch, CURLOPT_HEADER, 1);
29 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
30 |
31 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
32 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
33 |
34 | if (!curl_exec($ch)) {
35 | error_log(curl_error($ch));
36 | $data = '';
37 | } else {
38 | $data = curl_multi_getcontent($ch);
39 | }
40 | curl_close($ch);
41 | return $data;
42 | }
43 |
44 | function mini_pro_messagesafeclear($message) {
45 | if(strpos($message, '[/password]') !== FALSE) {
46 | $message = '';
47 | }
48 | if(strpos($message, '[/postbg]') !== FALSE) {
49 | $message = preg_replace("/\s?\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]\s?/is", '', $message);
50 | }
51 | if(strpos($message, '[/begin]') !== FALSE) {
52 | $message = preg_replace("/\[begin(=\s*([^\[\<\r\n]*?)\s*,(\d*),(\d*),(\d*),(\d*))?\]\s*([^\[\<\r\n]+?)\s*\[\/begin\]/is", '', $message);
53 | }
54 | if(strpos($message, '[page]') !== FALSE) {
55 | $message = preg_replace("/\s?\[page\]\s?/is", '', $message);
56 | }
57 | if(strpos($message, '[/index]') !== FALSE) {
58 | $message = preg_replace("/\s?\[index\](.+?)\[\/index\]\s?/is", '', $message);
59 | }
60 | if(strpos($message, '[/begin]') !== FALSE) {
61 | $message = preg_replace("/\[begin(=\s*([^\[\<\r\n]*?)\s*,(\d*),(\d*),(\d*),(\d*))?\]\s*([^\[\<\r\n]+?)\s*\[\/begin\]/is", '', $message);
62 | }
63 | if(strpos($message, '[/groupid]') !== FALSE) {
64 | $message = preg_replace("/\[groupid=\d+\].*\[\/groupid\]/i", '', $message);
65 | }
66 | $language = lang('forum/misc');
67 | $message = preg_replace(array($language['post_edithtml_regexp'],$language['post_editnobbcode_regexp'],$language['post_edit_regexp']), '', $message);
68 | $language = lang('forum/misc');
69 | loadcache(array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes', 'domainwhitelist'));
70 | $bbcodesclear = 'attach'.($_G['cache']['bbcodes_display'][$_G['groupid']] ? '|'.implode('|', array_keys($_G['cache']['bbcodes_display'][$_G['groupid']])) : '');
71 | $message = strip_tags(preg_replace(array(
72 | "/\[hide=?\d*\](.*?)\[\/hide\]/is",
73 | "/\[($bbcodesclear)=?.*?\].+?\[\/\\1\]/si",
74 | ), array(
75 | "[b]$language[post_hidden][/b]",
76 | '',
77 | ), $message));
78 | return trim($message);
79 | }
--------------------------------------------------------------------------------
/wmapp/pages/self_thread/self_thread.js:
--------------------------------------------------------------------------------
1 | // pages/self_thread/self_thread.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | articleList: [],
10 | page_size: 5,
11 | page_index: 0,
12 | lite_switch: app.globalData.lite_switch
13 | },
14 |
15 | /**
16 | * 生命周期函数--监听页面加载
17 | */
18 | onLoad: function (options) {
19 | this.reloadIndex();
20 | },
21 |
22 | onShow: function () {
23 | },
24 |
25 | reloadIndex: function() {
26 | var that = this;
27 | var tmpArticleList = [];
28 | var page_size = that.data.page_size;
29 | var page_index = 0;
30 | wx.request({
31 | url: getApp().globalData.svr_url + "get_self_thread.php",
32 | method: "post",
33 | header: { "content-type": "application/x-www-form-urlencoded" },
34 | data: {
35 | token: wx.getStorageSync("token"),
36 | page_size: page_size,
37 | page_index: page_index
38 | },
39 | success: function (resp) {
40 | console.log(resp);
41 | var resp_dict = resp.data;
42 | if (resp_dict.err_code == 0) {
43 | that.setData({
44 | articleList: resp_dict.data.forum_thread_data,
45 | page_index: page_index
46 | })
47 | } else {
48 | getApp().showSvrErrModal(resp);
49 | }
50 | }
51 | })
52 | },
53 |
54 | onReachBottom: function() {
55 | var that = this;
56 | var page_size = that.data.page_size;
57 | var page_index = that.data.page_index+1;
58 | wx.request({
59 | url: getApp().globalData.svr_url + "get_self_thread.php",
60 | method: "post",
61 | header: { "content-type": "application/x-www-form-urlencoded" },
62 | data: {
63 | token: wx.getStorageSync("token"),
64 | page_size: page_size,
65 | page_index: page_index
66 | },
67 | success: function (resp) {
68 | console.log(resp);
69 | var resp_dict = resp.data;
70 | if (resp_dict.err_code == 0) {
71 | var tmpArticleList = that.data.articleList;
72 | var respArticleList = resp_dict.data.forum_thread_data;
73 | var has_append = 0;
74 | for (var i = 0; i < respArticleList.length; ++i) {
75 | var has_in = 0;
76 | for (var j = 0; j < tmpArticleList.length; ++j) {
77 | if (respArticleList[i].tid == tmpArticleList[j].tid) {
78 | has_in = 1;
79 | }
80 | }
81 | if (has_in == 0) {
82 | tmpArticleList.push(respArticleList[i]);
83 | has_append = 1;
84 | }
85 | }
86 |
87 | if (has_append == 1)
88 | {
89 | that.setData({
90 | articleList: tmpArticleList,
91 | page_index: page_index
92 | })
93 | }
94 | } else {
95 | getApp().showSvrErrModal(resp);
96 | }
97 | }
98 | })
99 | },
100 |
101 | toDetail: function (e) {
102 | console.log(e);
103 | var tid = e.currentTarget.dataset.tid;
104 | wx.navigateTo({
105 | url: '../detail/detail?tid='+tid,
106 | })
107 | },
108 | })
--------------------------------------------------------------------------------
/wmapi/get_user_info.php:
--------------------------------------------------------------------------------
1 | $medalid) {
36 | list($medalid, $medalexpiration) = explode("|", $medalid);
37 | if (empty($medalid)) {
38 | continue;
39 | }
40 | if (!$medalexpiration || $medalexpiration > TIMESTAMP) {
41 | $usermedals[] = $medalid;
42 | }
43 | }
44 | if (!empty($usermedals)) {
45 | $medal_detail = DB::fetch_all("SELECT * FROM " . DB::table('forum_medal') . " WHERE medalid in(" . implode(',', $usermedals) . ")");
46 | foreach ($medal_detail as $val) {
47 | if ($val['expiration'] == 0 || $val['expiration'] > TIMESTAMP) {
48 | $usermedalmenus[] = array('medalid' => $val['medalid'], 'name' => $val['name'], 'image' => STATICURL . 'image/common/' . $val['image']);
49 | }
50 | }
51 | }
52 | }
53 |
54 | //统计数据
55 | $member_count = DB::fetch_first("SELECT * FROM " . DB::table('common_member_count') . " WHERE uid='{$result['uid']}'");
56 |
57 | //头像
58 |
59 | $data = array();
60 | $data['uid'] = $member['uid'];
61 | $data['avatar'] = WmApiLib::get_user_avatar($member['uid']);
62 | $data['username'] = $author;
63 |
64 | /*
65 | $data['email'] = $member['email'];
66 | $data['password'] = $member['password'];
67 | $data['groupid'] = $member['groupid'];//等级
68 | $data['extcredits3'] = $member_count['extcredits3'];//金钱
69 | $data['extcredits6'] = $member_count['extcredits6'];//模币
70 | $data['extcredits8'] = $member_count['extcredits6'];//应助分
71 | $data['follower'] = $member_count['follower'];//分数数
72 | $data['following'] = $member_count['following'];//关注数
73 | $data['gender'] = lang('space','gender_'.$member_profile['gender']);//$member_profile['gender'] ? ($member_profile['gender']==1 ? '男' : '女') : '保密';//关注数
74 | $data['department'] = $member_profile['field2'];//部门
75 | $data['constellation'] = $member_profile['constellation'];//星座
76 | $data['medals'] = $usermedalmenus;//勋章
77 | $data['bloodtype'] = $member_profile['bloodtype'];//血型
78 | $data['sightml'] = strip_tags($member_profile_forum['sightml']);//签名
79 | */
80 |
81 | //dd($data);
82 |
83 | WmApiError::display_result('ok', $data);
84 |
85 |
--------------------------------------------------------------------------------
/update_log.md:
--------------------------------------------------------------------------------
1 | ## 备份描述
2 |
3 | > 备份源码在线上测试论坛进行过测试,主要有以下几个功能,考虑到有破坏的可能,特此备份。
4 |
5 | ### 2018.1.23
6 |
7 | 1. ```file_get_content()``` 函数,在论坛上有可能无法使用,已经在 ***inc.php*** 文件中实现相同功能的
8 |
9 | ```get_url_content()``` 函数。
10 |
11 | ```php
12 | function get_url_content($url)
13 | {
14 | $ch = curl_init();
15 | curl_setopt($ch, CURLOPT_URL, $url);
16 | # curl_setopt($ch, CURLOPT_HEADER, 1);
17 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
18 |
19 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
20 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
21 |
22 | if (!curl_exec($ch)) {
23 | error_log(curl_error($ch));
24 | $data = '';
25 | } else {
26 | $data = curl_multi_getcontent($ch);
27 | }
28 | curl_close($ch);
29 | return $data;
30 | }
31 | ```
32 |
33 | 2. 由于论坛整体格式为 GBK,而和微信服务端交互,必须为 UTF-8 编码,所以对接口编码进行了一部分的优化。
34 |
35 | 输出的情况下,有 ***error.php*** 下的 ```array_iconv()``` 函数,来对输出数组进行编码的转换。
36 |
37 | ```php
38 | static function array_iconv($str, $in_charset = "UTF-8", $out_charset = CHARSET)
39 | {
40 | if (is_array($str)) {
41 | foreach ($str as $k => $v) {
42 | $str[$k] = WmApiError::array_iconv($v, $in_charset, $out_charset);
43 | }
44 | return $str;
45 | } else {
46 | if (is_string($str)) {
47 | // return iconv('UTF-8', 'GBK//IGNORE', $str);
48 | return mb_convert_encoding($str, $out_charset, $in_charset);
49 | } else {
50 | return $str;
51 | }
52 | }
53 | ```
54 |
55 | 接受的情况下, 有 ***inc.php*** 下的 ```getDataForCharset()``` 函数来整合接受编码。
56 |
57 | ```php
58 | function getDataForCharset($data)
59 | {
60 | return (CHARSET != 'UTF-8') ? dhtmlspecialchars(WmApiError::array_iconv($data)) : dhtmlspecialchars($data);
61 | }
62 | ```
63 |
64 | 3. 关闭了微信登陆的功能。
65 |
66 | 4. 获取帖子时新增了帖子的具体内容,message。
67 |
68 | 5. 优化了其他一些细节部分的内容。
69 |
70 | ### 2018.1.24
71 |
72 | 1. 输出帖子时,对 Discuz Code 进行解码,同时,获取图片附件,以及表情图片。
73 | 2. 接受时,解析文本的加粗、高亮、斜体、字体等。让帖子呈原样输出。
74 | 3. 以上功能,重点在 ***wmapi/get_post_detail.php*** 、 ***wmapi/get_self_post.php*** 两个脚本中重点突出。
75 |
76 | ### 2018.1.31
77 |
78 | > 本次更新十分重要,是根据生产环境测试得来
79 | >
80 | > 本次记录内容页包含了小程序的部分修改
81 |
82 | 1. 部分获取小程序的数据的方式为 ```get_url_content()``` 部分为 ```file_get_content()``` (生产环境可能由于设置问题,导致如此怪异,请结合自身服务器来看)
83 | 2. 首页新增加载状态 (加载中... 没有更多... 暂无数据...)
84 | 3. 群组帖子,无法显示群组的名称
85 | 4. 修复中文无法登陆 bug (在小程序向服务器传递中文字符串的时候,先 ```encodeURI()``` 再到论坛服务器上 ```urldecode()``` 最后进行 UTF8 -> GBK 的转码,当然,是有必要的情况下。)
86 | 5. 首次登陆,无法直接加载(是因为小程序 app.js 中还有 微信登陆的残留代码在执行,关闭即可,否则会报错,参数错误。)
87 |
88 |
89 | ### 2018.2.1
90 |
91 | 1. 部分非图片附件,加载空白位占位
92 | 2. 部分图片附件以及头像图片加载为 http 而非 https
93 |
94 | ### 2018.2.3
95 |
96 | 1. 部分手机显示的头像被压扁
97 | 2. 个人回复获得的数据有误
98 | 3. 过滤带有权限控制的版块的帖子
99 | 4. 有非图片附件的帖子进行提示
100 | 5. 过滤隐藏贴以及密码贴的内容
101 |
102 |
103 | ### 2018.2.5
104 |
105 | 个人的失误,老代码覆盖了新代码,今天恢复,并新增如下功能
106 |
107 | 1. 付费贴内容隐藏并提示
108 | 2. 回到顶部按钮
109 | 3. 过滤 attach 标签,同时不显示隐藏贴内容
110 |
111 |
112 | ### 2018.2.6
113 |
114 | 重新封装缓存 Api ,给缓存内容设置时效,目的是解决如下 bug
115 |
116 | 长时间未操作的情况下,使用的是已过期的 token,我们需要自己给 token 设置过期值。
117 |
118 | ### 2018.4.7
119 |
120 | 新增文章页的回到首页按钮以及分享按钮,方便文章分享!
--------------------------------------------------------------------------------
/wmapp/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | .article{
3 | background-color: #fff;
4 | /* padding:20rpx; */
5 | padding:10rpx 20rpx;
6 | margin:20rpx 0;
7 | border-radius: 10rpx;
8 | color:#2D2E2F;
9 | }
10 |
11 | .article-header{
12 | height: 120rpx;
13 | display: flex;
14 | flex-flow: row nowrap;
15 | justify-content: flex-start;
16 | align-items: center;
17 | margin-bottom:8rpx;
18 | /* padding-bottom:6rpx; */
19 | border-bottom: 1px solid #efefef;
20 | }
21 |
22 | .article-header .article-author-avatar{
23 | width:15%;
24 | display: flex;
25 | flex-direction: row;
26 | justify-content: flex-start;
27 | align-content: center;
28 | }
29 |
30 | .article-header .article-author-avatar image{
31 | /*
32 | width: 90rpx;
33 | height:90rpx;
34 | */
35 | width: 78rpx;
36 | height: 78rpx;
37 | border-radius: 50%;
38 | margin-right: 20rpx;
39 | }
40 |
41 | .article-side-header {
42 | width:85%;
43 | }
44 |
45 | .article-sub-header{
46 | display: flex;
47 | flex-flow: row nowrap;
48 | align-items: center;
49 | }
50 |
51 | .article-sub-header .article-title{
52 | color: #444;
53 | font-size: 30rpx;
54 | font-weight: 600;
55 | display: -webkit-box;
56 | -webkit-box-orient: vertical;
57 | -webkit-line-clamp: 1;
58 | overflow: hidden;
59 | }
60 |
61 | .article-info{
62 | display: flex;
63 | flex-flow: row nowrap;
64 | align-items: center;
65 | }
66 |
67 | .article-info .article-by{
68 | color:#c7c7c7;
69 | margin-right:10rpx;
70 | }
71 |
72 | .article-info .article-author{
73 | color:#666;
74 | font-size:26rpx;
75 | }
76 |
77 | .article-info .article-fid-item{
78 | font-size:26rpx;
79 | color: #FF6A6A;
80 | }
81 |
82 | .article-info .article-in{
83 | color:#c7c7c7;
84 | margin:0 20rpx;
85 | }
86 |
87 | .article-img{
88 | position: relative;
89 | width: 100%;
90 | height: 200rpx;
91 | overflow: hidden;
92 | background-position: 50%;
93 | background-size: cover;
94 | -webkit-transform: translateZ(0);
95 | transform: translateZ(0);
96 | margin-bottom:10rpx;
97 | }
98 |
99 | .article-img-info{
100 | position: absolute;
101 | top: 50%;
102 | left: 0;
103 | height: 100%;
104 | width: 100%;
105 | -webkit-transform: translateY(-50%);
106 | transform: translateY(-50%);
107 | overflow: hidden;
108 | }
109 |
110 | .article-img-item {
111 | position: absolute;
112 | top: 50%;
113 | left: 50%;
114 | width: 100%;
115 | -webkit-transform: translate3d(-50%,-50%,0);
116 | transform: translate3d(-50%,-50%,0);
117 | }
118 |
119 | .article-message{
120 | margin:10rpx 0;
121 | color: #909090;
122 | font-size: 30rpx;
123 | }
124 |
125 | .article-ext-info{
126 | display: flex;
127 | flex-flow: row nowrap;
128 | justify-content: space-between;
129 | /* margin-top: 10rpx; */
130 | color: #c7c7c7;
131 | }
132 |
133 | .article-ext-info .article-re{
134 | display: flex;
135 | flex-flow: row nowrap;
136 | }
137 |
138 | .article-ext-info .article-re .zan-icon{
139 | color:#f44444;
140 | }
141 |
142 | .article-ext-info .article-re view{
143 | margin-right:20rpx;
144 | }
145 |
146 | .scroll-to-top {
147 | z-index: 100;
148 | position: fixed;
149 | right: 50rpx;
150 | bottom: 50rpx;
151 | width: 90rpx;
152 | height: 90rpx;
153 | }
154 |
155 | .scroll-to-top-img {
156 | background-color: #FF6A6A;
157 | width: 90rpx;
158 | height: 90rpx;
159 | border-radius: 50%;
160 | opacity: 0.9;
161 | }
--------------------------------------------------------------------------------
/wmapp/pages/add_article/add_article.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{loading_msg}}
6 |
7 |
8 |
9 |
10 |
11 |
12 | 标题
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 类别
22 |
23 |
24 |
25 | {{group_list[group_index]}}
26 |
27 |
28 |
29 |
30 |
31 |
32 | 版块
33 |
34 |
35 |
36 | {{sub_group_list[sub_group_index]}}
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 选择图片
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/wmapi/error.php:
--------------------------------------------------------------------------------
1 | 'ok',
8 | 'sys_error' => '系统错误',
9 | 'param_error' => '参数错误',
10 | 'user_no_login' => '用户没有登录',
11 | 'user_login_failed' => '登录失败',
12 | 'token_error' => 'token错误',
13 | 'token_has_expired' => 'token过期',
14 | 'user_status_excption' => '用户状态异常',
15 | 'user_visit_been_banned' => '用户被禁止访问',
16 | 'token_check_successed' => 'token检查成功',
17 | 'file_too_big' => '文件太大',
18 | 'file_type_error' => '文件类型不支持',
19 | 'file_upload_error' => '文件上传失败',
20 | 'param_code_error' => '参数code错误',
21 | 'token_empty' => 'token不能为空',
22 | 'profile_username_illegal' => '用户名不合法',
23 | 'profile_username_protect' => '用户名不合法',
24 | 'profile_username_duplicate' => '用户名已存在',
25 | 'profile_email_domain_illegal' => '邮箱不合法',
26 | 'profile_email_duplicate' => '邮箱已存在',
27 | );
28 |
29 | static $_wm_global_error_code = array(
30 | 'ok' => 0,
31 | 'sys_error' => -1,
32 | 'param_error' => 1,
33 | 'user_no_login' => 10001,
34 | 'user_login_failed' => 10002,
35 | 'token_error' => 10003,
36 | 'token_has_expired' => 10004,
37 | 'user_status_excption' => 10005,
38 | 'user_visit_been_banned' => 10006,
39 | 'token_check_successed' => 10007,
40 | 'file_too_big' => 10008,
41 | 'file_type_error' => 10009,
42 | 'file_upload_error' => 10010,
43 | 'param_code_error' => 10011,
44 | 'token_empty' => 10012,
45 | 'profile_username_illegal' => 10013,
46 | 'profile_username_protect' => 10014,
47 | 'profile_username_duplicate' => 10015,
48 | 'profile_email_domain_illegal' => 10016,
49 | 'profile_email_duplicate' => 10017,
50 | );
51 |
52 | static function display_result($error, $data=array())
53 | {
54 |
55 | if (CHARSET != 'UTF-8') {
56 | $data = WmApiError::array_iconv($data, CHARSET, 'UTF-8');
57 | }
58 | $result = array();
59 | $result['err_code'] = -1;
60 | $result['err_msg'] = '数据正在初始化...';
61 |
62 | $result['data'] = array();
63 | if(isset(self::$_wm_global_error_code[$error]))
64 | {
65 | $result['err_code'] = self::$_wm_global_error_code[$error];
66 | $result['err_msg'] = self::$_wm_global_error_msg[$error];
67 | }
68 |
69 | if($error == 'ok' and !empty($data))
70 | {
71 | $result['data'] = $data;
72 | }
73 | header('Content-Type: application/json');
74 | //$req_data = get_url_content("php://input");
75 | $req_data = file_get_contents("php://input");
76 |
77 | $resp_data = json_encode($result);
78 | self::runlog("req_data: ".$req_data." resp_data: ".$resp_data);
79 | echo $resp_data;
80 | }
81 |
82 | static function runlog($log_str)
83 | {
84 | runlog('wmapi', $log_str);
85 | }
86 |
87 | static function convertToUtf($str) {
88 | return urlencode(diconv($str, CHARSET, 'UTF-8'));
89 | }
90 |
91 | static function array_iconv($str, $in_charset = "UTF-8", $out_charset = CHARSET)
92 | {
93 | if (is_array($str)) {
94 | foreach ($str as $k => $v) {
95 | $str[$k] = WmApiError::array_iconv($v, $in_charset, $out_charset);
96 | }
97 | return $str;
98 | } else {
99 | if (is_string($str)) {
100 | // return iconv('UTF-8', 'GBK//IGNORE', $str);
101 | //return diconv($str, $out_charset, $in_charset);
102 | return mb_convert_encoding($str, $out_charset, $in_charset);
103 |
104 | } else {
105 | return $str;
106 | }
107 | }
108 | }
109 |
110 | };
111 |
--------------------------------------------------------------------------------
/wmapp/pages/user/user.js:
--------------------------------------------------------------------------------
1 | // user.js
2 | var app = getApp()
3 |
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | hasUserInfo: false,
11 | userInfo: {
12 | avatarUrl: "../../resources/image/user_icon.png",
13 | nickName: "游客"
14 | },
15 | loading_hidden: true,
16 | loading_msg: '加载中...'
17 | },
18 |
19 | onLoad: function () {
20 |
21 | },
22 |
23 | onShow: function() {
24 | var that = this;
25 | wx.request({
26 | url: getApp().globalData.svr_url + "get_user_info.php",
27 | method: "post",
28 | header: { "content-type": "application/x-www-form-urlencoded" },
29 | data: {
30 | token: wx.getStorageSync("token"),
31 | },
32 | success: function (resp) {
33 | console.log(resp);
34 | var resp_dict = resp.data;
35 | if (resp_dict.err_code == 0) {
36 | that.setData({
37 | hasUserInfo: true,
38 | userInfo: {
39 | avatarUrl: resp_dict.data.avatar,
40 | nickName: resp_dict.data.username
41 | }
42 | })
43 | } else {
44 | that.setData({
45 | hasUserInfo: false,
46 | userInfo: {
47 | avatarUrl: "../../resources/image/user_icon.png",
48 | nickName: "游客"
49 | }
50 | })
51 | }
52 | }
53 | });
54 | },
55 |
56 | wxlogin: function() {
57 | var that = this;
58 | console.log('wxLogin');
59 | that.setData({
60 | loading_hidden: false,
61 | loading_msg: '登录中...'
62 | })
63 | wx.getUserInfo({
64 | success: function (res) {
65 | console.log(res.userInfo);
66 | var username = res.userInfo.nickName;
67 | var avatar_url = res.userInfo.avatarUrl;
68 | wx.request({
69 | url: getApp().globalData.svr_url+'wx_login.php',
70 | method: 'POST',
71 | header: { "content-type": "application/x-www-form-urlencoded" },
72 | data: {
73 | token: wx.getStorageSync("token"),
74 | username: username,
75 | avatar_url: avatar_url
76 | },
77 | success: function(resp) {
78 | console.log(resp);
79 | var resp_dict = resp.data;
80 | if (resp_dict.err_code == 0) {
81 | wx.setStorage({
82 | key: 'token',
83 | data: resp.data.data.token,
84 | success: function() {
85 | that.setData({
86 | loading_hidden: true,
87 | })
88 | that.onShow();
89 | }
90 | })
91 | } else {
92 | getApp().showSvrErrModal(resp);
93 | }
94 | }
95 | })
96 | }
97 | });
98 |
99 | },
100 |
101 | logout: function() {
102 | var that = this;
103 | wx.request({
104 | url: getApp().globalData.svr_url+'logout.php',
105 | method: 'POST',
106 | header: { "content-type": "application/x-www-form-urlencoded" },
107 | data: {
108 | token: wx.getStorageSync("token"),
109 | },
110 | success: function(resp) {
111 | console.log(resp);
112 | var resp_dict = resp.data;
113 | if (resp_dict.err_code == 0) {
114 | wx.setStorage({
115 | key: 'token',
116 | data: resp_dict.data.token,
117 | success: function() {
118 | that.onShow();
119 | }
120 | })
121 | wx.setStorage({
122 | key: 'login',
123 | data: 0,
124 | })
125 | } else {
126 | getApp().showSvrErrModal(resp);
127 | }
128 | }
129 | })
130 | }
131 |
132 | })
--------------------------------------------------------------------------------
/wmapp/app.wxss:
--------------------------------------------------------------------------------
1 | /* reset */
2 | @import "./weui/weui.wxss";
3 | @import "./zanui/zanui.wxss";
4 |
5 | page {
6 | background-color: #f3f3f3;
7 | height: 100%;
8 | font-size: 28rpx;
9 | line-height: 1.6;
10 | }
11 | checkbox, radio{
12 | margin-right: 10rpx;
13 | }
14 | button{
15 | margin-top: 20rpx;
16 | margin-bottom: 20rpx;
17 | font-size: 16px;
18 | }
19 | form{
20 | width: 100%;
21 | }
22 |
23 | /* lib */
24 | .strong{
25 | font-weight: bold;
26 | }
27 | .tc{
28 | text-align: center;
29 | }
30 |
31 | /* page */
32 | .container {
33 | display: flex;
34 | flex-direction: column;
35 | min-height: 100%;
36 | justify-content: space-between;
37 | font-size: 28rpx;
38 | padding:0 20rpx;
39 | font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
40 | }
41 | .page-head{
42 | padding: 60rpx 50rpx 80rpx;
43 | text-align: center;
44 | }
45 | .page-head-title{
46 | display: inline-block;
47 | padding: 0 40rpx 20rpx 40rpx;
48 | font-size: 32rpx;
49 | color: #BEBEBE;
50 | }
51 | .page-head-line{
52 | margin: 0 auto;
53 | width: 150rpx;
54 | height: 2rpx;
55 | background-color: #D8D8D8;
56 | }
57 | .page-head-desc{
58 | padding-top: 20rpx;
59 | color: #9B9B9B;
60 | font-size: 32rpx;
61 | }
62 |
63 | .page-body {
64 | width: 100%;
65 | flex-grow: 1;
66 | overflow-x: hidden;
67 | }
68 |
69 | .page-body-wrapper {
70 | display: flex;
71 | flex-direction: column;
72 | align-items: center;
73 | width: 100%;
74 | }
75 | .page-body-wording {
76 | text-align: center;
77 | padding: 200rpx 100rpx;
78 | }
79 | .page-body-info {
80 | display: flex;
81 | flex-direction: column;
82 | align-items: center;
83 | background-color: #fff;
84 | width: 100%;
85 | padding: 50rpx 0 150rpx 0;
86 | }
87 | .page-body-title {
88 | margin-bottom: 100rpx;
89 | font-size: 32rpx;
90 | }
91 | .page-body-text {
92 | font-size: 30rpx;
93 | line-height: 26px;
94 | color: #ccc;
95 | }
96 | .page-body-text-small {
97 | font-size: 24rpx;
98 | color: #000;
99 | margin-bottom: 100rpx;
100 | }
101 |
102 | .page__bd{
103 | margin-top:20rpx;
104 | }
105 |
106 | .page-foot{
107 | margin: 100rpx 0 30rpx 0;
108 | text-align: center;
109 | color: #1aad19;
110 | font-size: 0;
111 | }
112 | .icon-foot{
113 | width: 152rpx;
114 | height: 23rpx;
115 | }
116 |
117 | .cells-no-border {
118 | font-size: 30rpx;
119 | border-radius: 10rpx;
120 | }
121 |
122 | .cells-no-border::after, .cells-no-border::before {
123 | border:none;
124 | }
125 |
126 | /* widget */
127 |
128 |
129 | .btn-area{
130 | margin-top: 60rpx;
131 | box-sizing: border-box;
132 | width: 100%;
133 | padding: 0 20rpx;
134 | }
135 |
136 | .navigator-box {
137 | opacity: 0;
138 | position: relative;
139 | background-color: #FFFFFF;
140 | line-height: 1.41176471;
141 | font-size: 34rpx;
142 |
143 | transform: translateY(-50%);
144 | transition: .3s;
145 | }
146 | .navigator-box-show {
147 | opacity: 1;
148 | transform: translateY(0);
149 | }
150 |
151 | .navigator {
152 | padding: 20rpx 30rpx;
153 | position: relative;
154 | display: flex;
155 | align-items: center;
156 | }
157 |
158 | .navigator:first-child:before {
159 | display: none;
160 | }
161 |
162 | .navigator-text {
163 | flex: 1;
164 | }
165 |
166 | .navigator-arrow {
167 | padding-right: 26rpx;
168 | position: relative;
169 | }
170 |
171 | .navigator-arrow:after {
172 | content: " ";
173 | display: inline-block;
174 | height: 18rpx;
175 | width: 18rpx;
176 | border-width: 2rpx 2rpx 0 0;
177 | border-color: #888888;
178 | border-style: solid;
179 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
180 | position: absolute;
181 | top: 50%;
182 | margin-top: -8rpx;
183 | right: 28rpx;
184 | }
--------------------------------------------------------------------------------
/wmapi/get_thread.php:
--------------------------------------------------------------------------------
1 | fetch_all_field_perm();
12 | $unselect_forum = array();
13 | foreach ($viewperms as $viewperm) {
14 | if ($viewperm['viewperm']) {
15 | array_push($unselect_forum, $viewperm['fid']);
16 | }
17 | }
18 |
19 | if (!empty($unselect_forum)) {
20 | $sql_not_in = "and fid not in ('" . implode("','", $unselect_forum) . "')";
21 | $sql_where = ' where displayorder>=0 and closed = 0 ' . $sql_not_in;
22 | } else {
23 | $sql_where = ' where displayorder>=0 and closed = 0 ';
24 | }
25 |
26 |
27 | $fid = $_POST['fid'];
28 | if (!empty($fid)) {
29 | if (!is_numeric($fid)) {
30 | WmApiError::display_result('param_error', '');
31 | exit;
32 | } else {
33 | $sql_where = $sql_where . ' and fid=' . $fid;
34 | }
35 | }
36 |
37 | $digest = $_POST['digest'];
38 | if (!empty($digest)) {
39 | if (is_numeric($digest) && $digest == 1) {
40 | $sql_where = $sql_where . ' and digest>0';
41 | }
42 | }
43 |
44 | $order_field = 'dateline';
45 | $order_by_views = $_POST['order_by_views'];
46 | if (!empty($order_by_views)) {
47 | if (is_numeric($order_by_views) && $order_by_views == 1) {
48 | $order_field = 'views';
49 | }
50 | }
51 |
52 | $page_size = $_POST['page_size'];
53 | if (!empty($page_size)) {
54 | if (!is_numeric($page_size)) {
55 | WmApiError::display_result('param_error', '');
56 | exit;
57 | }
58 | } else {
59 | $page_size = 5;
60 | }
61 |
62 | $page_index = $_POST['page_index'];
63 | if (!empty($page_index)) {
64 | if (!is_numeric($page_index)) {
65 | WmApiError::display_result('param_error', '');
66 | exit;
67 | }
68 | } else {
69 | $page_index = 0;
70 | }
71 |
72 | $sql_limit = ' order by ' . $order_field . ' desc limit ' . ($page_index * $page_size) . ', ' . $page_size;
73 |
74 | $resp_data = array();
75 |
76 | $forum_thread_data = DB::fetch_all("SELECT * FROM " . DB::table('forum_thread') . $sql_where . $sql_limit);
77 |
78 |
79 | foreach ($forum_thread_data as &$value) {
80 | $forum_post_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_post') . " where first=1 and tid=" . $value['tid']);
81 | $pid = $forum_post_data['pid'];
82 | $value['avatar'] = WmApiLib::get_user_avatar($value['authorid']);
83 | if (!$value['price']) {
84 | $value['message'] = messagecutstr(preg_replace('/\s+/', '', $forum_post_data['message']), 100);
85 | } else {
86 | $value['message'] = diconv('***付费帖内容隐藏***', 'UTF-8');
87 | }
88 | $image_list = array();
89 | // 获取图片
90 | if ($value['attachment'] == 2) {
91 | $forum_attachment = DB::fetch_all("SELECT * FROM " . DB::table('forum_attachment_' . ($value['tid'] % 10)) . " where pid=" . $pid);
92 | foreach ($forum_attachment as &$image_item) {
93 | if ($image_item['isimage']) {
94 | $image_url = $http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/get_image.php?file_url=' . $image_item['attachment'];
95 | array_push($image_list, $image_url);
96 | }
97 | }
98 | $value['image_list'] = $image_list;
99 | }
100 |
101 | // 获取版块
102 | $forum_forum_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_forum') . " WHERE status=1 and fid=" . $value['fid']);
103 | if ($forum_forum_data) {
104 | $value['fid_name'] = $forum_forum_data['name'];
105 | }
106 |
107 | // 修改字段
108 | $value['create_time'] = date('Y-m-d', $value['dateline']);
109 | }
110 |
111 | $resp_data['forum_thread_data'] = $forum_thread_data;
112 |
113 | //dd($resp_data);
114 | WmApiError::display_result('ok', $resp_data);
115 |
--------------------------------------------------------------------------------
/wmapi/add_image.php:
--------------------------------------------------------------------------------
1 | 4*1024*1024) {
16 | WmApiError::display_result('file_too_big', '');
17 | exit();
18 | }
19 |
20 | $file_type = $_FILES['myfile']['type'];
21 | if ($file_type != "image/jpeg"
22 | && $file_type != 'image/jpg'
23 | && $file_type != 'image/jpeg'
24 | && $file_type != 'image/png') {
25 | WmApiError::display_result('file_type_error', '');
26 | exit();
27 | }
28 |
29 | if(!is_uploaded_file($_FILES['myfile']['tmp_name']))
30 | {
31 | WmApiError::display_result('file_upload_error', '');
32 | exit();
33 | }
34 |
35 | $base_file_path = getglobal('setting/attachdir').'./forum/';
36 | $ym = date("Ym",time());
37 | $file_path = $ym;
38 | $full_file_path = $base_file_path.'/'.$file_path;
39 | if (!file_exists($full_file_path))
40 | {
41 | mkdir($full_file_path);
42 | }
43 |
44 | $d = date("d",time());
45 | $file_path = $file_path.'/'.$d;
46 | $full_file_path = $base_file_path.'/'.$file_path;
47 | if (!file_exists($full_file_path))
48 | {
49 | mkdir($full_file_path);
50 | }
51 |
52 | // 获取aid
53 | $aid = DB::insert('forum_attachment', array('uid'=>$uid), 1);
54 | if ($aid < 0)
55 | {
56 | WmApiError::display_result('sys_error', '');
57 | exit();
58 | }
59 |
60 | $uid = getglobal('uid', 'member');
61 | $file_name = $file_path.'/'.$uid.time().$aid.'.'.pathinfo($_FILES['myfile']['name'], PATHINFO_EXTENSION);;
62 |
63 | $uploaded_file = $_FILES['myfile']['tmp_name'];
64 | $move_to_file = $base_file_path.'/'.$file_name;
65 |
66 | if(!move_uploaded_file($uploaded_file, $move_to_file))
67 | {
68 | WmApiError::display_result('file_upload_error', '');
69 | exit();
70 | }
71 |
72 | list($width, $height) = getimagesize($move_to_file);
73 | if ($width > 500)
74 | {
75 | // 缩略图比例
76 | $percent = 1.0*500/$width;
77 | WmApiError::runlog("percent:".$percent);
78 |
79 | // 缩略图尺寸
80 | $newwidth = $width * $percent;
81 | $newheight = $height * $percent;
82 |
83 | if ($file_type == "image/jpeg" || $file_type == 'image/jpg' || $file_type == 'image/pjpeg')
84 | {
85 | // 加载图像
86 | $src_im = @imagecreatefromjpeg($move_to_file);
87 | $dst_im = imagecreatetruecolor($newwidth, $newheight);
88 |
89 | // 调整大小
90 | imagecopyresized($dst_im, $src_im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
91 |
92 | //输出缩小后的图像
93 | imagejpeg($dst_im, $move_to_file);
94 |
95 | imagedestroy($dst_im);
96 | imagedestroy($src_im);
97 | }
98 |
99 | if ($file_type == 'image/png')
100 | {
101 | // 加载图像
102 | $src_im = @imagecreatefrompng($move_to_file);
103 | $dst_im = imagecreatetruecolor($newwidth, $newheight);
104 |
105 | // 调整大小
106 | imagecopyresized($dst_im, $src_im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
107 |
108 | //输出缩小后的图像
109 | imagepng($dst_im, $move_to_file);
110 |
111 | imagedestroy($dst_im);
112 | imagedestroy($src_im);
113 | }
114 |
115 | }
116 |
117 |
118 | $array_attachment_unused = array(
119 | 'aid' => $aid,
120 | 'uid' => $uid,
121 | 'dateline' => time(),
122 | 'filename' => $_FILES['myfile']['name'],
123 | 'filesize' => $_FILES['myfile']['size'],
124 | 'attachment' => $file_name,
125 | 'isimage' => 1,
126 | 'width' => 500,
127 | );
128 | DB::insert('forum_attachment_unused', $array_attachment_unused);
129 |
130 |
131 | // 压缩图片
132 |
133 |
134 | $data = array();
135 | $data['aid'] = $aid;
136 | $data['file_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/'.dirname($_SERVER['PHP_SELF']).'/get_image.php?file_url='.$file_name;
137 | WmApiError::display_result('ok', $data);
138 |
--------------------------------------------------------------------------------
/wmapi/add_thread.php:
--------------------------------------------------------------------------------
1 | $fid,
54 | 'author' => $author,
55 | 'authorid' => $authorid,
56 | 'subject' => $subject,
57 | 'dateline' => $dateline,
58 | 'lastpost' => $lastpost,
59 | 'lastposter' => $lastposter,
60 | 'status' => $status,
61 | 'attachment' => $attachment
62 | );
63 |
64 | $tid = DB::insert('forum_thread', $insert_thread, 1);
65 | if ($tid < 0)
66 | {
67 | WmApiError::display_result('sys_error', '');
68 | exit();
69 | }
70 |
71 | // 获取pid
72 | $pid = DB::insert('forum_post_tableid', array('pid'=>null), 1);
73 | if ($pid < 0)
74 | {
75 | WmApiError::display_result('sys_error', '');
76 | exit();
77 | }
78 |
79 | // 添加主贴
80 | $insert_post = array(
81 | 'pid' => $pid,
82 | 'fid' => $fid,
83 | 'tid' => $tid,
84 | 'first' => 1,
85 | 'author' => $author,
86 | 'authorid' => $authorid,
87 | 'subject' => $subject,
88 | 'dateline' => $dateline,
89 | 'message' => $message,
90 | 'status' => 0,
91 | 'attachment' => $attachment
92 | );
93 |
94 | $post_id = DB::insert('forum_post', $insert_post, 1);
95 | if ($post_id < 0)
96 | {
97 | WmApiError::display_result('sys_error', '');
98 | exit();
99 | }
100 |
101 |
102 | // 保持图片
103 | if (!empty($aid_list))
104 | {
105 | $array_aid_list = explode(',', $aid_list);
106 | foreach ($array_aid_list as &$value)
107 | {
108 | $aid = $value;
109 | $forum_attachment_unused = DB::fetch_first("SELECT * FROM ".DB::table('forum_attachment_unused').' where aid='.$aid);
110 |
111 | $array_forum_attachment = array(
112 | 'aid' => $aid,
113 | 'uid' => $uid,
114 | 'tid' => $tid,
115 | 'pid' => $pid,
116 | 'tableid' => $pid%10,
117 | );
118 | DB::insert('forum_attachment', $array_forum_attachment, 1, 1);
119 |
120 | $array_threadimage = array(
121 | 'tid' => $tid,
122 | 'attachment' => $forum_attachment_unused['attachment'],
123 | );
124 | DB::insert('forum_threadimage', $array_threadimage);
125 |
126 | $array_forum_attachment = array(
127 | 'aid' => $aid,
128 | 'tid' => $tid,
129 | 'pid' => $pid,
130 | 'uid' => $uid,
131 | 'dateline' => time(),
132 | 'filename' => $forum_attachment_unused['filename'],
133 | 'filesize' => $forum_attachment_unused['filesize'],
134 | 'attachment' => $forum_attachment_unused['attachment'],
135 | 'isimage' => 1,
136 | 'width' => 500,
137 | );
138 | DB::insert('forum_attachment_'.$tid%10, $array_forum_attachment);
139 | }
140 | }
141 |
142 | // 更新版块
143 | DB::query("update ".DB::table('forum_forum').' set posts=posts+1, threads=threads+1 where fid='.$fid);
144 |
145 | $data = array();
146 | $data['tid'] = $tid;
147 | $data['pid'] = $pid;
148 | WmApiError::display_result('ok',$data);
149 |
--------------------------------------------------------------------------------
/wmapi/wmapi_install.php:
--------------------------------------------------------------------------------
1 | {'access_token'}))
14 | {
15 | echo "appid或者appsecret无效";
16 | exit();
17 | }
18 |
19 | // 修改配置文件
20 | $wmapi_key = WMAPI_KEY;
21 | if (empty($wmapi_key)) {
22 | $pattern = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ';
23 | for ($i=0; $i<16; $i++)
24 | {
25 | $wmapi_key .= $pattern{mt_rand(0,35)}; //生成php随机数
26 | }
27 | }
28 |
29 | $wmapi_config = fopen("wmapi_config.php", "w") or die("Unable to open file!");
30 | $wmapi_config_msg = "
70 |
71 |
72 |
73 |
74 |
75 |
76 | wmdz安装
77 |
81 |
82 |
83 |
84 |
85 |
wmdz安装
86 |
87 |
88 | | discuz是否已安装 |
89 |
90 | yes";
93 | } else {
94 | echo " no ";
95 | $can_install = false;
96 | }
97 | ?>
98 | |
99 |
100 |
101 |
102 | | wmapi_config.php配置文件是否可写 |
103 |
104 | yes";
108 | } else {
109 | echo " no ";
110 | $can_install = false;
111 | }
112 | ?>
113 | |
114 |
115 |
116 |
117 | | data目录是否可写 |
118 |
119 | yes";
123 | } else {
124 | echo " no ";
125 | $can_install = false;
126 | }
127 | ?>
128 | |
129 |
130 |
131 |
132 |
133 |
134 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/wmapp/pages/self_post/self_post.js:
--------------------------------------------------------------------------------
1 | // pages/self_post/self_post.js
2 | var WxParse = require('../../wxParse/wxParse.js');
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | page_size: 8,
10 | page_index: 0,
11 | },
12 |
13 | onLoad: function (options) {
14 | this.reloadIndex();
15 | },
16 |
17 | reloadIndex: function() {
18 | var that = this;
19 | var tmpPostList = [];
20 | var page_size = that.data.page_size;
21 | var page_index = 0;
22 | wx.request({
23 | url: getApp().globalData.svr_url + "get_self_post.php",
24 | method: "post",
25 | header: { "content-type": "application/x-www-form-urlencoded" },
26 | data: {
27 | token: wx.getStorageSync("token"),
28 | page_size: page_size,
29 | page_index: page_index
30 | },
31 | success: function (resp) {
32 | console.log(resp);
33 | var resp_dict = resp.data;
34 | if (resp_dict.err_code == 0) {
35 | that.setData({
36 | postList: resp_dict.data.self_post_list,
37 | page_index: page_index
38 | })
39 | console.log(resp_dict.data.self_post_list)
40 |
41 | // 我的帖子 parse
42 | var postArr = []
43 |
44 | for (var i = 0; i < resp_dict.data.self_post_list.length; i++) {
45 | // console.log(post_list[i].message)
46 | postArr.push(resp_dict.data.self_post_list[i].message)
47 | }
48 |
49 | // console.log(postArr);
50 |
51 | for (let j = 0; j < postArr.length; j++) {
52 | WxParse.wxParse('reply' + j, 'html', postArr[j], that);
53 | if (j === postArr.length - 1) {
54 | WxParse.wxParseTemArray("replyTemArray", 'reply', postArr.length, that)
55 | }
56 | }
57 |
58 | } else {
59 | getApp().showSvrErrModal(resp);
60 | }
61 | }
62 | })
63 | },
64 |
65 | onReachBottom: function() {
66 | var that = this;
67 | var page_size = that.data.page_size;
68 | var page_index = that.data.page_index+1;
69 | wx.request({
70 | url: getApp().globalData.svr_url + "get_self_post.php",
71 | method: "post",
72 | header: { "content-type": "application/x-www-form-urlencoded" },
73 | data: {
74 | token: wx.getStorageSync("token"),
75 | page_size: page_size,
76 | page_index: page_index
77 | },
78 | success: function (resp) {
79 | console.log(resp);
80 | var resp_dict = resp.data;
81 | if (resp_dict.err_code == 0) {
82 | var tmpPostList = that.data.postList;
83 | var respPostList = resp_dict.data.self_post_list;
84 | var has_append = 0;
85 | for (var i = 0; i < respPostList.length; ++i) {
86 | var has_in = 0;
87 | for (var j = 0; j < tmpPostList.length; ++j) {
88 | if (respPostList[i].pid == tmpPostList[j].pid) {
89 | has_in = 1;
90 | }
91 | }
92 | if (has_in == 0) {
93 | tmpPostList.push(respPostList[i]);
94 | has_append = 1;
95 | }
96 | }
97 |
98 | if (has_append == 1)
99 | {
100 | that.setData({
101 | postList: tmpPostList,
102 | page_index: page_index
103 | })
104 | // 我的帖子 parse
105 | var postArr = []
106 |
107 | for (var i = 0; i < tmpPostList.length; i++) {
108 | // console.log(post_list[i].message)
109 | postArr.push(tmpPostList[i].message)
110 | }
111 |
112 | // console.log(postArr);
113 |
114 | for (let j = 0; j < postArr.length; j++) {
115 | WxParse.wxParse('reply' + j, 'html', postArr[j], that);
116 | if (j === postArr.length - 1) {
117 | WxParse.wxParseTemArray("replyTemArray", 'reply', postArr.length, that)
118 | }
119 | }
120 | }
121 | } else {
122 | getApp().showSvrErrModal(resp);
123 | }
124 | }
125 | })
126 | },
127 |
128 | toDetail: function (e) {
129 | console.log(e);
130 | var tid = e.currentTarget.dataset.tid;
131 | wx.navigateTo({
132 | url: '../detail/detail?tid='+tid,
133 | })
134 | },
135 | })
136 |
--------------------------------------------------------------------------------
/wmapp/pages/forum_list/forum_list.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{forum_data.name}}
10 | 主题:{{forum_data.threads}} 帖子:{{forum_data.posts}}
11 |
12 |
13 | 置顶贴
14 |
15 | {{item.subject}}
16 |
17 |
18 | 查看更多
19 |
20 |
21 |
22 |
23 |
24 |
25 | 最新
26 | 热门
27 | 精华
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | {{article.subject}}
39 |
40 |
41 | by
42 | {{article.author}}
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | {{article.message}}
60 |
61 |
62 |
63 |
64 |
65 |
66 | {{article.views}}
67 |
68 | {{article.replies}}
69 |
70 | {{article.create_time}}
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/wmapi/get_post_detail.php:
--------------------------------------------------------------------------------
1 | =0 ';
17 | $sql_where = $sql_where . ' and tid=' . $tid;
18 |
19 |
20 | $page_size = $_GET['page_size'];
21 | if (!empty($page_size)) {
22 | if (!is_numeric($page_size)) {
23 | WmApiError::display_result('param_error', '');
24 | exit;
25 | }
26 | } else {
27 | $page_size = 5;
28 | }
29 |
30 | $page_index = $_GET['page_index'];
31 | if (!empty($page_index)) {
32 | if (!is_numeric($page_index)) {
33 | WmApiError::display_result('param_error', '');
34 | exit;
35 | }
36 | } else {
37 | $page_index = 0;
38 | }
39 |
40 | $sql_limit = ' order by dateline limit ' . ($page_index * $page_size) . ', ' . $page_size;
41 |
42 | $resp_data = array();
43 | $post_list = array();
44 | $forum_post_data = DB::fetch_all("SELECT * FROM " . DB::table('forum_post') . $sql_where . $sql_limit);
45 | //dd($forum_post_data);
46 |
47 | foreach ($forum_post_data as &$value) {
48 | if ($value['attachment'] == 2) {
49 | $post_image_list = array();
50 | $forum_attachment = DB::fetch_all("SELECT * FROM " . DB::table('forum_attachment_' . ($value['tid'] % 10)) . " where pid=" . $value['pid']);
51 | foreach ($forum_attachment as &$image_item) {
52 | // 判断附件是否为图片
53 | if ($image_item['isimage']) {
54 | $image_url = $http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/get_image.php?file_url=' . $image_item['attachment'];
55 | array_push($post_image_list, $image_url);
56 | }
57 | }
58 | $value['post_image_list'] = $post_image_list;
59 | }
60 | // 修改字段
61 | $value['create_time'] = date('Y-m-d', $value['dateline']);
62 | $value['author_avatar'] = WmApiLib::get_user_avatar($value['authorid']);
63 | if ($value['first'] != 1) {
64 | $value['message'] = discuzcode(mini_pro_messagesafeclear($value['message']), 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
65 | // dd($value);
66 | array_push($post_list, $value);
67 | }
68 | }
69 |
70 | $resp_data['post_list'] = $post_list;
71 |
72 | $thread_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_thread') . ' where tid=' . $tid);
73 | // 修改字段
74 | $thread_data['create_time'] = date('Y-m-d', $thread_data['dateline']);
75 | $thread_data['author_avatar'] = WmApiLib::get_user_avatar($thread_data['authorid']);
76 |
77 | $first_post_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_post') . " where first=1 and tid=" . $tid);
78 | $pid = $first_post_data['pid'];
79 |
80 | // $thread_data['message'] = $first_post_data['message'];
81 | if (!$thread_data['price']) {
82 | $thread_data['message'] = discuzcode(mini_pro_messagesafeclear($first_post_data['message']), 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
83 | } else {
84 | $thread_data['message'] = diconv('***付费帖内容隐藏***', 'UTF-8');
85 | }
86 |
87 |
88 | // 获取版块
89 | $forum_forum_data = DB::fetch_first("SELECT * FROM " . DB::table('forum_forum') . " WHERE status=1 and fid=" . $thread_data['fid']);
90 | if ($forum_forum_data) {
91 | $thread_data['fid_name'] = $forum_forum_data['name'];
92 | }
93 |
94 | if ($thread_data['attachment'] == 2) {
95 | $image_list = array();
96 | $un_image_attach = 0;
97 | // 获取图片
98 | $forum_attachment = DB::fetch_all("SELECT * FROM " . DB::table('forum_attachment_' . ($tid % 10)) . " where pid=" . $pid);
99 | foreach ($forum_attachment as &$image_item) {
100 | // 判断附件是否为图片
101 | if ($image_item['isimage']) {
102 | // dd($image_item['attachment']);
103 | $image_url = $http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/get_image.php?file_url=' . $image_item['attachment'];
104 | array_push($image_list, $image_url);
105 | } else {
106 | $un_image_attach++;
107 | }
108 | }
109 | $thread_data['un_image_attach'] = $un_image_attach;
110 | $thread_data['image_list'] = $image_list;
111 | }
112 |
113 | $resp_data['thread_data'] = $thread_data;
114 |
115 | if ($_POST['new_reader'] == 1) {
116 | // 更新阅读数
117 | DB::query("update " . DB::table('forum_thread') . ' set views=views+1 where tid=' . $tid);
118 | }
119 | //dd($resp_data);
120 | WmApiError::display_result('ok', $resp_data);
121 |
--------------------------------------------------------------------------------
/wmapp/wxParse/wxParse.js:
--------------------------------------------------------------------------------
1 | /**
2 | * author: Di (微信小程序开发工程师)
3 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
4 | * 垂直微信小程序开发交流社区
5 | *
6 | * github地址: https://github.com/icindy/wxParse
7 | *
8 | * for: 微信小程序富文本解析
9 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
10 | */
11 |
12 | /**
13 | * utils函数引入
14 | **/
15 | import showdown from './showdown.js';
16 | import HtmlToJson from './html2json.js';
17 | /**
18 | * 配置及公有属性
19 | **/
20 | var realWindowWidth = 0;
21 | var realWindowHeight = 0;
22 | wx.getSystemInfo({
23 | success: function (res) {
24 | realWindowWidth = res.windowWidth
25 | realWindowHeight = res.windowHeight
26 | }
27 | })
28 | /**
29 | * 主函数入口区
30 | **/
31 | function wxParse(bindName = 'wxParseData', type='html', data='数据不能为空
', target,imagePadding) {
32 | var that = target;
33 | var transData = {};//存放转化后的数据
34 | if (type == 'html') {
35 | transData = HtmlToJson.html2json(data, bindName);
36 | // console.log(JSON.stringify(transData, ' ', ' '));
37 | } else if (type == 'md' || type == 'markdown') {
38 | var converter = new showdown.Converter();
39 | var html = converter.makeHtml(data);
40 | transData = HtmlToJson.html2json(html, bindName);
41 | // console.log(JSON.stringify(transData, ' ', ' '));
42 | }
43 | transData.view = {};
44 | transData.view.imagePadding = 0;
45 | if(typeof(imagePadding) != 'undefined'){
46 | transData.view.imagePadding = imagePadding
47 | }
48 | var bindData = {};
49 | bindData[bindName] = transData;
50 | that.setData(bindData)
51 | that.wxParseImgLoad = wxParseImgLoad;
52 | that.wxParseImgTap = wxParseImgTap;
53 | }
54 | // 图片点击事件
55 | function wxParseImgTap(e) {
56 | var that = this;
57 | var nowImgUrl = e.target.dataset.src;
58 | var tagFrom = e.target.dataset.from;
59 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
60 | wx.previewImage({
61 | current: nowImgUrl, // 当前显示图片的http链接
62 | urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表
63 | })
64 | }
65 | }
66 |
67 | /**
68 | * 图片视觉宽高计算函数区
69 | **/
70 | function wxParseImgLoad(e) {
71 | var that = this;
72 | var tagFrom = e.target.dataset.from;
73 | var idx = e.target.dataset.idx;
74 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
75 | calMoreImageInfo(e, idx, that, tagFrom)
76 | }
77 | }
78 | // 假循环获取计算图片视觉最佳宽高
79 | function calMoreImageInfo(e, idx, that, bindName) {
80 | var temData = that.data[bindName];
81 | if (!temData || temData.images.length == 0) {
82 | return;
83 | }
84 | var temImages = temData.images;
85 | //因为无法获取view宽度 需要自定义padding进行计算,稍后处理
86 | var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName);
87 | // temImages[idx].width = recal.imageWidth;
88 | // temImages[idx].height = recal.imageheight;
89 | // temData.images = temImages;
90 | // var bindData = {};
91 | // bindData[bindName] = temData;
92 | // that.setData(bindData);
93 | var index = temImages[idx].index
94 | var key = `${bindName}`
95 | for (var i of index.split('.')) key+=`.nodes[${i}]`
96 | var keyW = key + '.width'
97 | var keyH = key + '.height'
98 | that.setData({
99 | [keyW]: recal.imageWidth,
100 | [keyH]: recal.imageheight,
101 | })
102 | }
103 |
104 | // 计算视觉优先的图片宽高
105 | function wxAutoImageCal(originalWidth, originalHeight,that,bindName) {
106 | //获取图片的原始长宽
107 | var windowWidth = 0, windowHeight = 0;
108 | var autoWidth = 0, autoHeight = 0;
109 | var results = {};
110 | var padding = that.data[bindName].view.imagePadding;
111 | windowWidth = realWindowWidth-2*padding;
112 | windowHeight = realWindowHeight;
113 | //判断按照那种方式进行缩放
114 | // console.log("windowWidth" + windowWidth);
115 | if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候
116 | autoWidth = windowWidth;
117 | // console.log("autoWidth" + autoWidth);
118 | autoHeight = (autoWidth * originalHeight) / originalWidth;
119 | // console.log("autoHeight" + autoHeight);
120 | results.imageWidth = autoWidth;
121 | results.imageheight = autoHeight;
122 | } else {//否则展示原来的数据
123 | results.imageWidth = originalWidth;
124 | results.imageheight = originalHeight;
125 | }
126 | return results;
127 | }
128 |
129 | function wxParseTemArray(temArrayName,bindNameReg,total,that){
130 | var array = [];
131 | var temData = that.data;
132 | var obj = null;
133 | for(var i = 0; i < total; i++){
134 | var simArr = temData[bindNameReg+i].nodes;
135 | array.push(simArr);
136 | }
137 | temArrayName = temArrayName || 'wxParseTemArray';
138 | obj = JSON.parse('{"'+ temArrayName +'":""}');
139 | obj[temArrayName] = array;
140 | that.setData(obj);
141 | }
142 |
143 | /**
144 | * 配置emojis
145 | *
146 | */
147 |
148 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
149 | HtmlToJson.emojisInit(reg,baseSrc,emojis);
150 | }
151 |
152 | module.exports = {
153 | wxParse: wxParse,
154 | wxParseTemArray:wxParseTemArray,
155 | emojisInit:emojisInit
156 | }
157 |
158 |
159 |
--------------------------------------------------------------------------------
/wmapp/wxParse/wxParse.wxss:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * author: Di (微信小程序开发工程师)
4 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
5 | * 垂直微信小程序开发交流社区
6 | *
7 | * github地址: https://github.com/icindy/wxParse
8 | *
9 | * for: 微信小程序富文本解析
10 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
11 | */
12 |
13 | .wxParse{
14 | margin: 0 5px;
15 | font-family: Helvetica,sans-serif;
16 | font-size: 28rpx;
17 | color: #666;
18 | line-height: 1.8;
19 | }
20 | view{
21 | word-break:break-all; overflow:auto;
22 | }
23 | .wxParse-inline{
24 | display: inline;
25 | margin: 0;
26 | padding: 0;
27 | }
28 | /*//标题 */
29 | .wxParse-div{margin: 0;padding: 0;}
30 | .wxParse-h1{ font-size:2em; margin: .67em 0 }
31 | .wxParse-h2{ font-size:1.5em; margin: .75em 0 }
32 | .wxParse-h3{ font-size:1.17em; margin: .83em 0 }
33 | .wxParse-h4{ margin: 1.12em 0}
34 | .wxParse-h5 { font-size:.83em; margin: 1.5em 0 }
35 | .wxParse-h6{ font-size:.75em; margin: 1.67em 0 }
36 |
37 | .wxParse-h1 {
38 | font-size: 18px;
39 | font-weight: 400;
40 | margin-bottom: .9em;
41 | }
42 | .wxParse-h2 {
43 | font-size: 16px;
44 | font-weight: 400;
45 | margin-bottom: .34em;
46 | }
47 | .wxParse-h3 {
48 | font-weight: 400;
49 | font-size: 15px;
50 | margin-bottom: .34em;
51 | }
52 | .wxParse-h4 {
53 | font-weight: 400;
54 | font-size: 14px;
55 | margin-bottom: .24em;
56 | }
57 | .wxParse-h5 {
58 | font-weight: 400;
59 | font-size: 13px;
60 | margin-bottom: .14em;
61 | }
62 | .wxParse-h6 {
63 | font-weight: 400;
64 | font-size: 12px;
65 | margin-bottom: .04em;
66 | }
67 |
68 | .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
69 |
70 | .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
71 | .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
72 | .wxParse-pre{white-space:pre}
73 | .wxParse-big{font-size:1.17em}
74 | .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
75 | .wxParse-sub{vertical-align:sub}
76 | .wxParse-sup{vertical-align:super}
77 | .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
78 | /*wxparse-自定义个性化的css样式*/
79 | /*增加video的css样式*/
80 | .wxParse-strong,.wxParse-s{display: inline}
81 | .wxParse-a{
82 | color: deepskyblue;
83 | word-break:break-all;
84 | overflow:auto;
85 | }
86 |
87 | .wxParse-video{
88 | text-align: center;
89 | margin: 10px 0;
90 | }
91 |
92 | .wxParse-video-video{
93 | width:100%;
94 | }
95 |
96 | .wxParse-img{
97 | /*background-color: #efefef;*/
98 | width:34rpx;
99 | height:34rpx;
100 | overflow: hidden;
101 | }
102 |
103 | .wxParse-blockquote {
104 | margin: 0;
105 | padding:10px 0 10px 5px;
106 | /* font-family:Courier, Calibri,"宋体"; */
107 | font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
108 | background:#f5f5f5;
109 | border-left: 3px solid #dbdbdb;
110 | }
111 |
112 | .wxParse-code,.wxParse-wxxxcode-style{
113 | display: inline;
114 | background:#f5f5f5;
115 | }
116 | .wxParse-ul{
117 | margin: 20rpx 10rpx;
118 | }
119 |
120 | .wxParse-li,.wxParse-li-inner{
121 | display: flex;
122 | align-items: baseline;
123 | margin: 10rpx 0;
124 | }
125 | .wxParse-li-text{
126 |
127 | align-items: center;
128 | line-height: 20px;
129 | }
130 |
131 | .wxParse-li-circle{
132 | display: inline-flex;
133 | width: 5px;
134 | height: 5px;
135 | background-color: #333;
136 | margin-right: 5px;
137 | }
138 |
139 | .wxParse-li-square{
140 | display: inline-flex;
141 | width: 10rpx;
142 | height: 10rpx;
143 | background-color: #333;
144 | margin-right: 5px;
145 | }
146 | .wxParse-li-ring{
147 | display: inline-flex;
148 | width: 10rpx;
149 | height: 10rpx;
150 | border: 2rpx solid #333;
151 | border-radius: 50%;
152 | background-color: #fff;
153 | margin-right: 5px;
154 | }
155 |
156 | /*.wxParse-table{
157 | width: 100%;
158 | height: 400px;
159 | }
160 | .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
161 | display: flex;
162 | flex-direction: row;
163 | }
164 | .wxParse-th,.wxParse-td{
165 | display: flex;
166 | width: 580px;
167 | overflow: auto;
168 | }*/
169 |
170 | .wxParse-u {
171 | text-decoration: underline;
172 | }
173 | .wxParse-hide{
174 | display: none;
175 | }
176 | .WxEmojiView{
177 | align-items: center;
178 | }
179 | .wxEmoji{
180 | width: 16px;
181 | height:16px;
182 | }
183 | .wxParse-tr{
184 | display: flex;
185 | border-right:1px solid #e0e0e0;
186 | border-bottom:1px solid #e0e0e0;
187 | border-top:1px solid #e0e0e0;
188 | }
189 | .wxParse-th,
190 | .wxParse-td{
191 | flex:1;
192 | padding:5px;
193 | font-size:28rpx;
194 | border-left:1px solid #e0e0e0;
195 | word-break: break-all;
196 | }
197 | .wxParse-td:last{
198 | border-top:1px solid #e0e0e0;
199 | }
200 | .wxParse-th{
201 | background:#f0f0f0;
202 | border-top:1px solid #e0e0e0;
203 | }
204 | .wxParse-del{
205 | display: inline;
206 | }
207 | .wxParse-figure {
208 | overflow: hidden;
209 | }
210 |
--------------------------------------------------------------------------------
/wmapp/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function() {
4 | var that = this
5 | wx.getUserInfo({
6 | success: function (res) {
7 | that.globalData.userInfo = res.userInfo;
8 | }
9 | })
10 | that.get_token() // 获取token
11 | },
12 |
13 | get_token: function() {
14 | var that = this;
15 | wx.login({
16 | success: function (res) {
17 | if (res.code) {
18 | // console.log(res);
19 | wx.request({
20 | url: getApp().globalData.svr_url+'get_token.php',
21 | method: 'POST',
22 | header: { "content-type": "application/x-www-form-urlencoded" },
23 | data: {
24 | token: wx.getStorageSync("token"),
25 | code: res.code,
26 | },
27 | success: function(resp) {
28 | console.log('Get token...');
29 | console.log(resp);
30 | var resp_dict = resp.data;
31 | if (resp_dict.err_code == 0) {
32 | wx.setStorage({
33 | key: 'token',
34 | data: resp_dict.data.token,
35 | success: function() {
36 | console.log('Close wechat login...');
37 | /*
38 | if (resp_dict.data.has_login != 1) {
39 | that.wxLogin();
40 | }
41 | */
42 | }
43 | })
44 | } else {
45 | that.showSvrErrModal(resp)
46 | }
47 | }
48 | })
49 | } else {
50 | console.log('获取用户登录状态失败!' + res.errMsg)
51 | }
52 | }
53 | });
54 | },
55 |
56 | wxLogin: function() {
57 | var that = this;
58 | wx.getUserInfo({
59 | success: function (res) {
60 | var username = res.userInfo.nickName;
61 | var avatar_url = res.userInfo.avatarUrl;
62 | if (username && avatar_url){
63 | wx.request({
64 | url: getApp().globalData.svr_url+'wx_login.php',
65 | method: 'POST',
66 | header: { "content-type": "application/x-www-form-urlencoded" },
67 | data: {
68 | token: wx.getStorageSync("token"),
69 | username: username,
70 | avatar_url: avatar_url
71 | },
72 | success: function(resp) {
73 | var resp_dict = resp.data;
74 | if (resp_dict.err_code == 0) {
75 | wx.setStorage({
76 | key: 'token',
77 | data: resp_dict.data.token,
78 | })
79 | } else {
80 | that.showSvrErrModal(resp);
81 | }
82 | }
83 | })
84 | }
85 | }
86 | });
87 | },
88 |
89 | showSvrErrModal: function(resp) {
90 | if (resp.data.err_code != 0 && resp.data.err_msg) {
91 | console.log(resp.data.err_msg)
92 | this.showErrModal(resp.data.err_msg);
93 | } else {
94 | console.log(resp);
95 | wx.request({
96 | url: getApp().globalData.svr_url+'report_error.php',
97 | method: 'POST',
98 | header: { "content-type": "application/x-www-form-urlencoded" },
99 | data: {
100 | token: wx.getStorageSync("token"),
101 | error_log: resp.data,
102 | svr_url: getApp().globalData.svr_url,
103 | },
104 | success: function(resp) {
105 | console.log(resp);
106 | }
107 | })
108 | }
109 | },
110 |
111 | checkLogin: function() {
112 | var that = this
113 | wx.getStorage({
114 | key: 'login',
115 | success: function (res) {
116 | if (!res.data) {
117 | that.unLoginModal()
118 | }
119 | },
120 | fail: function () {
121 | that.unLoginModal()
122 | }
123 | })
124 | },
125 |
126 | unLoginModal:function (){
127 | wx.showModal({
128 | content: '您还没有登录,请先登录!',
129 | showCancel: false,
130 | success: function () {
131 | wx.navigateTo({
132 | url: '/pages/login/login',
133 | })
134 | }
135 | })
136 | },
137 |
138 | showErrModal: function(err_msg) {
139 | wx.showModal({
140 | content: err_msg,
141 | showCancel: false
142 | });
143 | },
144 |
145 | /* 封装微信缓存 Api */
146 | putSt: function (k, v, t) {
147 | wx.setStorageSync(k, v)
148 | var seconds = parseInt(t);
149 | if (seconds > 0) {
150 | var timestamp = Date.parse(new Date());
151 | timestamp = timestamp / 1000 + seconds;
152 | wx.setStorageSync(k + 'dtime', timestamp + "")
153 | } else {
154 | wx.removeStorageSync(k + 'dtime')
155 | }
156 | },
157 |
158 | getSt: function (k, def) {
159 | var deadtime = parseInt(wx.getStorageSync(k + 'dtime'))
160 | if (deadtime) {
161 | if (parseInt(deadtime) < Date.parse(new Date()) / 1000) {
162 | if (def) { return def; } else { return; }
163 | }
164 | }
165 | var res = wx.getStorageSync(k);
166 | if (res) {
167 | return res;
168 | } else {
169 | return def;
170 | }
171 | },
172 |
173 | globalData: {
174 | base_url: '',
175 | svr_url: '',
176 |
177 | userInfo: null,
178 | lite_switch: false,
179 | }
180 | })
--------------------------------------------------------------------------------
/wmapp/pages/add_forum_article/add_forum_article.js:
--------------------------------------------------------------------------------
1 | // add_article.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | countIndex: 8,
10 | count: [1, 2, 3, 4, 5, 6, 7, 8, 9],
11 | articleTitle: "",
12 | imageList: [],
13 | aidList: [],
14 | loading_hidden: true,
15 | loading_msg: '加载中...',
16 | },
17 |
18 | chooseImage: function () {
19 | var that = this
20 | wx.chooseImage({
21 | count: 1,
22 | success: function (res) {
23 | console.log(res)
24 | var tmpImageList = that.data.imageList;
25 | var tmpAidList = that.data.aidList;
26 |
27 | that.setData({
28 | loading_hidden: false,
29 | loading_msg: '加载中...'
30 | })
31 |
32 | for (var i = 0; i < res.tempFilePaths.length; i++) {
33 | var localFilePath = res.tempFilePaths[i]
34 | wx.uploadFile({
35 | url: getApp().globalData.svr_url + 'add_image.php',
36 | filePath: localFilePath,
37 | name: 'myfile',
38 | method: 'POST',
39 | formData: {
40 | token: wx.getStorageSync("token"),
41 | },
42 | success: function(resp) {
43 | console.log(resp);
44 | var resp_dict = JSON.parse(resp.data)
45 | console.log(resp_dict)
46 | if (resp_dict.err_code == 0)
47 | {
48 | console.log(resp_dict.data.file_url)
49 | tmpImageList.push(resp_dict.data.file_url);
50 | tmpAidList.push(resp_dict.data.aid);
51 | that.setData({
52 | imageList: tmpImageList,
53 | aidList: tmpAidList
54 | })
55 | } else {
56 | getApp().showSvrErrModal(resp);
57 | }
58 | that.setData({
59 | loading_hidden: true,
60 | })
61 | }
62 | })
63 | }
64 | }
65 | })
66 | },
67 |
68 | previewImage: function (e) {
69 | var current = e.target.dataset.src
70 | wx.previewImage({
71 | current: current,
72 | urls: this.data.imageList
73 | })
74 | },
75 |
76 | inputTitle: function(e) {
77 | this.setData({
78 | articleTitle: e.detail.value
79 | });
80 | },
81 |
82 | inputContent: function(e) {
83 | this.setData({
84 | articleContent: e.detail.value
85 | });
86 | },
87 |
88 | articleSubmit: function() {
89 | var that = this;
90 | var articleTitle = that.data.articleTitle;
91 | if (articleTitle == null || articleTitle == undefined || articleTitle == ''){
92 | getApp().showErrModal('标题不能为空');
93 | return;
94 | }
95 |
96 | var articleContent = that.data.articleContent;
97 | if (articleContent == null || articleContent == undefined || articleContent == ''){
98 | getApp().showErrModal('内容不能为空');
99 | return;
100 | }
101 |
102 | wx.request({
103 | url: getApp().globalData.svr_url + 'add_thread.php',
104 | header: { "content-type": "application/x-www-form-urlencoded" },
105 | method: 'POST',
106 | data: {
107 | token: wx.getStorageSync("token"),
108 | fid: that.data.fid,
109 | subject: that.data.articleTitle,
110 | message: that.data.articleContent,
111 | pic_list: that.data.imageList,
112 | aid_list: that.data.aidList,
113 | },
114 | success: function(resp) {
115 | console.log(resp);
116 | var resp_dict = resp.data;
117 | if (resp_dict.err_code == 10001) {
118 | wx.showModal({
119 | content: "请先登录",
120 | success: function(res) {
121 | if (res.confirm) {
122 | wx.switchTab({
123 | url:"../user/user"
124 | });
125 | } else if (res.cancel) {
126 | console.log('用户点击取消')
127 | }
128 | }
129 | });
130 | } else if (resp_dict.err_code == 0) {
131 | that.setData({
132 | articleTitle: '',
133 | articleContent: '',
134 | imageList: [],
135 | aidList: [],
136 | })
137 |
138 | var pages = getCurrentPages();
139 | var prevPage = pages[pages.length - 2];
140 | prevPage.setData({
141 | reload_index: 1,
142 | });
143 | wx.navigateBack({
144 | delta: 1,
145 | })
146 | } else {
147 | getApp().showSvrErrModal(resp);
148 | }
149 | }
150 | })
151 | },
152 |
153 | /**
154 | * 生命周期函数--监听页面加载
155 | */
156 | onLoad: function (options) {
157 | app.checkLogin()
158 | console.log(options);
159 | var fid = options.fid;
160 | var fname = options.fname;
161 | this.setData({
162 | fid: fid,
163 | fname: fname,
164 | })
165 | },
166 |
167 | onShow: function() {
168 | },
169 |
170 | delImg: function(e) {
171 | var index = e.currentTarget.dataset.index;
172 | var imageList = this.data.imageList;
173 | var aidList = this.data.aidList;
174 | if (index < imageList.length) {
175 | imageList.splice(index, 1);
176 | aidList.splice(index, 1);
177 | }
178 | this.setData({
179 | imageList: imageList,
180 | aidList: aidList,
181 | })
182 | }
183 | })
--------------------------------------------------------------------------------
/wmapp/wxParse/htmlparser.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 | // Regular Expressions for parsing tags and attributes
15 | var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
16 | endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
17 | attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
18 |
19 | // Empty Elements - HTML 5
20 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
21 |
22 | // Block Elements - HTML 5
23 | var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
24 |
25 | // Inline Elements - HTML 5
26 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
27 |
28 | // Elements that you can, intentionally, leave open
29 | // (and which close themselves)
30 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
31 |
32 | // Attributes that have their values filled in disabled="disabled"
33 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
34 |
35 | // Special Elements (can contain anything)
36 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
37 |
38 | function HTMLParser(html, handler) {
39 | var index, chars, match, stack = [], last = html;
40 | stack.last = function () {
41 | return this[this.length - 1];
42 | };
43 |
44 | while (html) {
45 | chars = true;
46 |
47 | // Make sure we're not in a script or style element
48 | if (!stack.last() || !special[stack.last()]) {
49 |
50 | // Comment
51 | if (html.indexOf("");
53 |
54 | if (index >= 0) {
55 | if (handler.comment)
56 | handler.comment(html.substring(4, index));
57 | html = html.substring(index + 3);
58 | chars = false;
59 | }
60 |
61 | // end tag
62 | } else if (html.indexOf("") == 0) {
63 | match = html.match(endTag);
64 |
65 | if (match) {
66 | html = html.substring(match[0].length);
67 | match[0].replace(endTag, parseEndTag);
68 | chars = false;
69 | }
70 |
71 | // start tag
72 | } else if (html.indexOf("<") == 0) {
73 | match = html.match(startTag);
74 |
75 | if (match) {
76 | html = html.substring(match[0].length);
77 | match[0].replace(startTag, parseStartTag);
78 | chars = false;
79 | }
80 | }
81 |
82 | if (chars) {
83 | index = html.indexOf("<");
84 | var text = ''
85 | while (index === 0) {
86 | text += "<";
87 | html = html.substring(1);
88 | index = html.indexOf("<");
89 | }
90 | text += index < 0 ? html : html.substring(0, index);
91 | html = index < 0 ? "" : html.substring(index);
92 |
93 | if (handler.chars)
94 | handler.chars(text);
95 | }
96 |
97 | } else {
98 |
99 | html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
100 | text = text.replace(/|/g, "$1$2");
101 | if (handler.chars)
102 | handler.chars(text);
103 |
104 | return "";
105 | });
106 |
107 |
108 | parseEndTag("", stack.last());
109 | }
110 |
111 | if (html == last)
112 | throw "Parse Error: " + html;
113 | last = html;
114 | }
115 |
116 | // Clean up any remaining tags
117 | parseEndTag();
118 |
119 | function parseStartTag(tag, tagName, rest, unary) {
120 | tagName = tagName.toLowerCase();
121 |
122 | if (block[tagName]) {
123 | while (stack.last() && inline[stack.last()]) {
124 | parseEndTag("", stack.last());
125 | }
126 | }
127 |
128 | if (closeSelf[tagName] && stack.last() == tagName) {
129 | parseEndTag("", tagName);
130 | }
131 |
132 | unary = empty[tagName] || !!unary;
133 |
134 | if (!unary)
135 | stack.push(tagName);
136 |
137 | if (handler.start) {
138 | var attrs = [];
139 |
140 | rest.replace(attr, function (match, name) {
141 | var value = arguments[2] ? arguments[2] :
142 | arguments[3] ? arguments[3] :
143 | arguments[4] ? arguments[4] :
144 | fillAttrs[name] ? name : "";
145 |
146 | attrs.push({
147 | name: name,
148 | value: value,
149 | escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
150 | });
151 | });
152 |
153 | if (handler.start) {
154 | handler.start(tagName, attrs, unary);
155 | }
156 |
157 | }
158 | }
159 |
160 | function parseEndTag(tag, tagName) {
161 | // If no tag name is provided, clean shop
162 | if (!tagName)
163 | var pos = 0;
164 |
165 | // Find the closest opened tag of the same type
166 | else {
167 | tagName = tagName.toLowerCase();
168 | for (var pos = stack.length - 1; pos >= 0; pos--)
169 | if (stack[pos] == tagName)
170 | break;
171 | }
172 | if (pos >= 0) {
173 | // Close all the open elements, up the stack
174 | for (var i = stack.length - 1; i >= pos; i--)
175 | if (handler.end)
176 | handler.end(stack[i]);
177 |
178 | // Remove the open elements from the stack
179 | stack.length = pos;
180 | }
181 | }
182 | };
183 |
184 |
185 | function makeMap(str) {
186 | var obj = {}, items = str.split(",");
187 | for (var i = 0; i < items.length; i++)
188 | obj[items[i]] = true;
189 | return obj;
190 | }
191 |
192 | module.exports = HTMLParser;
193 |
--------------------------------------------------------------------------------
/wmapp/utils/wxSearch/wxSearch.js:
--------------------------------------------------------------------------------
1 | // 定义数据格式
2 |
3 | /***
4 | *
5 | * "wxSearchData":{
6 | * configconfig:{
7 | * style: "wxSearchNormal"
8 | * },
9 | * view:{
10 | * hidden: true,
11 | * searchbarHeght: 20
12 | * }
13 | * keys:[],//自定义热门搜索
14 | * his:[]//历史搜索关键字
15 | * value
16 | * }
17 | *
18 | *
19 | */
20 | var __keysColor = [];
21 |
22 | var __mindKeys = [];
23 |
24 | function initColors(colors){
25 | __keysColor = colors;
26 | }
27 |
28 | function initMindKeys(keys){
29 | __mindKeys = keys;
30 | }
31 |
32 | function init(that, barHeight, keys, isShowKey, isShowHis, callBack) {
33 | var temData = {};
34 | var view = {
35 | barHeight: barHeight,
36 | isShow: false
37 | }
38 |
39 | if(typeof(isShowKey) == 'undefined'){
40 | view.isShowSearchKey = true;
41 | }else{
42 | view.isShowSearchKey = isShowKey;
43 | }
44 |
45 | if(typeof(isShowHis) == 'undefined'){
46 | view.isShowSearchHistory = true;
47 | }else{
48 | view.isShowSearchHistory = isShowHis;
49 | }
50 | temData.keys = keys;
51 | wx.getSystemInfo({
52 | success: function(res) {
53 | var wHeight = res.windowHeight;
54 | view.seachHeight = wHeight-barHeight;
55 | temData.view = view;
56 | that.setData({
57 | wxSearchData: temData
58 | });
59 | }
60 | })
61 |
62 | if (typeof (callBack) == "function") {
63 | callBack();
64 | }
65 |
66 | getHisKeys(that);
67 | }
68 |
69 | function wxSearchInput(e, that, callBack){
70 | var temData = that.data.wxSearchData;
71 | var text = e.detail.value;
72 | var mindKeys = [];
73 | if(typeof(text) == "undefined" || text.length == 0){
74 |
75 | }else{
76 | for(var i = 0; i < __mindKeys.length; i++){
77 | var mindKey = __mindKeys[i];
78 | if(mindKey.indexOf(text) > -1){
79 | mindKeys.push(mindKey);
80 | }
81 | }
82 | }
83 | temData.value = text;
84 | temData.mindKeys = mindKeys;
85 | that.setData({
86 | wxSearchData: temData
87 | });
88 | }
89 |
90 | function wxSearchFocus(e, that, callBack) {
91 | var temData = that.data.wxSearchData;
92 | temData.view.isShow = true;
93 | that.setData({
94 | wxSearchData: temData
95 | });
96 | //回调
97 | if (typeof (callBack) == "function") {
98 | callBack();
99 | }
100 | // if(typeof(temData) != "undefined"){
101 | // temData.view.hidden= false;
102 | // that.setData({
103 | // wxSearchData:temData
104 | // });
105 | // }else{
106 |
107 | // }
108 | }
109 | function wxSearchBlur(e, that, callBack) {
110 | var temData = that.data.wxSearchData;
111 | temData.value = e.detail.value;
112 | that.setData({
113 | wxSearchData: temData
114 | });
115 | if (typeof (callBack) == "function") {
116 | callBack();
117 | }
118 | }
119 |
120 | function wxSearchHiddenPancel(that){
121 | var temData = that.data.wxSearchData;
122 | temData.view.isShow = false;
123 | that.setData({
124 | wxSearchData: temData
125 | });
126 | }
127 |
128 | function wxSearchKeyTap(e, that, callBack) {
129 | //回调
130 | var temData = that.data.wxSearchData;
131 | temData.value = e.target.dataset.key;
132 | that.setData({
133 | wxSearchData: temData
134 | });
135 | if (typeof (callBack) == "function") {
136 | callBack();
137 | }
138 | }
139 | function getHisKeys(that) {
140 | var value = [];
141 | try {
142 | value = wx.getStorageSync('wxSearchHisKeys')
143 | if (value) {
144 | // Do something with return value
145 | var temData = that.data.wxSearchData;
146 | temData.his = value;
147 | that.setData({
148 | wxSearchData: temData
149 | });
150 | }
151 | } catch (e) {
152 | // Do something when catch error
153 | }
154 |
155 | }
156 | function wxSearchAddHisKey(that) {
157 | wxSearchHiddenPancel(that);
158 | var text = that.data.wxSearchData.value;
159 | if(typeof(text) == "undefined" || text.length == 0){return;}
160 | var value = wx.getStorageSync('wxSearchHisKeys');
161 | if(value){
162 | if(value.indexOf(text) < 0){
163 | value.unshift(text);
164 | }
165 | wx.setStorage({
166 | key:"wxSearchHisKeys",
167 | data:value,
168 | success: function(){
169 | getHisKeys(that);
170 | }
171 | })
172 | }else{
173 | value = [];
174 | value.push(text);
175 | wx.setStorage({
176 | key:"wxSearchHisKeys",
177 | data:value,
178 | success: function(){
179 | getHisKeys(that);
180 | }
181 | })
182 | }
183 |
184 |
185 | }
186 | function wxSearchDeleteKey(e,that) {
187 | var text = e.target.dataset.key;
188 | var value = wx.getStorageSync('wxSearchHisKeys');
189 | value.splice(value.indexOf(text),1);
190 | wx.setStorage({
191 | key:"wxSearchHisKeys",
192 | data:value,
193 | success: function(){
194 | getHisKeys(that);
195 | }
196 | })
197 | }
198 | function wxSearchDeleteAll(that){
199 | wx.removeStorage({
200 | key: 'wxSearchHisKeys',
201 | success: function(res) {
202 | var value = [];
203 | var temData = that.data.wxSearchData;
204 | temData.his = value;
205 | that.setData({
206 | wxSearchData: temData
207 | });
208 | }
209 | })
210 | }
211 |
212 |
213 |
214 | module.exports = {
215 | init: init,
216 | initColor: initColors,
217 | initMindKeys: initMindKeys,
218 | wxSearchInput: wxSearchInput,
219 | wxSearchFocus: wxSearchFocus,
220 | wxSearchBlur: wxSearchBlur,
221 | wxSearchKeyTap: wxSearchKeyTap,
222 | wxSearchAddHisKey:wxSearchAddHisKey,
223 | wxSearchDeleteKey:wxSearchDeleteKey,
224 | wxSearchDeleteAll:wxSearchDeleteAll,
225 | wxSearchHiddenPancel:wxSearchHiddenPancel
226 | }
--------------------------------------------------------------------------------
/wmapp/pages/detail/detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 | {{loading_msg}}
12 |
13 |
14 |
15 |
16 |
17 | {{thread_data.subject}}
18 |
19 |
20 |
21 | {{thread_data.views}}
22 |
23 | {{thread_data.replies}}
24 |
25 |
26 | {{thread_data.fid_name}}
27 |
28 |
29 | 群组
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | {{username}}
40 | {{time}}
41 |
42 |
43 |
44 | 发表成功
45 |
46 |
47 | {{post_message}}
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | {{thread_data.author}}
59 | {{thread_data.create_time}}
60 |
61 |
62 |
63 | 楼主
64 |
65 |
66 |
67 |
68 |
69 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | 本帖有 {{thread_data.un_image_attach}} 个附件可供下载
84 |
85 |
86 | 本帖售价为 {{thread_data.price}} 模币
87 |
88 | 请移步至中国模具论坛官网,进行查看。
89 |
90 |
91 |
92 | 全部回复({{thread_data.replies}})
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | {{article.author}}
102 | {{article.create_time}}
103 |
104 |
105 |
106 | {{article.position}}楼
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 | 回复
133 |
134 |
135 | 点此处登录之后,即可回复本帖
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
--------------------------------------------------------------------------------
/wmapp/pages/detail/detail.wxss:
--------------------------------------------------------------------------------
1 | /* detail.wxss */
2 | @import "/wxParse/wxParse.wxss";
3 |
4 | .header-fix {
5 | position: fixed;
6 | height: 80rpx;
7 | background: #fbfbfb;
8 | width: 100%;
9 | display: flex;
10 | flex-flow: row nowrap;
11 | z-index: 100;
12 | border-bottom: 1rpx solid #dfdfdf;
13 | }
14 |
15 | .header-fix .fix-btn{
16 | display: flex;
17 | height: 100%;
18 | width: 50%;
19 | justify-content: center;
20 | align-items: center;
21 | font-size: 28rpx;
22 | letter-spacing: 6rpx;
23 | color: #444;
24 | }
25 |
26 | .header-fix .share-btn {
27 | font-size: 28rpx;
28 | margin: 0;
29 | padding: 0;
30 | line-height: normal;
31 | border-radius: 0;
32 | color: #444;
33 | background: #fbfbfb;
34 | }
35 |
36 | .header-fix .share-btn::after{
37 | content: none;
38 | }
39 |
40 | .detail-icon {
41 | width: 40rpx;
42 | height: 40rpx;
43 | margin-right: 15rpx;
44 | }
45 |
46 | .thread_title-cell {
47 | border-radius: 10rpx;
48 | margin: 80rpx 0 20rpx 0;
49 | padding: 20rpx 30rpx;
50 | background-color: white;
51 | display: felx;
52 | flex: row nowrap;
53 | }
54 |
55 | .thread_data-title {
56 | font-size: 36rpx;
57 | margin-bottom: 10rpx;
58 | }
59 |
60 | .thread_data-sub {
61 | display: flex;
62 | flex-direction:row;
63 | justify-content: space-between;
64 | align-content: center;
65 | }
66 |
67 | .thread_data-info {
68 | display: flex;
69 | flex-direction: row;
70 | color:#c7c7c7;
71 | }
72 |
73 | .thread_data-info .zan-icon{
74 | color:#f44444;
75 | width: 30rpx;
76 | }
77 |
78 | .thread_data-info view{
79 | margin-right:16rpx;
80 | }
81 |
82 | .thread_data-fid {
83 | height:30rpx;
84 | line-height:30rpx;
85 | font-size: 22rpx;
86 | border-radius: 5rpx;
87 | border: 0.1rpx solid #FF6A6A;
88 | color: #FF6A6A;
89 | padding: 2px 6rpx;
90 | margin-top:5rpx;
91 | }
92 |
93 | .thread_content-cell {
94 | padding: 20rpx 30rpx;
95 | background-color: white;
96 | border-radius: 5rpx;
97 | }
98 |
99 | .new-post{
100 | border:2px solid #FF6A6A;
101 | }
102 |
103 | .new-post .article-info .article-author-info {
104 | padding:0;
105 | }
106 |
107 | .new-post .article-info .article-author-position{
108 | color:#FF6A6A;
109 | }
110 |
111 | .article-info {
112 | padding: 10rpx 0 15rpx 0;
113 | margin-bottom: 18rpx;
114 | color: gray;
115 | display: flex;
116 | flex-direction: row;
117 | justify-content: space-between;
118 | align-items: flex-end;
119 | border-bottom: 1px solid #efefef
120 | }
121 |
122 | .article-author {
123 | display: flex;
124 | flex-direction: row;
125 | justify-content: center;
126 | align-content: center;
127 | }
128 |
129 | .article-author-avatar {
130 | display: flex;
131 | flex-direction: row;
132 | justify-content: center;
133 | align-content: center;
134 | }
135 |
136 | .article-author-icon {
137 | max-width: 68rpx;
138 | max-height: 68rpx;
139 | border-radius: 50%;
140 | }
141 |
142 | .article-author-info
143 | {
144 | display: flex;
145 | flex-direction: column;
146 | justify-content: center;
147 | font-size: 24rpx;
148 | padding-left: 18rpx;
149 | }
150 |
151 | .article-author-position
152 | {
153 | display: flex;
154 | flex-direction: column;
155 | justify-content: center;
156 | font-size: 24rpx;
157 | padding-left: 10rpx;
158 | }
159 |
160 |
161 | .thread_image {
162 | width: 100%;
163 | margin: 10rpx 0;
164 | }
165 |
166 | .resp-head {
167 | color:#FF6A6A;
168 | margin: 20rpx 0 6rpx 10rpx;
169 | font-size:26rpx;
170 | }
171 |
172 | .article {
173 | border-radius: 5rpx;
174 | margin-bottom: 15rpx;
175 | padding: 20rpx 30rpx;
176 | position: relative;
177 | align-items: center;
178 | background-color: white;
179 | }
180 |
181 | .article-content {
182 | display: flex;
183 | flex-direction: row;
184 | justify-content: space-between
185 | }
186 |
187 | .article-title {
188 | font-size: large;
189 | }
190 |
191 | .article-sign {
192 | display: flex;
193 | flex-direction: row;
194 | font-size: small;
195 | }
196 |
197 | .article-sign-item {
198 | background-color: orange;
199 | color: white;
200 | padding: 0rpx 5rpx;
201 | margin: 0rpx 5rpx;
202 | }
203 |
204 | .article-reader {
205 | display: flex;
206 | flex-direction: column;
207 | justify-content: center;
208 | }
209 |
210 | .article-image {
211 | max-width: 150rpx;
212 | max-height: 150rpx;
213 | }
214 |
215 | .comment {
216 | padding: 0rpx 30rpx;
217 | position: relative;
218 | align-items: center;
219 | background-color: white;
220 | }
221 |
222 | .comment-item {
223 | padding: 20rpx 0rpx;
224 | border-top: 1rpx solid #D8D8D8;
225 | }
226 |
227 | .comment-info {
228 | color: gray;
229 | font-size: small;
230 | display: flex;
231 | flex-direction: row;
232 | justify-content: space-between;
233 | }
234 | .comment-author {
235 | display: flex;
236 | flex-direction: row;
237 | }
238 |
239 | .comment-op {
240 | display: flex;
241 | flex-direction: column;
242 | justify-content: center;
243 | }
244 |
245 | .comment-content {
246 | margin-left: 80rpx;
247 | }
248 |
249 | .comment-resp {
250 | margin-left: 80rpx;
251 | padding: 10rpx 10rpx;
252 | background-color: #EEEEEE;
253 | /* border-left: 8rpx solid gray; */
254 | }
255 |
256 | .page-tail-space {
257 | height: 110rpx;
258 | /*background-color: white;*/
259 | }
260 |
261 | .page-tail {
262 | left: 0;
263 | position: fixed;
264 | bottom: 0;
265 | width: 100%;
266 | z-index: 100;
267 | background-color: white;
268 | display: flex;
269 | flex-direction: row;
270 | justify-content: space-between;
271 | align-items: center;
272 | border-top: 1rpx solid #dfdfdf;
273 | }
274 |
275 | .resp-input-cell {
276 | width: 84%;
277 | margin-right: 20rpx;
278 | }
279 |
280 | .resp-input {
281 | height: 60rpx;
282 | padding-left: 20rpx;
283 | margin: 15rpx 0 15rpx 25rpx;
284 | /* width: 100%; */
285 | border:1px solid #ccc;
286 | border-radius: 30rpx;
287 | }
288 |
289 | .resp-btn {
290 | height: 60rpx;
291 | width: 16%;
292 | line-height: 60rpx;
293 | text-align: center;
294 | margin-right:8rpx;
295 | color: #4b0;
296 | font-size: 30rpx;
297 | }
298 |
299 | .need-login {
300 | height: 90rpx;
301 | width: 100%;
302 | display: flex;
303 | flex-direction: row;
304 | justify-content: center;
305 | align-items: center;
306 | color:#999;
307 | }
308 |
309 | .scroll-to-top {
310 | z-index: 100;
311 | position: fixed;
312 | right: 20rpx;
313 | bottom: 100rpx;
314 | width: 120rpx;
315 | height: 120rpx;
316 | }
317 |
318 | .scroll-to-top-img {
319 | background-color: #FF6A6A;
320 | width: 90rpx;
321 | height: 90rpx;
322 | border-radius: 50%;
323 | opacity: 0.9;
324 | }
325 |
326 | .extend-notice {
327 | padding:10rpx 20rpx;
328 | background:white;
329 | margin:20rpx 0;
330 | border-radius:5rpx;
331 | border:2px solid #FF6A6A;
332 | }
333 |
334 | .extend-notice .alert, .extend-notice .to-mould text {
335 | color: #FF6A6A;
336 | }
--------------------------------------------------------------------------------
/wmapp/pages/forum_list/forum_list.js:
--------------------------------------------------------------------------------
1 | var app = getApp()
2 | Page({
3 | data: {
4 | fid: 0,
5 | articleList: [],
6 | page_size: 5,
7 | page_index: 0,
8 | recent: 1,
9 | digest: 0,
10 | order_by_views: 0,
11 | has_top: 0,
12 | reload_index: 1,
13 | no_data:false,
14 | have_data: false,
15 | nomore_data : false,
16 | lite_switch: app.globalData.lite_switch,
17 | },
18 |
19 | onLoad: function (options) {
20 | console.log(options);
21 | var fid = options.fid;
22 | console.log(fid);
23 | this.setData({
24 | fid: fid,
25 | })
26 | this.reloadIndex();
27 | this.get_forum_info();
28 | },
29 |
30 | onShow: function () {
31 | if (this.data.reload_index == 1) {
32 | this.reloadIndex();
33 | this.get_forum_info();
34 | this.setData({
35 | reload_index: 0
36 | });
37 | }
38 | },
39 |
40 | toDetail: function (e) {
41 | console.log(e);
42 | var pid = e.currentTarget.dataset.pid;
43 | var tid = e.currentTarget.dataset.tid;
44 | wx.navigateTo({
45 | url: '../detail/detail?pid=' + pid + '&tid=' + tid,
46 | })
47 | },
48 |
49 | reloadIndex: function () {
50 | var that = this;
51 | var tmpArticleList = [];
52 | var page_size = that.data.page_size;
53 | var page_index = 0;
54 | wx.request({
55 | url: getApp().globalData.svr_url + "get_thread.php",
56 | method: "post",
57 | header: { "content-type": "application/x-www-form-urlencoded" },
58 | data: {
59 | token: wx.getStorageSync("token"),
60 | fid: that.data.fid,
61 | page_size: page_size,
62 | page_index: page_index,
63 | digest: that.data.digest,
64 | order_by_views: that.data.order_by_views,
65 | },
66 | success: function (resp) {
67 | console.log(resp);
68 | var resp_dict = resp.data;
69 | if (resp_dict.err_code == 0) {
70 | if (resp_dict.data.forum_thread_data.length != 0) {
71 | that.setData({
72 | articleList: resp_dict.data.forum_thread_data,
73 | page_index: page_index,
74 | no_data: false,
75 | have_data: false,
76 | nomore_data: false,
77 | })
78 | } else {
79 | that.setData({
80 | articleList: resp_dict.data.forum_thread_data,
81 | page_index: page_index,
82 | no_data: true,
83 | nomore_data:false,
84 | have_data:false,
85 | })
86 | }
87 | } else {
88 | getApp().showSvrErrModal(resp);
89 | }
90 | }
91 | })
92 | },
93 |
94 | onReachBottom: function () {
95 | var that = this;
96 | that.setData({
97 | have_data: true,
98 | })
99 | var page_size = that.data.page_size;
100 | var page_index = that.data.page_index + 1;
101 | wx.request({
102 | url: getApp().globalData.svr_url + "get_thread.php",
103 | method: "post",
104 | header: { "content-type": "application/x-www-form-urlencoded" },
105 | data: {
106 | token: wx.getStorageSync("token"),
107 | fid: that.data.fid,
108 | page_size: page_size,
109 | page_index: page_index,
110 | digest: that.data.digest,
111 | order_by_views: that.data.order_by_views,
112 | },
113 | success: function (resp) {
114 | console.log(resp);
115 | var resp_dict = resp.data;
116 | if (resp_dict.err_code == 0) {
117 | var tmpArticleList = that.data.articleList;
118 | var respArticleList = resp_dict.data.forum_thread_data;
119 | var has_append = 0;
120 | // console.log(respArticleList)
121 | if (respArticleList.length > 0) {
122 | for (var i = 0; i < respArticleList.length; ++i) {
123 | var has_in = 0;
124 | for (var j = 0; j < tmpArticleList.length; ++j) {
125 | if (respArticleList[i].tid == tmpArticleList[j].tid) {
126 | has_in = 1;
127 | }
128 | }
129 | if (has_in == 0) {
130 | tmpArticleList.push(respArticleList[i]);
131 | has_append = 1;
132 | }
133 | }
134 | if (has_append == 1) {
135 | that.setData({
136 | articleList: tmpArticleList,
137 | page_index: page_index
138 | })
139 | }
140 | } else {
141 | that.setData({
142 | have_data: false,
143 | nomore_data: true,
144 | })
145 | }
146 | }
147 | }
148 | })
149 | },
150 |
151 | onPullDownRefresh: function () {
152 | console.log('onPullDownRefresh');
153 | this.reloadIndex();
154 | wx.stopPullDownRefresh();
155 | },
156 |
157 | get_forum_info: function () {
158 | var that = this;
159 | wx.request({
160 | url: getApp().globalData.svr_url + "get_forum_info.php",
161 | method: "post",
162 | header: { "content-type": "application/x-www-form-urlencoded" },
163 | data: {
164 | token: wx.getStorageSync("token"),
165 | fid: that.data.fid,
166 | },
167 | success: function (resp) {
168 | console.log(resp);
169 | var resp_dict = resp.data;
170 | if (resp_dict.err_code == 0) {
171 | // console.log(resp_dict)
172 | var data = {};
173 | that.setData({
174 | forum_data: resp_dict.data.forum_data,
175 | few_top_thread_data: resp_dict.data.few_top_thread_data,
176 | top_thread_data: resp_dict.data.top_thread_data,
177 | show_more: resp_dict.data.show_more,
178 | has_top: resp_dict.data.has_top,
179 | });
180 | }
181 | }
182 | })
183 | },
184 |
185 | show_more_top: function () {
186 | console.log(this.data)
187 | this.setData({
188 | few_top_thread_data: this.data.top_thread_data,
189 | show_more: 0,
190 | });
191 | },
192 |
193 | get_recent_thread: function () {
194 | this.setData({
195 | recent: 1,
196 | digest: 0,
197 | order_by_views: 0,
198 | })
199 | this.reloadIndex();
200 | },
201 |
202 | get_hot_thread: function () {
203 | this.setData({
204 | recent: 0,
205 | digest: 0,
206 | order_by_views: 1,
207 | })
208 | this.reloadIndex();
209 | },
210 |
211 | get_digest_thread: function () {
212 | this.setData({
213 | recent: 0,
214 | digest: 1,
215 | order_by_views: 0,
216 | })
217 | this.reloadIndex();
218 | },
219 |
220 | toAddArticle: function (e) {
221 | wx.navigateTo({
222 | url: '../add_forum_article/add_forum_article?fid=' + this.data.fid + "&fname=" + this.data.forum_data.name,
223 | })
224 | },
225 | onPageScroll: function (e) {
226 | if (e.scrollTop >= 600) {
227 | this.setData({
228 | scroll_show: true
229 | })
230 | } else {
231 | this.setData({
232 | scroll_show: false
233 | })
234 | }
235 | },
236 | scrollToTop: function () {
237 | if (wx.pageScrollTo) {
238 | wx.pageScrollTo({
239 | scrollTop: 0,
240 | duration: 600
241 | })
242 | } else {
243 | wx.showModal({
244 | title: '提示',
245 | content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
246 | })
247 | }
248 | this.setData({
249 | scroll_show: false
250 | })
251 | }
252 | })
--------------------------------------------------------------------------------
/wmapp/wxParse/wxDiscode.js:
--------------------------------------------------------------------------------
1 | // HTML 支持的数学符号
2 | function strNumDiscode(str){
3 | str = str.replace(/∀/g, '∀');
4 | str = str.replace(/∂/g, '∂');
5 | str = str.replace(/&exists;/g, '∃');
6 | str = str.replace(/∅/g, '∅');
7 | str = str.replace(/∇/g, '∇');
8 | str = str.replace(/∈/g, '∈');
9 | str = str.replace(/∉/g, '∉');
10 | str = str.replace(/∋/g, '∋');
11 | str = str.replace(/∏/g, '∏');
12 | str = str.replace(/∑/g, '∑');
13 | str = str.replace(/−/g, '−');
14 | str = str.replace(/∗/g, '∗');
15 | str = str.replace(/√/g, '√');
16 | str = str.replace(/∝/g, '∝');
17 | str = str.replace(/∞/g, '∞');
18 | str = str.replace(/∠/g, '∠');
19 | str = str.replace(/∧/g, '∧');
20 | str = str.replace(/∨/g, '∨');
21 | str = str.replace(/∩/g, '∩');
22 | str = str.replace(/∩/g, '∪');
23 | str = str.replace(/∫/g, '∫');
24 | str = str.replace(/∴/g, '∴');
25 | str = str.replace(/∼/g, '∼');
26 | str = str.replace(/≅/g, '≅');
27 | str = str.replace(/≈/g, '≈');
28 | str = str.replace(/≠/g, '≠');
29 | str = str.replace(/≤/g, '≤');
30 | str = str.replace(/≥/g, '≥');
31 | str = str.replace(/⊂/g, '⊂');
32 | str = str.replace(/⊃/g, '⊃');
33 | str = str.replace(/⊄/g, '⊄');
34 | str = str.replace(/⊆/g, '⊆');
35 | str = str.replace(/⊇/g, '⊇');
36 | str = str.replace(/⊕/g, '⊕');
37 | str = str.replace(/⊗/g, '⊗');
38 | str = str.replace(/⊥/g, '⊥');
39 | str = str.replace(/⋅/g, '⋅');
40 | return str;
41 | }
42 |
43 | //HTML 支持的希腊字母
44 | function strGreeceDiscode(str){
45 | str = str.replace(/Α/g, 'Α');
46 | str = str.replace(/Β/g, 'Β');
47 | str = str.replace(/Γ/g, 'Γ');
48 | str = str.replace(/Δ/g, 'Δ');
49 | str = str.replace(/Ε/g, 'Ε');
50 | str = str.replace(/Ζ/g, 'Ζ');
51 | str = str.replace(/Η/g, 'Η');
52 | str = str.replace(/Θ/g, 'Θ');
53 | str = str.replace(/Ι/g, 'Ι');
54 | str = str.replace(/Κ/g, 'Κ');
55 | str = str.replace(/Λ/g, 'Λ');
56 | str = str.replace(/Μ/g, 'Μ');
57 | str = str.replace(/Ν/g, 'Ν');
58 | str = str.replace(/Ξ/g, 'Ν');
59 | str = str.replace(/Ο/g, 'Ο');
60 | str = str.replace(/Π/g, 'Π');
61 | str = str.replace(/Ρ/g, 'Ρ');
62 | str = str.replace(/Σ/g, 'Σ');
63 | str = str.replace(/Τ/g, 'Τ');
64 | str = str.replace(/Υ/g, 'Υ');
65 | str = str.replace(/Φ/g, 'Φ');
66 | str = str.replace(/Χ/g, 'Χ');
67 | str = str.replace(/Ψ/g, 'Ψ');
68 | str = str.replace(/Ω/g, 'Ω');
69 |
70 | str = str.replace(/α/g, 'α');
71 | str = str.replace(/β/g, 'β');
72 | str = str.replace(/γ/g, 'γ');
73 | str = str.replace(/δ/g, 'δ');
74 | str = str.replace(/ε/g, 'ε');
75 | str = str.replace(/ζ/g, 'ζ');
76 | str = str.replace(/η/g, 'η');
77 | str = str.replace(/θ/g, 'θ');
78 | str = str.replace(/ι/g, 'ι');
79 | str = str.replace(/κ/g, 'κ');
80 | str = str.replace(/λ/g, 'λ');
81 | str = str.replace(/μ/g, 'μ');
82 | str = str.replace(/ν/g, 'ν');
83 | str = str.replace(/ξ/g, 'ξ');
84 | str = str.replace(/ο/g, 'ο');
85 | str = str.replace(/π/g, 'π');
86 | str = str.replace(/ρ/g, 'ρ');
87 | str = str.replace(/ς/g, 'ς');
88 | str = str.replace(/σ/g, 'σ');
89 | str = str.replace(/τ/g, 'τ');
90 | str = str.replace(/υ/g, 'υ');
91 | str = str.replace(/φ/g, 'φ');
92 | str = str.replace(/χ/g, 'χ');
93 | str = str.replace(/ψ/g, 'ψ');
94 | str = str.replace(/ω/g, 'ω');
95 | str = str.replace(/ϑ/g, 'ϑ');
96 | str = str.replace(/ϒ/g, 'ϒ');
97 | str = str.replace(/ϖ/g, 'ϖ');
98 | str = str.replace(/·/g, '·');
99 | return str;
100 | }
101 |
102 | //
103 |
104 | function strcharacterDiscode(str){
105 | // 加入常用解析
106 | str = str.replace(/ /g, ' ');
107 | str = str.replace(/"/g, "'");
108 | str = str.replace(/&/g, '&');
109 | // str = str.replace(/</g, '‹');
110 | // str = str.replace(/>/g, '›');
111 |
112 | str = str.replace(/</g, '<');
113 | str = str.replace(/>/g, '>');
114 | str = str.replace(/•/g, '•');
115 |
116 | return str;
117 | }
118 |
119 | // HTML 支持的其他实体
120 | function strOtherDiscode(str){
121 | str = str.replace(/Œ/g, 'Œ');
122 | str = str.replace(/œ/g, 'œ');
123 | str = str.replace(/Š/g, 'Š');
124 | str = str.replace(/š/g, 'š');
125 | str = str.replace(/Ÿ/g, 'Ÿ');
126 | str = str.replace(/ƒ/g, 'ƒ');
127 | str = str.replace(/ˆ/g, 'ˆ');
128 | str = str.replace(/˜/g, '˜');
129 | str = str.replace(/ /g, '');
130 | str = str.replace(/ /g, '');
131 | str = str.replace(/ /g, '');
132 | str = str.replace(//g, '');
133 | str = str.replace(//g, '');
134 | str = str.replace(//g, '');
135 | str = str.replace(//g, '');
136 | str = str.replace(/–/g, '–');
137 | str = str.replace(/—/g, '—');
138 | str = str.replace(/‘/g, '‘');
139 | str = str.replace(/’/g, '’');
140 | str = str.replace(/‚/g, '‚');
141 | str = str.replace(/“/g, '“');
142 | str = str.replace(/”/g, '”');
143 | str = str.replace(/„/g, '„');
144 | str = str.replace(/†/g, '†');
145 | str = str.replace(/‡/g, '‡');
146 | str = str.replace(/•/g, '•');
147 | str = str.replace(/…/g, '…');
148 | str = str.replace(/‰/g, '‰');
149 | str = str.replace(/′/g, '′');
150 | str = str.replace(/″/g, '″');
151 | str = str.replace(/‹/g, '‹');
152 | str = str.replace(/›/g, '›');
153 | str = str.replace(/‾/g, '‾');
154 | str = str.replace(/€/g, '€');
155 | str = str.replace(/™/g, '™');
156 |
157 | str = str.replace(/←/g, '←');
158 | str = str.replace(/↑/g, '↑');
159 | str = str.replace(/→/g, '→');
160 | str = str.replace(/↓/g, '↓');
161 | str = str.replace(/↔/g, '↔');
162 | str = str.replace(/↵/g, '↵');
163 | str = str.replace(/⌈/g, '⌈');
164 | str = str.replace(/⌉/g, '⌉');
165 |
166 | str = str.replace(/⌊/g, '⌊');
167 | str = str.replace(/⌋/g, '⌋');
168 | str = str.replace(/◊/g, '◊');
169 | str = str.replace(/♠/g, '♠');
170 | str = str.replace(/♣/g, '♣');
171 | str = str.replace(/♥/g, '♥');
172 |
173 | str = str.replace(/♦/g, '♦');
174 | str = str.replace(/'/g, '\'');
175 | return str;
176 | }
177 |
178 | function strMoreDiscode(str){
179 | str = str.replace(/\r\n/g,"");
180 | str = str.replace(/\n/g,"");
181 |
182 | str = str.replace(/code/g,"wxxxcode-style");
183 | return str;
184 | }
185 |
186 | function strDiscode(str){
187 | str = strNumDiscode(str);
188 | str = strGreeceDiscode(str);
189 | str = strcharacterDiscode(str);
190 | str = strOtherDiscode(str);
191 | str = strMoreDiscode(str);
192 | return str;
193 | }
194 | function urlToHttpUrl(url,rep){
195 |
196 | var patt1 = new RegExp("^//");
197 | var result = patt1.test(url);
198 | if(result){
199 | url = rep+":"+url;
200 | }
201 | return url;
202 | }
203 |
204 | module.exports = {
205 | strDiscode:strDiscode,
206 | urlToHttpUrl:urlToHttpUrl
207 | }
--------------------------------------------------------------------------------