Commit 8d5dc264 by sunerhu

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

parent 628aa826
<template> <template>
<view class="content"> <view class="content">
<view class="" style="display: flex;justify-content: space-between;"> <view class="content-box">
<view class="" style=""> <view style="margin: 20rpx;">
<view class="inputItem">
<input class="uni-input" name="invitationCode" placeholder="输入手机号" v-model="mobile" />
</view> </view>
<view class="header"> <view class="login-code">
<image style="width: 180rpx; <input name="form.code" placeholder="输入验证码" v-model="code" type="number" maxlength="6" />
height: 120rpx;" src="../../static/Group132.png" mode=""></image> <text @click="sendMessage()" :class="{'grey':disabledSendBtn}">{{sendCode}}</text>
</view> </view>
<!-- <view class=""> <view class="agree">
<image src="../../static/bo" mode=""></image> <label class="radio" style="padding-right: 10rpx;">
</view> --> <radio :checked="agreeFlag" @click="agreeFlag=!agreeFlag" />
</label>
<text>已阅读并同意</text><a href="#">银盾保险经纪服务协议</a><text></text><a href="">隐私政策</a>
</view> </view>
<view class="footer" @click="login()">
<view class="" style="text-align: center;"> <text style="line-height: 80rpx;">登录</text>
<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> </view>
<span class="text">按钮,</span>
</view> </view>
<span class="text" style="margin-top: 40rpx;"> 使用系统浏览器打开!</span> <view class="" style="width: 80rpx;height: 80rpx;margin: auto;" @click="closebootpage()">
<image style="width: 80rpx;height: 80rpx;" src="../../static/Slice3.png" mode=""></image>
</view> </view>
<view class="footer" @click="closebootpage()">
<text style="line-height: 80rpx;">我知道了</text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import api from '../../api/api';
import common from '../../common/common';
export default { export default {
data() { data() {
return { return {
agreeFlag:false,
mobile: '',
code: '',
sendCode: '获取验证码',
disabledSendBtn: false,
remainTimes:60,
}
},
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'
})
}
})
}, },
methods:{ closebootpage() {
closebootpage(){ this.$emit('close', this.userId)
this.$emit('close')
}, },
} }
} }
</script> </script>
<style lang="scss"> <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 { .content {
position: fixed; position: fixed;
width: 100vw; width: 100vw;
...@@ -60,12 +190,6 @@ ...@@ -60,12 +190,6 @@
transition: .2s; transition: .2s;
background-color: rgba(36, 36, 36, 0.5); background-color: rgba(36, 36, 36, 0.5);
z-index: 999; z-index: 999;
.header {
// float:right;
width: 200rpx;
height: 120rpx;
}
} }
.text { .text {
...@@ -74,15 +198,16 @@ ...@@ -74,15 +198,16 @@
color: #FFFFFF; color: #FFFFFF;
font-size: 36rpx; font-size: 36rpx;
} }
.footer{
width: 200rpx; .footer {
width: 400rpx;
height: 80rpx; height: 80rpx;
border-radius: 66rpx 66rpx 66rpx 66rpx; background: #20279B;
border-radius: 80rpx;
opacity: 1; opacity: 1;
margin: 60rpx auto;
display: flex;
justify-content: center;
color: #FFFFFF; color: #FFFFFF;
border: 2rpx solid #FFFFFF;
text-align: center;
margin: auto;
margin-top: 60rpx;
} }
</style> </style>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
doublePassword:null, doublePassword:null,
agreeFlag:false, agreeFlag:false,
userId:null, userId:null,
imgSrc:'../../static/cffp_logo.jpg' imgSrc:'../../static/cffp_logo.png'
} }
}, },
methods: { methods: {
......
...@@ -4,16 +4,17 @@ ...@@ -4,16 +4,17 @@
<view class="shareheader" style=""> <view class="shareheader" style="">
<view class="iconfont icon-youjiantou" @click="goBack()"> <view class="iconfont icon-youjiantou" @click="goBack()">
</view> </view>
<view class="share-entrance"> <view class="share-entrance" v-if="coursesharing != 1">
<view style="z-index: 99999;"> <view style="z-index: 99999;">
<uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true' @change="maskClick"> <uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true'
<uni-popup-share @select="sharechange" ></uni-popup-share> @change="maskClick">
<uni-popup-share @select="sharechange"></uni-popup-share>
</uni-popup> </uni-popup>
</view> </view>
<!-- <img @click="reinvite" src="../../static/fastentry/Slice122.png" alt=""> <!-- <img @click="reinvite" src="../../static/fastentry/Slice122.png" alt="">
<img @click="shareToggle" src="../../static/fastentry/Slice12.png" alt=""> --> <img @click="shareToggle" src="../../static/fastentry/Slice12.png" alt=""> -->
<view class="" style="width: 50rpx;height: 50rpx;padding-right: 20rpx;"> <view class="" style="width: 50rpx;height: 50rpx;padding-right: 20rpx;">
<image class="image" @click="reinvite" src="../../static/fastentry/Slice122.png" mode="" ></image> <image class="image" @click="reinvite" src="../../static/fastentry/Slice122.png" mode=""></image>
</view> </view>
<view class="" style="width: 50rpx;height: 50rpx; "> <view class="" style="width: 50rpx;height: 50rpx; ">
...@@ -34,8 +35,13 @@ ...@@ -34,8 +35,13 @@
<view class="courseTitle"> <view class="courseTitle">
<h4>{{courseInfo.fileTitle}}</h4> <h4>{{courseInfo.fileTitle}}</h4>
<view class="shareF"> <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> </view>
<view class="dataBox"> <view class="dataBox">
...@@ -43,7 +49,9 @@ ...@@ -43,7 +49,9 @@
<text v-if="courseInfo.status==2" style="color: #F15A1F;margin-right: 20rpx;"><i <text v-if="courseInfo.status==2" style="color: #F15A1F;margin-right: 20rpx;"><i
class="iconfont icon-yifukuan"></i>已购</text> class="iconfont icon-yifukuan"></i>已购</text>
<text>{{courseInfo.salesNumber}}人购买</text> <text>{{courseInfo.salesNumber}}人购买</text>
</view> </view>
</view> </view>
<!-- 课程介绍,相关课程,讲师 --> <!-- 课程介绍,相关课程,讲师 -->
<view class="courseProBox"> <view class="courseProBox">
...@@ -92,7 +100,8 @@ ...@@ -92,7 +100,8 @@
<p><text class="lecturerName">{{lecturerInfo.lecturerName}}</text></p> <p><text class="lecturerName">{{lecturerInfo.lecturerName}}</text></p>
<template v-if="lecturerInfo?.lecturerRankNames"> <template v-if="lecturerInfo?.lecturerRankNames">
<p v-for="item in lecturerInfo.lecturerRankNames.split(',')" class="lecturerTitle"> <p v-for="item in lecturerInfo.lecturerRankNames.split(',')" class="lecturerTitle">
<text>{{item}}</text></p> <text>{{item}}</text>
</p>
</template> </template>
</view> </view>
</view> </view>
...@@ -107,17 +116,20 @@ ...@@ -107,17 +116,20 @@
</view> </view>
</view> </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> </view>
</template> </template>
<script> <script>
import api from "../../api/api"; import api from "../../api/api";
import BootPage from "@/components/bootpage/bootpage.vue";
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue"; import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import dataHandling from "@/util/dataHandling"; import dataHandling from "@/util/dataHandling";
export default { export default {
components:{ components: {
UniShareWx UniShareWx,
BootPage
}, },
data() { data() {
return { return {
...@@ -145,24 +157,46 @@ ...@@ -145,24 +157,46 @@
sliceshare: false, sliceshare: false,
nonRequiredCount: 0, nonRequiredCount: 0,
requiredCount: 0, requiredCount: 0,
realName: '' realName: '',
coursesharing: null,
sharelogin: false
}; };
}, },
methods: { 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() { goBack() {
uni.navigateBack(1) uni.navigateBack(1)
}, },
// 监听空白关闭 // 监听空白关闭
maskClick(val){ maskClick(val) {
this.sliceshare = val.show this.sliceshare = val.show
}, },
// 打开微信分享啊 // 打开微信分享啊
reinvite() { reinvite() {
let dataWXform = { let dataWXform = {
href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId + '&userId=' + this.userId, href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
title: "CFFP课程分享", '&coursesharing=1',
summary: `立即开启学习之旅`, title: this.courseInfo.fileTitle,
imageUrl: this.courseInfo.fileFirstImage, summary: `加入我们开启学习之旅`,
imageUrl: this.courseInfo.displayImage,
} }
this.$refs.sharewx.open(dataWXform) this.$refs.sharewx.open(dataWXform)
}, },
...@@ -170,10 +204,10 @@ ...@@ -170,10 +204,10 @@
this.sliceshare = true this.sliceshare = true
this.$refs.share.open() this.$refs.share.open()
}, },
sharechange(val){ sharechange(val) {
console.log(val, 423) console.log(val, 423)
uni.navigateTo({ uni.navigateTo({
url:val.item.link url: val.item.link
}) })
}, },
...@@ -184,6 +218,15 @@ ...@@ -184,6 +218,15 @@
url: '/components/login/login' url: '/components/login/login'
}) })
} else { } else {
if (this.coursesharing == 1) {
this.sharelogin = true
} else {
this.jumppurchase()
}
}
},
jumppurchase() {
const param = { const param = {
productType: '1', productType: '1',
productId: this.courseInfo.fileId, productId: this.courseInfo.fileId,
...@@ -207,8 +250,6 @@ ...@@ -207,8 +250,6 @@
return; return;
} }
}) })
}
}, },
// 切换tab // 切换tab
switchTab(type) { switchTab(type) {
...@@ -380,8 +421,8 @@ ...@@ -380,8 +421,8 @@
}, },
onLoad(option) { onLoad(option) {
this.fileId = option.fileId; this.fileId = option.fileId;
if(option.userId){ if (option.coursesharing) {
this.userId = option.userId this.coursesharing = option.coursesharing
} }
let dataForm = uni.getStorageSync('userinfodataForm') let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName this.realName = dataForm.realName
...@@ -411,6 +452,7 @@ ...@@ -411,6 +452,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
z-index: 1; z-index: 1;
.videoBox { .videoBox {
max-width: 100%; max-width: 100%;
height: 100%; height: 100%;
...@@ -421,7 +463,7 @@ ...@@ -421,7 +463,7 @@
height: 150rpx; height: 150rpx;
background-color: #fff; background-color: #fff;
margin-bottom: 10rpx; margin-bottom: 10rpx;
padding: 20rpx 30rpx; padding: 20rpx 0rpx 20rpx 30rpx;
box-sizing: border-box; box-sizing: border-box;
.courseTitle { .courseTitle {
...@@ -448,23 +490,37 @@ ...@@ -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 { .shareheader {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 60rpx; height: 60rpx;
.icon-youjiantou{
.icon-youjiantou {
display: inline-block; display: inline-block;
transform: rotate(180deg); transform: rotate(180deg);
font-size: 30rpx; font-size: 30rpx;
z-index: 1; z-index: 1;
} }
.share-entrance{
.share-entrance {
width: 120rpx; width: 120rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.image{
.image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
margin-top: 10rpx; margin-top: 10rpx;
......
...@@ -185,6 +185,7 @@ ...@@ -185,6 +185,7 @@
border-bottom: 1px solid #CECECE; border-bottom: 1px solid #CECECE;
padding: 20rpx; padding: 20rpx;
.grey{ .grey{
font-size: 28rpx;
color: #CECECE; color: #CECECE;
} }
} }
......
...@@ -184,7 +184,6 @@ ...@@ -184,7 +184,6 @@
}, },
userStudyTime(){ userStudyTime(){
api.userStudyTime({userId:this.userId,month:this.month}).then(res=>{ api.userStudyTime({userId:this.userId,month:this.month}).then(res=>{
console.log(res, 2555)
if(res['success']){ if(res['success']){
this.userStudyTimeList = res['data']['studyInfos']; this.userStudyTimeList = res['data']['studyInfos'];
this.$nextTick(() => { this.$nextTick(() => {
...@@ -383,6 +382,7 @@ ...@@ -383,6 +382,7 @@
background-color: #fff; background-color: #fff;
margin-top: 20rpx; margin-top: 20rpx;
.calendarBox{ .calendarBox{
height: 400rpx;
margin: 20rpx; margin: 20rpx;
box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.1); box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.1);
border-radius: 10rpx; border-radius: 10rpx;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 课程详情 --> <!-- 课程详情 -->
<template v-if="courseInfoItem"> <template v-if="courseInfoItem">
<view class="courseItemBox"> <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> </view>
</template> </template>
<!-- 价格明细 --> <!-- 价格明细 -->
...@@ -270,6 +270,9 @@ ...@@ -270,6 +270,9 @@
onLoad(option){ onLoad(option){
this.fileId = option.fileId; this.fileId = option.fileId;
this.orderId = option.orderId; this.orderId = option.orderId;
if(option.userId){
this.userId = option.userId
}
this.courseDetail(); this.courseDetail();
this.queryByUserIdFortuneStatistic() this.queryByUserIdFortuneStatistic()
console.log(option) console.log(option)
......
...@@ -48,14 +48,29 @@ ...@@ -48,14 +48,29 @@
}, },
uniShare(type) { uniShare(type) {
// if (type === 1) { // if (type === 1) {
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({ uni.share({
provider: "weixin", provider: "weixin",
scene: type === 1? "WXSceneSession":"WXSceneTimeline", scene: type === 1? "WXSceneSession":"WXSceneTimeline",
type: 0, type: 0,
href: this.WXdata.href, href: that.WXdata.href,
title: this.WXdata.title, title: that.WXdata.title,
summary: this.WXdata.summary, summary: that.WXdata.summary,
imageUrl: this.WXdata.imageUrl, imageUrl: that.WXdata.tempImg,
success: function(res) { success: function(res) {
console.log("success:" + JSON.stringify(res)); console.log("success:" + JSON.stringify(res));
}, },
...@@ -63,6 +78,13 @@ ...@@ -63,6 +78,13 @@
console.log("fail:" + JSON.stringify(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