class='
cartmain
'>
for="
}" wx:key="
key" wx:for-index="
index
">
"}"class='
cart-box
' data-index="
}">
<!-- 核取方塊 -->
class='
icon
'>
if="
}" type="
success
" color="
rgb(51, 138, 238)
" size="
20" bindtap="
selectedcart
" data-index="
}" />
else type="
circle
" bindtap="
selectedcart
" size="
20" data-index="
}" />
<!-- -->
class='
cart_main
'>
class='
left_imgae
' data-key="
}" style="
background-color:}
">
}class='
left_box
'>
class="
cart-title
">}
class="
cart-goods
">}
class="
cart-price
">¥}
class="
jisuan
">
'reduce
'class="
input cart-reduce
" data-index="
}">-
class="
input cart-text
">}
'add
'class="
input cart-add
" data-index="
}">+
class="
cart-bottom
">
if="}"
class="
cart-icon
" type="
success
" color="
rgb(51, 138, 238)
" size="
20" bindtap="
select
" data-index="
}" />
else type="
circle
"class="
cart-icon
" size="
20" bindtap="
select
" data-index="
}" />
class='
checkall
'>全選
class='
cart-sum
'>
class='
cart_sum
'>
class='
sum_text
'>合計:
class='
sum_color
'>¥}元
class='
cart-pay
'>
class='
cart_pay
' bindtap="
go" data-id="
}">結算
/*wxss
*/.cartmain
.cart-image
.cart-box
.icon
.cart_main
.cart-boxtwo
.left_imgae
.left_box
.cart-title
.cart-goods
.cart-price
.right image
.input
.cart-add
.cart-reduce
.cart-text
.cart-bottom
.yuan
.spcart
.sptext
.cart-icon
.cart-sum
.cart-pay
.cart_pay
.sum_color
.sum_text
.checkall
.jisuan
//js
page(,,,
,,,,,
],total: 0,
checkall:
false
, indexs:
'',//
下標 selectedit:'',//
checked選擇
num:'',//數量
//自定義自己喜歡的顏色
colorarr: [ "
rgb(85, 198, 226)
",'#6495ed
','rgb(51, 138, 238)'],
//儲存隨機顏色
randomcolorarr:
},onload: function (e) )
let that = this
, lablen =that.data.cartitems.length,
colorarr =that.data.colorarr,
colorlen =colorarr.length,
randomcolorarr =;
//判斷執行do
while (lablen > 0
) that.setdata();
},onshow: function () )
this
.getsumtotal()
},//
選擇select
: function (e)
this
.setdata()
this
.getsumtotal()
},add: function (e) );
this
.getsumtotal()
wx.setstoragesync(
"cartitems
", cartitems) //
存快取},
//減reduce: function (e)
else
this
.setdata();
this
.getsumtotal()
wx.setstoragesync(
"cartitems
", cartitems)
},//
選擇selectedcart: function (e) )
this
.getsumtotal();
wx.setstoragesync(
"cartitems
", cartitems)
},//
結算go: function (e)
}console.log(cardatas)
//選中結算的物品
},
//合計
getsumtotal: function ()
}//更新資料
this
.setdata()
},})
購物車小程式
coding utf 8 shp iphone 5000 offee 35 shoes 800 pric list e int input 請輸入賬戶金額 while true for i,p in enumerate shp print i,p 0 p 1 enther input 請輸入要購買的...
Python購物車小程式
問題描述 商店有一系列商品,給出購買序列,然後輸入你的金額,然後選擇要購買的商品序號或是退出,如果持續購買餘額不足則提醒使用者餘額不足,然後如果使用者退出則列印使用者購買的商品列表,並列印使用者餘額。購物車程式 product list mac 9000 kindle 8000 tesla 9000...
12 小程式 購物車
資料庫連表查詢json server 連線資料中的表 localhost 3000 carts?expand good 當前購物車商品的詳情資訊 命名要有統一性 商品資訊資料名 goods 購物車資料id goodid 購物車介面 localhost 3000 carts?expand goodsh...