点赞,收藏,审核,商城
This commit is contained in:
parent
d77bb46fc6
commit
a4038d4656
28
App.vue
28
App.vue
|
|
@ -1,13 +1,41 @@
|
|||
<script>
|
||||
import {
|
||||
AppServer
|
||||
} from './modules/api/AppServer';
|
||||
export default {
|
||||
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
|
||||
var systemInfo = uni.getSystemInfoSync(); // 获取系统信息
|
||||
this.globalData.statusBarHeight = systemInfo.statusBarHeight;
|
||||
this.globalData.windowHeight = systemInfo.windowHeight;
|
||||
this.getAppConfig();
|
||||
},
|
||||
globalData: {
|
||||
statusBarHeight: 0, // 初始化状态栏高度
|
||||
windowHeight: 0, // 屏幕高度
|
||||
isCheck: false, // 是否审核
|
||||
myPageMallEntrance: "", // 商城入口页图片
|
||||
mallBanner: "", // 商城顶部banner
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
},
|
||||
methods: {
|
||||
getAppConfig() {
|
||||
var that = this;
|
||||
var appserver = new AppServer();
|
||||
appserver.GetAppConfig("1.0").then(data => {
|
||||
console.log("getAppConfig", data.data);
|
||||
that.globalData.isCheck = data.data.isCheck;
|
||||
that.globalData.myPageMallEntrance = data.data.myPageMallEntrance;
|
||||
that.globalData.mallBanner = data.data.mallBanner;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ serverConfig.apiUrl_Music_GetMiniProgramUserInfo = baseUrl + '/api/Account/GetMi
|
|||
|
||||
serverConfig.apiUrl_Music_GetMusicGenresList = baseUrl + '/api/Music/GetMusicGenresList'
|
||||
serverConfig.apiUrl_Music_GetMusicGenresInfo = baseUrl + '/api/Music/GetMusicGenresInfo'
|
||||
serverConfig.apiUrl_Music_GetAppConfig = baseUrl + '/api/Music/GetAppConfig' //获取app配置
|
||||
serverConfig.apiUrl_Music_GetUserMusicGenresList = baseUrl + '/api/Music/GetUserMusicGenresList' //音乐标签
|
||||
serverConfig.apiUrl_Music_CreateUserMusicGenres = baseUrl + '/api/Music/CreateUserMusicGenres' //创建音乐风格
|
||||
serverConfig.apiUrl_Music_CreateMusic = baseUrl + '/api/Music/CreateMusic' //创建音乐
|
||||
|
|
@ -36,7 +37,11 @@ serverConfig.apiUrl_Music_GetMyMusicList = baseUrl + '/api/Music/GetMyMusicList'
|
|||
serverConfig.apiUrl_Music_GetUserInfo = baseUrl + '/api/Music/GetUserInfo' //用户信息
|
||||
serverConfig.apiUrl_Music_MusicSongsReview = baseUrl + '/api/Music/MusicSongsReview' //歌曲审核
|
||||
serverConfig.apiUrl_Music_MusicCancelSongsReview = baseUrl + '/api/Music/MusicCancelSongsReview' //取消审核
|
||||
serverConfig.apiUrl_Music_GetShopInfoList = baseUrl + '/api/Music/GetShopInfoList' //取消审核
|
||||
serverConfig.apiUrl_Music_GetShopInfoList = baseUrl + '/api/Music/GetShopInfoList' //获取商城信息
|
||||
serverConfig.apiUrl_Music_MusicSongLike = baseUrl + '/api/Music/MusicSongLike' //音乐点赞
|
||||
serverConfig.apiUrl_Music_MusicSongFavorites = baseUrl + '/api/Music/MusicSongFavorites' //音乐收藏
|
||||
serverConfig.apiUrl_Music_GetMusicSongFavorites = baseUrl + '/api/Music/GetMusicSongFavorites' //我的音乐收藏
|
||||
serverConfig.apiUrl_Music_DelMusic = baseUrl + '/api/Music/DelMusic' //删除音乐
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -201,6 +206,18 @@ AppServer.prototype.GetMusicGenresList = async function() {
|
|||
})
|
||||
}
|
||||
|
||||
//获取配置
|
||||
AppServer.prototype.GetAppConfig = async function(version) {
|
||||
|
||||
var url = serverConfig.apiUrl_Music_GetAppConfig
|
||||
|
||||
return this.getData(url, {
|
||||
"version": version
|
||||
}).then((data) => {
|
||||
return data;
|
||||
})
|
||||
}
|
||||
|
||||
//音乐列表
|
||||
AppServer.prototype.GetMusicGenresInfo = async function(genresId) {
|
||||
|
||||
|
|
@ -305,7 +322,7 @@ AppServer.prototype.MusicCancelSongsReview = async function(id) {
|
|||
})
|
||||
}
|
||||
|
||||
//取消歌曲审核
|
||||
//商城信息
|
||||
AppServer.prototype.GetShopInfoList = async function() {
|
||||
|
||||
var url = serverConfig.apiUrl_Music_GetShopInfoList
|
||||
|
|
@ -315,6 +332,52 @@ AppServer.prototype.GetShopInfoList = async function() {
|
|||
})
|
||||
}
|
||||
|
||||
//音乐点赞
|
||||
AppServer.prototype.MusicSongLike = async function(id) {
|
||||
|
||||
var url = serverConfig.apiUrl_Music_MusicSongLike
|
||||
|
||||
return this.postData(url, {
|
||||
"id": id
|
||||
}).then((data) => {
|
||||
return data;
|
||||
})
|
||||
}
|
||||
|
||||
//音乐收藏
|
||||
AppServer.prototype.MusicSongFavorites = async function(id) {
|
||||
|
||||
var url = serverConfig.apiUrl_Music_MusicSongFavorites
|
||||
|
||||
return this.postData(url, {
|
||||
"id": id
|
||||
}).then((data) => {
|
||||
return data;
|
||||
})
|
||||
}
|
||||
|
||||
//我的音乐收藏
|
||||
AppServer.prototype.GetMusicSongFavorites = async function() {
|
||||
|
||||
var url = serverConfig.apiUrl_Music_GetMusicSongFavorites
|
||||
|
||||
return this.getData(url).then((data) => {
|
||||
return data;
|
||||
})
|
||||
}
|
||||
|
||||
//删除音乐
|
||||
AppServer.prototype.DelMusic = async function(id) {
|
||||
|
||||
var url = serverConfig.apiUrl_Music_DelMusic
|
||||
|
||||
return this.postData(url, {
|
||||
"id": id
|
||||
}).then((data) => {
|
||||
return data;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
AppServer.prototype.GetServerList = async function() {
|
||||
return this.postData(serverConfig.apiUrl_AppConfig_GetServerList).then(data => {
|
||||
|
|
|
|||
|
|
@ -37,21 +37,14 @@
|
|||
onLoad: function(options) {
|
||||
console.log('传递的参数:', options.id);
|
||||
this.musicId = options.id;
|
||||
this.getStatusBarHeight();
|
||||
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
|
||||
this.getMusicSchedule(this.musicId);
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toBack() {
|
||||
uni.navigateBack();
|
||||
this.stopRequests();
|
||||
|
|
|
|||
|
|
@ -109,34 +109,14 @@
|
|||
},
|
||||
|
||||
onLoad() {
|
||||
this.getStatusBarHeight();
|
||||
this.getSubtractedHeight();
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
this.subtractedHeight = getApp().globalData.windowHeight;
|
||||
|
||||
this.getMusicGenresInfo();
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getSubtractedHeight() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const screenWidth = systemInfo.screenWidth;
|
||||
const windowHeight = systemInfo.windowHeight;
|
||||
console.log("windowHeight", windowHeight);
|
||||
// 将167rpx转换为px
|
||||
const rpxToPx = (rpx) => (rpx * screenWidth) / 750;
|
||||
// this.subtractedHeight = windowHeight - rpxToPx(167);
|
||||
this.subtractedHeight = windowHeight;
|
||||
console.log("subtractedHeight", this.subtractedHeight);
|
||||
},
|
||||
|
||||
sumfontnum(e) {
|
||||
this.fontNum = e.detail.cursor
|
||||
|
|
|
|||
|
|
@ -28,8 +28,11 @@
|
|||
style="background-color: #302D4EFF; width: 683.33rpx; height: 213.89rpx; border-radius: 10rpx; display: flex; flex-direction: row; align-items: center;">
|
||||
|
||||
<view class=""
|
||||
style="width: 152rpx; height: 152rpx; background-color: #3c3a3eFF; display: flex; align-items: center; justify-content: center; margin-left: 24rpx;">
|
||||
<img src="/static/image/ic_play.png" style="width: 45rpx; height: 45rpx;" alt="" />
|
||||
style="width: 152rpx; height: 152rpx; background-color: #3c3a3eFF; display: flex; position: relative; align-items: center; justify-content: center; margin-left: 24rpx;">
|
||||
<image :src="item.coverImage"
|
||||
style="width: 152rpx; height: 152rpx; position: absolute;" mode=""></image>
|
||||
<img src="/static/image/ic_play.png"
|
||||
style="width: 45rpx; height: 45rpx; position: absolute;" alt="" />
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
|
|
@ -85,6 +88,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
import {
|
||||
AppServer
|
||||
} from '../../modules/api/AppServer';
|
||||
|
|
@ -103,35 +107,12 @@
|
|||
this.getMusicGenresList();
|
||||
},
|
||||
onLoad() {
|
||||
this.getStatusBarHeight();
|
||||
this.getSubtractedHeight();
|
||||
this.autoLogin();
|
||||
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
this.subtractedHeight = getApp().globalData.windowHeight;
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getSubtractedHeight() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const screenWidth = systemInfo.screenWidth;
|
||||
const windowHeight = systemInfo.windowHeight;
|
||||
console.log("windowHeight", windowHeight);
|
||||
// 将167rpx转换为px
|
||||
const rpxToPx = (rpx) => (rpx * screenWidth) / 750;
|
||||
// this.subtractedHeight = windowHeight - rpxToPx(167);
|
||||
this.subtractedHeight = windowHeight;
|
||||
console.log("subtractedHeight", this.subtractedHeight);
|
||||
},
|
||||
|
||||
changeTab(index) {
|
||||
this.current = index
|
||||
console.log('当前选中索引:changeTab' + index)
|
||||
|
|
@ -188,7 +169,8 @@
|
|||
uni.navigateTo({
|
||||
url: '/pages/music/MusicPlayPage?musicUrl=' + item.musicAddress + '&musicName=' +
|
||||
item.title + '&lyrics=' + item.lyrics + '&isPublic=' + item.isPublic + '&state=' +
|
||||
item.state + '&id=' + item.id
|
||||
item.state + '&id=' + item.id + '&isLikes=' + item.isLikes + '&isFavorites=' +
|
||||
item.isFavorites + '&coverImage=' + item.coverImage
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -65,18 +65,9 @@
|
|||
},
|
||||
|
||||
onLoad() {
|
||||
this.getStatusBarHeight();
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
},
|
||||
methods: {
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
toBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -20,21 +20,20 @@
|
|||
|
||||
</view>
|
||||
|
||||
<view class="" style="width: 100%; height: 103.47rpx; display: flex; align-items: center; justify-content: center;">
|
||||
<image src="/static/image/vip.png" style="width: 683.33rpx; margin-top: 50rpx;" @click="toRecharge()"
|
||||
<view class=""
|
||||
style="width: 100%; height: 103.47rpx; display: flex; align-items: center; justify-content: center;">
|
||||
<image :src="myPageMallEntrance" style="width: 683.33rpx; margin-top: 50rpx;" @click="toRecharge()"
|
||||
mode="widthFix">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
|
||||
<view class=""
|
||||
style="display: flex; flex-direction: row; width: 100%; margin-top: 67rpx; align-items: flex-end;">
|
||||
style="display: flex; flex-direction: row; width: 65%; margin-top: 67rpx; align-items: center; justify-content: space-between;">
|
||||
|
||||
<text style="color: white; font-size: 33rpx; margin-left: 33rpx;">我的音乐</text>
|
||||
<text @click="clickMyMusic(0)" :style="setColor()">我的音乐</text>
|
||||
|
||||
<text style="color: white; font-size: 25rpx; margin-left: 52rpx;">总点赞 {{userData.likeCount}}</text>
|
||||
|
||||
<text style="color: white; font-size: 25rpx; margin-left: 52rpx;">总收藏 1.1万</text>
|
||||
<text @click="clickMyMusic(1)" :style="setColor1()">我的收藏</text>
|
||||
|
||||
</view>
|
||||
|
||||
|
|
@ -54,7 +53,8 @@
|
|||
style="width: 45rpx; height: 45rpx; position: absolute;" alt="" />
|
||||
</view>
|
||||
|
||||
<view class="" style="display: flex; flex-direction: column; margin-left: 42rpx; width: 50%;">
|
||||
<view class="" v-if="currentIndex==0"
|
||||
style="display: flex; flex-direction: column; margin-left: 42rpx; width: 50%;">
|
||||
|
||||
<view class="" style="display: flex; flex-direction: row;">
|
||||
|
||||
|
|
@ -71,6 +71,28 @@
|
|||
|
||||
|
||||
|
||||
<view class=""
|
||||
style="display: flex; flex-direction: row; align-items: center; margin-top: 75rpx;">
|
||||
<image src="../../static/image/ic_like.png" style="width: 16rpx; height: 16rpx;"
|
||||
mode=""></image>
|
||||
<text
|
||||
style="color: white; font-size: 22rpx; margin-left: 9rpx;">{{item.likeCount}}</text>
|
||||
|
||||
<image src="../../static/image/ic_collect.png"
|
||||
style="width: 16rpx; height: 16rpx; margin-left: 34rpx;" mode=""></image>
|
||||
<text
|
||||
style="color: white; font-size: 22rpx; margin-left: 9rpx;">{{item.favoritesCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="" v-if="currentIndex==1"
|
||||
style="display: flex; flex-direction: column; margin-left: 42rpx; width: 35%;">
|
||||
|
||||
<text style="font-size: 33rpx; color: white;">{{item.title}}</text>
|
||||
|
||||
<text
|
||||
style="font-size: 27rpx; color: #9C9090FF; margin-top: 18rpx;">{{item.authorName}}</text>
|
||||
|
||||
<view class=""
|
||||
style="display: flex; flex-direction: row; align-items: center; margin-top: 20rpx;">
|
||||
<image src="../../static/image/ic_like.png" style="width: 16rpx; height: 16rpx;"
|
||||
|
|
@ -86,9 +108,9 @@
|
|||
</view>
|
||||
|
||||
|
||||
<view class="" style="width: 90rpx; height: 90%; margin-left: 50rpx;">
|
||||
<view class="" v-if="currentIndex==0" style="width: 90rpx; height: 90%; margin-left: 50rpx;">
|
||||
|
||||
<view class="" @click.native.stop="deleteMusic()"
|
||||
<view class="" @click.native.stop="deleteMusic(item.id)"
|
||||
style="width: 100%; display: flex; flex-direction: row; align-items: center; justify-content: center;">
|
||||
|
||||
<image src="../../static/image/ic_delete.png" style="width: 18rpx; height: 18rpx;"
|
||||
|
|
@ -112,6 +134,21 @@
|
|||
style="width: 518.75rpx; height: 289.58rpx; background-color: #474747; border-radius: 14rpx; display: flex; flex-direction: column; align-items: center;">
|
||||
<text class="" style="font-size: 33rpx; color: white; margin-top: 31rpx;">删除音乐</text>
|
||||
<text class="" style="font-size: 28rpx; color: #ABABAB; margin-top: 39rpx;">删除后将无法找回,确认删除吗?</text>
|
||||
|
||||
<view class=""
|
||||
style="display: flex; flex-direction: row; width: 80%; margin-top: 50rpx; justify-content: space-between;">
|
||||
|
||||
<view class="" @click="cancelDele()"
|
||||
style="width: 176.46rpx; height: 59.03rpx; background-color: #7D7D7D; border-radius: 30rpx; display: flex; align-items: center; justify-content: center;">
|
||||
<text style="color: white; font-size: 27rpx;">取消</text>
|
||||
</view>
|
||||
|
||||
<view class="" @click="confirmDele()"
|
||||
style="width: 176.46rpx; height: 59.03rpx; background-image: linear-gradient(to left, #a541ffFF, #3fbbfeFF); border-radius: 30rpx; display: flex; align-items: center; justify-content: center;">
|
||||
<text style="color: white; font-size: 27rpx;">确认</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
|
@ -128,43 +165,30 @@
|
|||
systemBarHeight: 0,
|
||||
subtractedHeight: 0,
|
||||
dataList: [],
|
||||
userData: ""
|
||||
|
||||
userData: "",
|
||||
currentIndex: 0,
|
||||
musicList: [],
|
||||
favoritesList: [],
|
||||
selectedId: 0,
|
||||
myPageMallEntrance: "",
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfo();
|
||||
this.getMyMusicList();
|
||||
this.getMusicSongFavorites();
|
||||
this.currentIndex = 0;
|
||||
},
|
||||
onLoad() {
|
||||
this.getStatusBarHeight();
|
||||
this.getSubtractedHeight();
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
this.subtractedHeight = getApp().globalData.windowHeight;
|
||||
this.myPageMallEntrance = getApp().globalData.myPageMallEntrance;
|
||||
this.getUserInfo();
|
||||
this.getMyMusicList();
|
||||
|
||||
console.log("this.myPageMallEntrance", this.myPageMallEntrance);
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getSubtractedHeight() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const screenWidth = systemInfo.screenWidth;
|
||||
const windowHeight = systemInfo.windowHeight;
|
||||
console.log("windowHeight", windowHeight);
|
||||
// 将167rpx转换为px
|
||||
const rpxToPx = (rpx) => (rpx * screenWidth) / 750;
|
||||
// this.subtractedHeight = windowHeight - rpxToPx(167);
|
||||
this.subtractedHeight = windowHeight;
|
||||
console.log("subtractedHeight", this.subtractedHeight);
|
||||
},
|
||||
|
||||
|
||||
toRecharge() {
|
||||
uni.navigateTo({
|
||||
|
|
@ -193,13 +217,30 @@
|
|||
var appserver = new AppServer();
|
||||
appserver.GetMyMusicList().then(data => {
|
||||
console.log("getMyMusicList", data);
|
||||
that.musicList = data.data.reverse();
|
||||
that.dataList = data.data.reverse();
|
||||
});
|
||||
},
|
||||
|
||||
getMusicSongFavorites() {
|
||||
var that = this;
|
||||
var appserver = new AppServer();
|
||||
appserver.GetMusicSongFavorites().then(data => {
|
||||
console.log("getMusicSongFavorites", data);
|
||||
that.favoritesList = data.data.reverse();
|
||||
});
|
||||
},
|
||||
|
||||
//音乐播放页
|
||||
toMusicPlay(item) {
|
||||
|
||||
if (this.currentIndex == 1) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/music/MusicPlayPage?musicUrl=' + item.musicAddress + '&musicName=' +
|
||||
item.title + '&lyrics=' + item.lyrics + '&isPublic=' + item.isPublic + '&state=' +
|
||||
item.state + '&id=' + item.id + '&isLikes=' + item.isLikes + '&isFavorites=' +
|
||||
item.isFavorites + '&coverImage=' + item.coverImage
|
||||
});
|
||||
} else {
|
||||
if (item.state == 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/create/CreateInfoPage?id=' + item.id
|
||||
|
|
@ -208,16 +249,86 @@
|
|||
uni.navigateTo({
|
||||
url: '/pages/music/MyMusicPlayPage?musicUrl=' + item.musicAddress + '&musicName=' +
|
||||
item.title + '&lyrics=' + item.lyrics + '&isPublic=' + item.isPublic + '&state=' +
|
||||
item.state + '&id=' + item.id
|
||||
item.state + '&id=' + item.id + '&coverImage=' + item.coverImage
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
//删除音乐
|
||||
deleteMusic() {
|
||||
deleteMusic(id) {
|
||||
this.selectedId = id;
|
||||
this.$refs.popup.open('center')
|
||||
},
|
||||
|
||||
//取消
|
||||
cancelDele() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
|
||||
//确定删除
|
||||
confirmDele() {
|
||||
this.$refs.popup.close();
|
||||
uni.showLoading({
|
||||
title: ' '
|
||||
});
|
||||
var that = this;
|
||||
var appserver = new AppServer();
|
||||
appserver.DelMusic(this.selectedId).then(data => {
|
||||
console.log("DelMusic", data.data);
|
||||
that.getMyMusicList();
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: data.message,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 点击
|
||||
clickMyMusic(type) {
|
||||
this.currentIndex = type;
|
||||
if (this.currentIndex == 0) {
|
||||
this.dataList = this.musicList;
|
||||
} else {
|
||||
this.dataList = this.favoritesList;
|
||||
}
|
||||
},
|
||||
|
||||
setColor() {
|
||||
if (this.currentIndex == 0) {
|
||||
return {
|
||||
color: 'white',
|
||||
fontSize: '33rpx'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
color: '#ABABAB',
|
||||
fontSize: '28rpx'
|
||||
}
|
||||
}
|
||||
},
|
||||
setColor1() {
|
||||
if (this.currentIndex == 1) {
|
||||
return {
|
||||
color: 'white',
|
||||
fontSize: '33rpx'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
color: '#ABABAB',
|
||||
fontSize: '28rpx'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
<view class=""
|
||||
style="width: 431.25rpx; height: 431.25rpx; background-color: #000000FF; margin-top: 88rpx;">
|
||||
|
||||
<image :src="coverImage" style="width: 431.25rpx; height: 431.25rpx;" mode=""></image>
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
<view class="" v-if="!isCheck"
|
||||
style="width: 431.25rpx; display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-top: 40rpx;">
|
||||
|
||||
<image src="/static/image/ic_previous.png" style="width: 25.69rpx; height: 30.56rpx;" mode="" />
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<image src="/static/image/ic_next.png" style="width: 25.69rpx; height: 30.56rpx;" mode="" />
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
<view class="" v-if="!isCheck"
|
||||
style="display: flex; flex-direction: row; margin-top: 54rpx; width: 100%; align-items: center;">
|
||||
<text style="font-size: 25rpx; color: #3FBBFEFF; margin-left: 34rpx;">{{currentTime}}</text>
|
||||
<slider step="1" :value="speedValue" max="100" @change="sliderChange" activeColor="#84bcd2FF"
|
||||
|
|
@ -50,14 +50,18 @@
|
|||
<text style="font-size: 29rpx; color: #999999FF; margin-left: 20rpx;">举报</text>
|
||||
</view>
|
||||
|
||||
<view class="" style="display: flex; flex-direction: row; align-items: center;">
|
||||
<image src="/static/image/ic_like.png" style="width: 22.92rpx; height: 22.92rpx;" mode="">
|
||||
<view class="" @click="musicSongLike()"
|
||||
style="display: flex; flex-direction: row; align-items: center;">
|
||||
<image :src="isLikes?'/static/image/ic_like_s.png':'/static/image/ic_like.png'"
|
||||
style="width: 22.92rpx; height: 22.92rpx;" mode="">
|
||||
</image>
|
||||
<text style="font-size: 29rpx; color: #999999FF; margin-left: 20rpx;">点赞</text>
|
||||
</view>
|
||||
|
||||
<view class="" style="display: flex; flex-direction: row; align-items: center;">
|
||||
<image src="/static/image/ic_collect.png" style="width: 22.92rpx; height: 22.92rpx;" mode="">
|
||||
<view class="" @click="musicSongFavorites()"
|
||||
style="display: flex; flex-direction: row; align-items: center;">
|
||||
<image :src="isFavorites?'/static/image/ic_collect_s.png':'/static/image/ic_collect.png'"
|
||||
style="width: 22.92rpx; height: 22.92rpx;" mode="">
|
||||
</image>
|
||||
<text style="font-size: 29rpx; color: #999999FF; margin-left: 20rpx;">收藏</text>
|
||||
</view>
|
||||
|
|
@ -72,19 +76,24 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<scroll-view scroll-y="true" :scroll-into-view="currentTimeContent"
|
||||
<!-- 歌词 -->
|
||||
<!-- <scroll-view scroll-y="true" :scroll-into-view="currentTimeContent"
|
||||
style="width: 643.75rpx;height: 200rpx; margin-top: 60rpx;">
|
||||
<view v-for="(item,index) in lyricList" :id="'item-'+index"
|
||||
style="width: 100%; text-align: center; margin-top: 11rpx; margin-bottom: 11rpx;"
|
||||
:style="setlyricColor(index)">
|
||||
{{item.content}}
|
||||
</view>
|
||||
</scroll-view> -->
|
||||
|
||||
<scroll-view scroll-y="true" style="width: 643.75rpx;height: 200rpx; margin-top: 60rpx;">
|
||||
<view v-for="(item,index) in lyrics"
|
||||
style="width: 100%; text-align: center; margin-top: 11rpx; margin-bottom: 11rpx; color: white;">
|
||||
{{item}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="" style="width: 683.33rpx; height: 83.33rpx; margin-top: 140rpx; display: flex; align-items: center; justify-content: center;
|
||||
background-image: linear-gradient(to left, #a541ffFF, #a541ffFF, #3fbbfeFF); border-radius: 50rpx;">
|
||||
|
||||
|
|
@ -102,6 +111,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
AppServer
|
||||
} from '../../modules/api/AppServer';
|
||||
var innerAudioContext = null;
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -114,8 +126,12 @@
|
|||
currentTimeIndex: 0,
|
||||
currentTimeContent: "",
|
||||
musicName: "",
|
||||
lyrics: "",
|
||||
lyrics: [],
|
||||
id: 0,
|
||||
isLikes: false,
|
||||
isFavorites: false,
|
||||
isCheck: false,
|
||||
coverImage: "",
|
||||
lyricList: [{
|
||||
time: "00:00",
|
||||
content: "晴天 - 周杰伦"
|
||||
|
|
@ -144,16 +160,30 @@
|
|||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
this.getStatusBarHeight();
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
this.isCheck = getApp().globalData.isCheck;
|
||||
this.musicName = options.musicName;
|
||||
this.lyrics = options.lyrics;
|
||||
this.coverImage = options.coverImage;
|
||||
this.id = options.id;
|
||||
this.isLikes = JSON.parse(options.isLikes);
|
||||
this.isFavorites = JSON.parse(options.isFavorites);
|
||||
|
||||
this.lyrics = this.splitAndRemoveBrackets(options.lyrics);
|
||||
|
||||
console.log("isFavorites", this.isFavorites);
|
||||
console.log("isLikes", this.isLikes);
|
||||
|
||||
if (!this.isCheck) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
}
|
||||
|
||||
innerAudioContext = uni.createInnerAudioContext();
|
||||
innerAudioContext.src = options.musicUrl;
|
||||
if (!this.isCheck) {
|
||||
innerAudioContext.autoplay = true;
|
||||
}
|
||||
|
||||
innerAudioContext.onTimeUpdate(() => {
|
||||
this.currentTime = this.convertSecondsToHMS(innerAudioContext.currentTime);
|
||||
|
|
@ -190,15 +220,6 @@
|
|||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toBack() {
|
||||
innerAudioContext.destroy();
|
||||
|
|
@ -232,7 +253,6 @@
|
|||
},
|
||||
|
||||
|
||||
|
||||
convertSecondsToHMS(seconds) {
|
||||
// var hours = Math.floor(seconds / 3600);
|
||||
var minutes = Math.floor((seconds % 3600) / 60);
|
||||
|
|
@ -263,7 +283,58 @@
|
|||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
splitAndRemoveBrackets(str) {
|
||||
// 按照换行符分割字符串成数组
|
||||
const lines = str.split('\n');
|
||||
|
||||
// 遍历数组,去掉每行中[]内的内容
|
||||
const result = lines.map(line => {
|
||||
// 使用正则表达式匹配[]内的内容,并替换为空字符串
|
||||
return line.replace(/\[.*?\]/g, '');
|
||||
});
|
||||
|
||||
// 过滤掉空字符串
|
||||
return result.filter(line => line.trim() !== '');
|
||||
},
|
||||
|
||||
//点赞
|
||||
musicSongLike() {
|
||||
var that = this;
|
||||
var appserver = new AppServer();
|
||||
appserver.MusicSongLike(this.id).then(data => {
|
||||
console.log("musicSongLike", data.data);
|
||||
uni.showToast({
|
||||
title: data.message,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
|
||||
if (data.data) {
|
||||
that.isLikes = !that.isLikes;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//收藏
|
||||
musicSongFavorites() {
|
||||
var that = this;
|
||||
var appserver = new AppServer();
|
||||
appserver.MusicSongFavorites(this.id).then(data => {
|
||||
console.log("musicSongFavorites", data.data);
|
||||
uni.showToast({
|
||||
title: data.message,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
if (data.data) {
|
||||
that.isFavorites = !that.isFavorites;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
<view class=""
|
||||
style="width: 431.25rpx; height: 431.25rpx; background-color: #000000FF; margin-top: 88rpx;">
|
||||
|
||||
<image :src="coverImage" style="width: 431.25rpx; height: 431.25rpx;" mode=""></image>
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
<view class="" v-if="!isCheck"
|
||||
style="width: 431.25rpx; display: flex; align-items: center; justify-content: center; margin-top: 40rpx;">
|
||||
|
||||
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
<view class="" v-if="!isCheck"
|
||||
style="display: flex; flex-direction: row; margin-top: 54rpx; width: 100%; align-items: center;">
|
||||
<text style="font-size: 25rpx; color: #3FBBFEFF; margin-left: 34rpx;">{{currentTime}}</text>
|
||||
<slider step="1" :value="speedValue" max="100" @change="sliderChange" activeColor="#84bcd2FF"
|
||||
|
|
@ -64,14 +64,21 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<scroll-view scroll-y="true" :scroll-into-view="currentTimeContent"
|
||||
<!-- 歌词 -->
|
||||
<!-- <scroll-view scroll-y="true" :scroll-into-view="currentTimeContent"
|
||||
style="width: 643.75rpx;height: 200rpx; margin-top: 60rpx;">
|
||||
<view v-for="(item,index) in lyricList" :id="'item-'+index"
|
||||
style="width: 100%; text-align: center; margin-top: 11rpx; margin-bottom: 11rpx;"
|
||||
:style="setlyricColor(index)">
|
||||
{{item.content}}
|
||||
</view>
|
||||
</scroll-view> -->
|
||||
|
||||
<scroll-view scroll-y="true" style="width: 643.75rpx;height: 260rpx; margin-top: 60rpx;">
|
||||
<view v-for="(item,index) in lyrics"
|
||||
style="width: 100%; text-align: center; margin-top: 11rpx; margin-bottom: 11rpx; color: white;">
|
||||
{{item}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
|
|
@ -109,12 +116,14 @@
|
|||
currentTimeIndex: 0,
|
||||
currentTimeContent: "",
|
||||
musicName: "",
|
||||
lyrics: "",
|
||||
lyrics: [],
|
||||
isExamine: false,
|
||||
isPublic: false,
|
||||
state: 0,
|
||||
isPublicStatus: false,
|
||||
id: 0,
|
||||
isCheck: false,
|
||||
coverImage: "",
|
||||
lyricList: [{
|
||||
time: "00:00",
|
||||
content: "晴天 - 周杰伦"
|
||||
|
|
@ -143,15 +152,23 @@
|
|||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
this.getStatusBarHeight();
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
this.isCheck = getApp().globalData.isCheck;
|
||||
this.musicName = options.musicName;
|
||||
this.lyrics = options.lyrics;
|
||||
this.coverImage = options.coverImage;
|
||||
this.isPublic = options.isPublic;
|
||||
this.state = options.state;
|
||||
this.id = options.id;
|
||||
|
||||
this.lyrics = this.splitAndRemoveBrackets(options.lyrics);
|
||||
|
||||
console.log("coverImage", this.coverImage);
|
||||
|
||||
if (!this.isCheck) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
}
|
||||
|
||||
console.log("this.state", this.state);
|
||||
console.log("this.isPublic", this.isPublic);
|
||||
|
|
@ -167,7 +184,11 @@
|
|||
|
||||
innerAudioContext = uni.createInnerAudioContext();
|
||||
innerAudioContext.src = options.musicUrl;
|
||||
|
||||
if (!this.isCheck) {
|
||||
innerAudioContext.autoplay = true;
|
||||
}
|
||||
|
||||
|
||||
innerAudioContext.onTimeUpdate(() => {
|
||||
this.currentTime = this.convertSecondsToHMS(innerAudioContext.currentTime);
|
||||
|
|
@ -204,16 +225,6 @@
|
|||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toBack() {
|
||||
innerAudioContext.destroy();
|
||||
uni.navigateBack();
|
||||
|
|
@ -293,6 +304,20 @@
|
|||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
splitAndRemoveBrackets(str) {
|
||||
// 按照换行符分割字符串成数组
|
||||
const lines = str.split('\n');
|
||||
|
||||
// 遍历数组,去掉每行中[]内的内容
|
||||
const result = lines.map(line => {
|
||||
// 使用正则表达式匹配[]内的内容,并替换为空字符串
|
||||
return line.replace(/\[.*?\]/g, '');
|
||||
});
|
||||
|
||||
// 过滤掉空字符串
|
||||
return result.filter(line => line.trim() !== '');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
</view>
|
||||
|
||||
<image src="/static/image/recharge_info.png"
|
||||
style="width: 683.33rpx; height: 206.94rpx; margin-top: 66rpx;" mode=""></image>
|
||||
<image :src="mallBanner" style="width: 683.33rpx; height: 206.94rpx; margin-top: 66rpx;" mode="">
|
||||
</image>
|
||||
|
||||
</view>
|
||||
|
||||
|
|
@ -35,8 +35,8 @@
|
|||
style="width: 192.36rpx; height: 172.22rpx; margin-left: 29rpx;
|
||||
background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; padding: 2rpx;" :style="setBg(index)">
|
||||
|
||||
<image src="/static/image/recharge_goods.png" style="width: 185.42rpx; height: 164.58rpx;"
|
||||
@click="clickGoods(index,item)" mode=""></image>
|
||||
<image :src="item.imgUrl" style="width: 185.42rpx; height: 164.58rpx;"
|
||||
@click="clickGoods(index,item.price)" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -46,17 +46,17 @@
|
|||
<view class=""
|
||||
style="width: 100%; display: flex; flex-direction: row; margin-top: 61rpx; overflow: auto;">
|
||||
|
||||
<view class="" v-for="(item,index) in goodsList"
|
||||
<view class="" v-for="(item,index) in vipGoodsList"
|
||||
style="width: 192.36rpx; height: 172.22rpx; margin-left: 29rpx;
|
||||
background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; padding: 2rpx;" :style="setVIPBg(index)">
|
||||
|
||||
<image src="/static/image/recharge_goods_2.png" style="width: 185.42rpx; height: 164.58rpx;"
|
||||
@click="clickVIPGoods(index,item)" mode=""></image>
|
||||
<image :src="item.imgUrl" style="width: 185.42rpx; height: 164.58rpx;"
|
||||
@click="clickVIPGoods(index,item.price)" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="" @click="setPayment(true)"
|
||||
<!-- <view class="" @click="setPayment(true)"
|
||||
style="display: flex; width: 100%; flex-direction: row; height: 50rpx; margin-top: 60rpx;align-items: center; justify-content: space-between;">
|
||||
|
||||
<view class=""
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
<image :src='!isWX?"/static/image/ic_c_s.png":"/static/image/ic_c.png"'
|
||||
style="width: 25rpx; height: 25rpx; margin-right: 33rpx;" mode=""></image>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="" style="width: 683.33rpx; height: 83.33rpx; margin-top: 140rpx; display: flex; align-items: center; justify-content: center;
|
||||
|
|
@ -127,15 +127,16 @@
|
|||
} from '../../modules/api/AppServer';
|
||||
export default {
|
||||
data() {
|
||||
var goodsList = [1, 2, 3, 4, 5, 6];
|
||||
return {
|
||||
systemBarHeight: 0,
|
||||
goodsList,
|
||||
goodsList: [],
|
||||
vipGoodsList: [],
|
||||
currentIndex: 0,
|
||||
currentVIPIndex: 0,
|
||||
isVIP: false,
|
||||
isWX: true,
|
||||
price: "",
|
||||
mallBanner: "",
|
||||
isAgreement: true
|
||||
}
|
||||
},
|
||||
|
|
@ -143,19 +144,10 @@
|
|||
this.getShopInfoList();
|
||||
},
|
||||
onLoad() {
|
||||
this.getStatusBarHeight();
|
||||
this.systemBarHeight = getApp().globalData.statusBarHeight;
|
||||
this.mallBanner = getApp().globalData.mallBanner;
|
||||
},
|
||||
methods: {
|
||||
// 获取状态栏高度的方法
|
||||
getStatusBarHeight: function() {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.systemBarHeight = res.statusBarHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
|
@ -166,6 +158,9 @@
|
|||
var appserver = new AppServer();
|
||||
appserver.GetShopInfoList().then(data => {
|
||||
console.log("getShopInfoList", data.data);
|
||||
that.price = data.data.productList[0].price
|
||||
that.goodsList = data.data.productList;
|
||||
that.vipGoodsList = data.data.vipList;
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
BIN
static/image/ic_collect_s.png
Normal file
BIN
static/image/ic_collect_s.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/image/ic_like_s.png
Normal file
BIN
static/image/ic_like_s.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 63 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
BIN
static/logo.png
BIN
static/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB |
Loading…
Reference in New Issue
Block a user