Commit 25d067ad by 梁建民

签到

parent 6bd9dcb5
// pages/form/report/index.js
const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
text: '请选择举报原因',
id: '',
topic_id: '',
itemList: ['广告骚扰', '违法内容', '人身攻击', '侮辱性语言']
},
/**
......@@ -13,6 +22,11 @@ Page({
*/
onLoad: function (options) {
this.setData({
id: options.id,
topic_id: options.topic_id
});
},
/**
......@@ -56,11 +70,48 @@ Page({
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 () {
var self = this;
wx.showActionSheet({
itemList: ['广告骚扰', '违法内容', '人身攻击','侮辱性语言'],
itemList: ['广告骚扰', '违法内容', '人身攻击', '侮辱性语言'],
success(res) {
console.log(res.tapIndex)
self.setData({
text: self.data.itemList[res.tapIndex]
});
},
fail(res) {
console.log(res.errMsg)
......
<!--pages/form/report/index.wxml-->
<!-- pages/form/report/index.wxml -->
<view class="report-view">
<view class="report-top row bothSide verCenter">
<text class="text-left">举报原因</text>
<view class="text-right row verCenter" bindtap="openAction">
<text class="text">请选择举报原因</text>
<text class="icon iconfont iconChevron"></text>
<form bindsubmit="formSubmit">
<view class="report-top row bothSide verCenter">
<text class="text-left">举报原因</text>
<view class="text-right row verCenter" bindtap="openAction">
<text class="text">{{text}}</text>
<text class="icon iconfont iconChevron"></text>
</view>
</view>
</view>
<textarea class="textarea" placeholder="请填写具体问题(选填)"></textarea>
<view class="btn-com btn-com-b report-btn">提交举报</view>
<textarea class="textarea" name="describe" placeholder="请填写具体问题(选填)"></textarea>
<button class="btn-com btn-com-b report-btn" form-type="submit">提交举报</button>
</form>
</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({
/**
......@@ -6,85 +12,233 @@ Page({
*/
data: {
tabIndex: 1,
inputbar: null
inputbar: null,
topicInfo: {}, //今日话题
checkList: [], //最新数据
checkPopular: [], //热门数据
topic_id: '', //话题id
limit: 30,
p: 1,
total: 1,
isShowBottom: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
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)
this.data.inputbar.cancelEmoji();
},
switchTab: function(e) {
/**
*tab切换
*/
switchTab: function (e) {
let i = e.currentTarget.dataset.index;
this.setData({
isShowBottom: false
});
if (i == this.data.tabIndex) {
return
return;
} else {
this.setData({
tabIndex: i,
})
}
this.getData();
},
openAction:function(){
/**
* 举报
*/
openAction: function (e) {
let id = e.currentTarget.dataset.id;
let topic_id = this.data.topic_id;
wx.showActionSheet({
itemList: ['我要举报'],
success(res) {
console.log(res.tapIndex)
wx.navigateTo({
url: '/pages/form/report/index?id=' + id + '&topic_id=' + topic_id,
});
},
fail(res) {
console.log(res.errMsg)
}
})
},
/**
* 点赞
*/
praise: function (e) {
let type = e.currentTarget.dataset.type,
praise = '';
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) {
} 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="today-topic">
<view class="top-line"></view>
<view class="topic-content">
<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>
</view>
<view class="content-text">传说,软件工程师的工资要非常高?但是硬件工程师又如何呢?</view>
<view class="content-text">{{topicInfo.content}}</view>
</view>
</view>
<view class="switch-tab-com row">
......@@ -21,87 +21,69 @@
</view>
</view>
<view class="topic-list">
<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 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>
<block wx:if="{{tabIndex == 1}}">
<block wx:for="{{checkList}}" wx:for-item="item">
<view class="topic-item">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="{{item.avatar}}" class="img"></image>
<text class="name bold">{{item.company_name}}</text>
</view>
<view class="time">{{item.time}}</view>
</view>
<view class="down row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji32 hasdown"></text>
<text class="num">233</text>
<view class="item-center">{{item.content}}。</view>
<view class="item-bottom row bothSide verCenter">
<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 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>
</block>
</block>
<block wx:elif="{{tabIndex == 2}}">
<block wx:for="{{checkPopular}}" wx:for-item="item">
<view class="topic-item">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="{{item.avatar}}" class="img"></image>
<text class="name bold">{{item.company_name}}</text>
</view>
<view class="time">{{item.time}}</view>
</view>
<view class="down row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji30"></text>
<text class="num">233</text>
<view class="item-center">{{item.content}}。</view>
<view class="item-bottom row bothSide verCenter">
<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 class="more" bindtap="openAction">
<text class="icon iconfont iconiconxiantiaoshouji6"></text>
</view>
</view>
</block>
</block>
<view class="data-bottom row verCenter rowCenter" wx:if="{{isShowBottom}}">
<text class="line"></text>
<text class="text">我是有底线的</text>
<text class="line"></text>
</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>
\ No newline at end of file
......@@ -47,6 +47,10 @@
"currentL": -1,
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": 29,
"list": [
......@@ -259,6 +263,12 @@
"pathName": "pages/detail/good/index",
"query": "goodId=156393707673258&type=3",
"scene": null
},
{
"id": -1,
"name": "pages/tab/home/home",
"pathName": "pages/tab/home/home",
"scene": null
}
]
}
......
const auth_url = 'https://authapi.icsales.com';
const so_url = 'https://soapi.icsales.com';
const offer_url = "https://offerapi.icsales.com";
const user_url = 'https://userapi.icsales.com';
const goods_url = 'https://goodsapi.icsales.com';
const home_url = 'https://home.icsales.com';
// const auth_url = 'http://authapi.icsales.cc';
// const so_url = 'http://soapi.icsales.cc';
// const offer_url = "http://offerapi.icsales.cc";
// const user_url = 'http://userapi.icsales.cc';
// const goods_url = 'http://goodsapi.icsales.cc';
// const home_url = 'http://home.icsales.cc';
// const auth_url = 'https://authapi.icsales.com';
// const so_url = 'https://soapi.icsales.com';
// const offer_url = "https://offerapi.icsales.com";
// const user_url = 'https://userapi.icsales.com';
// const goods_url = 'https://goodsapi.icsales.com';
// const home_url = 'https://home.icsales.com';
const auth_url = 'http://authapi.icsales.cc';
const so_url = 'http://soapi.icsales.cc';
const offer_url = "http://offerapi.icsales.cc";
const user_url = 'http://userapi.icsales.cc';
const goods_url = 'http://goodsapi.icsales.cc';
const home_url = 'http://home.icsales.cc';
const apis = {
/**
......@@ -190,8 +190,8 @@ const apis = {
*/
userMarkmsg: user_url + '/user/markmsg',
/**
* 环信通讯记录添加
*/
* 环信通讯记录添加
*/
addrecord: user_url + '/im/add/record',
/**
* 环信通讯记录列表(最多显示30条最新的聊天记录)
......@@ -202,8 +202,8 @@ const apis = {
*/
hotgoods: home_url + '/hotgoods',
/**
* 获取会员系统通知
*/
* 获取会员系统通知
*/
userSysmsg: user_url + '/user/sysmsg',
/**
* 获取会员活动通知
......@@ -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