关注企业接口

This commit is contained in:
zdx
2020-12-30 17:34:35 +08:00
parent 428d0bb7d9
commit 043dfce6cc
25 changed files with 143 additions and 198 deletions

View File

@@ -26,9 +26,10 @@ const crowdfunds = (company_id, category_id, page) => req({
const crowdfundsDetail = crowdfund_id => req({
url: "crowdfunds/" + crowdfund_id
})
// 获取关注列表
const getCrowdfundsLike = page => req({
url: "user/crowdfunds",
url: "user/subscribes",
method: "get",
data: {
page: page
@@ -36,7 +37,7 @@ const getCrowdfundsLike = page => req({
})
//项目关注
const crowdfundsLike = crowdfund_id => req({
url: "crowdfunds/like",
url: "crowdfunds/subscribe",
method: "POST",
data: {
crowdfund_id: crowdfund_id
@@ -44,7 +45,7 @@ const crowdfundsLike = crowdfund_id => req({
})
//项目取消关注
const crowdfundsUnLike = crowdfund_id => req({
url: "crowdfunds/unlike",
url: "crowdfunds/unsubscribe",
method: "POST",
data: {
crowdfund_id: crowdfund_id
@@ -177,6 +178,12 @@ const getRefundLogsInfo = (refundId) => req({
url: "refunds/" + refundId + '/logs'
})
// 关注企业 取消关注企业
const companyLike = (companyId) => req({
url: "company/" + companyId + '/subscribe'
})
export default ({
crowdfundcategory, //项目筹集分类
@@ -189,6 +196,7 @@ export default ({
crowdfundsCreatOrder, //创建订单
wechat, //微信支付
company, //企业基本信息
companyLike,//关注企业
actives, //企业活动列表
activesDetail, //企业活动详情
activesEnroll, //企业报名

View File

@@ -3,7 +3,19 @@
* 用户
*/
import {req} from "../request"
// 个人中心信息
const userInfo = () => req({
url: "user/center"
})
// 获取关注企业列表
const companySubscribesList = ( page) => req({
url: "user/subscribes/company",
data: {
page: page
}
})
export default({
userInfo,//用户基本信息
companySubscribesList,//关注企业列表
})

View File

@@ -1,7 +1,6 @@
{
"pages": [
"pages/welcome/index",
"pages/user/index",
"pages/config/config",
"pages/company/index",
"pages/company/search/search",

View File

@@ -89,5 +89,16 @@ Page({
wx.navigateTo({
url: '/pages/mall/index',
})
},
// 关注企业 取消关注企业
force() {
wx.$api.companyModule.companyLike(wx.getStorageSync('company_id')).then(res => {
console.log(res);
var info = this.data.info;
info.isSubscrib = !this.data.info.isSubscrib
this.setData({
info: info
})
})
}
})

View File

@@ -26,8 +26,8 @@
<view class=" cop_call cop_shop" catchtap="goMall">
<image src="/static/images/com_shop.png" mode="widthFix"></image>进入商城
</view>
<view class=" cop_call cop_focus">
<image src="/static/images/eye.png" mode="widthFix"></image>关注企业
<view class=" cop_call cop_focus" catchtap="force">
<image src="/static/images/eye.png" mode="widthFix"></image> {{info.isSubscrib ? '取消关注' :'关注企业'}}
</view>
</view>
</view>

View File

@@ -89,11 +89,11 @@ Page({
// 关注取消关注项目
islike() {
if (!this.data.info.isLike) {
if (!this.data.info.isSubscribed) {
wx.$api.companyModule.crowdfundsLike(this.data.crowdfund_id).then(res => {
var info = this.data.info;
info.isLike = true;
info.likes = res.likes
info.isSubscribed = true;
info.subscribes = res.subscribes
this.setData({
info: info
})
@@ -101,8 +101,8 @@ Page({
} else {
wx.$api.companyModule.crowdfundsUnLike(this.data.crowdfund_id).then(res => {
var info = this.data.info;
info.isLike = false;
info.likes = res.likes
info.isSubscribed = false;
info.subscribes = res.subscribes
this.setData({
info: info
})

View File

@@ -104,15 +104,14 @@
<view class="project_now_act {{acted?'acted':''}}">
<view class="left" wx:if='{{info.status!=2}}' catchtap="islike" >
<image class="collect" mode="widthFix"
src="{{info.isLike ? '/static/images/collect.png':'/static/images/unCollect.png'}}">
src="{{info.isSubscribed ? '/static/images/collect.png':'/static/images/unCollect.png'}}">
</image>
关注{{info.likes>0?info.likes:''}}
关注{{info.subscribes>0?info.subscribes:''}}
</view>
<view wx:else class="left">
{{info.likes || 0}}人已关注
{{info.subscribes || 0}}人已关注
</view>
<span class="nolike" wx:if='{{info.status==3 || info.status==4 }}'>我要支持</span>
<button size="mini" class="{{info.isLike?'nolike':''}}" bindtap="{{!info.isLike?'like':'islike'}}" wx:elif='{{info.status==2}}' hover-class="other-button-hover">{{!info.isLike?'关注项目':'不再关注项目'}}</button>
<button size="mini" class="{{info.isSubscribed?'nolike':''}}" bindtap="{{!info.isSubscribed?'like':'islike'}}" wx:elif='{{info.status==2}}' hover-class="other-button-hover">{{!info.isSubscribed?'关注项目':'不再关注项目'}}</button>
<span wx:else catchtap="goDetail">我要支持</span>
</view>

View File

@@ -9,13 +9,13 @@ Page({
page: 1,
has_more: true
},
onShow() {
onLoad() {
this.getList();
},
// 获取活动列表
getList() {
wx.$api.companyModule.getCrowdfundsLike(this.data.page).then(res => {
wx.$api.user.companySubscribesList(this.data.page).then(res => {
setTimeout(() => {
wx.hideLoading({})
}, 1000);
@@ -45,12 +45,6 @@ Page({
})
}
},
//跳转到详情页
goUrl(e) {
wx.navigateTo({
url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id,
})
},
// 取消项目
crowdfundsUnLike(e) {
var id = e.currentTarget.dataset.id
@@ -71,7 +65,7 @@ Page({
wx.showLoading({
title: '取消中',
})
wx.$api.companyModule.crowdfundsUnLike(id).then(res => {
wx.$api.companyModule.companyLike(id).then(res => {
this.setData({
lists: temp
})
@@ -84,5 +78,12 @@ Page({
}
}
})
},
runIn(e) {
console.log(e.currentTarget.dataset.id)
wx.setStorageSync('company_id', e.currentTarget.dataset.id)
wx.navigateTo({
url: '/pages/home/index',
})
}
})

View File

@@ -1,12 +1,11 @@
<!-- <view class="content" wx:for="{{lists}}" :key="index"> -->
<view class="content" wx:for="{{10}}" :key="index">
<view class="content" wx:for="{{lists}}" :key="index">
<image src="{{item.cover}}" mode="aspectFill"></image>
<view class="left">
<view class="title">域展科技 <span catchtap="crowdfundsUnLike" data-id='{{item.crowdfund_id}}'
<view class="title">域展科技 <span catchtap="crowdfundsUnLike" data-id='{{item.company_id}}'
data-index='{{index}}'>已关注</span></view>
<view class="bottom"><span>诚信值1587</span></view>
</view>
<navigator hover-class="none" url="/pages/home/index" class="runIn">进入</navigator>
<navigator hover-class="none" data-id='{{item.company_id}}' catchtap="runIn" class="runIn">进入</navigator>
</view>
<view class="has_more">

View File

@@ -1,88 +1,11 @@
// pages/user/companyMine/focusedProject/focusedProject.js
Page({
/**
* 页面的初始数据
*/
data: {
lists: [],
page: 1,
has_more: true
name:'***'
},
onShow() {
this.getList();
},
// 获取活动列表
getList() {
wx.$api.companyModule.getCrowdfundsLike(this.data.page).then(res => {
setTimeout(() => {
wx.hideLoading({})
}, 1000);
var lists = this.data.lists.concat(res.data)
if (res.page.has_more) {
onLoad(e) {
console.log(e.name);
this.setData({
has_more: res.page.has_more,
page: this.data.page + 1,
lists: lists
})
} else {
this.setData({
has_more: res.page.has_more,
lists: lists
})
}
name: e.name
})
},
// 触底加载更多
onReachBottom() {
if (this.data.has_more) {
this.getList();
} else {
wx.showToast({
icon: 'none',
title: '没有更多',
})
}
},
//跳转到详情页
goUrl(e) {
wx.navigateTo({
url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id,
})
},
// 取消项目
crowdfundsUnLike(e) {
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var arr = this.data.lists
var temp = []
for (var i = 0; i < arr.length; i++) {
if (i != index) {
temp.push(arr[i]);
}
}
console.log(temp)
wx.showModal({
title: '提示',
content: '确认取消关注么?',
success: res => {
if (res.confirm) {
wx.showLoading({
title: '取消中',
})
wx.$api.companyModule.crowdfundsUnLike(id).then(res => {
this.setData({
lists: temp
})
wx.showToast({
title: '取消成功',
icon:'none'
})
wx.hideLoading({})
});
}
}
})
}
})

View File

@@ -1,6 +1,6 @@
<view class="content">
<image class="bg" src="/static/images/zs.png" mode="aspectFill"></image>
<view class="title">企获客授权 [ 艾米家的傻钢 ] 区块链证书</view>
<view class="title">企获客授权 [ {{name}} ] 区块链证书</view>
<view class="num">
<view class="font32">区块链编号</view>
<view class="font22">jiquwrofkdjs09u834545124dkafodjfihi</view>

View File

@@ -10,7 +10,7 @@ Page({
has_more: true
},
onShow() {
this.getList();
// this.getList();
},
// 获取活动列表
@@ -36,14 +36,14 @@ Page({
},
// 触底加载更多
onReachBottom() {
if (this.data.has_more) {
this.getList();
} else {
wx.showToast({
icon: 'none',
title: '没有更多',
})
}
// if (this.data.has_more) {
// this.getList();
// } else {
// wx.showToast({
// icon: 'none',
// title: '没有更多',
// })
// }
},
//跳转到详情页
goUrl(e) {

View File

@@ -15,6 +15,6 @@
</view>
<view class="has_more">
<image wx:if='{{lists.length==0}}' src="/static/images/no_list.png" style="width:200rpx;" mode="widthFix"></image>
<!-- <image wx:if='{{lists.length==0}}' src="/static/images/no_list.png" style="width:200rpx;" mode="widthFix"></image> -->
<span>{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}</span>
</view>

View File

@@ -5,62 +5,24 @@ Page({
* 页面的初始数据
*/
data: {
info:''
},
onShow() {
this.userInfo();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
userInfo() {
wx.$api.user.userInfo().then(res => {
console.log(res);
this.setData({
info:res
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
showtoast() {
wx.showToast({
title: '正在完善,看看其他的吧',
icon: 'none'
})
}
})

View File

@@ -1,6 +1,6 @@
{
"usingComponents" : {},
"navigationBarTitleText" : "个人中心",
"navigationBarBackgroundColor" : "#2e81fc",
"navigationBarBackgroundColor" : "#378fff",
"navigationBarTextStyle" : "white"
}

View File

@@ -1,17 +1,17 @@
<!-- 个人中心 -->
<view class="userTop">
<view class="userTop-head">
<view class="userTop-name"> 艾米家的傻钢^ <text>游客</text> </view>
<image class="userTop-img" src="/static/images/goods_text.png"></image>
<view class="userTop-name"> {{info.user.nickname}}<text>{{info.vip.is_vip?'会员':'游客'}}</text> </view>
<image class="userTop-img" src="{{info.user.avatar}}"></image>
</view>
<view class="userTop-nav">
<!-- <view class="userTop-label"> <text>89</text> 钱包 </view> -->
<navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/myTeam/myTeam">
<text>128</text> 团队 </navigator>
<text>{{info.counter.teams || 10}}</text> 团队 </navigator>
<navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/focusedCompany/focusedCompany">
<text>11259</text> 关注企业 </navigator>
<text>{{info.counter.subscriptions}}</text> 关注企业 </navigator>
</view>
<view class="userTop-vip">
<view class="userTop-vip" catchtap="showtoast">
<view class="userTop-text">
<image src="/static/user_iocn/user_crown.png"></image>升级VIP会员 享会员特权
</view>
@@ -33,7 +33,7 @@
</view>
<text>我的订单</text>
</navigator>
<view class="userNav-label">
<view class="userNav-label" catchtap="showtoast">
<view class="userNav-label-img">
<image src="/static/user_iocn/userNav_02.png"></image>
</view>
@@ -61,7 +61,7 @@
<navigator hover-class="none" url="/pages/mall/mall_cart/mall_cart" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_02.png"></image>
<view class="userTool-label-tips">2</view>
<view wx:if='{{info.cart_counts>0}}' class="userTool-label-tips">{{ info.cart_counts}}</view>
</view>
<text>我的购物车</text>
</navigator>
@@ -85,7 +85,7 @@
</view>
<text>项目关注</text>
</navigator>
<navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain" class="userTool-label">
<navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain?name={{info.user.nickname}}" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_06.png"></image>
</view>

View File

@@ -10,7 +10,7 @@ page {
/* 个人中心头部 */
.userTop {
background-color: #2e81fc;
background-color: #378fff;
padding: 0 30rpx;
box-sizing: border-box;
color: #fff;
@@ -43,6 +43,7 @@ page {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
box-shadow: 0 0 10rpx;
}
.userTop-nav {
@@ -217,6 +218,7 @@ page {
margin-bottom: 15rpx;
background-color: red;
}
.userTool-label-img-button image {
position: absolute;
left: 0;

View File

@@ -1,3 +1,8 @@
Page({
data: {}
data: {},
besure(){
wx.navigateBack({
delta: 0,
})
}
})

View File

@@ -1,4 +1,4 @@
<view class="content">
<textarea placeholder="输入您的意见与建议"></textarea>
<view>确认提交</view>
<view catchtap="besure">确认提交</view>
</view>

View File

@@ -13,7 +13,11 @@ Page({
date: '2016-09-01',
region: ['广东省', '广州市', '海珠区'],
},
besure(){
wx.navigateBack({
delta: 0,
})
},
// 选择性别
pickSex: function (e) {
this.setData({

View File

@@ -63,5 +63,5 @@
</view>
<view class="beSure" catchtap="logOut">退出登录</view>
<view class="beSure beSure1" catchtap="beSure">保存</view>
<view class="beSure" catchtap="besure">退出登录</view>
<view class="beSure beSure1" catchtap="besure">保存</view>

View File

@@ -1,2 +1,7 @@
<image src="/static/images/company_bg4.png" mode="widthFix" style="width:100%;"></image>
<rich-text nodes="{{nodes}}"></rich-text>
<!-- <rich-text nodes="{{nodes}}"></rich-text> -->
<view>
电子科技有限公司是一家集产品研发生产及销售的大型高科技电子企业是全球专业的液晶广告机液晶电视及液晶拼接墙制造商从创立伊始历经多年的稳健发展以推动国内液晶广告机的普及化为己任以提升人类视听享受为目标公司旗下品牌博视TBOSV已经成为全球普遍赞誉的知名品牌。上海域展电子科技有限公司成立于2006年。我们凭借着"以品质为根本、以创新求发展"的理念;力争以优质的全方位服务为客户提供具有竞争力价...
电子科技有限公司是一家集产品研发生产及销售的大型高科技电子企业是全球专业的液晶广告机液晶电视及液晶拼接墙制造商从创立伊始历经多年的稳健发展以推动国内液晶广告机的普及化为己任以提升人类视听享受为目标公司旗下品牌博视TBOSV已经成为全球普遍赞誉的知名品牌。上海域展电子科技有限公司成立于2006年。我们凭借着"以品质为根本、以创新求发展"的理念;力争以优质的全方位服务为客户提供具有竞争力价...
</view>

View File

@@ -1,3 +1,9 @@
Page({
data: {}
data: {},
showtoast() {
wx.showToast({
title: '正在完善,看看其他的吧',
icon: 'none'
})
}
})

View File

@@ -1,4 +1,7 @@
<navigator class="item" hover-class="none" url="/pages/user/setting/aboutMine/aboutMine">
<!-- <navigator class="item" hover-class="none" url="/pages/user/setting/aboutMine/aboutMine">
<image src="/static/images/aboutMine.png" mode="widthFix" /> 个人信息
</navigator> -->
<navigator class="item" hover-class="none" catchtap="showtoast">
<image src="/static/images/aboutMine.png" mode="widthFix" /> 个人信息
</navigator>
<navigator class="item" hover-class="none" url="/pages/user/setting/aboutAdvice/aboutAdvice">

View File

@@ -135,6 +135,12 @@
{
"name": "pages/user/setting/aboutUs/aboutUs",
"pathName": "pages/user/setting/aboutUs/aboutUs",
"query": "",
"scene": null
},
{
"name": "pages/home/index",
"pathName": "pages/home/index",
"scene": null
}
]