作者 朱振飞

修改时间

... ... @@ -84,9 +84,9 @@ Page({
}):''
})
},
bannerDetail(e){
bannerDetail(){
wx.navigateTo({
url: '/pages/attract/detail/detail?id='+e.currentTarget.id,
url: '/pages/attract/list/list',
})
},
... ...
... ... @@ -24,6 +24,9 @@ Page({
};
t.post(url, p).then((r)=>{
d.setData({detail:r})
wx.setNavigationBarTitle({
title: r.name,
})
WxParse.wxParse('contentHtml', 'html', r.content, d, 5);
})
},
... ...
<view class='main_container'>
<!-- <view class='video_box'>
<video class='vid'></video>
<view class='video_icon'>
<image src='/images/shipin@3x.png' mode='widthFix'></image>
</view>
</view> -->
<video class='video_box' src='{{detail.video}}'>
<cover-view class='video_title'>{{detail.name}}</cover-view>
</video>
<!-- 招商优势 -->
<view class='single_item_container'>
<view class='top_label'>
... ... @@ -27,20 +18,20 @@
</view>
<view class='zixun_container'>
<view class='zixun_item'>
<view class='zixun_icon'>
<view class='zixun_icon phone'>
<image src='/images/zuoji@3x.png' mode='aspectFit'></image>
</view>
<view class='zixun_content'>{{detail.phone}}</view>
</view>
<view class='zixun_item'>
<view class='zixun_icon'>
<view class='zixun_icon email'>
<image src='/images/mail@3x.png' mode='aspectFit'></image>
</view>
<view class='zixun_content'>{{detail.email}}</view>
</view>
<view class='zixun_item'>
<view class='zixun_icon'>
<image src='/images/zuoji@3x.png' mode='aspectFit'></image>
<view class='zixun_icon '>
<image src='/images/erweima@3x.png' mode='aspectFit'></image>
</view>
<view class='zixun_content'>
<view class='erwei_code'>
... ...
/* pages/attract/detail/detail.wxss */
.video_box {
width: 682rpx;
height: 430rpx;
margin: 0 auto;
background-color: rgba(0,0,0,.6);
position: relative;
left: 35rpx;
}
.video_icon{
width: 96rpx;
height: 96rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.video_icon image{
width: 100%;
}
.video_title{
margin:0 32rpx;
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp:1;
color: #FFF;
font-size: 30rpx;
margin-top: 30rpx;
}
.single_item_container{
margin-top: 30rpx;
border-bottom: 2rpx solid #f5f5f5;
... ... @@ -67,11 +36,20 @@
justify-content: flex-start;
margin: 30rpx 0;
}
.zixun_icon{
height: 28rpx;
width: 32rpx;
height: 46rpx;
width: 60rpx;
align-self: flex-start;
}
.email{
width: 46rpx;
height: 30rpx;
}
.phone{
width: 42rpx;
height: 42rpx;
}
.zixun_icon image {
width: 100%;
height: 100%;
... ... @@ -81,7 +59,7 @@
font-size: 28rpx;
line-height: 1;
color: #333;
margin-left: 10rpx;
margin-left: 20rpx;
}
.erwei_code {
... ... @@ -89,8 +67,8 @@
margin-bottom: 20rpx;
}
.img_box{
width: 88rpx;
height: 88rpx;
width: 140rpx;
height: 140rpx;
margin-right: 20rpx;
}
.img_box image{
... ...
// pages/attract/detail/detail.js
const t = getApp();
var WxParse = require('../../../wxParse/wxParse.js');
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let a = this;
a.d(), a.l();
},
d() {
let d = this, url = '/api/Article/getAttractInvestmentVideo', p = {};
t.post(url, p).then((r) => {
d.setData({ detail: r })
})
},
l(){
let d = this, url = '/api/Article/getAttractInvestmentList', p = {};
t.post(url, p).then((r) => {
d.setData({ list: r })
})
},
detail(e){
wx.navigateTo({
url: '/pages/attract/detail/detail?id='+e.currentTarget.id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class='main_container'>
<video class='video_box' controls='true' object-fit='cover' poster='{{detail.thumbnail}}' src='{{detail.video}}'>
</video>
<view class='zhaoshangLists'>
<view class='zhaoshang_item' wx:for='{{list}}' wx:key='' id='{{item.id}}' bindtap='detail'>
<image src='{{detail.thumbnail}}' mode='widthFix'></image>
<text>{{item.name}}</text>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/attract/detail/detail.wxss */
.video_box {
width: 100%;
height: 430rpx;
margin: 0 auto;
background-color: rgba(0,0,0,.6);
position: relative;
}
.video_icon{
width: 96rpx;
height: 96rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.video_icon image{
width: 100%;
}
.video_title{
margin:0 32rpx;
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp:1;
color: #FFF;
font-size: 30rpx;
margin-top: 30rpx;
}
.zhaoshangLists{
margin: 20rpx;
}
.zhaoshang_item{
height: 280rpx;
border-radius: 10rpx;
margin-bottom: 30rpx;
overflow: hidden;
position: relative;
}
.zhaoshang_item image{
width: 100%;
}
.zhaoshang_item text{
position: absolute;
right: 40rpx;
bottom: 40rpx;
color: #FFF;
font-size: 30rpx;
font-weight: bold;
}
\ No newline at end of file
... ...
... ... @@ -13,48 +13,66 @@ Page({
}
],
zixunList: [],
currentTab: 0,
page: 1 ,
postList:[],
currentTab: 1,
page: 1,
ifData: !1,
noMore: !1,
show:!0
show: !0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let c = this;wx.getSystemInfo({
success: function(res) {
let c = this; wx.getSystemInfo({
success: function (res) {
c.setData({
winHeight:res.windowHeight
winHeight: res.windowHeight
})
},
})
}), this.postList();
},
getzixun(){
let url = '/api/interact/getQuestionList',d = this,params = {
header:true,
page: d.data.page
getzixun() {
let url = '/api/interact/getQuestionList', d = this, params = {
header: true,
page: d.data.page
};
t.post(url,params,false).then((r)=>{
t.post(url, params, false).then((r) => {
let list = d.data.zixunList.concat(r.data);
d.setData({
zixunList: list
})
list.length==0?d.setData({
ifData:!0,
}):(r.data.length<r.per_page?d.setData({
noMore:!0
}):"")
setTimeout(()=>{
list.length == 0 ? d.setData({
ifData: !0,
}) : (r.data.length < r.per_page ? d.setData({
noMore: !0
}) : "")
setTimeout(() => {
d.setData({
show: !1
},1200)
}, 1200)
})
})
},
askQuestion(){
postList() {
let url = '/api/interact/getPostsList', d = this, params = {
page: d.data.page
};
t.post(url, params, false).then((r) => {
let list = d.data.postList.concat(r.data);
d.setData({
postList: list
})
list.length == 0 ? d.setData({
ifData: !0,
}) : (r.data.length < r.per_page ? d.setData({
noMore: !0
}) : "")
})
},
askQuestion() {
wx.navigateTo({
url: '/pages/question/question',
})
... ... @@ -64,29 +82,29 @@ Page({
header: true
};
t.post(url, params).then((r) => {
b.setData({
auth:r
});
r == 2 ? b.getzixun():'';
b.setData({
auth: r
});
r == 2 ? b.getzixun() : '';
})
},
renzheng(e){
renzheng(e) {
let type = e.currentTarget.dataset.type;
type==1?wx.showToast({
type == 1 ? wx.showToast({
title: '认证审批中请耐心等待',
icon:'none',
icon: 'none',
duration: 1200
}):wx.navigateTo({
url: '/pages/my/approve/approve',
}) : wx.navigateTo({
url: '/pages/my/approve/approve',
})
},
navbarTap: function (e) {
let that = this;
let t = this, idx = e.currentTarget.dataset.idx;
this.setData({
currentTab: e.currentTarget.dataset.idx,
})
currentTab: idx,
}), idx ? t.postList() : t.getzixun();
},
jump(){
jump() {
wx.navigateTo({
url: '',
})
... ... @@ -95,12 +113,12 @@ Page({
url: '',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
... ... @@ -108,7 +126,7 @@ Page({
*/
onShow: function () {
this.setData({
zixunList:[]
zixunList: []
})
this.checkstatus()
},
... ... @@ -117,34 +135,34 @@ Page({
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
<scroll-view wx:if='{{auth=="2"}}' style='height:{{winHeight}}px' scroll-y="true">
<view class="nav mainindex_nav top">
<view wx:for="{{navbar}}" data-idx="{{index}}" class="nav_item {{currentTab==index ? 'active' : ''}}" wx:key="unique" bindtap="navbarTap" data-categoryid="{{item.id}}">{{item.name}}</view>
</view>
<scroll-view wx:if='{{auth=="2"}}' style='height:{{winHeight}}px' scroll-y="true">
<view class="none-box" hidden="{{!ifData}}">
<view>暂无相关咨询</view>
<view class="none-box" hidden="{{!ifData}}">
<view>暂无相关咨询</view>
</view>
<view class='box_left' wx:if="{{currentTab==0}}" >
<view class='mid' bindtap="jump" hidden='{{ifData}}'>
<view class='mid_item' wx:for='{{zixunList}}' wx:key=''>
<view class='mid_item_left'>
<image src='../../images/tishi@3x.png'></image>
</view>
<view class='mid_item_right'>
<view class='mid_item_right_top'>
{{item.question}}?
<view class='mid_label' hidden='{{item.show}}'>
<image src='../../images/huifujishi@3x.png' wx:if="{{item.state==1}}"></image>
<image src='../../images/huifuyiban@3x.png' wx:elif='{{item.state==2}}'></image>
<image src='../../images/huifuzhihuan @3x.png' wx:elif='{{item.state==3}}'></image>
</view>
</view>
<view class='mid_item_right_bottom'>
发布时间: {{item.create_time_text}}
</view>
<!-- 回复 -->
<view class='response_box' hidden='{{item.state==0}}'>
<!-- 回复内容 -->
<view class='mid_item_right_response'>
<text class='color_blue'>回复:</text> {{item.reply}}
<view class='box_left' wx:if="{{currentTab==0}}">
<view class='mid' bindtap="jump" hidden='{{ifData}}'>
<view class='mid_item' wx:for='{{zixunList}}' wx:key=''>
<view class='mid_item_left'>
<image src='../../images/tishi@3x.png'></image>
</view>
<view class='mid_item_right'>
<view class='mid_item_right_top'>
{{item.question}}?
<view class='mid_label' hidden='{{item.is_show_state}}'>
<image src='../../images/huifujishi@3x.png' wx:if="{{item.state==1}}"></image>
<image src='../../images/huifuyiban@3x.png' wx:elif='{{item.state==2}}'></image>
<image src='../../images/huifuzhihuan @3x.png' wx:elif='{{item.state==3}}'></image>
</view>
</view>
<!-- 回复时间 -->
<view class='mid_item_right_bottom'>
回复时间:{{item.reply_time_text}}
发布时间: {{item.create_time_text}}
</view>
</view>
<view class='waiting_response' hidden='{{item.state!=0}}'>
等待回复中.....
</view>
</view>
</view>
</view>
<!-- 提问 -->
<view class='bottom' hidden='{{show}}'>
<view class='bottom_question' bindtap='askQuestion'>
提问
</view>
</view>
</view>
<!-- 企话吧 -->
<view class='box_right' wx:if="{{currentTab==1}}">
<view class='mid'>
<!-- 标题 -->
<view class='mid_title'>
有一条新评论 >
</view>
<!-- 条目 -->
<view class='mid_item'>
<view class='mid_item_top'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
<image src='../../images/03_nav@2x.png'></image>
<!-- 回复 -->
<view class='response_box' hidden='{{item.state==0}}'>
<!-- 回复内容 -->
<view class='mid_item_right_response'>
<text class='color_blue'>回复:</text> {{item.reply}}
</view>
<!-- 回复时间 -->
<view class='mid_item_right_bottom'>
回复时间:{{item.reply_time_text}}
</view>
</view>
<!-- 文字 -->
<view class='mid_item_top_left_text'>
金沃斯英语在线教育
<view class='waiting_response' hidden='{{item.state!=0}}'>
等待回复中.....
</view>
</view>
<view class='mid_item_top_right'>
15分钟前
</view>
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>
新个人所得税法近日备受关注。关于个人所得税,想必大家都十分关心,让我们通过以下问题!
</view>
<!-- 图片 -->
<view class='mid_pic_box'>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
</view>
<!-- 底部 -->
<view class='mid_item_like'>
<view class='mid_item_like_left'>
删除
</view>
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue'>
<image src='../../images/thumb-up-button@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number color_blue'>
46
</view>
<!-- 点赞 -->
<view class='mid_like'>
<image src='../../images/pinglun@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number'>
46
</view>
</view>
</view>
<!-- 提问 -->
<view class='bottom' hidden='{{show}}'>
<view class='bottom_question' bindtap='askQuestion'>
提问
</view>
</view>
<!-- 条目 -->
<view class='mid_item'>
<view class='mid_item_top'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
<image src='../../images/03_nav@2x.png'></image>
</view>
<!-- 文字 -->
<view class='mid_item_top_left_text'>
金沃斯英语在线教育
<view class='icon_tm'>
<image src='../../images/guangfang@2x.png'></image>
</view>
<!-- 企话吧 -->
<view class='box_right' wx:if="{{currentTab==1}}">
<view class='mid'>
<!-- 标题 -->
<view class='mid_title'>
有一条新评论 >
</view>
<!-- 条目 -->
<view class='mid_item' wx:for='{{postList}}' wx:key=''>
<view class='mid_item_top'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
<image src='{{item.avatar||"../../images/03_nav@2x.png"}}'></image>
</view>
<!-- 文字 -->
<view class='mid_item_top_left_text'>
{{item.title}}
</view>
</view>
<view class='mid_item_top_right'>
{{item.create_time_text}}
</view>
</view>
<view class='mid_item_top_right'>
15分钟前
</view>
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>
新个人所得税法近日备受关注。关于个人所得税,想必大家都十分关心,让我们通过以下问题!
</view>
<!-- 图片 -->
<view class='mid_pic_box'>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
</view>
<!-- 底部 -->
<view class='mid_item_like'>
<view class='mid_item_like_left'>
删除
<!-- 文字内容 -->
<view class='mid_item_text'>
{{item.content}}
</view>
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue'>
<image src='../../images/zan@3x.png'></image>
<!-- 图片 -->
<view class='mid_pic_box'>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number '>
46
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
<!-- 点赞 -->
<view class='mid_like'>
<image src='../../images/pinglun_fill@3x.png'></image>
<view class='mid_pic_box_item'>
<image src='../../images/weirenzheng@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number color_blue'>
46
</view>
</view>
</view>
</view>
<!-- 条目 -->
<view class='mid_item'>
<view class='mid_item_top'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
<image src='../../images/03_nav@2x.png'></image>
</view>
<!-- 底部 -->
<view class='mid_item_like'>
<view class='mid_item_like_left' hidden='{{item.is_can_del=="0"}}' id='{{item.id}}' bindtap='delete'>
删除
</view>
<!-- 文字 -->
<view class='mid_item_top_left_text'>
金沃斯英语在线教育
<view class='icon_tm'>
<image src='../../images/guangfang@2x.png'></image>
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue'>
<image src='../../images/thumb-up-button@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number color_blue'>
{{item.likes}}
</view>
</view>
</view>
<view class='mid_item_top_right'>
15分钟前
</view>
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>
新个人所得税法近日备受关注。关于个人所得税,想必大家都十分关心,让我们通过以下问题!
</view>
<!-- 底部 -->
<view class='mid_item_like'>
<view class='mid_item_like_left'>
删除
</view>
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue'>
<image src='../../images/zan@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number '>
46
<!-- 点赞 -->
<view class='mid_like'>
<image src='../../images/pinglun@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number'>
{{item.comment_count}}
</view>
</view>
<!-- 点赞 -->
<view class='mid_like'>
<image src='../../images/pinglun@3x.png'></image>
</view>
<!-- 数量 -->
<view class='mid_number'>
46
</view>
</view>
</view>
<!-- 回复框 -->
<view class='mid_item_bottom'>
<view>
<span class='color_blue'>宏中科技</span>:非常实用!!!</view>
<view>
<span class='color_blue'>宏中科技</span>:非常实用!!!</view>
<view>
<span class='color_blue'>查看更多>></span>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</scroll-view>
<!-- 没有权限 -->
<view class='null_data_box' wx:else>
<view class='data_box'>
<image src='/images/weirenzheng@2x.png'></image>
<view class='list_btn' bindtap='open_btn' data-type='auth' bindtap='renzheng'>{{auth=='0'?'开通企业认证 >':auth=='1'?'企业认证中 请等待':""}}</view>
<view wx:if='{{auth=="0"}}'> ~~ 企业认证后开启更多服务 ~~</view>
</view>
</view>
\ No newline at end of file
<!-- 没有权限 -->
<view class='null_data_box' wx:else>
<view class='data_box'>
<image src='/images/weirenzheng@2x.png'></image>
<view class='list_btn' bindtap='open_btn' data-type='auth' bindtap='renzheng'>{{auth=='0'?'开通企业认证 >':auth=='1'?'企业认证中 请等待':""}}</view>
<view wx:if='{{auth=="0"}}'> ~~ 企业认证后开启更多服务 ~~</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -70,6 +70,9 @@ page{
border-bottom: 2px solid #f5f5f5;
box-sizing: border-box;
}
.box_right .mid_item{
flex-flow: column;
}
.mid_item_left{
width:42rpx;
height:40rpx;
... ... @@ -145,7 +148,7 @@ page{
height: 100%;
}
.bottom{
margin-top: 150rpx;
margin: 100rpx 0;
width: 100%;
/* background: #fff; */
display: flex;
... ...
// pages/interact/interactPost/interactPost.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
images: ['/images/huifujishi@2x.png', '/images/huifuyiban@2x.png'],
params:{
title:'',
content:'',
images:[]
},
images: [],
},
/**
... ... @@ -14,10 +20,138 @@ Page({
onLoad: function (options) {
},
setTitle(e){
setText(e){
let t = this,s = e.currentTarget.dataset.type;
s=='title'?(t.setData({
'params.title':e.detail.value
})):(t.setData({
'params.content': e.detail.value
}))
},
deleteImg(e){
let index = e.currentTarget.dataset.index;
this.data.images.splice(index,1);
this.setData({
images: this.data.images
})
},
choose: function () {
let that = this;
wx.chooseImage({
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success(res) {
// tempFilePath可以作为img标签的src属性显示图片
// console.log(res);
let successUp = 0; //成功个数
let failUp = 0; //失败个数
let i = 0; //第几个
let tempFilePaths = res.tempFilePaths //总文件
let length = res.tempFilePaths.length //总共个数
wx.showNavigationBarLoading()
wx.showLoading({
title: '上传中',
})
that.uploadAllfile(tempFilePaths, successUp, failUp, i, length);
},
fail: function (res) {
console.log(res);
},
})
},
// 上传图片至后台
uploadAllfile(filePaths, successUp, failUp, i, length) {
let that = this;
let url = '/api/common/upload';
let headers = {
"token": wx.getStorageSync("token"),
'content-type': 'multipart/form-data'
}
wx.uploadFile({
url: app.globalData.baseUrl + url, //仅为示例,非真实的接口地址
header: headers,
filePath: filePaths[i],
name: 'file',
formData: {
act: "Index_upload",
file: '',
filetype: 'image'
},
success: function (res) {
// console.log(res)
wx.hideNavigationBarLoading()
wx.hideLoading()
if (res.statusCode == 200) {
// console.log(res)
let dat = JSON.parse(res.data);
// console.log(dat);
that.setData({
images: that.data.images.concat(dat.data.url)
})
// console.log(that.data.proData.images);
} else {
wx.showModal({
title: '提示',
content: res.msg,
showCancel: false
})
}
},
fail: function (res) {
wx.hideNavigationBarLoading()
wx.hideLoading()
// console.log(res);
},
complete() {
i++;
let img = that.data.img
if (i == length) {
// console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');
}
else { //递归调用uploadDIY函数
that.uploadAllfile(filePaths, successUp, failUp, i, length);
}
}
})
},
subArticle(){
let t = this, url ='/api/interact/setPosts',params= t.data.params;
params.images = params.images.length?params.images.join(','):'';
!params.title?(wx.showToast({
title: '请输入主题',
icon:'none'
})) : (!params.content ? wx.showToast({
title: '请输入内容',
icon: 'none'
}) : (app.post(url, params).then((r) => {
wx.showToast({
title: '发表成功',
icon: 'none'
})
setTimeout(() => {
wx.switchTab({
url: '/pages/enterprise/enterprise',
})
}, 1100)
})))
// app.post(url,params).then((r)=>{
// wx.showToast({
// title: '发表成功',
// icon:'none'
// })
// setTimeout(()=>{
// wx.redirectTo({
// url: '/pages/enterprise/enterprise',
// })
// },1100)
// })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<!--pages/interact/interactPost/interactPost.wxml-->
<view class='box'>
<view class='banner_box'>
<view class='type_box' bindtap="showPicker">
<view>
<input placeholder='输入主题...' placeholder-class='input_size' data-type='title' value='{{title}}' bindinput='setTitle'></input>
</view>
<view class='type_box' >
<input placeholder='输入主题...' placeholder-class='input_size' data-type='title' value='{{title}}' bindinput='setText'></input>
</view>
<view class='textarea_box'>
<textarea class='textarea' placeholder='输入内容...' placeholder-class='input_size' maxlength='{{max2}}' value='{{text}}' bindinput='setText'>
<textarea class='textarea' placeholder='输入内容...' placeholder-class='input_size' maxlength='{{max2}}' value='{{text}}' bindinput='setText' data-type='content'>
</textarea>
</view>
<view class='upload_box'>
<block wx:for="{{images}}" wx:for-item="image" wx:key="index">
<block wx:for="{{params.images}}" wx:for-item="image" wx:key="index">
<view class='upload_img'>
<view class='icon_box'>
<view class='iconfont icon-shanchu' catchtap="deleteImg" data-index="{{index}}"></view>
... ... @@ -19,10 +17,10 @@
<image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image>
</view>
</block>
<view class='upload_img' bindtap="choose">
<view class='upload_img' bindtap="choose" hidden='{{params.images.length>9}}'>
<view class='iconfont icon-jia1'></view>
</view>
</view>
</view>
<view class='bottom_btn'>发表帖子</view>
<view class='bottom_btn' bindtap='subArticle'>发表帖子</view>
</view>
\ No newline at end of file
... ...
... ... @@ -97,6 +97,7 @@ page {
.type_box input {
font-size: 28rpx;
width: 100%;
}
.type_info {
... ...
... ... @@ -31,9 +31,13 @@ Page({
let url ='/api/company/setFollow', params = {
id: this.data.id,
header: true
}; app.post(url,params).then((res)=>{
}; app.post(url,params,false).then((r)=>{
wx.showToast({
title: r == 2 ? "关注成功" : "已取消",
icon:'none'
})
this.setData({
'detailInfo["focus"]': true
'detailInfo.is_like': r==2?1:0
})
})
},
... ... @@ -51,7 +55,9 @@ Page({
tuijian(){
let url ='/api/Company/recommend';
app.post(url,{header:true}).then((r)=>{
console.log(r)
this.setData({
tuijianList: r.data
})
})
},
onReady: function () {},
... ...
... ... @@ -7,7 +7,7 @@
<view class='compony_info'>
<view class='compony_title'>
<view class='compony_left'>{{detailInfo.name}}</view>
<view class='focus_button cancle_focus' wx:if='{{!detailInfo.is_like}}' bindtap='canclefocus'>已关注</view>
<view class='focus_button cancle_focus' wx:if='{{detailInfo.is_like}}' bindtap='onfocus'>已关注</view>
<view class='focus_button' bindtap='onfocus' wx:else>+ 关注</view>
</view>
... ... @@ -46,12 +46,10 @@
</view>
<!-- 企业推荐 -->
<view class='tuijian_content'>
<navigator class='tuijian_item'>
企业推荐:网易云
</view>
<view class='tuijian_item'>
企业推荐:易云端科技有限公司
</view>
<navigator open-type='redirect' url='/pages/matrix/company/company?id={{item.id}}' class='tuijian_item' wx:for='{{tuijianList}}' wx:key=''>
企业推荐:{{item.name}}
</navigator>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -119,13 +119,13 @@ Page({
// 上传图片至后台
uploadAllfile(filePaths, successUp, failUp, i, length) {
let that = this;
let url = 'http://lqz.w.brotop.cn/api/common/upload';
let url = '/api/common/upload';
let headers = {
"token": wx.getStorageSync("token"),
'content-type': 'multipart/form-data'
}
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
url: app.globalData.baseUrl+url, //仅为示例,非真实的接口地址
header: headers,
filePath: filePaths[i],
name: 'file',
... ...
... ... @@ -56,7 +56,7 @@
}
.bottom_btn {
width: 352rpx;
width: 520rpx;
height: 80rpx;
background: linear-gradient(319deg, rgba(22, 155, 213, 1) 0%, rgba(0, 211, 255, 1) 100%);
border-radius: 8rpx;
... ... @@ -66,12 +66,12 @@
display: flex;
align-items: center;
justify-content: center;
margin: 100rpx auto 0 auto;
margin: 200rpx auto 0;
}
.add_btn{
border: 2rpx solid rgb(236, 201, 201);
width: 160rpx;
height: 160rpx;
width: 158rpx;
height: 158rpx;
display: flex;
align-items: center;
justify-content: center;
... ...
... ... @@ -25,8 +25,8 @@ Page({
// 返回首页
goHome() {
wx.navigateBack({
delta: 5
wx.reLaunch({
url:"/pages/matrix/matrix",
})
},
... ...
... ... @@ -46,6 +46,7 @@
line-height: 96rpx;
text-align: center;
margin-top: 50rpx;
margin: 40rpx auto;
}
.list_active {
... ...
... ... @@ -34,14 +34,14 @@ Page({
b.setData({
auth: r
});
r == 2 ? b.getUserInfo() : '';
b.getUserInfo()
})
},
getUserInfo(){
let d = this, url ='/api/user/index',params={
header: true
}; t.post(url,params,false).then((r)=>{
d.setData({ userInfo: r.userInfo})
d.setData({ userInfo: r.userInfo, noticeNum: r.noticeNum})
})
},
... ...
... ... @@ -3,7 +3,7 @@
<view class='banner_info_box'>
<image class='head_img' src='{{userInfo.avatar||"/images/weirenzheng@2x.png"}}'></image>
<view class='banner_right' wx:if="{{userInfo}}">
<view class='banner_info' wx:if="{{userInfo.company_name}}">
<view class='banner_info'>
<text>认证企业:{{userInfo.company_name}}</text>
<image src='/images/guangfang@2x.png'></image>
</view>
... ... @@ -12,7 +12,6 @@
<text>{{userInfo.username}}</text>
</view>
</view>
<view wx:else class='banner_label'>授权登录</view>
</view>
</view>
<!-- -->
... ... @@ -59,8 +58,8 @@
</view>
<view class='list_item_box'>
<view>发文通知</view>
<view class='list_icon2'>
<view class='list_point'>1</view>
<view class='list_icon2' >
<view class='list_point' hidden="{{!noticeNum}}">{{noticeNum}}</view>
<view class='iconfont icon-go'></view>
</view>
</view>
... ...
... ... @@ -86,6 +86,7 @@
</scroll-view>
<view class="none-box" hidden="{{ifData}}">
<view>你还没有帖子,快去<text class='fabiao' bindtap='subArticle'>发表</text>吧!</view>
<!-- <view>你还没有帖子,快去<text class='fabiao' bindtap='subArticle'>发表</text>吧!</view> -->
<view>你还没有帖子,快去<text class='fabiao' >发表</text>吧!</view>
</view>
\ No newline at end of file
... ...