增加积分商城的功能
This commit is contained in:
@ -15,7 +15,8 @@
|
|||||||
class="attr line1"
|
class="attr line1"
|
||||||
v-if="cart.productInfo.attrInfo"
|
v-if="cart.productInfo.attrInfo"
|
||||||
>{{ cart.productInfo.attrInfo.sku }}</view>
|
>{{ cart.productInfo.attrInfo.sku }}</view>
|
||||||
<view class="money font-color-red">¥{{ cart.truePrice }}</view>
|
<view class="money font-color-red" v-if="!isIntegral">¥{{ cart.truePrice }}</view>
|
||||||
|
<view class="money font-color-red" v-if="isIntegral">{{ cart.productInfo.attrInfo.integral }}积分</view>
|
||||||
<view class="evaluate" v-if="evaluate == 3 && cart.isReply==0" @click="routerGo(cart)">评价</view>
|
<view class="evaluate" v-if="evaluate == 3 && cart.isReply==0" @click="routerGo(cart)">评价</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -26,6 +27,7 @@
|
|||||||
export default {
|
export default {
|
||||||
name: "OrderGoods",
|
name: "OrderGoods",
|
||||||
props: {
|
props: {
|
||||||
|
isIntegral:Boolean,
|
||||||
evaluate: Number,
|
evaluate: Number,
|
||||||
cartInfo: {
|
cartInfo: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -90,13 +90,16 @@
|
|||||||
<view class="text acea-row row-between">
|
<view class="text acea-row row-between">
|
||||||
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
||||||
<view class="money">
|
<view class="money">
|
||||||
<view>
|
<view v-if="order.payType!='integral'">
|
||||||
¥{{
|
¥{{
|
||||||
cart.productInfo.attrInfo
|
cart.productInfo.attrInfo
|
||||||
? cart.productInfo.attrInfo.price
|
? cart.productInfo.attrInfo.price
|
||||||
: cart.productInfo.price
|
: cart.productInfo.price
|
||||||
}}
|
}}
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="order.payType=='integral'">
|
||||||
|
{{order.payIntegral}}积分
|
||||||
|
</view>
|
||||||
<view>x{{ cart.cartNum }}</view>
|
<view>x{{ cart.cartNum }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -104,7 +107,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="totalPrice">
|
<view class="totalPrice">
|
||||||
共{{ order.cartInfo.length || 0 }}件商品,总金额
|
共{{ order.cartInfo.length || 0 }}件商品,总金额
|
||||||
<text class="money font-color-red">¥{{ order.payPrice }}</text>
|
<text class="money font-color-red" v-if="order.payType!='integral'">¥{{ order.payPrice }}</text>
|
||||||
|
<text class="money font-color-red" v-if="order.payType=='integral'">{{order.payIntegral}}积分</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom acea-row row-right row-middle">
|
<view class="bottom acea-row row-right row-middle">
|
||||||
<template v-if="order._status._type == 0">
|
<template v-if="order._status._type == 0">
|
||||||
|
@ -18,67 +18,44 @@
|
|||||||
<view :class="{ on: status.type === 4 }">已完成</view>
|
<view :class="{ on: status.type === 4 }">已完成</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="progress acea-row row-between-wrapper">
|
<view class="progress acea-row row-between-wrapper">
|
||||||
<view
|
<view class="iconfont" :class="[
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type === 0 || status.type === 9
|
status.type === 0 || status.type === 9
|
||||||
? 'icon-webicon318'
|
? 'icon-webicon318'
|
||||||
: 'icon-yuandianxiao',
|
: 'icon-yuandianxiao',
|
||||||
status.type >= 0 ? 'font-color-red' : ''
|
status.type >= 0 ? 'font-color-red' : ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
|
||||||
<view class="line" :class="{ 'bg-color-red': status.type > 0 && status.type != 9 }"></view>
|
<view class="line" :class="{ 'bg-color-red': status.type > 0 && status.type != 9 }"></view>
|
||||||
<view
|
<view class="iconfont" :class="[
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
status.type >= 1 && status.type != 6 && status.type != 9
|
status.type >= 1 && status.type != 6 && status.type != 9
|
||||||
? 'font-color-red'
|
? 'font-color-red'
|
||||||
: ''
|
: ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
<view class="line" :class="{'bg-color-red':status.type > 1 && status.type != 6 && status.type != 9}"
|
||||||
<view
|
v-if="orderInfo.shippingType === 1"></view>
|
||||||
class="line"
|
<view class="iconfont"
|
||||||
:class="{'bg-color-red':status.type > 1 && status.type != 6 && status.type != 9}"
|
|
||||||
v-if="orderInfo.shippingType === 1"
|
|
||||||
></view>
|
|
||||||
<view
|
|
||||||
class="iconfont"
|
|
||||||
:class="[status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao',status.type >= 2 && status.type != 6 && status.type != 9? 'font-color-red': '']"
|
:class="[status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao',status.type >= 2 && status.type != 6 && status.type != 9? 'font-color-red': '']"
|
||||||
v-if="orderInfo.shippingType === 1"
|
v-if="orderInfo.shippingType === 1"></view>
|
||||||
></view>
|
<view class="line" :class="{
|
||||||
<view
|
|
||||||
class="line"
|
|
||||||
:class="{
|
|
||||||
'bg-color-red':
|
'bg-color-red':
|
||||||
status.type > 2 && status.type != 6 && status.type != 9
|
status.type > 2 && status.type != 6 && status.type != 9
|
||||||
}"
|
}"></view>
|
||||||
></view>
|
<view class="iconfont" :class="[
|
||||||
<view
|
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type === 3 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type === 3 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
status.type >= 3 && status.type != 6 && status.type != 9
|
status.type >= 3 && status.type != 6 && status.type != 9
|
||||||
? 'font-color-red'
|
? 'font-color-red'
|
||||||
: ''
|
: ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
<view class="line" :class="{
|
||||||
<view
|
|
||||||
class="line"
|
|
||||||
:class="{
|
|
||||||
'bg-color-red':
|
'bg-color-red':
|
||||||
status.type > 3 && status.type != 6 && status.type != 9
|
status.type > 3 && status.type != 6 && status.type != 9
|
||||||
}"
|
}"></view>
|
||||||
></view>
|
<view class="iconfont" :class="[
|
||||||
<view
|
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
status.type >= 4 && status.type != 6 && status.type != 9
|
status.type >= 4 && status.type != 6 && status.type != 9
|
||||||
? 'font-color-red'
|
? 'font-color-red'
|
||||||
: ''
|
: ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<div class="writeOff" v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1">
|
<div class="writeOff" v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1">
|
||||||
@ -110,15 +87,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="map acea-row row-between-wrapper" v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1">
|
||||||
class="map acea-row row-between-wrapper"
|
|
||||||
v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1"
|
|
||||||
>
|
|
||||||
<div>自提地址信息</div>
|
<div>自提地址信息</div>
|
||||||
<div
|
<div class="place cart-color acea-row row-center-wrapper" @click="showChang(orderInfo.systemStore)">
|
||||||
class="place cart-color acea-row row-center-wrapper"
|
|
||||||
@click="showChang(orderInfo.systemStore)"
|
|
||||||
>
|
|
||||||
<span class="iconfont icon-weizhi"></span>查看位置
|
<span class="iconfont icon-weizhi"></span>查看位置
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -134,7 +105,8 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
{{ system_store.name}}
|
{{ system_store.name}}
|
||||||
<span class="phone">{{ system_store.phone }}</span>
|
<span class="phone">{{ system_store.phone }}</span>
|
||||||
<span @click="telPhone(system_store.phone)" class="iconfont icon-tonghua font-color-red" :href="'tel:' + system_store.phone"></span>
|
<span @click="telPhone(system_store.phone)" class="iconfont icon-tonghua font-color-red"
|
||||||
|
:href="'tel:' + system_store.phone"></span>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ system_store.address }}</div>
|
<div>{{ system_store.address }}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -142,7 +114,7 @@
|
|||||||
<image src="@/static/images/line.jpg" />
|
<image src="@/static/images/line.jpg" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<OrderGoods :evaluate="status.type || 0" :cartInfo="orderInfo.cartInfo || []"></OrderGoods>
|
<OrderGoods :evaluate="status.type || 0" isIntegral :cartInfo="orderInfo.cartInfo || []"></OrderGoods>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>订单编号:</view>
|
<view>订单编号:</view>
|
||||||
@ -223,10 +195,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between" v-if="!isIntegral">
|
||||||
<view>支付金额:</view>
|
<view>支付金额:</view>
|
||||||
<view class="conter">¥{{ orderInfo.totalPrice }}</view>
|
<view class="conter">¥{{ orderInfo.totalPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="item acea-row row-between" v-if="isIntegral">
|
||||||
|
<view>支付积分:</view>
|
||||||
|
<view class="conter">{{ orderInfo.payIntegral }}积分</view>
|
||||||
|
</view>
|
||||||
<view class="item acea-row row-between" v-if="orderInfo.couponPrice > 0">
|
<view class="item acea-row row-between" v-if="orderInfo.couponPrice > 0">
|
||||||
<view>优惠券抵扣:</view>
|
<view>优惠券抵扣:</view>
|
||||||
<view class="conter">-¥{{ orderInfo.couponPrice }}</view>
|
<view class="conter">-¥{{ orderInfo.couponPrice }}</view>
|
||||||
@ -241,7 +217,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="actualPay acea-row row-right">
|
<view class="actualPay acea-row row-right">
|
||||||
实付款:
|
实付款:
|
||||||
<text class="money font-color-red">¥{{ orderInfo.payPrice }}</text>
|
<text class="money font-color-red" v-if="!isIntegral">¥{{ orderInfo.payPrice }}</text>
|
||||||
|
<text class="money font-color-red" v-if="isIntegral">{{ orderInfo.payIntegral }}积分</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
|
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
|
||||||
@ -255,26 +232,19 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
||||||
<view
|
<view class="bnt default"
|
||||||
class="bnt default"
|
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
|
||||||
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
|
|
||||||
>查看物流</view>
|
|
||||||
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
|
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
||||||
<view
|
<view class="bnt default"
|
||||||
class="bnt default"
|
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
|
||||||
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
|
|
||||||
>查看物流</view>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 4">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 4">
|
||||||
<view class="bnt cancel" @click="delOrder">删除订单</view>
|
<view class="bnt cancel" @click="delOrder">删除订单</view>
|
||||||
<view
|
<view class="bnt default" @click="
|
||||||
class="bnt default"
|
|
||||||
@click="
|
|
||||||
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
|
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
|
||||||
"
|
">查看物流</view>
|
||||||
>查看物流</view>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="status.type == 6">
|
<template v-if="status.type == 6">
|
||||||
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
|
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
|
||||||
@ -282,355 +252,384 @@
|
|||||||
</view>
|
</view>
|
||||||
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
|
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
|
||||||
<view class="geoPage" v-if="mapShow">
|
<view class="geoPage" v-if="mapShow">
|
||||||
<iframe
|
<iframe width="100%" height="100%" frameborder="0" scrolling="no"
|
||||||
width="100%"
|
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"></iframe>
|
||||||
height="100%"
|
|
||||||
frameborder="0"
|
|
||||||
scrolling="no"
|
|
||||||
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"
|
|
||||||
></iframe>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import OrderGoods from "@/components/OrderGoods";
|
import OrderGoods from "@/components/OrderGoods";
|
||||||
import { orderDetail } from "@/api/order";
|
import {
|
||||||
import Payment from "@/components/Payment";
|
orderDetail
|
||||||
import { isWeixin, copyClipboard } from "@/utils";
|
} from "@/api/order";
|
||||||
import { mapGetters } from "vuex";
|
import Payment from "@/components/Payment";
|
||||||
import {
|
import {
|
||||||
cancelOrderHandle,
|
isWeixin,
|
||||||
takeOrderHandle,
|
copyClipboard
|
||||||
delOrderHandle,
|
} from "@/utils";
|
||||||
payOrderHandle,
|
import {
|
||||||
} from "@/libs/order";
|
mapGetters
|
||||||
// import { wechatEvevt } from "@/libs/wechat";
|
} from "vuex";
|
||||||
|
import {
|
||||||
|
cancelOrderHandle,
|
||||||
|
takeOrderHandle,
|
||||||
|
delOrderHandle,
|
||||||
|
payOrderHandle,
|
||||||
|
} from "@/libs/order";
|
||||||
|
// import { wechatEvevt } from "@/libs/wechat";
|
||||||
|
|
||||||
const NAME = "OrderDetails";
|
const NAME = "OrderDetails";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: NAME,
|
name: NAME,
|
||||||
components: {
|
components: {
|
||||||
OrderGoods,
|
OrderGoods,
|
||||||
Payment,
|
Payment,
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
offlinePayStatus: 2,
|
offlinePayStatus: 2,
|
||||||
orderTypeName: "普通订单",
|
orderTypeName: "普通订单",
|
||||||
orderTypeNameStatus: true,
|
orderTypeNameStatus: true,
|
||||||
offlineStatus: true,
|
offlineStatus: true,
|
||||||
id: "",
|
id: "",
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
_status: {},
|
_status: {},
|
||||||
|
},
|
||||||
|
status: {},
|
||||||
|
pay: false,
|
||||||
|
payType: ["yue", "weixin"],
|
||||||
|
from: this.$deviceType,
|
||||||
|
system_store: {},
|
||||||
|
mapKay: "",
|
||||||
|
mapShow: false,
|
||||||
|
isIntegral: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
refundOrder() {
|
||||||
|
return this.orderInfo.refund_status > 0;
|
||||||
},
|
},
|
||||||
status: {},
|
...mapGetters(["userInfo"]),
|
||||||
pay: false,
|
|
||||||
payType: ["yue", "weixin"],
|
|
||||||
from: this.$deviceType,
|
|
||||||
system_store: {},
|
|
||||||
mapKay: "",
|
|
||||||
mapShow: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
refundOrder() {
|
|
||||||
return this.orderInfo.refund_status > 0;
|
|
||||||
},
|
},
|
||||||
...mapGetters(["userInfo"]),
|
onShow() {
|
||||||
},
|
this.id = this.$yroute.query.id;
|
||||||
onShow() {
|
this.getDetail();
|
||||||
this.id = this.$yroute.query.id;
|
|
||||||
this.getDetail();
|
|
||||||
},
|
|
||||||
mounted: function () {
|
|
||||||
this.id = this.$yroute.query.id;
|
|
||||||
// this.getDetail();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
copyClipboard,
|
|
||||||
goGoodsReturn(orderInfo) {
|
|
||||||
this.$yrouter.push({
|
|
||||||
path: "/pages/order/GoodsReturn/index",
|
|
||||||
query: {
|
|
||||||
id: orderInfo.orderId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
goGroupRule(orderInfo) {
|
mounted: function () {
|
||||||
this.$yrouter.push({
|
this.id = this.$yroute.query.id;
|
||||||
path: "/pages/activity/GroupRule/index",
|
// this.getDetail();
|
||||||
query: {
|
|
||||||
id: orderInfo.pinkId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//拨打电话
|
methods: {
|
||||||
telPhone(phoneNumber) {
|
copyClipboard,
|
||||||
uni.makePhoneCall({
|
goGoodsReturn(orderInfo) {
|
||||||
phoneNumber: phoneNumber,
|
this.$yrouter.push({
|
||||||
fail() {
|
path: "/pages/order/GoodsReturn/index",
|
||||||
console.log("取消拨打");
|
query: {
|
||||||
}
|
id: orderInfo.orderId,
|
||||||
});
|
},
|
||||||
},
|
|
||||||
showChang: function (data) {
|
|
||||||
// 这里判断是不是微信小程序
|
|
||||||
this.$yrouter.push({
|
|
||||||
path: "/pages/map/index",
|
|
||||||
query: data,
|
|
||||||
});
|
|
||||||
// if (isWeixin()) {
|
|
||||||
// let config = {
|
|
||||||
// latitude: this.system_store.latitude,
|
|
||||||
// longitude: this.system_store.longitude,
|
|
||||||
// name: this.system_store.name,
|
|
||||||
// address: this.system_store.address
|
|
||||||
// };
|
|
||||||
// } else {
|
|
||||||
// if (!this.mapKey)
|
|
||||||
// uni.showToast({
|
|
||||||
// title: "暂无法使用查看地图,请配置您的腾讯地图key",
|
|
||||||
// icon: "none",
|
|
||||||
// duration: 2000
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// this.mapShow = true;
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
if (this.name === "MyOrder") {
|
|
||||||
this.$yrouter.back();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
console.log(this);
|
|
||||||
this.$yrouter.replace({
|
|
||||||
path: "/pages/order/MyOrder/index",
|
|
||||||
});
|
});
|
||||||
return;
|
},
|
||||||
}
|
goGroupRule(orderInfo) {
|
||||||
},
|
this.$yrouter.push({
|
||||||
cancelOrder() {
|
path: "/pages/activity/GroupRule/index",
|
||||||
cancelOrderHandle(this.orderInfo.orderId)
|
query: {
|
||||||
.then(() => {
|
id: orderInfo.pinkId,
|
||||||
setTimeout(() => this.goBack(), 300);
|
},
|
||||||
})
|
});
|
||||||
.catch(() => {
|
},
|
||||||
|
//拨打电话
|
||||||
|
telPhone(phoneNumber) {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: phoneNumber,
|
||||||
|
fail() {
|
||||||
|
console.log("取消拨打");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
showChang: function (data) {
|
||||||
|
// 这里判断是不是微信小程序
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: "/pages/map/index",
|
||||||
|
query: data,
|
||||||
|
});
|
||||||
|
// if (isWeixin()) {
|
||||||
|
// let config = {
|
||||||
|
// latitude: this.system_store.latitude,
|
||||||
|
// longitude: this.system_store.longitude,
|
||||||
|
// name: this.system_store.name,
|
||||||
|
// address: this.system_store.address
|
||||||
|
// };
|
||||||
|
// } else {
|
||||||
|
// if (!this.mapKey)
|
||||||
|
// uni.showToast({
|
||||||
|
// title: "暂无法使用查看地图,请配置您的腾讯地图key",
|
||||||
|
// icon: "none",
|
||||||
|
// duration: 2000
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// this.mapShow = true;
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
if (this.name === "MyOrder") {
|
||||||
|
this.$yrouter.back();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
console.log(this);
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: "/pages/order/MyOrder/index",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancelOrder() {
|
||||||
|
cancelOrderHandle(this.orderInfo.orderId)
|
||||||
|
.then(() => {
|
||||||
|
setTimeout(() => this.goBack(), 300);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.getDetail();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
takeOrder() {
|
||||||
|
takeOrderHandle(this.orderInfo.orderId).finally(() => {
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
takeOrder() {
|
delOrder() {
|
||||||
takeOrderHandle(this.orderInfo.orderId).finally(() => {
|
delOrderHandle(this.orderInfo.orderId).then(() => {
|
||||||
this.getDetail();
|
setTimeout(() => this.goBack(), 300);
|
||||||
});
|
|
||||||
},
|
|
||||||
delOrder() {
|
|
||||||
delOrderHandle(this.orderInfo.orderId).then(() => {
|
|
||||||
setTimeout(() => this.goBack(), 300);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setOfflinePayStatus: function (status) {
|
|
||||||
var that = this;
|
|
||||||
that.offlinePayStatus = status;
|
|
||||||
if (status === 1 && that.orderTypeNameStatus === true) {
|
|
||||||
that.payType.push("offline");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getOrderStatus: function () {
|
|
||||||
let orderInfo = this.orderInfo || {},
|
|
||||||
_status = orderInfo._status || { _type: 0 },
|
|
||||||
status = {};
|
|
||||||
let type = parseInt(_status._type),
|
|
||||||
delivery_type = orderInfo.deliveryType,
|
|
||||||
seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0,
|
|
||||||
bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0,
|
|
||||||
combination_id = orderInfo.combinationId
|
|
||||||
? parseInt(orderInfo.combinationId)
|
|
||||||
: 0;
|
|
||||||
status = {
|
|
||||||
type: type,
|
|
||||||
class_status: 0,
|
|
||||||
};
|
|
||||||
if (type == 1 && combination_id > 0) {
|
|
||||||
status.type = 6;
|
|
||||||
status.class_status = 1;
|
|
||||||
} //查看拼团
|
|
||||||
if (type == 2 && delivery_type == "express") status.class_status = 2; //查看物流
|
|
||||||
if (type == 2) status.class_status = 3; //确认收货
|
|
||||||
if (type == 4 || type === 0) status.class_status = 4; //删除订单
|
|
||||||
if (
|
|
||||||
!seckill_id &&
|
|
||||||
!bargain_id &&
|
|
||||||
!combination_id &&
|
|
||||||
(type == 3 || type == 4)
|
|
||||||
)
|
|
||||||
status.class_status = 5; //再次购买
|
|
||||||
if (type == 9) {
|
|
||||||
//线下付款
|
|
||||||
status.class_status = 0;
|
|
||||||
this.offlineStatus = false;
|
|
||||||
}
|
|
||||||
this.status = status;
|
|
||||||
},
|
|
||||||
getDetail() {
|
|
||||||
const id = this.id;
|
|
||||||
if (!id) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "订单不存在",
|
|
||||||
icon: "none",
|
|
||||||
duration: 2000,
|
|
||||||
});
|
});
|
||||||
return;
|
},
|
||||||
}
|
setOfflinePayStatus: function (status) {
|
||||||
orderDetail(id)
|
var that = this;
|
||||||
.then((res) => {
|
that.offlinePayStatus = status;
|
||||||
this.orderInfo = res.data;
|
if (status === 1 && that.orderTypeNameStatus === true) {
|
||||||
this.getOrderStatus();
|
that.payType.push("offline");
|
||||||
if (this.orderInfo.combinationId > 0) {
|
}
|
||||||
this.orderTypeName = "拼团订单";
|
},
|
||||||
this.orderTypeNameStatus = false;
|
getOrderStatus: function () {
|
||||||
} else if (this.orderInfo.bargainId > 0) {
|
let orderInfo = this.orderInfo || {},
|
||||||
this.orderTypeName = "砍价订单";
|
_status = orderInfo._status || {
|
||||||
this.orderTypeNameStatus = false;
|
_type: 0
|
||||||
} else if (this.orderInfo.seckillId > 0) {
|
},
|
||||||
this.orderTypeName = "秒杀订单";
|
status = {};
|
||||||
this.orderTypeNameStatus = false;
|
let type = parseInt(_status._type),
|
||||||
}
|
delivery_type = orderInfo.deliveryType,
|
||||||
this.system_store = res.data.systemStore || {};
|
seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0,
|
||||||
this.mapKey = res.data.mapKay;
|
bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0,
|
||||||
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus);
|
combination_id = orderInfo.combinationId ?
|
||||||
})
|
parseInt(orderInfo.combinationId) :
|
||||||
.catch((err) => {
|
0;
|
||||||
|
status = {
|
||||||
|
type: type,
|
||||||
|
class_status: 0,
|
||||||
|
};
|
||||||
|
if (type == 1 && combination_id > 0) {
|
||||||
|
status.type = 6;
|
||||||
|
status.class_status = 1;
|
||||||
|
} //查看拼团
|
||||||
|
if (type == 2 && delivery_type == "express") status.class_status = 2; //查看物流
|
||||||
|
if (type == 2) status.class_status = 3; //确认收货
|
||||||
|
if (type == 4 || type === 0) status.class_status = 4; //删除订单
|
||||||
|
if (
|
||||||
|
!seckill_id &&
|
||||||
|
!bargain_id &&
|
||||||
|
!combination_id &&
|
||||||
|
(type == 3 || type == 4)
|
||||||
|
)
|
||||||
|
status.class_status = 5; //再次购买
|
||||||
|
if (type == 9) {
|
||||||
|
//线下付款
|
||||||
|
status.class_status = 0;
|
||||||
|
this.offlineStatus = false;
|
||||||
|
}
|
||||||
|
this.status = status;
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const id = this.id;
|
||||||
|
if (!id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.response.data.msg,
|
title: "订单不存在",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
orderDetail(id)
|
||||||
|
.then((res) => {
|
||||||
|
this.orderInfo = res.data;
|
||||||
|
this.getOrderStatus();
|
||||||
|
if (this.orderInfo.combinationId > 0) {
|
||||||
|
this.orderTypeName = "拼团订单";
|
||||||
|
this.orderTypeNameStatus = false;
|
||||||
|
} else if (this.orderInfo.bargainId > 0) {
|
||||||
|
this.orderTypeName = "砍价订单";
|
||||||
|
this.orderTypeNameStatus = false;
|
||||||
|
} else if (this.orderInfo.seckillId > 0) {
|
||||||
|
this.orderTypeName = "秒杀订单";
|
||||||
|
this.orderTypeNameStatus = false;
|
||||||
|
}
|
||||||
|
this.isIntegral = res.data.payType == 'integral'
|
||||||
|
if (this.isIntegral) {
|
||||||
|
this.orderTypeName = "积分兑换订单";
|
||||||
|
this.orderTypeNameStatus = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.system_store = res.data.systemStore || {};
|
||||||
|
this.mapKey = res.data.mapKay;
|
||||||
|
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.response.data.msg,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async toPay(type) {
|
||||||
|
var that = this;
|
||||||
|
console.log(type, "支付方式");
|
||||||
|
await payOrderHandle(this.orderInfo.orderId, type, that.from);
|
||||||
|
that.getDetail();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
async toPay(type) {
|
};
|
||||||
var that = this;
|
|
||||||
console.log(type, "支付方式");
|
|
||||||
await payOrderHandle(this.orderInfo.orderId, type, that.from);
|
|
||||||
that.getDetail();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.geoPage {
|
.geoPage {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
}
|
}
|
||||||
.order-details .writeOff {
|
|
||||||
background-color: #fff;
|
.order-details .writeOff {
|
||||||
margin-top: 0.13 * 100rpx;
|
background-color: #fff;
|
||||||
padding-bottom: 0.3 * 100rpx;
|
margin-top: 0.13 * 100rpx;
|
||||||
}
|
padding-bottom: 0.3 * 100rpx;
|
||||||
.order-details .writeOff .title {
|
}
|
||||||
font-size: 0.3 * 100rpx;
|
|
||||||
color: #282828;
|
.order-details .writeOff .title {
|
||||||
height: 0.87 * 100rpx;
|
font-size: 0.3 * 100rpx;
|
||||||
border-bottom: 1px solid #f0f0f0;
|
color: #282828;
|
||||||
padding: 0 0.3 * 100rpx;
|
height: 0.87 * 100rpx;
|
||||||
line-height: 0.87 * 100rpx;
|
border-bottom: 1px solid #f0f0f0;
|
||||||
}
|
padding: 0 0.3 * 100rpx;
|
||||||
.order-details .writeOff .grayBg {
|
line-height: 0.87 * 100rpx;
|
||||||
background-color: #f2f5f7;
|
}
|
||||||
width: 5.9 * 100rpx;
|
|
||||||
height: 3.84 * 100rpx;
|
.order-details .writeOff .grayBg {
|
||||||
border-radius: 0.2 * 100rpx 0.2 * 100rpx 0 0;
|
background-color: #f2f5f7;
|
||||||
margin: 0.5 * 100rpx auto 0 auto;
|
width: 5.9 * 100rpx;
|
||||||
padding-top: 0.55 * 100rpx;
|
height: 3.84 * 100rpx;
|
||||||
}
|
border-radius: 0.2 * 100rpx 0.2 * 100rpx 0 0;
|
||||||
.order-details .writeOff .grayBg .pictrue {
|
margin: 0.5 * 100rpx auto 0 auto;
|
||||||
width: 2.9 * 100rpx;
|
padding-top: 0.55 * 100rpx;
|
||||||
height: 2.9 * 100rpx;
|
}
|
||||||
margin: 0 auto;
|
|
||||||
}
|
.order-details .writeOff .grayBg .pictrue {
|
||||||
.order-details .writeOff .grayBg .pictrue img {
|
width: 2.9 * 100rpx;
|
||||||
width: 100%;
|
height: 2.9 * 100rpx;
|
||||||
height: 100%;
|
margin: 0 auto;
|
||||||
display: block;
|
}
|
||||||
}
|
|
||||||
.order-details .writeOff .gear {
|
.order-details .writeOff .grayBg .pictrue img {
|
||||||
width: 5.9 * 100rpx;
|
width: 100%;
|
||||||
height: 0.3 * 100rpx;
|
height: 100%;
|
||||||
margin: 0 auto;
|
display: block;
|
||||||
}
|
}
|
||||||
.order-details .writeOff .gear img {
|
|
||||||
width: 100%;
|
.order-details .writeOff .gear {
|
||||||
height: 100%;
|
width: 5.9 * 100rpx;
|
||||||
display: block;
|
height: 0.3 * 100rpx;
|
||||||
}
|
margin: 0 auto;
|
||||||
.order-details .writeOff .num {
|
}
|
||||||
background-color: #f0c34c;
|
|
||||||
width: 5.9 * 100rpx;
|
.order-details .writeOff .gear img {
|
||||||
height: 0.84 * 100rpx;
|
width: 100%;
|
||||||
color: #282828;
|
height: 100%;
|
||||||
font-size: 0.48 * 100rpx;
|
display: block;
|
||||||
margin: 0 auto;
|
}
|
||||||
border-radius: 0 0 0.2 * 100rpx 0.2 * 100rpx;
|
|
||||||
text-align: center;
|
.order-details .writeOff .num {
|
||||||
padding-top: 0.04 * 100rpx;
|
background-color: #f0c34c;
|
||||||
}
|
width: 5.9 * 100rpx;
|
||||||
.order-details .writeOff .rules {
|
height: 0.84 * 100rpx;
|
||||||
margin: 0.46 * 100rpx 0.3 * 100rpx 0 0.3 * 100rpx;
|
color: #282828;
|
||||||
border-top: 0.01 * 100rpx solid #f0f0f0;
|
font-size: 0.48 * 100rpx;
|
||||||
padding-top: 0.1 * 100rpx;
|
margin: 0 auto;
|
||||||
}
|
border-radius: 0 0 0.2 * 100rpx 0.2 * 100rpx;
|
||||||
.order-details .writeOff .rules .item {
|
text-align: center;
|
||||||
margin-top: 0.15 * 100rpx;
|
padding-top: 0.04 * 100rpx;
|
||||||
}
|
}
|
||||||
.order-details .writeOff .rules .item .rulesTitle {
|
|
||||||
font-size: 0.28 * 100rpx;
|
.order-details .writeOff .rules {
|
||||||
color: #282828;
|
margin: 0.46 * 100rpx 0.3 * 100rpx 0 0.3 * 100rpx;
|
||||||
}
|
border-top: 0.01 * 100rpx solid #f0f0f0;
|
||||||
.order-details .writeOff .rules .item .rulesTitle .iconfont {
|
padding-top: 0.1 * 100rpx;
|
||||||
font-size: 0.3 * 100rpx;
|
}
|
||||||
color: #333;
|
|
||||||
margin-right: 0.08 * 100rpx;
|
.order-details .writeOff .rules .item {
|
||||||
margin-top: 0.05 * 100rpx;
|
margin-top: 0.15 * 100rpx;
|
||||||
}
|
}
|
||||||
.order-details .writeOff .rules .item .info {
|
|
||||||
font-size: 0.28 * 100rpx;
|
.order-details .writeOff .rules .item .rulesTitle {
|
||||||
color: #999;
|
font-size: 0.28 * 100rpx;
|
||||||
margin-top: 0.05 * 100rpx;
|
color: #282828;
|
||||||
}
|
}
|
||||||
.order-details .writeOff .rules .item .info .time {
|
|
||||||
margin-left: 0.2 * 100rpx;
|
.order-details .writeOff .rules .item .rulesTitle .iconfont {
|
||||||
}
|
font-size: 0.3 * 100rpx;
|
||||||
.order-details .map {
|
color: #333;
|
||||||
height: 0.86 * 100rpx;
|
margin-right: 0.08 * 100rpx;
|
||||||
font-size: 0.3 * 100rpx;
|
margin-top: 0.05 * 100rpx;
|
||||||
color: #282828;
|
}
|
||||||
line-height: 0.86 * 100rpx;
|
|
||||||
border-bottom: 0.01 * 100rpx solid #f0f0f0;
|
.order-details .writeOff .rules .item .info {
|
||||||
margin-top: 0.13 * 100rpx;
|
font-size: 0.28 * 100rpx;
|
||||||
background-color: #fff;
|
color: #999;
|
||||||
padding: 0 0.3 * 100rpx;
|
margin-top: 0.05 * 100rpx;
|
||||||
}
|
}
|
||||||
.order-details .map .place {
|
|
||||||
font-size: 0.26 * 100rpx;
|
.order-details .writeOff .rules .item .info .time {
|
||||||
width: 1.76 * 100rpx;
|
margin-left: 0.2 * 100rpx;
|
||||||
height: 0.5 * 100rpx;
|
}
|
||||||
border-radius: 0.25 * 100rpx;
|
|
||||||
line-height: 0.5 * 100rpx;
|
.order-details .map {
|
||||||
text-align: center;
|
height: 0.86 * 100rpx;
|
||||||
}
|
font-size: 0.3 * 100rpx;
|
||||||
.order-details .map .place .iconfont {
|
color: #282828;
|
||||||
font-size: 0.27 * 100rpx;
|
line-height: 0.86 * 100rpx;
|
||||||
height: 0.27 * 100rpx;
|
border-bottom: 0.01 * 100rpx solid #f0f0f0;
|
||||||
line-height: 0.27 * 100rpx;
|
margin-top: 0.13 * 100rpx;
|
||||||
margin: 0.02 * 100rpx 0.03 * 100rpx 0 0;
|
background-color: #fff;
|
||||||
}
|
padding: 0 0.3 * 100rpx;
|
||||||
.order-details .address .name .iconfont {
|
}
|
||||||
font-size: 0.34 * 100rpx;
|
|
||||||
margin-left: 0.1 * 100rpx;
|
.order-details .map .place {
|
||||||
}
|
font-size: 0.26 * 100rpx;
|
||||||
|
width: 1.76 * 100rpx;
|
||||||
|
height: 0.5 * 100rpx;
|
||||||
|
border-radius: 0.25 * 100rpx;
|
||||||
|
line-height: 0.5 * 100rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-details .map .place .iconfont {
|
||||||
|
font-size: 0.27 * 100rpx;
|
||||||
|
height: 0.27 * 100rpx;
|
||||||
|
line-height: 0.27 * 100rpx;
|
||||||
|
margin: 0.02 * 100rpx 0.03 * 100rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-details .address .name .iconfont {
|
||||||
|
font-size: 0.34 * 100rpx;
|
||||||
|
margin-left: 0.1 * 100rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -44,9 +44,9 @@
|
|||||||
<image src="@/static/images/line.jpg" />
|
<image src="@/static/images/line.jpg" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<OrderGoods :evaluate="0" :cartInfo="orderGroupInfo.cartInfo"></OrderGoods>
|
<OrderGoods :evaluate="0" isIntegral :cartInfo="orderGroupInfo.cartInfo"></OrderGoods>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="item acea-row row-between-wrapper" @click="couponTap" v-if="deduction === false">
|
<view class="item acea-row row-between-wrapper" @click="couponTap" v-if="deduction === false && !isIntegral">
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
<view class="discount">
|
<view class="discount">
|
||||||
{{ usableCoupon.couponTitle || "请选择" }}
|
{{ usableCoupon.couponTitle || "请选择" }}
|
||||||
@ -65,7 +65,7 @@
|
|||||||
当前积分
|
当前积分
|
||||||
<text class="num font-color-red">{{ userInfo.integral || 0 }}</text>
|
<text class="num font-color-red">{{ userInfo.integral || 0 }}</text>
|
||||||
</text>
|
</text>
|
||||||
<checkbox value="true" :checked="useIntegral ? true : false"></checkbox>
|
<checkbox value="true" v-if="!isIntegral" :checked="useIntegral ? true : false"></checkbox>
|
||||||
</label>
|
</label>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
@ -101,7 +101,7 @@
|
|||||||
<textarea v-model="mark"></textarea>
|
<textarea v-model="mark"></textarea>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper">
|
<view class="wrapper" v-if="!isIntegral">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view>支付方式</view>
|
<view>支付方式</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
@ -131,17 +131,18 @@
|
|||||||
<view class="moneyList">
|
<view class="moneyList">
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.totalPrice !== undefined">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.totalPrice !== undefined">
|
||||||
<view>商品总价:</view>
|
<view>商品总价:</view>
|
||||||
<view class="money">¥{{ orderPrice.totalPrice }}</view>
|
<view class="money" v-if="!isIntegral">¥{{ orderPrice.totalPrice }}</view>
|
||||||
|
<view class="money" v-if="isIntegral">{{ orderPrice.payIntegral }}积分</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.payPostage > 0">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.payPostage > 0 && !isIntegral">
|
||||||
<view>运费:</view>
|
<view>运费:</view>
|
||||||
<view class="money">¥{{ orderPrice.payPostage }}</view>
|
<view class="money">¥{{ orderPrice.payPostage }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0 && !isIntegral">
|
||||||
<view>优惠券抵扣:</view>
|
<view>优惠券抵扣:</view>
|
||||||
<view class="money">-¥{{ orderPrice.couponPrice }}</view>
|
<view class="money">-¥{{ orderPrice.couponPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.deductionPrice > 0">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.deductionPrice > 0 && !isIntegral">
|
||||||
<view>积分抵扣:</view>
|
<view>积分抵扣:</view>
|
||||||
<view class="money">-¥{{ orderPrice.deductionPrice }}</view>
|
<view class="money">-¥{{ orderPrice.deductionPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -150,7 +151,8 @@
|
|||||||
<view class="footer acea-row row-between-wrapper">
|
<view class="footer acea-row row-between-wrapper">
|
||||||
<view>
|
<view>
|
||||||
合计:
|
合计:
|
||||||
<text class="font-color-red">¥{{ orderPrice.payPrice }}</text>
|
<text class="font-color-red" v-if="!isIntegral">¥{{ orderPrice.payPrice }}</text>
|
||||||
|
<text class="font-color-red" v-if="isIntegral">{{ orderPrice.payIntegral }}积分</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="settlement" @click="createOrder">立即结算</view>
|
<view class="settlement" @click="createOrder">立即结算</view>
|
||||||
</view>
|
</view>
|
||||||
@ -324,6 +326,7 @@
|
|||||||
contactsTel: "",
|
contactsTel: "",
|
||||||
storeSelfMention: 0,
|
storeSelfMention: 0,
|
||||||
cartid: "",
|
cartid: "",
|
||||||
|
isIntegral: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(["userInfo", "storeItems"]),
|
computed: mapGetters(["userInfo", "storeItems"]),
|
||||||
@ -346,6 +349,8 @@
|
|||||||
if (that.$yroute.query.pinkid !== undefined) {
|
if (that.$yroute.query.pinkid !== undefined) {
|
||||||
that.pinkId = that.$yroute.query.pinkid;
|
that.pinkId = that.$yroute.query.pinkid;
|
||||||
}
|
}
|
||||||
|
this.isIntegral = that.$yroute.query.isIntegral == 'true'
|
||||||
|
this.useIntegral = this.isIntegral
|
||||||
if (that.$yroute.query.id !== undefined) {
|
if (that.$yroute.query.id !== undefined) {
|
||||||
that.cartid = that.$yroute.query.id;
|
that.cartid = that.$yroute.query.id;
|
||||||
console.log(that.cartid);
|
console.log(that.cartid);
|
||||||
@ -372,6 +377,9 @@
|
|||||||
},
|
},
|
||||||
changeUseIntegral: function (e) {
|
changeUseIntegral: function (e) {
|
||||||
// this.computedPrice();
|
// this.computedPrice();
|
||||||
|
if (this.isIntegral) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.useIntegral = e.mp.detail.value[0];
|
this.useIntegral = e.mp.detail.value[0];
|
||||||
},
|
},
|
||||||
computedPrice() {
|
computedPrice() {
|
||||||
@ -460,8 +468,20 @@
|
|||||||
this.computedPrice();
|
this.computedPrice();
|
||||||
},
|
},
|
||||||
createOrder() {
|
createOrder() {
|
||||||
|
if (this.isIntegral) {
|
||||||
|
// 积分支付
|
||||||
|
if (this.userInfo.integral < this.orderPrice.payIntegral) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "积分不足",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.active = 'integral'
|
||||||
|
}
|
||||||
let shipping_type = this.shipping_type;
|
let shipping_type = this.shipping_type;
|
||||||
if (!this.active) {
|
if (!this.isIntegral && !this.active) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请选择支付方式",
|
title: "请选择支付方式",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<!-- 商品信息描述 -->
|
<!-- 商品信息描述 -->
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="share acea-row row-between row-bottom">
|
<view class="share acea-row row-between row-bottom">
|
||||||
<view class="money font-color-red">
|
<view class="money font-color-red" v-if="!isIntegral">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text class="num">{{
|
<text class="num">{{
|
||||||
attr.productSelect.price || storeInfo.price
|
attr.productSelect.price || storeInfo.price
|
||||||
@ -16,11 +16,16 @@
|
|||||||
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">¥{{ attr.productSelect.vipPrice || storeInfo.vipPrice }}</text>
|
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">¥{{ attr.productSelect.vipPrice || storeInfo.vipPrice }}</text>
|
||||||
<image src="@/static/images/vip.png" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
|
<image src="@/static/images/vip.png" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
|
||||||
</view>
|
</view>
|
||||||
|
<view class="money font-color-red" v-if="isIntegral">
|
||||||
|
<text class="num">{{
|
||||||
|
attr.productSelect.integral || storeInfo.integral
|
||||||
|
}}积分</text>
|
||||||
|
</view>
|
||||||
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="introduce">{{ storeInfo.storeName }}</view>
|
<view class="introduce">{{ storeInfo.storeName }}</view>
|
||||||
<view class="label acea-row row-between-wrapper">
|
<view class="label acea-row row-between-wrapper">
|
||||||
<text>原价:¥{{ storeInfo.otPrice }}</text>
|
<text v-if="!isIntegral">原价:¥{{ storeInfo.otPrice }}</text>
|
||||||
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
|
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
|
||||||
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
|
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
|
||||||
</view>
|
</view>
|
||||||
@ -311,7 +316,7 @@
|
|||||||
qqmapsdk: null,
|
qqmapsdk: null,
|
||||||
productConClass: "product-con",
|
productConClass: "product-con",
|
||||||
tempName: "全国包邮",
|
tempName: "全国包邮",
|
||||||
isIntegral: "false"
|
isIntegral: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(["isLogin", "location"]),
|
computed: mapGetters(["isLogin", "location"]),
|
||||||
@ -331,6 +336,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.id = this._route.query.id;
|
this.id = this._route.query.id;
|
||||||
}
|
}
|
||||||
|
this.isIntegral = url.isIntegral == 'true'
|
||||||
this.productCon();
|
this.productCon();
|
||||||
this.setOpenShare();
|
this.setOpenShare();
|
||||||
},
|
},
|
||||||
@ -507,6 +513,7 @@
|
|||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, "price", productSelect.price);
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
||||||
|
this.$set(this.attr.productSelect, "integral", productSelect.integral);
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, "cart_num", 1);
|
||||||
this.$set(this, "attrValue", value.sort().join(","));
|
this.$set(this, "attrValue", value.sort().join(","));
|
||||||
this.$set(this, "attrTxt", "已选择");
|
this.$set(this, "attrTxt", "已选择");
|
||||||
@ -518,6 +525,7 @@
|
|||||||
);
|
);
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
||||||
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
||||||
|
this.$set(this.attr.productSelect, "integral", this.storeInfo.integral);
|
||||||
this.$set(this.attr.productSelect, "stock", 0);
|
this.$set(this.attr.productSelect, "stock", 0);
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this.attr.productSelect, "unique", "");
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
this.$set(this.attr.productSelect, "cart_num", 0);
|
||||||
@ -532,6 +540,7 @@
|
|||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
||||||
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
||||||
this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
|
this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
|
||||||
|
this.$set(this.attr.productSelect, "integral", this.storeInfo.integral);
|
||||||
this.$set(
|
this.$set(
|
||||||
this.attr.productSelect,
|
this.attr.productSelect,
|
||||||
"unique",
|
"unique",
|
||||||
@ -632,12 +641,14 @@
|
|||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, "price", productSelect.price);
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
||||||
|
this.$set(this.attr.productSelect, "integral", productSelect.integral);
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, "cart_num", 1);
|
||||||
this.$set(this, "attrValue", res.value);
|
this.$set(this, "attrValue", res.value);
|
||||||
this.$set(this, "attrTxt", "已选择");
|
this.$set(this, "attrTxt", "已选择");
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
||||||
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
||||||
|
this.$set(this.attr.productSelect, "integral", this.storeInfo.price);
|
||||||
this.$set(this.attr.productSelect, "stock", 0);
|
this.$set(this.attr.productSelect, "stock", 0);
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this.attr.productSelect, "unique", "");
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
this.$set(this.attr.productSelect, "cart_num", 0);
|
||||||
@ -698,11 +709,11 @@
|
|||||||
cartNum: that.attr.productSelect.cart_num,
|
cartNum: that.attr.productSelect.cart_num,
|
||||||
new: news,
|
new: news,
|
||||||
uniqueId: that.attr.productSelect !== undefined ?
|
uniqueId: that.attr.productSelect !== undefined ?
|
||||||
that.attr.productSelect.unique :
|
that.attr.productSelect.unique : "",
|
||||||
"",
|
|
||||||
};
|
};
|
||||||
postCartAdd(q)
|
postCartAdd(q)
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
|
console.log(res)
|
||||||
that.isOpen = false;
|
that.isOpen = false;
|
||||||
that.attr.cartAttr = false;
|
that.attr.cartAttr = false;
|
||||||
if (news) {
|
if (news) {
|
||||||
@ -718,6 +729,7 @@
|
|||||||
path: "/pages/order/OrderSubmission/index",
|
path: "/pages/order/OrderSubmission/index",
|
||||||
query: {
|
query: {
|
||||||
id: res.data.cartId,
|
id: res.data.cartId,
|
||||||
|
isIntegral:that.isIntegral
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -732,9 +744,12 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.log(error)
|
||||||
that.isOpen = false;
|
that.isOpen = false;
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.response.data.msg,
|
title: error.msg ||
|
||||||
|
error.response.data.msg ||
|
||||||
|
error.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user