Browse Source

新增功能,接口接入

master
xiangshunpu 4 years ago
parent
commit
9ba18f5245
  1. 2
      app.js
  2. 44
      app.wxss
  3. 18
      components/detail-clinch/detail-clinch.wxml
  4. 59
      components/detail-clinch/detail-clinch.wxss
  5. 7
      components/detail-present/detail-present.js
  6. 41
      components/detail-present/detail-present.wxml
  7. 37
      components/detail-present/detail-present.wxss
  8. 45
      pages/look-detail/look-detail.js
  9. 2
      project.config.json
  10. 7
      utils/api.js

2
app.js

@ -11,7 +11,7 @@ App({
wx.login({ wx.login({
success: res => { success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId // 发送 res.code 到后台换取 openId, sessionKey, unionId
$api.getOpenid(res.code) $api.getUserAuth(res.code)
.then(res => { .then(res => {
//请求成功 //请求成功
console.log(res) console.log(res)

44
app.wxss

@ -122,3 +122,47 @@
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.table-title {
font-size: 30rpx;
font-weight: bold;
color: #F69F06;
line-height: 90rpx;
}
.table-box {
background-color: #ffffff;
padding: 0 30rpx 50rpx 30rpx;
margin-top: 20rpx;
}
.table{
border: 1px solid #E1E1E1;
}
.table-item{
border-bottom: 1px solid #E1E1E1;
font-size: 26rpx;
display: flex;
}
.table-item:last-of-type {
border: none;
}
.table-lable{
padding-left: 30rpx;
display: flex;
align-items: center;
width: 186rpx;
color: #838B99;
border-right: 1px solid #E1E1E1;
background: rgba(225, 225, 225, 0.2);
}
.table-info{
padding: 20rpx 30rpx;
line-height: 50rpx;
color: #262936;
flex: 1;
}

18
components/detail-clinch/detail-clinch.wxml

@ -1,12 +1,14 @@
<!--components/detail-clinch/detail-clinch.wxml--> <!--components/detail-clinch/detail-clinch.wxml-->
<view class="clinch"> <view class="table-box">
<view class="title">基本信息</view> <view class="table-title">基本信息</view>
<view class="box"> <view class="table">
<view class="lable"> <view class="table-item" wx:for="{{info.list}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="lable-item" wx:for="{{info.list}}" wx:for-index="index" wx:for-item="item" wx:key="index">{{item.lable}}</view> <view class="table-lable">
</view> {{item.lable}}
<view class="info"> </view>
<view class="info-item" wx:for="{{info.list}}" wx:for-index="index" wx:for-item="item" wx:key="index">{{item.info}}</view> <view class="table-info">
{{item.info}}
</view>
</view> </view>
</view> </view>
</view> </view>

59
components/detail-clinch/detail-clinch.wxss

@ -1,63 +1,4 @@
/* components/detail-clinch/detail-clinch.wxss */ /* components/detail-clinch/detail-clinch.wxss */
.clinch {
background-color: #ffffff;
padding: 0 30rpx 50rpx 30rpx;
margin-top: 20rpx;
}
.title {
font-size: 30rpx;
font-weight: bold;
color: #F69F06;
line-height: 90rpx;
}
.box {
width: 100%;
display: flex;
border: 1px solid #E1E1E1;
}
.lable {
background: rgba(225, 225, 225, 0.2);
border-right: 1px solid #E1E1E1;
width: 186rpx;
display: flex;
flex-direction: column;
}
.lable-item {
display: flex;
border-bottom: 1px solid #E1E1E1;
height: 90rpx;
align-items: center;
padding-left: 28rpx;
font-size: 26rpx;
color: #838B99;
}
.lable-item:last-of-type {
border: none;
}
.info {
flex: 1;
}
.info-item {
display: flex;
height: 90rpx;
align-items: center;
padding-left: 38rpx;
font-size: 26rpx;
color: #262936;
border-bottom: 1px solid #E1E1E1;
}
.info-item:last-of-type {
border: none;
}
.message{ .message{
margin-top: 20rpx; margin-top: 20rpx;
background-color: #ffffff; background-color: #ffffff;

7
components/detail-present/detail-present.js

@ -1,10 +1,15 @@
// components/detai-present/detai-present.js // components/detai-present/detai-present.js
Component({ Component({
options: {
addGlobalClass: true
},
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
info: {
type: Object
},
}, },
/** /**

41
components/detail-present/detail-present.wxml

@ -1,2 +1,41 @@
<!--components/detai-present/detai-present.wxml--> <!--components/detai-present/detai-present.wxml-->
<text>components/detai-present/detai-present.wxml</text> <view class="table-box">
<view class="table-title">项目详情</view>
<view class="table">
<view class="table-item" wx:for="{{info.detail}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="table-lable">
{{item.lable}}
</view>
<view class="table-info">
{{item.info}}
</view>
</view>
</view>
</view>
<view class="table-box">
<view class="table-title">销售情况</view>
<view class="table">
<view class="table-item" wx:for="{{info.list}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="table-lable">
{{item.lable}}
</view>
<view class="table-info">
{{item.info}}
</view>
</view>
</view>
<view class="table-column">
<view class="column-item">
<view class="column-head">预售明细</view>
<view class="column-head">预售/去化/去化率</view>
<view class="column-head">取证时间</view>
</view>
<view class="column-item" wx:for="{{info.more}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="column-info">{{item.msg}}</view>
<view class="column-info">{{item.booking}}</view>
<view class="column-info">{{item.timer}}</view>
</view>
</view>
</view>

37
components/detail-present/detail-present.wxss

@ -1 +1,38 @@
/* components/detai-present/detai-present.wxss */ /* components/detai-present/detai-present.wxss */
.table-column {
border: 1px solid #E1E1E1;
border-bottom: none;
margin-top: 26rpx;
}
.column-item {
display: flex;
font-size: 26rpx;
}
.column-item>view {
border-bottom: 1px solid #E1E1E1;
padding: 30rpx 0;
text-align: center;
flex: 1;
}
.column-item>view:nth-child(2) {
border-left: 1px solid #E1E1E1;
border-right: 1px solid #E1E1E1;
}
.column-head {
background: rgba(225, 225, 225, 0.2);
color: #838B99;
}
.column-item .column-info {
font-weight: bold;
color: #262936;
}
.column-item .column-info:nth-child(1) {
text-decoration: underline;
color: #036EF3;
}

45
pages/look-detail/look-detail.js

@ -55,7 +55,50 @@ Page({
], ],
message: [] message: []
}, },
presentInfo:{}, presentInfo:{
detail:[{
lable: '项目状态',
info: '在售'
},{
lable: '楼盘名称',
info: '海纳九龙'
},{
lable: '项目公司',
info: '重庆筑品房地产开发有限公司'
},{
lable: '经营企业',
info: '融信34 + 金科35 + 荣安33'
},{
lable: '首开时间',
info: '2021/02/01'
}],
list:[{
lable: '合计预售',
info: '120套'
},{
lable: '去化',
info: '37套'
},{
lable: '去化率',
info: '56%'
},{
lable: '预售住宅均价',
info: '10000元/m'
},{
lable: '预售商业均价',
info: '12000元/m'
}],
more:[{
msg:'2021XXX号',
booking:'72/34/56%',
timer:'2020/01/02'
},
{
msg:'2021XXX号',
booking:'48/34/46%',
timer:'2020/01/02'
}]
},
basisInfo:{}, basisInfo:{},
seniorInfo:{}, seniorInfo:{},
}, },

2
project.config.json

@ -4,7 +4,7 @@
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,

7
utils/api.js

@ -1,4 +1,4 @@
const baseURL = 'https://some-domain.com/api/' const baseURL = 'http://139.159.180.147:9002/'
const GET = 'GET'; const GET = 'GET';
const POST = 'POST'; const POST = 'POST';
const PUT = 'PUT'; const PUT = 'PUT';
@ -9,7 +9,7 @@ const DELETE = 'DELETE';
function request(method, url, data) { function request(method, url, data) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
let header = { let header = {
'content-type': 'application/json', 'content-type': 'application/json'
}; };
wx.request({ wx.request({
url: baseURL + url, url: baseURL + url,
@ -36,7 +36,8 @@ function request(method, url, data) {
const API = { const API = {
getOpenid: (data) => request(GET, `jsapi/mini?jsCode=${data}`), getOpenid: (data) => request(GET, `auth/oauth/token?grant_type=password&username=${data.admin}&password=${data.password}`),
getUserAuth: (data) => request(POST, `auth/social/token`, data)
}; };
module.exports = { module.exports = {
API: API API: API

Loading…
Cancel
Save