From 64f04a10e18864bb63b93584371066eae44fa0ff Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Thu, 19 Jul 2018 10:48:12 +0800 Subject: [PATCH] =?UTF-8?q?chore[litemall-core]:=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/aliyun.properties | 2 +- litemall-wx/app.json | 4 +- .../pages/about/{index.js => about.js} | 8 +- .../pages/about/{index.json => about.json} | 0 .../pages/about/{index.wxml => about.wxml} | 0 .../pages/about/{index.wxss => about.wxss} | 2 +- litemall-wx/pages/goods/goods.js | 169 +++++++++--------- litemall-wx/pages/goods/goods.wxml | 6 +- litemall-wx/pages/goods/goods.wxss | 99 +++++----- litemall-wx/pages/index/index.js | 4 +- litemall-wx/pages/ucenter/index/index.js | 95 +++++----- litemall-wx/project.config.json | 19 +- 12 files changed, 199 insertions(+), 209 deletions(-) rename litemall-wx/pages/about/{index.js => about.js} (89%) rename litemall-wx/pages/about/{index.json => about.json} (100%) rename litemall-wx/pages/about/{index.wxml => about.wxml} (100%) rename litemall-wx/pages/about/{index.wxss => about.wxss} (97%) diff --git a/litemall-os-api/src/main/resources/aliyun.properties b/litemall-os-api/src/main/resources/aliyun.properties index 18eebadb..9e734940 100644 --- a/litemall-os-api/src/main/resources/aliyun.properties +++ b/litemall-os-api/src/main/resources/aliyun.properties @@ -1,4 +1,4 @@ -# 阿里云对象存储配置信息 +# 闃块噷浜戝璞″瓨鍌ㄩ厤缃俊鎭 aliyun.os.ENDPOINT=oss-cn-shenzhen.aliyuncs.com aliyun.os.ACCESS_KEY_ID= aliyun.os.ACCESS_KEY_SECRET= diff --git a/litemall-wx/app.json b/litemall-wx/app.json index 59b59c90..7b1af09b 100644 --- a/litemall-wx/app.json +++ b/litemall-wx/app.json @@ -13,7 +13,7 @@ "pages/ucenter/coupon/coupon", "pages/ucenter/collect/collect", "pages/auth/login/login", - "pages/auth/accountLogin/accountLogin", + "pages/auth/accountLogin/accountLogin", "pages/auth/register/register", "pages/auth/reset/reset", "pages/payResult/payResult", @@ -32,7 +32,7 @@ "pages/shopping/address/address", "pages/shopping/addressAdd/addressAdd", "pages/goods/goods", - "pages/about/index" + "pages/about/about" ], "window": { "navigationBarTitleText": "litemall灏忕▼搴忓晢鍩", diff --git a/litemall-wx/pages/about/index.js b/litemall-wx/pages/about/about.js similarity index 89% rename from litemall-wx/pages/about/index.js rename to litemall-wx/pages/about/about.js index e246322c..328ca13c 100644 --- a/litemall-wx/pages/about/index.js +++ b/litemall-wx/pages/about/about.js @@ -1,4 +1,4 @@ -// index.js +// about.js var app = getApp() var util = require("../../utils/util.js"); @@ -14,9 +14,9 @@ Page({ shopInfo: { name: 'litemall', address: 'https://github.com/linlinjava/litemall', - latitude: 22.60, - longitude: 116.87, - linkPhone: '0755-xxxx-xxxx', + latitude: 31.201900, + longitude: 121.587839, + linkPhone: '021-xxxx-xxxx', qqNumber: '738696120' }, }, diff --git a/litemall-wx/pages/about/index.json b/litemall-wx/pages/about/about.json similarity index 100% rename from litemall-wx/pages/about/index.json rename to litemall-wx/pages/about/about.json diff --git a/litemall-wx/pages/about/index.wxml b/litemall-wx/pages/about/about.wxml similarity index 100% rename from litemall-wx/pages/about/index.wxml rename to litemall-wx/pages/about/about.wxml diff --git a/litemall-wx/pages/about/index.wxss b/litemall-wx/pages/about/about.wxss similarity index 97% rename from litemall-wx/pages/about/index.wxss rename to litemall-wx/pages/about/about.wxss index 1ea5b4e0..9a671e65 100644 --- a/litemall-wx/pages/about/index.wxss +++ b/litemall-wx/pages/about/about.wxss @@ -1,4 +1,4 @@ -/* index.wxss */ +/* about.wxss */ page{ height: 100%; diff --git a/litemall-wx/pages/goods/goods.js b/litemall-wx/pages/goods/goods.js index 8db99aad..532a11bd 100644 --- a/litemall-wx/pages/goods/goods.js +++ b/litemall-wx/pages/goods/goods.js @@ -24,12 +24,14 @@ Page({ openAttr: false, noCollectImage: '/static/images/icon_collect.png', hasCollectImage: '/static/images/icon_collect_checked.png', - collectBackImage: '/static/images/icon_collect.png', + collectImage: '/static/images/icon_collect.png', soldout: false }, - getGoodsInfo: function () { + getGoodsInfo: function() { let that = this; - util.request(api.GoodsDetail, { id: that.data.id }).then(function (res) { + util.request(api.GoodsDetail, { + id: that.data.id + }).then(function(res) { if (res.errno === 0) { let _specificationList = res.data.specificationList @@ -67,11 +69,11 @@ Page({ if (res.data.userHasCollect == 1) { that.setData({ - collectBackImage: that.data.hasCollectImage + collectImage: that.data.hasCollectImage }); } else { that.setData({ - collectBackImage: that.data.noCollectImage + collectImage: that.data.noCollectImage }); } @@ -82,9 +84,11 @@ Page({ }); }, - getGoodsRelated: function () { + getGoodsRelated: function() { let that = this; - util.request(api.GoodsRelated, { id: that.data.id }).then(function (res) { + util.request(api.GoodsRelated, { + id: that.data.id + }).then(function(res) { if (res.errno === 0) { that.setData({ relatedGoods: res.data.goodsList, @@ -93,7 +97,7 @@ Page({ }); }, - clickSkuValue: function (event) { + clickSkuValue: function(event) { let that = this; let specName = event.currentTarget.dataset.name; let specValueId = event.currentTarget.dataset.valueId; @@ -127,7 +131,7 @@ Page({ //閲嶆柊璁$畻鍝簺鍊间笉鍙互鐐瑰嚮 }, //鑾峰彇閫変腑鐨勮鏍间俊鎭 - getCheckedSpecValue: function () { + getCheckedSpecValue: function() { let checkedValues = []; let _specificationList = this.data.specificationList; for (let i = 0; i < _specificationList.length; i++) { @@ -148,35 +152,35 @@ Page({ return checkedValues; }, //鏍规嵁宸查夌殑鍊硷紝璁$畻鍏跺畠鍊肩殑鐘舵 - setSpecValueStatus: function () { + setSpecValueStatus: function() { }, //鍒ゆ柇瑙勬牸鏄惁閫夋嫨瀹屾暣 - isCheckedAllSpec: function () { - return !this.getCheckedSpecValue().some(function (v) { + isCheckedAllSpec: function() { + return !this.getCheckedSpecValue().some(function(v) { if (v.valueId == 0) { return true; } }); }, - getCheckedSpecKey: function () { - let checkedValue = this.getCheckedSpecValue().map(function (v) { + getCheckedSpecKey: function() { + let checkedValue = this.getCheckedSpecValue().map(function(v) { return v.valueText; }); return checkedValue; }, - changeSpecInfo: function () { + changeSpecInfo: function() { let checkedNameValue = this.getCheckedSpecValue(); //璁剧疆閫夋嫨鐨勪俊鎭 - let checkedValue = checkedNameValue.filter(function (v) { + let checkedValue = checkedNameValue.filter(function(v) { if (v.valueId != 0) { return true; } else { return false; } - }).map(function (v) { + }).map(function(v) { return v.valueText; }); if (checkedValue.length > 0) { @@ -211,16 +215,14 @@ Page({ checkedSpecPrice: checkedProduct.price, soldout: false }); - } - else { + } else { this.setData({ checkedSpecPrice: this.data.goods.retailPrice, soldout: true }); } - } - else { + } else { this.setData({ checkedSpecText: '瑙勬牸鏁伴噺閫夋嫨', checkedSpecPrice: this.data.goods.retailPrice, @@ -229,8 +231,8 @@ Page({ } }, - getCheckedProductItem: function (key) { - return this.data.productList.filter(function (v) { + getCheckedProductItem: function(key) { + return this.data.productList.filter(function(v) { if (v.specifications.toString() == key.toString()) { return true; } else { @@ -238,21 +240,21 @@ Page({ } }); }, - onLoad: function (options) { + onLoad: function(options) { // 椤甸潰鍒濆鍖 options涓洪〉闈㈣烦杞墍甯︽潵鐨勫弬鏁 this.setData({ id: parseInt(options.id) }); this.getGoodsInfo(); }, - onReady: function () { + onReady: function() { // 椤甸潰娓叉煋瀹屾垚 }, - onShow: function () { + onShow: function() { // 椤甸潰鏄剧ず var that = this; - util.request(api.CartGoodsCount).then(function (res) { + util.request(api.CartGoodsCount).then(function(res) { if (res.errno === 0) { that.setData({ cartGoodsCount: res.data @@ -260,79 +262,68 @@ Page({ } }); }, - onHide: function () { + onHide: function() { // 椤甸潰闅愯棌 }, - onUnload: function () { + onUnload: function() { // 椤甸潰鍏抽棴 }, - switchAttrPop: function () { + switchAttrPop: function() { if (this.data.openAttr == false) { this.setData({ - openAttr: !this.data.openAttr, - collectBackImage: '/static/images/detail_back.png' + openAttr: !this.data.openAttr }); } }, - closeAttr: function () { + closeAttr: function() { this.setData({ openAttr: false, }); }, - addCollectOrNot: function () { + addCollectOrNot: function() { let that = this; - // if (this.data.openAttr) { - // this.setData({ - // openAttr: false, - // }); - // if (that.data.userHasCollect == 1) { - // that.setData({ - // collectBackImage: that.data.hasCollectImage - // }); - // } else { - // that.setData({ - // collectBackImage: that.data.noCollectImage - // }); - // } - // } else { - //娣诲姞鎴栨槸鍙栨秷鏀惰棌 - util.request(api.CollectAddOrDelete, { type: 0, valueId: this.data.id }, "POST") - .then(function (res) { - let _res = res; - if (_res.errno == 0) { - if (_res.data.type == 'add') { - that.setData({ - collectBackImage: that.data.hasCollectImage - }); - } else { - that.setData({ - collectBackImage: that.data.noCollectImage - }); - } - + //娣诲姞鎴栨槸鍙栨秷鏀惰棌 + util.request(api.CollectAddOrDelete, { + type: 0, + valueId: this.data.id + }, "POST") + .then(function(res) { + let _res = res; + if (_res.errno == 0) { + if (_res.data.type == 'add') { + that.setData({ + collectImage: that.data.hasCollectImage + }); } else { - wx.showToast({ - image: '/static/images/icon_error.png', - title: _res.errmsg, - mask: true + that.setData({ + collectImage: that.data.noCollectImage }); } - }); + } else { + wx.showToast({ + image: '/static/images/icon_error.png', + title: _res.errmsg, + mask: true + }); + } + + }); }, - openCartPage: function () { - wx.switchTab({ url: '/pages/cart/cart' }); + openCartPage: function() { + wx.switchTab({ + url: '/pages/cart/cart' + }); }, - addFast: function () { + addFast: function() { var that = this; if (this.data.openAttr == false) { //鎵撳紑瑙勬牸閫夋嫨绐楀彛 this.setData({ - openAttr: !this.data.openAttr, - collectBackImage: '/static/images/detail_back.png' + openAttr: !this.data.openAttr }); } else { @@ -367,8 +358,12 @@ Page({ } //绔嬪嵆璐拱 - util.request(api.CartFastAdd, { goodsId: this.data.goods.id, number: this.data.number, productId: checkedProduct.id }, "POST") - .then(function (res) { + util.request(api.CartFastAdd, { + goodsId: this.data.goods.id, + number: this.data.number, + productId: checkedProduct.id + }, "POST") + .then(function(res) { if (res.errno == 0) { // 濡傛灉storage涓缃簡cartId锛屽垯鏄珛鍗宠喘涔帮紝鍚﹀垯鏄喘鐗╄溅璐拱 @@ -377,8 +372,7 @@ Page({ wx.navigateTo({ url: '/pages/shopping/checkout/checkout' }) - } catch (e) { - } + } catch (e) {} } else { wx.showToast({ @@ -392,13 +386,12 @@ Page({ }, - addToCart: function () { + addToCart: function() { var that = this; if (this.data.openAttr == false) { //鎵撳紑瑙勬牸閫夋嫨绐楀彛 this.setData({ - openAttr: !this.data.openAttr, - // collectBackImage: '/static/images/detail_back.png' + openAttr: !this.data.openAttr }); } else { @@ -433,8 +426,12 @@ Page({ } //娣诲姞鍒拌喘鐗╄溅 - util.request(api.CartAdd, { goodsId: this.data.goods.id, number: this.data.number, productId: checkedProduct.id }, "POST") - .then(function (res) { + util.request(api.CartAdd, { + goodsId: this.data.goods.id, + number: this.data.number, + productId: checkedProduct.id + }, "POST") + .then(function(res) { let _res = res; if (_res.errno == 0) { wx.showToast({ @@ -446,11 +443,11 @@ Page({ }); if (that.data.userHasCollect == 1) { that.setData({ - collectBackImage: that.data.hasCollectImage + collectImage: that.data.hasCollectImage }); } else { that.setData({ - collectBackImage: that.data.noCollectImage + collectImage: that.data.noCollectImage }); } } else { @@ -465,12 +462,12 @@ Page({ } }, - cutNumber: function () { + cutNumber: function() { this.setData({ number: (this.data.number - 1 > 1) ? this.data.number - 1 : 1 }); }, - addNumber: function () { + addNumber: function() { this.setData({ number: this.data.number + 1 }); diff --git a/litemall-wx/pages/goods/goods.wxml b/litemall-wx/pages/goods/goods.wxml index 940bad35..45e8411a 100644 --- a/litemall-wx/pages/goods/goods.wxml +++ b/litemall-wx/pages/goods/goods.wxml @@ -111,7 +111,7 @@ 浠锋牸锛氾骏{{checkedSpecPrice}} - 宸查夋嫨锛歿{checkedSpecText}} + {{tmpSpecText}} @@ -119,7 +119,7 @@ {{item.name}} - {{vitem.value}} + {{vitem.value}} @@ -140,7 +140,7 @@ - + diff --git a/litemall-wx/pages/goods/goods.wxss b/litemall-wx/pages/goods/goods.wxss index a3743fd0..0e7f80c4 100644 --- a/litemall-wx/pages/goods/goods.wxss +++ b/litemall-wx/pages/goods/goods.wxss @@ -524,9 +524,10 @@ text-align: center; width: 90rpx; } + .bottom-btn .l.l-kefu { position: relative; - height:54rpx; + height: 54rpx; width: 63rpx; } @@ -534,7 +535,6 @@ position: relative; height: 60rpx; width: 60rpx; - } .bottom-btn .l.l-cart .cart-count { @@ -572,7 +572,8 @@ line-height: 28rpx; border-radius: 50%; } -.bottom-btn .l.l-kefu .icon{ + +.bottom-btn .l.l-kefu .icon { position: absolute; top: 10rpx; left: 0; @@ -584,36 +585,34 @@ width: 44rpx; } -.bottom-btn .c{ - float: left; - background: #f48f18; - height: 100rpx; - line-height: 96rpx; - flex: 1; - text-align: center; - color: #fff; - /* border-top: 2px solid #f4f4f4; */ - /* border-bottom: 2px solid #f4f4f4; */ +.bottom-btn .c { + float: left; + background: #f48f18; + height: 100rpx; + line-height: 96rpx; + flex: 1; + text-align: center; + color: #fff; + /* border-top: 2px solid #f4f4f4; *//* border-bottom: 2px solid #f4f4f4; */ } -.bottom-btn .r{ - border:1px solid #b4282d; - background: #b4282d; - float: left; - height: 100rpx; - line-height: 96rpx; - flex: 1; - text-align: center; - color: #fff; +.bottom-btn .r { + border: 1px solid #b4282d; + background: #b4282d; + float: left; + height: 100rpx; + line-height: 96rpx; + flex: 1; + text-align: center; + color: #fff; } - @import "../../lib/wxParse/wxParse.wxss"; .attr-pop-box { width: 100%; height: 100%; position: fixed; - background: rgba(0, 0, 0, .5); + background: rgba(0, 0, 0, 0.5); z-index: 8; bottom: 0; /* display: none; */ @@ -754,48 +753,32 @@ line-height: 65rpx; } -.contact{ - - height: 100rpx; - - width: 100rpx; - - background-color: #008000; - - border-radius: 100%; - - position: fixed; - - bottom: 150rpx; - - right: 20rpx; - - display: flex; - - align-items: center; - - justify-content: center; - - z-index: 9; - +.contact { + height: 100rpx; + width: 100rpx; + background-color: #008000; + border-radius: 100%; + position: fixed; + bottom: 150rpx; + right: 20rpx; + display: flex; + align-items: center; + justify-content: center; + z-index: 9; flex-direction: column; - /*line-height: 100rpx; text-align: center; padding-top: 26rpx;*/ font-size: 20rpx; color: #008000; box-sizing: border-box; - background: url("https://litemall.oss-cn-shenzhen.aliyuncs.com/kefu.png") no-repeat center 21rpx; + background: url("https://litemall.oss-cn-shenzhen.aliyuncs.com/kefu.png") no-repeat center 21rpx; background-size: 55rpx auto; } -.contact .name{ - - font-size: 32rpx; - - max-width: 80rpx; - - color: #fff; - text-align: center; +.contact .name { + font-size: 32rpx; + max-width: 80rpx; + color: #fff; + text-align: center; } diff --git a/litemall-wx/pages/index/index.js b/litemall-wx/pages/index/index.js index 26817293..59fed36d 100644 --- a/litemall-wx/pages/index/index.js +++ b/litemall-wx/pages/index/index.js @@ -16,8 +16,8 @@ Page({ }, onShareAppMessage: function () { return { - title: 'litemall灏忓晢鍦', - desc: '浠跨綉鏄撲弗閫夊井淇″皬绋嬪簭鍟嗗煄', + title: 'litemall灏忕▼搴忓晢鍦', + desc: '寮婧愬井淇″皬绋嬪簭鍟嗗煄', path: '/pages/index/index' } }, diff --git a/litemall-wx/pages/ucenter/index/index.js b/litemall-wx/pages/ucenter/index/index.js index c51759b8..e77a9f4d 100644 --- a/litemall-wx/pages/ucenter/index/index.js +++ b/litemall-wx/pages/ucenter/index/index.js @@ -10,16 +10,16 @@ Page({ avatarUrl: 'http://yanxuan.nosdn.127.net/8945ae63d940cc42406c3f67019c5cb6.png' } }, - onLoad: function (options) { + onLoad: function(options) { // 椤甸潰鍒濆鍖 options涓洪〉闈㈣烦杞墍甯︽潵鐨勫弬鏁 }, - onReady: function () { + onReady: function() { }, - onShow: function () { + onShow: function() { //鑾峰彇鐢ㄦ埛鐨勭櫥褰曚俊鎭 - if (app.globalData.hasLogin){ + if (app.globalData.hasLogin) { let userInfo = wx.getStorageSync('userInfo'); this.setData({ userInfo: userInfo, @@ -27,82 +27,87 @@ Page({ } }, - onHide: function () { + onHide: function() { // 椤甸潰闅愯棌 }, - onUnload: function () { + onUnload: function() { // 椤甸潰鍏抽棴 }, - goLogin(){ + goLogin() { if (!app.globalData.hasLogin) { - wx.navigateTo({ url: "/pages/auth/login/login" }); + wx.navigateTo({ + url: "/pages/auth/login/login" + }); } }, goOrder() { if (app.globalData.hasLogin) { - wx.navigateTo({ url: "/pages/ucenter/order/order" }); - } - else { - wx.navigateTo({ url: "/pages/auth/login/login" }); + wx.navigateTo({ + url: "/pages/ucenter/order/order" + }); + } else { + wx.navigateTo({ + url: "/pages/auth/login/login" + }); } }, goCoupon() { if (app.globalData.hasLogin) { - wx.navigateTo({ url: "/pages/ucenter/coupon/coupon" }); - } - else { - wx.navigateTo({ url: "/pages/auth/login/login" }); + wx.navigateTo({ + url: "/pages/ucenter/coupon/coupon" + }); + } else { + wx.navigateTo({ + url: "/pages/auth/login/login" + }); }; }, goCollect() { if (app.globalData.hasLogin) { - wx.navigateTo({ url: "/pages/ucenter/collect/collect" }); - } - else { - wx.navigateTo({ url: "/pages/auth/login/login" }); + wx.navigateTo({ + url: "/pages/ucenter/collect/collect" + }); + } else { + wx.navigateTo({ + url: "/pages/auth/login/login" + }); }; }, goFootprint() { if (app.globalData.hasLogin) { - wx.navigateTo({ url: "/pages/ucenter/footprint/footprint" }); - } - else { - wx.navigateTo({ url: "/pages/auth/login/login" }); + wx.navigateTo({ + url: "/pages/ucenter/footprint/footprint" + }); + } else { + wx.navigateTo({ + url: "/pages/auth/login/login" + }); }; }, goAddress() { if (app.globalData.hasLogin) { - wx.navigateTo({ url: "/pages/ucenter/address/address" }); - } - else { - wx.navigateTo({ url: "/pages/auth/login/login" }); + wx.navigateTo({ + url: "/pages/ucenter/address/address" + }); + } else { + wx.navigateTo({ + url: "/pages/auth/login/login" + }); }; }, - aboutUs: function () { - // wx.navigateTo({ - // url: '/page/about/index', - // }) + aboutUs: function() { wx.navigateTo({ - url: '../../about/index',//椤甸潰璺宠浆鐩稿璺緞瑕佸啓娓呮涓斿噯纭 - success: function (res) { - console.log('璺宠浆鍒皀ews椤甸潰鎴愬姛')// success - }, - fail: function () { - console.log('璺宠浆鍒皀ews椤甸潰澶辫触') // fail - }, - complete: function () { - console.log('璺宠浆鍒皀ews椤甸潰瀹屾垚') // complete - } - }) + url: '/pages/about/about' + }); }, - exitLogin: function () { + exitLogin: function() { wx.showModal({ title: '', confirmColor: '#b4282d', content: '閫鍑虹櫥褰曪紵', - success: function (res) { + success: function(res) { if (res.confirm) { wx.removeStorageSync('token'); wx.removeStorageSync('userInfo'); diff --git a/litemall-wx/project.config.json b/litemall-wx/project.config.json index ba9871d5..d8447b7d 100644 --- a/litemall-wx/project.config.json +++ b/litemall-wx/project.config.json @@ -28,7 +28,7 @@ "list": [] }, "miniprogram": { - "current": 32, + "current": 33, "list": [ { "id": -1, @@ -210,12 +210,12 @@ "pathName": "pages/auth/login/login", "query": "" }, - { - "id": -1, - "name": "璐﹀彿鐧诲綍", - "pathName": "pages/auth/accountLogin/accountLogin", - "query": "" - }, + { + "id": -1, + "name": "璐﹀彿鐧诲綍", + "pathName": "pages/auth/accountLogin/accountLogin", + "query": "" + }, { "id": -1, "name": "娉ㄥ唽", @@ -227,6 +227,11 @@ "name": "鎵惧洖瀵嗙爜", "pathName": "pages/auth/reset/reset", "query": "" + }, + { + "id": -1, + "name": "鍏充簬", + "pathName": "pages/about/about" } ] }