From 043dfce6ccca837566abbe4ad6e4e331d307cbf9 Mon Sep 17 00:00:00 2001
From: zdx <731335498@qq.com>
Date: Wed, 30 Dec 2020 17:34:35 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E4=BC=81=E4=B8=9A=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apis/interfaces/home.js | 14 ++-
apis/interfaces/user.js | 14 ++-
app.json | 1 -
pages/home/index.js | 11 +++
pages/home/index.wxml | 4 +-
pages/home/projectDetail/projectDetail.js | 10 +--
pages/home/projectDetail/projectDetail.wxml | 9 +-
.../focusedCompany/focusedCompany.js | 21 ++---
.../focusedCompany/focusedCompany.wxml | 7 +-
.../companyMine/myBlockchain/myBlockchain.js | 87 ++-----------------
.../myBlockchain/myBlockchain.wxml | 2 +-
pages/user/companyMine/myTeam/myTeam.js | 18 ++--
pages/user/companyMine/myTeam/myTeam.wxml | 2 +-
pages/user/index.js | 72 ++++-----------
pages/user/index.json | 2 +-
pages/user/index.wxml | 16 ++--
pages/user/index.wxss | 6 +-
pages/user/setting/aboutAdvice/aboutAdvice.js | 7 +-
.../user/setting/aboutAdvice/aboutAdvice.wxml | 2 +-
pages/user/setting/aboutMine/aboutMine.js | 6 +-
pages/user/setting/aboutMine/aboutMine.wxml | 4 +-
pages/user/setting/aboutUs/aboutUs.wxml | 7 +-
pages/user/setting/setting.js | 8 +-
pages/user/setting/setting.wxml | 5 +-
project.config.json | 6 ++
25 files changed, 143 insertions(+), 198 deletions(-)
diff --git a/apis/interfaces/home.js b/apis/interfaces/home.js
index 21c21c3..ac1034c 100644
--- a/apis/interfaces/home.js
+++ b/apis/interfaces/home.js
@@ -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, //企业报名
diff --git a/apis/interfaces/user.js b/apis/interfaces/user.js
index f695781..39944ba 100644
--- a/apis/interfaces/user.js
+++ b/apis/interfaces/user.js
@@ -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,//关注企业列表
})
diff --git a/app.json b/app.json
index ca367c5..094bf25 100644
--- a/app.json
+++ b/app.json
@@ -1,7 +1,6 @@
{
"pages": [
"pages/welcome/index",
- "pages/user/index",
"pages/config/config",
"pages/company/index",
"pages/company/search/search",
diff --git a/pages/home/index.js b/pages/home/index.js
index 25990aa..cb8d951 100644
--- a/pages/home/index.js
+++ b/pages/home/index.js
@@ -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
+ })
+ })
}
})
\ No newline at end of file
diff --git a/pages/home/index.wxml b/pages/home/index.wxml
index 41180f3..0383780 100644
--- a/pages/home/index.wxml
+++ b/pages/home/index.wxml
@@ -26,8 +26,8 @@
进入商城
-
- 关注企业
+
+ {{info.isSubscrib ? '取消关注' :'关注企业'}}
diff --git a/pages/home/projectDetail/projectDetail.js b/pages/home/projectDetail/projectDetail.js
index 359f88d..f9692fb 100644
--- a/pages/home/projectDetail/projectDetail.js
+++ b/pages/home/projectDetail/projectDetail.js
@@ -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
})
diff --git a/pages/home/projectDetail/projectDetail.wxml b/pages/home/projectDetail/projectDetail.wxml
index 326476f..3d1c071 100644
--- a/pages/home/projectDetail/projectDetail.wxml
+++ b/pages/home/projectDetail/projectDetail.wxml
@@ -104,15 +104,14 @@
+ src="{{info.isSubscribed ? '/static/images/collect.png':'/static/images/unCollect.png'}}">
- 关注{{info.likes>0?info.likes:''}}
+ 关注{{info.subscribes>0?info.subscribes:''}}
- {{info.likes || 0}}人已关注
+ {{info.subscribes || 0}}人已关注
我要支持
-
+
我要支持
-
\ No newline at end of file
diff --git a/pages/user/companyMine/focusedCompany/focusedCompany.js b/pages/user/companyMine/focusedCompany/focusedCompany.js
index 54c9f16..d362121 100644
--- a/pages/user/companyMine/focusedCompany/focusedCompany.js
+++ b/pages/user/companyMine/focusedCompany/focusedCompany.js
@@ -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,18 +65,25 @@ Page({
wx.showLoading({
title: '取消中',
})
- wx.$api.companyModule.crowdfundsUnLike(id).then(res => {
+ wx.$api.companyModule.companyLike(id).then(res => {
this.setData({
lists: temp
})
wx.showToast({
title: '取消成功',
- icon:'none'
+ icon: 'none'
})
wx.hideLoading({})
});
}
}
})
+ },
+ runIn(e) {
+ console.log(e.currentTarget.dataset.id)
+ wx.setStorageSync('company_id', e.currentTarget.dataset.id)
+ wx.navigateTo({
+ url: '/pages/home/index',
+ })
}
})
\ No newline at end of file
diff --git a/pages/user/companyMine/focusedCompany/focusedCompany.wxml b/pages/user/companyMine/focusedCompany/focusedCompany.wxml
index e7f31c4..df1035e 100644
--- a/pages/user/companyMine/focusedCompany/focusedCompany.wxml
+++ b/pages/user/companyMine/focusedCompany/focusedCompany.wxml
@@ -1,12 +1,11 @@
-
-
+
- 域展科技 域展科技 已关注
诚信值1587
- 进入
+ 进入
diff --git a/pages/user/companyMine/myBlockchain/myBlockchain.js b/pages/user/companyMine/myBlockchain/myBlockchain.js
index 54c9f16..d6f2f5a 100644
--- a/pages/user/companyMine/myBlockchain/myBlockchain.js
+++ b/pages/user/companyMine/myBlockchain/myBlockchain.js
@@ -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) {
- 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
- })
- }
+ onLoad(e) {
+ console.log(e.name);
+ this.setData({
+ 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({})
- });
- }
- }
- })
- }
})
\ No newline at end of file
diff --git a/pages/user/companyMine/myBlockchain/myBlockchain.wxml b/pages/user/companyMine/myBlockchain/myBlockchain.wxml
index 74d983f..315c41b 100644
--- a/pages/user/companyMine/myBlockchain/myBlockchain.wxml
+++ b/pages/user/companyMine/myBlockchain/myBlockchain.wxml
@@ -1,6 +1,6 @@
- 企获客授权 [ 艾米家的傻钢 ] 区块链证书
+ 企获客授权 [ {{name}} ] 区块链证书
区块链编号
jiquwrofkdjs09u834545124dkafodjfihi
diff --git a/pages/user/companyMine/myTeam/myTeam.js b/pages/user/companyMine/myTeam/myTeam.js
index 54c9f16..587269d 100644
--- a/pages/user/companyMine/myTeam/myTeam.js
+++ b/pages/user/companyMine/myTeam/myTeam.js
@@ -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) {
diff --git a/pages/user/companyMine/myTeam/myTeam.wxml b/pages/user/companyMine/myTeam/myTeam.wxml
index 49a30c5..c4e0377 100644
--- a/pages/user/companyMine/myTeam/myTeam.wxml
+++ b/pages/user/companyMine/myTeam/myTeam.wxml
@@ -15,6 +15,6 @@
-
+
{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}
\ No newline at end of file
diff --git a/pages/user/index.js b/pages/user/index.js
index 6547a73..a70a4b3 100644
--- a/pages/user/index.js
+++ b/pages/user/index.js
@@ -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'
+ })
+ }
})
\ No newline at end of file
diff --git a/pages/user/index.json b/pages/user/index.json
index e6c9b1d..7eeb07d 100644
--- a/pages/user/index.json
+++ b/pages/user/index.json
@@ -1,6 +1,6 @@
{
"usingComponents" : {},
"navigationBarTitleText" : "个人中心",
- "navigationBarBackgroundColor" : "#2e81fc",
+ "navigationBarBackgroundColor" : "#378fff",
"navigationBarTextStyle" : "white"
}
\ No newline at end of file
diff --git a/pages/user/index.wxml b/pages/user/index.wxml
index afbac32..e2895a4 100644
--- a/pages/user/index.wxml
+++ b/pages/user/index.wxml
@@ -1,17 +1,17 @@
- 艾米家的傻钢^ 游客
-
+ {{info.user.nickname}}{{info.vip.is_vip?'会员':'游客'}}
+
- 128 团队
+ {{info.counter.teams || 10}} 团队
- 11259 关注企业
+ {{info.counter.subscriptions}} 关注企业
-
+
升级VIP会员 享会员特权
@@ -33,7 +33,7 @@
我的订单
-
+
@@ -61,7 +61,7 @@
- 2
+ {{ info.cart_counts}}
我的购物车
@@ -85,7 +85,7 @@
项目关注
-
+
diff --git a/pages/user/index.wxss b/pages/user/index.wxss
index 5bc0bd7..6b4abe8 100644
--- a/pages/user/index.wxss
+++ b/pages/user/index.wxss
@@ -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,7 +218,8 @@ page {
margin-bottom: 15rpx;
background-color: red;
}
-.userTool-label-img-button image{
+
+.userTool-label-img-button image {
position: absolute;
left: 0;
top: 0;
diff --git a/pages/user/setting/aboutAdvice/aboutAdvice.js b/pages/user/setting/aboutAdvice/aboutAdvice.js
index 28f0b32..ecc1f96 100644
--- a/pages/user/setting/aboutAdvice/aboutAdvice.js
+++ b/pages/user/setting/aboutAdvice/aboutAdvice.js
@@ -1,3 +1,8 @@
Page({
- data: {}
+ data: {},
+ besure(){
+ wx.navigateBack({
+ delta: 0,
+ })
+ }
})
\ No newline at end of file
diff --git a/pages/user/setting/aboutAdvice/aboutAdvice.wxml b/pages/user/setting/aboutAdvice/aboutAdvice.wxml
index 3a35737..e0104b5 100644
--- a/pages/user/setting/aboutAdvice/aboutAdvice.wxml
+++ b/pages/user/setting/aboutAdvice/aboutAdvice.wxml
@@ -1,4 +1,4 @@
- 确认提交
+ 确认提交
\ No newline at end of file
diff --git a/pages/user/setting/aboutMine/aboutMine.js b/pages/user/setting/aboutMine/aboutMine.js
index 2bd47c2..305f085 100644
--- a/pages/user/setting/aboutMine/aboutMine.js
+++ b/pages/user/setting/aboutMine/aboutMine.js
@@ -13,7 +13,11 @@ Page({
date: '2016-09-01',
region: ['广东省', '广州市', '海珠区'],
},
-
+ besure(){
+ wx.navigateBack({
+ delta: 0,
+ })
+ },
// 选择性别
pickSex: function (e) {
this.setData({
diff --git a/pages/user/setting/aboutMine/aboutMine.wxml b/pages/user/setting/aboutMine/aboutMine.wxml
index 5c6b5b9..4a9ad2b 100644
--- a/pages/user/setting/aboutMine/aboutMine.wxml
+++ b/pages/user/setting/aboutMine/aboutMine.wxml
@@ -63,5 +63,5 @@
-退出登录
-保存
\ No newline at end of file
+退出登录
+保存
\ No newline at end of file
diff --git a/pages/user/setting/aboutUs/aboutUs.wxml b/pages/user/setting/aboutUs/aboutUs.wxml
index 9d2f568..f1a1ebe 100644
--- a/pages/user/setting/aboutUs/aboutUs.wxml
+++ b/pages/user/setting/aboutUs/aboutUs.wxml
@@ -1,2 +1,7 @@
-
\ No newline at end of file
+
+
+ 电子科技有限公司是一家集产品研发,生产及销售的大型高科技电子企业,是全球专业的液晶广告机,液晶电视及液晶拼接墙制造商,从创立伊始,历经多年的稳健发展,以推动国内液晶广告机的普及化为己任,以提升人类视听享受为目标,公司旗下品牌博视(TBOSV)已经成为全球普遍赞誉的知名品牌。上海域展电子科技有限公司成立于2006年。我们凭借着"以品质为根本、以创新求发展"的理念;力争以优质的全方位服务为客户提供具有竞争力价...
+
+电子科技有限公司是一家集产品研发,生产及销售的大型高科技电子企业,是全球专业的液晶广告机,液晶电视及液晶拼接墙制造商,从创立伊始,历经多年的稳健发展,以推动国内液晶广告机的普及化为己任,以提升人类视听享受为目标,公司旗下品牌博视(TBOSV)已经成为全球普遍赞誉的知名品牌。上海域展电子科技有限公司成立于2006年。我们凭借着"以品质为根本、以创新求发展"的理念;力争以优质的全方位服务为客户提供具有竞争力价...
+
\ No newline at end of file
diff --git a/pages/user/setting/setting.js b/pages/user/setting/setting.js
index 28f0b32..b22397c 100644
--- a/pages/user/setting/setting.js
+++ b/pages/user/setting/setting.js
@@ -1,3 +1,9 @@
Page({
- data: {}
+ data: {},
+ showtoast() {
+ wx.showToast({
+ title: '正在完善,看看其他的吧',
+ icon: 'none'
+ })
+ }
})
\ No newline at end of file
diff --git a/pages/user/setting/setting.wxml b/pages/user/setting/setting.wxml
index 8a7e730..38de18b 100644
--- a/pages/user/setting/setting.wxml
+++ b/pages/user/setting/setting.wxml
@@ -1,4 +1,7 @@
-
+
+
个人信息
diff --git a/project.config.json b/project.config.json
index 80c856d..ecc1415 100644
--- a/project.config.json
+++ b/project.config.json
@@ -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
}
]