Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
20b97ec8
Commit
20b97ec8
authored
Nov 16, 2018
by
Junling Bu
Browse files
chore[litemall-wx]: 使用微信开发者工具的格式化代码
parent
822d5075
Changes
102
Hide whitespace changes
Inline
Side-by-side
litemall-wx/pages/search/search.wxml
View file @
20b97ec8
...
...
@@ -8,55 +8,55 @@
<view class="right" bindtap="closeSearch">取消</view>
</view>
<view class="no-search" wx:if="{{ !searchStatus}}">
<view class="search-keywords search-history" wx:if="{{!keyword && historyKeyword.length}}">
<view class="h">
<text class="title">历史记录</text>
<image class="icon" bindtap="clearHistory" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/del1-93f0a4add4.png"></image>
</view>
<view class="b">
<view class="item" bindtap="onKeywordTap" data-keyword="{{item.keyword}}" wx:for="{{historyKeyword}}" wx:key="keyword" hover-class="navigator-hover">{{item.keyword}}</view>
<view class="search-keywords search-history" wx:if="{{!keyword && historyKeyword.length}}">
<view class="h">
<text class="title">历史记录</text>
<image class="icon" bindtap="clearHistory" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/del1-93f0a4add4.png"></image>
</view>
<view class="b">
<view class="item" bindtap="onKeywordTap" data-keyword="{{item.keyword}}" wx:for="{{historyKeyword}}" wx:key="keyword" hover-class="navigator-hover">{{item.keyword}}</view>
</view>
</view>
</view>
<view class="search-keywords search-hot" wx:if="{{!keyword && hotKeyword.length}}">
<view class="h">
<text class="title">热门搜索</text>
<view class="search-keywords search-hot" wx:if="{{!keyword && hotKeyword.length}}">
<view class="h">
<text class="title">热门搜索</text>
</view>
<view class="b">
<view class="item {{item.is_hot === 1 ? 'active' : ''}}" hover-class="navigator-hover" bindtap="onKeywordTap" data-keyword="{{item.keyword}}" wx:for="{{hotKeyword}}" wx:key="id">{{item.keyword}}</view>
</view>
</view>
<view class="
b
">
<view class="item
{{item.is_hot === 1 ? 'active' : ''}}" hover-class="navigator-hover" bindtap="onKeywordTap" data-keyword="{{item.keyword}}" wx:for="{{hotKeyword}}" wx:key="id">{{item.keyword
}}</view>
<view class="
shelper-list" wx:if="{{keyword}}
">
<view class="item
" hover-class="navigator-hover" wx:for="{{helpKeyword}}" wx:key="id" bindtap="onKeywordTap" data-keyword="{{item}}">{{item
}}</view>
</view>
</view>
<view class="shelper-list" wx:if="{{keyword}}">
<view class="item" hover-class="navigator-hover" wx:for="{{helpKeyword}}" wx:key="id" bindtap="onKeywordTap" data-keyword="{{item}}">{{item}}</view>
</view>
</view>
<view class="search-result" wx:if="{{ searchStatus && goodsList.length}}">
<view class="sort">
<view class="sort-box">
<view class="item {{currentSortType == 'default' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultSort">
<text class="txt">综合</text>
</view>
<view class="item by-price {{currentSortType == 'price' ? 'active' : ''}} {{currentSortOrder == 'asc' ? 'asc' : 'desc'}}" bindtap="openSortFilter" id="priceSort">
<text class="txt">价格</text>
<view class="sort-box">
<view class="item {{currentSortType == 'default' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultSort">
<text class="txt">综合</text>
</view>
<view class="item by-price {{currentSortType == 'price' ? 'active' : ''}} {{currentSortOrder == 'asc' ? 'asc' : 'desc'}}" bindtap="openSortFilter" id="priceSort">
<text class="txt">价格</text>
</view>
<view class="item {{currentSortType == 'category' ? 'active' : ''}}" bindtap="openSortFilter" id="categoryFilter">
<text class="txt">分类</text>
</view>
</view>
<view class="
item {{currentSortType == 'category' ? 'active' : ''}}" bindtap="openSortFilter" id="
categoryFilter">
<
text
class="
txt">分类</text
>
<view class="
sort-box-category" wx-if="{{
categoryFilter
}}
">
<
view
class="
item {{item.checked ? 'active' : ''}}" wx:for="{{filterCategory}}" wx:key="id" data-category-index="{{index}}" bindtap="selectCategory">{{item.name}}</view
>
</view>
</view>
<view class="sort-box-category" wx-if="{{categoryFilter}}">
<view class="item {{item.checked ? 'active' : ''}}" wx:for="{{filterCategory}}" wx:key="id" data-category-index="{{index}}" bindtap="selectCategory">{{item.name}}</view>
</view>
</view>
<view class="cate-item">
<view class="b">
<navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex">
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
<view class="cate-item">
<view class="b">
<navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex">
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
</view>
</view>
</view>
</view>
<view class="search-result-empty" wx:if="{{!goodsList.length && searchStatus}}">
<image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noSearchResult-7572a94f32.png"></image>
...
...
litemall-wx/pages/search/search.wxss
View file @
20b97ec8
page{
page
{
min-height: 100%;
background-color: #f4f4f4;
}
.container{
.container
{
min-height: 100%;
background-color: #f4f4f4;
}
.search-header{
position: fixed;
top: 0;
width: 750rpx;
height: 91rpx;
display: flex;
background: #fff;
border-bottom: 1px solid rgba(0,0,0,.15);
padding: 0 31.25rpx;
font-size: 29rpx;
color: #333;
}
.search-header .input-box{
position: relative;
margin-top: 16rpx;
float: left;
width: 0;
flex: 1;
height: 59rpx;
line-height: 59rpx;
padding: 0 20rpx;
background: #f4f4f4;
}
.search-header .icon{
position: absolute;
top: 14rpx;
left: 20rpx;
width: 31rpx;
height: 31rpx;
}
.search-header .del{
position: absolute;
top: 3rpx;
right: 10rpx;
width: 53rpx;
height: 53rpx;
z-index: 10;
.search-header {
position: fixed;
top: 0;
width: 750rpx;
height: 91rpx;
display: flex;
background: #fff;
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
padding: 0 31.25rpx;
font-size: 29rpx;
color: #333;
}
.search-header .keywrod{
position: absolute;
top: 0;
left: 40rpx;
width: 506rpx;
height: 59rpx;
padding-left: 30rpx;
}
.search-header .right{
margin-top: 24rpx;
margin-left: 31rpx;
margin-right: 6rpx;
width: 58rpx;
height: 43rpx;
line-height: 43rpx;
float: right;
}
.no-search{
height: auto;
overflow: hidden;
margin-top: 91rpx;
}
.search-keywords{
background: #fff;
width: 750rpx;
height: auto;
overflow: hidden;
margin-bottom: 20rpx;
}
.search-keywords .h{
padding: 0 31.25rpx;
height: 93rpx;
line-height: 93rpx;
width: 100%;
color: #999;
font-size: 29rpx;
.search-header .input-box {
position: relative;
margin-top: 16rpx;
float: left;
width: 0;
flex: 1;
height: 59rpx;
line-height: 59rpx;
padding: 0 20rpx;
background: #f4f4f4;
}
.search-keywords .title{
display: block;
width: 120rpx;
float: left;
.search-header .icon {
position: absolute;
top: 14rpx;
left: 20rpx;
width: 31rpx;
height: 31rpx;
}
.search-
keywords .icon
{
margin-top: 19rpx
;
float: right
;
display: block
;
margin-left
: 5
11
rpx;
height: 5
5
rpx;
width: 55rpx
;
.search-
header .del
{
position: absolute
;
top: 3rpx
;
right: 10rpx
;
width
: 5
3
rpx;
height: 5
3
rpx;
z-index: 10
;
}
.search-keywords .b{
width: 750rpx;
height: auto;
overflow: hidden;
padding-left: 31.25rpx;
.search-header .keywrod {
position: absolute;
top: 0;
left: 40rpx;
width: 506rpx;
height: 59rpx;
padding-left: 30rpx;
}
.search-keywords .item{
display: inline-block;
width: auto;
height: 48rpx;
line-height: 48rpx;
padding:0 15rpx;
border: 1px solid #999;
margin: 0 31.25rpx 31.25rpx 0;
font-size: 24rpx;
color: #333;
.search-header .right {
margin-top: 24rpx;
margin-left: 31rpx;
margin-right: 6rpx;
width: 58rpx;
height: 43rpx;
line-height: 43rpx;
float: right;
}
.search-keywords .item.active{
color: #b4282d;
border: 1px solid #b4282d;
.no-search {
height: auto;
overflow: hidden;
margin-top: 91rpx;
}
.shelper-list{
width: 750rpx;
height: auto;
overflow: hidden;
background: #fff;
padding: 0 31.25rpx;
.search-keywords {
background: #fff;
width: 750rpx;
height: auto;
overflow: hidden;
margin-bottom: 20rpx;
}
.search-keywords .h {
padding: 0 31.25rpx;
height: 93rpx;
line-height: 93rpx;
width: 100%;
color: #999;
font-size: 29rpx;
}
.shelper-list .item{
height: 93rpx;
width: 687.5rpx;
line-height: 93rpx;
font-size: 24rpx;
color: #333;
border-bottom: 1px solid #f4f4f4;
.search-keywords .title {
display: block;
width: 120rpx;
float: left;
}
.search-keywords .icon {
margin-top: 19rpx;
float: right;
display: block;
margin-left: 511rpx;
height: 55rpx;
width: 55rpx;
}
.search-keywords .b {
width: 750rpx;
height: auto;
overflow: hidden;
padding-left: 31.25rpx;
}
.search-keywords .item {
display: inline-block;
width: auto;
height: 48rpx;
line-height: 48rpx;
padding: 0 15rpx;
border: 1px solid #999;
margin: 0 31.25rpx 31.25rpx 0;
font-size: 24rpx;
color: #333;
}
.search-keywords .item.active {
color: #b4282d;
border: 1px solid #b4282d;
}
.shelper-list {
width: 750rpx;
height: auto;
overflow: hidden;
background: #fff;
padding: 0 31.25rpx;
}
.shelper-list .item {
height: 93rpx;
width: 687.5rpx;
line-height: 93rpx;
font-size: 24rpx;
color: #333;
border-bottom: 1px solid #f4f4f4;
}
.sort{
position: fixed;
top: 91rpx;
background: #fff;
width: 100%;
height: 78rpx;
.sort
{
position: fixed;
top: 91rpx;
background: #fff;
width: 100%;
height: 78rpx;
}
.sort-box{
background: #fff;
width: 100%;
height: 78rpx;
overflow: hidden;
padding: 0 30rpx;
display: flex;
border-bottom: 1px solid #d9d9d9;
.sort-box
{
background: #fff;
width: 100%;
height: 78rpx;
overflow: hidden;
padding: 0 30rpx;
display: flex;
border-bottom: 1px solid #d9d9d9;
}
.sort-box .item{
height: 78rpx;
line-height: 78rpx;
text-align: center;
flex:1;
color: #333;
font-size: 30rpx;
.sort-box .item
{
height: 78rpx;
line-height: 78rpx;
text-align: center;
flex:
1;
color: #333;
font-size: 30rpx;
}
.sort-box .item .txt{
display: block;
width: 100%;
height: 100%;
color: #333;
.sort-box .item .txt
{
display: block;
width: 100%;
height: 100%;
color: #333;
}
.sort-box .item.active .txt{
color: #b4282d;
.sort-box .item.active .txt
{
color: #b4282d;
}
.sort-box .item.by-price{
background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx;
.sort-box .item.by-price
{
background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx;
}
.sort-box .item.by-price.active.asc{
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx;
.sort-box .item.by-price.active.asc
{
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx;
}
.sort-box .item.by-price.active.desc{
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx;
.sort-box .item.by-price.active.desc
{
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx;
}
.sort-box-category{
background: #fff;
width: 100%;
height: auto;
overflow: hidden;
padding: 40rpx 40rpx 0 0;
border-bottom: 1px solid #d9d9d9;
.sort-box-category
{
background: #fff;
width: 100%;
height: auto;
overflow: hidden;
padding: 40rpx 40rpx 0 0;
border-bottom: 1px solid #d9d9d9;
}
.sort-box-category .item{
height: 54rpx;
line-height: 54rpx;
text-align: center;
float: left;
padding: 0 16rpx;
margin: 0 0 40rpx 40rpx;
border: 1px solid #666;
color: #333;
font-size: 24rpx;
.sort-box-category .item
{
height: 54rpx;
line-height: 54rpx;
text-align: center;
float: left;
padding: 0 16rpx;
margin: 0 0 40rpx 40rpx;
border: 1px solid #666;
color: #333;
font-size: 24rpx;
}
.sort-box-category .item.active{
color: #b4282d;
border: 1px solid #b4282d;
.sort-box-category .item.active
{
color: #b4282d;
border: 1px solid #b4282d;
}
.cate-item{
margin-top: 175rpx;
height: auto;
overflow: hidden;
.cate-item
{
margin-top: 175rpx;
height: auto;
overflow: hidden;
}
.cate-item .h{
height: 145rpx;
width: 750rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.cate-item .h
{
height: 145rpx;
width: 750rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.cate-item .h .name{
display: block;
height: 35rpx;
margin-bottom: 18rpx;
font-size: 30rpx;
color: #333;
.cate-item .h .name
{
display: block;
height: 35rpx;
margin-bottom: 18rpx;
font-size: 30rpx;
color: #333;
}
.cate-item .h .desc{
display: block;
height: 24rpx;
font-size: 24rpx;
color: #999;
.cate-item .h .desc
{
display: block;
height: 24rpx;
font-size: 24rpx;
color: #999;
}
.cate-item .b{
.cate-item .b
{
width: 750rpx;
padding: 0 6.25rpx;
height: auto;
overflow: hidden;
}
.cate-item .list-filter{
height: 80rpx;
width: 100%;
background: #fff;
margin-bottom: 6.25rpx;
.cate-item .list-filter
{
height: 80rpx;
width: 100%;
background: #fff;
margin-bottom: 6.25rpx;
}
.cate-item .b .item{
.cate-item .b .item
{
float: left;
background: #fff;
width: 365rpx;
...
...
@@ -283,16 +282,16 @@ page{
text-align: center;
}
.cate-item .b .item-b{
.cate-item .b .item-b
{
margin-left: 6.25rpx;
}
.cate-item .item .img{
.cate-item .item .img
{
width: 302rpx;
height: 302rpx;
}
.cate-item .item .name{
.cate-item .item .name
{
display: block;
width: 365.625rpx;
height: 35rpx;
...
...
@@ -304,7 +303,7 @@ page{
color: #333;
}
.cate-item .item .price{
.cate-item .item .price
{
display: block;
width: 365.625rpx;
height: 30rpx;
...
...
@@ -313,24 +312,24 @@ page{
color: #b4282d;
}
.search-result-empty{
width: 100%;
height: 100%;
padding-top: 300rpx;
.search-result-empty
{
width: 100%;
height: 100%;
padding-top: 300rpx;
}
.search-result-empty .icon{
margin: 0 auto;
display: block;
width: 240rpx;
height: 240rpx;
.search-result-empty .icon
{
margin: 0 auto;
display: block;
width: 240rpx;
height: 240rpx;
}
.search-result-empty .text{
display: block;
width: 100%;
height: 40rpx;
font-size: 28rpx;
text-align: center;
color: #999;
}
\ No newline at end of file
.search-result-empty .text {
display: block;
width: 100%;
height: 40rpx;
font-size: 28rpx;
text-align: center;
color: #999;
}
litemall-wx/pages/topic/topic.js
View file @
20b97ec8
...
...
@@ -2,82 +2,85 @@ var util = require('../../utils/util.js');
var
api
=
require
(
'
../../config/api.js
'
);
var
app
=
getApp
()
Page
({
data
:
{
topicList
:
[],
page
:
1
,
size
:
10
,
count
:
0
,
scrollTop
:
0
,
showPage
:
false
},
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
getTopic
();
},
onReady
:
function
()
{
// 页面渲染完成
},
onShow
:
function
()
{
// 页面显示
},
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
// 页面关闭
},
nextPage
:
function
(
event
)
{
var
that
=
this
;
if
(
this
.
data
.
page
>
that
.
data
.
count
/
that
.
data
.
size
)
{
return
true
;
}
data
:
{
topicList
:
[],
page
:
1
,
size
:
10
,
count
:
0
,
scrollTop
:
0
,
showPage
:
false
},
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
getTopic
();
},
onReady
:
function
()
{
// 页面渲染完成
},
onShow
:
function
()
{
// 页面显示
},
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
// 页面关闭
},
nextPage
:
function
(
event
)
{
var
that
=
this
;
if
(
this
.
data
.
page
>
that
.
data
.
count
/
that
.
data
.
size
)
{
return
true
;
}
that
.
setData
({
page
:
that
.
data
.
page
+
1
});
this
.
getTopic
();
},
getTopic
:
function
(){
let
that
=
this
;
that
.
setData
({
scrollTop
:
0
,
showPage
:
false
,
topicList
:
[]
});
// 页面渲染完成
wx
.
showToast
({
title
:
'
加载中...
'
,
icon
:
'
loading
'
,
duration
:
2000
});
that
.
setData
({
page
:
that
.
data
.
page
+
1
});
util
.
request
(
api
.
TopicList
,
{
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
this
.
getTopic
();
that
.
setData
({
scrollTop
:
0
,
topicList
:
res
.
data
.
data
,
showPage
:
true
,
count
:
res
.
data
.
count
});
}
wx
.
hideToast
();
});
},
prevPage
:
function
(
event
)
{
if
(
this
.
data
.
page
<=
1
)
{
return
false
;
}
},
getTopic
:
function
()
{
let
that
=
this
;
that
.
setData
({
scrollTop
:
0
,
showPage
:
false
,
topicList
:
[]
});
// 页面渲染完成
wx
.
showToast
({
title
:
'
加载中...
'
,
icon
:
'
loading
'
,
duration
:
2000
});
util
.
request
(
api
.
TopicList
,
{
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
var
that
=
this
;
that
.
setData
({
page
:
that
.
data
.
page
-
1
scrollTop
:
0
,
topicList
:
res
.
data
.
data
,
showPage
:
true
,
count
:
res
.
data
.
count
});
this
.
getTopic
();
}
wx
.
hideToast
();
});
},
prevPage
:
function
(
event
)
{
if
(
this
.
data
.
page
<=
1
)
{
return
false
;
}
var
that
=
this
;
that
.
setData
({
page
:
that
.
data
.
page
-
1
});
this
.
getTopic
();
}
})
\ No newline at end of file
litemall-wx/pages/topic/topic.wxml
View file @
20b97ec8
<view class="container">
<scroll-view class="topic-list" scroll-y="true" scroll-top="{{scrollTop}}">
<navigator class="item" wx:for="{{topicList}}" wx:key="id" url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.picUrl}}"></image>
<view class="info">
<text class="title">{{item.title}}</text>
<text class="desc">{{item.subtitle}}</text>
<text class="price">{{item.price}}元起</text>
</view>
</navigator>
<view class="page" wx:if="{{showPage}}">
<view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
<view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
</view>
</scroll-view>
<scroll-view class="topic-list" scroll-y="true" scroll-top="{{scrollTop}}">
<navigator class="item" wx:for="{{topicList}}" wx:key="id" url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.picUrl}}"></image>
<view class="info">
<text class="title">{{item.title}}</text>
<text class="desc">{{item.subtitle}}</text>
<text class="price">{{item.price}}元起</text>
</view>
</navigator>
<view class="page" wx:if="{{showPage}}">
<view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
<view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
litemall-wx/pages/topicComment/topicComment.js
View file @
20b97ec8
...
...
@@ -17,9 +17,12 @@ Page({
picPage
:
1
,
size
:
20
},
getCommentCount
:
function
()
{
getCommentCount
:
function
()
{
let
that
=
this
;
util
.
request
(
api
.
CommentCount
,
{
valueId
:
that
.
data
.
valueId
,
type
:
that
.
data
.
type
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
CommentCount
,
{
valueId
:
that
.
data
.
valueId
,
type
:
that
.
data
.
type
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
...
...
@@ -29,15 +32,15 @@ Page({
}
});
},
getCommentList
:
function
(){
getCommentList
:
function
()
{
let
that
=
this
;
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
valueId
,
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
valueId
,
type
:
that
.
data
.
type
,
size
:
that
.
data
.
size
,
page
:
(
that
.
data
.
showType
==
0
?
that
.
data
.
allPage
:
that
.
data
.
picPage
),
showType
:
that
.
data
.
showType
}).
then
(
function
(
res
)
{
showType
:
that
.
data
.
showType
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
if
(
that
.
data
.
showType
==
0
)
{
...
...
@@ -56,7 +59,7 @@ Page({
}
});
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
setData
({
type
:
options
.
type
,
...
...
@@ -65,39 +68,39 @@ Page({
this
.
getCommentCount
();
this
.
getCommentList
();
},
onReady
:
function
()
{
onReady
:
function
()
{
// 页面渲染完成
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
},
switchTab
:
function
()
{
switchTab
:
function
()
{
this
.
setData
({
showType
:
this
.
data
.
showType
==
1
?
0
:
1
showType
:
this
.
data
.
showType
==
1
?
0
:
1
});
this
.
getCommentList
();
},
onReachBottom
:
function
(){
onReachBottom
:
function
()
{
console
.
log
(
'
onPullDownRefresh
'
);
if
(
this
.
data
.
showType
==
0
)
{
if
(
this
.
data
.
showType
==
0
)
{
if
(
this
.
data
.
allCount
/
this
.
data
.
size
<
this
.
data
.
allPage
)
{
return
false
;
}
this
.
setData
({
'
allPage
'
:
this
.
data
.
allPage
+
1
'
allPage
'
:
this
.
data
.
allPage
+
1
});
}
else
{
if
(
this
.
data
.
hasPicCount
/
this
.
data
.
size
<
this
.
data
.
picPage
)
{
...
...
litemall-wx/pages/topicComment/topicComment.wxml
View file @
20b97ec8
...
...
@@ -12,10 +12,6 @@
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<image class="img" wx:for="{{item.picList}}" wx:key="id" wx:for-item="pitem" src="{{pitem.picUrl}}"></image>
</view>
<!--<view class="customer-service" wx:if="{{item.commentReplyVO}}">
<text class="u">小选回复:</text>
<text class="c">{{item.commentReplyVO.replyContent}}</text>
</view>-->
</view>
</view>
...
...
litemall-wx/pages/topicComment/topicComment.wxss
View file @
20b97ec8
.comments{
width: 100%;
height: auto;
padding-left:30rpx;
background: #fff;
margin: 20rpx 0;
.comments
{
width: 100%;
height: auto;
padding-left:
30rpx;
background: #fff;
margin: 20rpx 0;
}
.comments .b{
height: auto;
width: 720rpx;
.comments .b
{
height: auto;
width: 720rpx;
}
.comments .b.no-h{
margin-top: 0;
.comments .b.no-h
{
margin-top: 0;
}
.comments .item{
height: auto;
width: 720rpx;
overflow: hidden;
border-bottom: 1px solid #d9d9d9;
padding-bottom: 25rpx;
.comments .item
{
height: auto;
width: 720rpx;
overflow: hidden;
border-bottom: 1px solid #d9d9d9;
padding-bottom: 25rpx;
}
.comments .info{
height: 127rpx;
width: 100%;
padding: 33rpx 0 27rpx 0;
.comments .info
{
height: 127rpx;
width: 100%;
padding: 33rpx 0 27rpx 0;
}
.comments .user{
float: left;
width: auto;
height: 67rpx;
line-height: 67rpx;
font-size: 0;
.comments .user
{
float: left;
width: auto;
height: 67rpx;
line-height: 67rpx;
font-size: 0;
}
.comments .user image{
float: left;
width: 67rpx;
height: 67rpx;
margin-right: 17rpx;
border-radius: 50%;
.comments .user image
{
float: left;
width: 67rpx;
height: 67rpx;
margin-right: 17rpx;
border-radius: 50%;
}
.comments .user text{
display: inline-block;
width: auto;
height: 66rpx;
overflow: hidden;
font-size: 29rpx;
line-height: 66rpx;
.comments .user text
{
display: inline-block;
width: auto;
height: 66rpx;
overflow: hidden;
font-size: 29rpx;
line-height: 66rpx;
}
.comments .time{
display: block;
float: right;
width: auto;
height: 67rpx;
line-height: 67rpx;
color: #7f7f7f;
font-size: 25rpx;
margin-right: 30rpx;
.comments .time
{
display: block;
float: right;
width: auto;
height: 67rpx;
line-height: 67rpx;
color: #7f7f7f;
font-size: 25rpx;
margin-right: 30rpx;
}
.comments .comment{
width: 720rpx;
padding-right: 30rpx;
line-height: 45.8rpx;
font-size: 29rpx;
margin-bottom: 16rpx;
.comments .comment
{
width: 720rpx;
padding-right: 30rpx;
line-height: 45.8rpx;
font-size: 29rpx;
margin-bottom: 16rpx;
}
.comments .imgs{
width: 720rpx;
height: 150rpx;
margin-bottom: 25rpx;
.comments .imgs
{
width: 720rpx;
height: 150rpx;
margin-bottom: 25rpx;
}
.comments .imgs .img{
height: 150rpx;
width: 150rpx;
margin-right: 28rpx;
.comments .imgs .img
{
height: 150rpx;
width: 150rpx;
margin-right: 28rpx;
}
.comments .customer-service{
width: 690rpx;
height: auto;
overflow: hidden;
margin-top: 23rpx;
background: rgba(0,0,0,.03);
padding: 21rpx;
.comments .customer-service
{
width: 690rpx;
height: auto;
overflow: hidden;
margin-top: 23rpx;
background: rgba(0,
0,
0,
0
.03);
padding: 21rpx;
}
.comments .customer-service .u{
font-size: 24rpx;
color: #333;
line-height: 37.5rpx;
.comments .customer-service .u {
font-size: 24rpx;
color: #333;
line-height: 37.5rpx;
}
.comments .customer-service .c{
font-size: 24rpx;
color: #999;
line-height: 37.5rpx;
}
\ No newline at end of file
.comments .customer-service .c {
font-size: 24rpx;
color: #999;
line-height: 37.5rpx;
}
litemall-wx/pages/topicCommentPost/topicCommentPost.js
View file @
20b97ec8
...
...
@@ -14,7 +14,7 @@ Page({
picUrls
:
[],
files
:
[]
},
chooseImage
:
function
(
e
)
{
chooseImage
:
function
(
e
)
{
if
(
this
.
data
.
files
.
length
>=
5
)
{
util
.
showErrorToast
(
'
只能上传五张图片
'
)
return
false
;
...
...
@@ -25,7 +25,7 @@ Page({
count
:
1
,
sizeType
:
[
'
original
'
,
'
compressed
'
],
sourceType
:
[
'
album
'
,
'
camera
'
],
success
:
function
(
res
)
{
success
:
function
(
res
)
{
that
.
setData
({
files
:
that
.
data
.
files
.
concat
(
res
.
tempFilePaths
)
});
...
...
@@ -33,13 +33,13 @@ Page({
}
})
},
upload
:
function
(
res
)
{
upload
:
function
(
res
)
{
var
that
=
this
;
const
uploadTask
=
wx
.
uploadFile
({
url
:
api
.
StorageUpload
,
filePath
:
res
.
tempFilePaths
[
0
],
name
:
'
file
'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
var
_res
=
JSON
.
parse
(
res
.
data
);
if
(
_res
.
errno
===
0
)
{
var
url
=
_res
.
data
.
url
...
...
@@ -50,7 +50,7 @@ Page({
})
}
},
fail
:
function
(
e
)
{
fail
:
function
(
e
)
{
wx
.
showModal
({
title
:
'
错误
'
,
content
:
'
上传失败
'
,
...
...
@@ -66,28 +66,24 @@ Page({
})
},
previewImage
:
function
(
e
)
{
previewImage
:
function
(
e
)
{
wx
.
previewImage
({
current
:
e
.
currentTarget
.
id
,
// 当前显示图片的http链接
urls
:
this
.
data
.
files
// 需要预览的图片http链接列表
})
},
selectRater
:
function
(
e
)
{
selectRater
:
function
(
e
)
{
var
star
=
e
.
currentTarget
.
dataset
.
star
+
1
;
var
starText
;
if
(
star
==
1
)
{
starText
=
'
很差
'
;
}
else
if
(
star
==
2
)
{
}
else
if
(
star
==
2
)
{
starText
=
'
不太满意
'
;
}
else
if
(
star
==
3
)
{
}
else
if
(
star
==
3
)
{
starText
=
'
满意
'
;
}
else
if
(
star
==
4
)
{
}
else
if
(
star
==
4
)
{
starText
=
'
比较满意
'
;
}
else
{
}
else
{
starText
=
'
十分满意
'
}
this
.
setData
({
...
...
@@ -96,8 +92,8 @@ Page({
})
},
onLoad
:
function
(
options
)
{
if
(
parseInt
(
options
.
type
)
!==
1
){
onLoad
:
function
(
options
)
{
if
(
parseInt
(
options
.
type
)
!==
1
)
{
return
;
}
...
...
@@ -107,9 +103,11 @@ Page({
});
this
.
getTopic
();
},
getTopic
:
function
()
{
getTopic
:
function
()
{
let
that
=
this
;
util
.
request
(
api
.
TopicDetail
,
{
id
:
that
.
data
.
valueId
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
TopicDetail
,
{
id
:
that
.
data
.
valueId
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
...
...
@@ -117,12 +115,12 @@ Page({
});
}
});
});
},
onClose
:
function
()
{
onClose
:
function
()
{
wx
.
navigateBack
();
},
onPost
:
function
()
{
onPost
:
function
()
{
let
that
=
this
;
if
(
!
this
.
data
.
content
)
{
...
...
@@ -137,11 +135,11 @@ Page({
star
:
that
.
data
.
star
,
hasPicture
:
that
.
data
.
hasPicture
,
picUrls
:
that
.
data
.
picUrls
},
'
POST
'
).
then
(
function
(
res
)
{
},
'
POST
'
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
wx
.
showToast
({
title
:
'
评论成功
'
,
complete
:
function
()
{
complete
:
function
()
{
wx
.
navigateBack
();
}
})
...
...
@@ -161,18 +159,18 @@ Page({
content
:
event
.
detail
.
value
,
})
},
onReady
:
function
()
{
onReady
:
function
()
{
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
}
...
...
litemall-wx/pages/topicCommentPost/topicCommentPost.wxml
View file @
20b97ec8
...
...
@@ -35,10 +35,6 @@
<view class="weui-uploader__file" bindtap="previewImage" id="{{item}}">
<image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
</view>
<!-- <view class="weui-uploader__file weui-uploader__file_status" bindtap="previewImage" id="{{item}}">
<image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
<view class="weui-uploader__file-content">50%</view>
</view> -->
</block>
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="chooseImage"></view>
...
...
litemall-wx/pages/topicDetail/topicDetail.js
View file @
20b97ec8
...
...
@@ -12,14 +12,16 @@ Page({
commentList
:
[],
topicGoods
:
[]
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
var
that
=
this
;
that
.
setData
({
id
:
options
.
id
});
util
.
request
(
api
.
TopicDetail
,
{
id
:
that
.
data
.
id
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
TopicDetail
,
{
id
:
that
.
data
.
id
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
topic
:
res
.
data
.
topic
,
...
...
@@ -30,7 +32,9 @@ Page({
}
});
util
.
request
(
api
.
TopicRelated
,
{
id
:
that
.
data
.
id
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
TopicRelated
,
{
id
:
that
.
data
.
id
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
topicList
:
res
.
data
...
...
@@ -40,7 +44,13 @@ Page({
},
getCommentList
()
{
let
that
=
this
;
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
id
,
type
:
1
,
showType
:
0
,
page
:
1
,
size
:
5
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
id
,
type
:
1
,
showType
:
0
,
page
:
1
,
size
:
5
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
commentList
:
res
.
data
.
data
,
...
...
@@ -51,26 +61,27 @@ Page({
},
postComment
()
{
if
(
!
app
.
globalData
.
hasLogin
)
{
wx
.
navigateTo
({
url
:
"
/pages/auth/login/login
"
});
}
else
{
wx
.
navigateTo
({
url
:
"
/pages/auth/login/login
"
});
}
else
{
wx
.
navigateTo
({
url
:
'
/pages/topicCommentPost/topicCommentPost?valueId=
'
+
this
.
data
.
id
+
'
&type=1
'
,
})
}
},
onReady
:
function
()
{
onReady
:
function
()
{
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
this
.
getCommentList
();
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
}
...
...
litemall-wx/pages/topicDetail/topicDetail.wxml
View file @
20b97ec8
<scroll-view class="container">
<scroll-view class="content">
<import src="../../lib/wxParse/wxParse.wxml"/>
<template is="wxParse" data="{{wxParseData:topicDetail.nodes}}"/>
<import src="../../lib/wxParse/wxParse.wxml"
/>
<template is="wxParse" data="{{wxParseData:topicDetail.nodes}}"
/>
</scroll-view>
<scroll-view class="sv-goods" wx:if="{{topicGoods.length > 0 }}">
<view class="topic-goods">
<view class="h">
<text class="t">专题商品</text>
<image bindtap="postComment" class="i" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/comment-add-2aca147c3f.png"></image>
</view>
<view class="b">
<view class="item" wx:for="{{topicGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="right">
<view class="text">
<text class="name">{{item.name}}</text>
<text class="desc">{{item.brief}}</text>
<text class="price">¥{{item.retailPrice}}</text>
<view class="topic-goods">
<view class="h">
<text class="t">专题商品</text>
<image bindtap="postComment" class="i" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/comment-add-2aca147c3f.png"></image>
</view>
<view class="b">
<view class="item" wx:for="{{topicGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="right">
<view class="text">
<text class="name">{{item.name}}</text>
<text class="desc">{{item.brief}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</view>
</view>
</navigator>
</view>
</view>
</view>
</navigator>
</view>
</view>
</view>
</view>
</scroll-view>
<scroll-view class="comments">
<view class="h">
<text class="t">精选留言</text>
<image bindtap="postComment" class="i" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/comment-add-2aca147c3f.png"></image>
</view>
<view class="has-comments" wx:if="{{commentList.length > 0 }}">
<view class="has-comments" wx:if="{{commentList.length > 0 }}">
<view class="b">
<view class="item" wx:for="{{commentList}}" wx:key="id">
<view class="info">
...
...
@@ -48,12 +48,12 @@
<view class="load" wx:if="{{commentCount > 5}}">
<navigator url="/pages/topicComment/topicComment?valueId={{topic.id}}&type=1">查看更多</navigator>
</view>
</view>
</view>
<view class="no-comments" wx:if="{{commentList.length <= 0}}">
<view class="b">
<image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-comment-560f87660a.png"></image>
<text class="txt">等你来留言</text>
</view>
<view class="b">
<image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-comment-560f87660a.png"></image>
<text class="txt">等你来留言</text>
</view>
</view>
</scroll-view>
<scroll-view class="rec-box">
...
...
litemall-wx/pages/topicDetail/topicDetail.wxss
View file @
20b97ec8
.content{
width: 100%;
height: auto;
font-size: 0;
.content
{
width: 100%;
height: auto;
font-size: 0;
}
.content image{
display: inline-block;
width: 100%;
.content image
{
display: inline-block;
width: 100%;
}
.comments{
width: 100%;
height: auto;
padding-left:30rpx;
background: #fff;
margin-top: 20rpx;
.comments
{
width: 100%;
height: auto;
padding-left:
30rpx;
background: #fff;
margin-top: 20rpx;
}
.comments .h{
height: 93rpx;
line-height: 93rpx;
width: 720rpx;
padding-right: 30rpx;
border-bottom: 1px solid #d9d9d9;
.comments .h
{
height: 93rpx;
line-height: 93rpx;
width: 720rpx;
padding-right: 30rpx;
border-bottom: 1px solid #d9d9d9;
}
.comments .h .t{
display: block;
float: left;
width: 50%;
font-size: 29rpx;
color: #333;
.comments .h .t
{
display: block;
float: left;
width: 50%;
font-size: 29rpx;
color: #333;
}
.comments .h .i{
display: block;
float: right;
margin-top: 30rpx;
width: 33rpx;
height: 33rpx;
.comments .h .i
{
display: block;
float: right;
margin-top: 30rpx;
width: 33rpx;
height: 33rpx;
}
.comments .b{
height: auto;
width: 720rpx;
.comments .b
{
height: auto;
width: 720rpx;
}
.comments .item{
height: auto;
width: 720rpx;
overflow: hidden;
border-bottom: 1px solid #d9d9d9;
.comments .item
{
height: auto;
width: 720rpx;
overflow: hidden;
border-bottom: 1px solid #d9d9d9;
}
.comments .info{
height: 127rpx;
width: 100%;
padding: 33rpx 0 27rpx 0;
.comments .info
{
height: 127rpx;
width: 100%;
padding: 33rpx 0 27rpx 0;
}
.comments .user{
float: left;
width: auto;
height: 67rpx;
line-height: 67rpx;
font-size: 0;
.comments .user
{
float: left;
width: auto;
height: 67rpx;
line-height: 67rpx;
font-size: 0;
}
.comments .user .avatar{
display: block;
float: left;
width: 67rpx;
height: 67rpx;
margin-right: 17rpx;
border-radius: 50%;
.comments .user .avatar
{
display: block;
float: left;
width: 67rpx;
height: 67rpx;
margin-right: 17rpx;
border-radius: 50%;
}
.comments .user .nickname{
display: block;
width: auto;
float: left;
height: 66rpx;
overflow: hidden;
font-size: 29rpx;
line-height: 66rpx;
.comments .user .nickname
{
display: block;
width: auto;
float: left;
height: 66rpx;
overflow: hidden;
font-size: 29rpx;
line-height: 66rpx;
}
.comments .time{
display: block;
float: right;
width: auto;
height: 67rpx;
line-height: 67rpx;
color: #7f7f7f;
font-size: 25rpx;
margin-right: 30rpx;
.comments .time
{
display: block;
float: right;
width: auto;
height: 67rpx;
line-height: 67rpx;
color: #7f7f7f;
font-size: 25rpx;
margin-right: 30rpx;
}
.comments .comment{
width: 720rpx;
padding-right: 30rpx;
line-height: 45.8rpx;
margin-bottom: 30rpx;
font-size: 29rpx;
color: #333;
.comments .comment
{
width: 720rpx;
padding-right: 30rpx;
line-height: 45.8rpx;
margin-bottom: 30rpx;
font-size: 29rpx;
color: #333;
}
.comments .load{
width: 720rpx;
height: 108rpx;
line-height: 108rpx;
text-align: center;
font-size: 38.5rpx;
.comments .load
{
width: 720rpx;
height: 108rpx;
line-height: 108rpx;
text-align: center;
font-size: 38.5rpx;
}
.no-comments{
height: 297rpx;
.no-comments
{
height: 297rpx;
}
.no-comments .txt{
height: 43rpx;
line-height: 43rpx;
display: block;
width: 100%;
text-align: center;
font-size: 29rpx;
color: #7f7f7f;
.no-comments .txt
{
height: 43rpx;
line-height: 43rpx;
display: block;
width: 100%;
text-align: center;
font-size: 29rpx;
color: #7f7f7f;
}
.no-comments .icon{
margin: 48rpx auto 18rpx auto;
height: 130rpx;
display: block;
width: 115rpx;
.no-comments .icon
{
margin: 48rpx auto 18rpx auto;
height: 130rpx;
display: block;
width: 115rpx;
}
.sv-goods{
width: 100%;
height: auto;
padding-left:30rpx;
background: #fff;
margin-top: 20rpx;
.sv-goods
{
width: 100%;
height: auto;
padding-left:
30rpx;
background: #fff;
margin-top: 20rpx;
}
.topic-goods .b .item {
border-top: 1px solid #d9d9d9;
margin: 0 20rpx;
height: 244rpx;
width: 710rpx;
border-top: 1px solid #d9d9d9;
margin: 0 20rpx;
height: 244rpx;
width: 710rpx;
}
.topic-goods .b .img {
margin-top: 12rpx;
margin-right: 12rpx;
float: left;
width: 220rpx;
height: 220rpx;
margin-top: 12rpx;
margin-right: 12rpx;
float: left;
width: 220rpx;
height: 220rpx;
}
.topic-goods .b .right {
float: left;
height: 244rpx;
width: 476rpx;
display: flex;
flex-flow: row nowrap;
float: left;
height: 244rpx;
width: 476rpx;
display: flex;
flex-flow: row nowrap;
}
.topic-goods .b .text {
display: flex;
flex-wrap: nowrap;
flex-direction: column;
justify-content: center;
overflow: hidden;
height: 244rpx;
width: 476rpx;
display: flex;
flex-wrap: nowrap;
flex-direction: column;
justify-content: center;
overflow: hidden;
height: 244rpx;
width: 476rpx;
}
.topic-goods .b .name {
float: left;
width: 330rpx;
display: block;
color: #333;
line-height: 50rpx;
font-size: 30rpx;
float: left;
width: 330rpx;
display: block;
color: #333;
line-height: 50rpx;
font-size: 30rpx;
}
.topic-goods .b .desc {
width: 476rpx;
display: block;
color: #999;
line-height: 50rpx;
font-size: 25rpx;
width: 476rpx;
display: block;
color: #999;
line-height: 50rpx;
font-size: 25rpx;
}
.topic-goods .b .price {
width: 476rpx;
display: flex;
color: #b4282d;
line-height: 50rpx;
font-size: 33rpx;
}
.rec-box{
width: 690rpx;
height: auto;
margin: 0 30rpx;
}
.rec-box .h{
position: relative;
width: 690rpx;
height: 96rpx;
/*border-bottom: 1px solid #d0d0d0;*/
margin-bottom: 32rpx;
}
.rec-box .h .txt{
display: inline-block;
position: absolute;
background: #f4f4f4;
top: 59rpx;
left: 200rpx;
width: 290rpx;
height: 45rpx;
line-height: 45rpx;
font-size: 30rpx;
color: #999;
text-align: center;
}
.rec-box .b .item{
width: 690rpx;
height: 397rpx;
padding: 24rpx 24rpx 30rpx 24rpx;
background: #fff;
margin-bottom: 30rpx;
}
.rec-box .b .item .img{
height: 278rpx;
width: 642rpx;
}
.rec-box .b .item .title{
display: block;
margin-top: 30rpx;
height: 30rpx;
width: 642rpx;
font-size: 28rpx;
width: 476rpx;
display: flex;
color: #b4282d;
line-height: 50rpx;
font-size: 33rpx;
}
.rec-box
{
width: 690rpx;
height: auto;
margin: 0 30rpx;
}
.rec-box .h
{
position: relative;
width: 690rpx;
height: 96rpx;
/*border-bottom: 1px solid #d0d0d0;*/
margin-bottom: 32rpx;
}
.rec-box .h .txt
{
display: inline-block;
position: absolute;
background: #f4f4f4;
top: 59rpx;
left: 200rpx;
width: 290rpx;
height: 45rpx;
line-height: 45rpx;
font-size: 30rpx;
color: #999;
text-align: center;
}
.rec-box .b .item
{
width: 690rpx;
height: 397rpx;
padding: 24rpx 24rpx 30rpx 24rpx;
background: #fff;
margin-bottom: 30rpx;
}
.rec-box .b .item .img
{
height: 278rpx;
width: 642rpx;
}
.rec-box .b .item .title
{
display: block;
margin-top: 30rpx;
height: 30rpx;
width: 642rpx;
font-size: 28rpx;
}
@import "../../lib/wxParse/wxParse.wxss";
litemall-wx/pages/ucenter/address/address.js
View file @
20b97ec8
...
...
@@ -6,19 +6,19 @@ Page({
data
:
{
addressList
:
[],
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
},
onReady
:
function
()
{
onReady
:
function
()
{
// 页面渲染完成
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
this
.
getAddressList
();
},
getAddressList
(){
getAddressList
()
{
let
that
=
this
;
util
.
request
(
api
.
AddressList
).
then
(
function
(
res
)
{
util
.
request
(
api
.
AddressList
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
addressList
:
res
.
data
...
...
@@ -26,7 +26,7 @@ Page({
}
});
},
addressAddOrUpdate
(
event
)
{
addressAddOrUpdate
(
event
)
{
console
.
log
(
event
)
//返回之前,先取出上一页对象,并设置addressId
...
...
@@ -55,13 +55,13 @@ Page({
})
}
},
deleteAddress
(
event
){
deleteAddress
(
event
)
{
console
.
log
(
event
.
target
)
let
that
=
this
;
wx
.
showModal
({
title
:
''
,
content
:
'
确定要删除地址?
'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
let
addressId
=
event
.
target
.
dataset
.
addressId
;
util
.
request
(
api
.
AddressDelete
,
{
...
...
@@ -80,12 +80,12 @@ Page({
}
})
return
false
;
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
}
})
\ No newline at end of file
litemall-wx/pages/ucenter/address/address.wxml
View file @
20b97ec8
<view class="container">
<view class="address-list" wx:if="{{ addressList.length > 0 }}">
<view class="item" wx:for="{{addressList}}" wx:key="id" bindtap="addressAddOrUpdate" data-address-id="{{item.id}}">
<view class="l">
<view class="name">{{item.name}}</view>
<view class="default" wx:if="{{item.isDefault}}">默认</view>
</view>
<view class="c">
<view class="mobile">{{item.mobile}}</view>
<view class="address">{{item.detailedAddress}}</view>
</view>
<view class="r">
<image catchtap="deleteAddress" data-address-id="{{item.id}}" class="del" src="/static/images/del-address.png"></image>
</view>
</view>
<view class="address-list" wx:if="{{ addressList.length > 0 }}">
<view class="item" wx:for="{{addressList}}" wx:key="id" bindtap="addressAddOrUpdate" data-address-id="{{item.id}}">
<view class="l">
<view class="name">{{item.name}}</view>
<view class="default" wx:if="{{item.isDefault}}">默认</view>
</view>
<view class="c">
<view class="mobile">{{item.mobile}}</view>
<view class="address">{{item.detailedAddress}}</view>
</view>
<view class="r">
<image catchtap="deleteAddress" data-address-id="{{item.id}}" class="del" src="/static/images/del-address.png"></image>
</view>
</view>
<view class="empty-view" wx:if="{{ addressList.length <= 0 }}">
<image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png"></image>
<text class="text">收货地址在哪里</text>
</view>
<view class="add-address" bindtap="addressAddOrUpdate" data-address-id="0">新建</view>
</view>
</view>
<view class="empty-view" wx:if="{{ addressList.length <= 0 }}">
<image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png"></image>
<text class="text">收货地址在哪里</text>
</view>
<view class="add-address" bindtap="addressAddOrUpdate" data-address-id="0">新建</view>
</view>
\ No newline at end of file
litemall-wx/pages/ucenter/address/address.wxss
View file @
20b97ec8
page{
height: 100%;
width: 100%;
background: #f4f4f4;
page
{
height: 100%;
width: 100%;
background: #f4f4f4;
}
.container{
.container
{
height: 100%;
width: 100%;
}
.address-list{
padding-left: 31.25rpx;
background: #fff url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png) 0 0 repeat-x;
background-size: auto 10.5rpx;
margin-bottom: 90rpx;
.address-list
{
padding-left: 31.25rpx;
background: #fff url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png) 0 0 repeat-x;
background-size: auto 10.5rpx;
margin-bottom: 90rpx;
}
.address-list .item{
height: 156.55rpx;
align-items: center;
display: flex;
border-bottom: 1rpx solid #
DCD9D
9;
.address-list .item
{
height: 156.55rpx;
align-items: center;
display: flex;
border-bottom: 1rpx solid #
dcd9d
9;
}
.address-list .l{
width: 125rpx;
height: 80rpx;
overflow: hidden;
.address-list .l
{
width: 125rpx;
height: 80rpx;
overflow: hidden;
}
.address-list .name{
width: 125rpx;
height: 43rpx;
font-size: 29rpx;
color: #333;
margin-bottom: 5.2rpx;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
.address-list .name
{
width: 125rpx;
height: 43rpx;
font-size: 29rpx;
color: #333;
margin-bottom: 5.2rpx;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.address-list .default{
width: 62.5rpx;
height: 33rpx;
line-height: 28rpx;
text-align: center;
font-size: 20rpx;
color: #b4282d;
border: 1rpx solid #b4282d;
visibility: visible;
.address-list .default
{
width: 62.5rpx;
height: 33rpx;
line-height: 28rpx;
text-align: center;
font-size: 20rpx;
color: #b4282d;
border: 1rpx solid #b4282d;
visibility: visible;
}
.address-list .c{
flex: 1;
height: auto;
overflow: hidden;
.address-list .c {
flex: 1;
height: auto;
overflow: hidden;
}
.address-list .mobile{
height: 29rpx;
font-size: 29rpx;
line-height: 29rpx;
overflow: hidden;
color: #333;
margin-bottom: 6.25rpx;
.address-list .mobile {
height: 29rpx;
font-size: 29rpx;
line-height: 29rpx;
overflow: hidden;
color: #333;
margin-bottom: 6.25rpx;
}
.address-list .address{
height: 37rpx;
font-size: 25rpx;
line-height: 37rpx;
overflow: hidden;
color: #666;
.address-list .address
{
height: 37rpx;
font-size: 25rpx;
line-height: 37rpx;
overflow: hidden;
color: #666;
}
.address-list .r{
width: 52rpx;
height: auto;
overflow: hidden;
margin-right: 16.5rpx;
.address-list .r
{
width: 52rpx;
height: auto;
overflow: hidden;
margin-right: 16.5rpx;
}
.address-list .del{
display: block;
width: 52rpx;
height: 52rpx;
.address-list .del
{
display: block;
width: 52rpx;
height: 52rpx;
}
.add-address{
.add-address
{
border: none;
right: 0;
display: flex;
...
...
@@ -117,7 +115,7 @@ page{
background-image: linear-gradient(to right, #9a9ba1 0%, #9a9ba1 100%);
}
.empty-view{
.empty-view
{
height: 100%;
width: 100%;
display: flex;
...
...
@@ -126,15 +124,15 @@ page{
justify-content: center;
}
.empty-view .icon{
.empty-view .icon
{
height: 248rpx;
width: 258rpx;
margin-bottom: 10rpx;
}
.empty-view .text{
.empty-view .text
{
width: auto;
font-size: 28rpx;
line-height: 35rpx;
color: #999;
}
\ No newline at end of file
}
litemall-wx/pages/ucenter/addressAdd/addressAdd.js
View file @
20b97ec8
...
...
@@ -6,7 +6,7 @@ var app = getApp();
Page
({
data
:
{
address
:
{
id
:
0
,
id
:
0
,
provinceId
:
0
,
cityId
:
0
,
areaId
:
0
,
...
...
@@ -20,10 +20,24 @@ Page({
},
addressId
:
0
,
openSelectRegion
:
false
,
selectRegionList
:
[
{
id
:
0
,
name
:
'
省份
'
,
pid
:
1
,
type
:
1
},
{
id
:
0
,
name
:
'
城市
'
,
pid
:
1
,
type
:
2
},
{
id
:
0
,
name
:
'
区县
'
,
pid
:
1
,
type
:
3
}
selectRegionList
:
[{
id
:
0
,
name
:
'
省份
'
,
pid
:
1
,
type
:
1
},
{
id
:
0
,
name
:
'
城市
'
,
pid
:
1
,
type
:
2
},
{
id
:
0
,
name
:
'
区县
'
,
pid
:
1
,
type
:
3
}
],
regionType
:
1
,
regionList
:
[],
...
...
@@ -43,14 +57,14 @@ Page({
address
:
address
});
},
bindinputAddress
(
event
){
bindinputAddress
(
event
)
{
let
address
=
this
.
data
.
address
;
address
.
address
=
event
.
detail
.
value
;
this
.
setData
({
address
:
address
});
},
bindIsDefault
(){
bindIsDefault
()
{
let
address
=
this
.
data
.
address
;
address
.
isDefault
=
!
address
.
isDefault
;
this
.
setData
({
...
...
@@ -59,12 +73,14 @@ Page({
},
getAddressDetail
()
{
let
that
=
this
;
util
.
request
(
api
.
AddressDetail
,
{
id
:
that
.
data
.
addressId
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
AddressDetail
,
{
id
:
that
.
data
.
addressId
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
if
(
res
.
data
){
that
.
setData
({
address
:
res
.
data
});
if
(
res
.
data
)
{
that
.
setData
({
address
:
res
.
data
});
}
}
});
...
...
@@ -110,10 +126,24 @@ Page({
this
.
getRegionList
(
address
.
cityId
);
}
else
{
this
.
setData
({
selectRegionList
:
[
{
id
:
0
,
name
:
'
省份
'
,
pid
:
0
,
type
:
1
},
{
id
:
0
,
name
:
'
城市
'
,
pid
:
0
,
type
:
2
},
{
id
:
0
,
name
:
'
区县
'
,
pid
:
0
,
type
:
3
}
selectRegionList
:
[{
id
:
0
,
name
:
'
省份
'
,
pid
:
0
,
type
:
1
},
{
id
:
0
,
name
:
'
城市
'
,
pid
:
0
,
type
:
2
},
{
id
:
0
,
name
:
'
区县
'
,
pid
:
0
,
type
:
3
}
],
regionType
:
1
})
...
...
@@ -123,7 +153,7 @@ Page({
this
.
setRegionDoneStatus
();
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
console
.
log
(
options
)
if
(
options
.
id
&&
options
.
id
!=
0
)
{
...
...
@@ -133,7 +163,7 @@ Page({
this
.
getAddressDetail
();
}
},
onReady
:
function
()
{
onReady
:
function
()
{
},
selectRegionType
(
event
)
{
...
...
@@ -142,14 +172,14 @@ Page({
let
selectRegionList
=
that
.
data
.
selectRegionList
;
//判断是否可点击
if
(
regionTypeIndex
+
1
==
this
.
data
.
regionType
||
(
regionTypeIndex
-
1
>=
0
&&
selectRegionList
[
regionTypeIndex
-
1
].
id
<=
0
))
{
if
(
regionTypeIndex
+
1
==
this
.
data
.
regionType
||
(
regionTypeIndex
-
1
>=
0
&&
selectRegionList
[
regionTypeIndex
-
1
].
id
<=
0
))
{
return
false
;
}
this
.
setData
({
regionType
:
regionTypeIndex
+
1
})
let
selectRegionItem
=
selectRegionList
[
regionTypeIndex
];
this
.
getRegionList
(
selectRegionItem
.
pid
);
...
...
@@ -240,7 +270,9 @@ Page({
getRegionList
(
regionId
)
{
let
that
=
this
;
let
regionType
=
that
.
data
.
regionType
;
util
.
request
(
api
.
RegionList
,
{
pid
:
regionId
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
RegionList
,
{
pid
:
regionId
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
regionList
:
res
.
data
.
map
(
item
=>
{
...
...
@@ -258,10 +290,10 @@ Page({
}
});
},
cancelAddress
(){
cancelAddress
()
{
wx
.
navigateBack
();
},
saveAddress
(){
saveAddress
()
{
console
.
log
(
this
.
data
.
address
)
let
address
=
this
.
data
.
address
;
...
...
@@ -293,7 +325,7 @@ Page({
}
let
that
=
this
;
util
.
request
(
api
.
AddressSave
,
{
util
.
request
(
api
.
AddressSave
,
{
id
:
address
.
id
,
name
:
address
.
name
,
mobile
:
address
.
mobile
,
...
...
@@ -302,7 +334,7 @@ Page({
areaId
:
address
.
areaId
,
address
:
address
.
address
,
isDefault
:
address
.
isDefault
},
'
POST
'
).
then
(
function
(
res
)
{
},
'
POST
'
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
//返回之前,先取出上一页对象,并设置addressId
var
pages
=
getCurrentPages
();
...
...
@@ -325,15 +357,15 @@ Page({
});
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
}
...
...
litemall-wx/pages/ucenter/addressAdd/addressAdd.wxml
View file @
20b97ec8
<view class="add-address">
<view class="add-form">
<view class="form-item">
<input class="input" bindinput="bindinputName" placeholder="姓名" value="{{address.name}}" auto-focus/>
</view>
<view class="form-item">
<input class="input" bindinput="bindinputMobile" value="{{address.mobile}}" placeholder="手机号码"/>
</view>
<view class="form-item">
<input class="input" value="{{address.provinceName + address.cityName + address.areaName}}" disabled="true" bindtap="chooseRegion" placeholder="省份、城市、区县"/>
</view>
<view class="form-item">
<input class="input" bindinput="bindinputAddress" value="{{address.address}}" placeholder="详细地址, 如街道、楼盘号等"/>
</view>
<view class="form-default">
<text bindtap="bindIsDefault" class="default-input {{address.isDefault == 1 ? 'selected' : ''}}">设为默认地址</text>
</view>
<view class="add-form">
<view class="form-item">
<input class="input" bindinput="bindinputName" placeholder="姓名" value="{{address.name}}" auto-focus/>
</view>
<view class="btns">
<button class="cannel" bindtap="cancelAddress">取消</button>
<button class="save" bindtap="saveAddress">保存</button>
<view class="form-item">
<input class="input" bindinput="bindinputMobile" value="{{address.mobile}}" placeholder="手机号码" />
</view>
<view class="form-item">
<input class="input" value="{{address.provinceName + address.cityName + address.areaName}}" disabled="true" bindtap="chooseRegion" placeholder="省份、城市、区县" />
</view>
<view class="form-item">
<input class="input" bindinput="bindinputAddress" value="{{address.address}}" placeholder="详细地址, 如街道、楼盘号等" />
</view>
<view class="form-default">
<text bindtap="bindIsDefault" class="default-input {{address.isDefault == 1 ? 'selected' : ''}}">设为默认地址</text>
</view>
</view>
<view class="region-select" wx:if="{{openSelectRegion}}">
<view class="hd">
<view class="region-selected">
<view class="item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}" bindtap="selectRegionType" data-region-type-index="{{index}}" wx:for="{{selectRegionList}}" wx:key="id">{{item.name}}</view>
</view>
<view class="done {{selectRegionDone ? '' : 'disabled'}}" bindtap="doneSelectRegion">确定</view>
<view class="btns">
<button class="cannel" bindtap="cancelAddress">取消</button>
<button class="save" bindtap="saveAddress">保存</button>
</view>
<view class="region-select" wx:if="{{openSelectRegion}}">
<view class="hd">
<view class="region-selected">
<view class="item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}" bindtap="selectRegionType" data-region-type-index="{{index}}" wx:for="{{selectRegionList}}" wx:key="id">{{item.name}}</view>
</view>
<view class="bd">
<view class="done {{selectRegionDone ? '' : 'disabled'}}" bindtap="doneSelectRegion">确定</view>
</view>
<view class="bd">
<scroll-view scroll-y class="region-list">
<view class="item {{item.selected ? 'selected' : ''}}" bindtap="selectRegion" data-region-index="{{index}}" wx:for="{{regionList}}" wx:key="id">{{item.name}}</view>
</scroll-view>
</view>
</view>
</view>
</view>
<view class="bg-mask" bindtap="cancelSelectRegion" wx:if="{{openSelectRegion}}"></view>
\ No newline at end of file
litemall-wx/pages/ucenter/addressAdd/addressAdd.wxss
View file @
20b97ec8
page{
height: 100%;
background: #f4f4f4;
}
.add-address .add-form{
background: #fff;
width: 100%;
height: auto;
overflow: hidden;
page {
height: 100%;
background: #f4f4f4;
}
.add-address .form-item{
height: 116rpx;
padding-left: 31.25rpx;
border-bottom: 1px solid #d9d9d9;
display: flex;
align-items: center;
padding-right: 31.25rpx;
.add-address .add-form {
background: #fff;
width: 100%;
height: auto;
overflow: hidden;
}
.add-address .input{
flex: 1;
height: 44rpx;
line-height: 44rpx;
overflow: hidden;
.add-address .form-item {
height: 116rpx;
padding-left: 31.25rpx;
border-bottom: 1px solid #d9d9d9;
display: flex;
align-items: center;
padding-right: 31.25rpx;
}
.add-address .form-default{
border-bottom: 1px solid #d9d9d9;
height: 96rpx;
background: #fafafa;
padding-top: 28rpx;
font-size: 28rpx;
.add-address .input {
flex: 1;
height: 44rpx;
line-height: 44rpx;
overflow: hidden;
}
.default-input{
margin: 0 auto;
display: block;
width: 240rpx;
height: 40rpx;
padding-left: 50rpx;
line-height: 40rpx;
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 1rpx -448rpx no-repeat;
background-size: 38rpx 486rpx;
font-size: 28rpx;
.add-address .form-default {
border-bottom: 1px solid #d9d9d9;
height: 96rpx;
background: #fafafa;
padding-top: 28rpx;
font-size: 28rpx;
}
.default-input.selected{
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -192rpx no-repeat;
background-size: 38rpx 486rpx;
.default-input {
margin: 0 auto;
display: block;
width: 240rpx;
height: 40rpx;
padding-left: 50rpx;
line-height: 40rpx;
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 1rpx -448rpx no-repeat;
background-size: 38rpx 486rpx;
font-size: 28rpx;
}
.add-address .btns{
position: fixed;
bottom: 0;
left: 0;
overflow: hidden;
display: flex;
height: 100rpx;
width: 100%;
.default-input.selected {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -192rpx no-repeat;
background-size: 38rpx 486rpx;
}
.add-address .cannel,.add-address .save{
flex: 1;
height: 100rpx;
text-align: center;
line-height: 100rpx;
font-size: 28rpx;
color: #fff;
border:none;
border-radius: 0;
.add-address .btns {
position: fixed;
bottom: 0;
left: 0;
overflow: hidden;
display: flex;
height: 100rpx;
width: 100%;
}
.add-address .cannel{
background: #333;
.add-address .cannel, .add-address .save {
flex: 1;
height: 100rpx;
text-align: center;
line-height: 100rpx;
font-size: 28rpx;
color: #fff;
border: none;
border-radius: 0;
}
.add-address .
save
{
background: #
b4282d
;
.add-address .
cannel
{
background: #
333
;
}
.add-address .save {
background: #b4282d;
}
.region-select{
.region-select
{
width: 100%;
height: 600rpx;
background: #fff;
position: fixed;
z-index: 10;
left:0;
left:
0;
bottom: 0;
}
.region-select .hd{
.region-select .hd
{
height: 108rpx;
width: 100%;
border-bottom: 1px solid #f4f4f4;
padding: 46rpx 30rpx 0 30rpx;
}
.region-select .region-selected{
.region-select .region-selected
{
float: left;
height: 60rpx;
display: flex;
}
.region-select .region-selected .item{
.region-select .region-selected .item
{
max-width: 140rpx;
margin-right: 30rpx;
text-align: left;
...
...
@@ -112,19 +112,19 @@ page{
color: #333;
font-size: 28rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-overflow: ellipsis;
white-space: nowrap;
}
.region-select .region-selected .item.disabled{
.region-select .region-selected .item.disabled
{
color: #999;
}
.region-select .region-selected .item.selected{
.region-select .region-selected .item.selected
{
color: #b4282d;
}
.region-select .done{
.region-select .done
{
float: right;
height: 60rpx;
width: 60rpx;
...
...
@@ -136,21 +136,21 @@ page{
font-size: 28rpx;
}
.region-select .done.disabled{
.region-select .done.disabled
{
color: #999;
}
.region-select .bd{
.region-select .bd
{
height: 492rpx;
width: 100%;
padding: 0 30rpx;
}
.region-select .region-list{
.region-select .region-list
{
height: 492rpx;
}
.region-select .region-list .item{
.region-select .region-list .item
{
width: 100%;
height: 104rpx;
line-height: 104rpx;
...
...
@@ -159,17 +159,16 @@ page{
font-size: 28rpx;
}
.region-select .region-list .item.selected{
.region-select .region-list .item.selected
{
color: #b4282d;
}
.bg-mask{
.bg-mask {
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.4);
position: fixed;
top:0;
left:0;
top:
0;
left:
0;
z-index: 8;
}
litemall-wx/pages/ucenter/collect/collect.js
View file @
20b97ec8
...
...
@@ -16,7 +16,11 @@ Page({
title
:
'
加载中...
'
,
});
let
that
=
this
;
util
.
request
(
api
.
CollectList
,
{
type
:
that
.
data
.
type
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
CollectList
,
{
type
:
that
.
data
.
type
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
collectList
:
that
.
data
.
collectList
.
concat
(
res
.
data
.
collectList
),
...
...
@@ -26,7 +30,7 @@ Page({
wx
.
hideLoading
();
});
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
getCollectList
();
},
onReachBottom
()
{
...
...
@@ -43,22 +47,22 @@ Page({
});
return
false
;
}
},
onReady
:
function
()
{
},
onReady
:
function
()
{
},
onShow
:
function
()
{
onShow
:
function
()
{
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
},
openGoods
(
event
)
{
let
that
=
this
;
let
index
=
event
.
currentTarget
.
dataset
.
index
;
let
goodsId
=
this
.
data
.
collectList
[
index
].
valueId
;
...
...
@@ -71,10 +75,13 @@ Page({
wx
.
showModal
({
title
:
''
,
content
:
'
确定删除吗?
'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
util
.
request
(
api
.
CollectAddOrDelete
,
{
type
:
that
.
data
.
type
,
valueId
:
goodsId
},
'
POST
'
).
then
(
function
(
res
)
{
util
.
request
(
api
.
CollectAddOrDelete
,
{
type
:
that
.
data
.
type
,
valueId
:
goodsId
},
'
POST
'
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
console
.
log
(
res
.
data
);
wx
.
showToast
({
...
...
@@ -92,24 +99,24 @@ Page({
}
})
}
else
{
wx
.
navigateTo
({
url
:
'
/pages/goods/goods?id=
'
+
goodsId
,
});
}
}
},
//按下事件开始
touchStart
:
function
(
e
)
{
touchStart
:
function
(
e
)
{
let
that
=
this
;
that
.
setData
({
touchStart
:
e
.
timeStamp
})
},
//按下事件结束
touchEnd
:
function
(
e
)
{
touchEnd
:
function
(
e
)
{
let
that
=
this
;
that
.
setData
({
touchEnd
:
e
.
timeStamp
})
},
},
})
\ No newline at end of file
litemall-wx/pages/ucenter/collect/collect.wxml
View file @
20b97ec8
...
...
@@ -6,7 +6,7 @@
</view>
</view>
<view class="collect-list" wx:else>
<view class="item" bindtap="openGoods"
bindtouchstart="touchStart" bindtouchend="touchEnd" wx:for="{{collectList}}" wx:key="id" data-index="{{index}}">
<view class="item" bindtap="openGoods" bindtouchstart="touchStart" bindtouchend="touchEnd" wx:for="{{collectList}}" wx:key="id" data-index="{{index}}">
<image class="img" src="{{item.picUrl}}"></image>
<view class="info">
<view class="name">{{item.name}}</view>
...
...
@@ -16,4 +16,4 @@
</view>
</view>
</view>
</view>
\ No newline at end of file
Prev
1
2
3
4
5
6
Next
Write
Preview
Supports
Markdown
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