This commit is contained in:
lanzhihui 2024-11-08 15:21:59 +08:00
parent 35d128f427
commit 31d6a9f499
13 changed files with 921 additions and 31 deletions

View File

@ -35,7 +35,7 @@ wepy.app({
}
},
globalData: {
versions: 'v5.5.76', // 版本号
versions: 'v5.5.77', // 版本号
navBarHeight: 0, // 导航栏高度
navRight: 0, // 胶囊距右方间距(方保持左、右间距一致)
navTop: 0, // 胶囊距顶部间距
@ -217,6 +217,7 @@ subPackages: [
'logoutDefault',
'ImageCropper',
'myDynamicDetail',
'groupMember',
]
},
{

View File

@ -412,8 +412,10 @@ scroll-view {
}
console.log(vm.from, url, type, '7777')
if (vm.from != 'dynamic' && vm.from != 'myDynamic' && type != 'vote' && vm.from != 'hotTopic') {
console.log('44---')
return
}
console.log('333--')
wx.navigateTo({url: url})
}
},

View File

@ -109,7 +109,7 @@ wepy.component({
},
success: (res) => {
if (res.statusCode === 204) {
console.log(filePathUrl, '上传成功')
console.log(filePathUrl, res, '上传成功')
let dataV2 = {
filePath: filePathUrl,
type: filePath.split('.').pop().toLowerCase()

View File

@ -0,0 +1,340 @@
<template>
<!-- 此组件为前端引用阿里云的点播视频插件,可经过鉴黄,返回video_id,以及url-->
<view class="~cu-load ~load-modal ~load-icon" v-if="loadModal">
<!-- <view>{{ progressPercent }}%</view>-->
<!-- <view class='gray-text'>加载中...</view>-->
<image src="https://image.fulllinkai.com/202207/07/e58b3d9613b86f1baa48e929337edf85.gif" mode="widthFix"
style="width: 150rpx;height: auto;"></image>
<view class="~gray-text">上传中(<span class="~bold"> {{ progressPercent }}% </span></view>
</view>
</template>
<script>
import wepy from '@wepy/core'
import {service} from '../config.js'
import https from '../mixins/https'
import base from '../mixins/base'
import VODUpload from '../mixins/aliyun-upload-sdk-1.0.3.min'
// import ShareMessage from '../mixins/ShareMessage'
wepy.component({
mixins: [base, https],
props: {
pic: {
type: String,
default: '',
twoWay: true
},
options: {
type: Object,
default: {},
twoWay: true
}
},
data: {
uploader: {},
videos: [],
loadModal: false,
progressPercent: 0,
videosCount: 9 // 最多可以选择的视频数
},
ready() {
this.getSignature()
},
methods: {
getSignature() {
let that = this
let uploader = new VODUpload({
userId: '1303984639806000',
timeout: that.options.timeout || 60000,
region: that.options.region || 'cn-shanghai',
// 添加文件成功
addFileSuccess: (uploadInfo) => {
console.log('addFileSuccess' + JSON.stringify(uploadInfo))
that.uploader.startUpload()
},
// 开始上传
onUploadstarted: function (uploadInfo) {
console.log('文件开始上传...')
console.log('onUploadStarted:' + JSON.stringify(uploadInfo))
// var url
// if (uploadInfo.isImage) {
// url = 'https://alivc-demo.aliyuncs.com/demo/getImageUploadAuth?imageType=default&imageExt=' + that._getSuffix(uploadInfo.url) + '&title=title&tags=tags'
// } else {
// url = 'https://alivc-demo.aliyuncs.com/demo/getVideoUploadAuth?title=' + uploadInfo.url + '&fileName=' + uploadInfo.url + '&fileSize=' + uploadInfo.fileSize + '&description=description&coverURL=' + uploadInfo.coverUrl + '&tags=tags'
// }
let data = {
// title: uploadInfo.url,
// fileSize: uploadInfo.fileSize,
// description: 'description',
// coverURL: uploadInfo.coverUrl,
// tags: 'tags',
file_name: uploadInfo.url
}
that.$post({
url: `${service.host}/ali/upload/video`, data
})
.then(({code, data}) => {
console.log(data, 'data====')
if (code == 0) {
console.log(data.body.VideoId)
uploader.setUploadAuthAndAddress(uploadInfo, data.body.UploadAuth, data.body.UploadAddress, data.body.VideoId)
} else {
that.$showToast('上传失败了')
uploader.stopUpload()
}
wx.hideLoading()
})
},
// 文件上传成功
onUploadSucceed: function (uploadInfo) {
console.log(JSON.stringify(uploadInfo))
console.log('文件上传成功!')
that.loadModal = false
that.getVideoUrl(uploadInfo.videoId)
},
// 文件上传失败
onUploadFailed: function (uploadInfo, code, message) {
console.log('onUploadFailed: file:' + uploadInfo.file.name + ',code:' + code + ', message:' + message)
console.log('文件上传失败!')
uploader.stopUpload()
},
// 取消文件上传
onUploadCanceled: function (uploadInfo, code, message) {
console.log(JSON.stringify(uploadInfo) + code + message)
console.log('文件已暂停上传!')
uploader.stopUpload()
},
// 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
onUploadProgress: function (uploadInfo, totalSize, progress) {
let files = []
console.log()
if (uploadInfo.isImage) {
files = that.images || []
} else {
files = that.videos || []
}
files.forEach((file, idx) => {
if (file.url === uploadInfo.url) {
file.progress = progress
if (uploadInfo.isImage) {
that.setData({
images: files
})
} else {
that.setData({
videos: files
})
}
}
})
let progressPercent = Math.ceil(progress)
console.log('文件上传中...' + progressPercent)
wx.hideLoading()
that.loadModal = true
that.progressPercent = progressPercent
},
// 上传凭证超时
onUploadTokenExpired: function (uploadInfo) {
// // 如果是上传方式二即根据 STSToken 实现时从新获取STS临时账号用于恢复上传
// // 上传文件过大时可能在上传过程中 sts token 就会失效, 所以需要在 token 过期的回调中调用 resumeUploadWithSTSToken 方法
// // 这里是测试接口, 所以我直接获取了 STSToken
// $('#status').text('文件上传超时!')
// var stsUrl = 'http://demo-vod.cn-shanghai.aliyuncs.com/voddemo/CreateSecurityToken?BusinessType=vodai&TerminalType=pc&DeviceModel=iPhone9,2&UUID=67999yyuuuy&AppVersion=1.0.0'
// $.get(stsUrl, function (data) {
// var info = data.SecurityTokenInfo
// var accessKeyId = info.AccessKeyId
// var accessKeySecret = info.AccessKeySecret
// var secretToken = info.SecurityToken
// var expiration = info.Expiration
// uploader.resumeUploadWithSTSToken(accessKeyId, accessKeySecret, secretToken, expiration)
// }, 'json')
},
// 全部文件上传结束
onUploadEnd: (uploadInfo) => {
console.log('文件上传完毕 onUploadEnd: uploaded all the files')
}
})
console.log(uploader, 'uploader')
this.uploader = uploader
},
// 获取视频URL
getVideoUrl(videoId) {
let vm = this
vm.$showLoading('加载中...')
let data = {
video_id: videoId
}
vm.$post({url: `${service.host}/ali/video/info`, data}).then(({code, data}) => {
console.log(data, data.body.PlayInfoList.PlayInfo[0].PlayURL, '1131231')
vm.$emit('uploadVideoSuccess', data.body.PlayInfoList.PlayInfo[0].PlayURL, videoId)
wx.hideLoading()
})
},
uploadFile(file) { // 上传视频
let vm = this
let videosCount = --vm.videosCount
vm.videosCount = videosCount
vm.videos = vm.videos.concat(file)
let uploader = vm.uploader
let userData = '{"Vod":{}}'
console.log(file, 'file')
console.log(uploader, 'file')
wx.hideLoading()
uploader.addFile(file, null, null, null, userData)
},
// 视频压缩
compressVideo(tempFilePath) {
console.log(tempFilePath)
// wx.showLoading({title: '视频压缩中...', mask: true})
let that = this
return new Promise((resolve, reject) => {
wx.compressVideo({
quality: 'high',
src: tempFilePath,
success: (res) => {
console.log(res)
// console.log((res.size / 1024).toFixed(2))
// console.log(parseFloat(res.size / 1024).toFixed(2))
// let size = parseFloat(res.size / 1024).toFixed(2)
// console.log('压缩后视频大小为' + size)
// console.log('压缩后视频的链接' + res.tempFilePath)
resolve(res)
}
})
})
},
// 剪辑视频
editorVideo(tempFilePath) {
console.log(tempFilePath)
// wx.showLoading({title: '视频压缩中...', mask: true})
let that = this
return new Promise((resolve, reject) => {
wx.openVideoEditor({
filePath: tempFilePath,
// minDuration: 3, // 限制时间
// maxDuration: 30, // 限制时间
success: (res) => {
if (parseFloat(res.duration / 1000).toFixed(0) > 30) { // 视频大于30秒
reject(res)
} else {
resolve(res) // 视频剪辑后少于30秒
}
console.log('剪辑后的视频时长:' + parseFloat(res.duration / 1000).toFixed(0))
console.log('剪辑后的视频大小:' + res.size)
console.log('剪辑后的视频链接:' + res.tempFilePath)
console.log('剪辑后的视频图片链接:' + res.tempThumbPath)
},
fail: (res) => {
// that.$showToast(res.errMsg)
}
})
})
},
choosevideo(maxTime = 30) {
let vm = this
console.log('上传视频的方法')
wx.chooseMedia({
count: 1, // 上传视频的个数
mediaType: ['video'], // 限制上传的类型为video
sourceType: ['album', 'camera'], // 视频选择来源
maxDuration: maxTime, // 拍摄限制时间
compressed: true,
camera: 'back', // 采用后置摄像头
success: (res) => { // 获取临时存放的视频资源
let tempFilePath = res.tempFiles[0].tempFilePath
// 获取该视频的播放时间
let duration = res.tempFiles[0].duration
console.log('视频播放时间为' + duration)
// 视频封面
let thumbTempFilePath = res.tempFiles[0].thumbTempFilePath
console.log('视频封面为' + thumbTempFilePath)
// 获取视频的大小(MB单位)
let size = parseFloat(res.tempFiles[0].size / 1024 / 1024).toFixed(1)
console.log('视频大小为' + size)
// 获取视频的高度
let height = res.tempFiles[0].height
console.log('视频高度为' + height)
// 获取视频的宽度
let width = res.tempFiles[0].width
console.log('视频宽度为' + width)
let file = {
url: tempFilePath,
coverUrl: thumbTempFilePath,
fileSize: size
}
// 校验大小后,符合进行上传
if (duration > maxTime) {
let beyongSize = parseFloat(duration - 30).toFixed(0)
// 获取视频超出限制大小的数量
wx.showModal({
title: '提示',
content: '上传的视频时长超限,超出' + beyongSize + '秒,是否剪辑视频!',
success(res) {
if (res.confirm) {
console.log('用户点击确定')
vm.$showLoading('压缩中...')
vm.compressVideo(tempFilePath).then((data) => { // 先压缩视频,再剪辑视频
vm.$showLoading('准备编辑中...')
vm.editorVideo(data.tempFilePath).then((resV2) => {
console.log(resV2)
file = {
url: resV2.tempFilePath,
coverUrl: resV2.thumbTempFilePath,
fileSize: resV2.size
}
vm.uploadFile(file) // 视频在30秒内上传视频
}).catch((err) => {
console.log(err, '========================')
let time = parseFloat(err.duration / 1000).toFixed(0)
console.log(time)
if (time > maxTime) { // 视频大于30秒重新上传视频
return wx.showModal({
title: '提示',
content: `视频超过${parseFloat(time - maxTime).toFixed(0)}秒,请重新上传哦!`,
showCancel: false,
success(res) {
console.log('用户点击确定')
}
})
}
})
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
} else {
vm.$showLoading('压缩中')
vm.compressVideo(tempFilePath).then((data) => { // 先压缩视频,然后再上传
console.log(data)
file = {
url: data.tempFilePath,
coverUrl: thumbTempFilePath,
fileSize: data.size
}
wx.hideLoading()
// 上传视频
vm.uploadFile(file)
})
}
}
})
}
}
})
</script>
<style type="less">
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,6 +34,39 @@ wepy.page({
dynamicList: [],
list: [] // 评论列表数据
},
async onShareAppMessage(res) {
let that = this
console.log(that.detail.content.length, 'that.list.content.length---')
console.log(that.detail.content.slice(0, 10), 'that.list.content.length---')
let topitTitle = that.detail.topic.name ? '#' + that.detail.topic.name + '#' : ''
let title = (topitTitle.length + that.detail.content.length) > 27 ? that.detail.content.slice(0, (27 - topitTitle.length)) + '...' : that.detail.content
console.log(title, 'title---')
let openid = wx.getStorageSync('openid')
let fromUserID = wx.getStorageSync('user_id')
let imgUrl = (that.detail.photos && that.detail.photos.length) > 0 ? that.detail.photos[0] : that.detail.cover_url ? that.detail.cover_url : that.detail.topic.back_image ? that.detail.topic.back_image : 'https://images.ufutx.com/202004/29/baac955e5878e0cb03c17eef0c92f473.jpeg'
let url = `/pages/dynamic/dynamicDetail?id=${that.id}&from_openid=${openid}&share_user_id=${that.user_id}&from_user_id=${fromUserID}`
console.log(url)
return {
title: topitTitle + title,
path: url,
// imageUrl: 'https://images.ufutx.com/202004/29/baac955e5878e0cb03c17eef0c92f473.jpeg',
imageUrl: imgUrl,
success: function (res) {
wx.showToast({
title: '转发成功',
icon: 'success',
duration: 1500
})
var shareTickets = res.shareTickets
if (shareTickets.length == 0) {
return false
}
},
fail: function (res) {
// 转发失败
}
}
},
methods: {
getDetail() {
let vm = this

View File

@ -313,7 +313,8 @@ page {
</view>
</view>
<uploadPic :num="9 - imgList.length" :chooseShow.sync="choosePicsShow" @changeVal="changeVal" @closeUploadPic="closeUpload"></uploadPic>
<uploadVideo :chooseShow.sync="chooseVideoShow" @changeVal="changeVideoVal" @closeUploadVideo="closeUpload"></uploadVideo>
<!-- <uploadVideo :chooseShow.sync="chooseVideoShow" @changeVal="changeVideoVal" @closeUploadVideo="closeUpload"></uploadVideo>-->
<uploadVideoV2 ref="uploadVideo" @uploadVideoSuccess="changeVideoVal" @closeUploadVideo="closeUpload"></uploadVideoV2>
</template>
<script>
@ -335,12 +336,14 @@ wepy.page({
throttle: true,
placeholder: '用视频/图片分享记录,能获得更多好友点赞',
play_url: '',
videoId: '',
chooseVideoShow: false,
choosePicsShow: false,
imgList: [],
showCon: false,
uploadType: '',
address: '我在哪里'
address: '我在哪里',
uploadVideo: null
},
methods: {
saveIssue() {
@ -349,6 +352,7 @@ wepy.page({
topic_id: vm.id * 1,
content: vm.value,
photos: vm.imgList,
aliyun_video_id: vm.videoId,
address: vm.address == '我在哪里' ? '' : vm.address,
is_hot: vm.hot * 1
}
@ -362,6 +366,7 @@ wepy.page({
if (code == 0) {
vm.$showToast('动态已发布')
setTimeout(() => {
vm.throttle = true
// 发布成功后返回列表并且切换到最新tab
const pages = getCurrentPages()
const prevPage = pages[pages.length - 2]
@ -374,7 +379,6 @@ wepy.page({
wx.navigateBack({delta: 1})
}, 1200)
}
vm.throttle = true
}).catch(() => {
vm.throttle = true
wx.hideLoading()
@ -472,6 +476,7 @@ wepy.page({
},
chooseVideo() {
let vm = this
vm.$refs.uploadVideo.choosevideo()
vm.chooseVideoShow = true
},
changeVal(e) {
@ -483,13 +488,17 @@ wepy.page({
vm.choosePicsShow = false
console.log(vm.imgList, '777')
},
changeVideoVal(e) {
console.log(e, '711177')
changeVideoVal(play_url, videoId) {
// console.log(e, '711177')
let vm = this
if (e && e.length > 0) {
vm.play_url = e[0].filePath
// if (e && e.length > 0) {
// vm.play_url = e[0].filePath
// }
console.log(play_url, 'play_url===')
vm.play_url = play_url
vm.videoId = videoId
vm.uploadType = 'video'
}
},
closeUpload() {
let vm = this
@ -519,6 +528,7 @@ backgroundColorBottom: '#ffffff',
usingComponents: {
uploadPic: '~@/components/uploadPic',
uploadVideo: '~@/components/uploadVideo',
uploadVideoV2: '~@/components/uploadVideoV2',
}
}
</config>

View File

@ -1010,6 +1010,7 @@ wepy.page({
app.globalData.nim.user.getUsersNameCardFromServer({
accounts: [e.from]
}).then((res) => {
console.log(res, 'res===')
vm.msgList.push({
text: e.body,
attach: vm.calculatePic(e.attach, e.type),

View File

@ -292,7 +292,7 @@ page {
<view class="u_vc_lst {{index >= 3 && !userInfo.rank_id ? 'ui-filter' : ''}}" @longpress="deleteRecord(item, index)" @tap="jumpPath(item, index)">
<view class="f-fc u_box">
<view class="f-fc">
<image class="u_vclst_img" :src="item.photo" mode="aspectFill" @tap.stop="gotofriends(item, index)"></image>
<image class="u_vclst_img" :src="item.photo" mode="aspectFill" @tap.stop="jumpPath(item, index)"></image>
<view class="u_vclst_t_box">
<view class="f-fc">
<view class="u_vclst_name ellipsis_1">{{item.nickname}}</view>
@ -396,6 +396,23 @@ wepy.page({
fansScroll: 0
},
methods: {
gotofriends(item, index) {
console.log(index)
if (index >= 3 && this.user.rank_id == 0) {
this.$emit('clickGoto', {
item: item,
index: index
})
return
}
this.$gotoFriendPage(item.type, item.id)
// if (item.other_user.type == 'single') {
// url = '/pages/home/information?id=' + item.other_user.id
// } else {
// url = '/pages/home/informationV2?id=' + item.other_user.id
// }
// wx.navigateTo({url: url})
},
// 访客列表
getList() {
let vm = this

View File

@ -5,7 +5,7 @@ page {
}
.ui-home{
padding-bottom: 140rpx;
padding-bottom: 45rpx;
}
.ui-top-up{
@ -411,7 +411,7 @@ page {
</view>
</view>
</block>
<view v-if="no_more " class="text-c color-theme f-fcc" @tap="toRefresh">
<view v-if="no_more " class="text-c f-fcc" style="color: #F33B6C;" @tap="toRefresh">
<image src="https://image.fulllinkai.com/202411/05/97b41d06d255edc1ecfecec71cd15ba1.png" class="ui-refresh ui-mr-8"></image>
<view>更换一批</view>
</view>
@ -476,7 +476,7 @@ wepy.page({
referrals: [], // 为你推荐
countdown: {d: '0', h: '00', m: '00', s: '00'},
timer: null,
url: 'other/user/square'
url: 'other/user/square' // 精准推荐
},
methods: {
// 获取置顶推荐用户
@ -553,7 +553,7 @@ wepy.page({
vm.$showLoading('更新中')
setTimeout(() => {
vm.no_more = false
vm.url = 'other/user/rand/square'
vm.url = 'other/user/rand/square' // 随机推荐
vm.getSquare()
}, 300)
},

View File

@ -0,0 +1,440 @@
<template>
<cuCustom :bgColor="bgVip" isCustom="{{true}}">
<view slot="backText">返回</view>
<view slot="content">会员中心</view>
</cuCustom>
<view class="page-user animation-slide-top">
<block v-if="!PageData.is_show_image">
<view class="caid_bg">
<view class="_time font_32 bold">{{ PageData.card_text }}</view>
</view>
</block>
<block v-else>
<view class="caid_bg" style="background-image: url({{ PageData.card_image }})">
</view>
</block>
<block v-if="PageData.card.remain_num>0">
<view class="getBtnStyle radius shadow margin-top" v-if="PageData.history_count == 1"
style="background-image: url('https://images.ufutx.com/202005/18/f6bdbd97cdf2c5a63d4b55b8a1e7522e.png')"></view>
<view class="getBtnStyle radius shadow margin-top LRSwing" v-else @tap="getTempMember"></view>
</block>
<block v-else>
<view class="getBtnStyle radius shadow margin-top" v-if="PageData.history_count == 1"
style="background-image: url('https://images.ufutx.com/202005/18/f6bdbd97cdf2c5a63d4b55b8a1e7522e.png')"></view>
<view class="getBtnStyle radius shadow margin-top" v-else
style="background-image: url('https://images.ufutx.com/202005/18/3f166b587ff2b72858ebb35a76787150.png')"></view>
</block>
<view class="_text text-center font_24">每天限量发送,先到先得</view>
<view class="text-center animation-scale-up" style="animation-delay: 0.8s;">
<image src="https://images.ufutx.com/202005/18/9d52760f40fbb4acbf52b5a4ddb2c230.png" mode="aspectFill"
class="_icon"></image>
</view>
<view class="_text2 text-center font_30">福恋超级会员有什么权益?</view>
<view class="itemList text-center">
<block v-for="(item,index) in privileges" :key="index">
<!-- // 此注释是因为后台分开给字段的时候写的-->
<view class="container">
<view class="_icon" style="background-image: url({{ item.icon }});"></view>
<text class="_title">{{ item.title }}</text>
<text class="_title_sb font_20">{{ item.desc }}</text>
</view>
</block>
</view>
</view>
<view class="_model text-center" v-if="showModal">
<view class="item_model {{showModal?'animation-slide-top':''}}">
<image src="https://images.ufutx.com/202005/18/982d51fb107b78fb06274504042f214f.png" mode="aspectFill"
class="close" @tap="closeFn"></image>
<image src="https://images.ufutx.com/202005/18/689731658105206339940cfd11b0a654.png" mode="widthFix"
class="_caid"></image>
<view class="font_36 bold color-333 _textV">领取成功</view>
<view class="font_26 color-666 _textV">会员稍后到账</view>
<image src="https://images.ufutx.com/202005/18/58822abdd8ece42f824ce0bd03e4cce5.png" mode="widthFix" class="_btnV"
@tap="redirectTo('/pages/tabBar/welcome')"></image>
</view>
</view>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
// import cuCustom from '../../components/cu-custom'
import {service} from '../../config.js'
wepy.page({
mixins: [base, https],
config: {
navigationBarTitleText: '领取礼包',
enablePullDownRefresh: false,
navigationStyle: 'custom'
},
data: {
is_profile: '',
id: 0,
PageData: [],
init: false,
type: '',
openid: '',
showModal: false,
sharePath: '',
number: 0,
privileges: [], // 权益
bgVip: 'background: #333333;\ncolor: white'
},
components: {
// cuCustom
},
onShow() {
// 初始化页面数据
// this.$parent.getTracker(this.$root.$name, this.config.navigationBarTitleText)
},
// onShareAppMessage(res) {
// let that = this
// // from_openid = wx.getStorageSync('openid'),
// // url = `/pages/tabBar/home?&from_openid=${from_openid}`
// // console.log(url)
// console.log(res.from)
// console.log(that.sharePath)
// if (res.from == 'menu') {
// // that.$showToast('此分享无效!')
// }
// return {
// title: that.PageData.name,
// path: that.sharePath,
// imageUrl: 'http://images.ufutx.com/201901/24/ea7a0215b88ca0d003ad55111dd6547f.png',
// success: function (res) {
// wx.showToast({
// title: '转发成功',
// icon: 'success',
// duration: 1500
// })
// },
// fail: function (res) {
// console.log('转发成功')
// }
// }
// }
onLoad(e) {
if (e.number) this.number = e.number
// this.$recordFrom_platform(e)
wx.setStorageSync('groupMemberRow', e)
this.token = wx.getStorageSync('token')
if (e.scene) {
let newScene = decodeURIComponent(e.scene)
if (newScene.indexOf('&') >= 0) {
newScene.split('&').forEach((item, index) => {
if (item.indexOf('from_user_id') >= 0) {
wx.setStorageSync(item.split('=')[0], item.split('=')[1])
} else if (item.indexOf('id=') >= 0) {
this.id = item.split('=')[1]
}
})
} else {
this.id = decodeURIComponent(e.scene).split('=')[1]
}
} else {
this.id = e.id
if (e.from_openid) {
wx.setStorageSync('from_openid', e.from_openid)
}
}
this.getPageData()
// if (wepy.$instance.globalData.userInfo) {
// this.type = wx.getStorageSync('type')
// this.openid = wx.getStorageSync('openid')
// this.getPageData()
// } else {
// wepy.$instance.userInfoReadyCallback = res => {
// this.openid = res.openid
// if (res.token) {
// this.type = res.user.type
// }
// this.getPageData()
// }
// }
},
onPullDownRefresh() {
},
methods: {
getPageData() {
let vm = this
vm.$get({
url: `${service.host}/fellowing/card/${this.id}?member=${this.number}`
})
.then(({code, data}) => {
// this.sharePath = `/pages/users/groupMember?id=${this.id}&from_openid=` + wx.getStorageSync('openid')
this.init = true
this.PageData = data
this.privileges = data.privileges
})
// complete: (res) => {
// if (res.errMsg.indexOf('timeout') > -1) {
// wx.showModal({
// title: '',
// content: '当前网络不稳定!请重试...',
// confirmText: '确认',
// cancelText: '返回首页',
// success: (res) => {
// if (res.confirm) {
// const pages = getCurrentPages()
// const page = pages.pop()
// page.onLoad(wx.getStorageSync('groupMemberRow'))
// } else {
// let userType = wx.getStorageSync('type')
// wx.removeStorageSync('groupMemberRow')
// if (userType == 'single') {
// wx.reLaunch({
// url: '/pages/tabBar/home1'
// })
// } else {
// wx.redirectTo({
// url: `/pages/marriedPage/home`
// })
// }
// }
// }
// })
// }
// }
},
// 领取尊享会员
redirectTo(url) {
wx.redirectTo({url: url})
let vm = this
vm.showModal = false
},
closeFn() {
let vm = this
vm.showModal = false
},
getTempMember() {
let vm = this
let data = {
openid: this.openid
}
if (vm.number) data = {openid: vm.openid, number: vm.number}
// if (this.type == 'marriage' && this.type) {
// return wx.showModal({
// title: '提示:',
// content: '抱歉!只有单身才能领取...',
// showCancel: false,
// confirmText: '进入福恋',
// success: function (res) {
// if (res.confirm) {
// wx.redirectTo({url: '/pages/tabBar/welcome'})
// }
// }
// })
// }
this.$post({url: `${service.host}/fellowing/card/${vm.id}`, data})
.then(({code, data}) => {
switch (data.result) {
case 0:
vm.getPageData()
vm.showModal = true
break
case 1:
wx.showModal({
title: '提示:',
content: '抱歉该VIP卡已被领取完',
showCancel: false,
confirmText: '进入福恋',
success: function (res) {
if (res.confirm) {
wx.redirectTo({url: '/pages/tabBar/welcome'})
}
}
})
break
case 2:
wx.showModal({
title: '提示:',
content: '抱歉你已领取过该VIP卡',
showCancel: false,
confirmText: '进入福恋',
success: function (res) {
if (res.confirm) {
wx.redirectTo({url: '/pages/tabBar/welcome'})
}
}
})
break
}
})
},
goto(url) {
wx.navigateTo({url: url})
},
switchTab(url) {
wx.switchTab({url: url})
}
}
})
</script>
<style lang="less">
//@import "../../styles/custom/reset.less";
//@import "../../styles/custom/fn.less";
page {
background-image: url("https://images.ufutx.com/202005/14/fe9e791027aeec5509358f995c676e84.png");
background-repeat: no-repeat;
background-size: cover;
width: 100vw;
height: 80vh;
.page-user {
}
.caid_bg {
background-image: url("https://images.ufutx.com/202005/18/64ca8ace0b8fd063d11fdc825d85469a.png");
background-repeat: no-repeat;
background-size: cover;
width: 90vw;
height: 46.6vw;
margin: 8vw auto;
position: relative;
border-radius: 16rpx;
._time {
position: absolute;
right: 6vw;
top: 6vw;
color: #E11F1D;
letter-spacing: 3rpx;
}
}
.getBtnStyle {
background-image: url("https://images.ufutx.com/202005/18/943bd3b4a1ee3a23593c422c411ca4a2.png");
background-repeat: no-repeat;
background-size: cover;
width: 80vw;
height: 12vw;
margin: auto;
}
._text, ._text2 {
color: #8f8b7e;
margin: 24rpx auto;
letter-spacing: 2rpx;
}
._text2 {
color: #cdc19e;
margin-top: 12rpx;
letter-spacing: 4rpx;
}
._icon {
width: 72rpx;
height: 72rpx;
margin: auto;
}
.itemList {
width: 100vw;
background: #333333;
padding-bottom: 12rpx;
.image {
width: 90vw;
height: auto;
}
}
}
.container{
width: 675rpx;
height: 130rpx;
background-image: url("https://image.fulllinkai.com/202202/15/ee783b8c1eeb1e46376e678bdac38c9e.png");
background-size: cover;
margin: auto;
margin-bottom: 16rpx;
border-radius: 22rpx;
position: relative;
._icon{
width: 100rpx;height: 100rpx;
background-size: contain;
border-radius: 50%;
position: absolute;
left: 42rpx;top: 14rpx;
}
._title{
position: absolute;
left: 172rpx;top: 16rpx;
color: #feeaa7;
font-weight: 400;
letter-spacing:4rpx;
}
._title_sb{
position: absolute;
left: 160rpx;top: 72rpx;
color: #c6c5c2;
letter-spacing:2rpx;
background: #494746;
padding: 0 22rpx;
border-radius: 22rpx;
height: 36rpx;
line-height: 36rpx;
}
}
._model {
position: fixed;
top: 0;
left: 0;
width: 100vw;
padding: 0 15vw;
height: 100vh;
background: rgba(0, 0, 0, .7);
.item_model {
margin-top: 62vw;
background: white;
border-radius: 16rpx;
position: relative;
.close {
position: absolute;
right: 0rpx;
top: -92rpx;
width: 60rpx;
height: 60rpx;
}
._caid {
width: 420rpx;
height: auto;
margin-top: 36rpx;
}
._textV {
letter-spacing: 4rpx;
}
._btnV {
width: 340rpx;
height: auto;
margin-top: 42rpx;
margin-bottom: 42rpx;
}
}
}
</style>
<config>
{
navigationBarTitleText: '',
navigationStyle: 'custom',
enablePullDownRefresh: false,
backgroundColorTop: '#f2f2f2',
backgroundColorBottom: '#f2f2f2',
usingComponents: {
cuCustom: '~@/components/cu-custom'
}
}
</config>

View File

@ -153,7 +153,7 @@
approve_time: 0
},
onShow() {
onShow(options) {
if (wx.getStorageSync('cardName')) {
this.card.new_card_num = wx.getStorageSync('cardNum')
this.card.name = wx.getStorageSync('cardName')
@ -163,8 +163,20 @@
wx.redirectTo({url: '/pages/tabBar/welcome'})
return
}
if (options) {
const { referrerInfo, scene } = options
/* 判断是否从eID数字身份小程序返回 */
const { appId } = referrerInfo
if (scene === 1038 && appId === 'wx0e2cb0b052a91c92') {
} else {
// 执行接入方小程序原本的逻辑
this.GetInit()
},
}
} else {
this.GetInit()
}
},
onShareAppMessage (res) {
let fromUserID = wx.getStorageSync('user_id')
@ -229,12 +241,12 @@
// 初始化页面数据
initPageData() {
this.$get({url: `${service.host}/user/approve/profile`}).then(({code, data}) => {
wx.removeStorageSync('realName')
// wx.removeStorageSync('realName')
this.user = data
if (data.is_real_approved == 2) {
wx.redirectTo({url: `/pages/users/artificial`})
return
}
// if (data.is_real_approved == 2) {
// wx.redirectTo({url: `/pages/users/artificial`})
// return
// }
if (data.card_num && data.is_real_approved == 1) {
this.user.new_card_num = this.interceptAndReplace(data.card_num, 5, 2, '*')
}
@ -247,7 +259,8 @@
},
getInfoData() {
let vm = this
this.$get({url: `${service.host}/user/approve/info`}).then(({code, data}) => {
this.$get({url: `${service.host}/user/approve/profile`}).then(({code, data}) => {
// wx.removeStorageSync('isEid')
if (data.is_real_approved == 0) {
return vm.$showToast('请核查认证信息')
}
@ -381,6 +394,7 @@
vm.$post({url: `${service.host}/user/approve/real`, data}).then(({code, data}) => {
console.log(data, 'tid数据')
let token = data.eid_token
// wx.setStorageSync('isEid', true)
startEid({
data: {
token: token