first commit
This commit is contained in:
83
pages/me/erweimaRegister.vue
Normal file
83
pages/me/erweimaRegister.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- <u-navbar :title-bold="true" :title="$t('order.wxts')"> -->
|
||||
<!-- <view class="slot-wrap margin-right" slot="right">全部已读</view> -->
|
||||
<!-- </u-navbar> -->
|
||||
<view style="text-align: center;height: 100%;position: absolute;width:100%;background: #F8F8F8;">
|
||||
<image style="width: 60px;height: 60px;margin-top: 20px;border-radius:10px" src="/static/images/logo.png">
|
||||
</image>
|
||||
<view style="font-size: 18px;margin-top: 8px;font-weight: 600;padding: 0rpx 30rpx;">{{content}}</view>
|
||||
<image style="margin-top: 40px" mode="aspectFit" :src="erweima">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isWeiXin: false,
|
||||
name: '',
|
||||
content: '',
|
||||
erweima: '',
|
||||
webviewStyles: {
|
||||
progress: {
|
||||
color: '#FF3333'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
//pc展示用户端二维码 854
|
||||
this.$Request.getT("/app/common/type/854").then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.erweima = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
//pc展示用户端文字 853
|
||||
this.$Request.getT("/app/common/type/853").then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.content = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
uni.stopPullDownRefresh(); // 停止刷新
|
||||
},
|
||||
onShow() {
|
||||
//#ifdef H5
|
||||
this.follow()
|
||||
//#endif
|
||||
},
|
||||
methods: {
|
||||
|
||||
follow() {
|
||||
if (this.$queue.getData("openid")) {
|
||||
this.$Request.get("/tao/wx/follow/" + this.$queue.getData("openid")).then(res => {
|
||||
if (res === true) {
|
||||
window.location.replace(this.$queue.publicYuMing());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
rests() {
|
||||
uni.showToast({
|
||||
title: "已刷新请再次长按识别",
|
||||
mask: false,
|
||||
duration: 1500,
|
||||
icon: "none"
|
||||
});
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
847
pages/me/index.vue
Normal file
847
pages/me/index.vue
Normal file
@@ -0,0 +1,847 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 40rpx;">
|
||||
<u-navbar :background="background" :is-back="false" :title="title" :border-bottom="false">
|
||||
</u-navbar>
|
||||
<!-- 登录信息 -->
|
||||
<view class="info flex align-center justify-center">
|
||||
<view class="info-box">
|
||||
<view @click="token?goNav('/pages/me/userinfo'):goNav('/pages/login/login')"
|
||||
class="info-box-c flex align-center justify-between">
|
||||
<view class="info-box-c-l flex align-center">
|
||||
<view class="info-box-c-l-avatar">
|
||||
<image :src="avatar?avatar:'../../static/images/logo.png'" mode=""></image>
|
||||
</view>
|
||||
<view class="info-box-c-l-name">
|
||||
<view class="info-box-c-l-name-t">
|
||||
{{userName?userName:'未登录'}}
|
||||
</view>
|
||||
<view class="info-box-c-l-name-b" v-if="invitationCode">
|
||||
ID:{{invitationCode}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-box-c-r">
|
||||
<u-icon name="arrow-right" color="#F6F6F6" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 统计 -->
|
||||
<view class="statistics flex align-center justify-center">
|
||||
<view class="statistics-box flex align-center justify-between">
|
||||
<view class="statistics-box-item" @click="goNav('/me/jilu/myLove')">
|
||||
<view class="statistics-box-item-top">
|
||||
{{myLoveNum}}
|
||||
</view>
|
||||
<view class="statistics-box-item-btn">
|
||||
我的喜欢
|
||||
</view>
|
||||
</view>
|
||||
<view class="statistics-box-item" @click="goNav('/me/jilu/histor')">
|
||||
<view class="statistics-box-item-top">
|
||||
{{myZhui}}
|
||||
</view>
|
||||
<view class="statistics-box-item-btn">
|
||||
我的追剧
|
||||
</view>
|
||||
</view>
|
||||
<view class="statistics-box-item" @click="goNav('/me/jifen/jifen')">
|
||||
<view class="statistics-box-item-top">
|
||||
{{jifen}}
|
||||
</view>
|
||||
<view class="statistics-box-item-btn">
|
||||
我的积分
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isVips == '是' && isWxIosPay == true" class="vip flex align-center justify-center">
|
||||
<view class="vip-box flex align-center justify-between">
|
||||
<view class="vip-box-l">
|
||||
<view class="vip-box-l-l flex align-center">
|
||||
{{isVIP?'会员用户':'开通会员'}}
|
||||
<image src="../../static/images/me/Vips.png" mode=""></image>
|
||||
</view>
|
||||
|
||||
<view class="vip-box-l-r" v-if="isVIP">
|
||||
{{endTime?endTime+'到期':'您是尊贵的永久会员'}}
|
||||
</view>
|
||||
<view class="vip-box-l-r" v-else>
|
||||
{{endTime?endTime+'到期':'升级VIP,省更多钱'}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!isVIP" @click="goNav('/pages/me/vip/index')"
|
||||
class="vip-box-r flex align-center justify-center">
|
||||
立即开通
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 钱包 -->
|
||||
<view class="money flex align-center justify-center" v-if="isWxIosPay == true">
|
||||
<view class="money-box flex align-center justify-between">
|
||||
<view class="">
|
||||
<view class="money-box-title flex align-center">
|
||||
<view class="money-box-title-l">
|
||||
金豆余额
|
||||
</view>
|
||||
<view @click="isShoMoney = !isShoMoney" class="money-box-title-r" style="margin-left: 12rpx;">
|
||||
<u-icon :name="isShoMoney?'eye':'eye-off'" color="#5A4A32" size="40"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money-box-price">
|
||||
<block v-if="isShoMoney">
|
||||
{{formatNumber(moneyNum)}}
|
||||
</block>
|
||||
<block v-else>
|
||||
****
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money-box-btn" @click="goNav('/me/wallet/wallet')">
|
||||
立即充值
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 常用工具 -->
|
||||
<view class="tool flex align-center justify-center">
|
||||
<view class="tool-box">
|
||||
<view class="tool-box-content flex align-center justify-between flex-wrap">
|
||||
<!-- #ifdef MP-TOUTIAO -->
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/wallet/mingxi')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/mingxi.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
钱包明细
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view v-if="kmPaySel != '否'" @click="openKaMiShow()"
|
||||
class="tool-box-content-item flex align-center justify-center flex-wrap">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/kami.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
卡密兑换
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/invite/index')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/vfx.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
分享好友
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/message/index')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/messige.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
消息中心
|
||||
</view>
|
||||
<u-badge :offset="[0,20]" type="error" :count="numCount"></u-badge>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/jilu/jilu')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/vlishi.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
观看历史
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="rate>0" class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/invite/inviteDet')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/vtd.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
我的团队
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap" @click="goMsg()">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/vkf.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
联系客服
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/feedbackIndex/feedbackIndex')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/bangzhu.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
帮助中心
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/feedback/index')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/yijian.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
意见反馈
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
|
||||
@click="goNav('/me/setting/index')">
|
||||
<view class="tool-box-content-item-img">
|
||||
<image src="../../static/images/me/setting.png" mode=""></image>
|
||||
</view>
|
||||
<view class="tool-box-content-item-txt">
|
||||
设置中心
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap" style="height: 0;">
|
||||
</view>
|
||||
<view class="tool-box-content-item flex align-center justify-center flex-wrap" style="height: 0;">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卡密兑换弹窗 -->
|
||||
<u-popup @close="kami = ''" v-model="showCard" mode="center" border-radius="14" :closeable="true">
|
||||
<view class="kami">
|
||||
<view class="kami-title">
|
||||
卡密兑换
|
||||
</view>
|
||||
<view class="kami-input">
|
||||
<u-input v-model="kami" placeholder="请输入卡密" type="text" :border="true" />
|
||||
</view>
|
||||
<view @click="exchangeKaMi()" class="kami-btn flex align-center justify-center">
|
||||
确认兑换
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 抖音im客服 -->
|
||||
<ttMsg />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ttMsg from '../../components/ttMsg/ttMsg.vue'
|
||||
export default {
|
||||
components: {
|
||||
ttMsg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
background: {
|
||||
backgroundImage: 'linear-gradient(to right, #FFE5EA 0%, #E4F5FB 49%, #FFF0EE 100%)'
|
||||
},
|
||||
kami: '', //卡密
|
||||
isShoMoney: false, //是否显示余额
|
||||
avatar: '../../static/images/logo.png',
|
||||
img: '../../static/images/me/huiyuan.png',
|
||||
swiperList: [{
|
||||
imageUrl: '../../static/images/me/banner.png',
|
||||
}],
|
||||
isLogin: false,
|
||||
userName: '未登录',
|
||||
isVIP: false,
|
||||
invitationCode: '',
|
||||
token: '',
|
||||
endTime: '', //会员到期时间
|
||||
moneyNum: 0, //余额
|
||||
jifen: 0, //积分
|
||||
isVips: '否', //是否显示会员
|
||||
myLoveNum: 0, //我的喜欢个数
|
||||
myZhui: 0, //我的追剧数量
|
||||
showCard: false,
|
||||
numCount: 0,
|
||||
rate: 0,
|
||||
kmPaySel: '否',
|
||||
isWxIosPay: true, //微信下是否显示支付功能
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getBannerList()
|
||||
},
|
||||
onShow() {
|
||||
this.isWxIosPay = uni.getStorageSync('isWxIosPay')
|
||||
this.kmPaySel = this.$queue.getData('kmPaySel');
|
||||
this.numCount = uni.getStorageSync('numCount')
|
||||
this.isVips = uni.getStorageSync('isVips') ? uni.getStorageSync('isVips') : '否'
|
||||
this.token = uni.getStorageSync('token')
|
||||
if (this.token) {
|
||||
this.getMyMoney()
|
||||
this.getJifen()
|
||||
this.$u.api.userinfo().then(res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
uni.setStorageSync('zhiFuBao', res.data.zhiFuBao)
|
||||
uni.setStorageSync('zhiFuBaoName', res.data.zhiFuBaoName)
|
||||
uni.setStorageSync('userName', res.data.userName)
|
||||
uni.setStorageSync('avatar', res.data.avatar)
|
||||
this.userName = res.data.userName
|
||||
this.avatar = res.data.avatar
|
||||
this.invitationCode = res.data.invitationCode
|
||||
if (res.data.rate) {
|
||||
this.rate = (Number(res.data.rate) * 100).toFixed(0)
|
||||
} else {
|
||||
this.rate = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
let data = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
this.$u.api.userVip(data).then(res => {
|
||||
if (res.code == 0 && res.data && res.data.isVip == 2) {
|
||||
this.isVIP = true;
|
||||
this.endTime = res.data.endTime
|
||||
uni.setStorageSync('isVIP', true)
|
||||
} else {
|
||||
this.isVIP = false;
|
||||
this.endTime = ''
|
||||
uni.setStorageSync('isVIP', false)
|
||||
}
|
||||
})
|
||||
|
||||
this.isLogin = true
|
||||
this.userName = uni.getStorageSync('userName')
|
||||
this.isVIP = uni.getStorageSync('isVIP')
|
||||
this.getMyLoveNum()
|
||||
this.getMyZhuiNum()
|
||||
} else {
|
||||
this.isLogin = false
|
||||
this.isVIP = false
|
||||
this.endTime = '' //会员到期时间
|
||||
this.moneyNum = 0 //余额
|
||||
this.jifen = 0 //积分
|
||||
this.userName = '未登录'
|
||||
this.invitationCode = ''
|
||||
this.myLoveNum = 0
|
||||
this.myZhui = 0
|
||||
this.rate = 0
|
||||
}
|
||||
this.avatar = uni.getStorageSync('avatar') ? uni.getStorageSync('avatar') : '../../static/images/logo.png'
|
||||
},
|
||||
methods: {
|
||||
//兑换卡密
|
||||
exchangeKaMi() {
|
||||
if (!this.kami) {
|
||||
uni.showToast({
|
||||
title: '请输入卡密',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
sdkContent: this.kami
|
||||
}
|
||||
this.$Request.postT('/app/sdkInfo/sdkExchange', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '兑换成功'
|
||||
})
|
||||
this.showCard = false
|
||||
let datas = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
this.$u.api.userVip(datas).then(rest => {
|
||||
if (rest.code == 0 && rest.data && rest.data.isVip == 2) {
|
||||
this.isVIP = true;
|
||||
this.endTime = rest.data.endTime
|
||||
uni.setStorageSync('isVIP', true)
|
||||
} else {
|
||||
this.isVIP = false;
|
||||
this.endTime = ''
|
||||
uni.setStorageSync('isVIP', false)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
openKaMiShow() {
|
||||
if (uni.getStorageSync('token')) {
|
||||
this.showCard = true
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//获取我喜欢的数量
|
||||
getMyLoveNum() {
|
||||
let data = {
|
||||
page: 1,
|
||||
limit: 1,
|
||||
classify: 2
|
||||
}
|
||||
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.myLoveNum = res.data.total
|
||||
} else {
|
||||
this.myLoveNum = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取我追剧的数量
|
||||
getMyZhuiNum() {
|
||||
let data = {
|
||||
page: 1,
|
||||
limit: 1,
|
||||
classify: 1
|
||||
}
|
||||
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.myZhui = res.data.total
|
||||
} else {
|
||||
this.myZhui = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取积分
|
||||
*/
|
||||
getJifen() {
|
||||
this.$Request.getT('/app/integral/selectByUserId').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.jifen = res.data.integralNum
|
||||
} else {
|
||||
this.jifen = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @param {Number} num
|
||||
* @param 保留两位小数
|
||||
*/
|
||||
formatNumber(num) {
|
||||
// 判断是否为整数
|
||||
if (Number.isInteger(num)) {
|
||||
return num.toFixed(2);
|
||||
} else {
|
||||
return num.toFixed(2).replace(/\.?0+$/, '');
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取余额
|
||||
*/
|
||||
getMyMoney() {
|
||||
this.$Request.getT('/app/moneyDetails/selectUserMoney').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.moneyNum = res.data.money
|
||||
// this.$Request.getT('/app/invite/selectInviteMoney').then(ret => {
|
||||
// if (ret.code == 0) {
|
||||
// if (ret.data.inviteMoney && ret.data.inviteMoney.money) {
|
||||
// this.moneyNum = Number(res.data.money) + Number(ret.data.inviteMoney
|
||||
// .money)
|
||||
// } else {
|
||||
// this.moneyNum = Number(res.data.money)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
goPage(url) {
|
||||
if (url) {
|
||||
if (url.indexOf('/pages/') !== -1 || url.indexOf('/me/') !== -1) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
} else {
|
||||
//#ifndef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/webView?url=' + url
|
||||
});
|
||||
//#endif
|
||||
//#ifdef H5
|
||||
window.location.href = url;
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
},
|
||||
goMsg() {
|
||||
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
|
||||
}
|
||||
},
|
||||
goNav(e) {
|
||||
console.log(e)
|
||||
let token = uni.getStorageSync('token')
|
||||
if (token) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 获取轮播图列表
|
||||
getBannerList() {
|
||||
this.$u.api.bannerList({
|
||||
classify: '3'
|
||||
}).then(res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
let arr = []
|
||||
res.data.forEach(ret => {
|
||||
if (ret.state == 1) {
|
||||
arr.push(ret)
|
||||
}
|
||||
})
|
||||
this.swiperList = arr
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F5F7FF;
|
||||
}
|
||||
|
||||
/deep/.u-navbar-inner {
|
||||
/* #ifdef H5 */
|
||||
background: linear-gradient(to right, #FFE5EA 0%, #E4F5FB 49%, #FFF0EE 100%);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.kami {
|
||||
width: 500rpx;
|
||||
height: auto;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
.kami-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 30rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.kami-input {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.kami-btn {
|
||||
width: calc(100% - 60rpx);
|
||||
height: 80rpx;
|
||||
margin: 0 auto;
|
||||
background-color: #ff7581;
|
||||
border-radius: 44rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 10rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.info::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(to right, #FFE5EA 0%, #E4F5FB 49%, #FFF0EE 100%);
|
||||
z-index: 1;
|
||||
/* 确保在垂直渐变之上 */
|
||||
}
|
||||
|
||||
.info::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(to bottom, transparent, #F5F7FF);
|
||||
/* 垂直渐变,结束颜色为透明 */
|
||||
z-index: 2;
|
||||
/* 确保在水平渐变之上 */
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
// height: 400rpx;
|
||||
background: #F5F7FF;
|
||||
position: relative;
|
||||
border-radius: 0 0 80rpx 80rpx;
|
||||
|
||||
.info-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.info-box-c {
|
||||
width: 100%;
|
||||
height: 94rpx;
|
||||
// margin-top: 60rpx;
|
||||
margin-bottom: 140rpx;
|
||||
}
|
||||
|
||||
.info-box-c-l-avatar {
|
||||
width: 94rpx;
|
||||
height: 94rpx;
|
||||
border-radius: 50%;
|
||||
|
||||
image {
|
||||
width: 94rpx;
|
||||
height: 94rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.info-box-c-l-name {
|
||||
margin-left: 16rpx;
|
||||
|
||||
.info-box-c-l-name-t {
|
||||
color: #333333;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.info-box-c-l-name-b {
|
||||
color: #333333;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.statistics {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: -100rpx;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
|
||||
.statistics-box {
|
||||
width: 686rpx;
|
||||
// height: 184rpx;
|
||||
// background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.statistics-box-item {
|
||||
// width: calc(100% / 3);
|
||||
// height: 100%;
|
||||
}
|
||||
|
||||
.statistics-box-item-top {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #333333;
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.statistics-box-item-btn {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #999999;
|
||||
font-size: 26rpx;
|
||||
// margin-top: 20rpx
|
||||
}
|
||||
}
|
||||
|
||||
.vip {
|
||||
width: 100%;
|
||||
// height: 84rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.vip-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, #FEF5E4 0%, #FBECD7 100%);
|
||||
border-radius: 24rpx;
|
||||
padding: 26rpx 30rpx;
|
||||
}
|
||||
|
||||
.vip-box-l {
|
||||
image {
|
||||
width: 24rpx;
|
||||
height: 22rpx;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.vip-box-l-l {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
color: #5A4A32;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.vip-box-l-r {
|
||||
color: #817858;
|
||||
font-size: 26rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.vip-box-r {
|
||||
width: 130rpx;
|
||||
height: 50rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx -3rpx 9rpx 0rpx rgba(255, 255, 255, 0.46);
|
||||
border-radius: 25rpx;
|
||||
color: #5A4A32;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.money {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.money-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
background: #ffffff;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.money-box-btn {
|
||||
background: linear-gradient(90deg, #FF7581 0%, #F8A5AF 100%);
|
||||
border-radius: 44rpx;
|
||||
padding: 18rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.money-box-title-l {
|
||||
color: #333333;
|
||||
font-size: 28rpx;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.money-box-price {
|
||||
color: #333333;
|
||||
font-size: 48rpx;
|
||||
font-weight: 800;
|
||||
margin-top: 20rpx;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.tool {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.tool-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.tool-box-content {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: 30rpx 30rpx 0 30rpx;
|
||||
}
|
||||
|
||||
.tool-box-content-item {
|
||||
width: 130rpx;
|
||||
height: auto;
|
||||
margin-bottom: 46rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tool-box-content-item-img {
|
||||
width: 66rpx;
|
||||
height: 66rpx;
|
||||
|
||||
image {
|
||||
width: 66rpx;
|
||||
height: 66rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tool-box-content-item-txt {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 10rpx;
|
||||
color: #333333;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
475
pages/me/userinfo.vue
Normal file
475
pages/me/userinfo.vue
Normal file
@@ -0,0 +1,475 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="usermain">
|
||||
<view class="usermain-item u-border-bottom">
|
||||
<view>头像</view>
|
||||
<view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
||||
<image style="width: 111rpx;height: 111rpx;border-radius: 50%"
|
||||
:src="headImg?headImg:'../../static/images/logo.png'"></image>
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<image :src="headImg?headImg:'../../static/images/logo.png'" mode="" @click="uploadImg"
|
||||
style="width: 111rpx;height: 111rpx;border-radius: 50%;"></image>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="usermain-item item-padding u-border-bottom">
|
||||
<view>用户名</view>
|
||||
<view>
|
||||
<view class="cu-form-group">
|
||||
<input type="nickname" v-model="userName" placeholder="请输入用户名" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="usermain-item item-padding">
|
||||
<view >姓名</view>
|
||||
<view class="cu-form-group">
|
||||
<input v-model="realName" placeholder="请填写您的真实姓名" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="usermain-item item-padding u-border-bottom">
|
||||
<view>手机</view>
|
||||
<view>
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<view class="cu-form-group">
|
||||
<input v-if="phone" disabled v-model="phone" placeholder="请输入联系电话" />
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="cu-form-group">
|
||||
<input v-if="phone" disabled v-model="phone" placeholder="请输入联系电话" />
|
||||
<button v-else
|
||||
style="background-color: #ff7581 !important;color: #FFFFFF;font-size: 22rpx;padding: 10rpx 20rpx;"
|
||||
class="bottom" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
授权手机号
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="usermain-item item-padding" @click="goMyAddress">
|
||||
|
||||
<view >地址管理</view>
|
||||
<view>
|
||||
<view class="cu-form-group" >
|
||||
<image src="../static/right.png" style="width: 12rpx; height: 19rpx;margin-left: 10rpx;" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="footer-btn">
|
||||
<view class="usermain-btn" @click="messagebtn()">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configdata from '../../common/config.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: '',
|
||||
headImg: '../../static/images/logo.png',
|
||||
userName: '',
|
||||
nickName: '',
|
||||
userId: '',
|
||||
realName: '',
|
||||
weChatId: "",
|
||||
password: '',
|
||||
platform: '',
|
||||
createTime: '',
|
||||
money: '',
|
||||
jiFen: '',
|
||||
status: '',
|
||||
zhiFuBao: '',
|
||||
zhiFuBaoName: ''
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
getMyPhone(code) {
|
||||
let data = {
|
||||
code: code
|
||||
}
|
||||
this.$Request.postT('/app/Login/wxPhone', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.phone = res.data.phone_info.purePhoneNumber;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '获取手机号失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取小程序手机号授权
|
||||
getPhoneNumber: function(e) {
|
||||
console.log(e.detail, '1111111111')
|
||||
// #ifdef MP-TOUTIAO
|
||||
if (e.detail.encryptedData && e.detail.iv) {
|
||||
console.log('用户同意提供手机号');
|
||||
|
||||
// console.log('用户拒绝提供手机号');
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '获取手机号失败',
|
||||
icon: 'none'
|
||||
})
|
||||
// this.setPhoneByInsert(e.detail.encryptedData, e.detail.iv);
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
if (e.detail.code) {
|
||||
this.getMyPhone(e.detail.code)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '获取手机号失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
// if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
|
||||
// console.log('用户拒绝提供手机号');
|
||||
// } else {
|
||||
// console.log('用户同意提供手机号');
|
||||
// this.setPhoneByInsert(e.detail.encryptedData, e.detail.iv);
|
||||
// }
|
||||
// #endif
|
||||
// #ifdef MP-KUAISHOU
|
||||
|
||||
// #endif
|
||||
|
||||
},
|
||||
goMyAddress() {
|
||||
uni.navigateTo({
|
||||
url: '../jifen/myaddress'
|
||||
});
|
||||
},
|
||||
//微信填写能力获取头像
|
||||
onChooseAvatar(e) {
|
||||
console.log(e.detail.avatarUrl)
|
||||
let that = this;
|
||||
let url = ''
|
||||
let token = uni.getStorageSync('token');
|
||||
uni.showLoading({
|
||||
title: '上传中...'
|
||||
});
|
||||
uni.uploadFile({
|
||||
url: configdata.APIHOST + '/alioss/upload',
|
||||
// url: 'https://jiaoyu.xianmxkj.com/sqx_fast/alioss/upload', //仅为示例,非真实的接口地址
|
||||
filePath: e.detail.avatarUrl,
|
||||
// filePath: res.tempFilePaths[0],
|
||||
header: {
|
||||
token: token
|
||||
},
|
||||
name: 'file',
|
||||
success: uploadFileRes => {
|
||||
url = JSON.parse(uploadFileRes.data);
|
||||
|
||||
that.headImg = url.data
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
uploadImg() {
|
||||
let token = uni.getStorageSync('token')
|
||||
|
||||
if (!token) {
|
||||
this.goLoginInfo();
|
||||
return;
|
||||
}
|
||||
let that = this;
|
||||
var url = null;
|
||||
uni.showActionSheet({
|
||||
// itemList按钮的文字接受的是数组
|
||||
itemList: ["查看头像", "从相册选择图片"],
|
||||
success(e) {
|
||||
var index = e.tapIndex
|
||||
if (index === 0) {
|
||||
// 用户点击了预览当前图片
|
||||
// 可以自己实现当前头像链接的读取
|
||||
let url = that.headImg;
|
||||
let arr = []
|
||||
arr.push(url)
|
||||
uni.previewImage({
|
||||
// 预览功能图片也必须是数组的
|
||||
urls: arr
|
||||
})
|
||||
} else if (index === 1) {
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: function(res) {
|
||||
uni.showLoading({
|
||||
title: '上传中...'
|
||||
});
|
||||
let token = uni.getStorageSync('token');
|
||||
let userId = uni.getStorageSync('userId');
|
||||
uni.uploadFile({
|
||||
url: configdata.APIHOST + '/alioss/upload',
|
||||
// url: 'https://jiaoyu.xianmxkj.com/sqx_fast/alioss/upload', //仅为示例,非真实的接口地址
|
||||
filePath: res.tempFilePaths[0],
|
||||
name: 'file',
|
||||
success: uploadFileRes => {
|
||||
url = JSON.parse(uploadFileRes.data);
|
||||
console.log(url)
|
||||
that.headImg = url.data
|
||||
uni.hideLoading();
|
||||
// that.$u.post('/app/user/updateUsers',{
|
||||
// headImg: url.data
|
||||
// },{
|
||||
// header: "application/json"
|
||||
// }).then(res => {
|
||||
// uni.showToast({
|
||||
// title: '更新成功',
|
||||
// icon: "none"
|
||||
// })
|
||||
// that.getUserInfo();
|
||||
// })
|
||||
// uni.request({
|
||||
// url: 'https://jiaoyu.xianmxkj.com/sqx_fast/app/user/updateUsers',
|
||||
// data: data,
|
||||
// method: "POST",
|
||||
// header: {
|
||||
// "content-type": header,
|
||||
// "token": token
|
||||
// },
|
||||
// success: function (result) {
|
||||
// console.error(result);
|
||||
// succ.call(self, result.data)
|
||||
// },
|
||||
// fail: function (e) {
|
||||
// error.call(self, e)
|
||||
// }
|
||||
// })
|
||||
|
||||
// that.$Request.postJson('/user/update',{
|
||||
// userId: userId,
|
||||
// headImg:url.data
|
||||
// }).then(res => {
|
||||
// uni.hideLoading();
|
||||
// if (res.status === 0) {
|
||||
// that.$queue.showToast("更新成功");
|
||||
// that.getUserInfo(userId);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
config: function(name) {
|
||||
var info = null;
|
||||
if (name) {
|
||||
var name2 = name.split("."); //字符分割
|
||||
if (name2.length > 1) {
|
||||
info = configdata[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = configdata[name] || null;
|
||||
}
|
||||
if (info == null) {
|
||||
let web_config = cache.get("web_config");
|
||||
if (web_config) {
|
||||
if (name2.length > 1) {
|
||||
info = web_config[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = web_config[name] || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
},
|
||||
getUserInfo() {
|
||||
let userId = uni.getStorageSync('userId')
|
||||
this.$u.api.userinfo().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.userName = res.data.userName;
|
||||
this.phone = res.data.phone;
|
||||
this.phones = res.data.phone
|
||||
this.headImg = res.data.avatar;
|
||||
}
|
||||
})
|
||||
// this.$Request.getT('/user/find?id=' + userId).then(res => {
|
||||
// if (res.status === 0) {
|
||||
// this.userName = res.data.userName;
|
||||
// this.phone = res.data.phone;
|
||||
// this.headImg = res.data.headImg;
|
||||
// this.realName = res.data.realName;
|
||||
// this.nickName = res.data.nickName;
|
||||
// this.userId = res.data.userId;
|
||||
// this.password = res.data.password;
|
||||
// this.createTime = res.data.createTime;
|
||||
// this.money = res.data.money;
|
||||
// this.platform = res.data.platform;
|
||||
|
||||
// this.jiFen = res.data.jiFen;
|
||||
// this.weChatId=res.data.weChatId;
|
||||
// this.status = res.data.status;
|
||||
// this.zhiFuBao = res.data.zhiFuBao;
|
||||
// this.zhiFuBaoName = res.data.zhiFuBaoName;
|
||||
// } else {
|
||||
// uni.showModal({
|
||||
// showCancel: false,
|
||||
// title: '未知错误',
|
||||
// content: res.msg
|
||||
// });
|
||||
// this.$queue.logout();
|
||||
// }
|
||||
// uni.hideLoading();
|
||||
// });
|
||||
},
|
||||
//根据正则验证手机号是否正确包括校验长度
|
||||
checkPhone(phone) {
|
||||
return /^1[3456789]\d{9}$/.test(phone);
|
||||
},
|
||||
// 保存
|
||||
messagebtn() {
|
||||
if (!this.userName) {
|
||||
uni.showToast({
|
||||
title: "用户名不能为空",
|
||||
icon: "none"
|
||||
})
|
||||
return
|
||||
}
|
||||
// #ifdef MP-WEIXIN
|
||||
if (!this.phone) {
|
||||
uni.showToast({
|
||||
title: "手机号不能空",
|
||||
icon: "none"
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.checkPhone(this.phone) == false) {
|
||||
uni.showToast({
|
||||
title: "手机号格式不正确",
|
||||
icon: "none"
|
||||
})
|
||||
return
|
||||
}
|
||||
// #endif
|
||||
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '确定保存信息',
|
||||
confirmColor: '#ff7581',
|
||||
success: e => {
|
||||
if (e.confirm) {
|
||||
this.$u.post("/app/user/updateUsers", {
|
||||
userName: this.userName,
|
||||
avatar: this.headImg,
|
||||
phone: this.phone,
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: "none"
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// userphone(){
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/my/userphone'
|
||||
// })
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
button::after {
|
||||
border: none;
|
||||
background-color: none;
|
||||
}
|
||||
|
||||
button {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
box-sizing: border-box;
|
||||
text-decoration: none;
|
||||
line-height: 1.35;
|
||||
overflow: hidden;
|
||||
color: #666666;
|
||||
/* background-color: #fff; */
|
||||
background-color: rgba(255, 255, 255, 0) !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.usermain {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.usermain-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 40rpx;
|
||||
padding: 30rpx 40rpx 30rpx 0;
|
||||
justify-content: space-between;
|
||||
/* border-bottom: 2rpx solid #f2f2f2; */
|
||||
}
|
||||
|
||||
.usermain-item.item-padding {
|
||||
padding: 0 40rpx 0 0;
|
||||
}
|
||||
|
||||
.cu-form-group {
|
||||
padding: 0;
|
||||
background: #FFFFFF;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.cu-form-group input {
|
||||
background: #FFFFFF;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
||||
}
|
||||
|
||||
.footer-btn {
|
||||
margin-top: 150rpx;
|
||||
}
|
||||
|
||||
.footer-btn .usermain-btn {
|
||||
color: #FFFFFF;
|
||||
background: #ff7581;
|
||||
text-align: center;
|
||||
width: 450rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
</style>
|
||||
916
pages/me/vip/index.vue
Normal file
916
pages/me/vip/index.vue
Normal file
@@ -0,0 +1,916 @@
|
||||
<!-- 会员中心 -->
|
||||
<template>
|
||||
<view>
|
||||
<view class="margin-top margin-lr radius u-relative"
|
||||
style="overflow: hidden;height: 260rpx;border-radius: 40rpx;">
|
||||
<u-image src="../../../static/images/me/beijing@2x.png" width="100%" height="400rpx"></u-image>
|
||||
<view class="u-abso margin" style="top: 0;">
|
||||
<view class="text-bold u-font-40">{{userName}}</view>
|
||||
<view class="margin-top-sm" style="color: #604320;" v-if="!isVIP">购买会员所有资源免费看</view>
|
||||
<view class="margin-top-sm" style="color: #604320;" v-else>会员到期:{{vipData}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-lr padding bg-white"
|
||||
style="border-radius: 40rpx;position: relative;top: -80rpx;color: #000;">
|
||||
<view class="u-font-16 text-bold margin-bottom">开通会员</view>
|
||||
<view class="flex justify-between margin-bottom" v-for="(item, index) in VIPlist" :key="index">
|
||||
<view>
|
||||
<view class="u-font-40">
|
||||
{{item.money}}<text style="font-size: 22rpx;margin-right: 16rpx;">金豆</text>
|
||||
<!-- #ifdef MP-TOUTIAO -->
|
||||
/ {{item.payDiamond}}<text style="font-size: 22rpx;">钻石</text>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="" style="color: #7F8299;">{{item.type}}卡 •
|
||||
{{item.money}}金豆/
|
||||
<!-- #ifdef MP-TOUTIAO -->
|
||||
{{item.payDiamond}}钻石/
|
||||
<!-- #endif -->
|
||||
{{item.type}}/{{item.vipNameType==0?'30天':(item.vipNameType==1?'90天':'365天')}}
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="btn-bg" @click="bugVIP(item.id)">购买</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="illustrate flex align-center justify-center">
|
||||
<view class="illustrate-box flex align-center">
|
||||
<u-checkbox active-color="#ff7581" v-model="checked" shape="circle"></u-checkbox>
|
||||
<text @click="checked = !checked">
|
||||
我已经阅读并同意
|
||||
</text>
|
||||
<view @click="goXieyi()" class="illustrate-box-txt">
|
||||
《付费须知说明》
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-popup v-model="showPay" mode="bottom" border-radius="14" :closeable="true">
|
||||
<view
|
||||
style="width: 100%;text-align: center;font-size:38rpx;font-weight: bold;margin-top:15rpx;margin-bottom: 80rpx;">
|
||||
选择支付方式
|
||||
</view>
|
||||
<view @click="goMoney" class="flex align-center justify-end" style="margin-right: 20rpx;color: #ff7581;">
|
||||
<view class="" style="color: #666666;">
|
||||
金豆不足?
|
||||
</view>
|
||||
去充值
|
||||
</view>
|
||||
<view style="display: flex;height: 100upx;align-items: center;padding: 20upx 30rpx;"
|
||||
v-for="(item,index) in openLists" :key='index' @tap='selectWay(item.id)'>
|
||||
<view style="display: flex;width:80%;align-items: center;">
|
||||
<image :src="item.image" style="width: 55upx;height: 55upx;"></image>
|
||||
<view style="font-size: 30upx;margin-left: 20upx;width: 70%;">{{item.text}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 20%;display: flex;justify-content: flex-end;">
|
||||
<radio-group name="openWay" style="margin-left: 20upx;">
|
||||
<label class="tui-radio">
|
||||
<radio color="#ff7581" :checked="openWay === item.id ? true : false" />
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
style="width: 690rpx;height: 80rpx;background:#ff7581;color:#FFFFFF;text-align: center;line-height: 80rpx;border-radius: 50rpx;margin: 30rpx;"
|
||||
@tap="pay()">确认支付</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 会员助力 -->
|
||||
<u-popup v-model="showjl" :closeable="true" close-icon-color="#ffffff" mode="center">
|
||||
<view class="zl" @click="goZl()">
|
||||
<image class="zl-bg"
|
||||
src="https://duanju.xianmxkj.com/file/uploadPath/2023/12/14/adf37beca97826d44970d20118f88e29.png"
|
||||
mode=""></image>
|
||||
<view class="zl-title">
|
||||
会员免费领
|
||||
</view>
|
||||
<view class="zl-titlef">
|
||||
免费领会员
|
||||
</view>
|
||||
<view class="zl-titlef2">
|
||||
助力中...
|
||||
</view>
|
||||
<view class="zl-titlebtn">
|
||||
立即领取
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
<!-- 抖音im客服 -->
|
||||
<ttMsg />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ttMsg from '../../../components/ttMsg/ttMsg.vue'
|
||||
export default {
|
||||
components: {
|
||||
ttMsg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userName: '匿名',
|
||||
VIPlist: '',
|
||||
showPay: false,
|
||||
openWay: 0,
|
||||
openLists: [],
|
||||
vipId: '',
|
||||
vipData: '',
|
||||
isVIP: false,
|
||||
showjl: false,
|
||||
checked: false,
|
||||
osName: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-KUAISHOU
|
||||
this.osName = uni.getSystemInfoSync().osName;
|
||||
// #endif
|
||||
|
||||
// #ifdef APP
|
||||
if (plus.os.name.toLowerCase() === 'android') {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 1
|
||||
}, {
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 2
|
||||
}, {
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}]
|
||||
this.openWay = 1;
|
||||
} else {
|
||||
let checkIosPay = this.$queue.getData('checkIosPay');
|
||||
if (checkIosPay === '是') {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}];
|
||||
this.openWay = 3;
|
||||
} else {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 1
|
||||
}, {
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 2
|
||||
}, {
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}];
|
||||
this.openWay = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.openLists = [
|
||||
// {
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 1
|
||||
// },
|
||||
{
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}
|
||||
],
|
||||
this.openWay = 3;
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 1
|
||||
}, {
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}],
|
||||
this.openWay = 1;
|
||||
} else {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 2
|
||||
}, {
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}],
|
||||
this.openWay = 2;
|
||||
}
|
||||
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '抖音支付',
|
||||
id: 4
|
||||
}, {
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}]
|
||||
this.openWay = 4;
|
||||
// #endif
|
||||
// #ifdef MP-KUAISHOU
|
||||
if (this.osName != 'ios') { //安卓
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '快手支付',
|
||||
id: 5
|
||||
}, {
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}]
|
||||
this.openWay = 5
|
||||
} else {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/lingqian.png',
|
||||
text: '金豆支付',
|
||||
id: 3
|
||||
}]
|
||||
this.openWay = 3
|
||||
}
|
||||
// #endif
|
||||
if (uni.getStorageSync('token')) {
|
||||
this.$Request.get('/app/common/type/813').then(res => {
|
||||
if (res.code == 0 && res.data.value) {
|
||||
if (res.data.value == '是') {
|
||||
this.getActivity()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.userName = uni.getStorageSync('userName')
|
||||
this.getVIPDet()
|
||||
this.getvipdata()
|
||||
},
|
||||
methods: {
|
||||
//去付费须知说明
|
||||
goXieyi() {
|
||||
uni.navigateTo({
|
||||
url: '/me/setting/payXieYi'
|
||||
})
|
||||
},
|
||||
goMoney() {
|
||||
uni.navigateTo({
|
||||
url: '/me/wallet/wallet'
|
||||
})
|
||||
},
|
||||
// 获取活动等级
|
||||
getActivity() {
|
||||
this.$Request.getT('/app/invite/selectInviteAwardByUserId').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.showjl = true
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//去助力页面
|
||||
goZl() {
|
||||
uni.navigateTo({
|
||||
url: '/me/assistance/assistance'
|
||||
})
|
||||
this.showjl = false
|
||||
},
|
||||
getvipdata() {
|
||||
let data = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
this.$u.api.userVip(data).then(res => {
|
||||
if (res.code == 0 && res.data && res.data.isVip == 2) {
|
||||
this.isVIP = true;
|
||||
this.vipData = res.data.endTime
|
||||
} else {
|
||||
this.isVIP = false
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
selectWay: function(id) {
|
||||
this.openWay = id;
|
||||
},
|
||||
getVIPDet() {
|
||||
this.$u.api.vipDet().then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.forEach(ret => {
|
||||
switch (ret.vipNameType) {
|
||||
case 0:
|
||||
ret.type = '月'
|
||||
break;
|
||||
case 1:
|
||||
ret.type = '季'
|
||||
break;
|
||||
case 2:
|
||||
ret.type = '年'
|
||||
break;
|
||||
}
|
||||
})
|
||||
this.VIPlist = res.data
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
bugVIP(e) {
|
||||
if (this.checked == false) {
|
||||
this.$refs.uToast.show({
|
||||
title: '请阅读并同意《付费须知说明》',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
this.vipId = e
|
||||
this.showPay = true
|
||||
// // #ifdef MP-TOUTIAO
|
||||
// this.toutiaoPay()
|
||||
// // #endif
|
||||
// // #ifndef MP-TOUTIAO
|
||||
// this.showPay = true
|
||||
// // #endif
|
||||
|
||||
},
|
||||
//头条支付
|
||||
toutiaoPay() {
|
||||
let that = this
|
||||
let data = {
|
||||
vipDetailsId: this.vipId
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
})
|
||||
this.$Request.getT('/app/order/insertVipOrders', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
let dats = {
|
||||
orderId: res.data.ordersId
|
||||
}
|
||||
if (this.osName == 'ios') {
|
||||
dats.ios = 1
|
||||
}
|
||||
this.$Request.postT('/app/dyPay/payVirtualAppOrder', dats).then(ret => {
|
||||
if (ret.code == 0) {
|
||||
// console.log(JSON.parse(ret.data))
|
||||
let options = {
|
||||
data: JSON.stringify(ret.data.data),
|
||||
byteAuthorization: JSON.stringify(ret.data.byteAuthorization)
|
||||
}
|
||||
tt.requestOrder({
|
||||
data: JSON.stringify(ret.data.data), // 请勿在前端对data做任何处理
|
||||
byteAuthorization: ret.data
|
||||
.byteAuthorization, // 请勿在前端对byteAuthorization做任何处理
|
||||
success(redd) {
|
||||
console.log(JSON.stringify(redd))
|
||||
tt.getOrderPayment({
|
||||
orderId: redd.orderId,
|
||||
success(reee) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
})
|
||||
setTimeout(d => {
|
||||
let data = {
|
||||
userId: uni
|
||||
.getStorageSync(
|
||||
'userId')
|
||||
}
|
||||
that.$u.api.userVip(data).then(
|
||||
res => {
|
||||
if (res.code ==
|
||||
0 && res
|
||||
.data && res
|
||||
.data
|
||||
.isVip ==
|
||||
2) {
|
||||
uni.setStorageSync(
|
||||
'isVIP',
|
||||
true)
|
||||
} else {
|
||||
uni.setStorageSync(
|
||||
'isVIP',
|
||||
false)
|
||||
}
|
||||
})
|
||||
setTimeout(d => {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back',
|
||||
data)
|
||||
uni.navigateBack(1)
|
||||
}, 1000);
|
||||
}, 2000)
|
||||
},
|
||||
fail(ee) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '支付失败,请重试',
|
||||
icon: 'none'
|
||||
})
|
||||
console.log(ee)
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
fail(e) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '支付失败,请重试',
|
||||
icon: 'none'
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
pay() {
|
||||
let that = this
|
||||
if (that.openWay == 4) { //抖音支付
|
||||
that.toutiaoPay()
|
||||
} else if (that.openWay == 5) { //快手支付
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
})
|
||||
let data = {
|
||||
vipDetailsId: that.vipId
|
||||
}
|
||||
this.$Request.getT('/app/order/insertVipOrders', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$Request.postT('/app/ksPay/payAppOrder', {
|
||||
orderId: res.data.ordersId
|
||||
}).then(ree => {
|
||||
if (ree.code == 0) {
|
||||
ks.pay({
|
||||
serviceId: '1', //服务类型id(固定值为‘1’)
|
||||
orderInfo: ree.data,
|
||||
success(succ) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '支付成功'
|
||||
})
|
||||
let data = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
that.$u.api.userVip(data).then(res => {
|
||||
if (res.code == 0 && res.data && res.data
|
||||
.isVip ==
|
||||
2) {
|
||||
uni.setStorageSync('isVIP', true)
|
||||
} else {
|
||||
uni.setStorageSync('isVIP', false)
|
||||
}
|
||||
})
|
||||
setTimeout(d => {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack(1)
|
||||
}, 1000);
|
||||
},
|
||||
fail(err) {
|
||||
uni.hideLoading()
|
||||
that.$refs.uToast.show({
|
||||
title: '支付失败,请重试!',
|
||||
duration: 1500
|
||||
})
|
||||
},
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
this.$refs.uToast.show({
|
||||
title: ree.msg,
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
this.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
let data = {
|
||||
vipDetailsId: that.vipId
|
||||
}
|
||||
let userId = uni.getStorageSync('userId')
|
||||
that.$u.api.VipOrders(data).then(res => {
|
||||
if (that.openWay == 1) {
|
||||
// #ifdef MP-WEIXIN
|
||||
that.$u.post('app/wxPay/wxPayJsApiOrder?orderId=' + res.data.ordersId).then(ret => {
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: ret.data.timestamp,
|
||||
nonceStr: ret.data.noncestr,
|
||||
package: ret.data.package,
|
||||
signType: ret.data.signType,
|
||||
paySign: ret.data.sign,
|
||||
success: function(suc) {
|
||||
console.log('success:' + JSON.stringify(suc));
|
||||
that.showPay = false
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
let data = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
that.$u.api.userVip(data).then(res => {
|
||||
if (res.code == 0 && res.data && res.data
|
||||
.isVip ==
|
||||
2) {
|
||||
uni.setStorageSync('isVIP', true)
|
||||
} else {
|
||||
uni.setStorageSync('isVIP', false)
|
||||
}
|
||||
})
|
||||
setTimeout(d => {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack(1)
|
||||
}, 1000);
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.$u.post('/app/wxPay/wxPayMpOrder?orderId=' + res.data.ordersId).then(red => {
|
||||
if (red.code === 0) {
|
||||
this.callPay(red.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败!'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
this.$u.post("/app/wxPay/payAppOrder?orderId=" + res.data.ordersId).then(red => {
|
||||
if (red.code == 0) {
|
||||
that.setPayment('wxpay', JSON.stringify(red
|
||||
.data));
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: red.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
} else if (that.openWay == 2) {
|
||||
// #ifdef H5
|
||||
this.$u.post('/app/aliPay/payOrder?orderId=' + res.data.ordersId + '&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({
|
||||
icon: 'none',
|
||||
title: '支付失败!'
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
this.$u.post('/app/aliPay/payOrder?orderId=' + res.data.ordersId + '&classify=1').then(
|
||||
red => {
|
||||
if (red.code === 0) {
|
||||
console.log('1111111')
|
||||
that.setPayment('alipay', red.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败!'
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
} else if (that.openWay == 3) {
|
||||
that.$queue.showLoading('支付中...')
|
||||
that.$Request.postT("/app/order/payOrders", {
|
||||
orderId: res.data.ordersId,
|
||||
}).then(red => {
|
||||
uni.hideLoading();
|
||||
if (red.code == 0) {
|
||||
that.showPay = false
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
let data = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
that.$u.api.userVip(data).then(res => {
|
||||
if (res.code == 0 && res.data && res.data
|
||||
.isVip ==
|
||||
2) {
|
||||
uni.setStorageSync('isVIP', true)
|
||||
} else {
|
||||
uni.setStorageSync('isVIP', false)
|
||||
}
|
||||
})
|
||||
setTimeout(d => {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack(1)
|
||||
}, 1000);
|
||||
} else {
|
||||
that.$queue.showToast(red.msg)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
isCheckPay(code, name, order) {
|
||||
if (code == 0) {
|
||||
console.log('999999999999')
|
||||
this.setPayment(name, order);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '支付信息有误'
|
||||
});
|
||||
}
|
||||
},
|
||||
setPayment(name, order) {
|
||||
let that = this
|
||||
uni.requestPayment({
|
||||
provider: name,
|
||||
orderInfo: order, //微信、支付宝订单数据
|
||||
success: function(res) {
|
||||
uni.hideLoading();
|
||||
that.showPay = false
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
let data = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
that.$u.api.userVip(data).then(res => {
|
||||
if (res.code == 0 && res.data && res.data
|
||||
.isVip ==
|
||||
2) {
|
||||
uni.setStorageSync('isVIP', true)
|
||||
} else {
|
||||
uni.setStorageSync('isVIP', false)
|
||||
}
|
||||
})
|
||||
setTimeout(d => {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack(1)
|
||||
}, 1000);
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading();
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
},
|
||||
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;
|
||||
}
|
||||
console.log("response)))):" + JSON.stringify(response))
|
||||
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,但并不保证它绝对可靠。
|
||||
that.showPay = false
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
let data = {
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
that.$u.api.userVip(data).then(res => {
|
||||
if (res.code == 0 && res.data && res.data
|
||||
.isVip ==
|
||||
2) {
|
||||
uni.setStorageSync('isVIP', true)
|
||||
} else {
|
||||
uni.setStorageSync('isVIP', false)
|
||||
}
|
||||
})
|
||||
setTimeout(d => {
|
||||
let data = {
|
||||
flag: true
|
||||
}
|
||||
uni.$emit('back', data)
|
||||
uni.navigateBack(1)
|
||||
}, 1000);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
}
|
||||
WeixinJSBridge.log(response.err_msg);
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.custom-style {
|
||||
/* background: linear-gradient(90deg, #DBC084 0%, #E9D4A6 100%); */
|
||||
/* padding: 0px 16px; */
|
||||
/* border: 0px; */
|
||||
color: #604320;
|
||||
}
|
||||
|
||||
.illustrate {
|
||||
width: 100%;
|
||||
margin: 30rpx 0;
|
||||
|
||||
.illustrate-box {
|
||||
width: 686rpx;
|
||||
}
|
||||
|
||||
.illustrate-box-txt {
|
||||
color: #ff7581;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/deep/.u-radio__label {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* #ifdef MP-TOUTIAO */
|
||||
/deep/radio::before {
|
||||
content: '' !important;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
|
||||
/deep/.u-mode-center-box {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.zl {
|
||||
width: 518rpx;
|
||||
height: 556rpx;
|
||||
position: relative;
|
||||
background: transparent;
|
||||
|
||||
.zl-bg {
|
||||
width: 518rpx;
|
||||
height: 556rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.zl-title {
|
||||
position: absolute;
|
||||
top: 15%;
|
||||
left: 46%;
|
||||
transform: translate(-50%, 100%);
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
color: #F24364;
|
||||
background: linear-gradient(0deg, #FF5878 0.390625%, #F30931 100%);
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.zl-titlef {
|
||||
font-size: 14rpx;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
position: absolute;
|
||||
top: 41%;
|
||||
right: 35%;
|
||||
}
|
||||
|
||||
.zl-titlef2 {
|
||||
font-size: 14rpx;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
position: absolute;
|
||||
top: 48%;
|
||||
left: 22%;
|
||||
}
|
||||
|
||||
.zl-titlebtn {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
background: linear-gradient(0deg, #FF5878 0.390625%, #F30931 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
position: absolute;
|
||||
bottom: 10%;
|
||||
left: 50%;
|
||||
transform: translate(-65%, 50%);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-bg {
|
||||
width: 64px;
|
||||
height: 28px;
|
||||
background: linear-gradient(90deg, #DBC084 0%, #E9D4A6 100%);
|
||||
color: #604320;
|
||||
border-radius: 28px;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user