Commit 545cb2d3 authored by jyx's avatar jyx

代码优化

parent 83b5b31c
{
"version" : "1",
"prompt" : "template",
"title" : "服务协议和隐私政策",
"message" : "请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://shimo.im/docs/dPkpKL1EVNIBbXqO\">《用户协议》</a>和<a href=\"https://shimo.im/docs/aBAYVY4mNXfgLm3j\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意",
"second" : {
"title" : "确认提示",
"message" : "进入应用前,你需先同意<a href=\"https://shimo.im/docs/dPkpKL1EVNIBbXqO\">《用户协议》</a>和<a href=\"https://shimo.im/docs/aBAYVY4mNXfgLm3j\">《隐私政策》</a>,否则将退出应用。",
"buttonAccept" : "同意并继续",
"buttonRefuse" : "退出应用"
},
"styles" : {
"backgroundColor" : "#ffffff",
"borderRadius" : "5px",
"title" : {
"color" : "#008cfb"
},
"buttonAccept" : {
"color" : "#008cfb"
},
"buttonRefuse" : {
"color" : "#c0c0c0"
}
}
}
function gotoVideoPlayerPage(detail, playNext = 0) {
if (tt.canIUse('PlayletExtension')) {
if (detail.douyinAlbumIdNext && detail.douyinEpisodeIdNext) {
//跳转至绑定短剧的页面
uni.navigateTo({
url: '/pagesC/playlet/index?data=' + encodeURIComponent(JSON.stringify(detail)) +
'&tt_album_id=' + detail.douyinAlbumIdNext + '&tt_episode_id=' + detail.douyinEpisodeIdNext
})
return
}
//跳转至绑定短剧的页面
uni.navigateTo({
url: '/pagesC/playlet/index?data=' + encodeURIComponent(JSON.stringify(detail)) +
'&tt_album_id=' + detail.douyinAlbumId + '&tt_episode_id=' + detail.douyinEpisodeId
})
} else {
tt.navigateTo({
url: '/pagesC/ttvideo/ttVideoDetail?data=' + encodeURIComponent(JSON.stringify(detail)) +
'&tt_album_id=' + detail.douyinAlbumId + '&tt_episode_id=' + detail.douyinEpisodeId +
'&playNext=' + playNext
})
}
}
export {
gotoVideoPlayerPage
}
\ No newline at end of file
This diff is collapsed.
...@@ -42,10 +42,14 @@ ...@@ -42,10 +42,14 @@
</template> </template>
<script> <script>
import common from '@/mixins/common'; import common from '@/mixins/common';
import {
gotoVideoPlayerPage
} from "@/common/page-route.js"
import { import {
message, message,
navigateTo, navigateTo,
} from '../../utils/fun.js' } from '../../utils/fun.js'
...@@ -109,8 +113,7 @@ ...@@ -109,8 +113,7 @@
this.$emit("goRecommend") this.$emit("goRecommend")
}, },
click(detail) { click(detail) {
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)) + gotoVideoPlayerPage(detail)
'&tt_album_id=' + detail.douyinAlbumId + '&tt_episode_id=' + detail.douyinEpisodeId);
}, },
longClick(key) { longClick(key) {
this.isEditStyle = true this.isEditStyle = true
...@@ -154,7 +157,7 @@ ...@@ -154,7 +157,7 @@
success: ({ success: ({
data data
}) => { }) => {
this.isEditStyle = false this.isEditStyle = false
message.notify("删除成功") message.notify("删除成功")
this.loadData() this.loadData()
} }
......
This diff is collapsed.
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
@ended="ended"> @ended="ended">
</tt-video-player> </tt-video-player>
</view> </view>
<view v-if="!isqp" class="userInfo flex"> <!-- <view v-if="!isqp" class="userInfo flex"> -->
<view v-if="false" class="userInfo flex">
<!-- 点赞 --> <!-- 点赞 -->
<view class="flex" style="opacity: 0.9; margin-top: 10rpx;"> <view class="flex" style="opacity: 0.9; margin-top: 10rpx;">
<image @click.stop="collect(list.vedioId,index)" v-if="list.collect==0" <image @click.stop="collect(list.vedioId,index)" v-if="list.collect==0"
...@@ -50,6 +51,9 @@ ...@@ -50,6 +51,9 @@
</template> </template>
<script> <script>
import {
gotoVideoPlayerPage
} from '../../common/page-route.js'
import common from '../../mixins/common.js' import common from '../../mixins/common.js'
import { import {
...@@ -238,9 +242,7 @@ ...@@ -238,9 +242,7 @@
this.isqp = e.detail.show this.isqp = e.detail.show
}, },
detail(detail) { detail(detail) {
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)) + gotoVideoPlayerPage(detail)
'&tt_album_id=' + detail.douyinAlbumId + '&tt_episode_id=' + detail.douyinEpisodeId +
`&playNext=1`);
}, },
collect(vedioId, index) { collect(vedioId, index) {
this.originList[index].collect = 1 this.originList[index].collect = 1
......
This diff is collapsed.
<template>
<view>
<button
class="reset-button button"
@click="onClick"
hover-class="button-hover"
:class="[shape == 'circle' ? 'round-circle' : '']"
>
<slot></slot>
</button>
</view>
</template>
<script>
/**
* m-field button 按钮组件
* @description 常用按钮组件。
* @tutorial https://ui.ymeoo.cn
* @property {String} color 按钮主题色
* @property {String} shape 设置为circle,则按钮两边为半圆形
* @event {Function} click 组件自定义点击事件
* @example <u-form-item label="姓名"><u-input v-model="form.name" /></u-form-item>
*/
export default {
name: 'q-button',
props: {
shape: {
type: String,
default: 'circle'
}
},
data() {
return {};
},
methods: {
onClick() {
this.$emit('click', '');
}
}
};
</script>
<style lang="scss" scoped>
// 去除button的所有默认样式
.reset-button {
padding: 0;
font-size: inherit;
line-height: inherit;
background-color: transparent;
color: inherit;
}
.reset-button::after {
border: none;
}
// button样式
.button {
display: block;
padding: 20rpx;
margin: 20rpx;
background-image: -moz-linear-gradient(135deg, rgb(0, 255, 255), rgb(29, 147, 251));
background-image: -webkit-linear-gradient(135deg, rgb(0, 255, 255), rgb(29, 147, 251));
background-image: linear-gradient(135deg, rgb(0, 255, 255), rgb(29, 147, 251));
color: #fff;
}
.button-hover {
background-color: #f5f5f5 !important;
}
.round-circle {
border-radius: 100rpx;
}
</style>
{ {
"uni-app": { "uni-app": {
"scripts": { "scripts": {}
"mp-dingtalk": {
"title": "钉钉小程序",
"env": {
"UNI_PLATFORM": "mp-alipay"
},
"define": {
"MP-DINGTALK": true
}
},
"mp-weixin-test": {
"title": "本地测试版本",
"env": {
"UNI_PLATFORM": "mp-weixin"
},
"define": {
"MP-APP-TEST": true
}
},
"mp-app-test": {
"title": "App 本地测试版本",
"env": {
"UNI_PLATFORM": "mp-weixin"
},
"define": {
"MP-APP-TEST": true
}
}
}
}, },
"dependencies": { "dependencies": {
"decimal.js": "^10.4.3", "decimal.js": "^10.4.3",
......
{ {
"easycom": { "easycom": {
"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue", "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue",
"autoscan": true, "autoscan": true,
"custom": { "custom": {
"^n-(.*)": "@/nPro/$1/$1.vue", // 匹配nPro内的vue文件 "^n-(.*)": "@/nPro/$1/$1.vue", // 匹配nPro内的vue文件
"^nx-(.*)": "@/nProX/$1/$1.vue" // 匹配nProX内的vue文件 "^nx-(.*)": "@/nProX/$1/$1.vue" // 匹配nProX内的vue文件
} }
}, },
"pages": [ "pages": [
// #ifndef APP-PLUS // #ifndef APP-PLUS
{ {
"path": "pages/loading", "path": "pages/loading"
"style": { },
"navigationStyle": "default", // #endif
"navigationBarBackgroundColor": "#F2F1FF", {
"navigationBarTextStyle": "#000000" "path": "pages/home",
} "style": {
}, "navigationBarTitleText": "山梨剧场"
// #endif }
{ }, {
"path": "pages/home", "path": "pages/brower/brower"
"style": { }
"navigationBarTitleText": "山梨剧场", ],
"navigationStyle": "default", // 分包配置
"navigationBarBackgroundColor": "#ffffff", "subPackages": [{
"navigationBarTextStyle": "black" "root": "pagesA",
} "pages": [{
}, { "path": "vipPay/vipPay"
"path": "pages/brower/brower", }, {
"style": { "path": "search/search"
"navigationStyle": "default", }, {
"navigationBarBackgroundColor": "#ffffff", "path": "task/task"
"navigationBarTextStyle": "black" }]
} },
} {
], "root": "pagesC",
// 分包配置 "pages": [{
"subPackages": [{ "path": "ttvideo/ttVideoDetail",
"root": "pagesA", "style": {
"pages": [{ "backgroundColor": "#000000",
"path": "vipPay/vipPay", "navigationBarBackgroundColor": "#000000",
"style": { "navigationBarTextStyle": "#ffffff"
"navigationStyle": "default", }
"navigationBarBackgroundColor": "#ffffff", }, {
"navigationBarTextStyle": "black" "path": "playlet/index",
} "style": {
}, { "extends": "ext://industry/playlet-plugin",
"path": "search/search", "isPageExtension": true
"style": { }
"navigationStyle": "default", }]
"navigationBarBackgroundColor": "#ffffff", },
"navigationBarTextStyle": "black" {
} "root": "pagesD",
}, { "pages": [{
"path": "task/task", "path": "watchRecord/watchRecord",
"style": { "style": {
"navigationStyle": "default", "navigationBarTitleText": "观看记录"
"navigationBarBackgroundColor": "#ffffff", }
"navigationBarTextStyle": "black" }, {
} "path": "payRecord/payRecord",
}] "style": {
}, { "navigationBarTitleText": "我的订单"
"root": "pagesC", }
"pages": [{ }, {
"path": "ttvideo/ttVideoDetail", "path": "dotRecord/dotRecord",
"style": { "style": {
"backgroundColor": "#000000", "navigationBarTitleText": "看点记录"
"navigationStyle": "default", }
"navigationBarBackgroundColor": "#000000", }, {
"navigationBarTextStyle": "#ffffff" "path": "useDotRecord/useDotRecord",
} "style": {
}] "navigationBarTitleText": "消费记录",
}, "navigationStyle": "default",
{ "navigationBarBackgroundColor": "#ffffff",
"root": "pagesD", "navigationBarTextStyle": "black"
"pages": [{ }
"path": "watchRecord/watchRecord", }, {
"style": { "path": "invite/invite",
"navigationBarTitleText": "观看记录", "style": {
"navigationStyle": "default", "navigationBarTitleText": "邀好友得1000看点"
"navigationBarBackgroundColor": "#ffffff", }
"navigationBarTextStyle": "black" }, {
} "path": "cdkey/cdkey",
}, { "style": {
"path": "payRecord/payRecord", "navigationBarTitleText": "兑换会员"
"style": { }
"navigationBarTitleText": "我的订单", }]
"navigationStyle": "default", }
"navigationBarBackgroundColor": "#ffffff", ],
"navigationBarTextStyle": "black" // 分包预载配置
} "preloadRule": {
}, { // 当我们进入了pages/home页面以后就会预下载pagesA分包
"path": "dotRecord/dotRecord", "pages/home": {
"style": { "network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"navigationBarTitleText": "看点记录", "packages": ["pagesA", "pagesC", "pagesD"] //进入页面后预下载分包
"navigationStyle": "default", }
"navigationBarBackgroundColor": "#ffffff", },
"navigationBarTextStyle": "black" "globalStyle": {
} "backgroundColor": "#f5f5f5",
}, { "navigationStyle": "default",
"path": "useDotRecord/useDotRecord", "navigationBarTextStyle": "black",
"style": { "app-plus": {
"navigationBarTitleText": "消费记录", "bounce": "none",
"navigationStyle": "default", "scrollIndicator": "none"
"navigationBarBackgroundColor": "#ffffff", },
"navigationBarTextStyle": "black" "usingComponents": {
} "tt-video-player": "ext://industry/video-player"
}, { }
"path": "invite/invite", },
"style": { "condition": { //模式配置,仅开发期间生效
"navigationBarTitleText": "邀好友得1000看点", "current": 0, //当前激活的模式(list 的索引项)
"navigationStyle": "default", "list": [{
"navigationBarBackgroundColor": "#ffffff", "name": "", //模式名称
"navigationBarTextStyle": "black" "path": "", //启动页面,必选
} "query": "" //启动参数,在页面的onLoad函数里面得到
}, { }]
"path": "cdkey/cdkey", }
"style": {
"navigationStyle": "default",
"navigationBarTitleText": "兑换会员",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}]
}
],
// 分包预载配置
"preloadRule": {
// 当我们进入了pages/home页面以后就会预下载pagesA分包
"pages/home": {
"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"packages": ["pagesA", "pagesC", "pagesD"] //进入页面后预下载分包
}
},
"globalStyle": {
"backgroundColor": "#f5f5f5",
"navigationStyle": "default",
"app-plus": {
"bounce": "none",
"scrollIndicator": "none"
},
"usingComponents": {
"tt-video-player": "ext://industry/video-player"
}
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}
} }
\ No newline at end of file
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
</template> </template>
<script> <script>
import {
gotoVideoPlayerPage
} from '../../common/page-route';
import common from '@/mixins/common'; import common from '@/mixins/common';
import { import {
navigateTo, navigateTo,
...@@ -166,8 +169,7 @@ ...@@ -166,8 +169,7 @@
this.showEmpty = false this.showEmpty = false
}, },
handleListItem(item) { handleListItem(item) {
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)) + gotoVideoPlayerPage(item)
'&tt_album_id=' + item.douyinAlbumId + '&tt_episode_id=' + item.douyinEpisodeId);
}, },
saveSearchWord(word) { saveSearchWord(word) {
// 校验是否保存过,保存过不保存 // 校验是否保存过,保存过不保存
......
<script>
import Player from "@/components/player/player.vue";
import Charge from "@/components/charge/charge.vue";
const {
PlayletExtension,
getPlayletManager
} = tt;
PlayletExtension();
import common from '@/mixins/common';
export default {
components: {
Player,
Charge
},
//采用uniapp的生命周期函数
onLoad(option) {
let data = JSON.parse(decodeURIComponent(option.data));
setTimeout(() => {
const p_m = getPlayletManager(this);
p_m.setCatalog({
freeList: data.douyinFreeList,
unlockList: data.douyinUnlockList,
lockList: data.douyinLockList,
});
}, 500)
},
onReady() {
const p_m = getPlayletManager(this);
p_m.onPlay((e) => {
console.error("可以播放了,可以播放了,可以播放了,可以播放了", e);
});
p_m.onError((e) => {
console.error("插件页onload 报错了 报错了", e);
});
p_m.onPause((e) => {
console.error("触发暂停播放onPause回调:", e);
});
},
onShow() {
console.log("show");
},
mounted() {
console.error(this, "this");
},
onShareAppMessage() {
console.log("share");
},
methods: {
cliPause(num) {
console.log(num, "cliPause");
}
},
};
</script>
\ No newline at end of file
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
</template> </template>
<script> <script>
import common from '@/mixins/common'; import common from '@/mixins/common';
import {
gotoVideoPlayerPage
} from "@/common/page-route.js"
import { import {
navigateTo, navigateTo,
message, message,
...@@ -79,8 +81,7 @@ ...@@ -79,8 +81,7 @@
}); });
}, },
handleInfo(item) { handleInfo(item) {
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)) + gotoVideoPlayerPage(item)
'&tt_album_id=' + item.douyinAlbumId + '&tt_episode_id=' + item.douyinEpisodeId);
}, },
handleXing(item) { handleXing(item) {
var that = this; var that = this;
......
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