价格隐藏
This commit is contained in:
1
app.json
1
app.json
@@ -6,6 +6,7 @@
|
|||||||
"pages/login/index",
|
"pages/login/index",
|
||||||
"pages/article/index",
|
"pages/article/index",
|
||||||
"pages/article/info/info",
|
"pages/article/info/info",
|
||||||
|
"pages/article/articleList/index",
|
||||||
"pages/member/open/open",
|
"pages/member/open/open",
|
||||||
"pages/login/agreement/agreement",
|
"pages/login/agreement/agreement",
|
||||||
"pages/stock/index",
|
"pages/stock/index",
|
||||||
|
|||||||
92
pages/article/articleList/index.js
Normal file
92
pages/article/articleList/index.js
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* 手太欠
|
||||||
|
* 愿这世界都如故事里一样 美好而动人~
|
||||||
|
*/
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
articlesArr : [] , //列表
|
||||||
|
page : {}, //分页信息
|
||||||
|
type : '', //类型
|
||||||
|
name : '', //名称
|
||||||
|
lodingStats : false, //加载状态
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
console.log(options)
|
||||||
|
this.setData({
|
||||||
|
type: options.type
|
||||||
|
})
|
||||||
|
if (options.type == '1') {
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '锶源昆仑·记忆'
|
||||||
|
})
|
||||||
|
this.setData({
|
||||||
|
name: 'memory'
|
||||||
|
})
|
||||||
|
} else if (options.type == '2') {
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '锶源昆仑·健康百科'
|
||||||
|
})
|
||||||
|
this.setData({
|
||||||
|
name: 'wiki'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
// 获取列表
|
||||||
|
this.articlesInfo();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 列表
|
||||||
|
articlesInfo(page){
|
||||||
|
wx.$api.mall.articlesList({
|
||||||
|
category_id : this.data.type,
|
||||||
|
page : page || 1
|
||||||
|
}).then(res => {
|
||||||
|
let listArr = this.data.articlesArr,
|
||||||
|
newData = []
|
||||||
|
if(page == 1 || page == undefined) listArr = []
|
||||||
|
newData = listArr.concat(res.data.data)
|
||||||
|
this.setData({
|
||||||
|
articlesArr : newData,
|
||||||
|
page : res.data.page,
|
||||||
|
lodingStats : false
|
||||||
|
})
|
||||||
|
wx.stopPullDownRefresh()
|
||||||
|
}).catch(err => {})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
// 获取列表
|
||||||
|
this.articlesInfo();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上拉加载
|
||||||
|
*/
|
||||||
|
onReachBottom(){
|
||||||
|
this.setData({
|
||||||
|
lodingStats: true
|
||||||
|
})
|
||||||
|
let pageNumber = this.data.page.current
|
||||||
|
if(this.data.page.has_more){
|
||||||
|
pageNumber++
|
||||||
|
// 获取列表
|
||||||
|
this.articlesInfo(pageNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
3
pages/article/articleList/index.json
Normal file
3
pages/article/articleList/index.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
25
pages/article/articleList/index.wxml
Normal file
25
pages/article/articleList/index.wxml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<view class="list" wx:if="{{articlesArr.length > 0}}">
|
||||||
|
<navigator hover-class="none" url="../info/info?id={{item.article_id}}&type={{name}}" class="item" wx:for="{{articlesArr}}" wx:key="articlesArr">
|
||||||
|
<view class="itemCont">
|
||||||
|
<view class="nowrap itemCont-name"><text>{{item.categories[0].slug}}</text> | {{item.title}}</view>
|
||||||
|
<view class="nowrap itemCont-text">{{item.description}}</view>
|
||||||
|
<view class="itemCont-see">
|
||||||
|
<view class="itemCont-icon"><image src="https://api.siyuankunlun.com/storage/materials/2022/10/11/articleIcon_00.png"></image> {{item.clicks}}</view>
|
||||||
|
<view class="itemCont-icon"><image src="https://api.siyuankunlun.com/storage/materials/2022/10/11/articleIcon_01.png"></image>{{item.subscribes}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="itemImg" mode="aspectFill" src="{{item.cover}}"></image>
|
||||||
|
</navigator>
|
||||||
|
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||||
|
<block wx:if="{{page.has_more}}">
|
||||||
|
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||||
|
</block>
|
||||||
|
<block wx:else>
|
||||||
|
没有更多了~
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="pack-center pages-hint" wx:else>
|
||||||
|
<image src="/static/imgs/coupon_null.png"></image>
|
||||||
|
<view>暂无数据</view>
|
||||||
|
</view>
|
||||||
66
pages/article/articleList/index.wxss
Normal file
66
pages/article/articleList/index.wxss
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
page {
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
position: relative;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemImg {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemCont {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
padding: 25rpx 230rpx 0 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemCont-name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemCont-name text {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemCont-text {
|
||||||
|
color: #999;
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin: 15rpx 0 30rpx;
|
||||||
|
font-weight: 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemCont-see {
|
||||||
|
color: #999;
|
||||||
|
display: flex;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemCont-icon {
|
||||||
|
display: flex;
|
||||||
|
margin-right: 50rpx;
|
||||||
|
line-height: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemCont-icon image {
|
||||||
|
width: 26rpx;
|
||||||
|
height: 26rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
@@ -11,7 +11,8 @@
|
|||||||
<view class="nowrap itemCont-name">{{item.name}}</view>
|
<view class="nowrap itemCont-name">{{item.name}}</view>
|
||||||
<view class="nowrap itemCont-text">{{item.description}}</view>
|
<view class="nowrap itemCont-text">{{item.description}}</view>
|
||||||
<view class="itemCont-price">
|
<view class="itemCont-price">
|
||||||
<!-- <image src="/static/icons/newIcon_03.png"></image> -->¥{{item.price.price_max}}
|
<!-- <image src="/static/icons/newIcon_03.png"></image> -->
|
||||||
|
<!-- ¥{{item.price.price_max}} -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||||
"projectname": "%E9%94%B6%E6%BA%90%E6%98%86%E4%BB%91",
|
"projectname": "sykl-mall",
|
||||||
"setting": {
|
"setting": {
|
||||||
"compileHotReLoad": true,
|
"compileHotReLoad": true,
|
||||||
"urlCheck": true
|
"urlCheck": true
|
||||||
|
|||||||
Reference in New Issue
Block a user