From 0925c245405f4d8b51a236bd0e90d3f232e853b4 Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Tue, 17 Dec 2019 09:33:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/classify/navigation/index.js | 7 +++++++ components/classify/navigation/index.wxml | 18 +++++++++--------- project.config.json | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/components/classify/navigation/index.js b/components/classify/navigation/index.js index 035c745..e427181 100644 --- a/components/classify/navigation/index.js +++ b/components/classify/navigation/index.js @@ -2,7 +2,14 @@ Component({ properties: { }, data: { + id:0 }, methods: { + select(a){ + // console.log(a.target.dataset.id) + this.setData({ + id:a.target.dataset.id + }) + } } }) \ No newline at end of file diff --git a/components/classify/navigation/index.wxml b/components/classify/navigation/index.wxml index c03b550..86574d6 100644 --- a/components/classify/navigation/index.wxml +++ b/components/classify/navigation/index.wxml @@ -1,10 +1,10 @@ - - 热门商品 - 美容健身 - 美容健身 - 美容健身 - 美容健身 - 美容健身 - 美容健身 - 美容健身 + + 热门商品 + 美容健身 + 美容健身 + 美容健身 + 美容健身 + 美容健身 + 美容健身 + 美容健身 \ No newline at end of file diff --git a/project.config.json b/project.config.json index bd2b7f8..01cad11 100644 --- a/project.config.json +++ b/project.config.json @@ -16,7 +16,7 @@ }, "compileType": "miniprogram", "libVersion": "2.9.4", - "appid": "wx5766b7aac7c938b3", + "appid": "wxb9033316008de1ce", "projectname": "deguodaigou", "debugOptions": { "hidedInDevtools": [] -- 2.39.5 From ed38614c2cf6fc5d66093dd9027c4fbb44d4f10d Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Tue, 17 Dec 2019 09:54:17 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shopping/shoppingitem/shoppingitem.js | 17 ++++++++++++++++- .../shopping/shoppingitem/shoppingitem.wxml | 6 +++--- .../shopping/shoppingitem/shoppingitem.wxss | 13 ++++++++----- pages/shopping/shopping.js | 2 +- pages/shopping/shopping.wxml | 10 +++++----- pages/shopping/shopping.wxss | 5 ++++- 6 files changed, 37 insertions(+), 16 deletions(-) diff --git a/components/shopping/shoppingitem/shoppingitem.js b/components/shopping/shoppingitem/shoppingitem.js index 71165bf..4ab5506 100644 --- a/components/shopping/shoppingitem/shoppingitem.js +++ b/components/shopping/shoppingitem/shoppingitem.js @@ -14,13 +14,28 @@ Component({ * 组件的初始数据 */ data: { - + num: 5 }, /** * 组件的方法列表 */ methods: { + rm() { + if (this.data.num == 0) { + return + } else { + this.setData({ + num: this.data.num - 1 + }) + } + }, + add() { + + this.setData({ + num: this.data.num + 1 + }) + } } }) \ No newline at end of file diff --git a/components/shopping/shoppingitem/shoppingitem.wxml b/components/shopping/shoppingitem/shoppingitem.wxml index c1f4a39..a2fe59f 100644 --- a/components/shopping/shoppingitem/shoppingitem.wxml +++ b/components/shopping/shoppingitem/shoppingitem.wxml @@ -9,8 +9,8 @@ ${{price}} - - 5 - + - + {{num}} + + diff --git a/components/shopping/shoppingitem/shoppingitem.wxss b/components/shopping/shoppingitem/shoppingitem.wxss index d30936f..34847bd 100644 --- a/components/shopping/shoppingitem/shoppingitem.wxss +++ b/components/shopping/shoppingitem/shoppingitem.wxss @@ -63,11 +63,13 @@ } .reverse { - width: 19rpx; - height: 3rpx; - background-color: #97DFB4; + width: 23rpx; + height: 23rpx; + /* background-color: #97DFB4; */ margin: 0 auto; - margin-top: 25rpx; + margin-top: 20rpx; + line-height: 23rpx; + font-size: 46rpx; } .num { @@ -79,7 +81,8 @@ .add { width: 23rpx; height: 23rpx; - background-color: #242424; + /* background-color: #242424; */ margin: 0 auto; margin-bottom: 17rpx; + line-height: 23rpx; } \ No newline at end of file diff --git a/pages/shopping/shopping.js b/pages/shopping/shopping.js index c51647f..6eeb4df 100644 --- a/pages/shopping/shopping.js +++ b/pages/shopping/shopping.js @@ -5,7 +5,7 @@ Page({ * 页面的初始数据 */ data: { - + list:[1,1,1] }, /** diff --git a/pages/shopping/shopping.wxml b/pages/shopping/shopping.wxml index c5706dc..ffaa067 100644 --- a/pages/shopping/shopping.wxml +++ b/pages/shopping/shopping.wxml @@ -1,5 +1,8 @@ - + + + + diff --git a/pages/shopping/shopping.wxss b/pages/shopping/shopping.wxss index aeaf59c..7379c93 100644 --- a/pages/shopping/shopping.wxss +++ b/pages/shopping/shopping.wxss @@ -1,4 +1,7 @@ - .item { +.shopping{ + padding-bottom: 128rpx; +} +.item { height: 186rpx; margin-left: 46rpx; margin-top: 59rpx; -- 2.39.5 From 3166463ac4c69694cbc0b8f1e9ab808326a54afa Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Wed, 18 Dec 2019 18:10:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 1 + app.wxss | 26 +++++-- components/index/list/commodity/index.js | 7 +- components/index/list/commodity/index.wxml | 6 +- components/index/list/index.js | 1 + components/index/list/index.wxml | 2 +- pages/index/index.js | 15 +++- pages/index/index.wxml | 2 +- pages/login/login.js | 86 ++++++++++++++++++++++ pages/login/login.json | 3 + pages/login/login.wxml | 3 + pages/login/login.wxss | 1 + pages/personal/personal.js | 7 +- pages/personal/personal.wxml | 2 +- project.config.json | 14 +++- utils/bin.js | 11 ++- 16 files changed, 166 insertions(+), 21 deletions(-) create mode 100644 pages/login/login.js create mode 100644 pages/login/login.json create mode 100644 pages/login/login.wxml create mode 100644 pages/login/login.wxss diff --git a/app.json b/app.json index 12d12ad..0c0db63 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,6 @@ { "pages": [ + "pages/login/login", "pages/index/index", "pages/search/search", "pages/shopping/shopping", diff --git a/app.wxss b/app.wxss index 4531a14..aaec663 100644 --- a/app.wxss +++ b/app.wxss @@ -1,3 +1,15 @@ +.towline { + overflow: hidden; + + text-overflow: ellipsis; + + display: -webkit-box; + + -webkit-box-orient: vertical; + + -webkit-line-clamp: 2; +} + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ /* Document @@ -8,7 +20,7 @@ * 2. Prevent adjustments of font size after orientation changes in iOS. */ - html { +html { line-height: 1; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ } @@ -174,7 +186,8 @@ textarea { */ button, -input { /* 1 */ +input { + /* 1 */ overflow: visible; } @@ -184,7 +197,8 @@ input { /* 1 */ */ button, -select { /* 1 */ +select { + /* 1 */ text-transform: none; } @@ -347,7 +361,7 @@ template { [hidden] { display: none; } -image{ +image { background-size: cover; - background-image: url('http://luyuan.tk/static/images/TIM%E5%9B%BE%E7%89%8720191214113605.jpg'); -} \ No newline at end of file + background-image: url("http://luyuan.tk/static/images/TIM%E5%9B%BE%E7%89%8720191214113605.jpg"); +} diff --git a/components/index/list/commodity/index.js b/components/index/list/commodity/index.js index 8423aa4..60d2ac3 100644 --- a/components/index/list/commodity/index.js +++ b/components/index/list/commodity/index.js @@ -1,5 +1,10 @@ Component({ - properties: {}, + properties: { + img:String, + title:String, + id:String, + price:String + }, data: {}, methods: { gotodetail() { diff --git a/components/index/list/commodity/index.wxml b/components/index/list/commodity/index.wxml index 635e5ff..0edd8bd 100644 --- a/components/index/list/commodity/index.wxml +++ b/components/index/list/commodity/index.wxml @@ -1,10 +1,10 @@ - + - 产品名称产品名称产品名称产品名称产品名称产品名称产品名称 + {{title}} - ¥657 + ¥{{price}} 加入购物车 diff --git a/components/index/list/index.js b/components/index/list/index.js index 035c745..82a621a 100644 --- a/components/index/list/index.js +++ b/components/index/list/index.js @@ -1,5 +1,6 @@ Component({ properties: { + list:Array }, data: { }, diff --git a/components/index/list/index.wxml b/components/index/list/index.wxml index 7983d11..8f1ac02 100644 --- a/components/index/list/index.wxml +++ b/components/index/list/index.wxml @@ -1,4 +1,4 @@ 热门商品 - + \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 95bc36d..f9e3444 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,9 +1,20 @@ +import {request} from "../../utils/bin" Page({ data:{ - + list:[] }, onLoad(){ - + request({ + url:"Goods/hotGoodsList", + data:{ + page:0 + } + }).then((res)=>{ + console.log(res.data.result) + this.setData({ + list:res.data.result + }) + }) }, searchs(){ console.log(10) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 4e25615..bc7cb0c 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/pages/login/login.js b/pages/login/login.js new file mode 100644 index 0000000..b168ea5 --- /dev/null +++ b/pages/login/login.js @@ -0,0 +1,86 @@ +// pages/login/login.js +import {request} from "../../utils/bin" +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + login(a){ + console.log(a) + wx.login({ + success (res) { + if (res.code) { + //发起网络请求 + request({ + url:"User/getopenId", + data:{ + js_code:res.code + } + }).then((res)=>{ + console.log(res) + }) + } else { + console.log('登录失败!' + res.errMsg) + } + } + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/login/login.json b/pages/login/login.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/login/login.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/login/login.wxml b/pages/login/login.wxml new file mode 100644 index 0000000..cd32bd7 --- /dev/null +++ b/pages/login/login.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pages/login/login.wxss b/pages/login/login.wxss new file mode 100644 index 0000000..4827a66 --- /dev/null +++ b/pages/login/login.wxss @@ -0,0 +1 @@ +/* pages/login/login.wxss */ \ No newline at end of file diff --git a/pages/personal/personal.js b/pages/personal/personal.js index acb09a3..b444df6 100644 --- a/pages/personal/personal.js +++ b/pages/personal/personal.js @@ -5,14 +5,17 @@ Page({ * 页面的初始数据 */ data: { - + openid:"", + username:"啦啦啦" }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { - + this.setData({ + openid:wx.getStorageSync("openid") + }) }, toorder() { wx.navigateTo({ diff --git a/pages/personal/personal.wxml b/pages/personal/personal.wxml index 4aba087..9142488 100644 --- a/pages/personal/personal.wxml +++ b/pages/personal/personal.wxml @@ -2,7 +2,7 @@ - 于于于宇于 + {{openid == ""?'点击登录':username}} 账户余额 diff --git a/project.config.json b/project.config.json index 01cad11..e422e4a 100644 --- a/project.config.json +++ b/project.config.json @@ -4,15 +4,23 @@ "ignore": [] }, "setting": { - "urlCheck": true, + "urlCheck": false, "es6": true, "postcss": true, "minified": true, "newFeature": true, - "autoAudits": false, "coverView": true, + "autoAudits": false, "showShadowRootInWxmlPanel": true, - "scopeDataCheck": false + "scopeDataCheck": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } }, "compileType": "miniprogram", "libVersion": "2.9.4", diff --git a/utils/bin.js b/utils/bin.js index 27bdf03..cc07017 100644 --- a/utils/bin.js +++ b/utils/bin.js @@ -2,15 +2,24 @@ let request = function (obj){ let { url, + data, method, header, dataType, responseType, complete } = obj + url="http://daigou.sdbairui.com/index.php/WXAPI/" + url + if(method == "POST" || method == "post"){ + if(header == undefined){ + header ={} + } + header['content-type'] = "application/x-www-form-urlencoded" + } return new Promise((res,rej)=>{ - Wx.request({ + wx.request({ url, + data, method, header, dataType, -- 2.39.5 From 9c4dd6edc9fa7dd68aa27fd2902bbb291f3e3f53 Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Thu, 19 Dec 2019 09:24:05 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A4=9A=E8=A1=8C=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 2 +- app.wxss | 10 ---------- components/index/list/commodity/index.scss | 10 ++++++++++ components/index/list/commodity/index.wxss | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app.json b/app.json index 0c0db63..221ebf0 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "pages": [ - "pages/login/login", "pages/index/index", + "pages/login/login", "pages/search/search", "pages/shopping/shopping", "pages/classify/classify", diff --git a/app.wxss b/app.wxss index aaec663..3906c42 100644 --- a/app.wxss +++ b/app.wxss @@ -1,14 +1,4 @@ -.towline { - overflow: hidden; - text-overflow: ellipsis; - - display: -webkit-box; - - -webkit-box-orient: vertical; - - -webkit-line-clamp: 2; -} /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ diff --git a/components/index/list/commodity/index.scss b/components/index/list/commodity/index.scss index bcb00be..1eb6e9d 100644 --- a/components/index/list/commodity/index.scss +++ b/components/index/list/commodity/index.scss @@ -25,12 +25,22 @@ font-size: 26rpx; color: #333; margin-bottom: 22rpx; + overflow: hidden; + + text-overflow: ellipsis; + + display: -webkit-box; + + -webkit-box-orient: vertical; + + -webkit-line-clamp: 2; } > view { display: flex; align-items: center; justify-content: space-between; > text:first-child { + font-size: 30rpx; color: #dec499; } diff --git a/components/index/list/commodity/index.wxss b/components/index/list/commodity/index.wxss index 8647b14..e358535 100644 --- a/components/index/list/commodity/index.wxss +++ b/components/index/list/commodity/index.wxss @@ -1 +1 @@ -.commodity{width:623rpx;height:143rpx;margin-top:32rpx;display:flex;align-items:center}.commodity .content{width:614rpx;height:100%;display:flex;align-items:center;box-shadow:0 0 24rpx 0 rgba(227,227,227,0.4)}.commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.commodity .content .introduce{width:410rpx;margin-left:40rpx;display:flex;flex-direction:column}.commodity .content .introduce>text{font-size:26rpx;color:#333;margin-bottom:22rpx}.commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999}.commodity .decorate{width:9rpx;height:102rpx;background-color:#3fb66e} +.commodity{width:623rpx;height:143rpx;margin-top:32rpx;display:flex;align-items:center}.commodity .content{width:614rpx;height:100%;display:flex;align-items:center;box-shadow:0 0 24rpx 0 rgba(227,227,227,0.4)}.commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.commodity .content .introduce{width:410rpx;margin-left:40rpx;display:flex;flex-direction:column}.commodity .content .introduce>text{font-size:26rpx;color:#333;margin-bottom:22rpx;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999}.commodity .decorate{width:9rpx;height:102rpx;background-color:#3fb66e} -- 2.39.5