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

联合国际券页面开发

parent 1ff013b6
......@@ -306,7 +306,16 @@
"path" : "pages/my/order/orderList/orderList",
"style" :
{
"navigationBarTitleText": "",
"navigationBarTitleText": "订单列表",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/common/coupon/coupon",
"style" :
{
"navigationBarTitleText": "领劵中心",
"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 @@
openid:this.openid
}
this.$request("wechatUser/myPage/usableCouponList",data).then((res) =>{
if (res.data.code == "00") {
this.couponData = res.data.data
let masterSlaveCouponList=res.data.data.masterSlaveCouponList
if (res.code == "00") {
this.couponData = res.data
let masterSlaveCouponList=res.data.masterSlaveCouponList
if (masterSlaveCouponList&&masterSlaveCouponList.length>0) {
masterSlaveCouponList.forEach((item) => { //获取最优券
savedMoneyList.push(item.savedMoney)
......@@ -380,8 +380,8 @@
}
this.savedMoney=this.chooseCouponObj.savedMoney
} else {
if (res.data.data.unusableCouponList.length > 0) {
res.data.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (res.data.unusableCouponList.length > 0) {
res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (item.isProduct == 1) {
this.ableConpon = item
}
......@@ -407,18 +407,20 @@
couponId:this.chooseCouponObj.slaveCouponId,//券id
isMerchant:this.chooseCouponObj.slaveCreateSource,//是否是商户的券
myCouponId:this.chooseCouponObj.slaveId,//领取人编号
couponType:this.chooseCouponObj.couponType,//券类型
couponPrice:this.chooseCouponObj.savedMoney,//券价格
couponType:this.chooseCouponObj.couponType,//券类型
couponPrice:this.chooseCouponObj.savedMoney,//券价格
couponCompanyId:this.chooseCouponObj.companyId,//公司Id
}
]
}else{
couponList=[
{
couponId:this.chooseCouponObj.couponId,//券id
isMerchant:this.chooseCouponObj.createSource,//是否是商户的券
myCouponId:this.chooseCouponObj.id,//领取人编号
couponId:this.chooseCouponObj.couponId,//券id
isMerchant:this.chooseCouponObj.createSource,//是否是商户的券
myCouponId:this.chooseCouponObj.id,//领取人编号
couponType:this.chooseCouponObj.couponType,//券类型
couponPrice:this.chooseCouponObj.savedMoney,//券价格
couponCompanyId:this.chooseCouponObj.companyId,//公司Id
}
]
}
......
......@@ -13,7 +13,7 @@
</view>
<view v-else-if="vlogList.length===0 && show===false" class="empty">
<view class="row">
<text>啊哦。。。没找到呢</text>
<text>空空如也...</text>
<image src="../../../static/img/vlog/icon/icon_thereisnovideo.png"></image>
</view>
<navigator url="../vlogface/vlogface" class="btnn">
......@@ -48,7 +48,8 @@
},
getMyVlogList(){
this.$request("wechatUser/myPage/getVlogRecord", {
openid: uni.getStorageSync("openid")
openid: uni.getStorageSync("openid"),
productType:0
}).then(res => {
this.show = false
if(res.code==="00"){
......
<template>
<view class="content">
<view class="content">
<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>
</view>
<image src="../../../static/img/vlog/icon/fengexian.png" mode="" style="width: 100%;height: 15rpx;"></image>
......@@ -9,10 +9,10 @@
<view class="item" v-for="(item,index) in list" :key="index">
<image :src="item.thumbImageUrl" mode="widthFix"></image>
<view class="bottom">
<text class="text1">¥123</text>
<text class="text2">¥123</text>
<u-button class="button" size="mini" @click="payment">
点击付费下载
<text class="text1">¥0</text>
<text class="text2">¥0</text>
<u-button class="button" size="mini" @click="handleDownload(item.thumbImageUrl)">
费下载
</u-button>
</view>
</view>
......@@ -20,52 +20,152 @@
</view>
</template>
<script>
export default {
data() {
return {
list:[],//相片列表
checkImg:"",//选中的图片
}
},
onLoad(){//代替 vue 里面的 created
this.getPhotoData()
},
onReady() {//代替 vue 里面的 mounted
},
methods: {
payment(){//付费下载
export default {
data() {
return {
list: [], //相片列表
checkImg: "", //选中的图片
}
},
getPhotoData(){//获取用户vlog图片
this.$request("wechatUser/myPage/getVlogRecord", {
openid: uni.getStorageSync("openid"),
productType:1
}).then(res => {
if (res.code === "00") {
this.list=res.data
}else{
uni.showModal({
title: '提示',
content: res.message,
showCancel: false,
})
}
})
onLoad() { //代替 vue 里面的 created
this.getPhotoData()
},
onReady() { //代替 vue 里面的 mounted
},
methods: {
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图片
this.$request("wechatUser/myPage/getVlogRecord", {
openid: uni.getStorageSync("openid"),
productType: 1
}).then(res => {
if (res.code === "00") {
this.list = res.data
} else {
uni.showModal({
title: '提示',
content: res.message,
showCancel: false,
})
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
.content{box-sizing: border-box;margin: 0 auto;background-color: #fff;height: 100%;
.row{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;}
.content {
box-sizing: border-box;
margin: 0 auto;
background-color: #fff;
height: 100%;
.row {
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;
}
}
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -2,12 +2,15 @@
<view class="content">
<view style="padding-top: 30rpx;">
<block>
<view class="item" v-if="scenic.name">
<video class="video" :poster="scenic.coverImgUrl" :src="scenic.showVideoUrl" play-btn-position="center" @error="error" controls></video>
<view class="item" v-if="merchantName">
<video class="video" id="myVideo" :poster="thumbImageUrl" :src="productUrl" play-btn-position="center"
@error="error" object-fit="fill" @play="playVideo()">
</video>
<view class="title">
<text>[ {{scenic.name || ""}} ]</text>
<text>[ {{merchantName || ""}} ]</text>
<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>
......@@ -18,6 +21,7 @@
<navigator url="../vlogface/vlogface">
<view class="paizhao">
<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>
</navigator>
</view>
......@@ -28,44 +32,108 @@
export default {
data() {
return {
scenic:{},//景区详情
productUrl: "", //视频地址
thumbImageUrl: "", //图片地址
merchantName: "", //景区名称
videoContext:""
}
},
onReady() {//代替 vue 里面的 mounted
onReady() { //代替 vue 里面的 mounted
},
onLoad(res){//代替 vue 里面的 created
let caseId=res.caseId
this.$request("distribution/vlog/getScenicInfo",{caseId}).then(res=>{
if(res.code==="00"){
console.log(res);
this.scenic=res.data;
uni.setNavigationBarTitle({title:this.scenic.name})
}
})
onLoad(option) { //代替 vue 里面的 created
this.productUrl = option.productUrl
this.thumbImageUrl = option.thumbImageUrl
this.merchantName = option.merchantName
},
methods: {
error(e){//视频播放出错
uni.showModal({content: e.target.errMsg,showCancel: false})
playVideo(){
// 获取 video 上下文 videoContext 对象
this.videoContext = uni.createVideoContext('myVideo',this);
// 进入全屏状态
this.videoContext.requestFullScreen({direction:-90})
},
error(e) { //视频播放出错
uni.showModal({
content: e.target.errMsg,
showCancel: false
})
},
}
}
</script>
<style lang="scss" scoped>
.content{padding: 0 20rpx;min-height: 100%;width: 100%;background-color: #192033;
.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;}
view{float: right;height: 60rpx;line-height: 60rpx;align-items: center;display: flex;}
.content {
padding: 0 20rpx;
min-height: 100%;
width: 100%;
background-color: #192033;
.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;
}
view {
float: right;
height: 60rpx;
line-height: 60rpx;
align-items: center;
display: flex;
}
}
}
.bottom{height: 150rpx;width: 100%;position: relative;position: fixed;bottom: 0;right:0rpx;
image{width: 100%;height: 100rpx;position: relative;position: fixed;bottom: 0;}
.paizhao{height: 160rpx;width: 160rpx;z-index: 1;position: absolute;left:50%;top:22%;transform: translate(-50%, -50%);
image{height: 100%;width: 100%;}
.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>
......@@ -38,15 +38,15 @@
</view>
</view>
</navigator>
<view class="title">
<view class="title" v-if="scenicList.length>0">
<view class="shuxian"></view>
<view>景区VLOG样片</view>
</view>
<view class="row">
<block v-for="(item,index) in scenicList" :key="index">
<navigator :url="'../scenicList/scenicList?caseId='+item.caseId" class="item">
<image class="fengmian" :src="item.coverImgUrl"></image>
<text>{{item.name}}</text>
<navigator :url="'../scenicList/scenicList?productUrl='+item.productUrl+'&thumbImageUrl='+item.thumbImageUrl+'&merchantName='+item.merchantName" class="item">
<image class="fengmian" :src="item.thumbImageUrl"></image>
<text>{{item.merchantName}}</text>
</navigator>
</block>
</view>
......@@ -55,6 +55,7 @@
<navigator url="../vlogface/vlogface">
<view class="paizhao">
<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>
</navigator>
</view>
......@@ -110,12 +111,13 @@
},
getScenicList() { //景区列表查询
let data = {
"pageNo": 1,
"pageSize": 10
merchantId:"a124Jj6IYiSzCjVV"
}
this.$request("distribution/vlog/getScenicList", data).then(res => {
this.$request("scenic/user/merchant/merchantVlogList", data).then(res => {
if (res.code === "00") { //请求成功
this.scenicList = res.data.list
this.scenicList=res.data.filter((item)=>{
return item.isPublic===1
})
} else {
uni.showModal({
content: res.message,
......@@ -302,9 +304,7 @@
}
.bottom {
height: 150rpx;
width: 100%;
position: relative;
position: fixed;
bottom: 0;
right: 0rpx;
......@@ -312,23 +312,23 @@
image {
width: 100%;
height: 100rpx;
position: relative;
position: fixed;
bottom: 0;
}
.paizhao {
height: 160rpx;
width: 160rpx;
width:100%;
z-index: 1;
position: absolute;
left: 50%;
top: 22%;
transform: translate(-50%, -50%);
bottom: 15rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
image {
height: 100%;
width: 100%;
height:160rpx;
width:160rpx;
position: relative;
top: 30rpx;
}
}
}
......
......@@ -2,7 +2,7 @@
<view class="content">
<view style="padding-top: 30rpx;">
<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>
<view class="">
<button v-if="item.shareNumber===0" :data-productUrl="item.productUrl" :data-productId="item.productId" class="btnn"
......@@ -65,7 +65,8 @@
methods: {
getMyVlogList() { //获取景区vlog列表
this.$request("wechatUser/myPage/getVlogRecord", {
openid: uni.getStorageSync("openid")
openid: uni.getStorageSync("openid"),
productType:0
}).then(res => {
if (res.code === "00") {
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