Commit 85367f37 by 施宇

1

parent 10a2e649
...@@ -42,10 +42,7 @@ App({ ...@@ -42,10 +42,7 @@ App({
addChatMemberStorage: function(id) { addChatMemberStorage: function(id) {
let member = wx.getStorageSync("member") || []; let member = wx.getStorageSync("member") || [];
member.push(id); member.push(id);
wx.setStorage({ wx.setStorageSync("member", member)
key: "member",
data: member
});
}, },
onLaunch() { onLaunch() {
wx.removeStorageSync('im'); wx.removeStorageSync('im');
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
"pages/person/invitation/index", "pages/person/invitation/index",
"pages/person/invitationrecord/index", "pages/person/invitationrecord/index",
"pages/form/report/index", "pages/form/report/index",
"pages/list/notice/index" "pages/list/notice/index",
"pages/person/notice/index"
], ],
"subPackages": [ "subPackages": [
{ {
......
...@@ -136,7 +136,7 @@ Component({ ...@@ -136,7 +136,7 @@ Component({
let avatar = wx.getStorageSync('avatar'); let avatar = wx.getStorageSync('avatar');
let touserid = this.data.username.id == userId ? this.data.username.touserid : this.data.username.id; let touserid = this.data.username.id == userId ? this.data.username.touserid : this.data.username.id;
let members = wx.getStorageSync('member') || ''; let members = wx.getStorageSync('member') || '';
let index = members.indexOf(me.data.username); let index = members.indexOf(me.data.username.your);
let params = Object.assign({}, me.data.template, { let params = Object.assign({}, me.data.template, {
id: userId, id: userId,
name: companyName, name: companyName,
......
...@@ -18,6 +18,9 @@ Component({ ...@@ -18,6 +18,9 @@ Component({
}, },
xb: { xb: {
type: Number // 询报价类型 1询价 2报价 type: Number // 询报价类型 1询价 2报价
},
isClick:{//是否可以点击
type:String
} }
}, },
...@@ -39,6 +42,10 @@ Component({ ...@@ -39,6 +42,10 @@ Component({
let xb = e.currentTarget.dataset.xb; let xb = e.currentTarget.dataset.xb;
let type = e.currentTarget.dataset.type; //1代表询价 2代表报价 3代表商品 let type = e.currentTarget.dataset.type; //1代表询价 2代表报价 3代表商品
let priceType = e.currentTarget.dataset.pricetype; let priceType = e.currentTarget.dataset.pricetype;
let isClick = e.currentTarget.dataset.isclick;
if(isClick==='0'){
return;
}
if (judgeToken(true)) { if (judgeToken(true)) {
if (priceType == 1) { if (priceType == 1) {
if (type == 1) { if (type == 1) {
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</block> </block>
<!-- 搜索页面询报价展示 --> <!-- 搜索页面询报价展示 -->
<block wx:if="{{priceType==3}}"> <block wx:if="{{priceType==3}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent" data-inquiryitemsid="{{item['inquiry_items_id']}}" data-offerid="{{item['offer_id']}} " data-type="{{xb}}" data-pricetype="3"> <view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent" data-inquiryitemsid="{{item['inquiry_items_id']}}" data-offerid="{{item['offer_id']}} " data-type="{{xb}}" data-pricetype="3" data-isclick="{{isClick}}">
<view class="item-header px-hr-bottom row verCenter bothSide nowrap"> <view class="item-header px-hr-bottom row verCenter bothSide nowrap">
<view class="row verCenter"> <view class="row verCenter">
<text class="mark xun" wx:if="{{xb==1}}">询价</text> <text class="mark xun" wx:if="{{xb==1}}">询价</text>
......
...@@ -26,7 +26,7 @@ Page({ ...@@ -26,7 +26,7 @@ Page({
title: username.title title: username.title
}); });
} }
if (wx.getStorageSync('im')) { if (getApp().globalData.imBoolean) {
reloginIm() reloginIm()
} }
......
// pages/detail/company/index.js // pages/detail/company/index.js
import {
getData,
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tabIndex:1 tabIndex: 1,
type: "",
userId: "",
token: "",
userInfo: null,
limit: 10, //每页的条数
p: 1, //当前页面
total: 1,
priceList: null,
priceType: "",
xb: 1, //1表示询价 2表示报价
isShowBottom: false,
isShowData: true,
isClick: ""
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function(options) {
let me = this;
let type = options.type; //1 看自己 2看别人
let userId = options.userId || ''; //别人的id
let token = wx.getStorageSync('access_token') || '';
this.setData({
type: type,
token: token,
userId: userId
});
if (type == 1) {
this.getInfo();
this.setData({
priceType: 5
})
this.getListData(false, true);
} else {
this.setData({
priceType: 2
});
this.getInfo();
};
getApp().globalData.bus.off('addFirstBj');
getApp().globalData.bus.on('addFirstBj', (id) => {
let index = me.data.priceList.findIndex((value, index, arr) => {
return value.inquiry_items_id == id
});
if (index !== -1) {
me.data.priceList[index].offer_num += 1;
me.setData({
priceList: me.data.priceList
})
}
});
getApp().globalData.bus.off('editGoodSuccess');
getApp().globalData.bus.on('editGoodSuccess', (params) => {
let index = me.data.priceList.findIndex((value, index, arr) => {
return value.goods_id == params.goods_id
});
if (index !== -1) {
me.data.priceList[index] = params;
me.setData({
priceList: me.data.priceList
})
}
})
}, },
//获取用户信息
getInfo: function() {
let me = this;
let params = {
token: this.data.token
}
if (this.data.type == 2) {
params.user_id = this.data.userId
}
getData(apis.userInfo, 'GET', params, (res) => {
if (res.errcode === 0) {
me.setData({
userInfo: res.data
});
if (me.data.type == 2) {
if (res.data.goods_show == 1) {
me.getListData(false, true)
} else {
me.getListData(false, false)
}
}
} else {
me.setData({
userInfo: {}
});
if (me.data.type == 2) {
me.getListData(false, false)
}
}
}, true);
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function() {
let allPage = Math.ceil(this.data.total / this.data.limit);
let p = this.data.p;
if (p == allPage) {
this.setData({
isShowBottom: true
});
return
} else {
this.setData({
p: p + 1
});
console.log(this.data.p)
this.getListData(true, true);
}
}, },
switchTab: function (e) { switchTab: function(e) {
let i = e.currentTarget.dataset.index; let i = e.currentTarget.dataset.index;
let priceType = "";
let xb = "";
if (i == this.data.tabIndex) { if (i == this.data.tabIndex) {
return return
} else { } else {
this.setData({ this.setData({
priceList: null,
p: 1,
total: 1,
tabIndex: i, tabIndex: i,
}) isShowBottom: false
});
if (this.data.type == 2) {
if (i == 1) {
priceType = 2;
this.setData({
priceType: priceType
})
if (this.data.userInfo.goods_show == 1) {
this.getListData(true, true)
} else {
this.getListData(false, false)
}
} else if (i == 2) {
priceType = 3;
xb = 1;
this.setData({
priceType: priceType,
xb: xb,
isClick: ""
})
if (this.data.userInfo.enquiry_show == 1) {
this.getListData(true, true)
} else {
this.getListData(false, false)
}
} else {
priceType = 3;
xb = 2;
this.setData({
priceType: priceType,
xb: xb,
isClick: '0'
})
if (this.data.userInfo.offer_show == 1) {
this.getListData(true, true)
} else {
this.getListData(false, false)
}
}
} else {
if (i == 1) {
priceType = 5
} else {
priceType = 1;
if (i == 2) {
xb = 1
} else {
xb = 2
}
}
this.setData({
priceType: priceType,
xb: xb
})
this.getListData(true, true)
}
} }
}, },
getListData: function(isLoading, isAjax) {
if (!isAjax) {
this.setData({
priceList: [],
isShowData: false
});
return
}
let me = this;
let url;
let str = "";
let type = this.data.type;
let params = {
offset: me.data.limit,
p: me.data.p,
};
if (me.data.tabIndex == 1) {
if (type == 1) {
url = apis.goodsInfo; //查看自己的商品
params.token = me.data.token
} else if (type == 2) {
url = apis.goodsSearch //查看别人的商品
params['user_id/eq'] = me.data.userId
}
str = "goods_list"
} else if (me.data.tabIndex == 2) {
if (type == 1) {
url = apis.inquiryInfo; //查看自己的询价
params.token = me.data.token
} else if (type == 2) {
url = apis.inquirySearch; //查看别人的询价
params['user_id/eq'] = me.data.userId
}
str = "inquiry_list"
} else {
if (type == 1) {
url = apis.offerinfo; //查看自己的报价
console.log(url)
params.token = me.data.token
} else if (type == 2) {
url = apis.offersearch; //查看别人的报价
params['user_id/eq'] = me.data.userId
}
}
getData(url, 'get', params, function(res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
newArr = me.data.priceList;
}
if (me.data.tabIndex != 3) {
for (let key in res[str]) {
newArr.push(res[str][key])
}
} else {
newArr = newArr.concat(res.data);
};
me.setData({
priceList: newArr,
total: res.total,
});
} else {
if (me.data.p == 1) {
me.setData({
priceList: []
})
}
}
}, true)
}
}) })
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {
"priceItem": "/components/priceItem/priceItem"},
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
\ No newline at end of file
<!--pages/detail/company/index.wxml--> <!--pages/detail/company/index.wxml-->
<view class="company-view"> <view class="company-view">
<view class="company-head row verCenter"> <view class="company-head row verCenter">
<image src="/res/images/imgs/test.jpg" class="company-img"></image> <view class="img-view">
<image src="{{userInfo.avatar||'/res/images/imgs/heads.png'}}" class="company-img"></image>
</view>
<view class="text"> <view class="text">
<view class="h3 bold">深圳市猎芯科技有限公司</view> <view class="h3 bold">{{userInfo.company_name||'--'}}</view>
<view class="rz row"> <view class="rz row">
<view class="yes"> <view class="yes" wx:if="{{userInfo.auth_type!=''&&userInfo.auth_type!=undefined }}">
<text class="icon iconfont iconiconxiantiaoshouji11"></text> <text class="icon iconfont iconiconxiantiaoshouji11"></text>
<text>未认证</text> <text>
<block wx:if="{{userInfo.auth_type==0}}">未认证</block>
<block wx:elif="{{userInfo.auth_type==1}}">个人认证</block>
<block wx:elif="{{userInfo.auth_type==2}}">企业认证</block>
</text>
</view> </view>
<view class="yes"> <view class="yes" wx:if="{{userInfo.company_type!=''&&userInfo.company_type!=undefined}}">
<text class="icon iconfont iconiconxiantiaoshouji11"></text> <text class="icon iconfont iconiconxiantiaoshouji11"></text>
<text>未认证</text> <text>
<block wx:if="{{userInfo.company_type==1}}">贸易商</block>
<block wx:elif="{{userInfo.company_type==2}}">代理商</block>
<block wx:elif="{{userInfo.company_type==3}}">原厂</block>
<block wx:elif="{{userInfo.company_type==4}}">制造商</block>
<block wx:elif="{{userInfo.company_type==5}}">个人用户</block>
</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -31,10 +43,18 @@ ...@@ -31,10 +43,18 @@
</view> </view>
</view> </view>
<view class="company-content"> <view class="company-content">
<view class="nodata"> <view wx:if="{{priceList&&priceList.length==0}}" class="nodata">
<image src="/res/images/imgs/noxb.png" class="img"></image> <image src="/res/images/imgs/noxb.png" class="img"></image>
<view class="h3 bold">当前信息不展示</view> <view class="h3 bold">
<text wx:if="{{isShowData}}">暂无数据</text>
<text wx:else="{{isShowData}}">当前信息不展示</text>
</view>
</view>
<priceItem price-list="{{priceList}}" wx:if="{{priceList&&priceList.length!==0}}" price-type="{{priceType}}" xb="{{xb}}" is-click="{{isClick}}"></priceItem>
<view class="data-bottom row verCenter rowCenter" wx:if="{{isShowBottom}}">
<text class="line"></text>
<text class="text">我是有底线的</text>
<text class="line"></text>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
/* pages/detail/company/index.wxss */ /* pages/detail/company/index.wxss */
.company-view { .company-view {
box-sizing: border-box;
padding-top: 298rpx;
} }
.company-head { .company-head {
padding: 40rpx 24rpx; padding: 40rpx 24rpx;
border-bottom: 10rpx solid #f5f9fc; border-bottom: 10rpx solid #f5f9fc;
height: 210rpx;
box-sizing: border-box;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 2;
background-color: #fff;
}
.company-view .switch-tab-com {
position: fixed;
top: 210rpx;
left: 0;
right: 0;
background-color: #fff;
z-index: 2;
}
.img-view {
height: 120rpx;
width: 120rpx;
border-radius: 50%;
background: #e6ecf2;
} }
.company-img { .company-img {
......
...@@ -173,6 +173,18 @@ Page({ ...@@ -173,6 +173,18 @@ Page({
onReachBottom: function() { onReachBottom: function() {
}, },
companyHome:function(){//跳转到公司首页
let userId = wx.getStorageSync("user_id");
if (this.data.info.user_id == userId){
wx.navigateTo({
url: "/pages/person/company/index?type=1"
})
}else{
wx.navigateTo({
url: "/pages/person/company/index?type=2&userId=" + this.data.info.user_id
})
}
},
onShareAppMessage: function(res) { onShareAppMessage: function(res) {
let me = this; let me = this;
wx.reportAnalytics('share_good', { wx.reportAnalytics('share_good', {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="company row verCenter"> <view class="company row verCenter">
<text class="name bold">{{info.company_name||'--'}}</text> <text class="name bold">{{info.company_name||'--'}}</text>
</view> </view>
<text class="icon iconfont iconiconxiantiaoshouji6"></text> <text class="icon iconfont iconiconxiantiaoshouji6" bindtap="companyHome"></text>
</view> </view>
<view class="bottom row"> <view class="bottom row">
<view class="yes" wx:if="{{info.auth_type!=''}}"> <view class="yes" wx:if="{{info.auth_type!=''}}">
......
...@@ -32,7 +32,7 @@ Page({ ...@@ -32,7 +32,7 @@ Page({
}); });
console.log(me.data.topInfo) console.log(me.data.topInfo)
me.getData(inquiryItemsId, offerId,token) me.getData(inquiryItemsId, offerId,token)
} else if (res.errcode == 105001) { } else {
me.setData({ me.setData({
topInfo: "" topInfo: ""
}) })
...@@ -64,6 +64,18 @@ Page({ ...@@ -64,6 +64,18 @@ Page({
} }
}, false) }, false)
}, },
companyHome: function () {//跳转到公司首页
let userId = wx.getStorageSync("user_id");
if (this.data.info.user_id == userId) {
wx.navigateTo({
url: "/pages/person/company/index?type=1"
})
} else {
wx.navigateTo({
url: "/pages/person/company/index?type=2&userId=" + this.data.info.user_id
})
}
},
sendTemplate:function(){ sendTemplate:function(){
let data = this.data.info; let data = this.data.info;
let my = wx.getStorageSync("myUsername"); let my = wx.getStorageSync("myUsername");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<text class="bao">报价</text> <text class="bao">报价</text>
<text class="name bold">{{info.company_name||'--'}}</text> <text class="name bold">{{info.company_name||'--'}}</text>
</view> </view>
<text class="icon iconfont iconiconxiantiaoshouji6"></text> <text class="icon iconfont iconiconxiantiaoshouji6" bindtap="companyHome"></text>
</view> </view>
<view class="bottom row"> <view class="bottom row">
......
...@@ -12,12 +12,20 @@ Page({ ...@@ -12,12 +12,20 @@ Page({
p: 1,//当前页面 p: 1,//当前页面
total: 0, total: 0,
isShowBottom: false, isShowBottom: false,
type:"",
userId:""
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let type = options.type; //1自己 2他人
let userId = options.userId; //查看时别人评价的id
this.setData({
type: type,
userId: userId
});
this.getData(); this.getData();
}, },
...@@ -77,8 +85,18 @@ Page({ ...@@ -77,8 +85,18 @@ Page({
getData: function () { getData: function () {
let me = this; let me = this;
let token = wx.getStorageSync('access_token'); let token = wx.getStorageSync('access_token');
getData(apis.evaluateList, 'get', { let url="";
limit: me.data.limit, page: me.data.p, token: token, received:'1' let params = {
token:token
};
if(this.data.type==1){
url = apis.evaluateList
}else if(this.data.type==2){
url = apis.evaluateUserList;
params.user_id = this.data.userId
}
getData(url, 'get', {
limit: me.data.limit, page: me.data.p, received:'1',...params
}, function (res) { }, function (res) {
if (res.errcode === 0) { if (res.errcode === 0) {
let newArr = []; let newArr = [];
......
...@@ -202,6 +202,18 @@ Page({ ...@@ -202,6 +202,18 @@ Page({
onPullDownRefresh: function() { onPullDownRefresh: function() {
}, },
companyHome: function () {//跳转到公司首页
let userId = wx.getStorageSync("user_id");
if (this.data.topInfo.user_id == userId) {
wx.navigateTo({
url: "/pages/person/company/index?type=1"
})
} else {
wx.navigateTo({
url: "/pages/person/company/index?type=2&userId=" + this.data.topInfo.user_id
})
}
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<text class="xun">询价</text> <text class="xun">询价</text>
<text class="name bold">{{topInfo.company_name||'--'}}</text> <text class="name bold">{{topInfo.company_name||'--'}}</text>
</view> </view>
<text class="icon iconfont iconiconxiantiaoshouji6"></text> <text class="icon iconfont iconiconxiantiaoshouji6" bindtap="companyHome"></text>
</view> </view>
</view> </view>
<template is="info" data="{{ topInfo }}" /> <template is="info" data="{{ topInfo }}" />
......
.company .head {
padding: 0 24rpx;
flex-wrap: nowrap;
}
.company .head .pic {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.company .head .pic .im {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.company .head .txt {
margin-left: 24rpx;
}
.company .head .txt .t1 {
font-weight: 600;
font-size: 36rpx;
line-height: 50rpx;
margin-bottom: 16rpx;
display: block;
}
.company .head .txt .company-txt {
margin-right: 48rpx;
}
.company .head .txt .company-txt .iconiconxiantiaoshouji24 {
font-size: 30rpx;
color: #61A0F2;
}
.company .head .txt .company-txt .company-txt-t1 {
font-size: 26rpx;
color: #8A9299;
margin-left: 5rpx;
}
.company .head .iconiconxiantiaoshouji22 {
font-size: 40rpx;
color: #0D84D1;
margin-bottom: 13rpx;
}
.company .head .edit {
color: #0D84D1;
font-size: 22rpx;
font-weight: 400;
}
.company .tab {
margin: 38rpx 0 24rpx 0;
}
.company .tab .v {
flex: 1;
text-align: center;
}
.company .tab .v .t1 {
font-size: 32rpx;
font-weight: 600;
line-height: 45rpx;
color: #515559;
display: block;
}
.company .tab .v .t2 {
font-size: 24rpx;
font-weight: 400;
line-height: 33rpx;
color: #8A9299;
}
.company .evaluation {
padding: 0 24rpx;
height: 100rpx;
}
.company .evaluation .iconiconxiantiaoshouji23 {
font-size: 40rpx;
color: #EA1717;
}
.company .evaluation .t1 {
font-size: 28rpx;
line-height: 46rpx;
color: #515559;
margin-left: 20rpx;
}
.company .evaluation .iconChevron {
font-size: 27rpx;
color: #ADB6BF;
}
.company .txt-wrap {
margin: 24rpx 0 0 0;
padding: 0 24rpx 40rpx 24rpx;
}
.company .txt-wrap .pic {
width: 702rpx;
height: 410rpx;
margin-bottom: 32rpx;
}
.company .txt-wrap .pic .im {
width: 702rpx;
height: 410rpx;
border-radius: 8rpx;
}
.company .txt-wrap .text-introduced {
padding: 0 27rpx 40rpx 27rpx;
}
.company .txt-wrap .text-introduced .tit {
font-size: 26rpx;
color: #515559;
margin-bottom: 24rpx;
font-weight: 600;
line-height: 37rpx;
}
.company .txt-wrap .text-introduced .t1 {
font-size: 26rpx;
line-height: 40rpx;
font-weight: 400;
color: #8A9299;
text-align: justify;
}
.company .txt-wrap .btn {
padding: 0 27rpx;
height: 98rpx;
line-height: 98rpx;
text-align: center;
background: #0d84d1;
box-shadow: 0px 6px 10px 0px rgba(97, 160, 242, 0.3);
border-radius: 8rpx;
font-size: 32rpx;
color: #FFFFFF;
}
...@@ -10,17 +10,79 @@ Page({ ...@@ -10,17 +10,79 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
userInfo: {}, userInfo: null,
business:{} business: null,
type: "",
token: "",
userId: ""
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let type = options.type; //1编辑 2查看
let userId = options.userId||''; //查看时别人公司的id
let token = wx.getStorageSync('access_token') || '';
let me = this;
this.setData({
type: type,
token: token,
userId: userId
});
this.getNum();
this.getInfo();
getApp().globalData.bus.off('editCompany');
getApp().globalData.bus.on('editCompany', () => {
me.getInfo();
});
},
//获取数量统计
getNum: function () {
let me = this;
let url;
let params = {
token: this.data.token
};
if (this.data.type == 1) {
url = apis.countBusiness
} else if (this.data.type == 2) {
url = apis.countUserBusiness;
params.user_id = this.data.userId
}
http.getData(url, 'GET', params, (res) => {
if (res.errcode === 0) {
me.setData({
business: res.data
});
} else {
me.setData({
business: {}
})
}
}, true);
},
//获取用户信息
getInfo: function () {
let me = this;
let params = {
token: this.data.token
}
if (this.data.type == 2) {
params.user_id = this.data.userId
}
http.getData(apis.userInfo, 'GET', params, (res) => {
if (res.errcode === 0) {
me.setData({
userInfo: res.data
});
} else {
me.setData({
userInfo: {}
})
}
}, true);
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -33,29 +95,8 @@ Page({ ...@@ -33,29 +95,8 @@ Page({
*/ */
onShow: function () { 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);
}, },
/** /**
...@@ -100,9 +141,21 @@ Page({ ...@@ -100,9 +141,21 @@ Page({
} }
}, },
toRateList:function(){ toRateList: function () {
wx.navigateTo({
url: '/pages/list/rate/index?type=' + this.data.type + '&userId=' + this.data.userId
});
},
toCompanyData: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/list/rate/index' url: '/pages/detail/company/index?type=' + this.data.type + '&userId=' + this.data.userId
}); });
},
toCall: function (e) {
let phone = e.currentTarget.dataset.phone;
wx.makePhoneCall({
phoneNumber: phone
})
} }
}) })
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
.pic { .pic {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
border-radius: 50%;
.im { .im {
width: 120rpx; width: 120rpx;
......
<view class="company" hover-class="none" hover-stop-propagation="false"> <view class="company" hover-class="none" hover-stop-propagation="false">
<view class="head boxsiz row verCenter bothSide"> <view class="head boxsiz row verCenter bothSide">
<view class="row">
<view class="pic">
<cover-image class="im" src="{{userInfo.avatar||'/res/images/imgs/heads.png'}}"></cover-image>
</view>
<view class="txt">
<text class="t1">{{userInfo.company_name||'--'}}</text>
<view class="row"> <view class="row">
<view class="pic"> <view class="company-txt" wx:if="{{userInfo.auth_type!=''&&userInfo.auth_type!=undefined }}">
<cover-image class="im" src="{{userInfo.avatar}}"></cover-image> <text class="icon iconfont iconiconxiantiaoshouji24"></text>
</view> <text class="user-mark">
<view class="txt"> <block wx:if="{{userInfo.auth_type==0}}">未认证</block>
<text class="t1">{{userInfo.company_name}}</text> <block wx:elif="{{userInfo.auth_type==1}}">个人认证</block>
<view class="row"> <block wx:elif="{{userInfo.auth_type==2}}">企业认证</block>
<view class="company-txt"> </text>
<text class="icon iconfont iconiconxiantiaoshouji24"></text> </view>
<text class="company-txt-t1">公司认证</text> <view class="company-txt" wx:if="{{userInfo.company_type!=''&&userInfo.company_type!=undefined}}">
</view> <text class="icon iconfont iconiconxiantiaoshouji24"></text>
<view class="company-txt"> <text class="user-mark">
<text class="icon iconfont iconiconxiantiaoshouji24"></text> <block wx:if="{{userInfo.company_type==1}}">贸易商</block>
<text class="company-txt-t1">贸易商</text> <block wx:elif="{{userInfo.company_type==2}}">代理商</block>
</view> <block wx:elif="{{userInfo.company_type==3}}">原厂</block>
</view> <block wx:elif="{{userInfo.company_type==4}}">制造商</block>
</view> <block wx:elif="{{userInfo.company_type==5}}">个人用户</block>
</view> </text>
<view class="column" data-url="/pages/person/editcompany/index?type=edit" bind:tap="toUrl"> </view>
<text class="icon iconfont iconiconxiantiaoshouji22"></text>
<text class="edit">编辑</text>
</view> </view>
</view>
</view> </view>
<view class="tab row rowCenter verCenter"> <view class="column" data-url="/pages/person/editcompany/index" bind:tap="toUrl" wx:if="{{type==1}}">
<view class="v"> <text class="icon iconfont iconiconxiantiaoshouji22"></text>
<text class="t1">{{business.goods}}</text> <text class="edit">编辑</text>
<text class="t2">商品</text>
</view>
<view class="v">
<text class="t1">{{business.inquiry}}</text>
<text class="t2">询价</text>
</view>
<view class="v">
<text class="t1">{{business.offer}}</text>
<text class="t2">报价</text>
</view>
</view> </view>
<view class="evaluation boxsiz row verCenter bothSide" bindtap="toRateList"> </view>
<view> <view class="tab row rowCenter verCenter" bindtap="toCompanyData">
<text class="icon iconfont iconiconxiantiaoshouji23"></text> <view class="v">
<text class="t1">收到的评价</text> <text class="t1">{{business.goods}}</text>
</view> <text class="t2">商品</text>
<view>
<text class="icon iconfont iconChevron"></text>
</view>
</view> </view>
<view class="txt-wrap boxsiz "> <view class="v">
<view class="pic"> <text class="t1">{{business.inquiry}}</text>
<cover-image class="im" src="/res/images/imgs/test.jpg"></cover-image> <text class="t2">询价</text>
</view> </view>
<view class="text-introduced column"> <view class="v">
<text class="tit">企业简介</text> <text class="t1">{{business.offer}}</text>
<text class="t1">{{userInfo.com_desc}}</text> <text class="t2">报价</text>
</view> </view>
<view class="text-introduced column"> </view>
<text class="tit">公司地址</text> <view class="evaluation boxsiz row verCenter bothSide" bindtap="toRateList">
<text class="t1">广东省深圳市龙岗区坂田街道五和大道南路2号万科星火Online天枢仓6栋3楼</text> <view>
</view> <text class="icon iconfont iconiconxiantiaoshouji23"></text>
<view class="btn">联系电话:{{userInfo.com_tel}}</view> <text class="t1">收到的评价</text>
</view>
<view>
<text class="icon iconfont iconChevron"></text>
</view>
</view>
<view class="txt-wrap boxsiz ">
<view class="pic" wx:if="{{userInfo.com_pic}}">
<cover-image class="im" src="{{userInfo.com_pic}}"></cover-image>
</view>
<view class="text-introduced column" wx:if="{{userInfo.com_desc}}">
<text class="tit">企业简介</text>
<text class="t1">{{userInfo.com_desc}}</text>
</view>
<view class="text-introduced column" wx:if="{{userInfo.complete_address}}">
<text class="tit">公司地址</text>
<text class="t1">{{userInfo.complete_address}}</text>
</view> </view>
<view class="btn" wx:if="{{userInfo.com_tel}}" bindtap="toCall" data-phone="{{userInfo.com_tel}}">联系电话:{{userInfo.com_tel}}</view>
</view>
</view> </view>
\ No newline at end of file
...@@ -2,18 +2,24 @@ ...@@ -2,18 +2,24 @@
padding: 0 24rpx; padding: 0 24rpx;
flex-wrap: nowrap; flex-wrap: nowrap;
} }
.company .head .pic { .company .head .pic {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
background: #e6ecf2;
border-radius: 50%;
} }
.company .head .pic .im { .company .head .pic .im {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
border-radius: 50%; border-radius: 50%;
} }
.company .head .txt { .company .head .txt {
margin-left: 24rpx; margin-left: 24rpx;
} }
.company .head .txt .t1 { .company .head .txt .t1 {
font-weight: 600; font-weight: 600;
font-size: 36rpx; font-size: 36rpx;
...@@ -21,35 +27,43 @@ ...@@ -21,35 +27,43 @@
margin-bottom: 16rpx; margin-bottom: 16rpx;
display: block; display: block;
} }
.company .head .txt .company-txt { .company .head .txt .company-txt {
margin-right: 48rpx; margin-right: 48rpx;
} }
.company .head .txt .company-txt .iconiconxiantiaoshouji24 { .company .head .txt .company-txt .iconiconxiantiaoshouji24 {
font-size: 30rpx; font-size: 30rpx;
color: #61A0F2; color: #61a0f2;
} }
.company .head .txt .company-txt .company-txt-t1 { .company .head .txt .company-txt .company-txt-t1 {
font-size: 26rpx; font-size: 26rpx;
color: #8A9299; color: #8a9299;
margin-left: 5rpx; margin-left: 5rpx;
} }
.company .head .iconiconxiantiaoshouji22 { .company .head .iconiconxiantiaoshouji22 {
font-size: 40rpx; font-size: 40rpx;
color: #0D84D1; color: #0d84d1;
margin-bottom: 13rpx; margin-bottom: 13rpx;
} }
.company .head .edit { .company .head .edit {
color: #0D84D1; color: #0d84d1;
font-size: 22rpx; font-size: 22rpx;
font-weight: 400; font-weight: 400;
} }
.company .tab { .company .tab {
margin: 38rpx 0 24rpx 0; margin: 38rpx 0 24rpx 0;
} }
.company .tab .v { .company .tab .v {
flex: 1; flex: 1;
text-align: center; text-align: center;
} }
.company .tab .v .t1 { .company .tab .v .t1 {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
...@@ -57,47 +71,57 @@ ...@@ -57,47 +71,57 @@
color: #515559; color: #515559;
display: block; display: block;
} }
.company .tab .v .t2 { .company .tab .v .t2 {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
line-height: 33rpx; line-height: 33rpx;
color: #8A9299; color: #8a9299;
} }
.company .evaluation { .company .evaluation {
padding: 0 24rpx; padding: 0 24rpx;
height: 100rpx; height: 100rpx;
} }
.company .evaluation .iconiconxiantiaoshouji23 { .company .evaluation .iconiconxiantiaoshouji23 {
font-size: 40rpx; font-size: 40rpx;
color: #EA1717; color: #ea1717;
} }
.company .evaluation .t1 { .company .evaluation .t1 {
font-size: 28rpx; font-size: 28rpx;
line-height: 46rpx; line-height: 46rpx;
color: #515559; color: #515559;
margin-left: 20rpx; margin-left: 20rpx;
} }
.company .evaluation .iconChevron { .company .evaluation .iconChevron {
font-size: 27rpx; font-size: 27rpx;
color: #ADB6BF; color: #adb6bf;
} }
.company .txt-wrap { .company .txt-wrap {
margin: 24rpx 0 0 0; margin: 24rpx 0 0 0;
padding: 0 24rpx 40rpx 24rpx; padding: 0 24rpx 40rpx 24rpx;
} }
.company .txt-wrap .pic { .company .txt-wrap .pic {
width: 702rpx; width: 702rpx;
height: 410rpx; height: 410rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.company .txt-wrap .pic .im { .company .txt-wrap .pic .im {
width: 702rpx; width: 702rpx;
height: 410rpx; height: 410rpx;
border-radius: 8rpx; border-radius: 8rpx;
} }
.company .txt-wrap .text-introduced { .company .txt-wrap .text-introduced {
padding: 0 27rpx 40rpx 27rpx; padding: 0 27rpx 40rpx 27rpx;
} }
.company .txt-wrap .text-introduced .tit { .company .txt-wrap .text-introduced .tit {
font-size: 26rpx; font-size: 26rpx;
color: #515559; color: #515559;
...@@ -105,13 +129,15 @@ ...@@ -105,13 +129,15 @@
font-weight: 600; font-weight: 600;
line-height: 37rpx; line-height: 37rpx;
} }
.company .txt-wrap .text-introduced .t1 { .company .txt-wrap .text-introduced .t1 {
font-size: 26rpx; font-size: 26rpx;
line-height: 40rpx; line-height: 40rpx;
font-weight: 400; font-weight: 400;
color: #8A9299; color: #8a9299;
text-align: justify; text-align: justify;
} }
.company .txt-wrap .btn { .company .txt-wrap .btn {
padding: 0 27rpx; padding: 0 27rpx;
height: 98rpx; height: 98rpx;
...@@ -121,5 +147,11 @@ ...@@ -121,5 +147,11 @@
box-shadow: 0px 6px 10px 0px rgba(97, 160, 242, 0.3); box-shadow: 0px 6px 10px 0px rgba(97, 160, 242, 0.3);
border-radius: 8rpx; border-radius: 8rpx;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #fff;
}
.user-mark {
font-size: 26rpx;
color: #8a9299;
margin-left: 12rpx;
} }
...@@ -16,135 +16,85 @@ Page({ ...@@ -16,135 +16,85 @@ Page({
status: true, status: true,
avatar: '', avatar: '',
multiArray: [], multiArray: [],
multiIndex: [4, 0, 0], multiIndex: [0, 0, 0],
province_id: 6, province_id: "",
city_id: 76, city_id: "",
district_id: 696, district_id: "",
type: '' step: 0
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function(options) {
//获取用户信息
var arr = []; http.getData(apis.userInfo, 'GET', {
token: wx.getStorageSync('access_token')
this.setData({ }, (res) => {
type: options.type
});
//设置默认省市区
http.getData(apis.regionPcd, 'GET', null, (res) => {
if (res.errcode === 0) { if (res.errcode === 0) {
let province = []; this.setData({
res.data.forEach(function (value, index, array) { userInfo: res.data,
province.push({ avatar: res.data.com_pic,
id: index, status: res.data.com_pic ? false : true,
region_id: value.region_id, province_id: res.data.province,
name: value.region_name city_id: res.data.city,
}) district_id: res.data.district,
}); });
arr.push(province); this.getProvince(true)
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
});
} else {
}, false, false, true);
}, false, false, true);
} }
}, true);
}, false, false, true);
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function() {
//获取用户信息
http.getData(apis.userInfo, 'GET', {
token: wx.getStorageSync('access_token')
}, (res) => {
if (res.errcode === 0) {
this.setData({
userInfo: res.data
});
}
}, true);
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function() {
}, },
/** /**
* 上传企业形象 * 上传企业形象
*/ */
uploadImg: function () { uploadImg: function() {
chooseImg(apis.ossupload, 1, (res) => { chooseImg(apis.ossupload, 1, (res) => {
if (res) { if (res) {
...@@ -158,7 +108,7 @@ Page({ ...@@ -158,7 +108,7 @@ Page({
/** /**
* 删除企业形象 * 删除企业形象
*/ */
deleteImg: function () { deleteImg: function() {
this.setData({ this.setData({
avatar: '', avatar: '',
status: true status: true
...@@ -167,7 +117,7 @@ Page({ ...@@ -167,7 +117,7 @@ Page({
/** /**
* 验证字段 * 验证字段
*/ */
calcForm: function (val) { calcForm: function(val) {
let detail_address = val.detail_address; let detail_address = val.detail_address;
let mobile = val.mobile; let mobile = val.mobile;
...@@ -178,30 +128,26 @@ Page({ ...@@ -178,30 +128,26 @@ Page({
* *
* 企业提交 * 企业提交
*/ */
formSubmit: function (e) { formSubmit: function(e) {
if (this.calcForm(e.detail.value)) { if (this.calcForm(e.detail.value)) {
this.setData({ this.setData({
disabled: true, disabled: true,
loading: true loading: true
}); });
let params = Object.assign({}, e.detail.value, { let params = Object.assign({}, e.detail.value, {
province_id: this.data.province_id, province_id: this.data.province_id,
city_id: this.data.city_id, city_id: this.data.city_id,
district_id: this.data.district_id, district_id: this.data.district_id,
avatar: this.data.avatar com_pic: this.data.avatar
}); });
http.getData(apis.userAccount, 'GET', params, (res) => { http.getData(apis.userAccount, 'GET', params, (res) => {
if (res.errcode === 0) { if (res.errcode === 0) {
setTimeout(() => {
wx.navigateTo({ wx.navigateBack();
url: '/pages/person/company/index' getApp().globalData.bus.emit('editCompany');
}); }, 1000)
} else { } else {
...@@ -220,110 +166,158 @@ Page({ ...@@ -220,110 +166,158 @@ Page({
}, false, false, true); }, false, false, true);
} }
}, },
bindMultiPickerChange: function (e) { bindMultiPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({ this.setData({
step: 1, // 有数据时显示当前已选择的省市区
multiIndex: e.detail.value, multiIndex: e.detail.value,
province_id: this.data.multiArray[0][e.detail.value[0]].region_id, province_id: this.data.multiArray[0][e.detail.value[0]].region_id,
city_id: this.data.multiArray[1][e.detail.value[1]].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 district_id: this.data.multiArray[2][e.detail.value[2]] ? this.data.multiArray[2][e.detail.value[2]].region_id : ''
}) })
}, },
bindMultiPickerColumnChange: function (e) { bindMultiPickerColumnChange: function(e) {
console.log('修改的列为', e.detail.column, ',值为', e.detail.value); console.log(e.detail)
let column = e.detail.column // 当前改变的列
this.data.multiIndex[e.detail.column] = e.detail.value; let data = {
multiIndex: JSON.parse(JSON.stringify(this.data.multiIndex)),
if (e.detail.column === 0) { multiArray: JSON.parse(JSON.stringify(this.data.multiArray))
this.setData({ }
province_id: this.data.multiArray[e.detail.column][e.detail.value].region_id, data.multiIndex[column] = e.detail.value;
}) switch (column) {
case 0: //省发生变化
//更新省 let currentProvinceId = this.data.provinceList[e.detail.value].region_id;
http.getData(apis.regionPcd, 'GET', { if (this.data.provinceList[e.detail.value].region_id) { // 当前的市的查询id
province_id: this.data.multiArray[0][e.detail.value].region_id this.getCity(currentProvinceId) // 获取当前市的查询id下面的市级数据
}, (res) => { }
let city = []; data.multiIndex[1] = 0 // 将市默认选择第一个
let arr = this.data.multiArray; break;
res.data.forEach(function (value, index, array) { case 1: //市发生变化
city.push({ let currentCityId = this.data.cityList[e.detail.value].region_id;
if (this.data.cityList[e.detail.value].region_id) {
this.getArea(currentCityId) // 获取区
}
data.multiIndex[2] = 0 // 默认为第一个
break;
case 2: //区发送变化
break
}
this.setData(data)
},
getProvince: function(isInit) {
let me = this;
let indexArr = [];
let positionArr = [];
http.getData(apis.regionPcd, 'GET', null, (res) => {
if (res.errcode === 0) {
let province = [];
res.data.forEach(function(value, index, array) {
province.push({
id: index, id: index,
region_id: value.region_id, region_id: value.region_id,
name: value.region_name name: value.region_name
}) });
}); if (value.region_id == me.data.province_id) {
arr.splice(1, 1, city); if (isInit) {
this.setData({ indexArr[0] = index;
multiArray: arr }
}
}); });
me.setData({
multiArray: [province, [],
[]
],
provinceList: province
})
let defaultId = isInit ? me.data.province_id : me.data.provinceList[0].region_id;
if (defaultId) {
me.setData({
currentProvinceId: defaultId
})
};
if (isInit) {
positionArr.push(province);
}
me.getCity(defaultId, isInit, indexArr, positionArr)
}
}, false, false, true);
let city_index = this.data.multiIndex; },
city_index.splice(1, 1, 0); getCity: function(id, isInit, indexArr, positionArr) {
let me = this;
this.setData({ this.setData({
multiIndex: city_index currentProvinceId: id // 保存当前选择的省级id
})
http.getData(apis.regionPcd, 'GET', {
province_id: id
}, (cityData) => {
let city = [];
cityData.data.forEach(function(value, index, array) {
city.push({
id: index,
region_id: value.region_id,
name: value.region_name
}); });
if (value.region_id == me.data.city_id) {
if (isInit) {
//更新市 indexArr[1] = index;
http.getData(apis.regionPcd, 'GET', { }
province_id: this.data.multiArray[0][e.detail.value].region_id, }
city_id: city[0].region_id });
}, (data) => { me.setData({
multiArray: [me.data.provinceList, city, []],
let area = []; cityList: city
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
}) })
let defaultId = isInit ? me.data.city_id : me.data.cityList[0].region_id;
//选择市 if (defaultId) {
http.getData(apis.regionPcd, 'GET', { me.setData({
province_id: this.data.province_id, currentCityId: defaultId
city_id: this.data.city_id })
}, (res) => { };
if (isInit) {
let area = []; positionArr.push(city);
let arr = this.data.multiArray; }
res.data.forEach(function (value, index, array) { me.getArea(defaultId, isInit, indexArr, positionArr)
area.push({ }, false, false, true);
id: index, },
region_id: value.region_id, getArea: function(id, isInit, indexArr, positionArr) {
name: value.region_name let me = this;
}) this.setData({
currentCityId: id // 保存当前选择的市级id
})
http.getData(apis.regionPcd, 'GET', {
province_id: me.data.currentProvinceId,
city_id: id
}, (areaData) => {
let area = [];
areaData.data.forEach(function(value, index, array) {
area.push({
id: index,
region_id: value.region_id,
name: value.region_name
}); });
arr.splice(2, 1, area); if (value.region_id == me.data.district_id) {
this.setData({ if (isInit) {
multiArray: arr indexArr[2] = index;
}
}
});
if (isInit) {
positionArr.push(area);
me.setData({
multiArray: positionArr,
multiIndex: indexArr
}); });
if (me.data.province_id) {
me.setData({
step: 1
})
}
} else {
me.setData({
multiArray: [me.data.provinceList, me.data.cityList, area]
})
}
}, false, false, true);
}, false, false, true); },
}
}
}) })
\ No newline at end of file
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
</block> </block>
<block wx:else> <block wx:else>
<view class="view column rowCenter verCenter"> <view class="view column rowCenter verCenter">
<cover-image src="{{avatar}}" class="img"></cover-image> <image src="{{avatar}}" class="img" style="height:100%;width:100%"></image>
<text class="icon iconfont iconiconxiantiaoshouji7" bind:tap="deleteImg"></text> <text class="icon iconfont iconiconxiantiaoshouji7" bind:tap="deleteImg"></text>
</view> </view>
</block> </block>
</view> </view>
<view class="txt"> <view class="txt">
<textarea name='com_desc' bindblur="bindTextAreaBlur" value="{{userInfo.com_desc}}" auto-height placeholder="请输入企业简介" class="tarea" placeholder-class="textarea-placeholder" /> <textarea name='com_desc' value="{{userInfo.com_desc}}" auto-height placeholder="请输入企业简介" class="tarea" placeholder-class="textarea-placeholder" />
</view> </view>
<view class="hr"></view> <view class="hr"></view>
<view class="list row verCenter bothSide bor"> <view class="list row verCenter bothSide bor">
...@@ -23,7 +23,11 @@ ...@@ -23,7 +23,11 @@
<view class="sel row rowCenter verCenter" wx:if="{{multiArray.length > 0}}"> <view class="sel row rowCenter verCenter" wx:if="{{multiArray.length > 0}}">
<view> <view>
<picker class="t1" mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}" range-key="name"> <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}} <view wx:if="{{step==0}}">请选择省/市/区</view>
<view wx:if="{{step==1}}">
{{multiArray[0][multiIndex[0]].name}}<text>-</text>{{multiArray[1][multiIndex[1]].name}}<text wx:if="{{multiArray[2][multiIndex[2]].name}}">-</text>{{multiArray[2][multiIndex[2]].name}}
</view>
</picker> </picker>
</view> </view>
<text class="icon iconfont iconChevron"></text> <text class="icon iconfont iconChevron"></text>
...@@ -32,13 +36,13 @@ ...@@ -32,13 +36,13 @@
<view class="list row verCenter bothSide bor"> <view class="list row verCenter bothSide bor">
<view class="l">详细地址</view> <view class="l">详细地址</view>
<view class="r"> <view class="r">
<input type="text" placeholder="请输入详细地址" placeholder-class="placeholderClass" name="detail_address" /> <input type="text" placeholder="请输入详细地址" placeholder-class="placeholderClass" name="detail_address" value="{{userInfo.detail_address}}" />
</view> </view>
</view> </view>
<view class="list row verCenter bothSide bor"> <view class="list row verCenter bothSide bor">
<view class="l">联系电话</view> <view class="l">联系电话</view>
<view class="r"> <view class="r">
<input type="text" placeholder="请输入联系电话" placeholder-class="placeholderClass" name="com_tel" /> <input type="text" placeholder="请输入联系电话" placeholder-class="placeholderClass" name="com_tel" value="{{userInfo.mobile}}"/>
</view> </view>
</view> </view>
<view class="btn-wrap"> <view class="btn-wrap">
......
// pages/person/notice/index.js
import {
apis
} from '../../../utils/api.js';
import {
getData,
tips
} from '../../../utils/util.js';
Page({
/**
* 页面的初始数据
*/
data: {
checked2: 0,
checked3: 0,
token: "",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
token: wx.getStorageSync('access_token') || ''
});
this.getSwitchStatus()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
getSwitchStatus: function () {
let me = this;
getData(apis.userInfo, 'get', {
"token": me.data.token,
}, function (res) {
if (res.errcode == 0) {
me.setData({
checked2: Number(res.data.sys_msg),
checked3: Number(res.data.activity_msg)
})
} else {
tips(res.errmsg);
console.log('获取状态失败')
}
}, true)
},
changeMsg: function (e) {
let val = e.detail.value;
let isChecked = val?1:0
this.setMessage(1,isChecked)
},
changeAct: function (e) {
let val = e.detail.value;
let isChecked = val ? 1 : 0
this.setMessage(3,isChecked)
},
setMessage: function (type, isChecked) {
let me = this;
getData(apis.userSetmsg, 'get', {
"token": me.data.token,
type: type,
is_open: isChecked
}, function (res) {
if (res.errcode == 0) {
if(type==1){
me.setData({
checked2:isChecked
})
}else{
me.setData({
checked3: isChecked
})
}
tips('设置成功');
} else {
if (type == 1) {
me.setData({
checked2: isChecked?0:1
})
} else {
me.setData({
checked3: isChecked?0:1
})
}
tips(res.errmsg);
}
}, true)
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "通知设置"
}
\ No newline at end of file
<!--pages/person/notice/index.wxml-->
<view class="notice" hover-class="none" hover-stop-propagation="false">
<view class="boxsiz bar row bothSide verCenter bor">
<view>
<text class="t1">系统通知</text>
</view>
<view>
<switch checked="{{checked2}}" bindchange="changeMsg"/>
</view>
</view>
<view class="boxsiz bar row bothSide verCenter bor">
<view>
<text class="t1">活动通知</text>
</view>
<view>
<switch checked="{{checked3}}" bindchange="changeAct"/>
</view>
</view>
</view>
/* pages/person/notice/index.wxss */
.notice .bar {
padding: 0 24rpx 0 0;
margin-left: 24rpx;
height: 100rpx;
}
.notice .bar .t1 {
font-size: 28rpx;
color: #515559;
margin-left: 20rpx;
font-weight: 400;
}
.notice .bar .t2 {
font-size: 26rpx;
color: #8A9299;
font-weight: 400;
}
.notice .bar .iconChevron {
font-size: 27rpx;
color: #ADB6BF;
margin-left: 12rpx;
}
.notice .bar.bor {
border-bottom: 1px solid #F5F9FC;
}
// pages/person/privacy/index.js // pages/person/privacy/index.js
import {
apis
} from '../../../utils/api.js';
import {
getData,
tips
} from '../../../utils/util.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
checked:1,
checked2: 0,
checked3: 0,
token: "",
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
token: wx.getStorageSync('access_token') || ''
});
this.getSwitchStatus()
}, },
/** /**
...@@ -56,4 +69,77 @@ Page({ ...@@ -56,4 +69,77 @@ Page({
onReachBottom: function () { onReachBottom: function () {
}, },
changeGood: function (e) {
let val = e.detail.value;
let isChecked = val ? 1 : 0
this.setStatus(1, isChecked)
},
changeXj: function (e) {
let val = e.detail.value;
let isChecked = val ? 1 : 0
this.setStatus(3, isChecked)
},
changeBj: function (e) {
let val = e.detail.value;
let isChecked = val ? 1 : 0
this.setStatus(2, isChecked)
},
getSwitchStatus: function () {
let me = this;
getData(apis.userInfo, 'get', {
"token": me.data.token,
}, function (res) {
if (res.errcode == 0) {
me.setData({
checked1: Number(res.data.goods_show),
checked2: Number(res.data.enquiry_show),
checked3: Number(res.data.offer_show)
})
} else {
tips(res.errmsg);
console.log('获取状态失败')
}
}, true)
},
setStatus: function (type, isChecked) {
let me = this;
getData(apis.userSetprivacy, 'get', {
"token": me.data.token,
type: type,
is_open: isChecked
}, function (res) {
if (res.errcode == 0) {
if (type == 1) {
me.setData({
checked1: isChecked
})
} else if(type == 2){
me.setData({
checked3: isChecked
})
}else{
me.setData({
checked2: isChecked
})
}
tips('设置成功');
} else {
if (type == 1) {
me.setData({
checked1: isChecked ? 0 : 1
})
} else if(type == 2){
me.setData({
checked3: isChecked ? 0 : 1
})
}else{
me.setData({
checked2: isChecked ? 0 : 1
})
}
tips(res.errmsg);
}
}, true)
}
}) })
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<text class="t1">商品展示</text> <text class="t1">商品展示</text>
</view> </view>
<view> <view>
<switch checked /> <switch checked="{{checked1}}" bindchange="changeGood" />
</view> </view>
</view> </view>
<view class="boxsiz bar row bothSide verCenter bor"> <view class="boxsiz bar row bothSide verCenter bor">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<text class="t1">询价展示</text> <text class="t1">询价展示</text>
</view> </view>
<view> <view>
<switch /> <switch checked="{{checked2}}" bindchange="changeXj"/>
</view> </view>
</view> </view>
<view class="boxsiz bar row bothSide verCenter bor"> <view class="boxsiz bar row bothSide verCenter bor">
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<text class="t1">报价展示</text> <text class="t1">报价展示</text>
</view> </view>
<view> <view>
<switch /> <switch checked="{{checked3}}" bindchange="changeBj"/>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -18,6 +18,15 @@ ...@@ -18,6 +18,15 @@
</view> </view>
</view> </view>
<view class="hr"></view> <view class="hr"></view>
<view class="boxsiz bar row bothSide verCenter" bind:tap="toUrl" data-url="/pages/person/notice/index">
<view>
<text class="t1">通知设置</text>
</view>
<view>
<text class="icon iconfont iconChevron"></text>
</view>
</view>
<view class="boxsiz bar row bothSide verCenter" bind:tap="toUrl" data-url="/pages/person/privacy/index"> <view class="boxsiz bar row bothSide verCenter" bind:tap="toUrl" data-url="/pages/person/privacy/index">
<view> <view>
<text class="t1">隐私设置</text> <text class="t1">隐私设置</text>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<text class='t2'>金币提现兑换、领红包</text> <text class='t2'>金币提现兑换、领红包</text>
</view> </view>
<view class="bar-list boxsiz"> <view class="bar-list boxsiz">
<view class="boxsiz bar row bothSide verCenter" data-url="/pages/person/company/index" bind:tap="toUrl"> <view class="boxsiz bar row bothSide verCenter" data-url="/pages/person/company/index?type=1" bind:tap="toUrl">
<view> <view>
<text class="icon iconfont iconiconcaiseshouye1"></text> <text class="icon iconfont iconiconcaiseshouye1"></text>
<text class="t1">个人主页</text> <text class="t1">个人主页</text>
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 0, "current": 8,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -72,6 +72,49 @@ ...@@ -72,6 +72,49 @@
"id": -1, "id": -1,
"name": "pages/person/welfare/index", "name": "pages/person/welfare/index",
"pathName": "pages/person/welfare/index", "pathName": "pages/person/welfare/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/notice/index",
"pathName": "pages/person/notice/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/notice/index",
"pathName": "pages/person/notice/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/privacy/index",
"pathName": "pages/person/privacy/index",
"query": "",
"scene": null
},
{
"id": 8,
"name": "pages/detail/company/index",
"pathName": "pages/detail/company/index",
"query": "type=2&userId=93",
"scene": null "scene": null
} }
] ]
......
...@@ -168,6 +168,10 @@ const apis = { ...@@ -168,6 +168,10 @@ const apis = {
*/ */
userSetmsg: user_url + "/user/setmsg", userSetmsg: user_url + "/user/setmsg",
/*** /***
* 账户隐私项设置
*/
userSetprivacy: user_url + "/user/setprivacy",
/***
* 账户设置 * 账户设置
*/ */
userAccount: user_url + "/user/account", userAccount: user_url + "/user/account",
...@@ -180,10 +184,14 @@ const apis = { ...@@ -180,10 +184,14 @@ const apis = {
*/ */
uploadList: goods_url + '/goods/upload/list', uploadList: goods_url + '/goods/upload/list',
/** /**
* 数量统计 * 获取自己的数量统计
*/ */
countBusiness: user_url + '/count/business', countBusiness: user_url + '/count/business',
/** /**
* 获取别人的数量统计
*/
countUserBusiness: user_url + '/count/user/business',
/**
* 获取会员系统通知 * 获取会员系统通知
*/ */
userSysmsg: user_url + '/user/sysmsg', userSysmsg: user_url + '/user/sysmsg',
...@@ -248,6 +256,10 @@ const apis = { ...@@ -248,6 +256,10 @@ const apis = {
*/ */
evaluateList: user_url + '/evaluate/list', evaluateList: user_url + '/evaluate/list',
/** /**
* 评价列表(其他用户,根据user_id获取)
*/
evaluateUserList: user_url + '/evaluate/user/list',
/**
* 新增评价 * 新增评价
*/ */
evaluateAdd: user_url + '/evaluate/add', evaluateAdd: user_url + '/evaluate/add',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment