订单添加备注
This commit is contained in:
parent
83afd6216e
commit
eedb40b9d0
@ -139,9 +139,9 @@ export default {
|
||||
});
|
||||
},
|
||||
// 订单步骤2:发起订单,返回订单信息
|
||||
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, member_deliver_type, invoice_id }) {
|
||||
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, member_deliver_type, invoice_id, pay_message }) {
|
||||
return vm.$u.post('buy/buy_step2', {
|
||||
ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, member_deliver_type, invoice_id,
|
||||
ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, member_deliver_type, invoice_id, pay_message
|
||||
});
|
||||
},
|
||||
// 订单步骤3:发起支付(第三方统一下单)
|
||||
|
@ -34,24 +34,29 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<view @click="showCoupon({type: 2, store_id: item[0].store_id})" v-if="orderType == 1 || orderType == 5">
|
||||
<view class="show-view" @click="showCoupon({type: 2, store_id: item[0].store_id})" v-if="orderType == 1 || orderType == 5">
|
||||
<view class="title">优惠券折扣</view>
|
||||
<view class="value">
|
||||
<view>-¥{{ storeCoupon[item[0].store_id] ? storeCoupon[item[0].store_id].voucher_price.toFixed(2) : '0.00' }}</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="show-view">
|
||||
<view class="title">运费</view>
|
||||
<view class="value">
|
||||
<view v-if="freight">¥{{ freight | setFreight(index) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="remark">
|
||||
<view class="title">订单备注</view>
|
||||
<u-input v-model="remark[index]" type="textarea" :height="88" placeholder="选填" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="pick-up" v-if="delivery.type == 3">
|
||||
<view class="title">自提地址</view>
|
||||
<view class="content">{{ orderInfo.store_list[index].store_address }}</view>
|
||||
</view>
|
||||
<view class="store-total">共{{ item | getTotalNum }}件 小计:<text>¥{{ orderInfo.store_goods_total[index] | getStorePrice(storeCoupon, index) }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-active">
|
||||
@ -146,12 +151,34 @@ export default {
|
||||
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
|
||||
debounce: true,
|
||||
hasInvoice: 0,
|
||||
remark: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Coupon
|
||||
},
|
||||
filters: {
|
||||
// 店铺总数量
|
||||
getTotalNum(data, coupon) {
|
||||
let num = 0;
|
||||
data.forEach(item => {
|
||||
num += item.goods_num;
|
||||
})
|
||||
return num;
|
||||
},
|
||||
// 店铺总金额
|
||||
getStorePrice(price, coupon, index) {
|
||||
for (const key in coupon) {
|
||||
if (coupon.hasOwnProperty(key)) {
|
||||
const element = coupon[key];
|
||||
if(index == key) {
|
||||
price -= Number(element.voucher_price);
|
||||
}
|
||||
}
|
||||
}
|
||||
return price;
|
||||
},
|
||||
// 订单总数量
|
||||
setTotalNumber(data) {
|
||||
let num = 0;
|
||||
for (const key in data) {
|
||||
@ -175,6 +202,7 @@ export default {
|
||||
if(!this.orderInfo.is_selfraising) this.deliveryList[2].disabled = true;
|
||||
// console.log('orderType' + this.orderType);
|
||||
// console.log(this.orderInfo);
|
||||
this.initRemark();
|
||||
this.getGoodsClass();
|
||||
this.setTotalPrice();
|
||||
},
|
||||
@ -188,8 +216,9 @@ export default {
|
||||
} else {
|
||||
if(this.$store.getters.getOrderAddress) this.addressInfo = this.$store.state.orderAddress;
|
||||
}
|
||||
// 是否开发票
|
||||
this.hasInvoice = this.$store.getters.hasInvoice;
|
||||
console.log(this.hasInvoice);
|
||||
// console.log(this.hasInvoice);
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$store.commit('updateAddress', {});
|
||||
@ -202,6 +231,17 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initRemark() {
|
||||
// 初始化备注
|
||||
const obj = this.orderInfo.store_cart_list;
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
const element = obj[key];
|
||||
this.remark[key] = '';
|
||||
}
|
||||
}
|
||||
console.log(this.remark);
|
||||
},
|
||||
// 如果有pintuangroup_headid为参团不然为开团
|
||||
async withImmediate(type) {
|
||||
let params = {
|
||||
@ -228,6 +268,7 @@ export default {
|
||||
})
|
||||
},
|
||||
intermediate() {
|
||||
console.log(this.remark);
|
||||
if(!this.debounce) return;
|
||||
this.debounce = false;
|
||||
if(this.orderType == 2) {
|
||||
@ -281,6 +322,7 @@ export default {
|
||||
buy_city_id: this.addressInfo.city_id,
|
||||
member_deliver_type: this.delivery.type,
|
||||
invoice_id: this.$store.getters.getInvoiceId, // 发票抬头ID,不开票传0
|
||||
pay_message: this.remark,
|
||||
}
|
||||
if(coupon.length) Object.assign(params, { voucher_id: coupon });
|
||||
if(this.orderType == 2) {
|
||||
@ -288,6 +330,7 @@ export default {
|
||||
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
||||
}
|
||||
// console.log(params);
|
||||
// return;
|
||||
this.$u.api.sendOrder(params).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$u.route({
|
||||
@ -587,7 +630,7 @@ export default {
|
||||
}
|
||||
}
|
||||
.order-info {
|
||||
> view {
|
||||
.show-view {
|
||||
height: 98rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
padding: 35rpx 30rpx;
|
||||
@ -612,6 +655,24 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.remark {
|
||||
background: rgba(255,255,255,1);
|
||||
padding: 35rpx 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 2rpx;
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: rgba(102,102,102,1);
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
/deep/ .u-input {
|
||||
font-size: 28rpx;
|
||||
.u-input__textarea {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.pick-up {
|
||||
padding: 30rpx;
|
||||
@ -627,6 +688,16 @@ export default {
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
.store-total {
|
||||
text-align: right;
|
||||
padding: 34rpx 30rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
font-size: 28rpx;
|
||||
color: #656565;
|
||||
> text {
|
||||
color: #FF770F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.common-active {
|
||||
|
101
pageE/mine/Contact.vue
Normal file
101
pageE/mine/Contact.vue
Normal file
@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view class="contact">
|
||||
<view class="item-view" @click="makePhone">
|
||||
<view class="title">联系电话</view>
|
||||
<view class="content">{{ phoneNumber }}</view>
|
||||
<u-icon name="arrow-right" color="#9A9A9A" size="24"></u-icon>
|
||||
</view>
|
||||
<view class="item-view" @click="customerService">
|
||||
<view class="title">客服服务</view>
|
||||
<u-icon name="arrow-right" color="#9A9A9A" size="24"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getPhone();
|
||||
},
|
||||
methods: {
|
||||
getPhone() {
|
||||
this.$u.api.getConfigInfo({
|
||||
code: 'site_tel400'
|
||||
}).then(res => {
|
||||
this.phoneNumber = res.data.config.value;
|
||||
})
|
||||
},
|
||||
makePhone() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.phoneNumber,
|
||||
});
|
||||
},
|
||||
customerService(){
|
||||
if(!this.$store.state.hasLogin){
|
||||
this.$u.toast('请先登录');
|
||||
} else {
|
||||
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
|
||||
this.uuid = uuid;
|
||||
this.name = name;
|
||||
this.avatar = avatar;
|
||||
this.online = false;
|
||||
this.unReadMessage = 0;
|
||||
this.text = text;
|
||||
this.time = time;
|
||||
this.date = date
|
||||
}
|
||||
const token = uni.getStorageSync('token');
|
||||
let that = this
|
||||
uni.request({
|
||||
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
|
||||
data:{
|
||||
userId: 1
|
||||
},
|
||||
method:"POST",
|
||||
header:{
|
||||
"Authorization" : 'Bearer' + " " + token
|
||||
},
|
||||
success(res){
|
||||
res = res.data;
|
||||
let user = new Friend(res.data.member_id,res.data.store_name,res.data.member_avatar);
|
||||
that.$u.route({
|
||||
url:"/pageD/privateChat/privateChat",
|
||||
params:{
|
||||
id:JSON.stringify(user)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.contact {
|
||||
border-top: 1rpx solid #ECECEC;
|
||||
.item-view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 34rpx 30rpx;
|
||||
border-bottom: 2rpx solid #ECECEC;
|
||||
.title {
|
||||
font-size: 30rpx;
|
||||
color: #343434;
|
||||
}
|
||||
.content {
|
||||
margin-left: auto;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.u-icon {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
13
pages.json
13
pages.json
@ -780,6 +780,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "mine/Contact",
|
||||
"style": {
|
||||
"navigationBarTitleText": "联系我们",
|
||||
"app-plus": {
|
||||
"titleSize": "36px",
|
||||
"titleNView": {
|
||||
"titleColor": "#333333",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "mine/Integral",
|
||||
"style": {
|
||||
|
@ -16,7 +16,10 @@
|
||||
<view class="user-rank">等级:{{ userInfo.member_level || 0 }}级</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="member-service" @click="toOtherPage('/mine/MemberServe')">会员服务</view>
|
||||
<view class="btn">
|
||||
<view class="member-service" @click="toOtherPage('/mine/MemberServe')">会员服务</view>
|
||||
<view class="member-service" @click="toOtherPage('/mine/Contact')">联系我们</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view @click="toOtherPage('/mine/GoodsCollection')">
|
||||
@ -243,6 +246,7 @@ export default {
|
||||
// width: 100%;
|
||||
height: 272rpx;
|
||||
background-color: #FF7807;
|
||||
position: relative;
|
||||
.top {
|
||||
padding: 40rpx 0 0 30rpx;
|
||||
display: flex;
|
||||
@ -299,16 +303,23 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.member-service {
|
||||
height: 52rpx;
|
||||
line-height: 52rpx;
|
||||
box-sizing: content-box;
|
||||
margin-left: auto;
|
||||
padding: 0 51rpx 0 22rpx;
|
||||
background: rgba(255,255,255,0.32);
|
||||
border-radius: 26rpx 0 0 26rpx;
|
||||
font-size: 26rpx;
|
||||
color:rgba(51,51,51,1);
|
||||
.btn {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 43rpx;
|
||||
.member-service {
|
||||
height: 52rpx;
|
||||
line-height: 52rpx;
|
||||
box-sizing: content-box;
|
||||
padding: 0 51rpx 0 22rpx;
|
||||
background: rgba(255,255,255,0.32);
|
||||
border-radius: 26rpx 0 0 26rpx;
|
||||
font-size: 26rpx;
|
||||
color:rgba(51,51,51,1);
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bottom {
|
||||
|
Loading…
Reference in New Issue
Block a user