first commit
BIN
me/.DS_Store
vendored
Normal file
815
me/assistance/assistance.vue
Normal file
@@ -0,0 +1,815 @@
|
||||
<template>
|
||||
<view class="assist">
|
||||
<!-- 背景图片 -->
|
||||
<image src="../static/assist/zlBg.png" class="bg" mode="widthFix"></image>
|
||||
<!-- 内容 -->
|
||||
<view class="content">
|
||||
<!-- #ifdef H5 -->
|
||||
<image v-if="isBack" src="/static/images/index/left.png" class="left_viewimage" @tap="goBack"></image>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 标题 -->
|
||||
<view class="content-title">
|
||||
邀好友助力
|
||||
</view>
|
||||
<!-- 副标题 -->
|
||||
<view class="content-titles">
|
||||
免费领会员
|
||||
</view>
|
||||
<!-- 邀请好友展示框 -->
|
||||
<view class="content-hy flex align-center justify-center">
|
||||
<view class="content-hy-box">
|
||||
<view class="content-hy-box-title1" v-if="rlueList[rlueIndex] && rlueList[rlueIndex].inviteMonth>0">
|
||||
{{userName}},再邀请<span>{{getUserPeopNum}}</span>位好友,可再得{{rlueList[rlueIndex].inviteMonth}}个月会员
|
||||
</view>
|
||||
<view class="content-hy-box-title1" v-else>
|
||||
{{userName}},再邀请<span>{{getUserPeopNum}}</span>位好友,可升级永久免费无限会员
|
||||
</view>
|
||||
<view class="" v-for="(item,index) in rlueList" :key="index">
|
||||
<view v-if="index>rlueIndex" class="content-hy-box-title2">
|
||||
<block v-if="item.inviteMonth>0">
|
||||
再邀请{{item.inviteCount - nowPeopNum}}位好友,可再得{{item.inviteMonth}}个月会员
|
||||
</block>
|
||||
<block v-else>
|
||||
再邀请{{item.inviteCount - nowPeopNum}}位好友,可升级永久免费无限会员
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-hy-box-peop">
|
||||
<view class="content-hy-box-peop-my flex align-center justify-center">
|
||||
<image :src="avatar?avatar:'../../static/images/logo.png'" mode=""></image>
|
||||
</view>
|
||||
<view class="content-hy-box-peop-title">
|
||||
您已注册成功,还需邀请
|
||||
</view>
|
||||
<view class="content-hy-box-peop-list flex align-center justify-between flex-wrap">
|
||||
<view class="content-hy-box-peop-list-i flex align-center justify-center"
|
||||
v-for="(item,index) in getPeopNum" :key="index">
|
||||
<block v-if="getPeopList[index]">
|
||||
<view class="content-hy-box-peop-list-ia flex align-center justify-center"
|
||||
style="border: none;">
|
||||
<image style="width: 100%;height: 100%;border-radius: 50%;"
|
||||
:src="getPeopList[index].avatar?getPeopList[index].avatar:'../../static/images/logo.png'"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view class="content-hy-box-peop-list-it flex align-center justify-center">
|
||||
{{getPeopList[index].userName}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view @click="onSaveImg()"
|
||||
class="content-hy-box-peop-list-ia flex align-center justify-center">
|
||||
<u-icon name="plus" color="#ffffff" size="28"></u-icon>
|
||||
</view>
|
||||
<view class="content-hy-box-peop-list-it flex align-center justify-center">
|
||||
待助力
|
||||
</view>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
<view class="content-hy-box-peop-list-i flex align-center justify-center"
|
||||
style="height: 0;">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="getPeopList.length>0">
|
||||
<!-- 进度条 -->
|
||||
<view class="content-hy-box-schedule">
|
||||
<u-line-progress height="16" inactive-color="#f5e0b0" active-color="#edb840"
|
||||
:show-percent="false" :percent="getMathNum()" :round="true"></u-line-progress>
|
||||
</view>
|
||||
<view class="content-hy-box-schedulet">
|
||||
距离领取会员仅差<span>{{getUserPeopNum}}</span>位好友
|
||||
</view>
|
||||
<view class="content-hy-box-peops">
|
||||
<swiper class="content-hy-box-peopss" next-margin="80px" :circular="true"
|
||||
:indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000">
|
||||
<swiper-item class="content-hy-box-peopssi" v-for="(item,index) in getPeopList"
|
||||
:key="index">
|
||||
<view class="content-hy-box-peopssis flex align-center">
|
||||
<image :src="item.avatar?item.avatar:'../../static/images/logo.png'" mode="">
|
||||
</image>
|
||||
<view class="content-hy-box-peopssit">
|
||||
{{item.userName}}已为您助力
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 助力按钮 -->
|
||||
<!-- #ifndef MP-KUAISHOU -->
|
||||
<view class="content-btn flex align-center justify-center" @click="onSaveImg()">
|
||||
{{getPeopList.length==0?'开始助力':'继续助力'}}
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-KUAISHOU -->
|
||||
<view class="content-btn flex align-center justify-center">
|
||||
<u-button open-type="share" :custom-style="customStyle" :hair-line="false"
|
||||
style="width: 100%;height: 100%;" shape="circle"
|
||||
:ripple="true">{{getPeopList.length==0?'开始助力':'继续助力'}}</u-button>
|
||||
</view>
|
||||
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 活动流程 -->
|
||||
<view class="content-lc">
|
||||
<view class="content-lc-title flex align-center justify-center">
|
||||
活动流程
|
||||
</view>
|
||||
<view class="content-lc-ls flex justify-between">
|
||||
<view class="content-lc-ls-i">
|
||||
<image src="../static/assist/as1.png" mode=""></image>
|
||||
<view class="content-lc-ls-it">
|
||||
点击发起助力
|
||||
</view>
|
||||
</view>
|
||||
<image class="content-lc-ls-ir" src="../static/assist/asr.png" mode=""></image>
|
||||
<view class="content-lc-ls-i">
|
||||
<image src="../static/assist/as2.png" mode=""></image>
|
||||
<view class="content-lc-ls-it">
|
||||
邀请对应数量好友
|
||||
</view>
|
||||
</view>
|
||||
<image class="content-lc-ls-ir" src="../static/assist/asr.png" mode=""></image>
|
||||
<view class="content-lc-ls-i">
|
||||
<image src="../static/assist/as3.png" mode=""></image>
|
||||
<view class="content-lc-ls-it">
|
||||
每位好友注册成功
|
||||
</view>
|
||||
</view>
|
||||
<image class="content-lc-ls-ir" src="../static/assist/asr.png" mode=""></image>
|
||||
<view class="content-lc-ls-i">
|
||||
<image src="../static/assist/as4.png" mode=""></image>
|
||||
<view class="content-lc-ls-it">
|
||||
领取对应时间会员
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 活动规则 -->
|
||||
<view class="content-rule">
|
||||
<view class="content-rule-title flex align-center justify-center">
|
||||
活动规则
|
||||
</view>
|
||||
<view class="content-rule-list">
|
||||
<view class="content-rule-list-i flex align-center" v-for="(item,index) in rlueList" :key="index">
|
||||
<image :src="item.inviteImg" mode=""></image>
|
||||
<view class="content-rule-list-i-r">
|
||||
<view class="content-rule-list-i-r-t" v-if="item.inviteMonth>0">
|
||||
领取{{item.inviteMonth}}个月会员
|
||||
</view>
|
||||
<view class="content-rule-list-i-r-t" v-else>
|
||||
领取永久会员
|
||||
</view>
|
||||
<view class="content-rule-list-i-r-b" v-if="item.inviteMonth>0">
|
||||
邀请{{item.inviteCount}}位好友,您可以免费{{item.inviteMonth}}个月无限看短剧。
|
||||
</view>
|
||||
<view class="content-rule-list-i-r-b" v-else>
|
||||
邀请{{item.inviteCount}}位好友,您可以永久免费无限看短剧。
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <image src="../../static/images/logo.png" mode=""></image> -->
|
||||
|
||||
<tki-qrcode ref="qrcode" :val="erweima" :size="100" background="#ffffff" foreground="#000000" pdground="#000000"
|
||||
:onval="true" :loadMake="true" @result="qrR" :show="false"></tki-qrcode>
|
||||
|
||||
<view class="cu-modal" :class="modalName == 'Image' ? 'show' : ''" @tap="hideModal">
|
||||
<view class="cu-dialog" v-if="bgImg && erweimapath && haibaoShow" @tap="hideModal">
|
||||
<view class="bg-img">
|
||||
<wm-poster @success="posterSuccess" @successH5="successH5" :imgSrc="bgImg"
|
||||
:Referrer="'我的邀请码:'+invitationCode" :QrSrc="erweimapath" :LineType="false"></wm-poster>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tkiQrcode from '../../components/tki-qrcode/tki-qrcode.vue';
|
||||
import wmPoster from '../components/wm-poster/wm-posterordershd.vue';
|
||||
import config from '../../common/config.js'
|
||||
export default {
|
||||
components: {
|
||||
tkiQrcode,
|
||||
wmPoster
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
customStyle: {
|
||||
width: '100%',
|
||||
height: '98rpx',
|
||||
border: 'none',
|
||||
background: 'transparent',
|
||||
color: '#ffffff',
|
||||
fontSize: '12px',
|
||||
fontWeight: '500',
|
||||
|
||||
// padding: '24px 20px',
|
||||
},
|
||||
avatar: '',
|
||||
inviteAwardId: '', //等级id
|
||||
rlueList: [], //规则列表
|
||||
getPeopNum: 0, //当前需要邀请的人数
|
||||
getUserPeopNum: 0, //还需要邀请的人数
|
||||
rlueIndex: 0, //当前等级对应的下标
|
||||
nowPeopNum: 0, //已经邀请的人数
|
||||
getPeopList: [], //已经邀请的人列表
|
||||
userName: '', //用户名称
|
||||
avatar: '', //用户头像
|
||||
erweima: '',
|
||||
modalName: '',
|
||||
bgImg: '',
|
||||
erweimapath: '',
|
||||
haibaoShow: false,
|
||||
invitationCode: 0,
|
||||
erweimapath: '',
|
||||
haibaoImgH5: '',
|
||||
qdCode: '', //渠道码
|
||||
isBack: false,
|
||||
bgImgs: '',
|
||||
tuiguang: '',
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
return {
|
||||
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||
title: this.tuiguang,
|
||||
imageUrl: this.bgImgs
|
||||
}
|
||||
},
|
||||
onShareTimeline(res) {
|
||||
return {
|
||||
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||
title: this.tuiguang,
|
||||
imageUrl: this.bgImgs
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.isBack = false
|
||||
} else {
|
||||
this.isBack = true
|
||||
}
|
||||
// #endif
|
||||
|
||||
if (uni.getStorageSync('qdCode')) {
|
||||
this.qdCode = uni.getStorageSync('qdCode')
|
||||
}
|
||||
this.getBgImg()
|
||||
this.invitationCode = uni.getStorageSync('invitationCode')
|
||||
// h5携带邀请码去首页
|
||||
// #ifdef H5
|
||||
this.erweima = config.APIHOST2 + '/?invitation=' + this
|
||||
.invitationCode + '&qdCode=' + this.qdCode
|
||||
// #endif
|
||||
// app直接去app注册页面
|
||||
// #ifdef APP
|
||||
this.erweima = config.APIHOST2 + '/pages/login/registerApp?invitation=' + this
|
||||
.invitationCode + '&qdCode=' + this.qdCode
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
this.getWxEq()
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
this.getTouTiao()
|
||||
// #endif
|
||||
this.getUserInfo()
|
||||
this.getActivity()
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
//获取头条二维码
|
||||
getTouTiao() {
|
||||
let that = this
|
||||
uni.downloadFile({
|
||||
url: config.APIHOST +
|
||||
'/app/invite/dyCreateQr?invitationCode=' + that
|
||||
.invitationCode + ',' + that.qdCode + '&page=/pages/index/index',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
if (res.statusCode === 200) {
|
||||
that.erweimapath = res.tempFilePath
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取微信二维码
|
||||
getWxEq() {
|
||||
let that = this
|
||||
uni.downloadFile({
|
||||
url: config.APIHOST +
|
||||
'/app/invite/mpCreateQr?invitationCode=' + that
|
||||
.invitationCode + ',' + that.qdCode,
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
if (res.statusCode === 200) {
|
||||
that.erweimapath = res.tempFilePath
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取背景图
|
||||
getBgImg() {
|
||||
this.$Request.get('/app/common/type/812').then(res => {
|
||||
if (res.code == 0 && res.data.value) {
|
||||
this.bgImg = res.data.value
|
||||
}
|
||||
})
|
||||
this.$u.get('app/banner/selectBannerList?classify=5').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.bgImgs = res.data[0].imageUrl
|
||||
this.tuiguang = res.data[0].describes
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
showModal() {
|
||||
console.log(this.erweima, '二维码地址')
|
||||
// #ifndef H5
|
||||
if (!this.haibaoImg) {
|
||||
this.haibaoShow = true;
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
} else {
|
||||
this.modalName = 'Image';
|
||||
}
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
//微信浏览器
|
||||
if (!this.haibaoImg) {
|
||||
this.haibaoShow = true;
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
} else {
|
||||
this.modalName = 'Image';
|
||||
}
|
||||
} else {
|
||||
if (!this.haibaoImgH5) {
|
||||
this.haibaoShow = true;
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
} else {
|
||||
uni.previewImage({
|
||||
urls: [this.haibaoImgH5],
|
||||
current: 1,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
onSaveImg() {
|
||||
this.showModal();
|
||||
},
|
||||
posterSuccess(haibaoImg) {
|
||||
this.haibaoImg = haibaoImg;
|
||||
this.modalName = 'Image';
|
||||
uni.hideLoading();
|
||||
},
|
||||
successH5(haibaoImg) {
|
||||
this.haibaoImgH5 = haibaoImg
|
||||
uni.previewImage({
|
||||
urls: [haibaoImg],
|
||||
current: 1,
|
||||
})
|
||||
},
|
||||
hideModal() {
|
||||
this.modalName = null;
|
||||
},
|
||||
qrR(path) {
|
||||
console.log(path, '二维码回调地址')
|
||||
this.erweimapath = path;
|
||||
},
|
||||
//计算百分比
|
||||
getMathNum() {
|
||||
return (this.getPeopList.length / this.getPeopNum).toFixed(2) * 100
|
||||
},
|
||||
//获取登录用户信息
|
||||
getUserInfo() {
|
||||
this.$u.api.userinfo().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.userName = res.data.userName;
|
||||
this.avatar = res.data.avatar;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取活动等级
|
||||
getActivity() {
|
||||
this.$Request.getT('/app/invite/selectInviteAwardByUserId').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.inviteAwardId = res.data.inviteAwardId
|
||||
this.getPeopNum = res.data.inviteCount
|
||||
this.getActivityrule()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取活动规则列表
|
||||
getActivityrule() {
|
||||
this.$Request.getT('/app/invite/selectInviteAwardList', {
|
||||
page: 1,
|
||||
limit: 100
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.rlueList = res.data.records
|
||||
this.rlueIndex = this.rlueList.findIndex(item => item.inviteAwardId === this
|
||||
.inviteAwardId)
|
||||
this.getActivityList()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取邀请人列表
|
||||
getActivityList() {
|
||||
this.$Request.getT('/app/invite/selectInviteUserListByUserId').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.nowPeopNum = res.data.length
|
||||
|
||||
this.getPeopList = res.data
|
||||
this.getUserPeopNum = Number(this.getPeopNum) - Number(res.data.length)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.assist {
|
||||
background-color: #F22947;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #f8cfc3;
|
||||
}
|
||||
|
||||
.left_viewimage {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
position: absolute;
|
||||
top: 60rpx;
|
||||
left: 40rpx;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.content-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 78rpx;
|
||||
font-weight: bold;
|
||||
color: #FFF4E4;
|
||||
text-shadow: 0rpx 6rpx 9rpx rgba(118, 4, 17, 0.26);
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.content-titles {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 100rpx;
|
||||
font-weight: bold;
|
||||
color: #FFF4E4;
|
||||
text-shadow: 0rpx 6rpx 9rpx rgba(118, 4, 17, 0.26);
|
||||
}
|
||||
|
||||
.content-hy {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.content-hy-box {
|
||||
padding: 40rpx 0;
|
||||
width: 615rpx;
|
||||
height: 100%;
|
||||
background: linear-gradient(0deg, #FBEDCC 0%, #FFF7F0 98%);
|
||||
border-radius: 48rpx 48rpx 24rpx 24rpx;
|
||||
|
||||
.content-hy-box-title1 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
color: #F22947;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
|
||||
span {
|
||||
font-size: 54rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content-hy-box-title2 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 16rpx;
|
||||
color: #F22947;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.content-hy-box-peop {
|
||||
width: 550rpx;
|
||||
height: auto;
|
||||
background: linear-gradient(45deg, #f27e8c 0%, #fa3653 100%);
|
||||
border-radius: 24rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 20rpx;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.content-hy-box-peop-my {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
|
||||
image {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.content-hy-box-peop-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.content-hy-box-peop-list {
|
||||
width: calc(100% - 60rpx);
|
||||
margin: 0 auto;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.content-hy-box-peop-list-i {
|
||||
width: 32%;
|
||||
flex-direction: column;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.content-hy-box-peop-list-ia {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
border: 1px dashed #ffffff;
|
||||
}
|
||||
|
||||
.content-hy-box-peop-list-it {
|
||||
color: #ffffff;
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content-hy-box-schedule {
|
||||
width: 550rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
.content-hy-box-schedulet {
|
||||
width: 550rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 22rpx;
|
||||
|
||||
span {
|
||||
color: #F22A48;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content-hy-box-peops {
|
||||
width: 550rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 26rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.content-hy-box-peopss {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.content-hy-box-peopssi {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.content-hy-box-peopssis {
|
||||
width: 90%;
|
||||
// width: 300rpx;
|
||||
height: 100%;
|
||||
background-color: green;
|
||||
padding: 0 10rpx;
|
||||
background: linear-gradient(-90deg, #FCE9A4 0%, #FDFBD4 100%);
|
||||
border-radius: 25rpx;
|
||||
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.content-hy-box-peopssit {
|
||||
width: 80%;
|
||||
font-size: 24rpx;
|
||||
margin-left: 10rpx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-btn {
|
||||
width: 666rpx;
|
||||
height: 98rpx;
|
||||
background: linear-gradient(-90deg, #F22C49 0%, #FF7989 100%);
|
||||
border: 1px solid #FFD4CF;
|
||||
border-radius: 49rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 50rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.content-lc {
|
||||
width: 666rpx;
|
||||
height: 344rpx;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 50rpx;
|
||||
|
||||
.content-lc-title {
|
||||
width: 434rpx;
|
||||
height: 80rpx;
|
||||
background: linear-gradient(90deg, #FF969B 0%, #FF345B 100%);
|
||||
border-radius: 0rpx 0rpx 50rpx 50rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.content-lc-ls {
|
||||
width: calc(100% - 40rpx);
|
||||
margin: 0 auto;
|
||||
margin-top: 50rpx;
|
||||
|
||||
.content-lc-ls-ir {
|
||||
width: 26rpx;
|
||||
height: 16rpx;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.content-lc-ls-i {
|
||||
width: 100rpx;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.content-lc-ls-it {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #9C2A2A;
|
||||
font-weight: bold;
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-rule {
|
||||
width: 666rpx;
|
||||
height: auto;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 50rpx;
|
||||
|
||||
.content-rule-title {
|
||||
width: 434rpx;
|
||||
height: 80rpx;
|
||||
background: linear-gradient(90deg, #FF969B 0%, #FF345B 100%);
|
||||
border-radius: 0rpx 0rpx 50rpx 50rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.content-rule-list {
|
||||
width: 626rpx;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
margin-top: 40rpx;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
}
|
||||
|
||||
.content-rule-list-i {
|
||||
padding: 18rpx 12rpx;
|
||||
background-color: #FFF8E6;
|
||||
border-radius: 14rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
image {
|
||||
width: 106rpx;
|
||||
height: 82rpx;
|
||||
}
|
||||
|
||||
.content-rule-list-i-r {
|
||||
margin-left: 18rpx;
|
||||
|
||||
.content-rule-list-i-r-t {
|
||||
color: #9C2A2A;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.content-rule-list-i-r-b {
|
||||
font-size: 24rpx;
|
||||
color: #9C2A2A;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
96
me/collect/index.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="margin bg-white padding-sm radius" v-if="collectList.length" v-for="(item,index) in collectList" :key='index' @click="goDet(item.courseId)" >
|
||||
<view class="flex">
|
||||
<u-image width="280rpx" height="200rpx" :src="item.titleImg"></u-image>
|
||||
<view class="flex-sub margin-left flex flex-direction justify-between" style="width:420rpx;">
|
||||
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{item.title}}
|
||||
</view>
|
||||
<view class="text-gray text-26 margin-top">最近{{item.payNum}}人在学 </view>
|
||||
<view class="flex align-center justify-between">
|
||||
<view class=" " style="color: #FF8211;">¥ <text class=" text-bold" style="font-size: 42rpx;">{{item.price}}</text></view>
|
||||
<view class="btn">马上学习</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空数据 -->
|
||||
<empty v-if="!collectList.length"></empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
limit: 10,
|
||||
page: 1,
|
||||
collectList: [],//收藏资源
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getCollectList()
|
||||
},
|
||||
methods: {
|
||||
// 获取收藏信息
|
||||
getCollectList() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
this.$u.api.collectList(data).then(res => {
|
||||
if(res.code == 0) {
|
||||
if( this.page == 1) {
|
||||
this.collectList = res.data.records
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
this.collectList = [...this.collectList, ...res.data.records]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
goDet(e) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/course/courseDet?id=' + e
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getCollectList();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getCollectList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.btn {
|
||||
width: 150upx;
|
||||
height: 60upx;
|
||||
background: #5074FF;
|
||||
border-radius: 30upx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
</style>
|
||||
321
me/components/com-input.vue
Normal file
@@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="mix-list-cell" :class="border" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="cell-tit">{{title}}</text>
|
||||
<input
|
||||
class="main-input"
|
||||
:value="value"
|
||||
:type="_type"
|
||||
placeholder-class="placeholder-class"
|
||||
:maxlength="maxlength"
|
||||
:placeholder="placeholder"
|
||||
:password="type==='password'&&!showPassword"
|
||||
@input="onInput"
|
||||
:disabled="readOnly"
|
||||
/>
|
||||
|
||||
<!-- 是否可见密码 -->
|
||||
<image
|
||||
v-if="_isShowPass&&type==='password'&&!_isShowCode"
|
||||
class="img cuIcon"
|
||||
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'"
|
||||
@tap="showPass"
|
||||
></image>
|
||||
<!-- 倒计时 -->
|
||||
<view
|
||||
v-if="_isShowCode&&!_isShowPass"
|
||||
:class="['vercode',{'vercode-run': second>0}]"
|
||||
@click="setCode"
|
||||
>{{ getVerCodeSecond }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _this, countDown;
|
||||
/**
|
||||
* 简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
|
||||
* 比如加入image, iconSize可控等
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showPassword: false, //是否显示明文
|
||||
second: 0, //倒计时
|
||||
isRunCode: false, //是否开始倒计时
|
||||
typeList: {
|
||||
left: 'icon-zuo',
|
||||
right: 'icon-you',
|
||||
up: 'icon-shang',
|
||||
down: 'icon-xia'
|
||||
},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
readOnly: {
|
||||
//是否显示获取验证码(二选一)
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
},
|
||||
type: String, //类型
|
||||
logo: String, //类型
|
||||
value: String, //值
|
||||
placeholder: String, //框内提示
|
||||
isShowCode: {
|
||||
//是否显示获取验证码(二选一)
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
},
|
||||
codeText: {
|
||||
type: String,
|
||||
default: "获取验证码",
|
||||
},
|
||||
setTime: {
|
||||
//倒计时时间设置
|
||||
type: [Number, String],
|
||||
default: 60,
|
||||
},
|
||||
maxlength: {
|
||||
//最大长度
|
||||
type: [Number, String],
|
||||
default: 30,
|
||||
},
|
||||
isShowPass: {
|
||||
//是否显示密码图标(二选一)
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '标题'
|
||||
},
|
||||
tips: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
navigateType: {
|
||||
type: String,
|
||||
default: 'right'
|
||||
},
|
||||
border: {
|
||||
type: String,
|
||||
default: 'b-b'
|
||||
},
|
||||
hoverClass: {
|
||||
type: String,
|
||||
default: 'cell-hover'
|
||||
},
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
_this = this
|
||||
//准备触发
|
||||
this.$on('runCodes', (val) => {
|
||||
this.runCodes(val);
|
||||
});
|
||||
clearInterval(countDown);//先清理一次循环,避免缓存
|
||||
},
|
||||
methods: {
|
||||
showPass() {
|
||||
//是否显示密码
|
||||
this.showPassword = !this.showPassword
|
||||
},
|
||||
onInput(e) {
|
||||
//传出值
|
||||
this.$emit('input', e.target.value)
|
||||
},
|
||||
setCode() {
|
||||
//设置获取验证码的事件
|
||||
if (this.isRunCode) {
|
||||
//判断是否开始倒计时,避免重复点击
|
||||
return false;
|
||||
}
|
||||
this.$emit('setCode')
|
||||
},
|
||||
runCodes(val) {
|
||||
console.error("runCodes")
|
||||
//开始倒计时
|
||||
if (String(val) == "0") {
|
||||
|
||||
//判断是否需要终止循环
|
||||
this.second = 0; //初始倒计时
|
||||
clearInterval(countDown);//清理循环
|
||||
this.isRunCode = false; //关闭循环状态
|
||||
return false;
|
||||
}
|
||||
if (this.isRunCode) {
|
||||
//判断是否开始倒计时,避免重复点击
|
||||
return false;
|
||||
}
|
||||
this.isRunCode = true
|
||||
this.second = this._setTime //倒数秒数
|
||||
|
||||
let _this = this;
|
||||
countDown = setInterval(function () {
|
||||
_this.second--
|
||||
if (_this.second == 0) {
|
||||
_this.isRunCode = false
|
||||
clearInterval(countDown)
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
_type() {
|
||||
//处理值
|
||||
const type = this.type
|
||||
return type == 'password' ? 'text' : type
|
||||
},
|
||||
_isShowPass() {
|
||||
//处理值
|
||||
return String(this.isShowPass) !== 'false'
|
||||
},
|
||||
_isShowCode() {
|
||||
//处理值
|
||||
return String(this.isShowCode) !== 'false'
|
||||
},
|
||||
_setTime() {
|
||||
//处理值
|
||||
const setTime = Number(this.setTime)
|
||||
return setTime > 0 ? setTime : 60
|
||||
},
|
||||
getVerCodeSecond() {
|
||||
//验证码倒计时计算
|
||||
if (this.second <= 0) {
|
||||
return this.codeText;
|
||||
} else {
|
||||
if (this.second < 10) {
|
||||
return '0' + this.second + "s";
|
||||
} else {
|
||||
return this.second + "s";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.main-input {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
color: black;
|
||||
font-size: 16px;
|
||||
padding-right: 6px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.icon .mix-list-cell.b-b:after {
|
||||
left: 45px;
|
||||
}
|
||||
|
||||
.placeholder-class {
|
||||
color: black;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.mix-list-cell {
|
||||
/* border-radius: 16upx; */
|
||||
border-bottom: 4upx solid #F8F8F8;
|
||||
margin-top: 1px;
|
||||
font-size: 32upx;
|
||||
background: white;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
margin: 32upx;
|
||||
padding: 24upx 32upx;
|
||||
position: relative;
|
||||
|
||||
&.cell-hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&.b-b:after {
|
||||
left: 16px;
|
||||
}
|
||||
|
||||
.cell-icon {
|
||||
align-self: center;
|
||||
width: 28px;
|
||||
max-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
align-self: center;
|
||||
font-size: 16px;
|
||||
color: #606266;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.cell-tit {
|
||||
width: 80px;
|
||||
font-size: 16px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
font-size: 14px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.items {
|
||||
position: absolute;
|
||||
height: 48px;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
/*opacity:0.05;*/
|
||||
}
|
||||
|
||||
.main-list {
|
||||
opacity: 0.8;
|
||||
z-index: 88;
|
||||
background: white;
|
||||
border: 1px solid white;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 18px; /* Input 高度 */
|
||||
color: #333333;
|
||||
padding: 16px;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.vercode {
|
||||
color: #FF2638;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.vercode-run {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.oBorder {
|
||||
|
||||
border-radius: 2.5rem;
|
||||
-webkit-box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||
box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||
}
|
||||
</style>
|
||||
273
me/components/wm-poster/wm-poster.vue
Normal file
@@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<view style="background: #FFFFFF;">
|
||||
<!-- <view v-if="loading"></view> -->
|
||||
<canvas v-if="!tempFilePath" :canvas-id="CanvasID" :style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" class="is-response" @longpress="toSave(tempFilePath)"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _this;
|
||||
export default {
|
||||
name: 'wm-poster',
|
||||
props: {
|
||||
CanvasID: {
|
||||
//CanvasID 等同于 canvas-id
|
||||
Type: String,
|
||||
default: 'PosterCanvas'
|
||||
},
|
||||
imgSrc: {
|
||||
//展示图
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
QrSrc: {
|
||||
//二维码
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
Title: {
|
||||
//文本内容
|
||||
Type: String,
|
||||
default: '优享帮'
|
||||
},
|
||||
TitleColor: {
|
||||
//标题颜色
|
||||
Type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
LineType: {
|
||||
//标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||
Type: [String, Boolean],
|
||||
default: true
|
||||
},
|
||||
PriceTxt: {
|
||||
//价格值
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
PriceColor: {
|
||||
//价格颜色
|
||||
Type: String,
|
||||
default: '#e31d1a'
|
||||
},
|
||||
OriginalTxt: {
|
||||
//原价值
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
OriginalColor: {
|
||||
//默认颜色(如原价与扫描二维码颜色)
|
||||
Type: String,
|
||||
default: '#b8b8b8'
|
||||
},
|
||||
Width: {
|
||||
//画布宽度 (高度根据图片比例计算 单位upx)
|
||||
Type: String,
|
||||
default: 700
|
||||
},
|
||||
CanvasBg: {
|
||||
//canvas画布背景色
|
||||
Type: String,
|
||||
default: '#ffffff'
|
||||
},
|
||||
Referrer: {
|
||||
//推荐人信息
|
||||
Type: String,
|
||||
default: '优享帮精选好物'
|
||||
},
|
||||
ViewDetails: {
|
||||
//描述提示文字
|
||||
Type: String,
|
||||
default: '长按或扫描识别二维码领券'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
tempFilePath: '',
|
||||
canvasW: 0,
|
||||
canvasH: 0,
|
||||
canvasImgSrc: '',
|
||||
ctx: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toSave(url) {
|
||||
//#ifndef H5
|
||||
uni.getImageInfo({
|
||||
src: url,
|
||||
success: function(image) {
|
||||
console.log('图片信息:', JSON.stringify(image));
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: image.path,
|
||||
success: function() {
|
||||
console.log('save success');
|
||||
uni.showToast({
|
||||
title: '海报已保存相册',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//#endif
|
||||
},
|
||||
async OnCanvas() {
|
||||
this.loading = true;
|
||||
// this.$queue.showLoading('海报生成中...');
|
||||
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||
C_P = uni.upx2px(30), //canvas Paddng 间距
|
||||
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||
let _strlineW = 0; //文本宽度
|
||||
let _imgInfo = await _this.getImageInfo({
|
||||
imgSrc: _this.imgSrc
|
||||
}); //广告图
|
||||
let _QrCode = await _this.getImageInfo({
|
||||
imgSrc: _this.QrSrc
|
||||
}); //二维码或太阳码
|
||||
let r = [_imgInfo.width, _imgInfo.height];
|
||||
let q = [_QrCode.width, _QrCode.height];
|
||||
let imgW = C_W - C_P * 2;
|
||||
if (r[0] != imgW) {
|
||||
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||
r[0] = imgW;
|
||||
}
|
||||
if (q[0] != C_Q) {
|
||||
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||
q[0] = C_Q;
|
||||
}
|
||||
_this.canvasW = C_W;
|
||||
_this.canvasH = r[1] + q[1] + 128;
|
||||
_this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||
|
||||
//添加图片展示
|
||||
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], r[1]);
|
||||
//添加图片展示 end
|
||||
|
||||
//设置文本
|
||||
//#ifdef H5
|
||||
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||
//#endif
|
||||
//#ifdef APP-PLUS
|
||||
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||
_this.Title=_this.Title.substring(0,20)
|
||||
//#endif
|
||||
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||
let _num = 1;
|
||||
for (let i = 0; i < _this.Title.length; i++) {
|
||||
_strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||
if (_strlineW > r[0]) {
|
||||
if (_num == 2 && _this.LineType) {
|
||||
//文字换行数量大于二进行省略号处理
|
||||
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||
_strlineW = 0;
|
||||
_strLastIndex = i;
|
||||
_num++;
|
||||
break;
|
||||
} else {
|
||||
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||
_strlineW = 0;
|
||||
_strHeight += 20;
|
||||
_strLastIndex = i;
|
||||
_num++;
|
||||
}
|
||||
} else if (i == _this.Title.length - 1) {
|
||||
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||
_strlineW = 0;
|
||||
}
|
||||
}
|
||||
//设置文本 end
|
||||
//设置价格
|
||||
_strlineW = C_P;
|
||||
_strHeight += uni.upx2px(60);
|
||||
if (_num == 1) {
|
||||
_strHeight += 20; //单行标题时占位符
|
||||
}
|
||||
if (_this.PriceTxt != '') {
|
||||
//判断是否有销售价格
|
||||
_this.ctx.setFillStyle(_this.PriceColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(38));
|
||||
_this.ctx.fillText('券后价 ¥' + _this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||
_strlineW += _this.ctx.measureText('券后价 ¥' + _this.PriceTxt).width + uni.upx2px(10);
|
||||
}
|
||||
// #ifdef H5
|
||||
if (_this.PriceTxt != '' && _this.OriginalTxt != '') {
|
||||
//判断是否有销售价格且原价
|
||||
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(24));
|
||||
_this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||
}
|
||||
// #endif
|
||||
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(10)); //终点
|
||||
_this.ctx.stroke();
|
||||
//设置价格 end
|
||||
|
||||
//添加二维码
|
||||
_strHeight += uni.upx2px(20);
|
||||
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||
//添加二维码 end
|
||||
|
||||
//添加推荐人与描述
|
||||
_this.ctx.setFillStyle(_this.TitleColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(30));
|
||||
_this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(24));
|
||||
_this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||
//添加推荐人与描述 end
|
||||
//延迟后渲染至canvas上
|
||||
setTimeout(function() {
|
||||
_this.ctx.draw(true, ret => {
|
||||
_this.getNewImage();
|
||||
});
|
||||
}, 600);
|
||||
},
|
||||
async getImageInfo({
|
||||
imgSrc
|
||||
}) {
|
||||
return new Promise((resolve, errs) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
success: function(image) {
|
||||
resolve(image);
|
||||
},
|
||||
fail(err) {
|
||||
errs(err);
|
||||
_this.$queue.showToast('海报生成失败');
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getNewImage() {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: _this.CanvasID,
|
||||
quality: 1,
|
||||
complete: res => {
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
_this.loading = false;
|
||||
_this.$queue.showToast('长按图片保存海报');
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
this
|
||||
);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
_this = this;
|
||||
this.OnCanvas();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
321
me/components/wm-poster/wm-posterorders.vue
Normal file
@@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<view style="background: #FFFFFF;">
|
||||
<canvas v-if="!tempFilePath" :canvas-id="CanvasID"
|
||||
:style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="saveqrcode"></image>
|
||||
<!-- <button v-if="openSettingBtnHidden" class="purple_btn btn_box" hover-class="none" open-type="openSetting"
|
||||
@opensetting='handleSetting'>请开启保存权限</button> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="toSave(tempFilePath)"></image>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _this;
|
||||
export default {
|
||||
name: 'wm-poster',
|
||||
props: {
|
||||
CanvasID: {
|
||||
//CanvasID 等同于 canvas-id
|
||||
Type: String,
|
||||
default: 'PosterCanvas'
|
||||
},
|
||||
imgSrc: {
|
||||
//展示图
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
QrSrc: {
|
||||
//二维码
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
Title: {
|
||||
//文本内容
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
TitleColor: {
|
||||
//标题颜色
|
||||
Type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
LineType: {
|
||||
//标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||
Type: [String, Boolean],
|
||||
default: true
|
||||
},
|
||||
PriceTxt: {
|
||||
//价格值
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
PriceColor: {
|
||||
//价格颜色
|
||||
Type: String,
|
||||
default: '#e31d1a'
|
||||
},
|
||||
OriginalTxt: {
|
||||
//原价值
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
OriginalColor: {
|
||||
//默认颜色(如原价与扫描二维码颜色)
|
||||
Type: String,
|
||||
default: '#b8b8b8'
|
||||
},
|
||||
Width: {
|
||||
//画布宽度 (高度根据图片比例计算 单位upx)
|
||||
Type: String,
|
||||
default: 700
|
||||
},
|
||||
CanvasBg: {
|
||||
//canvas画布背景色
|
||||
Type: String,
|
||||
default: '#ffffff'
|
||||
},
|
||||
Referrer: {
|
||||
//推荐人信息
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
ViewDetails: {
|
||||
//描述提示文字
|
||||
Type: String,
|
||||
default: '长按或扫描识别二维码进入'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
tempFilePath: '',
|
||||
canvasW: 0,
|
||||
canvasH: 0,
|
||||
canvasImgSrc: '',
|
||||
ctx: null,
|
||||
openSettingBtnHidden: true //是否授权
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
saveqrcode() {
|
||||
var that = this
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.tempFilePath, // canvas 标签的 id 或 canvas-id
|
||||
success: function(res) {
|
||||
uni.showToast({
|
||||
title: '海报已保存相册',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
toSave(url) {
|
||||
//#ifdef APP-PLUS || MP-TOUTIAO || MP-KUAISHOU
|
||||
uni.getImageInfo({
|
||||
src: url,
|
||||
success: function(image) {
|
||||
console.log('图片信息:', JSON.stringify(image));
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: image.path,
|
||||
success: function() {
|
||||
console.log('save success');
|
||||
uni.showToast({
|
||||
title: '海报已保存相册',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//#endif
|
||||
},
|
||||
async OnCanvas() {
|
||||
this.loading = true;
|
||||
// this.$queue.showLoading('海报生成中...');
|
||||
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||
C_P = uni.upx2px(0), //canvas Paddng 间距
|
||||
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||
let _strlineW = 0; //文本宽度
|
||||
let _imgInfo = await _this.getImageInfo({
|
||||
imgSrc: _this.imgSrc
|
||||
}); //广告图
|
||||
let _QrCode = await _this.getImageInfo({
|
||||
imgSrc: _this.QrSrc
|
||||
}); //二维码或太阳码
|
||||
let r = [_imgInfo.width, _imgInfo.height];
|
||||
let q = [_QrCode.width, _QrCode.height];
|
||||
let imgW = C_W - (C_P * 2.5);
|
||||
if (r[0] != imgW) {
|
||||
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||
r[0] = imgW;
|
||||
}
|
||||
if (q[0] != C_Q) {
|
||||
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||
q[0] = C_Q;
|
||||
}
|
||||
_this.canvasW = C_W;
|
||||
_this.canvasH = r[1] + q[1] + 25;
|
||||
_this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||
|
||||
//添加图片展示
|
||||
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], r[1]);
|
||||
//添加图片展示 end
|
||||
|
||||
//设置文本
|
||||
//#ifdef H5
|
||||
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||
//#endif
|
||||
//#ifdef MP-WEIXIN
|
||||
_this.ctx.setFontSize(uni.upx2px(34)); //设置标题字体大小
|
||||
//#endif
|
||||
//#ifdef APP-PLUS
|
||||
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||
_this.Title = _this.Title.substring(0, 20)
|
||||
//#endif
|
||||
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||
let _num = 1;
|
||||
// for (let i = 0; i < _this.Title.length; i++) {
|
||||
// _strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||
// if (_strlineW > r[0]) {
|
||||
// if (_num == 2 && _this.LineType) {
|
||||
// //文字换行数量大于二进行省略号处理
|
||||
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||
// _strlineW = 0;
|
||||
// _strLastIndex = i;
|
||||
// _num++;
|
||||
// break;
|
||||
// } else {
|
||||
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||
// _strlineW = 0;
|
||||
// _strHeight += 20;
|
||||
// _strLastIndex = i;
|
||||
// _num++;
|
||||
// }
|
||||
// } else if (i == _this.Title.length - 1) {
|
||||
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||
// _strlineW = 0;
|
||||
// }
|
||||
// }
|
||||
//设置文本 end
|
||||
//设置价格
|
||||
_strlineW = C_P;
|
||||
_strHeight += uni.upx2px(60);
|
||||
if (_num == 1) {
|
||||
_strHeight += 20; //单行标题时占位符
|
||||
}
|
||||
// if (_this.PriceTxt != '') {
|
||||
// //判断是否有销售价格
|
||||
// _this.ctx.setFillStyle(_this.PriceColor);
|
||||
// _this.ctx.setFontSize(uni.upx2px(38));
|
||||
// _this.ctx.fillText('现价 ¥' + _this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||
// _strlineW += _this.ctx.measureText('现价 ¥' + _this.PriceTxt).width + uni.upx2px(10);
|
||||
// }
|
||||
// // #ifdef H5
|
||||
// if (_this.PriceTxt != '' && _this.OriginalTxt != '') {
|
||||
// //判断是否有销售价格且原价
|
||||
// _this.ctx.setFillStyle(_this.OriginalColor);
|
||||
// _this.ctx.setFontSize(uni.upx2px(24));
|
||||
// _this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||
// }
|
||||
// #endif
|
||||
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(
|
||||
10)); //终点
|
||||
_this.ctx.stroke();
|
||||
//设置价格 end
|
||||
|
||||
//添加二维码
|
||||
_strHeight += uni.upx2px(20);
|
||||
let toTop = uni.upx2px(20);
|
||||
// _this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P - uni.upx2px(20), _this.canvasH - q[1] - toTop, q[
|
||||
0], q[1]);
|
||||
//添加二维码 end
|
||||
|
||||
//添加推荐人与描述
|
||||
_this.ctx.setFillStyle(_this.TitleColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(30));
|
||||
// _this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||
_this.ctx.fillText(_this.Referrer, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2);
|
||||
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(24));
|
||||
// _this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||
_this.ctx.fillText(_this.ViewDetails, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2 +
|
||||
20);
|
||||
//添加推荐人与描述 end
|
||||
//延迟后渲染至canvas上
|
||||
setTimeout(function() {
|
||||
_this.ctx.draw(true, ret => {
|
||||
_this.getNewImage();
|
||||
});
|
||||
}, 600);
|
||||
},
|
||||
async getImageInfo({
|
||||
imgSrc
|
||||
}) {
|
||||
return new Promise((resolve, errs) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
success: function(image) {
|
||||
resolve(image);
|
||||
},
|
||||
fail(err) {
|
||||
errs(err);
|
||||
_this.$queue.showToast('海报生成失败');
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getNewImage() {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: _this.CanvasID,
|
||||
quality: 1,
|
||||
complete: res => {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
} else {
|
||||
_this.$emit('successH5', res.tempFilePath);
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
// #endif
|
||||
_this.loading = false;
|
||||
uni.showToast({
|
||||
title: '长按图片保存海报',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
this
|
||||
);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
_this = this;
|
||||
this.OnCanvas();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
324
me/components/wm-poster/wm-posterordershd.vue
Normal file
@@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<view>
|
||||
<canvas v-if="!tempFilePath" :canvas-id="CanvasID"
|
||||
:style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="saveqrcode"></image>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-TOUTIAO -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="saveqrcode"></image>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="toSave(tempFilePath)"></image>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _this;
|
||||
export default {
|
||||
name: 'wm-poster',
|
||||
props: {
|
||||
CanvasID: {
|
||||
//CanvasID 等同于 canvas-id
|
||||
Type: String,
|
||||
default: 'PosterCanvas'
|
||||
},
|
||||
imgSrc: {
|
||||
//展示图
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
QrSrc: {
|
||||
//二维码
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
Title: {
|
||||
//文本内容
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
TitleColor: {
|
||||
//标题颜色
|
||||
Type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
LineType: {
|
||||
//标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||
Type: [String, Boolean],
|
||||
default: true
|
||||
},
|
||||
PriceTxt: {
|
||||
//价格值
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
PriceColor: {
|
||||
//价格颜色
|
||||
Type: String,
|
||||
default: '#e31d1a'
|
||||
},
|
||||
OriginalTxt: {
|
||||
//原价值
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
OriginalColor: {
|
||||
//默认颜色(如原价与扫描二维码颜色)
|
||||
Type: String,
|
||||
default: '#b8b8b8'
|
||||
},
|
||||
Width: {
|
||||
//画布宽度 (高度根据图片比例计算 单位upx)
|
||||
Type: String,
|
||||
default: 700
|
||||
},
|
||||
CanvasBg: {
|
||||
//canvas画布背景色
|
||||
Type: String,
|
||||
default: '#ffffff'
|
||||
},
|
||||
Referrer: {
|
||||
//推荐人信息
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
ViewDetails: {
|
||||
//描述提示文字
|
||||
Type: String,
|
||||
default: '长按或扫描识别二维码进入'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
tempFilePath: '',
|
||||
canvasW: 0,
|
||||
canvasH: 0,
|
||||
canvasImgSrc: '',
|
||||
ctx: null,
|
||||
openSettingBtnHidden: true //是否授权
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
saveqrcode() {
|
||||
var that = this
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.tempFilePath, // canvas 标签的 id 或 canvas-id
|
||||
success: function(res) {
|
||||
uni.showToast({
|
||||
title: '海报已保存相册',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
toSave(url) {
|
||||
//#ifdef APP-PLUS
|
||||
uni.getImageInfo({
|
||||
src: url,
|
||||
success: function(image) {
|
||||
console.log('图片信息:', JSON.stringify(image));
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: image.path,
|
||||
success: function() {
|
||||
console.log('save success');
|
||||
uni.showToast({
|
||||
title: '海报已保存相册',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//#endif
|
||||
},
|
||||
async OnCanvas() {
|
||||
this.loading = true;
|
||||
// this.$queue.showLoading('海报生成中...');
|
||||
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||
C_P = uni.upx2px(0), //canvas Paddng 间距
|
||||
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||
let _strlineW = 0; //文本宽度
|
||||
let _imgInfo = await _this.getImageInfo({
|
||||
imgSrc: _this.imgSrc
|
||||
}); //广告图
|
||||
let _QrCode = await _this.getImageInfo({
|
||||
imgSrc: _this.QrSrc
|
||||
}); //二维码或太阳码
|
||||
let r = [_imgInfo.width, _imgInfo.height];
|
||||
let q = [_QrCode.width, _QrCode.height];
|
||||
let imgW = C_W - (C_P * 2.5);
|
||||
if (r[0] != imgW) {
|
||||
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||
r[0] = imgW;
|
||||
}
|
||||
if (q[0] != C_Q) {
|
||||
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||
q[0] = C_Q;
|
||||
}
|
||||
_this.canvasW = C_W;
|
||||
_this.canvasH = r[1];
|
||||
// _this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||
|
||||
//添加图片展示
|
||||
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], _this.canvasH);
|
||||
//添加图片展示 end
|
||||
|
||||
//设置文本
|
||||
//#ifdef H5
|
||||
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||
//#endif
|
||||
//#ifdef MP-WEIXIN
|
||||
_this.ctx.setFontSize(uni.upx2px(34)); //设置标题字体大小
|
||||
//#endif
|
||||
//#ifdef APP-PLUS
|
||||
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||
_this.Title = _this.Title.substring(0, 20)
|
||||
//#endif
|
||||
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||
let _num = 1;
|
||||
// for (let i = 0; i < _this.Title.length; i++) {
|
||||
// _strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||
// if (_strlineW > r[0]) {
|
||||
// if (_num == 2 && _this.LineType) {
|
||||
// //文字换行数量大于二进行省略号处理
|
||||
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||
// _strlineW = 0;
|
||||
// _strLastIndex = i;
|
||||
// _num++;
|
||||
// break;
|
||||
// } else {
|
||||
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||
// _strlineW = 0;
|
||||
// _strHeight += 20;
|
||||
// _strLastIndex = i;
|
||||
// _num++;
|
||||
// }
|
||||
// } else if (i == _this.Title.length - 1) {
|
||||
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||
// _strlineW = 0;
|
||||
// }
|
||||
// }
|
||||
//设置文本 end
|
||||
//设置价格
|
||||
_strlineW = C_P;
|
||||
_strHeight += uni.upx2px(60);
|
||||
if (_num == 1) {
|
||||
_strHeight += 20; //单行标题时占位符
|
||||
}
|
||||
// if (_this.PriceTxt != '') {
|
||||
// //判断是否有销售价格
|
||||
// _this.ctx.setFillStyle(_this.PriceColor);
|
||||
// _this.ctx.setFontSize(uni.upx2px(38));
|
||||
// _this.ctx.fillText('现价 ¥' + _this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||
// _strlineW += _this.ctx.measureText('现价 ¥' + _this.PriceTxt).width + uni.upx2px(10);
|
||||
// }
|
||||
// // #ifdef H5
|
||||
// if (_this.PriceTxt != '' && _this.OriginalTxt != '') {
|
||||
// //判断是否有销售价格且原价
|
||||
// _this.ctx.setFillStyle(_this.OriginalColor);
|
||||
// _this.ctx.setFontSize(uni.upx2px(24));
|
||||
// _this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||
// }
|
||||
// #endif
|
||||
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(
|
||||
10)); //终点
|
||||
_this.ctx.stroke();
|
||||
//设置价格 end
|
||||
|
||||
//添加二维码
|
||||
_strHeight += uni.upx2px(20);
|
||||
let toTop = uni.upx2px(20);
|
||||
// _this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||
_this.ctx.drawImage(_QrCode.path, _this.canvasW / 2 - q[0] / 2 + uni.upx2px(25), _this.canvasH / 2 - q[
|
||||
1] / 2 + uni.upx2px(20), q[0], q[
|
||||
1]);
|
||||
//添加二维码 end
|
||||
|
||||
//添加推荐人与描述
|
||||
_this.ctx.setFillStyle(_this.TitleColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(30));
|
||||
// _this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||
// _this.ctx.fillText(_this.Referrer, C_P, _this.canvasH - q[1] - toTop + q[1] / 2);
|
||||
_this.ctx.setFillStyle('red');
|
||||
_this.ctx.setFontSize(uni.upx2px(24));
|
||||
// _this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||
_this.ctx.fillText('扫一扫,注册领会员', _this.canvasW / 2 - q[0] / 2 - uni.upx2px(5), _this.canvasH / 2 - q[
|
||||
1] / 2 - uni.upx2px(10));
|
||||
//添加推荐人与描述 end
|
||||
//延迟后渲染至canvas上
|
||||
setTimeout(function() {
|
||||
_this.ctx.draw(true, ret => {
|
||||
_this.getNewImage();
|
||||
});
|
||||
}, 600);
|
||||
},
|
||||
async getImageInfo({
|
||||
imgSrc
|
||||
}) {
|
||||
return new Promise((resolve, errs) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
success: function(image) {
|
||||
resolve(image);
|
||||
},
|
||||
fail(err) {
|
||||
errs(err);
|
||||
_this.$queue.showToast('海报生成失败');
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getNewImage() {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: _this.CanvasID,
|
||||
quality: 1,
|
||||
complete: res => {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
} else {
|
||||
_this.$emit('successH5', res.tempFilePath);
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
// #endif
|
||||
_this.loading = false;
|
||||
uni.showToast({
|
||||
title: '长按图片保存海报',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
this
|
||||
);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
_this = this;
|
||||
this.OnCanvas();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
261
me/components/wm-poster/wm-posters.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<view style="background: #FFFFFF;">
|
||||
<canvas v-if="!tempFilePath" :canvas-id="CanvasID" :style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" class="is-response" @longpress="toSave(tempFilePath)"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _this;
|
||||
export default {
|
||||
name: 'wm-poster',
|
||||
props: {
|
||||
CanvasID: { //CanvasID 等同于 canvas-id
|
||||
Type: String,
|
||||
default: 'PosterCanvas'
|
||||
},
|
||||
imgSrc: { //展示图
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
QrSrc: { //二维码
|
||||
Type: String,
|
||||
default: ''
|
||||
},
|
||||
Title: { //文本内容
|
||||
Type: String,
|
||||
default: '优享帮'
|
||||
},
|
||||
TitleColor: { //标题颜色
|
||||
Type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
LineType: { //标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||
Type: [String, Boolean],
|
||||
default: true
|
||||
},
|
||||
PriceTxt: { //价格值
|
||||
Type: String,
|
||||
default: '99.99'
|
||||
},
|
||||
PriceColor: { //价格颜色
|
||||
Type: String,
|
||||
default: '#e31d1a'
|
||||
},
|
||||
OriginalTxt: { //原价值
|
||||
Type: String,
|
||||
default: '199.99'
|
||||
},
|
||||
OriginalColor: { //默认颜色(如原价与扫描二维码颜色)
|
||||
Type: String,
|
||||
default: '#b8b8b8'
|
||||
},
|
||||
Width: { //画布宽度 (高度根据图片比例计算 单位upx)
|
||||
Type: String,
|
||||
default: 700
|
||||
},
|
||||
CanvasBg: { //canvas画布背景色
|
||||
Type: String,
|
||||
default: '#ffffff'
|
||||
},
|
||||
Referrer: { //推荐人信息
|
||||
Type: String,
|
||||
default: '优享帮精选好物'
|
||||
},
|
||||
ViewDetails: { //描述提示文字
|
||||
Type: String,
|
||||
default: '长按或扫描二维码免费领取'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tempFilePath: '',
|
||||
canvasW: 0,
|
||||
canvasH: 0,
|
||||
canvasImgSrc: '',
|
||||
ctx: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toSave(url) {
|
||||
//#ifndef H5
|
||||
uni.getImageInfo({
|
||||
src: url,
|
||||
success: function(image) {
|
||||
console.log('图片信息:', JSON.stringify(image));
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: image.path,
|
||||
success: function() {
|
||||
console.log('save success');
|
||||
uni.showToast({
|
||||
title: '海报已保存相册',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//#endif
|
||||
},
|
||||
async OnCanvas() {
|
||||
|
||||
this.$queue.showLoading('海报生成中...');
|
||||
|
||||
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||
C_P = uni.upx2px(30), //canvas Paddng 间距
|
||||
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||
let _strlineW = 0; //文本宽度
|
||||
let _imgInfo = await _this.getImageInfo({
|
||||
imgSrc: _this.imgSrc
|
||||
}); //广告图
|
||||
let _QrCode = await _this.getImageInfo({
|
||||
imgSrc: _this.QrSrc
|
||||
}); //二维码或太阳码
|
||||
let r = [_imgInfo.width, _imgInfo.height];
|
||||
let q = [_QrCode.width, _QrCode.height];
|
||||
let imgW = C_W - C_P * 2;
|
||||
if (r[0] != imgW) {
|
||||
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||
r[0] = imgW;
|
||||
}
|
||||
if (q[0] != C_Q) {
|
||||
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||
q[0] = C_Q;
|
||||
}
|
||||
_this.canvasW = C_W;
|
||||
_this.canvasH = r[1] + q[1] + 128;
|
||||
_this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||
|
||||
//添加图片展示
|
||||
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], r[1]);
|
||||
//添加图片展示 end
|
||||
|
||||
//设置文本
|
||||
//#ifdef H5
|
||||
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||
//#endif
|
||||
//#ifndef H5
|
||||
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||
//#endif
|
||||
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||
let _num = 1;
|
||||
for (let i = 0; i < _this.Title.length; i++) {
|
||||
_strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||
if (_strlineW > r[0]) {
|
||||
if (_num == 2 && _this.LineType) {
|
||||
//文字换行数量大于二进行省略号处理
|
||||
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||
_strlineW = 0;
|
||||
_strLastIndex = i;
|
||||
_num++;
|
||||
break;
|
||||
} else {
|
||||
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||
_strlineW = 0;
|
||||
_strHeight += 20;
|
||||
_strLastIndex = i;
|
||||
_num++;
|
||||
}
|
||||
} else if (i == _this.Title.length - 1) {
|
||||
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||
_strlineW = 0;
|
||||
}
|
||||
}
|
||||
//设置文本 end
|
||||
|
||||
//设置价格
|
||||
_strlineW = C_P;
|
||||
_strHeight += uni.upx2px(60);
|
||||
if (_num == 1) {
|
||||
_strHeight += 20; //单行标题时占位符
|
||||
}
|
||||
|
||||
if (_this.PriceTxt != '') { //判断是否有销售价格
|
||||
_this.ctx.setFillStyle(_this.PriceColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(38));
|
||||
_this.ctx.fillText(_this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||
_strlineW += _this.ctx.measureText(_this.PriceTxt).width + uni.upx2px(10);
|
||||
}
|
||||
if (_this.PriceTxt != '' && _this.OriginalTxt != '') { //判断是否有销售价格且原价
|
||||
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(24));
|
||||
_this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||
}
|
||||
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(10)); //终点
|
||||
_this.ctx.stroke();
|
||||
//设置价格 end
|
||||
|
||||
//添加二维码
|
||||
_strHeight += uni.upx2px(20);
|
||||
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||
//添加二维码 end
|
||||
|
||||
//添加推荐人与描述
|
||||
_this.ctx.setFillStyle(_this.TitleColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(30));
|
||||
_this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(24));
|
||||
_this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||
//添加推荐人与描述 end
|
||||
|
||||
//延迟后渲染至canvas上
|
||||
setTimeout(function() {
|
||||
_this.ctx.draw(true, (ret) => {
|
||||
_this.getNewImage();
|
||||
});
|
||||
|
||||
}, 600);
|
||||
// setTimeout(function () {
|
||||
// uni.hideLoading();
|
||||
|
||||
// }, 3000);
|
||||
},
|
||||
async getImageInfo({
|
||||
imgSrc
|
||||
}) {
|
||||
return new Promise((resolve, errs) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
success: function(image) {
|
||||
resolve(image);
|
||||
},
|
||||
fail(err) {
|
||||
errs(err);
|
||||
uni.hideLoading();
|
||||
_this.$queue.showToast("海报生成失败")
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
getNewImage() {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: _this.CanvasID,
|
||||
quality: 1,
|
||||
complete: (res) => {
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
_this.$queue.showToast("长按图片保存海报")
|
||||
// uni.hideLoading();
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
_this = this;
|
||||
this.OnCanvas();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
301
me/course/index.vue
Normal file
@@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<view class="page-box">
|
||||
<view class="order" v-if="courseList.length" v-for="(item, index) in courseList" :key="index"
|
||||
@click="goCourse(item.courseId)">
|
||||
<view class="item">
|
||||
<view class="left">
|
||||
<image :src="item.titleImg" mode="aspectFill" style="width: 200rpx;height: 200rpx;"></image>
|
||||
</view>
|
||||
<view class="flex-sub content flex flex-direction justify-between" style="width:420rpx;">
|
||||
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{item.title}}
|
||||
</view>
|
||||
<view class="text-gray text-26 margin-top">最近{{item.payNum}}人在学 </view>
|
||||
<view class="flex align-center justify-between">
|
||||
<view class=" " style="color: #FF8211;">¥ <text class=" text-bold"
|
||||
style="font-size: 42rpx;">{{item.price}}</text></view>
|
||||
<view class="btn">马上学习</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="content flex-sub flex flex-direction justify-between">
|
||||
<view class="flex flex-direction justify-between flex-sub">
|
||||
<view class="title u-line-2" style="width: 380rpx;">{{ item.title }}</view>
|
||||
<view class="buttom margin-top">
|
||||
<view class="price">
|
||||
¥{{ priceInt(item.price) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex margin-top-sm">
|
||||
<view>
|
||||
<u-avatar v-for="(ite,ind) in item.avatar" :key='ind' v-if="ind < 3" class="head" size="44" :src="ite"></u-avatar>
|
||||
</view>
|
||||
<view class="text-gray number">{{item.courseCount}}人已观看</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空数据 -->
|
||||
<empty v-if="!courseList.length" title="暂无资源"></empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
userId: '',
|
||||
courseList: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.userId = uni.getStorageSync('userId')
|
||||
this.getCourseList()
|
||||
},
|
||||
methods: {
|
||||
// 我的资源列表
|
||||
getCourseList() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
this.$u.api.selectCourse(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.list.forEach(ret => {
|
||||
if (ret.avatar) {
|
||||
ret.avatar = ret.avatar.split(',')
|
||||
}
|
||||
})
|
||||
if (this.page == 1) {
|
||||
this.courseList = res.data.list
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
this.courseList = [...this.courseList, ...res.data.list]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
// 跳转资源详情
|
||||
goCourse(e) {
|
||||
console.log(e)
|
||||
let userId = uni.getStorageSync('userId')
|
||||
if (userId) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/course/courseDet?id=' + e
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getCourseList();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.courseList = []
|
||||
this.getCourseList();
|
||||
},
|
||||
computed: {
|
||||
// 价格小数
|
||||
priceDecimal() {
|
||||
return val => {
|
||||
if (val !== parseInt(val)) return val.slice(-2);
|
||||
else return '00';
|
||||
};
|
||||
},
|
||||
// 价格整数
|
||||
priceInt() {
|
||||
return val => {
|
||||
// if (val !== parseInt(val)) return val.split('.')[0];
|
||||
// else return val;
|
||||
return val
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn {
|
||||
width: 150upx;
|
||||
height: 60upx;
|
||||
background: #5074FF;
|
||||
border-radius: 30upx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.order {
|
||||
width: 700rpx;
|
||||
background-color: #ffffff;
|
||||
margin: 20rpx auto;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.store {
|
||||
margin: 0 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
color: $u-type-warning-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 280rpx;
|
||||
height: 240rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.title {
|
||||
font-size: 16px;
|
||||
line-height: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.buttom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #E6E6E6;
|
||||
|
||||
.price {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #FF3838;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.head1 {
|
||||
position: relative;
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
.head2 {
|
||||
position: relative;
|
||||
left: -10px;
|
||||
}
|
||||
|
||||
.number {
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.total {
|
||||
margin-top: 20rpx;
|
||||
text-align: right;
|
||||
font-size: 24rpx;
|
||||
|
||||
.total-price {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
margin-top: 40rpx;
|
||||
padding: 0 10rpx;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.btn {
|
||||
line-height: 52rpx;
|
||||
width: 160rpx;
|
||||
border-radius: 26rpx;
|
||||
border: 2rpx solid $u-border-color;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
color: $u-type-info-dark;
|
||||
}
|
||||
|
||||
.evaluate {
|
||||
color: $u-type-warning-dark;
|
||||
border-color: $u-type-warning-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
|
||||
image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
border: 1px dotted #000000;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 40rpx;
|
||||
color: #5074FF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #5074FF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1842
me/detail/detail.nvue
Normal file
1908
me/detail/detail.vue
Normal file
1896
me/detail/detailIOS.nvue
Normal file
4
me/detail/explain.md
Normal file
@@ -0,0 +1,4 @@
|
||||
注意:由于app环境下ios跟Android存在差异,故需要分别适配
|
||||
detail.nvue文件默认为Android版本,打包则用这个
|
||||
如果打ios包,请把detailIOS.nvue改名为detail.nvue,原来的detail.nvue改为其他名称打包即可
|
||||
打安卓包同样操作即可
|
||||
208
me/feedback/index.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="feedback-title">
|
||||
<text>问题和意见</text>
|
||||
<text @tap="chooseMsg">快速键入</text>
|
||||
</view>
|
||||
<view class="feedback-body" style="background: #F5F5F5;">
|
||||
<textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" />
|
||||
</view>
|
||||
<view class="feedback-title">
|
||||
<text>QQ/邮箱</text>
|
||||
</view>
|
||||
<view class="feedback-body">
|
||||
<input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " />
|
||||
</view>
|
||||
|
||||
<button style="" class="feedback-submit" @tap="send">提交</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
|
||||
stars: [1, 2, 3, 4, 5],
|
||||
imageList: [],
|
||||
sendDate: {
|
||||
score: 5,
|
||||
content: '',
|
||||
contact: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
let deviceInfo = {
|
||||
appid: plus.runtime.appid,
|
||||
imei: plus.device.imei, //设备标识
|
||||
p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
|
||||
md: plus.device.model, //设备型号
|
||||
app_version: plus.runtime.version,
|
||||
plus_version: plus.runtime.innerVersion, //基座版本号
|
||||
os: plus.os.version,
|
||||
net: '' + plus.networkinfo.getCurrentType()
|
||||
};
|
||||
this.sendDate = Object.assign(deviceInfo, this.sendDate);
|
||||
},
|
||||
methods: {
|
||||
close(e) {
|
||||
this.imageList.splice(e, 1);
|
||||
},
|
||||
chooseMsg() {
|
||||
//快速输入
|
||||
uni.showActionSheet({
|
||||
itemList: this.msgContents,
|
||||
success: res => {
|
||||
this.sendDate.content = this.msgContents[res.tapIndex];
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseImg() {
|
||||
//选择图片
|
||||
uni.chooseImage({
|
||||
sourceType: ['camera', 'album'],
|
||||
sizeType: 'compressed',
|
||||
count: 8 - this.imageList.length,
|
||||
success: res => {
|
||||
this.imageList = this.imageList.concat(res.tempFilePaths);
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseStar(e) {
|
||||
//点击评星
|
||||
this.sendDate.score = e;
|
||||
},
|
||||
previewImage() {
|
||||
//预览图片
|
||||
uni.previewImage({
|
||||
urls: this.imageList
|
||||
});
|
||||
},
|
||||
send() {
|
||||
//发送反馈
|
||||
console.log(JSON.stringify(this.sendDate));
|
||||
|
||||
if (!this.sendDate.content) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入反馈内容'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (this.$queue.getChatSearchKeys(this.sendDate.content)) {
|
||||
// uni.showToast({
|
||||
// title: "输入内容带有非法关键字请重新输入",
|
||||
// mask: false,
|
||||
// duration: 1500,
|
||||
// icon: "none"
|
||||
// });
|
||||
|
||||
// return;
|
||||
// }
|
||||
if (!this.sendDate.contact) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请填写QQ或邮箱'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// this.$queue.showLoading('加载中...');
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
this.$u.post('/app/message/insertMessage', {
|
||||
title: this.sendDate.contact,
|
||||
content: JSON.stringify(this.sendDate),
|
||||
state: 2
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '投诉成功'
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '投诉失败',
|
||||
content: res.msg
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@font-face {
|
||||
font-family: uniicons;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
|
||||
/*问题反馈*/
|
||||
.feedback-title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20upx;
|
||||
color: #8f8f94;
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
.feedback-star-view.feedback-title {
|
||||
justify-content: flex-start;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.feedback-body {
|
||||
|
||||
font-size: 32upx;
|
||||
padding: 16upx;
|
||||
margin: 16upx;
|
||||
border-radius: 16upx;
|
||||
background: #F5F5F5;
|
||||
/* color: #FFF; */
|
||||
}
|
||||
|
||||
.feedback-textare {
|
||||
height: 200upx;
|
||||
font-size: 32upx;
|
||||
line-height: 50upx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
// padding: 20upx 30upx 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.feedback-input {
|
||||
font-size: 32upx;
|
||||
height: 60upx;
|
||||
// padding: 15upx 20upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
|
||||
|
||||
.feedback-submit {
|
||||
background: #ff7581;
|
||||
color: #ffffff;
|
||||
margin: 20upx;
|
||||
margin-top: 32upx;
|
||||
}
|
||||
</style>
|
||||
243
me/feedbackIndex/feedbackIndex.vue
Normal file
@@ -0,0 +1,243 @@
|
||||
<!-- 帮助反馈页面 -->
|
||||
<template>
|
||||
<view>
|
||||
<!-- <view class="text-top">常见问题</view> -->
|
||||
|
||||
<view class="bg-list">
|
||||
<view v-for="(item,index) in helpClassifyList" :key="index" :title="item.helpClassifyName"
|
||||
class="list-title padding-bottom">
|
||||
<view class="flex align-center justify-between" @click.stop="openList(item)">
|
||||
<view class="text-title">{{item.helpClassifyName}}</view>
|
||||
<view @click.stop="openList(item)" >
|
||||
<image src="../static/up.png" style="width: 21rpx;height: 15rpx;" v-if="item.parentId==0"></image>
|
||||
<image src="../static/dowm.png" style="width: 21rpx;height: 15rpx;" v-else></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(problemItem,problemIndex) in item.helpWordList" :key="problemIndex" class="list-question"
|
||||
hover-class="hover" @click="onClick(problemItem)" v-if="item.parentId==0">
|
||||
<view class="text-item">{{problemItem.helpWordTitle}}</view>
|
||||
<view class="line" v-if="problemIndex!=item.helpWordList.length-1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-box">
|
||||
<view class="bg-white-box">
|
||||
<image src="../static/icon-letter.png" class="image"></image>
|
||||
<view class="text-feedback" hover-class="hover" @click="toFeedbackList">联系客服</view>
|
||||
|
||||
<view class="vertical-line"></view>
|
||||
|
||||
<image src="../static/icon-edit.png" class="image"></image>
|
||||
<view class="text-feedback" hover-class="hover" @click="toFeedback">我要反馈</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
helpClassifyList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
openList(item) {
|
||||
var oldhelpClassifyList=item
|
||||
if(oldhelpClassifyList.parentId==1){
|
||||
item.parentId=0
|
||||
}else{
|
||||
item.parentId=1
|
||||
}
|
||||
},
|
||||
getlist() {
|
||||
let data={
|
||||
types:1
|
||||
}
|
||||
this.$u.api.help(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.helpClassifyList = res.data
|
||||
for (var i = 0; i < this.helpClassifyList.length; i++) {
|
||||
this.helpClassifyList[i].parentId = 1
|
||||
}
|
||||
// this.helpClassifyList.isTrue = false
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
onClick(item) {
|
||||
uni.navigateTo({
|
||||
url: '/me/helpDetail/helpDetail?title=' + item.helpWordTitle + '&helpWordId=' + item.helpWordId,
|
||||
})
|
||||
|
||||
},
|
||||
toFeedbackList() {
|
||||
let kefu = uni.getStorageSync('kefu'); // 用户端联系方式 1 手机号 2企业微信
|
||||
let kefuPhone = uni.getStorageSync('kefuPhone');
|
||||
if (kefu == 1) {
|
||||
uni.navigateTo({
|
||||
url:'/me/setting/kefu'
|
||||
})
|
||||
}else if (kefu == 3) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: kefuPhone //仅为示例
|
||||
});
|
||||
} else if(kefu == 2){
|
||||
// #ifdef MP-WEIXIN
|
||||
let that = this
|
||||
try {
|
||||
wx.openCustomerServiceChat({
|
||||
extInfo: {
|
||||
url:uni.getStorageSync('kefuUrl')
|
||||
},
|
||||
corpId: uni.getStorageSync('kefuAppId'),
|
||||
success(res) {},
|
||||
fail(res) {
|
||||
console.error(res)
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error("catchcatch" + error)
|
||||
uni.showToast({
|
||||
title: '请更新至微信最新版本'
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
let url =uni.getStorageSync('kefuUrl');
|
||||
if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
} else {
|
||||
//#ifndef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/webView?url=' + url
|
||||
});
|
||||
//#endif
|
||||
//#ifdef H5
|
||||
window.location.href = url;
|
||||
//#endif
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
toFeedback() {
|
||||
uni.navigateTo({
|
||||
url: '/me/feedback/index',
|
||||
success: res => {},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.bg-box {
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.bg-list {
|
||||
margin-bottom: 100rpx;
|
||||
background-color: #FFFFFF;
|
||||
padding: 30rpx
|
||||
}
|
||||
|
||||
.bg-white-box {
|
||||
background-color: #F7F7F7;
|
||||
margin: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10rpx;
|
||||
border-radius: 20rpx;
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.vertical-line {
|
||||
height: 20rpx;
|
||||
background-color: #cecece;
|
||||
width: 2rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.text-title {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text-item {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
padding: 24rpx 0rpx;
|
||||
}
|
||||
|
||||
.list-title {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.list-question {
|
||||
color: #000;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.hover {
|
||||
background-color: #ffffff;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.text-feedback {
|
||||
padding: 20rpx;
|
||||
/* color: #000000; */
|
||||
}
|
||||
|
||||
.text-top {
|
||||
margin: 30rpx;
|
||||
color: #000;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
</style>
|
||||
68
me/helpDetail/helpDetail.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<!-- <view class="helpTitle">{{ resultData.helpWordTitle }}</view> -->
|
||||
<view class="helpCon" v-html="content"></view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
helpWordId: '',
|
||||
resultData:[],
|
||||
content:''
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.helpWordId = options.helpWordId
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.title
|
||||
});
|
||||
if (this.helpWordId) {
|
||||
this.getContent()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getContent() {
|
||||
let data = {
|
||||
helpWordId: this.helpWordId,
|
||||
}
|
||||
this.$u.api.helpDet(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.resultData = res.data
|
||||
this.content = res.data.helpWordContent.replace(new RegExp("img","g"),'img style="width:100%;height:auto;"')
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.helpTitle {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin: 50rpx 30rpx 30rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.helpCon {
|
||||
font-size: 30rpx;
|
||||
margin: 30rpx 30rpx 50rpx;
|
||||
color: #000;
|
||||
line-height: 2em;
|
||||
}
|
||||
</style>
|
||||
88
me/integral/index.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<!-- 我的积分 -->
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="margin radius" style="background: url(@/me/static/integral/bg.png) 100% no-repeat;position: relative;">
|
||||
<image src="@/me/static/integral/bg.png" style="width: 100%;height: 220rpx;"></image>
|
||||
<view class="padding" style="position: absolute;top: 0;width: 640rpx;">
|
||||
<view class="text-19">当前积分</view>
|
||||
<view class="flex justify-between margin-top">
|
||||
<view class="text-bold" style="font-size: 34px;">{{integralNum}}</view>
|
||||
<view class="" style="position: relative;overflow: hidden;width: 90px;">
|
||||
<!-- <view style="position: absolute;bottom:0;">
|
||||
<view class="flex">
|
||||
<u-image src="@/me/static/integral/integrate.png" width="43rpx" height="37rpx" style="width: 43rpx;height: 37rpx;"></u-image>
|
||||
<view class="margin-left-sm">积分明细</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap height="30" bg-color="#F7F7F7"></u-gap>
|
||||
<view class="margin">
|
||||
<view class="flex justify-between u-border-bottom padding-tb" v-for="(item,index) in integralList" :key="index" >
|
||||
<view class="u-font-16 text-bold">{{item.content}}</view>
|
||||
<view class="flex justify-between" style="width: 120rpx;border: 2rpx solid #FFA800;background: rgba(255, 247, 226, 0.5);border-radius: 36rpx;height: 40rpx;">
|
||||
<u-image src="@/me/static/integral/jinbi.png" width="36rpx" height="36rpx"></u-image>
|
||||
<view class="margin-right-sm" style="line-height: 36rpx;">+2</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
integralList: [],
|
||||
integralNum: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getIntegral()
|
||||
this.getIntegralDet()
|
||||
},
|
||||
methods: {
|
||||
getIntegral() {
|
||||
this.$u.api.integral().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.integralNum = res.data.integralNum
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getIntegralDet() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$u.api.integralDet(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.integralList = res.data.records
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
168
me/integral/inviteDet.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="bg-white padding">
|
||||
<view class="box" style="">
|
||||
<view class="text-19">总资产(元)</view>
|
||||
<view class="text-bold padding-tb"><text style="font-size: 68rpx;">{{inviterRecord}}</text>元</view>
|
||||
<!-- <view>累计提现:325.05元</view> -->
|
||||
</view>
|
||||
<view class="padding-top flex align-center justify-between">
|
||||
<view>
|
||||
<view class="text-19">总资产(元)</view>
|
||||
<view class="text-bold "><text style="font-size: 48rpx;">{{inviterRecord}}</text></view>
|
||||
</view>
|
||||
<view class="btn" @click="getOut">提现</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="margin-top padding bg-white radius">
|
||||
<view class="flex align-center">
|
||||
<view class="linh"></view>
|
||||
<view class="u-font-16 text-bold " style="color: #333333;" >账单明细</view>
|
||||
</view>
|
||||
<view style="text-align: left">
|
||||
<view v-for="(item, index) in userList" :key="index" class="item">
|
||||
<view>
|
||||
<view style="color: #333333;font-weight: bold;">{{item.title}}</view>
|
||||
<view class="margin-top-sm" style="color: #999999;">{{item.createTime}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<text v-if="item.type==1" style="color: #333333;font-size:34upx;font-weight: 600"> + ¥{{item.money}}</text>
|
||||
<text v-else style="color: #333333;font-size: 34upx;font-weight: 600"> - ¥{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="userList.length===0" style="text-align: center;margin-top: 60px">暂无记录</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
userList: [],
|
||||
inviterRecord: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getData()
|
||||
this.getInviter()
|
||||
},
|
||||
onShow() {
|
||||
this.getInviter()
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$u.api.queryInviter(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.inviterRecord = res.data.inviteMoney.money
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('userName')
|
||||
uni.removeStorageSync('openId')
|
||||
uni.removeStorageSync('avatar')
|
||||
uni.removeStorageSync('phone')
|
||||
uni.removeStorageSync('invitationCode')
|
||||
uni.removeStorageSync('userId')
|
||||
uni.removeStorageSync('zhiFuBao')
|
||||
uni.removeStorageSync('zhiFuBaoName')
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
},
|
||||
getInviter() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$u.api.moneyList(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if(this.page == 1) {
|
||||
this.userList = res.data.records
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
this.userList = [...this.userList, ...res.data.records]
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getOut() {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/cashDetail'
|
||||
});
|
||||
},
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getInviter()
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
// this.userList = []
|
||||
this.getInviter()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.box{
|
||||
background: linear-gradient(90deg, #90A7FF 0%, #5074FF 100%);
|
||||
border-radius: 16rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 50rpx 0;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.btn {
|
||||
background: #5074FF;
|
||||
color: #FFFFFF;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
width: 160rpx;
|
||||
height: 70rpx;
|
||||
text-align: center;
|
||||
line-height: 70rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.linh{
|
||||
width:8rpx;
|
||||
height: 32rpx;
|
||||
background: #2474FF;
|
||||
margin-right: 15rpx;
|
||||
border-radius: 4rpx;
|
||||
|
||||
}
|
||||
.item {
|
||||
/* background: white; */
|
||||
/* padding: 32rpx; */
|
||||
margin: 32rpx 0;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
/* box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1); */
|
||||
/* border-radius: 16upx; */
|
||||
}
|
||||
</style>
|
||||
373
me/invite/cashDetail.vue
Normal file
@@ -0,0 +1,373 @@
|
||||
<template>
|
||||
<view class="cash">
|
||||
<view
|
||||
style="background-color: #ff7581;height: 400upx;border-bottom-right-radius: 40upx;border-bottom-left-radius: 40upx;">
|
||||
<view style="font-size: 32upx;color: #FFFFFF;padding-top: 100upx;">可提现总额</view>
|
||||
<view style="font-size: 40upx;color: #FFFFFF;padding-top: 20upx;">¥ {{mayMoney}}</view>
|
||||
|
||||
<view
|
||||
style="width: 90%;height: max-content;margin-left: 40upx;background-color: #FFFFFF;box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;margin-top: 50upx;border-radius: 20upx;">
|
||||
<view style="display: flex;flex-direction: row;padding: 20upx;">
|
||||
<view style="font-size: 32upx;color: #333333;">提现金额 <text style="font-size: 28upx;color: #ff7581;"
|
||||
v-if="shouxufei">(注:提现手续费为{{shouxufei * 100}}%)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;flex-direction: row;padding: 20upx;">
|
||||
<view style="font-size: 40upx;color: #333333;">¥</view>
|
||||
<input type="number" v-model="money" placeholder="请输入金额"
|
||||
style="font-size: 40upx;color: #333333;text-align: left;margin-left: 10upx;width: 100%;" />
|
||||
</view>
|
||||
<view style="background: #E6E6E6;width: 100%;height: 1upx;"></view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;flex-wrap: wrap;">
|
||||
<view style="display: flex;flex-direction: row;" v-for="(item, index) in moneyList" :key="index">
|
||||
<view>
|
||||
<view style="padding: 20upx;" @click="getOut1(item.money)">
|
||||
<view
|
||||
style="padding-top: 40upx;width: 180upx; height: 120upx;background-color: #FFFFFF;border:1px solid #ff7581;border-radius: 10upx;">
|
||||
{{ item.money }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="getOut"
|
||||
style="margin: 32upx;font-size: 18px;background: #ff7581;color: white;border-radius: 10px;height: 40px;line-height: 40px">
|
||||
提现
|
||||
</view>
|
||||
|
||||
<view style="display: flex;width: 100%;justify-content: center;">
|
||||
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;width: 33%;" @click="goZhifuBao">提现账号
|
||||
</view>
|
||||
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;width: 33%;" @click="goqianbao">钱包明细
|
||||
</view>
|
||||
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;width: 33%;" @click="gojilu">提现记录
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
money: '',
|
||||
mayMoney: '0',
|
||||
shouxufei: '',
|
||||
moneyList: [{
|
||||
money: '10'
|
||||
},
|
||||
{
|
||||
money: '20'
|
||||
},
|
||||
{
|
||||
money: '50'
|
||||
},
|
||||
{
|
||||
money: '100'
|
||||
},
|
||||
{
|
||||
money: '200'
|
||||
},
|
||||
{
|
||||
money: '500'
|
||||
}
|
||||
],
|
||||
value: 0,
|
||||
min: '',
|
||||
token: '',
|
||||
userId: '',
|
||||
zhifubao: '',
|
||||
zhifubaoName: '',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getshouxufei();
|
||||
},
|
||||
onShow() {
|
||||
this.token = uni.getStorageSync('token')
|
||||
this.userId = uni.getStorageSync('userId')
|
||||
this.zhifubao = uni.getStorageSync('zhiFuBao')
|
||||
this.zhifubaoName = uni.getStorageSync('zhiFuBaoName')
|
||||
|
||||
|
||||
this.getcashMoney()
|
||||
|
||||
},
|
||||
onNavigationBarButtonTap() {
|
||||
// this.list();
|
||||
},
|
||||
methods: {
|
||||
//获取收取费
|
||||
getshouxufei() {
|
||||
this.$u.get('app/common/type/152').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.shouxufei = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.$u.get('app/common/type/112').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.cashMoney = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// 可提现金额
|
||||
getcashMoney() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$u.api.queryInviter(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.mayMoney = res.data.inviteMoney.money
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提现记录
|
||||
gojilu() {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/cashList'
|
||||
});
|
||||
},
|
||||
//钱包明细
|
||||
goqianbao() {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/moneyList'
|
||||
});
|
||||
},
|
||||
list() {
|
||||
// uni.navigateTo({
|
||||
// url: '/me/invite/cashList'
|
||||
// })
|
||||
},
|
||||
goZhifuBao() {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/zhifubao'
|
||||
});
|
||||
},
|
||||
getMoney() {
|
||||
let that = this;
|
||||
let token = that.token
|
||||
let userId = that.userId
|
||||
if (token) {
|
||||
//this.$queue.showLoading("加载中...");
|
||||
//可以提现金额查询预估收入查询
|
||||
let data = {
|
||||
money: that.money
|
||||
}
|
||||
this.$u.api.cashMoney(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '提现申请成功,预计三个工作日到账',
|
||||
icon: 'none'
|
||||
})
|
||||
that.money = ''
|
||||
setTimeout(function() {
|
||||
that.getcashMoney()
|
||||
}, 1500)
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//校验用户输入金额
|
||||
checkMobile(money) {
|
||||
return RegExp(/^1[34578]\d{9}$/).test(money);
|
||||
},
|
||||
getOut() {
|
||||
let that = this;
|
||||
let token = that.token
|
||||
let userId = that.userId
|
||||
console.log(token)
|
||||
let cashMoney = that.cashMoney;
|
||||
|
||||
if (token) {
|
||||
if (that.zhifubao && that.zhifubaoName) {
|
||||
if (!/^\d+$/.test(that.money)) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let shouxufei = parseFloat(that.money * that.shouxufei).toFixed(2);
|
||||
if (parseFloat(that.mayMoney).toFixed(1) >= parseFloat(that.money) + shouxufei * 1) {
|
||||
if (parseFloat(that.money).toFixed(1) >= parseFloat(cashMoney)) {
|
||||
if (that.shouxufei > 0) {
|
||||
|
||||
uni.showModal({
|
||||
title: "提现申请提示",
|
||||
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + that
|
||||
.money + '元\n\n提现手续费:' + shouxufei +
|
||||
'\n\n收款人账号:' + that.zhifubao + '',
|
||||
success: (e) => {
|
||||
if (e.confirm) {
|
||||
// that.money = money
|
||||
that.getMoney();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: "提现申请提示",
|
||||
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + that
|
||||
.money + '元\n\n收款人账号:' + that.zhifubao +
|
||||
'',
|
||||
success: (e) => {
|
||||
if (e.confirm) {
|
||||
// that.money = money
|
||||
that.getMoney();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: "提现金额必须大于或等于" + cashMoney + "元才可提现"
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: "您的余额不足"
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/me/invite/zhifubao"
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
},
|
||||
getOut1(money) {
|
||||
let that = this;
|
||||
let token = that.token
|
||||
let userId = that.userId
|
||||
if (token) {
|
||||
if (that.zhifubao && that.zhifubaoName) {
|
||||
if (parseFloat(this.mayMoney).toFixed(1) >= parseFloat(money)) {
|
||||
if (parseFloat(money).toFixed(1) >= 10) {
|
||||
if (this.shouxufei > 0) {
|
||||
let shouxufei = parseFloat(money * this.shouxufei).toFixed(2);
|
||||
uni.showModal({
|
||||
title: '提现申请提示',
|
||||
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + money +
|
||||
'元\n\n提现手续费:' + shouxufei +
|
||||
'\n\n收款人账号:' + that.zhifubao + '',
|
||||
confirmColor: '#ff7581',
|
||||
success: e => {
|
||||
if (e.confirm) {
|
||||
this.money = money
|
||||
that.getMoney();
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: '提现成功'
|
||||
// })
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提现申请提示',
|
||||
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + money +
|
||||
'元\n\n收款人账号:' + that.zhifubao +
|
||||
'',
|
||||
success: e => {
|
||||
if (e.confirm) {
|
||||
this.money = money
|
||||
that.getMoney();
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: '提现成功'
|
||||
// })
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '提现金额必须大于或等于10元才可提现'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '您的余额不足'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/zhifubao'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
// @import '../../static/css/index.css';
|
||||
|
||||
.view2-view-text {
|
||||
font-size: 14px;
|
||||
color: #000000;
|
||||
margin-left: 20upx;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.view2-view-image-right {
|
||||
width: 18upx;
|
||||
height: 30upx;
|
||||
margin-left: 50upx;
|
||||
}
|
||||
|
||||
.cash {
|
||||
text-align: center;
|
||||
background: white;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
|
||||
.cash-top {
|
||||
padding: 32upx 32upx 50upx 32upx;
|
||||
/* border-bottom: 1px solid gainsboro; */
|
||||
background: #5074FF;
|
||||
}
|
||||
|
||||
.leiji {
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
137
me/invite/cashList.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<view style="text-align: left">
|
||||
<view v-if="list.length" v-for="(item, index) in list" :key="index" class="item">
|
||||
<view>
|
||||
<view style="margin-bottom: 8upx;text-align: right;">
|
||||
<text style="margin-bottom: 8upx;color: green" v-if="item.state==1"> 提现成功</text>
|
||||
<text style="margin-bottom: 8upx;color: green" v-if="item.state==0"> 提现中</text>
|
||||
<text style="margin-bottom: 8upx;color: #FD6416" v-if="item.state==-1"> 提现失败</text>
|
||||
</view>
|
||||
|
||||
<view style="color: #999999;font-size: 28upx;">
|
||||
<view style="margin-bottom: 8upx"> 收款人账号:{{item.zhifubao}}</view>
|
||||
<view style="margin-bottom: 8upx"> 收款人姓名:{{item.zhifubaoName}}</view>
|
||||
<view style="margin-bottom: 8upx"> 发起时间:{{item.createAt}}</view>
|
||||
<view style="margin-bottom: 8upx" v-if="item.state==1">成功时间 {{item.outAt}}</view>
|
||||
<view style="margin-bottom: 8upx;color: #FD6416" v-if="item.state==-1">{{item.refund}}</view>
|
||||
|
||||
<view style="margin-bottom: 8upx;text-align: right;">
|
||||
<!-- 提现金额: -->
|
||||
<text style="color: #FD6416;font-size: 32upx;font-weight: 600"> ¥{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-box" v-if="!list.length">
|
||||
<view class="centre">
|
||||
<image src="../../static/images/learn/none.png" mode=""></image>
|
||||
<view class="tips">
|
||||
暂无记录
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
page: 1,
|
||||
limit: 10
|
||||
}
|
||||
},
|
||||
onLoad: function(e) {
|
||||
this.getMoney();
|
||||
},
|
||||
|
||||
methods: {
|
||||
getMoney() {
|
||||
let that = this;
|
||||
let token = uni.getStorageSync('token')
|
||||
|
||||
if (token) {
|
||||
//可以提现金额查询预估收入查询
|
||||
let data = {
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
}
|
||||
that.$u.api.selectPay(data).then(res => {
|
||||
if (that.page == 1) {
|
||||
that.list = res.data.list
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
that.list = res.data.list;
|
||||
})
|
||||
// this.$Request.getT("/cash/selectCashOutList/" + userId).then(res => {
|
||||
// if (res.status === 0 && res.data) {
|
||||
// that.list = res.data;
|
||||
// }
|
||||
// uni.hideLoading();
|
||||
// });
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getMoney();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
// that.list = []
|
||||
this.getMoney();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
/* @import "../../static/css/index.css"; */
|
||||
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.item {
|
||||
background: white;
|
||||
padding: 32rpx;
|
||||
margin: 32rpx;
|
||||
font-size: 28rpx;
|
||||
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 16upx;
|
||||
}
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
|
||||
image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
// border: 1px dotted #000000;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 34rpx;
|
||||
color: #999999;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #ff7581;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
768
me/invite/index.vue
Normal file
@@ -0,0 +1,768 @@
|
||||
<!-- 我的邀请 -->
|
||||
<template>
|
||||
<view>
|
||||
<u-image src="/me/static/invite/juxing.png" alt="" width="100%" mode="widthFix"></u-image>
|
||||
<view class="padding" style="position: relative;height: 360rpx;">
|
||||
<u-image src="@/me/static/invite/fenxiang.png" alt="" width="100%" height="100%"></u-image>
|
||||
<view class="text-center padding-top yaoqing">
|
||||
<view class="margin-top-xl margin-bottom-sm padding-top-sm text-xxl text-red text-bold">
|
||||
{{invitationCode}}
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<u-button @tap="sharurl" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||
:ripple="true">一键分享</u-button>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP -->
|
||||
<u-button @tap="sharurl" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||
:ripple="true">一键分享</u-button>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-TOUTIAO || MP-KUAISHOU -->
|
||||
<u-button open-type="share" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||
:ripple="true">一键分享</u-button>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<u-button open-type="share" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||
:ripple="true">一键分享</u-button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-KUAISHOU -->
|
||||
<u-button style="margin-left: 50rpx;" @click.stop="onSaveImg()" :custom-style="customStyle"
|
||||
:hair-line="false" shape="circle" size="mini" :ripple="true">保存海报</u-button>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin padding bg-white radius" v-if="inviterList.length">
|
||||
<view class="flex justify-between" style="line-height: 80rpx;" v-for="(item, index) in inviterList"
|
||||
:key='index'>
|
||||
<view class="flex">
|
||||
<!-- <u-image :src="item.avatar == null?avatar:item.avatar" width="40px" mode="widthFix"></u-image> -->
|
||||
<image src="../static/invite/5.png" style="width: 80rpx;" mode="widthFix"></image>
|
||||
<text class="margin-left-sm">{{item.userName}}</text>
|
||||
</view>
|
||||
<view style="width: 160rpx;">
|
||||
<text>获得</text>
|
||||
<text class="margin-left-xs text-red">{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding" style="position: relative;height: 160px;">
|
||||
<u-image src="@/me/static/invite/yaoqing.png" alt="" width="100%" height="100%"></u-image>
|
||||
<view class="text-center padding-top flex justify-center flex-direction zhanji">
|
||||
<view class="flex justify-around margin-top-sm" @click="goNav('/me/invite/inviteDet')">
|
||||
<view>
|
||||
<view class="margin-bottom-sm">已邀请</view>
|
||||
<view class="text-red"><text class="text-bold u-font-18">{{inviterNumber}}</text>人</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-sm">累计收益</view>
|
||||
<view class="text-red"><text class="text-bold u-font-18">{{cumulativeRevenue}}</text>元</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-sm">已提现</view>
|
||||
<view class="text-red">¥<text class="text-bold u-font-18">{{withdrawn}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding" style="position: relative;height: 250rpx;">
|
||||
<u-image src="@/me/static/invite/jiqiao.png" alt="" width="100%" height="100%"></u-image>
|
||||
<view class="padding-top jiqiao" style="">
|
||||
<view class="padding-top-xl padding-lr padding-bottom" style="line-height: 48rpx;">
|
||||
<block v-if="price2==0">
|
||||
<view class="flex padding-sm" style="background-color: #ffffff;">
|
||||
<text class="cuIcon-title text-yellow"></text>
|
||||
<view>邀请好友可得开通会员及消费金额 {{price}}%的佣金奖励</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="flex padding-sm" style="background-color: #ffffff;">
|
||||
<text class="cuIcon-title text-yellow"></text>
|
||||
<view>可得一级好友开通会员及消费金额 {{price}}%的佣金奖励</view>
|
||||
</view>
|
||||
<view class="flex padding-sm" style="background-color: #ffffff;">
|
||||
<text class="cuIcon-title text-yellow"></text>
|
||||
<view>可得二级好友开通会员及消费金额 {{price2}}%的佣金奖励</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<tki-qrcode ref="qrcode" :val="erweima" :size="200" background="#fff" foreground="#000" pdground="#000"
|
||||
:onval="true" :loadMake="true" @result="qrR" :show="false"></tki-qrcode>
|
||||
<view class="cu-modal" :class="modalName == 'Image' ? 'show' : ''" @tap="hideModal">
|
||||
<view class="cu-dialog" v-if="bgImg && erweimapath && haibaoShow" @tap="hideModal">
|
||||
<view class="bg-img">
|
||||
<wm-poster @success="posterSuccess" @successH5="successH5" :imgSrc="bgImg"
|
||||
:Referrer="'我的邀请码:'+invitationCode" :QrSrc="erweimapath" :LineType="false"></wm-poster>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let settingWritePhotosAlbum = false;
|
||||
import tkiQrcode from '../../components/tki-qrcode/tki-qrcode.vue';
|
||||
import wmPoster from '../components/wm-poster/wm-posterorders.vue';
|
||||
import config from '../../common/config.js'
|
||||
export default {
|
||||
components: {
|
||||
tkiQrcode,
|
||||
wmPoster
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
erweimapath: '',
|
||||
poster: {},
|
||||
qrShow: false,
|
||||
haibaoImg: null,
|
||||
haibaoShow: false,
|
||||
modalName: '',
|
||||
canvasId: 'default_PosterCanvasId',
|
||||
avatar: '../../static/images/logo.png',
|
||||
customStyle: {
|
||||
background: '#FFE0E0',
|
||||
border: '0',
|
||||
color: 'rgb(254,30,35)',
|
||||
fontSize: '12px',
|
||||
fontWeight: '500',
|
||||
padding: '15px 20px',
|
||||
},
|
||||
page: 1,
|
||||
limit: 10,
|
||||
inviterName: '', //邀请码
|
||||
cumulativeRevenue: '', //累计收益
|
||||
inviterNumber: '', //邀请人数
|
||||
withdrawn: '', //已提现
|
||||
inviterList: [],
|
||||
erweima: '',
|
||||
bgImg: '',
|
||||
tuiguang: '',
|
||||
invitationCode: 0,
|
||||
price: 0,
|
||||
price2: 0,
|
||||
h5SaveImg: '',
|
||||
modalName: '',
|
||||
haibaoImgH5: '',
|
||||
qdCode: '', //渠道码
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
return {
|
||||
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||
title: this.tuiguang,
|
||||
imageUrl: this.bgImg
|
||||
}
|
||||
},
|
||||
onShareTimeline(res) {
|
||||
return {
|
||||
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||
title: this.tuiguang,
|
||||
imageUrl: this.bgImg
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getInviter()
|
||||
this.queryInviter()
|
||||
|
||||
this.invitationCode = uni.getStorageSync('invitationCode')
|
||||
this.getUserInfoBl()
|
||||
this.getBgImg()
|
||||
if (uni.getStorageSync('qdCode')) {
|
||||
this.qdCode = uni.getStorageSync('qdCode')
|
||||
}
|
||||
// h5携带邀请码去首页
|
||||
// #ifdef H5
|
||||
this.erweima = config.APIHOST2 + '/?invitation=' + this
|
||||
.invitationCode + '&qdCode=' + this.qdCode
|
||||
// #endif
|
||||
// app直接去app注册页面
|
||||
// #ifdef APP
|
||||
this.erweima = config.APIHOST2 + '/pages/login/registerApp/?invitation=' + this
|
||||
.invitationCode + '&qdCode=' + this.qdCode
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
this.getWxEq()
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
this.getTouTiao()
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
//获取用户分销比例
|
||||
getUserInfoBl() {
|
||||
this.$Request.getT('/app/user/selectUserById').then(res => {
|
||||
if (res.code == 0) {
|
||||
//一级分销
|
||||
if (res.data.rate) {
|
||||
this.price = (Number(res.data.rate) * 100).toFixed(0)
|
||||
} else {
|
||||
this.price = 0
|
||||
}
|
||||
//二级分销
|
||||
if (res.data.twoRate) {
|
||||
this.price2 = (Number(res.data.twoRate) * 100).toFixed(0)
|
||||
} else {
|
||||
this.price2 = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取头条二维码
|
||||
getTouTiao() {
|
||||
let that = this
|
||||
uni.downloadFile({
|
||||
url: config.APIHOST +
|
||||
'/app/invite/dyCreateQr?invitationCode=' + that
|
||||
.invitationCode + ',' + that.qdCode + '&page=/pages/index/index',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
if (res.statusCode === 200) {
|
||||
that.erweimapath = res.tempFilePath
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取微信二维码
|
||||
getWxEq() {
|
||||
let that = this
|
||||
uni.downloadFile({
|
||||
url: config.APIHOST +
|
||||
'/app/invite/mpCreateQr?invitationCode=' + that
|
||||
.invitationCode + ',' + that.qdCode,
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
if (res.statusCode === 200) {
|
||||
that.erweimapath = res.tempFilePath
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
sharurl() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '链接推广',
|
||||
content: this.tuiguang + this.erweima,
|
||||
showCancel: true,
|
||||
cancelText: '关闭',
|
||||
confirmText: '一键复制',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setClipboardData({
|
||||
data: this.tuiguang + this.erweima,
|
||||
success: function() {
|
||||
console.log('success');
|
||||
uni.showToast({
|
||||
title: '复制成功',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
posterSuccess(haibaoImg) {
|
||||
this.haibaoImg = haibaoImg;
|
||||
this.modalName = 'Image';
|
||||
uni.hideLoading();
|
||||
},
|
||||
successH5(haibaoImg) {
|
||||
this.haibaoImgH5 = haibaoImg
|
||||
uni.previewImage({
|
||||
urls: [haibaoImg],
|
||||
current: 1,
|
||||
})
|
||||
},
|
||||
showModal() {
|
||||
// #ifndef H5
|
||||
if (!this.haibaoImg) {
|
||||
this.haibaoShow = true;
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
} else {
|
||||
this.modalName = 'Image';
|
||||
}
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
//微信浏览器
|
||||
if (!this.haibaoImg) {
|
||||
this.haibaoShow = true;
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
} else {
|
||||
this.modalName = 'Image';
|
||||
}
|
||||
} else {
|
||||
if (!this.haibaoImgH5) {
|
||||
this.haibaoShow = true;
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
} else {
|
||||
uni.previewImage({
|
||||
urls: [this.haibaoImgH5],
|
||||
current: 1,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
hideModal() {
|
||||
this.modalName = null;
|
||||
},
|
||||
qrR(path) {
|
||||
this.erweimapath = path;
|
||||
},
|
||||
getInviter() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$u.api.inviter(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.inviterList = res.data.list
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
queryInviter() {
|
||||
this.$u.api.queryInviter().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.cumulativeRevenue = res.data.inviteMoney.moneySum //累计收益
|
||||
this.inviterNumber = res.data.inviteCount //邀请人数
|
||||
this.withdrawn = res.data.inviteMoney.cashOut //已提现
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
goNav(e) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
},
|
||||
|
||||
//获取背景图
|
||||
getBgImg() {
|
||||
this.$u.get('app/banner/selectBannerList?classify=5').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.bgImg = res.data[0].imageUrl
|
||||
this.tuiguang = res.data[0].describes
|
||||
console.log(this.bgImg)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//生成h5海报
|
||||
createH5Poster() {
|
||||
let that = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
const ctx = uni.createCanvasContext('poster');
|
||||
ctx.fillRect(0, 0, 375, 673);
|
||||
ctx.setFillStyle("#FFF");
|
||||
ctx.fillRect(0, 0, 375, 673);
|
||||
let imgUrl = that.bgImg;
|
||||
uni.downloadFile({
|
||||
url: imgUrl,
|
||||
success: (res) => {
|
||||
console.log(res, '***************')
|
||||
if (res.statusCode === 200) {
|
||||
uni.downloadFile({
|
||||
url: that.erweima,
|
||||
success: (res2) => {
|
||||
console.log(res2)
|
||||
if (res.statusCode === 200) {
|
||||
ctx.drawImage(res.tempFilePath, 0, 0, 375,
|
||||
500);
|
||||
// 长按识别二维码访问
|
||||
let textTop = 0;
|
||||
ctx.setFontSize(19);
|
||||
ctx.setFillStyle('#333');
|
||||
ctx.fillText("长按识别图中二维码", 17, textTop + 590);
|
||||
// 二维码
|
||||
ctx.drawImage(res2.tempFilePath, 238, textTop +
|
||||
526, 120, 120);
|
||||
ctx.draw(true, () => {
|
||||
// canvas画布转成图片并返回图片地址
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'poster',
|
||||
width: 375,
|
||||
height: 673,
|
||||
success: (res) => {
|
||||
console.log(
|
||||
"海报制作成功!"
|
||||
);
|
||||
resolve(res
|
||||
.tempFilePath
|
||||
);
|
||||
},
|
||||
fail: () => {
|
||||
uni
|
||||
.hideLoading();
|
||||
reject();
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
complete: com => {
|
||||
console.log(com)
|
||||
uni.showToast({
|
||||
title: com,
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
// that.yu.toast(err)
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
//生成海报
|
||||
createPoster() {
|
||||
let that = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showLoading({
|
||||
title: '海报生成中'
|
||||
});
|
||||
const ctx = uni.createCanvasContext('poster');
|
||||
ctx.fillRect(0, 0, 375, 673);
|
||||
ctx.setFillStyle("#FFF");
|
||||
ctx.fillRect(0, 0, 375, 673);
|
||||
let imgUrl = that.bgImg;
|
||||
uni.downloadFile({
|
||||
url: imgUrl,
|
||||
success: (res) => {
|
||||
console.log(res, '***************')
|
||||
if (res.statusCode === 200) {
|
||||
uni.downloadFile({
|
||||
url: config.APIHOST +
|
||||
'/app/invite/mpCreateQr?invitationCode=' + that
|
||||
.invitationCode,
|
||||
// url: 'https://jiaoyu.xianmxkj.com/sqx_fast/app/invite/mpCreateQr?invitationCode=' +
|
||||
// that.invitationCode,
|
||||
success: (res2) => {
|
||||
console.log(res2)
|
||||
if (res.statusCode === 200) {
|
||||
ctx.drawImage(res.tempFilePath, 0, 0, 375,
|
||||
500);
|
||||
// 长按识别二维码访问
|
||||
let textTop = 0;
|
||||
ctx.setFontSize(19);
|
||||
ctx.setFillStyle('#333');
|
||||
ctx.fillText("长按识别图中二维码", 17, textTop + 590);
|
||||
// 二维码
|
||||
ctx.drawImage(res2.tempFilePath, 238, textTop +
|
||||
526, 120, 120);
|
||||
ctx.draw(true, () => {
|
||||
// canvas画布转成图片并返回图片地址
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'poster',
|
||||
width: 375,
|
||||
height: 673,
|
||||
success: (res) => {
|
||||
console.log(
|
||||
"海报制作成功!"
|
||||
);
|
||||
resolve(res
|
||||
.tempFilePath
|
||||
);
|
||||
},
|
||||
fail: () => {
|
||||
uni
|
||||
.hideLoading();
|
||||
reject();
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
complete: com => {
|
||||
console.log(com)
|
||||
uni.showToast({
|
||||
title: com,
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
// that.yu.toast(err)
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '海报制作失败,图片下载失败',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 保存图片
|
||||
async onSaveImg() {
|
||||
this.showModal();
|
||||
return
|
||||
// #ifndef MP-WEIXIN
|
||||
this.showModal();
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
let imgUrl = await this.createPoster();
|
||||
uni.showLoading({
|
||||
title: '海报下载中'
|
||||
});
|
||||
if (settingWritePhotosAlbum) {
|
||||
uni.getSetting({
|
||||
success: res => {
|
||||
if (res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: imgUrl,
|
||||
success: () => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '保存成功'
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先在设置页面打开“保存相册”使用权限',
|
||||
confirmText: '去设置',
|
||||
cancelText: '算了',
|
||||
success: data => {
|
||||
if (data.confirm) {
|
||||
uni.hideLoading();
|
||||
uni.openSetting();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
settingWritePhotosAlbum = true;
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success: () => {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: imgUrl,
|
||||
success: () => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '保存成功'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1110;
|
||||
opacity: 0;
|
||||
outline: 0;
|
||||
text-align: center;
|
||||
-ms-transform: scale(1.185);
|
||||
transform: scale(1.185);
|
||||
backface-visibility: hidden;
|
||||
perspective: 2000upx;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
transition: all 0.3s ease-in-out 0s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.modal.show {
|
||||
opacity: 1;
|
||||
transition-duration: 0.3s;
|
||||
-ms-transform: scale(1);
|
||||
transform: scale(1);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
page {
|
||||
background: #E0EFFF;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.poster_canvas {
|
||||
width: 750upx;
|
||||
height: 1334upx;
|
||||
position: fixed;
|
||||
top: -10000upx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.yaoqing {
|
||||
width: 100%;
|
||||
height: 136px;
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* background-image: url('@/me/static/invite/fenxiang.png'); */
|
||||
/* background-size: 100%; */
|
||||
/* background-repeat: no-repeat; */
|
||||
}
|
||||
|
||||
.zhanji {
|
||||
width: 100%;
|
||||
height: 119px;
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* background-image: url('@/me/static/invite/yaoqing.png'); */
|
||||
/* background-size: 100%; */
|
||||
/* background-repeat: no-repeat; */
|
||||
}
|
||||
|
||||
.jiqiao {
|
||||
width: 100%;
|
||||
height: 160rpx;
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* background-image: url('@/me/static/invite/jiqiao.png');
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat; */
|
||||
}
|
||||
</style>
|
||||
144
me/invite/inviteDet.vue
Normal file
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 50rpx;">
|
||||
<view class="padding margin radius bg-white" style="">
|
||||
<view class="text-19">当前收益</view>
|
||||
<view class="flex justify-between margin-top">
|
||||
<view class="text-bold text-black">¥<text style="font-size: 34px;">{{inviterRecord}}</text></view>
|
||||
<view class="" style="position: relative;overflow: hidden;width: 90px;">
|
||||
<view style="position: absolute;bottom:0;">
|
||||
<!-- <view class="flex"> -->
|
||||
<button @tap="getOut" class="cu-btn round">立即提现</button>
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin padding bg-white radius">
|
||||
<view class="u-font-16 text-bold margin-bottom">邀请明细</view>
|
||||
<!-- <view class="flex justify-between" style="line-height: 30px;" v-for="(item,index) in userList" >
|
||||
<view class="flex" style="width: 300rpx;">
|
||||
<u-image :src="item.avatar" width="30px" mode="widthFix"></u-image>
|
||||
<view class="margin-left-sm userName_view">{{item.userName}}</view>
|
||||
</view>
|
||||
<view style="width: 120rpx;">邀请好友</view>
|
||||
<view style="width: 120rpx;">
|
||||
<text class="margin-left text-red">赚{{item.money}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="flex justify-between align-center" style="margin-bottom: 40rpx;"
|
||||
v-for="(item,index) in userList">
|
||||
<view class="flex align-center">
|
||||
<image :src="item.avatar?item.avatar:'../../static/images/logo.png'"
|
||||
style="width: 80rpx;height:80rpx;border-radius: 50rpx;"></image>
|
||||
<view class="margin-left-sm">
|
||||
<view class="userName_view">{{item.userName}}</view>
|
||||
<view class="text-cut" style="font-size: 24rpx;" v-if="item.userType && item.userType == 2">二级好友
|
||||
</view>
|
||||
<view class="text-cut" style="font-size: 24rpx;" v-else>一级好友
|
||||
</view>
|
||||
<!-- <u-image :src="item.avatar" width="30px" mode="widthFix"></u-image> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-left flex-sub text-right">
|
||||
<text class="margin-left text-red">赚{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<empty v-if="userList.length == 0" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 50,
|
||||
userList: [],
|
||||
inviterRecord: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getData()
|
||||
this.getInviter()
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getInviter();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getData();
|
||||
this.getInviter();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$u.api.queryInviter(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.inviterRecord = res.data.inviteMoney.money
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getInviter() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$u.api.inviter(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.page == 1) {
|
||||
this.userList = res.data.list
|
||||
} else {
|
||||
this.userList = [...this.userList, ...res.data.list]
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getOut() {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/cashDetail'
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.cu-btn {
|
||||
background: rgba(255, 117, 129, 0.2);
|
||||
color: #ff7581;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.userName_view {
|
||||
width: 280rpx;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
</style>
|
||||
121
me/invite/moneyList.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<view style="text-align: left">
|
||||
<view v-if="list.length" v-for="(item, index) in list" :key="index" class="item">
|
||||
<view>
|
||||
|
||||
<view style="color: #000000;font-size: 28upx;">
|
||||
<view style="margin-bottom: 8upx;"> 类型: {{item.title}}</view>
|
||||
<view style="margin-bottom: 8upx"> 内容: {{item.content}}</view>
|
||||
<view style="margin-bottom: 8upx"> 时间: {{item.createTime}}</view>
|
||||
<view style="margin-bottom: 8upx;text-align: right;">
|
||||
<!-- 提现金额: -->
|
||||
<text v-if="item.type==2" style="color: #FD6416;font-size: 32upx;font-weight: 600"> - ¥{{item.money}}</text>
|
||||
<text v-if="item.type==1" style="color: #FD6416;font-size: 32upx;font-weight: 600">+ ¥{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-box" v-if="!list.length">
|
||||
<view class="centre">
|
||||
<image src="../../static/images/learn/none.png" mode=""></image>
|
||||
<view class="tips">
|
||||
暂无明细
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
page: 1,
|
||||
limit: 10
|
||||
}
|
||||
},
|
||||
onLoad: function(e) {
|
||||
this.getMoney();
|
||||
},
|
||||
|
||||
methods: {
|
||||
getMoney() {
|
||||
let that = this;
|
||||
let token = uni.getStorageSync('token')
|
||||
|
||||
if (token) {
|
||||
let data = {
|
||||
page : that.page,
|
||||
limit : that.limit
|
||||
}
|
||||
that.$u.api.moneyDet(data).then(res => {
|
||||
if(that.page == 1) {
|
||||
that.list = res.data.records
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
that.list = [...that.list, ...res.data.records]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getMoney();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
// that.list = []
|
||||
this.getMoney();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
/* @import "../../static/css/index.css"; */
|
||||
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.item {
|
||||
background: white;
|
||||
padding: 32rpx;
|
||||
margin: 32rpx;
|
||||
font-size: 28rpx;
|
||||
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 16upx;
|
||||
}
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
// border: 1px dotted #000000;
|
||||
}
|
||||
.tips {
|
||||
font-size: 34rpx;
|
||||
color: #5074FF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #5074FF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
171
me/invite/zhifubao.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<list-cell title="收款人姓名" type="text" placeholder="请输入支付宝收款人姓名" v-model="zhiFuBaoName"></list-cell>
|
||||
|
||||
<list-cell title="支付宝账号" type="text" placeholder="请输入要绑定的支付宝手机号" v-model="zhiFuBao"></list-cell>
|
||||
|
||||
|
||||
<button :class="zhiFuBao&&zhiFuBaoName?'confirm-btn':'confirm-btn1'" @click="toLogin"
|
||||
:disabled="logining">绑定账户</button>
|
||||
<view style="padding: 32upx 64upx;font-size: 24upx;color: #999999;">提示:请正确填写收款人的支付宝账户和真实的收款人姓名,否则将无法正常收款</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listCell from '@/me/components/com-input';
|
||||
export default {
|
||||
components: {
|
||||
listCell
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
zhiFuBao: '',
|
||||
zhiFuBaoName: '',
|
||||
logining: false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
let userId = uni.getStorageSync('userId');
|
||||
|
||||
if (userId) {
|
||||
this.$u.api.userinfo().then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data.zhiFuBao) {
|
||||
this.zhiFuBao = res.data.zhiFuBao;
|
||||
}
|
||||
if (res.data.zhiFuBaoName) {
|
||||
this.zhiFuBaoName = res.data.zhiFuBaoName;
|
||||
}
|
||||
// console.log(this.zhiFuBao )
|
||||
// console.log(this.zhiFuBaoName )
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
toLogin() {
|
||||
// console.log(this.zhiFuBao )
|
||||
// console.log(this.zhiFuBaoName )
|
||||
// const {
|
||||
// zhiFuBao,
|
||||
// zhiFuBaoName
|
||||
// } = this;
|
||||
let zhiFuBao = this.zhiFuBao
|
||||
let zhiFuBaoName = this.zhiFuBaoName
|
||||
console.log(zhiFuBao)
|
||||
console.log(zhiFuBaoName)
|
||||
if (!zhiFuBao) {
|
||||
uni.showToast({
|
||||
title: '请设置收款人姓名',
|
||||
icon: 'none'
|
||||
})
|
||||
} else if (!zhiFuBaoName) {
|
||||
uni.showToast({
|
||||
title: '请设置收款人支付宝账号',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.$u.post('app/user/updateUser?zhiFuBao=' + zhiFuBao + '&zhiFuBaoName=' + zhiFuBaoName).then(
|
||||
res => {
|
||||
// console.log(res);
|
||||
uni.setStorageSync('zhiFuBao', zhiFuBao)
|
||||
uni.setStorageSync('zhiFuBaoName', zhiFuBaoName)
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none',
|
||||
complete() {
|
||||
setTimeout(function() {
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
// if (!zhifubao) {
|
||||
// this.$queue.showToast("请设置收款人支付宝账号");
|
||||
// } else if (!zhifubaoName) {
|
||||
// this.$queue.showToast("请设置收款人姓名");
|
||||
// } else {
|
||||
// this.$queue.showLoading("修改中...");
|
||||
// this.$Request.postT("/cash/userinfo?userId=" + userId + "&zhifubao=" + zhifubao + "&zhifubaoName=" + zhifubaoName).then(
|
||||
// res => {
|
||||
// if (res.status === 0) {
|
||||
// if (res.data.zhifubao) {
|
||||
// this.zhifubao = res.data.zhifubao;
|
||||
// }
|
||||
// if (res.data.zhifubaoName) {
|
||||
// this.zhifubaoName = res.data.zhifubaoName;
|
||||
// }
|
||||
// this.navBack();
|
||||
// } else {
|
||||
// // this.$queue.showToast(res.msg)
|
||||
// }
|
||||
// uni.hideLoading();
|
||||
// });
|
||||
// }
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-top: 32upx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.confirm-btn1 {
|
||||
width: 300px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
border-radius: 30px;
|
||||
margin-top: 70upx;
|
||||
/* background: whitesmoke; */
|
||||
background: #ff7581;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
|
||||
&:after {
|
||||
border-radius: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.confirm-btn {
|
||||
width: 300px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
border-radius: 30px;
|
||||
margin-top: 70upx;
|
||||
background: #ff7581;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
|
||||
&:after {
|
||||
border-radius: 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
191
me/jifen/duihuan.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="jf flex align-center justify-between">
|
||||
<view class="jf-l">
|
||||
<view class="jf-l-t">
|
||||
当前积分
|
||||
</view>
|
||||
<view class="jf-l-b">
|
||||
{{num}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="jf-r">
|
||||
<view class="jf-r-t">
|
||||
兑换说明
|
||||
</view>
|
||||
<view class="jf-r-b">
|
||||
{{bili}}:1兑换,最少{{bili}}积分
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listTitle flex align-center">
|
||||
<u-icon name="order" color="#2e2f33" size="50"></u-icon>
|
||||
<text>
|
||||
兑换数量
|
||||
</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="list-input">
|
||||
<u-input v-model="value" placeholder="请输入兑换数量" type="number" :border="true" />
|
||||
</view>
|
||||
<view class="list-btn">
|
||||
<view @click="userIntegral()" class="list-btn-s flex align-center justify-center">
|
||||
提交兑换
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
num: 0,
|
||||
value: '',
|
||||
bili: 0,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getNum()
|
||||
this.getBili()
|
||||
},
|
||||
methods: {
|
||||
//兑换积分
|
||||
userIntegral() {
|
||||
if (!this.value) {
|
||||
uni.showToast({
|
||||
title: '请输入兑换的积分数量',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (Number(this.value) < Number(this.bili)) {
|
||||
uni.showToast({
|
||||
title: '兑换的积分数量不能小于' + this.bili + '积分',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
integral: this.value
|
||||
}
|
||||
this.$Request.postT('/app/integral/creditsExchange', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '积分兑换成功'
|
||||
})
|
||||
this.getNum()
|
||||
this.value = ''
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取积分兑换比例
|
||||
getBili() {
|
||||
this.$u.get('/app/common/type/104').then(res => { // 积分兑换比例 104
|
||||
if (res.code == 0 && res.data) {
|
||||
this.bili = res.data.value
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取当前积分
|
||||
getNum() {
|
||||
this.$Request.getT('/app/integral/selectByUserId').then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.num = res.data.integralNum
|
||||
} else {
|
||||
this.num = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.jf {
|
||||
width: 100%;
|
||||
height: 252rpx;
|
||||
background: linear-gradient(90deg, rgba(255, 117, 129, 0.6) 0%, #ff7581 100%);
|
||||
padding: 0 40rpx;
|
||||
|
||||
.jf-l-t {
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.jf-l-b {
|
||||
font-size: 40rpx;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.jf-r {
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
|
||||
.jf-r-b {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listTitle {
|
||||
width: 100%;
|
||||
height: 110rpx;
|
||||
margin-top: -40rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
padding-left: 20rpx;
|
||||
|
||||
text {
|
||||
color: #2e2f33;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-left: 20rpx;
|
||||
padding-top: 8rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
|
||||
.list-input {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.list-btn {
|
||||
padding: 40rpx;
|
||||
|
||||
}
|
||||
|
||||
.list-btn-s {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
color: #ffffff;
|
||||
background-color: #ff7581;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
235
me/jifen/jifen.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="jf flex align-center justify-between">
|
||||
<view class="jf-l">
|
||||
<view class="jf-l-t">
|
||||
当前积分
|
||||
</view>
|
||||
<view class="jf-l-b">
|
||||
{{num}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="jf-r" @click="goNav('/me/jifen/duihuan')">
|
||||
积分兑换
|
||||
</view>
|
||||
</view>
|
||||
<view class="listTitle flex align-center">
|
||||
<u-icon name="order" color="#2e2f33" size="50"></u-icon>
|
||||
<text>
|
||||
积分明细
|
||||
</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<scroll-view @scrolltolower="scrolltolower" :refresher-enabled="refresherTriggered"
|
||||
@scrolltoupper="scrolltoupper" scroll-y="true"
|
||||
style="width: 100%;height: 100%;background-color: #ffffff;padding-bottom: 30rpx;">
|
||||
<view class="list-item flex align-center justify-center" v-for="(item,index) in list" :key="index">
|
||||
<view class="list-item-box flex align-center justify-between">
|
||||
<view class="list-item-box-l">
|
||||
<view class="list-item-box-l-t">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="list-item-box-l-b">
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-item-box-r" v-if="item.type == 1">
|
||||
+{{item.num}}
|
||||
</view>
|
||||
<view class="list-item-box-r" v-else>
|
||||
-{{item.num}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="width: 100%;height: 30rpx;" v-if="list.length>0"></view>
|
||||
<u-loadmore v-if="list.length>0" :status="status" />
|
||||
<empty :isShow="true" title="暂无明细" v-if="list.length == 0" />
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
boxStyle: {
|
||||
margin: 0,
|
||||
padding: '200rpx 0 0 0',
|
||||
},
|
||||
num: 0,
|
||||
list: [],
|
||||
status: 'loadmore',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
pages: 1,
|
||||
refresherTriggered: true
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getNum()
|
||||
this.getList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getNum()
|
||||
},
|
||||
methods: {
|
||||
goNav(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
//上拉刷新
|
||||
scrolltoupper() {
|
||||
this.page = 1
|
||||
this.refresherTriggered = true
|
||||
this.getList()
|
||||
},
|
||||
//加载更多
|
||||
scrolltolower() {
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loading'
|
||||
this.page += 1
|
||||
this.getList()
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
|
||||
},
|
||||
//获取积分明细
|
||||
getList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$Request.getT('/app/integral/details', data).then(res => {
|
||||
setTimeout(() => {
|
||||
this.refresherTriggered = false
|
||||
}, 1500)
|
||||
if (res.code == 0) {
|
||||
this.pages = res.data.pages
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.list = res.data.records
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取当前积分
|
||||
getNum() {
|
||||
this.$Request.getT('/app/integral/selectByUserId').then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.num = res.data.integralNum
|
||||
} else {
|
||||
this.num = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.jf {
|
||||
width: 100%;
|
||||
height: 252rpx;
|
||||
background: linear-gradient(90deg, rgba(255, 117, 129, 0.6) 0%, #ff7581 100%);
|
||||
padding: 0 40rpx;
|
||||
|
||||
.jf-l-t {
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.jf-l-b {
|
||||
font-size: 40rpx;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.jf-r {
|
||||
padding: 20rpx 40rpx;
|
||||
border-radius: 40rpx;
|
||||
color: #ff7581;
|
||||
background-color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.listTitle {
|
||||
width: 100%;
|
||||
height: 110rpx;
|
||||
margin-top: -40rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
border-bottom: 1px solid hsla(0, 0%, 90.2%, .8);
|
||||
padding-left: 20rpx;
|
||||
|
||||
text {
|
||||
color: #2e2f33;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-left: 20rpx;
|
||||
padding-top: 8rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 252rpx - 70rpx - 88rpx);
|
||||
/* #endif */
|
||||
/* #ifndef H5 */
|
||||
height: calc(100vh - 252rpx - 70rpx);
|
||||
/* #endif */
|
||||
background-color: #ffffff;
|
||||
|
||||
.list-item {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.list-item-box {
|
||||
width: calc(100% - 40rpx);
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid hsla(0, 0%, 90.2%, .8);
|
||||
|
||||
.list-item-box-l-t {
|
||||
color: #2e2f33;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.list-item-box-l-b {
|
||||
font-size: 24rpx;
|
||||
color: #aeb2c1;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.list-item-box-r {
|
||||
color: #2e2f33;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
163
me/jilu/histor.vue
Normal file
@@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="list flex align-center justify-center" v-for="(item,index) in list" :key="index"
|
||||
@click="goCourse(item.courseId,item.courseDetailsId)">
|
||||
<view class="list-box flex align-center justify-between">
|
||||
<view class="list-box-l">
|
||||
<image :src="item.titleImg" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="list-box-r flex flex-wrap">
|
||||
<view class="list-box-r-title">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="list-box-r-jilu">
|
||||
看到{{item.courseDetailsName}}
|
||||
</view>
|
||||
<view class="list-box-r-new flex align-center justify-between">
|
||||
<view class="list-box-r-new-l">
|
||||
{{item.over==1?'完结':'更新'+item.courseDetailsCount+'集'}}
|
||||
</view>
|
||||
<view class="list-box-r-new-r">
|
||||
继续观看
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="margin: 20rpx;" v-if="list.length > 0">
|
||||
<u-loadmore :status="status" />
|
||||
</view>
|
||||
<empty v-if="list.length == 0" title="暂无记录" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 'loadmore',
|
||||
list: [],
|
||||
page: 1,
|
||||
pages: 1,
|
||||
limit: 10,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.page < this.pages) {
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getList()
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 跳转资源详情
|
||||
goCourse(e, courseDetailsId) {
|
||||
uni.navigateTo({
|
||||
url: '/me/detail/detail?id=' + e + '&courseDetailsId=' + courseDetailsId
|
||||
})
|
||||
},
|
||||
//获取观看记录
|
||||
getList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
classify: 1
|
||||
}
|
||||
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.pages = res.data.pages
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.list = res.data.records
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.list {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.list-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.list-box-l {
|
||||
width: 150rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 24rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list-box-r {
|
||||
width: calc(100% - 170rpx);
|
||||
height: 200rpx;
|
||||
padding: 20rpx;
|
||||
|
||||
.list-box-r-title {
|
||||
width: 100%;
|
||||
color: #2e2f33;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.list-box-r-jilu {
|
||||
width: 100%;
|
||||
color: #ff7581;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.list-box-r-new {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
|
||||
.list-box-r-new-l {
|
||||
color: #aeb2c1;
|
||||
|
||||
}
|
||||
|
||||
.list-box-r-new-r {
|
||||
padding: 10rpx 20rpx;
|
||||
background-color: #ff7581;
|
||||
color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
164
me/jilu/jilu.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="list flex align-center justify-center" v-for="(item,index) in list" :key="index"
|
||||
@click="goCourse(item.courseId,item.courseDetailsId)">
|
||||
<view class="list-box flex align-center justify-between">
|
||||
<view class="list-box-l">
|
||||
<image :src="item.titleImg" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="list-box-r flex flex-wrap">
|
||||
<view class="list-box-r-title">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="list-box-r-jilu">
|
||||
看到{{item.courseDetailsName}}
|
||||
</view>
|
||||
<view class="list-box-r-new flex align-center justify-between">
|
||||
<view class="list-box-r-new-l">
|
||||
{{item.over==1?'完结':'更新'+item.courseDetailsCount+'集'}}
|
||||
</view>
|
||||
<view class="list-box-r-new-r">
|
||||
继续观看
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="margin: 20rpx;" v-if="list.length > 0">
|
||||
<u-loadmore :status="status" />
|
||||
</view>
|
||||
<empty v-if="list.length == 0" title="暂无记录" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 'loadmore',
|
||||
list: [],
|
||||
page: 1,
|
||||
pages: 1,
|
||||
limit: 10,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.page < this.pages) {
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getList()
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 跳转资源详情
|
||||
goCourse(e, courseDetailsId) {
|
||||
uni.navigateTo({
|
||||
url: '/me/detail/detail?id=' + e + '&courseDetailsId=' + courseDetailsId
|
||||
})
|
||||
},
|
||||
//获取观看记录
|
||||
getList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
classify: 3
|
||||
}
|
||||
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.pages = res.data.pages
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.list = res.data.records
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.list {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.list-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.list-box-l {
|
||||
width: 150rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 24rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list-box-r {
|
||||
width: calc(100% - 170rpx);
|
||||
height: 200rpx;
|
||||
padding: 20rpx;
|
||||
|
||||
.list-box-r-title {
|
||||
width: 100%;
|
||||
color: #2e2f33;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.list-box-r-jilu {
|
||||
width: 100%;
|
||||
color: #ff7581;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.list-box-r-new {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
|
||||
.list-box-r-new-l {
|
||||
color: #aeb2c1;
|
||||
|
||||
}
|
||||
|
||||
.list-box-r-new-r {
|
||||
padding: 10rpx 20rpx;
|
||||
background-color: #ff7581;
|
||||
color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
125
me/jilu/myLove.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="list flex align-center justify-between flex-wrap">
|
||||
<view class="list-item" v-for="(item,index) in list" :key="index" @click="goCourse(item.courseId,item.courseDetailsId)">
|
||||
<view class="list-item-img">
|
||||
<image :src="item.titleImg" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="list-item-title">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-item" style="height: 0;"></view>
|
||||
</view>
|
||||
<view class="" style="margin: 20rpx;" v-if="list.length > 0">
|
||||
<u-loadmore :status="status" />
|
||||
</view>
|
||||
|
||||
<empty v-if="list.length == 0" title="暂无记录" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 'loadmore',
|
||||
list: [],
|
||||
page: 1,
|
||||
pages: 1,
|
||||
limit: 10,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.page < this.pages) {
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getList()
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 跳转资源详情
|
||||
goCourse(e,courseDetailsId) {
|
||||
uni.navigateTo({
|
||||
url: '/me/detail/detail?id=' + e+'&courseDetailsId='+courseDetailsId
|
||||
})
|
||||
},
|
||||
//获取观看记录
|
||||
getList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
classify: 2
|
||||
}
|
||||
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.pages = res.data.pages
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.list = res.data.records
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.list {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.list-item {
|
||||
width: calc((100% - 40rpx) / 3);
|
||||
height: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
.list-item-img {
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.list-item-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 0 0 24rpx 24rpx;
|
||||
padding: 0 10rpx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
150
me/juqing/juqing.vue
Normal file
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 40rpx;">
|
||||
<view class="plot flex align-center justify-center">
|
||||
<view class="plot-box">
|
||||
<view class="plot-box-item flex justify-between" @click="goCourse(item.courseId,item.courseDetailsId)"
|
||||
v-for="(item,index) in jqList" :key="index">
|
||||
<view class="plot-box-item-l">
|
||||
<image :src="item.titleImg" mode=""></image>
|
||||
</view>
|
||||
<view class="plot-box-item-r">
|
||||
<view class="plot-box-item-r-title">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="plot-box-item-r-content" v-html="item.details">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="jqList.length == 0" />
|
||||
<u-loadmore v-if="jqList.length > 4" :status="status" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jqList: [], //剧情列表
|
||||
page: 1,
|
||||
limit: 10,
|
||||
pages: 1,
|
||||
status: 'loadmore',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getJqList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.page < this.pages) {
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getJqList()
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getJqList()
|
||||
},
|
||||
methods: {
|
||||
// 跳转资源详情
|
||||
goCourse(e, courseDetailsId) {
|
||||
let userId = uni.getStorageSync('userId')
|
||||
if (userId) {
|
||||
uni.navigateTo({
|
||||
url: '/me/detail/detail?id=' + e + '&courseDetailsId=' + courseDetailsId
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取剧情列表
|
||||
*/
|
||||
getJqList() {
|
||||
let data = {
|
||||
limit: this.limit,
|
||||
page: this.page,
|
||||
sort: '',
|
||||
}
|
||||
this.$u.api.courseList(data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.pages = res.data.totalPage
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.jqList = res.data.list
|
||||
} else {
|
||||
this.jqList = [...this.jqList, ...res.data.list]
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.plot {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.plot-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.plot-box-item {
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.plot-box-item-l {
|
||||
width: 200rpx;
|
||||
height: 260rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
image {
|
||||
width: 200rpx;
|
||||
height: 260rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.plot-box-item-r {
|
||||
width: calc(686rpx - 260rpx);
|
||||
}
|
||||
|
||||
.plot-box-item-r-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #2e2f33;
|
||||
}
|
||||
|
||||
.plot-box-item-r-content {
|
||||
font-size: 28rpx;
|
||||
color: #2e2f33;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
119
me/message/index.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<!-- 消息中心 -->
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="msgList.length" class="flex margin-lr padding-tb-sm u-border-bottom" v-for="(item,index) in msgList"
|
||||
:key='index'>
|
||||
<u-image src="@/me/static/message/xitong.png" width="82rpx" mode="widthFix"></u-image>
|
||||
<view class="flex-sub margin-left">
|
||||
<view class="flex justify-between">
|
||||
<view class="text-bold text-lg">{{item.title}}</view>
|
||||
<view class="text-gray">{{item.createAt}}</view>
|
||||
</view>
|
||||
<view class="text-gray">{{item.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="!msgList.length" title="暂无消息" :isShow="false"></empty>
|
||||
<!-- <view class="page-box" v-if="!msgList.length">
|
||||
<view class="centre">
|
||||
<image src="../static/none.png" mode=""></image>
|
||||
<view class="tips">
|
||||
暂无消息
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
msgList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getMsg()
|
||||
},
|
||||
methods: {
|
||||
getMsg() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
state: 5
|
||||
}
|
||||
this.$u.api.message(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.page == 1) {
|
||||
this.msgList = res.data.list
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
this.msgList = [...this.msgList, ...res.data.list]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getMsg()
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
// this.msgList = []
|
||||
this.getMsg()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
|
||||
image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
// border: 1px dotted #000000;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 34rpx;
|
||||
color: #5074FF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #5074FF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
758
me/payOrder/payOrder.vue
Normal file
@@ -0,0 +1,758 @@
|
||||
<template>
|
||||
<view style="padding: 20rpx 0;">
|
||||
<!-- 视频简介 -->
|
||||
<view class="info flex align-center justify-center">
|
||||
<view class="info-box flex align-center">
|
||||
<view class="info-box-l">
|
||||
<image :src="titleImg" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="info-box-r">
|
||||
<view class="info-box-r-t">
|
||||
{{type==1?name:courseDetailsName}}
|
||||
</view>
|
||||
<view class="info-box-r-b flex align-center" v-if="type == 1">
|
||||
全集价格:
|
||||
<view class="flex align-center">
|
||||
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||
src="../../static/images/me/jindou.png" mode="">
|
||||
</image>
|
||||
{{parsePrice(zongPrice)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-box-r-b flex align-center" v-else>
|
||||
单集价格:
|
||||
<view class="flex align-center">
|
||||
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||
src="../../static/images/me/jindou.png" mode="">
|
||||
</image>
|
||||
{{parsePrice(price)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 价格提示 -->
|
||||
<view class="price flex align-center justify-center">
|
||||
<view class="price-box flex align-center justify-between">
|
||||
<view class="price-box-title">
|
||||
需支付
|
||||
</view>
|
||||
<view class="price-box-price flex align-center" v-if="type==1">
|
||||
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||
src="../../static/images/me/jindou.png" mode="">
|
||||
</image>
|
||||
{{parsePrice(zongPrice)}}
|
||||
</view>
|
||||
<view class="price-box-price flex align-center" v-else>
|
||||
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||
src="../../static/images/me/jindou.png" mode="">
|
||||
</image>
|
||||
{{parsePrice(price)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 支付方式 -->
|
||||
<view v-if="payList.length>0" class="pay flex align-center justify-center">
|
||||
<view class="pay-box">
|
||||
<view class="pay-box-title">
|
||||
支付方式
|
||||
</view>
|
||||
<u-radio-group style="width: 100%;" size="44" v-model="payAway">
|
||||
<view class="pay-box-item flex align-center justify-between" v-for="(item,index) in payList"
|
||||
:key="index">
|
||||
<view class="pay-box-item-l flex align-center">
|
||||
<image :src="item.imgurl" mode=""></image>
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="pay-box-item-r">
|
||||
<u-radio active-color="5074FF" :name="item.payAway"></u-radio>
|
||||
</view>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="illustrate flex align-center justify-center">
|
||||
<view class="illustrate-box flex align-center">
|
||||
<u-checkbox v-model="checked" :size="40" shape="circle"></u-checkbox>
|
||||
<text @click="checked = !checked">我已经阅读并同意</text>
|
||||
<view @click="goXieyi()" class="illustrate-box-txt">
|
||||
《付费须知说明》
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 支付 -->
|
||||
<view class="submit flex align-center justify-center">
|
||||
<view class="submit-box flex align-center justify-center" @click="getOrderInfo()">
|
||||
支付 ¥{{type==1?parsePrice(zongPrice):parsePrice(price)}}
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
<!-- 抖音im客服 -->
|
||||
<ttMsg />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ttMsg from '../../components/ttMsg/ttMsg.vue'
|
||||
export default {
|
||||
components: {
|
||||
ttMsg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
courseId: '', //整部视频id
|
||||
courseDetailsId: '', //单集id
|
||||
titleImg: '', //图片
|
||||
courseDetailsName: '', //名称
|
||||
price: 0, //单价
|
||||
zongPrice: 0, //总价
|
||||
type: 1, //类型:1:整部 2:单部
|
||||
name: '', //全集名称
|
||||
payList: [],
|
||||
payAway: 1,
|
||||
checked: false
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// #ifdef APP
|
||||
if (plus.os.name.toLowerCase() === 'android') {
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/weixin.png',
|
||||
name: '微信支付',
|
||||
payAway: 1
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/zhifubao.png',
|
||||
name: '支付宝支付',
|
||||
payAway: 2
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}
|
||||
]
|
||||
this.payAway = 1
|
||||
} else {
|
||||
let checkIosPay = this.$queue.getData('checkIosPay');
|
||||
if (checkIosPay === '是') {
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}]
|
||||
this.payAway = 3
|
||||
} else {
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/weixin.png',
|
||||
name: '微信支付',
|
||||
payAway: 1
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/zhifubao.png',
|
||||
name: '支付宝支付',
|
||||
payAway: 2
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}
|
||||
]
|
||||
this.payAway = 1
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}]
|
||||
this.payAway = 3
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/weixin.png',
|
||||
name: '微信支付',
|
||||
payAway: 1
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}
|
||||
]
|
||||
this.payAway = 1
|
||||
} else {
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/zhifubao.png',
|
||||
name: '支付宝支付',
|
||||
payAway: 2
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}
|
||||
]
|
||||
this.payAway = 2
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/zhifubao.png',
|
||||
name: '抖音支付',
|
||||
payAway: 4
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}
|
||||
]
|
||||
this.payAway = 4
|
||||
// #endif
|
||||
// #ifdef MP-KUAISHOU
|
||||
const osName = uni.getSystemInfoSync().osName;
|
||||
if (osName != 'ios') { //安卓
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/zhifubao.png',
|
||||
name: '快手支付',
|
||||
payAway: 5
|
||||
},
|
||||
{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}
|
||||
]
|
||||
this.payAway = 5
|
||||
} else {
|
||||
this.payList = [{
|
||||
imgurl: '/static/images/pay/lingqian.png',
|
||||
name: '金豆支付',
|
||||
payAway: 3
|
||||
}]
|
||||
this.payAway = 3
|
||||
}
|
||||
// #endif
|
||||
if (option.info) {
|
||||
let info = JSON.parse(decodeURIComponent(option.info))
|
||||
this.courseId = info.courseId
|
||||
this.courseDetailsId = info.courseDetailsId
|
||||
this.titleImg = info.titleImg
|
||||
this.courseDetailsName = info.courseDetailsName
|
||||
this.price = info.price
|
||||
this.zongPrice = info.zongPrice
|
||||
this.name = info.name
|
||||
this.type = info.type
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//去付费须知说明
|
||||
goXieyi() {
|
||||
uni.navigateTo({
|
||||
url: '/me/setting/payXieYi'
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @param {Number} price
|
||||
* 价格保留两位小数
|
||||
*/
|
||||
parsePrice(price) {
|
||||
return price.toFixed(2)
|
||||
},
|
||||
//生成订单
|
||||
getOrderInfo() {
|
||||
if (this.checked == false) {
|
||||
this.$refs.uToast.show({
|
||||
title: '请阅读并同意《付费须知说明》',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
courseId: this.courseId
|
||||
}
|
||||
if (this.type != 1) { //购买单集
|
||||
data.courseDetailsId = this.courseDetailsId
|
||||
}
|
||||
this.$Request.getT('/app/order/insertCourseOrders', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.payOrder(res.data.orders.ordersId)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
/**
|
||||
* @param {Object} orderId 订单id
|
||||
*/
|
||||
payOrder(orderId) {
|
||||
let that = this
|
||||
if (that.payAway == 4) { //抖音支付
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
})
|
||||
this.$Request.postT('/app/dyPay/payVirtualAppOrder', {
|
||||
orderId: orderId
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
tt.requestOrder({
|
||||
data: JSON.stringify(res.data.data), // 请勿在前端对data做任何处理
|
||||
byteAuthorization: res.data
|
||||
.byteAuthorization, // 请勿在前端对byteAuthorization做任何处理
|
||||
success(redd) {
|
||||
console.log(JSON.stringify(redd))
|
||||
tt.getOrderPayment({
|
||||
orderId: redd.orderId,
|
||||
success(reee) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '支付成功'
|
||||
})
|
||||
setTimeout(function() {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
},
|
||||
fail(ee) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
})
|
||||
console.log(ee)
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
fail(e) {
|
||||
console.log(e)
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
} else if (that.payAway == 5) { //快手支付
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
})
|
||||
this.$Request.postT('/app/ksPay/payAppOrder', {
|
||||
orderId: orderId
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
ks.pay({
|
||||
serviceId: '1', //服务类型id(固定值为‘1’)
|
||||
orderInfo: res.data,
|
||||
success(succ) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '支付成功'
|
||||
})
|
||||
setTimeout(function() {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
},
|
||||
fail(err) {
|
||||
uni.hideLoading()
|
||||
that.$refs.uToast.show({
|
||||
title: '支付失败,请重试!',
|
||||
duration: 1500
|
||||
})
|
||||
},
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
this.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
switch (this.payAway) { //1:微信支付,2:支付宝支付 3:金豆支付
|
||||
case 1: //微信支付
|
||||
// #ifdef MP-WEIXIN
|
||||
that.$Request.postT("/app/wxPay/wxPayJsApiOrder", {
|
||||
orderId: orderId,
|
||||
}).then(red => {
|
||||
if (red.code == 0) {
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: red.data.timestamp,
|
||||
nonceStr: red.data.noncestr,
|
||||
package: red.data.package,
|
||||
signType: red.data.signType,
|
||||
paySign: red.data.sign,
|
||||
success: function(redd) {
|
||||
uni.showLoading({
|
||||
title: '支付成功'
|
||||
});
|
||||
uni.hideLoading();
|
||||
setTimeout(function() {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading();
|
||||
that.$queue.showToast(
|
||||
'支付失败');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: red.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
console.log(ua)
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
that.$Request.postT("/app/wxPay/wxPayMpOrder", {
|
||||
orderId: orderId,
|
||||
}).then(red => {
|
||||
if (red.code == 0) {
|
||||
that.callPay(red.data);
|
||||
} else {
|
||||
that.isPay = true
|
||||
uni.showToast({
|
||||
title: red.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
that.$Request.postT("/app/wxPay/payAppOrder", {
|
||||
orderId: orderId,
|
||||
}).then(red => {
|
||||
if (red.code == 0) {
|
||||
console.log(red, '+++++++++++++++++++++')
|
||||
that.setPayment('wxpay', JSON.stringify(red.data));
|
||||
} else {
|
||||
that.isPay = true
|
||||
uni.showToast({
|
||||
title: red.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
break;
|
||||
case 2: //支付宝
|
||||
// #ifdef H5
|
||||
that.$Request.postT("/app/aliPay/payOrder", {
|
||||
orderId: orderId,
|
||||
classify: 2
|
||||
}).then(red => {
|
||||
if (red.code == 0) {
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = red.data //此处form就是后台返回接收到的数据
|
||||
document.body.appendChild(div)
|
||||
document.forms[0].submit()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: red.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
that.$Request.postT("/app/aliPay/payOrder", {
|
||||
orderId: orderId,
|
||||
classify: 1
|
||||
}).then(red => {
|
||||
if (red.code == 0) {
|
||||
that.setPayment('alipay', red.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: red.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
break;
|
||||
default: //零钱
|
||||
that.$Request.postT("/app/order/payOrders", {
|
||||
orderId: orderId,
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '支付成功'
|
||||
})
|
||||
setTimeout(function() {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
} else {
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
// icon: 'none'
|
||||
// })
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '支付失败,余额不足!',
|
||||
confirmText: '去充值',
|
||||
complete(ret) {
|
||||
if (ret.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/me/wallet/wallet'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
callPay: function(response) {
|
||||
if (typeof WeixinJSBridge === "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
|
||||
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
|
||||
}
|
||||
} else {
|
||||
this.onBridgeReady(response);
|
||||
}
|
||||
},
|
||||
onBridgeReady: function(response) {
|
||||
let that = this;
|
||||
if (!response.package) {
|
||||
return;
|
||||
}
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest', {
|
||||
"appId": response.appid, //公众号名称,由商户传入
|
||||
"timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
|
||||
"nonceStr": response.noncestr, //随机串
|
||||
"package": response.package,
|
||||
"signType": response.signType, //微信签名方式:
|
||||
"paySign": response.sign //微信签名
|
||||
},
|
||||
function(res) {
|
||||
if (res.err_msg === "get_brand_wcpay_request:ok") {
|
||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||
uni.removeStorageSync('EditAddress')
|
||||
uni.showLoading({
|
||||
title: '支付成功'
|
||||
});
|
||||
uni.hideLoading();
|
||||
setTimeout(function() {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
}
|
||||
WeixinJSBridge.log(response.err_msg);
|
||||
}
|
||||
);
|
||||
},
|
||||
setPayment(name, order) {
|
||||
let that = this;
|
||||
uni.requestPayment({
|
||||
provider: name,
|
||||
orderInfo: order, //微信、支付宝订单数据
|
||||
success: function(res) {
|
||||
uni.showLoading({
|
||||
title: '支付成功'
|
||||
});
|
||||
uni.hideLoading();
|
||||
setTimeout(function() {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading();
|
||||
console.log(err, 12)
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/deep/.u-radio {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.illustrate {
|
||||
width: 100%;
|
||||
margin: 30rpx 0;
|
||||
|
||||
.illustrate-box {
|
||||
width: 686rpx;
|
||||
}
|
||||
|
||||
.illustrate-box-txt {
|
||||
color: #5173F8;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/deep/.u-radio__label {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
|
||||
.info-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.info-box-l {
|
||||
width: 200rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.info-box-r {
|
||||
margin-left: 30rpx;
|
||||
|
||||
.info-box-r-t {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.info-box-r-b {
|
||||
margin-top: 20rpx;
|
||||
color: #5074FF;
|
||||
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.price-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.price-box-price {
|
||||
color: #5074FF;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.pay {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.pay-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.pay-box-title {
|
||||
width: 100%;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
.pay-box-item {
|
||||
width: 100%;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.pay-box-item-l {
|
||||
font-weight: 500;
|
||||
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.submit {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx 0;
|
||||
|
||||
.submit-box {
|
||||
width: 686rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 40rpx;
|
||||
background-color: #5074FF;
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
203
me/setting/bind.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="cu-form-group"
|
||||
style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<view class="title">手机号</view>
|
||||
<input type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
|
||||
@input="inputChange" />
|
||||
</view>
|
||||
<view class="cu-form-group"
|
||||
style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<text class="title">验证码</text>
|
||||
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange"
|
||||
@confirm="toLogin" />
|
||||
<button class="send-msg" @click="sendMsg" :disabled="sending">{{ sendTime }}</button>
|
||||
</view>
|
||||
|
||||
<button class="confirm-btn" @click="toLogin" :disabled="logining">立即换绑
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import listCell from '@/components/com-input';
|
||||
export default {
|
||||
components: {
|
||||
// listCell
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mobile: '',
|
||||
code: '',
|
||||
logining: false,
|
||||
sending: false,
|
||||
sendTime: '获取验证码',
|
||||
count: 60,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
countDown() {
|
||||
const {
|
||||
count
|
||||
} = this;
|
||||
if (count === 1) {
|
||||
this.count = 60;
|
||||
this.sending = false;
|
||||
this.sendTime = '获取验证码'
|
||||
} else {
|
||||
this.count = count - 1;
|
||||
this.sending = true;
|
||||
this.sendTime = count - 1 + '秒后重新获取';
|
||||
setTimeout(this.countDown.bind(this), 1000);
|
||||
}
|
||||
},
|
||||
sendMsg() {
|
||||
const {
|
||||
mobile
|
||||
} = this;
|
||||
if (!mobile) {
|
||||
uni.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
} else if (mobile.length !== 11) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: '正在发送验证码...'
|
||||
})
|
||||
this.$u.get('/app/Login/sendMsg/' + mobile + '/login').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.sending = true;
|
||||
uni.showToast({
|
||||
title: '验证码发送成功请注意查收',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
this.countDown();
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '短信发送失败',
|
||||
content: res.msg ? res.msg : '请一分钟后再获取验证码'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
toLogin() {
|
||||
const {
|
||||
mobile,
|
||||
code,
|
||||
} = this;
|
||||
if (!mobile) {
|
||||
uni.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
} else if (code.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请输入验证码',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
} else {
|
||||
this.logining = true;
|
||||
uni.showLoading({
|
||||
title: '更换中...'
|
||||
})
|
||||
this.$u.post('/app/user/updatePhone?phone=' + mobile + '&msg=' + code).then(res => {
|
||||
if (res.code === 0) {
|
||||
// this.$queue.remove('invitation');
|
||||
// uni.setStorageSync('token', res.token)
|
||||
// uni.setStorageSync('userId', res.userId)
|
||||
// uni.setStorageSync('mobile', res.mobile)
|
||||
|
||||
uni.showToast({
|
||||
title: '更换成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '更换失败',
|
||||
content: res.msg
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
page {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.send-msg {
|
||||
border-radius: 30px;
|
||||
color: white;
|
||||
height: 30px;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
background: #ff7581;
|
||||
}
|
||||
|
||||
.container {
|
||||
top: 0;
|
||||
padding-top: 32upx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
z-index: 90;
|
||||
background: #ffffff;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.confirm-btn {
|
||||
width: 300px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
border-radius: 30px;
|
||||
margin-top: 70px;
|
||||
background: #ff7581;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
|
||||
&:after {
|
||||
border-radius: 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
91
me/setting/index.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/bind')">
|
||||
<view>修改手机号</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
<view class="flex justify-between padding bg-white solid-bottom"
|
||||
@click="goNav('/me/feedbackIndex/feedbackIndex')">
|
||||
<view>帮助中心</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/feedback/index')">
|
||||
<view>意见反馈</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/xieyi')">
|
||||
<view>用户协议</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/mimi')">
|
||||
<view>隐私协议</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/logOff')">
|
||||
<view>注销账号</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
<view class="flex justify-between padding bg-white solid-bottom" @click="loginOut">
|
||||
<view>退出登录</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
goNav(e) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
},
|
||||
// 退出登录
|
||||
loginOut() {
|
||||
uni.showModal({
|
||||
title: '退出提醒',
|
||||
content: '确定要退出登录么',
|
||||
confirmColor: '#ff7581',
|
||||
success: e => {
|
||||
if (e.confirm) {
|
||||
this.avatar = '/static/images/logo.png';
|
||||
this.userName = '';
|
||||
// this.isLogin = false
|
||||
// 清除本地数据
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('userName')
|
||||
uni.removeStorageSync('avatar')
|
||||
uni.removeStorageSync('phone')
|
||||
uni.removeStorageSync('invitationCode')
|
||||
uni.removeStorageSync('sex')
|
||||
uni.removeStorageSync('userId')
|
||||
uni.removeStorageSync('openId')
|
||||
uni.removeStorageSync('zhiFuBao')
|
||||
uni.removeStorageSync('zhiFuBaoName')
|
||||
uni.removeStorageSync('isVIP')
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '退出登录成功'
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
123
me/setting/kefu.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view style="height: 100vh;margin: 32upx;">
|
||||
<view style="text-align: center;background: #FFFFFF;padding: 40upx;border-radius: 32upx;">
|
||||
<view style="font-size: 38upx;">添加客服微信咨询</view>
|
||||
<!-- <view style="font-size: 32upx;margin-top: 32upx;">微信号:{{weixin}}</view>
|
||||
<view @click="copyHref"
|
||||
style="background: #ff7581;width:200upx;margin-top: 32upx;font-size: 30upx;margin-left: 36%;color: #FFFFFF;padding: 4upx 20upx;border-radius: 24upx;">
|
||||
一键复制</view> -->
|
||||
|
||||
<image @click="saveImg" mode="aspectFit" style="margin-top: 32upx" :src="image"></image>
|
||||
<view style="font-size: 28upx;margin-top: 32upx" v-if="isWeiXin">{{ isWeiXin ? '长按识别上方二维码' : '' }}</view>
|
||||
<!-- <view @click="goChat"
|
||||
style="width:260upx;margin-top: 32upx;font-size: 30upx;margin-left: 28%;color: #557EFD;padding: 4upx 20upx;border-radius: 24upx;">
|
||||
联系在线客服</view> -->
|
||||
<!-- <view v-if="isWeiXin" style="font-size: 24upx;margin-top: 80upx" @click="rests">无法识别?</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
image: '',
|
||||
isWeiXin: false,
|
||||
weixin: '',
|
||||
webviewStyles: {
|
||||
progress: {
|
||||
color: '#1A1929 '
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.isWeiXin = true;
|
||||
}
|
||||
// #endif
|
||||
//客服二维码
|
||||
this.$u.get('/app/common/type/205').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.image = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
// 客服微信号 /
|
||||
this.$u.get('/app/common/type/207').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.weixin = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
uni.stopPullDownRefresh(); // 停止刷新
|
||||
},
|
||||
methods: {
|
||||
//邀请码复制
|
||||
copyHref() {
|
||||
uni.setClipboardData({
|
||||
data: this.weixin,
|
||||
success: r => {
|
||||
this.$queue.showToast('复制成功');
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg() {
|
||||
let that = this;
|
||||
let imgArr = []
|
||||
imgArr.push(that.image);
|
||||
//预览图片
|
||||
uni.previewImage({
|
||||
urls: imgArr,
|
||||
current: imgArr[0]
|
||||
});
|
||||
// uni.saveImageToPhotosAlbum({
|
||||
// filePath: that.image,
|
||||
// success(res) {
|
||||
// that.$queue.showToast('保存成功');
|
||||
// }
|
||||
// });
|
||||
},
|
||||
rests() {
|
||||
uni.showToast({
|
||||
title: '已刷新请再次长按识别',
|
||||
mask: false,
|
||||
duration: 1500,
|
||||
icon: 'none'
|
||||
});
|
||||
window.location.reload();
|
||||
},
|
||||
// 在线客服
|
||||
goChat() {
|
||||
let token = this.$queue.getData('token');
|
||||
if (token) {
|
||||
uni.navigateTo({
|
||||
url: '/my/setting/chat'
|
||||
});
|
||||
} else {
|
||||
this.goLoginInfo();
|
||||
}
|
||||
},
|
||||
//统一登录跳转
|
||||
goLoginInfo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/loginphone'
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* @import '../../static/css/index.css'; */
|
||||
|
||||
page {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
</style>
|
||||
181
me/setting/logOff.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="icon flex align-center justify-center">
|
||||
<u-icon name="info-circle-fill" color="#ff7581" size="100"></u-icon>
|
||||
</view>
|
||||
<view class="title">
|
||||
注销短剧服务
|
||||
</view>
|
||||
<view class="shuoming">
|
||||
短剧服务帐号注销后,您将放弃以下权益且无法找回
|
||||
</view>
|
||||
<view class="list flex align-center justify-center">
|
||||
<view class="list-box">
|
||||
<view class="list-box-item">
|
||||
·<text style="margin-left: 10rpx;">您将无法通过该帐号登录、使用短剧平台;</text>
|
||||
</view>
|
||||
<view class="list-box-item">
|
||||
·<text style="margin-left: 10rpx;">您将无法访问帐号的个人信息(包括帐号名称、昵称、头像等);</text>
|
||||
</view>
|
||||
<view class="list-box-item">
|
||||
·<text style="margin-left: 10rpx;">您帐号的所有权益,将视为主动放弃</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tishi">
|
||||
点击【确认注销】即代表您已同意<text @click="goXieOff()">《用户注销协议》</text>
|
||||
</view>
|
||||
<view class="submit flex align-center justify-center">
|
||||
<view class="submit-box flex align-center justify-center" @click="submit()">
|
||||
确认注销
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//用户注销协议
|
||||
goXieOff() {
|
||||
uni.navigateTo({
|
||||
url: '/me/setting/offXieyi'
|
||||
})
|
||||
},
|
||||
//确认注销
|
||||
submit() {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认注销后,您将退出登录,并清除所有数据!',
|
||||
cancelText: '我再想想',
|
||||
confirmText: '确认注销',
|
||||
confirmColor: '#ff7581',
|
||||
complete(ret) {
|
||||
if (ret.confirm) {
|
||||
let data = {
|
||||
state: 3,
|
||||
content: '我要注销账号',
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
that.$Request.postJson('/app/message/insertMessage', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '操作成功',
|
||||
showCancel: false,
|
||||
confirmText: '确认',
|
||||
confirmColor: '#fd6416'
|
||||
})
|
||||
that.loginOut()
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 退出登录
|
||||
loginOut() {
|
||||
this.avatar = '/static/images/logo.png';
|
||||
this.userName = '';
|
||||
// this.isLogin = false
|
||||
// 清除本地数据
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('userName')
|
||||
uni.removeStorageSync('avatar')
|
||||
uni.removeStorageSync('phone')
|
||||
uni.removeStorageSync('invitationCode')
|
||||
uni.removeStorageSync('sex')
|
||||
uni.removeStorageSync('userId')
|
||||
uni.removeStorageSync('openId')
|
||||
uni.removeStorageSync('zhiFuBao')
|
||||
uni.removeStorageSync('zhiFuBaoName')
|
||||
uni.removeStorageSync('isVIP')
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: '/pages/me/index'
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.icon {
|
||||
width: 100%;
|
||||
padding-top: 100rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.shuoming {
|
||||
font-size: 16rpx;
|
||||
color: #333333;
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
// height: 100rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.list-box {
|
||||
padding: 20rpx;
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
background: #ffffff;
|
||||
|
||||
.list-box-item {
|
||||
margin-top: 10rpx;
|
||||
font-size: 16rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tishi {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #999999;
|
||||
margin-top: 40rpx;
|
||||
font-size: 18rpx;
|
||||
|
||||
text {
|
||||
color: #ff7581;
|
||||
}
|
||||
}
|
||||
|
||||
.submit {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
margin-top: 60rpx;
|
||||
|
||||
.submit-box {
|
||||
width: 686rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 16rpx;
|
||||
color: #ffffff;
|
||||
background-color: #ff7581;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
31
me/setting/mimi.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="home1">
|
||||
<view style="font-size: 28upx;" v-html="content"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
content:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getGuize();
|
||||
},
|
||||
methods: {
|
||||
getGuize(){
|
||||
this.$u.get('app/common/type/155').then(res => {
|
||||
this.content = res.data.value
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
/* background: #1c1b20; */
|
||||
}
|
||||
</style>
|
||||
32
me/setting/offXieyi.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<view style="line-height: 26px;padding: 32upx;" class="home1">
|
||||
<view style="font-size: 28upx;" v-html="content"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
content:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getGuize();
|
||||
},
|
||||
methods: {
|
||||
getGuize(){
|
||||
this.$u.get('app/common/type/246').then(res => {
|
||||
this.content = res.data.value
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{
|
||||
/* background: #1c1b20; */
|
||||
}
|
||||
</style>
|
||||
31
me/setting/payXieYi.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="home1">
|
||||
<view style="font-size: 28upx;" v-html="content"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getGuize();
|
||||
},
|
||||
methods: {
|
||||
getGuize() {
|
||||
this.$u.get('app/common/type/500').then(res => {
|
||||
this.content = res.data.value
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
/* background: #1c1b20; */
|
||||
}
|
||||
</style>
|
||||
37
me/setting/xieyi.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<view style="line-height: 26px;padding: 32upx;" class="home1">
|
||||
<view style="font-size: 28upx;" v-html="content"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
content:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getGuize();
|
||||
},
|
||||
methods: {
|
||||
getGuize(){
|
||||
// this.$Request.getT('/agreement/find?id=1').then(res =>{
|
||||
// if(res.status === 0){
|
||||
// this.content = res.data.content;
|
||||
// }
|
||||
// });
|
||||
this.$u.get('app/common/type/154').then(res => {
|
||||
this.content = res.data.value
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{
|
||||
/* background: #1c1b20; */
|
||||
}
|
||||
</style>
|
||||
BIN
me/static/.DS_Store
vendored
Normal file
BIN
me/static/assist/as1.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
me/static/assist/as2.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
me/static/assist/as3.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
me/static/assist/as4.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
me/static/assist/asr.png
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
me/static/assist/zlBg.png
Normal file
|
After Width: | Height: | Size: 334 KiB |
BIN
me/static/dowm.png
Normal file
|
After Width: | Height: | Size: 437 B |
BIN
me/static/icon-edit.png
Normal file
|
After Width: | Height: | Size: 947 B |
BIN
me/static/icon-letter.png
Normal file
|
After Width: | Height: | Size: 856 B |
BIN
me/static/integral/bg.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
me/static/integral/integrate.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
me/static/integral/jinbi.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
me/static/invite/.DS_Store
vendored
Normal file
BIN
me/static/invite/5.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
me/static/invite/6.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
me/static/invite/7.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
me/static/invite/fenxiang.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
me/static/invite/jiqiao.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
me/static/invite/juxing.png
Normal file
|
After Width: | Height: | Size: 364 KiB |
BIN
me/static/invite/yaoqing.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
me/static/message/jifen.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
me/static/message/xitong.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
me/static/none.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
me/static/nvueIcon/backs.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
me/static/nvueIcon/closeIcon.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
me/static/nvueIcon/lock.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
me/static/nvueIcon/moreList.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
me/static/nvueIcon/myLove.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
me/static/nvueIcon/myLove_.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
me/static/order/tuceng.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
me/static/up.png
Normal file
|
After Width: | Height: | Size: 429 B |
129
me/wallet/mingxi.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 20rpx;">
|
||||
<view v-for="(item,index) in list" :key="index" class="list flex align-center justify-center">
|
||||
<view class="list-box">
|
||||
<view class="list-box-title">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="list-box-content">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="list-box-time flex align-center justify-between">
|
||||
{{item.createTime}}
|
||||
<text>{{item.type==1?'+':'-'}}{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length > 3" class="loadmore">
|
||||
<u-loadmore :status="status" />
|
||||
</view>
|
||||
|
||||
<empty v-if="list.length==0" title="暂无明细" />
|
||||
<!-- 抖音im客服 -->
|
||||
<ttMsg />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ttMsg from '../../components/ttMsg/ttMsg.vue'
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty,
|
||||
ttMsg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 'loadmore',
|
||||
list: [], //余额明细
|
||||
page: 1,
|
||||
pages: 1,
|
||||
limit: 10,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
},
|
||||
//加载更多
|
||||
onReachBottom() {
|
||||
if (this.page < this.pages) {
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getList()
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$Request.getT('/app/moneyDetails/queryUserMoneyDetails', data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.pages = res.data.pages
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.list = res.data.records
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.list {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.list-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.list-box-title {
|
||||
width: 100%;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.list-box-content {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.list-box-time {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
color: #999999;
|
||||
|
||||
text {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loadmore {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
</style>
|
||||
1304
me/wallet/wallet.vue
Normal file
1264
me/wallet/wallets.vue
Normal file
111
me/wallpaper/wallpaper.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="videoImg flex align-center justify-center">
|
||||
<view class="videoImg-box flex justify-between align-center flex-wrap">
|
||||
<view class="videoImg-box-item" v-for="(item,index) in wallpaperList" :key="index">
|
||||
<image @click="priveImg(item.imageUrl)" :src="item.imageUrl" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="wallpaperList.length == 0" />
|
||||
<u-loadmore v-if="wallpaperList.length >= 4" :status="status" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
wallpaperList: [], //壁纸列表
|
||||
page: 1,
|
||||
limit: 10,
|
||||
pages: 1,
|
||||
status: 'loadmore',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getWallpaperList() //壁纸
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.page < this.pages) {
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getWallpaperList()
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getWallpaperList()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @param {Object} url 图片链接
|
||||
* 预览图片
|
||||
*/
|
||||
priveImg(url) {
|
||||
console.log(url)
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
current: 0
|
||||
})
|
||||
},
|
||||
//获取壁纸列表
|
||||
getWallpaperList() {
|
||||
let data = {
|
||||
classify: 10,
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
// selectBannerPage
|
||||
this.$u.api.selectBannerPage(data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
this.pages = res.data.totalPage
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.wallpaperList = res.data.list
|
||||
} else {
|
||||
this.wallpaperList = [...this.wallpaperList, ...res.data.list]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.videoImg {
|
||||
width: 100%;
|
||||
padding-top: 20rpx;
|
||||
height: auto;
|
||||
|
||||
.videoImg-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.videoImg-box-item {
|
||||
width: 49%;
|
||||
height: 500rpx;
|
||||
border-radius: 18rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||