Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsalesProgram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5aa398d9
authored
Aug 13, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://119.23.72.7/shiyu/icsalesProgram
parents
e5a4faef
e37d1e65
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
334 additions
and
29 deletions
app.js
pages/person/company/index.js
pages/person/company/index.wxml
pages/person/editcompany/index.js
pages/person/editcompany/index.less
pages/person/editcompany/index.wxml
pages/person/editcompany/index.wxss
pages/tab/me/me.js
pages/tab/me/me.wxml
project.config.json
app.js
View file @
5aa398d9
...
...
@@ -54,9 +54,9 @@ App({
if
(
this
.
globalData
.
auth
)
{
//是否登录
if
(
this
.
globalData
.
token
)
{
wx
.
switchTab
({
url
:
'/pages/tab/home/home'
});
//
wx.switchTab({
//
url: '/pages/tab/home/home'
//
});
}
else
{
wx
.
redirectTo
({
url
:
'/pages/person/login/index'
...
...
pages/person/company/index.js
View file @
5aa398d9
// pages/person/company/index.js
const
http
=
require
(
'../../../utils/util.js'
);
import
{
apis
}
from
'../../../utils/api.js'
;
Page
({
/**
* 页面的初始数据
*/
data
:
{
userInfo
:
{},
business
:{}
},
/**
...
...
@@ -27,6 +33,29 @@ Page({
*/
onShow
:
function
()
{
//获取数量统计
http
.
getData
(
apis
.
countBusiness
,
'GET'
,
{
token
:
wx
.
getStorageSync
(
'access_token'
)
},
(
res
)
=>
{
if
(
res
.
errcode
===
0
)
{
this
.
setData
({
business
:
res
.
data
});
}
},
true
);
//获取用户信息
http
.
getData
(
apis
.
userInfo
,
'GET'
,
{
token
:
wx
.
getStorageSync
(
'access_token'
)
},
(
res
)
=>
{
if
(
res
.
errcode
===
0
)
{
this
.
setData
({
userInfo
:
res
.
data
});
}
},
true
);
},
/**
...
...
@@ -62,5 +91,20 @@ Page({
*/
onShareAppMessage
:
function
()
{
},
/**
* 跳转地址
*/
toUrl
:
function
(
e
)
{
//普通跳转
if
(
e
.
currentTarget
.
dataset
.
url
)
{
wx
.
navigateTo
({
url
:
e
.
currentTarget
.
dataset
.
url
});
}
}
})
\ No newline at end of file
pages/person/company/index.wxml
View file @
5aa398d9
...
...
@@ -2,10 +2,10 @@
<view class="head boxsiz row verCenter bothSide">
<view class="row">
<view class="pic">
<cover-image class="im" src="
/res/images/imgs/test.jpg
"></cover-image>
<cover-image class="im" src="
{{userInfo.avatar}}
"></cover-image>
</view>
<view class="txt">
<text class="t1">
深圳市猎芯科技有限公司
</text>
<text class="t1">
{{userInfo.company_name}}
</text>
<view class="row">
<view class="company-txt">
<text class="icon iconfont iconiconxiantiaoshouji24"></text>
...
...
@@ -18,22 +18,22 @@
</view>
</view>
</view>
<view class="column">
<view class="column"
data-url="/pages/person/editcompany/index" bind:tap="toUrl"
>
<text class="icon iconfont iconiconxiantiaoshouji22"></text>
<text class="edit">编辑</text>
</view>
</view>
<view class="tab row rowCenter verCenter">
<view class="v">
<text class="t1">
513
</text>
<text class="t1">
{{business.goods}}
</text>
<text class="t2">商品</text>
</view>
<view class="v">
<text class="t1">
53
</text>
<text class="t1">
{{business.inquiry}}
</text>
<text class="t2">询价</text>
</view>
<view class="v">
<text class="t1">
2
</text>
<text class="t1">
{{business.offer}}
</text>
<text class="t2">报价</text>
</view>
</view>
...
...
@@ -52,12 +52,12 @@
</view>
<view class="text-introduced column">
<text class="tit">企业简介</text>
<text class="t1">
猎芯网是由深圳市猎芯科技有限公司开发运营的电子元器件交易服务平台,可为用户提供涵盖购买、报关、仓储、金融等整个交易环节的全闭环服务。 猎芯网于2015年7月上线,总部位于深圳,在北京、香港设有分公司,迄今已获得经纬中国、微光创投、华诺创投、京东、海通证券及文华海汇等多轮融资,及E络盟与Mouser贸泽电子等多家知名分销商授权; 猎芯网提供自营、联营、寄售、供应链金融等服务,并在深圳光明新区设有一万多平米的自营仓库,实现当天下单,当天发货,订单动态全透明,极大的提升了效率 ,降低了交易成本;同时与5500多家优质供应商合作,提供超过2000万的联营商品选择,极大地满足了广大用户的采购需求!
</text>
<text class="t1">
{{userInfo.com_desc}}
</text>
</view>
<view class="text-introduced column">
<text class="tit">公司地址</text>
<text class="t1">广东省深圳市龙岗区坂田街道五和大道南路2号万科星火Online天枢仓6栋3楼</text>
</view>
<view class="btn">联系电话:
15012479484
</view>
<view class="btn">联系电话:
{{userInfo.com_tel}}
</view>
</view>
</view>
\ No newline at end of file
pages/person/editcompany/index.js
View file @
5aa398d9
...
...
@@ -13,7 +13,12 @@ Page({
*/
data
:
{
status
:
true
,
imgSrc
:
''
avatar
:
''
,
multiArray
:
[],
multiIndex
:
[
4
,
0
,
0
],
province_id
:
6
,
city_id
:
76
,
district_id
:
696
},
/**
...
...
@@ -21,6 +26,61 @@ Page({
*/
onLoad
:
function
(
options
)
{
var
arr
=
[];
//设置默认省市区
http
.
getData
(
apis
.
regionPcd
,
'GET'
,
null
,
(
res
)
=>
{
if
(
res
.
errcode
===
0
)
{
let
province
=
[];
res
.
data
.
forEach
(
function
(
value
,
index
,
array
)
{
province
.
push
({
id
:
index
,
region_id
:
value
.
region_id
,
name
:
value
.
region_name
})
});
arr
.
push
(
province
);
http
.
getData
(
apis
.
regionPcd
,
'GET'
,
{
province_id
:
6
},
(
province
)
=>
{
let
city
=
[];
province
.
data
.
forEach
(
function
(
value
,
index
,
array
)
{
city
.
push
({
id
:
index
,
region_id
:
value
.
region_id
,
name
:
value
.
region_name
})
});
arr
.
push
(
city
);
http
.
getData
(
apis
.
regionPcd
,
'GET'
,
{
province_id
:
6
,
city_id
:
76
},
(
city
)
=>
{
let
area
=
[];
city
.
data
.
forEach
(
function
(
value
,
index
,
array
)
{
area
.
push
({
id
:
index
,
region_id
:
value
.
region_id
,
name
:
value
.
region_name
})
});
arr
.
push
(
area
);
this
.
setData
({
multiArray
:
arr
});
},
false
,
false
,
true
);
},
false
,
false
,
true
);
}
},
false
,
false
,
true
);
},
/**
...
...
@@ -79,7 +139,7 @@ Page({
chooseImg
(
apis
.
ossupload
,
1
,
(
res
)
=>
{
if
(
res
)
{
this
.
setData
({
imgSrc
:
res
,
avatar
:
res
,
status
:
false
});
}
...
...
@@ -90,15 +150,169 @@ Page({
*/
deleteImg
:
function
()
{
this
.
setData
({
imgSrc
:
''
,
avatar
:
''
,
status
:
true
})
},
/**
* 验证字段
*/
calcForm
:
function
(
val
)
{
let
detail_address
=
val
.
detail_address
;
let
mobile
=
val
.
mobile
;
return
true
;
},
/**
*
* 企业提交
*/
formSubmit
:
function
(
e
)
{
if
(
this
.
calcForm
(
e
.
detail
.
value
))
{
this
.
setData
({
disabled
:
true
,
loading
:
true
});
let
params
=
Object
.
assign
({},
e
.
detail
.
value
,
{
province_id
:
this
.
data
.
province_id
,
city_id
:
this
.
data
.
city_id
,
district_id
:
this
.
data
.
district_id
,
avatar
:
this
.
data
.
avatar
});
http
.
getData
(
apis
.
userAccount
,
'GET'
,
params
,
(
res
)
=>
{
if
(
res
.
errcode
===
0
)
{
wx
.
navigateTo
({
url
:
'/pages/person/company/index'
});
}
else
{
this
.
setData
({
disabled
:
false
,
loading
:
false
});
wx
.
showToast
({
title
:
res
.
errmsg
,
icon
:
'none'
,
duration
:
2000
});
}
},
false
,
false
,
true
);
}
},
bindMultiPickerChange
:
function
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
)
this
.
setData
({
multiIndex
:
e
.
detail
.
value
,
province_id
:
this
.
data
.
multiArray
[
0
][
e
.
detail
.
value
[
0
]].
region_id
,
city_id
:
this
.
data
.
multiArray
[
1
][
e
.
detail
.
value
[
1
]].
region_id
,
district_id
:
this
.
data
.
multiArray
[
2
][
e
.
detail
.
value
[
2
]].
region_id
})
},
bindMultiPickerColumnChange
:
function
(
e
)
{
console
.
log
(
'修改的列为'
,
e
.
detail
.
column
,
',值为'
,
e
.
detail
.
value
);
this
.
data
.
multiIndex
[
e
.
detail
.
column
]
=
e
.
detail
.
value
;
if
(
e
.
detail
.
column
===
0
)
{
this
.
setData
({
province_id
:
this
.
data
.
multiArray
[
e
.
detail
.
column
][
e
.
detail
.
value
].
region_id
,
})
//更新省
http
.
getData
(
apis
.
regionPcd
,
'GET'
,
{
province_id
:
this
.
data
.
multiArray
[
0
][
e
.
detail
.
value
].
region_id
},
(
res
)
=>
{
let
city
=
[];
let
arr
=
this
.
data
.
multiArray
;
res
.
data
.
forEach
(
function
(
value
,
index
,
array
)
{
city
.
push
({
id
:
index
,
region_id
:
value
.
region_id
,
name
:
value
.
region_name
})
});
arr
.
splice
(
1
,
1
,
city
);
this
.
setData
({
multiArray
:
arr
});
let
city_index
=
this
.
data
.
multiIndex
;
city_index
.
splice
(
1
,
1
,
0
);
this
.
setData
({
multiIndex
:
city_index
});
//更新市
http
.
getData
(
apis
.
regionPcd
,
'GET'
,
{
province_id
:
this
.
data
.
multiArray
[
0
][
e
.
detail
.
value
].
region_id
,
city_id
:
city
[
0
].
region_id
},
(
data
)
=>
{
let
area
=
[];
let
arrs
=
this
.
data
.
multiArray
;
data
.
data
.
forEach
(
function
(
values
,
indexs
,
arrays
)
{
area
.
push
({
id
:
indexs
,
region_id
:
values
.
region_id
,
name
:
values
.
region_name
})
});
arrs
.
splice
(
2
,
1
,
area
);
this
.
setData
({
multiArray
:
arrs
});
},
false
,
false
,
true
);
},
false
,
false
,
true
);
}
else
if
(
e
.
detail
.
column
===
1
)
{
this
.
setData
({
city_id
:
this
.
data
.
multiArray
[
e
.
detail
.
column
][
e
.
detail
.
value
].
region_id
})
//选择市
http
.
getData
(
apis
.
regionPcd
,
'GET'
,
{
province_id
:
this
.
data
.
province_id
,
city_id
:
this
.
data
.
city_id
},
(
res
)
=>
{
let
area
=
[];
let
arr
=
this
.
data
.
multiArray
;
res
.
data
.
forEach
(
function
(
value
,
index
,
array
)
{
area
.
push
({
id
:
index
,
region_id
:
value
.
region_id
,
name
:
value
.
region_name
})
});
arr
.
splice
(
2
,
1
,
area
);
this
.
setData
({
multiArray
:
arr
});
},
false
,
false
,
true
);
}
}
})
\ No newline at end of file
pages/person/editcompany/index.less
View file @
5aa398d9
...
...
@@ -56,6 +56,11 @@
width: 100%;
height: 310rpx !important;
}
.textarea-placeholder {
color: rgba(81, 85, 89, 0.5);
font-size: 28rpx;
}
}
.list {
...
...
pages/person/editcompany/index.wxml
View file @
5aa398d9
...
...
@@ -9,36 +9,42 @@
</block>
<block wx:else>
<view class="view column rowCenter verCenter">
<cover-image src="{{
imgSrc
}}" class="img"></cover-image>
<cover-image src="{{
avatar
}}" class="img"></cover-image>
<text class="icon iconfont iconiconxiantiaoshouji7" bind:tap="deleteImg"></text>
</view>
</block>
</view>
<view class="txt">
<textarea
bindblur="bindTextAreaBlur" auto-height placeholder="请输入企业简介" class="tarea
" />
<textarea
name='com_desc' bindblur="bindTextAreaBlur" auto-height placeholder="请输入企业简介" class="tarea" placeholder-class="textarea-placeholder
" />
</view>
<view class="hr"></view>
<view class="list row verCenter bothSide bor">
<view class="l">所有地区</view>
<view class="sel">
<text class="t1">请选择省/市/区</text>
<view class="sel row rowCenter verCenter">
<view>
<picker class="t1" mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}" range-key="name">
{{multiArray[0][multiIndex[0]].name}},{{multiArray[1][multiIndex[1]].name}},{{multiArray[2][multiIndex[2]].name}}
</picker>
</view>
<text class="icon iconfont iconChevron"></text>
</view>
</view>
<view class="list row verCenter bothSide bor">
<view class="l">详细地址</view>
<view class="r">
<input type="text" placeholder="请输入详细地址" placeholder-class="placeholderClass" />
<input type="text" placeholder="请输入详细地址" placeholder-class="placeholderClass"
name="detail_address"
/>
</view>
</view>
<view class="list row verCenter bothSide bor">
<view class="l">联系电话</view>
<view class="r">
<input type="text" placeholder="请输入联系电话" placeholder-class="placeholderClass" />
<input type="text" placeholder="请输入联系电话" placeholder-class="placeholderClass"
name="com_tel"
/>
</view>
</view>
<view class="btn-wrap">
<button class="btn">确认修改</button>
<button class="btn" form-type="submit" disabled="{{disabled}}" loading="{{loading}}">
确认修改
</button>
</view>
</form>
</view>
\ No newline at end of file
pages/person/editcompany/index.wxss
View file @
5aa398d9
...
...
@@ -47,6 +47,10 @@
width: 100%;
height: 310rpx !important;
}
.company .txt .textarea-placeholder {
color: rgba(81, 85, 89, 0.5);
font-size: 28rpx;
}
.company .list {
padding: 0 24rpx 0 0;
margin-left: 24rpx;
...
...
pages/tab/me/me.js
View file @
5aa398d9
...
...
@@ -109,20 +109,22 @@ Page({
//认证管理
if
(
e
.
currentTarget
.
dataset
.
type
==
'certification'
)
{
console
.
log
(
e
.
currentTarget
.
dataset
.
status
)
if
(
e
.
currentTarget
.
dataset
.
status
==
null
)
{
wx
.
navigateTo
({
url
:
"/pages/person/certification/addcertification/index"
});
}
else
{
wx
.
navigateTo
({
url
:
"/pages/person/certification/addcertification/index"
});
}
}
//普通跳转
if
(
e
.
currentTarget
.
dataset
.
url
)
{
...
...
@@ -134,23 +136,27 @@ Page({
},
sendCustomer
:
function
()
{
let
my
=
wx
.
getStorageSync
(
"myUsername"
);
let
companyName
=
wx
.
getStorageSync
(
"company_name"
);
let
userId
=
wx
.
getStorageSync
(
"user_id"
);
let
avatar
=
wx
.
getStorageSync
(
"avatar"
);
let
queryObj
=
{
myName
:
my
,
your
:
getApp
().
globalData
.
customerNum
,
name
:
getApp
().
globalData
.
customerName
,
name1
:
companyName
,
id
:
userId
,
touserid
:
''
,
touserid
:
''
,
title
:
getApp
().
globalData
.
customerName
,
img
:
''
,
img
:
''
,
img1
:
avatar
};
wx
.
navigateTo
({
url
:
"/pages/detail/chat/index?username="
+
JSON
.
stringify
(
queryObj
)
})
},
})
\ No newline at end of file
pages/tab/me/me.wxml
View file @
5aa398d9
...
...
@@ -38,7 +38,7 @@
<text class='t2'>金币提现兑换、领红包</text>
</view>
<view class="bar-list boxsiz">
<view class="boxsiz bar row bothSide verCenter">
<view class="boxsiz bar row bothSide verCenter"
data-url="/pages/person/company/index" bind:tap="toUrl"
>
<view>
<text class="icon iconfont iconiconcaiseshouye1"></text>
<text class="t1">个人主页</text>
...
...
project.config.json
View file @
5aa398d9
...
...
@@ -48,7 +48,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
2
0
,
"current"
:
2
3
,
"list"
:
[
{
"id"
:
-1
,
...
...
@@ -194,6 +194,27 @@
"id"
:
-1
,
"name"
:
"pages/person/register/index"
,
"pathName"
:
"pages/person/register/index"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/person/company/index"
,
"pathName"
:
"pages/person/company/index"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/person/editcompany/index"
,
"pathName"
:
"pages/person/editcompany/index"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/person/auth/index"
,
"pathName"
:
"pages/person/auth/index"
,
"scene"
:
null
}
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment