8 changed files with 270 additions and 1 deletions
Split View
Diff Options
-
2app.js
-
1app.json
-
5pages/home/info/index.js
-
4pages/home/info/index.wxml
-
137pages/home/tab6/index.js
-
3pages/home/tab6/index.json
-
40pages/home/tab6/index.wxml
-
79pages/home/tab6/index.wxss
@ -0,0 +1,137 @@ |
|||
// pages/home/tab6/index.js
|
|||
import { |
|||
updateUserInfo, |
|||
getBaseInfo |
|||
} from '../../api/ztb' |
|||
const storage = require('../../../utils/storage') |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
bidType: 0 |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.getUerInfoFct() |
|||
|
|||
}, |
|||
toMyInfo: function () { |
|||
wx.redirectTo({ |
|||
url: '/pages/index/index' |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
}, |
|||
backspace: function () { |
|||
console.log('点击返回被触发3') |
|||
wx.redirectTo({ |
|||
url: '/pages/home/tab2/index' |
|||
}) |
|||
|
|||
}, |
|||
onTabChangeTop: function (e) { |
|||
if (this.data.bidType == Number(e.currentTarget.dataset.index)) { |
|||
return |
|||
} |
|||
var tabIndex = Number(e.currentTarget.dataset.index) |
|||
this.data.firstCategoryId = '' |
|||
this.setData({ |
|||
['bidType']: tabIndex |
|||
}) |
|||
var model={ |
|||
experienceTag:'' |
|||
} |
|||
if (this.data.bidType == 1) { |
|||
model.shipmentPerMonth = '1000吨以下' |
|||
this.submitForm(model) |
|||
} |
|||
if (this.data.bidType == 2) { |
|||
model.shipmentPerMonth = '1000~2000吨' |
|||
this.submitForm(model) |
|||
} |
|||
if (this.data.bidType == 3) { |
|||
model.shipmentPerMonth = '2000吨以上' |
|||
this.submitForm(model) |
|||
} |
|||
}, |
|||
submitForm: function (model) { |
|||
console.log(model) |
|||
updateUserInfo(model).then(result => { |
|||
setTimeout(() => this.toMyInfo(), 1000) |
|||
}).catch(err => { |
|||
this.data.loopRequesting = false |
|||
}) |
|||
}, |
|||
getUerInfoFct: function () { |
|||
getBaseInfo().then(res => { |
|||
if (res.data.shipmentPerMonth == '1000吨以下') { |
|||
this.setData({ |
|||
bidType: 1 |
|||
}) |
|||
|
|||
} else if (res.data.shipmentPerMonth == '1000~2000吨') { |
|||
this.setData({ |
|||
bidType: 2 |
|||
}) |
|||
|
|||
} else if (res.data.shipmentPerMonth == '2000吨以上') { |
|||
this.setData({ |
|||
bidType: 3 |
|||
}) |
|||
|
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
"usingComponents": {} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
<!--pages/home/tab6/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">经验</view> |
|||
</cu-custom> |
|||
|
|||
<view class="bj"> |
|||
<view style="width:100%;height:130rpx;padding-top:10rpx;padding-right:10rpx"> |
|||
<button class="cu-btn bg-red round shadow-blur vip-btn" bindtap="toMyInfo">暂时不填</button> |
|||
</view> |
|||
<view class="top"> |
|||
<view class="topText"> |
|||
<text>HI,\n欢迎使用纸通宝\n开启一站式废纸交易</text> |
|||
</view> |
|||
<view style="width:310rpx;height:258rpx;float:right"> |
|||
<image src="/assets/image/tabBj.png" style="width:310rpx;height:258rpx"></image> |
|||
</view> |
|||
</view> |
|||
<view class="mid"> |
|||
<text>你的月出货量大约是?</text> |
|||
</view> |
|||
<view class="bottom"> |
|||
<view class="btson1" style="color:{{bidType == 1 ? '#008AFF' : '#333'}};border-color:{{bidType == 1 ? '#008AFF' : '#D8D8D8'}};" data-index="1" bindtap="onTabChangeTop"> |
|||
<view style="width:162rpx;height:50rpx;padding-left:20rpx;float:right"> |
|||
<text>1000吨以下</text> |
|||
</view> |
|||
</view> |
|||
<view class="btson2" style="color:{{bidType == 2 ? '#008AFF' : '#333'}};border-color:{{bidType == 2 ? '#008AFF' : '#D8D8D8'}};" data-index="2" bindtap="onTabChangeTop"> |
|||
<view style="width:183rpx;height:50rpx;background: #FFFFFF;"> |
|||
<view style="width:162rpx;height:50rpx;padding-left:20rpx;float:right"> |
|||
<text>1000~2000吨</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="btson3" style="color:{{bidType == 3 ? '#008AFF' : '#333'}};border-color:{{bidType == 3 ? '#008AFF' : '#D8D8D8'}};" data-index="3" bindtap="onTabChangeTop"> |
|||
<view style="width:162rpx;height:50rpx;padding-left:20rpx;float:right"> |
|||
<text>2000吨以上</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
@ -0,0 +1,79 @@ |
|||
/* pages/home/tab6/index.wxss */ |
|||
.bj { |
|||
background-color: white; |
|||
min-height: 900rpx; |
|||
} |
|||
|
|||
.vip-btn { |
|||
/* height: 90rpx; */ |
|||
width: 180rpx; |
|||
background: #F5F5F5; |
|||
float: right; |
|||
color: rgba(0, 0, 0, 0.45); |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.top { |
|||
height: 258rpx; |
|||
width: 100%; |
|||
} |
|||
|
|||
.topText { |
|||
width: 440rpx; |
|||
height: 258rpx; |
|||
float: left; |
|||
padding-left: 48rpx; |
|||
padding-top: 60rpx; |
|||
font-size: 44rpx; |
|||
color: #000000; |
|||
font-family: PingFangSC-Medium; |
|||
} |
|||
|
|||
.mid { |
|||
height: 150rpx; |
|||
padding-top: 100rpx; |
|||
padding-left: 48rpx; |
|||
font-family: PingFangSC-Medium; |
|||
font-size: 36rpx; |
|||
color: #000000; |
|||
letter-spacing: 2px; |
|||
} |
|||
|
|||
.bottom { |
|||
height: 410rpx; |
|||
padding: 48rpx; |
|||
} |
|||
|
|||
.btson1 { |
|||
height: 147rpx; |
|||
width: 315rpx; |
|||
float: left; |
|||
overflow: hidden; |
|||
border: 3rpx solid #D8D8D8; |
|||
border-radius: 10rpx; |
|||
border-radius: 10rpx; |
|||
padding: 22px 35px 22px 35px; |
|||
} |
|||
|
|||
.btson2 { |
|||
height: 147rpx; |
|||
width: 315rpx; |
|||
float: right; |
|||
overflow: hidden; |
|||
border: 3rpx solid #D8D8D8; |
|||
border-radius: 10rpx; |
|||
border-radius: 10rpx; |
|||
padding: 22px 35px 22px 35px; |
|||
} |
|||
|
|||
.btson3 { |
|||
height: 147rpx; |
|||
width: 315rpx; |
|||
float: left; |
|||
margin-top: 20rpx; |
|||
overflow: hidden; |
|||
border: 3rpx solid #D8D8D8; |
|||
border-radius: 10rpx; |
|||
border-radius: 10rpx; |
|||
padding: 22px 35px 22px 35px; |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save