diff --git a/litemall-wx/app.js b/litemall-wx/app.js
index 20f09bcd..1fb78e95 100644
--- a/litemall-wx/app.js
+++ b/litemall-wx/app.js
@@ -3,13 +3,13 @@ var api = require('./config/api.js');
var user = require('./utils/user.js');
App({
- onLaunch: function () {
+ onLaunch: function() {
const updateManager = wx.getUpdateManager();
- wx.getUpdateManager().onUpdateReady(function () {
+ wx.getUpdateManager().onUpdateReady(function() {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
- success: function (res) {
+ success: function(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
@@ -18,7 +18,7 @@ App({
})
})
},
- onShow: function (options) {
+ onShow: function(options) {
user.checkLogin().then(res => {
this.globalData.hasLogin = true;
}).catch(() => {
diff --git a/litemall-wx/app.json b/litemall-wx/app.json
index 113eb763..074dcbb2 100644
--- a/litemall-wx/app.json
+++ b/litemall-wx/app.json
@@ -1,86 +1,86 @@
{
- "pages": [
- "pages/index/index",
- "pages/catalog/catalog",
- "pages/newGoods/newGoods",
- "pages/hotGoods/hotGoods",
- "pages/ucenter/index/index",
- "pages/ucenter/address/address",
- "pages/ucenter/addressAdd/addressAdd",
- "pages/ucenter/feedback/feedback",
- "pages/ucenter/footprint/footprint",
- "pages/ucenter/order/order",
- "pages/ucenter/orderDetail/orderDetail",
- "pages/ucenter/coupon/coupon",
- "pages/ucenter/collect/collect",
- "pages/auth/login/login",
- "pages/auth/accountLogin/accountLogin",
- "pages/auth/register/register",
- "pages/auth/reset/reset",
- "pages/payResult/payResult",
- "pages/comment/comment",
- "pages/commentPost/commentPost",
- "pages/topic/topic",
- "pages/topicComment/topicComment",
- "pages/topicDetail/topicDetail",
- "pages/topicCommentPost/topicCommentPost",
- "pages/brand/brand",
- "pages/brandDetail/brandDetail",
- "pages/search/search",
- "pages/category/category",
- "pages/cart/cart",
- "pages/checkout/checkout",
- "pages/goods/goods",
- "pages/about/about",
- "pages/groupon/myGroupon/myGroupon",
- "pages/groupon/grouponDetail/grouponDetail",
- "pages/groupon/grouponList/grouponList"
- ],
- "window": {
- "navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTitleText": "litemall小程序商城",
- "enablePullDownRefresh": true,
- "navigationBarTextStyle": "black",
- "backgroundColor": "#FFFFFF",
- "backgroundTextStyle": "dark"
- },
- "tabBar": {
- "backgroundColor": "#fafafa",
- "borderStyle": "white",
- "selectedColor": "#AB956D",
- "color": "#666",
- "list": [
- {
- "pagePath": "pages/index/index",
- "iconPath": "static/images/home.png",
- "selectedIconPath": "static/images/home@selected.png",
- "text": "首页"
- },
- {
- "pagePath": "pages/catalog/catalog",
- "iconPath": "static/images/category.png",
- "selectedIconPath": "static/images/category@selected.png",
- "text": "分类"
- },
- {
- "pagePath": "pages/cart/cart",
- "iconPath": "static/images/cart.png",
- "selectedIconPath": "static/images/cart@selected.png",
- "text": "购物车"
- },
- {
- "pagePath": "pages/ucenter/index/index",
- "iconPath": "static/images/my.png",
- "selectedIconPath": "static/images/my@selected.png",
- "text": "个人"
- }
- ]
- },
- "networkTimeout": {
- "request": 10000,
- "connectSocket": 10000,
- "uploadFile": 10000,
- "downloadFile": 10000
- },
- "debug": true
+ "pages": [
+ "pages/index/index",
+ "pages/catalog/catalog",
+ "pages/newGoods/newGoods",
+ "pages/hotGoods/hotGoods",
+ "pages/ucenter/index/index",
+ "pages/ucenter/address/address",
+ "pages/ucenter/addressAdd/addressAdd",
+ "pages/ucenter/feedback/feedback",
+ "pages/ucenter/footprint/footprint",
+ "pages/ucenter/order/order",
+ "pages/ucenter/orderDetail/orderDetail",
+ "pages/ucenter/coupon/coupon",
+ "pages/ucenter/collect/collect",
+ "pages/auth/login/login",
+ "pages/auth/accountLogin/accountLogin",
+ "pages/auth/register/register",
+ "pages/auth/reset/reset",
+ "pages/payResult/payResult",
+ "pages/comment/comment",
+ "pages/commentPost/commentPost",
+ "pages/topic/topic",
+ "pages/topicComment/topicComment",
+ "pages/topicDetail/topicDetail",
+ "pages/topicCommentPost/topicCommentPost",
+ "pages/brand/brand",
+ "pages/brandDetail/brandDetail",
+ "pages/search/search",
+ "pages/category/category",
+ "pages/cart/cart",
+ "pages/checkout/checkout",
+ "pages/goods/goods",
+ "pages/about/about",
+ "pages/groupon/myGroupon/myGroupon",
+ "pages/groupon/grouponDetail/grouponDetail",
+ "pages/groupon/grouponList/grouponList"
+ ],
+ "window": {
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTitleText": "litemall小程序商城",
+ "enablePullDownRefresh": true,
+ "navigationBarTextStyle": "black",
+ "backgroundColor": "#FFFFFF",
+ "backgroundTextStyle": "dark"
+ },
+ "tabBar": {
+ "backgroundColor": "#fafafa",
+ "borderStyle": "white",
+ "selectedColor": "#AB956D",
+ "color": "#666",
+ "list": [
+ {
+ "pagePath": "pages/index/index",
+ "iconPath": "static/images/home.png",
+ "selectedIconPath": "static/images/home@selected.png",
+ "text": "首页"
+ },
+ {
+ "pagePath": "pages/catalog/catalog",
+ "iconPath": "static/images/category.png",
+ "selectedIconPath": "static/images/category@selected.png",
+ "text": "分类"
+ },
+ {
+ "pagePath": "pages/cart/cart",
+ "iconPath": "static/images/cart.png",
+ "selectedIconPath": "static/images/cart@selected.png",
+ "text": "购物车"
+ },
+ {
+ "pagePath": "pages/ucenter/index/index",
+ "iconPath": "static/images/my.png",
+ "selectedIconPath": "static/images/my@selected.png",
+ "text": "个人"
+ }
+ ]
+ },
+ "networkTimeout": {
+ "request": 10000,
+ "connectSocket": 10000,
+ "uploadFile": 10000,
+ "downloadFile": 10000
+ },
+ "debug": true
}
\ No newline at end of file
diff --git a/litemall-wx/app.wxss b/litemall-wx/app.wxss
index 3d70f731..fc5ee9e4 100644
--- a/litemall-wx/app.wxss
+++ b/litemall-wx/app.wxss
@@ -1,19 +1,19 @@
/**app.wxss**/
+
.container {
box-sizing: border-box;
background-color: #f4f4f4;
- font-family: PingFangSC-Light,helvetica,'Heiti SC';
-}
-
-view,image,text,navigator{
- box-sizing: border-box;
- padding:0;
- margin:0;
-
+ font-family: PingFangSC-Light, helvetica, 'Heiti SC';
}
-view,text{
- font-family: PingFangSC-Light,helvetica,'Heiti SC';
+view, image, text, navigator {
+ box-sizing: border-box;
+ padding: 0;
+ margin: 0;
+}
+
+view, text {
+ font-family: PingFangSC-Light, helvetica, 'Heiti SC';
font-size: 29rpx;
color: #333;
-}
\ No newline at end of file
+}
diff --git a/litemall-wx/config/api.js b/litemall-wx/config/api.js
index 2b852716..cc56d889 100644
--- a/litemall-wx/config/api.js
+++ b/litemall-wx/config/api.js
@@ -1,6 +1,6 @@
// 以下是业务服务器API地址
// 本机开发时使用
- var WxApiRoot = 'http://localhost:8080/wx/';
+var WxApiRoot = 'http://localhost:8080/wx/';
// 局域网测试使用
// var WxApiRoot = 'http://192.168.0.101:8080/wx/';
// 云平台部署时使用
@@ -9,87 +9,87 @@
// var WxApiRoot = 'https://www.menethil.com.cn/wx/';
module.exports = {
- IndexUrl: WxApiRoot + 'home/index', //首页数据接口
- CatalogList: WxApiRoot + 'catalog/index', //分类目录全部分类数据接口
- CatalogCurrent: WxApiRoot + 'catalog/current', //分类目录当前分类数据接口
+ IndexUrl: WxApiRoot + 'home/index', //首页数据接口
+ CatalogList: WxApiRoot + 'catalog/index', //分类目录全部分类数据接口
+ CatalogCurrent: WxApiRoot + 'catalog/current', //分类目录当前分类数据接口
- AuthLoginByWeixin: WxApiRoot + 'auth/login_by_weixin', //微信登录
- AuthLoginByAccount: WxApiRoot + 'auth/login', //账号登录
- AuthLogout: WxApiRoot + 'auth/logout', //账号登出
- AuthRegister: WxApiRoot + 'auth/register', //账号注册
- AuthReset: WxApiRoot + 'auth/reset', //账号密码重置
- AuthRegisterCaptcha: WxApiRoot + 'auth/regCaptcha', //验证码
- AuthBindPhone: WxApiRoot + 'auth/bindPhone', //绑定微信手机号
+ AuthLoginByWeixin: WxApiRoot + 'auth/login_by_weixin', //微信登录
+ AuthLoginByAccount: WxApiRoot + 'auth/login', //账号登录
+ AuthLogout: WxApiRoot + 'auth/logout', //账号登出
+ AuthRegister: WxApiRoot + 'auth/register', //账号注册
+ AuthReset: WxApiRoot + 'auth/reset', //账号密码重置
+ AuthRegisterCaptcha: WxApiRoot + 'auth/regCaptcha', //验证码
+ AuthBindPhone: WxApiRoot + 'auth/bindPhone', //绑定微信手机号
- GoodsCount: WxApiRoot + 'goods/count', //统计商品总数
- GoodsList: WxApiRoot + 'goods/list', //获得商品列表
- GoodsCategory: WxApiRoot + 'goods/category', //获得分类数据
- GoodsDetail: WxApiRoot + 'goods/detail', //获得商品的详情
- GoodsNew: WxApiRoot + 'goods/new', //新品
- GoodsHot: WxApiRoot + 'goods/hot', //热门
- GoodsRelated: WxApiRoot + 'goods/related', //商品详情页的关联商品(大家都在看)
+ GoodsCount: WxApiRoot + 'goods/count', //统计商品总数
+ GoodsList: WxApiRoot + 'goods/list', //获得商品列表
+ GoodsCategory: WxApiRoot + 'goods/category', //获得分类数据
+ GoodsDetail: WxApiRoot + 'goods/detail', //获得商品的详情
+ GoodsNew: WxApiRoot + 'goods/new', //新品
+ GoodsHot: WxApiRoot + 'goods/hot', //热门
+ GoodsRelated: WxApiRoot + 'goods/related', //商品详情页的关联商品(大家都在看)
- BrandList: WxApiRoot + 'brand/list', //品牌列表
- BrandDetail: WxApiRoot + 'brand/detail', //品牌详情
+ BrandList: WxApiRoot + 'brand/list', //品牌列表
+ BrandDetail: WxApiRoot + 'brand/detail', //品牌详情
- CartList: WxApiRoot + 'cart/index', //获取购物车的数据
- CartAdd: WxApiRoot + 'cart/add', // 添加商品到购物车
- CartFastAdd: WxApiRoot + 'cart/fastadd', // 立即购买商品
- CartUpdate: WxApiRoot + 'cart/update', // 更新购物车的商品
- CartDelete: WxApiRoot + 'cart/delete', // 删除购物车的商品
- CartChecked: WxApiRoot + 'cart/checked', // 选择或取消选择商品
- CartGoodsCount: WxApiRoot + 'cart/goodscount', // 获取购物车商品件数
- CartCheckout: WxApiRoot + 'cart/checkout', // 下单前信息确认
+ CartList: WxApiRoot + 'cart/index', //获取购物车的数据
+ CartAdd: WxApiRoot + 'cart/add', // 添加商品到购物车
+ CartFastAdd: WxApiRoot + 'cart/fastadd', // 立即购买商品
+ CartUpdate: WxApiRoot + 'cart/update', // 更新购物车的商品
+ CartDelete: WxApiRoot + 'cart/delete', // 删除购物车的商品
+ CartChecked: WxApiRoot + 'cart/checked', // 选择或取消选择商品
+ CartGoodsCount: WxApiRoot + 'cart/goodscount', // 获取购物车商品件数
+ CartCheckout: WxApiRoot + 'cart/checkout', // 下单前信息确认
- CollectList: WxApiRoot + 'collect/list', //收藏列表
- CollectAddOrDelete: WxApiRoot + 'collect/addordelete', //添加或取消收藏
+ CollectList: WxApiRoot + 'collect/list', //收藏列表
+ CollectAddOrDelete: WxApiRoot + 'collect/addordelete', //添加或取消收藏
- CommentList: WxApiRoot + 'comment/list', //评论列表
- CommentCount: WxApiRoot + 'comment/count', //评论总数
- CommentPost: WxApiRoot + 'comment/post', //发表评论
+ CommentList: WxApiRoot + 'comment/list', //评论列表
+ CommentCount: WxApiRoot + 'comment/count', //评论总数
+ CommentPost: WxApiRoot + 'comment/post', //发表评论
- TopicList: WxApiRoot + 'topic/list', //专题列表
- TopicDetail: WxApiRoot + 'topic/detail', //专题详情
- TopicRelated: WxApiRoot + 'topic/related', //相关专题
+ TopicList: WxApiRoot + 'topic/list', //专题列表
+ TopicDetail: WxApiRoot + 'topic/detail', //专题详情
+ TopicRelated: WxApiRoot + 'topic/related', //相关专题
- SearchIndex: WxApiRoot + 'search/index', //搜索关键字
- SearchResult: WxApiRoot + 'search/result', //搜索结果
- SearchHelper: WxApiRoot + 'search/helper', //搜索帮助
- SearchClearHistory: WxApiRoot + 'search/clearhistory', //搜索历史清楚
+ SearchIndex: WxApiRoot + 'search/index', //搜索关键字
+ SearchResult: WxApiRoot + 'search/result', //搜索结果
+ SearchHelper: WxApiRoot + 'search/helper', //搜索帮助
+ SearchClearHistory: WxApiRoot + 'search/clearhistory', //搜索历史清楚
- AddressList: WxApiRoot + 'address/list', //收货地址列表
- AddressDetail: WxApiRoot + 'address/detail', //收货地址详情
- AddressSave: WxApiRoot + 'address/save', //保存收货地址
- AddressDelete: WxApiRoot + 'address/delete', //保存收货地址
+ AddressList: WxApiRoot + 'address/list', //收货地址列表
+ AddressDetail: WxApiRoot + 'address/detail', //收货地址详情
+ AddressSave: WxApiRoot + 'address/save', //保存收货地址
+ AddressDelete: WxApiRoot + 'address/delete', //保存收货地址
- ExpressQuery: WxApiRoot + 'express/query', //物流查询
+ ExpressQuery: WxApiRoot + 'express/query', //物流查询
- RegionList: WxApiRoot + 'region/list', //获取区域列表
+ RegionList: WxApiRoot + 'region/list', //获取区域列表
- OrderSubmit: WxApiRoot + 'order/submit', // 提交订单
- OrderPrepay: WxApiRoot + 'order/prepay', // 订单的预支付会话
- OrderList: WxApiRoot + 'order/list', //订单列表
- OrderDetail: WxApiRoot + 'order/detail', //订单详情
- OrderCancel: WxApiRoot + 'order/cancel', //取消订单
- OrderRefund: WxApiRoot + 'order/refund', //退款取消订单
- OrderDelete: WxApiRoot + 'order/delete', //删除订单
- OrderConfirm: WxApiRoot + 'order/confirm', //确认收货
- OrderGoods: WxApiRoot + 'order/goods', // 代评价商品信息
- OrderComment: WxApiRoot + 'order/comment', // 评价订单商品信息
+ OrderSubmit: WxApiRoot + 'order/submit', // 提交订单
+ OrderPrepay: WxApiRoot + 'order/prepay', // 订单的预支付会话
+ OrderList: WxApiRoot + 'order/list', //订单列表
+ OrderDetail: WxApiRoot + 'order/detail', //订单详情
+ OrderCancel: WxApiRoot + 'order/cancel', //取消订单
+ OrderRefund: WxApiRoot + 'order/refund', //退款取消订单
+ OrderDelete: WxApiRoot + 'order/delete', //删除订单
+ OrderConfirm: WxApiRoot + 'order/confirm', //确认收货
+ OrderGoods: WxApiRoot + 'order/goods', // 代评价商品信息
+ OrderComment: WxApiRoot + 'order/comment', // 评价订单商品信息
- FeedbackAdd: WxApiRoot + 'feedback/submit', //添加反馈
- FootprintList: WxApiRoot + 'footprint/list', //足迹列表
- FootprintDelete: WxApiRoot + 'footprint/delete', //删除足迹
+ FeedbackAdd: WxApiRoot + 'feedback/submit', //添加反馈
+ FootprintList: WxApiRoot + 'footprint/list', //足迹列表
+ FootprintDelete: WxApiRoot + 'footprint/delete', //删除足迹
- UserFormIdCreate: WxApiRoot + 'formid/create', //用户FromId,用于发送模版消息
+ UserFormIdCreate: WxApiRoot + 'formid/create', //用户FromId,用于发送模版消息
- GroupOnList: WxApiRoot + 'groupon/list', //团购列表
- GroupOn: WxApiRoot + 'groupon/query', //团购API-查询
- GroupOnMy: WxApiRoot + 'groupon/my', //团购API-我的团购
- GroupOnDetail: WxApiRoot + 'groupon/detail', //团购API-详情
- GroupOnJoin: WxApiRoot + 'groupon/join', //团购API-详情
- StorageUpload: WxApiRoot + 'storage/upload', //图片上传,
+ GroupOnList: WxApiRoot + 'groupon/list', //团购列表
+ GroupOn: WxApiRoot + 'groupon/query', //团购API-查询
+ GroupOnMy: WxApiRoot + 'groupon/my', //团购API-我的团购
+ GroupOnDetail: WxApiRoot + 'groupon/detail', //团购API-详情
+ GroupOnJoin: WxApiRoot + 'groupon/join', //团购API-详情
+ StorageUpload: WxApiRoot + 'storage/upload', //图片上传,
- UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息
+ UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息
};
\ No newline at end of file
diff --git a/litemall-wx/pages/auth/accountLogin/accountLogin.js b/litemall-wx/pages/auth/accountLogin/accountLogin.js
index 51c6154c..959f37e2 100644
--- a/litemall-wx/pages/auth/accountLogin/accountLogin.js
+++ b/litemall-wx/pages/auth/accountLogin/accountLogin.js
@@ -10,26 +10,26 @@ Page({
code: '',
loginErrorCount: 0
},
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
},
- onReady: function () {
+ onReady: function() {
},
- onShow: function () {
+ onShow: function() {
// 页面显示
},
- onHide: function () {
+ onHide: function() {
// 页面隐藏
},
- onUnload: function () {
+ onUnload: function() {
// 页面关闭
},
- accountLogin: function () {
+ accountLogin: function() {
var that = this;
if (this.data.password.length < 1 || this.data.username.length < 1) {
@@ -51,24 +51,23 @@ Page({
header: {
'content-type': 'application/json'
},
- success: function (res) {
- if (res.data.errno == 0){
+ success: function(res) {
+ if (res.data.errno == 0) {
that.setData({
loginErrorCount: 0
});
app.globalData.hasLogin = true;
wx.setStorageSync('userInfo', res.data.data.userInfo);
wx.setStorage({
- key:"token",
+ key: "token",
data: res.data.data.token,
- success: function(){
+ success: function() {
wx.switchTab({
url: '/pages/ucenter/index/index'
});
}
});
- }
- else{
+ } else {
that.setData({
loginErrorCount: that.data.loginErrorCount + 1
});
@@ -78,25 +77,25 @@ Page({
}
});
},
- bindUsernameInput: function (e) {
+ bindUsernameInput: function(e) {
this.setData({
username: e.detail.value
});
},
- bindPasswordInput: function (e) {
+ bindPasswordInput: function(e) {
this.setData({
password: e.detail.value
});
},
- bindCodeInput: function (e) {
+ bindCodeInput: function(e) {
this.setData({
code: e.detail.value
});
},
- clearInput: function (e) {
+ clearInput: function(e) {
switch (e.currentTarget.id) {
case 'clear-username':
this.setData({
diff --git a/litemall-wx/pages/auth/login/login.js b/litemall-wx/pages/auth/login/login.js
index 9567ecae..4a0796ed 100644
--- a/litemall-wx/pages/auth/login/login.js
+++ b/litemall-wx/pages/auth/login/login.js
@@ -4,27 +4,27 @@ var user = require('../../../utils/user.js');
var app = getApp();
Page({
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
},
- onReady: function () {
+ onReady: function() {
},
- onShow: function () {
+ onShow: function() {
// 页面显示
},
- onHide: function () {
+ onHide: function() {
// 页面隐藏
},
- onUnload: function () {
+ onUnload: function() {
// 页面关闭
},
- wxLogin: function (e) {
- if (e.detail.userInfo == undefined){
+ wxLogin: function(e) {
+ if (e.detail.userInfo == undefined) {
app.globalData.hasLogin = false;
util.showErrorToast('微信登录失败');
return;
@@ -45,7 +45,9 @@ Page({
});
},
- accountLogin: function () {
- wx.navigateTo({ url: "/pages/auth/accountLogin/accountLogin" });
+ accountLogin: function() {
+ wx.navigateTo({
+ url: "/pages/auth/accountLogin/accountLogin"
+ });
}
})
\ No newline at end of file
diff --git a/litemall-wx/pages/auth/login/login.wxml b/litemall-wx/pages/auth/login/login.wxml
index 429ff36c..c2b604b0 100644
--- a/litemall-wx/pages/auth/login/login.wxml
+++ b/litemall-wx/pages/auth/login/login.wxml
@@ -1,6 +1,6 @@
-
+
-
+
\ No newline at end of file
diff --git a/litemall-wx/pages/auth/register/register.js b/litemall-wx/pages/auth/register/register.js
index 37408bc7..54453db0 100644
--- a/litemall-wx/pages/auth/register/register.js
+++ b/litemall-wx/pages/auth/register/register.js
@@ -1,4 +1,3 @@
-
var api = require('../../../config/api.js');
var check = require('../../../utils/check.js');
@@ -11,27 +10,27 @@ Page({
mobile: '',
code: ''
},
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
},
- onReady: function () {
+ onReady: function() {
},
- onShow: function () {
+ onShow: function() {
// 页面显示
},
- onHide: function () {
+ onHide: function() {
// 页面隐藏
},
- onUnload: function () {
+ onUnload: function() {
// 页面关闭
},
- sendCode: function () {
+ sendCode: function() {
let that = this;
if (this.data.mobile.length == 0) {
@@ -61,15 +60,14 @@ Page({
header: {
'content-type': 'application/json'
},
- success: function (res) {
+ success: function(res) {
if (res.data.errno == 0) {
wx.showModal({
title: '发送成功',
content: '验证码已发送',
showCancel: false
});
- }
- else {
+ } else {
wx.showModal({
title: '错误信息',
content: res.data.errmsg,
@@ -79,7 +77,7 @@ Page({
}
});
},
- requestRegister: function (wxCode) {
+ requestRegister: function(wxCode) {
let that = this;
wx.request({
url: api.AuthRegister,
@@ -94,21 +92,20 @@ Page({
header: {
'content-type': 'application/json'
},
- success: function (res) {
+ success: function(res) {
if (res.data.errno == 0) {
app.globalData.hasLogin = true;
wx.setStorageSync('userInfo', res.data.data.userInfo);
wx.setStorage({
key: "token",
data: res.data.data.token,
- success: function () {
+ success: function() {
wx.switchTab({
url: '/pages/ucenter/index/index'
});
}
});
- }
- else {
+ } else {
wx.showModal({
title: '错误信息',
content: res.data.errmsg,
@@ -118,7 +115,7 @@ Page({
}
});
},
- startRegister: function () {
+ startRegister: function() {
var that = this;
if (this.data.password.length < 6 || this.data.username.length < 6) {
@@ -156,9 +153,9 @@ Page({
});
return false;
}
-
+
wx.login({
- success: function (res) {
+ success: function(res) {
if (!res.code) {
wx.showModal({
title: '错误信息',
@@ -171,37 +168,37 @@ Page({
}
});
},
- bindUsernameInput: function (e) {
+ bindUsernameInput: function(e) {
this.setData({
username: e.detail.value
});
},
- bindPasswordInput: function (e) {
+ bindPasswordInput: function(e) {
this.setData({
password: e.detail.value
});
},
- bindConfirmPasswordInput: function (e) {
+ bindConfirmPasswordInput: function(e) {
this.setData({
confirmPassword: e.detail.value
});
},
- bindMobileInput: function (e) {
+ bindMobileInput: function(e) {
this.setData({
mobile: e.detail.value
});
},
- bindCodeInput: function (e) {
+ bindCodeInput: function(e) {
this.setData({
code: e.detail.value
});
},
- clearInput: function (e) {
+ clearInput: function(e) {
switch (e.currentTarget.id) {
case 'clear-username':
this.setData({
@@ -222,7 +219,7 @@ Page({
this.setData({
mobile: ''
});
- break;
+ break;
case 'clear-code':
this.setData({
code: ''
diff --git a/litemall-wx/pages/auth/register/register.wxml b/litemall-wx/pages/auth/register/register.wxml
index 4db893fe..06964963 100644
--- a/litemall-wx/pages/auth/register/register.wxml
+++ b/litemall-wx/pages/auth/register/register.wxml
@@ -1,35 +1,35 @@
-
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
- 获取验证码
-
-
-
+
+
+
+
+
+ 获取验证码
+
+
+
+
\ No newline at end of file
diff --git a/litemall-wx/pages/auth/register/register.wxss b/litemall-wx/pages/auth/register/register.wxss
index 965a125d..6878ce64 100644
--- a/litemall-wx/pages/auth/register/register.wxss
+++ b/litemall-wx/pages/auth/register/register.wxss
@@ -1,69 +1,69 @@
-.form-box{
- width: 100%;
- height: auto;
- overflow: hidden;
- padding: 0 40rpx;
- margin-top: 96rpx;
- background: #fff;
+.form-box {
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ padding: 0 40rpx;
+ margin-top: 96rpx;
+ background: #fff;
}
-.form-item{
- position: relative;
- background: #fff;
- height: 96rpx;
- border-bottom: 1px solid #d9d9d9;
+.form-item {
+ position: relative;
+ background: #fff;
+ height: 96rpx;
+ border-bottom: 1px solid #d9d9d9;
}
-.form-item .username, .form-item .password, .form-item .mobile, .form-item .code{
- position: absolute;
- top: 26rpx;
- left: 0;
- display: block;
- width: 100%;
- height: 44rpx;
- background: #fff;
- color: #333;
- font-size: 30rpx;
+.form-item .username, .form-item .password, .form-item .mobile, .form-item .code {
+ position: absolute;
+ top: 26rpx;
+ left: 0;
+ display: block;
+ width: 100%;
+ height: 44rpx;
+ background: #fff;
+ color: #333;
+ font-size: 30rpx;
}
-.form-item-code{
- margin-top:32rpx;
- height: auto;
- overflow: hidden;
- width: 100%;
+.form-item-code {
+ margin-top: 32rpx;
+ height: auto;
+ overflow: hidden;
+ width: 100%;
}
-.form-item-code .form-item{
- float: left;
- width: 350rpx;
+.form-item-code .form-item {
+ float: left;
+ width: 350rpx;
}
-.form-item-code .code-btn{
- float: right;
- padding: 20rpx 40rpx;
- border: 1px solid #d9d9d9;
- border-radius: 10rpx;
- color: #fff;
- background: green;
+.form-item-code .code-btn {
+ float: right;
+ padding: 20rpx 40rpx;
+ border: 1px solid #d9d9d9;
+ border-radius: 10rpx;
+ color: #fff;
+ background: green;
}
-.form-item .clear{
- position: absolute;
- top: 26rpx;
- right: 18rpx;
- z-index: 2;
- display: block;
- background: #fff;
- height: 44rpx;
- width: 44rpx;
+.form-item .clear {
+ position: absolute;
+ top: 26rpx;
+ right: 18rpx;
+ z-index: 2;
+ display: block;
+ background: #fff;
+ height: 44rpx;
+ width: 44rpx;
}
-.register-btn{
- margin: 60rpx 0 40rpx 0;
- height: 96rpx;
- line-height: 96rpx;
- color: #fff;
- font-size: 30rpx;
- width: 100%;
- border-radius: 6rpx;
-}
\ No newline at end of file
+.register-btn {
+ margin: 60rpx 0 40rpx 0;
+ height: 96rpx;
+ line-height: 96rpx;
+ color: #fff;
+ font-size: 30rpx;
+ width: 100%;
+ border-radius: 6rpx;
+}
diff --git a/litemall-wx/pages/auth/reset/reset.js b/litemall-wx/pages/auth/reset/reset.js
index 775c3a41..3b821ee2 100644
--- a/litemall-wx/pages/auth/reset/reset.js
+++ b/litemall-wx/pages/auth/reset/reset.js
@@ -9,28 +9,28 @@ Page({
password: '',
confirmPassword: ''
},
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
-
- },
- onReady: function () {
},
- onShow: function () {
+ onReady: function() {
+
+ },
+ onShow: function() {
// 页面显示
},
- onHide: function () {
+ onHide: function() {
// 页面隐藏
},
- onUnload: function () {
+ onUnload: function() {
// 页面关闭
},
- sendCode: function () {
+ sendCode: function() {
let that = this;
wx.request({
url: api.AuthRegisterCaptcha,
@@ -41,15 +41,14 @@ Page({
header: {
'content-type': 'application/json'
},
- success: function (res) {
+ success: function(res) {
if (res.data.errno == 0) {
wx.showModal({
title: '发送成功',
content: '验证码已发送',
showCancel: false
});
- }
- else {
+ } else {
wx.showModal({
title: '错误信息',
content: res.data.errmsg,
@@ -59,7 +58,7 @@ Page({
}
});
},
- startReset: function(){
+ startReset: function() {
var that = this;
if (this.data.mobile.length == 0 || this.data.code.length == 0) {
@@ -109,11 +108,10 @@ Page({
header: {
'content-type': 'application/json'
},
- success: function (res) {
+ success: function(res) {
if (res.data.errno == 0) {
wx.navigateBack();
- }
- else{
+ } else {
wx.showModal({
title: '密码重置失败',
content: res.data.errmsg,
@@ -123,32 +121,32 @@ Page({
}
});
},
- bindPasswordInput: function (e) {
+ bindPasswordInput: function(e) {
this.setData({
password: e.detail.value
});
},
- bindConfirmPasswordInput: function (e) {
+ bindConfirmPasswordInput: function(e) {
this.setData({
confirmPassword: e.detail.value
});
},
- bindMobileInput: function (e) {
+ bindMobileInput: function(e) {
this.setData({
mobile: e.detail.value
});
},
- bindCodeInput: function(e){
-
+ bindCodeInput: function(e) {
+
this.setData({
code: e.detail.value
});
},
- clearInput: function(e){
- switch (e.currentTarget.id){
+ clearInput: function(e) {
+ switch (e.currentTarget.id) {
case 'clear-password':
this.setData({
password: ''
diff --git a/litemall-wx/pages/auth/reset/reset.wxss b/litemall-wx/pages/auth/reset/reset.wxss
index 94fca0b8..4f61be72 100644
--- a/litemall-wx/pages/auth/reset/reset.wxss
+++ b/litemall-wx/pages/auth/reset/reset.wxss
@@ -1,68 +1,68 @@
-.form-box{
- width: 100%;
- height: auto;
- overflow: hidden;
- padding: 0 40rpx;
- margin-top: 96rpx;
- background: #fff;
+.form-box {
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ padding: 0 40rpx;
+ margin-top: 96rpx;
+ background: #fff;
}
-.form-item{
- position: relative;
- background: #fff;
- height: 96rpx;
- border-bottom: 1px solid #d9d9d9;
+.form-item {
+ position: relative;
+ background: #fff;
+ height: 96rpx;
+ border-bottom: 1px solid #d9d9d9;
}
-.form-item .mobile, .form-item .password, .form-item .code{
- position: absolute;
- top: 26rpx;
- left: 0;
- display: block;
- width: 100%;
- height: 44rpx;
- background: #fff;
- color: #333;
- font-size: 30rpx;
+.form-item .mobile, .form-item .password, .form-item .code {
+ position: absolute;
+ top: 26rpx;
+ left: 0;
+ display: block;
+ width: 100%;
+ height: 44rpx;
+ background: #fff;
+ color: #333;
+ font-size: 30rpx;
}
-.form-item-code{
- margin-top:32rpx;
- height: auto;
- overflow: hidden;
- width: 100%;
+.form-item-code {
+ margin-top: 32rpx;
+ height: auto;
+ overflow: hidden;
+ width: 100%;
}
-.form-item-code .form-item{
- float: left;
- width: 350rpx;
+.form-item-code .form-item {
+ float: left;
+ width: 350rpx;
}
-.form-item-code .code-btn{
- float: right;
- padding: 20rpx 40rpx;
- border: 1px solid #d9d9d9;
- border-radius: 10rpx;
+.form-item-code .code-btn {
+ float: right;
+ padding: 20rpx 40rpx;
+ border: 1px solid #d9d9d9;
+ border-radius: 10rpx;
}
-.form-item .clear{
- position: absolute;
- top: 26rpx;
- right: 18rpx;
- z-index: 2;
- display: block;
- background: #fff;
- height: 44rpx;
- width: 44rpx;
+.form-item .clear {
+ position: absolute;
+ top: 26rpx;
+ right: 18rpx;
+ z-index: 2;
+ display: block;
+ background: #fff;
+ height: 44rpx;
+ width: 44rpx;
}
-.reset-btn{
- margin: 60rpx 0 40rpx 0;
- height: 96rpx;
- line-height: 96rpx;
- color: #fff;
- font-size: 30rpx;
- width: 100%;
- background: #b4282d;
- border-radius: 6rpx;
-}
\ No newline at end of file
+.reset-btn {
+ margin: 60rpx 0 40rpx 0;
+ height: 96rpx;
+ line-height: 96rpx;
+ color: #fff;
+ font-size: 30rpx;
+ width: 100%;
+ background: #b4282d;
+ border-radius: 6rpx;
+}
diff --git a/litemall-wx/pages/brand/brand.js b/litemall-wx/pages/brand/brand.js
index 4689c9d6..7e1920bf 100644
--- a/litemall-wx/pages/brand/brand.js
+++ b/litemall-wx/pages/brand/brand.js
@@ -8,16 +8,19 @@ Page({
size: 10,
totalPages: 1
},
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
this.getBrandList();
},
- getBrandList: function () {
+ getBrandList: function() {
wx.showLoading({
title: '加载中...',
});
let that = this;
- util.request(api.BrandList, { page: that.data.page, size: that.data.size }).then(function (res) {
+ util.request(api.BrandList, {
+ page: that.data.page,
+ size: that.data.size
+ }).then(function(res) {
if (res.errno === 0) {
that.setData({
brandList: that.data.brandList.concat(res.data.brandList),
@@ -27,7 +30,7 @@ Page({
wx.hideLoading();
});
},
- onReachBottom (){
+ onReachBottom() {
if (this.data.totalPages > this.data.page) {
this.setData({
page: this.data.page + 1
@@ -38,18 +41,18 @@ Page({
this.getBrandList();
},
- onReady: function () {
+ onReady: function() {
},
- onShow: function () {
+ onShow: function() {
// 页面显示
},
- onHide: function () {
+ onHide: function() {
// 页面隐藏
},
- onUnload: function () {
+ onUnload: function() {
// 页面关闭
}
diff --git a/litemall-wx/pages/brand/brand.wxml b/litemall-wx/pages/brand/brand.wxml
index 9cce1491..ef2e2b9a 100644
--- a/litemall-wx/pages/brand/brand.wxml
+++ b/litemall-wx/pages/brand/brand.wxml
@@ -1,16 +1,16 @@
-
-
-
-
-
-
-
- {{item.name}}
- |
- {{item.floorPrice}}元起
-
-
-
-
+
+
+
+
+
+
+
+ {{item.name}}
+ |
+ {{item.floorPrice}}元起
+
+
+
+
\ No newline at end of file
diff --git a/litemall-wx/pages/brand/brand.wxss b/litemall-wx/pages/brand/brand.wxss
index 71de4d69..4fdc8c57 100644
--- a/litemall-wx/pages/brand/brand.wxss
+++ b/litemall-wx/pages/brand/brand.wxss
@@ -1,52 +1,52 @@
-.brand-list .item{
- display: block;
- width: 750rpx;
- height: 416rpx;
- position: relative;
- margin-bottom: 4rpx;
+.brand-list .item {
+ display: block;
+ width: 750rpx;
+ height: 416rpx;
+ position: relative;
+ margin-bottom: 4rpx;
}
-.brand-list .item .img-bg{
- position: absolute;
- left:0;
- top:0;
- z-index: 0;
- width: 750rpx;
- height: 417rpx;
- overflow: hidden;
+.brand-list .item .img-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 0;
+ width: 750rpx;
+ height: 417rpx;
+ overflow: hidden;
}
-.brand-list .item .img-bg image{
- width: 750rpx;
- height: 416rpx;
+.brand-list .item .img-bg image {
+ width: 750rpx;
+ height: 416rpx;
}
-.brand-list .item .txt-box{
- position: absolute;
- left:0;
- top:0;
- display: table;
- z-index: 0;
- width: 750rpx;
- height: 417rpx;
+.brand-list .item .txt-box {
+ position: absolute;
+ left: 0;
+ top: 0;
+ display: table;
+ z-index: 0;
+ width: 750rpx;
+ height: 417rpx;
}
-.brand-list .item .line{
- display: table-cell;
- vertical-align: middle;
- text-align: center;
- height: 63rpx;
- line-height: 63rpx;
+.brand-list .item .line {
+ display: table-cell;
+ vertical-align: middle;
+ text-align: center;
+ height: 63rpx;
+ line-height: 63rpx;
}
-.brand-list .item .line text{
- font-size: 35rpx;
- font-weight: 700;
- text-shadow: 1rpx 1rpx rgba(0,0,0,.32);
- color: #fff;
+.brand-list .item .line text {
+ font-size: 35rpx;
+ font-weight: 700;
+ text-shadow: 1rpx 1rpx rgba(0, 0, 0, 0.32);
+ color: #fff;
}
-.brand-list .item .line .s{
- padding: 0 10rpx;
- font-size: 40rpx;
-}
\ No newline at end of file
+.brand-list .item .line .s {
+ padding: 0 10rpx;
+ font-size: 40rpx;
+}
diff --git a/litemall-wx/pages/brandDetail/brandDetail.js b/litemall-wx/pages/brandDetail/brandDetail.js
index 7881f67c..d8222ff7 100644
--- a/litemall-wx/pages/brandDetail/brandDetail.js
+++ b/litemall-wx/pages/brandDetail/brandDetail.js
@@ -12,7 +12,7 @@ Page({
page: 1,
size: 100
},
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
var that = this;
that.setData({
@@ -20,9 +20,11 @@ Page({
});
this.getBrand();
},
- getBrand: function () {
+ getBrand: function() {
let that = this;
- util.request(api.BrandDetail, { id: that.data.id }).then(function (res) {
+ util.request(api.BrandDetail, {
+ id: that.data.id
+ }).then(function(res) {
if (res.errno === 0) {
that.setData({
brand: res.data.brand
@@ -35,8 +37,12 @@ Page({
getGoodsList() {
var that = this;
- util.request(api.GoodsList, { brandId: that.data.id, page: that.data.page, size: that.data.size})
- .then(function (res) {
+ util.request(api.GoodsList, {
+ brandId: that.data.id,
+ page: that.data.page,
+ size: that.data.size
+ })
+ .then(function(res) {
if (res.errno === 0) {
that.setData({
goodsList: res.data.goodsList
@@ -44,19 +50,19 @@ Page({
}
});
},
- onReady: function () {
+ onReady: function() {
// 页面渲染完成
},
- onShow: function () {
+ onShow: function() {
// 页面显示
},
- onHide: function () {
+ onHide: function() {
// 页面隐藏
},
- onUnload: function () {
+ onUnload: function() {
// 页面关闭
}
diff --git a/litemall-wx/pages/brandDetail/brandDetail.wxml b/litemall-wx/pages/brandDetail/brandDetail.wxml
index ba2f0c7f..bf4e9ed4 100644
--- a/litemall-wx/pages/brandDetail/brandDetail.wxml
+++ b/litemall-wx/pages/brandDetail/brandDetail.wxml
@@ -1,28 +1,28 @@
-
-
-
-
-
- {{brand.name}}
-
-
-
-
-
- {{brand.desc}}
+
+
+
+
+
+ {{brand.name}}
+
+
+
+ {{brand.desc}}
+
+
-
-
-
-
-
- {{iitem.name}}
- ¥{{iitem.retailPrice}}
-
-
-
+
+
+
+
+
+ {{iitem.name}}
+ ¥{{iitem.retailPrice}}
+
+
+
\ No newline at end of file
diff --git a/litemall-wx/pages/brandDetail/brandDetail.wxss b/litemall-wx/pages/brandDetail/brandDetail.wxss
index cb82b455..3126093f 100644
--- a/litemall-wx/pages/brandDetail/brandDetail.wxss
+++ b/litemall-wx/pages/brandDetail/brandDetail.wxss
@@ -1,65 +1,66 @@
-page{
- background: #f4f4f4;
-}
-.brand-info .name{
- width: 100%;
- height: 290rpx;
- position: relative;
+page {
+ background: #f4f4f4;
}
-.brand-info .img{
- position: absolute;
- top:0;
- left:0;
- width: 100%;
- height: 290rpx;
+.brand-info .name {
+ width: 100%;
+ height: 290rpx;
+ position: relative;
}
-.brand-info .info-box{
- position: absolute;
- top:0;
- left:0;
- width: 100%;
- height: 290rpx;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
+.brand-info .img {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 290rpx;
}
-.brand-info .info{
- display: block;
+.brand-info .info-box {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 290rpx;
+ text-align: center;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
-.brand-info .txt{
- display: block;
- height: 37.5rpx;
- font-size: 37.5rpx;
- color: #fff;
+.brand-info .info {
+ display: block;
}
-.brand-info .line{
- margin: 0 auto;
- margin-top: 16rpx;
- display: block;
- height: 2rpx;
- width: 145rpx;
- background: #fff;
+.brand-info .txt {
+ display: block;
+ height: 37.5rpx;
+ font-size: 37.5rpx;
+ color: #fff;
}
-.brand-info .desc{
- background: #fff;
- width: 100%;
- height: auto;
- overflow: hidden;
- padding: 41.5rpx 31.25rpx;
- font-size: 30rpx;
- color: #666;
- line-height: 41.5rpx;
- text-align: center;
+.brand-info .line {
+ margin: 0 auto;
+ margin-top: 16rpx;
+ display: block;
+ height: 2rpx;
+ width: 145rpx;
+ background: #fff;
}
-.cate-item .b{
+.brand-info .desc {
+ background: #fff;
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ padding: 41.5rpx 31.25rpx;
+ font-size: 30rpx;
+ color: #666;
+ line-height: 41.5rpx;
+ text-align: center;
+}
+
+.cate-item .b {
width: 750rpx;
height: auto;
overflow: hidden;
@@ -67,7 +68,7 @@ page{
margin-top: 20rpx;
}
-.cate-item .b .item{
+.cate-item .b .item {
float: left;
background: #fff;
width: 375rpx;
@@ -78,17 +79,17 @@ page{
text-align: center;
}
-.cate-item .b .item-b{
- border-right: 1rpx solid #f4f4f4;
+.cate-item .b .item-b {
+ border-right: 1rpx solid #f4f4f4;
}
-.cate-item .item .img{
- margin-top: 10rpx;
+.cate-item .item .img {
+ margin-top: 10rpx;
width: 302rpx;
height: 302rpx;
}
-.cate-item .item .name{
+.cate-item .item .name {
display: block;
width: 365.625rpx;
height: 35rpx;
@@ -100,11 +101,11 @@ page{
color: #333;
}
-.cate-item .item .price{
+.cate-item .item .price {
display: block;
width: 365.625rpx;
height: 30rpx;
text-align: center;
font-size: 30rpx;
color: #b4282d;
-}
\ No newline at end of file
+}
diff --git a/litemall-wx/pages/cart/cart.js b/litemall-wx/pages/cart/cart.js
index a5270688..65552bce 100644
--- a/litemall-wx/pages/cart/cart.js
+++ b/litemall-wx/pages/cart/cart.js
@@ -5,299 +5,299 @@ var user = require('../../utils/user.js');
var app = getApp();
Page({
- data: {
- cartGoods: [],
- cartTotal: {
- "goodsCount": 0,
- "goodsAmount": 0.00,
- "checkedGoodsCount": 0,
- "checkedGoodsAmount": 0.00
+ data: {
+ cartGoods: [],
+ cartTotal: {
+ "goodsCount": 0,
+ "goodsAmount": 0.00,
+ "checkedGoodsCount": 0,
+ "checkedGoodsAmount": 0.00
+ },
+ isEditCart: false,
+ checkedAllStatus: true,
+ editCartList: [],
+ hasLogin: false
},
- isEditCart: false,
- checkedAllStatus: true,
- editCartList: [],
- hasLogin: false
- },
- onLoad: function(options) {
- // 页面初始化 options为页面跳转所带来的参数
- },
- onReady: function() {
- // 页面渲染完成
- },
- onPullDownRefresh() {
- wx.showNavigationBarLoading() //在标题栏中显示加载
- this.getCartList();
- wx.hideNavigationBarLoading() //完成停止加载
- wx.stopPullDownRefresh() //停止下拉刷新
- },
- onShow: function() {
- // 页面显示
- if (app.globalData.hasLogin) {
- this.getCartList();
- }
-
- this.setData({
- hasLogin: app.globalData.hasLogin
- });
-
- },
- onHide: function() {
- // 页面隐藏
- },
- onUnload: function() {
- // 页面关闭
- },
- goLogin() {
- wx.navigateTo({
- url: "/pages/auth/login/login"
- });
- },
- getCartList: function() {
- let that = this;
- util.request(api.CartList).then(function(res) {
- if (res.errno === 0) {
- that.setData({
- cartGoods: res.data.cartList,
- cartTotal: res.data.cartTotal
- });
-
- that.setData({
- checkedAllStatus: that.isCheckedAll()
- });
- }
- });
- },
- isCheckedAll: function() {
- //判断购物车商品已全选
- return this.data.cartGoods.every(function(element, index, array) {
- if (element.checked == true) {
- return true;
- } else {
- return false;
- }
- });
- },
- doCheckedAll: function() {
- let checkedAll = this.isCheckedAll()
- this.setData({
- checkedAllStatus: this.isCheckedAll()
- });
- },
- checkedItem: function(event) {
- let itemIndex = event.target.dataset.itemIndex;
- let that = this;
-
- let productIds = [];
- productIds.push(that.data.cartGoods[itemIndex].productId);
- if (!this.data.isEditCart) {
- util.request(api.CartChecked, {
- productIds: productIds,
- isChecked: that.data.cartGoods[itemIndex].checked ? 0 : 1
- }, 'POST').then(function(res) {
- if (res.errno === 0) {
- that.setData({
- cartGoods: res.data.cartList,
- cartTotal: res.data.cartTotal
- });
+ onLoad: function(options) {
+ // 页面初始化 options为页面跳转所带来的参数
+ },
+ onReady: function() {
+ // 页面渲染完成
+ },
+ onPullDownRefresh() {
+ wx.showNavigationBarLoading() //在标题栏中显示加载
+ this.getCartList();
+ wx.hideNavigationBarLoading() //完成停止加载
+ wx.stopPullDownRefresh() //停止下拉刷新
+ },
+ onShow: function() {
+ // 页面显示
+ if (app.globalData.hasLogin) {
+ this.getCartList();
}
- that.setData({
- checkedAllStatus: that.isCheckedAll()
+ this.setData({
+ hasLogin: app.globalData.hasLogin
});
- });
- } else {
- //编辑状态
- let tmpCartData = this.data.cartGoods.map(function(element, index, array) {
- if (index == itemIndex) {
- element.checked = !element.checked;
+
+ },
+ onHide: function() {
+ // 页面隐藏
+ },
+ onUnload: function() {
+ // 页面关闭
+ },
+ goLogin() {
+ wx.navigateTo({
+ url: "/pages/auth/login/login"
+ });
+ },
+ getCartList: function() {
+ let that = this;
+ util.request(api.CartList).then(function(res) {
+ if (res.errno === 0) {
+ that.setData({
+ cartGoods: res.data.cartList,
+ cartTotal: res.data.cartTotal
+ });
+
+ that.setData({
+ checkedAllStatus: that.isCheckedAll()
+ });
+ }
+ });
+ },
+ isCheckedAll: function() {
+ //判断购物车商品已全选
+ return this.data.cartGoods.every(function(element, index, array) {
+ if (element.checked == true) {
+ return true;
+ } else {
+ return false;
+ }
+ });
+ },
+ doCheckedAll: function() {
+ let checkedAll = this.isCheckedAll()
+ this.setData({
+ checkedAllStatus: this.isCheckedAll()
+ });
+ },
+ checkedItem: function(event) {
+ let itemIndex = event.target.dataset.itemIndex;
+ let that = this;
+
+ let productIds = [];
+ productIds.push(that.data.cartGoods[itemIndex].productId);
+ if (!this.data.isEditCart) {
+ util.request(api.CartChecked, {
+ productIds: productIds,
+ isChecked: that.data.cartGoods[itemIndex].checked ? 0 : 1
+ }, 'POST').then(function(res) {
+ if (res.errno === 0) {
+ that.setData({
+ cartGoods: res.data.cartList,
+ cartTotal: res.data.cartTotal
+ });
+ }
+
+ that.setData({
+ checkedAllStatus: that.isCheckedAll()
+ });
+ });
+ } else {
+ //编辑状态
+ let tmpCartData = this.data.cartGoods.map(function(element, index, array) {
+ if (index == itemIndex) {
+ element.checked = !element.checked;
+ }
+
+ return element;
+ });
+
+ that.setData({
+ cartGoods: tmpCartData,
+ checkedAllStatus: that.isCheckedAll(),
+ 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
+ });
+ }
+ },
+ getCheckedGoodsCount: function() {
+ let checkedGoodsCount = 0;
+ this.data.cartGoods.forEach(function(v) {
+ if (v.checked === true) {
+ checkedGoodsCount += v.number;
+ }
+ });
+ console.log(checkedGoodsCount);
+ return checkedGoodsCount;
+ },
+ checkedAll: function() {
+ let that = this;
+
+ if (!this.data.isEditCart) {
+ var productIds = this.data.cartGoods.map(function(v) {
+ return v.productId;
+ });
+ util.request(api.CartChecked, {
+ productIds: productIds,
+ isChecked: that.isCheckedAll() ? 0 : 1
+ }, 'POST').then(function(res) {
+ if (res.errno === 0) {
+ console.log(res.data);
+ that.setData({
+ cartGoods: res.data.cartList,
+ cartTotal: res.data.cartTotal
+ });
+ }
+
+ that.setData({
+ checkedAllStatus: that.isCheckedAll()
+ });
+ });
+ } else {
+ //编辑状态
+ let checkedAllStatus = that.isCheckedAll();
+ let tmpCartData = this.data.cartGoods.map(function(v) {
+ v.checked = !checkedAllStatus;
+ return v;
+ });
+
+ that.setData({
+ cartGoods: tmpCartData,
+ checkedAllStatus: that.isCheckedAll(),
+ 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
+ });
}
- return element;
- });
-
- that.setData({
- cartGoods: tmpCartData,
- checkedAllStatus: that.isCheckedAll(),
- 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
- });
- }
- },
- getCheckedGoodsCount: function() {
- let checkedGoodsCount = 0;
- this.data.cartGoods.forEach(function(v) {
- if (v.checked === true) {
- checkedGoodsCount += v.number;
- }
- });
- console.log(checkedGoodsCount);
- return checkedGoodsCount;
- },
- checkedAll: function() {
- let that = this;
-
- if (!this.data.isEditCart) {
- var productIds = this.data.cartGoods.map(function(v) {
- return v.productId;
- });
- util.request(api.CartChecked, {
- productIds: productIds,
- isChecked: that.isCheckedAll() ? 0 : 1
- }, 'POST').then(function(res) {
- if (res.errno === 0) {
- console.log(res.data);
- that.setData({
- cartGoods: res.data.cartList,
- cartTotal: res.data.cartTotal
- });
+ },
+ editCart: function() {
+ var that = this;
+ if (this.data.isEditCart) {
+ this.getCartList();
+ this.setData({
+ isEditCart: !this.data.isEditCart
+ });
+ } else {
+ //编辑状态
+ let tmpCartList = this.data.cartGoods.map(function(v) {
+ v.checked = false;
+ return v;
+ });
+ this.setData({
+ editCartList: this.data.cartGoods,
+ cartGoods: tmpCartList,
+ isEditCart: !this.data.isEditCart,
+ checkedAllStatus: that.isCheckedAll(),
+ 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
+ });
}
- that.setData({
- checkedAllStatus: that.isCheckedAll()
- });
- });
- } else {
- //编辑状态
- let checkedAllStatus = that.isCheckedAll();
- let tmpCartData = this.data.cartGoods.map(function(v) {
- v.checked = !checkedAllStatus;
- return v;
- });
+ },
+ updateCart: function(productId, goodsId, number, id) {
+ let that = this;
- that.setData({
- cartGoods: tmpCartData,
- checkedAllStatus: that.isCheckedAll(),
- 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
- });
- }
-
- },
- editCart: function() {
- var that = this;
- if (this.data.isEditCart) {
- this.getCartList();
- this.setData({
- isEditCart: !this.data.isEditCart
- });
- } else {
- //编辑状态
- let tmpCartList = this.data.cartGoods.map(function(v) {
- v.checked = false;
- return v;
- });
- this.setData({
- editCartList: this.data.cartGoods,
- cartGoods: tmpCartList,
- isEditCart: !this.data.isEditCart,
- checkedAllStatus: that.isCheckedAll(),
- 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
- });
- }
-
- },
- updateCart: function(productId, goodsId, number, id) {
- let that = this;
-
- util.request(api.CartUpdate, {
- productId: productId,
- goodsId: goodsId,
- number: number,
- id: id
- }, 'POST').then(function(res) {
- that.setData({
- checkedAllStatus: that.isCheckedAll()
- });
- });
-
- },
- cutNumber: function(event) {
-
- let itemIndex = event.target.dataset.itemIndex;
- let cartItem = this.data.cartGoods[itemIndex];
- let number = (cartItem.number - 1 > 1) ? cartItem.number - 1 : 1;
- cartItem.number = number;
- this.setData({
- cartGoods: this.data.cartGoods
- });
- this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
- },
- addNumber: function(event) {
- let itemIndex = event.target.dataset.itemIndex;
- let cartItem = this.data.cartGoods[itemIndex];
- let number = cartItem.number + 1;
- cartItem.number = number;
- this.setData({
- cartGoods: this.data.cartGoods
- });
- this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
-
- },
- checkoutOrder: function() {
- //获取已选择的商品
- let that = this;
-
- var checkedGoods = this.data.cartGoods.filter(function(element, index, array) {
- if (element.checked == true) {
- return true;
- } else {
- return false;
- }
- });
-
- if (checkedGoods.length <= 0) {
- return false;
- }
-
- // storage中设置了cartId,则是购物车购买
- try {
- wx.setStorageSync('cartId', 0);
- wx.navigateTo({
- url: '/pages/checkout/checkout'
- })
- } catch (e) {}
-
- },
- deleteCart: function() {
- //获取已选择的商品
- let that = this;
-
- let productIds = this.data.cartGoods.filter(function(element, index, array) {
- if (element.checked == true) {
- return true;
- } else {
- return false;
- }
- });
-
- if (productIds.length <= 0) {
- return false;
- }
-
- productIds = productIds.map(function(element, index, array) {
- if (element.checked == true) {
- return element.productId;
- }
- });
-
-
- util.request(api.CartDelete, {
- productIds: productIds
- }, 'POST').then(function(res) {
- if (res.errno === 0) {
- console.log(res.data);
- let cartList = res.data.cartList.map(v => {
- v.checked = false;
- return v;
+ util.request(api.CartUpdate, {
+ productId: productId,
+ goodsId: goodsId,
+ number: number,
+ id: id
+ }, 'POST').then(function(res) {
+ that.setData({
+ checkedAllStatus: that.isCheckedAll()
+ });
});
- that.setData({
- cartGoods: cartList,
- cartTotal: res.data.cartTotal
- });
- }
+ },
+ cutNumber: function(event) {
- that.setData({
- checkedAllStatus: that.isCheckedAll()
- });
- });
- }
+ let itemIndex = event.target.dataset.itemIndex;
+ let cartItem = this.data.cartGoods[itemIndex];
+ let number = (cartItem.number - 1 > 1) ? cartItem.number - 1 : 1;
+ cartItem.number = number;
+ this.setData({
+ cartGoods: this.data.cartGoods
+ });
+ this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
+ },
+ addNumber: function(event) {
+ let itemIndex = event.target.dataset.itemIndex;
+ let cartItem = this.data.cartGoods[itemIndex];
+ let number = cartItem.number + 1;
+ cartItem.number = number;
+ this.setData({
+ cartGoods: this.data.cartGoods
+ });
+ this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
+
+ },
+ checkoutOrder: function() {
+ //获取已选择的商品
+ let that = this;
+
+ var checkedGoods = this.data.cartGoods.filter(function(element, index, array) {
+ if (element.checked == true) {
+ return true;
+ } else {
+ return false;
+ }
+ });
+
+ if (checkedGoods.length <= 0) {
+ return false;
+ }
+
+ // storage中设置了cartId,则是购物车购买
+ try {
+ wx.setStorageSync('cartId', 0);
+ wx.navigateTo({
+ url: '/pages/checkout/checkout'
+ })
+ } catch (e) {}
+
+ },
+ deleteCart: function() {
+ //获取已选择的商品
+ let that = this;
+
+ let productIds = this.data.cartGoods.filter(function(element, index, array) {
+ if (element.checked == true) {
+ return true;
+ } else {
+ return false;
+ }
+ });
+
+ if (productIds.length <= 0) {
+ return false;
+ }
+
+ productIds = productIds.map(function(element, index, array) {
+ if (element.checked == true) {
+ return element.productId;
+ }
+ });
+
+
+ util.request(api.CartDelete, {
+ productIds: productIds
+ }, 'POST').then(function(res) {
+ if (res.errno === 0) {
+ console.log(res.data);
+ let cartList = res.data.cartList.map(v => {
+ v.checked = false;
+ return v;
+ });
+
+ that.setData({
+ cartGoods: cartList,
+ cartTotal: res.data.cartTotal
+ });
+ }
+
+ that.setData({
+ checkedAllStatus: that.isCheckedAll()
+ });
+ });
+ }
})
\ No newline at end of file
diff --git a/litemall-wx/pages/cart/cart.wxml b/litemall-wx/pages/cart/cart.wxml
index ad0c9fa2..3cbaf0a6 100644
--- a/litemall-wx/pages/cart/cart.wxml
+++ b/litemall-wx/pages/cart/cart.wxml
@@ -3,7 +3,7 @@
还没有登录
-
+
diff --git a/litemall-wx/pages/cart/cart.wxss b/litemall-wx/pages/cart/cart.wxss
index 953d0302..1fae7097 100644
--- a/litemall-wx/pages/cart/cart.wxss
+++ b/litemall-wx/pages/cart/cart.wxss
@@ -449,7 +449,7 @@ page {
border-bottom-right-radius: 50rpx;
letter-spacing: 3rpx;
/* background-image: linear-gradient(to right, #ff7701 100%); */
- background-image: linear-gradient(to right, #AB956D 0%, #AB956D 100%);
+ background-image: linear-gradient(to right, #ab956d 0%, #ab956d 100%);
}
.action_btn_area .checkout {
@@ -508,7 +508,7 @@ page {
border-top-right-radius: 50rpx;
border-bottom-right-radius: 50rpx;
letter-spacing: 3rpx;
- background-image: linear-gradient(to right, #AB956D 0%, #AB956D 100%);
+ background-image: linear-gradient(to right, #ab956d 0%, #ab956d 100%);
/* background-image: linear-gradient(to right, #ff7701 0%, #fe4800 100%); */
}
diff --git a/litemall-wx/pages/catalog/catalog.js b/litemall-wx/pages/catalog/catalog.js
index 15fc5538..d7067efa 100644
--- a/litemall-wx/pages/catalog/catalog.js
+++ b/litemall-wx/pages/catalog/catalog.js
@@ -2,85 +2,85 @@ var util = require('../../utils/util.js');
var api = require('../../config/api.js');
Page({
- data: {
- categoryList: [],
- currentCategory: {},
- currentSubCategoryList: {},
- scrollLeft: 0,
- scrollTop: 0,
- goodsCount: 0,
- scrollHeight: 0
- },
- onLoad: function(options) {
- this.getCatalog();
- },
- onPullDownRefresh() {
- wx.showNavigationBarLoading() //在标题栏中显示加载
- this.getCatalog();
- wx.hideNavigationBarLoading() //完成停止加载
- wx.stopPullDownRefresh() //停止下拉刷新
- },
- getCatalog: function() {
- //CatalogList
- let that = this;
- wx.showLoading({
- title: '加载中...',
- });
- util.request(api.CatalogList).then(function(res) {
- that.setData({
- categoryList: res.data.categoryList,
- currentCategory: res.data.currentCategory,
- currentSubCategoryList: res.data.currentSubCategory
- });
- wx.hideLoading();
- });
- util.request(api.GoodsCount).then(function(res) {
- that.setData({
- goodsCount: res.data.goodsCount
- });
- });
+ data: {
+ categoryList: [],
+ currentCategory: {},
+ currentSubCategoryList: {},
+ scrollLeft: 0,
+ scrollTop: 0,
+ goodsCount: 0,
+ scrollHeight: 0
+ },
+ onLoad: function(options) {
+ this.getCatalog();
+ },
+ onPullDownRefresh() {
+ wx.showNavigationBarLoading() //在标题栏中显示加载
+ this.getCatalog();
+ wx.hideNavigationBarLoading() //完成停止加载
+ wx.stopPullDownRefresh() //停止下拉刷新
+ },
+ getCatalog: function() {
+ //CatalogList
+ let that = this;
+ wx.showLoading({
+ title: '加载中...',
+ });
+ util.request(api.CatalogList).then(function(res) {
+ that.setData({
+ categoryList: res.data.categoryList,
+ currentCategory: res.data.currentCategory,
+ currentSubCategoryList: res.data.currentSubCategory
+ });
+ wx.hideLoading();
+ });
+ util.request(api.GoodsCount).then(function(res) {
+ that.setData({
+ goodsCount: res.data.goodsCount
+ });
+ });
- },
- getCurrentCategory: function(id) {
- let that = this;
- util.request(api.CatalogCurrent, {
- id: id
- })
- .then(function(res) {
- that.setData({
- currentCategory: res.data.currentCategory,
- currentSubCategoryList: res.data.currentSubCategory
- });
- });
- },
- onReady: function() {
- // 页面渲染完成
- },
- onShow: function() {
- // 页面显示
- },
- onHide: function() {
- // 页面隐藏
- },
- onUnload: function() {
- // 页面关闭
- },
- getList: function() {
- var that = this;
- util.request(api.ApiRootUrl + 'api/catalog/' + that.data.currentCategory.catId)
- .then(function(res) {
- that.setData({
- categoryList: res.data,
- });
- });
- },
- switchCate: function(event) {
- var that = this;
- var currentTarget = event.currentTarget;
- if (this.data.currentCategory.id == event.currentTarget.dataset.id) {
- return false;
+ },
+ getCurrentCategory: function(id) {
+ let that = this;
+ util.request(api.CatalogCurrent, {
+ id: id
+ })
+ .then(function(res) {
+ that.setData({
+ currentCategory: res.data.currentCategory,
+ currentSubCategoryList: res.data.currentSubCategory
+ });
+ });
+ },
+ onReady: function() {
+ // 页面渲染完成
+ },
+ onShow: function() {
+ // 页面显示
+ },
+ onHide: function() {
+ // 页面隐藏
+ },
+ onUnload: function() {
+ // 页面关闭
+ },
+ getList: function() {
+ var that = this;
+ util.request(api.ApiRootUrl + 'api/catalog/' + that.data.currentCategory.catId)
+ .then(function(res) {
+ that.setData({
+ categoryList: res.data,
+ });
+ });
+ },
+ switchCate: function(event) {
+ var that = this;
+ var currentTarget = event.currentTarget;
+ if (this.data.currentCategory.id == event.currentTarget.dataset.id) {
+ return false;
+ }
+
+ this.getCurrentCategory(event.currentTarget.dataset.id);
}
-
- this.getCurrentCategory(event.currentTarget.dataset.id);
- }
})
\ No newline at end of file
diff --git a/litemall-wx/pages/catalog/catalog.wxml b/litemall-wx/pages/catalog/catalog.wxml
index 28bf44c8..6d1340a7 100644
--- a/litemall-wx/pages/catalog/catalog.wxml
+++ b/litemall-wx/pages/catalog/catalog.wxml
@@ -7,24 +7,24 @@
- {{item.name}}
+ {{item.name}}
-
-
- {{currentCategory.frontName}}
+
+
+ {{currentCategory.frontName}}
+
+
+
+ {{currentCategory.name}}分类
+
+
+
+
+
+ {{item.name}}
-
-
- {{currentCategory.name}}分类
-
-
-
-
-
- {{item.name}}
-
-
+
\ No newline at end of file
diff --git a/litemall-wx/pages/catalog/catalog.wxss b/litemall-wx/pages/catalog/catalog.wxss
index 887de2b9..0c8a2f1a 100644
--- a/litemall-wx/pages/catalog/catalog.wxss
+++ b/litemall-wx/pages/catalog/catalog.wxss
@@ -68,9 +68,9 @@ page {
}
.catalog .nav .item.active {
- color: #AB956D;
+ color: #ab956d;
font-size: 36rpx;
- border-left: 6rpx solid #AB956D;
+ border-left: 6rpx solid #ab956d;
}
.catalog .cate {
diff --git a/litemall-wx/pages/category/category.js b/litemall-wx/pages/category/category.js
index 2aa3196e..2a157ad5 100644
--- a/litemall-wx/pages/category/category.js
+++ b/litemall-wx/pages/category/category.js
@@ -13,7 +13,7 @@ Page({
page: 1,
size: 100
},
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
var that = this;
if (options.id) {
@@ -23,7 +23,7 @@ Page({
}
wx.getSystemInfo({
- success: function (res) {
+ success: function(res) {
that.setData({
scrollHeight: res.windowHeight
});
@@ -34,10 +34,12 @@ Page({
this.getCategoryInfo();
},
- getCategoryInfo: function () {
+ getCategoryInfo: function() {
let that = this;
- util.request(api.GoodsCategory, { id: this.data.id })
- .then(function (res) {
+ util.request(api.GoodsCategory, {
+ id: this.data.id
+ })
+ .then(function(res) {
if (res.errno == 0) {
that.setData({
@@ -75,33 +77,37 @@ Page({
} else {
//显示错误信息
}
-
+
});
},
- onReady: function () {
+ onReady: function() {
// 页面渲染完成
},
- onShow: function () {
+ onShow: function() {
// 页面显示
console.log(1);
},
- onHide: function () {
+ onHide: function() {
// 页面隐藏
},
- getGoodsList: function () {
+ getGoodsList: function() {
var that = this;
- util.request(api.GoodsList, {categoryId: that.data.id, page: that.data.page, size: that.data.size})
- .then(function (res) {
+ util.request(api.GoodsList, {
+ categoryId: that.data.id,
+ page: that.data.page,
+ size: that.data.size
+ })
+ .then(function(res) {
that.setData({
goodsList: res.data.goodsList,
});
});
},
- onUnload: function () {
+ onUnload: function() {
// 页面关闭
},
- switchCate: function (event) {
+ switchCate: function(event) {
if (this.data.id == event.currentTarget.dataset.id) {
return false;
}
diff --git a/litemall-wx/pages/category/category.wxml b/litemall-wx/pages/category/category.wxml
index b0f6d18f..4ee8b88f 100644
--- a/litemall-wx/pages/category/category.wxml
+++ b/litemall-wx/pages/category/category.wxml
@@ -1,25 +1,25 @@
-
-
-
- {{item.name}}
-
-
-
-
+
+
+
+ {{item.name}}
+
+
+
+
-
- {{currentCategory.name}}
- {{currentCategory.frontName}}
-
-
-
-
- {{iitem.name}}
- ¥{{iitem.retailPrice}}
-
-
+
+ {{currentCategory.name}}
+ {{currentCategory.frontName}}
+
+
+
+
+ {{iitem.name}}
+ ¥{{iitem.retailPrice}}
+
+
-
+
\ No newline at end of file
diff --git a/litemall-wx/pages/category/category.wxss b/litemall-wx/pages/category/category.wxss
index afa9c2e8..8a31dbda 100644
--- a/litemall-wx/pages/category/category.wxss
+++ b/litemall-wx/pages/category/category.wxss
@@ -1,81 +1,82 @@
-.container{
- background: #f9f9f9;
-}
-.cate-nav{
- position: fixed;
- left:0;
- top:0;
- z-index: 1000;
+.container {
+ background: #f9f9f9;
}
-.cate-nav-body{
- height: 84rpx;
- white-space: nowrap;
- background: #fff;
- border-top: 1px solid rgba(0,0,0,.15);
- overflow: hidden;
+.cate-nav {
+ position: fixed;
+ left: 0;
+ top: 0;
+ z-index: 1000;
}
-.cate-nav .item{
- display: inline-block;
- height: 84rpx;
- min-width: 130rpx;
- padding: 0 15rpx;
+.cate-nav-body {
+ height: 84rpx;
+ white-space: nowrap;
+ background: #fff;
+ border-top: 1px solid rgba(0, 0, 0, 0.15);
+ overflow: hidden;
}
-.cate-nav .item .name{
- display: block;
- height: 84rpx;
- padding: 0 20rpx;
- line-height: 84rpx;
- color: #333;
- font-size: 30rpx;
- width: auto;
+.cate-nav .item {
+ display: inline-block;
+ height: 84rpx;
+ min-width: 130rpx;
+ padding: 0 15rpx;
}
-.cate-nav .item.active .name{
- color: #AB956D;
- border-bottom: 2px solid #AB956D;
+.cate-nav .item .name {
+ display: block;
+ height: 84rpx;
+ padding: 0 20rpx;
+ line-height: 84rpx;
+ color: #333;
+ font-size: 30rpx;
+ width: auto;
}
-.cate-item{
- margin-top: 94rpx;
- height: auto;
- overflow: hidden;
+.cate-nav .item.active .name {
+ color: #ab956d;
+ border-bottom: 2px solid #ab956d;
}
-.cate-item .h{
- height: 145rpx;
- width: 750rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
+.cate-item {
+ margin-top: 94rpx;
+ height: auto;
+ overflow: hidden;
}
-.cate-item .h .name{
- display: block;
- height: 35rpx;
- margin-bottom: 18rpx;
- font-size: 30rpx;
- color: #333;
+.cate-item .h {
+ height: 145rpx;
+ width: 750rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
}
-.cate-item .h .desc{
- display: block;
- height: 24rpx;
- font-size: 24rpx;
- color: #999;
+.cate-item .h .name {
+ display: block;
+ height: 35rpx;
+ margin-bottom: 18rpx;
+ font-size: 30rpx;
+ color: #333;
}
-.cate-item .b{
+.cate-item .h .desc {
+ display: block;
+ height: 24rpx;
+ font-size: 24rpx;
+ color: #999;
+}
+
+.cate-item .b {
width: 750rpx;
padding: 0 6.25rpx;
height: auto;
overflow: hidden;
}
-.cate-item .b .item{
+.cate-item .b .item {
float: left;
background: #fff;
width: 365rpx;
@@ -86,16 +87,16 @@
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;
@@ -107,11 +108,11 @@
color: #333;
}
-.cate-item .item .price{
+.cate-item .item .price {
display: block;
width: 365.625rpx;
height: 30rpx;
text-align: center;
font-size: 30rpx;
- color: #AB956D;
-}
\ No newline at end of file
+ color: #ab956d;
+}
diff --git a/litemall-wx/pages/checkout/checkout.js b/litemall-wx/pages/checkout/checkout.js
index 8acab84f..1715cdab 100644
--- a/litemall-wx/pages/checkout/checkout.js
+++ b/litemall-wx/pages/checkout/checkout.js
@@ -10,174 +10,174 @@ Page({
checkedCoupon: [],
couponList: [],
goodsTotalPrice: 0.00, //商品总价
- freightPrice: 0.00, //快递费
- couponPrice: 0.00, //优惠券的价格
- grouponPrice: 0.00, //团购优惠价格
- orderTotalPrice: 0.00, //订单总价
- actualPrice: 0.00, //实际需要支付的总价
+ freightPrice: 0.00, //快递费
+ couponPrice: 0.00, //优惠券的价格
+ grouponPrice: 0.00, //团购优惠价格
+ orderTotalPrice: 0.00, //订单总价
+ actualPrice: 0.00, //实际需要支付的总价
cartId: 0,
addressId: 0,
- couponId: 0,
- message: '',
- grouponLinkId: 0, //参与的团购,如果是发起则为0
- grouponRulesId: 0 //团购规则ID
- },
- onLoad: function(options) {
- // 页面初始化 options为页面跳转所带来的参数
- },
+ couponId: 0,
+ message: '',
+ grouponLinkId: 0, //参与的团购,如果是发起则为0
+ grouponRulesId: 0 //团购规则ID
+ },
+ onLoad: function(options) {
+ // 页面初始化 options为页面跳转所带来的参数
+ },
- //获取checkou信息
- getCheckoutInfo: function() {
- let that = this;
- util.request(api.CartCheckout, {
- cartId: that.data.cartId,
- addressId: that.data.addressId,
- couponId: that.data.couponId,
- grouponRulesId: that.data.grouponRulesId
- }).then(function(res) {
- if (res.errno === 0) {
- that.setData({
- checkedGoodsList: res.data.checkedGoodsList,
- checkedAddress: res.data.checkedAddress,
- actualPrice: res.data.actualPrice,
- checkedCoupon: res.data.checkedCoupon,
- couponPrice: res.data.couponPrice,
- grouponPrice: res.data.grouponPrice,
- freightPrice: res.data.freightPrice,
- goodsTotalPrice: res.data.goodsTotalPrice,
- orderTotalPrice: res.data.orderTotalPrice,
- addressId: res.data.addressId,
- couponId: res.data.couponId,
- grouponRulesId: res.data.grouponRulesId,
- });
- }
- wx.hideLoading();
- });
- },
- selectAddress() {
- wx.navigateTo({
- url: '/pages/ucenter/address/address',
- })
- },
- bindMessageInput: function (e) {
- this.setData({
- message: e.detail.value
- });
- },
- onReady: function() {
- // 页面渲染完成
-
- },
- onShow: function() {
- // 页面显示
- wx.showLoading({
- title: '加载中...',
- });
- try {
- var cartId = wx.getStorageSync('cartId');
- if (cartId) {
- this.setData({
- 'cartId': cartId
- });
- }
-
- var addressId = wx.getStorageSync('addressId');
- if (addressId) {
- this.setData({
- 'addressId': addressId
- });
- }
-
- var couponId = wx.getStorageSync('couponId');
- if (couponId) {
- this.setData({
- 'couponId': couponId
- });
- }
-
- var grouponRulesId = wx.getStorageSync('grouponRulesId');
- if (grouponRulesId) {
- this.setData({
- 'grouponRulesId': grouponRulesId
- });
- }
-
- var grouponLinkId = wx.getStorageSync('grouponLinkId');
- if (grouponLinkId) {
- this.setData({
- 'grouponLinkId': grouponLinkId
- });
- }
- } catch (e) {
- // Do something when catch error
- console.log(e);
- }
-
- this.getCheckoutInfo();
- },
- onHide: function() {
- // 页面隐藏
-
- },
- onUnload: function() {
- // 页面关闭
-
- },
- submitOrder: function() {
- if (this.data.addressId <= 0) {
- util.showErrorToast('请选择收货地址');
- return false;
- }
- util.request(api.OrderSubmit, {
- cartId: this.data.cartId,
- addressId: this.data.addressId,
- couponId: this.data.couponId,
- message: this.data.message,
- grouponRulesId: this.data.grouponRulesId,
- grouponLinkId: this.data.grouponLinkId
- }, 'POST').then(res => {
- if (res.errno === 0) {
- const orderId = res.data.orderId;
- util.request(api.OrderPrepay, {
- orderId: orderId
- }, 'POST').then(function(res) {
- if (res.errno === 0) {
- const payParam = res.data;
- console.log("支付过程开始");
- wx.requestPayment({
- 'timeStamp': payParam.timeStamp,
- 'nonceStr': payParam.nonceStr,
- 'package': payParam.packageValue,
- 'signType': payParam.signType,
- 'paySign': payParam.paySign,
- 'success': function(res) {
- console.log("支付过程成功");
- wx.redirectTo({
- url: '/pages/payResult/payResult?status=1&orderId=' + orderId
+ //获取checkou信息
+ getCheckoutInfo: function() {
+ let that = this;
+ util.request(api.CartCheckout, {
+ cartId: that.data.cartId,
+ addressId: that.data.addressId,
+ couponId: that.data.couponId,
+ grouponRulesId: that.data.grouponRulesId
+ }).then(function(res) {
+ if (res.errno === 0) {
+ that.setData({
+ checkedGoodsList: res.data.checkedGoodsList,
+ checkedAddress: res.data.checkedAddress,
+ actualPrice: res.data.actualPrice,
+ checkedCoupon: res.data.checkedCoupon,
+ couponPrice: res.data.couponPrice,
+ grouponPrice: res.data.grouponPrice,
+ freightPrice: res.data.freightPrice,
+ goodsTotalPrice: res.data.goodsTotalPrice,
+ orderTotalPrice: res.data.orderTotalPrice,
+ addressId: res.data.addressId,
+ couponId: res.data.couponId,
+ grouponRulesId: res.data.grouponRulesId,
});
- },
- 'fail': function(res) {
- console.log("支付过程失败");
- wx.redirectTo({
- url: '/pages/payResult/payResult?status=0&orderId=' + orderId
- });
- },
- 'complete': function(res) {
- console.log("支付过程结束")
- }
- });
- } else {
- wx.redirectTo({
- url: '/pages/payResult/payResult?status=0&orderId=' + orderId
- });
- }
+ }
+ wx.hideLoading();
});
+ },
+ selectAddress() {
+ wx.navigateTo({
+ url: '/pages/ucenter/address/address',
+ })
+ },
+ bindMessageInput: function(e) {
+ this.setData({
+ message: e.detail.value
+ });
+ },
+ onReady: function() {
+ // 页面渲染完成
- } else {
- wx.redirectTo({
- url: '/pages/payResult/payResult?status=0&orderId=' + orderId
+ },
+ onShow: function() {
+ // 页面显示
+ wx.showLoading({
+ title: '加载中...',
});
- }
- });
- }
+ try {
+ var cartId = wx.getStorageSync('cartId');
+ if (cartId) {
+ this.setData({
+ 'cartId': cartId
+ });
+ }
+
+ var addressId = wx.getStorageSync('addressId');
+ if (addressId) {
+ this.setData({
+ 'addressId': addressId
+ });
+ }
+
+ var couponId = wx.getStorageSync('couponId');
+ if (couponId) {
+ this.setData({
+ 'couponId': couponId
+ });
+ }
+
+ var grouponRulesId = wx.getStorageSync('grouponRulesId');
+ if (grouponRulesId) {
+ this.setData({
+ 'grouponRulesId': grouponRulesId
+ });
+ }
+
+ var grouponLinkId = wx.getStorageSync('grouponLinkId');
+ if (grouponLinkId) {
+ this.setData({
+ 'grouponLinkId': grouponLinkId
+ });
+ }
+ } catch (e) {
+ // Do something when catch error
+ console.log(e);
+ }
+
+ this.getCheckoutInfo();
+ },
+ onHide: function() {
+ // 页面隐藏
+
+ },
+ onUnload: function() {
+ // 页面关闭
+
+ },
+ submitOrder: function() {
+ if (this.data.addressId <= 0) {
+ util.showErrorToast('请选择收货地址');
+ return false;
+ }
+ util.request(api.OrderSubmit, {
+ cartId: this.data.cartId,
+ addressId: this.data.addressId,
+ couponId: this.data.couponId,
+ message: this.data.message,
+ grouponRulesId: this.data.grouponRulesId,
+ grouponLinkId: this.data.grouponLinkId
+ }, 'POST').then(res => {
+ if (res.errno === 0) {
+ const orderId = res.data.orderId;
+ util.request(api.OrderPrepay, {
+ orderId: orderId
+ }, 'POST').then(function(res) {
+ if (res.errno === 0) {
+ const payParam = res.data;
+ console.log("支付过程开始");
+ wx.requestPayment({
+ 'timeStamp': payParam.timeStamp,
+ 'nonceStr': payParam.nonceStr,
+ 'package': payParam.packageValue,
+ 'signType': payParam.signType,
+ 'paySign': payParam.paySign,
+ 'success': function(res) {
+ console.log("支付过程成功");
+ wx.redirectTo({
+ url: '/pages/payResult/payResult?status=1&orderId=' + orderId
+ });
+ },
+ 'fail': function(res) {
+ console.log("支付过程失败");
+ wx.redirectTo({
+ url: '/pages/payResult/payResult?status=0&orderId=' + orderId
+ });
+ },
+ 'complete': function(res) {
+ console.log("支付过程结束")
+ }
+ });
+ } else {
+ wx.redirectTo({
+ url: '/pages/payResult/payResult?status=0&orderId=' + orderId
+ });
+ }
+ });
+
+ } else {
+ wx.redirectTo({
+ url: '/pages/payResult/payResult?status=0&orderId=' + orderId
+ });
+ }
+ });
+ }
});
\ No newline at end of file
diff --git a/litemall-wx/pages/checkout/checkout.wxml b/litemall-wx/pages/checkout/checkout.wxml
index 60fef79b..98dff556 100644
--- a/litemall-wx/pages/checkout/checkout.wxml
+++ b/litemall-wx/pages/checkout/checkout.wxml
@@ -1,89 +1,89 @@
-
-
-
- {{checkedAddress.name}}
- 默认
-
-
- {{checkedAddress.mobile}}
- {{checkedAddress.address}}
-
-
-
-
-
-
-
- 还没有收货地址,去添加
-
-
-
-
-
+
+
+
+ {{checkedAddress.name}}
+ 默认
+
+
+ {{checkedAddress.mobile}}
+ {{checkedAddress.address}}
+
+
+
+
+
+
+ 还没有收货地址,去添加
+
+
+
+
+
+
-
-
-
- 请选择优惠券
- {{couponList.length}}张
-
-
-
-
-
+
+
+
+ 请选择优惠券
+ {{couponList.length}}张
+
+
+
+
+
-
-
-
+
+
+
-
-
-
- 商品合计
-
-
- ¥{{goodsTotalPrice}}元
-
-
-
-
- 运费
-
-
- ¥{{freightPrice}}元
-
-
-
-
- 优惠券
-
-
- -¥{{couponPrice}}元
-
-
+
+
+
+ 商品合计
+
+
+ ¥{{goodsTotalPrice}}元
+
+
+
+ 运费
+
+
+ ¥{{freightPrice}}元
+
+
+
+
+ 优惠券
+
+
+ -¥{{couponPrice}}元
+
+
+
-
-
-
-
-
-
-
- {{item.goodsName}}
- x{{item.number}}
-
- {{item.specifications}}
- ¥{{item.price}}
-
+
+
+
+
+
+
+
+ {{item.goodsName}}
+ x{{item.number}}
+ {{item.specifications}}
+ ¥{{item.price}}
+
+
-
- 实付:¥{{actualPrice}}
- 去付款
-
+
+ 实付:¥{{actualPrice}}
+ 去付款
+
\ No newline at end of file
diff --git a/litemall-wx/pages/checkout/checkout.wxss b/litemall-wx/pages/checkout/checkout.wxss
index 9687e18b..bc6dc30b 100644
--- a/litemall-wx/pages/checkout/checkout.wxss
+++ b/litemall-wx/pages/checkout/checkout.wxss
@@ -1,313 +1,311 @@
-page{
- height: 100%;
- background: #f4f4f4;
+page {
+ height: 100%;
+ background: #f4f4f4;
}
-.address-box{
- width: 100%;
- height: 166.55rpx;
- background: 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: 62.5rpx 10.5rpx;
- margin-bottom: 20rpx;
- padding-top: 10.5rpx;
+.address-box {
+ width: 100%;
+ height: 166.55rpx;
+ background: 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: 62.5rpx 10.5rpx;
+ margin-bottom: 20rpx;
+ padding-top: 10.5rpx;
}
-.address-item{
- display: flex;
- height: 155.55rpx;
- background: #fff;
- padding: 41.6rpx 0 41.6rpx 31.25rpx;
+.address-item {
+ display: flex;
+ height: 155.55rpx;
+ background: #fff;
+ padding: 41.6rpx 0 41.6rpx 31.25rpx;
}
-.address-item.address-empty{
+.address-item.address-empty {
line-height: 75rpx;
text-align: center;
}
-.address-box .l{
- width: 125rpx;
- height: 100%;
+.address-box .l {
+ width: 125rpx;
+ height: 100%;
}
-.address-box .l .name{
- margin-left: 6.25rpx;
- margin-top: -7.25rpx;
- display: block;
- width: 125rpx;
- height: 43rpx;
- line-height: 43rpx;
- font-size: 30rpx;
- color: #333;
- margin-bottom: 5rpx;
-
+.address-box .l .name {
+ margin-left: 6.25rpx;
+ margin-top: -7.25rpx;
+ display: block;
+ width: 125rpx;
+ height: 43rpx;
+ line-height: 43rpx;
+ font-size: 30rpx;
+ color: #333;
+ margin-bottom: 5rpx;
}
-.address-box .l .default{
- margin-left: 6.25rpx;
- display: block;
- width: 62rpx;
- height: 33rpx;
- border-radius: 5rpx;
- border: 1px solid #b4282d;
- font-size: 20.5rpx;
- text-align: center;
- line-height: 29rpx;
- color: #b4282d;
+.address-box .l .default {
+ margin-left: 6.25rpx;
+ display: block;
+ width: 62rpx;
+ height: 33rpx;
+ border-radius: 5rpx;
+ border: 1px solid #b4282d;
+ font-size: 20.5rpx;
+ text-align: center;
+ line-height: 29rpx;
+ color: #b4282d;
}
-.address-box .m{
- flex: 1;
- height: 72.25rpx;
- color: #999;
+.address-box .m {
+ flex: 1;
+ height: 72.25rpx;
+ color: #999;
}
-.address-box .mobile{
- display: block;
- height: 29rpx;
- line-height: 29rpx;
- margin-bottom: 6.25rpx;
- font-size: 30rpx;
- color:#333;
+.address-box .mobile {
+ display: block;
+ height: 29rpx;
+ line-height: 29rpx;
+ margin-bottom: 6.25rpx;
+ font-size: 30rpx;
+ color: #333;
}
-.address-box .address{
- display: block;
- height: 37.5rpx;
- line-height: 37.5rpx;
- font-size: 25rpx;
- color:#666;
+.address-box .address {
+ display: block;
+ height: 37.5rpx;
+ line-height: 37.5rpx;
+ font-size: 25rpx;
+ color: #666;
}
-.address-box .r{
- width: 77rpx;
- height: 77rpx;
- display: flex;
- justify-content: center;
- align-items: center;
+.address-box .r {
+ width: 77rpx;
+ height: 77rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
-.address-box .r image{
- width: 52.078rpx;
- height: 52.078rpx;
+.address-box .r image {
+ width: 52.078rpx;
+ height: 52.078rpx;
}
-.coupon-box{
- width: 100%;
- height: auto;
- overflow: hidden;
- background: #fff;
+.coupon-box {
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ background: #fff;
}
-.coupon-box .coupon-item{
- width: 100%;
- height: 108.3rpx;
- overflow: hidden;
- background: #fff;
- display: flex;
- padding-left: 31.25rpx;
+.coupon-box .coupon-item {
+ width: 100%;
+ height: 108.3rpx;
+ overflow: hidden;
+ background: #fff;
+ display: flex;
+ padding-left: 31.25rpx;
}
-.coupon-box .l{
- flex: 1;
- height: 43rpx;
- line-height: 43rpx;
- padding-top: 35rpx;
+.coupon-box .l {
+ flex: 1;
+ height: 43rpx;
+ line-height: 43rpx;
+ padding-top: 35rpx;
}
-.coupon-box .l .name{
- float: left;
- font-size: 30rpx;
- color: #666;
+.coupon-box .l .name {
+ float: left;
+ font-size: 30rpx;
+ color: #666;
}
-.coupon-box .l .txt{
- float: right;
- font-size: 30rpx;
- color: #666;
+.coupon-box .l .txt {
+ float: right;
+ font-size: 30rpx;
+ color: #666;
}
-.coupon-box .r{
- margin-top: 15.5rpx;
- width: 77rpx;
- height: 77rpx;
- display: flex;
- justify-content: center;
- align-items: center;
+.coupon-box .r {
+ margin-top: 15.5rpx;
+ width: 77rpx;
+ height: 77rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
-.coupon-box .r image{
- width: 52.078rpx;
- height: 52.078rpx;
+.coupon-box .r image {
+ width: 52.078rpx;
+ height: 52.078rpx;
}
-.message-box{
- margin-top: 20rpx;
- width: 100%;
- height: auto;
- overflow: hidden;
- background: #fff;
+.message-box {
+ margin-top: 20rpx;
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ background: #fff;
}
-.message-box .message-item{
- height: 52.078rpx;
- overflow: hidden;
- background: #fff;
- display: flex;
- margin-left: 31.25rpx;
- padding-right: 31.25rpx;
- padding-top: 26rpx;
+.message-box .message-item {
+ height: 52.078rpx;
+ overflow: hidden;
+ background: #fff;
+ display: flex;
+ margin-left: 31.25rpx;
+ padding-right: 31.25rpx;
+ padding-top: 26rpx;
}
-.order-box{
- margin-top: 20rpx;
- width: 100%;
- height: auto;
- overflow: hidden;
- background: #fff;
+.order-box {
+ margin-top: 20rpx;
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ background: #fff;
}
-.order-box .order-item{
- height: 104.3rpx;
- overflow: hidden;
- background: #fff;
- display: flex;
- margin-left: 31.25rpx;
- padding-right: 31.25rpx;
- padding-top: 26rpx;
- border-bottom: 1px solid #d9d9d9;
+.order-box .order-item {
+ height: 104.3rpx;
+ overflow: hidden;
+ background: #fff;
+ display: flex;
+ margin-left: 31.25rpx;
+ padding-right: 31.25rpx;
+ padding-top: 26rpx;
+ border-bottom: 1px solid #d9d9d9;
}
-.order-box .order-item .l{
- float: left;
- height: 52rpx;
- width: 50%;
- line-height: 52rpx;
- overflow: hidden;
+.order-box .order-item .l {
+ float: left;
+ height: 52rpx;
+ width: 50%;
+ line-height: 52rpx;
+ overflow: hidden;
}
-.order-box .order-item .r{
- float: right;
- text-align: right;
- width: 50%;
- height: 52rpx;
- line-height: 52rpx;
- overflow: hidden;
+.order-box .order-item .r {
+ float: right;
+ text-align: right;
+ width: 50%;
+ height: 52rpx;
+ line-height: 52rpx;
+ overflow: hidden;
}
-.order-box .order-item.no-border{
- border-bottom: none;
+.order-box .order-item.no-border {
+ border-bottom: none;
}
-.goods-items{
- margin-top: 20rpx;
- width: 100%;
- height: auto;
- overflow: hidden;
- background: #fff;
- padding-left: 31.25rpx;
- margin-bottom: 120rpx;
+.goods-items {
+ margin-top: 20rpx;
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ background: #fff;
+ padding-left: 31.25rpx;
+ margin-bottom: 120rpx;
}
-.goods-items .item{
- height: 192rpx;
- padding-right: 31.25rpx;
- display: flex;
- align-items: center;
- border-bottom: 1px solid rgba(0,0,0,0.15);
+.goods-items .item {
+ height: 192rpx;
+ padding-right: 31.25rpx;
+ display: flex;
+ align-items: center;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
-.goods-items .item.no-border{
- border-bottom: none;
+.goods-items .item.no-border {
+ border-bottom: none;
}
-
-.goods-items .item:last-child{
- border-bottom: none;
+.goods-items .item:last-child {
+ border-bottom: none;
}
-.goods-items .img{
- height: 145.83rpx;
- width: 145.83rpx;
- background-color: #f4f4f4;
- margin-right: 20rpx;
+.goods-items .img {
+ height: 145.83rpx;
+ width: 145.83rpx;
+ background-color: #f4f4f4;
+ margin-right: 20rpx;
}
-.goods-items .img image{
- height: 145.83rpx;
- width: 145.83rpx;
+.goods-items .img image {
+ height: 145.83rpx;
+ width: 145.83rpx;
}
-.goods-items .info{
- flex: 1;
- height: 145.83rpx;
- padding-top: 5rpx;
+.goods-items .info {
+ flex: 1;
+ height: 145.83rpx;
+ padding-top: 5rpx;
}
-.goods-items .t{
- height: 33rpx;
- line-height: 33rpx;
- margin-bottom: 10rpx;
- overflow: hidden;
- font-size: 30rpx;
- color: #333;
+.goods-items .t {
+ height: 33rpx;
+ line-height: 33rpx;
+ margin-bottom: 10rpx;
+ overflow: hidden;
+ font-size: 30rpx;
+ color: #333;
}
-.goods-items .t .name{
- display: block;
- float: left;
+.goods-items .t .name {
+ display: block;
+ float: left;
}
-.goods-items .t .number{
- display: block;
- float: right;
- text-align: right;
+.goods-items .t .number {
+ display: block;
+ float: right;
+ text-align: right;
}
.goods-items .m {
- height: 29rpx;
- overflow: hidden;
- line-height: 29rpx;
- margin-bottom: 25rpx;
- font-size: 25rpx;
- color: #666;
+ height: 29rpx;
+ overflow: hidden;
+ line-height: 29rpx;
+ margin-bottom: 25rpx;
+ font-size: 25rpx;
+ color: #666;
}
.goods-items .b {
- height: 41rpx;
- overflow: hidden;
- line-height: 41rpx;
- font-size: 30rpx;
- color: #333;
+ height: 41rpx;
+ overflow: hidden;
+ line-height: 41rpx;
+ font-size: 30rpx;
+ color: #333;
}
-.order-total{
- position: fixed;
- left:0;
- bottom: 0;
- height: 100rpx;
- width: 100%;
- display: flex;
+.order-total {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ height: 100rpx;
+ width: 100%;
+ display: flex;
}
-.order-total .l{
- flex: 1;
- height: 100rpx;
- line-height: 100rpx;
- color: #b4282d;
- background: #fff;
- font-size: 33rpx;
- padding-left: 31.25rpx;
- border-top: 1rpx solid rgba(0,0,0,0.2);
- border-bottom: 1rpx solid rgba(0,0,0,0.2);
+.order-total .l {
+ flex: 1;
+ height: 100rpx;
+ line-height: 100rpx;
+ color: #b4282d;
+ background: #fff;
+ font-size: 33rpx;
+ padding-left: 31.25rpx;
+ border-top: 1rpx solid rgba(0, 0, 0, 0.2);
+ border-bottom: 1rpx solid rgba(0, 0, 0, 0.2);
}
-.order-total .r{
- width: 233rpx;
- height: 100rpx;
- background: #b4282d;
- border: 1px solid #b4282d;
- line-height: 100rpx;
- text-align: center;
- color: #fff;
- font-size: 30rpx;
-}
\ No newline at end of file
+.order-total .r {
+ width: 233rpx;
+ height: 100rpx;
+ background: #b4282d;
+ border: 1px solid #b4282d;
+ line-height: 100rpx;
+ text-align: center;
+ color: #fff;
+ font-size: 30rpx;
+}
diff --git a/litemall-wx/pages/comment/comment.js b/litemall-wx/pages/comment/comment.js
index a0f2d019..688eb4f2 100644
--- a/litemall-wx/pages/comment/comment.js
+++ b/litemall-wx/pages/comment/comment.js
@@ -16,9 +16,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({
allCount: res.data.allCount,
@@ -27,15 +30,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) {
@@ -54,7 +57,7 @@ Page({
}
});
},
- onLoad: function (options) {
+ onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
this.setData({
type: options.type,
@@ -63,23 +66,23 @@ 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() {
let that = this;
if (that.data.showType == 0) {
that.setData({
@@ -98,16 +101,16 @@ Page({
}
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) {
diff --git a/litemall-wx/pages/comment/comment.wxml b/litemall-wx/pages/comment/comment.wxml
index 8e4a8464..dfc28bb9 100644
--- a/litemall-wx/pages/comment/comment.wxml
+++ b/litemall-wx/pages/comment/comment.wxml
@@ -1,12 +1,12 @@