Commit f243cead by liujinsa

优惠券大转盘迁移

parent 370a1389
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+``)
},
};
<!-- 积分大转盘 -->
<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>
...@@ -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={};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment