Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhqg-mini
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhqg
zhqg-mini
Commits
4cf20802
Commit
4cf20802
authored
Oct 30, 2020
by
wangyalan-git
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资讯管理/评论管理
parent
6bb006b0
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
385 additions
and
109 deletions
+385
-109
workspace.xml
.idea/workspace.xml
+24
-9
poster1@2x.png
images/icon/poster1@2x.png
+0
-0
index.js
pages/index/index.js
+35
-10
index.wxml
pages/index/index.wxml
+41
-43
index.wxss
pages/index/index.wxss
+4
-4
login.wxss
pages/login/login.wxss
+5
-4
index.js
pages/newDetail/index.js
+164
-23
index.json
pages/newDetail/index.json
+2
-1
index.wxml
pages/newDetail/index.wxml
+24
-1
index.wxss
pages/newDetail/index.wxss
+77
-1
index.js
pages/newsList/index.js
+1
-11
index.wxml
pages/newsList/index.wxml
+1
-1
index.wxss
pages/newsList/index.wxss
+6
-0
project.config.json
project.config.json
+1
-1
No files found.
.idea/workspace.xml
View file @
4cf20802
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"749f7826-d70b-49cf-994d-3acd7b934330"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"749f7826-d70b-49cf-994d-3acd7b934330"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/images/icon/poster1@2x.png"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/images/icon/poster1@2x.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/index/index.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/index/index.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/index/index.wxml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/index/index.wxml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/index/index.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/index/index.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/login/login.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/login/login.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/newDetail/index.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/newDetail/index.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/newDetail/index.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/newDetail/index.json"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/newDetail/index.wxml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/newDetail/index.wxml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/newDetail/index.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/newDetail/index.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/newsList/index.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/newsList/index.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/newsList/index.wxml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/newsList/index.wxml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pages/newsList/index.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pages/newsList/index.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/project.config.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/project.config.json"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/.tmp/"
/>
<ignored
path=
"$PROJECT_DIR$/.tmp/"
/>
<ignored
path=
"$PROJECT_DIR$/temp/"
/>
<ignored
path=
"$PROJECT_DIR$/temp/"
/>
<ignored
path=
"$PROJECT_DIR$/tmp/"
/>
<ignored
path=
"$PROJECT_DIR$/tmp/"
/>
...
@@ -15,7 +29,7 @@
...
@@ -15,7 +29,7 @@
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"-
99
"
/>
<option
name=
"x"
value=
"-
100
"
/>
<option
name=
"y"
value=
"5"
/>
<option
name=
"y"
value=
"5"
/>
<option
name=
"width"
value=
"1935"
/>
<option
name=
"width"
value=
"1935"
/>
<option
name=
"height"
value=
"1040"
/>
<option
name=
"height"
value=
"1040"
/>
...
@@ -69,23 +83,19 @@
...
@@ -69,23 +83,19 @@
<option
name=
"presentableId"
value=
"Default"
/>
<option
name=
"presentableId"
value=
"Default"
/>
<updated>
1603358883438
</updated>
<updated>
1603358883438
</updated>
<workItem
from=
"1603358884856"
duration=
"655000"
/>
<workItem
from=
"1603358884856"
duration=
"655000"
/>
<workItem
from=
"1604054385788"
duration=
"4000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"TimeTrackingManager"
>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"65
5
000"
/>
<option
name=
"totallyTimeSpent"
value=
"65
9
000"
/>
</component>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-7"
y=
"-7"
width=
"1550"
height=
"838"
extended-state=
"6"
/>
<frame
x=
"-7"
y=
"-7"
width=
"1550"
height=
"838"
extended-state=
"6"
/>
<layout>
<layout>
<window_info
id=
"Favorites"
side_tool=
"true"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.24966975"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.24966975"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
anchor=
"bottom"
id=
"Docker"
show_stripe_button=
"false"
/>
<window_info
id=
"Favorites"
order=
"2"
side_tool=
"true"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Version Control"
visible=
"true"
weight=
"0.6430595"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Messages"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
/>
...
@@ -93,6 +103,11 @@
...
@@ -93,6 +103,11 @@
<window_info
anchor=
"bottom"
id=
"Cvs"
order=
"4"
weight=
"0.25"
/>
<window_info
anchor=
"bottom"
id=
"Cvs"
order=
"4"
weight=
"0.25"
/>
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
/>
<window_info
anchor=
"bottom"
id=
"Docker"
order=
"7"
show_stripe_button=
"false"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Version Control"
order=
"8"
visible=
"true"
weight=
"0.3937677"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"9"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"10"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Messages"
order=
"11"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
<window_info
anchor=
"right"
id=
"Ant Build"
order=
"1"
weight=
"0.25"
/>
<window_info
anchor=
"right"
id=
"Ant Build"
order=
"1"
weight=
"0.25"
/>
<window_info
anchor=
"right"
content_ui=
"combo"
id=
"Hierarchy"
order=
"2"
weight=
"0.25"
/>
<window_info
anchor=
"right"
content_ui=
"combo"
id=
"Hierarchy"
order=
"2"
weight=
"0.25"
/>
...
...
images/icon/poster1@2x.png
View replaced file @
6bb006b0
View file @
4cf20802
326 KB
|
W:
|
H:
190 KB
|
W:
|
H:
2-up
Swipe
Onion skin
pages/index/index.js
View file @
4cf20802
...
@@ -18,6 +18,8 @@ Page({
...
@@ -18,6 +18,8 @@ Page({
news
:
[],
news
:
[],
taglist
:
[],
taglist
:
[],
sts
:
0
,
sts
:
0
,
preZone
:
[],
newGoods
:
[]
},
},
//事件处理函数
//事件处理函数
bindViewTap
:
function
()
{
bindViewTap
:
function
()
{
...
@@ -26,7 +28,7 @@ Page({
...
@@ -26,7 +28,7 @@ Page({
})
})
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
getAllData
();
},
},
toNews
(
e
)
{
toNews
(
e
)
{
...
@@ -135,8 +137,8 @@ Page({
...
@@ -135,8 +137,8 @@ Page({
url
:
'/pages/recent-news/recent-news'
,
url
:
'/pages/recent-news/recent-news'
,
})
})
},
},
onShow
:
function
()
{
onShow
:
function
()
{
this
.
getAllData
();
let
token
=
wx
.
getStorageSync
(
'token'
)
let
token
=
wx
.
getStorageSync
(
'token'
)
let
shareCode
=
wx
.
getStorageSync
(
'shareCode'
)
let
shareCode
=
wx
.
getStorageSync
(
'shareCode'
)
console
.
log
(
'页面参数路径'
,
shareCode
,
token
)
console
.
log
(
'页面参数路径'
,
shareCode
,
token
)
...
@@ -173,7 +175,9 @@ Page({
...
@@ -173,7 +175,9 @@ Page({
this
.
getVideoShow
()
this
.
getVideoShow
()
// this.getIndexImgs()
// this.getIndexImgs()
this
.
getNoticeList
();
this
.
getNoticeList
();
this
.
getTag
();
// this.getTag();
this
.
getTagProd
(
1
)
this
.
getTagProd
(
3
)
this
.
getHeadNews
()
this
.
getHeadNews
()
this
.
getHotNews
()
this
.
getHotNews
()
...
@@ -191,7 +195,6 @@ Page({
...
@@ -191,7 +195,6 @@ Page({
userId
:
app
.
globalData
.
userInfo
.
userId
,
userId
:
app
.
globalData
.
userInfo
.
userId
,
},
},
callBack
:
(
res
)
=>
{
callBack
:
(
res
)
=>
{
console
.
log
(
'头条'
,
res
.
result
.
list
)
this
.
setData
({
this
.
setData
({
headNews
:
res
.
result
.
list
,
headNews
:
res
.
result
.
list
,
});
});
...
@@ -296,7 +299,7 @@ Page({
...
@@ -296,7 +299,7 @@ Page({
http
.
request
(
params
);
http
.
request
(
params
);
},
},
getTagProd
(
id
,
index
)
{
getTagProd
(
id
)
{
var
param
=
{
var
param
=
{
url
:
"/prod/prodListByTagId"
,
url
:
"/prod/prodListByTagId"
,
method
:
"GET"
,
method
:
"GET"
,
...
@@ -305,16 +308,38 @@ Page({
...
@@ -305,16 +308,38 @@ Page({
size
:
6
size
:
6
},
},
callBack
:
(
res
)
=>
{
callBack
:
(
res
)
=>
{
var
taglist
=
this
.
data
.
taglist
;
if
(
id
==
3
){
taglist
[
index
].
prods
=
res
.
records
this
.
setData
({
this
.
setData
({
taglist
:
taglist
,
newGoods
:
res
.
records
});
})
}
else
{
this
.
setData
({
preZone
:
res
.
records
})
}
}
}
};
};
http
.
request
(
param
);
http
.
request
(
param
);
},
},
// getTagProd(id, index) {
// var param = {
// url: "/prod/prodListByTagId",
// method: "GET",
// data: {
// tagId: id,
// size: 6
// },
// callBack: (res) => {
// var taglist = this.data.taglist;
// taglist[index].prods = res.records
// this.setData({
// taglist: taglist,
// });
// }
// };
// http.request(param);
// },
/**
/**
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
...
...
pages/index/index.wxml
View file @
4cf20802
...
@@ -34,27 +34,25 @@
...
@@ -34,27 +34,25 @@
</view>
</view>
<!-- end swiper -->
<!-- end swiper -->
</view>
</view>
<!-- 商品 -->
<view wx:for="{{taglist}}" wx:key="id" style="margin-top: 20rpx;">
<!-- 首发新品 -->
<!-- 首发新品 -->
<view class='more-prod' wx:if="{{item.style==0}}"
>
<view class='more-prod'
>
<view class='title'>
<view class='title'>
<view style="display:flex;align-items: center;">
<view style="display:flex;align-items: center;">
<image src="/images/icon/products@2x.png" class="title-icon" mode="widthFix"></image>
<image src="/images/icon/products@2x.png" class="title-icon" mode="widthFix"></image>
<text>{{item.title
}}</text>
<text>{{'首发新品'
}}</text>
</view>
</view>
</view>
</view>
<view class='prod-show'>
<view class='prod-show'>
<block wx:for="{{item.pr
ods}}" wx:for-item="prod" wx:key="prodId">
<block wx:for="{{newGo
ods}}" wx:for-item="prod" wx:key="prodId">
<view class='show-item' bindtap='toProdPage' data-prodid="{{prod.prodId}}">
<view class='show-item' bindtap='toProdPage' data-prodid="{{prod.prodId}}">
<view class='more-prod-pic'>
<view class='more-prod-pic'>
<image src='{{prod.pic}}' class='more-pic'></image>
<image src='{{prod.pic}}' class='more-pic'></image>
</view>
</view>
<view class='prod-text-right'>
<view class='prod-text-right'>
<view class='text-ellipsis'>{{prod.prodName}}</view>
<view class='text-ellipsis'>{{prod.prodName}}</view>
<!-- <view class='prod-info'>{{prod.brief}}</view> --
>
<view class='prod-info'>{{prod.brief}}</view
>
<view class='prod-after'>已售:{{667}}人 | 预售:{{222}}人</view
>
<!-- <view class='prod-after'>已售:{{667}}人 | 预售:{{222}}人</view> --
>
<view class='b-cart'>
<view class='b-cart'>
<view class='price'>
<view class='price'>
<text class='symbol'>¥</text>
<text class='symbol'>¥</text>
...
@@ -68,44 +66,14 @@
...
@@ -68,44 +66,14 @@
</block>
</block>
</view>
</view>
</view>
</view>
<!-- 预热专区 -->
<view class='up-to-date' wx:if="{{item.style==2}}">
<view class='title'>
<view style="display:flex;align-items: center;">
<image src="/images/icon/hot@2x.png" class="title-icon" mode="widthFix"></image>
<text>{{item.title}}</text>
</view>
</view>
<view class='item-cont'>
<block wx:for="{{item.prods}}" wx:for-item="prod" wx:key="prodId">
<view class='prod-item' bindtap='toProdPage' data-prodid="{{prod.prodId}}">
<view>
<view class='imagecont'>
<image src='{{prod.pic}}' class='prodimg'></image>
</view>
<view class='prod-text'>{{prod.prodName}}</view>
<view class='price'>
<text class='symbol'>¥</text>
<text class='big-num'>{{wxs.parsePrice(prod.price)[0]}}</text>
<text class='small-num'>.{{wxs.parsePrice(prod.price)[1]}}</text>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<!-- 资讯 -->
<!-- 全供头条 -->
<!-- 全供头条 -->
<view class='more-prod'
style="margin-top: 20rpx;
">
<view class='more-prod'
wx:if="{{headNews && headNews.length}}
">
<view class='title' bindtap="goMore" data-type="1">
<view class='title' bindtap="goMore" data-type="1">
<view style="display: flex;align-items: center;">
<view style="display: flex;align-items: center;">
<image src="/images/icon/Headlines@2x.png" class="title-icon" mode="widthFix"></image>
<image src="/images/icon/Headlines@2x.png" class="title-icon" mode="widthFix"></image>
<text>{{'全供头条'}}</text>
<text>{{'全供头条'}}</text>
</view>
</view>
<view class="title-more"
>
<view class="title-more">
查看更多
查看更多
</view>
</view>
</view>
</view>
...
@@ -123,7 +91,8 @@
...
@@ -123,7 +91,8 @@
<view class="b-right">
<view class="b-right">
<image src='../../images/icon/comment@2x.png' class='basket-img'></image>
<image src='../../images/icon/comment@2x.png' class='basket-img'></image>
<text style="margin-right: 20rpx;">{{prod.commentNumber}}</text>
<text style="margin-right: 20rpx;">{{prod.commentNumber}}</text>
<image src='../../images/icon/Fabulous@2x.png' class='basket-img'></image>
<image src="../../images/icon/{{prod.praise? 'Fabul@2x.png':'Fabulous@2x.png'}}" class='basket-img'>
</image>
<text>{{prod.praiseNumber}}</text>
<text>{{prod.praiseNumber}}</text>
</view>
</view>
</view>
</view>
...
@@ -132,8 +101,36 @@
...
@@ -132,8 +101,36 @@
</block>
</block>
</view>
</view>
</view>
</view>
<!-- 预热专区 -->
<view class='up-to-date' style="margin-top: 20rpx;" >
<view class='title'>
<view style="display:flex;align-items: center;">
<image src="/images/icon/hot@2x.png" class="title-icon" mode="widthFix"></image>
<text>{{'预热专区'}}</text>
</view>
</view>
<view class='item-cont'>
<block wx:for="{{preZone}}" wx:for-item="prod" wx:key="prodId">
<view class='prod-item' bindtap='toProdPage' data-prodid="{{prod.prodId}}">
<view>
<view class='imagecont'>
<image src='{{prod.pic}}' class='prodimg'></image>
</view>
<view class='prod-text'>{{prod.prodName}}</view>
<view class='price'>
<text class='symbol'>¥</text>
<text class='big-num'>{{wxs.parsePrice(prod.price)[0]}}</text>
<text class='small-num'>.{{wxs.parsePrice(prod.price)[1]}}</text>
</view>
</view>
</view>
</block>
</view>
</view>
<!-- 热议专区 -->
<!-- 热议专区 -->
<view class='more-prod'
style="margin-top: 20rpx;
">
<view class='more-prod'
wx:if="{{hotNews && hotNews.length}}
">
<view class='title' bindtap="goMore" data-type="2">
<view class='title' bindtap="goMore" data-type="2">
<view style="display: flex;align-items: center;">
<view style="display: flex;align-items: center;">
<image src="/images/icon/discussion@2x.png" class="title-icon" mode="widthFix"></image>
<image src="/images/icon/discussion@2x.png" class="title-icon" mode="widthFix"></image>
...
@@ -144,7 +141,7 @@
...
@@ -144,7 +141,7 @@
</view>
</view>
</view>
</view>
<view class='prod-show'>
<view class='prod-show'>
<block wx:for="{{h
ead
News}}" wx:for-item="prod" wx:key="prodId">
<block wx:for="{{h
ot
News}}" wx:for-item="prod" wx:key="prodId">
<view class='show-item' bindtap='toNews' data-id="{{prod.id}}">
<view class='show-item' bindtap='toNews' data-id="{{prod.id}}">
<view class='more-prod-pic'>
<view class='more-prod-pic'>
<image src='{{prod.pic}}' class='more-pic'></image>
<image src='{{prod.pic}}' class='more-pic'></image>
...
@@ -157,7 +154,8 @@
...
@@ -157,7 +154,8 @@
<view class="b-right">
<view class="b-right">
<image src='../../images/icon/comment@2x.png' class='basket-img'></image>
<image src='../../images/icon/comment@2x.png' class='basket-img'></image>
<text style="margin-right: 20rpx;">{{prod.commentNumber}}</text>
<text style="margin-right: 20rpx;">{{prod.commentNumber}}</text>
<image src='../../images/icon/Fabulous@2x.png' class='basket-img'></image>
<image src="../../images/icon/{{prod.praise? 'Fabul@2x.png':'Fabulous@2x.png'}}" class='basket-img'>
</image>
<text>{{prod.praiseNumber}}</text>
<text>{{prod.praiseNumber}}</text>
</view>
</view>
</view>
</view>
...
...
pages/index/index.wxss
View file @
4cf20802
...
@@ -202,10 +202,8 @@ swiper.pic-swiper .banner {
...
@@ -202,10 +202,8 @@ swiper.pic-swiper .banner {
.title {
.title {
position: relative;
position: relative;
height: 64rpx;
line-height: 64rpx;
font-size: 32rpx;
font-size: 32rpx;
padding:
10rpx 30rpx
;
padding:
20rpx 30rpx 0
;
color: #333;
color: #333;
background: #fff;
background: #fff;
display: flex;
display: flex;
...
@@ -216,6 +214,7 @@ swiper.pic-swiper .banner {
...
@@ -216,6 +214,7 @@ swiper.pic-swiper .banner {
}
}
.title .title-icon{
.title .title-icon{
width: 40rpx;
width: 40rpx;
height: 40rpx;
margin-right: 5rpx;
margin-right: 5rpx;
}
}
.title .title-more{
.title .title-more{
...
@@ -270,7 +269,7 @@ line-height:44rpx;
...
@@ -270,7 +269,7 @@ line-height:44rpx;
margin: auto;
margin: auto;
height: auto;
height: auto;
width: calc(100% - 40rpx);
width: calc(100% - 40rpx);
padding:
0 20rpx
;
padding:
20rpx 20rpx 0
;
display: flex;
display: flex;
flex-wrap:wrap;
flex-wrap:wrap;
/* justify-content: space-between; */
/* justify-content: space-between; */
...
@@ -432,6 +431,7 @@ line-height:44rpx;
...
@@ -432,6 +431,7 @@ line-height:44rpx;
.more-prod {
.more-prod {
background: #fff;
background: #fff;
padding-bottom: 20rpx;
padding-bottom: 20rpx;
margin-top: 20rpx;
}
}
...
...
pages/login/login.wxss
View file @
4cf20802
...
@@ -38,11 +38,12 @@ button {
...
@@ -38,11 +38,12 @@ button {
}
}
.login-btn{
.login-btn
{
background-
color: #fff;
color: #fff;
color: #eb2444;
background-
color: #eb2444;
}
}
.no-login{
.no-login {
width: 100%;
width: 100%;
margin: 0 auto;
margin: 0 auto;
text-align: center;
text-align: center;
...
...
pages/newDetail/index.js
View file @
4cf20802
// pages/news-detail/news-detail.js
// pages/news-detail/news-detail.js
var
http
=
require
(
"../../utils/http.js"
);
var
http
=
require
(
"../../utils/http.js"
);
var
config
=
require
(
"../../utils/config.js"
);
var
config
=
require
(
"../../utils/config.js"
);
var
app
=
getApp
()
Page
({
Page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
id
:
''
,
news
:
{
news
:
{
title
:
''
,
title
:
''
,
content
:
''
,
content
:
''
,
id
:
null
id
:
null
,
},
pageNum
:
1
,
list
:
[],
total
:
0
,
flag
:
false
,
content
:
''
},
getDetail
()
{
var
that
=
this
var
params
=
{
url
:
'/consult/getOneById'
,
method
:
"GET"
,
data
:
{
consultId
:
that
.
data
.
id
,
userId
:
app
.
globalData
.
userInfo
.
userId
},
callBack
:
res
=>
{
let
consult
=
res
.
result
.
consult
consult
.
content
=
consult
.
content
.
replace
(
/width=/gi
,
'sss='
);
consult
.
content
=
consult
.
content
.
replace
(
/height=/gi
,
'sss='
);
consult
.
content
=
consult
.
content
.
replace
(
/
\/\>
/gi
,
' style="max-width:100% !important;display:block;"
\
/
\
>'
);
that
.
setData
({
news
:
consult
,
flag
:
res
.
result
.
flag
});
}
}
};
http
.
request
(
params
);
},
getList
()
{
var
that
=
this
var
params
=
{
url
:
'/consultComment/getListPage'
,
method
:
"GET"
,
data
:
{
consultId
:
this
.
data
.
id
,
pageNum
:
this
.
data
.
pageNum
,
pageSize
:
5
,
status
:
0
},
},
callBack
:
res
=>
{
let
list
=
res
.
result
.
list
if
(
that
.
data
.
pageNum
>
1
)
{
list
=
that
.
data
.
list
.
concat
(
list
)
}
that
.
setData
({
list
:
list
,
total
:
res
.
result
.
total
})
console
.
log
(
'list'
,
that
.
data
.
list
)
}
};
http
.
request
(
params
);
},
toLike
()
{
var
that
=
this
,
user
=
app
.
globalData
.
userInfo
if
(
user
&&
user
.
userId
)
{
var
params
=
{
url
:
'/p/consultPraise/praisr'
,
method
:
"POST"
,
data
:
{
consultId
:
that
.
data
.
id
,
userId
:
app
.
globalData
.
userInfo
.
userId
},
callBack
:
res
=>
{
wx
.
showToast
({
title
:
'点赞成功'
,
})
that
.
getDetail
()
}
};
http
.
request
(
params
);
}
else
{
wx
.
navigateTo
({
url
:
'/pages/login/login'
,
})
}
},
cancleLike
()
{
var
that
=
this
,
user
=
app
.
globalData
.
userInfo
if
(
user
&&
user
.
userId
)
{
var
params
=
{
url
:
'/p/consultPraise/canclePraisr'
,
method
:
"POST"
,
data
:
{
consultId
:
that
.
data
.
id
,
userId
:
app
.
globalData
.
userInfo
.
userId
},
callBack
:
res
=>
{
wx
.
showToast
({
title
:
'取消点赞'
,
})
that
.
getDetail
()
}
};
http
.
request
(
params
);
}
else
{
wx
.
navigateTo
({
url
:
'/pages/login/login'
,
})
}
},
toComment
()
{
var
that
=
this
,
user
=
app
.
globalData
.
userInfo
if
(
user
&&
user
.
userId
)
{
var
params
=
{
url
:
'/consultComment/insertCommentConsult'
,
method
:
"POST"
,
data
:
{
consultId
:
that
.
data
.
id
,
status
:
0
,
content
:
that
.
data
.
content
,
userId
:
app
.
globalData
.
userInfo
.
userId
},
callBack
:
res
=>
{
wx
.
showToast
({
title
:
'评论成功'
,
})
that
.
setData
({
content
:
''
,
pageNum
:
1
,
total
:
0
,
list
:
[]
},
function
()
{
that
.
getList
()
})
}
};
http
.
request
(
params
);
}
else
{
wx
.
navigateTo
({
url
:
'/pages/login/login'
,
})
}
},
inputContent
(
e
)
{
this
.
setData
({
content
:
e
.
detail
.
value
})
},
focusConent
(
e
){
let
user
=
app
.
globalData
.
userInfo
if
(
!
user
||
!
user
.
userId
)
{
wx
.
navigateTo
({
url
:
'/pages/login/login'
,
})
}
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// var ths = this;
//加载公告详情
var
params
=
{
// `/shop/notice/info/${options.id}`
url
:
'/shop/notice/info/'
+
options
.
id
,
method
:
"GET"
,
// data: {
// id: id,
// },
// callBack: function(news){
callBack
:
res
=>
{
res
.
content
=
res
.
content
.
replace
(
/width=/gi
,
'sss='
);
res
.
content
=
res
.
content
.
replace
(
/height=/gi
,
'sss='
);
res
.
content
=
res
.
content
.
replace
(
/
\/\>
/gi
,
' style="max-width:100% !important;display:block;"
\
/
\
>'
);
this
.
setData
({
this
.
setData
({
news
:
res
id
:
options
.
id
});
})
}
this
.
getDetail
()
};
http
.
request
(
params
);
},
},
/**
/**
...
@@ -54,7 +186,13 @@ Page({
...
@@ -54,7 +186,13 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
this
.
setData
({
list
:
[],
pageNum
:
1
,
total
:
0
},
function
()
{
this
.
getList
()
})
},
},
/**
/**
...
@@ -82,7 +220,10 @@ Page({
...
@@ -82,7 +220,10 @@ Page({
* 页面上拉触底事件的处理函数
* 页面上拉触底事件的处理函数
*/
*/
onReachBottom
:
function
()
{
onReachBottom
:
function
()
{
if
(
this
.
data
.
total
>
this
.
data
.
list
.
length
)
{
this
.
data
.
pageNum
++
this
.
getList
()
}
},
},
/**
/**
...
...
pages/newDetail/index.json
View file @
4cf20802
{
{
"backgroundTextStyle"
:
"light"
,
"backgroundTextStyle"
:
"light"
,
"navigationBarTitleText"
:
"
最新公告
"
,
"navigationBarTitleText"
:
"
资讯详情
"
,
"navigationBarTextStyle"
:
"black"
,
"navigationBarTextStyle"
:
"black"
,
"navigationBarBackgroundColor"
:
"#fafafa"
"navigationBarBackgroundColor"
:
"#fafafa"
}
}
\ No newline at end of file
pages/newDetail/index.wxml
View file @
4cf20802
<!--pages/news-detail/news-detail.wxml-->
<!--pages/news-detail/news-detail.wxml-->
<view class='container'>
<view class='container'>
<!-- <block wx:for='{{news}}' wx:key=''> -->
<!-- <block wx:for='{{news}}' wx:key=''> -->
<view class='news-detail'>
<view class='news-detail'>
<view class='news-detail-title'>{{news.title}}</view>
<view class='news-detail-title'>{{news.title}}</view>
<view class="time">{{news.createTime}}</view>
<!-- <view class='news-detail-text'>{{news.content}}</view> -->
<!-- <view class='news-detail-text'>{{news.content}}</view> -->
<image wx:if="{{news.pic}}" class="img" src="{{news.pic}}" mode="widthFix"></image>
<rich-text nodes="{{news.content}}"></rich-text>
<rich-text nodes="{{news.content}}"></rich-text>
</view>
</view>
<!-- </block> -->
<!-- </block> -->
<!-- 评论 -->
<block wx:if="{{list.length}}">
<view class="comment-title">全部评论</view>
<view class="comments" wx:for="{{list}}" wx:key="index">
<image src="{{item.pic}}" mode="widthFix"></image>
<view class="info-right">
<view>{{item.nickName}}</view>
<view>{{item.createTime}}</view>
<view>{{item.content}}</view>
</view>
</view>
</block>
</view>
<view class="bottom">
<input class="input" placeholder='请发表你的评论' maxlength='100' value="{{content}}"
bindinput="inputContent" bindconfirm="toComment" bindfocus="focusConent"></input>
<image class="like-img" wx:if="{{!flag}}" src="/images/icon/Fabulous@2x.png" bindtap="toLike" mode="widthFix"></image>
<image class="like-img" wx:else src="/images/icon/Fabul@2x.png" mode="widthFix" bindtap="cancleLike"></image>
</view>
</view>
\ No newline at end of file
pages/newDetail/index.wxss
View file @
4cf20802
/* pages/news-detail/news-detail.wxss */
/* pages/news-detail/news-detail.wxss */
.container {
padding-bottom: 120rpx;
}
.news-detail {
.news-detail {
padding: 20rpx;
padding: 20rpx;
...
@@ -8,7 +11,11 @@
...
@@ -8,7 +11,11 @@
font-size: 32rpx;
font-size: 32rpx;
font-weight: bold;
font-weight: bold;
line-height: 50rpx;
line-height: 50rpx;
padding: 20rpx;
padding: 20rpx 20rpx 0;
}
.img {
width: 100%;
}
}
.news-detail .news-detail-text {
.news-detail .news-detail-text {
...
@@ -18,3 +25,71 @@
...
@@ -18,3 +25,71 @@
text-justify: inter-ideograph;
text-justify: inter-ideograph;
margin-top: 20rpx;
margin-top: 20rpx;
}
}
.comment-title {
text-align: center;
font-size: 30rpx;
color: #020202;
}
.comments {
width: 100%;
display: flex;
align-items: flex-start;
padding: 20rpx 30rpx;
}
.info-right {
color: #999;
font-size: 24rpx;
}
.comments image {
width: 50rpx;
margin-right: 20rpx;
}
.info-right view:first-child {
color: #333;
font-size: 30rpx;
}
.info-right view:last-child {
font-size: 26rpx;
color: #333;
}
.time {
color: #999;
font-size: 24rpx;
padding: 10rpx 20rpx;
}
.bottom {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 98rpx;
display: flex;
align-items: center;
border-top: 1rpx solid #f2f2f2;
background: #fff;
padding: 0 30rpx;
}
.bottom .input {
font-size: 26rpx;
border: 1rpx solid #ccc;
border-radius: 40rpx;
padding-left: 20rpx;
flex: 1;
height: 60rpx;
line-height: 60rpx;
}
.bottom .like-img {
width: 50rpx;
height: 50rpx;
margin-left: 20rpx;
}
\ No newline at end of file
pages/newsList/index.js
View file @
4cf20802
...
@@ -68,17 +68,7 @@ Page({
...
@@ -68,17 +68,7 @@ Page({
onShow
:
function
()
{
onShow
:
function
()
{
this
.
setData
({
this
.
setData
({
type
:
this
.
options
.
type
,
type
:
this
.
options
.
type
,
list
:
[
list
:
[],
{
"brief"
:
""
,
"createTime"
:
"2020-09-09"
,
"id"
:
0
,
"pic"
:
"https://zhqg.jsonpro.cn/zhqgImages/product/20201022/c8c82ad4e9824d6996d183450e0ee0cf.jpg"
,
"price"
:
0
,
"prodId"
:
0
,
"title"
:
"标题表题"
,
"userId"
:
""
}],
pageNum
:
1
,
pageNum
:
1
,
total
:
0
total
:
0
})
})
...
...
pages/newsList/index.wxml
View file @
4cf20802
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<view class="b-right">
<view class="b-right">
<image src='../../images/icon/comment@2x.png' class='basket-img'></image>
<image src='../../images/icon/comment@2x.png' class='basket-img'></image>
<text style="margin-right: 20rpx;">{{prod.commentNumber}}</text>
<text style="margin-right: 20rpx;">{{prod.commentNumber}}</text>
<image src=
'../../images/icon/Fabulous@2x.png'
class='basket-img'></image>
<image src=
"../../images/icon/{{prod.praise? 'Fabul@2x.png':'Fabulous@2x.png'}}"
class='basket-img'></image>
<text>{{prod.praiseNumber}}</text>
<text>{{prod.praiseNumber}}</text>
</view>
</view>
</view>
</view>
...
...
pages/newsList/index.wxss
View file @
4cf20802
...
@@ -108,3 +108,8 @@ page {
...
@@ -108,3 +108,8 @@ page {
display: flex;
display: flex;
align-items: center;
align-items: center;
}
}
.offList{
color: #999;
font-size: 26rpx;
padding-top: 30rpx;
}
\ No newline at end of file
project.config.json
View file @
4cf20802
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"ignore"
:
[]
"ignore"
:
[]
},
},
"setting"
:
{
"setting"
:
{
"urlCheck"
:
tru
e
,
"urlCheck"
:
fals
e
,
"es6"
:
true
,
"es6"
:
true
,
"enhance"
:
false
,
"enhance"
:
false
,
"postcss"
:
true
,
"postcss"
:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment