[fix]调整下单,显示联系人及可以修改

main
huyuanxiang 1 year ago
parent 78dfbcab21
commit c4cfd122bb

@ -7,6 +7,16 @@
<text class="text2">{{modes || "请选择配送方式"}}</text> <text class="text2">{{modes || "请选择配送方式"}}</text>
<image src="/static/images/home/right.png"></image> <image src="/static/images/home/right.png"></image>
</view> </view>
<view class="order_address" style="height: auto;margin-bottom: 8px;">
<view class="row">
<view class="nominal">联系人</view>
<view class="input"><input class="input-text" v-model="userInfo.realname" placeholder="请输入联系人姓名" type="text"></input></view>
</view>
<view class="row">
<view class="nominal">电话号码</view>
<view class="input"><input class="input-text" v-model="userInfo.phone" placeholder="请输入联系人电话号码" type="number" maxlength="11"></input></view>
</view>
</view>
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="order_address" v-if="tapIndex == 0"> <view class="order_address" v-if="tapIndex == 0">
<image src="/static/images/home/bottom.png"></image> <image src="/static/images/home/bottom.png"></image>
@ -152,7 +162,11 @@ export default {
condition: ['新人专享'] condition: ['新人专享']
} }
], ],
themeObj: app.globalData.themeObj themeObj: app.globalData.themeObj,
userInfo: {
realname: getUserInfo().realname,
phone: getUserInfo().phone
}
}; };
}, },
@ -239,47 +253,57 @@ export default {
this.$toast('请先选择地址') this.$toast('请先选择地址')
return return
} }
const cartList = getCart() const that = this
const goodsIds = this.goodsList.map(v => v.id) uni.showModal({
const newCartList = cartList.filter(v => !goodsIds.includes(v.id)) content: '确定联系人及联系电话无误?',
const userInfo = getUserInfo() success: res => {
const params = { if (res.confirm) {
storeId: this.address.id, const cartList = getCart()
"recipient": userInfo.realname, const goodsIds = that.goodsList.map(v => v.id)
"addr": this.address.addr, const newCartList = cartList.filter(v => !goodsIds.includes(v.id))
"mobile": userInfo.phone, const userInfo = getUserInfo()
"orderDetailList": this.goodsList.map(v => { const params = {
return { storeId: that.address.id,
goodsId: v.id, "recipient": that.userInfo.realname,
goodsName: v.goodsName, "addr": that.address.addr,
goodsNo: v.number, "mobile": that.userInfo.phone,
price: v.price "orderDetailList": that.goodsList.map(v => {
return {
goodsId: v.id,
goodsName: v.goodsName,
goodsNo: v.number,
price: v.price
}
}),
state: 6,
"remark": that.remark,
"totalAmount": that.sumprice,
"userId": userInfo.id
} }
}), if (that.isConfirm) return
state: 6, that.isConfirm = true
"remark": this.remark, uni.showLoading({
"totalAmount": this.sumprice, mask: true
"userId": userInfo.id })
} addOrder(params).then(res => {
if (this.isConfirm) return uni.hideLoading()
this.isConfirm = true that.isConfirm = false
uni.showLoading({ if (res.result) {
mask: true that.$toast('添加成功')
}) resetCart(newCartList)
addOrder(params).then(res => { setTabBarBadge(newCartList.length)
uni.hideLoading() //
this.isConfirm = false uni.redirectTo({
if (res.result) { url: '/pages/views/order/success'
this.$toast('添加成功') });
resetCart(newCartList) }
setTabBarBadge(newCartList.length) })
//
uni.redirectTo({ } else if (res.cancel) {
url: '/pages/views/order/success'
}); }
} }
}) });
}, },
selectMode() { selectMode() {
@ -368,6 +392,26 @@ page {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
box-shadow: 0upx 0upx 10upx #ddd; box-shadow: 0upx 0upx 10upx #ddd;
.row {
color: #999;
display: flex;
line-height: 60upx;
height: 60upx;
padding: 0 20upx;
font-size: 24upx;
.nominal {
width: 22%;
}
.input {
display: flex;
align-items: center;
margin-left: 20px;
}
.input-text {
color: #000;
font-size: 24upx;
}
}
} }
.order_address image { .order_address image {

@ -2,6 +2,16 @@
<view> <view>
<view class="order" :class="['theme', themeObj.name]"> <view class="order" :class="['theme', themeObj.name]">
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="order_address" style="height: auto;margin-bottom: 8px;">
<view class="row">
<view class="nominal">联系人</view>
<view class="input"><input class="input-text" v-model="goods.recipient" disabled="true" placeholder="请输入联系人姓名" type="text"></input></view>
</view>
<view class="row">
<view class="nominal">电话号码</view>
<view class="input"><input class="input-text" v-model="goods.mobile" disabled="" placeholder="请输入联系人电话号码" type="number" maxlength="11"></input></view>
</view>
</view>
<view class="order_address"> <view class="order_address">
<image src="/static/images/home/bottom.png"></image> <image src="/static/images/home/bottom.png"></image>
<view class="address_box"> <view class="address_box">
@ -518,6 +528,26 @@ page {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
box-shadow: 0upx 0upx 10upx #ddd; box-shadow: 0upx 0upx 10upx #ddd;
.row {
color: #999;
display: flex;
line-height: 60upx;
height: 60upx;
padding: 0 20upx;
font-size: 24upx;
.nominal {
width: 22%;
}
.input {
display: flex;
align-items: center;
margin-left: 20px;
}
.input-text {
color: #000;
font-size: 24upx;
}
}
} }
.order_address image { .order_address image {

@ -7,7 +7,7 @@
<view class="user" @click="onLogin"> <view class="user" @click="onLogin">
<image :src="userdata.avatar" v-if="userdata.avatar"></image> <image :src="userdata.avatar" v-if="userdata.avatar"></image>
<image src="../../../static/images/face.jpg" v-else></image> <image src="../../../static/images/face.jpg" v-else></image>
<text>{{userdata.username || '-'}}</text> <text>{{userdata.realname || '-'}}</text>
</view> </view>
</view> </view>
<view class="vip"> <view class="vip">

Loading…
Cancel
Save