Commit 8d5dc264 by sunerhu

1.分享压缩图片修改提交测试

parent 628aa826
<template>
<view class="content">
<view class="" style="display: flex;justify-content: space-between;">
<view class="" style="">
</view>
<view class="header">
<image style="width: 180rpx;
height: 120rpx;" src="../../static/Group132.png" mode=""></image>
</view>
<!-- <view class="">
<image src="../../static/bo" mode=""></image>
</view> -->
</view>
<view class="content-box">
<view style="margin: 20rpx;">
<view class="inputItem">
<input class="uni-input" name="invitationCode" placeholder="输入手机号" v-model="mobile" />
</view>
<view class="login-code">
<input name="form.code" placeholder="输入验证码" v-model="code" type="number" maxlength="6" />
<text @click="sendMessage()" :class="{'grey':disabledSendBtn}">{{sendCode}}</text>
<view class="" style="text-align: center;">
<view class="" style="display: flex;justify-content: center;">
<span class="text">戳这里,点击
</span>
<view class="" style="width: 100rpx;height: 100rpx;padding: 0 20rpx;">
<image style="width: 100rpx;height: 100rpx;" src="../../static/Slice146.png" mode=""></image>
</view>
<span class="text">按钮,</span>
<view class="agree">
<label class="radio" style="padding-right: 10rpx;">
<radio :checked="agreeFlag" @click="agreeFlag=!agreeFlag" />
</label>
<text>已阅读并同意</text><a href="#">银盾保险经纪服务协议</a><text></text><a href="">隐私政策</a>
</view>
<view class="footer" @click="login()">
<text style="line-height: 80rpx;">登录</text>
</view>
</view>
<view class="" style="width: 80rpx;height: 80rpx;margin: auto;" @click="closebootpage()">
<image style="width: 80rpx;height: 80rpx;" src="../../static/Slice3.png" mode=""></image>
</view>
<span class="text" style="margin-top: 40rpx;"> 使用系统浏览器打开!</span>
</view>
<view class="footer" @click="closebootpage()">
<text style="line-height: 80rpx;">我知道了</text>
</view>
</view>
</template>
<script>
import api from '../../api/api';
import common from '../../common/common';
export default {
data() {
return {
agreeFlag:false,
mobile: '',
code: '',
sendCode: '获取验证码',
disabledSendBtn: false,
remainTimes:60,
}
},
methods:{
closebootpage(){
this.$emit('close')
mounted() {
console.log(this.orderId, 222)
},
methods: {
sendMessage(){
const params = {
mobileNo:this.mobile,
type:"1"
}
if(common.mobileNoValid(this.mobile) && !this.disabledSendBtn){
api.verificationCode(params).then((res)=>{
if(res['success']){
this.delayTime()
}
})
}else{
common.errorDialog(2,'手机号校验错误')
}
},
delayTime() {
this.disabledSendBtn = true;
this.timer = setInterval(() => {
this.remainTimes--;
this.sendCode = `${this.remainTimes}(S)`;
if (this.remainTimes <= 0) {
this.sendCode = '获取验证码';
this.remainTimes = 60;
this.disabledSendBtn = false;
clearInterval(this.timer);
}
}, 1000);
},
login(){
if(this.mobile =='' ||this.mobile == null ){
uni.showToast({
title: '请输入手机号',
duration: 2000,
icon: 'none'
});
return false
}
if(this.code =='' ||this.code == null ){
uni.showToast({
title: '请输入验证码',
duration: 2000,
icon: 'none'
});
return false
}
if(this.agreeFlag == false) {
uni.showToast({
title: '请阅读并勾选银盾保险经纪服务协议和隐私条款',
duration: 2000,
icon: 'none'
});
return false
}
const params = {
loginType:'3',
mobile: this.mobile,
code: this.code
}
api.loginVerification(params).then((res)=>{
if(res['success']){
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1')
uni.setStorageSync('cffp_userId',this.userId);
// uni.navigateTo({
// url:'/pages/orderConfirm/orderConfirm?userId=' + this.userId
// })
this.closebootpage()
}else{
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
},
closebootpage() {
this.$emit('close', this.userId)
},
}
}
</script>
<style lang="scss">
.content-box {
position: absolute;
// left:50%;
left: 10%;
top: 20%;
width: 630rpx;
height: 500rpx;
background: #FFFFFF;
border-radius: 20rpx;
opacity: 1;
}
.inputItem {
border-bottom: 2rpx solid #CECECE;
padding: 20rpx;
}
.agree {
font-size: 28rpx;
color: #666;
text-align: center;
margin-top: 40rpx;
a {
color: #20279B;
text-decoration: none;
}
}
.login-code {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #CECECE;
padding: 20rpx;
.grey {
font-size: 28rpx;
color: #CECECE;
}
}
.content {
position: fixed;
width: 100vw;
......@@ -60,12 +190,6 @@
transition: .2s;
background-color: rgba(36, 36, 36, 0.5);
z-index: 999;
.header {
// float:right;
width: 200rpx;
height: 120rpx;
}
}
.text {
......@@ -74,15 +198,16 @@
color: #FFFFFF;
font-size: 36rpx;
}
.footer{
width: 200rpx;
.footer {
width: 400rpx;
height: 80rpx;
border-radius: 66rpx 66rpx 66rpx 66rpx;
background: #20279B;
border-radius: 80rpx;
opacity: 1;
margin: 60rpx auto;
display: flex;
justify-content: center;
color: #FFFFFF;
border: 2rpx solid #FFFFFF;
text-align: center;
margin: auto;
margin-top: 60rpx;
}
</style>
......@@ -94,7 +94,7 @@
doublePassword:null,
agreeFlag:false,
userId:null,
imgSrc:'../../static/cffp_logo.jpg'
imgSrc:'../../static/cffp_logo.png'
}
},
methods: {
......
......@@ -2,27 +2,28 @@
<view class="container">
<view class="shareheader" style="">
<view class="iconfont icon-youjiantou" @click="goBack()">
<view class="iconfont icon-youjiantou" @click="goBack()">
</view>
<view class="share-entrance">
<view class="share-entrance" v-if="coursesharing != 1">
<view style="z-index: 99999;">
<uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true' @change="maskClick">
<uni-popup-share @select="sharechange" ></uni-popup-share>
<uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true'
@change="maskClick">
<uni-popup-share @select="sharechange"></uni-popup-share>
</uni-popup>
</view>
<!-- <img @click="reinvite" src="../../static/fastentry/Slice122.png" alt="">
<img @click="shareToggle" src="../../static/fastentry/Slice12.png" alt=""> -->
<view class="" style="width: 50rpx;height: 50rpx;padding-right: 20rpx;">
<image class="image" @click="reinvite" src="../../static/fastentry/Slice122.png" mode="" ></image>
</view>
<view class="" style="width: 50rpx;height: 50rpx; ">
<image class="image" @click="shareToggle" src="../../static/fastentry/Slice12.png" mode=""></image>
</view>
<view class="" style="width: 50rpx;height: 50rpx;padding-right: 20rpx;">
<image class="image" @click="reinvite" src="../../static/fastentry/Slice122.png" mode=""></image>
</view>
<view class="" style="width: 50rpx;height: 50rpx; ">
<image class="image" @click="shareToggle" src="../../static/fastentry/Slice12.png" mode=""></image>
</view>
</view>
</view>
<!-- 课程banner图 -->
<!-- v-show="!sliceshare" -->
<!-- v-show="!sliceshare" -->
<view class="courseBannerBox" v-show="!sliceshare">
<video id="myVideo" :src="courseInfo.filePathOss" :initial-time="videoPlaybackInfo.maxViewTime"
object-fit="contain" class="videoBox" :poster="courseInfo.fileFirstImage" :title="courseInfo.fileTitle"
......@@ -34,8 +35,13 @@
<view class="courseTitle">
<h4>{{courseInfo.fileTitle}}</h4>
<view class="shareF">
<view></view>
<!-- <view>送好友</view> -->
<!-- <view></view> -->
<view class="awakenApp" @click="jumpapp()" v-if="coursesharing == 1">
<view class="" style="width: 50rpx; height: 50rpx;">
<image style="width: 50rpx; height: 50rpx;" src="../../static/Slice117.png" mode=""></image>
</view>
<text>唤醒App</text>
</view>
</view>
</view>
<view class="dataBox">
......@@ -43,7 +49,9 @@
<text v-if="courseInfo.status==2" style="color: #F15A1F;margin-right: 20rpx;"><i
class="iconfont icon-yifukuan"></i>已购</text>
<text>{{courseInfo.salesNumber}}人购买</text>
</view>
</view>
<!-- 课程介绍,相关课程,讲师 -->
<view class="courseProBox">
......@@ -92,7 +100,8 @@
<p><text class="lecturerName">{{lecturerInfo.lecturerName}}</text></p>
<template v-if="lecturerInfo?.lecturerRankNames">
<p v-for="item in lecturerInfo.lecturerRankNames.split(',')" class="lecturerTitle">
<text>{{item}}</text></p>
<text>{{item}}</text>
</p>
</template>
</view>
</view>
......@@ -107,17 +116,20 @@
</view>
</view>
</view>
<uni-share-wx ref="sharewx"></uni-share-wx>>
<boot-page v-if="sharelogin" ref="sharelogin" @close="close"></boot-page>
<uni-share-wx ref="sharewx"></uni-share-wx>
</view>
</template>
<script>
import api from "../../api/api";
import BootPage from "@/components/bootpage/bootpage.vue";
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import dataHandling from "@/util/dataHandling";
export default {
components:{
UniShareWx
components: {
UniShareWx,
BootPage
},
data() {
return {
......@@ -145,24 +157,46 @@
sliceshare: false,
nonRequiredCount: 0,
requiredCount: 0,
realName: ''
realName: '',
coursesharing: null,
sharelogin: false
};
},
methods: {
close(val) {
console.log(val, 54812)
if (val) {
this.sharelogin = false
uni.setStorageSync('cffp_userId', val)
this.jumppurchase()
} else {
this.sharelogin = false
}
},
jumpapp() {
let platform = uni.getSystemInfoSync().platform
if (platform == 'ios') {
window.open("https://mdev.zuihuibi.cn/cffp");
} else if (platform == 'android') {
window.open("https://mdev.zuihuibi.cn/cffp");
}
},
goBack() {
uni.navigateBack(1)
},
// 监听空白关闭
maskClick(val){
maskClick(val) {
this.sliceshare = val.show
},
// 打开微信分享啊
reinvite() {
let dataWXform = {
href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId + '&userId=' + this.userId,
title: "CFFP课程分享",
summary: `立即开启学习之旅`,
imageUrl: this.courseInfo.fileFirstImage,
href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1',
title: this.courseInfo.fileTitle,
summary: `加入我们开启学习之旅`,
imageUrl: this.courseInfo.displayImage,
}
this.$refs.sharewx.open(dataWXform)
},
......@@ -170,13 +204,13 @@
this.sliceshare = true
this.$refs.share.open()
},
sharechange(val){
sharechange(val) {
console.log(val, 423)
uni.navigateTo({
url:val.item.link
url: val.item.link
})
},
// 订单保存
saveOrder() {
if (this.loginType === 'visitor') {
......@@ -184,32 +218,39 @@
url: '/components/login/login'
})
} else {
const param = {
productType: '1',
productId: this.courseInfo.fileId,
userId: this.userId,
shareUserId: this.shareUserId,
shareReadId: this.shareReadId,
shareCode: this.shareCode,
dataSource: this.dataSource
if (this.coursesharing == 1) {
this.sharelogin = true
} else {
this.jumppurchase()
}
api.saveOrder(param).then(res => {
if (res['success']) {
this.orderId = res['data']['id'];
uni.navigateTo({
url: `/pages/orderConfirm/orderConfirm?fileId=${this.fileId}&orderId=${this.orderId}`
})
} else {
uni.showToast({
title: res['message'],
duration: 2000
});
return;
}
})
}
},
jumppurchase() {
const param = {
productType: '1',
productId: this.courseInfo.fileId,
userId: this.userId,
shareUserId: this.shareUserId,
shareReadId: this.shareReadId,
shareCode: this.shareCode,
dataSource: this.dataSource
}
api.saveOrder(param).then(res => {
if (res['success']) {
this.orderId = res['data']['id'];
uni.navigateTo({
url: `/pages/orderConfirm/orderConfirm?fileId=${this.fileId}&orderId=${this.orderId}`
})
} else {
uni.showToast({
title: res['message'],
duration: 2000
});
return;
}
})
},
// 切换tab
switchTab(type) {
this.tabType = type;
......@@ -380,8 +421,8 @@
},
onLoad(option) {
this.fileId = option.fileId;
if(option.userId){
this.userId = option.userId
if (option.coursesharing) {
this.coursesharing = option.coursesharing
}
let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName
......@@ -411,6 +452,7 @@
display: flex;
justify-content: center;
z-index: 1;
.videoBox {
max-width: 100%;
height: 100%;
......@@ -421,7 +463,7 @@
height: 150rpx;
background-color: #fff;
margin-bottom: 10rpx;
padding: 20rpx 30rpx;
padding: 20rpx 0rpx 20rpx 30rpx;
box-sizing: border-box;
.courseTitle {
......@@ -448,23 +490,37 @@
}
}
.awakenApp {
display: flex;
align-items: center;
border-top-left-radius: 30rpx;
border-bottom-left-radius: 30rpx;
padding-left: 10rpx;
color: #fff;
height: 60rpx;
background: #20269B;
}
.shareheader {
display: flex;
justify-content: space-between;
align-items: center;
height: 60rpx;
.icon-youjiantou{
.icon-youjiantou {
display: inline-block;
transform: rotate(180deg);
font-size: 30rpx;
z-index: 1;
}
.share-entrance{
.share-entrance {
width: 120rpx;
display: flex;
justify-content: space-between;
align-items: center;
.image{
.image {
width: 50rpx;
height: 50rpx;
margin-top: 10rpx;
......
......@@ -185,6 +185,7 @@
border-bottom: 1px solid #CECECE;
padding: 20rpx;
.grey{
font-size: 28rpx;
color: #CECECE;
}
}
......
......@@ -184,7 +184,6 @@
},
userStudyTime(){
api.userStudyTime({userId:this.userId,month:this.month}).then(res=>{
console.log(res, 2555)
if(res['success']){
this.userStudyTimeList = res['data']['studyInfos'];
this.$nextTick(() => {
......@@ -383,6 +382,7 @@
background-color: #fff;
margin-top: 20rpx;
.calendarBox{
height: 400rpx;
margin: 20rpx;
box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.1);
border-radius: 10rpx;
......
......@@ -3,7 +3,7 @@
<!-- 课程详情 -->
<template v-if="courseInfoItem">
<view class="courseItemBox">
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle" :summaryBox="courseInfoItem.fileSynopsis" :dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}" :fileLecturerId="courseInfoItem.fileLecturerId"></course-item>
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle" :summaryBox="courseInfoItem.fileSynopsis" :dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}" :fileLecturerId="courseInfoItem.fileLecturerId" :fileId="fileId"></course-item>
</view>
</template>
<!-- 价格明细 -->
......@@ -270,6 +270,9 @@
onLoad(option){
this.fileId = option.fileId;
this.orderId = option.orderId;
if(option.userId){
this.userId = option.userId
}
this.courseDetail();
this.queryByUserIdFortuneStatistic()
console.log(option)
......
......@@ -48,21 +48,43 @@
},
uniShare(type) {
// if (type === 1) {
uni.share({
provider: "weixin",
scene: type === 1? "WXSceneSession":"WXSceneTimeline",
type: 0,
href: this.WXdata.href,
title: this.WXdata.title,
summary: this.WXdata.summary,
imageUrl: this.WXdata.imageUrl,
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
let that = this;
//获取图片后压缩
uni.downloadFile({
url: that.WXdata.imageUrl,
success: function(images) {
console.log(images, 1147474)
uni.compressImage({
src: images.tempFilePath,
quality: 20,
width: '60%',
height: '60%',
success: (res) => {
console.log('ok--->' + res.tempFilePath);
that.WXdata.tempImg = res.tempFilePath;
uni.share({
provider: "weixin",
scene: type === 1? "WXSceneSession":"WXSceneTimeline",
type: 0,
href: that.WXdata.href,
title: that.WXdata.title,
summary: that.WXdata.summary,
imageUrl: that.WXdata.tempImg,
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
}
})
},
fail(error) {
uni.hideLoading();
}
})
},
}
}
......
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