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: {
shospname: String,
shopname: String,
shopdesc: String,
price: Number,
pic: String

View File

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

View File

@ -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 {

View File

@ -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) {

View File

@ -1,6 +1,6 @@
<view class="shopping">
<view class="item" wx:for="{{list}}" wx:for-index="j" wx:if = "{{item == 1}}" wx:key="{{j}}">
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item>
<view class="item" wx:for="{{list}}" wx:for-index="j" wx:key="{{j}}">
<shopping-item shopname="{{item.goods_name}}" shopdesc="{{item.spec_key_name||'默认规格'}}" price="{{item.goods_price}}" pic="{{item.image}}"></shopping-item>
</view>
<!-- <view class="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,
responseType,
complete,
name
name,
urldata
} = obj
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(header == undefined){
header ={}