Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
f243cead
Commit
f243cead
authored
Feb 03, 2021
by
liujinsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券大转盘迁移
parent
370a1389
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
1 deletions
+131
-1
src/api/coupon.js
+12
-0
src/components/activity/coupon.vue
+0
-0
src/components/activity/integralTurntable.vue
+108
-0
src/pages/home/index.vue
+11
-1
No files found.
src/api/coupon.js
0 → 100644
View file @
f243cead
import
{
requestPOST
}
from
"@/utils/request.js"
;
export
default
{
// 组件查询优惠券列表
queryCouponIdsList
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/promotion/query_coupon_detail_by_ids`
,
data
)
},
// 领取优惠券
receive_coupon
(
params
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/promotion/receive_coupon/?couponCode=`
+
params
+
``
)
},
};
src/components/activity/coupon.vue
0 → 100644
View file @
f243cead
This diff is collapsed.
Click to expand it.
src/components/activity/integralTurntable.vue
0 → 100644
View file @
f243cead
<!-- 积分大转盘 -->
<
template
>
<div
class=
"IntegralTurntable"
v-if=
"isShow == true"
>
<div
class=
"img"
@
click=
"toPrizePage"
>
<img
v-if=
"datas.componentData.imgUrl"
mode=
"widthFix"
:src=
"datas.componentData.imgUrl"
lazy-load
alt
/>
<img
v-else
src=
"http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/png/2a61b201-4fe3-406b-9d76-9ec606ed08c0.png"
alt
/>
</div>
</div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
import
coupon
from
'@/api/coupon'
const
app
=
getApp
()
export
default
{
name
:
"integral-turntable"
,
props
:
{
datas
:
{
type
:
Object
,
default
:
function
()
{
return
{
id
:
""
,
pageCode
:
0
,
pageType
:
0
,
queueNumber
:
0
,
componentName
:
"积分大转盘"
,
componentCode
:
"Integral-turntable"
,
code
:
3
,
componentData
:
{
imgUrl
:
"http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/png/2a61b201-4fe3-406b-9d76-9ec606ed08c0.png"
,
turntableCode
:
""
}
};
}
}
},
data
()
{
return
{
isShow
:
false
,
};
},
components
:
{},
watch
:
{
// "datas.componentData._tempData" : function(newVal){
// this.isShow = newVal
// }
},
mounted
()
{
if
(
this
.
render
)
{
try
{
this
.
$on
(
'getEnvInfo'
,([
val
])
=>
{
console
.
log
(
val
,
'ggggggggggggg'
,
typeof
val
)
this
.
api
=
val
;
this
.
init
();
})
}
catch
(
error
)
{}
}
else
{
this
.
isShow
=
true
;
}
},
methods
:
{
// 初始化--查询列表看活动是否可用
// init() {
// let activityId=this.datas.componentData.turntableCode;
// coupon.queryPrizeFlag({activityId}).then(res=>{
// if(res.data.code==200){
// this.isShow=res.data=='true'?true:false;
// }else{
// this.isShow=true;
// }
// })
// },
// 跳转到大转盘页
toPrizePage
()
{
let
link
=
`/turntable?turntableCode=
${
this
.
datas
.
componentData
.
turntableCode
}
`
app
.
$themeToLink
(
link
);
},
// toEnvPage() {
// let query = {
// back: this.$route.path,
// };
// this.$router.push({ name: "login-accountLogin", query });
// }
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.IntegralTurntable
{
.img
{
overflow
:
hidden
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
max-height
:
200px
;
img
{
width
:
100%
;
object-fit
:
cover
;
}
}
}
</
style
>
src/pages/home/index.vue
View file @
f243cead
...
@@ -54,6 +54,12 @@
...
@@ -54,6 +54,12 @@
<div
v-if=
"item.componentCode == 'pop-up'"
>
<div
v-if=
"item.componentCode == 'pop-up'"
>
<pop-up
:datas=
"item"
></pop-up>
<pop-up
:datas=
"item"
></pop-up>
</div>
</div>
<div
v-if=
"item.componentCode == 'coupon'"
>
<coupon
:datas=
"item"
></coupon>
</div>
<div
v-if=
"item.componentCode == 'integral-turntable'"
>
<integralTurntable
:datas=
"item"
></integralTurntable>
</div>
</div>
</div>
<bottomCont></bottomCont>
<bottomCont></bottomCont>
...
@@ -86,6 +92,8 @@ import shopPopup from '@/components/basicTool/shop-popup/index.vue'
...
@@ -86,6 +92,8 @@ import shopPopup from '@/components/basicTool/shop-popup/index.vue'
import
text
from
'@/components/content/text'
import
text
from
'@/components/content/text'
import
imgText
from
'@/components/content/imgText'
import
imgText
from
'@/components/content/imgText'
import
videoPlayer
from
'@/components/content/videoPlayer'
import
videoPlayer
from
'@/components/content/videoPlayer'
import
coupon
from
'@/components/activity/coupon'
import
integralTurntable
from
'@/components/activity/integralTurntable'
import
{
setTabBarActive
,
checkTabbarPage
}
from
"../../utils/mayi.js"
;
import
{
setTabBarActive
,
checkTabbarPage
}
from
"../../utils/mayi.js"
;
const
app
=
getApp
();
const
app
=
getApp
();
...
@@ -105,7 +113,9 @@ export default {
...
@@ -105,7 +113,9 @@ export default {
ThemeDataPlant
,
ThemeDataPlant
,
'text-text'
:
text
,
'text-text'
:
text
,
'img-text'
:
imgText
,
'img-text'
:
imgText
,
videoPlayer
videoPlayer
,
coupon
,
integralTurntable
},
},
onShareAppMessage
(
res
)
{
onShareAppMessage
(
res
)
{
let
shareVal
=
{};
let
shareVal
=
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment