Commit 2e17c52e by 李伟康

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

合并代码

See merge request !10
2 parents 79413f25 8a90c455
......@@ -19,6 +19,7 @@
</noscript>
<div id="app"></div>
<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>
<!-- 使用CDN加速的JS文件,配置在vue.config.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
const url = '/rop-scrm-equity/router'
export default {
/**套餐分页查询 */
getEquityList (pageNum) {
getEquityList (pageNum,pageType) {
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,
state: 1,
pageNum
}
if(pageType){
data.packageType = pageType
}
return window.$HTTP({
url,
data
......
......@@ -2,7 +2,7 @@
const url = '/rop-scrm-coupon/router'
const pageSize = 10
export default {
/**根据条件获取定向礼包列表(企微) */
/**根据条件获取可发送列表(企微) */
getGiftList (data) {
data.method = 'scrm.api.coupon.weChat.directional.gift.list'
data.pageSize = pageSize
......@@ -11,6 +11,24 @@ export default {
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) {
data.method = 'scrm.api.coupon.weChat.directional.gift.approve.in.list'
......@@ -37,10 +55,32 @@ export default {
})
},
/**根据id获取定向礼包详情(企微) */
getGiftDetail (id) {
getGiftDetail (params) {
let data = {
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({
url,
......@@ -64,6 +104,14 @@ export default {
data
})
},
// 指定条件创建
createPerfectGift (data) {
data.method = 'scrm.api.coupon.weChat.perfect.directional.gift'
return window.$HTTP({
url,
data
})
},
/**根据定向礼包id获取二维码路径 */
createQr (data) {
data.method = 'scrm.api.coupon.directional.gift.qr.code'
......
......@@ -15,6 +15,7 @@ import shopmallApi from './shopmallApi'
import boutiquecouponApi from './boutiquecouponApi'
import equityApi from './equityApi'
import giftApi from './giftApi'
import bigdatautilApi from './bigdatautilApi'
export {
ssoApi,
......@@ -25,5 +26,6 @@ export {
liveApi,
boutiquecouponApi,
equityApi,
giftApi
giftApi,
bigdatautilApi
}
\ No newline at end of file
......@@ -81,5 +81,17 @@ export default {
url,
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;}
.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-1 { width: 32px; height: 32px; background-position: -270px -155px;}
.icon-coupon-lose { width: 70px; height: 70px; background-position: -180px -90px;}
......@@ -7,9 +8,9 @@
.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: -80px -217px;}
.icon-down { width: 12px; height: 12px; background-position: -124px -217px;}
.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-create { width: 16px; height: 16px; background-position: -300px -227px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -300px -197px;}
......@@ -18,5 +19,6 @@
.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-white { width: 13px; height: 13px; background-position: -231px -180px;}
.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

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