no message
This commit is contained in:
+8
-1
@@ -56,4 +56,11 @@ export function settle(data) {
|
|||||||
method: "post",
|
method: "post",
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export function settlementOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: "/cart/settlementOrder",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -49,7 +49,28 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 产品详情 -->
|
<!-- 产品详情 -->
|
||||||
<view class="order_item_content" v-for="(pItem, pIndex) in addItem.goods" :key="pItem.id">
|
<view v-if="ids" class="order_item_content" v-for="(pItem, pIndex) in addItem.goods" :key="pItem.id">
|
||||||
|
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"
|
||||||
|
@click="jumpProductInfo(pItem)"></up-image>
|
||||||
|
<view class="content_info_right">
|
||||||
|
<view class="content_info_left_total" @click="jumpProductInfo(pItem)">
|
||||||
|
<view class="content_info_title">{{ pItem.title }}</view>
|
||||||
|
<view class="content_info_tag">{{ pItem.specs }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="content_info_right_total">
|
||||||
|
<view class="content_right_total">
|
||||||
|
<view>¥<text style="font-size: 36rpx;">{{ pItem.totalPrice }}</text></view>
|
||||||
|
<view>每件到手价¥{{ pItem.unitPrice }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="shopping_info_quantity">
|
||||||
|
<view class="quantity_but" @click="quantityFun('minus', index, addIndex, pIndex)">-</view>
|
||||||
|
<view class="quantity_value">{{ pItem.num }}</view>
|
||||||
|
<view class="quantity_but" @click="quantityFun('add', index, addIndex, pIndex)">+</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="order_item_content" v-for="(pItem, pIndex) in addItem.goods" :key="pItem.id">
|
||||||
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"
|
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"
|
||||||
@click="jumpProductInfo(pItem)"></up-image>
|
@click="jumpProductInfo(pItem)"></up-image>
|
||||||
<view class="content_info_right">
|
<view class="content_info_right">
|
||||||
@@ -157,8 +178,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Address from '@/components/address.vue';
|
import Address from '@/components/address.vue';
|
||||||
|
import { getGoodsDetail } from '@/api/product.js';
|
||||||
import { PAYMENT_WAY, PAYMENT_WAY_, PRODUCT_DELIVERY_TIME, getValue, WAY_LIST } from '@/utils/enumUtils.js';
|
import { PAYMENT_WAY, PAYMENT_WAY_, PRODUCT_DELIVERY_TIME, getValue, WAY_LIST } from '@/utils/enumUtils.js';
|
||||||
import { getSettleList, settle, updateGoodsNum } from '@/api/cart.js';
|
import { getSettleList, settle,settlementOrder, updateGoodsNum } from '@/api/cart.js';
|
||||||
import { getSupportPay } from '@/api/order.js';
|
import { getSupportPay } from '@/api/order.js';
|
||||||
import { feedback } from '@/api/payment.js';
|
import { feedback } from '@/api/payment.js';
|
||||||
import { assembleAddress } from '@/utils/index.js'
|
import { assembleAddress } from '@/utils/index.js'
|
||||||
@@ -194,16 +216,19 @@ export default {
|
|||||||
selectAddress: {},// 收件地址选择
|
selectAddress: {},// 收件地址选择
|
||||||
wayOption: [],
|
wayOption: [],
|
||||||
isShowBalance: false,
|
isShowBalance: false,
|
||||||
ji:0
|
ji:0,
|
||||||
|
sed:null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
const ids = option.ids;
|
// const ids = option.ids;
|
||||||
if(option.ji){
|
if(option.sed){
|
||||||
this.ji = 1;
|
this.ji = 1;
|
||||||
|
this.sed = JSON.parse(option.sed)
|
||||||
|
this.getOrderTwo();
|
||||||
}
|
}
|
||||||
if (ids && ids !== "null") {
|
if (option.ids) {
|
||||||
this.ids = ids;
|
this.ids = option.ids;
|
||||||
this.getOrder();
|
this.getOrder();
|
||||||
}
|
}
|
||||||
const addressShow = option.addressShow;
|
const addressShow = option.addressShow;
|
||||||
@@ -241,7 +266,7 @@ export default {
|
|||||||
let parmas = {
|
let parmas = {
|
||||||
}
|
}
|
||||||
if(this.ji){
|
if(this.ji){
|
||||||
params['type'] = 4;
|
parmas['type'] = 4;
|
||||||
}
|
}
|
||||||
const result = await getSupportPay(parmas);
|
const result = await getSupportPay(parmas);
|
||||||
if (result && result.bizcode === 100) {
|
if (result && result.bizcode === 100) {
|
||||||
@@ -292,6 +317,71 @@ export default {
|
|||||||
this.orderInfo = data;
|
this.orderInfo = data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async getOrderTwo() {
|
||||||
|
const params = {
|
||||||
|
id: this.sed.id,
|
||||||
|
}
|
||||||
|
const resp = await getGoodsDetail(params);
|
||||||
|
if (resp && resp.bizcode === 100) {
|
||||||
|
const data = resp.data;
|
||||||
|
this.ji = data.type == 3 ? 1 : 0;
|
||||||
|
this.orderInfo = {
|
||||||
|
address:null,
|
||||||
|
amount:this.sed.goodsNum * this.sed.specsId.price,
|
||||||
|
shops:[{
|
||||||
|
addrTimes:[
|
||||||
|
{
|
||||||
|
address:null,
|
||||||
|
deliveryTime:data.deliveryTime,
|
||||||
|
postagesId:data.postagesId,
|
||||||
|
postagesType:1,
|
||||||
|
goods:[
|
||||||
|
{
|
||||||
|
adress:null,
|
||||||
|
addressId:null,
|
||||||
|
areaName:null,
|
||||||
|
cityName:null,
|
||||||
|
goodsId:this.sed.id,
|
||||||
|
id:this.sed.specsId.id,
|
||||||
|
img:data.goodsGraph,
|
||||||
|
name:null,
|
||||||
|
num:this.sed.goodsNum,
|
||||||
|
phone:null,
|
||||||
|
provinceName:null,
|
||||||
|
specs:this.sed.specsId.combNames,
|
||||||
|
title:data.name,
|
||||||
|
totalPrice:this.sed.goodsNum * this.sed.specsId.price,
|
||||||
|
unitPrice:this.sed.specsId.price
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
|
],id:data.shop.id,logo:data.shop.logo,name:data.shop.name
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
this.orderInfo.paymentMethod = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
// const params = {
|
||||||
|
// cartIds: ids,
|
||||||
|
// }
|
||||||
|
// const resp = await getSettleList(params);
|
||||||
|
// if (resp && resp.bizcode === 100) {
|
||||||
|
// const data = resp.data;
|
||||||
|
// const shops = data.shops;
|
||||||
|
// if (shops && shops.length !== 0) {
|
||||||
|
// shops.map(item => {
|
||||||
|
// item.addrTimes.map(addItem => {
|
||||||
|
// addItem.remark = null;
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// data.shops = shops;
|
||||||
|
// data.paymentMethod = null;// 支付方式
|
||||||
|
// this.orderInfo = data;
|
||||||
|
// }
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 数量进行增加删除
|
* 数量进行增加删除
|
||||||
* @param {Object} type 区分是 + 还是 -
|
* @param {Object} type 区分是 + 还是 -
|
||||||
@@ -380,12 +470,22 @@ export default {
|
|||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
addrId: orderInfo.address.id,// 收货地址ID
|
addrId: orderInfo.address.id,// 收货地址ID
|
||||||
cartIds: this.ids,//结算的购物车ID,多个以逗号分割,ALL表示全选
|
//结算的购物车ID,多个以逗号分割,ALL表示全选
|
||||||
payway: way,// 支付方式:1-微信,2-支付宝
|
payway: way,// 支付方式:1-微信,2-支付宝
|
||||||
remark: JSON.stringify(this.getRemark()),//备注信息'[{"sid":"店铺ID","rmk":"备注内容"},{"sid":"店铺ID","rmk":"备注内容"}]'
|
remark: JSON.stringify(this.getRemark()),//备注信息'[{"sid":"店铺ID","rmk":"备注内容"},{"sid":"店铺ID","rmk":"备注内容"}]'
|
||||||
}
|
}
|
||||||
console.log("params", params);
|
const resp = null;
|
||||||
const resp = await settle(params);
|
if(this.sed){
|
||||||
|
params['goodsId'] = this.sed.id;
|
||||||
|
params['specsId'] = this.sed.specsId.id;
|
||||||
|
params['goodsNum'] = this.orderInfo.shops[0].addrTimes[0].goods[0].num;
|
||||||
|
resp = await settlementOrder(params);
|
||||||
|
}else{
|
||||||
|
params['cartIds'] = this.ids;
|
||||||
|
resp = await settle(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 提交订单成功,就唤起支付
|
// 提交订单成功,就唤起支付
|
||||||
if (resp && resp.bizcode === 100) {
|
if (resp && resp.bizcode === 100) {
|
||||||
const item = resp.data;
|
const item = resp.data;
|
||||||
|
|||||||
@@ -275,9 +275,7 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const id = options.id;
|
const id = options.id;
|
||||||
const source = options.source;
|
const source = options.source;
|
||||||
if(options.ji){
|
|
||||||
this.ji = 1;
|
|
||||||
}
|
|
||||||
if (id && id !== 0) {
|
if (id && id !== 0) {
|
||||||
this.id = id ? parseInt(id, 10) : 0;
|
this.id = id ? parseInt(id, 10) : 0;
|
||||||
if (source && source === 'supply_chain') {
|
if (source && source === 'supply_chain') {
|
||||||
@@ -326,6 +324,7 @@ export default {
|
|||||||
const resp = await getGoodsDetail(params);
|
const resp = await getGoodsDetail(params);
|
||||||
if (resp && resp.bizcode === 100) {
|
if (resp && resp.bizcode === 100) {
|
||||||
const data = resp.data;
|
const data = resp.data;
|
||||||
|
this.ji = data.type == 3 ? 1 : 0;
|
||||||
// 商品图
|
// 商品图
|
||||||
if (data.goodsGraph) {
|
if (data.goodsGraph) {
|
||||||
this.swiperList = data.goodsGraph.split(",");
|
this.swiperList = data.goodsGraph.split(",");
|
||||||
@@ -495,24 +494,33 @@ export default {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
id: this.id,
|
id: this.id,
|
||||||
specsId: selectTempl.id,// 规格ID
|
specsId: selectTempl.id,// 规格ID
|
||||||
goodsNum: this.orderInfo.quantity,// 商品数量
|
goodsNum: this.orderInfo.quantity,// 商品数量
|
||||||
}
|
}
|
||||||
|
console.log('selectTempl',selectTempl)
|
||||||
|
if(isBy){
|
||||||
|
params['specsId'] = selectTempl;
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(params)}`,
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
const resp = await addGoods(params);
|
const resp = await addGoods(params);
|
||||||
if (resp && resp.bizcode === 100) {
|
if (resp && resp.bizcode === 100) {
|
||||||
if (isBy) {
|
// if (isBy) {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: `/pages/order_package/order_submit/order_submit?ids=${resp.data}&ji=${ji}`,
|
// url: `/pages/order_package/order_submit/order_submit?ids=${resp.data}&ji=${this.ji}`,
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '成功加入购物车',
|
title: '成功加入购物车',
|
||||||
icon: 'success', // 可选 success/loading/none
|
icon: 'success', // 可选 success/loading/none
|
||||||
duration: 2000 // 持续时长,单位ms
|
duration: 2000 // 持续时长,单位ms
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.checkSpecification(false, null);
|
this.checkSpecification(false, null);
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
|||||||
Reference in New Issue
Block a user