Commit 8019c5a5 by sunerhu

1.分享记录接口对接。

parent cf54edf2
...@@ -296,5 +296,13 @@ export default { ...@@ -296,5 +296,13 @@ export default {
// 账号注销 // 账号注销
cancellation(params){ cancellation(params){
return request(`${apiURL}/cffp/user/cancellation`, "POST", params) return request(`${apiURL}/cffp/user/cancellation`, "POST", params)
},
// 用户分享
userShare(params){
return request(`${apiURL}/cffp/share/userShare`, "POST", params)
},
// 用户阅读
userRead(params){
return request(`${apiURL}/cffp/share/userRead`, "POST", params)
} }
} }
<template> <template>
<view class="content"> <view class="content">
<view class="content-box"> <view class="content-box">
<view style="margin: 20rpx;"> <view style="margin: 40rpx 30rpx;">
<view class="inputItem"> <view class="inputItem">
<input class="uni-input" name="invitationCode" placeholder="输入手机号" v-model="mobile" /> <input class="uni-input" name="invitationCode" maxlength="11" placeholder="输入手机号" v-model="mobile" />
</view> </view>
<view class="login-code"> <view class="login-code">
<input name="form.code" placeholder="输入验证码" v-model="code" type="number" maxlength="6" /> <input name="form.code" placeholder="输入验证码" v-model="code" type="number" maxlength="6" />
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
sendCode: '获取验证码', sendCode: '获取验证码',
disabledSendBtn: false, disabledSendBtn: false,
remainTimes:60, remainTimes:60,
userId:''
} }
}, },
mounted() { mounted() {
...@@ -111,7 +112,6 @@ ...@@ -111,7 +112,6 @@
if(res['success']){ if(res['success']){
this.userId = String(res['data']['userId']); this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1') uni.setStorageSync('isLogin','1')
uni.setStorageSync('cffp_userId',this.userId);
// uni.navigateTo({ // uni.navigateTo({
// url:'/pages/orderConfirm/orderConfirm?userId=' + this.userId // url:'/pages/orderConfirm/orderConfirm?userId=' + this.userId
// }) // })
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
padding: 20rpx; padding: 20rpx;
.grey { .grey {
font-size: 28rpx; font-size: 24rpx;
color: #CECECE; color: #CECECE;
} }
} }
......
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
<!-- :class="`padding-left-${item.level * 5 + 10}`"--> <!-- :class="`padding-left-${item.level * 5 + 10}`"-->
<view class="d-td" > <view class="d-td" >
<view class="" style="display: flex;"> <view class="" style="display: flex;">
<view class=""> <view class="" >
<uni-icons <uni-icons
v-if="item.hasChildren" v-if="item.hasChildren && !treeList[0]"
:type="checkLazy(item.id) ? 'spinner-cycle' : !checkOpen(item.id) ? 'arrowright' : 'arrowdown'" :type="checkLazy(item.id) ? 'spinner-cycle' : !checkOpen(item.id) ? 'arrowright' : 'arrowdown'"
size="12" size="12"
></uni-icons> ></uni-icons>
</view> </view>
<view @click="open(item, i)" v-if="item.level && !item.hasChildren" style="width: 24rpx;height: 26rpx;display: inline-block;"></view> <view @click="open(item, i)" v-if="item.level && !item.hasChildren" style="width: 24rpx;height: 26rpx;display: inline-block;"></view>
...@@ -77,6 +76,9 @@ export default { ...@@ -77,6 +76,9 @@ export default {
type: Array, type: Array,
default: null default: null
}, },
type: {
type: String,
}
}, },
name: 'lazy-tree', name: 'lazy-tree',
mounted() { mounted() {
...@@ -177,7 +179,9 @@ export default { ...@@ -177,7 +179,9 @@ export default {
this.openList = list; this.openList = list;
}, },
async open(item, index) { async open(item, index) {
console.log(item, 11410) if(index == 0 && this.type == 1){
return false
}
try { try {
if (this.checkLazy(item.id)) return; if (this.checkLazy(item.id)) return;
if (!this.checkOpen(item.id)) { if (!this.checkOpen(item.id)) {
......
{ {
"name": "日期区间picker", "name": "日期区间picker",
"version": "1.0.7", "version": "1.0.7",
"lockfileVersion": 1, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": {
"": {
"name": "日期区间picker",
"version": "1.0.7",
"dependencies": {
"nanoid": "^4.0.0",
"vue-signature-pad": "^3.0.2"
}
},
"node_modules/merge-images": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/merge-images/-/merge-images-1.2.0.tgz",
"integrity": "sha512-hEGvgnTdXr08uzGvEArxRsKpy7WmozM73YaSi4s5IYF4LxrhANpqfHaz9CgBZ5+0+s2NsjPnPdStz3aCc0Yulw=="
},
"node_modules/nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==",
"bin": {
"nanoid": "bin/nanoid.js"
},
"engines": {
"node": "^14 || ^16 || >=18"
}
},
"node_modules/signature_pad": {
"version": "3.0.0-beta.4",
"resolved": "https://registry.npmmirror.com/signature_pad/-/signature_pad-3.0.0-beta.4.tgz",
"integrity": "sha512-cOf2NhVuTiuNqe2X/ycEmizvCDXk0DoemhsEpnkcGnA4kS5iJYTCqZ9As7tFBbsch45Q1EdX61833+6sjJ8rrw=="
},
"node_modules/vue-signature-pad": {
"version": "3.0.2",
"resolved": "https://registry.npmmirror.com/vue-signature-pad/-/vue-signature-pad-3.0.2.tgz",
"integrity": "sha512-o25o+lROfCmzASS2+fU8ZV801kV+D4/02zkZ+ez3NKeiUmbxW7kwlUf5oKQkvA+l7Ou9xGsGLsirBLch3jyX8A==",
"dependencies": {
"merge-images": "^1.1.0",
"signature_pad": "^3.0.0-beta.3"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"vue": "^3.2.0"
}
}
},
"dependencies": { "dependencies": {
"merge-images": { "merge-images": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmmirror.com/merge-images/-/merge-images-1.2.0.tgz", "resolved": "https://registry.npmmirror.com/merge-images/-/merge-images-1.2.0.tgz",
"integrity": "sha512-hEGvgnTdXr08uzGvEArxRsKpy7WmozM73YaSi4s5IYF4LxrhANpqfHaz9CgBZ5+0+s2NsjPnPdStz3aCc0Yulw==" "integrity": "sha512-hEGvgnTdXr08uzGvEArxRsKpy7WmozM73YaSi4s5IYF4LxrhANpqfHaz9CgBZ5+0+s2NsjPnPdStz3aCc0Yulw=="
}, },
"nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg=="
},
"signature_pad": { "signature_pad": {
"version": "3.0.0-beta.4", "version": "3.0.0-beta.4",
"resolved": "https://registry.npmmirror.com/signature_pad/-/signature_pad-3.0.0-beta.4.tgz", "resolved": "https://registry.npmmirror.com/signature_pad/-/signature_pad-3.0.0-beta.4.tgz",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
] ]
}, },
"dependencies": { "dependencies": {
"nanoid": "^4.0.0",
"vue-signature-pad": "^3.0.2" "vue-signature-pad": "^3.0.2"
} }
} }
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
}, },
onsubmit() { onsubmit() {
this.loading = true this.loading = true
this.openForm.userIdType = this.openForm.userIdType?this.openForm.userIdType:'1'
let requestVo = this.openForm let requestVo = this.openForm
// header:{ // header:{
// 'content-type': 'application/json', // 'content-type': 'application/json',
......
<template> <template>
<view class="container"> <view class="container">
<view class="shareheader" style=""> <!-- <view class="" v-if="coursesharing == 1" style="padding: 0;">
</view> -->
<view class="shareheader" style="" v-if="coursesharing != 1">
<view class="iconfont icon-youjiantou" @click="goBack()"> <view class="iconfont icon-youjiantou" @click="goBack()">
</view> </view>
<view class="share-entrance" v-if="coursesharing != 1"> <view class="share-entrance">
<view style="z-index: 99999;"> <view style="z-index: 99999;">
<uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true' <uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true'
@change="maskClick"> @change="maskClick">
...@@ -126,6 +128,9 @@ ...@@ -126,6 +128,9 @@
import BootPage from "@/components/bootpage/bootpage.vue"; 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";
import {
nanoid
} from 'nanoid';
export default { export default {
components: { components: {
UniShareWx, UniShareWx,
...@@ -159,16 +164,21 @@ ...@@ -159,16 +164,21 @@
requiredCount: 0, requiredCount: 0,
realName: '', realName: '',
coursesharing: null, coursesharing: null,
serialsNo: null,
shareCode: null,
sharelogin: false sharelogin: false
}; };
}, },
methods: { methods: {
close(val) { close(val) {
console.log(val, 54812) console.log(val, 558)
if (val) { if (val) {
this.sharelogin = false this.sharelogin = false
uni.setStorageSync('cffp_userId', val) this.userId = val
uni.setStorageSync('cffp_userId', this.userId);
this.coursesharing = null
this.jumppurchase() this.jumppurchase()
this.getuserRead()
} else { } else {
this.sharelogin = false this.sharelogin = false
} }
...@@ -177,7 +187,17 @@ ...@@ -177,7 +187,17 @@
jumpapp() { jumpapp() {
let platform = uni.getSystemInfoSync().platform let platform = uni.getSystemInfoSync().platform
if (platform == 'ios') { if (platform == 'ios') {
var loadDateTime = new Date();
window.location.href = "https://mcffp.anjibao.cn/app/"; window.location.href = "https://mcffp.anjibao.cn/app/";
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 5000) {
window.location = "http://baidu.com"; //ios下载地址
} else {
}
}, 500);
} else if (platform == 'android') { } else if (platform == 'android') {
window.open('cffpapp://'); window.open('cffpapp://');
} }
...@@ -191,12 +211,15 @@ ...@@ -191,12 +211,15 @@
}, },
// 打开微信分享啊 // 打开微信分享啊
reinvite() { reinvite() {
const shareCode = nanoid() + this.userId
let dataWXform = { let dataWXform = {
href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId + href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1', '&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode,
title: this.courseInfo.fileTitle, title: this.courseInfo.fileTitle,
summary: `加入我们开启学习之旅`, summary: `加入我们开启学习之旅`,
imageUrl: this.courseInfo.displayImage, imageUrl: this.courseInfo.displayImage,
fileId: this.fileId,
shareCode: shareCode
} }
this.$refs.sharewx.open(dataWXform) this.$refs.sharewx.open(dataWXform)
}, },
...@@ -419,18 +442,39 @@ ...@@ -419,18 +442,39 @@
this.videoContext.seek(0); this.videoContext.seek(0);
} }
} }
},
// 用户阅读
getuserRead(){
let UserReadRequestVO = {
userId: this.userId?this.userId:'',
serialsNo: this.serialsNo || 1,
shareCode: this.shareCode || 1,
shareUrl: window.location.href
}
api.userRead(UserReadRequestVO).then(res =>{
if (res['success']) {
uni.showToast({
title: '阅读成功',
duration: 2000
});
}
})
} }
}, },
onLoad(option) { onLoad(option) {
this.fileId = option.fileId; this.fileId = option.fileId;
if (option.coursesharing) { if (option.coursesharing) {
this.userId = ''
this.coursesharing = option.coursesharing this.coursesharing = option.coursesharing
this.serialsNo = option.serialsNo
this.shareCode = option.shareCode
this.getuserRead()
} }
let dataForm = uni.getStorageSync('userinfodataForm') let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName this.realName = dataForm.realName
// this.switchTab(1); // this.switchTab(1);
}, },
mounted() { onShow() {
this.switchTab(1); this.switchTab(1);
this.loginType = uni.getStorageSync('loginType') this.loginType = uni.getStorageSync('loginType')
}, },
...@@ -447,9 +491,13 @@ ...@@ -447,9 +491,13 @@
</script> </script>
<style lang="scss"> <style lang="scss">
page {
padding: 0;
}
.courseBannerBox { .courseBannerBox {
height: 300rpx; height: 300rpx;
margin-top: 20rpx; // margin-top: 20rpx;
background-color: #ebebeb; background-color: #ebebeb;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -504,10 +552,11 @@ ...@@ -504,10 +552,11 @@
} }
.shareheader { .shareheader {
padding-top: 60rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 60rpx; height: 80rpx;
.icon-youjiantou { .icon-youjiantou {
display: inline-block; display: inline-block;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<i class="iconfont icon-youjiantou"></i> <i class="iconfont icon-youjiantou"></i>
</view> </view>
</view> </view>
</view>s </view>
</view> </view>
<!-- 没有报名项目 --> <!-- 没有报名项目 -->
<view class="noSign" v-if="signupInfos.length==0"> <view class="noSign" v-if="signupInfos.length==0">
......
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
</view> </view>
</template> </template>
...@@ -154,6 +155,7 @@ ...@@ -154,6 +155,7 @@
} }
} }
}, },
methods: { methods: {
// 支付 // 支付
pay(){ pay(){
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
justify-content: space-between; justify-content: space-between;
text{ text{
&:first-child{ &:first-child{
font-size: 24rpx; font-size: 28rpx;
color: #333; color: #333;
} }
&:last-child{ &:last-child{
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
合计:{{item.rank}} 合计:{{item.rank}}
</view> </view>
<view class=""> <view class="">
<lazy-tree :datatitleList="datatitleList" :dataList="dataList" type="1"></lazy-tree> <lazy-tree :datatitleList="datatitleList" :dataList="dataList" type="2"></lazy-tree>
<!-- <myteam-table :datatitleList="datatitleList" :dataList="raiseList" type="2"></myteam-table> --> <!-- <myteam-table :datatitleList="datatitleList" :dataList="raiseList" type="2"></myteam-table> -->
<!-- <view class="table-content"> <!-- <view class="table-content">
<span>辖下组织/成员</span> <span>辖下组织/成员</span>
......
...@@ -29,62 +29,88 @@ ...@@ -29,62 +29,88 @@
</template> </template>
<script> <script>
import api from "@/api/api";
import {
nanoid
} from 'nanoid';
export default { export default {
data() { data() {
return { return {
WXdata:{} WXdata: {}
} }
}, },
methods:{ methods: {
open(option) { open(option) {
console.log(option, 155) console.log(option, 155)
this.WXdata = option this.WXdata = option
this.$refs.sharewx.open() this.$refs.sharewx.open()
this.share()
}, },
share() {
},
// 关闭微信分享啊 // 关闭微信分享啊
closeShare() { closeShare() {
this.$refs.sharewx.close() this.$refs.sharewx.close()
}, },
uniShare(type) { uniShare(type) {
// if (type === 1) { this.closeShare()
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: that.WXdata.href, href: this.WXdata.href,
title: that.WXdata.title, title: this.WXdata.title,
summary: that.WXdata.summary, summary: this.WXdata.summary,
imageUrl: that.WXdata.tempImg, imageUrl: this.WXdata.imageUrl,
success: function(res) { success: function(res) {
console.log("success:" + JSON.stringify(res)); let UserShareRequestVO = {
}, userId: uni.getStorageSync('cffp_userId'),
fail: function(err) { businessType: '1', // 分享类型
console.log("fail:" + JSON.stringify(err)); businessId: this.WXdata.fileId, // 课程Id
shareUrl: this.WXdata.href, // 分享链接
shareType: '2', // 分享类型(1:图片分享; 2:链接分享)
shareToWhere: type, //分享到哪儿(1好友 2朋友圈)
shareCode: this.WXdata.shareCode
} }
}); api.userShare(UserShareRequestVO).then(res => {
// console.log('分享成功了吗')
if (res['success']) {
// uni.showToast({
// title: '分享成功',
// duration: 2000
// });
} }
}) })
}, },
fail(error) { fail: function(err) {
uni.hideLoading(); console.log("fail:" + JSON.stringify(err));
} }
}) });
// 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;
// }
// })
// },
// fail(error) {
// uni.hideLoading();
// }
// })
// }
}, },
} }
} }
...@@ -100,6 +126,7 @@ ...@@ -100,6 +126,7 @@
align-items: center; align-items: center;
padding-top: 36rpx; padding-top: 36rpx;
} }
.popup-content { .popup-content {
font-size: 32rpx; font-size: 32rpx;
color: #666; color: #666;
......
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