feat 对接表格数据接口

This commit is contained in:
Abbh1 2023-11-24 22:54:48 +08:00
parent e9f0f6e12c
commit 2cf8068382
14 changed files with 342 additions and 147 deletions

View File

@ -7,19 +7,28 @@ import {
import { import {
getSearchRecList getSearchRecList
} from '~/services/home/getSearchRecList'; } from '~/services/home/getSearchRecList';
import {
TableDataList
} from '~/services/home/getTableDataList';
import {
getProductsInvolvedList
} from '~/services/table-data/getProductsInvolvedList';
import Toast from 'tdesign-miniprogram/toast/index'; import Toast from 'tdesign-miniprogram/toast/index';
Page({ Page({
data: { data: {
imgSrcs: [], imgSrcs: [],
tabList: [{ tableDataList: [],
text: "精选推荐",
key: 0,
categoryGuid: 1,
}],
hotCategoryList: [],
noticeList: [], noticeList: [],
popularWords: [], popularWords: [],
params: {
pageSize: 10,
pageNum: 1,
isLastUpdate: true,
search: "",
type: 0,
order: "default"
},
pageLoading: false, pageLoading: false,
current: 0, current: 0,
autoplay: true, autoplay: true,
@ -34,20 +43,8 @@ Page({
categoryGuid: 0, categoryGuid: 0,
loadMoreStatus: 0, loadMoreStatus: 0,
product: { product: {
value: 'all', value: '0',
options: [{ options: [],
value: 'all',
label: '全部产品',
},
{
value: 'new',
label: '最新产品',
},
{
value: 'hot',
label: '最火产品',
},
],
}, },
sorter: { sorter: {
value: 'default', value: 'default',
@ -56,15 +53,27 @@ Page({
label: '默认排序', label: '默认排序',
}, },
{ {
value: 'price', value: 'date-down',
label: '日期降序',
},
{
value: 'date-up',
label: '日期升序',
},
{
value: 'price-up',
label: '价格从高到低', label: '价格从高到低',
}, },
{
value: 'price-down',
label: '价格从低到高',
},
], ],
}, },
}, },
page: { page: {
size: 20, size: 10,
num: 1, num: 1,
}, },
privateData: { privateData: {
@ -81,7 +90,7 @@ Page({
// 划到底部触发 // 划到底部触发
onReachBottom() { onReachBottom() {
this.getEmocticonLastData() this.getTableDataList()
}, },
onPullDownRefresh() { onPullDownRefresh() {
@ -99,8 +108,9 @@ Page({
pageLoading: true, pageLoading: true,
}); });
this.getTableDataList(false, "")
this.getProductsInvolvedListFun()
// this.getBanner() // this.getBanner()
// this.getRec()
// this.getNotice() // this.getNotice()
}, },
@ -116,38 +126,63 @@ Page({
}); });
}, },
getRec() { // 获取涉及产品类别
// 获取搜索推荐 getProductsInvolvedListFun() {
getSearchRecList().then((res) => { getProductsInvolvedList().then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.setData({ res.data.unshift({
popularWords: res.data, value: '0',
pageLoading: false label: '全部类别',
}); });
} else {} this.setData({
"product.value": "0",
"product.options": res.data,
});
console.log(this.data);
}
}); });
}, },
// 获取列表 // 获取列表
getEmocticonLastData() { getTableDataList(isInit = false) {
const params = { if (isInit) {
pageSize: this.page.size, this.page.num = 1
pageNum: this.page.num, }
isLastUpdate: true else{
}; this.setData({
"params.pageSize": this.page.size,
"params.pageNum": this.page.num
})
}
// const params = {
// pageSize: this.page.size,
// pageNum: this.page.num,
// isLastUpdate: true,
// search,
// type,
// order
// };
this.setData({ this.setData({
loadMoreStatus: 1, loadMoreStatus: 1,
}); });
// 获取最近更新表情包列表 TableDataList(this.data.params).then((res) => {
getEmoticonDataList(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.page.num++; if (!isInit) {
this.page.num++;
this.setData({ this.setData({
lastUpdatedList: this.data.lastUpdatedList.concat(res.data.result), tableDataList: this.data.tableDataList.concat(res.data.result),
loadMoreStatus: 0 loadMoreStatus: 0,
}); pageLoading: false
});
} else {
this.setData({
tableDataList: res.data.result,
loadMoreStatus: 0,
pageLoading: false
});
}
console.log(this.data);
} else {} } else {}
}); });
}, },
@ -170,28 +205,53 @@ Page({
}); });
}, },
// 点击搜索推荐
handleRecTap(e) {
const {
dataset
} = e.currentTarget;
const _searchValue = dataset?.value;
if (_searchValue) {
wx.navigateTo({
url: `/pages/emoticon/result/index?searchValue=${_searchValue}`,
});
}
},
gotoDetail(e) { gotoDetail(e) {
const { const {
dataset dataset
} = e.currentTarget; } = e.currentTarget;
const id = dataset?.value; const id = dataset?.id;
wx.navigateTo({ wx.navigateTo({
url: `/pages/table-data/index?id=${id}`, url: `/pages/table-data/index?id=${id}`,
}); });
} },
// 搜索
search(e) {
this.setData({
"params.search" : e.detail.value
})
this.getTableDataList(true);
},
onChange(e) {
this.setData({
'product.value': e.detail.value,
});
if(e.detail.value == 0){
this.init()
}
else{
this.setData({
"params.type" : e.detail.value
})
this.getTableDataList(true);
}
},
onChangeOrder(e) {
// this.setData({
// 'product.value': e.detail.value,
// });
if(e.detail.value == 0){
this.init()
}
else{
this.setData({
"params.order" : e.detail.value
})
this.getTableDataList(true);
}
},
}); });

