作者 朱振飞

新增

... ... @@ -11,7 +11,6 @@ App({
let url = '/api/user/codeToToken', t = this;
wx.login({
success: function (res) {
console.log(res)
t.post(url, { code: res.code }).then((r) => {
wx.setStorageSync('token', r.userInfo.token)
})
... ... @@ -36,7 +35,8 @@ App({
var promise = new Promise((resolve, reject) => {
//init
let that = this,token=wx.getStorageSync('token'),header={
'content-type': 'application/x-www-form-urlencoded'
'content-type': 'application/x-www-form-urlencoded',
'token': token||''
},postData;
data.header ? (token ? (header['token'] = token, delete data.header):setTimeout(()=>{
wx.navigateTo({
... ... @@ -44,7 +44,6 @@ App({
})
},1100)):""
//网络请求
console.log(header)
wx.request({
url: this.globalData.baseUrl + url,
data: data,
... ... @@ -85,6 +84,6 @@ App({
},
globalData: {
userInfo: null,
baseUrl:'http://lqz.w.brotop.cn'
baseUrl:'https://lqz.w.brotop.cn'
}
})
\ No newline at end of file
... ...
... ... @@ -20,7 +20,9 @@
"pages/attract/attract",
"pages/attract/detail/detail",
"pages/register/register",
"pages/question/question"
"pages/question/question",
"pages/attract/list/list",
"pages/attract/articleDetail/articleDetail"
],
"tabBar": {
"list": [
... ...

1.1 KB | 宽: | 高:

1.0 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖
// pages/attract/articleDetail/articleDetail.js
const A = getApp();
const wxParse = require('../../../wxParse/wxParse.js')
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let t = this;
t.setData({
id: options.id
}), t.d(options.id)
},
d(id){
let url = '/api/Article/detail',params={
id: id
},t = this;
A.post(url,params).then((r)=>{
t.setData({
detail: r
})
wxParse.wxParse('contentHtml', 'html', r.content, t, 5);
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {},
"navigationBarTitleText": "政策宣传"
}
\ No newline at end of file
... ...
<!--pages/attract/articleDetail/articleDetail.wxml-->
<view class='title margin_set'>{{detail.title}}</view>
<view class='content margin_set'>
<import src="/wxParse/wxParse.wxml" />
<template is="wxParse" data="{{wxParseData:contentHtml.nodes}}" />
</view>
\ No newline at end of file
... ...
/* pages/attract/articleDetail/articleDetail.wxss */
.title{
font-size: 34rpx;
color: #333;
font-weight: bold;
padding: 52rpx 0 40rpx;
}
.margin_set{
margin: 0 46rpx;
}
.content image{
width: 100%!important;
}
.content{
padding-bottom: 40rpx;
}
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@
<scroll-view bindscroll="scroll" bindscrolltolower="getMore" class="news_detail_container" hidden='{{!ifData}}' scrollTop="{{scrollTop}}" scrollY="true" style="height:{{windowHeight-200}}px;">
<view class='news_detail_items'>
<block wx:for='{{list}}' wx:key=''>
<navigator class='news_detail_item' url='/pages/attract/detail/detail?id={{item.id}}' id="{{item.id}}" bindtap='btn_matrix'>
<navigator class='news_detail_item' url='/pages/attract/articleDetail/articleDetail?id={{item.id}}' id="{{item.id}}" bindtap='btn_matrix'>
<view class='new_info'>
<view class='new_title'>{{item.title}}</view>
<view class='new_time_address'>
... ...
const A = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
startComment: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let t = this;
t.setData({
id:options.id
}),t.d(options.id),t.c()
},
d(id){
let url = '/api/interact/getPostsDetail',params = {
id:id
},t = this;
A.post(url,params).then((r)=>{
console.log(r)
t.setData({
detail:r
})
})
},
c(){
let url = '/api/interact/getPostsCommentList',t = this ,params={
id:t.data.id
};
A.post(url,params).then((r)=>{
t.setData({
comments:r.data
})
})
},
s(){
let t = this,params = {
id:t.data.id,
content: t.data.content
}, t. url ='/api/interact/setPostsComment';
A.post(url,params).then((r)=>{
console.log(r)
})
},
subComments(e){
this.setData({
content: e.detail.value
})
},
parentSet(e){
this.setData({
parent_id: e.currentTarget.id,
startComment: true
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<view class='container'>
<view class='item'>
<view class='item_top'>
员工个税减免干货都在这里了!各家HR惠存鸭~
</view>
<view class='item_top'>{{detail.title}}</view>
<view class='item_mid'>
<view class='item_mid_text'>
新个人所得税法近日备受关注。关于个人所得税,想必大家都十分关心,让我们通过以下问题!
{{detail.content}}
<span class='color_blue'>全部</span>
</view>
<!-- 图片盒子 -->
<view class='item_mid_box'>
<view class='item_mid_box_pic'>
<image src='../../images/weirenzheng@2x.png'></image>
</view>
<view class='item_mid_box_pic'>
<image src='../../images/weirenzheng@2x.png'></image>
</view>
<view class='item_mid_box_pic'>
<image src='../../images/weirenzheng@2x.png'></image>
<view class='item_mid_box' wx:if="{{detail.images}}">
<view class='item_mid_box_pic' wx:for='{{detail.images}}' wx:key=''>
<image src='{{item}}'></image>
</view>
</view>
</view>
... ... @@ -30,17 +19,17 @@
<view class='item_left'>
<!-- 头像 -->
<view class='item_left_pic'>
<image src='../../images/weirenzheng@3x.png'></image>
<image src='{{detail.avatar}}'></image>
</view>
<view class='item_name'>
张小亮
{{detail.nickname}}
</view>
<!-- 时间 -->
<view class='item_time'>
2019/01/21
{{detail.create_time_text}}
</view>
<!-- 删除 -->
<view class='item_delete'>
<view class='item_delete' hidden='{{detail.is_mine==0}}' bindtap='del'>
删除
</view>
</view>
... ... @@ -52,16 +41,15 @@
</view>
<!-- 数量 -->
<view class='item_right_number'>
26
{{detail.browse_count}}
</view>
<!-- 图片 -->
<view class='item_right_pic2'>
<image src='../../images/pinglun@3x.png'></image>
</view>
<!-- 数量 -->
<view class='item_right_number'>
26
{{detail.comment_count}}
</view>
</view>
... ... @@ -71,94 +59,57 @@
<view class='item_box'>
<!-- 回复内容1 -->
<view class='item item_bottom'>
<view class='item item_bottom' wx:for='{{comments}}' wx:key=''>
<view class='item_list'>
<view class='item_list_left'>
<view class='item_list_left_pic'>
<image src='../../images/img.jpg'></image>
<image src='{{item.avatar}}'></image>
</view>
</view>
<!-- 右边 -->
<view class='item_list_right'>
<!-- 名字 -->
<view class='item_list_right_name'>
Bigman
{{item.nickname}}
</view>
<!-- 评论 -->
<view class='item_list_right_title'>
祝愿祖国越来越强大!!!
<view class='item_list_right_title' bindtap='parentSet' id='{{item.id}}'>
{{item.content}}
</view>
<!-- 时间&点赞 -->
<view class='time_bottom'>
<view class='time_bottom_left'>
24分钟前
{{item.create_time_text}}
</view>
<view class='time_bottom_left'>
<view>21</view>
<view class='time_bottom_left_pic'>
<image src='../../images/zan@3x.png'></image>
<view>{{item.likes}}</view>
<view class='time_bottom_left_pic' bindtap='zan' id='{{item.id}}'>
<image src='../../images/zan@3x.png' wx:if="{{item.is_like==0}}"></image>
<image src='../../images/thumb-up-button@3x' wx:else></image>
</view>
</view>
</view>
<!-- 底部评论 -->
<view class='text_bottom'>
<span class='color_blue'>你好啊:</span>哪个人是你
</view>
<!-- 下划线 -->
<view class='underline'></view>
</view>
</view>
</view>
<!-- 回复内容2 -->
<view class='item item_bottom'>
<view class='item_list'>
<view class='item_list_left'>
<view class='item_list_left_pic'>
<image src='../../images/img.jpg'></image>
</view>
</view>
<!-- 右边 -->
<view class='item_list_right'>
<!-- 名字 -->
<view class='item_list_right_name'>
Bigman
</view>
<!-- 评论 -->
<view class='item_list_right_title'>
祝愿祖国越来越强大!!!
</view>
<!-- 时间&点赞 -->
<view class='time_bottom'>
<view class='time_bottom_left'>
24分钟前
</view>
<view class='time_bottom_left'>
<view>21</view>
<view class='time_bottom_left_pic'>
<image src='../../images/zan@3x.png'></image>
<view class='sec_comments' wx:if="{{item.child.length>0}}">
<view class='sec_comment' wx:for='{{item.child}}' wx:for-item='sec' wx:key=''>
<view class='text_bottom' >
<text class='color_blue'>{{sec.nickname}}:</text>{{sec.content}}
</view>
</view>
<view class='underline'></view>
</view>
<!-- 底部评论 -->
<!-- <view class='text_bottom'>
<span class='color_blue'>你好啊:</span>哪个人是你
</view> -->
<!-- 下划线 -->
<!-- <view class='underline'></view> -->
</view>
</view>
</view>
</view>
<!-- 底部发表按钮 -->
<view class='bottom_box'>
<view class='bottom_box_input'>
<input placeholder='发表评论...'></input>
<input placeholder='发表评论...' focus='{{startComment}}' bindtap='parentSet' bindinput='subComments' id=''></input>
</view>
<view class='bottom_box_text'>
<view class='bottom_box_text' bindtap='s'>
发表
</view>
</view>
... ...
... ... @@ -15,10 +15,9 @@ page{
padding: 48rpx 46rpx 0 32rpx;
}
.item_top{
font-size:30rpx;
font-family:PingFang SC;
font-weight:600;
font-weight:bold;
line-height:42rpx;
color:rgba(51,51,51,1);
opacity:1;
... ... @@ -288,5 +287,4 @@ page{
}
.item_box{
margin-top: 16rpx;
margin-bottom: 200rpx;
}
\ No newline at end of file
... ...
let t = getApp();
let A = getApp();
Page({
/**
... ... @@ -32,12 +32,30 @@ Page({
},
}), this.postList();
},
zan(e){
let url = '/api/interact/setLike',params = {
object_id: e.currentTarget.id,
type:'1'
}, index = e.currentTarget.dataset.idx,t=this,type=e.currentTarget.dataset.type;
A.post(url,params).then((r)=>{
t.data.postList[index].is_like = type==1?0:1
t.data.postList[index].likes = r
t.setData({
postList: t.data.postList
})
})
},
navdetail(e) {
wx.navigateTo({
url: '/pages/colleagues_2/colleagues_2?id='+e.currentTarget.id,
})
},
getzixun() {
let url = '/api/interact/getQuestionList', d = this, params = {
header: true,
page: d.data.page
};
t.post(url, params, false).then((r) => {
A.post(url, params, false).then((r) => {
let list = d.data.zixunList.concat(r.data);
d.setData({
zixunList: list
... ... @@ -58,7 +76,7 @@ Page({
let url = '/api/interact/getPostsList', d = this, params = {
page: d.data.page
};
t.post(url, params, false).then((r) => {
A.post(url, params, false).then((r) => {
let list = d.data.postList.concat(r.data);
d.setData({
postList: list
... ... @@ -81,7 +99,7 @@ Page({
let b = this, url = '/api/user/getAuthStatus', params = {
header: true
};
t.post(url, params).then((r) => {
A.post(url, params).then((r) => {
b.setData({
auth: r
});
... ... @@ -102,6 +120,8 @@ Page({
let t = this, idx = e.currentTarget.dataset.idx;
this.setData({
currentTab: idx,
zixunList:[],
postList:[]
}), idx ? t.postList() : t.getzixun();
},
jump() {
... ...
<view class="nav mainindex_nav top">
<!-- <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>
</view> -->
<scroll-view wx:if='{{auth=="2"}}' style='height:{{winHeight}}px' scroll-y="true">
<view class="none-box" hidden="{{!ifData}}">
<view>暂无相关咨询</view>
</view>
... ... @@ -58,7 +57,7 @@
</view>
<!-- 条目 -->
<view class='mid_item' wx:for='{{postList}}' wx:key=''>
<view class='mid_item_top'>
<view class='mid_item_top' bindtap='navdetail' id='{{item.id}}'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
... ... @@ -74,37 +73,30 @@
</view>
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>
<view class='mid_item_text' bindtap='navdetail' id='{{item.id}}'>
{{item.content}}
</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 class='mid_pic_box' wx:if='{{item.images}}'>
<view class='mid_pic_box_item' wx:for="{{item.images}}" wx:key='' wx:for-item='sec'>
<image src='{{sec}}'></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' hidden='{{item.is_can_del=="0"}}' id='{{item.id}}' bindtap='delete'>
删除
<view class='mid_item_like_left' >
<text hidden='{{item.is_can_del=="0"}}' id='{{item.id}}' bindtap='delete'>删除</text>
</view>
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue'>
<image src='../../images/thumb-up-button@3x.png'></image>
<view class='mid_like color_blue' bindtap='zan' id='{{item.id}}' data-idx='{{index}}' data-type='{{item.is_like}}'>
<image src='../../images/thumb-up-button@3x.png' wx:if='{{item.is_like==1}}'></image>
<image src='../../images/dainzan@3x.png' wx:else></image>
</view>
<!-- 数量 -->
<view class='mid_number color_blue'>
{{item.likes}}
</view>
<!-- 点赞 -->
<view class='mid_like'>
<image src='../../images/pinglun@3x.png'></image>
... ... @@ -114,9 +106,7 @@
{{item.comment_count}}
</view>
</view>
</view>
</view>
</view>
</view>
... ...
... ... @@ -18,7 +18,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
setText(e){
let t = this,s = e.currentTarget.dataset.type;
... ...
... ... @@ -15,11 +15,11 @@
<image src='/images/img.jpg'></image>
<!-- <import src="../../../wxParse/wxParse.wxml" />
<view class='content'>
<import src="../../../wxParse/wxParse.wxml" />
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view> -->
</view>
</view>
</view>
<view class='comment_box'>
... ...
... ... @@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": false,
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
... ... @@ -12,7 +12,7 @@
"autoAudits": false
},
"compileType": "miniprogram",
"libVersion": "2.6.1",
"libVersion": "2.6.2",
"appid": "wx75855734b0730d64",
"projectname": "%E6%9D%8E%E4%B8%83%E5%BA%84",
"debugOptions": {
... ... @@ -37,7 +37,7 @@
"list": []
},
"miniprogram": {
"current": 31,
"current": 36,
"list": [
{
"id": 0,
... ... @@ -262,6 +262,41 @@
"pathName": "pages/myComments/myComments",
"query": "",
"scene": null
},
{
"id": -1,
"name": "政企互动",
"pathName": "pages/enterprise/enterprise",
"query": "",
"scene": null
},
{
"id": -1,
"name": "慧招商列表",
"pathName": "pages/attract/list/list",
"query": "",
"scene": null
},
{
"id": -1,
"name": "慧招商详情",
"pathName": "pages/attract/detail/detail",
"query": "id=1",
"scene": null
},
{
"id": -1,
"name": "认证成功",
"pathName": "pages/my/approveInfo/approveInfo",
"query": "",
"scene": null
},
{
"id": -1,
"name": "帖子详情",
"pathName": "pages/colleagues_2/colleagues_2",
"query": "id=1",
"scene": null
}
]
}
... ...