完成巴爷个人资产展示

wechat_user_type
Ge Hao 8 years ago
parent 641b54aaff
commit c57e7b00aa
  1. 2
      pages/mine/mine.js
  2. 29
      pages/mine/mine.wxml
  3. 62
      pages/mine/mine.wxss
  4. 6
      utils/profile.js

@ -17,7 +17,7 @@ Page({
that.setData({userInfo:userInfo}) that.setData({userInfo:userInfo})
}) })
profile.getSlides(function(result) { profile.getZichanSlides({}, function(result) {
var data = getApp().store.sync(result.data) var data = getApp().store.sync(result.data)
that.setData({'zichan_slides': data}) that.setData({'zichan_slides': data})
wx.setStorage({ wx.setStorage({

@ -1,4 +1,3 @@
<view class="userinfo"> <view class="userinfo">
<image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image> <image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text> <text class="userinfo-nickname">{{userInfo.nickName}}</text>
@ -12,21 +11,23 @@
<view>查看全部资产》</view> <view>查看全部资产》</view>
</view> </view>
<view class="second-line"> <view class="second-line">
<swiper> <scroll-view scroll-x="true">
<block wx:for="{{zichan_slides}}" wx:for-item="slide"> <view class="long-view">
<swiper-item> <block wx:for="{{zichan_slides}}" wx:for-item="slide">
<image class="slide-img" src="{{slide.url}}"/> <view class="item">
<view class="desc"> <image class="slide-img" src="{{slide.image}}"/>
<text>{{slide.title}}</text> <view class="desc">
<text>{{slide.amount}}</text> <view class="desc-line"><text>{{slide.name}}</text></view>
<text>{{slide.inventory}}</text> <view class="desc-line asset-count"><text>{{slide['asset-count']}}</text></view>
<view class="desc-line"><text>{{slide.inventory}}</text></view>
</view>
</view> </view>
</swiper-item> </block>
</block> </view>
</swiper> </scroll-view>
</view> </view>
<view class="third-line"> <!--<view class="third-line">
<view>巴爷定制</view> <view>巴爷定制</view>
<view>》</view> <view>》</view>
</view> </view>-->
</view> </view>

@ -31,15 +31,75 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
font-size: 27rpx;
margin-left: 20rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
} }
.zichan .second-line { .zichan .second-line {
padding-top: 15rpx;
padding-bottom: 15rpx;
border-top: 1rpx solid #F6F6F6;
border-bottom: 1rpx solid #F6F6F6;
}
.long-view {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
width: 1850rpx;
} }
.zichan .third-line { .zichan .second-line .item {
width: 560rpx;
height: 250rpx;
margin-left: 20rpx;
}
.zichan .second-line .desc {
position: relative;
top: -255rpx;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.3);
border-radius: 5px;
text-align: center;
color: #fff;
display: flex;
flex-direction: column;
justify-content: center;
font-size: 25rpx;
}
.desc-line {
margin-top: 5rpx;
margin-bottom: 5rpx;
}
.desc-line.asset-count {
font-size: 32rpx;
color: #FFC800;
}
.slide-img {
border-radius: 5px;
width: 560rpx;
height: 250rpx;
}
/*.zichan .third-line {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
font-size: 27rpx;
margin-left: 20rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
}*/
.blank {
width: 500rpx;
} }

@ -1,6 +1,6 @@
const API_URL = 'http://localhost:3000' const API_URL = 'http://localhost:3000'
function getZichanSlides (resolve) { function getZichanSlides (data, resolve) {
wx.request({ wx.request({
url: `${API_URL}/profiles/zichan_sildes`, url: `${API_URL}/profiles/zichan_sildes`,
data: data, data: data,
@ -11,7 +11,7 @@ function getZichanSlides (resolve) {
} }
module.exports = { module.exports = {
getZichanSlides (resolve) { getZichanSlides (data, resolve) {
return getZichanSlides(resolve) return getZichanSlides(data, resolve)
} }
} }
Loading…
Cancel
Save