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

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

parent 822d5075
...@@ -20,59 +20,59 @@ Page({ ...@@ -20,59 +20,59 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function(options) {
this.getGrouponList(); this.getGrouponList();
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function() {
}, },
getGrouponList: function () { getGrouponList: function() {
let that = this; let that = this;
that.setData({ that.setData({
...@@ -87,7 +87,10 @@ Page({ ...@@ -87,7 +87,10 @@ Page({
duration: 2000 duration: 2000
}); });
util.request(api.GroupOnList, { page: that.data.page, size: that.data.size }).then(function (res) { util.request(api.GroupOnList, {
page: that.data.page,
size: that.data.size
}).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
...@@ -101,7 +104,7 @@ Page({ ...@@ -101,7 +104,7 @@ Page({
}); });
}, },
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;
...@@ -115,7 +118,7 @@ Page({ ...@@ -115,7 +118,7 @@ Page({
this.getTopic(); this.getTopic();
}, },
prevPage: function (event) { prevPage: function(event) {
if (this.data.page <= 1) { if (this.data.page <= 1) {
return false; return false;
} }
......
page ,.container{ page, .container {
width: 750rpx; width: 750rpx;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #f4f4f4; background: #f4f4f4;
} }
.groupon-list{
.groupon-list {
width: 750rpx; width: 750rpx;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
...@@ -74,7 +75,7 @@ page ,.container{ ...@@ -74,7 +75,7 @@ page ,.container{
.groupon-list .price { .groupon-list .price {
width: 476rpx; width: 476rpx;
display: flex; display: flex;
color: #AB956D; color: #ab956d;
line-height: 50rpx; line-height: 50rpx;
font-size: 33rpx; font-size: 33rpx;
} }
...@@ -91,14 +92,14 @@ page ,.container{ ...@@ -91,14 +92,14 @@ page ,.container{
color: #a78845; color: #a78845;
} }
.page{ .page {
width: 750rpx; width: 750rpx;
height: 108rpx; height: 108rpx;
background: #fff; background: #fff;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.page view{ .page view {
height: 108rpx; height: 108rpx;
width: 50%; width: 50%;
float: left; float: left;
...@@ -108,10 +109,10 @@ page ,.container{ ...@@ -108,10 +109,10 @@ page ,.container{
line-height: 108rpx; line-height: 108rpx;
} }
.page .prev{ .page .prev {
border-right: 1px solid #D9D9D9; border-right: 1px solid #d9d9d9;
} }
.page .disabled{ .page .disabled {
color: #ccc; color: #ccc;
} }
...@@ -18,9 +18,9 @@ Page({ ...@@ -18,9 +18,9 @@ Page({
page: 1, page: 1,
size: 100 size: 100
}, },
getBanner: function () { getBanner: function() {
let that = this; let that = this;
util.request(api.GoodsHot).then(function (res) { util.request(api.GoodsHot).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
bannerInfo: res.data.bannerInfo, bannerInfo: res.data.bannerInfo,
...@@ -28,11 +28,13 @@ Page({ ...@@ -28,11 +28,13 @@ Page({
} }
}); });
}, },
getCategoryList: function(){ getCategoryList: function() {
var that = this; var that = this;
util.request(api.GoodsFilter, { isHot: 1 }) util.request(api.GoodsFilter, {
.then(function (res) { isHot: 1
})
.then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
filterCategory: res.data.filterCategoryList, filterCategory: res.data.filterCategoryList,
...@@ -40,11 +42,18 @@ Page({ ...@@ -40,11 +42,18 @@ Page({
} }
}); });
}, },
getGoodsList: function (){ getGoodsList: function() {
var that = this; var that = this;
util.request(api.GoodsList, { isHot: true, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSort, categoryId: that.data.categoryId}) util.request(api.GoodsList, {
.then(function (res) { isHot: true,
page: that.data.page,
size: that.data.size,
order: that.data.currentSortOrder,
sort: that.data.currentSort,
categoryId: that.data.categoryId
})
.then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
goodsList: res.data.goodsList, goodsList: res.data.goodsList,
...@@ -54,27 +63,27 @@ Page({ ...@@ -54,27 +63,27 @@ Page({
}); });
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
this.getBanner(); this.getBanner();
this.getGoodsList(); this.getGoodsList();
}, },
onReady: function () { onReady: function() {
// 页面渲染完成 // 页面渲染完成
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
openSortFilter: function (event) { openSortFilter: function(event) {
let currentId = event.currentTarget.id; let currentId = event.currentTarget.id;
switch (currentId) { switch (currentId) {
case 'categoryFilter': case 'categoryFilter':
...@@ -111,7 +120,7 @@ Page({ ...@@ -111,7 +120,7 @@ Page({
this.getGoodsList(); this.getGoodsList();
} }
}, },
selectCategory: function(event){ selectCategory: function(event) {
let currentIndex = event.target.dataset.categoryIndex; let currentIndex = event.target.dataset.categoryIndex;
this.setData({ this.setData({
'categoryFilter': false, 'categoryFilter': false,
......
page{ page {
background: #f4f4f4; background: #f4f4f4;
} }
.brand-info .name{ .brand-info .name {
width: 100%; width: 100%;
height: 278rpx; height: 278rpx;
position: relative; position: relative;
} }
.brand-info .img{ .brand-info .img {
position: absolute; position: absolute;
top:0; top: 0;
left:0; left: 0;
width: 100%; width: 100%;
height: 278rpx; height: 278rpx;
} }
.brand-info .info-box{ .brand-info .info-box {
position: absolute; position: absolute;
top:0; top: 0;
left:0; left: 0;
width: 100%; width: 100%;
height: 278rpx; height: 278rpx;
text-align: center; text-align: center;
...@@ -28,18 +28,18 @@ page{ ...@@ -28,18 +28,18 @@ page{
align-items: center; align-items: center;
} }
.brand-info .info{ .brand-info .info {
display: block; display: block;
} }
.brand-info .txt{ .brand-info .txt {
display: block; display: block;
height: 40rpx; height: 40rpx;
font-size: 37.5rpx; font-size: 37.5rpx;
color: #fff; color: #fff;
} }
.brand-info .line{ .brand-info .line {
margin: 0 auto; margin: 0 auto;
margin-top: 16rpx; margin-top: 16rpx;
display: block; display: block;
...@@ -48,14 +48,14 @@ page{ ...@@ -48,14 +48,14 @@ page{
background: #fff; background: #fff;
} }
.sort{ .sort {
position: relative; position: relative;
background: #fff; background: #fff;
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
} }
.sort-box{ .sort-box {
background: #fff; background: #fff;
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
...@@ -65,42 +65,42 @@ page{ ...@@ -65,42 +65,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;
...@@ -109,7 +109,7 @@ page{ ...@@ -109,7 +109,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;
...@@ -121,12 +121,12 @@ page{ ...@@ -121,12 +121,12 @@ 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 .b{ .cate-item .b {
width: 750rpx; width: 750rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
...@@ -134,7 +134,7 @@ page{ ...@@ -134,7 +134,7 @@ page{
margin-top: 20rpx; margin-top: 20rpx;
} }
.cate-item .b .item{ .cate-item .b .item {
float: left; float: left;
background: #fff; background: #fff;
width: 375rpx; width: 375rpx;
...@@ -145,17 +145,17 @@ page{ ...@@ -145,17 +145,17 @@ page{
text-align: center; text-align: center;
} }
.cate-item .b .item-b{ .cate-item .b .item-b {
border-right: 1rpx solid #f4f4f4; border-right: 1rpx solid #f4f4f4;
} }
.cate-item .item .img{ .cate-item .item .img {
margin-top: 10rpx; margin-top: 10rpx;
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;
...@@ -167,7 +167,7 @@ page{ ...@@ -167,7 +167,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;
......
...@@ -9,20 +9,15 @@ ...@@ -9,20 +9,15 @@
} }
.m-menu { .m-menu {
/* border: 1px solid black; */
/* height: 280rpx; */
background: #fff; background: #fff;
/* padding: 0 25rpx; */
display: flex; display: flex;
/* justify-content: center; */
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
padding-bottom: 0rpx; padding-bottom: 0rpx;
padding-top: 25rpx padding-top: 25rpx;
} }
.m-menu .item { .m-menu .item {
/* border: 1px solid black; */
width: 150rpx; width: 150rpx;
height: 126rpx; height: 126rpx;
} }
...@@ -116,7 +111,7 @@ ...@@ -116,7 +111,7 @@
margin-left: 1rpx; margin-left: 1rpx;
} }
.a-brand .item-1:nth-child(2n+1){ .a-brand .item-1:nth-child(2n+1) {
margin-left: 0; margin-left: 0;
width: 374rpx; width: 374rpx;
} }
...@@ -195,7 +190,7 @@ ...@@ -195,7 +190,7 @@
.a-groupon .b .price { .a-groupon .b .price {
width: 476rpx; width: 476rpx;
display: flex; display: flex;
color: #AB956D; color: #ab956d;
line-height: 50rpx; line-height: 50rpx;
font-size: 33rpx; font-size: 33rpx;
} }
...@@ -252,7 +247,7 @@ ...@@ -252,7 +247,7 @@
text-align: center; text-align: center;
line-height: 30rpx; line-height: 30rpx;
font-size: 30rpx; font-size: 30rpx;
color: #AB956D; color: #ab956d;
} }
.a-popular { .a-popular {
...@@ -313,7 +308,7 @@ ...@@ -313,7 +308,7 @@
.a-popular .b .price { .a-popular .b .price {
width: 456rpx; width: 456rpx;
display: block; display: block;
color: #AB956D; color: #ab956d;
line-height: 50rpx; line-height: 50rpx;
font-size: 33rpx; font-size: 33rpx;
} }
...@@ -357,7 +352,7 @@ ...@@ -357,7 +352,7 @@
.a-topic .b .np .price { .a-topic .b .np .price {
margin-left: 20.8rpx; margin-left: 20.8rpx;
color: #AB956D; color: #ab956d;
} }
.a-topic .b .desc { .a-topic .b .desc {
...@@ -367,7 +362,7 @@ ...@@ -367,7 +362,7 @@
font-size: 24rpx; font-size: 24rpx;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
} }
.good-grid { .good-grid {
...@@ -403,7 +398,7 @@ ...@@ -403,7 +398,7 @@
text-align: center; text-align: center;
} }
.good-grid .b .item .a{ .good-grid .b .item .a {
height: 452rpx; height: 452rpx;
width: 100%; width: 100%;
} }
...@@ -436,7 +431,7 @@ ...@@ -436,7 +431,7 @@
height: 30rpx; height: 30rpx;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
color: #AB956D; color: #ab956d;
} }
.good-grid .t { .good-grid .t {
......
...@@ -18,9 +18,9 @@ Page({ ...@@ -18,9 +18,9 @@ Page({
page: 1, page: 1,
size: 100 size: 100
}, },
getBanner: function () { getBanner: function() {
let that = this; let that = this;
util.request(api.GoodsNew).then(function (res) { util.request(api.GoodsNew).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
bannerInfo: res.data.bannerInfo, bannerInfo: res.data.bannerInfo,
...@@ -31,8 +31,15 @@ Page({ ...@@ -31,8 +31,15 @@ Page({
getGoodsList: function() { getGoodsList: function() {
var that = this; var that = this;
util.request(api.GoodsList, { isNew: true, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSort, categoryId: that.data.categoryId }) util.request(api.GoodsList, {
.then(function (res) { isNew: true,
page: that.data.page,
size: that.data.size,
order: that.data.currentSortOrder,
sort: that.data.currentSort,
categoryId: that.data.categoryId
})
.then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
goodsList: res.data.goodsList, goodsList: res.data.goodsList,
...@@ -41,27 +48,27 @@ Page({ ...@@ -41,27 +48,27 @@ Page({
} }
}); });
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
this.getBanner(); this.getBanner();
this.getGoodsList(); this.getGoodsList();
}, },
onReady: function () { onReady: function() {
// 页面渲染完成 // 页面渲染完成
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
openSortFilter: function (event) { openSortFilter: function(event) {
let currentId = event.currentTarget.id; let currentId = event.currentTarget.id;
switch (currentId) { switch (currentId) {
case 'categoryFilter': case 'categoryFilter':
...@@ -98,7 +105,7 @@ Page({ ...@@ -98,7 +105,7 @@ Page({
this.getGoodsList(); this.getGoodsList();
} }
}, },
selectCategory: function (event) { selectCategory: function(event) {
let currentIndex = event.target.dataset.categoryIndex; let currentIndex = event.target.dataset.categoryIndex;
this.setData({ this.setData({
'categoryFilter': false, 'categoryFilter': false,
......
page{ page {
background: #f4f4f4; background: #f4f4f4;
} }
.brand-info .name{ .brand-info .name {
width: 100%; width: 100%;
height: 278rpx; height: 278rpx;
position: relative; position: relative;
} }
.brand-info .img{ .brand-info .img {
position: absolute; position: absolute;
top:0; top: 0;
left:0; left: 0;
width: 100%; width: 100%;
height: 278rpx; height: 278rpx;
} }
.brand-info .info-box{ .brand-info .info-box {
position: absolute; position: absolute;
top:0; top: 0;
left:0; left: 0;
width: 100%; width: 100%;
height: 278rpx; height: 278rpx;
text-align: center; text-align: center;
...@@ -28,18 +28,18 @@ page{ ...@@ -28,18 +28,18 @@ page{
align-items: center; align-items: center;
} }
.brand-info .info{ .brand-info .info {
display: block; display: block;
} }
.brand-info .txt{ .brand-info .txt {
display: block; display: block;
height: 40rpx; height: 40rpx;
font-size: 37.5rpx; font-size: 37.5rpx;
color: #fff; color: #fff;
} }
.brand-info .line{ .brand-info .line {
margin: 0 auto; margin: 0 auto;
margin-top: 16rpx; margin-top: 16rpx;
display: block; display: block;
...@@ -48,14 +48,14 @@ page{ ...@@ -48,14 +48,14 @@ page{
background: #fff; background: #fff;
} }
.sort{ .sort {
position: relative; position: relative;
background: #fff; background: #fff;
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
} }
.sort-box{ .sort-box {
background: #fff; background: #fff;
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
...@@ -65,42 +65,42 @@ page{ ...@@ -65,42 +65,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;
...@@ -109,7 +109,7 @@ page{ ...@@ -109,7 +109,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;
...@@ -121,12 +121,12 @@ page{ ...@@ -121,12 +121,12 @@ 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 .b{ .cate-item .b {
width: 750rpx; width: 750rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
...@@ -134,7 +134,7 @@ page{ ...@@ -134,7 +134,7 @@ page{
margin-top: 20rpx; margin-top: 20rpx;
} }
.cate-item .b .item{ .cate-item .b .item {
float: left; float: left;
background: #fff; background: #fff;
width: 375rpx; width: 375rpx;
...@@ -145,17 +145,17 @@ page{ ...@@ -145,17 +145,17 @@ page{
text-align: center; text-align: center;
} }
.cate-item .b .item-b{ .cate-item .b .item-b {
border-right: 1rpx solid #f4f4f4; border-right: 1rpx solid #f4f4f4;
} }
.cate-item .item .img{ .cate-item .item .img {
margin-top: 10rpx; margin-top: 10rpx;
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;
...@@ -167,7 +167,7 @@ page{ ...@@ -167,7 +167,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;
......
...@@ -7,25 +7,25 @@ Page({ ...@@ -7,25 +7,25 @@ Page({
status: false, status: false,
orderId: 0 orderId: 0
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
this.setData({ this.setData({
orderId: options.orderId, orderId: options.orderId,
status: options.status === '1' ? true : false status: options.status === '1' ? true : false
}) })
}, },
onReady: function () { onReady: function() {
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
...@@ -57,7 +57,7 @@ Page({ ...@@ -57,7 +57,7 @@ Page({
util.request(api.OrderPrepay, { util.request(api.OrderPrepay, {
orderId: that.data.orderId orderId: that.data.orderId
}, 'POST').then(function (res) { }, 'POST').then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
const payParam = res.data; const payParam = res.data;
console.log("支付过程开始") console.log("支付过程开始")
...@@ -67,17 +67,17 @@ Page({ ...@@ -67,17 +67,17 @@ Page({
'package': payParam.packageValue, 'package': payParam.packageValue,
'signType': payParam.signType, 'signType': payParam.signType,
'paySign': payParam.paySign, 'paySign': payParam.paySign,
'success': function (res) { 'success': function(res) {
console.log("支付过程成功") console.log("支付过程成功")
that.setData({ that.setData({
status: true status: true
}); });
}, },
'fail': function (res) { 'fail': function(res) {
console.log("支付过程失败") console.log("支付过程失败")
util.showErrorToast('支付失败'); util.showErrorToast('支付失败');
}, },
'complete': function (res) { 'complete': function(res) {
console.log("支付过程结束") console.log("支付过程结束")
} }
}); });
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<view class="error" wx:if="{{!status}}"> <view class="error" wx:if="{{!status}}">
<view class="msg">付款失败</view> <view class="msg">付款失败</view>
<view class="tips"> <view class="tips">
<view class="p">请在 <text class="time">半小时</text> 内完成付款</view> <view class="p">请在
<text class="time">半小时</text> 内完成付款</view>
<view class="p">否则订单将会被系统取消</view> <view class="p">否则订单将会被系统取消</view>
</view> </view>
<view class="btns"> <view class="btns">
......
...@@ -33,7 +33,7 @@ page { ...@@ -33,7 +33,7 @@ page {
width: 200rpx; width: 200rpx;
line-height: 78rpx; line-height: 78rpx;
border: 1px solid #868686; border: 1px solid #868686;
color: #000000; color: #000;
border-radius: 5rpx; border-radius: 5rpx;
} }
......
...@@ -21,23 +21,23 @@ Page({ ...@@ -21,23 +21,23 @@ Page({
categoryId: 0 categoryId: 0
}, },
//事件处理函数 //事件处理函数
closeSearch: function () { closeSearch: function() {
wx.navigateBack() wx.navigateBack()
}, },
clearKeyword: function () { clearKeyword: function() {
this.setData({ this.setData({
keyword: '', keyword: '',
searchStatus: false searchStatus: false
}); });
}, },
onLoad: function () { onLoad: function() {
this.getSearchKeyword(); this.getSearchKeyword();
}, },
getSearchKeyword() { getSearchKeyword() {
let that = this; let that = this;
util.request(api.SearchIndex).then(function (res) { util.request(api.SearchIndex).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
historyKeyword: res.data.historyKeywordList, historyKeyword: res.data.historyKeywordList,
...@@ -48,7 +48,7 @@ Page({ ...@@ -48,7 +48,7 @@ Page({
}); });
}, },
inputChange: function (e) { inputChange: function(e) {
this.setData({ this.setData({
keyword: e.detail.value, keyword: e.detail.value,
searchStatus: false searchStatus: false
...@@ -58,7 +58,7 @@ Page({ ...@@ -58,7 +58,7 @@ Page({
this.getHelpKeyword(); this.getHelpKeyword();
} }
}, },
getHelpKeyword: function () { getHelpKeyword: function() {
let that = this; let that = this;
util.request(api.SearchHelper, { util.request(api.SearchHelper, {
keyword: that.data.keyword keyword: that.data.keyword
...@@ -70,7 +70,7 @@ Page({ ...@@ -70,7 +70,7 @@ Page({
} }
}); });
}, },
inputFocus: function () { inputFocus: function() {
this.setData({ this.setData({
searchStatus: false, searchStatus: false,
goodsList: [] goodsList: []
...@@ -80,17 +80,17 @@ Page({ ...@@ -80,17 +80,17 @@ Page({
this.getHelpKeyword(); this.getHelpKeyword();
} }
}, },
clearHistory: function () { clearHistory: function() {
this.setData({ this.setData({
historyKeyword: [] historyKeyword: []
}) })
util.request(api.SearchClearHistory, {}, 'POST') util.request(api.SearchClearHistory, {}, 'POST')
.then(function (res) { .then(function(res) {
console.log('清除成功'); console.log('清除成功');
}); });
}, },
getGoodsList: function () { getGoodsList: function() {
let that = this; let that = this;
util.request(api.GoodsList, { util.request(api.GoodsList, {
keyword: that.data.keyword, keyword: that.data.keyword,
...@@ -113,7 +113,7 @@ Page({ ...@@ -113,7 +113,7 @@ Page({
that.getSearchKeyword(); that.getSearchKeyword();
}); });
}, },
onKeywordTap: function (event) { onKeywordTap: function(event) {
this.getSearchResult(event.target.dataset.keyword); this.getSearchResult(event.target.dataset.keyword);
......
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