作者 朱振飞

新增

... ... @@ -4,8 +4,20 @@ App({
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
this.changeToken();
// 获取用户信息
},
changeToken() {
let url = '/api/user/codeToToken', t = this;
wx.login({
success: function (res) {
console.log(res)
t.post(url, { code: res.code }).then((r) => {
wx.setStorageSync('token', r.userInfo.token)
})
}
})
},
post: function (url, data, showLoad) {
/**
* 自定义post函数,返回Promise
... ...
... ... @@ -72,6 +72,18 @@ Page({
}) : ''
})
},
// 更新token
changeToken(){
let url = '/api/user/codeToToken',t = this;
wx.login({
success:function(res){
console.log(res)
app.post(url,{code:res.code}).then((r)=>{
wx.setStorageSync('token', r.userInfo.token)
})
}
})
},
getMore(){
let t = this;
!t.data.noMore?(t.setData({
... ... @@ -95,7 +107,7 @@ Page({
*/
onLoad: function(options) {
let a = this;
this.getTypes(), this.getAreas(), this.getCompanyList(), wx.getSystemInfo({
a.getTypes(), a.getAreas(), a.getCompanyList(), wx.getSystemInfo({
success: function (t) {
a.setData({
scrollHeight: t.windowHeight,
... ...
... ... @@ -5,9 +5,14 @@ Page({
* 页面的初始数据
*/
data: {
proData:{
company_id:'',
name:'',
mobile:'',
images:[]
},
companyName:''
},
/**
* 生命周期函数--监听页面加载
*/
... ...
... ... @@ -3,37 +3,13 @@
<view class="item_list">
<view class="list_title">公司名称</view>
<view class="list_content">
<input type="text" placeholder='输入公司名称' placeholder-class='pl_style' value="{{username?username:''}}" class="input_item" bindinput='userName'></input>
<view class='input_item'>{{'输入公司名称'}}</view>
</view>
</view>
<view class="item_list">
<view class="list_title">法人代表</view>
<view class="list_title">姓名</view>
<view class="list_content">
<input type="text" placeholder='输入公法人姓名' placeholder-class='pl_style' value="{{work}}" class="input_item" bindinput='work'></input>
</view>
</view>
<view class='item_list'>
<view class='list_title'>公司类型</view>
<view class='list_content'>
<input placeholder='输入公司类型' placeholder-class='pl_style' class='input_item'></input>
</view>
</view>
<view class="item_list">
<view class="list_title">注册号</view>
<view class="list_content">
<input type="text" placeholder='输入公司注册号' placeholder-class='pl_style' value="{{city}}" class="input_item" bindinput='city'></input>
</view>
</view>
<view class="item_list">
<view class="list_title">成立时间</view>
<view class="list_content">
<input type="text" placeholder='输入公司成立时间' placeholder-class='pl_style' value="{{mobile}}" class="input_item" bindinput='getPhone'></input>
</view>
</view>
<view class="item_list">
<view class="list_title">注册资本</view>
<view class="list_content">
<input type="text" placeholder='输入注册资本' placeholder-class='pl_style' value="{{city}}" class="input_item" bindinput='city'></input>
<input type="text" placeholder='请输入姓名' placeholder-class='pl_style' value="{{work}}" class="input_item" bindinput='work'></input>
</view>
</view>
<view class="item_list">
... ... @@ -43,11 +19,28 @@
</view>
</view>
<view class="item_list" style=' align-items: flex-start;'>
<view class="list_title">公司地址</view>
<view class="list_content">
<textarea placeholder='输入公司详细地址' placeholder-class='pl_style' value="{{honor}}" class="area_item" bindinput='honor'></textarea>
<view class="list_title">营业执照</view>
<view class="list_content" >
<view class='add_btn img_box' wx:for="{{proData.images}}" wx:key=''>
<image src='item' mode='widthFix'></image>
</view>
<view class='add_btn'>
<text>+</text>
</view>
</view>
</view>
</view>
<view class='bottom_btn' bindtap='btn_approve'>认证</view>
<!-- 公司搜索弹窗 -->
<view class='search_view'>
<view class='search-top'>
<input placeholder='请输入公司名称' type='search' class='input_item'></input>
<view class='cancle_action'>取消</view>
</view>
<view class='adress_list_container'>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -15,6 +15,7 @@
font-size: 32rpx;
color: #333;
margin-right: 26rpx;
text-align: center;
}
.pl_style {
... ... @@ -56,3 +57,49 @@
justify-content: center;
margin: 100rpx auto 0 auto;
}
.add_btn{
border: 2rpx solid rgb(236, 201, 201);
width: 160rpx;
height: 160rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 90rpx;
line-height: 1;
position: relative;
color: rgb(236, 201, 201);
}
.search_view{
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: #f5f5f5;
z-index: 15;
display: flex;
flex-flow: column;
box-sizing: border-box;
}
.search-top{
height: 80rpx;
width: 100%;
display: flex;
font-size: 26rpx;
padding: 20rpx;
background-color: #fff;
}
.input_item{
border: 1rpx solid #efefef;
flex: 1;
height: 100%;
border-radius: 10rpx;
padding-left: 10rpx;
}
.cancle_action{
width: 100rpx;
display: flex;
align-items: center;
color: #64A2E8;
justify-content: center;
}
\ No newline at end of file
... ...
... ... @@ -12,11 +12,11 @@
<text>{{userInfo.username}}</text>
</view>
</view>
<view wx:else >授权登录</view>
<view wx:else class='banner_label'>授权登录</view>
</view>
</view>
<!-- -->
<view class='content_box' wx:if='{{status}}'>
<view class='content_box' wx:if='{{userInfo.auth_status}}'>
<view class='item_list' bindtap='TB' bindtap="btn_post">
<view class='list_icon'>
<text class='iconfont icon-wodetiezi'></text>
... ...
... ... @@ -8,8 +8,6 @@ Page({
data: {
},
/**
* 生命周期函数--监听页面加载
*/
... ...
... ... @@ -22,6 +22,7 @@ Page({
code: res.code,
rawData: e.detail.rawData
};
console.log(params)
app.post(url,params).then((res)=>{
wx.setStorageSync('token', res.userInfo.token)
wx.showToast({
... ...
... ... @@ -37,7 +37,7 @@
"list": []
},
"miniprogram": {
"current": 25,
"current": 26,
"list": [
{
"id": 0,
... ... @@ -220,6 +220,12 @@
"pathName": "pages/my/myAttention/myAttention",
"query": "",
"scene": null
},
{
"id": -1,
"name": "企业认证",
"pathName": "pages/my/approve/approve",
"scene": null
}
]
}
... ...