Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a789b5ba
authored
Jan 17, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
暂时屏蔽精品礼券
1 parent
1a97f990
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
31 deletions
src/mixins/shareMixin.js
src/views/coupon/index.vue
src/mixins/shareMixin.js
View file @
a789b5b
import
{
shopmallApi
,
activityApi
,
couponApi
,
boutiquecouponApi
,
equityApi
,
wxConfig
}
from
'@/api'
import
{
shopmallApi
,
activityApi
,
couponApi
,
boutiquecouponApi
,
equityApi
,
wxConfig
}
from
'@/api'
const
{
environment
}
=
window
.
$fetchConfig
const
{
environment
}
=
window
.
$fetchConfig
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
entry
:
'normal'
entry
:
'normal'
}
}
},
},
mounted
()
{
mounted
()
{
if
(
this
.
$route
.
meta
.
isTab
||
this
.
$route
.
meta
.
isIndex
)
this
.
wxInit
()
if
(
this
.
$route
.
meta
.
isTab
||
this
.
$route
.
meta
.
isIndex
)
this
.
wxInit
()
},
},
methods
:
{
methods
:
{
wxInit
()
{
wxInit
()
{
let
_this
=
this
let
_this
=
this
wxConfig
.
init
([
'shareAppMessage'
,
'sendChatMessage'
,
'getCurExternalContact'
,
'getContext'
]).
then
(()
=>
{
wxConfig
.
init
([
'shareAppMessage'
,
'sendChatMessage'
,
'getCurExternalContact'
,
'getContext'
]).
then
(()
=>
{
wxConfig
.
getContext
().
then
(({
entry
})
=>
{
wxConfig
.
getContext
().
then
(({
entry
})
=>
{
...
@@ -19,7 +19,7 @@ export default {
...
@@ -19,7 +19,7 @@ export default {
})
})
})
})
},
},
showShareModel
(
i
=
{})
{
showShareModel
(
i
=
{})
{
let
{
let
{
tabIndex
,
tabIndex
,
$route
:
{
name
}
$route
:
{
name
}
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
this
.
sendMessage
(
i
)
this
.
sendMessage
(
i
)
})
})
},
},
sendMessage
(
i
)
{
sendMessage
(
i
)
{
let
{
merchantId
,
merchantName
,
userName
,
channelType
}
=
this
.
getLocalStorage
(
'dj_scrm_userInfo'
)
let
{
merchantId
,
merchantName
,
userName
,
channelType
}
=
this
.
getLocalStorage
(
'dj_scrm_userInfo'
)
let
{
tabIndex
,
entry
}
=
this
let
{
tabIndex
,
entry
}
=
this
let
{
name
}
=
this
.
$route
let
{
name
}
=
this
.
$route
...
@@ -52,7 +52,8 @@ export default {
...
@@ -52,7 +52,8 @@ export default {
let
desc
=
'您的专属服务顾问为您发来了优惠券,请点击领取~'
let
desc
=
'您的专属服务顾问为您发来了优惠券,请点击领取~'
let
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
let
imgUrl
=
'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
console
.
log
(
entry
)
console
.
log
(
entry
)
if
(
tabIndex
==
0
)
{
if
(
false
)
{
// if (tabIndex == 0 ) {
if
(
entry
!=
'normal'
)
if
(
entry
!=
'normal'
)
this
.
sendChatMessage
({
this
.
sendChatMessage
({
// channelType 1 嘀加 2:广汇
// channelType 1 嘀加 2:广汇
...
@@ -161,7 +162,7 @@ export default {
...
@@ -161,7 +162,7 @@ export default {
}
}
}
}
},
},
sendChatMessage
(
params
)
{
sendChatMessage
(
params
)
{
wxConfig
wxConfig
.
sendChatMessage
({
.
sendChatMessage
({
msgtype
:
'miniprogram'
,
msgtype
:
'miniprogram'
,
...
@@ -176,7 +177,7 @@ export default {
...
@@ -176,7 +177,7 @@ export default {
this
.
hideLoading
()
this
.
hideLoading
()
})
})
},
},
shareAppMessage
(
link
,
desc
,
title
,
imgUrl
)
{
shareAppMessage
(
link
,
desc
,
title
,
imgUrl
)
{
wxConfig
wxConfig
.
shareAppMessage
({
.
shareAppMessage
({
title
,
title
,
...
@@ -191,14 +192,14 @@ export default {
...
@@ -191,14 +192,14 @@ export default {
this
.
hideLoading
()
this
.
hideLoading
()
})
})
},
},
toUnicode
(
chineseStr
=
''
)
{
toUnicode
(
chineseStr
=
''
)
{
let
unicodeStr
=
''
let
unicodeStr
=
''
for
(
let
i
=
0
,
iLength
=
chineseStr
.
length
;
i
<
iLength
;
i
++
)
{
for
(
let
i
=
0
,
iLength
=
chineseStr
.
length
;
i
<
iLength
;
i
++
)
{
unicodeStr
+=
'@'
+
chineseStr
.
charCodeAt
(
i
).
toString
(
16
)
unicodeStr
+=
'@'
+
chineseStr
.
charCodeAt
(
i
).
toString
(
16
)
}
}
return
unicodeStr
return
unicodeStr
},
},
couponShare
(
item
,
callBack
)
{
couponShare
(
item
,
callBack
)
{
let
{
is_contact
,
id
}
=
item
let
{
is_contact
,
id
}
=
item
let
obj
=
{
let
obj
=
{
couponId
:
id
,
couponId
:
id
,
...
...
src/views/coupon/index.vue
View file @
a789b5b
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
class=
"item"
class=
"item"
>
>
<div
:class=
"['sprite-icon', 'text-center',tabIndex == 0 ?'icon-coupon':'icon-discount',
{'clear-padding':i.discountType == 3}]">
<div
:class=
"['sprite-icon', 'text-center',tabIndex == 0 ?'icon-coupon':'icon-discount',
{'clear-padding':i.discountType == 3}]">
<template
v-if=
"tabIndex == 0 "
>
<template
v-if=
"false"
>
<!--
<template
v-if=
"tabIndex == 0 "
>
-->
{{
i
.
couponTypeName
}}
{{
i
.
couponTypeName
}}
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
...
@@ -76,7 +77,8 @@
...
@@ -76,7 +77,8 @@
<
script
type=
'text/ecmascript-6'
>
<
script
type=
'text/ecmascript-6'
>
import
{
shareMixin
,
pageMixin
,
discountTypeMixin
}
from
'@/mixins'
import
{
shareMixin
,
pageMixin
,
discountTypeMixin
}
from
'@/mixins'
import
{
couponApi
,
boutiquecouponApi
}
from
'@/api'
import
{
couponApi
,
boutiquecouponApi
}
from
'@/api'
const
tabList
=
[
'新车精品礼券'
,
'商城优惠券'
]
const
tabList
=
[
'商城优惠券'
]
// const tabList = ['新车精品礼券', '商城优惠券']
export
default
{
export
default
{
name
:
'coupon'
,
name
:
'coupon'
,
mixins
:
[
shareMixin
,
pageMixin
,
discountTypeMixin
],
mixins
:
[
shareMixin
,
pageMixin
,
discountTypeMixin
],
...
@@ -88,27 +90,18 @@ export default {
...
@@ -88,27 +90,18 @@ export default {
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
// getList_0(pageNum) {
// let { list } = this
// boutiquecouponApi.getBoutiqueCouponList({ pageNum }).then(res => {
// this.hideLoading()
// console.log('精品礼券', res)
// this.flag = true
// this.list = list.concat(res.list)
// this.total = res.total
// })
// },
getList_0
(
pageNum
)
{
getList_0
(
pageNum
)
{
let
{
list
}
=
this
let
{
list
}
=
this
boutiquecouponApi
.
getBoutiqueCouponList
({
pageNum
}).
then
(
res
=>
{
this
.
hideLoading
()
console
.
log
(
'精品礼券'
,
res
)
// if (res.total == 0) {
// this.showLoading()
// this.updata = new Date().getTime()
// this.tabList = ['商城优惠券']
// this.getList_1(pageNum)
// return
// } else {
// this.tabList = tabList
// }
this
.
flag
=
true
this
.
list
=
list
.
concat
(
res
.
list
)
this
.
total
=
res
.
total
})
},
getList_1
(
pageNum
)
{
let
{
list
}
=
this
couponApi
.
getMerchantCouponList
({
pageNum
}).
then
(
res
=>
{
couponApi
.
getMerchantCouponList
({
pageNum
}).
then
(
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
console
.
log
(
'商城礼券'
,
res
)
console
.
log
(
'商城礼券'
,
res
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment