Commit ea58761d by 李伟康

修改代码

1 parent 96f56419
......@@ -55,5 +55,5 @@ export default {
url,
data
})
}
},
}
\ No newline at end of file
const url = '/rop-scrm-shopmall/router'
export default {
/** 获取门店商品列表 */
getGoodsList(currentPage) {
getGoodsList (currentPage) {
let data = {
method: 'scrm.api.shopmall.goods.wework.page',
pageSize: 10,
......@@ -13,7 +13,7 @@ export default {
})
},
/**获取商品海报 */
getGoodsPoster(data) {
getGoodsPoster (data) {
data.method = 'scrm.api.shopmall.goods.wework.posterUrl'
return window.$HTTP({
url,
......@@ -21,7 +21,7 @@ export default {
})
},
/** 获取商品链接 */
getGoodsLink(data) {
getGoodsLink (data) {
data.method = 'scrm.api.shopmall.goods.wework.url'
return window.$HTTP({
url,
......@@ -29,7 +29,7 @@ export default {
})
},
/** 获取商品海报企业微信素材mediaId */
getGoodsPosterMediaId(data) {
getGoodsPosterMediaId (data) {
data.method = 'scrm.api.shopmall.goods.wework.posterWorkWxMediaId'
return window.$HTTP({
url,
......@@ -38,7 +38,7 @@ export default {
},
/** 分页查询商品订单核销列表(待核销、已核销用查询参数区分) */
getGoodsVerficationList(data = {}) {
getGoodsVerficationList (data = {}) {
data.method = 'scrm.api.shopmall.wework.order.verfication.page'
data.pageSize = 10
return window.$HTTP({
......@@ -48,7 +48,7 @@ export default {
},
/**根据商城订单核销码获取商城订单详情以备核销 */
getGoodsVerficationDetail(verificationCode) {
getGoodsVerficationDetail (verificationCode) {
let data = {
method: 'scrm.api.shopmall.wework.order.detail.toVerfication',
verificationCode: verificationCode
......@@ -60,7 +60,7 @@ export default {
},
/** 商品订单核销 */
verficationGoods(verificationCode) {
verficationGoods (verificationCode) {
let data = {
method: 'scrm.api.shopmall.wework.order.verfication',
verificationCode: verificationCode
......@@ -69,5 +69,16 @@ export default {
url,
data
})
},
/**查看商品订单详情 */
getGoodsDetail (orderCode) {
let data = {
method: 'scrm.api.shopmall.weapp.order.detail',
orderCode
}
return window.$HTTP({
url,
data
})
}
}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 290px 250px;}
.icon-coupon-0 { width: 32px; height: 32px; background-position: -134px -180px;}
.icon-coupon-1 { width: 32px; height: 32px; background-position: -176px -180px;}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 319px 250px;}
.icon-close { width: 12px; height: 12px; background-position: -231px -180px;}
.icon-coupon-0 { width: 32px; height: 32px; background-position: -270px -113px;}
.icon-coupon-1 { width: 32px; height: 32px; background-position: -270px -155px;}
.icon-coupon-lose { width: 70px; height: 70px; background-position: -180px -90px;}
.icon-coupon-success { width: 70px; height: 70px; background-position: 0px -180px;}
.icon-coupon-tips { width: 49px; height: 49px; background-position: -270px 0px;}
.icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;}
.icon-discount { width: 80px; height: 80px; background-position: -90px 0px;}
.icon-down { width: 12px; height: 12px; background-position: -270px -110px;}
.icon-down { width: 12px; height: 12px; background-position: -80px -217px;}
.icon-exchange { width: 80px; height: 80px; background-position: 0px -90px;}
.icon-gift-add { width: 12px; height: 12px; background-position: -270px -132px;}
.icon-gift-add { width: 12px; height: 12px; background-position: -102px -217px;}
.icon-gift-bg { width: 80px; height: 80px; background-position: -90px -90px;}
.icon-gift-create { width: 16px; height: 16px; background-position: -270px -58px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -270px -30px;}
.icon-gift-icon { width: 44px; height: 44px; background-position: -80px -180px;}
.icon-poster-close { width: 20px; height: 20px; background-position: -218px -180px;}
.icon-scan { width: 16px; height: 16px; background-position: -270px -84px;}
.icon-share { width: 20px; height: 20px; background-position: -270px 0px;}
.icon-gift-create { width: 16px; height: 16px; background-position: -300px -227px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -300px -197px;}
.icon-gift-icon { width: 44px; height: 44px; background-position: -270px -59px;}
.icon-gift-logo { width: 89px; height: 27px; background-position: -80px -180px;}
.icon-goods-share { width: 16px; height: 16px; background-position: -179px -180px;}
.icon-poster-close { width: 20px; height: 20px; background-position: -270px -197px;}
.icon-scan { width: 16px; height: 16px; background-position: -205px -180px;}
.icon-share { width: 20px; height: 20px; background-position: -270px -227px;}
.icon-vip { width: 80px; height: 80px; background-position: -180px 0px;}
\ No newline at end of file

119 KB | W: | H:

128 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -47,7 +47,7 @@ export default {
{ text: '优惠券', value: 0 },
{ text: '精品礼券', value: 1 },
{ text: '商品订单', value: 2 },
{ text: '会员服务', value: 3 }
{ text: '门店服务', value: 3 }
],
searchValue: ''
}
......
......@@ -5,7 +5,7 @@ const discountType = {
4: '兑换',
5: '购车代金',
6: '商品折扣',
7: '会员服务'
7: '门店服务'
}
export default {
data() {
......@@ -18,7 +18,7 @@ export default {
4: '兑换券',
5: '购车代金券',
6: '商品折扣券',
7: '会员服务'
7: '门店服务'
},
}
},
......
......@@ -66,6 +66,7 @@
<div
class="btn text-center"
@click="submit"
v-if="!hideBtn"
>确认核销</div>
</div>
</template>
......@@ -77,6 +78,7 @@ export default {
data () {
return {
flag: false,
hideBtn: false,
detail: {},
total: 0,
price: 0,
......@@ -120,23 +122,35 @@ export default {
}
},
activated () {
let { verficationCode } = this.getParams()
let { verficationCode, orderCode } = this.getParams()
this.showLoading()
shopmallApi
if (orderCode) this.getGoodsDetail(orderCode)
else 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)
this.setData(res)
})
},
mounted () {
},
deactivated () {
Object.assign(this.$data, this.$options.data.call(this))
},
methods: {
setData (res) {
res.orderGoods.map(e => (this.price += e.retailPrice))
this.detail = res
this.flag = true
this.total = this.price + res.expressFee
this.hideLoading()
},
getGoodsDetail (orderCode) {
shopmallApi.getGoodsDetail(orderCode).then(res => {
this.setData(res)
this.hideBtn = true
})
},
submit () {
let { verficationCode } = this.getParams()
this.showLoading()
......
......@@ -8,10 +8,21 @@
:updata="updata"
sticky
></tab>
<template v-if="tabIndex==1 && showTips">
<div class="tips flex">
温馨提示:多次发送同张优惠券给客户,客户可领
<div
class="close flex"
@click="closeTips"
>
<div class="sprite-icon icon-close"></div>
</div>
</div>
</template>
<template v-if="flag">
<template v-if="list.length">
<scroll-view
class="list-box"
:class="['list-box',{'tips-type':showTips && tabIndex == 1}]"
@ReachBottom="onReachBottom"
ref="scrollView"
>
......@@ -64,6 +75,29 @@
<template v-else>
<router-view></router-view>
</template>
<template v-if="tabIndex == 1">
<van-dialog
v-model="showCouponModal"
confirmButtonText="我知道了"
confirmButtonColor="#3975C6"
@confirm="closeCouponModal"
>
<div class="modal-content flex">
<div class="sprite-icon icon-coupon-tips"></div>
<div class="modal-content-title">温馨提示</div>
<div class="modal-content-text">多次发送同张优惠券给客户,客户可领取多张,请注意控制成本</div>
<div class="modal-content-radio flex">
<van-checkbox
v-model="modalChecked"
checked-color="#3975C6"
shape="square"
icon-size="16px"
></van-checkbox>
以后不再提示
</div>
</div>
</van-dialog>
</template>
</div>
</template>
......@@ -75,11 +109,20 @@ export default {
mixins: [shareMixin, pageMixin, discountTypeMixin],
data () {
return {
// tabList: ['商城优惠券']
tabList: ['新车精品礼券', '商城优惠券']
tabList: ['新车精品礼券', '商城优惠券'],
showTips: true,
showCouponModal: false,
modalChecked: false
}
},
mounted () { },
mounted () {
const { corpId } = this.getLocalStorage('dj_scrm_corpId')
const tomorrow = this.getLocalStorage(`dj_scrm_coupon_tips_${corpId}`)
const couponModal = this.getLocalStorage(`dj_scrm_coupon_modal_${corpId}`)
const now = new Date().getTime()
if (tomorrow) this.showTips = now >= tomorrow
this.showCouponModal = !couponModal
},
methods: {
getList (pageNum) {
let { list, tabIndex } = this
......@@ -92,12 +135,49 @@ export default {
this.list = list.concat(res.list)
this.total = res.total
})
},
closeTips () {
const now = new Date()
const { corpId } = this.getLocalStorage('dj_scrm_corpId')
this.showTips = false
let tomorrow = new Date(`${new Date(now.setDate(now.getDate() + 1)).format('yyyy-MM-dd')} 00:00:00`).getTime()
this.setLocalStorage(`dj_scrm_coupon_tips_${corpId}`, tomorrow)
},
closeCouponModal () {
let { modalChecked } = this
if (!modalChecked) return
const { corpId } = this.getLocalStorage('dj_scrm_corpId')
this.setLocalStorage(`dj_scrm_coupon_modal_${corpId}`, modalChecked)
}
}
}
</script>
<style scoped lang='scss'>
.tips {
position: sticky;
top: 50px;
height: 32px;
background: #e5effd;
z-index: 2;
font-size: 12px;
color: #333333;
padding-left: 16px;
&::before {
content: '';
width: 1px;
height: 14px;
background-color: #3975c6;
margin-right: 7px;
}
.close {
margin-left: auto;
width: 32px;
height: 100%;
justify-content: flex-end;
padding-right: 16px;
}
}
.list-box {
height: calc(100vh - 100px);
.item {
......@@ -184,4 +264,31 @@ export default {
}
}
}
.tips-type {
height: calc(100vh - 132px);
}
.modal-content {
flex-direction: column;
padding: 24px 24px 9px;
color: rgba(10, 17, 26, 0.5);
font-size: 15px;
&-title {
font-size: 17px;
font-weight: 500;
color: #000000;
margin: 19px 0 8px;
}
&-text {
text-align: center;
}
&-radio {
margin-top: 8px;
font-size: 14px;
color: #666666;
justify-content: center;
.van-checkbox {
margin-right: 4px;
}
}
}
</style>
\ No newline at end of file
......@@ -30,13 +30,24 @@
class="item flex"
v-if="detail[i.key]"
>
<div class="label">{{i.label}}</div>
<div class="label">
{{i.label}}
<template v-if="i.tipsLabel">
<div class="item-tips">{{i.tipsLabel}}</div>
</template>
</div>
<div class="value">
<template v-if="i.format">
<div v-html="i.format(detail)"></div>
</template>
<template v-else>
{{detail[i.key] || ''}}
<template v-if="i.tipsValue">
<div
class="item-tips"
v-html="i.tipsValue(detail)"
></div>
</template>
</template>
</div>
</div>
......@@ -61,9 +72,25 @@
</div>
</div>
</div>
<template v-if="detail.directionalGiftName">
<div class="item flex">
<div class="label">
所属定向礼包
<div class="item-tips">领取条件</div>
</div>
<div class="value">
{{detail.directionalGiftName}}
<div class="item-tips">
{{detail.directionalGiftReceiveWay == 1?'手机号':'车架号后6位'}}:{{detail.directionalGiftReceiveCondition}}
</div>
</div>
</div>
</template>
</template>
</div>
<div
v-if="!hideBtn"
class="btn text-center"
@click="submit"
>确认核销</div>
......@@ -90,6 +117,14 @@ const couponObj = [
}
},
{
label: '所属定向礼包',
key: 'directionalGiftName',
tipsLabel: '领取条件',
tipsValue (item) {
return `${item.directionalGiftReceiveWay == 1 ? '手机号' : '车架号后6位'}:${item.directionalGiftReceiveCondition}`
}
},
{
label: '发放人',
key: 'issueName'
},
......@@ -111,8 +146,15 @@ const vipObj = [
key: 'couponName'
},
{
label: '类型',
key: 'discountType',
format () {
return '服务券'
}
},
{
label: '有效期',
KEY: 'effectiveType',
key: 'effectiveType',
format (item) {
let { effectiveType } = item
let str = ''
......@@ -121,7 +163,7 @@ const vipObj = [
else str = '无有效期'
return str
}
}
},
]
export default {
name: '',
......@@ -148,15 +190,17 @@ export default {
],
infoObj: [],
verficationCode: '',
flag: false
flag: false,
hideBtn: false
}
},
activated () {
let { verficationCode } = this.getParams()
let { verficationCode, hideBtn } = this.getParams()
this.showLoading()
this.hideBtn = hideBtn
couponApi.scan({ verficationCode }).then(res => {
this.hideLoading()
this.detail = res
this.detail = res || {}
this.infoObj = res.discountType == 7 ? vipObj : couponObj
this.verficationCode = verficationCode
this.flag = true
......@@ -165,6 +209,9 @@ export default {
mounted () {
},
deactivated(){
Object.assign(this.$data, this.$options.data.call(this))
},
methods: {
submit () {
let { detail: { discountType } } = this
......@@ -203,12 +250,23 @@ export default {
color: #3a3a3a;
padding: 0 16px;
border-bottom: 1px solid rgba(195, 195, 195, 0.3);
&-tips {
color: #666666;
margin-top: 10px;
font-size: 12px;
}
.label {
.item-tips {
margin-left: 8px;
}
}
&:last-of-type {
border-bottom: none;
}
.value {
margin-left: auto;
color: #333333;
text-align: right;
&-btn {
font-size: 12px;
color: #3975c6;
......@@ -218,6 +276,9 @@ export default {
border-radius: 4px;
margin-right: 10px;
}
.item-tips {
color: #333333;
}
}
}
}
......
......@@ -25,11 +25,12 @@
<div
:key="index"
class="item"
@click="jump(item)"
>
<!-- 0:优惠券 1:精品礼券 2:商品订单 3:会员服务 -->
<!-- 0:优惠券 1:精品礼券 2:商品订单 3:门店服务 -->
<template v-if="type == 0 || type == 1">
<div class="title flex">
{{item.userName || item.customerName}}
<div class="name text-hide">{{item.userName || item.customerName}}</div>
<div class="time">
<template v-if="type == 0">
<template v-if="tabIndex == 0">
......@@ -109,8 +110,10 @@
</template>
<template v-else>
<div class="title flex">
{{item.userName}}
<span class="time">{{tabIndex == 0?'核销时间':'购买时间'}}:{{new Date(tabIndex == 0 ?item.verificationTime:item.receiveTime).format('yyyy/MM/dd')}}</span>
{{item.phone}}
<template v-if="item.directionalGiftId || item.directionalGiftName">
<div class="sprite-icon icon-gift-logo"></div>
</template>
</div>
<div class="page">
<div class="page-item flex">
......@@ -118,10 +121,6 @@
<div class="value">{{item.couponName}}</div>
</div>
<div class="page-item flex">
<div class="label">所属套餐</div>
<div class="value">{{item.packageName}}</div>
</div>
<div class="page-item flex">
<div class="label">有效期</div>
<div class="value">
<template v-if="item.useType == 0">
......@@ -141,19 +140,22 @@
</template>
</div>
</div>
<template v-if="item.verificationOperator">
<div class="page-item flex">
<div class="label">核销人</div>
<div class="value">{{item.verificationOperator}}</div>
</div>
</template>
</div>
<div class="bottom flex">
<div class="vip-btn text-center">
<template v-if="tabIndex == 0">已核销{{item.useAllAmount}}次</template>
<template v-if="tabIndex == 0">已核销{{item.usedAmount}}次</template>
<template v-else>
<template v-if="item.residueAmount">剩余可用{{item.residueAmount}}次</template>
<template v-else>不限次数</template>
</template>
</div>
<div
class="name"
v-if="item.verificationOperator"
>核销人:{{item.verificationOperator}}</div>
<div class="name">{{tabIndex == 0?'核销时间':'购买时间'}}:{{new Date(tabIndex == 0 ?item.verificationTime:item.receiveTime).format('yyyy/MM/dd')}}</div>
</div>
</template>
</div>
......@@ -225,7 +227,7 @@ export default {
list: [],
updata: new Date().getTime(),
tabIndex: 0,
type: 0, /**0:优惠券 1:精品礼券 2:商品订单 3:会员服务*/
type: 0, /**0:优惠券 1:精品礼券 2:商品订单 3:门店服务*/
flag: false,
pageNum: 1,
itemObj,
......@@ -421,7 +423,7 @@ export default {
this.getList()
},
scan () {
// let resultStr = 't=2&c=7498728184171335680'
// let resultStr = 't=1&c=3510671342174081024'
wxConfig.scanQRCode(1).then(({ resultStr }) => {
let name = 'verificationDetail'
let [t, c] = resultStr.split('&')
......@@ -435,6 +437,22 @@ export default {
}
})
})
},
jump (item) {
let { type, tabIndex } = this
const { userCouponVerificationCode, verificationCode, orderCode } = item
if ((type == 0 && tabIndex == 2) || type == 1) return
let name = type == 2 ? 'goodsVerification' : 'verificationDetail'
let params = type == 2 ? {
orderCode
} : {
verficationCode: userCouponVerificationCode || verificationCode,
hideBtn: true
}
this.$router.push({
name: `coupon.${name}`,
params
})
}
}
}
......@@ -467,6 +485,7 @@ export default {
font-size: 12px;
color: #999999;
margin-left: auto;
flex-shrink: 0;
}
}
.info {
......@@ -516,12 +535,9 @@ export default {
font-size: 14px;
min-height: 40px;
border-bottom: 1px solid #eff0f2;
padding: 0 12px;
.time {
padding-left: 12px;
.sprite-icon {
margin-left: auto;
font-weight: 400;
font-size: 12px;
color: #666666;
}
}
.goods {
......
......@@ -149,7 +149,7 @@ export default {
})
},
getCouponList (callBack) {
// 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:会员服务
// 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:门店服务
let { merchantId, uuid } = this.getLocalStorage('dj_scrm_userInfo')
let { tabIndex } = this
let discountType = [7, 3, 2, 4][tabIndex]
......
......@@ -43,7 +43,7 @@
:key="index"
>
<!-- status 优惠券状态(1:未生效,2:生效中,3:已失效) -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:会员服务 -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:门店服务 -->
<span class="detail-title text-center">{{discountEnum[i.discountType]}}</span>
<template v-for="(e,ind) in i.list">
<div
......
......@@ -51,7 +51,7 @@
:key="index"
>
<!-- status 优惠券状态(1:未生效,2:生效中,3:已失效) -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:会员服务 -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:门店服务 -->
<span class="detail-title text-center">{{discountEnum[i.discountType]}}</span>
<template v-for="(e,ind) in i.list">
<div
......
......@@ -63,11 +63,20 @@
</div>
<div class="info">
<div class="name text-two-line">{{i.goodsName}}</div>
<div class="stock">库存:{{i.goodsStock}}</div>
<template v-if="i.price">
<div class="price">¥<template v-if="i.activityPrice">{{i.activityPrice.toFixed(2)}}</template><template v-else>{{i.price.toFixed(2)}}</template></div>
<template v-if="i.price || i.activityPrice">
<div class="price flex">
<template v-if="i.activityPrice">
<div class="activity">秒杀价</div>
</template>
<div class="unit">¥</div>
<div class="num">
<template v-if="i.activityPrice">{{i.activityPrice.toFixed(2)}}</template>
<template v-else>{{i.price.toFixed(2)}}</template>
</div>
</div>
</template>
<div class="btn text-center">分享给客户</div>
<div class="stock">库存:{{i.goodsStock}}</div>
<div class="sprite-icon icon-goods-share"></div>
</div>
</div>
</template>
......@@ -218,15 +227,25 @@ export default {
}
.price {
color: var(--themeColor);
font-weight: 500;
font-size: 16px;
font-size: 0;
align-items: baseline;
letter-spacing: -0.5px;
.activity {
font-size: 8px;
}
.unit {
font-size: 10px;
}
.num {
font-size: 16px;
font-weight: 500;
// font-family:;
}
}
.btn {
.icon-goods-share {
position: absolute;
bottom: 10px;
right: 8px;
border-radius: 12px;
height: 20px;
right: 12px;
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!