From 084fb4386b593432623ba912bf33824b69576ef5 Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Thu, 19 Dec 2019 14:50:06 +0800 Subject: [PATCH 1/4] opendi --- pages/product/product.scss | 1 + pages/product/product.wxss | 2 +- utils/bin.js | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pages/product/product.scss b/pages/product/product.scss index ce83366..3476d77 100644 --- a/pages/product/product.scss +++ b/pages/product/product.scss @@ -17,6 +17,7 @@ font-size: 32rpx; color: #333; margin-bottom: 34rpx; + width: 540rpx; } .menery{ font-size: 34rpx; diff --git a/pages/product/product.wxss b/pages/product/product.wxss index df561aa..51450d1 100644 --- a/pages/product/product.wxss +++ b/pages/product/product.wxss @@ -1 +1 @@ -.box{border-top:1rpx solid #eaeaea;display:flex;flex-direction:column;align-items:center}.box .swiper{margin-top:109rpx;width:389rpx;height:657rpx}.box .swiper .image{width:389rpx;height:549rpx;background-color:#000}.box .title{font-size:32rpx;color:#333;margin-bottom:34rpx}.box .menery{font-size:34rpx;color:#666;margin-bottom:70rpx}.box .add{width:308rpx;height:98rpx;background-color:#50CA80;border-radius:49rpx;line-height:98rpx;font-size:34rpx;color:#fff;text-align:center} +.box{border-top:1rpx solid #eaeaea;display:flex;flex-direction:column;align-items:center}.box .swiper{margin-top:109rpx;width:389rpx;height:657rpx}.box .swiper .image{width:389rpx;height:549rpx;background-color:#000}.box .title{font-size:32rpx;color:#333;margin-bottom:34rpx;width:540rpx}.box .menery{font-size:34rpx;color:#666;margin-bottom:70rpx}.box .add{width:308rpx;height:98rpx;background-color:#50CA80;border-radius:49rpx;line-height:98rpx;font-size:34rpx;color:#fff;text-align:center} diff --git a/utils/bin.js b/utils/bin.js index 84ceabc..c535980 100644 --- a/utils/bin.js +++ b/utils/bin.js @@ -7,7 +7,8 @@ let request = function (obj){ header, dataType, responseType, - complete + complete, + name } = obj url="http://daigou.sdbairui.com/index.php/WXAPI/" + url if(method == "POST" || method == "post"){ @@ -19,7 +20,7 @@ let request = function (obj){ if(data == undefined){ data = {} } - data.openid = wx.getStorageSync("openid") + data[name || 'openid'] = wx.getStorageSync("openid") return new Promise((res,rej)=>{ wx.request({ url, -- 2.39.5 From fc42af178ca5b2c88a7fefc9e56c353c30e0b3b6 Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Thu, 19 Dec 2019 14:57:46 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/product/product.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pages/product/product.js b/pages/product/product.js index 1ca6965..27c8bdf 100644 --- a/pages/product/product.js +++ b/pages/product/product.js @@ -6,7 +6,8 @@ Page({ * 页面的初始数据 */ data: { - array: ['20粒', '30粒', '50粒', '100粒'] + array: ['20粒', '30粒', '50粒', '100粒'], + userid:0 }, /** @@ -27,6 +28,14 @@ Page({ }) // console.log(this.data.type, 150) }) + request({ + url:"User/validateOpenid" + }).then((res)=>{ + console.log(res) + this.setData({ + userid:res.data.data.user_id + }) + }) }, // goshop() { @@ -38,8 +47,10 @@ Page({ data: { goods_id: this.data.shopid, goods_num: 1, - goods_spec:e.detail.value - } + goods_spec:"", + user_id:this.data.userid + }, + name:"session_id" }).then((res)=>{ console.log(res) wx.switchTab({ -- 2.39.5 From 79afb38a63767e36f442633f94362ad1311130ee Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Thu, 19 Dec 2019 15:27:30 +0800 Subject: [PATCH 3/4] url --- components/shopping/shoppingitem/shoppingitem.js | 2 +- components/shopping/shoppingitem/shoppingitem.wxml | 2 +- components/shopping/shoppingitem/shoppingitem.wxss | 12 ++++++++++-- pages/shopping/shopping.js | 5 ++++- pages/shopping/shopping.wxml | 4 ++-- utils/bin.js | 8 +++++++- 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/components/shopping/shoppingitem/shoppingitem.js b/components/shopping/shoppingitem/shoppingitem.js index 4ab5506..abb4ed3 100644 --- a/components/shopping/shoppingitem/shoppingitem.js +++ b/components/shopping/shoppingitem/shoppingitem.js @@ -4,7 +4,7 @@ Component({ * 组件的属性列表 */ properties: { - shospname: String, + shopname: String, shopdesc: String, price: Number, pic: String diff --git a/components/shopping/shoppingitem/shoppingitem.wxml b/components/shopping/shoppingitem/shoppingitem.wxml index a2fe59f..2753d2d 100644 --- a/components/shopping/shoppingitem/shoppingitem.wxml +++ b/components/shopping/shoppingitem/shoppingitem.wxml @@ -1,7 +1,7 @@ - + {{shopname}} diff --git a/components/shopping/shoppingitem/shoppingitem.wxss b/components/shopping/shoppingitem/shoppingitem.wxss index 34847bd..a24b12e 100644 --- a/components/shopping/shoppingitem/shoppingitem.wxss +++ b/components/shopping/shoppingitem/shoppingitem.wxss @@ -35,13 +35,21 @@ font-size: 26rpx; font-weight: bold; margin-bottom: 18rpx; - margin-top: 35rpx; + margin-top: 20rpx; + text-overflow: ellipsis; + overflow: hidden; + + display: -webkit-box; + + -webkit-box-orient: vertical; + + -webkit-line-clamp: 2; } .shopdesc { color: #666666; font-size: 22rpx; - margin-bottom: 39rpx; + margin-bottom: 20rpx; } .price { diff --git a/pages/shopping/shopping.js b/pages/shopping/shopping.js index 1988121..02f0f12 100644 --- a/pages/shopping/shopping.js +++ b/pages/shopping/shopping.js @@ -6,7 +6,7 @@ Page({ * 页面的初始数据 */ data: { - list:[1,1,1], + list:[], userid:0 }, @@ -21,6 +21,9 @@ Page({ } }).then((res)=>{ console.log(res) + this.setData({ + list:res.data.result + }) }) }, onLoad: function(options) { diff --git a/pages/shopping/shopping.wxml b/pages/shopping/shopping.wxml index ffaa067..2c7c27e 100644 --- a/pages/shopping/shopping.wxml +++ b/pages/shopping/shopping.wxml @@ -1,6 +1,6 @@ - - + +