chenkun 8 months ago
parent
commit
c9bfb7c9d5
7 changed files with 397 additions and 284 deletions
  1. +1
    -1
      api/api.js
  2. +1
    -1
      pages_order/auth/customsClearApply.vue
  3. +4
    -4
      pages_order/center/addressListManage.vue
  4. +225
    -224
      pages_order/components/address/addressList.vue
  5. +2
    -1
      pages_order/components/order/orderList.vue
  6. +22
    -22
      pages_order/order/offerOrBillLading.vue
  7. +142
    -31
      pages_order/tradingPlatform/nowOrder.vue

+ 1
- 1
api/api.js View File

@ -125,7 +125,7 @@ const config = {
// 用户地址表-删除 // 用户地址表-删除
deleteAddress: { deleteAddress: {
url: '/address/edit', url: '/address/edit',
method: 'PUT',
method: 'POST',
}, },
// 用户地址表-分页列表查询 // 用户地址表-分页列表查询
addressList: { addressList: {


+ 1
- 1
pages_order/auth/customsClearApply.vue View File

@ -25,7 +25,7 @@
<view class="item"> <view class="item">
<view>{{ $t('other.companyName') }}</view> <view>{{ $t('other.companyName') }}</view>
<view> <view>
<input v-model="form.companyName" type="number" :placeholder="$t('other.enterCompanyName')"
<input v-model="form.companyName" :placeholder="$t('other.enterCompanyName')"
clearable></input> clearable></input>
</view> </view>
</view> </view>


+ 4
- 4
pages_order/center/addressListManage.vue View File

@ -107,8 +107,10 @@ export default {
// //
editDefault(id) { editDefault(id) {
this.$api('addressDefault', {
this.$api('editAddress', {
id: id, id: id,
defaultFlag: 1
}, res => { }, res => {
if (res.code == 200) { if (res.code == 200) {
this.$refs.addressPopup.close() this.$refs.addressPopup.close()
@ -129,9 +131,7 @@ export default {
content: this.$t('components.confirmDeleteAddress'), content: this.$t('components.confirmDeleteAddress'),
success(e) { success(e) {
if(e.confirm){ if(e.confirm){
self.$api('deleteAddress', {
id
}, res => {
self.$api('editAddress', {id: id, isDisable: 1, defaultFla: 0}, res => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: this.$t('components.deleteSuccessful'), title: this.$t('components.deleteSuccessful'),


+ 225
- 224
pages_order/components/address/addressList.vue View File

@ -1,232 +1,233 @@
<template> <template>
<scroll-view scroll-y="true" :style="{height: height}" @scrolltolower="moreAddress">
<uv-radio-group v-model="selectAddress" @change="editDefault" v-if="addressList.length > 0">
<view v-for="item in addressList" :key="item.id" class="address-item">
<view class="address-item-top" @click="select(item)">
<view class="img-box">
<image src="/static/image/address/icon.png" mode="aspectFill"></image>
</view>
<view class="address-info">
<view class="user-info">
<text class="user-name">{{ item.name }}</text>
<text class="user-phone">{{ item.phone }}</text>
<text v-if="item.id == selectAddress" class="is-default">默认</text>
</view>
<view class="address-detail">
{{ item.address + " " + item.addressDetail }}
</view>
</view>
</view>
<view class="controls" v-if="controls">
<view class="default-checkbox">
<uv-radio :name="item.id" label-disabled size="30rpx" icon-size="30rpx">
默认地址
</uv-radio>
</view>
<view class="edit-btn">
<uv-icon name="edit-pen"></uv-icon>
<text @click="editAddress(item)" class="control-title">编辑</text>
</view>
<view class="del-btn" @click="deleteAddress(item.id)">
<uv-icon name="trash"></uv-icon>
<text class="control-title">删除</text>
</view>
</view>
</view>
</uv-radio-group>
<view style="padding: 100rpx 0;" v-else>
<uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
</view>
</scroll-view>
<scroll-view :style="{height: height}" scroll-y="true" @scrolltolower="moreAddress">
<uv-radio-group v-if="addressList.length > 0" v-model="selectAddress" @change="editDefault">
<view v-for="item in addressList" :key="item.id" class="address-item">
<view class="address-item-top" @click="select(item)">
<view class="img-box">
<image mode="aspectFill" src="/static/image/address/icon.png"></image>
</view>
<view class="address-info">
<view class="user-info">
<text class="user-name">{{ item.name }}</text>
<text class="user-phone">{{ item.phone }}</text>
<text v-if="item.id == selectAddress" class="is-default">默认</text>
</view>
<view class="address-detail">
{{ item.address + " " + item.addressDetail }}
</view>
</view>
</view>
<view v-if="item.defaultFlag=1" class="controls">
<view class="default-checkbox" @click="editDefault(item.id)">
<uv-radio :name="item.id" icon-size="30rpx" label-disabled size="30rpx">
默认地址
</uv-radio>
</view>
<view class="edit-btn">
<uv-icon name="edit-pen"></uv-icon>
<text class="control-title" @click="editAddress(item)">编辑</text>
</view>
<view class="del-btn" @click="deleteAddress(item.id)">
<uv-icon name="trash"></uv-icon>
<text class="control-title">删除</text>
</view>
</view>
</view>
</uv-radio-group>
<view v-else style="padding: 100rpx 0;">
<uv-empty iconSize="100rpx" mode="history" textSize="28rpx"/>
</view>
</scroll-view>
</template> </template>
<script> <script>
export default {
props: {
controls: {
default: false,
type: Boolean,
},
height: {
default: 'calc(90vh - 180rpx)'
}
},
data() {
return {
selectAddress: 0,
queryParams: {
pageNo: 1,
pageSize: 10,
},
addressList: [],
total: 0,
}
},
created() {
},
methods: {
//
getAddressList() {
return new Promise((success, fail) => {
this.$api('addressList', this.queryParams, res => {
if (res.code == 200) {
console.log("res.result.records", res.result.records)
this.addressList = res.result.records || [];
this.total = res.result.total || 0;
this.addressList.forEach(n => { //
if (n.defaultFlag == 1) {
this.selectAddress = n.id
}
})
success(res.result)
}
})
})
},
//
moreAddress() {
if (this.queryParams.pageSize > this.total) {
return
}
this.queryParams.pageSize += 10
this.getAddressList()
},
//
deleteAddress(e) {
this.$emit('deleteAddress', e)
},
//
editAddress(e) {
this.$emit('editAddress', e)
},
//
editDefault(e) {
this.$emit('editDefault', e)
},
//
select(e) {
this.$emit('select', e)
},
}
}
export default {
props: {
controls: {
default: false,
type: Boolean,
},
height: {
default: 'calc(90vh - 180rpx)'
}
},
data() {
return {
selectAddress: 0,
queryParams: {
pageNo: 1,
pageSize: 10,
},
addressList: [],
total: 0,
}
},
created() {
},
methods: {
//
getAddressList() {
return new Promise((success, fail) => {
this.$api('addressList', this.queryParams, res => {
if (res.code == 200) {
console.log("res.result.records", res.result.records)
this.addressList = res.result.records || [];
this.total = res.result.total || 0;
this.addressList.forEach(n => { //
if (n.defaultFlag == 1) {
this.selectAddress = n.id
}
})
success(res.result)
}
})
})
},
//
moreAddress() {
if (this.queryParams.pageSize > this.total) {
return
}
this.queryParams.pageSize += 10
this.getAddressList()
},
//
deleteAddress(e) {
this.$emit('deleteAddress', e)
},
//
editAddress(e) {
this.$emit('editAddress', e)
},
//
editDefault(e) {
this.$emit('editDefault', e)
},
//
select(e) {
this.$emit('select', e)
},
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.address-item {
background: white;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 20rpx;
padding: 15rpx 15rpx 0rpx 15rpx;
width: 680rpx;
.address-item-top {
border-bottom: 1px dashed #D3D1D1;
display: flex;
align-items: center;
padding: 0rpx 0rpx 15rpx 0rpx;
.img-box {
width: 120rpx;
height: 120rpx;
image {
width: 75%;
height: 75%;
display: block;
margin: 12.5% auto;
}
}
.address-info {
width: calc(100% - 120rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.user-info {
display: flex;
align-items: center;
text {
display: block;
line-height: 40rpx;
margin-right: 20rpx;
}
.user-name,
.user-phone {
font-size: 30rpx;
}
.is-default {
display: flex;
align-items: center;
justify-content: center;
background: #FEB773;
color: white;
width: 80rpx;
height: 35rpx;
border-radius: 20rpx;
font-size: 22rpx;
}
}
.address-detail {
color: #4a4a4a;
font-size: 26rpx;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
}
}
}
.controls {
display: flex;
align-items: center;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
padding: 15rpx 15rpx 25rpx 15rpx;
.default-checkbox {
display: flex;
text {
margin-left: 8rpx;
}
}
.control-title {
height: 30rpx;
line-height: 30rpx;
color: #666666;
}
view {
display: flex;
align-items: center;
}
image {
width: 23rpx;
height: 23rpx;
vertical-align: middle;
margin-right: 8rpx;
}
}
}
.address-item {
background: white;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 20rpx;
padding: 15rpx 15rpx 0rpx 15rpx;
width: 680rpx;
.address-item-top {
border-bottom: 1px dashed #D3D1D1;
display: flex;
align-items: center;
padding: 0rpx 0rpx 15rpx 0rpx;
.img-box {
width: 120rpx;
height: 120rpx;
image {
width: 75%;
height: 75%;
display: block;
margin: 12.5% auto;
}
}
.address-info {
width: calc(100% - 120rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.user-info {
display: flex;
align-items: center;
text {
display: block;
line-height: 40rpx;
margin-right: 20rpx;
}
.user-name,
.user-phone {
font-size: 30rpx;
}
.is-default {
display: flex;
align-items: center;
justify-content: center;
background: #FEB773;
color: white;
width: 80rpx;
height: 35rpx;
border-radius: 20rpx;
font-size: 22rpx;
}
}
.address-detail {
color: #4a4a4a;
font-size: 26rpx;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
}
}
}
.controls {
display: flex;
align-items: center;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
padding: 15rpx 15rpx 25rpx 15rpx;
.default-checkbox {
display: flex;
text {
margin-left: 8rpx;
}
}
.control-title {
height: 30rpx;
line-height: 30rpx;
color: #666666;
}
view {
display: flex;
align-items: center;
}
image {
width: 23rpx;
height: 23rpx;
vertical-align: middle;
margin-right: 8rpx;
}
}
}
</style> </style>

+ 2
- 1
pages_order/components/order/orderList.vue View File

@ -129,7 +129,8 @@
padding: 20rpx; padding: 20rpx;
border-radius: 40rpx; border-radius: 40rpx;
background-color: #fff; background-color: #fff;
overflow: hidden;
//overflow: hidden;
//height:300px;
.top { .top {
display: flex; display: flex;


+ 22
- 22
pages_order/order/offerOrBillLading.vue View File

@ -53,18 +53,18 @@
<!-- </view>--> <!-- </view>-->
<!--</view>--> <!--</view>-->
<!--详细地址-->
<view class="item" v-if="address.addressDetail">
<view>{{ $t('components.detailedAddress') }}</view>
<view>
<view class="">
{{ address.address }}
</view>
<view class="">
{{ address.addressDetail }}
</view>
</view>
</view>
<!--详细地址-->
<view v-if="address.addressDetail" class="item">
<view>{{ $t('components.detailedAddress') }}</view>
<view>
<view class="">
{{ address.address + ' ' + address.addressDetail }}
<!--</view>-->
<!--<view class="">-->
<!-- {{ address.addressDetail }}-->
</view>
</view>
</view>
<!--交货日期--> <!--交货日期-->
<view class="delivery-date" @click="startDateOpen"> <view class="delivery-date" @click="startDateOpen">
@ -107,7 +107,7 @@
<span class="lxwm" @click="contactUs"> <span class="lxwm" @click="contactUs">
{{ $t('components.contactUs') }} {{ $t('components.contactUs') }}
</span> </span>
<span class="tip">{{ $t('components.contactTip') }}</span>
<span class="tip">如有疑问请联系我们</span>
</view> </view>
</view> </view>
@ -126,14 +126,14 @@
</template> </template>
<script> <script>
import topbar from "@/components/base/topbar.vue";
import tabber from "@/components/base/tabbar.vue";
import customerServicePopup from "@/components/config/customerServicePopup.vue";
import Position from "@/utils/position";
import dayjs from "dayjs";
import AddressList from "@/pages_order/components/address/addressList.vue";
export default {
import topbar from "@/components/base/topbar.vue";
import tabber from "@/components/base/tabbar.vue";
import customerServicePopup from "@/components/config/customerServicePopup.vue";
import Position from "@/utils/position";
import dayjs from "dayjs";
import AddressList from "@/pages_order/components/address/addressList.vue";
export default {
name: "offer", name: "offer",
components: { components: {
AddressList, AddressList,
@ -156,7 +156,7 @@
"addressId": "", "addressId": "",
"num": 0, "num": 0,
"price": 0, "price": 0,
"transactionTime": ""
"transactionTime": dayjs(new Date()).format("YYYY-MM-DD")
}, },
address: { address: {
name: '请选择地址', name: '请选择地址',


+ 142
- 31
pages_order/tradingPlatform/nowOrder.vue View File

@ -21,28 +21,56 @@
<!--<uv-divider text="" :hairline="true"></uv-divider>--> <!--<uv-divider text="" :hairline="true"></uv-divider>-->
<!--提货地点--> <!--提货地点-->
<view class="currentRegion">
<view>{{ $t('components.pickupLocation') }}</view>
<!-- <view @click.stop="selectAddr">
<input class="input" disabled v-model="form.currentRegion" placeholder="请选择所在地区"></input>
<view class="orientation">
<img src="../../static/image/address/selectIcon.png"
style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;">
</view>
</view> -->
<view class="">
{{ fatherData.address }}
</view>
</view>
<!--<view class="currentRegion">-->
<!-- <view>{{ $t('components.pickupLocation') }}</view>-->
<!-- &lt;!&ndash; <view @click.stop="selectAddr">-->
<!-- <input class="input" disabled v-model="form.currentRegion" placeholder="请选择所在地区"></input>-->
<!-- <view class="orientation">-->
<!-- <img src="../../static/image/address/selectIcon.png"-->
<!-- style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;">-->
<!-- </view>-->
<!-- </view> &ndash;&gt;-->
<!-- <view class="">-->
<!-- {{ fatherData.address }}-->
<!-- </view>-->
<!--</view>-->
<view class="addressA" @click="openAddress">
<view class="title">提货地点</view>
<view class="address" style="width: 70%">
<image mode="" src="/static/image/address/selectIcon.png"></image>
<view class="">
{{ address.name }}
</view>
<view class="icon">
<uv-icon name="arrow-right" size="30rpx"></uv-icon>
</view>
</view>
</view>
<!--详细地址-->
<view v-if="address.addressDetail" class="item">
<view>{{ $t('components.detailedAddress') }}</view>
<view>
<view class="">
{{ address.address + ' ' + address.addressDetail }}
<!--</view>-->
<!--<view class="">-->
<!-- {{ address.addressDetail }}-->
</view>
</view>
</view>
<!--&lt;!&ndash;详细地址&ndash;&gt;-->
<!--<view class="item">-->
<!-- <view>{{ $t('components.detailedAddress') }}</view>-->
<!-- <view>-->
<!-- &lt;!&ndash; <input v-model="form.address" placeholder="请输入详细地址" clearable></input> &ndash;&gt;-->
<!-- </view>-->
<!--</view>-->
<!--详细地址-->
<view class="item">
<view>{{ $t('components.detailedAddress') }}</view>
<view>
<!-- <input v-model="form.address" placeholder="请输入详细地址" clearable></input> -->
</view>
</view>
<!--交货日期--> <!--交货日期-->
<view class="delivery-date"> <view class="delivery-date">
@ -114,21 +142,27 @@
<!-- 联系客服弹框 --> <!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" /> <customerServicePopup ref="customerServicePopup" />
<!-- 地址选择弹框 -->
<uv-popup ref="addressPopup" :round="30">
<addressList ref="addressList" height="60vh" @select="selectAddress"/>
</uv-popup>
</view> </view>
</template> </template>
<script> <script>
import topbar from "@/components/base/topbar.vue";
import {
mapGetters
} from 'vuex'
import Position from '@/utils/position.js'
import dayjs from "dayjs";
import customerServicePopup from '@/components/config/customerServicePopup.vue'
export default {
import topbar from "@/components/base/topbar.vue";
import {mapGetters} from 'vuex'
import Position from '@/utils/position.js'
import dayjs from "dayjs";
import customerServicePopup from '@/components/config/customerServicePopup.vue'
import AddressList from "@/pages_order/components/address/addressList.vue";
export default {
name: "nowOrder", name: "nowOrder",
components: { components: {
AddressList,
topbar, topbar,
customerServicePopup, customerServicePopup,
}, },
@ -164,9 +198,13 @@
"num": 1, "num": 1,
"price": 0, "price": 0,
"productId": "", "productId": "",
"takeTime": ""
"takeTime": dayjs(new Date()).format("YYYY-MM-DD"),
}, },
id : 0, id : 0,
address: {
name: '请选择地址',
addressDetail: '',
},
} }
}, },
@ -204,6 +242,12 @@
this.$refs.customerServicePopup.open() this.$refs.customerServicePopup.open()
}, },
//
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
},
startDateChange(val) { startDateChange(val) {
this.$nextTick(() => { this.$nextTick(() => {
this.form.takeTime = dayjs(val.value).format("YYYY-MM-DD") this.form.takeTime = dayjs(val.value).format("YYYY-MM-DD")
@ -226,7 +270,29 @@
this.form.address = res this.form.address = res
}) })
}, },
openAddress() {
this.$refs.addressPopup.open('bottom')
// this.getAddressList()
this.$nextTick(() => {
this.getAddressListA()
})
},
//
getAddressListA() {
this.$refs.addressList
.getAddressList()
.then(res => {
if (res == 0) {
this.$refs.popup.close()
return uni.navigateTo({
url: '/pages_order/mine/address?type=back'
})
}
})
},
// //
setAddress(res) { setAddress(res) {
// //
@ -466,6 +532,51 @@
} }
} }
.addressA {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
//padding: 10rpx 0 0 20rpx;
.title {
display: flex;
align-items: center;
justify-content: flex-start;
font-weight: 400;
width: 30%;
}
.address {
width: 70%;
display: flex;
padding: 20rpx;
background-color: #fff;
image {
width: 30rpx;
height: 30rpx;
margin: 10rpx;
}
view {
//margin: 20rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
.icon {
display: flex;
justify-content: center;
align-items: center;
margin-left: auto;
}
}
}
.currentRegion { .currentRegion {
display: flex; display: flex;
align-items: center; align-items: center;


Loading…
Cancel
Save