This commit is contained in:
pplokijuhyg 2019-12-19 15:27:30 +08:00
parent fc42af178c
commit 79afb38a63
6 changed files with 25 additions and 8 deletions

View File

@ -4,7 +4,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
shospname: String, shopname: String,
shopdesc: String, shopdesc: String,
price: Number, price: Number,
pic: String pic: String

View File

@ -1,7 +1,7 @@
<view class="shoppingitem"> <view class="shoppingitem">
<view class="select"></view> <view class="select"></view>
<view class="pic"> <view class="pic">
<image></image> <image src="{{pic}}"></image>
</view> </view>
<view class="shopinfo"> <view class="shopinfo">
<view class="shopname">{{shopname}}</view> <view class="shopname">{{shopname}}</view>

View File

@ -35,13 +35,21 @@
font-size: 26rpx; font-size: 26rpx;
font-weight: bold; font-weight: bold;
margin-bottom: 18rpx; 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 { .shopdesc {
color: #666666; color: #666666;
font-size: 22rpx; font-size: 22rpx;
margin-bottom: 39rpx; margin-bottom: 20rpx;
} }
.price { .price {

View File

@ -6,7 +6,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list:[1,1,1], list:[],
userid:0 userid:0
}, },
@ -21,6 +21,9 @@ Page({
} }
}).then((res)=>{ }).then((res)=>{
console.log(res) console.log(res)
this.setData({
list:res.data.result
})
}) })
}, },
onLoad: function(options) { onLoad: function(options) {

View File

@ -1,6 +1,6 @@
<view class="shopping"> <view class="shopping">
<view class="item" wx:for="{{list}}" wx:for-index="j" wx:if = "{{item == 1}}" wx:key="{{j}}"> <view class="item" wx:for="{{list}}" wx:for-index="j" wx:key="{{j}}">
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item> <shopping-item shopname="{{item.goods_name}}" shopdesc="{{item.spec_key_name||'默认规格'}}" price="{{item.goods_price}}" pic="{{item.image}}"></shopping-item>
</view> </view>
<!-- <view class="item"> <!-- <view class="item">
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item> <shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item>

View File

@ -8,9 +8,15 @@ let request = function (obj){
dataType, dataType,
responseType, responseType,
complete, complete,
name name,
urldata
} = obj } = obj
url="http://daigou.sdbairui.com/index.php/WXAPI/" + url url="http://daigou.sdbairui.com/index.php/WXAPI/" + url
let text = ""
for(let i in urldata){
text += `/${i}/${urldata[i]}`
}
url+=text
if(method == "POST" || method == "post"){ if(method == "POST" || method == "post"){
if(header == undefined){ if(header == undefined){
header ={} header ={}