Commit be0bb45d authored by 潘永坪's avatar 潘永坪

联合国际券页面开发

parent 1ff013b6
...@@ -306,7 +306,16 @@ ...@@ -306,7 +306,16 @@
"path" : "pages/my/order/orderList/orderList", "path" : "pages/my/order/orderList/orderList",
"style" : "style" :
{ {
"navigationBarTitleText": "", "navigationBarTitleText": "订单列表",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/common/coupon/coupon",
"style" :
{
"navigationBarTitleText": "领劵中心",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
......
<template>
<!-- 联合国际餐饮劵页面 -->
<view class="wrap">
<image src="../../../static/img/coupon/coupon.jpg"></image>
<template v-if="couponData">
<view class="top">
<view class="top-name" v-if="couponData.couponName">
{{couponData.couponName.substr(0,4)}}
</view>
<!-- <view class="top-address">
联合国际大厦二楼
</view> -->
</view>
<view class="middle">
<view class="middle-name">
<text v-if="couponData.couponType==3">
代金券
</text>
<text v-if="couponData.couponType==2">
折扣券
</text>
<text v-if="couponData.couponType==1">
抵用券
</text>
</view>
<view class="middle-price">
<text>{{couponData.couponPrice}}</text>
</view>
<view class="middle-tip">
可在“胖丁旅游”-【我的】-【券中心】中查看
</view>
</view>
<view class="bottom">
<text @click="clickBtn()">{{title}}</text>
</view>
</template>
</view>
</template>
<script>
export default {
data() {
return {
title:"立即领取",//标题
enterUrl:"",//进入页面路由
pageCode:"",//券码
couponData:"",//券数据
companyId:"",//公司Id
}
},
onLoad(option) {
//#ifdef MP-WEIXIN
this.enterUrl=option.q
//#endif
//#ifdef MP-ALIPAY
this.enterUrl=uni.getStorageSync("alipayQrCode")
//#endif
if(this.enterUrl){//普通二维码扫码进入
this.pageCode=this.getUrlKey("pageCode")
this.companyId=this.getUrlKey("companyId")
}
this.giveCoupon()
},
methods: {
//---送券
giveCoupon(){
let data={
couponCompanyId:this.companyId,
pageCode:this.pageCode,
marketingStatus:1,
userId:uni.getStorageSync('userId') ,
openid:uni.getStorageSync('openid')
}
this.$request("scenic/market/findPageMarket",data).then((res)=>{
if(res.data&&res.data.length>0){
this.couponData=res.data[0]
}
})
},
//---获取url
getUrlKey(name){
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ""])[1].replace(/\+/g, '%20') || "";
},
//---
clickBtn(){
this.title="已领取"
}
}
}
</script>
<style lang="scss">
$B17B34:#B17B34;
.wrap{
position: relative;
width: 100%;
height: 100%;
text-align:center;
image{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
}
.top{
position: absolute;
top:18%;
width: 100%;
color: #FFFFFF;
.top-name{
font-size: 72rpx;
font-weight: bold;
}
.top-address{
font-size: 48rpx;
margin-top: 24rpx;
}
}
.middle{
position: absolute;
top:44%;
width: 100%;
.middle-name{
font-size: 72rpx;
font-weight: bold;
color:$B17B34;
}
.middle-price{
font-size:48rpx;
color:$B17B34;
text{
color: #E74027;
font-size: 144rpx;
font-weight: bold;
}
}
.middle-tip{
font-size: 20rpx;
color:$B17B34;
font-weight: bold;
margin-top:26rpx;
}
}
.bottom{
position: absolute;
top:78%;
width: 100%;
text{
display: inline-block;
background: linear-gradient(360deg, #FFCB80 0%, #FFDFBB 49%, #FFFFFF 100%);
width: 400rpx;
height: 95rpx;
line-height: 95rpx;
border-radius: 45rpx;
font-size: 48rpx;
font-weight: bold;
color: #F42629;
}
}
</style>
...@@ -355,9 +355,9 @@ ...@@ -355,9 +355,9 @@
openid:this.openid openid:this.openid
} }
this.$request("wechatUser/myPage/usableCouponList",data).then((res) =>{ this.$request("wechatUser/myPage/usableCouponList",data).then((res) =>{
if (res.data.code == "00") { if (res.code == "00") {
this.couponData = res.data.data this.couponData = res.data
let masterSlaveCouponList=res.data.data.masterSlaveCouponList let masterSlaveCouponList=res.data.masterSlaveCouponList
if (masterSlaveCouponList&&masterSlaveCouponList.length>0) { if (masterSlaveCouponList&&masterSlaveCouponList.length>0) {
masterSlaveCouponList.forEach((item) => { //获取最优券 masterSlaveCouponList.forEach((item) => { //获取最优券
savedMoneyList.push(item.savedMoney) savedMoneyList.push(item.savedMoney)
...@@ -380,8 +380,8 @@ ...@@ -380,8 +380,8 @@
} }
this.savedMoney=this.chooseCouponObj.savedMoney this.savedMoney=this.chooseCouponObj.savedMoney
} else { } else {
if (res.data.data.unusableCouponList.length > 0) { if (res.data.unusableCouponList.length > 0) {
res.data.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券 res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (item.isProduct == 1) { if (item.isProduct == 1) {
this.ableConpon = item this.ableConpon = item
} }
...@@ -409,6 +409,7 @@ ...@@ -409,6 +409,7 @@
myCouponId:this.chooseCouponObj.slaveId,//领取人编号 myCouponId:this.chooseCouponObj.slaveId,//领取人编号
couponType:this.chooseCouponObj.couponType,//券类型 couponType:this.chooseCouponObj.couponType,//券类型
couponPrice:this.chooseCouponObj.savedMoney,//券价格 couponPrice:this.chooseCouponObj.savedMoney,//券价格
couponCompanyId:this.chooseCouponObj.companyId,//公司Id
} }
] ]
}else{ }else{
...@@ -419,6 +420,7 @@ ...@@ -419,6 +420,7 @@
myCouponId:this.chooseCouponObj.id,//领取人编号 myCouponId:this.chooseCouponObj.id,//领取人编号
couponType:this.chooseCouponObj.couponType,//券类型 couponType:this.chooseCouponObj.couponType,//券类型
couponPrice:this.chooseCouponObj.savedMoney,//券价格 couponPrice:this.chooseCouponObj.savedMoney,//券价格
couponCompanyId:this.chooseCouponObj.companyId,//公司Id
} }
] ]
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</view> </view>
<view v-else-if="vlogList.length===0 && show===false" class="empty"> <view v-else-if="vlogList.length===0 && show===false" class="empty">
<view class="row"> <view class="row">
<text>啊哦。。。没找到呢</text> <text>空空如也...</text>
<image src="../../../static/img/vlog/icon/icon_thereisnovideo.png"></image> <image src="../../../static/img/vlog/icon/icon_thereisnovideo.png"></image>
</view> </view>
<navigator url="../vlogface/vlogface" class="btnn"> <navigator url="../vlogface/vlogface" class="btnn">
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
}, },
getMyVlogList(){ getMyVlogList(){
this.$request("wechatUser/myPage/getVlogRecord", { this.$request("wechatUser/myPage/getVlogRecord", {
openid: uni.getStorageSync("openid") openid: uni.getStorageSync("openid"),
productType:0
}).then(res => { }).then(res => {
this.show = false this.show = false
if(res.code==="00"){ if(res.code==="00"){
......
<template> <template>
<view class="content"> <view class="content">
<view class="" style="display: flex;padding: 40rpx 20rpx 0 20rpx;"> <view class="" style="display: flex;padding: 40rpx 20rpx 0 20rpx;">
<u-section title="精彩瞬间" :right="false" color="#303133" ></u-section> <u-section title="精彩瞬间" :right="false" color="#303133"></u-section>
<text style="font-size: 24rpx;color: #ccc;margin-left: 30rpx;">MOMENT</text> <text style="font-size: 24rpx;color: #ccc;margin-left: 30rpx;">MOMENT</text>
</view> </view>
<image src="../../../static/img/vlog/icon/fengexian.png" mode="" style="width: 100%;height: 15rpx;"></image> <image src="../../../static/img/vlog/icon/fengexian.png" mode="" style="width: 100%;height: 15rpx;"></image>
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
<view class="item" v-for="(item,index) in list" :key="index"> <view class="item" v-for="(item,index) in list" :key="index">
<image :src="item.thumbImageUrl" mode="widthFix"></image> <image :src="item.thumbImageUrl" mode="widthFix"></image>
<view class="bottom"> <view class="bottom">
<text class="text1">¥123</text> <text class="text1">¥0</text>
<text class="text2">¥123</text> <text class="text2">¥0</text>
<u-button class="button" size="mini" @click="payment"> <u-button class="button" size="mini" @click="handleDownload(item.thumbImageUrl)">
点击付费下载 费下载
</u-button> </u-button>
</view> </view>
</view> </view>
...@@ -20,30 +20,97 @@ ...@@ -20,30 +20,97 @@
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
list:[],//相片列表 list: [], //相片列表
checkImg:"",//选中的图片 checkImg: "", //选中的图片
} }
}, },
onLoad(){//代替 vue 里面的 created onLoad() { //代替 vue 里面的 created
this.getPhotoData() this.getPhotoData()
}, },
onReady() {//代替 vue 里面的 mounted onReady() { //代替 vue 里面的 mounted
}, },
methods: { methods: {
payment(){//付费下载 handleDownload(url) { // 下载功能
uni.showLoading({
title: "下载中",
mask: true
})
let fileName = new Date().valueOf(); //获取时间戳
uni.downloadFile({ //下载文件资源到本地
url,
filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.jpg', //filePath指定文件下载后存储的路径,wx.env.USER_DATA_PATH,时间戳为文件名
success: res => { //下载到本地成功
let filePath = res.filePath;
uni.saveImageToPhotosAlbum({ //保存视频到系统相册。
filePath,
success: file => { //保存成功
//删除本地缓存
let fileMgr = uni.getFileSystemManager();
fileMgr.unlink({
filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.jpg',
})
uni.showToast({
title: "下载成功",
icon: "success",
mask: true
})
},
fail: err => {
uni.hideLoading();
//拒绝授权时显示
if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
uni.showModal({
title: '提示',
content: '需要您授权保存相册',
showCancel: false,
success: data => {
//打开权限设置
uni.openSetting({
success: setting => {
if (setting.authSetting['scope.writePhotosAlbum']) {
uni.showModal({
title: '提示',
content: '获取权限成功,再次点击下载即可保存',
showCancel: false,
})
} else {
uni.showModal({
title: '提示',
ontent: '获取权限失败,将无法保存到相册哦',
showCancel: false
})
}
},
})
}
})
}
}
})
},
fail: err => { //下载失败
uni.hideLoading();
if (err.errMsg == 'downloadFile:fail createDownloadTask:fail url not in domain list') {
uni.showToast({
title: '服务器错误,请联系相关管理员',
icon: 'none',
mask: true
})
}
}
})
}, },
getPhotoData(){//获取用户vlog图片 getPhotoData() { //获取用户vlog图片
this.$request("wechatUser/myPage/getVlogRecord", { this.$request("wechatUser/myPage/getVlogRecord", {
openid: uni.getStorageSync("openid"), openid: uni.getStorageSync("openid"),
productType:1 productType: 1
}).then(res => { }).then(res => {
if (res.code === "00") { if (res.code === "00") {
this.list=res.data this.list = res.data
}else{ } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.message, content: res.message,
...@@ -53,17 +120,50 @@ export default { ...@@ -53,17 +120,50 @@ export default {
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content{box-sizing: border-box;margin: 0 auto;background-color: #fff;height: 100%; .content {
.row{display: flex;width: 100%;justify-content: space-between;flex-wrap: wrap; box-sizing: border-box;
.item{width: 50%;position: relative;padding: 15rpx; margin: 0 auto;
image{width: 100%;border-radius: 10rpx;} background-color: #fff;
.bottom{font-weight: bold;align-items: center; height: 100%;
.text1{font-size: 24rpx; text-decoration: line-through;color: #ccc;}
.text2{font-size: 32rpx;color: #EE520E;margin-left: 10rpx;} .row {
.button{float: right;} display: flex;
width: 100%;
justify-content: space-between;
flex-wrap: wrap;
.item {
width: 50%;
position: relative;
padding: 15rpx;
image {
width: 100%;
border-radius: 10rpx;
}
.bottom {
font-weight: bold;
align-items: center;
.text1 {
font-size: 24rpx;
text-decoration: line-through;
color: #ccc;
}
.text2 {
font-size: 32rpx;
color: #EE520E;
margin-left: 10rpx;
}
.button {
float: right;
}
} }
} }
} }
......
...@@ -2,12 +2,15 @@ ...@@ -2,12 +2,15 @@
<view class="content"> <view class="content">
<view style="padding-top: 30rpx;"> <view style="padding-top: 30rpx;">
<block> <block>
<view class="item" v-if="scenic.name"> <view class="item" v-if="merchantName">
<video class="video" :poster="scenic.coverImgUrl" :src="scenic.showVideoUrl" play-btn-position="center" @error="error" controls></video> <video class="video" id="myVideo" :poster="thumbImageUrl" :src="productUrl" play-btn-position="center"
@error="error" object-fit="fill" @play="playVideo()">
</video>
<view class="title"> <view class="title">
<text>[ {{scenic.name || ""}} ]</text> <text>[ {{merchantName || ""}} ]</text>
<view> <view>
<u-icon name="eye-fill" class="icon" color="#ffffff" size="40rpx"></u-icon><text style="color: #ffffff;" space>10W +</text> <u-icon name="eye-fill" class="icon" color="#ffffff" size="40rpx"></u-icon><text style="color: #ffffff;" space>1000+</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -18,6 +21,7 @@ ...@@ -18,6 +21,7 @@
<navigator url="../vlogface/vlogface"> <navigator url="../vlogface/vlogface">
<view class="paizhao"> <view class="paizhao">
<image src="../../../static/img/vlog/icon/icon_scan.png"></image> <image src="../../../static/img/vlog/icon/icon_scan.png"></image>
<view style="width: 100%;text-align: center;margin-top:10rpx;color: #FFFFFF;">获取Vlog</view>
</view> </view>
</navigator> </navigator>
</view> </view>
...@@ -28,44 +32,108 @@ ...@@ -28,44 +32,108 @@
export default { export default {
data() { data() {
return { return {
scenic:{},//景区详情 productUrl: "", //视频地址
thumbImageUrl: "", //图片地址
merchantName: "", //景区名称
videoContext:""
} }
}, },
onReady() {//代替 vue 里面的 mounted onReady() { //代替 vue 里面的 mounted
}, },
onLoad(res){//代替 vue 里面的 created onLoad(option) { //代替 vue 里面的 created
let caseId=res.caseId this.productUrl = option.productUrl
this.$request("distribution/vlog/getScenicInfo",{caseId}).then(res=>{ this.thumbImageUrl = option.thumbImageUrl
if(res.code==="00"){ this.merchantName = option.merchantName
console.log(res);
this.scenic=res.data;
uni.setNavigationBarTitle({title:this.scenic.name})
}
})
}, },
methods: { methods: {
error(e){//视频播放出错 playVideo(){
uni.showModal({content: e.target.errMsg,showCancel: false}) // 获取 video 上下文 videoContext 对象
this.videoContext = uni.createVideoContext('myVideo',this);
// 进入全屏状态
this.videoContext.requestFullScreen({direction:-90})
},
error(e) { //视频播放出错
uni.showModal({
content: e.target.errMsg,
showCancel: false
})
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content{padding: 0 20rpx;min-height: 100%;width: 100%;background-color: #192033; .content {
.item{padding: 0 10rpx;border-radius: 10rpx;background-color: #192033;margin-bottom:30rpx;text-align: center; padding: 0 20rpx;
.video{height: 350rpx;border-radius: 10rpx;width: 100%;} min-height: 100%;
.title{height: 60rpx;margin-top: 20rpx; width: 100%;
text{float: left;height: 60rpx;line-height: 60rpx;color: #FFE600;font-weight: bold;} background-color: #192033;
view{float: right;height: 60rpx;line-height: 60rpx;align-items: center;display: flex;}
.item {
padding: 0 10rpx;
border-radius: 10rpx;
background-color: #192033;
margin-bottom: 30rpx;
text-align: center;
.video {
height: 350rpx;
border-radius: 10rpx;
width: 100%;
} }
.title {
height: 60rpx;
margin-top: 20rpx;
text {
float: left;
height: 60rpx;
line-height: 60rpx;
color: #FFE600;
font-weight: bold;
} }
.bottom{height: 150rpx;width: 100%;position: relative;position: fixed;bottom: 0;right:0rpx;
image{width: 100%;height: 100rpx;position: relative;position: fixed;bottom: 0;} view {
.paizhao{height: 160rpx;width: 160rpx;z-index: 1;position: absolute;left:50%;top:22%;transform: translate(-50%, -50%); float: right;
image{height: 100%;width: 100%;} height: 60rpx;
line-height: 60rpx;
align-items: center;
display: flex;
} }
} }
} }
.bottom {
width: 100%;
position: fixed;
bottom: 0;
right: 0rpx;
image {
width: 100%;
height: 100rpx;
position: fixed;
bottom: 0;
}
.paizhao {
z-index: 1;
position: absolute;
bottom: 15rpx;
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
image {
height: 160rpx;
width: 160rpx;
position: relative;
top: 20rpx;
}
}
}
}
</style> </style>
...@@ -38,15 +38,15 @@ ...@@ -38,15 +38,15 @@
</view> </view>
</view> </view>
</navigator> </navigator>
<view class="title"> <view class="title" v-if="scenicList.length>0">
<view class="shuxian"></view> <view class="shuxian"></view>
<view>景区VLOG样片</view> <view>景区VLOG样片</view>
</view> </view>
<view class="row"> <view class="row">
<block v-for="(item,index) in scenicList" :key="index"> <block v-for="(item,index) in scenicList" :key="index">
<navigator :url="'../scenicList/scenicList?caseId='+item.caseId" class="item"> <navigator :url="'../scenicList/scenicList?productUrl='+item.productUrl+'&thumbImageUrl='+item.thumbImageUrl+'&merchantName='+item.merchantName" class="item">
<image class="fengmian" :src="item.coverImgUrl"></image> <image class="fengmian" :src="item.thumbImageUrl"></image>
<text>{{item.name}}</text> <text>{{item.merchantName}}</text>
</navigator> </navigator>
</block> </block>
</view> </view>
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<navigator url="../vlogface/vlogface"> <navigator url="../vlogface/vlogface">
<view class="paizhao"> <view class="paizhao">
<image src="../../../static/img/vlog/icon/icon_scan.png"></image> <image src="../../../static/img/vlog/icon/icon_scan.png"></image>
<view style="width: 100%;text-align: center;margin-top:10rpx;color: #FFFFFF;">获取Vlog</view>
</view> </view>
</navigator> </navigator>
</view> </view>
...@@ -110,12 +111,13 @@ ...@@ -110,12 +111,13 @@
}, },
getScenicList() { //景区列表查询 getScenicList() { //景区列表查询
let data = { let data = {
"pageNo": 1, merchantId:"a124Jj6IYiSzCjVV"
"pageSize": 10
} }
this.$request("distribution/vlog/getScenicList", data).then(res => { this.$request("scenic/user/merchant/merchantVlogList", data).then(res => {
if (res.code === "00") { //请求成功 if (res.code === "00") { //请求成功
this.scenicList = res.data.list this.scenicList=res.data.filter((item)=>{
return item.isPublic===1
})
} else { } else {
uni.showModal({ uni.showModal({
content: res.message, content: res.message,
...@@ -302,9 +304,7 @@ ...@@ -302,9 +304,7 @@
} }
.bottom { .bottom {
height: 150rpx;
width: 100%; width: 100%;
position: relative;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
right: 0rpx; right: 0rpx;
...@@ -312,23 +312,23 @@ ...@@ -312,23 +312,23 @@
image { image {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
position: relative;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
} }
.paizhao { .paizhao {
height: 160rpx; width:100%;
width: 160rpx;
z-index: 1; z-index: 1;
position: absolute; position: absolute;
left: 50%; bottom: 15rpx;
top: 22%; display: flex;
transform: translate(-50%, -50%); flex-wrap: wrap;
justify-content: center;
image { image {
height: 100%; height:160rpx;
width: 100%; width:160rpx;
position: relative;
top: 30rpx;
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="content"> <view class="content">
<view style="padding-top: 30rpx;"> <view style="padding-top: 30rpx;">
<view class="item" v-for="(item,index) in myVlogList" :key="index"> <view class="item" v-for="(item,index) in myVlogList" :key="index">
<video class="video" :src="item.productUrl" :poster="item.thumbImageUrl" @error="error" controls <video class="video" :src="item.productUrl" :poster="item.thumbImageUrl" @error="error" object-fit="fill"
play-btn-position="center" :id="index" @play="playing(index)"></video> play-btn-position="center" :id="index" @play="playing(index)"></video>
<view class=""> <view class="">
<button v-if="item.shareNumber===0" :data-productUrl="item.productUrl" :data-productId="item.productId" class="btnn" <button v-if="item.shareNumber===0" :data-productUrl="item.productUrl" :data-productId="item.productId" class="btnn"
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
methods: { methods: {
getMyVlogList() { //获取景区vlog列表 getMyVlogList() { //获取景区vlog列表
this.$request("wechatUser/myPage/getVlogRecord", { this.$request("wechatUser/myPage/getVlogRecord", {
openid: uni.getStorageSync("openid") openid: uni.getStorageSync("openid"),
productType:0
}).then(res => { }).then(res => {
if (res.code === "00") { if (res.code === "00") {
res.data.forEach(item => { //获取当前景区视频列表 res.data.forEach(item => { //获取当前景区视频列表
......
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