Commit 20b97ec8 authored by Junling Bu's avatar Junling Bu
Browse files

chore[litemall-wx]: 使用微信开发者工具的格式化代码

parent 822d5075
page{ page {
min-height: 100%; min-height: 100%;
background-color: #f4f4f4; background-color: #f4f4f4;
} }
.container{ .container {
min-height: 100%; min-height: 100%;
background-color: #f4f4f4; background-color: #f4f4f4;
} }
.search-header{ .search-header {
position: fixed; position: fixed;
top: 0; top: 0;
width: 750rpx; width: 750rpx;
height: 91rpx; height: 91rpx;
display: flex; display: flex;
background: #fff; background: #fff;
border-bottom: 1px solid rgba(0,0,0,.15); border-bottom: 1px solid rgba(0, 0, 0, 0.15);
padding: 0 31.25rpx; padding: 0 31.25rpx;
font-size: 29rpx; font-size: 29rpx;
color: #333; color: #333;
} }
.search-header .input-box{ .search-header .input-box {
position: relative; position: relative;
margin-top: 16rpx; margin-top: 16rpx;
float: left; float: left;
...@@ -33,7 +33,7 @@ page{ ...@@ -33,7 +33,7 @@ page{
background: #f4f4f4; background: #f4f4f4;
} }
.search-header .icon{ .search-header .icon {
position: absolute; position: absolute;
top: 14rpx; top: 14rpx;
left: 20rpx; left: 20rpx;
...@@ -41,7 +41,7 @@ page{ ...@@ -41,7 +41,7 @@ page{
height: 31rpx; height: 31rpx;
} }
.search-header .del{ .search-header .del {
position: absolute; position: absolute;
top: 3rpx; top: 3rpx;
right: 10rpx; right: 10rpx;
...@@ -50,7 +50,7 @@ page{ ...@@ -50,7 +50,7 @@ page{
z-index: 10; z-index: 10;
} }
.search-header .keywrod{ .search-header .keywrod {
position: absolute; position: absolute;
top: 0; top: 0;
left: 40rpx; left: 40rpx;
...@@ -59,7 +59,7 @@ page{ ...@@ -59,7 +59,7 @@ page{
padding-left: 30rpx; padding-left: 30rpx;
} }
.search-header .right{ .search-header .right {
margin-top: 24rpx; margin-top: 24rpx;
margin-left: 31rpx; margin-left: 31rpx;
margin-right: 6rpx; margin-right: 6rpx;
...@@ -69,13 +69,13 @@ page{ ...@@ -69,13 +69,13 @@ page{
float: right; float: right;
} }
.no-search{ .no-search {
height: auto; height: auto;
overflow: hidden; overflow: hidden;
margin-top: 91rpx; margin-top: 91rpx;
} }
.search-keywords{ .search-keywords {
background: #fff; background: #fff;
width: 750rpx; width: 750rpx;
height: auto; height: auto;
...@@ -83,7 +83,7 @@ page{ ...@@ -83,7 +83,7 @@ page{
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.search-keywords .h{ .search-keywords .h {
padding: 0 31.25rpx; padding: 0 31.25rpx;
height: 93rpx; height: 93rpx;
line-height: 93rpx; line-height: 93rpx;
...@@ -92,13 +92,13 @@ page{ ...@@ -92,13 +92,13 @@ page{
font-size: 29rpx; font-size: 29rpx;
} }
.search-keywords .title{ .search-keywords .title {
display: block; display: block;
width: 120rpx; width: 120rpx;
float: left; float: left;
} }
.search-keywords .icon{ .search-keywords .icon {
margin-top: 19rpx; margin-top: 19rpx;
float: right; float: right;
display: block; display: block;
...@@ -107,31 +107,31 @@ page{ ...@@ -107,31 +107,31 @@ page{
width: 55rpx; width: 55rpx;
} }
.search-keywords .b{ .search-keywords .b {
width: 750rpx; width: 750rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
padding-left: 31.25rpx; padding-left: 31.25rpx;
} }
.search-keywords .item{ .search-keywords .item {
display: inline-block; display: inline-block;
width: auto; width: auto;
height: 48rpx; height: 48rpx;
line-height: 48rpx; line-height: 48rpx;
padding:0 15rpx; padding: 0 15rpx;
border: 1px solid #999; border: 1px solid #999;
margin: 0 31.25rpx 31.25rpx 0; margin: 0 31.25rpx 31.25rpx 0;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
} }
.search-keywords .item.active{ .search-keywords .item.active {
color: #b4282d; color: #b4282d;
border: 1px solid #b4282d; border: 1px solid #b4282d;
} }
.shelper-list{ .shelper-list {
width: 750rpx; width: 750rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
...@@ -139,7 +139,7 @@ page{ ...@@ -139,7 +139,7 @@ page{
padding: 0 31.25rpx; padding: 0 31.25rpx;
} }
.shelper-list .item{ .shelper-list .item {
height: 93rpx; height: 93rpx;
width: 687.5rpx; width: 687.5rpx;
line-height: 93rpx; line-height: 93rpx;
...@@ -148,8 +148,7 @@ page{ ...@@ -148,8 +148,7 @@ page{
border-bottom: 1px solid #f4f4f4; border-bottom: 1px solid #f4f4f4;
} }
.sort {
.sort{
position: fixed; position: fixed;
top: 91rpx; top: 91rpx;
background: #fff; background: #fff;
...@@ -157,7 +156,7 @@ page{ ...@@ -157,7 +156,7 @@ page{
height: 78rpx; height: 78rpx;
} }
.sort-box{ .sort-box {
background: #fff; background: #fff;
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
...@@ -167,42 +166,42 @@ page{ ...@@ -167,42 +166,42 @@ page{
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
} }
.sort-box .item{ .sort-box .item {
height: 78rpx; height: 78rpx;
line-height: 78rpx; line-height: 78rpx;
text-align: center; text-align: center;
flex:1; flex: 1;
color: #333; color: #333;
font-size: 30rpx; font-size: 30rpx;
} }
.sort-box .item .txt{ .sort-box .item .txt {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #333; color: #333;
} }
.sort-box .item.active .txt{ .sort-box .item.active .txt {
color: #b4282d; color: #b4282d;
} }
.sort-box .item.by-price{ .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: 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; background-size: 15rpx 21rpx;
} }
.sort-box .item.by-price.active.asc{ .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: 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; background-size: 15rpx 21rpx;
} }
.sort-box .item.by-price.active.desc{ .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: 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; background-size: 15rpx 21rpx;
} }
.sort-box-category{ .sort-box-category {
background: #fff; background: #fff;
width: 100%; width: 100%;
height: auto; height: auto;
...@@ -211,7 +210,7 @@ page{ ...@@ -211,7 +210,7 @@ page{
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
} }
.sort-box-category .item{ .sort-box-category .item {
height: 54rpx; height: 54rpx;
line-height: 54rpx; line-height: 54rpx;
text-align: center; text-align: center;
...@@ -223,18 +222,18 @@ page{ ...@@ -223,18 +222,18 @@ page{
font-size: 24rpx; font-size: 24rpx;
} }
.sort-box-category .item.active{ .sort-box-category .item.active {
color: #b4282d; color: #b4282d;
border: 1px solid #b4282d; border: 1px solid #b4282d;
} }
.cate-item{ .cate-item {
margin-top: 175rpx; margin-top: 175rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
.cate-item .h{ .cate-item .h {
height: 145rpx; height: 145rpx;
width: 750rpx; width: 750rpx;
display: flex; display: flex;
...@@ -243,7 +242,7 @@ page{ ...@@ -243,7 +242,7 @@ page{
justify-content: center; justify-content: center;
} }
.cate-item .h .name{ .cate-item .h .name {
display: block; display: block;
height: 35rpx; height: 35rpx;
margin-bottom: 18rpx; margin-bottom: 18rpx;
...@@ -251,28 +250,28 @@ page{ ...@@ -251,28 +250,28 @@ page{
color: #333; color: #333;
} }
.cate-item .h .desc{ .cate-item .h .desc {
display: block; display: block;
height: 24rpx; height: 24rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
} }
.cate-item .b{ .cate-item .b {
width: 750rpx; width: 750rpx;
padding: 0 6.25rpx; padding: 0 6.25rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
.cate-item .list-filter{ .cate-item .list-filter {
height: 80rpx; height: 80rpx;
width: 100%; width: 100%;
background: #fff; background: #fff;
margin-bottom: 6.25rpx; margin-bottom: 6.25rpx;
} }
.cate-item .b .item{ .cate-item .b .item {
float: left; float: left;
background: #fff; background: #fff;
width: 365rpx; width: 365rpx;
...@@ -283,16 +282,16 @@ page{ ...@@ -283,16 +282,16 @@ page{
text-align: center; text-align: center;
} }
.cate-item .b .item-b{ .cate-item .b .item-b {
margin-left: 6.25rpx; margin-left: 6.25rpx;
} }
.cate-item .item .img{ .cate-item .item .img {
width: 302rpx; width: 302rpx;
height: 302rpx; height: 302rpx;
} }
.cate-item .item .name{ .cate-item .item .name {
display: block; display: block;
width: 365.625rpx; width: 365.625rpx;
height: 35rpx; height: 35rpx;
...@@ -304,7 +303,7 @@ page{ ...@@ -304,7 +303,7 @@ page{
color: #333; color: #333;
} }
.cate-item .item .price{ .cate-item .item .price {
display: block; display: block;
width: 365.625rpx; width: 365.625rpx;
height: 30rpx; height: 30rpx;
...@@ -313,20 +312,20 @@ page{ ...@@ -313,20 +312,20 @@ page{
color: #b4282d; color: #b4282d;
} }
.search-result-empty{ .search-result-empty {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-top: 300rpx; padding-top: 300rpx;
} }
.search-result-empty .icon{ .search-result-empty .icon {
margin: 0 auto; margin: 0 auto;
display: block; display: block;
width: 240rpx; width: 240rpx;
height: 240rpx; height: 240rpx;
} }
.search-result-empty .text{ .search-result-empty .text {
display: block; display: block;
width: 100%; width: 100%;
height: 40rpx; height: 40rpx;
......
...@@ -10,23 +10,23 @@ Page({ ...@@ -10,23 +10,23 @@ Page({
scrollTop: 0, scrollTop: 0,
showPage: false showPage: false
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
this.getTopic(); this.getTopic();
}, },
onReady: function () { onReady: function() {
// 页面渲染完成 // 页面渲染完成
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
nextPage: function (event) { nextPage: function(event) {
var that = this; var that = this;
if (this.data.page > that.data.count / that.data.size) { if (this.data.page > that.data.count / that.data.size) {
return true; return true;
...@@ -40,7 +40,7 @@ Page({ ...@@ -40,7 +40,7 @@ Page({
this.getTopic(); this.getTopic();
}, },
getTopic: function(){ getTopic: function() {
let that = this; let that = this;
that.setData({ that.setData({
...@@ -55,7 +55,10 @@ Page({ ...@@ -55,7 +55,10 @@ Page({
duration: 2000 duration: 2000
}); });
util.request(api.TopicList, { page: that.data.page, size: that.data.size }).then(function (res) { util.request(api.TopicList, {
page: that.data.page,
size: that.data.size
}).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
...@@ -69,7 +72,7 @@ Page({ ...@@ -69,7 +72,7 @@ Page({
}); });
}, },
prevPage: function (event) { prevPage: function(event) {
if (this.data.page <= 1) { if (this.data.page <= 1) {
return false; return false;
} }
......
...@@ -17,9 +17,12 @@ Page({ ...@@ -17,9 +17,12 @@ Page({
picPage: 1, picPage: 1,
size: 20 size: 20
}, },
getCommentCount: function () { getCommentCount: function() {
let that = this; 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) { if (res.errno === 0) {
that.setData({ that.setData({
...@@ -29,7 +32,7 @@ Page({ ...@@ -29,7 +32,7 @@ Page({
} }
}); });
}, },
getCommentList: function(){ getCommentList: function() {
let that = this; let that = this;
util.request(api.CommentList, { util.request(api.CommentList, {
valueId: that.data.valueId, valueId: that.data.valueId,
...@@ -37,7 +40,7 @@ Page({ ...@@ -37,7 +40,7 @@ Page({
size: that.data.size, size: that.data.size,
page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage), page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage),
showType: that.data.showType showType: that.data.showType
}).then(function (res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
if (that.data.showType == 0) { if (that.data.showType == 0) {
...@@ -56,7 +59,7 @@ Page({ ...@@ -56,7 +59,7 @@ Page({
} }
}); });
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
this.setData({ this.setData({
type: options.type, type: options.type,
...@@ -65,39 +68,39 @@ Page({ ...@@ -65,39 +68,39 @@ Page({
this.getCommentCount(); this.getCommentCount();
this.getCommentList(); this.getCommentList();
}, },
onReady: function () { onReady: function() {
// 页面渲染完成 // 页面渲染完成
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
switchTab: function () { switchTab: function() {
this.setData({ this.setData({
showType: this.data.showType == 1 ? 0 :1 showType: this.data.showType == 1 ? 0 : 1
}); });
this.getCommentList(); this.getCommentList();
}, },
onReachBottom: function(){ onReachBottom: function() {
console.log('onPullDownRefresh'); console.log('onPullDownRefresh');
if ( this.data.showType == 0) { if (this.data.showType == 0) {
if (this.data.allCount / this.data.size < this.data.allPage) { if (this.data.allCount / this.data.size < this.data.allPage) {
return false; return false;
} }
this.setData({ this.setData({
'allPage' : this.data.allPage + 1 'allPage': this.data.allPage + 1
}); });
} else { } else {
if (this.data.hasPicCount / this.data.size < this.data.picPage) { if (this.data.hasPicCount / this.data.size < this.data.picPage) {
......
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
<view class="imgs" wx:if="{{item.picList.length > 0}}"> <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> <image class="img" wx:for="{{item.picList}}" wx:key="id" wx:for-item="pitem" src="{{pitem.picUrl}}"></image>
</view> </view>
<!--<view class="customer-service" wx:if="{{item.commentReplyVO}}">
<text class="u">小选回复:</text>
<text class="c">{{item.commentReplyVO.replyContent}}</text>
</view>-->
</view> </view>
</view> </view>
......
.comments{ .comments {
width: 100%; width: 100%;
height: auto; height: auto;
padding-left:30rpx; padding-left: 30rpx;
background: #fff; background: #fff;
margin: 20rpx 0; margin: 20rpx 0;
} }
.comments .b{ .comments .b {
height: auto; height: auto;
width: 720rpx; width: 720rpx;
} }
.comments .b.no-h{ .comments .b.no-h {
margin-top: 0; margin-top: 0;
} }
.comments .item{ .comments .item {
height: auto; height: auto;
width: 720rpx; width: 720rpx;
overflow: hidden; overflow: hidden;
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
padding-bottom: 25rpx; padding-bottom: 25rpx;
} }
.comments .info{ .comments .info {
height: 127rpx; height: 127rpx;
width: 100%; width: 100%;
padding: 33rpx 0 27rpx 0; padding: 33rpx 0 27rpx 0;
} }
.comments .user{ .comments .user {
float: left; float: left;
width: auto; width: auto;
height: 67rpx; height: 67rpx;
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
font-size: 0; font-size: 0;
} }
.comments .user image{ .comments .user image {
float: left; float: left;
width: 67rpx; width: 67rpx;
height: 67rpx; height: 67rpx;
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
border-radius: 50%; border-radius: 50%;
} }
.comments .user text{ .comments .user text {
display: inline-block; display: inline-block;
width: auto; width: auto;
height: 66rpx; height: 66rpx;
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
line-height: 66rpx; line-height: 66rpx;
} }
.comments .time{ .comments .time {
display: block; display: block;
float: right; float: right;
width: auto; width: auto;
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
margin-right: 30rpx; margin-right: 30rpx;
} }
.comments .comment{ .comments .comment {
width: 720rpx; width: 720rpx;
padding-right: 30rpx; padding-right: 30rpx;
line-height: 45.8rpx; line-height: 45.8rpx;
...@@ -73,35 +73,34 @@ ...@@ -73,35 +73,34 @@
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.comments .imgs{ .comments .imgs {
width: 720rpx; width: 720rpx;
height: 150rpx; height: 150rpx;
margin-bottom: 25rpx; margin-bottom: 25rpx;
} }
.comments .imgs .img{ .comments .imgs .img {
height: 150rpx; height: 150rpx;
width: 150rpx; width: 150rpx;
margin-right: 28rpx; margin-right: 28rpx;
} }
.comments .customer-service{ .comments .customer-service {
width: 690rpx; width: 690rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
margin-top: 23rpx; margin-top: 23rpx;
background: rgba(0,0,0,.03); background: rgba(0, 0, 0, 0.03);
padding: 21rpx; padding: 21rpx;
} }
.comments .customer-service .u {
.comments .customer-service .u{
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
line-height: 37.5rpx; line-height: 37.5rpx;
} }
.comments .customer-service .c{ .comments .customer-service .c {
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
line-height: 37.5rpx; line-height: 37.5rpx;
......
...@@ -14,7 +14,7 @@ Page({ ...@@ -14,7 +14,7 @@ Page({
picUrls: [], picUrls: [],
files: [] files: []
}, },
chooseImage: function (e) { chooseImage: function(e) {
if (this.data.files.length >= 5) { if (this.data.files.length >= 5) {
util.showErrorToast('只能上传五张图片') util.showErrorToast('只能上传五张图片')
return false; return false;
...@@ -25,7 +25,7 @@ Page({ ...@@ -25,7 +25,7 @@ Page({
count: 1, count: 1,
sizeType: ['original', 'compressed'], sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
success: function (res) { success: function(res) {
that.setData({ that.setData({
files: that.data.files.concat(res.tempFilePaths) files: that.data.files.concat(res.tempFilePaths)
}); });
...@@ -33,13 +33,13 @@ Page({ ...@@ -33,13 +33,13 @@ Page({
} }
}) })
}, },
upload: function (res) { upload: function(res) {
var that = this; var that = this;
const uploadTask = wx.uploadFile({ const uploadTask = wx.uploadFile({
url: api.StorageUpload, url: api.StorageUpload,
filePath: res.tempFilePaths[0], filePath: res.tempFilePaths[0],
name: 'file', name: 'file',
success: function (res) { success: function(res) {
var _res = JSON.parse(res.data); var _res = JSON.parse(res.data);
if (_res.errno === 0) { if (_res.errno === 0) {
var url = _res.data.url var url = _res.data.url
...@@ -50,7 +50,7 @@ Page({ ...@@ -50,7 +50,7 @@ Page({
}) })
} }
}, },
fail: function (e) { fail: function(e) {
wx.showModal({ wx.showModal({
title: '错误', title: '错误',
content: '上传失败', content: '上传失败',
...@@ -66,28 +66,24 @@ Page({ ...@@ -66,28 +66,24 @@ Page({
}) })
}, },
previewImage: function (e) { previewImage: function(e) {
wx.previewImage({ wx.previewImage({
current: e.currentTarget.id, // 当前显示图片的http链接 current: e.currentTarget.id, // 当前显示图片的http链接
urls: this.data.files // 需要预览的图片http链接列表 urls: this.data.files // 需要预览的图片http链接列表
}) })
}, },
selectRater: function (e) { selectRater: function(e) {
var star = e.currentTarget.dataset.star + 1; var star = e.currentTarget.dataset.star + 1;
var starText; var starText;
if (star == 1) { if (star == 1) {
starText = '很差'; starText = '很差';
} } else if (star == 2) {
else if (star == 2) {
starText = '不太满意'; starText = '不太满意';
} } else if (star == 3) {
else if (star == 3) {
starText = '满意'; starText = '满意';
} } else if (star == 4) {
else if (star == 4) {
starText = '比较满意'; starText = '比较满意';
} } else {
else {
starText = '十分满意' starText = '十分满意'
} }
this.setData({ this.setData({
...@@ -96,8 +92,8 @@ Page({ ...@@ -96,8 +92,8 @@ Page({
}) })
}, },
onLoad: function (options) { onLoad: function(options) {
if (parseInt(options.type) !== 1){ if (parseInt(options.type) !== 1) {
return; return;
} }
...@@ -107,9 +103,11 @@ Page({ ...@@ -107,9 +103,11 @@ Page({
}); });
this.getTopic(); this.getTopic();
}, },
getTopic: function () { getTopic: function() {
let that = this; 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) { if (res.errno === 0) {
that.setData({ that.setData({
...@@ -119,10 +117,10 @@ Page({ ...@@ -119,10 +117,10 @@ Page({
} }
}); });
}, },
onClose: function () { onClose: function() {
wx.navigateBack(); wx.navigateBack();
}, },
onPost: function () { onPost: function() {
let that = this; let that = this;
if (!this.data.content) { if (!this.data.content) {
...@@ -137,11 +135,11 @@ Page({ ...@@ -137,11 +135,11 @@ Page({
star: that.data.star, star: that.data.star,
hasPicture: that.data.hasPicture, hasPicture: that.data.hasPicture,
picUrls: that.data.picUrls picUrls: that.data.picUrls
}, 'POST').then(function (res) { }, 'POST').then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
wx.showToast({ wx.showToast({
title: '评论成功', title: '评论成功',
complete: function () { complete: function() {
wx.navigateBack(); wx.navigateBack();
} }
}) })
...@@ -161,18 +159,18 @@ Page({ ...@@ -161,18 +159,18 @@ Page({
content: event.detail.value, content: event.detail.value,
}) })
}, },
onReady: function () { onReady: function() {
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
} }
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
<view class="weui-uploader__file" bindtap="previewImage" id="{{item}}"> <view class="weui-uploader__file" bindtap="previewImage" id="{{item}}">
<image class="weui-uploader__img" src="{{item}}" mode="aspectFill" /> <image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
</view> </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> </block>
<view class="weui-uploader__input-box"> <view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="chooseImage"></view> <view class="weui-uploader__input" bindtap="chooseImage"></view>
......
...@@ -12,14 +12,16 @@ Page({ ...@@ -12,14 +12,16 @@ Page({
commentList: [], commentList: [],
topicGoods: [] topicGoods: []
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
var that = this; var that = this;
that.setData({ that.setData({
id: options.id 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) { if (res.errno === 0) {
that.setData({ that.setData({
topic: res.data.topic, topic: res.data.topic,
...@@ -30,7 +32,9 @@ Page({ ...@@ -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) { if (res.errno === 0) {
that.setData({ that.setData({
topicList: res.data topicList: res.data
...@@ -40,7 +44,13 @@ Page({ ...@@ -40,7 +44,13 @@ Page({
}, },
getCommentList() { getCommentList() {
let that = this; 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) { if (res.errno === 0) {
that.setData({ that.setData({
commentList: res.data.data, commentList: res.data.data,
...@@ -51,26 +61,27 @@ Page({ ...@@ -51,26 +61,27 @@ Page({
}, },
postComment() { postComment() {
if (!app.globalData.hasLogin) { if (!app.globalData.hasLogin) {
wx.navigateTo({ url: "/pages/auth/login/login" }); wx.navigateTo({
} url: "/pages/auth/login/login"
else { });
} else {
wx.navigateTo({ wx.navigateTo({
url: '/pages/topicCommentPost/topicCommentPost?valueId=' + this.data.id + '&type=1', url: '/pages/topicCommentPost/topicCommentPost?valueId=' + this.data.id + '&type=1',
}) })
} }
}, },
onReady: function () { onReady: function() {
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
this.getCommentList(); this.getCommentList();
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
} }
......
<scroll-view class="container"> <scroll-view class="container">
<scroll-view class="content"> <scroll-view class="content">
<import src="../../lib/wxParse/wxParse.wxml"/> <import src="../../lib/wxParse/wxParse.wxml" />
<template is="wxParse" data="{{wxParseData:topicDetail.nodes}}"/> <template is="wxParse" data="{{wxParseData:topicDetail.nodes}}" />
</scroll-view> </scroll-view>
<scroll-view class="sv-goods" wx:if="{{topicGoods.length > 0 }}"> <scroll-view class="sv-goods" wx:if="{{topicGoods.length > 0 }}">
<view class="topic-goods"> <view class="topic-goods">
......
.content{ .content {
width: 100%; width: 100%;
height: auto; height: auto;
font-size: 0; font-size: 0;
} }
.content image{ .content image {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
} }
.comments{ .comments {
width: 100%; width: 100%;
height: auto; height: auto;
padding-left:30rpx; padding-left: 30rpx;
background: #fff; background: #fff;
margin-top: 20rpx; margin-top: 20rpx;
} }
.comments .h{ .comments .h {
height: 93rpx; height: 93rpx;
line-height: 93rpx; line-height: 93rpx;
width: 720rpx; width: 720rpx;
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
} }
.comments .h .t{ .comments .h .t {
display: block; display: block;
float: left; float: left;
width: 50%; width: 50%;
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
color: #333; color: #333;
} }
.comments .h .i{ .comments .h .i {
display: block; display: block;
float: right; float: right;
margin-top: 30rpx; margin-top: 30rpx;
...@@ -41,25 +41,25 @@ ...@@ -41,25 +41,25 @@
height: 33rpx; height: 33rpx;
} }
.comments .b{ .comments .b {
height: auto; height: auto;
width: 720rpx; width: 720rpx;
} }
.comments .item{ .comments .item {
height: auto; height: auto;
width: 720rpx; width: 720rpx;
overflow: hidden; overflow: hidden;
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
} }
.comments .info{ .comments .info {
height: 127rpx; height: 127rpx;
width: 100%; width: 100%;
padding: 33rpx 0 27rpx 0; padding: 33rpx 0 27rpx 0;
} }
.comments .user{ .comments .user {
float: left; float: left;
width: auto; width: auto;
height: 67rpx; height: 67rpx;
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
font-size: 0; font-size: 0;
} }
.comments .user .avatar{ .comments .user .avatar {
display: block; display: block;
float: left; float: left;
width: 67rpx; width: 67rpx;
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
border-radius: 50%; border-radius: 50%;
} }
.comments .user .nickname{ .comments .user .nickname {
display: block; display: block;
width: auto; width: auto;
float: left; float: left;
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
line-height: 66rpx; line-height: 66rpx;
} }
.comments .time{ .comments .time {
display: block; display: block;
float: right; float: right;
width: auto; width: auto;
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
margin-right: 30rpx; margin-right: 30rpx;
} }
.comments .comment{ .comments .comment {
width: 720rpx; width: 720rpx;
padding-right: 30rpx; padding-right: 30rpx;
line-height: 45.8rpx; line-height: 45.8rpx;
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
color: #333; color: #333;
} }
.comments .load{ .comments .load {
width: 720rpx; width: 720rpx;
height: 108rpx; height: 108rpx;
line-height: 108rpx; line-height: 108rpx;
...@@ -114,11 +114,11 @@ ...@@ -114,11 +114,11 @@
font-size: 38.5rpx; font-size: 38.5rpx;
} }
.no-comments{ .no-comments {
height: 297rpx; height: 297rpx;
} }
.no-comments .txt{ .no-comments .txt {
height: 43rpx; height: 43rpx;
line-height: 43rpx; line-height: 43rpx;
display: block; display: block;
...@@ -128,17 +128,17 @@ ...@@ -128,17 +128,17 @@
color: #7f7f7f; color: #7f7f7f;
} }
.no-comments .icon{ .no-comments .icon {
margin: 48rpx auto 18rpx auto; margin: 48rpx auto 18rpx auto;
height: 130rpx; height: 130rpx;
display: block; display: block;
width: 115rpx; width: 115rpx;
} }
.sv-goods{ .sv-goods {
width: 100%; width: 100%;
height: auto; height: auto;
padding-left:30rpx; padding-left: 30rpx;
background: #fff; background: #fff;
margin-top: 20rpx; margin-top: 20rpx;
} }
...@@ -149,6 +149,7 @@ ...@@ -149,6 +149,7 @@
height: 244rpx; height: 244rpx;
width: 710rpx; width: 710rpx;
} }
.topic-goods .b .img { .topic-goods .b .img {
margin-top: 12rpx; margin-top: 12rpx;
margin-right: 12rpx; margin-right: 12rpx;
...@@ -156,6 +157,7 @@ ...@@ -156,6 +157,7 @@
width: 220rpx; width: 220rpx;
height: 220rpx; height: 220rpx;
} }
.topic-goods .b .right { .topic-goods .b .right {
float: left; float: left;
height: 244rpx; height: 244rpx;
...@@ -163,6 +165,7 @@ ...@@ -163,6 +165,7 @@
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
} }
.topic-goods .b .text { .topic-goods .b .text {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
...@@ -172,6 +175,7 @@ ...@@ -172,6 +175,7 @@
height: 244rpx; height: 244rpx;
width: 476rpx; width: 476rpx;
} }
.topic-goods .b .name { .topic-goods .b .name {
float: left; float: left;
width: 330rpx; width: 330rpx;
...@@ -180,6 +184,7 @@ ...@@ -180,6 +184,7 @@
line-height: 50rpx; line-height: 50rpx;
font-size: 30rpx; font-size: 30rpx;
} }
.topic-goods .b .desc { .topic-goods .b .desc {
width: 476rpx; width: 476rpx;
display: block; display: block;
...@@ -187,6 +192,7 @@ ...@@ -187,6 +192,7 @@
line-height: 50rpx; line-height: 50rpx;
font-size: 25rpx; font-size: 25rpx;
} }
.topic-goods .b .price { .topic-goods .b .price {
width: 476rpx; width: 476rpx;
display: flex; display: flex;
...@@ -195,13 +201,13 @@ ...@@ -195,13 +201,13 @@
font-size: 33rpx; font-size: 33rpx;
} }
.rec-box{ .rec-box {
width: 690rpx; width: 690rpx;
height: auto; height: auto;
margin: 0 30rpx; margin: 0 30rpx;
} }
.rec-box .h{ .rec-box .h {
position: relative; position: relative;
width: 690rpx; width: 690rpx;
height: 96rpx; height: 96rpx;
...@@ -209,7 +215,7 @@ ...@@ -209,7 +215,7 @@
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.rec-box .h .txt{ .rec-box .h .txt {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
background: #f4f4f4; background: #f4f4f4;
...@@ -223,7 +229,7 @@ ...@@ -223,7 +229,7 @@
text-align: center; text-align: center;
} }
.rec-box .b .item{ .rec-box .b .item {
width: 690rpx; width: 690rpx;
height: 397rpx; height: 397rpx;
padding: 24rpx 24rpx 30rpx 24rpx; padding: 24rpx 24rpx 30rpx 24rpx;
...@@ -231,12 +237,12 @@ ...@@ -231,12 +237,12 @@
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.rec-box .b .item .img{ .rec-box .b .item .img {
height: 278rpx; height: 278rpx;
width: 642rpx; width: 642rpx;
} }
.rec-box .b .item .title{ .rec-box .b .item .title {
display: block; display: block;
margin-top: 30rpx; margin-top: 30rpx;
height: 30rpx; height: 30rpx;
......
...@@ -6,19 +6,19 @@ Page({ ...@@ -6,19 +6,19 @@ Page({
data: { data: {
addressList: [], addressList: [],
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
}, },
onReady: function () { onReady: function() {
// 页面渲染完成 // 页面渲染完成
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
this.getAddressList(); this.getAddressList();
}, },
getAddressList (){ getAddressList() {
let that = this; let that = this;
util.request(api.AddressList).then(function (res) { util.request(api.AddressList).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
addressList: res.data addressList: res.data
...@@ -26,7 +26,7 @@ Page({ ...@@ -26,7 +26,7 @@ Page({
} }
}); });
}, },
addressAddOrUpdate (event) { addressAddOrUpdate(event) {
console.log(event) console.log(event)
//返回之前,先取出上一页对象,并设置addressId //返回之前,先取出上一页对象,并设置addressId
...@@ -55,13 +55,13 @@ Page({ ...@@ -55,13 +55,13 @@ Page({
}) })
} }
}, },
deleteAddress(event){ deleteAddress(event) {
console.log(event.target) console.log(event.target)
let that = this; let that = this;
wx.showModal({ wx.showModal({
title: '', title: '',
content: '确定要删除地址?', content: '确定要删除地址?',
success: function (res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
let addressId = event.target.dataset.addressId; let addressId = event.target.dataset.addressId;
util.request(api.AddressDelete, { util.request(api.AddressDelete, {
...@@ -82,10 +82,10 @@ Page({ ...@@ -82,10 +82,10 @@ Page({
return false; return false;
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
} }
}) })
\ No newline at end of file
page{ page {
height: 100%; height: 100%;
width: 100%; width: 100%;
background: #f4f4f4; background: #f4f4f4;
} }
.container{ .container {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
.address-list{ .address-list {
padding-left: 31.25rpx; 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: #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; background-size: auto 10.5rpx;
margin-bottom: 90rpx; margin-bottom: 90rpx;
} }
.address-list .item{ .address-list .item {
height: 156.55rpx; height: 156.55rpx;
align-items: center; align-items: center;
display: flex; display: flex;
border-bottom: 1rpx solid #DCD9D9; border-bottom: 1rpx solid #dcd9d9;
} }
.address-list .l{ .address-list .l {
width: 125rpx; width: 125rpx;
height: 80rpx; height: 80rpx;
overflow: hidden; overflow: hidden;
} }
.address-list .name{ .address-list .name {
width: 125rpx; width: 125rpx;
height: 43rpx; height: 43rpx;
font-size: 29rpx; font-size: 29rpx;
...@@ -40,7 +40,7 @@ page{ ...@@ -40,7 +40,7 @@ page{
overflow: hidden; overflow: hidden;
} }
.address-list .default{ .address-list .default {
width: 62.5rpx; width: 62.5rpx;
height: 33rpx; height: 33rpx;
line-height: 28rpx; line-height: 28rpx;
...@@ -51,15 +51,13 @@ page{ ...@@ -51,15 +51,13 @@ page{
visibility: visible; visibility: visible;
} }
.address-list .c {
.address-list .c{
flex: 1; flex: 1;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
.address-list .mobile{ .address-list .mobile {
height: 29rpx; height: 29rpx;
font-size: 29rpx; font-size: 29rpx;
line-height: 29rpx; line-height: 29rpx;
...@@ -68,7 +66,7 @@ page{ ...@@ -68,7 +66,7 @@ page{
margin-bottom: 6.25rpx; margin-bottom: 6.25rpx;
} }
.address-list .address{ .address-list .address {
height: 37rpx; height: 37rpx;
font-size: 25rpx; font-size: 25rpx;
line-height: 37rpx; line-height: 37rpx;
...@@ -76,20 +74,20 @@ page{ ...@@ -76,20 +74,20 @@ page{
color: #666; color: #666;
} }
.address-list .r{ .address-list .r {
width: 52rpx; width: 52rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
margin-right: 16.5rpx; margin-right: 16.5rpx;
} }
.address-list .del{ .address-list .del {
display: block; display: block;
width: 52rpx; width: 52rpx;
height: 52rpx; height: 52rpx;
} }
.add-address{ .add-address {
border: none; border: none;
right: 0; right: 0;
display: flex; display: flex;
...@@ -117,7 +115,7 @@ page{ ...@@ -117,7 +115,7 @@ page{
background-image: linear-gradient(to right, #9a9ba1 0%, #9a9ba1 100%); background-image: linear-gradient(to right, #9a9ba1 0%, #9a9ba1 100%);
} }
.empty-view{ .empty-view {
height: 100%; height: 100%;
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -126,13 +124,13 @@ page{ ...@@ -126,13 +124,13 @@ page{
justify-content: center; justify-content: center;
} }
.empty-view .icon{ .empty-view .icon {
height: 248rpx; height: 248rpx;
width: 258rpx; width: 258rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.empty-view .text{ .empty-view .text {
width: auto; width: auto;
font-size: 28rpx; font-size: 28rpx;
line-height: 35rpx; line-height: 35rpx;
......
...@@ -6,7 +6,7 @@ var app = getApp(); ...@@ -6,7 +6,7 @@ var app = getApp();
Page({ Page({
data: { data: {
address: { address: {
id:0, id: 0,
provinceId: 0, provinceId: 0,
cityId: 0, cityId: 0,
areaId: 0, areaId: 0,
...@@ -20,10 +20,24 @@ Page({ ...@@ -20,10 +20,24 @@ Page({
}, },
addressId: 0, addressId: 0,
openSelectRegion: false, openSelectRegion: false,
selectRegionList: [ selectRegionList: [{
{ id: 0, name: '省份', pid: 1, type: 1 }, id: 0,
{ id: 0, name: '城市', pid: 1, type: 2 }, name: '省份',
{ id: 0, name: '区县', pid: 1, type: 3 } pid: 1,
type: 1
},
{
id: 0,
name: '城市',
pid: 1,
type: 2
},
{
id: 0,
name: '区县',
pid: 1,
type: 3
}
], ],
regionType: 1, regionType: 1,
regionList: [], regionList: [],
...@@ -43,14 +57,14 @@ Page({ ...@@ -43,14 +57,14 @@ Page({
address: address address: address
}); });
}, },
bindinputAddress (event){ bindinputAddress(event) {
let address = this.data.address; let address = this.data.address;
address.address = event.detail.value; address.address = event.detail.value;
this.setData({ this.setData({
address: address address: address
}); });
}, },
bindIsDefault(){ bindIsDefault() {
let address = this.data.address; let address = this.data.address;
address.isDefault = !address.isDefault; address.isDefault = !address.isDefault;
this.setData({ this.setData({
...@@ -59,9 +73,11 @@ Page({ ...@@ -59,9 +73,11 @@ Page({
}, },
getAddressDetail() { getAddressDetail() {
let that = this; 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.errno === 0) {
if(res.data){ if (res.data) {
that.setData({ that.setData({
address: res.data address: res.data
}); });
...@@ -110,10 +126,24 @@ Page({ ...@@ -110,10 +126,24 @@ Page({
this.getRegionList(address.cityId); this.getRegionList(address.cityId);
} else { } else {
this.setData({ this.setData({
selectRegionList: [ selectRegionList: [{
{ id: 0, name: '省份', pid: 0, type: 1 }, id: 0,
{ id: 0, name: '城市', pid: 0, type: 2 }, name: '省份',
{ id: 0, name: '区县', pid: 0, type: 3 } pid: 0,
type: 1
},
{
id: 0,
name: '城市',
pid: 0,
type: 2
},
{
id: 0,
name: '区县',
pid: 0,
type: 3
}
], ],
regionType: 1 regionType: 1
}) })
...@@ -123,7 +153,7 @@ Page({ ...@@ -123,7 +153,7 @@ Page({
this.setRegionDoneStatus(); this.setRegionDoneStatus();
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
console.log(options) console.log(options)
if (options.id && options.id != 0) { if (options.id && options.id != 0) {
...@@ -133,7 +163,7 @@ Page({ ...@@ -133,7 +163,7 @@ Page({
this.getAddressDetail(); this.getAddressDetail();
} }
}, },
onReady: function () { onReady: function() {
}, },
selectRegionType(event) { selectRegionType(event) {
...@@ -142,7 +172,7 @@ Page({ ...@@ -142,7 +172,7 @@ Page({
let selectRegionList = that.data.selectRegionList; 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; return false;
} }
...@@ -240,7 +270,9 @@ Page({ ...@@ -240,7 +270,9 @@ Page({
getRegionList(regionId) { getRegionList(regionId) {
let that = this; let that = this;
let regionType = that.data.regionType; 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) { if (res.errno === 0) {
that.setData({ that.setData({
regionList: res.data.map(item => { regionList: res.data.map(item => {
...@@ -258,10 +290,10 @@ Page({ ...@@ -258,10 +290,10 @@ Page({
} }
}); });
}, },
cancelAddress(){ cancelAddress() {
wx.navigateBack(); wx.navigateBack();
}, },
saveAddress(){ saveAddress() {
console.log(this.data.address) console.log(this.data.address)
let address = this.data.address; let address = this.data.address;
...@@ -302,7 +334,7 @@ Page({ ...@@ -302,7 +334,7 @@ Page({
areaId: address.areaId, areaId: address.areaId,
address: address.address, address: address.address,
isDefault: address.isDefault isDefault: address.isDefault
}, 'POST').then(function (res) { }, 'POST').then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
//返回之前,先取出上一页对象,并设置addressId //返回之前,先取出上一页对象,并设置addressId
var pages = getCurrentPages(); var pages = getCurrentPages();
...@@ -325,15 +357,15 @@ Page({ ...@@ -325,15 +357,15 @@ Page({
}); });
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
} }
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<input class="input" bindinput="bindinputName" placeholder="姓名" value="{{address.name}}" auto-focus/> <input class="input" bindinput="bindinputName" placeholder="姓名" value="{{address.name}}" auto-focus/>
</view> </view>
<view class="form-item"> <view class="form-item">
<input class="input" bindinput="bindinputMobile" value="{{address.mobile}}" placeholder="手机号码"/> <input class="input" bindinput="bindinputMobile" value="{{address.mobile}}" placeholder="手机号码" />
</view> </view>
<view class="form-item"> <view class="form-item">
<input class="input" value="{{address.provinceName + address.cityName + address.areaName}}" disabled="true" bindtap="chooseRegion" placeholder="省份、城市、区县"/> <input class="input" value="{{address.provinceName + address.cityName + address.areaName}}" disabled="true" bindtap="chooseRegion" placeholder="省份、城市、区县" />
</view> </view>
<view class="form-item"> <view class="form-item">
<input class="input" bindinput="bindinputAddress" value="{{address.address}}" placeholder="详细地址, 如街道、楼盘号等"/> <input class="input" bindinput="bindinputAddress" value="{{address.address}}" placeholder="详细地址, 如街道、楼盘号等" />
</view> </view>
<view class="form-default"> <view class="form-default">
<text bindtap="bindIsDefault" class="default-input {{address.isDefault == 1 ? 'selected' : ''}}">设为默认地址</text> <text bindtap="bindIsDefault" class="default-input {{address.isDefault == 1 ? 'selected' : ''}}">设为默认地址</text>
......
page{ page {
height: 100%; height: 100%;
background: #f4f4f4; background: #f4f4f4;
} }
.add-address .add-form{
.add-address .add-form {
background: #fff; background: #fff;
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
.add-address .form-item{ .add-address .form-item {
height: 116rpx; height: 116rpx;
padding-left: 31.25rpx; padding-left: 31.25rpx;
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
...@@ -18,14 +19,14 @@ page{ ...@@ -18,14 +19,14 @@ page{
padding-right: 31.25rpx; padding-right: 31.25rpx;
} }
.add-address .input{ .add-address .input {
flex: 1; flex: 1;
height: 44rpx; height: 44rpx;
line-height: 44rpx; line-height: 44rpx;
overflow: hidden; overflow: hidden;
} }
.add-address .form-default{ .add-address .form-default {
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
height: 96rpx; height: 96rpx;
background: #fafafa; background: #fafafa;
...@@ -33,7 +34,7 @@ page{ ...@@ -33,7 +34,7 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.default-input{ .default-input {
margin: 0 auto; margin: 0 auto;
display: block; display: block;
width: 240rpx; width: 240rpx;
...@@ -45,12 +46,12 @@ page{ ...@@ -45,12 +46,12 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.default-input.selected{ .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: 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; background-size: 38rpx 486rpx;
} }
.add-address .btns{ .add-address .btns {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
...@@ -60,50 +61,49 @@ page{ ...@@ -60,50 +61,49 @@ page{
width: 100%; width: 100%;
} }
.add-address .cannel,.add-address .save{ .add-address .cannel, .add-address .save {
flex: 1; flex: 1;
height: 100rpx; height: 100rpx;
text-align: center; text-align: center;
line-height: 100rpx; line-height: 100rpx;
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
border:none; border: none;
border-radius: 0; border-radius: 0;
} }
.add-address .cannel{ .add-address .cannel {
background: #333; background: #333;
} }
.add-address .save{ .add-address .save {
background: #b4282d; background: #b4282d;
} }
.region-select {
.region-select{
width: 100%; width: 100%;
height: 600rpx; height: 600rpx;
background: #fff; background: #fff;
position: fixed; position: fixed;
z-index: 10; z-index: 10;
left:0; left: 0;
bottom: 0; bottom: 0;
} }
.region-select .hd{ .region-select .hd {
height: 108rpx; height: 108rpx;
width: 100%; width: 100%;
border-bottom: 1px solid #f4f4f4; border-bottom: 1px solid #f4f4f4;
padding: 46rpx 30rpx 0 30rpx; padding: 46rpx 30rpx 0 30rpx;
} }
.region-select .region-selected{ .region-select .region-selected {
float: left; float: left;
height: 60rpx; height: 60rpx;
display: flex; display: flex;
} }
.region-select .region-selected .item{ .region-select .region-selected .item {
max-width: 140rpx; max-width: 140rpx;
margin-right: 30rpx; margin-right: 30rpx;
text-align: left; text-align: left;
...@@ -116,15 +116,15 @@ page{ ...@@ -116,15 +116,15 @@ page{
white-space: nowrap; white-space: nowrap;
} }
.region-select .region-selected .item.disabled{ .region-select .region-selected .item.disabled {
color: #999; color: #999;
} }
.region-select .region-selected .item.selected{ .region-select .region-selected .item.selected {
color: #b4282d; color: #b4282d;
} }
.region-select .done{ .region-select .done {
float: right; float: right;
height: 60rpx; height: 60rpx;
width: 60rpx; width: 60rpx;
...@@ -136,21 +136,21 @@ page{ ...@@ -136,21 +136,21 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.region-select .done.disabled{ .region-select .done.disabled {
color: #999; color: #999;
} }
.region-select .bd{ .region-select .bd {
height: 492rpx; height: 492rpx;
width: 100%; width: 100%;
padding: 0 30rpx; padding: 0 30rpx;
} }
.region-select .region-list{ .region-select .region-list {
height: 492rpx; height: 492rpx;
} }
.region-select .region-list .item{ .region-select .region-list .item {
width: 100%; width: 100%;
height: 104rpx; height: 104rpx;
line-height: 104rpx; line-height: 104rpx;
...@@ -159,17 +159,16 @@ page{ ...@@ -159,17 +159,16 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.region-select .region-list .item.selected{ .region-select .region-list .item.selected {
color: #b4282d; color: #b4282d;
} }
.bg-mask {
.bg-mask{
height: 100%; height: 100%;
width: 100%; width: 100%;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.4);
position: fixed; position: fixed;
top:0; top: 0;
left:0; left: 0;
z-index: 8; z-index: 8;
} }
...@@ -16,7 +16,11 @@ Page({ ...@@ -16,7 +16,11 @@ Page({
title: '加载中...', title: '加载中...',
}); });
let that = this; 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) { if (res.errno === 0) {
that.setData({ that.setData({
collectList: that.data.collectList.concat(res.data.collectList), collectList: that.data.collectList.concat(res.data.collectList),
...@@ -26,7 +30,7 @@ Page({ ...@@ -26,7 +30,7 @@ Page({
wx.hideLoading(); wx.hideLoading();
}); });
}, },
onLoad: function (options) { onLoad: function(options) {
this.getCollectList(); this.getCollectList();
}, },
onReachBottom() { onReachBottom() {
...@@ -44,17 +48,17 @@ Page({ ...@@ -44,17 +48,17 @@ Page({
return false; return false;
} }
}, },
onReady: function () { onReady: function() {
}, },
onShow: function () { onShow: function() {
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
openGoods(event) { openGoods(event) {
...@@ -71,10 +75,13 @@ Page({ ...@@ -71,10 +75,13 @@ Page({
wx.showModal({ wx.showModal({
title: '', title: '',
content: '确定删除吗?', content: '确定删除吗?',
success: function (res) { success: function(res) {
if (res.confirm) { 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) { if (res.errno === 0) {
console.log(res.data); console.log(res.data);
wx.showToast({ wx.showToast({
...@@ -99,14 +106,14 @@ Page({ ...@@ -99,14 +106,14 @@ Page({
} }
}, },
//按下事件开始 //按下事件开始
touchStart: function (e) { touchStart: function(e) {
let that = this; let that = this;
that.setData({ that.setData({
touchStart: e.timeStamp touchStart: e.timeStamp
}) })
}, },
//按下事件结束 //按下事件结束
touchEnd: function (e) { touchEnd: function(e) {
let that = this; let that = this;
that.setData({ that.setData({
touchEnd: e.timeStamp touchEnd: e.timeStamp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment