diff --git a/pages/views/order/confirmOrder.vue b/pages/views/order/confirmOrder.vue index 7b0ec27..389dc0b 100644 --- a/pages/views/order/confirmOrder.vue +++ b/pages/views/order/confirmOrder.vue @@ -7,6 +7,16 @@ {{modes || "请选择配送方式"}} + + + 联系人 + + + + 电话号码 + + + @@ -123,7 +133,7 @@ import { addOrder } from "../../../api"; export default { data() { return { - + couponshow: false, modes: '现场提货', tapIndex: 0, @@ -152,7 +162,11 @@ export default { condition: ['新人专享'] } ], - themeObj: app.globalData.themeObj + themeObj: app.globalData.themeObj, + userInfo: { + realname: getUserInfo().realname, + phone: getUserInfo().phone + } }; }, @@ -189,7 +203,7 @@ export default { * 生命周期函数--监听页面隐藏 */ onHide: function () { - + }, /** @@ -219,7 +233,7 @@ export default { }) sumprice += resetNum(this.freight) this.sumprice = resetNum(sumprice, 'end') - this.nowprice = resetNum(sumprice, 'end') + this.nowprice = resetNum(sumprice, 'end') }, openCoupon(index) { this.setData({ @@ -239,47 +253,57 @@ export default { this.$toast('请先选择地址') return } - const cartList = getCart() - const goodsIds = this.goodsList.map(v => v.id) - const newCartList = cartList.filter(v => !goodsIds.includes(v.id)) - const userInfo = getUserInfo() - const params = { - storeId: this.address.id, - "recipient": userInfo.realname, - "addr": this.address.addr, - "mobile": userInfo.phone, - "orderDetailList": this.goodsList.map(v => { - return { - goodsId: v.id, - goodsName: v.goodsName, - goodsNo: v.number, - price: v.price + const that = this + uni.showModal({ + content: '确定联系人及联系电话无误?', + success: res => { + if (res.confirm) { + const cartList = getCart() + const goodsIds = that.goodsList.map(v => v.id) + const newCartList = cartList.filter(v => !goodsIds.includes(v.id)) + const userInfo = getUserInfo() + const params = { + storeId: that.address.id, + "recipient": that.userInfo.realname, + "addr": that.address.addr, + "mobile": that.userInfo.phone, + "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 } - }), - state: 6, - "remark": this.remark, - "totalAmount": this.sumprice, - "userId": userInfo.id - } - if (this.isConfirm) return - this.isConfirm = true - uni.showLoading({ - mask: true - }) - addOrder(params).then(res => { - uni.hideLoading() - this.isConfirm = false - if (res.result) { - this.$toast('添加成功') - resetCart(newCartList) - setTabBarBadge(newCartList.length) - //提交订单 - uni.redirectTo({ - url: '/pages/views/order/success' - }); - } - }) + if (that.isConfirm) return + that.isConfirm = true + uni.showLoading({ + mask: true + }) + addOrder(params).then(res => { + uni.hideLoading() + that.isConfirm = false + if (res.result) { + that.$toast('添加成功') + resetCart(newCartList) + setTabBarBadge(newCartList.length) + //提交订单 + uni.redirectTo({ + url: '/pages/views/order/success' + }); + } + }) + } else if (res.cancel) { + + } + } + }); }, selectMode() { @@ -295,7 +319,7 @@ export default { } }); }, - + setAddress() { uni.navigateTo({ url: '/pages/views/user/myaddress' @@ -311,7 +335,7 @@ export default { this.sumprice = this.sumprice - item.reduce }, notUsed(){ //不使用优惠券 重置金额 - + this.couponshow = false this.goodsList[this.couponIndex].couponName = '' if(this.goodsList[this.couponIndex].couponReduce){ @@ -368,6 +392,26 @@ page { overflow: hidden; position: relative; 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 { @@ -631,4 +675,4 @@ page { height: 55vh; z-index: 500; } - \ No newline at end of file + diff --git a/pages/views/order/orderDetails.vue b/pages/views/order/orderDetails.vue index e3f9dc7..649a368 100644 --- a/pages/views/order/orderDetails.vue +++ b/pages/views/order/orderDetails.vue @@ -2,6 +2,16 @@ + + + 联系人 + + + + 电话号码 + + + @@ -518,6 +528,26 @@ page { overflow: hidden; position: relative; 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 { diff --git a/pages/views/tabBar/user.vue b/pages/views/tabBar/user.vue index dcabbd5..618ae26 100644 --- a/pages/views/tabBar/user.vue +++ b/pages/views/tabBar/user.vue @@ -7,7 +7,7 @@ - {{userdata.username || '-'}} + {{userdata.realname || '-'}}