This commit is contained in:
pplokijuhyg 2019-12-24 15:02:17 +08:00
commit 68a7aea72c
365 changed files with 9339 additions and 9254 deletions

View File

@ -21,6 +21,9 @@
color: #999999; color: #999999;
font-size: 28rpx; font-size: 28rpx;
} }
.shurupla1{
color: #333333;
}
.arrow { .arrow {
width: 14rpx; width: 14rpx;
height: 25rpx; height: 25rpx;

View File

@ -1,7 +1,7 @@
<view class="shuru"> <view class="shuru">
<view class="left">{{left}}</view> <view class="left">{{left}}</view>
<view class="right"wx:if="{{ifarrow}}" bindtap="choose"> <view class="right"wx:if="{{ifarrow}}" bindtap="choose">
<text class="shurupla">{{right}}</text> <text class="shurupla1">{{right}}</text>
<view class="arrow"></view> <view class="arrow"></view>
</view> </view>
<view class="right" wx:else> <view class="right" wx:else>

View File

@ -1,37 +1 @@
.shuru { .shuru{width:670rpx;height:100rpx;border-bottom:2rpx solid #E8E8E8;margin:0 auto;display:flex;justify-content:space-between;line-height:100rpx;font-size:28rpx}.shuru .left{color:#333333}.shuru .right{margin:auto 0;display:flex}.shuru .right .shuru1{width:280rpx;text-align:right}.shuru .right .shurupla{color:#999999;font-size:28rpx}.shuru .right .shurupla1{color:#333333}.shuru .right .arrow{width:14rpx;height:25rpx;background-color:#999999;margin:auto 0;margin-left:27rpx}
width: 670rpx;
height: 100rpx;
border-bottom: 2rpx solid #E8E8E8;
margin: 0 auto;
display: flex;
justify-content: space-between;
line-height: 100rpx;
font-size: 28rpx;
}
.shuru .left {
color: #333333;
}
.shuru .right {
margin: auto 0;
display: flex;
}
.shuru .right .shuru1 {
width: 280rpx;
text-align: right;
}
.shuru .right .shurupla {
color: #999999;
font-size: 28rpx;
}
.shuru .right .arrow {
width: 14rpx;
height: 25rpx;
background-color: #999999;
margin: auto 0;
margin-left: 27rpx;
}

View File

@ -10,8 +10,17 @@ Page({
no: 0, no: 0,
userid:"", userid:"",
show: false, show: false,
arealist:[], arealist1:[],
area:["请选择","请选择","请选择"] arealist2:[],
arealist3:[],
area:["请选择","请选择","请选择"],
tagDis:[false,true,true],
active:0,
addressCity:"请选择 请选择 请选择",
countrys:[],
countryid:44,
nowcountry:"中国",
areaid:[]
}, },
/** /**
@ -23,17 +32,37 @@ Page({
urldata:{ urldata:{
parent_id:0 parent_id:0
}, },
}).then((res)=>{ }).then((res)=>{
console.log(res) // console.log(res)
this.setData({ this.setData({
arealist:res.data.result arealist1:res.data.result
}) })
console.log(this.data.arealist) console.log(this.data.arealist)
}) })
request({
url: "User/getCountry",
}).then((res)=>{
let country=[]
console.log(res,10000)
for(let i=0;i<res.data.result.length;i++){
country[i]=res.data.result[i].name
}
this.setData({
countrys:country
})
})
}, },
bindPickerChange(e) { bindPickerChange(e) {
console.log(e) console.log(e.detail.value)
let nowcountry=this.data.countrys[e.detail.value]
this.setData({
countryid:e.detail.value+1,
nowcountry:nowcountry
})
console.log(nowcountry,"zxc")
}, },
showPopup() { showPopup() {
this.setData({ show: true }); this.setData({ show: true });
@ -43,7 +72,7 @@ Page({
this.setData({ show: false }); this.setData({ show: false });
}, },
onMyEvent(e) { onMyEvent(e) {
console.log(e) // console.log(e)
for (let i = 0; i < 8; i++) { for (let i = 0; i < 8; i++) {
if (i == e.currentTarget.dataset.no) { if (i == e.currentTarget.dataset.no) {
this.data.canshu[i] = e.detail this.data.canshu[i] = e.detail
@ -51,10 +80,10 @@ Page({
} }
console.log(this.data.canshu) // console.log(this.data.canshu)
}, },
choose(e){ choose1(e){
console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset) // console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset)
let type=parseInt(e.currentTarget.dataset.type) let type=parseInt(e.currentTarget.dataset.type)
request({ request({
url: "User/getArea", url: "User/getArea",
@ -62,30 +91,112 @@ Page({
parent_id:e.currentTarget.dataset.id parent_id:e.currentTarget.dataset.id
}, },
}).then((res)=>{ }).then((res)=>{
console.log(res) // console.log(res)
if(res.data.result.length){
this.setData({ this.setData({
arealist1:res.data.result arealist2:res.data.result,
active:1
}) })
// this.data.area[type]=e.currentTarget.dataset.name // this.data.area[type]=e.currentTarget.dataset.name
this.setData({
console.log(this.data.area,123) tagDis:[false,false,true]
})
} // console.log(this.data.area,123)
this.data.area[0]=e.currentTarget.dataset.name
this.data.areaid[0]=e.currentTarget.dataset.id
// for(let i in this.data.area){ // for(let i in this.data.area){
// if(i==type){ // if(i==type){
// this.data.area[i]=e.currentTarget.dataset.name // this.data.area[i]=e.currentTarget.dataset.name
// } // }
// } // }
this.data.area[0]=e.currentTarget.dataset.name this.setData({
area:this.data.area
})
console.log(this.data.area,this.data.arealist) // console.log(this.data.area,this.data.arealist)
})
},
choose2(e){
// console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset)
let type=parseInt(e.currentTarget.dataset.type)
request({
url: "User/getArea",
urldata:{
parent_id:e.currentTarget.dataset.id
},
}).then((res)=>{
this.setData({
arealist3:res.data.result,
active:2,
tagDis:[false,false,false]
})
// this.data.area[type]=e.currentTarget.dataset.name
// console.log(this.data.area,123)
this.data.area[1]=e.currentTarget.dataset.name
this.data.areaid[1]=e.currentTarget.dataset.id
// for(let i in this.data.area){
// if(i==type){
// this.data.area[i]=e.currentTarget.dataset.name
// }
// }
this.setData({
area:this.data.area
})
// console.log(this.data.area,this.data.arealist)
console.log(this.data.arealist3+"001",this.data.active+"002",this.data.tagDis+"003")
})
},
choose3(e){
// console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset)
let type=parseInt(e.currentTarget.dataset.type)
request({
url: "User/getArea",
urldata:{
parent_id:e.currentTarget.dataset.id
},
}).then((res)=>{
// console.log(res)
this.setData({
arealist1:res.data.result,
tagDis:[false,false,false],
active:1
})
// this.data.area[type]=e.currentTarget.dataset.name
// console.log(this.data.area,123)
this.data.area[2]=e.currentTarget.dataset.name
this.data.areaid[2]=e.currentTarget.dataset.id
// for(let i in this.data.area){
// if(i==type){
// this.data.area[i]=e.currentTarget.dataset.name
// }
// }}
console.log(93)
this.setData({
area:this.data.area,
show: false,
addressCity:this.data.area[0]+this.data.area[1]+this.data.area[2]
})
console.log(this.data.active,94)
// console.log(this.data.area,this.data.arealist)
}) })
}, },
save() { save() {
// wx.navigateTo({ // wx.navigateTo({
// url: "/pages/chooseaddr/chooseaddr" // url: "/pages/chooseaddr/chooseaddr"
// }) // })
console.log(this.data.canshu)
console.log(this.data.countryid)
console.log(this.data.area)
console.log(this.data.areaid)
request({ request({
url: "User/validateOpenid", url: "User/validateOpenid",
}).then((res)=>{ }).then((res)=>{
@ -100,17 +211,18 @@ Page({
}, },
method:"POST", method:"POST",
data: { data: {
address: "Wesrdtfyguhijkl", // address: this.data.canshu[4],
city: "339", city: this.data.areaid[1],
consignee: "srdtfyguhijokl", consignee: this.data.canshu[0],
country: 1, country: this.data.countryid,
district: "361", address: this.data.canshu[4],
is_default: 0, is_default: 0,
mobile: "19953879035", mobile: this.data.canshu[1],
province: "338", province: this.data.areaid[0],
twon: 0, twon: this.data.areaid[2],
user_id: "9", user_id:this.data.userid,
zipcode: "271103", zipcode: this.data.canshu[5],
idcard: this.data.canshu[6],
} }
}).then((res)=>{ }).then((res)=>{
console.log(res) console.log(res)

View File

@ -1,34 +1,34 @@
<view class="addaddress"> <view class="addaddress">
<shuru left="收件人" right="姓名需和身份证一致" bindmyevent="onMyEvent" data-no="0"></shuru> <shuru left="收件人" right="姓名需和身份证一致" bindmyevent="onMyEvent" data-no="0"></shuru>
<shuru left="手机号" right="请填入常用的手机号码" bindmyevent="onMyEvent" data-no="1"></shuru> <shuru left="手机号" right="请填入常用的手机号码" bindmyevent="onMyEvent" data-no="1"></shuru>
<picker bindchange="bindPickerChange" value="{{item.item_id?item.item_id:0}}" range="{{info.goods.goods_spec_list?info.goods.goods_spec_list:['默认规格']}}"> <picker bindchange="bindPickerChange" value="{{index}}" range="{{countrys}}">
<shuru left="国家" right="CN中国大陆" ifarrow="{{true}}" data-no="2"></shuru> <shuru left="国家" right="{{nowcountry}}" ifarrow="{{true}}" data-no="2"></shuru>
</picker> </picker>
<!-- <picker bindchange="bindPickerChange" value="{{item.item_id?item.item_id:0}}" range="{{info.goods.goods_spec_list?info.goods.goods_spec_list:['默认规格']}}"> <!-- <picker bindchange="bindPickerChange" value="{{item.item_id?item.item_id:0}}" range="{{info.goods.goods_spec_list?info.goods.goods_spec_list:['默认规格']}}">
<shuru left="城市信息" right="北京市 北京市 东城区" ifarrow="{{true}}" data-no="3"></shuru> <shuru left="城市信息" right="北京市 北京市 东城区" ifarrow="{{true}}" data-no="3"></shuru>
</picker> --> </picker> -->
<view bindtap="showPopup"> <view bindtap="showPopup">
<shuru left="城市信息" right="北京市 北京市 东城区" ifarrow="{{true}}" data-no="3"></shuru> <shuru left="城市信息" right="{{addressCity}}" ifarrow="{{true}}" data-no="3"></shuru>
</view> </view>
<van-popup show="{{ show }}" position="bottom" bind:close="onClose"> <van-popup show="{{ show }}" position="bottom" bind:close="onClose" >
<van-tabs class="tab" swipe-threshold="5"> <van-tabs class="tab" swipe-threshold="5" active="{{active}}">
<van-tab title="{{area[0]}}"> <van-tab title="{{area[0]}}" disabled="{{tagDis[0]}}">
<view class="choose"> <view class="choose">
<view class="item" wx:for="{{arealist}}" bindtap="choose" data-type="0" data-id="{{item.id}}" data-name="{{item.name}}"> <view class="item" wx:for="{{arealist1}}" bindtap="choose1" data-type="0" data-id="{{item.id}}" data-name="{{item.name}}">
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
</van-tab> </van-tab>
<van-tab title="{{area[1]}}"> <van-tab title="{{area[1]}}" disabled="{{tagDis[1]}}" bingtap="choose2">
<view class="choose"> <view class="choose">
<view class="item" wx:for="{{arealist1}}" data-type="1" data-id="{{item.id}}" data-name="{{item.name}}"> <view class="item" wx:for="{{arealist2}}" bindtap="choose2" data-type="1" data-id="{{item.id}}" data-name="{{item.name}}">
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
</van-tab> </van-tab>
<van-tab title="{{area[2]}}"> <van-tab title="{{area[2]}}" disabled="{{tagDis[2]}}">
<view class="choose"> <view class="choose">
<view class="item" wx:for="{{arealist2}}" data-type="2" data-id="{{item.id}}" data-name="{{item.name}}"> <view class="item" wx:for="{{arealist3}}" bindtap="choose3" data-type="2" data-id="{{item.id}}" data-name="{{item.name}}">
{{item.name}} {{item.name}}
</view> </view>
</view> </view>

View File

@ -46,11 +46,10 @@ Page({
wx.showModal({ wx.showModal({
title: '确认', title: '确认',
content: '要删除这个地址吗?', content: '要删除这个地址吗?',
success(){ success(res){
console.log(e.currentTarget.dataset.id)
if (res.confirm) {
console.log('用户点击确定')
request({ request({
url: "User/validateOpenid", url: "User/validateOpenid",
}).then((res)=>{ }).then((res)=>{
@ -78,6 +77,12 @@ Page({
}) })
}) })
}) })
} else if (res.cancel) {
console.log('用户点击取消')
console.log("不能动啊")
}

View File

@ -1,4 +1,7 @@
.chooseaddress { .chooseaddress {
.box{
height: 910rpx
}
.addr { .addr {
margin-left: 30rpx; margin-left: 30rpx;
} }

View File

@ -1,7 +1,10 @@
<view class="chooseaddress"> <view class="chooseaddress">
<scroll-view class="box" scroll-y="{{true}}">
<view class="addr" wx:for="{{addresslist}}"> <view class="addr" wx:for="{{addresslist}}">
<address binddelete="delete" binddefault="setdefault"data-id="{{item.address_id}}" username="{{item.consignee}}" address="{{item.address}}" tel="{{item.mobile}}" youzheng="{{item.zipcode}}" isdefault="{{item.is_default}}"></address> <address binddelete="delete" binddefault="setdefault"data-id="{{item.address_id}}" username="{{item.consignee}}" address="{{item.address}}" tel="{{item.mobile}}" youzheng="{{item.zipcode}}" isdefault="{{item.is_default}}"></address>
</view> </view>
</scroll-view>
<!-- <view class="addr"> <!-- <view class="addr">
<address></address> <address></address>
</view> </view>

View File

@ -1,9 +1 @@
.chooseaddress .addr { .chooseaddress .box{height:910rpx}.chooseaddress .addr{margin-left:30rpx}.chooseaddress .btn1{position:fixed;bottom:149rpx;left:50rpx}
margin-left: 30rpx;
}
.chooseaddress .btn1 {
position: fixed;
bottom: 149rpx;
left: 50rpx;
}

View File

@ -1,5 +1,8 @@
// pages/undetermined/undetermined.js // pages/undetermined/undetermined.js
<<<<<<< HEAD
import bin from "../../utils/bin" import bin from "../../utils/bin"
=======
>>>>>>> 260785c6fe0a4997462040f4f8890f1da9a0deb6
Page({ Page({
/** /**