Commit cbeb5f5f by 李伟康

commit

1 parent 19f3aa4e
......@@ -33,4 +33,38 @@ export default {
data
})
},
}
\ No newline at end of file
/** 分页查询商品订单核销列表(待核销、已核销用查询参数区分) */
getGoodsVerficationList(data = {}) {
data.method = 'scrm.api.shopmall.wework.order.verfication.page'
data.pageSize = 10
return window.$HTTP({
url,
data
})
},
/**根据商城订单核销码获取商城订单详情以备核销 */
getGoodsVerficationDetail(verificationCode) {
let data = {
method: 'scrm.api.shopmall.wework.order.detail.toVerfication',
verificationCode: verificationCode
}
return window.$HTTP({
url,
data
})
},
/** 商品订单核销 */
verficationGoods(verificationCode) {
let data = {
method: 'scrm.api.shopmall.wework.order.verfication',
verificationCode: verificationCode
}
return window.$HTTP({
url,
data
})
}
}
......@@ -4,7 +4,7 @@ html,
body .app {
color: #333333;
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color:#fff;
background-color:#f7f7f7;
-webkit-overflow-scrolling: touch;
height: 100%;
// overflow: hidden;
......
......@@ -27,7 +27,9 @@ export default {
value: 0,
option: [
{ text: '优惠券', value: 0 },
{ text: '精品礼券', value: 1 }
{ text: '精品礼券', value: 1 },
{ text: '商品订单', value: 2 },
{ text: '会员服务', value: 3 }
]
}
},
......
......@@ -7,8 +7,7 @@ export default {
}
},
mounted() {
// if (this.$route.meta.isTab || this.$route.meta.isIndex)
this.wxInit()
if (this.$route.meta.isTab || this.$route.meta.isIndex) this.wxInit()
},
methods: {
wxInit() {
......
......@@ -25,7 +25,7 @@ function createRouter() {
return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL,
scrollBehavior: function(to, from, savedPosition) {
scrollBehavior: function (to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 }
},
routes
......@@ -40,8 +40,8 @@ router.beforeEach((to, from, next) => {
store.dispatch('setPageMeta', { title: '活动中心' })
}
store.commit('SET_LAST_PATH', to.name)
/* 路由发生变化修改页面背景色 */
document.documentElement.style.backgroundColor = to.meta.backgroundColor || '#fff'
/* 路由发生变化修改页面背景色 */
if (to.meta.backgroundColor) document.documentElement.style.backgroundColor = to.meta.backgroundColor
if (to.matched.some(recode => recode.meta.noAuth)) {
store.state.app.showWindow = true
} else {
......@@ -50,12 +50,10 @@ router.beforeEach((to, from, next) => {
next()
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router
\ No newline at end of file
export default router
......@@ -3,20 +3,25 @@ const pages = [
name: 'coupon',
meta: {
isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
keepAlive: true
},
children: [
{
name: 'verificationList',
meta: {
backgroundColor: '#F7F7F7'
title: '核销列表'
}
},
{
name: 'verificationDetail',
meta: {
backgroundColor: '#F7F7F7'
title: '核销详情'
}
},
{
name: 'goodsVerification',
meta: {
title: '核销订单'
}
}
]
......
......@@ -161,6 +161,10 @@ const watchPageBack = () => {
}
})
}
/**分转元 */
const centsToyuan = price => {
return decimal(price / 100, 2).toFixed(2)
}
const utils = {
removeLocalStorage,
setClipboardData,
......@@ -174,6 +178,7 @@ const utils = {
setSessionId,
getSessionId,
showLoading,
centsToyuan,
hideLoading,
refreshPage,
touchstart,
......
<template>
<div
class="layout"
v-if="flag"
>
<div class="box order">
<div class="title">订单信息</div>
<template v-for="(i,index) in orderObj">
<div
class="item"
:key="index"
>
<div class="label">{{i.label}}:</div>
<div class="value">
<template v-if="i.format">
{{ i.format(detail)}}
</template>
<template v-else>
{{detail[i.key] || ''}}
</template>
</div>
</div>
</template>
</div>
<div class="box">
<div class="title">订单商品</div>
<div class="subtitle">{{detail.merchantName}}</div>
<div class="goods-box">
<template v-for="(i,index) in detail.orderGoods">
<div
class="item flex"
:key="index"
>
<img
:src="i.goodsImage"
class="icon"
>
<div class="info flex">
<div class="name">{{i.goodsName}}</div>
<div class="price flex">
¥ {{i.retailPrice || 0}}
<div class="num">x{{i.goodsNumber || 1}}</div>
</div>
</div>
</div>
</template>
</div>
</div>
<div class="box order-price">
<div class="title">订单金额</div>
<div class="flex item">
<div class="label">商品总价:</div>
<div class="value">¥{{price}}</div>
</div>
<div class="flex item">
<div class="label">运费:</div>
<div class="value">¥{{detail.expressFee}}</div>
</div>
<div class="total flex item">
<div class="label">订单金额:</div>
<div class="value">
<span class="unit">¥</span>{{total}}
</div>
</div>
</div>
<div
class="btn text-center"
@click="submit"
>确认核销</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { shopmallApi } from '@/api'
export default {
name: '',
data() {
return {
flag: false,
detail: {},
total: 0,
price: 0,
orderObj: [
{
label: '客户姓名',
key: 'customerName'
},
{
label: '下单日期',
format(item) {
return new Date(item.createdDate).format('yyyy.MM.dd hh:mm')
}
},
{
label: '订单编号',
key: 'orderCode'
},
{
label: '收货地址',
key: 'shipAddress'
},
{
label: '订单状态',
format(item) {
return {
1: '待付款',
2: '已支付',
3: '已关闭',
4: '已发货',
5: '已收货',
6: '待审核',
7: '审核通过',
8: '审核不通过',
9: '待确认收到退货',
10: '退款中',
11: '已退款',
12: '退款失败',
13: '待发货',
14: '待安装',
15: '已安装'
}[item.orderStatus]
}
}
]
}
},
mounted() {
let { verficationCode } = this.getParams()
this.showLoading()
shopmallApi
.getGoodsVerficationDetail(verficationCode)
.then(res => {
res.orderGoods.map(e => (this.price += e.retailPrice))
this.detail = res
this.flag = true
this.total = this.price + res.expressFee
this.hideLoading()
console.log(res)
})
},
methods: {
submit() {
let { verficationCode } = this.getParams()
this.showLoading()
shopmallApi
.verficationGoods(verficationCode)
.then(res => {
this.hideLoading()
if (res)
this.showToast('已核销', () => {
this.$router.back()
})
})
}
}
}
</script>
<style scoped lang='scss'>
.layout {
padding: 0 16px 60px;
.box {
background: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
border-radius: 4px;
padding: 12px;
margin-top: 10px;
font-size: 12px;
.title {
font-size: 16px;
font-weight: 500;
color: #282829;
margin-bottom: 12px;
}
.subtitle {
color: #2d2d2e;
margin-bottom: 16px;
}
.goods-box {
.item {
margin-bottom: 20px;
.icon {
width: 80px;
height: 80px;
margin-right: 10px;
}
.info {
width: calc(100% - 90px);
height: 80px;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
.name {
font-size: 15px;
font-weight: 500;
color: #333333;
}
.price {
font-size: 14px;
color: #3975c6;
width: 100%;
.num {
margin-left: auto;
color: #656566;
}
}
}
&:last-of-type {
margin-bottom: 0;
}
}
}
}
.order {
.item {
display: flex;
color: #282829;
line-height: 24px;
.label {
width: 60px;
}
.value {
width: 246px;
color: #656566;
}
}
}
.order-price {
.item {
justify-content: space-between;
font-size: 12px;
color: #656566;
line-height: 30px;
.value {
font-weight: 600;
font-size: 14px;
color: #3975c6;
.unit {
font-size: 12px;
}
}
}
.total {
margin-bottom: 2px;
border-top: 1px solid #e3e3e6;
}
}
.btn {
position: fixed;
width: 343px;
left: 50%;
bottom: 16px;
transform: translateX(-50%);
height: 42px;
font-size: 14px;
border-radius: 21px;
box-sizing: border-box;
}
}
</style>
\ No newline at end of file
<template>
<div
class="layout"
v-if="detail"
v-if="flag"
>
<div class="title">客户信息</div>
<div class="box">
......@@ -22,9 +22,9 @@
</div>
</template>
</div>
<div class="title">优惠券信息</div>
<div class="title">{{detail.discountType == 7?'服务信息':'优惠券信息'}}</div>
<div class="box">
<template v-for="(i,index) in couponObj">
<template v-for="(i,index) in infoObj">
<div
:key="index"
class="item flex"
......@@ -32,7 +32,7 @@
<div class="label">{{i.label}}</div>
<div class="value">
<template v-if="i.format">
{{ i.format(detail)}}
<div v-html="i.format(detail)"></div>
</template>
<template v-else>
{{detail[i.key] || ''}}
......@@ -40,6 +40,27 @@
</div>
</div>
</template>
<template v-if="detail.discountType == 7">
<div class="item flex">
<div class="label">使用限制</div>
<div class="value flex">
<div class="value-btn text-center">
已核销{{detail.usedAmount}}次
</div>
<div class="use-type">
<template v-if="detail.useType == 0">不限次数</template>
<template v-else-if="detail.useType == 1">
{{detail.effectiveType > 2 ? '' : '有效期'}}可用{{detail.useAllAmount}}次
</template>
<template v-else>
每隔{{detail.useLimitDays}}天
|
可用{{detail.useAmount}}次
</template>
</div>
</div>
</div>
</template>
</div>
<div
class="btn text-center"
......@@ -51,6 +72,53 @@
<script type='text/ecmascript-6'>
import { discountTypeMixin } from '@/mixins'
import { couponApi } from '@/api'
const couponObj = [
{
label: '优惠券名称',
key: 'couponName'
},
{
label: '券编号',
key: 'verificationCode'
},
{
label: '类型',
format(item) {
return window.$discountType[item.discountType]
}
},
{
label: '发放人',
key: 'issueName'
},
{
label: '发放时间',
format(item) {
return new Date(item.issueDate).format('yyyy年MM月dd日')
}
}
]
const vipObj = [
{
label: '所属套餐',
key: 'packageName'
},
{
label: '服务名称',
key: 'couponName'
},
{
label: '有效期',
format(item) {
let { effectiveType } = item
let str = ''
if (effectiveType == 1) str = `${item.effectiveDays}天`
else if (effectiveType == 1) str = `${new Date(item.effectiveStartTime).format('yyyy/MM/dd')} ~ ${new Date(item.effectiveEndTime).format('yyyy/MM/dd')}`
else str = '无有效期'
return str
}
}
]
export default {
name: '',
mixins: [discountTypeMixin],
......@@ -73,46 +141,28 @@ export default {
}
}
],
couponObj: [
{
label: '优惠券名称',
key: 'couponName'
},
{
label: '券编号',
key: 'verificationCode'
},
{
label: '类型',
format(item) {
return window.$discountType[item.discountType]
}
},
{
label: '发放人',
key: 'issueName'
},
{
label: '发放时间',
format(item) {
return new Date(item.issueDate).format('yyyy年MM月dd日')
}
}
],
verficationCode: ''
infoObj: [],
verficationCode: '',
flag: false
}
},
mounted() {
let { verficationCode } = this.getParams()
this.showLoading()
couponApi.scan({ verficationCode }).then(res => {
this.hideLoading()
this.detail = res
this.infoObj = res.discountType == 7 ? vipObj : couponObj
this.verficationCode = verficationCode
this.flag = true
})
},
methods: {
submit() {
let { verficationCode } = this
this.showLoading()
couponApi.verificationCode({ verficationCode }).then(res => {
this.hideLoading()
if (res)
this.showToast('已核销', () => {
this.$router.back()
......@@ -147,7 +197,16 @@ export default {
}
.value {
margin-left: auto;
color: #d0d0d0;
color: #333333;
&-btn {
font-size: 12px;
color: #3975c6;
padding: 0 6px;
height: 24px;
background: rgba(57, 117, 198, 0.15);
border-radius: 4px;
margin-right: 10px;
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!