Commit 7d237041 authored by 潘永坪's avatar 潘永坪

出租车首页产品不显示bug处理

parent 92ec6c51
...@@ -47,8 +47,11 @@ export default{ ...@@ -47,8 +47,11 @@ export default{
var c = b.replace(regss,'') var c = b.replace(regss,'')
return c return c
}, },
getUrlKey:function(name){//通过连接地址获取参数值 phoneReg:function(){//手机正则
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || '' return /^(13[0-9]|14[0-9]|15[0-9]|18[0-9]|17[0-9]|19[0-9]|16[0-9])\d{8}$/
},
getUrlKey:function(name,url){//通过连接地址获取参数值
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(url)) || [, ''])[1].replace(/\+/g, '%20') || ''
}, },
/* /*
通过链接地址获取companyId,并保持在本地 通过链接地址获取companyId,并保持在本地
...@@ -65,12 +68,30 @@ export default{ ...@@ -65,12 +68,30 @@ export default{
//#endif //#endif
let companyId='' let companyId=''
if(enterUrl){//普通二维码扫码进入 if(enterUrl){//普通二维码扫码进入
companyId=getUrlKey('companyId')||uni.getStorageSync('companyId')||'' companyId=this.getUrlKey('companyId',enterUrl)||uni.getStorageSync('companyId')||''
}else{//小程序页面跳转进入 }else{//小程序页面跳转进入
companyId=option.companyId||uni.getStorageSync('companyId')||'' companyId=option.companyId||uni.getStorageSync('companyId')||''
} }
uni.setStorageSync('companyId',companyId) uni.setStorageSync('companyId',companyId)
return companyId return companyId
},
//获取除companyId的其他参数
getKey:function(option,query){
let enterUrl=''
//#ifdef MP-WEIXIN
enterUrl=option.q
//#endif
//#ifdef MP-ALIPAY
enterUrl=uni.getStorageSync('alipayQrCode')
//#endif
let key=''
if(enterUrl){//普通二维码扫码进入
key=this.getUrlKey(`${query}`,enterUrl)||''
}else{//小程序页面跳转进入
key=option[query]||''
}
return key
} }
} }
//调用方法时--this.$commonjs.today() //调用方法时--this.$commonjs.today()
\ No newline at end of file
var baseUrl = '' var baseUrl = ''
if(process.env.NODE_ENV === 'development'){//开发环境 if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl= 'http://pay.tuyoyoo.com/' baseUrl= 'https://pay.tuyoyoo.com/'
}else{ }else{
baseUrl= 'https://manager.pangdly.com/' baseUrl= 'https://manager.pangdly.com/'
} }
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<text class="middle-tip"> <text class="middle-tip">
取片电话: 取片电话:
</text> </text>
<input type="number" placeholder="请输入取片人手机号码" /> <input type="number" placeholder="请输入取片人手机号码" v-model.trim="printPhone"/>
</view> </view>
<view> <view>
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
</view> </view>
<view class="pop-bottom"> <view class="pop-bottom">
<text class="pop-btn"> <text class="pop-btn" @click="commit()">
提交 提交
</text> </text>
</view> </view>
...@@ -148,6 +148,7 @@ export default { ...@@ -148,6 +148,7 @@ export default {
imgList:[],//下载图片列表 imgList:[],//下载图片列表
downImgNumber:0,//下载图片的数量 downImgNumber:0,//下载图片的数量
extendContent:'',//额外信息 extendContent:'',//额外信息
printPhone:'',//打印电话号码
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -161,6 +162,36 @@ export default { ...@@ -161,6 +162,36 @@ export default {
} }
}, },
methods: { methods: {
//---打印提交
commit(){
if(!this.$commonjs.phoneReg().test(this.printPhone)){
uni.showToast({
title:'请输入正确的电话号码',
icon: 'none'
})
return
}
let data = {
orderId:this.orderId,//订单ID
userId:uni.getStorageSync('openid')||'',//用户Id
phone:this.printPhone,//电话号码
}
this.$request('order/userOrder/updateOrder', data).then(res => {
if (res.code == '00') {
uni.showToast({
title:'申请成功',
icon: 'none'
})
this.showPop=false
this.phone=''
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
//---复制内容 //---复制内容
copyText(value){ copyText(value){
uni.setClipboardData({ uni.setClipboardData({
......
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
行程订制 行程订制
</view> </view>
</view> </view>
<view @click="goAlbum()">
<image src="@/static/img/index/album.png"></image>
<view>
摄影/旅拍
</view>
</view>
<view @click="goVlog()"> <view @click="goVlog()">
<image src="@/static/img/index/video.png"></image> <image src="@/static/img/index/video.png"></image>
<view> <view>
...@@ -266,6 +272,12 @@ export default { ...@@ -266,6 +272,12 @@ export default {
url:'/pages/hotel/hotelIndex/hotelIndex' url:'/pages/hotel/hotelIndex/hotelIndex'
}) })
}, },
//跳转影集首页
goAlbum(){
uni.navigateTo({
url:'/pages/album/albumIndex?index=1'
})
},
//---跳转vlog //---跳转vlog
goVlog(){ goVlog(){
uni.navigateTo({ uni.navigateTo({
......
...@@ -126,14 +126,14 @@ ...@@ -126,14 +126,14 @@
通行码 通行码
</view> </view>
</view> </view>
<!-- <view class="middle3-list" @click="goMyPhoto()"> <view class="middle3-list" @click="goMyPhoto()">
<view> <view>
<image src="@/static/img/my/center/album.png"></image> <image src="@/static/img/my/center/album.png"></image>
</view> </view>
<view> <view>
我的影集 我的影集
</view> </view>
</view> --> </view>
<view class="middle3-list" @click="goshopping()"> <view class="middle3-list" @click="goshopping()">
<view> <view>
<image src="@/static/img/my/center/shopping.png"></image> <image src="@/static/img/my/center/shopping.png"></image>
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
export default { export default {
data() { data() {
return { return {
enterUrl: '', //进入页面路由
orderList:[], //订单列表 orderList:[], //订单列表
pdOrderMoney: '', //实际总价 pdOrderMoney: '', //实际总价
totalMoney: '', //原价总价 totalMoney: '', //原价总价
...@@ -79,19 +78,13 @@ export default { ...@@ -79,19 +78,13 @@ export default {
}, },
onLoad(option) { onLoad(option) {
//#ifdef MP-WEIXIN //#ifdef MP-WEIXIN
this.enterUrl = option.q
this.payType = 42 this.payType = 42
//#endif //#endif
//#ifdef MP-ALIPAY //#ifdef MP-ALIPAY
this.enterUrl = uni.getStorageSync('alipayQrCode')
this.payType = 33 this.payType = 33
//#endif //#endif
if (this.enterUrl) { this.orderId=this.$commonjs.getKey(option,'orderId')
this.orderId = this.getUrlKey('orderId')
} else {
this.orderId = option.orderId||''
}
this.ifyukuaiCode = option.ifyukuaiCode||'' this.ifyukuaiCode = option.ifyukuaiCode||''
this.albumOrderdetail=option.albumOrderdetail||'' this.albumOrderdetail=option.albumOrderdetail||''
this.openid = uni.getStorageSync('openid') || '' this.openid = uni.getStorageSync('openid') || ''
...@@ -266,10 +259,6 @@ export default { ...@@ -266,10 +259,6 @@ export default {
} }
}) })
// #endif // #endif
},
getUrlKey(name) {
//---------------------------------------------------------------获取url
return (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
} }
} }
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<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/vlog/icon/icon_thereisnovideo.png"></image>
</view> </view>
<navigator url="../vlogface/vlogface" class="btnn"> <navigator url="../vlogface/vlogface" class="btnn">
<view>点击获取我的Vlog</view> <view>点击获取我的Vlog</view>
...@@ -25,64 +25,64 @@ ...@@ -25,64 +25,64 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
show: true, //跳转过渡页面 show: true, //跳转过渡页面
vlogList: [], //我的vlog集合 vlogList: [], //我的vlog集合
} }
}, },
onReady() {}, onReady() {},
onLoad() { onLoad() {
this.$request('distribution/vlog/getVlogCreateInfo', {//获取结果 this.$request('distribution/vlog/getVlogCreateInfo', {//获取结果
userId: uni.getStorageSync('openid') userId: uni.getStorageSync('openid')
}).then(res=>{ }).then(res=>{
setTimeout(()=>{ setTimeout(()=>{
this.getMyVlogList() this.getMyVlogList()
},1000) },1000)
}) })
}, },
methods: { methods: {
navTo(item){ navTo(item){
this.$u.route('/pages/vlog/vlogList/vlogList?merchantId='+item.merchantId) this.$u.route('/pages/vlog/vlogList/vlogList?merchantId='+item.merchantId)
}, },
getMyVlogList(){ getMyVlogList(){
this.$request('wechatUser/myPage/getVlogRecord', { this.$request('wechatUser/myPage/getVlogRecord', {
openid: uni.getStorageSync('openid'), openid: uni.getStorageSync('openid'),
productType:0 productType:0
}).then(res => { }).then(res => {
this.show = false this.show = false
if(res.code==='00'){ if(res.code==='00'){
this.vlogList = res.data this.vlogList = res.data
if (this.vlogList.length > 0) { //如果有数据 if (this.vlogList.length > 0) { //如果有数据
uni.setNavigationBarColor({ //动态更改导航条颜色 uni.setNavigationBarColor({ //动态更改导航条颜色
frontColor: '#ffffff', frontColor: '#ffffff',
backgroundColor: '#192033', backgroundColor: '#192033',
animation: { animation: {
duration: 1, duration: 1,
timingFunc: 'easeIn' timingFunc: 'easeIn'
} }
}) })
uni.setBackgroundColor({ uni.setBackgroundColor({
backgroundColor: '#192033' backgroundColor: '#192033'
}) })
} else { //数据为空 } else { //数据为空
this.show = false this.show = false
} }
}else{ }else{
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.message, content: res.message,
showCancel: false, showCancel: false,
}) })
} }
}) })
}, },
query(e) { query(e) {
console.log(e) console.log(e)
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<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/vlog/icon/fengexian.png" mode="" style="width: 100%;height: 15rpx;"></image>
<view class="row"> <view class="row">
<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>
...@@ -20,107 +20,107 @@ ...@@ -20,107 +20,107 @@
</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: {
handleDownload(url) { // 下载功能 handleDownload(url) { // 下载功能
uni.showLoading({ uni.showLoading({
title: '下载中', title: '下载中',
mask: true mask: true
}) })
let fileName = new Date().valueOf() //获取时间戳 let fileName = new Date().valueOf() //获取时间戳
uni.downloadFile({ //下载文件资源到本地 uni.downloadFile({ //下载文件资源到本地
url, url,
filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.jpg', //filePath指定文件下载后存储的路径,wx.env.USER_DATA_PATH,时间戳为文件名 filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.jpg', //filePath指定文件下载后存储的路径,wx.env.USER_DATA_PATH,时间戳为文件名
success: res => { //下载到本地成功 success: res => { //下载到本地成功
let filePath = res.filePath let filePath = res.filePath
uni.saveImageToPhotosAlbum({ //保存视频到系统相册。 uni.saveImageToPhotosAlbum({ //保存视频到系统相册。
filePath, filePath,
success: file => { //保存成功 success: file => { //保存成功
//删除本地缓存 //删除本地缓存
let fileMgr = uni.getFileSystemManager() let fileMgr = uni.getFileSystemManager()
fileMgr.unlink({ fileMgr.unlink({
filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.jpg', filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.jpg',
}) })
uni.showToast({ uni.showToast({
title: '下载成功', title: '下载成功',
icon: 'success', icon: 'success',
mask: true mask: true
}) })
}, },
fail: err => { fail: err => {
uni.hideLoading() uni.hideLoading()
//拒绝授权时显示 //拒绝授权时显示
if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') { if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '需要您授权保存相册', content: '需要您授权保存相册',
showCancel: false, showCancel: false,
success: data => { success: data => {
//打开权限设置 //打开权限设置
uni.openSetting({ uni.openSetting({
success: setting => { success: setting => {
if (setting.authSetting['scope.writePhotosAlbum']) { if (setting.authSetting['scope.writePhotosAlbum']) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '获取权限成功,再次点击下载即可保存', content: '获取权限成功,再次点击下载即可保存',
showCancel: false, showCancel: false,
}) })
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
ontent: '获取权限失败,将无法保存到相册哦', ontent: '获取权限失败,将无法保存到相册哦',
showCancel: false showCancel: false
}) })
} }
}, },
}) })
} }
}) })
} }
} }
}) })
}, },
fail: err => { //下载失败 fail: err => { //下载失败
uni.hideLoading() uni.hideLoading()
if (err.errMsg == 'downloadFile:fail createDownloadTask:fail url not in domain list') { if (err.errMsg == 'downloadFile:fail createDownloadTask:fail url not in domain list') {
uni.showToast({ uni.showToast({
title: '服务器错误,请联系相关管理员', title: '服务器错误,请联系相关管理员',
icon: 'none', icon: 'none',
mask: true 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,
showCancel: false, showCancel: false,
}) })
} }
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
......
This diff is collapsed.
<template> <template>
<view class="content"> <view class="content">
<view class="item" style="padding-bottom: 0;"> <view class="item" style="padding-bottom: 0;">
<image src="../../../static/img/vlog/product_fengmian.jpg" mode="widthFix"></image> <image src="../static/vlog/product_fengmian.jpg" mode="widthFix"></image>
<view class="title"> <view class="title">
<view>我的VLOG照片</view> <view>我的VLOG照片</view>
<navigator url="../myVlogPhotos/myVlogPhotos" class="btnn" style="margin-top: 50rpx;"> <navigator url="../myVlogPhotos/myVlogPhotos" class="btnn" style="margin-top: 50rpx;">
...@@ -31,35 +31,35 @@ ...@@ -31,35 +31,35 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
list:[],//商品列表 list:[],//商品列表
} }
}, },
onLoad(){//代替 vue 里面的 created onLoad(){//代替 vue 里面的 created
this.getList() this.getList()
}, },
onReady() {//代替 vue 里面的 mounted onReady() {//代替 vue 里面的 mounted
}, },
methods: { methods: {
getList(){//获取商品列表 getList(){//获取商品列表
this.$request("scenic/user/product/findProductList", { this.$request('scenic/user/product/findProductList', {
openid: uni.getStorageSync("openid"), openid: uni.getStorageSync('openid'),
productType:9, productType:9,
type:4 type:4
}).then(res => { }).then(res => {
if (res.code == "00") { if (res.code == '00') {
this.list=res.data.list this.list=res.data.list
}else{ }else{
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.message, content: res.message,
showCancel: false, showCancel: false,
}) })
} }
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<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;">Template Selection</text> <text style="font-size: 24rpx;color: #ccc;margin-left: 30rpx;">Template Selection</text>
</view> </view>
<image src="../../../static/img/vlog/icon/fengexian.png" style="width: 100%;height: 5rpx;"></image> <image src="../static/vlog/icon/fengexian.png" style="width: 100%;height: 5rpx;"></image>
<view style="display: flex;justify-content: space-around;margin-bottom: 20upx;width: 75%;margin: 20upx auto;"> <view style="display: flex;justify-content: space-around;margin-bottom: 20upx;width: 75%;margin: 20upx auto;">
<button type="default" class="btnn" :class="current===0?'active':'noactive'" <button type="default" class="btnn" :class="current===0?'active':'noactive'"
@click="current=0">封面</button> @click="current=0">封面</button>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<view class="cover"> <view class="cover">
<view class="coverItem1" v-for="(item,index) in imgList2" :key="index"> <view class="coverItem1" v-for="(item,index) in imgList2" :key="index">
<image class="img" :src="item.url" @click="changeCover(item.url)"></image> <image class="img" :src="item.url" @click="changeCover(item.url)"></image>
<image v-if="cover===item.url" src="../../../static/img/vlog/icon/check.png" class="icon"></image> <image v-if="cover===item.url" src="../static/vlog/icon/check.png" class="icon"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<view class="cover"> <view class="cover">
<view class="coverItem" v-for="(item,index) in imgList3" :key="index"> <view class="coverItem" v-for="(item,index) in imgList3" :key="index">
<image class="img" :src="item.url" @click="changeinsidePages(item.url)"></image> <image class="img" :src="item.url" @click="changeinsidePages(item.url)"></image>
<image v-if="insidePages===item.url" src="../../../static/img/vlog/icon/check.png" class="icon"></image> <image v-if="insidePages===item.url" src="../static/vlog/icon/check.png" class="icon"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<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;">Parameters</text> <text style="font-size: 24rpx;color: #ccc;margin-left: 30rpx;">Parameters</text>
</view> </view>
<image src="../../../static/img/vlog/icon/fengexian.png" mode="" style="width: 100%;height: 5rpx;"></image> <image src="../static/vlog/icon/fengexian.png" mode="" style="width: 100%;height: 5rpx;"></image>
<image :src="item.url" mode="widthFix" v-for="(item,index) in imgList1" :key="index" style="width: 100%;border-radius: 10rpx;"></image> <image :src="item.url" mode="widthFix" v-for="(item,index) in imgList1" :key="index" style="width: 100%;border-radius: 10rpx;"></image>
<view class="bottom" @click="beginMaking">上传照片制作</view> <view class="bottom" @click="beginMaking">上传照片制作</view>
</view> </view>
...@@ -53,97 +53,97 @@ ...@@ -53,97 +53,97 @@
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
showBody: false, showBody: false,
productVo: {}, //产品详情 productVo: {}, //产品详情
imgList1: [], //详情列表 imgList1: [], //详情列表
imgList2: [], //封面列表 imgList2: [], //封面列表
imgList3: [], //内页列表 imgList3: [], //内页列表
current: 0, //封面内页切换 current: 0, //封面内页切换
cover: "", //封面 cover: '', //封面
insidePages: "", //内页 insidePages: '', //内页
} }
}, },
onLoad(option) { //代替 vue 里面的 created onLoad(option) { //代替 vue 里面的 created
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.name title: option.name
}) })
this.getDetails(option.id) this.getDetails(option.id)
}, },
onReady() { //代替 vue 里面的 mounted onReady() { //代替 vue 里面的 mounted
}, },
methods: { methods: {
getDetails(id) { //获取商品详情 getDetails(id) { //获取商品详情
this.$request("scenic/user/product/findChoseProductInfo", { this.$request('scenic/user/product/findChoseProductInfo', {
productId: id, productId: id,
openid: uni.getStorageSync("openid") openid: uni.getStorageSync('openid')
}).then(res => { }).then(res => {
if (res.code === "00") { if (res.code === '00') {
this.showBody = true this.showBody = true
this.productVo = res.data.productVo this.productVo = res.data.productVo
uni.setStorageSync('productVo', this.productVo) //保存选择的商品信息 uni.setStorageSync('productVo', this.productVo) //保存选择的商品信息
res.data.productVo.imgList.forEach(item => { res.data.productVo.imgList.forEach(item => {
if (item.location === 5) { if (item.location === 5) {
this.imgList1.push(item) this.imgList1.push(item)
} }
if (item.location === 6) { if (item.location === 6) {
this.imgList2.push(item) this.imgList2.push(item)
} }
if (item.location === 8) { if (item.location === 8) {
this.imgList3.push(item) this.imgList3.push(item)
} }
}) })
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.message, content: res.message,
showCancel: false, showCancel: false,
}) })
} }
}) })
}, },
changeCover(url) { //选择封面 changeCover(url) { //选择封面
this.cover = url this.cover = url
}, },
changeinsidePages(url) { //选择内页 changeinsidePages(url) { //选择内页
this.insidePages = url this.insidePages = url
}, },
beginMaking() { beginMaking() {
if (this.cover === "") { if (this.cover === '') {
return uni.showModal({ return uni.showModal({
showCancel: false, showCancel: false,
title: '提示', title: '提示',
content: '请选择封面', content: '请选择封面',
}); })
} }
if (this.insidePages === "") { if (this.insidePages === '') {
return uni.showModal({ return uni.showModal({
showCancel: false, showCancel: false,
title: '提示', title: '提示',
content: '请选择内页', content: '请选择内页',
}); })
} }
let coverInside = { let coverInside = {
cover: { cover: {
imgName: '封面', imgName: '封面',
imgUrl: this.cover imgUrl: this.cover
}, },
inside: { inside: {
imgName: '内页', imgName: '内页',
imgUrl: this.insidePages imgUrl: this.insidePages
} }
} }
uni.setStorageSync('coverInside', coverInside) uni.setStorageSync('coverInside', coverInside)
let yeshu = this.productVo.priceStockList[0].standardName let yeshu = this.productVo.priceStockList[0].standardName
this.$u.route({ this.$u.route({
url: 'pages/vlog/uploadPictures/uploadPictures?yeshu=' + yeshu url: 'pages/vlog/uploadPictures/uploadPictures?yeshu=' + yeshu
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
......
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
</block> </block>
</view> </view>
<view class="bottom"> <view class="bottom">
<image src="../../../static/img/vlog/icon/bottom.png"></image> <image src="../static/vlog/icon/bottom.png"></image>
<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/vlog/icon/icon_scan.png"></image>
<view style="width: 100%;text-align: center;margin-top:10rpx;color: #FFFFFF;">获取Vlog</view> <view style="width: 100%;text-align: center;margin-top:10rpx;color: #FFFFFF;">获取Vlog</view>
</view> </view>
</navigator> </navigator>
...@@ -29,38 +29,38 @@ ...@@ -29,38 +29,38 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
productUrl: "", //视频地址 productUrl: '', //视频地址
thumbImageUrl: "", //图片地址 thumbImageUrl: '', //图片地址
merchantName: "", //景区名称 merchantName: '', //景区名称
videoContext:"" videoContext:''
} }
}, },
onReady() { //代替 vue 里面的 mounted onReady() { //代替 vue 里面的 mounted
}, },
onLoad(option) { //代替 vue 里面的 created onLoad(option) { //代替 vue 里面的 created
this.productUrl = option.productUrl this.productUrl = option.productUrl
this.thumbImageUrl = option.thumbImageUrl this.thumbImageUrl = option.thumbImageUrl
this.merchantName = option.merchantName this.merchantName = option.merchantName
}, },
methods: { methods: {
playVideo(){ playVideo(){
// 获取 video 上下文 videoContext 对象 // 获取 video 上下文 videoContext 对象
this.videoContext = uni.createVideoContext('myVideo',this); this.videoContext = uni.createVideoContext('myVideo',this)
// 进入全屏状态 // 进入全屏状态
this.videoContext.requestFullScreen({direction:-90}) this.videoContext.requestFullScreen({direction:-90})
}, },
error(e) { //视频播放出错 error(e) { //视频播放出错
uni.showModal({ uni.showModal({
content: e.target.errMsg, content: e.target.errMsg,
showCancel: false showCancel: false
}) })
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<block v-for="(item,index) in imgList" :key="index"> <block v-for="(item,index) in imgList" :key="index">
<view class="imgItem" @click="changeImg(item,index)"> <view class="imgItem" @click="changeImg(item,index)">
<image :src="'http://picture.pangdly.com/'+item.url"></image> <image :src="'http://picture.pangdly.com/'+item.url"></image>
<image v-if="item.check===1" src="../../../static/img/vlog/icon/check.png" class="icon"></image> <image v-if="item.check===1" src="../static/vlog/icon/check.png" class="icon"></image>
</view> </view>
</block> </block>
</view> </view>
...@@ -29,135 +29,135 @@ ...@@ -29,135 +29,135 @@
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
maxImg: "", //相册规格张数 maxImg: '', //相册规格张数
imgList: [], //上传的图片列表 imgList: [], //上传的图片列表
checkList: [], //选中的图片下标 checkList: [], //选中的图片下标
} }
}, },
onLoad(opction) { //代替 vue 里面的 created onLoad(opction) { //代替 vue 里面的 created
this.maxImg = opction.yeshu //获取相册规格 this.maxImg = opction.yeshu //获取相册规格
this.imgList = uni.getStorageSync("imgList") this.imgList = uni.getStorageSync('imgList')
this.checkList = uni.getStorageSync("checkList") this.checkList = uni.getStorageSync('checkList')
if (this.imgList === "") { if (this.imgList === '') {
this.imgList = [] this.imgList = []
uni.setStorageSync("imgList", this.imgList) uni.setStorageSync('imgList', this.imgList)
} }
if (this.checkList === "") { if (this.checkList === '') {
this.checkList = [] this.checkList = []
uni.setStorageSync("checkList", this.checkList) uni.setStorageSync('checkList', this.checkList)
} }
// 监听从裁剪页发布的事件,获得裁剪结果 // 监听从裁剪页发布的事件,获得裁剪结果
uni.$on('uAvatarCropper', path => { uni.$on('uAvatarCropper', path => {
var that = this var that = this
var url = "https://manager.pangdly.com/" var url = 'https://manager.pangdly.com/'
uni.uploadFile({ // s上传图片 uni.uploadFile({ // s上传图片
url: url + 'upload/file/newUpload', url: url + 'upload/file/newUpload',
filePath: path, filePath: path,
name: 'uploadFile', name: 'uploadFile',
header: { header: {
'Content-Type': 'multipart/form-data;', 'Content-Type': 'multipart/form-data;',
}, },
success: res => { //获取图片结果 success: res => { //获取图片结果
let res1 = JSON.parse(res.data) let res1 = JSON.parse(res.data)
if (res1.code == "00") { //请求成功 if (res1.code == '00') { //请求成功
let obj = { let obj = {
url: res1.data, url: res1.data,
check: 0 check: 0
} }
that.imgList.push(obj) that.imgList.push(obj)
uni.setStorageSync("imgList", that.imgList) uni.setStorageSync('imgList', that.imgList)
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res1.message, content: res1.message,
showCancel: false, showCancel: false,
}) })
} }
} }
}) })
}) })
}, },
onReady() { //代替 vue 里面的 mounted onReady() { //代替 vue 里面的 mounted
}, },
methods: { methods: {
confirm() { //确定提交 confirm() { //确定提交
if (this.checkList.length !== this.maxImg * 1) { if (this.checkList.length !== this.maxImg * 1) {
return uni.showModal({ return uni.showModal({
showCancel: false, showCancel: false,
title: '提示', title: '提示',
content: '相册规格' + this.maxImg + "张,请按照标准选择", content: '相册规格' + this.maxImg + '张,请按照标准选择',
}); })
} }
this.$u.route("pages/vlog/pictureFormat/pictureFormat") this.$u.route('pages/vlog/pictureFormat/pictureFormat')
}, },
del() { //删除图片 del() { //删除图片
if (this.checkList.length === 0) { if (this.checkList.length === 0) {
uni.showModal({ uni.showModal({
showCancel: false, showCancel: false,
title: '提示', title: '提示',
content: "当前未选中任何图片!", content: '当前未选中任何图片!',
}); })
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: "确定要删除选中的图片吗?", content: '确定要删除选中的图片吗?',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
this.checkList.forEach(item => { this.checkList.forEach(item => {
this.imgList.splice(item, 1) this.imgList.splice(item, 1)
}) })
this.checkList = [] this.checkList = []
uni.setStorageSync("checkList", this.checkList) uni.setStorageSync('checkList', this.checkList)
uni.setStorageSync("imgList", this.imgList) uni.setStorageSync('imgList', this.imgList)
} }
} }
}); })
} }
}, },
changeImg(item, index) { //选择图片 changeImg(item, index) { //选择图片
if (item.check === 0) { if (item.check === 0) {
if (this.checkList.length < this.maxImg) { if (this.checkList.length < this.maxImg) {
item.check = 1; item.check = 1
this.checkList.push(index) this.checkList.push(index)
uni.setStorageSync("checkList", this.checkList) uni.setStorageSync('checkList', this.checkList)
uni.setStorageSync("imgList", this.imgList) uni.setStorageSync('imgList', this.imgList)
} else { } else {
uni.showModal({ uni.showModal({
showCancel: false, showCancel: false,
title: '提示', title: '提示',
content: '最多选取' + this.maxImg + "张", content: '最多选取' + this.maxImg + '张',
}); })
} }
} else { } else {
item.check = 0; item.check = 0
this.checkList.splice(this.checkList.indexOf(index), 1) this.checkList.splice(this.checkList.indexOf(index), 1)
uni.setStorageSync("checkList", this.checkList) uni.setStorageSync('checkList', this.checkList)
uni.setStorageSync("imgList", this.imgList) uni.setStorageSync('imgList', this.imgList)
} }
}, },
chooseAvatar() { //上传照片 chooseAvatar() { //上传照片
this.$u.route({ this.$u.route({
url: "pages/vlog/u-avatar-cropper/u-avatar-cropper", url: 'pages/vlog/u-avatar-cropper/u-avatar-cropper',
params: { params: {
// 输出图片宽高,单位px // 输出图片宽高,单位px
destWidth: 1000, destWidth: 1000,
destHeight: 1000, destHeight: 1000,
// 裁剪框宽高,单位px // 裁剪框宽高,单位px
rectWidth: 300, rectWidth: 300,
rectHeight: 300, rectHeight: 300,
// 输出的图片类型,如果'png'类型发现裁剪的图片太大,改成"jpg"即可 // 输出的图片类型,如果'png'类型发现裁剪的图片太大,改成"jpg"即可
fileType: 'jpg', fileType: 'jpg',
} }
}) })
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
</view> </view>
<navigator url="../myVlog/myVlog"> <navigator url="../myVlog/myVlog">
<view class="photoGallery"> <view class="photoGallery">
<image class="img" src="../../../static/img/vlog/icon/bg1.png"></image> <image class="img" src="../static/vlog/icon/bg1.png"></image>
<view class="access"></view> <view class="access"></view>
<view class="btnn"> <view class="btnn">
<image src="../../../static/img/vlog/icon/icon_clicktoenter.png"></image> <image src="../static/vlog/icon/icon_clicktoenter.png"></image>
<view> <view>
点击进入 点击进入
</view> </view>
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
</view> </view>
<navigator url="../product/product"> <navigator url="../product/product">
<view class="photoGallery"> <view class="photoGallery">
<image class="img" src="../../../static/img/vlog/icon/bg2.png"></image> <image class="img" src="../static/vlog/icon/bg2.png"></image>
<view class="access"></view> <view class="access"></view>
<view class="btnn"> <view class="btnn">
<image src="../../../static/img/vlog/icon/icon_clicktoenter.png"></image> <image src="../static/vlog/icon/icon_clicktoenter.png"></image>
<view> <view>
点击进入 点击进入
</view> </view>
...@@ -50,14 +50,14 @@ ...@@ -50,14 +50,14 @@
</navigator> </navigator>
</block> </block>
</view> </view>
<navigator url="../../album/albumIndex?index=1"> <!-- <navigator url="../../album/albumIndex?index=1">
<view class="album">相册首页</view> <view class="album">相册首页</view>
</navigator> </navigator> -->
<view class="bottom"> <view class="bottom">
<image src="../../../static/img/vlog/icon/bottom.png"></image> <image src="../static/vlog/icon/bottom.png"></image>
<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/vlog/icon/icon_scan.png"></image>
<view style="width: 100%;text-align: center;margin-top:10rpx;color: #FFFFFF;">获取Vlog</view> <view style="width: 100%;text-align: center;margin-top:10rpx;color: #FFFFFF;">获取Vlog</view>
</view> </view>
</navigator> </navigator>
...@@ -73,13 +73,13 @@ export default { ...@@ -73,13 +73,13 @@ export default {
scenicList: [], //景区列表 scenicList: [], //景区列表
search: '', //景区 search: '', //景区
list: [{ list: [{
image: '../../../static/img/vlog/swipe/swipe1.jpg' image: '../static/vlog/swipe/swipe1.jpg'
}, },
{ {
image: '../../../static/img/vlog/swipe/swipe2.jpg' image: '../static/vlog/swipe/swipe2.jpg'
}, },
{ {
image: '../../../static/img/vlog/swipe/swipe3.jpg' image: '../static/vlog/swipe/swipe3.jpg'
} }
], ],
} }
......
<template> <template>
<view class="content"> <view class="content">
<view class="bg"> <view class="bg">
<image src="../../../static/img/vlog/icon/camera.png"></image> <image src="../static/vlog/icon/camera.png"></image>
</view> </view>
<camera class="camera" device-position="front" flash="off" @error="error" @initdone="initdone"></camera> <camera class="camera" device-position="front" flash="off" @error="error" @initdone="initdone"></camera>
<view class="surface" v-show="show"> <view class="surface" v-show="show">
...@@ -14,20 +14,20 @@ ...@@ -14,20 +14,20 @@
<view class="hint1"> <view class="hint1">
<view class="item"> <view class="item">
<view class=""> <view class="">
<image src="../../../static/img/vlog/icon/icon_lightisenough.png"></image> <image src="../static/vlog/icon/icon_lightisenough.png"></image>
</view> </view>
<view>光线充足</view> <view>光线充足</view>
</view> </view>
<view class="item"> <view class="item">
<view class=""> <view class="">
<image src="../../../static/img/vlog/icon/icon_isthelens.png"></image> <image src="../static/vlog/icon/icon_isthelens.png"></image>
</view> </view>
<view>正对镜头</view> <view>正对镜头</view>
</view> </view>
<view class="item"> <view class="item">
<view class=""> <view class="">
<image src="../../../static/img/vlog/icon/icon_openface.png"></image> <image src="../static/vlog/icon/icon_openface.png"></image>
</view> </view>
<view>不遮挡面部</view> <view>不遮挡面部</view>
</view> </view>
......
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