微信小程式 問題彙總及詳解之picker 增 刪

2022-08-10 19:27:18 字數 2968 閱讀 8828

<

block

wx:for

="}"

wx:for-index

="index"

wx:key

="id"

wx:for-item

="item"

>

<

view

class

="con_txt"

>

<

view

class

="con_txt1"

style

="margin-left:30rpx;width:140rpx"

>銷售品申請

view

>

<

view

class

="con_txt1 con_txt2"

>

<

view

class

="section"

>

<

picker

bindchange

="bindpickerchange"

value

="}"

range

="}"

range-key

="good_name"

data-id="}" data-index

="}"

>

<

view

class

="picker"

style

="height:70rpx;position:relative"

>

}

<

image

src="../image/select.png"

style

="width:40rpx;height:40rpx;position:absolute;left:80%;top:20%;"

>

image

>

view

>

picker

>

view

>

view

>

<

view

class

="con_txt1"

>

<

view

class

="section2"

>

<

input

value

="}"

name

="count"

bindinput

="numchanges"

data-index

="}"

style

="text-align:center;height:66rpx !important;padding-top:4rpx;"

placeholder-style

="color:#ddd;text-align:center;margin-top: 0px;margin-left:-8rpx"

placeholder

="數量"

/>

view

>

view

>

<

button

class

="btnc"

hover-class

="none"

bindtap

="reducesales"

data-index

="}"

>-

button

>

view

>

block

>

<

view

class

="hb"

bindtap

="addsales"

>

<

image

src="../image/addt.png"

style

="width:30rpx;height:30rpx;float:left;margin-left:38%;"

>

image

>

<

view

class

="text3"

>繼續增加商品

view

>

view

>

data: ,

//銷售品刪除一行

reducesales: function

(e)

list.splice(index, 1);

this

.setdata()

},//點選新增銷售品

addsales: function

(e) );

return

; }

}var options = this

.data.objectarray

this.data.saleslist.push() //新增新行的時候nums初始為0

this

.setdata()

},//銷售品申請類

bindpickerchange: function

(e) )

},//

申請數量

numchanges: function

(e) )

},//頁面初始化 options為頁面跳轉所帶來的引數

onload: function

(options) ,

success:

function (res) )

that.data.materiellist.push()

that.data.activeslist.push()

that.setdata()

},})

},

微信小程式問題彙總

每個頁面的檔案都要在.js檔案中加上page 官方文件如下 wx.request header success function res 原因是開發工具公升級後,請求的header的content type寫法變了,改成 json 即可。參考 電影詳情介面api為 這裡的id為每部電影所對應的id,...

微信小程式之 問題

1.如何定義全域性資料 2.如何實現 的復用 函式的復用 test.js test function module.exports other.js var common require test.js page 模板 template name odd view odd view template...

微信小程式問題

1.js中this物件 在一般的函式中 bindfachange1 function e this.setdata是正確的。但當在函式中有個請求 wx.request 時 formsubmit function e 這樣會報錯誤 this.setdata is not a function.解決方法...