pplok #29

Manually merged
theluyuan merged 5 commits from pplok into master 2019-12-20 14:17:19 +08:00
6 changed files with 31 additions and 6 deletions
Showing only changes of commit 3cf388faed - Show all commits

View File

@ -10,7 +10,9 @@ Component({
price: Number, price: Number,
pic: String, pic: String,
gid:Number, gid:Number,
num:Number num:Number,
select:Boolean,
index:Number
}, },
/** /**
@ -58,6 +60,9 @@ Component({
}).then((res)=>{ }).then((res)=>{
}) })
},
sel(){
this.triggerEvent('sel', {index:this.data.index,select:this.data.select})
} }
} }

View File

@ -1,5 +1,5 @@
<view class="shoppingitem"> <view class="shoppingitem">
<view class="select"></view> <view class="select {{select ? 'selects':''}}" bind:tap="sel"></view>
<view class="pic"> <view class="pic">
<image src="{{pic}}"></image> <image src="{{pic}}"></image>
</view> </view>

View File

@ -12,7 +12,9 @@
border-radius: 50%; border-radius: 50%;
margin: auto 0; margin: auto 0;
} }
.selects{
background-color: #45C778;
}
.pic { .pic {
/* width: 222rpx; /* width: 222rpx;
height: 222rpx; */ height: 222rpx; */

View File

@ -7,8 +7,15 @@ Page({
*/ */
data: { data: {
list:[], list:[],
select:[],
userid:0 userid:0
}, },
sel(a){
console.log(a)
this.setData({
[`select[${a.detail.index}]`]:!a.detail.select
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -53,7 +60,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function() {
this.onLoad()
}, },
/** /**
@ -89,5 +96,10 @@ Page({
*/ */
onShareAppMessage: function() { onShareAppMessage: function() {
},
num(){
for(let i in this.data.select){
}
} }
}) })

View File

@ -1,6 +1,6 @@
<view class="shopping"> <view class="shopping">
<view class="item" wx:for="{{list}}" wx:for-index="j" wx:key="{{j}}"> <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}}" num="{{item.goods_num}}" gid="{{item.id}}"></shopping-item> <shopping-item shopname="{{item.goods_name}}" shopdesc="{{item.spec_key_name||'默认规格'}}" price="{{item.goods_price}}" pic="{{item.image}}" num="{{item.goods_num}}" gid="{{item.id}}" index="{{j}}" select="{{select[j]}}" bindsel="sel"></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

@ -14,7 +14,13 @@ let request = function (obj){
url="http://daigou.sdbairui.com/index.php/WXAPI/" + url url="http://daigou.sdbairui.com/index.php/WXAPI/" + url
let text = "" let text = ""
for(let i in urldata){ for(let i in urldata){
if(urldata[i] == undefined){
text += `/${i}`
}else{
text += `/${i}/${urldata[i]}` text += `/${i}/${urldata[i]}`
}
} }
url+=text url+=text
if(method == "POST" || method == "post"){ if(method == "POST" || method == "post"){