This commit is contained in:
cun-nan 2024-09-25 10:39:17 +08:00
parent 62672a5c09
commit c7c24f8413
4 changed files with 75 additions and 29 deletions

View File

@ -7,29 +7,33 @@
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="box-xianze" v-for="(item,index) in 3" :key="index">
<view class="" @click="choose(item)">
<view class="box-xianze" v-for="(item,index) in dataList" :key="index">
<view class="">
<view style="display: flex;align-items: center;margin-bottom: 5px;">
<view class="">{{item.address || '小王'}}</view>
<view style="margin: 0 10px;"> {{item.name || '先生'}}</view>
<view class=""> {{item.mobile || '15426886361'}}</view>
<view class="">{{item.name || '--'}}</view>
<view style="margin: 0 10px;" v-if="item.sex==0"> 先生</view>
<view style="margin: 0 10px;" v-if="item.sex==1"> 女士</view>
<view class=""> {{item.mobile || '--'}}</view>
</view>
</view>
<view class="box-xia">
<view class="box-left">
<u-checkbox v-model="checked" shape="circle" label="默认信息"></u-checkbox>
<u-checkbox-group>
<u-checkbox v-model="item.checked" shape="circle" label="默认信息"
@change="chooseDefault(item,$event)"></u-checkbox>
</u-checkbox-group>
</view>
<view class="box-right">
<view style="display: flex;" @click="goedit(item)">
<u-icon name="edit-pen-fill" size="12"></u-icon>
<view style="margin-left: 5px;">编辑</view>
</view>
<view style="display: flex;">
<view style="display: flex;" @click="delInfo(item)">
<u-icon name="trash" size="12"></u-icon>
<view style="margin-left: 5px;">删除</view>
</view>
</view>
</view>
</view>
@ -61,13 +65,39 @@
},
methods: {
chooseDefault(data,checked) {
if (checked) {
data.ifDefault = 1
}else{
data.ifDefault = 2
}
request({
url: '/business/userManager/mtUserExpressAddress',
method: 'put',
data:data
}).then((res) => {
if (res.code == 200) {
this.getList()
console.log(res,81);
}
})
},
getList() {
request({
url: 'business/userManager/mtUserExpressAddress/getList',
url: '/business/userManager/mtUserExpressAddress/getList',
method: 'get',
}).then((res) => {
if (res.code == 200) {
this.dataList = res.data
this.dataList.forEach(item => {
item.checked = false
if (item.ifDefault == 1) {
item.checked = true
}
this.$set(item, 'checked', item.checked); //
})
console.log(res,this.dataList,98);
this.$forceUpdate()
}
})
},
@ -84,6 +114,18 @@
url: '/pagesHome/editress/editress'
})
},
//
delInfo(data){
request({
url: '/business/userManager/mtUserExpressAddress',
method: 'delete',
params:{id:data.id}
}).then((res) => {
if (res.code == 200) {
this.getList()
}
})
},
choose(data) {
//
uni.$on('unChooseAddr', function() {

View File

@ -12,13 +12,13 @@
</view>
<view class="box-gang">
<view class="g-name">性别</view>
<view >
<u-radio-group v-model="dataForm.sex" >
<u-radio label="0">先生</u-radio>
<u-radio label="1">女士</u-radio>
<view>
<u-radio-group v-model="dataForm.sex">
<u-radio label="先生" :name="0"></u-radio>
<u-radio label="女士" :name="1"></u-radio>
</u-radio-group>
</view>
</view>
<view class="box-gang">
<view class="g-name">电话</view>
@ -52,12 +52,12 @@
title: '',
value: true,
dataForm: {
id: null,
name: '',
mobile: '',
address: '',
ifDefault: '',
fullAddress: '',
sex: "",
storeId: uni.getStorageSync("storeId")
}
}
@ -75,6 +75,7 @@
}
})
uni.$emit('unAddressInfo')
console.log(this.dataForm,78);
},
components: {
@ -87,13 +88,8 @@
uni.navigateBack()
},
goedit() {
if (this.value) {
this.dataForm.ifDefault = 1
} else {
this.dataForm.ifDefault = 2
}
let url = 'business/userManager/mtUserExpressAddress'
if (this.dataForm.id != null) {
let url = '/business/userManager/mtUserExpressAddress'
if (this.dataForm.id) {
request({
url: url,
method: 'put',
@ -123,7 +119,6 @@
})
}
console.log("123123", this.dataForm)
}
}
}

View File

@ -13,7 +13,7 @@
<view class="gang" v-if="qhindex == index"></view>
</view>
</scroll-view> -->
<view class="box-bai" v-if="qhindex == 0">
<view class="box-bai" v-if="qhindex == 0" @click="goAddress()">
<view class="dis">
<view class="boximg">
<image src="../../static/imgs/telicon.png"
@ -191,6 +191,11 @@
methods: {
goAddress(){
uni.navigateTo({
url:'/pagesHome/Address/Address'
})
},
//
async choose() {
let _this = this

View File

@ -28,6 +28,11 @@
</view>
</view>
</view>
<view v-if="!cardsList || cardsList.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty>
</view>
<u-overlay :show="shows">
<view class="boxck">
@ -64,7 +69,7 @@
storeId: '',
status: 0,
page: 1,
pageSize: 10
pageSize: 1000
},
title: '',
tabindex: 0,
@ -190,7 +195,7 @@
this.tabindex = index
console.log(index);
this.cardsList = []
this.query.useStatus = index
this.query.status = index
this.getGiftRecords()
@ -213,7 +218,6 @@
if (res.code == 200) {
this.cardsList = res.data.records
}
console.log(res.data, this.cardsList, 226);
})
}
}