Commit 55cddca5 by 施宇

Merge branch 'master' of http://119.23.72.7/shiyu/icsalesProgram

parents d714ccb2 bb4161fc
...@@ -48,9 +48,9 @@ App({ ...@@ -48,9 +48,9 @@ App({
if (this.globalData.auth) { if (this.globalData.auth) {
//是否登录 //是否登录
if (this.globalData.token) { if (this.globalData.token) {
wx.switchTab({ // wx.switchTab({
url: '/pages/tab/home/home' // url: '/pages/tab/home/home'
}); // });
} else { } else {
wx.redirectTo({ wx.redirectTo({
url: '/pages/person/login/index' url: '/pages/person/login/index'
......
// pages/form/report/index.js const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
text: '请选择举报原因',
id: '',
topic_id: '',
itemList: ['广告骚扰', '违法内容', '人身攻击', '侮辱性语言']
}, },
/** /**
...@@ -13,6 +22,11 @@ Page({ ...@@ -13,6 +22,11 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
id: options.id,
topic_id: options.topic_id
});
}, },
/** /**
...@@ -56,11 +70,48 @@ Page({ ...@@ -56,11 +70,48 @@ Page({
onReachBottom: function () { onReachBottom: function () {
}, },
/**
* 验证字段
*/
calcForm: function () {
},
/**
* 表单提交
*/
formSubmit: function (e) {
http.getData(apis.checkReport, 'GET', {
cause: this.data.text,
describe: e.detail.value.describe,
topic_id: this.data.topic_id,
id: this.data.id,
}, (res) => {
if (res.errcode === 0) {
wx.navigateTo({
url: '/pages/list/sigin/index'
});
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
},
openAction: function () { openAction: function () {
var self = this;
wx.showActionSheet({ wx.showActionSheet({
itemList: ['广告骚扰', '违法内容', '人身攻击','侮辱性语言'], itemList: ['广告骚扰', '违法内容', '人身攻击', '侮辱性语言'],
success(res) { success(res) {
console.log(res.tapIndex) self.setData({
text: self.data.itemList[res.tapIndex]
});
}, },
fail(res) { fail(res) {
console.log(res.errMsg) console.log(res.errMsg)
......
<!--pages/form/report/index.wxml--> <!-- pages/form/report/index.wxml -->
<view class="report-view"> <view class="report-view">
<view class="report-top row bothSide verCenter"> <form bindsubmit="formSubmit">
<text class="text-left">举报原因</text> <view class="report-top row bothSide verCenter">
<view class="text-right row verCenter" bindtap="openAction"> <text class="text-left">举报原因</text>
<text class="text">请选择举报原因</text> <view class="text-right row verCenter" bindtap="openAction">
<text class="icon iconfont iconChevron"></text> <text class="text">{{text}}</text>
<text class="icon iconfont iconChevron"></text>
</view>
</view> </view>
</view> <textarea class="textarea" name="describe" placeholder="请填写具体问题(选填)"></textarea>
<textarea class="textarea" placeholder="请填写具体问题(选填)"></textarea> <button class="btn-com btn-com-b report-btn" form-type="submit">提交举报</button>
<view class="btn-com btn-com-b report-btn">提交举报</view> </form>
</view> </view>
\ No newline at end of file
// pages/list/signin/index.js const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
...@@ -6,85 +12,242 @@ Page({ ...@@ -6,85 +12,242 @@ Page({
*/ */
data: { data: {
tabIndex: 1, tabIndex: 1,
inputbar: null inputbar: null,
topicInfo: {}, //今日话题
checkList: [], //最新数据
checkPopular: [], //热门数据
topic_id: '', //话题id
limit: 10,
p: 1,
total: 1,
isShowBottom: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function() { onReady: function () {
this.data.inputbar = this.selectComponent("#topic-inputbar"); this.data.inputbar = this.selectComponent("#topic-inputbar");
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function () {
//获取话题信息
http.getData(apis.topicInfo, 'GET', null, (res) => {
if (res.errcode === 0) {
this.setData({
topicInfo: res.data,
topic_id: res.data.id
});
}
}, false, false, true);
//最新签到列表
http.getData(apis.checkList, 'GET', {
page: this.data.p,
limit: this.data.limit
}, (res) => {
if (res.errcode === 0) {
this.setData({
total: res.total,
checkList: res.data
});
}
}, false, false, true);
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function() { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function() { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function() { onPullDownRefresh: function () {
}, },
getData: function () {
let url;
if (this.data.tabIndex == 1) {
url = apis.checkList;
} else {
url = apis.checkPopular;
}
http.getData(url, 'get', {
limit: this.data.limit,
page: this.data.p
}, (res) => {
if (res.errcode === 0) {
if (this.data.tabIndex == 1) {
//最新
let newArr = [];
if (this.data.p > 1) {
newArr = this.data.checkList;
}
newArr = newArr.concat(res.data);
this.setData({
checkList: newArr,
total: res.total
});
} else if (this.data.tabIndex == 2) {
//热门
this.setData({
checkPopular: res.data,
});
}
}
}, true, false, true)
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
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
});
this.getData();
}
}, },
sendSignin: function(evt) { /**
* 发布
*/
sendSignin: function (evt) {
console.log(evt) console.log(evt)
this.data.inputbar.cancelEmoji(); this.data.inputbar.cancelEmoji();
}, },
switchTab: function(e) { /**
*tab切换
*/
switchTab: function (e) {
let i = e.currentTarget.dataset.index; let i = e.currentTarget.dataset.index;
this.setData({
isShowBottom: false
});
if (i == this.data.tabIndex) { if (i == this.data.tabIndex) {
return return;
} else { } else {
this.setData({ this.setData({
tabIndex: i, tabIndex: i,
}) })
} }
this.getData();
}, },
openAction:function(){ /**
* 举报
*/
openAction: function (e) {
let id = e.currentTarget.dataset.id;
let topic_id = this.data.topic_id;
wx.showActionSheet({ wx.showActionSheet({
itemList: ['我要举报'], itemList: ['我要举报'],
success(res) { success(res) {
console.log(res.tapIndex) wx.navigateTo({
url: '/pages/form/report/index?id=' + id + '&topic_id=' + topic_id,
});
}, },
fail(res) { fail(res) {
console.log(res.errMsg) console.log(res.errMsg)
} }
}) })
},
/**
* 点赞
*/
praise: function (e) {
let type = e.currentTarget.dataset.type;
let praise = '';
let index = e.currentTarget.dataset.index;
console.log(index)
if (type == 1) {
praise = true;
} else {
praise = '';
}
http.getData(apis.checkPraise, 'GET', {
topic_id: this.data.topic_id,
praise: praise,
id: e.currentTarget.dataset.id
}, (res) => {
if (res.errcode === 0) {
wx.showToast({
title: '点赞成功',
icon: 'none',
duration: 2000
});
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, false, false, true);
} }
}) })
\ No newline at end of file
<!--pages/list/signin/index.wxml--> <!-- pages/list/signin/index.wxml -->
<view class="signin-view"> <view class="signin-view">
<view class="today-topic"> <view class="today-topic">
<view class="top-line"></view> <view class="top-line"></view>
<view class="topic-content"> <view class="topic-content">
<view class="content-top row bothSide verCenter"> <view class="content-top row bothSide verCenter">
<text class="content-title bold">“硬件重要还是软件重要”</text> <text class="content-title bold">{{topicInfo.title}}</text>
<text class="content-mask">#今日话题</text> <text class="content-mask">#今日话题</text>
</view> </view>
<view class="content-text">传说,软件工程师的工资要非常高?但是硬件工程师又如何呢?</view> <view class="content-text">{{topicInfo.content}}</view>
</view> </view>
</view> </view>
<view class="switch-tab-com row"> <view class="switch-tab-com row">
...@@ -21,87 +21,69 @@ ...@@ -21,87 +21,69 @@
</view> </view>
</view> </view>
<view class="topic-list"> <view class="topic-list">
<view class="topic-item"> <block wx:if="{{tabIndex == 1}}">
<view class="item-top row bothSide px-hr-bottom verCenter"> <block wx:for="{{checkList}}" wx:for-item="item">
<view class="top-left row verCenter"> <view class="topic-item">
<image src="/res/images/imgs/test.jpg" class="img"></image> <view class="item-top row bothSide px-hr-bottom verCenter">
<text class="name bold">深圳邦马特科技有限公司</text> <view class="top-left row verCenter">
</view> <image src="{{item.avatar}}" class="img"></image>
<view class="time">05-10 10:15</view> <text class="name bold">{{item.company_name}}</text>
</view> </view>
<view class="item-center"> <view class="time">{{item.time}}</view>
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-bottom row bothSide verCenter">
<view class="up-down row verCenter">
<view class="up row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji33"></text>
<text class="num">123</text>
</view>
<view class="down row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji30"></text>
<text class="num">233</text>
</view>
</view>
<view class="more">
<text class="icon iconfont iconiconxiantiaoshouji6"></text>
</view>
</view>
</view>
<view class="topic-item">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="/res/images/imgs/test.jpg" class="img"></image>
<text class="name bold">深圳邦马特科技有限公司</text>
</view>
<view class="time">05-10 10:15</view>
</view>
<view class="item-center">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-bottom row bothSide verCenter">
<view class="up-down row verCenter">
<view class="up row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji31 hasup"></text>
<text class="num">123</text>
</view> </view>
<view class="down row verCenter"> <view class="item-center">{{item.content}}。</view>
<text class="icon iconfont iconiconxiantiaoshouji32 hasdown"></text> <view class="item-bottom row bothSide verCenter">
<text class="num">233</text> <view class="up-down row verCenter">
<view class="up row verCenter" bind:tap="praise" data-id="{{item.id}}" data-type="1" data-index="{{index}}">
<text class="icon iconfont iconiconxiantiaoshouji31 {{item.is_praise == 1 ? 'hasup':'' }}"></text>
<text class="num">{{item.praise}}</text>
</view>
<view class="down row verCenter" bind:tap="praise" data-id="{{item.id}}" data-type="2" data-index="{{index}}">
<text class="icon iconfont iconiconxiantiaoshouji30 {{item.is_praise == 2 ? 'hasdown':'' }}"></text>
<text class="num">{{item.low}}</text>
</view>
</view>
<view class="more" bindtap="openAction" data-id="{{item.id}}">
<text class="icon iconfont iconiconxiantiaoshouji6"></text>
</view>
</view> </view>
</view> </view>
<view class="more"> </block>
<text class="icon iconfont iconiconxiantiaoshouji6"></text> </block>
</view> <block wx:elif="{{tabIndex == 2}}">
</view> <block wx:for="{{checkPopular}}" wx:for-item="item">
</view> <view class="topic-item">
<view class="topic-item"> <view class="item-top row bothSide px-hr-bottom verCenter">
<view class="item-top row bothSide px-hr-bottom verCenter"> <view class="top-left row verCenter">
<view class="top-left row verCenter"> <image src="{{item.avatar}}" class="img"></image>
<image src="/res/images/imgs/test.jpg" class="img"></image> <text class="name bold">{{item.company_name}}</text>
<text class="name bold">深圳邦马特科技有限公司</text> </view>
</view> <view class="time">{{item.time}}</view>
<view class="time">05-10 10:15</view>
</view>
<view class="item-center">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-bottom row bothSide verCenter">
<view class="up-down row verCenter">
<view class="up row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji31 hasup"></text>
<text class="num">123</text>
</view> </view>
<view class="down row verCenter"> <view class="item-center">{{item.content}}。</view>
<text class="icon iconfont iconiconxiantiaoshouji30"></text> <view class="item-bottom row bothSide verCenter">
<text class="num">233</text> <view class="up-down row verCenter">
<view class="up row verCenter" bind:tap="praise" data-id="{{item.id}}" data-type="1">
<text class="icon iconfont iconiconxiantiaoshouji31 {{item.is_praise == 1 ? 'hasup':'' }}"></text>
<text class="num">{{item.praise}}</text>
</view>
<view class="down row verCenter" bind:tap="praise" data-id="{{item.id}}" data-type="2">
<text class="icon iconfont iconiconxiantiaoshouji30 {{item.is_praise == 2 ? 'hasdown':'' }}"></text>
<text class="num">{{item.low}}</text>
</view>
</view>
<view class="more" bindtap="openAction" data-id="{{item.id}}">
<text class="icon iconfont iconiconxiantiaoshouji6"></text>
</view>
</view> </view>
</view> </view>
<view class="more" bindtap="openAction"> </block>
<text class="icon iconfont iconiconxiantiaoshouji6"></text> </block>
</view> <view class="data-bottom row verCenter rowCenter" wx:if="{{isShowBottom}}">
</view> <text class="line"></text>
<text class="text">我是有底线的</text>
<text class="line"></text>
</view> </view>
</view> </view>
<chat-inputbar id="topic-inputbar" is-topic="1" bind:newTextMsg="sendSignin"></chat-inputbar> <chat-inputbar id="topic-inputbar" is-topic="1" bind:newTextMsg="sendSignin"></chat-inputbar>
</view> </view>
\ No newline at end of file
...@@ -47,8 +47,12 @@ ...@@ -47,8 +47,12 @@
"currentL": -1, "currentL": -1,
"list": [] "list": []
}, },
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": { "miniprogram": {
"current": 30, "current": 29,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -261,10 +265,9 @@ ...@@ -261,10 +265,9 @@
"scene": null "scene": null
}, },
{ {
"id": 30, "id": -1,
"name": "pages/detail/good/index", "name": "pages/tab/home/home",
"pathName": "pages/detail/good/index", "pathName": "pages/tab/home/home",
"query": "goodId=156628347362412&type=3",
"scene": null "scene": null
} }
] ]
......
...@@ -190,8 +190,8 @@ const apis = { ...@@ -190,8 +190,8 @@ const apis = {
*/ */
userMarkmsg: user_url + '/user/markmsg', userMarkmsg: user_url + '/user/markmsg',
/** /**
* 环信通讯记录添加 * 环信通讯记录添加
*/ */
addrecord: user_url + '/im/add/record', addrecord: user_url + '/im/add/record',
/** /**
* 环信通讯记录列表(最多显示30条最新的聊天记录) * 环信通讯记录列表(最多显示30条最新的聊天记录)
...@@ -202,8 +202,8 @@ const apis = { ...@@ -202,8 +202,8 @@ const apis = {
*/ */
hotgoods: home_url + '/hotgoods', hotgoods: home_url + '/hotgoods',
/** /**
* 获取会员系统通知 * 获取会员系统通知
*/ */
userSysmsg: user_url + '/user/sysmsg', userSysmsg: user_url + '/user/sysmsg',
/** /**
* 获取会员活动通知 * 获取会员活动通知
...@@ -212,7 +212,31 @@ const apis = { ...@@ -212,7 +212,31 @@ const apis = {
/** /**
* 标记会员通知(已读) * 标记会员通知(已读)
*/ */
userMarkmsg: user_url + '/user/markmsg' userMarkmsg: user_url + '/user/markmsg',
/**
* 获取话题信息
*/
topicInfo: user_url + '/topic/info',
/**
* 签到列表
*/
checkList: user_url + '/check/list',
/**
* 签到
*/
checkAdd: user_url + '/check/add',
/**
* 举报签到
*/
checkReport: user_url + '/check/report',
/**
* 点赞或者点low
*/
checkPraise: user_url + '/check/praise',
/**
* 热门话题(最多30条, 5 分钟更新一次)
*/
checkPopular: user_url + '/check/popular'
} }
......
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