View File

@ -21,8 +21,8 @@
<t-swiper wx:if="{{imgSrcs.length > 0}}" current="{{current}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}" navigation="{{navigation}}" imageProps="{{swiperImageProps}}" list="{{imgSrcs}}" /> <t-swiper wx:if="{{imgSrcs.length > 0}}" current="{{current}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}" navigation="{{navigation}}" imageProps="{{swiperImageProps}}" list="{{imgSrcs}}" />
</view> --> </view> -->
<!-- 搜索框 --> <!-- 搜索框 -->
<view class="search" bind:tap="navToSearchPage"> <view class="search">
<t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="搜索关键词" leftIcon="" > <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="搜索关键词" leftIcon="" bind:submit='search'>
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
</t-search> </t-search>
</view> </view>
@ -32,28 +32,28 @@
<!-- 筛选 --> <!-- 筛选 -->
<t-dropdown-menu> <t-dropdown-menu>
<t-dropdown-item options="{{product.options}}" value="{{product.value}}" bindchange="onChange" /> <t-dropdown-item options="{{product.options}}" value="{{product.value}}" bindchange="onChange" />
<t-dropdown-item options="{{sorter.options}}" default-value="{{sorter.value}}" /> <t-dropdown-item options="{{sorter.options}}" default-value="{{sorter.value}}" bindchange="onChangeOrder"/>
</t-dropdown-menu> </t-dropdown-menu>
<!-- 列表渲染 --> <!-- 列表渲染 -->
<view class="table-data-list-box"> <view class="table-data-list-box">
<view class="table-data-list-item-box" bind:tap="gotoDetail"> <view class="table-data-list-item-box" bind:tap="gotoDetail" data-id="{{item.tableDataId}}" wx:for="{{tableDataList}}" wx:for-item="item" wx:for-index="index">
<view class="table-data-list-item"> <view class="table-data-list-item">
<view class="title w1">渤银理财理财分销对接代销系统采购项目</view> <view class="title w1">{{item.tableDataProcurementContent}}</view>
<view class="price-box"> <view class="price-box">
<view class="price-title">中标价格:</view> <view class="price-title">中标价格:</view>
<price wx:if="true" priceUnit="yuan" wr-class="price-class" symbol="" price="99" fill="true" decimalSmaller /> <price wx:if="{{item.tableDataBidWinningPrice !== 0}}" priceUnit="yuan" wr-class="price-class" symbol="" price="{{item.tableDataBidWinningPrice}}" fill="true" decimalSmaller />
<view wx:else class="price-class">价格待定</view> <view wx:else class="price-class">价格待定</view>
</view> </view>
<view class="time-box"> <view class="time-box">
<view class="time-text">2023-11-18</view> <view class="time-text">{{item.tableDataDate}}</view>
<view class="time-line"> - </view> <view class="time-line"> - </view>
<view class="time-text">2023-12-20</view> <view class="time-text">{{item.tableDataDeadline}}</view>
</view> </view>
<view class="tag-box"> <view class="tag-box">
<t-tag class="tag" variant="light">房产</t-tag> <t-tag class="tag" variant="light" wx:for="{{item.productsInvolvedName}}" wx:for-item="item" wx:for-index="index">{{item}}</t-tag>
</view> </view>
<van-button wx:if="true" class="btn" type="info" round block>查看详情</van-button> <!-- <van-button wx:if="true" class="btn" type="info" round block>查看详情</van-button> -->
</view> </view>
</view> </view>

