Commit 2e17c52e by 李伟康

Merge branch 'v2.7.0_0802' into 'develop'

合并代码

See merge request !10
2 parents 79413f25 8a90c455
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<!-- <script src="https://wwcdn.weixin.qq.com/node/wwopen/wwopenmng/js/jsapi/wecomtest$433252bc.js"></script> -->
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 --> <!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
......
const url = '/rop-scrm-bigdatautil/router'
import { util } from 'utils'
export default {
/**埋点 */
reportTrack (id) {
let userInfo = util.getLocalStorage('dj_scrm_userInfo')
let data = {
one_id: '',
staff_id: '',
staff_uuid: userInfo.uuid,
user_phone: '',
create_time: new Date().format('yyyy-MM-dd hh:mm:ss'),
item_type: 3,
customer_phone: '',
action_type: 4,
item_id: id,
business_type: 1,
add_way: 104,
merchant_id: userInfo.merchantId
}
return window.$HTTP({
url,
data: {
method: 'entmicro.api.customercollect.reportCustomerList',
jsonList: [JSON.stringify(data)]
},
})
}
}
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-equity/router' const url = '/rop-scrm-equity/router'
export default { export default {
/**套餐分页查询 */ /**套餐分页查询 */
getEquityList (pageNum) { getEquityList (pageNum,pageType) {
let data = { let data = {
method: 'scrm.api.equity.package.info.list.with.page', // method: 'scrm.api.equity.package.info.list.with.page',
method: 'scrm.api.equity.package.info.list.wechat',
pageSize: 10, pageSize: 10,
state: 1, state: 1,
pageNum pageNum
} }
if(pageType){
data.packageType = pageType
}
return window.$HTTP({ return window.$HTTP({
url, url,
data data
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
const url = '/rop-scrm-coupon/router' const url = '/rop-scrm-coupon/router'
const pageSize = 10 const pageSize = 10
export default { export default {
/**根据条件获取定向礼包列表(企微) */ /**根据条件获取可发送列表(企微) */
getGiftList (data) { getGiftList (data) {
data.method = 'scrm.api.coupon.weChat.directional.gift.list' data.method = 'scrm.api.coupon.weChat.directional.gift.list'
data.pageSize = pageSize data.pageSize = pageSize
...@@ -11,6 +11,24 @@ export default { ...@@ -11,6 +11,24 @@ export default {
data data
}) })
}, },
/**根据条件获取待完善发送列表(企微) */
getUnPerfectGiftList (data) {
data.method = 'scrm.api.coupon.weChat.unPerfect.directional.gift.list'
data.pageSize = pageSize
return window.$HTTP({
url,
data
})
},
/**根据条件获取已领取列表(企微) */
getReceivedGiftList (data) {
data.method = 'scrm.api.coupon.weChat.user.directional.gift.list'
data.pageSize = pageSize
return window.$HTTP({
url,
data
})
},
/** 获取审批中列表 */ /** 获取审批中列表 */
getInApproveGiftList (data) { getInApproveGiftList (data) {
data.method = 'scrm.api.coupon.weChat.directional.gift.approve.in.list' data.method = 'scrm.api.coupon.weChat.directional.gift.approve.in.list'
...@@ -37,10 +55,32 @@ export default { ...@@ -37,10 +55,32 @@ export default {
}) })
}, },
/**根据id获取定向礼包详情(企微) */ /**根据id获取定向礼包详情(企微) */
getGiftDetail (id) { getGiftDetail (params) {
let data = { let data = {
method: 'scrm.api.coupon.weChat.directional.gift.detail', method: 'scrm.api.coupon.weChat.directional.gift.detail',
id ...params
}
return window.$HTTP({
url,
data
})
},
/**根据id获取从审批中进入定向礼包详情(企微) */
getApproveGiftDetail (params) {
let data = {
method: 'scrm.api.coupon.weChat.directional.gift.approve.in.detail',
...params
}
return window.$HTTP({
url,
data
})
},
/**根据id获取已领取列表定向礼包详情(企微) */
getUserGiftDetail (params) {
let data = {
method: 'scrm.api.coupon.weChat.user.directional.gift.detail',
...params
} }
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -64,6 +104,14 @@ export default { ...@@ -64,6 +104,14 @@ export default {
data data
}) })
}, },
// 指定条件创建
createPerfectGift (data) {
data.method = 'scrm.api.coupon.weChat.perfect.directional.gift'
return window.$HTTP({
url,
data
})
},
/**根据定向礼包id获取二维码路径 */ /**根据定向礼包id获取二维码路径 */
createQr (data) { createQr (data) {
data.method = 'scrm.api.coupon.directional.gift.qr.code' data.method = 'scrm.api.coupon.directional.gift.qr.code'
......
...@@ -15,6 +15,7 @@ import shopmallApi from './shopmallApi' ...@@ -15,6 +15,7 @@ import shopmallApi from './shopmallApi'
import boutiquecouponApi from './boutiquecouponApi' import boutiquecouponApi from './boutiquecouponApi'
import equityApi from './equityApi' import equityApi from './equityApi'
import giftApi from './giftApi' import giftApi from './giftApi'
import bigdatautilApi from './bigdatautilApi'
export { export {
ssoApi, ssoApi,
...@@ -25,5 +26,6 @@ export { ...@@ -25,5 +26,6 @@ export {
liveApi, liveApi,
boutiquecouponApi, boutiquecouponApi,
equityApi, equityApi,
giftApi giftApi,
bigdatautilApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -81,5 +81,17 @@ export default { ...@@ -81,5 +81,17 @@ export default {
url, url,
data data
}) })
} },
/**查询众筹活动 */
getCrowdfundingList (currentPage) {
let data = {
method: 'scrm.api.shopmall.wechat.crowdfunding.activity.page',
pageSize: 10,
currentPage
}
return window.$HTTP({
url,
data
})
},
} }
.sprite-icon { background-image: url(../images/sprite.png);background-size: 319px 250px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 319px 250px;}
.icon-close { width: 12px; height: 12px; background-position: -231px -180px;} .icon-activity-time { width: 12px; height: 12px; background-position: -80px -217px;}
.icon-close { width: 12px; height: 12px; background-position: -102px -217px;}
.icon-coupon-0 { width: 32px; height: 32px; background-position: -270px -113px;} .icon-coupon-0 { width: 32px; height: 32px; background-position: -270px -113px;}
.icon-coupon-1 { width: 32px; height: 32px; background-position: -270px -155px;} .icon-coupon-1 { width: 32px; height: 32px; background-position: -270px -155px;}
.icon-coupon-lose { width: 70px; height: 70px; background-position: -180px -90px;} .icon-coupon-lose { width: 70px; height: 70px; background-position: -180px -90px;}
...@@ -7,9 +8,9 @@ ...@@ -7,9 +8,9 @@
.icon-coupon-tips { width: 49px; height: 49px; background-position: -270px 0px;} .icon-coupon-tips { width: 49px; height: 49px; background-position: -270px 0px;}
.icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;} .icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;}
.icon-discount { width: 80px; height: 80px; background-position: -90px 0px;} .icon-discount { width: 80px; height: 80px; background-position: -90px 0px;}
.icon-down { width: 12px; height: 12px; background-position: -80px -217px;} .icon-down { width: 12px; height: 12px; background-position: -124px -217px;}
.icon-exchange { width: 80px; height: 80px; background-position: 0px -90px;} .icon-exchange { width: 80px; height: 80px; background-position: 0px -90px;}
.icon-gift-add { width: 12px; height: 12px; background-position: -102px -217px;} .icon-gift-add { width: 12px; height: 12px; background-position: -146px -217px;}
.icon-gift-bg { width: 80px; height: 80px; background-position: -90px -90px;} .icon-gift-bg { width: 80px; height: 80px; background-position: -90px -90px;}
.icon-gift-create { width: 16px; height: 16px; background-position: -300px -227px;} .icon-gift-create { width: 16px; height: 16px; background-position: -300px -227px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -300px -197px;} .icon-gift-del { width: 18px; height: 18px; background-position: -300px -197px;}
...@@ -18,5 +19,6 @@ ...@@ -18,5 +19,6 @@
.icon-goods-share { width: 16px; height: 16px; background-position: -179px -180px;} .icon-goods-share { width: 16px; height: 16px; background-position: -179px -180px;}
.icon-poster-close { width: 20px; height: 20px; background-position: -270px -197px;} .icon-poster-close { width: 20px; height: 20px; background-position: -270px -197px;}
.icon-scan { width: 16px; height: 16px; background-position: -205px -180px;} .icon-scan { width: 16px; height: 16px; background-position: -205px -180px;}
.icon-share-white { width: 13px; height: 13px; background-position: -231px -180px;}
.icon-share { width: 20px; height: 20px; background-position: -270px -227px;} .icon-share { width: 20px; height: 20px; background-position: -270px -227px;}
.icon-vip { width: 80px; height: 80px; background-position: -180px 0px;} .icon-vip { width: 80px; height: 80px; background-position: -180px 0px;}
\ No newline at end of file \ No newline at end of file

128 KB | W: | H:

129 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
...@@ -11,7 +11,7 @@ module.exports = { ...@@ -11,7 +11,7 @@ module.exports = {
envVersion: 'trial', envVersion: 'trial',
title: '嘀加企微管家', title: '嘀加企微管家',
request: { request: {
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
let { tabIndex } = this.getQuery() let { tabIndex } = this.getQuery()
if (tabIndex) { if (tabIndex) {
this.tabIndex = Number(tabIndex) this.tabIndex = Number(tabIndex)
this.updata = new Date().getTime() // this.updata = new Date().getTime()
this.init() this.init()
return return
} }
......
...@@ -16,15 +16,15 @@ const state = { ...@@ -16,15 +16,15 @@ const state = {
lastPath: '' lastPath: ''
} }
const mutations = { const mutations = {
SET_PAGE_META(state, meta) { SET_PAGE_META (state, meta) {
state.pageMeta = meta state.pageMeta = meta
}, },
PUSH_KEEP(state, name) { PUSH_KEEP (state, name) {
if (!state.keepAlives.includes(name)) { if (!state.keepAlives.includes(name)) {
state.keepAlives.push(name) state.keepAlives.push(name)
} }
}, },
REMOVE_KEEP(state, names) { REMOVE_KEEP (state, names) {
state.keepAlives = state.keepAlives.reduce((arr, name) => { state.keepAlives = state.keepAlives.reduce((arr, name) => {
if (!names.includes(name)) { if (!names.includes(name)) {
return arr.push(name) return arr.push(name)
...@@ -32,28 +32,28 @@ const mutations = { ...@@ -32,28 +32,28 @@ const mutations = {
return arr return arr
}, []) }, [])
}, },
SET_LAST_PATH(state, path) { SET_LAST_PATH (state, path) {
state.lastPath = path state.lastPath = path
} }
} }
const actions = { const actions = {
setPageMeta({ commit }, meta) { setPageMeta ({ commit }, meta) {
document.title = meta.title document.title = meta.title
commit('SET_PAGE_META', meta) commit('SET_PAGE_META', meta)
}, },
setLoginToken({ commit }, val) { setLoginToken ({ commit }, val) {
commit('SET_LOGIN_TOKEN', val) commit('SET_LOGIN_TOKEN', val)
}, },
setAccountList({ commit }, list) { setAccountList ({ commit }, list) {
commit('SET_ACCOUNT_LIST', list) commit('SET_ACCOUNT_LIST', list)
}, },
pushKeep({ commit }, name) { pushKeep ({ commit }, name) {
commit('PUSH_KEEP', name) commit('PUSH_KEEP', name)
}, },
removeKeep({ commit }, names) { removeKeep ({ commit }, names) {
commit('REMOVE_KEEP', names) commit('REMOVE_KEEP', names)
}, },
login({ dispatch }) { login ({ dispatch }) {
let [redirectUrl] = window.location.href.split('?') let [redirectUrl] = window.location.href.split('?')
// 以下是 本地调试 // 以下是 本地调试
if (process.env.NODE_ENV == 'development') { if (process.env.NODE_ENV == 'development') {
...@@ -63,7 +63,8 @@ const actions = { ...@@ -63,7 +63,8 @@ const actions = {
ssoApi ssoApi
.login({ .login({
code, code,
corpId corpId,
getUserInfoFlag: false
}) })
.then(({ code, data, message }) => { .then(({ code, data, message }) => {
let route = state.lastPath == 'coupon' ? '' : state.lastPath || '' let route = state.lastPath == 'coupon' ? '' : state.lastPath || ''
...@@ -114,21 +115,21 @@ const actions = { ...@@ -114,21 +115,21 @@ const actions = {
util.showLoading() util.showLoading()
let appid = getParams('corpId') //从链接获取 let appid = getParams('corpId') //从链接获取
let dj_scrm = util.getLocalStorage('dj_scrm_corpId') let dj_scrm = util.getLocalStorage('dj_scrm_corpId')
if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'ww7ee69c648ae1b7e6' if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'wwc33bc9a3c72d45f3'
util.setLocalStorage('dj_scrm_corpId', { corpId: appid }) util.setLocalStorage('dj_scrm_corpId', { corpId: appid })
// 'ww657a2d4ae89a4424' // 'ww657a2d4ae89a4424'
const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize' const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize'
window.location.href = `${wxUrl}?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect` window.location.href = `${wxUrl}?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
} }
} else { } else {
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const { corpId, agentId } = util.getLocalStorage('dj_scrm_corpId')
const { baseURL } = window.$fetchConfig.request const { baseURL } = window.$fetchConfig.request
let url = `${baseURL}/dj-scrm-wx-work-main/#/` let url = `${baseURL}/dj-scrm-wx-work-main/#/`
window.location.href = `${url}?redirect_uri=${encodeURIComponent(redirectUrl)}&corpId=${storage_corpId.corpId}` window.location.href = `${url}?redirect_uri=${encodeURIComponent(redirectUrl)}&corpId=${corpId}&agentId=${agentId}`
} }
}, },
navigation({ dispatch }) { navigation ({ dispatch }) {
let { sessionId, corpId } = getParams() let { sessionId, corpId, agentId } = getParams()
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
if (!corpId) corpId = storage_corpId && storage_corpId.corpId if (!corpId) corpId = storage_corpId && storage_corpId.corpId
if (corpId && storage_corpId) { if (corpId && storage_corpId) {
...@@ -137,7 +138,9 @@ const actions = { ...@@ -137,7 +138,9 @@ const actions = {
util.clearSessionId() util.clearSessionId()
} }
} }
util.setLocalStorage('dj_scrm_corpId', { corpId }) let dj_scrm_storage = { corpId }
if (agentId) dj_scrm_storage.agentId = agentId
util.setLocalStorage('dj_scrm_corpId', dj_scrm_storage)
const storage_sessionId = util.getSessionId() const storage_sessionId = util.getSessionId()
if (sessionId || storage_sessionId) { if (sessionId || storage_sessionId) {
state.showWindow = true state.showWindow = true
...@@ -151,7 +154,7 @@ const actions = { ...@@ -151,7 +154,7 @@ const actions = {
} }
state.showWindow = true state.showWindow = true
}, },
registerHttp({}, sessionId = '') { registerHttp ({ }, sessionId = '') {
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } }) window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
} }
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<div class="info flex"> <div class="info flex">
<div class="name">{{i.goodsName}}</div> <div class="name">{{i.goodsName}}</div>
<div class="price flex"> <div class="price flex">
¥ {{i.retailPrice || 0}} ¥ {{i.activityPrice ||i.retailPrice || 0}}
<div class="num">x{{i.goodsNumber || 1}}</div> <div class="num">x{{i.goodsNumber || 1}}</div>
</div> </div>
</div> </div>
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
}, },
methods: { methods: {
setData (res) { setData (res) {
res.orderGoods.map(e => (this.price += e.retailPrice)) res.orderGoods.map(e => (this.price += e.activityPrice ? e.activityPrice : e.retailPrice))
this.detail = res this.detail = res
this.flag = true this.flag = true
this.total = this.price + res.expressFee this.total = this.price + res.expressFee
...@@ -147,7 +147,7 @@ export default { ...@@ -147,7 +147,7 @@ export default {
}, },
getGoodsDetail (orderCode) { getGoodsDetail (orderCode) {
shopmallApi.getGoodsDetail(orderCode).then(res => { shopmallApi.getGoodsDetail(orderCode).then(res => {
this.setData(res) this.setData(res)
this.hideBtn = true this.hideBtn = true
}) })
}, },
......
...@@ -76,22 +76,34 @@ ...@@ -76,22 +76,34 @@
<div class="item flex"> <div class="item flex">
<div class="label"> <div class="label">
所属定向礼包 所属定向礼包
<div class="item-tips">领取条件</div> <div
v-if="detail.directionalGiftReceiveWay"
class="item-tips"
>领取条件</div>
</div> </div>
<div class="value"> <div class="value">
{{detail.directionalGiftName}} {{detail.directionalGiftName}}
<div class="item-tips"> <div class="item-tips">
{{detail.directionalGiftReceiveWay == 1?'手机号':'车架号后6位'}}:{{detail.directionalGiftReceiveCondition}} <template v-if="detail.directionalGiftReceiveCondition">
{{detail.directionalGiftReceiveWay == 1?'手机号':'车架号后6位'}}:{{detail.directionalGiftReceiveCondition}}
</template>
<template v-else>直接领取</template>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
</template> </template>
<div v-if="detail.packageId" class="item flex"> <div
v-if="detail.packageId"
class="item flex"
>
<div class="label">所属套餐</div> <div class="label">所属套餐</div>
<div class="value"> <div class="value">
<div class="value">{{ detail.packageName }}</div> <div class="value">{{ detail.packageName }}</div>
<div v-if="detail.receiveWay == 6" class="sprite-icon icon-detail-group"></div> <div
v-if="detail.receiveWay == 6"
class="sprite-icon icon-detail-group"
></div>
</div> </div>
</div> </div>
...@@ -128,7 +140,7 @@ const couponObj = [ ...@@ -128,7 +140,7 @@ const couponObj = [
key: 'directionalGiftName', key: 'directionalGiftName',
tipsLabel: '领取条件', tipsLabel: '领取条件',
tipsValue (item) { tipsValue (item) {
return `${item.directionalGiftReceiveWay == 1 ? '手机号' : '车架号后6位'}:${item.directionalGiftReceiveCondition}` return item.directionalGiftReceiveCondition ? `${item.directionalGiftReceiveWay == 1 ? '手机号' : '车架号后6位'}:${item.directionalGiftReceiveCondition}` : '直接领取'
} }
}, },
{ {
...@@ -216,7 +228,7 @@ export default { ...@@ -216,7 +228,7 @@ export default {
mounted () { mounted () {
}, },
deactivated(){ deactivated () {
Object.assign(this.$data, this.$options.data.call(this)) Object.assign(this.$data, this.$options.data.call(this))
}, },
methods: { methods: {
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
<div class="flex"> <div class="flex">
<div class="name text-hide">{{item.goodsName}}</div> <div class="name text-hide">{{item.goodsName}}</div>
<div class="price"> <div class="price">
<span class="unit">¥</span>{{item.retailPrice}} <span class="unit">¥</span>{{item.activityPrice || item.retailPrice}}
</div> </div>
</div> </div>
<div class="flex"> <div class="flex">
...@@ -287,23 +287,15 @@ export default { ...@@ -287,23 +287,15 @@ export default {
let { params: { discountType, isGoods } } = from let { params: { discountType, isGoods } } = from
next(vm => { next(vm => {
if (discountType) { if (discountType) {
if (discountType == 7) { vm.changeType(0)
vm.changeType(3) vm.getUserCouponList({
vm.getUserCouponList({ userStatus: 0,
userStatus: 1, type: 0
type: 3 })
}) vm.getUserCouponList({
} else { userStatus: 1,
vm.changeType(0) type: 0
vm.getUserCouponList({ })
userStatus: 0,
type: 0
})
vm.getUserCouponList({
userStatus: 1,
type: 0
})
}
} }
if (isGoods) { if (isGoods) {
vm.changeType(2) vm.changeType(2)
...@@ -477,7 +469,7 @@ export default { ...@@ -477,7 +469,7 @@ export default {
} }
}, },
scan () { scan () {
// let resultStr = 't=1&c=3510671342174081024' // let resultStr = 't=1&c=550902106144645120'
wxConfig.scanQRCode(1).then(({ resultStr }) => { wxConfig.scanQRCode(1).then(({ resultStr }) => {
let name = 'verificationDetail' let name = 'verificationDetail'
let [t, c] = resultStr.split('&') let [t, c] = resultStr.split('&')
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<div class="value"> <div class="value">
<van-field <van-field
v-model="obj.name" v-model="obj.name"
:disabled="disabledList.includes('name')"
input-align="right" input-align="right"
maxlength="15" maxlength="15"
placeholder="请输入礼包名称" placeholder="请输入礼包名称"
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
<van-field <van-field
v-model="obj.remarkName" v-model="obj.remarkName"
input-align="right" input-align="right"
:disabled="disabledList.includes('remark')"
maxlength="30" maxlength="30"
placeholder="可按车主姓名+手机号形式备注" placeholder="可按车主姓名+手机号形式备注"
@input="input" @input="input"
...@@ -60,14 +62,14 @@ ...@@ -60,14 +62,14 @@
数量:x{{e.couponAmount}} 数量:x{{e.couponAmount}}
<div class="price">¥{{centsToyuan(e.couponAnticipatedCost * e.couponAmount)}}</div> <div class="price">¥{{centsToyuan(e.couponAnticipatedCost * e.couponAmount)}}</div>
</div> </div>
<div class="del sprite-icon icon-gift-del" @click="delCoupon(e)"></div> <div class="del sprite-icon icon-gift-del" v-if="!disabledList.includes('add')" @click="delCoupon(e)"></div>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
<div :class="['add-box text-center',{'add-line':obj.couponList.length}]"> <div v-if="!disabledList.includes('add')" :class="['add-box text-center',{'add-line':obj.couponList.length}]">
<div <div
class="add-btn text-center" class="add-btn text-center"
@click="showGiftModal" @click="showGiftModal"
...@@ -76,7 +78,7 @@ ...@@ -76,7 +78,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="box readonly-box radio-box"> <div v-if="obj.receiveRule!=3" class="box readonly-box radio-box">
<div class="title">领取条件</div> <div class="title">领取条件</div>
<template v-for="(i,index) in receiveWayObj"> <template v-for="(i,index) in receiveWayObj">
<div <div
...@@ -142,6 +144,7 @@ export default { ...@@ -142,6 +144,7 @@ export default {
return { return {
flag: false, flag: false,
disabled: true, disabled: true,
disabledList:[],
obj: { obj: {
receiveWay: 1, receiveWay: 1,
couponList: [] couponList: []
...@@ -156,7 +159,7 @@ export default { ...@@ -156,7 +159,7 @@ export default {
} }
}, },
mounted () { mounted () {
let { id } = this.getQuery() let { id,perfectFlag } = this.getQuery()
if (id) { if (id) {
this.getDetail(id) this.getDetail(id)
this.id = id this.id = id
...@@ -188,9 +191,15 @@ export default { ...@@ -188,9 +191,15 @@ export default {
this.total = total this.total = total
return res return res
}, },
getDetail (id) { getDetail () {
giftApi.getGiftDetail(id).then(res => { let { id,pageIdx, childId,perfectFlag } = this.getQuery()
let API = pageIdx==1? giftApi.getUserGiftDetail : pageIdx==2 ? giftApi.getApproveGiftDetail : giftApi.getGiftDetail
let pramas = {id,childId}
API(pramas).then(res => {
this.hideLoading() this.hideLoading()
if(res.receiveRule==2 || (res.receiveRule==3 && res.stock>1)){
this.disabledList=['name','remark','add']
}
res = this.setCouponData(res) res = this.setCouponData(res)
this.flag = true this.flag = true
if (res.receiveWay == 1) res.phone = res.receiveDetails if (res.receiveWay == 1) res.phone = res.receiveDetails
...@@ -217,10 +226,12 @@ export default { ...@@ -217,10 +226,12 @@ export default {
try { try {
target.map(key => { target.map(key => {
if (key == 'phone' || key == 'vin') { if (key == 'phone' || key == 'vin') {
if (obj.receiveWay == 1) { if(obj.receiveRule!=3){
if (!obj.phone) throw key if (obj.receiveWay == 1) {
} else { if (!obj.phone) throw key
if (!obj.vin) throw key } else {
if (!obj.vin) throw key
}
} }
} else { } else {
if (!obj[key]) throw key if (!obj[key]) throw key
...@@ -250,15 +261,17 @@ export default { ...@@ -250,15 +261,17 @@ export default {
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/
let { obj, disabled, id } = this let { obj, disabled, id } = this
if (disabled) return if (disabled) return
if (obj.receiveWay == 1) { if(obj.receiveRule!=3){
if (!phoneRex.test(obj.phone)) { if (obj.receiveWay == 1) {
this.showToast('请输入正确的手机号') if (!phoneRex.test(obj.phone)) {
return this.showToast('请输入正确的手机号')
} return
} else { }
if (obj.vin.length < 6) { } else {
this.showToast('请输入车架号的后6位') if (obj.vin.length < 6) {
return this.showToast('请输入车架号的后6位')
return
}
} }
} }
try { try {
...@@ -283,24 +296,42 @@ export default { ...@@ -283,24 +296,42 @@ export default {
receiveWay: obj.receiveWay, receiveWay: obj.receiveWay,
giveReason: obj.giveReason, giveReason: obj.giveReason,
couponCreateRequests, couponCreateRequests,
receiveDetails: obj.receiveWay == 1 ? obj.phone : obj.vin stock:1,
receiveDetailList: obj.receiveWay == 1 ? obj.phone : obj.vin
} }
if (id){ if (id){
params.id = id params.id = id
params.approveFlag = obj.approveFlag
params.receiveRule = obj.receiveRule
params.stock = obj.stock
params.staffCreateRequests = obj.staffList
params.childId = obj.childId
} }
params.requestSource = 2 params.requestSource = 2
let { perfectFlag,pageIdx } = this.getQuery()
if(id && perfectFlag==2){
params = {
id,
receiveWay:obj.receiveWay,
receiveDetail: obj.receiveWay == 1 ? obj.phone : obj.vin,
giveReason: obj.giveReason,
}
}
this.showLoading('提交中...') this.showLoading('提交中...')
giftApi.createOrupdataGift(params).then(res => { const API =(id && perfectFlag==2) ? giftApi.createPerfectGift : giftApi.createOrupdataGift
API(params).then(res => {
this.hideLoading() this.hideLoading()
if(res.approveFlag ===2){ if(res.approveFlag == 2){
wxConfig.thirdPartyOpenPage(setApproveParam(res)) wxConfig.thirdPartyOpenPage(setApproveParam(res))
.then((resp) => { .then((resp) => {
console.log(resp,'已发起审批')
setTimeout(()=>{ setTimeout(()=>{
this.$router.replace({ name: 'gift.detail', query: {id:res.directionalGiftId,approveStatus:999}}) let { pageIdx} = this.getQuery()
let childId = pageIdx ==3 ? res.directionalGiftChildId : this.obj.childId ? this.obj.childId: ''
this.$router.replace({ name: 'gift.detail', query: {id:res.directionalGiftId,approveStatus:999,childId}})
},500) },500)
}) })
}else{ }else{
// if(pageIdx==2){this.$route.query.approveStatus = 999}
this.$route.params.giftToast = `${id ? '修改' : '创建'}成功` this.$route.params.giftToast = `${id ? '修改' : '创建'}成功`
this.$router.back() this.$router.back()
} }
......
...@@ -77,16 +77,27 @@ ...@@ -77,16 +77,27 @@
</template> </template>
</div> </div>
</div> </div>
<div class="box readonly-box"> <div class="box readonly-box" v-if="obj.receiveRule!=3">
<div class="title">领取条件</div> <div class="title">领取条件</div>
<div class="item"> <!-- <div :class="[perfectFlag==1?'tel-list-box':'item']"> -->
指定{{obj.receiveWay == 1?'手机号':'车架号'}} <div class="tel-list-box">
<div class="value">{{obj.receiveDetails}}</div> <span v-if="perfectFlag==2" class="rule">员工赠送时指定</span>
<span v-else class="rule">指定{{obj.receiveWay == 1?'手机号':'车架号'}}</span>
<div class="more-wrap" :style="{'padding-bottom':(!showMoreTel && receiveDetailList.length>6)?'30px':'0'}">
<div class="tel-list" :style="{'height':(showMoreTel || receiveDetailList.length<6)?'unset':'48px'}">
<span class="tel" v-for="(telItem,idx) in receiveDetailList" :key="idx">{{telItem}}</span>
</div>
<div v-if="!showMoreTel && receiveDetailList.length>6" class="more-btn" @click.stop="showMoreTel=true">
展开全部
<img src="../../assets/images/icon/more.png" alt="">
</div>
</div>
<!-- <div v-else class="value">{{obj.receiveDetails}}</div> -->
</div> </div>
</div> </div>
<div class="box readonly-box"> <div class="box readonly-box">
<div class="title">赠送原因</div> <div class="title">赠送原因</div>
<div class="item"> <div class="item" style="word-break: break-all;">
{{obj.giveReason || '-'}} {{obj.giveReason || '-'}}
</div> </div>
</div> </div>
...@@ -127,15 +138,17 @@ ...@@ -127,15 +138,17 @@
</div> </div>
</div> </div>
</template> </template>
<div v-if="obj.receivedFlag == 1 && approveStatus != 1" class="submit-btn"> <div v-if="flag && (!(approveStatus == 1 || pageIdx==1 || (pageIdx!=3 && receiveDetailList.length>1)))" class="submit-btn">
<div <div
:class="isShowApprovalDetail? '': 'white'" class="text-center sub-btn" class="text-center sub-btn"
@click="changeGift" @click="changeGift"
v-if="perfectFlag==0 && !obj.receivedStock"
>修改</div> >修改</div>
<div v-if="!isShowApprovalDetail" <div
class="text-center sub-btn" class="text-center sub-btn"
@click="pushApproval" @click="changeGift"
>提交审批</div> v-if="perfectFlag!=0"
>{{perfectFlag==1 ? '提交申请' : '去指定领取条件'}}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -157,22 +170,35 @@ export default { ...@@ -157,22 +170,35 @@ export default {
data () { data () {
return { return {
infoList:[], infoList:[],
showMoreTel:false,
receiveDetailList:[],
flag: false, flag: false,
obj: {}, obj: {},
total: 0, total: 0,
lineHeight:0, lineHeight:0,
approveStatus: 0, approveStatus: 0,
isShowApprovalDetail: true perfectFlag: 0,
isShowApprovalDetail: true,
pageIdx:0,
} }
}, },
mounted () { mounted () {
const {approveStatus} = this.getQuery() const {approveStatus,perfectFlag,pageIdx} = this.getQuery()
this.approveStatus = approveStatus this.approveStatus = approveStatus
this.perfectFlag = perfectFlag || 0 //待完善跳过来,1是已完善信息未审批,2是未完善
this.pageIdx = pageIdx || 0
this.showLoading() this.showLoading()
this.getDetail() this.getDetail()
wxConfig.init(['thirdPartyOpenPage']) wxConfig.init(['thirdPartyOpenPage'])
}, },
computed:{
},
methods: { methods: {
isOne(val){
if(!val) return false;
return val.indexOf(',')<0
},
setCouponData (res) { setCouponData (res) {
let total = 0 let total = 0
let discountTypeList = Array.from(new Set([...res.couponList.map(e => e.discountType)])) let discountTypeList = Array.from(new Set([...res.couponList.map(e => e.discountType)]))
...@@ -193,12 +219,15 @@ export default { ...@@ -193,12 +219,15 @@ export default {
return res return res
}, },
getDetail () { getDetail () {
let { id } = this.getQuery() let { id,pageIdx, childId } = this.getQuery()
giftApi.getGiftDetail(id).then(res => { let API = pageIdx==1? giftApi.getUserGiftDetail : pageIdx==2 ? giftApi.getApproveGiftDetail : giftApi.getGiftDetail
let pramas = {id,childId}
API(pramas).then(res => {
this.hideLoading() this.hideLoading()
res = this.setCouponData(res) res = this.setCouponData(res)
this.flag = true this.flag = true
this.obj = res this.obj = res
res.receiveDetails && (this.receiveDetailList = res.receiveDetails.split(','))
if(res.approveUserInfo==null && res.weChatOpenApprovalDataResponse==null){ if(res.approveUserInfo==null && res.weChatOpenApprovalDataResponse==null){
this.isShowApprovalDetail = false this.isShowApprovalDetail = false
} }
...@@ -243,12 +272,13 @@ export default { ...@@ -243,12 +272,13 @@ export default {
} }
}) })
}) })
}) })
}, },
pushApproval(){ pushApproval(){
let { id } = this.getQuery() let { id } = this.getQuery()
this.showLoading()
giftApi.toApproveById({id}).then(res => { giftApi.toApproveById({id}).then(res => {
this.hideLoading()
if(res.approveFlag ===2){ if(res.approveFlag ===2){
wxConfig.thirdPartyOpenPage(setApproveParam(res)) wxConfig.thirdPartyOpenPage(setApproveParam(res))
.then((resp) => { .then((resp) => {
...@@ -260,8 +290,15 @@ export default { ...@@ -260,8 +290,15 @@ export default {
}) })
}, },
changeGift () { changeGift () {
let { id } = this.getQuery() let { id,perfectFlag,pageIdx } = this.getQuery()
this.$router.replace({ name: 'gift.create', query: { id } }) if(perfectFlag==1){
this.pushApproval()
}else{
let query = {id,pageIdx,childId : this.obj.childId || ''}
if(perfectFlag==2) query.perfectFlag = perfectFlag
this.$router.replace({ name: 'gift.create', query })
}
}, },
setApprovalStatus(id){ setApprovalStatus(id){
// 1-审批中;2-已同意;3-已驳回;4-已转审 // 1-审批中;2-已同意;3-已驳回;4-已转审
...@@ -297,6 +334,45 @@ export default { ...@@ -297,6 +334,45 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
@import '@/assets/css/gift-detail.scss'; @import '@/assets/css/gift-detail.scss';
.tel-list-box{
.tel,.rule{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 24px;
}
.more-wrap{
position: relative;
.tel-list{
display: grid;
grid-template-columns: 1fr 1fr 1fr;
overflow: hidden;
}
.more-btn{
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 110px;
height: 23px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 12px;
border: 1px solid #3975C6;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3975C6;
img{
width: 8px;
height: 8px;
margin-left: 5px;
}
}
}
}
.submit-btn{ .submit-btn{
z-index: 3; z-index: 3;
position: fixed; position: fixed;
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
const path = require('path') const path = require('path')
const defaultSettings = require('./src/config/conf.js') const defaultSettings = require('./src/config/conf.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
// page title // page title
const name = defaultSettings.title || 'vue mobile template' const name = defaultSettings.title || 'vue mobile template'
...@@ -35,7 +34,6 @@ const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) ...@@ -35,7 +34,6 @@ const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
// ] // ]
// } // }
// } // }
/** /**
* 雪碧图插件 * 雪碧图插件
*/ */
...@@ -132,11 +130,9 @@ module.exports = { ...@@ -132,11 +130,9 @@ module.exports = {
// config.externals = externals // config.externals = externals
// } // }
}, },
chainWebpack: config => { chainWebpack: config => {
config.plugins.delete('preload') // TODO: need test config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test config.plugins.delete('prefetch') // TODO: need test
// 别名 alias // 别名 alias
config.resolve.alias config.resolve.alias
.set('@', resolve('src')) .set('@', resolve('src'))
...@@ -146,7 +142,6 @@ module.exports = { ...@@ -146,7 +142,6 @@ module.exports = {
.set('components', resolve('src/components')) .set('components', resolve('src/components'))
.set('plugins', resolve('src/components')) .set('plugins', resolve('src/components'))
.set('utils', resolve('src/utils')) .set('utils', resolve('src/utils'))
/** /**
* 添加CDN参数到htmlWebpackPlugin配置中 * 添加CDN参数到htmlWebpackPlugin配置中
*/ */
...@@ -158,7 +153,6 @@ module.exports = { ...@@ -158,7 +153,6 @@ module.exports = {
// } // }
// return args // return args
// }) // })
/** /**
* 设置保留空格 * 设置保留空格
*/ */
...@@ -182,7 +176,6 @@ module.exports = { ...@@ -182,7 +176,6 @@ module.exports = {
config config
// https://webpack.js.org/configuration/devtool/#development // https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, config => config.devtool('cheap-source-map')) .when(!IS_PROD, config => config.devtool('cheap-source-map'))
config.when(IS_PROD, config => { config.when(IS_PROD, config => {
config config
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!