Commit 775ba504 authored by renjie's avatar renjie

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

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