Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
3.2.0内测
Browse files Browse the repository at this point in the history
  • Loading branch information
鞠欣诚 committed Feb 16, 2020
1 parent edad7ae commit e86b279
Show file tree
Hide file tree
Showing 30 changed files with 454 additions and 115 deletions.
6 changes: 6 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import {
App({
globalData: {},
onLaunch: function () {
let that = this
Follow.init()
wx.cloud.init()
wx.getSystemInfo({
success(res) {
that.globalData.systemInfo = res
},
})
}
})
1 change: 1 addition & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"pages/idel-index/idel-index",
"pages/idel-detail/idel-detail",
"pages/idel-create/idel-create",
"pages/idel-comment/idel-comment",
"pages/idel-my/idel-my",
"pages/auth/auth",
"pages/iclass/iclass",
Expand Down
8 changes: 8 additions & 0 deletions app.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ page {
align-items: center;
justify-content: center;
border-radius: 100rpx;
}

.float-button{
width: 180rpx;
height: 180rpx;
position: fixed;
z-index: 10;
right: 10rpx;
}
1 change: 1 addition & 0 deletions img/SearchInput/Cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion img/idel/add.svg

This file was deleted.

30 changes: 30 additions & 0 deletions img/idel/fabu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion img/idel/thing.svg

This file was deleted.

32 changes: 32 additions & 0 deletions img/idel/wode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions pages/components/Comment/Comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// components/component-tag-name.js
import {
Requests
} from "../../../utils/Requests"
Component({
/**
* 组件的属性列表
*/
properties: {
comment: Object
},

/**
* 组件的初始数据
*/
data: {
},

/**
* 组件的方法列表
*/
methods: {
tapComment: function () {
wx.navigateTo({
url:Requests.makeUrl("/pages/idel-comment/idel-comment",{
_id:this.data.comment._id
})
})
},
}
})
4 changes: 4 additions & 0 deletions pages/components/Comment/Comment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
9 changes: 9 additions & 0 deletions pages/components/Comment/Comment.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<view class="main-view" bindtap="tapComment" hover-class="hover">
<view class="line">
<image class="avatar" src="{{comment.from.avatarUrl}}"></image>
<text class="nickName">{{comment.from.nickName}}</text>
<text wx:if="{{comment.to!=null}}" class="replay">回复@{{comment.to.nickName}}</text>
</view>
<view class="content">{{comment.content}}</view>
<view class="time">{{comment.create_time}}</view>
</view>
48 changes: 48 additions & 0 deletions pages/components/Comment/Comment.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.main-view {
width: 750rpx;
display: flex;
flex-direction: column;
padding-top: 15rpx;
padding-bottom: 15rpx;
}

.hover{
background-color: #b8b8b89f;
}

.line {
display: flex;
flex-direction: row;
align-items: center;
margin-left: 20rpx;
}

.avatar {
height: 60rpx;
width: 60rpx;
border-radius: 50%;
overflow: hidden;
border: 1px solid;
border-color: #346cd1;
}

.nickName {
margin-left: 20rpx;
font-size: 30rpx;
font-weight: bold;
}

.replay{
color: #707070;
}

.content{
margin-left: 100rpx;
width: 620rpx;
}

.time{
margin-left: 100rpx;
color: #707070;
font-size: 18rpx;
}
44 changes: 31 additions & 13 deletions pages/components/GoodCard/GoodCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,39 @@ Component({
data: {

},
lifetimes:{
attached: function () {
let that = this
Requests.getWithCache({
url: "/user/" + this.data.good.owner,
success(data) {
that.setData({
owner: data
})
}
})
this.setData({
time: this.data.good.time.split(".")[0]
})
},
},

attached: function () {
let that = this
Requests.getWithCache({
url: "/user/" + this.data.good.owner,
success(data) {
that.setData({
owner: data
})
}
})
this.setData({
time: this.data.good.time.split(".")[0]
})
// 数据监听器
// 为了在good发生变化的时候同时改变owner
observers:{
"good":function(){
let that = this
Requests.getWithCache({
url: "/user/" + this.data.good.owner,
success(data) {
that.setData({
owner: data
})
}
})
}
},

/**
* 组件的方法列表
*/
Expand Down
4 changes: 2 additions & 2 deletions pages/components/GoodCard/GoodCard.wxml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<view wx:if="{{type=='sell'}}" class="sell-view" bindtap="tapCard">
<image class="photo" src="{{good.photos[0]}}" mode="aspectFill"></image>
<view class="content">
<view style=" display: flex;flex-direction: column;">
<view style="display: flex;flex-direction: column;">
<text class="title">{{good.title}}</text>
<view style="display:inline">
<text class="price" style="font-size:24rpx">¥</text>
<text class="price">{{good.price}}</text>
</view>
</view>
<image src="{{owner.avatarUrl}}" class="avatar"></image>
<image src="{{owner.avatarUrl}}" lazy-load="{{true}}" class="avatar"></image>
</view>
</view>

Expand Down
9 changes: 8 additions & 1 deletion pages/components/SearchInput/SearchInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Component({
* 组件的初始数据
*/
data: {

inputValue:""
},

/**
Expand All @@ -34,6 +34,13 @@ Component({
},
tapSearch: function () {
this.data.search(this.data.inputValue)
},
tapCancel:function(){
console.log(111)
this.setData({
inputValue: ""
})
this.data.search("")
}
}
})
15 changes: 8 additions & 7 deletions pages/components/SearchInput/SearchInput.wxml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<view class="main-view">
<view class="border">
<view style="width:15rpx"></view>
<image src="/img/SearchInput/search.svg" class="pic" />
<view style="width:15rpx"></view>
<input class="input" placeholder="{{placeholder}}" bindinput="input" bindconfirm="tapSearch" />
<view class="text" bindtap="tapSearch">搜索</view>
</view>
<view class="border">
<view style="width:15rpx"></view>
<image src="/img/SearchInput/search.svg" class="pic" />
<view style="width:15rpx"></view>
<input class="input" value="{{inputValue}}" placeholder="{{placeholder}}" bindinput="input" confirm-type="search" bindconfirm="tapSearch" />
<image wx:if="{{inputValue.length!=0}}" class="cancel" src="/img/SearchInput/Cancel.svg" bindtap="tapCancel"></image>
<view class="text" bindtap="tapSearch">搜索</view>
</view>
</view>
9 changes: 8 additions & 1 deletion pages/components/SearchInput/SearchInput.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

.input {
width: 90%;
width: 420rpx;
}

.text {
Expand All @@ -39,4 +39,11 @@
flex-direction: column;
justify-content: center;
align-items: center;
}

.cancel{
margin-left: 10rpx;
margin-right: 10rpx;
width: 30rpx;
height: 30rpx;
}
Loading

0 comments on commit e86b279

Please sign in to comment.