欧洲变态另类zozo,欧美xxxx做受欧美gaybdsm,欧洲熟妇色xxxx欧美老妇软件,免费人成视频xvideos入口 ,欧美.日韩.国产.中文字幕

歡迎光臨本站
我們一直在努力

微信小程序開發(fā)中怎樣實(shí)現(xiàn)地址頁面三級(jí)聯(lián)動(dòng)

我遇到的問題是

后端給我的數(shù)據(jù)里面有每一個(gè)地址對(duì)應(yīng)的ID,比如北京:2 北京:50 東城區(qū):500

處理這個(gè)數(shù)據(jù)的時(shí)候,我根據(jù)原來大神的代碼做了一些修改,

<span style="font-size: 14px;"><span class="hljs-built_in" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(79, 79, 79); word-break: break-all;">let</span> val = e.detail.value,
            t = this.data.values,
            cityData = this.data.cityData,
            index = this.data.id,
            list = this.data.addrList;
            list[index].area = <span class="hljs-literal" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(0, 102, 102); word-break: break-all;">true</span>;
            try {                <span class="hljs-keyword" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(0, 0, 136); word-break: break-all;">if</span> (val[0] != t[0]) { //當(dāng)val是選擇省份的時(shí)候
                const citys = [];
                const countys = [];
                    cityData[val[0]].child.map(item => citys.push({name:item.name,id:item.id}));
                    cityData[val[0]].child[0].child.map(item => countys.push({name:item.name,id:item.id}));
                    list[index].provinceName = this.data.provinces[val[0]].name;//省份
                    list[index].cityName = cityData[val[0]].child[0].name;//城市
                    list[index].districtName = cityData[val[0]].child[0].child[0].name;//地區(qū)
                    list[index].province = this.data.provinces[val[0]].id;//對(duì)應(yīng)的傳值ID
                    list[index].city = cityData[val[0]].child[0].id;//對(duì)應(yīng)的傳值ID
                    list[index].district = cityData[val[0]].child[0].child[0].id;//對(duì)應(yīng)的傳值ID
                this.setData({
                    citys: citys,
                    countys: countys,
                    values: val,
                    value: [val[0], 0, 0],
                    addrList: list
                })                    <span class="hljs-built_in" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(79, 79, 79); word-break: break-all;">return</span>;
                }                <span class="hljs-keyword" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(0, 0, 136); word-break: break-all;">if</span> (val[1] != t[1]) {//當(dāng)val是選擇城市的時(shí)候
                    const countys = [];
                    cityData[val[0]].child[val[1]].child.map(item => countys.push({name:item.name,id:item.id}));
                    list[index].cityName = this.data.citys[val[1]].name;// 選擇城市
                    list[index].city = this.data.citys[val[1]].id;//對(duì)應(yīng)的傳值ID
                    list[index].districtName = cityData[val[0]].child[val[1]].child[0].name;//選擇城市對(duì)應(yīng)的地區(qū)
                    list[index].district = cityData[val[0]].child[val[1]].child[0].id;//對(duì)應(yīng)的傳值ID
                    this.setData({
                        countys: countys,
                        values: val,
                        value: [val[0], val[1], 0],
                        addrList: list
                    })                    <span class="hljs-built_in" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(79, 79, 79); word-break: break-all;">return</span>;
                }                <span class="hljs-keyword" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(0, 0, 136); word-break: break-all;">if</span> (val[2] != t[2]) {//當(dāng)val是選擇地區(qū)的時(shí)候
                    list[index].districtName = this.data.countys[val[2]].name;//選擇地區(qū)
                    list[index].district = this.data.countys[val[2]].id;//對(duì)應(yīng)的傳值ID
                    this.setData({
                        county: this.data.countys[val[2]].name,
                        values: val,
                        addrList: list
                    })                    <span class="hljs-built_in" style="font-size: 14px; box-sizing: border-box; outline: 0px; color: rgb(79, 79, 79); word-break: break-all;">return</span>;
                }    

            } catch(e) {
                // statements
                console.log(e);
            }
list里面是有 收貨人,電話,等等信息  但是我只操作改變數(shù)組里面地址改變的信息,</span>
登錄后復(fù)制

布局方面需要做一些修改的地方就是

相信看了本文案例你已經(jīng)掌握了方法,更多精彩請(qǐng)關(guān)注有卡有網(wǎng)。

版權(quán)聲明:本文采用知識(shí)共享 署名4.0國際許可協(xié)議 [BY-NC-SA] 進(jìn)行授權(quán)
文章名稱:《微信小程序開發(fā)中怎樣實(shí)現(xiàn)地址頁面三級(jí)聯(lián)動(dòng)》
文章鏈接:http://www.ljxxtl.cn/kaquan-baike/xcx/154373.html
本站資源僅供個(gè)人學(xué)習(xí)交流,請(qǐng)于下載后24小時(shí)內(nèi)刪除,不允許用于商業(yè)用途,否則法律問題自行承擔(dān)。