Commit 20480cd5 authored by zhoucong's avatar zhoucong

vlog调接口

parent 5ff7840d
......@@ -9,7 +9,7 @@
let openid=uni.getStorageSync("openid")
if(!openid){
uni.navigateTo({
url: "pages/vlog/vlogIndex/vlogIndex"
url: "pages/login/login"
})
}
},
......
export default{
//调用方法时--this.$commonjs.aaa()
aaa(){
console.log(123456)
}
}
\ No newline at end of file
......@@ -3,11 +3,12 @@ import App from './App'
import uView from 'uview-ui'
import request from 'common/request.js'
import "./common/icon/iconfont.css"
import commonjs from "common/common.js"
Vue.prototype.$commonjs = commonjs
Vue.prototype.$request = request
Vue.use(uView)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
......
......@@ -131,7 +131,7 @@
,{
"path" : "pages/vlog/scenicList/scenicList",
"style" : {
"navigationBarTitleText": "景区",
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#192033",
"navigationBarTextStyle": "#F8F8F8"
......
......@@ -6,11 +6,10 @@
</view>
<view class="top-content">
<view>
<navigator url="../scenic/scenic">
<navigator url="../vlog/vlogIndex/vlogIndex">
<image src="../../static/img/index/classify1.png"></image>
<view>景区门票</view>
</navigator>
</view>
<view>
<navigator url="../hotel/hotel">
......@@ -70,6 +69,9 @@
<!-- <button @click="getUserInfo()"> 授权获取头像昵称 </button> -->
<!-- <view class="bottom" v-show="showBottom"> -->
<!--#ifdef MP-WEIXIN -->
<navigator url="../vlog/vlogIndex/vlogIndex">
<button type="default">vlog</button>
</navigator>
<!-- <web-view src="https://wx.pangdly.com"></web-view> -->
<!--#endif-->
<!-- </view> -->
......
......@@ -35,6 +35,7 @@
}
_this.$request('wechat/wx/getUserInfoByCode',data).then(res => {
if(res.code=='00'){
console.log(res);
let openid=res.data.openid
uni.setStorageSync('openid',openid)
uni.navigateBack({
......
<template>
<view class="content">
<view style="padding-top: 30rpx;">
<block v-for="(item,index) in scenic.vlogSamples" :key="index">
<view class="item">
<video class="video" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" @error="error" controls @play="playing(1)" id="d1"></video>
<view class="title">
......@@ -8,13 +9,7 @@
<button class="btnn" open-type="share"><u-icon name="share"></u-icon></button>
</view>
</view>
<view class="item">
<video class="video" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" @error="error" controls @play="playing(2)" id="d2"></video>
<view class="title">
<text>[ 样片2 ]</text>
<button class="btnn" open-type="share"><u-icon name="share"></u-icon></button>
</view>
</view>
</block>
</view>
<view class="bottom">
<image src="../../../static/img/vlog/icon/bottom.png"></image>
......@@ -31,14 +26,18 @@
export default {
data() {
return {
scenic:"",//景区详情
}
},
onReady() {
onReady() {//代替 vue 里面的 mounted
},
onLoad(res){
uni.setNavigationBarTitle({//动态更改标题
title: '标题名称'
onLoad(res){//代替 vue 里面的 created
let caseId=res.caseId
this.$request("distribution/vlog/getScenicInfo",{caseId}).then(res=>{
if(res.code==="00"){
this.scenic=res.data;
uni.setNavigationBarTitle({title:this.scenic.name})
}
})
},
methods: {
......
......@@ -36,22 +36,18 @@
</view>
</view>
</navigator>
<button type="default" @click="handleDownload">下载</button>
<view class="title">
<view class="shuxian"></view>
<view>景区VLOG样片</view>
</view>
<view class="row">
<navigator url="../scenicList/scenicList" class="item">
<block v-for="(item,index) in scenicList" :key="index">
<navigator :url="'../scenicList/scenicList?caseId='+item.caseId" class="item">
<image class="icon" src="../../../static/img/vlog/icon/icon_play.png"></image>
<image class="fengmian" src="https://cdn.uviewui.com/uview/swiper/1.jpg"></image>
<text>长江索道</text>
</navigator>
<navigator url="../scenicList/scenicList" class="item">
<image class="icon" src="../../../static/img/vlog/icon/icon_play.png"></image>
<image class="fengmian" src="https://cdn.uviewui.com/uview/swiper/1.jpg"></image>
<text>云端之眼·高空观景台</text>
<image class="fengmian" :src="item.coverImgUrl"></image>
<text>{{item.name}}</text>
</navigator>
</block>
</view>
<view class="bottom">
<image src="../../../static/img/vlog/icon/bottom.png"></image>
......@@ -68,6 +64,8 @@
export default {
data() {
return {
userInfo:"",//用户信息
scenicList:[],//景区列表
share:{
title:'vlog1231231',
path:'/pages/index/index',
......@@ -90,28 +88,64 @@ export default {
}
},
onLoad(){//代替 vue 里面的 created
this.openCamera()
this.getUserInfo()//获取用户信息
this.getScenicList()//获取景区列表
this.openCamera()//打开权限
},
onReady() {//代替 vue 里面的 mounted
uni.login({
provider: 'weixin',
success: function (loginRes) {
console.log(loginRes);
// 获取用户信息
uni.getUserInfo({
provider: 'weixin',
success: function (infoRes) {
console.log(infoRes);
console.log('用户昵称为:' + infoRes.userInfo.nickName);
}
});
}
});
},
onShareAppMessage(res){
},
onShareAppMessage(res){//分享
success:(res=>{console.log(res);})
},
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={
"pageNo":1,
"pageSize":10
}
this.$request("distribution/vlog/getScenicList",data).then(res=>{
if(res.code==="00"){//请求成功
console.log("景区列表",res.data.list);
this.scenicList=res.data.list
}else{
uni.showModal({content: res.message,showCancel: false})
}
})
},
vlogRegister(){//用户注册
let data={
"nickName":this.userInfo.nickname, //昵称
"userId":this.userInfo.openid, //用户id(用微信openid)
"phone":18523953636,
"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"){
console.log("注册成功");
}
})
},
handleDownload() { // 下载功能
uni.showLoading({title:"下载中",mask:true})
let fileName = new Date().valueOf();//获取时间戳
......
项目介绍文件
一、本地存储数据
1.uni.getStorageSync("openid")
2.uni.getStorageSync("alipayQrCode")
......@@ -36,5 +36,6 @@
"uniStatistics": {
"enable": true
},
"usingComponents": {}
"usingComponents": {},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
This diff is collapsed.
......@@ -208,6 +208,8 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
//
var _default =
{
data: function data() {
......
<view></view>
\ No newline at end of file
<view><navigator url="../vlog/vlogIndex/vlogIndex"><button type="default">vlog</button></navigator></view>
\ No newline at end of file
......@@ -165,6 +165,7 @@ var _default =
};
_this.$request('wechat/wx/getUserInfoByCode', data).then(function (res) {
if (res.code == '00') {
console.log(res);
var openid = res.data.openid;
uni.setStorageSync('openid', openid);
uni.navigateBack({
......
{
"navigationBarTitleText": "景区",
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#192033",
"navigationBarTextStyle": "white",
......
......@@ -94,10 +94,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components = {
uIcon: function() {
return __webpack_require__.e(/*! import() | uview-ui/components/u-icon/u-icon */ "uview-ui/components/u-icon/u-icon").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-icon/u-icon.vue */ 200))
return __webpack_require__.e(/*! import() | uview-ui/components/u-icon/u-icon */ "uview-ui/components/u-icon/u-icon").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-icon/u-icon.vue */ 208))
},
uButton: function() {
return __webpack_require__.e(/*! import() | uview-ui/components/u-button/u-button */ "uview-ui/components/u-button/u-button").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-button/u-button.vue */ 207))
return __webpack_require__.e(/*! import() | uview-ui/components/u-button/u-button */ "uview-ui/components/u-button/u-button").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-button/u-button.vue */ 215))
}
}
var render = function() {
......
{
"usingComponents": {},
"component": true
}
\ No newline at end of file
<view class="u-cell-box data-v-5723aa40"><block wx:if="{{title}}"><view class="u-cell-title data-v-5723aa40" style="{{$root.s0}}">{{''+title+''}}</view></block><view class="{{['u-cell-item-box data-v-5723aa40',(border)?'u-border-bottom u-border-top':'']}}"><slot></slot></view></view>
\ No newline at end of file
{
"usingComponents": {
"u-icon": "/uview-ui/components/u-icon/u-icon"
},
"component": true
}
\ No newline at end of file
{
"usingComponents": {
"u-cell-group": "/uview-ui/components/u-cell-group/u-cell-group",
"u-cell-item": "/uview-ui/components/u-cell-item/u-cell-item",
"u-icon": "/uview-ui/components/u-icon/u-icon"
},
"component": true
}
\ No newline at end of file
{
"usingComponents": {
"u-icon": "/uview-ui/components/u-icon/u-icon"
},
"component": true
}
\ No newline at end of file
{
"usingComponents": {
"u-popup": "/uview-ui/components/u-popup/u-popup"
},
"component": true
}
\ No newline at end of file
<view class="u-select data-v-a577ac80"><u-popup vue-id="097ce174-1" maskCloseAble="{{maskCloseAble}}" mode="bottom" popup="{{false}}" length="auto" safeAreaInsetBottom="{{safeAreaInsetBottom}}" z-index="{{uZIndex}}" value="{{value}}" data-event-opts="{{[['^close',[['close']]],['^input',[['__set_model',['','value','$event',[]]]]]]}}" bind:close="__e" bind:input="__e" class="data-v-a577ac80" bind:__l="__l" vue-slots="{{['default']}}"><view class="u-select data-v-a577ac80"><view data-event-opts="{{[['touchmove',[['',['$event']]]]]}}" class="u-select__header data-v-a577ac80" catchtouchmove="__e"><view class="u-select__header__cancel u-select__header__btn data-v-a577ac80" style="{{'color:'+(cancelColor)+';'}}" hover-class="u-hover-class" hover-stay-time="{{150}}" data-event-opts="{{[['tap',[['getResult',['cancel']]]]]}}" bindtap="__e">{{''+cancelText+''}}</view><view class="u-select__header__title data-v-a577ac80">{{''+title+''}}</view><view class="u-select__header__confirm u-select__header__btn data-v-a577ac80" style="{{'color:'+(moving?cancelColor:confirmColor)+';'}}" hover-class="u-hover-class" hover-stay-time="{{150}}" data-event-opts="{{[['touchmove',[['',['$event']]]],['tap',[['getResult',['confirm']]]]]}}" catchtouchmove="__e" catchtap="__e">{{''+confirmText+''}}</view></view><view class="u-select__body data-v-a577ac80"><picker-view class="u-select__body__picker-view data-v-a577ac80" value="{{defaultSelector}}" data-event-opts="{{[['change',[['columnChange',['$event']]]],['pickstart',[['pickstart',['$event']]]],['pickend',[['pickend',['$event']]]]]}}" bindchange="__e" bindpickstart="__e" bindpickend="__e"><block wx:for="{{columnData}}" wx:for-item="item" wx:for-index="index" wx:key="index"><picker-view-column class="data-v-a577ac80"><block wx:for="{{item}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="u-select__body__picker-view__item data-v-a577ac80"><view class="u-line-1 data-v-a577ac80">{{item1[labelName]}}</view></view></block></picker-view-column></block></picker-view></view></view></u-popup></view>
\ No newline at end of file
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