完成巴爷个人资产展示

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

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

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

@ -31,15 +31,75 @@
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 27rpx;
margin-left: 20rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.zichan .second-line {
padding-top: 15rpx;
padding-bottom: 15rpx;
border-top: 1rpx solid #F6F6F6;
border-bottom: 1rpx solid #F6F6F6;
}
.long-view {
display: flex;
flex-direction: row;
width: 1850rpx;
}
.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;
}
.zichan .third-line {
.slide-img {
border-radius: 5px;
width: 560rpx;
height: 250rpx;
}
/*.zichan .third-line {
display: flex;
flex-direction: row;
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'
function getZichanSlides (resolve) {
function getZichanSlides (data, resolve) {
wx.request({
url: `${API_URL}/profiles/zichan_sildes`,
data: data,
@ -11,7 +11,7 @@ function getZichanSlides (resolve) {
}
module.exports = {
getZichanSlides (resolve) {
return getZichanSlides(resolve)
getZichanSlides (data, resolve) {
return getZichanSlides(data, resolve)
}
}
Loading…
Cancel
Save