Commit 8543445a authored by mengcuiguang's avatar mengcuiguang

修改个人中心页面

parent 6ef75384
<template>
<view class="body">
<!-- <scroll-view :scroll-y="true"> -->
<z-paging style="height: 100%;">
<z-paging style="height: 100%;background-color: #f0f8ff;">
<view style="width: 100%;height: 340rpx;
background-repeat: no-repeat;
background-size: 100%;
background-origin: border-box;
background-image: url(https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_my_top.png);">
<view
:style="'display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;margin-top:'+10+'px;'">
style="display: flex;flex-direction: row;align-items: center;margin:20rpx;padding-left: 10rpx;padding-top: 34rpx;">
<image class="avatar" src="@/static/logo-about.png"></image>
<view>
<view style="font-size: 32rpx;color: black;margin-left: 20rpx;">用户ID:{{userBean.idcode}}</view>
<view style="font-size: 32rpx;color: white;margin-left: 20rpx;">用户ID:{{userBean.idcode}}</view>
</view>
<!-- <button text="微信用户一键登录" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">123123</button> -->
</view>
<view v-if="userBean.showVipInner && os === 'android' "
style="display: flex;flex-direction: row;background: #f5ca86;margin: 20rpx;padding: 40rpx;border-radius:20rpx;align-items: center;justify-content:space-between;">
<view style="display: flex;flex-direction: column;justify-content: center;">
<view style="font-size: 36rpx;color: #5b1500;font-weight: 777;">
<view style="display: flex;width: 95%;height: 150rpx;background: linear-gradient(to right, #fdeedd, #f6c194);margin-left: 20rpx;margin-right: 20rpx;margin-top: 59rpx;
border-top-left-radius: 20px;
border-top-right-radius: 20px;">
<view style="flex-grow: 2; margin-left: 20rpx;">
<view
style="width: 100%;height: 100%;display: flex;flex-direction: column;justify-content: center;">
<view style="display: flex;align-items: center;">
<image
style="width: 50rpx;height: 50rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="https://mints-web.oss-cn-beijing.aliyuncs.com/images/ic_my_vip.png"></image>
<view style="font-size: 36rpx;font-weight: 777;color: #5b1500;">
{{userBean.expireTime<=0 ? '开通VIP会员' : 'VIP会员'}}
</view>
</view>
<view v-if="userBean.expireTime<=0" style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;">
解锁全部短剧
<view v-if="userBean.expireTime<=0"
style="font-size: 28rpx;color: #5b1500;margin-top: 20rpx;">解锁全部功能</view>
<view v-else style="font-size: 28rpx;color: #5b1500;margin-top: 20rpx;">
到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}</view>
</view>
<view v-else style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;">
到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}
</view>
<view v-if="userBean.expireTime<=0" @click="handleCoinPay"
style="width: 210rpx;height: 60rpx;background-color: #5b1500;border-radius:30rpx;color: white;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;margin-top: 30rpx;">
立即开通
<view style="width: 220rpx;">
<view v-if="userBean.expireTime<=0"
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<view @click="handleCoinPay"
style="width: 180rpx;height: 60rpx;background: linear-gradient(to right, #bc875e, #45250c);border-radius:30rpx;color: #fff;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;">
去开通
</view>
<view v-else style="width: 210rpx;height: 60rpx;padding-bottom: 4rpx;margin-top: 30rpx;">
</view>
</view>
<image style="border-radius:10rpx; width: 130rpx;height: 100rpx;margin-right: 20rpx;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/bg_my_vip.png" mode="scaleToFill"></image>
</view>
<view v-if="os === 'android' "
style="display: flex;height: 200rpx;margin: 20rpx;background: #f5ca86;border-radius: 20rpx;">
</view>
<view style="display: flex;height: 120rpx;margin: 20rpx;background: #fff;border-radius: 20rpx;">
<view style="flex-grow: 2; margin-left: 20rpx;">
<view
style="width: 100%;height: 100%;display: flex;flex-direction: column;justify-content: center;">
<view style="display: flex;align-items: center;">
<image
style="width: 50rpx;height: 50rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_my_coin.png"></image>
<view style="font-size: 36rpx;font-weight: 777;">看点充值</view>
</view>
<view style="font-size: 28rpx;color: #5b1500;margin-top: 20rpx;">海量看点狂洒中,好剧等你来解锁</view>
<view style="font-size: 28rpx;color: #5b1500;">账户余额: 0看点</view>
</view>
</view>
<view style="width: 220rpx;">
<view style="width: 200rpx;">
<view
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<view style="font-size: 30rpx;color: #5b1500;margin-bottom: 20rpx;">{{userBean.point}}</view>
<view @click="handleCoinPay"
style="width: 160rpx;height: 60rpx;background-color: #5b1500;border-radius:30rpx;color: white;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;">
style="width: 160rpx;height: 60rpx;background: linear-gradient(to right, #bc875e, #45250c);border-radius:30rpx;color: #fff;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;">
去充值
</view>
</view>
......@@ -66,16 +66,34 @@
<view class="inviteClass">
<view @click="handleTask" class="inviteItemclass" style="margin-right: 10rpx">
<image style="width: 50rpx;height: 50rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="https://mints-web.oss-cn-beijing.aliyuncs.com/images/ic_my_task.png"></image>
<view style="font-size: 26rpx;color: black;">领免费看点</view>
</view>
<view @click="handleInvite" class="inviteItemclass" style="margin-left: 10rpx">
<image style="width: 50rpx;height: 50rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="https://mints-web.oss-cn-beijing.aliyuncs.com/images/ic_my_invite.png"></image>
<view style="font-size: 26rpx;color: black;">邀请好友得看点</view>
</view>
</view>
<view class="infobg" style="margin: 20rpx;">
<view v-if="userBean.showVipInner && os === 'android' " class="item arrow" @click="handlePayRecord">
<view v-if="userBean.showVipInner" class="item arrow" @click="handlePayRecord">
我的订单
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
<view v-if="os === 'android' " class="item arrow" @click="handleDotRecord">
<view class="item arrow" @click="handleDotRecord">
优惠券
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
<view class="item arrow" @click="handleUseDotRecord">
看点记录
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
<view v-if="os === 'android' " class="item arrow" @click="handleUseDotRecord">
<view class="item arrow" @click="handleUseDotRecord">
消费记录
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
......@@ -88,17 +106,8 @@
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
</view>
<view style="display: flex;justify-content: center;margin-top: 20rpx;font-size: 26rpx;color: gray;">
{{ versionName }}
</view>
</z-paging>
<!-- </scroll-view> -->
<coin-popup :show="showAnimate" @close="showAnimate = false" @paySuccess="paySuccess">
</coin-popup>
</view>
</template>
<script>
import common from '@/mixins/common';
......@@ -124,6 +133,14 @@
mixins: [common],
data() {
return {
imgTop: "",
hasMobile: false,
hideMobile: "",
isVip: false,
vipTime: "",
imgVip: "",
imgTask: "",
imgInvite: "",
statusBarHeight: app.globalData.statusBarHeight,
userBean: {},
showAnimate: false,
......@@ -169,48 +186,10 @@
handlePayRecord() {
navigateTo(`/pagesD/payRecord/payRecord`)
},
handleVipPay() {
handleCoinPay() {
navigateTo(`/pagesA/vipPay/vipPay`)
},
handlePhone() {
// if (this.corpid != '' && this.curl != '') {
// wx.openCustomerServiceChat({
// extInfo: {
// url: this.curl
// },
// corpId: this.corpid,
// success(res) {},
// fail(e) {
// console.log(e)
// }
// })
// } else {
// let that = this
// // 联系我们
// this.post({
// url: '/vedio/customerServiceNumbers',
// showLoading: false,
// success: ({
// data
// }) => {
// let datas = data.customerServiceNumbers.split(',')
// that.corpid = datas[0]
// that.curl = datas[1]
// wx.openCustomerServiceChat({
// extInfo: {
// url: that.curl
// },
// corpId: that.corpid,
// success(res) {},
// fail(e) {
// console.log(e)
// }
// })
// }
// });
// }
wx.makePhoneCall({
phoneNumber: '4000969950',
success: function(res) {
......@@ -224,7 +203,7 @@
paySuccess(largeType) {
// largeType=vip 开通vip
// largeType=point 购买看点
if(wx.getSystemInfoSync().platform=='ios'){
if (wx.getSystemInfoSync().platform == 'ios') {
message.notify('支付成功');
}
......@@ -251,7 +230,81 @@
@import '@/scss/uni.scss';
.body {
background-color: whitesmoke;
background-color: #f0f8ff;
}
.user-wrapper {
margin: 10rpx 25rpx;
height: 110rpx;
display: flex;
flex-direction: row;
.user-avatar {
width: 110rpx;
height: 110rpx;
border-radius: 60rpx;
margin-right: 30rpx;
}
.user-info {
height: 110rpx;
display: flex;
flex-direction: column;
}
}
.item-wrapper {
margin: 0 25rpx;
flex-direction: row;
height: 100rpx;
/* width: 100%; */
border-bottom: 1rpx solid #eeeeee;
.img {
align-self: center;
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
.text1 {
flex: 1;
}
.text2 {
font-size: 30rpx;
}
}
.loginWrapper {
margin-top: 10rpx;
}
.orderstyle {
flex-direction: column;
background-color: #ffffff;
margin: 20rpx;
border-radius: 15rpx;
}
.inviteClass {
display: flex;
flex-direction: row;
background-color: transparent;
margin-left: 20rpx;
margin-right: 20rpx;
height: 100rpx;
justify-content: space-between;
}
.inviteItemclass {
display: flex;
align-items: center;
justify-content: center;
width: 50%;
border-radius: 15rpx;
height: 100rpx;
background-color: #ffffff;
}
.avatar {
......@@ -262,4 +315,68 @@
overflow: hidden;
//box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
}
.vip-item {
width: 100%;
padding: 10rpx 40rpx;
.content {
width: 90%;
margin: auto;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 20rpx 40rpx;
background: #263358;
color: #fff;
border-radius: 18rpx;
}
.item {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
margin-right: 20rpx;
}
.item:last-child {
margin-right: 0;
}
.row {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 15rpx;
}
.row:last-child {
margin-bottom: 0;
}
.title {
font-size: 38rpx;
font-weight: 700;
font-style: italic;
}
.desc {
font-size: 26rpx;
color: #b5b5b5;
}
.button {
height: 40rpx;
line-height: 70rpx;
border-radius: 35rpx;
width: 160rpx;
background: #fff;
color: #263358;
text-align: center;
font-size: 30rpx;
font-weight: 700;
font-style: italic;
}
}
</style>
\ No newline at end of file
......@@ -5,6 +5,7 @@
"packages": {
"": {
"dependencies": {
"decimal.js": "^10.4.3",
"json-bignumber": "^1.1.1",
"uview": "^0.1.0"
}
......@@ -29,6 +30,11 @@
"deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.",
"hasInstallScript": true
},
"node_modules/decimal.js": {
"version": "10.4.3",
"resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz",
"integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
},
"node_modules/deepmerge": {
"version": "1.5.2",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.5.2.tgz",
......@@ -86,6 +92,11 @@
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
},
"decimal.js": {
"version": "10.4.3",
"resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz",
"integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
},
"deepmerge": {
"version": "1.5.2",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.5.2.tgz",
......
......@@ -31,6 +31,7 @@
}
},
"dependencies": {
"decimal.js": "^10.4.3",
"json-bignumber": "^1.1.1",
"uview": "^0.1.0"
}
......
......@@ -77,7 +77,7 @@
"path": "vipPay/vipPay",
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#2196f3",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}]
......
......@@ -2,10 +2,10 @@
<view class="body">
<image style="width: 170rpx;height: 170rpx;margin-top: 30%;" src="@/static/logo-about.png" mode="widthFix" />
<view style="color: black;margin-top: 30rpx;font-size: 40rpx;font-size: 50rpx;">{{appName}}</view>
<view style="color: #A231EF;margin-top: 10rpx;font-size: 40rpx;font-size: 40rpx;">欢迎使用</view>
<view style="color: #FECF02;margin-top: 10rpx;font-size: 40rpx;font-size: 40rpx;">欢迎使用</view>
<view style="bottom: 0;position: absolute;">
<image style="width: 540rpx;height: 644rpx;display: flex;align-items: center;margin-bottom: 30%;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_splash.png" mode="scaleToFill">
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/book_bg_splash.png" mode="scaleToFill">
</image>
</view>
......@@ -35,83 +35,29 @@
return {
tips1: '',
slotParam: '',
appName: ''
appName: '幻墨小说阁'
}
},
onLoad(options) {
this.tips1 = options.tips1
// #ifdef MP-TOUTIAO
this.appName = '寻觅短剧'
// #endif
// #ifdef MP-WEIXIN
this.appName = '河狸刷剧'
// #endif
},
onShow(options) {
// #ifdef MP-TOUTIAO
this.ttLoging()
// #endif
// #ifdef MP-WEIXIN
// this.wxlogin()
// #endif
},
methods: {
ttLoging() {
var that = this;
var obj = tt.getLaunchOptionsSync()
var channel = 'douyin' // 渠道
var tips2 = ''; // 投放测试标记
var product_type = ''; //自有产品
var zs_channel = ''; // 自有渠道
var vedio_id = ''; // 自有剧
var zs_os = ''; // 当前系统
var vedio_index = ''; // 自有剧
var free_index = ''; // 自有剧
var tips2 = ''; // 投放测试
var remark1 = ''; // 预留
var remark2 = ''; // 预留
var remark3 = ''; // 预留
var mid1 = "";
var mid2 = "";
var mid3 = "";
var mid4 = "";
var mid5 = "";
var thirdParam = "";
var album_id = obj.query.tt_album_id ?? '';
var episode_id = obj.query.tt_episode_id ?? '';
uni.setStorage({
key: 'tt_album_id',
data: album_id
});
uni.setStorage({
key: 'tt_episode_id',
data: episode_id
});
zs_os = wx.getSystemInfoSync().platform;
tips2 = obj.query.tips2 ?? ''
product_type = obj.query.product_type ?? ''
zs_channel = obj.query.zs_channel ?? ''
vedio_id = obj.query.vedio_id ?? ''
free_index = obj.query.free_index ?? ''
remark1 = obj.query.remark1 ?? ''
remark2 = obj.query.remark2 ?? ''
remark3 = obj.query.remark3 ?? ''
vedio_index = obj.query.vedio_index ?? ''
mid1 = obj.query.mid1 ?? ''
mid2 = obj.query.mid2 ?? ''
mid3 = obj.query.mid3 ?? ''
mid4 = obj.query.mid4 ?? ''
mid5 = obj.query.mid5 ?? ''
// 抖音feed页参数
thirdParam = JSON.stringify(obj.query);
// 打印渠道参数
if (this.tips1 == 'mints_vedio' || tips2 == 'mints_vedio') {
this.slotParam = JSON.stringify(obj.query);
......@@ -121,29 +67,16 @@
tt.login({
force: true,
success(res) {
console.log(`login 调用成功${res.code} ${res.anonymousCode}`);
that.post({
url: '/user/ttLogin',
data: {
channel: channel,
channel: 'douyin',
code: res.code,
anonymousCode: res.anonymousCode,
productType: product_type,
vedioId: vedio_id,
remark1: remark1,
remark2: remark2,
remark3: remark3,
os: zs_os,
vedioIndex: vedio_index,
freeIndex: free_index,
mid1: mid1,
mid2: mid2,
mid3: mid3,
mid4: mid4,
mid5: mid5,
thirdParam: thirdParam,
zsChannel: zs_channel
thirdParam: thirdParam
},
showLoading: false,
success: ({
......@@ -172,7 +105,7 @@
<style lang="scss">
.body {
background-color: white;
background: linear-gradient(to bottom, #F2F1FF, #FBFBFF);
// background: linear-gradient(to bottom, #F2F1FF, #FBFBFF);
display: flex;
flex-direction: column;
align-items: center;
......
<template>
<view class="body">
<status-title :showBack="true" icon-color="white" font-color="white">会员支付</status-title>
<scroll-view scroll-y style="height: 100%;">
<image style="width: 100%;" src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_vip_2.png" mode="widthFix" />
<view style="font-size: 36rpx;color: black;font-weight: 777;">充值看点</view>
<view class="section">
<view class="title">
选择套餐
</view>
<view class="pack-box">
<view class="pack-item" :class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList'
:key='index' @click="choosePack(item, index)">
<view class="name row">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in pointList' :key='index'
@click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row">
{{item.firstPayPrice}}
</view>
<view class="name row" v-if="item.title!=null&&item.title!=''">
{{item.title}}
</view>
<view class="price row">
{{item.firstPayPrice}}
<view class="origin row" v-if="item.remarks!=null&&item.remarks!=''">
{{item.remarks}}
</view>
</view>
<view class="origin row" v-if='item.oldPrice'>
原价:{{item.oldPrice}}
<view class="cut-down" v-if='item.topTitle!=null&&item.topTitle.length>0'>
{{item.topTitle}}
</view>
<view class="cut-down" v-if='item.oldPrice-item.firstPayPrice>0'>
立省 {{item.oldPrice-item.firstPayPrice}}
<view v-if="index==selectedIndex" style="position: absolute;bottom: 0;right: 0;">
<image mode="scaleToFill"
style="width: 100rpx;height: 100rpx;display: flex;align-items: right;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_loading.gif">
</image>
</view>
</view>
</view>
</view>
<view style="font-size: 36rpx;color: black;font-weight: 777;">充值VIP会员</view>
<view class="section">
<button class="apply-button" @click="handlePay">立即开通</button>
<view class="pack-box">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'"
:class="[{active: index==selectedVipIndex}]" v-for='(item, index) in vipList' :key='index'
@click="choosePack2(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row">
{{item.firstPayPrice}}
</view>
<view class="name row" v-if="item.title!=null&&item.title!=''">
{{item.title}}
</view>
<view class="origin row" v-if="item.remarks!=null&&item.remarks!=''">
{{item.remarks}}
</view>
</view>
<view class="cut-down" v-if='item.topTitle!=null&&item.topTitle.length>0'>
{{item.topTitle}}
</view>
<view v-if="index==selectedVipIndex" style="position: absolute;bottom: 0;right: 0;">
<image mode="scaleToFill"
style="width: 100rpx;height: 100rpx;display: flex;align-items: right;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_loading.gif">
</image>
</view>
</view>
</view>
</view>
<image style="width: 100%;" src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_vip_0.png" mode="widthFix" />
<image style="width: 100%;margin-bottom: 80rpx;" src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_vip_1.png" mode="widthFix" />
</scroll-view>
<view style="display: flex;
align-items: center;flex-direction: column;">
<view @click="handleAgree" style="margin-top: 12rpx;margin-right: 10rpx;">付费须知></view>
<view @click="handlePay" class="bottomtext">
<text style="
display: flex;
color: white;
font-size: 26rpx;
justify-content: center;
align-items: center;
">
{{ btnText }}
</text>
</view>
</view>
<uni-popup ref="alertDialog" type="center">
<uni-popup-dialog confirmText="确认" title="付费须知" content="
1、会员属于虚拟商品,一经购买不可退换;
2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;
3、充值会员一般5分钟内到账,如未到账请在“我的”页面联系客服;" @close="dialogClose">
</uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
import common from '@/mixins/common';
import {
message,
navigateBack,
navigateTo,
redirectTo
} from '@/utils/fun';
import {
Decimal
} from 'decimal.js'
const app = getApp();
......@@ -57,76 +123,245 @@
data() {
return {
vipList: [],
pointList: [],
selectedIndex: 0,
selectedVipIndex: -1,
btnText: '',
userBean: {},
os: 'android'
}
},
methods: {
loadData() {
let that = this;
if (tt.getSystemInfoSync().platform === 'ios') {
this.os = 'ios';
}
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.userBean = data;
}
});
this.post({
url: '/vip/getVipProducts',
showLoading: false,
success: ({
data
}) => {
this.vipList = data.list
if (data.list != null && data.list.length > 0) {
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].largeType == 'point') {
that.pointList.push(data.list[i]);
} else {
that.vipList.push(data.list[i]);
}
}
}
if (that.pointList != null && that.pointList.length > 0) {
for (let i = 0; i < that.pointList.length; i++) {
if (that.pointList[i].activityType == 1) {
that.selectedIndex = i;
let cashStr = that.pointList[i].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.pointList[i].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[i]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.pointList[i].yhqRateBalance + "元,已优惠" +
tempYhq + "元"
}
if (that.pointList[i].weixin) {
that.wxShowFlag = true
that.isZfb = false
} else {
that.wxShowFlag = false
that.isZfb = true
}
break;
}
}
}
if (that.pointList != null && that.pointList.length > 0 && that.selectedIndex == 0) {
let cashStr = that.pointList[0].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.pointList[0].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[0]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.pointList[0].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
}
if (that.pointList[0].weixin) {
that.wxShowFlag = true
that.isZfb = false
} else {
that.wxShowFlag = false
that.isZfb = true
}
}
}
});
},
dialogClose() {
this.$refs.alertDialog.close();
},
choosePack(item, index) {
let that = this
this.selectedIndex = index;
this.selectedVipIndex = -1;
// this.handlePay();
if (this.selectedIndex == -1) {
// vip充值
let cashStr = this.vipList[this.selectedVipIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.vipList[this.selectedVipIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.vipList[this.selectedVipIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.vipList[this.selectedVipIndex].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
}
} else {
let cashStr = this.pointList[this.selectedIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.pointList[this.selectedIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[this.selectedIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.pointList[this.selectedIndex].yhqRateBalance + "元,已优惠" + tempYhq + "元"
}
}
},
choosePack2(item, index) {
let that = this
this.selectedVipIndex = index;
this.selectedIndex = -1;
// this.handlePay();
if (this.selectedIndex == -1) {
// vip充值
let cashStr = this.vipList[this.selectedVipIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.vipList[this.selectedVipIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.vipList[this.selectedVipIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.vipList[this.selectedVipIndex].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
}
} else {
let cashStr = this.pointList[this.selectedIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.pointList[this.selectedIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[this.selectedIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.pointList[this.selectedIndex].yhqRateBalance + "元,已优惠" + tempYhq + "元"
}
}
},
handleAgree() {
this.$refs.alertDialog.open();
},
handlePay() {
let that=this;
let that = this;
let vipBean = this.vipList[this.selectedIndex];
if (this.selectedIndex == -1) {
// vip充值
vipBean = this.vipList[this.selectedVipIndex];
}
this.post({
url: '/vip/getVipPayParams',
url: '/vip/getVipPayParams/douyin',
data: {
pid: vipBean.pid,
payChannel: 'WEIXIN'
vedioId: that.point <= 0 ? null : that.vedioId,
os: that.os,
pid: vipBean.pid
},
showLoading: false,
showLoading: true,
success: ({
data
}) => {
that.wxPay(data);
that.ttPrePay(data, vipBean.largeType);
}
});
},
wxPay(wxData){
let wxParams = wxData.params;
let that=this;
// 发起微信支付
wx.requestPayment({
timeStamp: wxParams.timeStamp,
nonceStr: wxParams.nonceStr,
package: wxParams.packageStr,
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
message.notify('支付成功')
ttPrePay(ttData, largeType) {
if (!tt.canIUse('requestOrder')) {
message.notify('请升级抖音APP版本!');
return
}
// that.post({
// url: '/vip/queryVipOrder',
// data: {
// tid: wxData.tid
// },
// showLoading: false,
// success: ({
// data
// }) => {
let that = this;
tt.requestOrder({
data: ttData.params.data,
byteAuthorization: ttData.params.byteAuthorization,
success(res) {
that.ttPay(largeType, res.orderId, ttData);
},
fail(res) {
message.notify(res.errMsg);
console.log('requestOrder res.errMsg', res)
},
});
},
ttPay(largeType, oid, ttData) {
if (!tt.canIUse('getOrderPayment')) {
message.notify('请升级抖音APP版本~');
return
}
// }
// });
let that = this;
if (this.os == 'ios') {
if (!tt.canIUse('getOrderPayment.object.imId')) {
message.notify('请升级抖音APP版本.');
return
}
setTimeout(() => {
navigateTo(`/pages/home`)
}, 1000);
tt.getOrderPayment({
orderId: oid,
imId: ttData.imId,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
message.notify('取消支付')
console.log('ios=ttPay res.errMsg', res)
// message.notify(res.errMsg);
},
});
} else {
tt.getOrderPayment({
orderId: oid,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('android=ttPay res.errMsg', res)
// message.notify(res.errMsg);
},
});
}
})
},
queryOrderStatus(largeType, tid) {
let that = this;
this.post({
data: {
tid: tid
},
url: '/vip/queryVipOrder',
showLoading: true,
success: ({
data
}) => {
if (that.selectedIndex == -1) {
// vip充值
that.paySuccess(that.vipList[that.selectedVipIndex].largeType)
} else {
that.paySuccess(that.pointList[that.selectedIndex].largeType)
}
}
});
}
}
}
......@@ -134,26 +369,20 @@
<style lang="scss">
.body {
background-color: black;
background-color: white;
display: flex;
flex-direction: column;
}
.section {
padding: 0 30rpx;
display: flex;
flex-direction: column;
background: black;
.title {
font-size: 32rpx;
font-weight: 700;
color: white;
margin-bottom: 30rpx;
background: white;
}
.pack-box {
margin-top: 25rpx;
margin-left: 40rpx;
margin-left: 18rpx;
display: flex;
flex-direction: row;
align-items: center;
......@@ -165,13 +394,13 @@
.pack-item {
margin-bottom: 25rpx;
margin-right: 40rpx;
width: calc(31% - 40rpx);
height: 200rpx;
margin-right: 22rpx;
width: calc(45%);
height: 190rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
background: #f5f5f5;
// background: #f5f5f5;
border: 6rpx solid #f5f5f5;
border-radius: 10rpx;
position: relative;
......@@ -186,46 +415,58 @@
}
.name {
font-size: 26rpx;
font-weight: 700;
font-size: 29rpx;
color: #333;
}
.price {
font-size: 30rpx;
font-size: 40rpx;
color: #fd5350;
font-weight: 700;
}
.origin {
color: #5A3C0F;
// background: #5a1505;
background-image: linear-gradient(90deg, #F3DEBE, #EAC180);
font-size: 22rpx;
color: #333;
text-decoration: line-through;
border-radius: 20rpx;
height: 30rpx;
line-height: 30rpx;
padding-top: 4rpx;
padding-bottom: 3rpx;
padding-left: 16rpx;
padding-right: 16rpx;
}
.cut-down {
position: absolute;
top: 0;
right: 0;
color: #fff;
background: #ff502f;
font-size: 22rpx;
border-radius: 15rpx;
height: 30rpx;
line-height: 30rpx;
padding: 0 10rpx;
padding-top: 6rpx;
padding-bottom: 3rpx;
padding-left: 16rpx;
padding-right: 16rpx;
transform: translate(0, -50%);
}
}
}
.apply-button {
.bottomtext {
display: flex;
align-items: center;
justify-content: center;
width: 90%;
height: 90rpx;
background-color: #fdbd3d;
border-radius: 50rpx;
background: #e8c8ae;
color: #8d5a29;
width: 500rpx;
margin: 30rpx auto;
}
}
color: white;
font-size: 26rpx;
margin-bottom: 40rpx;
}
</style>
\ No newline at end of file
<template>
<view class="body">
<!-- <status-title :showBack="true">看点记录</status-title> -->
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList">
<view v-for="(item, i) in dataList" :key="i">
<view class="flex m-20 pd-20" style="background-color:white;border-radius:10rpx;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment