beifen
This commit is contained in:
@@ -26,6 +26,14 @@ const crowdfunds = (company_id, category_id, page) => req({
|
||||
const crowdfundsDetail = crowdfund_id => req({
|
||||
url: "crowdfunds/" + crowdfund_id
|
||||
})
|
||||
// 获取关注列表
|
||||
const getCrowdfundsLike = page => req({
|
||||
url: "user/crowdfunds",
|
||||
method: "get",
|
||||
data: {
|
||||
page: page
|
||||
}
|
||||
})
|
||||
//项目关注
|
||||
const crowdfundsLike = crowdfund_id => req({
|
||||
url: "crowdfunds/like",
|
||||
@@ -148,10 +156,12 @@ const signed = (active_id) => req({
|
||||
|
||||
|
||||
|
||||
|
||||
export default ({
|
||||
crowdfundcategory, //项目筹集分类
|
||||
crowdfunds, //根据项目筹集获取列表
|
||||
crowdfundsDetail, //项目详情
|
||||
getCrowdfundsLike, //获取已关注列表
|
||||
crowdfundsLike, //关注项目
|
||||
crowdfundsUnLike, //取消关注项目
|
||||
crowdfundsCreat, //获取确认订单信息
|
||||
|
||||
6
app.json
6
app.json
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/user/index",
|
||||
"pages/user/companyMine/myActives/myActives",
|
||||
"pages/user/companyMine/companyOrder",
|
||||
"pages/welcome/index",
|
||||
"pages/company/index",
|
||||
"pages/company/search/search",
|
||||
@@ -12,6 +11,9 @@
|
||||
"pages/mall/index",
|
||||
"pages/live/index",
|
||||
"pages/ticket/index",
|
||||
"pages/user/index",
|
||||
"pages/user/companyMine/myActives/myActives",
|
||||
"pages/user/companyMine/focusedProject/focusedProject",
|
||||
"pages/home/index",
|
||||
"pages/home/companyInfo/companyInfo",
|
||||
"pages/home/noticeDetail/noticeDetail",
|
||||
|
||||
@@ -19,51 +19,13 @@ Page({
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
* 跳转个人中心
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
beSure: function () {
|
||||
wx.navigateTo({
|
||||
url: '/pages/user/companyMine/myActives/myActives',
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
})
|
||||
@@ -5,7 +5,7 @@ Page({
|
||||
info: '',
|
||||
remark: '',
|
||||
crowdfund_id: '',
|
||||
addressDel: {},
|
||||
addressDel:'',
|
||||
},
|
||||
|
||||
onLoad(e) {
|
||||
@@ -41,6 +41,7 @@ Page({
|
||||
title: '创建中...',
|
||||
mask: 'true'
|
||||
})
|
||||
if (this.data.addressDel) {
|
||||
wx.$api.companyModule.crowdfundsCreatOrder(this.data.crowdfund_item_id, this.data.addressDel.address_id, this.data.remark).then(res => {
|
||||
var data = {};
|
||||
if (res.trade_no) {
|
||||
@@ -82,6 +83,18 @@ Page({
|
||||
}).catch(res => {
|
||||
wx.navigateBack({})
|
||||
})
|
||||
} else {
|
||||
wx.hideLoading({
|
||||
success: (res) => {
|
||||
wx.showToast({
|
||||
icon: 'none',
|
||||
title: '请选择收货地址',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
// 跳转到地址列表和新增地址页面
|
||||
goAddress() {
|
||||
|
||||
@@ -9,8 +9,7 @@ Page({
|
||||
info: '', //企业信息
|
||||
loaded: false
|
||||
},
|
||||
onLoad(e) {
|
||||
},
|
||||
onLoad(e) {},
|
||||
onShow() {
|
||||
this.company(wx.getStorageSync('company_id'))
|
||||
},
|
||||
@@ -57,12 +56,20 @@ Page({
|
||||
* 请求项目筹集分类接口
|
||||
*/
|
||||
company() {
|
||||
wx.showLoading({
|
||||
title: 'title',
|
||||
mask: 'true'
|
||||
})
|
||||
wx.$api.companyModule.company(this.data.company_id, this.data.page).then(res => {
|
||||
console.log(res)
|
||||
this.setData({
|
||||
info: res,
|
||||
loaded: true,
|
||||
})
|
||||
wx.hideLoading({})
|
||||
}).catch(res => {
|
||||
if(res.status_code=='404'){
|
||||
// this.company(wx.getStorageSync('company_id'))
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
align-items: flex-start;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: solid 2rpx #f7f7f7;
|
||||
border-bottom: solid 2rpx #f9f9f9;
|
||||
}
|
||||
|
||||
.item_title{
|
||||
|
||||
@@ -32,6 +32,11 @@ Page({
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 跳转到个人
|
||||
* 跳转到订单列表
|
||||
*/
|
||||
beSure(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/user/companyMine/companyOrder',
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -80,6 +80,10 @@ page {
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
padding: 0 30rpx;
|
||||
display:-webkit-box;
|
||||
-webkit-line-clamp:3;
|
||||
-webkit-box-orient:vertical;
|
||||
overflow:hidden;
|
||||
}
|
||||
.share_content .des{
|
||||
color: #fff;
|
||||
|
||||
@@ -6,6 +6,7 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
type: 0, //全部0 待付款1 待发货2 待收货3 退款/售后4
|
||||
company_id:wx.getStorageSync('company_id')
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -21,9 +22,6 @@ Page({
|
||||
this.setData({
|
||||
type: e.currentTarget.dataset.id
|
||||
})
|
||||
if (e.currentTarget.dataset.id == 3) {
|
||||
this.selectComponent('#categoryTypeList').crowdfundcategory(this.data.company_id);
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -1,16 +1,36 @@
|
||||
<!-- 滚动菜单 -->
|
||||
<view class="scroll_menu">
|
||||
<scroll-view class="scroll-view_H" scroll-x="true" bindscroll="scroll" style="width: 100%">
|
||||
<view id="menu1" catchtap="menuSelect" data-id='0'
|
||||
class="scroll-view-item_H {{type==0?'scroll_view_select':''}}">全部</view>
|
||||
<view id="menu2" catchtap="menuSelect" data-id='1'
|
||||
class="scroll-view-item_H {{type==1?'scroll_view_select':''}}">待付款</view>
|
||||
<view id="menu3" catchtap="menuSelect" data-id='2'
|
||||
class="scroll-view-item_H {{type==2?'scroll_view_select':''}}">待发货</view>
|
||||
<view id="menu4" catchtap="menuSelect" data-id='3'
|
||||
class="scroll-view-item_H {{type==3?'scroll_view_select':''}}">待收货</view>
|
||||
<view id="menu4" catchtap="menuSelect" data-id='4'
|
||||
class="scroll-view-item_H {{type==4?'scroll_view_select':''}}">退款/售后</view>
|
||||
<view id="menu1" catchtap="menuSelect" data-id='0' class="scroll-view-item_H {{type==0?'scroll_view_select':''}}">全部
|
||||
</view>
|
||||
<view id="menu2" catchtap="menuSelect" data-id='1' class="scroll-view-item_H {{type==1?'scroll_view_select':''}}">
|
||||
待付款</view>
|
||||
<view id="menu3" catchtap="menuSelect" data-id='2' class="scroll-view-item_H {{type==2?'scroll_view_select':''}}">
|
||||
待发货</view>
|
||||
<view id="menu4" catchtap="menuSelect" data-id='3' class="scroll-view-item_H {{type==3?'scroll_view_select':''}}">
|
||||
待收货</view>
|
||||
<view id="menu4" catchtap="menuSelect" data-id='4' class="scroll-view-item_H {{type==4?'scroll_view_select':''}}">
|
||||
退款/售后</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view class="lists">
|
||||
<view class="top">
|
||||
<view class="ctime">2020-11-22 13:30:00 <span>待付款</span> </view>
|
||||
<view class="content">
|
||||
<image src="/static/images/company_bg4.png" mode="aspectFill"></image>
|
||||
<view style="margin-left:20rpx;flex:1;">
|
||||
<view class="title"><span class="title1">亲自跑到义乌,待会今年就新鲜上线亲自跑到义乌,待会今年就新鲜上线</span><span>¥60.00</span></view>
|
||||
<view class="title"><span class="title1">小饼干</span><span>*4</span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>共<span>1</span>件商品 实付:<span>¥202.00</span></view>
|
||||
<view>项目结束时间:2020-10-29</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<span>取消订单</span>
|
||||
<span>立即付款</span>
|
||||
</view>
|
||||
</view>
|
||||
@@ -3,6 +3,7 @@
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0rpx 10px rgba(0, 0, 0, 0.1);
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.scroll-view_H {
|
||||
@@ -31,3 +32,56 @@
|
||||
}
|
||||
|
||||
/* 列表 */
|
||||
.lists {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.top {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.top image {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.top .ctime {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.top .ctime span {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.top .content {
|
||||
padding: 20rpx 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.top .title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.top .title .title1 {
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 400rpx;
|
||||
}
|
||||
108
pages/user/companyMine/companyOrder1 (2).js
Normal file
108
pages/user/companyMine/companyOrder1 (2).js
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 企获客商城
|
||||
*/
|
||||
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
stateType : 'all', //订单类型
|
||||
orderArr : [], //订单列表
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
if(wx.getStorageSync("token") == ""){
|
||||
wx.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 获取订单列表
|
||||
this.orderInfo()
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单tab
|
||||
*/
|
||||
orderTab(e){
|
||||
this.setData({
|
||||
stateType: e.currentTarget.dataset.state
|
||||
})
|
||||
this.orderInfo()
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
*/
|
||||
orderInfo(){
|
||||
let stateType = this.data.stateType
|
||||
|
||||
if(stateType == 'all') {
|
||||
wx.$api.order.index().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'unpaid') {
|
||||
wx.$api.order.unpaid().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'paid') {
|
||||
wx.$api.order.paid().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'delive') {
|
||||
wx.$api.order.delive().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'refunds') {
|
||||
wx.$api.order.refund().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单支付
|
||||
*/
|
||||
orderPay(e){
|
||||
let orderId = e.currentTarget.dataset.orderid
|
||||
wx.navigateTo({
|
||||
url: '/pages/mall/mall_pay/mall_pay?orderid=' + orderId,
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
*/
|
||||
orderDelete(e) {
|
||||
let orderId = e.currentTarget.dataset.orderid
|
||||
wx.$api.orders.cancel(orderId).then(res=>{
|
||||
// 获取列表
|
||||
this.orderInfo()
|
||||
})
|
||||
},
|
||||
})
|
||||
6
pages/user/companyMine/companyOrder1 (2).json
Normal file
6
pages/user/companyMine/companyOrder1 (2).json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "项目预购",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarBackgroundColor": "#378fff"
|
||||
}
|
||||
54
pages/user/companyMine/companyOrder1 (2).wxml
Normal file
54
pages/user/companyMine/companyOrder1 (2).wxml
Normal file
@@ -0,0 +1,54 @@
|
||||
<!-- 订单tab -->
|
||||
<view class="order-tab">
|
||||
<view class="order-tab-item {{stateType == 'all' ? 'active':''}}" data-state="all" bindtap="orderTab">
|
||||
全部
|
||||
</view>
|
||||
<view class="order-tab-item {{stateType == 'unpaid' ? 'active':''}}" data-state="unpaid" bindtap="orderTab">
|
||||
待支付
|
||||
</view>
|
||||
<view class="order-tab-item {{stateType == 'paid' ? 'active':''}}" data-state="paid" bindtap="orderTab">
|
||||
待发货
|
||||
</view>
|
||||
<view class="order-tab-item {{stateType == 'delive' ? 'active':''}}" data-state="delive" bindtap="orderTab">
|
||||
待收货
|
||||
</view>
|
||||
<view class="order-tab-item {{stateType == 'refunds' ? 'active':''}}" data-state="refunds" bindtap="orderTab">
|
||||
已完成 <!-- 退款 -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-content" wx:if="{{orderArr != ''}}">
|
||||
<view class="order-list" wx:for="{{orderArr}}" wx:key="orderArr" wx:for-item="goods">
|
||||
<view class="order-company">
|
||||
<view class="order-company-name">
|
||||
<image class="order-logo" src="/static/mall_icon/mallDetails_user.png"></image>
|
||||
{{goods.orderid}}
|
||||
<image class="order-arrow" src="/static/mall_icon/mall_arrow.png"></image>
|
||||
</view>
|
||||
<view class="order-company-state">
|
||||
{{goods.state_text}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-goods" wx:for="{{goods.items}}" wx:key="items">
|
||||
<image class="order-goods-img" src="{{item.cover}}" mode="aspectFill"></image>
|
||||
<view class="order-goods-text">
|
||||
<view class="nowrap-multi order-goods-name">{{item.title}}</view>
|
||||
<view class="order-goods-price">
|
||||
<text>¥{{item.price}}</text>
|
||||
共{{item.qty}}件
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-footer">
|
||||
<view class="order-footer-btn order-footer-btn-back" wx:if="{{goods.canPay == true}}" data-orderid="{{goods.orderid}}"
|
||||
bindtap="orderPay">立即支付</view>
|
||||
<view class="order-footer-btn" wx:if="{{goods.canCancel == true}}" data-orderid="{{goods.orderid}}"
|
||||
bindtap="orderDelete">取消订单</view>
|
||||
<navigator hover-class="none" url="/pages/mall/mall_order_data/mall_order_data?orderId={{goods.orderid}}" class="order-footer-btn">订单详情</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:else class="pack-center pages-hint">
|
||||
<image src="/static/images/no_list.png"></image>
|
||||
<view>暂无订单</view>
|
||||
</view>
|
||||
154
pages/user/companyMine/companyOrder1 (2).wxss
Normal file
154
pages/user/companyMine/companyOrder1 (2).wxss
Normal file
@@ -0,0 +1,154 @@
|
||||
|
||||
page {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
/* 订单tab */
|
||||
.order-tab{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
z-index: 9;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.order-tab-item{
|
||||
font-size: 28rpx;
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
border-bottom: solid 2rpx #f7f7f7;
|
||||
color: #464854;
|
||||
background: white;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.order-tab-item:after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: calc(50% - 30rpx);
|
||||
bottom: 0;
|
||||
background-color: transparent;
|
||||
width: 60rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.order-tab-item.active{
|
||||
color:#000;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.order-tab-item.active:after {
|
||||
background-color: #378fff;
|
||||
}
|
||||
|
||||
/* 订单列表 */
|
||||
.order-content{
|
||||
border-bottom: solid 100rpx transparent;
|
||||
padding: 80rpx 0 20rpx 0;
|
||||
}
|
||||
|
||||
.order-list {
|
||||
background-color: white;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
|
||||
.order-company {
|
||||
display: flex;
|
||||
line-height: 50rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.order-company-name {
|
||||
font-weight: 600;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.order-logo {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.order-arrow {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin: 10rpx 0 10rpx 20rpx;
|
||||
}
|
||||
|
||||
.order-company-state {
|
||||
color: #378fff;
|
||||
}
|
||||
|
||||
.order-goods {
|
||||
position: relative;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.order-goods-img {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.order-goods-text {
|
||||
position: absolute;
|
||||
padding-left: 220rpx;
|
||||
padding-right: 30rpx;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.order-goods-name {
|
||||
height: 80rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.order-goods-price {
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.order-goods-price text {
|
||||
flex: 1;
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.order-footer {
|
||||
border-top: 2rpx solid #eee;
|
||||
margin-top: 20rpx;
|
||||
padding: 30rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.order-footer-btn {
|
||||
margin-left: 20rpx;
|
||||
height: 60rpx;
|
||||
line-height: 56rpx;
|
||||
box-sizing: border-box;
|
||||
border: solid 1rpx #dddddd;
|
||||
padding: 0 20rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 40rpx;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.order-footer-btn-back {
|
||||
border-color: #378fff;
|
||||
color: #378fff;
|
||||
}
|
||||
84
pages/user/companyMine/focusedProject/focusedProject.js
Normal file
84
pages/user/companyMine/focusedProject/focusedProject.js
Normal file
@@ -0,0 +1,84 @@
|
||||
// pages/user/companyMine/focusedProject/focusedProject.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
lists: [],
|
||||
page: 1,
|
||||
has_more: true
|
||||
},
|
||||
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
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 触底加载更多
|
||||
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.hideLoading({})
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "项目关注",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarBackgroundColor": "#378fff"
|
||||
}
|
||||
12
pages/user/companyMine/focusedProject/focusedProject.wxml
Normal file
12
pages/user/companyMine/focusedProject/focusedProject.wxml
Normal file
@@ -0,0 +1,12 @@
|
||||
<view class="content" wx:for="{{lists}}" :key="index" >
|
||||
<image src="{{item.cover}}" mode="aspectFill"></image>
|
||||
<view class="left">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="bottom"><span>{{item.status_text}}</span><span catchtap="crowdfundsUnLike" data-id='{{item.crowdfund_id}}' data-index='{{index}}'>取消关注</span></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="has_more">
|
||||
<image wx:if='{{lists.length==0}}' src="/static/images/no_list.png" style="width:200rpx;" mode="widthFix"></image>
|
||||
<span>{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}</span>
|
||||
</view>
|
||||
59
pages/user/companyMine/focusedProject/focusedProject.wxss
Normal file
59
pages/user/companyMine/focusedProject/focusedProject.wxss
Normal file
@@ -0,0 +1,59 @@
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
padding: 10rpx 20rpx;
|
||||
/* box-shadow: 0 0 5rpx rgba(0, 0, 0, 0.1); */
|
||||
height: 200rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.content>image {
|
||||
width: 200rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
|
||||
.content .left {
|
||||
width: 100%;
|
||||
margin-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content .title {
|
||||
height: 120rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content .bottom {
|
||||
justify-content: space-between;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
box-sizing: border-box;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
|
||||
.has_more {
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
|
||||
.has_more image {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ Page({
|
||||
if (res.page.has_more) {
|
||||
this.setData({
|
||||
has_more: res.page.has_more,
|
||||
page: page + 1,
|
||||
page: this.data.page + 1,
|
||||
lists: lists
|
||||
})
|
||||
} else {
|
||||
@@ -56,7 +56,6 @@ Page({
|
||||
},
|
||||
// 触底加载更多
|
||||
onReachBottom() {
|
||||
console.log('触底')
|
||||
if (this.data.has_more) {
|
||||
this.userActives();
|
||||
} else {
|
||||
@@ -69,7 +68,7 @@ Page({
|
||||
//跳转到详情页
|
||||
goUrl(e) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/companyModule/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id,
|
||||
url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id,
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -65,12 +65,12 @@
|
||||
</view>
|
||||
<text>活动参与</text>
|
||||
</navigator>
|
||||
<view class="userTool-label">
|
||||
<navigator hover-class="none" url="/pages/user/companyMine/companyOrder" class="userTool-label">
|
||||
<view class="userTool-label-img">
|
||||
<image src="/static/user_iocn/userTool_01.png"></image>
|
||||
</view>
|
||||
<text>项目预购</text>
|
||||
</view>
|
||||
</navigator>
|
||||
<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>
|
||||
@@ -90,12 +90,13 @@
|
||||
</view>
|
||||
<text>收货地址</text>
|
||||
</navigator>
|
||||
<view class="userTool-label">
|
||||
<navigator hover-class="none" url="/pages/user/companyMine/focusedProject/focusedProject"
|
||||
class="userTool-label">
|
||||
<view class="userTool-label-img">
|
||||
<image src="/static/user_iocn/userTool_05.png"></image>
|
||||
</view>
|
||||
<text>项目关注</text>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="userTool-label">
|
||||
<view class="userTool-label-img">
|
||||
<image src="/static/user_iocn/userTool_06.png"></image>
|
||||
|
||||
Reference in New Issue
Block a user