Commit a8d16bc4 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 5639ee46
......@@ -86,8 +86,7 @@
bottomSafePadding: 12,
h5Url: 'https://api.mints-id.com/index.html',
baseUrl: 'https://dx.mints-tech.cn/minip-api/miniApi',
// baseUrl: 'http://test.mints-id.com/camera-api/miniApi',
// baseUrl: 'http://192.168.110.71:8301/miniApi',
// baseUrl: 'http://192.168.110.71:8301/minip-api/miniApi',
titleButtonWidth: 38,
token: '',
userId: 0,
......
......@@ -45,6 +45,12 @@
watchCollectionChange(() => {
this.refreshList();
}, this);
},
show(){
},
hide(){
},
onShow() {
// 更新阅读时间统计
......
......@@ -28,13 +28,13 @@
<view style="display: flex;flex-direction: column;align-items: center;margin-bottom: 20rpx;">
<view style="font-size: 38rpx;color: black;">{{titleText}}</view>
<view class="flex">
<!-- <view v-if="point>0" style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">解锁本</view>
<view v-if="point>0" style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">解锁本</view>
<view style="font-size: 42rpx;color: red;font-weight: 777;">{{point}}</view>
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;margin-left: 6rpx;">
书豆
</view>
</view> -->
</view>
<view v-if="point>0" style="width: 60rpx;"></view>
<view style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">账户余额:</view>
......@@ -49,7 +49,7 @@
<view class="section">
<view class="pack-box">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f5f5f5;'"
:style="item.largeType !=='vip' ?'background: #f4c98b;':'background: #f5f5f5;'"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList'
:key='index' @click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
......@@ -195,7 +195,6 @@
let vipBean = this.vipList[this.selectedIndex];
// 抖音支付
// #ifdef MP-TOUTIAO
this.post({
url: '/vip/getVipPayParams/douyin',
data: {
......@@ -210,14 +209,16 @@
that.ttPrePay(data, vipBean.largeType);
}
});
// #endif
},
ttPrePay(ttData, largeType) {
if (!tt.canIUse('requestOrder')) {
message.notify('请升级抖音APP版本');
message.notify('请升级抖音APP版本.');
return
}
uni.showLoading({
title: '加载中...'
});
let that = this;
tt.requestOrder({
......@@ -227,20 +228,23 @@
that.ttPay(largeType, res.orderId, ttData);
},
fail(res) {
uni.hideLoading();
// message.notify(res.errMsg);
},
});
},
ttPay(largeType, oid, ttData) {
uni.hideLoading();
if (!tt.canIUse('getOrderPayment')) {
message.notify('请升级抖音APP版本');
message.notify('请升级抖音APP版本!');
return
}
let that = this;
if (this.os == 'ios') {
if (!tt.canIUse('getOrderPayment.object.imId')) {
message.notify('请升级抖音APP版本');
message.notify('请升级抖音APP版本~');
return
}
......@@ -251,7 +255,7 @@
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
message.notify(res.errMsg);
// message.notify(res.errMsg);
},
});
} else {
......@@ -261,7 +265,7 @@
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
message.notify(res.errMsg);
// message.notify(res.errMsg);
},
});
}
......
This diff is collapsed.
......@@ -27,7 +27,7 @@
<view v-else style="font-size: 28rpx;color: #b5b5b5;margin-top: 20rpx;">到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}</view>
</view>
</view>
<view style="width: 220rpx;">
<view v-if="userBean.expireTime<=0" style="width: 220rpx;">
<view
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<view @click="handleCoinPay"
......@@ -101,17 +101,11 @@
statusBarHeight: app.globalData.statusBarHeight,
userBean: {},
showAnimate: false,
windowHeight: 0,
os: 'android',
versionName: app.globalData.versionName,
corpid: '', // 企业ID
curl: '', // 客服链接
versionName: app.globalData.versionName
};
},
methods: {
show() {
// this.os = wx.getSystemInfoSync().platform;
this.windowHeight = uni.getSystemInfoSync().windowHeight
// loadData() {
this.post({
url: '/user/baseMsg',
......@@ -143,48 +137,7 @@
handlePayRecord() {
navigateTo(`/pagesD/payRecord/payRecord`)
},
handleVipPay() {
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) {
......@@ -198,7 +151,7 @@
paySuccess(largeType) {
// largeType=vip 开通vip
// largeType=point 购买书豆
if(wx.getSystemInfoSync().platform=='ios'){
if(tt.getSystemInfoSync().platform=='ios'){
message.notify('支付成功');
}
......@@ -211,11 +164,6 @@
this.userBean = data;
}
});
},
getPhoneNumber(e) {
console.log(e.detail.code) // 动态令牌
console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
console.log(e.detail.errno) // 错误码(失败时返回)
}
}
};
......
......@@ -100,7 +100,13 @@
deep: true
}
},
methods: {
methods: {
show(){
},
hide(){
},
readyCategory() {
setTimeout(() => {
this.initHeight()
......
......@@ -13,7 +13,7 @@
"path": "pages/loading",
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#F2F1FF",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "#000000"
}
},
......@@ -165,6 +165,6 @@
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}]
}
}
\ No newline at end of file
......@@ -2,11 +2,10 @@
<view class="body">
<view style="height: 92%;">
<bookshelf v-show="currentPage==0" ref="index" />
<warehouse v-on:showEditBarH="showEditBarH" v-on:changeBottomBarColor="changeBottomBarColor"
v-show="currentPage==1" ref="recommend" />
<warehouse v-show="currentPage==1" ref="recommend" />
<userPage v-show="currentPage==2" ref="user" />
</view>
<view v-if="!isShowBlackBar" class="tabs-bar">
<view class="tabs-bar">
<view :class="currentPage==0?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'"
@click="tabChange(0)">
<view style="margin: 16rpx 0 11rpx;">
......@@ -15,7 +14,7 @@
</image>
<image v-else class="tabs-image" src="/static/tab/index_unselected.png" mode="heightFix"></image>
</view>
剧场
书架
</view>
<view :class="currentPage == 1?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'"
@click="tabChange(1)">
......@@ -24,7 +23,7 @@
mode="heightFix"></image>
<image v-else class="tabs-image" src="/static/tab/promote_unselected.png" mode="heightFix"></image>
</view>
推荐
书库
</view>
<view :class="currentPage == 2?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'"
@click="tabChange(2)">
......@@ -36,46 +35,6 @@
我的
</view>
</view>
<view v-if="isShowBlackBar" class="tabs-bar2">
<view :class="currentPage==0?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'"
@click="tabChange(0)">
<view style="margin: 16rpx 0 11rpx;">
<image v-if="currentPage==0" class="tabs-image" src="/static/tab/index_selected.png"
mode="heightFix">
</image>
<image v-else class="tabs-image" src="/static/tab/index_unselected.png" mode="heightFix"></image>
</view>
剧场
</view>
<view :class="currentPage == 1?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'"
@click="tabChange(1)">
<view style="margin: 16rpx 0 11rpx;">
<image v-if="currentPage==1" class="tabs-image" src="/static/tab/promote_selected.png"
mode="heightFix"></image>
<image v-else class="tabs-image" src="/static/tab/promote_unselected.png" mode="heightFix"></image>
</view>
推荐
</view>
<view :class="currentPage == 2?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'"
@click="tabChange(2)">
<view style="margin: 16rpx 0 11rpx;">
<image v-if="currentPage==2" class="tabs-image" src="/static/tab/my_selected.png" mode="heightFix">
</image>
<image v-else class="tabs-image" src="/static/tab/my_unselected.png" mode="heightFix"></image>
</view>
我的
</view>
</view>
<view v-if="showEditBar" class="editBar" :style="'padding-bottom:' + bottomSafePadding + 'px;'">
<view class="editItem" @click="!isFullChoice?fullChoice():noChoice()">
{{!isFullChoice?'全选':'全不选'}}
</view>
<view class="editItem" @click="deleteCollect">
删除
</view>
</view>
</view>
</template>
......@@ -101,11 +60,7 @@
},
data() {
return {
isFirstLoad: true,
currentPage: 0,
showEditBar: false,
isFullChoice: false,
isShowBlackBar: false
currentPage: 0
}
},
onLoad(options) {
......@@ -113,38 +68,10 @@
if (index != '' && index != undefined) {
this.currentPage = index
}
// #ifdef MP-TOUTIAO
tt.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#ffffff'
})
// #endif
// if (wx.setVisualEffectOnCapture) {
// wx.setVisualEffectOnCapture({
// visualEffect: 'hidden',
// success: (res) => {
// },
// })
// }
},
onShow() {
try {
// 在子组件重写show()代替onShow()
if (this.currentPage == 0) {
this.$refs.index.show();
} else if (this.currentPage == 1) {
// this.$refs.recommend.show();
} else if (this.currentPage == 2) {
this.$refs.user.show();
}
} catch (e) {
}
onShow() {
this.loadComponentData();
},
mounted() {
// 渲染完成 初始化首页数据
......@@ -159,53 +86,18 @@
},
loadComponentData() {
if (this.currentPage == 0) {
this.changeBottomBarColor(false)
this.$refs.index.show();
this.$refs.recommend.hide();
this.$refs.user.hide();
} else if (this.currentPage == 1) {
this.$refs.index.hide();
this.$refs.recommend.show();
this.$refs.index.hide();
this.$refs.user.hide();
} else if (this.currentPage == 2) {
this.changeBottomBarColor(false)
this.$refs.user.show();
this.$refs.index.hide();
this.$refs.recommend.hide();
this.$refs.recommend.hide();
this.$refs.user.show();
}
},
changeBottomBarColor(b) {
this.isShowBlackBar = b
// #ifdef MP-TOUTIAO
if(b){
tt.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#000000'
})
}else{
tt.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#ffffff'
})
}
// #endif
},
showEditBarH(b) {
this.showEditBar = b
this.isFullChoice = false
},
fullChoice() {
this.isFullChoice = !this.isFullChoice
this.$refs.recommend.fullChoice();
},
noChoice() {
this.isFullChoice = !this.isFullChoice
this.$refs.recommend.noChoice();
},
deleteCollect() {
this.$refs.recommend.deleteCollect();
}
}
}
......@@ -216,38 +108,4 @@
height: 100%;
background-color: white;
}
.editBar {
position: absolute;
bottom: 0;
width: 100%;
height: 110rpx;
background: white;
display: flex;
.editItem {
height: 110rpx;
line-height: 110rpx;
text-align: center;
width: 50%;
}
}
.tabs-bar2 {
display: flex;
background-color: black;
.tab {
height: 110rpx;
flex: 1;
text-align: center;
font-size: 26rpx;
font-weight: bold;
color: white;
&.active {
color: #FECF02;
}
}
}
</style>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<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/book_bg_splash.png" mode="scaleToFill">
......@@ -35,77 +35,29 @@
return {
tips1: '',
slotParam: '',
appName: ''
appName: '幻墨小说阁'
}
},
onLoad(options) {
this.tips1 = options.tips1
this.appName = '幻墨小说阁'
},
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页参数
remark3 = obj.query.remark3 ?? ''
thirdParam = JSON.stringify(obj.query);
// 打印渠道参数
if (this.tips1 == 'mints_vedio' || tips2 == 'mints_vedio') {
this.slotParam = JSON.stringify(obj.query);
......@@ -115,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: ({
......@@ -166,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;
......
......@@ -69,7 +69,7 @@
},
queryList(page, size) {
this.post({
url: '/vedio/history',
url: '/readSystem/system/readRecord/list',
data: {
page,
size
......
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