View File

@ -182,6 +182,7 @@ page {
border-radius: 20rpx; border-radius: 20rpx;
padding-top: 30rpx; padding-top: 30rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
margin-bottom: 40rpx;
} }
.table-data-list-item{ .table-data-list-item{

View File

@ -1,3 +1,13 @@
import {
getTableDataDetails
} from '~/services/table-data/getTableDataDetails';
import {
follow
} from '~/services/table-data/follow';
import {
cancelfollow
} from '~/services/table-data/cancelfollow';
// pages/table-data/index.js // pages/table-data/index.js
Page({ Page({
@ -5,14 +15,90 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tableDataId: 0,
tableDataDetail: {}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
tableDataId:options.id
})
this.init()
// console.log(options.id);
},
init() {
this.details()
},
details() {
let params = {
tableDataId: this.data.tableDataId
}
getTableDataDetails(params).then((res) => {
if (res.code == 200) {
this.setData({
tableDataDetail: res.data,
});
console.log(this.data);
} else {}
});
},
toSubcribe() {
wx.navigateTo({
url: `/pages/usercenter/subscribe/index`,
});
},
toLink() {
var that = this;
wx.setClipboardData({
data: that.data.tableDataDetail.tableDataLink,
success(res) {
wx.showToast({
title: '复制成功',
})
}
})
},
// 关注
followFun() {
let params = {
tableDataGuid: this.data.tableDataDetail.tableDataGuid
}
follow(params).then((res) => {
if (res.code == 200) {
wx.showToast({
title: res.data,
})
setTimeout(() => {
this.init()
}, 1000);
} else {}
});
},
cancelFollow() {
let params = {
tableDataGuid: this.data.tableDataDetail.tableDataGuid
}
cancelfollow(params).then((res) => {
if (res.code == 200) {
wx.showToast({
title: res.data,
})
setTimeout(() => {
this.init()
}, 1000);
} else {}
});
}, },
/** /**

View File

@ -3,7 +3,7 @@
<!-- 标题 --> <!-- 标题 -->
<view class="title-box"> <view class="title-box">
<view class="title">渤银理财理财分销对接代销系统采购项目</view> <view class="title">{{tableDataDetail.tableDataProcurementContent}}</view>
<!-- <view class="price-box"> <!-- <view class="price-box">
<price wx:if="true" priceUnit="yuan" wr-class="price-class" symbol="" price="99" fill="true" decimalSmaller /> <price wx:if="true" priceUnit="yuan" wr-class="price-class" symbol="" price="99" fill="true" decimalSmaller />
<view wx:else class="price-class black">价格待定</view> <view wx:else class="price-class black">价格待定</view>
@ -17,21 +17,18 @@
<view class="detail-title">基本信息</view> <view class="detail-title">基本信息</view>
</view> </view>
<view class="detail-margin-box"> <view class="detail-margin-box">
<t-cell t-class-title="cell-class" t-class-note="node-class" title="涉及产品" note="辅助信息" hover /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="涉及产品" note="{{tableDataDetail.productsInvolvedName}}" hover bind:tap="toSubcribe"/>
<t-cell t-class-title="cell-class" t-class-note="node-class" title="采购单位名称" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="采购方式" note="{{tableDataDetail.tableDataProcurementMethod}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="采购方式" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="采购单位名称" note="{{tableDataDetail.tableDataProcurementUnit}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="日期" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="日期" note="{{tableDataDetail.tableDataDate}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="截至日期" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="截至日期" note="{{tableDataDetail.tableDataDeadline}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="供应商名称" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="项目计价形式" note="{{tableDataDetail.tableDataProjectPricingForm}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="供应商报价" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="链接(点击复制)" description="{{tableDataDetail.tableDataLink}}" bind:tap="toLink"/>
<t-cell t-class-title="cell-class" t-class-note="node-class" title="项目计价形式" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="是否为中标公告" note="{{tableDataDetail.tableDataIsBidAnnouncement}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="链接" note="辅助信息" hover /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="是否是人力资源池或框架协议" note="{{tableDataDetail.tableDataIsHumanResourcePoolOrFrameworkAgreement}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="采购方式" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="公告中是否包含多个包/标段/采购内容" note="{{tableDataDetail.tableDataIsMultiple}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="是否为中标公告" note="是" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="是否仅有一个中标人" note="{{tableDataDetail.tableDataIsOnlyBidder}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="是否是人力资源池或框架协议" note="是" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="单一来源理由(如有)" description="{{tableDataDetail.tableDataSingleSource}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="公告中是否包含多个包/标段/采购内容" note="是" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="单一来源理由(如有)" note="是" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="是否仅有一个中标人" note="是" />
</view> </view>
</view> </view>
@ -40,13 +37,14 @@
<view class="detail-title">中标信息</view> <view class="detail-title">中标信息</view>
</view> </view>
<view class="detail-margin-box"> <view class="detail-margin-box">
<t-cell t-class-title="cell-class" t-class-note="node-class" title="中标人或候选人" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="中标人或候选人" note="{{tableDataDetail.tableDataWinningBidde}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="中标金额" note="辅助信息" /> <t-cell t-class-title="cell-class" t-class-note="node-class" title="供应商名称" note="{{tableDataDetail.tableDataSupplierName}}" />
<t-cell t-class-title="cell-class" t-class-note="node-class" title="中标金额" note="{{tableDataDetail.tableDataBidWinningPrice}}" />
</view> </view>
</view> </view>
<view class="detail-box"> <view class="detail-box">
<t-cell title="详情" description="渤银理财理财分销对接代销系统采购项目成交公示       受渤海银行股份有限公司委托金采联合北京招标有限公司于2022年8月4日以竞争性采购方式对渤银理财理财分销对接代销系统采购项目项目编号FUTC-2022-H031B组织了采购。现将成交供应商公布如下北京开科唯识技术股份有限公司为成交供应商。公示期限自2022年8月22日至2022年8月24日采购代理机构金采联合北京招标有限公司联系地址北京市西城区佟麟阁路95号尚信大厦联系人刘世平、刘松樵、谭永江代理机构联系方式13682015217、16622986307、010-51813597特此公告金采联合北京招标有限公司2022年8月19日" /> <t-cell title="详情" description="{{tableDataDetail.tableDataDetails}}" />
</view> </view>
</view> </view>
@ -56,5 +54,6 @@
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="footer-btn-box"> <view class="footer-btn-box">
<van-button wx:if="true" class="btn" type="info" round block>我感兴趣</van-button> <van-button wx:if="{{!tableDataDetail.isFollow}}" class="btn" type="info" round block bind:tap="followFun">我感兴趣</van-button>
<van-button wx:if="{{tableDataDetail.isFollow}}" class="btn" type="warning" round block bind:tap="cancelFollow">取消关注</van-button>
</view> </view>

View File

@ -68,4 +68,5 @@
.btn{ .btn{
width: 100%; width: 100%;
margin-top: 30rpx;
} }

View File

@ -5,7 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**

View File

@ -1,52 +0,0 @@
import {
request
} from '../_utils/request';
/** 获取热门表情包分类列表 */
export function getHotEmotionCategoryList() {
return new Promise((resolve, reject) => {
request({
url: `EmotionCategoryApi/getHotEmotionCategoryList`,
method: 'GET',
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}
/** 获取表情包分类列表 */
export function getEmotionCategoryList() {
return new Promise((resolve, reject) => {
request({
url: `EmotionCategoryApi/getEmotionCategoryList`,
method: 'GET',
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}
/** 获取表情包列表 */
export function getEmoticonDataList(parm) {
return new Promise((resolve, reject) => {
request({
url: `EmoticonDataApi/getEmoticonDataList`,
method: 'GET',
data: parm,
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}

View File

@ -0,0 +1,20 @@
import {
request
} from '../_utils/request';
/** 获取列表 */
export function TableDataList(parm) {
return new Promise((resolve, reject) => {
request({
url: `TableDataApi/getTableDataList`,
method: 'GET',
data: parm,
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}

View File

@ -14,8 +14,8 @@ export function login(data) {
method: 'POST', method: 'POST',
data: data, data: data,
success: async function (res) { success: async function (res) {
setStorage('userInfo', res.data.user, 86400); setStorage('userInfo', res.data.user, 2592000);
setStorage('Authorization', res.data.jwt, 86400); setStorage('Authorization', res.data.jwt, 2592000);
// const pages = getCurrentPages(); //获取小程序页面栈 // const pages = getCurrentPages(); //获取小程序页面栈
// const beforePage = pages[pages.length - 1]; //获取上个页面的实例对象 -3是上上一个页面 // const beforePage = pages[pages.length - 1]; //获取上个页面的实例对象 -3是上上一个页面
// wx.navigateBack({ // wx.navigateBack({

View File

@ -0,0 +1,20 @@
import {
request
} from '../_utils/request';
/** 取消关注表格数据 */
export function cancelfollow(parm) {
return new Promise((resolve, reject) => {
request({
url: `TableDataApi/cancelfollow`,
method: 'POST',
data: parm,
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}

View File

@ -0,0 +1,20 @@
import {
request
} from '../_utils/request';
/** 关注表格数据 */
export function follow(parm) {
return new Promise((resolve, reject) => {
request({
url: `TableDataApi/follow`,
method: 'POST',
data: parm,
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}

View File

@ -0,0 +1,20 @@
import {
request
} from '../_utils/request';
/** 获取涉及产品列表 */
export function getProductsInvolvedList(parm) {
return new Promise((resolve, reject) => {
request({
url: `TableDataApi/getProductsInvolvedList`,
method: 'GET',
data: parm,
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}

View File

@ -0,0 +1,20 @@
import {
request
} from '../_utils/request';
/** 获取详情 */
export function getTableDataDetails(parm) {
return new Promise((resolve, reject) => {
request({
url: `TableDataApi/getTableDataDetails`,
method: 'GET',
data: parm,
success: function (res) {
resolve(res);
},
fail: function (error) {
reject(error);
}
});
});
}