Skip to content

Commit

Permalink
Merge pull request #21 from airdb/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
deancn authored Sep 13, 2020
2 parents c04ea42 + 8bf8d14 commit 99df47d
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 106 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
小程序 - 宝贝回家

## 产品
[Figma org](https://www.figma.com/@airdb)
[设计图 - new](https://www.figma.com/file/xcoF6ywUadcB81F4mVn8cW/mina)

[设计图](https://org.modao.cc/app/9358480b82ba8ef102789b663a3e4715)


Expand Down
8 changes: 8 additions & 0 deletions build/miniprogram.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ module.exports = {
share: true,
windowScroll: false,
backgroundColor: '#F7F7F7',
reachBottom: true,
},
pages: {
home: {
enablePullDownRefresh: true,
pullDownRefresh: true,
permission: {
scope: {
userLocation: "aa"
}
// "desc": "你的位置信息将用于小程序位置接口的效果展示" // 高速公路行驶持续后台定位
//}
}
},
},
optimization: {
Expand Down
48 changes: 0 additions & 48 deletions mina_wepy/package.json

This file was deleted.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/api/commont.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function articleDetail(id) {
* @description 文章详情
* @param {number} id
*/
return get('/article/detail', { id })
return get('/article/query', { id })
}

export function getSources(p) {
Expand Down
46 changes: 27 additions & 19 deletions src/article/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<script>
import Vue from 'vue'
import ShowArticle from '../components/article.vue'
import { articleDetail } from '../api/commont'
export default Vue.extend({
name: 'ArticleShow',
Expand All @@ -39,25 +40,25 @@ export default Vue.extend({
articleId: null,
detail: null,
article: {
AvatarURL: 'https://wechat-1251018873.file.myqcloud.com/images/banner.png',
BabyID: 32519,
Gender: 1,
BirthedAt: 1599305851,
BirthedProvince: '北京',
BirthedCity: '北京',
BirthedCountry: '中国',
MissedAt: 1599305851,
MissedProvince: '广东',
MissedCity: '深圳',
MissedCountry: '中国',
MissedAddress: '测试测试',
Nickname: '王姑娘',
Height: '172厘米左右',
Subject: '1988年3月3日(农历)出生于江苏省宿迁市人民医院,被送养的王姑娘寻亲 32519',
DataFrom: 'https://bbs.baobeihuijia.com/thread-151906-1-1.html',
Category: '宝贝寻家',
Volunteer: '鼠尔草 跟进',
Details: '测试测试'
// AvatarURL: 'https://wechat-1251018873.file.myqcloud.com/images/banner.png',
// BabyID: 32519,
// Gender: 1,
// BirthedAt: 1599305851,
// BirthedProvince: '北京',
// BirthedCity: '北京',
// BirthedCountry: '中国',
// MissedAt: 1599305851,
// MissedProvince: '广东',
// MissedCity: '深圳',
// MissedCountry: '中国',
// MissedAddress: '测试测试',
// Nickname: '王姑娘',
// Height: '172厘米左右',
// Subject: '1988年3月3日(农历)出生于江苏省宿迁市人民医院,被送养的王姑娘寻亲 32519',
// DataFrom: 'https://bbs.baobeihuijia.com/thread-151906-1-1.html',
// Category: '宝贝寻家',
// Volunteer: '鼠尔草 跟进',
// Details: '测试测试'
},
}
},
Expand All @@ -73,6 +74,13 @@ export default Vue.extend({
this.url = this.url + this.articleId
// 开启分享
this.openShare(this.articleId)
articleDetail(this.$route.params.id).then((res) => {
console.log('article detail ---->', res.data.article)
this.article = res.data.article
}).catch((err) => {
console.log('article error--->', err)
})
},
methods: {
openShare(articleId) {
Expand Down
8 changes: 4 additions & 4 deletions src/components/ListContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
>
<div class="article_list_item" >

<div class="article_detail" @click="jumpToDetail( '/atricle/' + item.id)">
<div class="article_detail" @click="jumpToDetail( '/article/' + item.id)">

<div class="artclie_text_msg">
<div class="article_author">
Expand Down Expand Up @@ -56,10 +56,10 @@ export default Vue.extend({
},
methods: {
jumpToDetail(jurl) {
this.url = '/article/111?data='
// this.url = '/article/111?data='
console.log('xxxurl', jurl)
window.location.href = '/article/111'
// window.location.href = jurl
// window.location.href = '/article/111'
window.location.href = jurl
},
share(article) {
window.onShareAppMessage = (res) => {
Expand Down
34 changes: 20 additions & 14 deletions src/components/article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@


<img class="bg" src=""/>
<img class="head" :src="item.AvatarURL" />
<img class="head" :src="item.avatar_url" />

<view class="name">{{item.Nickname}}</view>
<view class="id">档案ID:{{item.BabyID}}</view>
<view class="name">{{item.nickname}}</view>
<view class="id">档案ID:{{item.babyid}}</view>

<view class="info">
<view class="info-item">
<view class="info-title">性别</view>
<view class="info-content">{{item.Sex}}</view>
<view class="info-content">{{item.gender}}</view>
</view>
<view class="info-item">
<view class="info-title">出生日期</view>
<view class="info-content">{{item.BirthedAt}}</view>
<view class="info-content">{{item.birthed_at}}</view>
</view>
<view class="info-item">
<view class="info-title">户籍地点</view>
<view class="info-content">
{{item.BirthedProvince + item.BirthedCity + item.BirthedCountry}}
{{item.birthed_province + item.birthed_city + item.birthed_country}}
</view>
</view>
</view>
Expand All @@ -34,47 +34,47 @@
<view class="info">
<view class="info-item">
<view class="info-title">失踪时间</view>
<view class="info-content">{{item.MissedAt}}</view>
<view class="info-content">{{item.missed_at}}</view>
</view>
<view class="info-item">
<view class="info-title">失踪地点</view>
<view class="info-content">{{item.MissedAddress}}</view>
<view class="info-content">{{item.missed_address}}</view>
</view>
<view class="info-item">
<view class="info-title">失踪时身高</view>
<view class="info-content">{{item.Height}}</view>
</view>
<view class="info-item feature">
<view class="info-title">失踪人特征</view>
<view class="info-content">{{item.Detail}}</view>
<view class="info-content">{{item.subject}}</view>
</view>
</view>

<view class="tag">寻亲信息</view>
<view class="info">
<view class="info-item">
<view class="info-title">寻亲编号</view>
<view class="info-content">{{item.BabyID}}</view>
<view class="info-content">{{item.babyid}}</view>
</view>
<view class="info-item">
<view class="info-title">寻亲类别</view>
<view class="info-content">{{item.Category}}</view>
<view class="info-content">{{item.category}}</view>
</view>
<view class="info-item feature">
<view class="info-title">信息来源</view>
<view class="info-content" @tap="handleLongPress">{{item.DataFrom}}</view>
<view class="info-content" @tap="handleLongPress">{{item.data_from}}</view>
</view>
<view class="info-item">
<view class="info-title">跟进志愿者</view>
<view class="info-content">{{item.Volunteer}}</view>
<view class="info-content">{{item.volunteer}}</view>
</view>
</view>

<view class="tag">其他资料</view>
<view class="info">
<view class="info-item feature">
<view class="info-title">其他资料</view>
<view class="info-content">{{item.Details}}</view>
<view class="info-content">{{item.details}}</view>
</view>
</view>
</div>
Expand All @@ -98,6 +98,12 @@ export default Vue.extend({
})
},
methods: {
onClickBack() {
console.log('onClickBack')
},
handleLongPress() {
console.log('handleLongPress')
},
jumpToDetail(jurl) {
this.url = '/article/111?data={aaa=11,bb=22}'
console.log('xxxurl', jurl)
Expand Down
2 changes: 1 addition & 1 deletion src/doc/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default Vue.extend({
docTitleList: [{
name: 'BBS 论坛',
url: '/doc/detail/docs',
},{
}, {
name: '工作月报',
url: '/doc/detail/docscn',
}],
Expand Down
22 changes: 20 additions & 2 deletions src/home/Tabs/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default Vue.extend({
{ label: '其他', key: 'pay' }
],
activeKey: 'newest',
actclieList: []
actclieList: [],
currentPage: 1 // default currentPage is 1
}
},
components: {
Expand All @@ -63,10 +64,27 @@ export default Vue.extend({
}
},
created() {
getArticles(1).then((res) => {
getArticles(this.currentPage).then((res) => {
// console.log(res)
this.actclieList = res.data.articles
})
// reach bottom envet 上拉触底查看历史
window.addEventListener('reachbottom', (evt) => {
console.log('reach_bottom', evt)
this.currentPage += 1
console.log('pageIndex--->', this.currentPage)
getArticles(this.currentPage).then((res) => {
console.log('append_xx')
this.actclieList = this.actclieList.concat(res.data.articles)
})
})
// pull down refresh 上拉更新数据
window.addEventListener('pulldownrefresh', (evt1) => {
console.log('pull_down', evt1)
})
}
})
</script>
Expand Down
21 changes: 20 additions & 1 deletion src/me/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
<view class="info-title">浏览记录</view>
<img class="right-icon" :src="narrowImg"/>
</view>
<view class="info-item">

<view class="info-item" @click.stop="hello">
<img class="item-icon" :src="historyImg"/>
<view class="info-title">联系我们</view>
<img class="right-icon" :src="narrowImg"/>
</view>

<view class="info-item" @click.stop="setting">
<img class="item-icon" :src="historyImg"/>
<view class="info-title" >设置</view>
Expand Down Expand Up @@ -81,6 +83,23 @@ export default Vue.extend({
setting() {
console.log('xx')
wx.openSetting()
},
hello() {
console.log('xxxaa')
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
wx.getSetting({
success(res) {
if (!res.authSetting['scope.userLocation']) {
wx.authorize({
scope: 'scope.userLocation',
success() {
// 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
wx.startRecord()
}
})
}
}
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/utils/request.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const baseUrl = 'https://scf.baobeihuijia.com/release/mina'
// const baseUrl = 'https://scf.baobeihuijia.com/release/mina'
const baseUrl = 'https://scf.baobeihuijia.com/release/mina/v1'

function request({ url, data, method }) {
const header = {
Expand Down
Loading

0 comments on commit 99df47d

Please sign in to comment.