Commit 775ba504 authored by renjie's avatar renjie

vlog首页加入影集首页进入按钮

parent 5cca28db
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
data() { data() {
return { return {
showtip: false,//领取提示 showtip: false,//领取提示
showUseRule: false,//使用规则提示 showUseRule: false,//使用规则提示
statusBarHeight: 0, statusBarHeight: 0,
capsule: 0, capsule: 0,
navHeight: 0, navHeight: 0,
...@@ -144,14 +144,14 @@ export default { ...@@ -144,14 +144,14 @@ export default {
} }
}, },
methods: { methods: {
closeMask() {//---关闭遮罩 closeMask() {//---关闭遮罩
this.showtip = false this.showtip = false
this.showUseRule = false this.showUseRule = false
}, },
useRuleClick() {//---查看使用规则 useRuleClick() {//---查看使用规则
this.showtip = false this.showtip = false
this.showUseRule = true this.showUseRule = true
}, },
jumpToScanFaceClick() {//---跳转扫脸页面 jumpToScanFaceClick() {//---跳转扫脸页面
const openid = uni.getStorageSync('openid') const openid = uni.getStorageSync('openid')
...@@ -247,13 +247,15 @@ export default { ...@@ -247,13 +247,15 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
this.$commonjs.getCompanyId(options) this.$commonjs.getCompanyId(options)
this.recordDeviceInfo() this.recordDeviceInfo()
this.options = options this.options = options
if(this.options.tip === 'true') { if(this.options.tip === 'true') {// 从模板选择页进入
this.show = true this.show = true
this.showtip = true this.showtip = true
}else { }else if(this.options.index == 1) {// 从vlog首页进入
this.show = true
}else {// 扫码进入本页
this.handleWhetherToVotePage() this.handleWhetherToVotePage()
} }
......
...@@ -42,14 +42,17 @@ ...@@ -42,14 +42,17 @@
<view class="shuxian"></view> <view class="shuxian"></view>
<view>景区VLOG样片</view> <view>景区VLOG样片</view>
</view> </view>
<view class="row"> <view class="row" v-if="scenicList.length>0">
<block v-for="(item,index) in scenicList" :key="index"> <block v-for="(item,index) in scenicList" :key="index">
<navigator :url="'../scenicList/scenicList?productUrl='+item.productUrl+'&thumbImageUrl='+item.thumbImageUrl+'&merchantName='+item.merchantName" class="item"> <navigator :url="'../scenicList/scenicList?productUrl='+item.productUrl+'&thumbImageUrl='+item.thumbImageUrl+'&merchantName='+item.merchantName" class="item">
<image class="fengmian" :src="item.thumbImageUrl"></image> <image class="fengmian" :src="item.thumbImageUrl"></image>
<text>{{item.merchantName}}</text> <text>{{item.merchantName}}</text>
</navigator> </navigator>
</block> </block>
</view> </view>
<navigator url="../../album/albumIndex?index=1">
<view class="album">相册首页</view>
</navigator>
<view class="bottom"> <view class="bottom">
<image src="../../../static/img/vlog/icon/bottom.png"></image> <image src="../../../static/img/vlog/icon/bottom.png"></image>
<navigator url="../vlogface/vlogface"> <navigator url="../vlogface/vlogface">
...@@ -63,154 +66,154 @@ ...@@ -63,154 +66,154 @@
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
userInfo: "", //用户信息 userInfo: '', //用户信息
scenicList: [], //景区列表 scenicList: [], //景区列表
search: "", //景区 search: '', //景区
list: [{ list: [{
image: '../../../static/img/vlog/swipe/swipe1.jpg' image: '../../../static/img/vlog/swipe/swipe1.jpg'
}, },
{ {
image: '../../../static/img/vlog/swipe/swipe2.jpg' image: '../../../static/img/vlog/swipe/swipe2.jpg'
}, },
{ {
image: '../../../static/img/vlog/swipe/swipe3.jpg' image: '../../../static/img/vlog/swipe/swipe3.jpg'
} }
], ],
} }
}, },
onLoad() { //代替 vue 里面的 created onLoad() { //代替 vue 里面的 created
this.getUserInfo() //获取用户信息 this.getUserInfo() //获取用户信息
this.getScenicList() //获取景区列表 this.getScenicList() //获取景区列表
this.openCamera() //打开权限 this.openCamera() //打开权限
}, },
onReady() { //代替 vue 里面的 mounted onReady() { //代替 vue 里面的 mounted
}, },
methods: { methods: {
getUserInfo() { //获取用户信息 getUserInfo() { //获取用户信息
this.$request('wechatUser/wxUser/findWxUser', { this.$request('wechatUser/wxUser/findWxUser', {
openid: uni.getStorageSync("openid") openid: uni.getStorageSync('openid')
}) })
.then((res) => { .then((res) => {
if (res.code === "00") { //请求成功 if (res.code === '00') { //请求成功
this.userInfo = res.data this.userInfo = res.data
if (this.userInfo.isVlog === 0) { //未注册 if (this.userInfo.isVlog === 0) { //未注册
this.vlogRegister() this.vlogRegister()
} else { } else {
console.log("用户已注册"); console.log('用户已注册')
} }
} else { } else {
uni.showModal({ uni.showModal({
content: res.message, content: res.message,
showCancel: false showCancel: false
}) })
} }
}) })
}, },
getScenicList() { //景区列表查询 getScenicList() { //景区列表查询
let data = { let data = {
merchantId:"a124Jj6IYiSzCjVV" merchantId:'a124Jj6IYiSzCjVV'
} }
this.$request("scenic/user/merchant/merchantVlogList", data).then(res => { this.$request('scenic/user/merchant/merchantVlogList', data).then(res => {
if (res.code === "00") { //请求成功 if (res.code === '00') { //请求成功
this.scenicList=res.data.filter((item)=>{ this.scenicList=res.data.filter((item)=>{
return item.isPublic===1 return item.isPublic===1
}) })
} else { } else {
uni.showModal({ uni.showModal({
content: res.message, content: res.message,
showCancel: false showCancel: false
}) })
} }
}) })
}, },
vlogRegister() { //用户注册 vlogRegister() { //用户注册
let data = { let data = {
"nickName": this.userInfo.nickname.substr(0,10), //昵称 'nickName': this.userInfo.nickname.substr(0,10), //昵称
"userId": this.userInfo.openid, //用户id(用微信openid) 'userId': this.userInfo.openid, //用户id(用微信openid)
"phone": 17347895200, //手机 'phone': 17347895200, //手机
"outUserId": this.userInfo.openid, //用户Id, //外部应用id(用微信openid) 'outUserId': this.userInfo.openid, //用户Id, //外部应用id(用微信openid)
"userType": "WECHAT", //ALIPAY-支付宝小程序,WECHAT-微信小程序,OTHER-其他 'userType': 'WECHAT', //ALIPAY-支付宝小程序,WECHAT-微信小程序,OTHER-其他
"gender": this.userInfo.gender //0-男,1-女 'gender': this.userInfo.gender //0-男,1-女
} }
this.$request("distribution/vlog/vlogRegister", data).then(res => { //注册 this.$request('distribution/vlog/vlogRegister', data).then(res => { //注册
if (res.code === "00") { if (res.code === '00') {
let data = { let data = {
userId: uni.getStorageSync("openid"), userId: uni.getStorageSync('openid'),
action: "VLOG_DOWNLOAD" action: 'VLOG_DOWNLOAD'
} }
this.$request("distribution/vlog/backflow", data).then(res => { //埋点 this.$request('distribution/vlog/backflow', data).then(res => { //埋点
if (res.code === "00") { if (res.code === '00') {
} }
}) })
} }
}) })
}, },
openCamera() { //用户首次进入打开权限 openCamera() { //用户首次进入打开权限
uni.authorize({ //摄像头 uni.authorize({ //摄像头
scope: 'scope.camera', scope: 'scope.camera',
success: (res) => { success: (res) => {
}, },
fail: (res) => { fail: (res) => {
uni.showModal({ uni.showModal({
content: '检测到您没打开摄像头权限,是否去设置打开?', content: '检测到您没打开摄像头权限,是否去设置打开?',
confirmText: "确认", confirmText: '确认',
cancelText: '取消', cancelText: '取消',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
uni.openSetting({ uni.openSetting({
success: (res) => { success: (res) => {
console.log(res); console.log(res)
}, },
fail: (err) => { fail: (err) => {
console.log(err); console.log(err)
} }
}) })
} else { } else {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
} }
} }
}) })
} }
}) })
uni.authorize({ uni.authorize({
scope: 'scope.writePhotosAlbum', scope: 'scope.writePhotosAlbum',
success: (res) => { success: (res) => {
}, },
fail: (res) => { fail: (res) => {
uni.showModal({ uni.showModal({
content: '检测到您没打开相册权限,是否去设置打开?', content: '检测到您没打开相册权限,是否去设置打开?',
confirmText: "确认", confirmText: '确认',
cancelText: '取消', cancelText: '取消',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
uni.openSetting({ uni.openSetting({
success: (res) => { success: (res) => {
console.log(res); console.log(res)
}, },
fail: (err) => { fail: (err) => {
console.log(err); console.log(err)
} }
}) })
} else { } else {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
} }
} }
}) })
} }
}) })
}, },
query() { //查询 query() { //查询
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
...@@ -333,4 +336,15 @@ ...@@ -333,4 +336,15 @@
} }
} }
} }
.album {
width: 100%;
height: 80rpx;
margin-top: 32rpx;
border-radius: 8rpx;
text-align: center;
line-height: 80rpx;
font-size: 32rpx;
background-color: #212B44;
color: #fff;
}
</style> </style>
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