| | |
| | | method: Method.GET, |
| | | needToken: true, |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 再次购买 添加购物车 |
| | | * |
| | | */ |
| | | export function buyBack(data) { |
| | | return http.request({ |
| | | url: '/trade/carts/sku/buyBack', |
| | | method: Method.POST, |
| | | needToken: true, |
| | | data:data |
| | | }); |
| | | } |
| | |
| | | this.getGoodsParam.categoryId = '' |
| | | this.goodsList1 = [] |
| | | this.goodsList2 = [] |
| | | this.listHeight1 = 0; |
| | | this.listHeight2 = 0; |
| | | await this.getgoodsData(); |
| | | }, |
| | | confirm() {}, |
| | |
| | | this.getGoodsParam.pageNumber = 1 |
| | | this.goodsList1 = []; |
| | | this.goodsList2 = []; |
| | | this.listHeight1 = 0; |
| | | this.listHeight2 = 0; |
| | | await this.getgoodsData(); |
| | | console.log(this.maxPages) |
| | | } |
| | |
| | | @click="ByUserMessage(order)">查看拼团信息</view> |
| | | <view class="customer-service" |
| | | @click="contact(order.storeId)">联系客服</view> |
| | | <view class="customer-service" v-if="order.orderStatus==='COMPLETED'" |
| | | @click="buyBack" |
| | | >再来一单</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | <script> |
| | | import '@/components/uview-components/uview-ui' |
| | | import { getExpress, getPackage } from "@/api/trade.js"; |
| | | import { getExpress, getPackage ,buyBack} from "@/api/trade.js"; |
| | | import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js"; |
| | | |
| | | import shares from "@/components/m-share/index"; //分享 |
| | |
| | | rogShow: false, |
| | | reason: "", |
| | | orderPackage:"", |
| | | //商品信息再来一单使用 |
| | | skuList:[], |
| | | }; |
| | | }, |
| | | onLoad(options) { |
| | |
| | | this.orderGoodsList[0].goodsId, |
| | | }); |
| | | }, |
| | | //再来一单 |
| | | buyBack(){ |
| | | console.log(JSON.stringify(this.skuList)) |
| | | buyBack(this.skuList).then(res=>{ |
| | | console.log('------------------->',res) |
| | | if(res.data.code==200){ |
| | | uni.navigateTo({ |
| | | url: "/pages/order/fillorder?way=CART" |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | async loadData(sn) { |
| | | uni.showLoading({ |
| | | title: "加载中", |
| | | }); |
| | | // 将再次购买商品置空重新获取 |
| | | this.skuList = [] |
| | | getOrderDetail(sn).then((res) => { |
| | | this.skuList = res.data.result.orderItems.map(item=>{ |
| | | return{ |
| | | skuId:item.skuId, |
| | | num:item.num} |
| | | }) |
| | | const order = res.data.result; |
| | | this.order = order.order; |
| | | this.orderGoodsList = order.orderItems; |