index.wxml
創(chuàng)新互聯(lián)建站是一家專(zhuān)業(yè)提供南沙企業(yè)網(wǎng)站建設(shè),專(zhuān)注與做網(wǎng)站、成都網(wǎng)站建設(shè)、H5場(chǎng)景定制、小程序制作等業(yè)務(wù)。10年已為南沙眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專(zhuān)業(yè)網(wǎng)站制作公司優(yōu)惠進(jìn)行中。
{{item.content}}
index.js
//index.js //獲取應(yīng)用實(shí)例 var app = getApp(); var x,y,x1,y1,x2,y2,index,currindex,n,yy; var arr1 = [{content:11,id:1},{content:22,id:2},{content:33,id:3},{content:44,id:4},{content:55,id:5}]; Page({ data: { mainx:0, content:[{content:11,id:1},{content:22,id:2},{content:33,id:3},{content:44,id:4},{content:55,id:5}], start:{x:0,y:0} }, movestart:function(e){ currindex = e.target.dataset.index; x = e.touches[0].clientX; y = e.touches[0].clientY; x1 = e.currentTarget.offsetLeft; y1 = e.currentTarget.offsetTop; }, move:function(e){ yy = e.currentTarget.offsetTop; x2 = e.touches[0].clientX-x+x1; y2 = e.touches[0].clientY-y+y1; this.setData({ mainx:currindex, opacity:0.7, start:{x:x2,y:y2} }) }, moveend:function(){ if(y2 != 0){ var arr = []; for(var i=0; i(52*(k-1)+k*2-26)){ n=k; } } if(y2>(52*(nx-1)+nx*2-26)){ n = nx; } console.log(arr); console.log(arr1) arr.splice((currindex-1),1); arr.splice((n-1),0,arr1[currindex-1]); arr1 = []; for(var m=0; m
index.wxss
.container { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 200rpx 0; box-sizing: border-box; } .box{width:300px; position: relative} .main{width: 90%; height:50px; background: #eee; border: 1px solid #ccc; margin:2px auto; text-align: center; line-height: 50px;} .mainmove{position: absolute; opacity: 0.7} .maind{background: #fff; border:1px dashed #efefef;} .mainend{position: static; opacity: 1;}
以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持創(chuàng)新互聯(lián)!