pplok #29
@ -10,7 +10,9 @@ Component({
 | 
			
		||||
        price: Number,
 | 
			
		||||
        pic: String,
 | 
			
		||||
        gid:Number,
 | 
			
		||||
        num:Number
 | 
			
		||||
        num:Number,
 | 
			
		||||
        select:Boolean,
 | 
			
		||||
        index:Number
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -58,6 +60,9 @@ Component({
 | 
			
		||||
            }).then((res)=>{
 | 
			
		||||
                
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
        sel(){
 | 
			
		||||
            this.triggerEvent('sel', {index:this.data.index,select:this.data.select})
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
<view class="shoppingitem">
 | 
			
		||||
    <view class="select"></view>
 | 
			
		||||
    <view class="select {{select ? 'selects':''}}" bind:tap="sel"></view>
 | 
			
		||||
    <view class="pic">
 | 
			
		||||
        <image src="{{pic}}"></image>
 | 
			
		||||
    </view>
 | 
			
		||||
 | 
			
		||||
@ -12,7 +12,9 @@
 | 
			
		||||
    border-radius: 50%;
 | 
			
		||||
    margin: auto 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.selects{
 | 
			
		||||
    background-color: #45C778;
 | 
			
		||||
}
 | 
			
		||||
.pic {
 | 
			
		||||
    /* width: 222rpx;
 | 
			
		||||
    height: 222rpx; */
 | 
			
		||||
 | 
			
		||||
@ -7,8 +7,15 @@ Page({
 | 
			
		||||
     */
 | 
			
		||||
    data: {
 | 
			
		||||
        list:[],
 | 
			
		||||
        select:[],
 | 
			
		||||
        userid:0
 | 
			
		||||
    },
 | 
			
		||||
    sel(a){
 | 
			
		||||
        console.log(a)
 | 
			
		||||
        this.setData({
 | 
			
		||||
            [`select[${a.detail.index}]`]:!a.detail.select
 | 
			
		||||
        })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 生命周期函数--监听页面加载
 | 
			
		||||
@ -53,7 +60,7 @@ Page({
 | 
			
		||||
     * 生命周期函数--监听页面显示
 | 
			
		||||
     */
 | 
			
		||||
    onShow: function() {
 | 
			
		||||
 | 
			
		||||
        this.onLoad()
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -89,5 +96,10 @@ Page({
 | 
			
		||||
     */
 | 
			
		||||
    onShareAppMessage: function() {
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    num(){
 | 
			
		||||
        for(let i in this.data.select){
 | 
			
		||||
            
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
})
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<view class="shopping">
 | 
			
		||||
   <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 class="item">
 | 
			
		||||
      <shopping-item shopname="J`adore - Dior" shopdesc="30支   1.30kg" price="61.78"></shopping-item>
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,13 @@ let request = function (obj){
 | 
			
		||||
    url="http://daigou.sdbairui.com/index.php/WXAPI/" + url
 | 
			
		||||
    let text = ""
 | 
			
		||||
    for(let i in urldata){
 | 
			
		||||
        text += `/${i}/${urldata[i]}`
 | 
			
		||||
        if(urldata[i] == undefined){
 | 
			
		||||
            text += `/${i}`
 | 
			
		||||
 | 
			
		||||
        }else{
 | 
			
		||||
            text += `/${i}/${urldata[i]}`
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    url+=text
 | 
			
		||||
    if(method == "POST" || method == "post"){
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user