Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
522b236dae | ||
|
|
3d5574df5c | ||
|
|
6ea49ff709 | ||
|
|
1e8dc0ee9a | ||
|
|
ae340d1944 | ||
|
|
536ffb3ad6 | ||
|
|
39ec8fdb34 | ||
|
|
bd998074a3 | ||
|
|
05829f5617 | ||
|
|
cbbbaab9a9 | ||
|
|
5b77dbc5c4 | ||
|
|
34af877bd8 | ||
|
|
f998b3be47 | ||
|
|
2aa8994f70 | ||
|
|
4b56dad146 | ||
|
|
162290eaab | ||
|
|
1b51a0dcd0 | ||
|
|
ddd68f8736 | ||
|
|
f5dc71993f | ||
|
|
fcc84b91a0 | ||
|
|
350f9d22d2 | ||
|
|
39dabee715 | ||
|
|
84a2505e2a | ||
|
|
9a5afe03d3 | ||
|
|
96f7e499db | ||
|
|
aad0cd8fe6 | ||
|
|
04c821ff48 | ||
|
|
c6bff04039 | ||
|
|
af31b446ae | ||
|
|
9b9a7df309 | ||
|
|
4a379caa6b | ||
|
|
acf38bc1cc | ||
|
|
6a40105fc1 | ||
|
|
bf3782a06f | ||
|
|
1e09529158 | ||
|
|
9ecd033775 | ||
|
|
dedd92e58f |
496
App.vue
496
App.vue
@@ -1,247 +1,289 @@
|
|||||||
<script>
|
<script>
|
||||||
import {music, bgm} from '@/utils/music.js'
|
import {
|
||||||
import store from '@/store/index.js';
|
music,
|
||||||
import socket from '@/config/socket';
|
bgm
|
||||||
// #ifdef H5
|
} from '@/utils/music.js'
|
||||||
import { h5Login } from '@/config/html5Utils';
|
import store from '@/store/index.js';
|
||||||
// #endif
|
import socket from '@/config/socket';
|
||||||
// #ifdef APP-PLUS
|
// #ifdef H5
|
||||||
import APPUpdate from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
|
import {
|
||||||
// #endif
|
h5Login
|
||||||
import Vue from 'vue'
|
} from '@/config/html5Utils';
|
||||||
|
// #endif
|
||||||
|
// // #ifdef APP-PLUS
|
||||||
|
// import APPUpdate from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
|
||||||
|
// // #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
import updata from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
|
||||||
|
// #endif
|
||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function(e) {
|
onLaunch: function(e) {
|
||||||
|
// 检测自动更新
|
||||||
uni.getSystemInfo({
|
// #ifdef APP-PLUS
|
||||||
success(res) {
|
updata()
|
||||||
Vue.prototype.winWidth=res.screenWidth
|
// #endif
|
||||||
Vue.prototype.winHeight=res.screenHeight
|
|
||||||
}
|
uni.getSystemInfo({
|
||||||
})
|
success(res) {
|
||||||
|
Vue.prototype.winWidth = res.screenWidth
|
||||||
// 取出初始播放信息
|
Vue.prototype.winHeight = res.screenHeight
|
||||||
uni.getStorage({
|
|
||||||
key: 'playingInfo',
|
|
||||||
success: function (res) {
|
|
||||||
console.log(res,'playingInfo本地初始化')
|
|
||||||
store.commit('setUserInfo',{'playingInfo': res.data})
|
|
||||||
store.commit('setUserInfo',{
|
|
||||||
'playTitle':res.data.chapter,
|
|
||||||
'fengImg':res.data.bookImage
|
|
||||||
})
|
|
||||||
console.log(store.state.userInfo,'初始化')
|
|
||||||
},
|
|
||||||
fail:function(e){
|
|
||||||
console.log(e,'playingInfo本地初始化失败')
|
|
||||||
store.commit('setUserInfo',{'playingInfo': {
|
|
||||||
'images':'../../static/icon/fengziIcon.jpg',
|
|
||||||
'chapterName':'暂无播放信息',
|
|
||||||
}})
|
|
||||||
store.commit('setUserInfo',{
|
|
||||||
'playTitle': '暂无播放信息',
|
|
||||||
'fengImg': '../../static/icon/fengziIcon.jpg'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// 取出播放列表
|
|
||||||
uni.getStorage({
|
|
||||||
key: 'playData',
|
|
||||||
success: function (res) { // 本地有播放数据就用本地的
|
|
||||||
console.log(res.data,'取出的本地数据');
|
|
||||||
if(res.data.myList.length<=0){
|
|
||||||
store.commit('setUserInfo',{'playVisible': false})
|
|
||||||
}else{
|
|
||||||
music.setList(res.data.myList,'',store.state.userInfo.playIndex)
|
|
||||||
// music.setCoverImg(res.data.fengImg)
|
|
||||||
store.commit('setUserInfo',res.data)
|
|
||||||
}
|
}
|
||||||
store.commit('setUserInfo',{'playFlag': false}); // 设置播放按钮状态为暂停
|
})
|
||||||
store.commit('setUserInfo',{'currentTime': 0});
|
|
||||||
|
// 取出初始播放信息
|
||||||
},
|
uni.getStorage({
|
||||||
fail:function(e){ // 如果没有,就查询一下线上的播放记录
|
key: 'playingInfo',
|
||||||
console.log('本地无数据');
|
success: function(res) {
|
||||||
music.setList([])
|
console.log(res, 'playingInfo本地初始化')
|
||||||
//store.commit('setUserInfo',{'playingInfo': {'bookid':0,'chapterId':0}});
|
store.commit('setUserInfo', {
|
||||||
store.commit('setUserInfo',{'playVisible': false})
|
'playingInfo': res.data
|
||||||
store.commit('setUserInfo',{
|
})
|
||||||
'myList':[],
|
store.commit('setUserInfo', {
|
||||||
'fengImg':'../../static/icon/fengziIcon.jpg'
|
'playTitle': res.data.chapter,
|
||||||
})
|
'fengImg': res.data.bookImage
|
||||||
store.commit('setUserInfo',{'playFlag': false});
|
})
|
||||||
store.commit('setUserInfo',{'currentTime': 0});
|
console.log(store.state.userInfo, '初始化')
|
||||||
}
|
},
|
||||||
});
|
fail: function(e) {
|
||||||
// end
|
console.log(e, 'playingInfo本地初始化失败')
|
||||||
// 取出播放弹窗显示或者隐藏
|
store.commit('setUserInfo', {
|
||||||
uni.getStorage({
|
'playingInfo': {
|
||||||
key: 'playVisible',
|
'images': '../../static/icon/fengziIcon.jpg',
|
||||||
success: function (res) {
|
'chapterName': '暂无播放信息',
|
||||||
store.commit('setUserInfo',{'playVisible': res.data}); // 设置是否显示按钮
|
|
||||||
},
|
|
||||||
fail:function(e){ // 如果本地没有playVisible数据,默认为false
|
|
||||||
store.commit('setUserInfo',{'playVisible': false});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//取出缓存数据
|
|
||||||
store.commit('setCacheData');
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
if (store.state.userInfo.token) {
|
|
||||||
socket.init();
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
console.log(store.state)
|
|
||||||
if (store.state.userInfo.token) {
|
|
||||||
socket.init();
|
|
||||||
} else {
|
|
||||||
h5Login('force', () => {
|
|
||||||
socket.init();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
if (store.state.userInfo.token) {
|
|
||||||
socket.init();
|
|
||||||
}
|
|
||||||
APPUpdate();
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
},
|
|
||||||
onShow: function(e) {
|
|
||||||
|
|
||||||
// console.log(store.state,'playVisible')
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
//获取二维码携带的参数
|
|
||||||
let scene = decodeURIComponent(e.query.scene);
|
|
||||||
scene = scene.split('&');
|
|
||||||
let data = {
|
|
||||||
//场景值
|
|
||||||
scene: e.scene
|
|
||||||
};
|
|
||||||
scene.forEach(item => {
|
|
||||||
let arr = item.split('=');
|
|
||||||
if (arr.length == 2) {
|
|
||||||
data[arr[0]] = arr[1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
store.commit('setChatScenesInfo', Object.assign(e.query, data));
|
|
||||||
//小程序更新
|
|
||||||
if (uni.getUpdateManager) {
|
|
||||||
const updateManager = uni.getUpdateManager();
|
|
||||||
updateManager.onCheckForUpdate(function(res) {
|
|
||||||
// 请求完新版本信息的回调
|
|
||||||
// console.log(res.hasUpdate);
|
|
||||||
});
|
|
||||||
updateManager.onUpdateReady(function(res) {
|
|
||||||
uni.showModal({
|
|
||||||
title: '更新提示',
|
|
||||||
content: '新版本已经准备好,是否重启应用?',
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
||||||
updateManager.applyUpdate();
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'playTitle': '暂无播放信息',
|
||||||
|
'fengImg': '../../static/icon/fengziIcon.jpg'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// 取出播放列表
|
||||||
|
uni.getStorage({
|
||||||
|
key: 'playData',
|
||||||
|
success: function(res) { // 本地有播放数据就用本地的
|
||||||
|
console.log(res.data, '取出的本地数据');
|
||||||
|
if (res.data.myList.length <= 0) {
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'playVisible': false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
music.setList(res.data.myList, '', store.state.userInfo.playIndex)
|
||||||
|
// music.setCoverImg(res.data.fengImg)
|
||||||
|
store.commit('setUserInfo', res.data)
|
||||||
}
|
}
|
||||||
});
|
store.commit('setUserInfo', {
|
||||||
|
'playFlag': false
|
||||||
|
}); // 设置播放按钮状态为暂停
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'currentTime': 0
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: function(e) { // 如果没有,就查询一下线上的播放记录
|
||||||
|
console.log('本地无数据');
|
||||||
|
music.setList([])
|
||||||
|
//store.commit('setUserInfo',{'playingInfo': {'bookid':0,'chapterId':0}});
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'playVisible': false
|
||||||
|
})
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'myList': [],
|
||||||
|
'fengImg': '../../static/icon/fengziIcon.jpg'
|
||||||
|
})
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'playFlag': false
|
||||||
|
});
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'currentTime': 0
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
updateManager.onUpdateFailed(function(res) {
|
// end
|
||||||
// 新的版本下载失败
|
// 取出播放弹窗显示或者隐藏
|
||||||
uni.showModal({
|
uni.getStorage({
|
||||||
title: '已经有新版本了哟~',
|
key: 'playVisible',
|
||||||
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
|
success: function(res) {
|
||||||
showCancel: false
|
store.commit('setUserInfo', {
|
||||||
});
|
'playVisible': res.data
|
||||||
|
}); // 设置是否显示按钮
|
||||||
|
},
|
||||||
|
fail: function(e) { // 如果本地没有playVisible数据,默认为false
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'playVisible': false
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
//取出缓存数据
|
||||||
|
store.commit('setCacheData');
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
if (store.state.userInfo.token) {
|
||||||
|
socket.init();
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
console.log(store.state)
|
||||||
|
if (store.state.userInfo.token) {
|
||||||
|
socket.init();
|
||||||
|
} else {
|
||||||
|
h5Login('force', () => {
|
||||||
|
socket.init();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (store.state.userInfo.token) {
|
||||||
|
socket.init();
|
||||||
|
}
|
||||||
|
// APPUpdate();
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow: function(e) {
|
||||||
|
|
||||||
|
// console.log(store.state,'playVisible')
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
//获取二维码携带的参数
|
||||||
|
let scene = decodeURIComponent(e.query.scene);
|
||||||
|
scene = scene.split('&');
|
||||||
|
let data = {
|
||||||
|
//场景值
|
||||||
|
scene: e.scene
|
||||||
|
};
|
||||||
|
scene.forEach(item => {
|
||||||
|
let arr = item.split('=');
|
||||||
|
if (arr.length == 2) {
|
||||||
|
data[arr[0]] = arr[1];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
store.commit('setChatScenesInfo', Object.assign(e.query, data));
|
||||||
|
//小程序更新
|
||||||
|
if (uni.getUpdateManager) {
|
||||||
|
const updateManager = uni.getUpdateManager();
|
||||||
|
updateManager.onCheckForUpdate(function(res) {
|
||||||
|
// 请求完新版本信息的回调
|
||||||
|
// console.log(res.hasUpdate);
|
||||||
|
});
|
||||||
|
updateManager.onUpdateReady(function(res) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '更新提示',
|
||||||
|
content: '新版本已经准备好,是否重启应用?',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
updateManager.applyUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
updateManager.onUpdateFailed(function(res) {
|
||||||
|
// 新的版本下载失败
|
||||||
|
uni.showModal({
|
||||||
|
title: '已经有新版本了哟~',
|
||||||
|
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
|
||||||
|
showCancel: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
onHide: function() {},
|
||||||
|
destroyed() {
|
||||||
|
store.commit('setUserInfo', {
|
||||||
|
'playFlag': true
|
||||||
|
})
|
||||||
|
console.log('页面销毁')
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
}
|
}
|
||||||
// #endif
|
};
|
||||||
},
|
|
||||||
onHide: function() {},
|
|
||||||
destroyed() {
|
|
||||||
store.commit('setUserInfo',{'playFlag': true})
|
|
||||||
console.log('页面销毁')
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "uview-ui/index.scss";
|
@import "uview-ui/index.scss";
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
@import './style/common.scss';
|
@import './style/common.scss';
|
||||||
@import './style/input.scss';
|
@import './style/input.scss';
|
||||||
@import './style/table.scss';
|
@import './style/table.scss';
|
||||||
page {
|
|
||||||
height: 100%;
|
|
||||||
background-color: #f7faf9;
|
|
||||||
}
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
/* #ifdef H5 */
|
page {
|
||||||
//修复H5底部导航挡住内容bug
|
height: 100%;
|
||||||
uni-app {
|
background-color: #f7faf9;
|
||||||
height: auto;
|
}
|
||||||
}
|
|
||||||
/*每个页面公共css */
|
/* #endif */
|
||||||
|
|
||||||
|
/* #ifdef H5 */
|
||||||
|
//修复H5底部导航挡住内容bug
|
||||||
|
uni-app {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*每个页面公共css */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'iconfont' ; /* project id 1997429 */
|
font-family: 'iconfont';
|
||||||
src: url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot');
|
/* project id 1997429 */
|
||||||
src: url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot?#iefix') format('embedded-opentype'),
|
src: url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot');
|
||||||
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff2') format('woff2'),
|
src: url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot?#iefix') format('embedded-opentype'),
|
||||||
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff') format('woff'),
|
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff2') format('woff2'),
|
||||||
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.ttf') format('truetype'),
|
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff') format('woff'),
|
||||||
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.svg#iconfont') format('svg');
|
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.ttf') format('truetype'),
|
||||||
}
|
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.svg#iconfont') format('svg');
|
||||||
.iconfont{
|
|
||||||
font-family:"iconfont" !important;
|
|
||||||
font-style:normal;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-webkit-text-stroke-width: 0.2px;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//修复H5输入框上下不居中bug
|
.iconfont {
|
||||||
.uni-input-form {
|
font-family: "iconfont" !important;
|
||||||
height: 100%;
|
font-style: normal;
|
||||||
}
|
-webkit-font-smoothing: antialiased;
|
||||||
//去除地图上高德地图标识符
|
-webkit-text-stroke-width: 0.2px;
|
||||||
.amap-copyright {
|
-moz-osx-font-smoothing: grayscale;
|
||||||
display: none !important;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.amap-logo {
|
//修复H5输入框上下不居中bug
|
||||||
display: none !important;
|
.uni-input-form {
|
||||||
}
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.amap-ui-control-zoom {
|
//去除地图上高德地图标识符
|
||||||
width: 60upx !important;
|
.amap-copyright {
|
||||||
}
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.amap-ui-control-zoom > * {
|
.amap-logo {
|
||||||
width: 60upx !important;
|
display: none !important;
|
||||||
height: 60upx !important;
|
}
|
||||||
line-height: 60upx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.amap-ui-control-theme-dark {
|
.amap-ui-control-zoom {
|
||||||
display: none !important;
|
width: 60upx !important;
|
||||||
}
|
}
|
||||||
//设置圆角
|
|
||||||
checkbox.round .wx-checkbox-input,
|
|
||||||
checkbox.round .uni-checkbox-input {
|
|
||||||
border-radius: 100upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//设置背景色
|
.amap-ui-control-zoom>* {
|
||||||
checkbox.checkedItem[checked] .wx-checkbox-input,
|
width: 60upx !important;
|
||||||
checkbox.checkedItem .uni-checkbox-input-checked{
|
height: 60upx !important;
|
||||||
background-color: #e5a000 !important;
|
line-height: 60upx !important;
|
||||||
border-color: #e5a000 !important;
|
}
|
||||||
color: #ffffff !important;
|
|
||||||
}
|
.amap-ui-control-theme-dark {
|
||||||
/* #endif */
|
display: none !important;
|
||||||
</style>
|
}
|
||||||
|
|
||||||
|
//设置圆角
|
||||||
|
checkbox.round .wx-checkbox-input,
|
||||||
|
checkbox.round .uni-checkbox-input {
|
||||||
|
border-radius: 100upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//设置背景色
|
||||||
|
checkbox.checkedItem[checked] .wx-checkbox-input,
|
||||||
|
checkbox.checkedItem .uni-checkbox-input-checked {
|
||||||
|
background-color: #e5a000 !important;
|
||||||
|
border-color: #e5a000 !important;
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #endif */
|
||||||
|
</style>
|
||||||
@@ -7,6 +7,7 @@ if (process.env.NODE_ENV === 'development') {
|
|||||||
// baseUrl = "https://twin-ui.com/demo/";
|
// baseUrl = "https://twin-ui.com/demo/";
|
||||||
// baseUrl = "http://59.110.212.44:9200/pb/";
|
// baseUrl = "http://59.110.212.44:9200/pb/";
|
||||||
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
|
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
|
||||||
|
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||||
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
|
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
|
||||||
baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1
|
baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1
|
||||||
// socketUrl = "ws://8.129.186.35:6001/";
|
// socketUrl = "ws://8.129.186.35:6001/";
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ export const setWXPay = function(payInfo, callback) {
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res,'res')
|
console.log(res,'resshoppingPay')
|
||||||
if(res.code === 0){
|
if(res.code === 0){
|
||||||
let payData = {
|
let payData = {
|
||||||
provider : 'wxpay',
|
provider : 'wxpay',
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
"src" : "图片路径"
|
"src" : "图片路径"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"versionName" : "1.2.1",
|
"versionName" : "1.2.6",
|
||||||
"versionCode" : 121,
|
"versionCode" : 126,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
"ignoreVersion" : true
|
"ignoreVersion" : true
|
||||||
@@ -37,7 +37,8 @@
|
|||||||
},
|
},
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
"apple" : {
|
"apple" : {
|
||||||
"devices" : "universal"
|
"devices" : "universal",
|
||||||
|
"UIBackgroundModes" : [ "audio" ]
|
||||||
},
|
},
|
||||||
"android" : {
|
"android" : {
|
||||||
"permissionPhoneState" : {
|
"permissionPhoneState" : {
|
||||||
@@ -76,7 +77,8 @@
|
|||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||||
"minSdkVersion" : 21
|
"minSdkVersion" : 21,
|
||||||
|
"targetSdkVersion" : 30
|
||||||
},
|
},
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
"ad" : {},
|
"ad" : {},
|
||||||
@@ -84,7 +86,7 @@
|
|||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx47134a8f15083734",
|
"appid" : "wx47134a8f15083734",
|
||||||
"UniversalLinks" : ""
|
"UniversalLinks" : "https://verification.nuttyreading.com/uni-universallinks/__UNI__9788EB5/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"payment" : {
|
"payment" : {
|
||||||
@@ -95,7 +97,7 @@
|
|||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__" : [ "android" ],
|
"__platform__" : [ "android" ],
|
||||||
"appid" : "wx47134a8f15083734",
|
"appid" : "wx47134a8f15083734",
|
||||||
"UniversalLinks" : ""
|
"UniversalLinks" : "https://verification.nuttyreading.com/uni-universallinks/__UNI__9788EB5/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -106,7 +108,12 @@
|
|||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"dSYMs" : false,
|
"dSYMs" : false,
|
||||||
"UIBackgroundModes" : [ "audio" ] // 背景播放音乐
|
"UIBackgroundModes" : [ "audio" ], // 背景播放音乐
|
||||||
|
"capabilities" : {
|
||||||
|
"entitlements" : {
|
||||||
|
"com.apple.developer.associated-domains" : [ "applinks:verification.nuttyreading.com" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"android" : {
|
"android" : {
|
||||||
@@ -177,7 +184,8 @@
|
|||||||
"enable" : true
|
"enable" : true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"_spaceID" : "mp-3614b80b-2d75-4462-a481-4998f8187274"
|
||||||
}
|
}
|
||||||
// 小程序特有相关
|
// 小程序特有相关
|
||||||
|
|
||||||
|
|||||||
18
pages.json
18
pages.json
@@ -459,7 +459,23 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
},
|
||||||
|
{ // 更新版本
|
||||||
|
"path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
|
||||||
|
"style": {
|
||||||
|
"disableScroll": true,
|
||||||
|
"app-plus": {
|
||||||
|
"backgroundColorTop": "transparent",
|
||||||
|
"background": "transparent",
|
||||||
|
"titleNView": false,
|
||||||
|
"scrollIndicator": false,
|
||||||
|
"popGesture": "none",
|
||||||
|
"animationType": "fade-in",
|
||||||
|
"animationDuration": 200
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"
|
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"
|
||||||
style="width: 100%;height: 100%;">
|
style="width: 100%;height: 100%;">
|
||||||
<swiper-item v-for="(item,index) in swiperlist" :key="index" style="width: 100%;height: 100%;">
|
<swiper-item v-for="(item,index) in swiperlist" :key="index" style="width: 100%;height: 100%;">
|
||||||
<image :src="item" mode="aspectFit" style="width: 100%;height: 100%;"></image>
|
<image :src="item" mode="aspectFit" style="width: 100%;height: 100%;" @click="previewImage(item)">
|
||||||
|
</image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -36,7 +37,7 @@
|
|||||||
<view v-if="linkProducts && linkProducts.length > 0 && linkProducts[0]">
|
<view v-if="linkProducts && linkProducts.length > 0 && linkProducts[0]">
|
||||||
<view class="spbh" v-for="(item, index) in linkProducts" :key="item.id">
|
<view class="spbh" v-for="(item, index) in linkProducts" :key="item.id">
|
||||||
<view class="flexbox aligncenter" @click="previewProduct(item,index)">
|
<view class="flexbox aligncenter" @click="previewProduct(item,index)">
|
||||||
<view class="spbhimg" >
|
<view class="spbhimg">
|
||||||
<image :src="item.productImages" mode="aspectFit"></image>
|
<image :src="item.productImages" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<text class="username nowrap ">{{item.productName}}</text>
|
<text class="username nowrap ">{{item.productName}}</text>
|
||||||
@@ -109,9 +110,9 @@
|
|||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="commodityIntroduce" v-html="productInfo.productDetails"> -->
|
<!-- <view class="commodityIntroduce" v-html="productInfo.productDetails"> -->
|
||||||
<view class="commodityIntroduce">
|
<view class="commodityIntroduce">
|
||||||
<view v-if="productInfo.productDetails">
|
<view v-if="productInfo.productDetails">
|
||||||
<rich-text v-if="productInfo.productDetails" class="xiangqing"
|
<rich-text v-if="productInfo.productDetails" class="xiangqing" @itemclick="showImg"
|
||||||
:nodes="productInfo.productDetails|formatRichText"></rich-text>
|
:nodes="productInfo.productDetails|formatRichText"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -122,7 +123,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="pingjia" v-else>
|
<view class="pingjia" v-else>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view style="font-weight: 700;margin-bottom: 30rpx;">评价({{commentsList?commentsList.length:0}})</view>
|
<view style="font-weight: 700;margin-bottom: 30rpx;">评价({{commentsList?commentsList.length:0}})
|
||||||
|
</view>
|
||||||
<!-- <view class="icon-del rotate"></view> -->
|
<!-- <view class="icon-del rotate"></view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品评价 -->
|
<!-- 商品评价 -->
|
||||||
@@ -176,7 +178,8 @@
|
|||||||
<view class="imgBox">
|
<view class="imgBox">
|
||||||
<image v-if="linkimg == ''" src="../../static/icon/wufeng.jpg" mode="aspectFit"
|
<image v-if="linkimg == ''" src="../../static/icon/wufeng.jpg" mode="aspectFit"
|
||||||
style="width: 100%; height: 100%;"></image>
|
style="width: 100%; height: 100%;"></image>
|
||||||
<image v-else :src="linkimg" mode="aspectFit" style="width: 100%; height: 100%;" @click="previewImage(linkimg)"></image>
|
<image v-else :src="linkimg" mode="aspectFit" style="width: 100%; height: 100%;"
|
||||||
|
@click="previewImage(linkimg)"></image>
|
||||||
<view class="xiangxi" v-if="productId != linkProducts[linkCur].productId"
|
<view class="xiangxi" v-if="productId != linkProducts[linkCur].productId"
|
||||||
@click="gotoDetail(linkProducts[linkCur])">
|
@click="gotoDetail(linkProducts[linkCur])">
|
||||||
<text>查看详情</text>
|
<text>查看详情</text>
|
||||||
@@ -185,8 +188,8 @@
|
|||||||
<view :class="['spbh', linkCur == index ? 'cur' :'']" v-for="(item, index) in linkProducts"
|
<view :class="['spbh', linkCur == index ? 'cur' :'']" v-for="(item, index) in linkProducts"
|
||||||
:key="item.id">
|
:key="item.id">
|
||||||
<view class="flexbox aligncenter" @click="previewProduct(item,index)">
|
<view class="flexbox aligncenter" @click="previewProduct(item,index)">
|
||||||
<view class="spbhimg" >
|
<view class="spbhimg">
|
||||||
<image :src="item.productImages" mode="aspectFit" ></image>
|
<image :src="item.productImages" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<text class="username nowrap ">{{item.productName}}</text>
|
<text class="username nowrap ">{{item.productName}}</text>
|
||||||
<text class="price"
|
<text class="price"
|
||||||
@@ -200,13 +203,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<uni-goods-nav class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
|
<uni-goods-nav class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
|
||||||
@buttonClick="buttonClick" />
|
@buttonClick="buttonClick" />
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import musicPlay from '@/components/music.vue'
|
import musicPlay from '@/components/music.vue'
|
||||||
import emojiList1 from '../../bkhumor-emojiplus/emoji/biaoqin.js'
|
import emojiList1 from '../../bkhumor-emojiplus/emoji/biaoqin.js'
|
||||||
@@ -224,7 +225,7 @@
|
|||||||
options: [{
|
options: [{
|
||||||
icon: 'cart',
|
icon: 'cart',
|
||||||
text: '购物车'
|
text: '购物车'
|
||||||
}],
|
}],
|
||||||
buttonGroup: [{
|
buttonGroup: [{
|
||||||
text: '加入购物车',
|
text: '加入购物车',
|
||||||
backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
|
backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
|
||||||
@@ -254,7 +255,7 @@
|
|||||||
listenList: [], // 关联得听书
|
listenList: [], // 关联得听书
|
||||||
linkProducts: [], // 关联的商品,
|
linkProducts: [], // 关联的商品,
|
||||||
upoShow: false, // 显示底部购买选项
|
upoShow: false, // 显示底部购买选项
|
||||||
linkCur: 0, // 当前选中的关联项
|
linkCur: 0, // 当前选中的关联项
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
@@ -271,6 +272,12 @@
|
|||||||
musicPlay
|
musicPlay
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showImg(e) {
|
||||||
|
// console.log(e,'点击的内容')
|
||||||
|
// let contentimg = e.target.dataset.nodes;
|
||||||
|
this.previewImage(e.target.node.attrs.src)
|
||||||
|
},
|
||||||
|
|
||||||
gotoDetail(item) {
|
gotoDetail(item) {
|
||||||
// console.log(item,'gotoDetail')
|
// console.log(item,'gotoDetail')
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -296,14 +303,14 @@
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('关联商品', res)
|
console.log('关联商品', res)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.result.length > 0) {
|
if (res.result.length > 0) {
|
||||||
this.linkProducts = res.result
|
this.linkProducts = res.result
|
||||||
this.linkimg = this.linkProducts[0].productImages
|
this.linkimg = this.linkProducts[0].productImages
|
||||||
this.linkCur = 0
|
this.linkCur = 0
|
||||||
}else{
|
} else {
|
||||||
this.linkProducts = []
|
this.linkProducts = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
@@ -320,7 +327,13 @@
|
|||||||
previewImage(url) {
|
previewImage(url) {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: [url]
|
urls: [url],
|
||||||
|
longPressActions: {
|
||||||
|
itemList: ['很抱歉,暂不支持保存图片到本地'],
|
||||||
|
success: function(res) {
|
||||||
|
// console.log(res,'+++++')
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取html格式的评论1
|
// 获取html格式的评论1
|
||||||
@@ -474,17 +487,17 @@
|
|||||||
// console.log(e)
|
// console.log(e)
|
||||||
if (e.index == 0) {
|
if (e.index == 0) {
|
||||||
// 点击的是加入购物车
|
// 点击的是加入购物车
|
||||||
// console.log('+.........',this.linkProducts,'this.linkProducts')
|
// console.log('+.........',this.linkProducts,'this.linkProducts')
|
||||||
if (this.linkProducts.length == 0) {
|
if (this.linkProducts.length == 0) {
|
||||||
this.addCart()
|
this.addCart()
|
||||||
} else {
|
} else {
|
||||||
this.upoShow = true
|
this.upoShow = true
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 点击的是立即购买
|
// 点击的是立即购买
|
||||||
if (this.linkProducts.length == 0) {
|
if (this.linkProducts.length == 0) {
|
||||||
this.goPurse()
|
this.goPurse()
|
||||||
} else {
|
} else {
|
||||||
this.upoShow = true
|
this.upoShow = true
|
||||||
}
|
}
|
||||||
@@ -682,7 +695,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
formatRichText(html) { //控制小程序中图片大小
|
formatRichText(html) { //控制图片大小
|
||||||
let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
|
let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
|
||||||
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
|
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
|
||||||
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
|
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
|
||||||
@@ -694,6 +707,10 @@
|
|||||||
'max-width:100%;');
|
'max-width:100%;');
|
||||||
return match;
|
return match;
|
||||||
});
|
});
|
||||||
|
// newContent = newContent.replace(/<img[^>]*>/gi, function(match, capture) {
|
||||||
|
// match = match.replace(/<img[^>]*>/gi, "@click='1111'").replace(/<img[^>]*>/gi, "@click='1111'");
|
||||||
|
// return match;
|
||||||
|
// });
|
||||||
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
|
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
|
||||||
newContent = newContent.replace(/\<img/gi,
|
newContent = newContent.replace(/\<img/gi,
|
||||||
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
|
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
|
||||||
@@ -705,7 +722,9 @@
|
|||||||
url: '../peanut/shopping'
|
url: '../peanut/shopping'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
clickImg() {
|
||||||
|
console.log('点击了图片')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
this.deliverList = []
|
this.deliverList = []
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
this.$http
|
this.$http
|
||||||
.post(`/book/buyorder/queryFMS?orderId=${this.orderId}`)
|
.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res, '物流信息')
|
console.log(res, '物流信息')
|
||||||
if (res && res.code === 0) {
|
if (res && res.code === 0) {
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
|
|
||||||
<view class="orderList">
|
<view class="orderList">
|
||||||
<view class="orderItem">
|
<view class="orderItem">
|
||||||
|
<!-- <view class="guoqi flexbox" v-if="orderContet.orderStatus==0 && orderContet.overTime > 0">
|
||||||
|
<text>剩余支付时间:</text>
|
||||||
|
<uni-countdown background-color="#ff5500" color="#ffffff" :font-size="14" :show-day="false" :hour="0" :minute="0" :second="orderContet.overTime" @timeup="countDown"></uni-countdown>
|
||||||
|
</view> -->
|
||||||
<view class="orderContent" v-for="(item,index) in orderContet.products" :key="index"
|
<view class="orderContent" v-for="(item,index) in orderContet.products" :key="index"
|
||||||
@click="goDetail(item.productId)" v-if="orderContet.products!=''">
|
@click="goDetail(item.productId)" v-if="orderContet.products!=''">
|
||||||
<image :src="item.image" mode=""></image>
|
<image :src="item.image" mode=""></image>
|
||||||
@@ -106,7 +110,7 @@
|
|||||||
<view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收货</view>
|
<view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收货</view>
|
||||||
|
|
||||||
<view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view>
|
<view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view>
|
||||||
<view v-if="orderContet.orderStatus==0" class="opCan" @click="goPay">去支付</view>
|
<view v-if="orderContet.orderStatus==0" class="opCan" @click="goPay(orderContet)">去支付</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="opCan" @click="kefu">联系客服</view>
|
<view class="opCan" @click="kefu">联系客服</view>
|
||||||
@@ -174,7 +178,7 @@
|
|||||||
import $http from '@/config/requestConfig.js';
|
import $http from '@/config/requestConfig.js';
|
||||||
import {
|
import {
|
||||||
setPay,
|
setPay,
|
||||||
setPayAssign
|
setPayAssign,setWXPay
|
||||||
} from '@/config/utils';
|
} from '@/config/utils';
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
@@ -245,7 +249,12 @@
|
|||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 倒计时回调
|
||||||
|
countDown(){
|
||||||
|
console.log('重新刷新订单')
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
// 获得输入的表情数组
|
// 获得输入的表情数组
|
||||||
handleEmj(i) {
|
handleEmj(i) {
|
||||||
console.log(i,'i---------');
|
console.log(i,'i---------');
|
||||||
@@ -491,7 +500,7 @@
|
|||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/update",
|
url: "book/buyOrder/update",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
@@ -520,12 +529,16 @@
|
|||||||
getOrderList() {
|
getOrderList() {
|
||||||
console.log('this.orderType',this.orderType)
|
console.log('this.orderType',this.orderType)
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/buyorder/appGetOrderInfo/${this.orderType}?orderId=${this.orderID}`)
|
.get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('res+++',res)
|
console.log('订单详情',res)
|
||||||
this.orderContet = res.buyOrder
|
var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
||||||
|
var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
||||||
|
res.result.overTime = seconds - nowSeconds
|
||||||
|
|
||||||
|
this.orderContet = res.result
|
||||||
this.userRecordid = res.userRecordid
|
this.userRecordid = res.userRecordid
|
||||||
this.productIDs = res.buyOrder.products.map(item => {
|
this.productIDs = res.result.products.map(item => {
|
||||||
return item.productId
|
return item.productId
|
||||||
})
|
})
|
||||||
// console.log(this.orderContet,'this.orderContet')
|
// console.log(this.orderContet,'this.orderContet')
|
||||||
@@ -538,15 +551,14 @@
|
|||||||
} else if (this.orderContet.orderStatus == 3) {
|
} else if (this.orderContet.orderStatus == 3) {
|
||||||
this.titleStat = '已完成'
|
this.titleStat = '已完成'
|
||||||
}
|
}
|
||||||
// if (this.orderType == 2) {
|
|
||||||
// this.getdeliverDetails()
|
console.log(this.orderContet,'订单详情')
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取物流
|
// 获取物流
|
||||||
getdeliverDetails() {
|
getdeliverDetails() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`/book/buyorder/queryFMS?orderId=${this.orderID}`)
|
.post(`/book/buyOrder/queryFMS?orderId=${this.orderID}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res && res.code === 0) {
|
if (res && res.code === 0) {
|
||||||
console.log(res, '物流信息')
|
console.log(res, '物流信息')
|
||||||
@@ -575,7 +587,7 @@
|
|||||||
success: res => {
|
success: res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/buyorder/appDelete?orderId=' + this.orderContet.orderId)
|
.post('book/buyOrder/appDelete?orderId=' + this.orderContet.orderId)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -592,28 +604,84 @@
|
|||||||
|
|
||||||
|
|
||||||
// 支付
|
// 支付
|
||||||
goPay() {
|
goPay(payItem) {
|
||||||
setPay({
|
console.log(payItem,'订单数据')
|
||||||
typePay: 'alipay',
|
if(payItem.paymentMethod == 2){
|
||||||
subject: 'order',
|
console.log('阿里支付')
|
||||||
totalAmount: this.orderContet.realMoney,
|
setPay({
|
||||||
type: 2,
|
typePay: 'alipay',
|
||||||
relevanceoid: this.orderContet.orderSn,
|
subject: 'order',
|
||||||
customerId: this.userInfo.id,
|
totalAmount: payItem.realMoney,
|
||||||
}, res => {
|
type: 2,
|
||||||
if (res.success) {
|
relevanceoid: payItem.orderSn,
|
||||||
uni.showToast({
|
customerId: this.userInfo.id,
|
||||||
title: "支付成功"
|
}, res => {
|
||||||
});
|
if (res.success) {
|
||||||
} else {
|
uni.showToast({
|
||||||
uni.showToast({
|
title: "支付成功"
|
||||||
title: "支付失败",
|
});
|
||||||
icon: "none",
|
} else {
|
||||||
image: '../../static/icon/ic_close.png'
|
uni.showToast({
|
||||||
});
|
title: "支付失败",
|
||||||
|
icon: "none",
|
||||||
|
image: '../../static/icon/ic_close.png'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.getOrderList()
|
||||||
|
})
|
||||||
|
} else if(payItem.paymentMethod == 1){
|
||||||
|
console.log('微信支付')
|
||||||
|
// console.log(this.isAndorid)
|
||||||
|
if(this.isAndorid == false){
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '很抱歉,苹果系统暂不支持微信支付',
|
||||||
|
showCancel:false
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}else{
|
||||||
|
let data1={
|
||||||
|
orderSn:payItem.orderSn,
|
||||||
|
buyOrderId: null,
|
||||||
|
totalAmount: payItem.realMoney
|
||||||
|
}
|
||||||
|
console.log(data1,'data1')
|
||||||
|
setWXPay(data1,res => {
|
||||||
|
if (res.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付成功"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log(res)
|
||||||
|
if(res.data.errMsg.indexOf('User canceled') != -1){
|
||||||
|
uni.showToast({
|
||||||
|
title: "用户取消支付",
|
||||||
|
icon: "none",
|
||||||
|
image: '../../static/icon/ic_close.png'
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付失败",
|
||||||
|
icon: "none",
|
||||||
|
image: '../../static/icon/ic_close.png'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.getOrderList()
|
}else if(payItem.paymentMethod == 3){
|
||||||
})
|
// 苹果充值
|
||||||
|
console.log('苹果二次支付')
|
||||||
|
if(this.isAndorid){
|
||||||
|
uni.showModal({
|
||||||
|
title:'提示',
|
||||||
|
showCancel:false,
|
||||||
|
content:'很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.iphonepay(payItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 商品内容跳转
|
// 商品内容跳转
|
||||||
@@ -627,6 +695,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.guoqi{ font-size: 28rpx; align-items: center; color: red; float: right; line-height: 40rpx;}
|
||||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
||||||
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }
|
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }
|
||||||
.starLight{ background : url(../../static/icon/star_light.png) no-repeat; background-size: contain;}
|
.starLight{ background : url(../../static/icon/star_light.png) no-repeat; background-size: contain;}
|
||||||
|
|||||||
@@ -10,12 +10,17 @@
|
|||||||
:class="orderListTab==item.value?'ordStyle':''">{{item.name}}</view>
|
:class="orderListTab==item.value?'ordStyle':''">{{item.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="orderList">
|
<view class="orderList" v-if="orderList.length > 0">
|
||||||
<view class="orderItem" v-for="(ifex,inten) in orderList">
|
<view class="orderItem" v-for="(ifex,inten) in orderList">
|
||||||
<text class="orderState orderState0" v-if="ifex.orderStatus==0">待支付</text>
|
<text class="orderState orderState0" v-if="ifex.orderStatus==0">待支付</text>
|
||||||
<text class="orderState orderState1" v-if="ifex.orderStatus==1">待发货</text>
|
<text class="orderState orderState1" v-if="ifex.orderStatus==1">待发货</text>
|
||||||
<text class="orderState orderState2" v-if="ifex.orderStatus==2">待收货</text>
|
<text class="orderState orderState2" v-if="ifex.orderStatus==2">待收货</text>
|
||||||
<text class="orderState orderState3" v-if="ifex.orderStatus==3">已完成</text>
|
<text class="orderState orderState3" v-if="ifex.orderStatus==3">已完成</text>
|
||||||
|
<text class="orderState orderState5" v-if="ifex.orderStatus==5">已超时</text>
|
||||||
|
<view class="guoqi flexbox" v-if="ifex.orderStatus==0 && ifex.overTime > 0">
|
||||||
|
<text>剩余支付时间:</text>
|
||||||
|
<uni-countdown background-color="#ff5500" color="#ffffff" :font-size="14" :show-day="false" :hour="0" :minute="0" :second="ifex.overTime" @timeup="countDown"></uni-countdown>
|
||||||
|
</view>
|
||||||
<view class="flexbox orderSn">
|
<view class="flexbox orderSn">
|
||||||
<text class="">订单编号: {{ifex.orderSn}}</text>
|
<text class="">订单编号: {{ifex.orderSn}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -72,6 +77,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="" v-else style=" margin-top: 250rpx;">
|
||||||
|
<u-divider text="暂无列表数据"></u-divider>
|
||||||
|
</view>
|
||||||
<z-navigation></z-navigation>
|
<z-navigation></z-navigation>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
@@ -106,7 +114,11 @@ import {
|
|||||||
}, {
|
}, {
|
||||||
name: '已完成',
|
name: '已完成',
|
||||||
value: 3
|
value: 3
|
||||||
}],
|
},{
|
||||||
|
name: '已超时',
|
||||||
|
value: 5
|
||||||
|
},
|
||||||
|
],
|
||||||
orderListTab: 9,
|
orderListTab: 9,
|
||||||
orderList: [],
|
orderList: [],
|
||||||
iapChannel:{},
|
iapChannel:{},
|
||||||
@@ -119,6 +131,8 @@ import {
|
|||||||
this.getOrderList()
|
this.getOrderList()
|
||||||
this.checkIapOrders() //检查未完成的苹果支付订单
|
this.checkIapOrders() //检查未完成的苹果支付订单
|
||||||
this.getOS()
|
this.getOS()
|
||||||
|
// this.countDown()
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
@@ -133,6 +147,11 @@ import {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setUserInfo']),
|
...mapMutations(['setUserInfo']),
|
||||||
|
// 倒计时回调
|
||||||
|
countDown(){
|
||||||
|
console.log('重新刷新订单')
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
// 获得操作系统
|
// 获得操作系统
|
||||||
getOS(){
|
getOS(){
|
||||||
let oprateOs = ''
|
let oprateOs = ''
|
||||||
@@ -170,9 +189,18 @@ import {
|
|||||||
// 获取订单列表
|
// 获取订单列表
|
||||||
getOrderList() {
|
getOrderList() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/buyorder/appUserGetlist?userId=${this.userInfo.id}&orderStatus=${this.orderListTab}`)
|
.post(`book/buyOrder/getMyOrderList?userId=${this.userInfo.id}&orderStatus=${this.orderListTab}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
res.page.list.forEach((item,index) => {
|
||||||
|
var seconds = item.timestamp + 30 * 60 + 2 // 过期时间 30分钟+2
|
||||||
|
// var seconds = item.timestamp + 30 + 2 // 过期时间 30秒
|
||||||
|
var nowSeconds = Math.floor(new Date().getTime() / 1000); // 单位秒
|
||||||
|
item.overTime = seconds - nowSeconds
|
||||||
|
// console.log(item.overTime,'item.overTime')
|
||||||
|
|
||||||
|
})
|
||||||
this.orderList = res.page.list
|
this.orderList = res.page.list
|
||||||
|
console.log(this.orderList,'订单列表')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -203,7 +231,7 @@ import {
|
|||||||
success: res => {
|
success: res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/buyorder/appDelete?orderId=${e.orderId}`)
|
.post(`book/buyOrder/appDelete?orderId=${e.orderId}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -510,16 +538,15 @@ import {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
|
.guoqi{ font-size: 28rpx; align-items: center; color: red; float: right; line-height: 40rpx;}
|
||||||
.flexbox{display: flex;}
|
.flexbox{display: flex;}
|
||||||
.orderTabs {
|
.orderTabs {
|
||||||
|
margin: 60rpx 0 0 0;
|
||||||
margin: 100rpx 0 0 0;
|
width: 100%;
|
||||||
width: 100%;
|
padding: 30rpx 3% 3% 3%;
|
||||||
|
// padding-top: 100rpx;
|
||||||
padding: 0 3% 3% 3%;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 80rpx;
|
top: 80rpx;
|
||||||
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
|
||||||
@@ -566,6 +593,7 @@ import {
|
|||||||
.orderState1{background-color: #409eff;}
|
.orderState1{background-color: #409eff;}
|
||||||
.orderState2{background-color: #f56c6c;}
|
.orderState2{background-color: #f56c6c;}
|
||||||
.orderState3{background-color: #67c23a;}
|
.orderState3{background-color: #67c23a;}
|
||||||
|
.orderState5{background-color: #787878;}
|
||||||
.orderContent {
|
.orderContent {
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
<!-- 公共组件-每个页面必须引入 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
<public-module></public-module>
|
<public-module></public-module>
|
||||||
<z-nav-bar title="商品结算"></z-nav-bar>
|
<z-nav-bar title="商品结算"></z-nav-bar>
|
||||||
<view v-if="adressMoRen.username==undefined" class="addShouhuo" @click="toAddress()">
|
<view v-if="adressMoRen.consigneeName==undefined" class="addShouhuo" @click="toAddress()">
|
||||||
<u-icon name="plus" size="20" style="display: inline-block;margin-right: 10rpx;"></u-icon>
|
<u-icon name="plus" size="20" style="display: inline-block;margin-right: 10rpx;"></u-icon>
|
||||||
请添加收货地址
|
请添加收货地址
|
||||||
</view>
|
</view>
|
||||||
<view class="adDefault" @click="dizhiShow = true" v-if="adressMoRen.username!=undefined">
|
<view class="adDefault" @click="dizhiShow = true" v-if="adressMoRen.consigneeName!=undefined">
|
||||||
<view class="defalTop">
|
<view class="defalTop">
|
||||||
<text class="userName">
|
<text class="userName">
|
||||||
{{adressMoRen.username}}
|
{{adressMoRen.consigneeName}}
|
||||||
</text>
|
</text>
|
||||||
<text class="userTel">
|
<text class="userTel">
|
||||||
{{adressMoRen.userphone}}
|
{{adressMoRen.consigneePhone}}
|
||||||
</text>
|
</text>
|
||||||
<text class="userMoren" v-if="adressMoRen.isdefault==1">
|
<text class="userMoren" v-if="adressMoRen.isDefault==1">
|
||||||
默认
|
默认
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="defalBottom">
|
<view class="defalBottom">
|
||||||
<text class="userAddress">
|
<text class="userAddress">
|
||||||
{{adressMoRen.areaidpathtext}} {{adressMoRen.useraddress}}
|
{{adressMoRen.province}} {{adressMoRen.city}} {{adressMoRen.county}} {{adressMoRen.useraddress}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -137,12 +137,12 @@
|
|||||||
<view class="addrContent">
|
<view class="addrContent">
|
||||||
<view class="addrContentTop">
|
<view class="addrContentTop">
|
||||||
<view class="userName">
|
<view class="userName">
|
||||||
{{item.username}}
|
{{item.consigneeName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userTel">
|
<view class="userTel">
|
||||||
{{item.userphone}}
|
{{item.consigneePhone}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userMoren" v-if="item.isdefault==1">
|
<view class="userMoren" v-if="item.isDefault==1">
|
||||||
默认
|
默认
|
||||||
</view>
|
</view>
|
||||||
<u-icon name="checkmark-circle-fill" class="chooseCheck" size="20" color="#fd6004"
|
<u-icon name="checkmark-circle-fill" class="chooseCheck" size="20" color="#fd6004"
|
||||||
@@ -150,7 +150,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="addrContentBottom">
|
<view class="addrContentBottom">
|
||||||
<view class="userAddress">
|
<view class="userAddress">
|
||||||
{{item.areaidpathtext}} {{item.useraddress}}
|
{{item.province}} {{item.city}} {{item.county}}
|
||||||
|
{{item.useraddress}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -287,17 +288,23 @@
|
|||||||
this.shangIDNum = e.list
|
this.shangIDNum = e.list
|
||||||
}
|
}
|
||||||
// this.getYunFei()
|
// this.getYunFei()
|
||||||
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
if (this.typeId == 1) {
|
if (this.typeId == 1) {
|
||||||
this.getCartList()
|
this.getCartList()
|
||||||
|
|
||||||
} else if (this.typeId == 0) {
|
} else if (this.typeId == 0) {
|
||||||
this.getShangList(this.shangIDNum);
|
this.getShangList(this.shangIDNum);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
// if (this.typeId == 1) {
|
||||||
|
// this.getCartList()
|
||||||
|
|
||||||
|
// } else if (this.typeId == 0) {
|
||||||
|
// this.getShangList(this.shangIDNum);
|
||||||
|
// }
|
||||||
this.getData()
|
this.getData()
|
||||||
this.getOS()
|
this.getOS()
|
||||||
|
this.getUserAddress()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
@@ -342,7 +349,8 @@
|
|||||||
// 获取地址列表
|
// 获取地址列表
|
||||||
getUserAddress() {
|
getUserAddress() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
// .post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
|
.post(`book/userAddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.list.length != 0) {
|
if (res.list.length != 0) {
|
||||||
@@ -433,7 +441,7 @@
|
|||||||
for (let i = 0; i < this.cartIDNum.length; i++) {
|
for (let i = 0; i < this.cartIDNum.length; i++) {
|
||||||
this.cartList.push(res.cartList[this.cartIDNum[i]])
|
this.cartList.push(res.cartList[this.cartIDNum[i]])
|
||||||
}
|
}
|
||||||
// console.log(this.cartList, '购物车列表')
|
console.log(this.cartList, '购物车列表')
|
||||||
this.getCourpe()
|
this.getCourpe()
|
||||||
this.getUserAddress()
|
this.getUserAddress()
|
||||||
|
|
||||||
@@ -445,14 +453,18 @@
|
|||||||
let dataToString = ''
|
let dataToString = ''
|
||||||
// console.log(this.adressMoRen, '默认地址')
|
// console.log(this.adressMoRen, '默认地址')
|
||||||
this.cartList.forEach((item, index) => {
|
this.cartList.forEach((item, index) => {
|
||||||
key.push({productsid: item.productId, productAmount:item.productAmount})
|
key.push({productId: item.productId, quantity:item.productAmount})
|
||||||
dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
|
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
|
||||||
})
|
})
|
||||||
console.log(this.adressMoRen.areaidpath,dataToString,'this.adressMoRen.areaidpath')
|
console.log(key,'this.adressMoRen.areaidpath')
|
||||||
|
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
url: "book/buyOrder/calculateTransportPrice/",
|
||||||
|
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data:{
|
data:{
|
||||||
|
'regionCode':this.adressMoRen.regionCode,
|
||||||
|
'products':key,
|
||||||
loadAnimate:'none', // 请求加载动画
|
loadAnimate:'none', // 请求加载动画
|
||||||
} ,
|
} ,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
@@ -460,11 +472,11 @@
|
|||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.farePrice = res.price
|
this.farePrice = res.result
|
||||||
}else{
|
}else{
|
||||||
this.farePrice = 0
|
this.farePrice = 0
|
||||||
}
|
}
|
||||||
console.log('需要的运费',res.price)
|
console.log('需要的运费',res.result)
|
||||||
this.allPrice()
|
this.allPrice()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -584,12 +596,14 @@
|
|||||||
let data = {
|
let data = {
|
||||||
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
|
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
|
||||||
userId: this.userInfo.id, //下单人ID
|
userId: this.userInfo.id, //下单人ID
|
||||||
shippingUser: this.adressMoRen.username, //收货人姓名
|
shippingUser: this.adressMoRen.consigneeName, //收货人姓名
|
||||||
userPhone: this.adressMoRen.userphone, //收货人手机号
|
userPhone: this.adressMoRen.consigneePhone, //收货人手机号
|
||||||
province: this.adressMoRen.areaidpathtext.split(' ')[0], //省
|
|
||||||
city: this.adressMoRen.areaidpathtext.split(' ')[1], //市
|
// province: this.adressMoRen.areaidpathtext.split(' ')[0], //省
|
||||||
district: this.adressMoRen.areaidpathtext.split(' ')[2], //区
|
// city: this.adressMoRen.areaidpathtext.split(' ')[1], //市
|
||||||
address: this.adressMoRen.useraddress, //地址
|
// district: this.adressMoRen.areaidpathtext.split(' ')[2], //区
|
||||||
|
//address: this.adressMoRen.useraddress, //地址
|
||||||
|
|
||||||
paymentMethod: this.payType, //支付方式 2支付宝,1微信,3ios内购 4,天医币购买
|
paymentMethod: this.payType, //支付方式 2支付宝,1微信,3ios内购 4,天医币购买
|
||||||
orderMoney: this.totalPrice, //订单金额
|
orderMoney: this.totalPrice, //订单金额
|
||||||
realMoney: this.realPrice, //实收金额
|
realMoney: this.realPrice, //实收金额
|
||||||
@@ -601,11 +615,11 @@
|
|||||||
orderStatus: 0, //订单状态
|
orderStatus: 0, //订单状态
|
||||||
products: xiaBiao, //订单列表
|
products: xiaBiao, //订单列表
|
||||||
orderType: "order", //订单类型
|
orderType: "order", //订单类型
|
||||||
addressId:this.adressMoRen.addressid // 地址ID
|
addressId:this.adressMoRen.id // 地址ID
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
// url: "book/buyorder/save",
|
// url: "book/buyorder/save",
|
||||||
url: "book/buyorder/buySave",
|
url: "book/buyOrder/buySave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
|
|||||||
@@ -473,7 +473,7 @@
|
|||||||
})
|
})
|
||||||
console.log(this.adressMoRen.areaidpath,dataToString,'this.adressMoRen.areaidpath')
|
console.log(this.adressMoRen.areaidpath,dataToString,'this.adressMoRen.areaidpath')
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
url: "book/buyOrder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data:{
|
data:{
|
||||||
loadAnimate:'none', // 请求加载动画
|
loadAnimate:'none', // 请求加载动画
|
||||||
@@ -627,7 +627,7 @@
|
|||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
// url: "book/buyorder/save",
|
// url: "book/buyorder/save",
|
||||||
url: "book/buyorder/buysave",
|
url: "book/buyOrder/buysave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
<text>返回今天</text>
|
<text>返回今天</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> -->
|
<!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> -->
|
||||||
<view class="dakaBtn" @tap="buSign()"
|
<view class="dakaBtn" @tap="buSign(linshiDay)"
|
||||||
v-if="signList.indexOf(currentDay) == -1 && currentDay > linshiDay">
|
v-if="currentDay > linshiDay">
|
||||||
<text style="font-size: 24rpx;">补卡</text>
|
<text style="font-size: 24rpx;">补卡</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="dakaBtn" @tap="kuickSign()"
|
<view class="dakaBtn" @tap="kuickSign()"
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<view class="container1">
|
<view class="container1">
|
||||||
<view class="task" v-if="taskInfo.id">
|
<view class="task" v-if="taskInfo.id">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{taskInfo.heading}}
|
{{taskInfo.title}}
|
||||||
</view>
|
</view>
|
||||||
<view class="video " v-if="taskInfo.video">
|
<view class="video " v-if="taskInfo.video">
|
||||||
<!-- 视频形式的任务 -->
|
<!-- 视频形式的任务 -->
|
||||||
@@ -61,9 +61,9 @@
|
|||||||
@error="videoErrorCallback" controls></video>
|
@error="videoErrorCallback" controls></video>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="image " v-if="taskInfo.images">
|
<view class="image " v-if="taskInfo.image">
|
||||||
<!-- 图片形式的任务 -->
|
<!-- 图片形式的任务 -->
|
||||||
<image :src="taskInfo.images" @click="previewImage(taskInfo.images)" style="width: 100%;"
|
<image :src="taskInfo.image" @click="previewImage(taskInfo.image)" style="width: 100%;"
|
||||||
mode="aspectFit"></image>
|
mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="txt" v-if="taskInfo.content" v-html="taskInfo.content"></view>
|
<view class="txt" v-if="taskInfo.content" v-html="taskInfo.content"></view>
|
||||||
@@ -76,16 +76,14 @@
|
|||||||
<!-- 已打卡 -->
|
<!-- 已打卡 -->
|
||||||
<view class="had">
|
<view class="had">
|
||||||
<view class="item" v-for="(item, index) in myword" :key="index">
|
<view class="item" v-for="(item, index) in myword" :key="index">
|
||||||
<h3>#{{item.TaskHeading}}#</h3>
|
<!-- <h3>#{{item.TaskHeading}}#</h3> -->
|
||||||
<view class="content" v-html="item.phtml">
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="pjimgs flexbox">
|
<view class="pjimgs flexbox">
|
||||||
<view class="item" v-for="(item1,index) in item.clockinimages">
|
<view class="item" v-for="(item1,index) in item.imageList">
|
||||||
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1"
|
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1"
|
||||||
mode="aspectFill" style="width:100%; height: 50px;"></image>
|
mode="aspectFill" style="width:100%; height: 50px;"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="content" v-html="item.phtml"></view>
|
||||||
<view class="opBtns flexbox">
|
<view class="opBtns flexbox">
|
||||||
<span class="flexbox"><u-icon name="clock"
|
<span class="flexbox"><u-icon name="clock"
|
||||||
color="#b3b3b3"></u-icon>{{item.createTime}}</span>
|
color="#b3b3b3"></u-icon>{{item.createTime}}</span>
|
||||||
@@ -98,39 +96,112 @@
|
|||||||
<text class="clockTitle">-- 更多签到记录 --</text>
|
<text class="clockTitle">-- 更多签到记录 --</text>
|
||||||
<view class="" v-if="commentsList && commentsList.length > 0">
|
<view class="" v-if="commentsList && commentsList.length > 0">
|
||||||
<view :class="['pingjiaBox']" v-for="(item, index) in commentsList" :key="index">
|
<view :class="['pingjiaBox']" v-for="(item, index) in commentsList" :key="index">
|
||||||
<view class="flexbox">
|
<view class="flexbox" style="margin-bottom: 20rpx;">
|
||||||
<view class="touxiang">
|
<view class="touxiang">
|
||||||
<image :src="item.avatar" mode="aspectFit"></image>
|
<image v-if="!item.avatar || item.avatar == ''" src="../../static/icon/morenAvavter.png"
|
||||||
<text class="username nowrap ">{{item.name}}</text>
|
mode="aspectFit"></image>
|
||||||
|
<image v-else :src="item.avatar" mode="aspectFit"></image>
|
||||||
|
<text class="username nowrap ">{{item.nickName?item.nickName:'匿名用户'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<div class="pjimgs flexbox">
|
<div class="pjimgs flexbox">
|
||||||
<view class="item" v-for="(item1,index) in item.images">
|
<view class="item" v-for="(item1,index) in item.imageList">
|
||||||
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1"
|
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1"
|
||||||
mode="aspectFill" style="width:100%; height: 50px;"></image>
|
mode="aspectFill" style="width:100%; height: 50px;"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<view class="content" v-html="item.phtml"></view>
|
<view class="content" style="width: 100%;" @click="showPingLun(item)">
|
||||||
<text class="time">{{item.createdate}}</text>
|
<view class="" v-html="item.phtml"></view>
|
||||||
|
</view>
|
||||||
|
<view class="flexbox" style="text-align: right; align-items: center; justify-content: space-between;">
|
||||||
|
<view class="flexbox" @click="showPingLun(item)" style="align-items: center; ">
|
||||||
|
<u-icon style="display: inline ;margin-left: 10rpx; " name="chat" color="#999"
|
||||||
|
size="18" ></u-icon>
|
||||||
|
<text class="time" style="display: inline ;margin-right: 20rpx; ">回复</text>
|
||||||
|
</view>
|
||||||
|
<text class="time">{{item.createTime}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 显示追平 -->
|
<!-- 显示追平 -->
|
||||||
<!-- <view class="zhuiping item" v-if="item.zphtml != ''" style="padding-left: 50px;">
|
<view class="zhuiping item" v-if="item.subCommentList.length > 0" style="padding-left: 50px;">
|
||||||
<h5 style="color: #dbdbdb; margin:10px;">追评内容:</h5>
|
<view class="subPItem" v-for="item2 in item.subCommentList" :key="item2.key">
|
||||||
<view class="flexbox">
|
<view class="touxiang zhuipingTX flexbox">
|
||||||
<view class="contentBox">
|
<view class="left">
|
||||||
<view class="content" v-html="item.zphtml"></view>
|
<image v-if="!item2.avatar || item2.avatar == ''" src="../../static/icon/morenAvavter.png"
|
||||||
<text class="time">{{item.followUpdate}}</text>
|
mode="aspectFit"></image>
|
||||||
</view>
|
<image v-else :src="item2.avatar" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
<view class="neirong" style="text-align: left;">
|
||||||
|
<text class="username nowrap subPName">{{item2.nickName?item2.nickName:'匿名用户'}}</text>
|
||||||
|
<text class="username nowrap" style="padding: 0 10rpx; color: #c7c7c7;">回复了</text>
|
||||||
|
<text class="username nowrap">{{item2.puserNickName?item2.puserNickName:'匿名用户'}}</text>
|
||||||
|
<view class="contentBox" style="width: 100% !important; padding-left: 3px;">
|
||||||
|
<!-- <div class="pjimgs flexbox">
|
||||||
|
<view class="item" v-for="(item1,index) in item2.imageList">
|
||||||
|
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1"
|
||||||
|
mode="aspectFill" style="width:100%; height: 50px;"></image>
|
||||||
|
</view>
|
||||||
|
</div> -->
|
||||||
|
<view class="content" style="width: 100%;" @click="showPingLun(item2)">
|
||||||
|
<view class="" v-html="item2.phtml"></view>
|
||||||
|
<!-- <view class="" v-html="item2.content"></view> -->
|
||||||
|
</view>
|
||||||
|
<view class="flexbox" style="text-align: right; align-items: center; justify-content: space-between;">
|
||||||
|
<view class="flexbox" @click="showPingLun(item2)" style="align-items: center;justify-content: space-between; ">
|
||||||
|
<u-icon style="display: inline ;margin-left: 10rpx; " name="chat" color="#999"
|
||||||
|
size="18" ></u-icon>
|
||||||
|
<text class="time" style="display: inline ;margin-right: 20rpx; ">回复</text>
|
||||||
|
</view>
|
||||||
|
<text class="time">{{item2.createTime}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<u-divider text="已加载全部"></u-divider>
|
||||||
</view>
|
</view>
|
||||||
<u-divider v-else text="暂无更多签到记录"></u-divider>
|
<u-divider v-else text="暂无更多签到记录"></u-divider>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 回复评论弹窗 -->
|
||||||
|
<u-popup mode="bottom" :show="pinglunShow" :round="10" @close="pinglunShow=false">
|
||||||
|
<view class="tanchu">
|
||||||
|
<view class="dp_title">回复 {{opPinglun.nickName ? opPinglun.nickName : '匿名用户'}}</view>
|
||||||
|
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||||
|
<!-- 提交 -->
|
||||||
|
<view class="padding-bottom-sm flex padding-lr-sm" style="border-bottom: 1px solid #EEEEEE;">
|
||||||
|
<!-- <view class="mb30">
|
||||||
|
<u-upload :fileList="formData.images" @afterRead="afterRead" @delete="deletePic" multiple
|
||||||
|
:maxCount="4" width="80" height="80" :previewFullImage="true">
|
||||||
|
</u-upload>
|
||||||
|
</view> -->
|
||||||
|
<view class="flex-sub flexbox mb30">
|
||||||
|
<i @click="showEmj()" :class="emojiIcon"></i>
|
||||||
|
<!-- <input type="text" @focus="InputFocus" @blur="InputBlur" v-model="message" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></input> -->
|
||||||
|
<textarea style="border: 1px solid #EEEEEE;" class="textarea" v-model="formData.content"
|
||||||
|
@focus="InputFocus" @blur="InputBlur" @input="textareaBInput"
|
||||||
|
placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入回复内容"></textarea>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<u-button type="success" @click="goToHuiFu">提交</u-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="position: relative;">
|
||||||
|
<emotion @emotion="handleEmj" :height="220" v-if="isShowEmj" :windowWidth="windowWidth">
|
||||||
|
</emotion>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
<!-- 发布评论弹窗 -->
|
||||||
<u-popup mode="bottom" :show="addTextShow" :round="10" @close="addTextShow=false">
|
<u-popup mode="bottom" :show="addTextShow" :round="10" @close="addTextShow=false">
|
||||||
<view class="tanchu">
|
<view class="tanchu">
|
||||||
<view class="dp_title">今日签到随想</view>
|
<view class="dp_title">今日签到随想</view>
|
||||||
@@ -138,7 +209,7 @@
|
|||||||
<i @click="showEmj()" :class="emojiIcon"></i>
|
<i @click="showEmj()" :class="emojiIcon"></i>
|
||||||
<editor id="editor" class="ql-container" :placeholder="placeholder" @ready="onEditorReady"></editor>
|
<editor id="editor" class="ql-container" :placeholder="placeholder" @ready="onEditorReady"></editor>
|
||||||
</view> -->
|
</view> -->
|
||||||
|
|
||||||
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||||
<!-- 提交 -->
|
<!-- 提交 -->
|
||||||
<view class="padding-bottom-sm flex padding-lr-sm" style="border-bottom: 1px solid #EEEEEE;">
|
<view class="padding-bottom-sm flex padding-lr-sm" style="border-bottom: 1px solid #EEEEEE;">
|
||||||
@@ -171,8 +242,10 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
<view class="leaveBtn" v-if="!addTextShow && currentDay == linshiDay && taskInfo.id && myword.length == 0">
|
<view class="leaveBtn" v-if="!addTextShow && currentDay == linshiDay && taskInfo.id && myword.length == 0">
|
||||||
<button style="height: 70rpx; font-size: 28rpx; line-height: 70rpx;" type="primary" plain="true"
|
<button style="height: 70rpx; font-size: 28rpx; line-height: 70rpx;" type="primary" plain="true"
|
||||||
@click="addTextShow = true">说点什么</button>
|
@click="addTextShow = true">说点什么</button>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
<public-module></public-module>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
<!-- <z-navigation></z-navigation> -->
|
<!-- <z-navigation></z-navigation> -->
|
||||||
</view>
|
</view>
|
||||||
@@ -188,9 +261,14 @@
|
|||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from 'vuex';
|
} from 'vuex';
|
||||||
|
import {
|
||||||
|
param
|
||||||
|
} from 'jquery';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
opPinglun:{}, // 针对的评论对象
|
||||||
|
pinglunShow:false,
|
||||||
placeholder: '开始输入...',
|
placeholder: '开始输入...',
|
||||||
dayCurrent: 0, // 载入页面时的显示页数
|
dayCurrent: 0, // 载入页面时的显示页数
|
||||||
showBack: false,
|
showBack: false,
|
||||||
@@ -250,12 +328,23 @@
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
recordPageSize:20,
|
||||||
|
recordPage:1,
|
||||||
|
secondPage:1,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.bookid = e.bookid
|
this.bookid = e.bookid
|
||||||
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
console.log('下拉刷新了')
|
||||||
|
this.getBookInfo()
|
||||||
|
this.initDay()
|
||||||
|
this.getmySign()
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getBookInfo()
|
this.getBookInfo()
|
||||||
this.initDay()
|
this.initDay()
|
||||||
@@ -270,6 +359,12 @@
|
|||||||
...mapState(['userInfo'])
|
...mapState(['userInfo'])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showPingLun(item) {
|
||||||
|
// 回复评论
|
||||||
|
this.opPinglun = item
|
||||||
|
this.pinglunShow = true
|
||||||
|
console.log('item45456', this.opPinglun)
|
||||||
|
},
|
||||||
onEditorReady() {
|
onEditorReady() {
|
||||||
// #ifdef MP-BAIDU
|
// #ifdef MP-BAIDU
|
||||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
||||||
@@ -292,7 +387,7 @@
|
|||||||
} else {
|
} else {
|
||||||
console.log(res.msg)
|
console.log(res.msg)
|
||||||
}
|
}
|
||||||
console.log(res, 'res基本信息')
|
console.log(res, '书籍基本信息息')
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
@@ -340,7 +435,13 @@
|
|||||||
previewImage(url) {
|
previewImage(url) {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: [url]
|
urls: [url],
|
||||||
|
longPressActions:{
|
||||||
|
itemList:['很抱歉,暂不支持保存图片到本地'],
|
||||||
|
success:function(res){
|
||||||
|
// console.log(res,'+++++')
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取打卡参数
|
// 获取打卡参数
|
||||||
@@ -350,12 +451,13 @@
|
|||||||
'userId': this.userInfo.id
|
'userId': this.userInfo.id
|
||||||
}
|
}
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/clockinPunch/clockindays', data)
|
// .post('book/clockinPunch/clockindays', data)
|
||||||
|
.get('book/userClockIn/clockInDays', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.currentDay = res.daysBetween
|
this.currentDay = res.currentDay
|
||||||
this.linshiDay = res.daysBetween
|
this.linshiDay = res.currentDay
|
||||||
this.signList = res.dayslist
|
this.signList = res.clockInDayList
|
||||||
console.log(res, '打卡参数')
|
console.log(res, '打卡参数')
|
||||||
let zheng = Math.floor(this.currentDay / 5)
|
let zheng = Math.floor(this.currentDay / 5)
|
||||||
this.currentIndex = zheng
|
this.currentIndex = zheng
|
||||||
@@ -382,19 +484,25 @@
|
|||||||
|
|
||||||
// 获取当天我的发布内容
|
// 获取当天我的发布内容
|
||||||
getmyWord() {
|
getmyWord() {
|
||||||
|
let data = {
|
||||||
|
'userId': this.userInfo.id,
|
||||||
|
'entryId': this.taskInfo.id
|
||||||
|
}
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/clockin/myinfolist?userid=' + this.userInfo.id + '&taskid=' + this.taskInfo.id +
|
// .post('book/clockin/myinfolist?userid=' + this.userInfo.id + '&taskid=' + this.taskInfo.id +
|
||||||
'&bookid=' + this.bookid)
|
// '&bookid=' + this.bookid)
|
||||||
|
|
||||||
|
.get('book/clockInForum/getChatList', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res, '当天我的打卡内容')
|
console.log(res, '当天我的打卡内容')
|
||||||
if (res.code == 0 && res.productlist.length > 0) {
|
if (res.code == 0 && res.chatList.length > 0) {
|
||||||
var arr = []
|
var arr = []
|
||||||
res.productlist.forEach((item1) => {
|
res.chatList.forEach((item1) => {
|
||||||
var pjstr = ''
|
var pjstr = ''
|
||||||
var imgs = []
|
var imgs = []
|
||||||
imgs = item1.clockinimages.split(',')
|
//imgs = item1.clockinimages.split(',')
|
||||||
pjstr = this.getHtmlComment(item1.content)
|
pjstr = this.getHtmlComment(item1.content)
|
||||||
item1.clockinimages = imgs
|
// item1.clockinimages = imgs
|
||||||
item1.phtml = pjstr
|
item1.phtml = pjstr
|
||||||
arr.push(item1)
|
arr.push(item1)
|
||||||
})
|
})
|
||||||
@@ -422,33 +530,37 @@
|
|||||||
// 获取某天的签到列表信息
|
// 获取某天的签到列表信息
|
||||||
getAllSign(val) {
|
getAllSign(val) {
|
||||||
console.log(val, '-----------')
|
console.log(val, '-----------')
|
||||||
let data = {
|
let param = {
|
||||||
'bookid': this.bookid,
|
'entryId': val.id,
|
||||||
'limit': 5,
|
// 'userId': null,
|
||||||
'page': this.page,
|
'currentPage': this.recordPage,
|
||||||
'taskid': val.id
|
'pageSize': this.recordPageSize,
|
||||||
}
|
// 'taskid': val.id
|
||||||
|
}
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/clockin/applist', data)
|
.get('book/clockInForum/getChatList', param)
|
||||||
|
// .get('book/clockInForum/getChatList', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res, '所有人打卡信息')
|
console.log(res, '所有人打卡信息')
|
||||||
if (res.list.length > 0) {
|
if (res.chatList.length > 0) {
|
||||||
var arr = res.list
|
var arr = res.chatList
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for (var i = 0; i < arr.length; i++) {
|
||||||
var arr1 = []
|
var arr1 = []
|
||||||
var pjstr = ''
|
var pjstr = ''
|
||||||
// console.log(arr[i].content,'arr[i].content')
|
// console.log(arr[i].content,'arr[i].content')
|
||||||
pjstr = this.getHtmlComment(arr[i].content)
|
pjstr = this.getHtmlComment(arr[i].content)
|
||||||
// console.log(pjstr,'pjstr')
|
// console.log(pjstr,'pjstr')
|
||||||
arr1 = arr[i].images.split(',')
|
//arr1 = arr[i].images.split(',')
|
||||||
arr[i].images = arr1
|
// arr[i].images = arr1
|
||||||
arr[i].phtml = pjstr
|
arr[i].phtml = pjstr
|
||||||
// console.log(arr1,'arr1')
|
for (var j = 0; j < arr[i].subCommentList.length; j++) {
|
||||||
|
var subpjstr = ''
|
||||||
|
subpjstr = this.getHtmlComment(arr[i].subCommentList[j].content)
|
||||||
|
arr[i].subCommentList[j].phtml = subpjstr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// console.log(arr,'res.page.list')
|
console.log(arr,'评论处理后的数据结构')
|
||||||
this.commentsList = arr
|
this.commentsList = arr
|
||||||
} else {
|
} else {
|
||||||
this.commentsList = []
|
this.commentsList = []
|
||||||
@@ -462,18 +574,19 @@
|
|||||||
getTask(index) {
|
getTask(index) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
let data = {
|
let data = {
|
||||||
'bookid': this.bookid,
|
'bookId': this.bookid,
|
||||||
'days': index
|
'day': index
|
||||||
}
|
}
|
||||||
console.log(data)
|
console.log(data)
|
||||||
this.linshiDay = index
|
this.linshiDay = index
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/task/applist', data)
|
// .post('book/task/applist', data)
|
||||||
|
.get('book/clockInForum/getPostingInfo', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res, '任务信息')
|
console.log(res, '任务信息')
|
||||||
if (res.page.list.length > 0) {
|
if (res.result != {}) {
|
||||||
this.taskInfo = res.page.list[0]
|
this.taskInfo = res.result
|
||||||
this.taskInfo.video != '' ? this.poster = this.taskInfo.video +
|
this.taskInfo.video != '' ? this.poster = this.taskInfo.video +
|
||||||
"?x-oss-process=video/snapshot,t_0,f_jpg" : ''
|
"?x-oss-process=video/snapshot,t_0,f_jpg" : ''
|
||||||
this.getmyWord()
|
this.getmyWord()
|
||||||
@@ -491,39 +604,37 @@
|
|||||||
},
|
},
|
||||||
// 补卡
|
// 补卡
|
||||||
buSign(day) {
|
buSign(day) {
|
||||||
console.log('正在补卡', this.taskInfo)
|
console.log('正在补卡', this.taskInfo,day)
|
||||||
if (!this.taskInfo.id) {
|
// return false
|
||||||
uni.showToast({
|
// if (!this.taskInfo.id) {
|
||||||
title: '当天未发布打卡任务,不可补卡哦',
|
// uni.showToast({
|
||||||
icon: 'none'
|
// title: '当天未发布打卡任务,不可补卡哦',
|
||||||
})
|
// icon: 'none'
|
||||||
return
|
// })
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
let param = {
|
||||||
|
'bookId': this.bookid,
|
||||||
|
'userId':this.userInfo.id,
|
||||||
|
'day':day
|
||||||
}
|
}
|
||||||
let data = {
|
console.log(param, 'param')
|
||||||
"bookId": this.bookid,
|
this.$http
|
||||||
"userId": this.userInfo.id,
|
.get('/book/userClockIn/correctClockIn', param)
|
||||||
"tid": this.taskInfo.id,
|
.then(res => {
|
||||||
"days": this.linshiDay
|
|
||||||
}
|
|
||||||
console.log(data, 'data')
|
|
||||||
$http.request({
|
|
||||||
url: 'book/clockinPunch/save',
|
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
|
||||||
data,
|
|
||||||
header: { //默认 无 说明:请求头
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
//console.log(res, '快捷签到')
|
//console.log(res, '快捷签到')
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '签到成功'
|
title: '补卡成功'
|
||||||
})
|
})
|
||||||
this.addTextShow = false
|
setTimeout(()=>{
|
||||||
this.formData.content = ''
|
this.addTextShow = false
|
||||||
this.formData.images = []
|
this.formData.content = ''
|
||||||
this.getmySign()
|
this.formData.images = []
|
||||||
this.getAllSign(this.taskInfo)
|
this.getmySign()
|
||||||
|
// this.getAllSign(this.taskInfo)
|
||||||
|
},2000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -541,49 +652,116 @@
|
|||||||
let data = {
|
let data = {
|
||||||
"bookId": this.bookid,
|
"bookId": this.bookid,
|
||||||
"userId": this.userInfo.id,
|
"userId": this.userInfo.id,
|
||||||
"tid": this.taskInfo.id,
|
// "tid": this.taskInfo.id,
|
||||||
"days": this.currentDay
|
// "days": this.currentDay
|
||||||
}
|
}
|
||||||
|
this.$http
|
||||||
|
// .post('book/clockinPunch/clockindays', data)
|
||||||
|
.get('book/userClockIn/clockIn', data)
|
||||||
|
.then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
//console.log(res, '快捷签到')
|
||||||
|
uni.showToast({
|
||||||
|
title: '签到成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.addTextShow = false
|
||||||
|
this.formData.content = ''
|
||||||
|
this.formData.images = []
|
||||||
|
this.getmySign()
|
||||||
|
this.getAllSign(this.taskInfo)
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
// 提交回复评论
|
||||||
|
goToHuiFu(){
|
||||||
|
let myFid = null
|
||||||
|
if(this.opPinglun.fid == 0){
|
||||||
|
myFid = this.opPinglun.id
|
||||||
|
}else if (this.opPinglun.fid != 0){
|
||||||
|
myFid = this.opPinglun.fid
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
// 'bookId': this.bookid,
|
||||||
|
"userId": this.userInfo.id,
|
||||||
|
"entryId": this.taskInfo.id,
|
||||||
|
'fid': myFid,
|
||||||
|
'puserId': this.opPinglun.userId,
|
||||||
|
// "dayId": this.currentDay,
|
||||||
|
"content": this.formData.content,
|
||||||
|
"pchatId": this.opPinglun.id,
|
||||||
|
// "imageList": imgs,
|
||||||
|
}
|
||||||
|
console.log(data, 'data回复提交数据')
|
||||||
|
// url: 'book/clockin/save',
|
||||||
|
// this.$http
|
||||||
|
// .post('book/clockInForum/addChat', data)
|
||||||
$http.request({
|
$http.request({
|
||||||
url: 'book/clockinPunch/save',
|
url: "book/clockInForum/addChat",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
//console.log(res, '快捷签到')
|
this.pinglunShow = false
|
||||||
uni.showToast({
|
this.opPinglun = {}
|
||||||
title: '签到成功',
|
|
||||||
icon: 'success'
|
|
||||||
})
|
|
||||||
this.addTextShow = false
|
|
||||||
this.formData.content = ''
|
this.formData.content = ''
|
||||||
this.formData.images = []
|
this.formData.images = []
|
||||||
this.getmySign()
|
this.formData.imagesStr = []
|
||||||
this.getAllSign(this.taskInfo)
|
uni.showToast({
|
||||||
|
title: '回复成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getmySign()
|
||||||
|
this.getTask(this.currentDay)
|
||||||
|
},2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
// 说点什么
|
// 说点什么
|
||||||
goToSign() {
|
goToSign() {
|
||||||
let data = {
|
// images数据处理
|
||||||
'bookId': this.bookid,
|
if(this.formData.images.length > 0){
|
||||||
"userId": this.userInfo.id,
|
var imgs = []
|
||||||
"taskId": this.taskInfo.id,
|
imgs = this.formData.images.map(item => {
|
||||||
"dayId": this.currentDay,
|
return item.url
|
||||||
"content": this.formData.content,
|
|
||||||
// "images": this.formData.imagesStr.join(),
|
|
||||||
"imageeStrings": this.formData.images,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(this.formData.content == ''){
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入内容',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
// 'bookId': this.bookid,
|
||||||
|
"userId": this.userInfo.id,
|
||||||
|
"entryId": this.taskInfo.id,
|
||||||
|
'fid': 0,
|
||||||
|
'puserId': 0,
|
||||||
|
// "dayId": this.currentDay,
|
||||||
|
"content": this.formData.content,
|
||||||
|
"pchatId": 0,
|
||||||
|
"imageList": imgs,
|
||||||
|
}
|
||||||
console.log(data, 'data')
|
console.log(data, 'data')
|
||||||
|
// url: 'book/clockin/save',
|
||||||
|
// this.$http
|
||||||
|
// .post('book/clockInForum/addChat', data)
|
||||||
$http.request({
|
$http.request({
|
||||||
url: 'book/clockin/save',
|
url: "book/clockInForum/addChat",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -591,16 +769,18 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
//console.log(res, '快捷签到')
|
//console.log(res, '快捷签到')
|
||||||
uni.showToast({
|
|
||||||
title: '发布成功',
|
|
||||||
icon: 'success'
|
|
||||||
})
|
|
||||||
this.addTextShow = false
|
this.addTextShow = false
|
||||||
this.formData.content = ''
|
this.formData.content = ''
|
||||||
this.formData.images = []
|
this.formData.images = []
|
||||||
this.formData.imagesStr = []
|
this.formData.imagesStr = []
|
||||||
this.getmySign()
|
uni.showToast({
|
||||||
this.getTask()
|
title: '发布成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getmySign()
|
||||||
|
this.getTask(this.currentDay)
|
||||||
|
},2000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -731,20 +911,24 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.ql-editor{min-height: 50rpx;}
|
.pingjiaBox{margin-bottom: 20rpx;}
|
||||||
|
.ql-editor {
|
||||||
|
min-height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.ql-container {
|
.ql-container {
|
||||||
width: calc(100% - 30rpx);
|
width: calc(100% - 30rpx);
|
||||||
min-height: 50rpx !important;
|
min-height: 50rpx !important;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pjimgs {
|
.pjimgs {
|
||||||
margin: 10px 0;
|
margin: 10rpx 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
@@ -764,6 +948,7 @@
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
margin: 10rpx 0;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -774,7 +959,7 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.touxiang {
|
.touxiang {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -796,7 +981,20 @@
|
|||||||
margin-top: 6rpx;
|
margin-top: 6rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.subPItem{margin-bottom: 40rpx;}
|
||||||
|
.subPName{padding-left: 10rpx;}
|
||||||
|
.zhuipingTX{
|
||||||
|
width: 100%;
|
||||||
|
image {
|
||||||
|
width: 30px !important;
|
||||||
|
padding: 3px;
|
||||||
|
height: 30px !important;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
.allComments {
|
.allComments {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
@@ -844,6 +1042,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gzicon {
|
||||||
|
width: 10px !important;
|
||||||
|
height: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.scroll-view_H {
|
.scroll-view_H {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin: 8rpx 0;
|
margin: 8rpx 0;
|
||||||
@@ -1145,8 +1348,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.had {
|
.had {
|
||||||
padding: 60rpx;
|
padding: 20rpx;
|
||||||
margin-top: 30rpx;
|
// margin-top: 30rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@@ -1156,7 +1359,7 @@
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
margin-top: 30rpx;
|
margin-top: 10rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #0e0e15;
|
color: #0e0e15;
|
||||||
}
|
}
|
||||||
@@ -1173,7 +1376,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.opBtns {
|
.opBtns {
|
||||||
margin-top: 30rpx;
|
margin-top: 10rpx;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: #b3b3b3;
|
color: #b3b3b3;
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<z-nav-bar title="读书打卡"></z-nav-bar>
|
<z-nav-bar title="读书打卡"></z-nav-bar>
|
||||||
<view class="tip">
|
<view class="" style="padding:40rpx 20rpx;">
|
||||||
<text>请选择要打卡的书籍:</text>
|
<view class="mytabs flexbox">
|
||||||
|
<view :class="['item','item1', contentShow == 1 ? 'active' :'']" @click="setData(1)">
|
||||||
|
已购图书
|
||||||
|
</view>
|
||||||
|
<view :class="['item','item2', contentShow == 2 ? 'active' :'']" @click="setData(2)">
|
||||||
|
推荐图书
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="tip">
|
||||||
|
<text>请选择要打卡的书籍:</text>
|
||||||
|
</view> -->
|
||||||
<view class="listenList" v-if="bookList.length > 0">
|
<view class="listenList" v-if="bookList.length > 0">
|
||||||
<view class="wrap" >
|
<view class="wrap" >
|
||||||
<u-row gutter="16" justify="flex-start">
|
<u-row gutter="16" justify="flex-start">
|
||||||
@@ -36,49 +46,61 @@
|
|||||||
playData:{},
|
playData:{},
|
||||||
bookList:[],
|
bookList:[],
|
||||||
page:1, // 页码
|
page:1, // 页码
|
||||||
|
contentShow: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getfreeBook()
|
this.getfreeBook()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
setData(e) {
|
||||||
|
this.contentShow = e
|
||||||
|
this.getfreeBook()
|
||||||
|
},
|
||||||
// 跳转到打卡页面
|
// 跳转到打卡页面
|
||||||
goToClock(val){
|
goToClock(val){
|
||||||
if(val.clockIn != 1){
|
console.log(val,'val')
|
||||||
uni.showModal({
|
if(this.contentShow == 1){
|
||||||
title: '提示',
|
|
||||||
cancelText: '暂不购买',
|
|
||||||
confirmText:'立即购买',
|
|
||||||
content: '购买后才可参与本书打卡哦~',
|
|
||||||
success: function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
console.log('点击了去购买');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
console.log(val,'val')
|
|
||||||
this.onPageJump('../clock/clock?bookid='+val.id)
|
this.onPageJump('../clock/clock?bookid='+val.id)
|
||||||
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../eBook/bookContent?Id=' + val.id
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取打卡图书
|
// 获取打卡图书
|
||||||
getfreeBook(){
|
getfreeBook(){
|
||||||
this.$http
|
if(this.contentShow == 1){
|
||||||
.post('book/userebookbuy/getUserClockBookList', { // 磊哥新写
|
// this.$http.post('book/clockinPunch/myClockBooks', {
|
||||||
// .post('book/userebookbuy/appbooklist', { 原接口
|
this.$http.post('book/clock/getUserClockBooks', {
|
||||||
'userId': this.userInfo.id,
|
'userId': this.userInfo.id,
|
||||||
})
|
limit: 100,
|
||||||
.then(res => {
|
page:1,
|
||||||
|
}).then(res => {
|
||||||
if(res.code == 0){
|
if(res.code == 0){
|
||||||
//this.ygtotalPage = res.resultlist.totalCount
|
//this.ygtotalPage = res.resultlist.totalCount
|
||||||
this.bookList = res.books
|
this.bookList = res.page.records
|
||||||
console.log(this.bookList,'打卡列表')
|
console.log(this.bookList,'打卡列表')
|
||||||
// this.status = 3
|
// this.status = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
//this.$http.post('book/clockinPunch/getBestClockBooks', {
|
||||||
|
this.$http.post('book/clock/getUserClockBestBooks', {
|
||||||
|
'userId': this.userInfo.id,
|
||||||
|
limit: 100,
|
||||||
|
page:1,
|
||||||
|
}).then(res => {
|
||||||
|
if(res.code == 0){
|
||||||
|
//this.ygtotalPage = res.resultlist.totalCount
|
||||||
|
this.bookList = res.page.records
|
||||||
|
console.log(this.bookList,'打卡列表')
|
||||||
|
// this.status = 3
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url) {
|
onPageJump(url) {
|
||||||
@@ -98,6 +120,33 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
|
|
||||||
|
.mytabs {
|
||||||
|
// background: url('@/static/icon/bgtushu.png') no-repeat left top;
|
||||||
|
height: 80rpx;
|
||||||
|
// margin-bottom: 30rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background-color: #c6ead0;
|
||||||
|
width: 48%;
|
||||||
|
// margin: 0 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #3c7f56;
|
||||||
|
font-size: 36rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item.active {
|
||||||
|
background-color: #3c7f56;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item1 {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.tip{
|
.tip{
|
||||||
padding: 20rpx; background-color: #fff;
|
padding: 20rpx; background-color: #fff;
|
||||||
text{ font-size: 36rpx;}
|
text{ font-size: 36rpx;}
|
||||||
|
|||||||
@@ -18,7 +18,11 @@
|
|||||||
<span class="author">作者:{{productInfo.authorName}}</span>
|
<span class="author">作者:{{productInfo.authorName}}</span>
|
||||||
<!-- <view class="description">{{productInfo.bookdesc}}</view> -->
|
<!-- <view class="description">{{productInfo.bookdesc}}</view> -->
|
||||||
|
|
||||||
<span class="author">听书、读书打卡、立即购买</span>
|
<view class="ting-du-mai">
|
||||||
|
<view class="ting-du-mai-item" @click="toOtherPage(1,productInfo)">听书</view>
|
||||||
|
<view class="ting-du-mai-item" @click="toOtherPage(2,productInfo)">读书打卡</view>
|
||||||
|
<view class="ting-du-mai-item" @click="toOtherPage(3,productInfo)">立即购买</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -29,6 +33,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="mainContent">
|
<view class="mainContent">
|
||||||
<view v-if="shupingList.length > 0">
|
<view v-if="shupingList.length > 0">
|
||||||
|
<view class="flexbox shuping-topbar">
|
||||||
|
<view class="shuping-topbar-tiao">{{shupingNum || 0}}条书评</view>
|
||||||
|
<view class="shuping-topbar-order">
|
||||||
|
<!-- <view v-for="(item,index) in orderTabs" @click="orderTabCLi(item.value)" :key="index"
|
||||||
|
:class="orderListTab==item.value?'orderdefine ordStyle':'orderdefine'">{{item.name}}</view> -->
|
||||||
|
<view :class="orderListTab==1?'orderdefine ordStyle':'orderdefine'" @click="orderTabCLi(1)">按时间</view>
|
||||||
|
<view style="border-left:2rpx solid #e9e9e9;height:36rpx;"></view>
|
||||||
|
<view :class="orderListTab==2?'orderdefine ordStyle':'orderdefine'" @click="orderTabCLi(2)">按热度</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="item" @click.stop="toDetail(item)" v-for="(item,index1) in shupingList" :key="index">
|
<view class="item" @click.stop="toDetail(item)" v-for="(item,index1) in shupingList" :key="index">
|
||||||
<view class="title">{{item.title}}</view>
|
<view class="title">{{item.title}}</view>
|
||||||
<image class="feng" v-if="item.image" :src="item.image" mode="aspectFill"></image>
|
<image class="feng" v-if="item.image" :src="item.image" mode="aspectFill"></image>
|
||||||
@@ -39,14 +53,16 @@
|
|||||||
<view class="btns flexbox" style="margin-top:10rpx;">
|
<view class="btns flexbox" style="margin-top:10rpx;">
|
||||||
<span class="left" style="color: #C0C4CC;">{{formatTimeDifferenceFromT(item.createTime)}}</span>
|
<span class="left" style="color: #C0C4CC;">{{formatTimeDifferenceFromT(item.createTime)}}</span>
|
||||||
<span class="right flexbox opbtns">
|
<span class="right flexbox opbtns">
|
||||||
<image class="gzicon" v-if="item.ilike" src="../../static/icon/gz2.png" mode="aspectFill"></image>
|
<image class="gzicon" v-if="item.ilike" src="../../static/icon/gz2.png" mode="aspectFill" @click.stop="clickLike(item)"></image>
|
||||||
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill"></image>
|
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill" @click.stop="clickLike(item)"></image>
|
||||||
<view style="color: #C0C4CC;">{{item.contlike}}</view>
|
<view style="color: #C0C4CC;">{{item.contlike}}</view>
|
||||||
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill" @click.stop="pinglun(item.id)"></image>
|
<!-- <image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill" @click.stop="pinglun(item.id)"></image>
|
||||||
<view style="color: #C0C4CC;" @click.stop="pinglun(item.id)">{{item.commentNum}}</view>
|
<view style="color: #C0C4CC;" @click.stop="pinglun(item.id)">{{item.commentNum}}</view> -->
|
||||||
|
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill"></image>
|
||||||
|
<view style="color: #C0C4CC;">{{item.commentNum}}</view>
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
<view style="border-bottom:2rpx solid #e9e9e9;height:50rpx;" v-if="index1<shupingList.length-1"></view>
|
<view style="border-bottom:2rpx solid #e9e9e9;height:36rpx;" v-if="index1<shupingList.length-1"></view>
|
||||||
<!-- <image class="feng" v-if="item.image == ''" src="../../static/icon/home_bg.jpg" mode="scaleToFill" style="width: 100%;"></image>
|
<!-- <image class="feng" v-if="item.image == ''" src="../../static/icon/home_bg.jpg" mode="scaleToFill" style="width: 100%;"></image>
|
||||||
<image class="feng" v-else :src="item.image" mode="scaleToFill" style="width: 100%;"></image>
|
<image class="feng" v-else :src="item.image" mode="scaleToFill" style="width: 100%;"></image>
|
||||||
<text class="title">{{item.title}}</text> -->
|
<text class="title">{{item.title}}</text> -->
|
||||||
@@ -126,6 +142,15 @@ import { data } from 'jquery';
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
orderListTab: 1,
|
||||||
|
orderTabs: [{
|
||||||
|
name: '按时间',
|
||||||
|
value: 1
|
||||||
|
}, {
|
||||||
|
name: '按热度',
|
||||||
|
value: 2
|
||||||
|
}],
|
||||||
|
shupingNum: 0,
|
||||||
loadingNow : false,
|
loadingNow : false,
|
||||||
playData:{},
|
playData:{},
|
||||||
isShowEmj: false,
|
isShowEmj: false,
|
||||||
@@ -156,7 +181,7 @@ import { data } from 'jquery';
|
|||||||
|
|
||||||
this.page=1, // 页码
|
this.page=1, // 页码
|
||||||
this.shupingList = []
|
this.shupingList = []
|
||||||
this.getBookCom()
|
this.getBookCom(this.orderListTab)
|
||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
@@ -165,7 +190,7 @@ import { data } from 'jquery';
|
|||||||
this.page++
|
this.page++
|
||||||
console.log('加载',this.page)
|
console.log('加载',this.page)
|
||||||
this.status = 0
|
this.status = 0
|
||||||
this.getBookCom()
|
this.getBookCom(this.orderListTab)
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
this.status = 1
|
this.status = 1
|
||||||
@@ -178,12 +203,55 @@ import { data } from 'jquery';
|
|||||||
console.log(e,'onload')
|
console.log(e,'onload')
|
||||||
this.bookid = e.bookid
|
this.bookid = e.bookid
|
||||||
this.getProDetail(e)
|
this.getProDetail(e)
|
||||||
this.getBookCom()
|
this.getBookCom(this.orderListTab)
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toOtherPage(e,productInfo) {
|
||||||
|
if(e==1){
|
||||||
|
// 跳转到听书
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "../listen/listen?bookid=" + productInfo.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(e==2){
|
||||||
|
// 跳转到读书打卡
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../clock/clock?bookid='+ productInfo.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(e==3){
|
||||||
|
// 跳转到购买
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../bookShop/commodityDetail?id=' + productInfo.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 切换tab状态
|
||||||
|
orderTabCLi(e) {
|
||||||
|
this.orderListTab = e
|
||||||
|
this.page = 1
|
||||||
|
this.shupingList = []
|
||||||
|
this.getBookCom(this.orderListTab)
|
||||||
|
},
|
||||||
|
clickLike(item){
|
||||||
|
this.$http
|
||||||
|
.post("forum/articles/chickForumContlike?forum_id=" + item.id,)
|
||||||
|
.then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title:'点赞成功!',
|
||||||
|
icon:'success'
|
||||||
|
})
|
||||||
|
|
||||||
|
item.contlike++
|
||||||
|
}
|
||||||
|
}).catch((e)=>{
|
||||||
|
console.log(e,'e')
|
||||||
|
})
|
||||||
|
},
|
||||||
formatTimeDifferenceFromT(dateTimeT) {
|
formatTimeDifferenceFromT(dateTimeT) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const t = new Date(dateTimeT);
|
const t = new Date(dateTimeT);
|
||||||
@@ -237,24 +305,26 @@ import { data } from 'jquery';
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获得书评
|
// 获得书评
|
||||||
getBookCom(){
|
getBookCom(flag){
|
||||||
let data = {
|
let data = {
|
||||||
'page': this.page,
|
'page': this.page,
|
||||||
'limit': this.pageSize,
|
'limit': this.pageSize,
|
||||||
'bookid' : this.bookid
|
'bookId' : this.bookid,
|
||||||
|
'order' : flag
|
||||||
}
|
}
|
||||||
console.log(data,'data')
|
console.log(data,'data')
|
||||||
this.$http
|
this.$http
|
||||||
.post('forum/articles/descupdatelist', data)
|
.post('forum/articles/getForumByBook', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res,'获取成功')
|
console.log(res,'获取成功')
|
||||||
this.total = res.page.totalPage
|
this.total = res.page.pages
|
||||||
this.shupingList = this.shupingList.concat(res.page.list)
|
this.shupingNum = res.page.total
|
||||||
|
this.shupingList = this.shupingList.concat(res.page.records)
|
||||||
// console.log(res,'已购买')
|
// console.log(res,'已购买')
|
||||||
this.status = 3
|
this.status = 3
|
||||||
}).catch((e)=>{
|
}).catch((e)=>{
|
||||||
console.log(e,'e')
|
console.log(e,'e')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获得输入的表情数组
|
// 获得输入的表情数组
|
||||||
handleEmj(i) {
|
handleEmj(i) {
|
||||||
@@ -462,18 +532,59 @@ import { data } from 'jquery';
|
|||||||
margin-right: 5rpx;
|
margin-right: 5rpx;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
.shuping-topbar{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.shuping-topbar-tiao{
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #8b8a91;
|
||||||
|
}
|
||||||
|
.shuping-topbar-order{
|
||||||
|
width: 280rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.orderdefine {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 20rpx 0 20rpx 0;
|
||||||
|
// margin: 40rpx 0 15rpx 0;
|
||||||
|
width:230rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordStyle {
|
||||||
|
// border-bottom: 4rpx solid #54a966;
|
||||||
|
// color: #54a966;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91; padding-bottom: 20rpx; padding-top: 20rpx;}
|
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91; padding-bottom: 20rpx; padding-top: 20rpx;}
|
||||||
.bookInfo{
|
.bookInfo{
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding:10px;
|
padding:10px;
|
||||||
border: 1px splid #999;
|
// border: 1px splid #999;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
|
.ting-du-mai{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: 400rpx;
|
||||||
|
.ting-du-mai-item{
|
||||||
|
color: deepskyblue;
|
||||||
|
border: 1px solid deepskyblue;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
padding: 4rpx 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.imageradius{
|
.imageradius{
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
border:1rpx solid #e9e9e9;
|
border:1rpx solid #e9e9e9;
|
||||||
@@ -522,8 +633,20 @@ import { data } from 'jquery';
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
.feng{margin:10rpx 0 0 0;height: 200rpx;width: 200rpx;float:right;border-radius: 20rpx;border:1rpx solid #e9e9e9;}
|
.feng{
|
||||||
.title{font-size: 30rpx; font-weight: 700; color: #000; overflow: hidden;}
|
margin:10rpx 20rpx 0 0;
|
||||||
|
height: 160rpx;
|
||||||
|
width: 140rpx;
|
||||||
|
float:left;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
border:1rpx solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #000;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
.description{
|
.description{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #666;
|
color: #666;
|
||||||
@@ -534,10 +657,10 @@ import { data } from 'jquery';
|
|||||||
-webkit-line-clamp: 5;
|
-webkit-line-clamp: 5;
|
||||||
line-clamp: 5;
|
line-clamp: 5;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 20rpx;
|
||||||
margin-top:5px;
|
margin-top:10rpx;
|
||||||
min-height: 186rpx;
|
height: 172rpx;
|
||||||
}
|
}
|
||||||
// .btns{
|
// .btns{
|
||||||
// font-size: 24rpx;
|
// font-size: 24rpx;
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
</span> -->
|
</span> -->
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="zhengwen" v-html="commentInfo.content"></view>
|
<view class="zhengwen" v-html="commentInfo.content">
|
||||||
|
</view>
|
||||||
<view class="btns flexbox">
|
<view class="btns flexbox">
|
||||||
<span class="left"></span>
|
<span class="left"></span>
|
||||||
<span class="right flexbox opbtns" style="color:#C0C4CC;">
|
<span class="right flexbox opbtns" style="color:#C0C4CC;">
|
||||||
@@ -72,7 +73,7 @@
|
|||||||
<view v-if="plList.length > 0">
|
<view v-if="plList.length > 0">
|
||||||
<view class="pl-item" v-for="item in plList" :key="item.id">
|
<view class="pl-item" v-for="item in plList" :key="item.id">
|
||||||
<view class="plusername">{{item.user.name}}</view>
|
<view class="plusername">{{item.user.name}}</view>
|
||||||
<view class="content" v-html="item.phtml"></view>
|
<view class="content" v-html="item.content"></view>
|
||||||
<!-- <view class="btns flexbox"> -->
|
<!-- <view class="btns flexbox"> -->
|
||||||
<!-- <span class="time">{{formatTimeDifferenceFromT(item.createTime)}}</span> -->
|
<!-- <span class="time">{{formatTimeDifferenceFromT(item.createTime)}}</span> -->
|
||||||
<!-- <span class="flexbox opbtns">
|
<!-- <span class="flexbox opbtns">
|
||||||
@@ -106,6 +107,7 @@
|
|||||||
<!-- <view style="color: #C0C4CC;" @click="pinglun(item1)">{{item1.commentsNum}}</view> -->
|
<!-- <view style="color: #C0C4CC;" @click="pinglun(item1)">{{item1.commentsNum}}</view> -->
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="border-bottom:2rpx solid #e9e9e9;height:20rpx;" v-if="index<item.comments.length-1"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- </view> -->
|
<!-- </view> -->
|
||||||
@@ -258,18 +260,15 @@
|
|||||||
this.status = 3
|
this.status = 3
|
||||||
// 评论格式化
|
// 评论格式化
|
||||||
var newarr = []
|
var newarr = []
|
||||||
plList1.forEach((item1)=>{
|
plList1.forEach((item1)=>{
|
||||||
var pjstr = ''
|
item1.content = this.getHtmlComment(item1.content)
|
||||||
pjstr = this.getHtmlComment(item1.content)
|
if(item1.comments && item1.comments.length>0){
|
||||||
item1.phtml = pjstr
|
item1.comments.forEach((item2)=>{
|
||||||
if(item1.comments && item1.comments.length>0){
|
item2.content = this.getHtmlComment(item2.content)
|
||||||
item1.comments.forEach((item2)=>{
|
})
|
||||||
var pjstr1 = ''
|
}
|
||||||
item2.content = this.getHtmlComment(item2.content)
|
// console.log(pjstr)
|
||||||
})
|
newarr.push(item1)
|
||||||
}
|
|
||||||
// console.log(pjstr)
|
|
||||||
newarr.push(item1)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
this.plList = this.plList.concat(newarr)
|
this.plList = this.plList.concat(newarr)
|
||||||
@@ -508,18 +507,40 @@
|
|||||||
.post("forum/articles/pushMsgToForum", data)
|
.post("forum/articles/pushMsgToForum", data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.code == 0) {
|
uni.showToast({
|
||||||
uni.showToast({
|
title:'评论成功!',
|
||||||
title:'评论成功!',
|
icon:'success'
|
||||||
icon:'success'
|
})
|
||||||
})
|
// this.getCommPL()
|
||||||
// this.getCommPL()
|
this.pingjiaShow = false
|
||||||
this.pingjiaShow = false
|
this.Pform.comment = ''
|
||||||
this.Pform.comment = ''
|
this.Pform.name = ''
|
||||||
this.Pform.name = ''
|
this.Pform.pid = ''
|
||||||
this.Pform.pid = ''
|
this.Pform.puserId = ''
|
||||||
this.Pform.puserId = ''
|
// this.pinglunId = null
|
||||||
// this.pinglunId = null
|
|
||||||
|
// 把回复的评论拼进this.plList回复列表中
|
||||||
|
let comment = res.comment
|
||||||
|
// 第一种情况:1级回复
|
||||||
|
if(comment&&comment.pid == 0){
|
||||||
|
comment.content = this.getHtmlComment(comment.content)
|
||||||
|
console.log('this.userInfo',this.userInfo)
|
||||||
|
comment.user = this.userInfo
|
||||||
|
comment.comments = []
|
||||||
|
this.plList.unshift(comment)
|
||||||
|
}else if(comment&&comment.pid > 0){// 第二种情况:回复第1级回复和回复第2级回复
|
||||||
|
|
||||||
|
for(let i=0;i<this.plList.length;i++){
|
||||||
|
if(this.plList[i].id == comment.pid){
|
||||||
|
|
||||||
|
comment.content = this.getHtmlComment(comment.content)
|
||||||
|
console.log('this.userInfo',this.userInfo)
|
||||||
|
comment.user = this.userInfo
|
||||||
|
comment.puser = this.plList[i].user
|
||||||
|
// comment.comments = []
|
||||||
|
this.plList[i].comments.push(comment)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch((e)=>{
|
}).catch((e)=>{
|
||||||
@@ -569,7 +590,7 @@
|
|||||||
border-bottom: 1px solid #f0f0f0;
|
border-bottom: 1px solid #f0f0f0;
|
||||||
.pl-son{
|
.pl-son{
|
||||||
margin: 14rpx 0 14rpx 60rpx;
|
margin: 14rpx 0 14rpx 60rpx;
|
||||||
padding: 0 0 14rpx 14rpx;
|
padding: 0 14rpx 14rpx 14rpx;
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
.pl-son-item{
|
.pl-son-item{
|
||||||
@@ -626,7 +647,14 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
// .mbtns{padding: 5px; background-color: #f4fff5; border-radius: 10px; font-size: 34rpx; color: #8b8a91; margin:15px 0; justify-content: space-between;}
|
// .mbtns{padding: 5px; background-color: #f4fff5; border-radius: 10px; font-size: 34rpx; color: #8b8a91; margin:15px 0; justify-content: space-between;}
|
||||||
.zhengwen{line-height: 50rpx; font-size: 28rpx;margin-top: 20rpx;}
|
/deep/.zhengwen{
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
img{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
.flexbox{display: flex;}
|
.flexbox{display: flex;}
|
||||||
.container{padding: 10px;}
|
.container{padding: 10px;}
|
||||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
<public-module></public-module>
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<!-- 顶部导航栏 -->
|
<!-- 顶部导航栏 -->
|
||||||
<z-nav-bar title="书评列表"></z-nav-bar>
|
<z-nav-bar title="书评列表"></z-nav-bar>
|
||||||
@@ -83,6 +85,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="commentsListTab == 3">
|
<view v-if="commentsListTab == 3">
|
||||||
|
<view class="" style="padding:40rpx 20rpx;">
|
||||||
|
<view class="mytabs flexbox">
|
||||||
|
<view :class="['item','item1', contentShow == 1 ? 'active' :'']" @click="setData(1)">
|
||||||
|
已购图书
|
||||||
|
</view>
|
||||||
|
<view :class="['item','item2', contentShow == 2 ? 'active' :'']" @click="setData(2)">
|
||||||
|
推荐图书
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view v-if="bookList.length > 0">
|
<view v-if="bookList.length > 0">
|
||||||
<view class="bookInfo3" v-for="(item,index) in bookList" :key="index">
|
<view class="bookInfo3" v-for="(item,index) in bookList" :key="index">
|
||||||
<view class="mainContent3">
|
<view class="mainContent3">
|
||||||
@@ -128,7 +140,7 @@
|
|||||||
import musicPlay from '@/components/music.vue'
|
import musicPlay from '@/components/music.vue'
|
||||||
import { data } from 'jquery';
|
import { data } from 'jquery';
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState, mapMutations
|
||||||
} from 'vuex';
|
} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -173,6 +185,7 @@ import { data } from 'jquery';
|
|||||||
newList:[],
|
newList:[],
|
||||||
hotList:[],
|
hotList:[],
|
||||||
bookList:[],
|
bookList:[],
|
||||||
|
contentShow: 1,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -186,25 +199,30 @@ import { data } from 'jquery';
|
|||||||
this.newList = []
|
this.newList = []
|
||||||
this.hotList = []
|
this.hotList = []
|
||||||
this.bookList = []
|
this.bookList = []
|
||||||
this.getBookList(this.commentsListTab, true)
|
this.getBookList(this.commentsListTab, false)
|
||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.newestpage++
|
this.newestpage++
|
||||||
this.hotestpage++
|
this.hotestpage++
|
||||||
this.booksetpage++
|
this.booksetpage++
|
||||||
this.getBookList(this.commentsListTab, true)
|
this.getBookList(this.commentsListTab, false)
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||||
console.log(e,'onload')
|
console.log(e,'onload')
|
||||||
// this.bookid = e.bookid
|
// this.bookid = e.bookid
|
||||||
this.getBookList(1, true)
|
this.getBookList(1, false)
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations(['setLoadingShow']),
|
||||||
|
setData(e) {
|
||||||
|
this.contentShow = e
|
||||||
|
this.getBookList(this.commentsListTab, true)
|
||||||
|
},
|
||||||
formatTimeDifferenceFromT(dateTimeT) {
|
formatTimeDifferenceFromT(dateTimeT) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const t = new Date(dateTimeT);
|
const t = new Date(dateTimeT);
|
||||||
@@ -243,7 +261,7 @@ import { data } from 'jquery';
|
|||||||
this.newList = []
|
this.newList = []
|
||||||
this.hotList = []
|
this.hotList = []
|
||||||
this.bookList = []
|
this.bookList = []
|
||||||
this.getBookList(this.commentsListTab, true)
|
this.getBookList(this.commentsListTab, false)
|
||||||
},
|
},
|
||||||
// 查看本书更多书评
|
// 查看本书更多书评
|
||||||
toMore(val){
|
toMore(val){
|
||||||
@@ -275,18 +293,27 @@ import { data } from 'jquery';
|
|||||||
console.log(e,'e')
|
console.log(e,'e')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getBookList(flag, clear){
|
getBookList(flag, tushuflag){
|
||||||
// 根据tab不同,获取最新书评、最热书评、书集列表
|
// 根据tab不同,获取最新书评、最热书评、书集列表
|
||||||
uni.showLoading({
|
// uni.showLoading({
|
||||||
title: '加载中'
|
// title: '加载中'
|
||||||
});
|
// });
|
||||||
|
|
||||||
var httpurl = ""
|
var httpurl = ""
|
||||||
if(flag == 1){
|
if(flag == 1){
|
||||||
httpurl = "forum/articles/getForumsNew?page=" + this.newestpage + '&limit=10'
|
httpurl = "forum/articles/getForumsNew?page=" + this.newestpage + '&limit=10'
|
||||||
}else if(flag == 2){
|
}else if(flag == 2){
|
||||||
httpurl = "forum/articles/getForumsHot?page=" + this.hotestpage + '&limit=10'
|
httpurl = "forum/articles/getForumsHot?page=" + this.hotestpage + '&limit=10'
|
||||||
}else{
|
}else{
|
||||||
httpurl = "forum/articles/getForumsAndBook?page=" + this.booksetpage + '&limit=10&userId=' + this.userInfo.id
|
if(tushuflag){ // 点击切换已购和推荐
|
||||||
|
this.booksetpage = 1
|
||||||
|
this.bookList = []
|
||||||
|
}
|
||||||
|
if(this.contentShow == 1){
|
||||||
|
httpurl = "forum/articles/getHasForumsAndBook?page=" + this.booksetpage + '&limit=10&userId=' + this.userInfo.id
|
||||||
|
} else {
|
||||||
|
httpurl = "forum/articles/getBestForumsAndBook?page=" + this.booksetpage + '&limit=10&userId=' + this.userInfo.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$http
|
this.$http
|
||||||
.post(httpurl)
|
.post(httpurl)
|
||||||
@@ -324,12 +351,12 @@ import { data } from 'jquery';
|
|||||||
// console.log(e,'e')
|
// console.log(e,'e')
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
if(res.page.records.size != 10){
|
if(res.page.records.length != 10){
|
||||||
this.status = 1
|
this.status = 1
|
||||||
} else {
|
} else {
|
||||||
this.status = 0
|
this.status = 0
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
// uni.hideLoading();
|
||||||
}).catch((e)=>{
|
}).catch((e)=>{
|
||||||
console.log(e,'e')
|
console.log(e,'e')
|
||||||
})
|
})
|
||||||
@@ -509,7 +536,7 @@ import { data } from 'jquery';
|
|||||||
border:1rpx solid #e9e9e9;
|
border:1rpx solid #e9e9e9;
|
||||||
}
|
}
|
||||||
.title{font-size: 30rpx; font-weight: 700; color: #000; overflow: hidden;}
|
.title{font-size: 30rpx; font-weight: 700; color: #000; overflow: hidden;}
|
||||||
.description{
|
/deep/.description{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #666;
|
color: #666;
|
||||||
text-overflow: -o-ellipsis-lastline;
|
text-overflow: -o-ellipsis-lastline;
|
||||||
@@ -523,6 +550,9 @@ import { data } from 'jquery';
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
margin-top:10rpx;
|
margin-top:10rpx;
|
||||||
height: 172rpx;
|
height: 172rpx;
|
||||||
|
img{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.btns{
|
.btns{
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
@@ -590,7 +620,7 @@ import { data } from 'jquery';
|
|||||||
.shupingList{
|
.shupingList{
|
||||||
min-height: 212rpx;
|
min-height: 212rpx;
|
||||||
}
|
}
|
||||||
.description{
|
/deep/.description{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #666;
|
color: #666;
|
||||||
text-overflow: -o-ellipsis-lastline;
|
text-overflow: -o-ellipsis-lastline;
|
||||||
@@ -603,6 +633,9 @@ import { data } from 'jquery';
|
|||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
margin-top:10rpx;
|
margin-top:10rpx;
|
||||||
|
img{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.btns{
|
.btns{
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
@@ -632,4 +665,30 @@ import { data } from 'jquery';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mytabs {
|
||||||
|
// background: url('@/static/icon/bgtushu.png') no-repeat left top;
|
||||||
|
height: 80rpx;
|
||||||
|
// margin-bottom: 30rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background-color: #c6ead0;
|
||||||
|
width: 48%;
|
||||||
|
// margin: 0 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #3c7f56;
|
||||||
|
font-size: 36rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item.active {
|
||||||
|
background-color: #3c7f56;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item1 {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -194,25 +194,25 @@
|
|||||||
this.freeChapterCount = res.book.freeChapterCount
|
this.freeChapterCount = res.book.freeChapterCount
|
||||||
this.bokMesDet.userId = this.userInfo.id
|
this.bokMesDet.userId = this.userInfo.id
|
||||||
|
|
||||||
if (this.bookMessage.publisherName.indexOf(',') > 0) {
|
// if (this.bookMessage.publisherName.indexOf(',') > 0) {
|
||||||
this.bookMessage.publisherName = this.bookMessage.publisherName.split(',')
|
// this.bookMessage.publisherName = this.bookMessage.publisherName.split(',')
|
||||||
this.bookMessage.publisherId = this.bookMessage.publisherId.split(',')
|
// this.bookMessage.publisherId = this.bookMessage.publisherId.split(',')
|
||||||
this.bookMessage.publisherNIList = []
|
// this.bookMessage.publisherNIList = []
|
||||||
for (let i in this.bookMessage.publisherName) {
|
// for (let i in this.bookMessage.publisherName) {
|
||||||
this.bookMessage.publisherNIList.push({
|
// this.bookMessage.publisherNIList.push({
|
||||||
title: this.bookMessage.publisherName[i]
|
// title: this.bookMessage.publisherName[i]
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
for (let j in this.bookMessage.publisherId) {
|
// for (let j in this.bookMessage.publisherId) {
|
||||||
this.bookMessage.publisherNIList[j].id = this.bookMessage.publisherId[j]
|
// this.bookMessage.publisherNIList[j].id = this.bookMessage.publisherId[j]
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
this.bookMessage.publisherNIList = []
|
// this.bookMessage.publisherNIList = []
|
||||||
this.bookMessage.publisherNIList.push({
|
// this.bookMessage.publisherNIList.push({
|
||||||
'title': this.bookMessage.publisherName,
|
// 'title': this.bookMessage.publisherName,
|
||||||
'id': this.bookMessage.publisherId
|
// 'id': this.bookMessage.publisherId
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取电子目录
|
// 获取电子目录
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<view class="">
|
<view class="">
|
||||||
<image src="../../static/icon/home3.png" mode="aspectFit"></image>
|
<image src="../../static/icon/home3.png" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="v1"><text>评 书</text></view>
|
<view class="v1"><text>书 评</text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item " >
|
<view class="item " >
|
||||||
<!-- <u-icon name="chat" color="#fcbd71" size="24"></u-icon> -->
|
<!-- <u-icon name="chat" color="#fcbd71" size="24"></u-icon> -->
|
||||||
@@ -390,7 +390,7 @@
|
|||||||
.btns{ margin-left: 20rpx; width: calc(100% - 200rpx); box-sizing: border-box; font-size: 34rpx; justify-content: space-between;
|
.btns{ margin-left: 20rpx; width: calc(100% - 200rpx); box-sizing: border-box; font-size: 34rpx; justify-content: space-between;
|
||||||
.item{ margin-bottom:30rpx; width: 20%; text-align: center;
|
.item{ margin-bottom:30rpx; width: 20%; text-align: center;
|
||||||
image{
|
image{
|
||||||
display: block; margin-right: 10rpx; height: 112rpx;
|
display: block; height: 108rpx;
|
||||||
}
|
}
|
||||||
.v1{margin-top: -30rpx;}
|
.v1{margin-top: -30rpx;}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,14 @@
|
|||||||
<public-module></public-module>
|
<public-module></public-module>
|
||||||
<z-nav-bar title="我的听书"></z-nav-bar>
|
<z-nav-bar title="我的听书"></z-nav-bar>
|
||||||
<view class="home_bg">
|
<view class="home_bg">
|
||||||
<image src="../../static/icon/home_icon_1.png" mode="aspectFit" class="icon_hua_1"></image>
|
<view class="icon_hua_1">
|
||||||
<view v-if="showEbook" class="search_box" @click="onPageJump('./searchFor')">
|
<image src="../../static/icon/home_icon_1.png" mode="aspectFit" ></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view v-if="showEbook" class="search_box" @click="onPageJump('./searchFor')">
|
||||||
<text class="icon_search"></text>
|
<text class="icon_search"></text>
|
||||||
<text class="prompt">搜索...</text>
|
<text class="prompt">搜索...</text>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="contentButton">
|
<!-- <view class="contentButton">
|
||||||
<u-tabs :scrollable="false" bg-color="#d4d4d4" active-color="#2979ff" inactive-color="#606266"
|
<u-tabs :scrollable="false" bg-color="#d4d4d4" active-color="#2979ff" inactive-color="#606266"
|
||||||
@@ -105,7 +108,7 @@
|
|||||||
ygtotalPage: 1,
|
ygtotalPage: 1,
|
||||||
tjPage: 1,
|
tjPage: 1,
|
||||||
tjTotalPage: 1,
|
tjTotalPage: 1,
|
||||||
tjPageSize:9,
|
tjPageSize:12,
|
||||||
tjBookLIst: [],
|
tjBookLIst: [],
|
||||||
// contentButtonList: [{
|
// contentButtonList: [{
|
||||||
// name: '已购图书'
|
// name: '已购图书'
|
||||||
@@ -147,7 +150,6 @@
|
|||||||
// console.log('加载',this.page)
|
// console.log('加载',this.page)
|
||||||
this.freeStatus = 0
|
this.freeStatus = 0
|
||||||
this.getfreeBook()
|
this.getfreeBook()
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
this.freeStatus = 1
|
this.freeStatus = 1
|
||||||
console.log('加载完成了', this.freeStatus)
|
console.log('加载完成了', this.freeStatus)
|
||||||
@@ -481,13 +483,17 @@
|
|||||||
background-position: center center;
|
background-position: center center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
padding: 100rpx 0 40rpx 0;
|
// padding: 100rpx 0 40rpx 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.icon_hua_1 {
|
.icon_hua_1 {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
height: 150rpx;
|
padding: 40rpx 0;
|
||||||
|
image{
|
||||||
|
width: 150rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.search_box {
|
.search_box {
|
||||||
|
|||||||
@@ -16,11 +16,16 @@
|
|||||||
<image @click="makeTel" src="../../static/icon/tel.png" mode="" style="height: 46rpx; width: 46rpx; margin-bottom: -10rpx; display: inline-block; "></image>
|
<image @click="makeTel" src="../../static/icon/tel.png" mode="" style="height: 46rpx; width: 46rpx; margin-bottom: -10rpx; display: inline-block; "></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="prof">
|
<view class="prof">
|
||||||
<p>一款线上电子书APP,包含医学类、国学类、文学类、中医古籍等各种类型。3D仿真翻页、护眼模式等阅读技术,打造舒适阅读体验。图文混排,AI人声读书听书。部分电子书也有对应的纸质书,给予用户更多的阅读选择。</p>
|
<p>一款线上电子书APP,包含医学类、国学类、文学类、中医古籍等各种类型。3D仿真翻页、护眼模式等阅读技术,打造舒适阅读体验。图文混排,AI人声读书听书。部分电子书也有对应的纸质书,给予用户更多的阅读选择。</p>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="" style="text-align: center;">
|
||||||
|
<!-- https://main.nuttyreading.com/privacy.html -->
|
||||||
|
<!-- <text @click="seeDetail('')" style="color: #007aff; font-size: 26rpx;">隐私政策</text> -->
|
||||||
|
<uni-link href="https://main.nuttyreading.com/privacy.html" text="隐私政策"></uni-link>
|
||||||
|
<!-- <uni-link href="https://uniapp.dcloud.io/" text="https://uniapp.dcloud.io/"></uni-link> -->
|
||||||
|
</view>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -366,7 +366,8 @@
|
|||||||
},
|
},
|
||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setUserInfo']),
|
...mapMutations(['setUserInfo']),
|
||||||
|
// ...mapMutations(['setLoadingShow']),
|
||||||
// 获取商品标签
|
// 获取商品标签
|
||||||
getTags() {
|
getTags() {
|
||||||
this.loadingNow = false
|
this.loadingNow = false
|
||||||
@@ -408,9 +409,9 @@
|
|||||||
}else{
|
}else{
|
||||||
this.tjProList = []
|
this.tjProList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log(e,'e')
|
console.log(e,'标签检索报错')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取折扣图书
|
// 获取折扣图书
|
||||||
@@ -422,8 +423,7 @@
|
|||||||
if(res.code == 0 && res.page.list.length > 0){
|
if(res.code == 0 && res.page.list.length > 0){
|
||||||
this.offSaleList = res.page.list
|
this.offSaleList = res.page.list
|
||||||
this.tabsNumber = 0
|
this.tabsNumber = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log(e,'e')
|
console.log(e,'e')
|
||||||
@@ -439,6 +439,8 @@
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res,'xinshu')
|
console.log(res,'xinshu')
|
||||||
this.newBookList = res.page.list
|
this.newBookList = res.page.list
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e,'新书上市报错')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 检测未完成订单
|
// 检测未完成订单
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<text class="name" v-if="userMes.nickname!=null">{{userMes.nickname}}</text>
|
<text class="name" v-if="userMes.nickname!=null">{{userMes.nickname}}</text>
|
||||||
<text class="name" v-if="userMes.nickname==null">未设置</text>
|
<text class="name" v-if="userMes.nickname==null">未设置</text>
|
||||||
<image v-if="userMes.vip==1" src="../../static/icon/mine_v.png" alt="" class="per_user_img"></image>
|
<!-- <image v-if="userMes.vip==1" src="../../static/icon/mine_v.png" alt="" class="per_user_img"></image> -->
|
||||||
<text style="margin-left: 20rpx;font-size: 22rpx;color: #888;">({{userMes.tel}})</text>
|
<text style="margin-left: 20rpx;font-size: 22rpx;color: #888;">({{userMes.tel}})</text>
|
||||||
|
|
||||||
<!-- <text class="tong">累计读书5本
|
<!-- <text class="tong">累计读书5本
|
||||||
@@ -58,9 +58,9 @@
|
|||||||
<view class="nav_list" @click="switchTab('../bookShop/orderList')">
|
<view class="nav_list" @click="switchTab('../bookShop/orderList')">
|
||||||
<text>我的订单</text>
|
<text>我的订单</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="nav_list" @click="onPageJump('../clock/clockList')">
|
<!-- <view class="nav_list" @click="onPageJump('../clock/clockList')">
|
||||||
<text>我的打卡</text>
|
<text>我的打卡</text>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="nav_list" @click="onPageJump('../listen/home')">
|
<view class="nav_list" @click="onPageJump('../listen/home')">
|
||||||
<text>我的听书</text>
|
<text>我的听书</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<!-- <view class="nav_list" @click="onGoing()">
|
<!-- <view class="nav_list" @click="onGoing()">
|
||||||
<text>帮助与反馈11111</text>
|
<text>帮助与反馈11111</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="nav_list" @click="newOnShare">
|
<view class="nav_list" @click="newOnShare" v-if="isAndorid">
|
||||||
<text>分享App</text>
|
<text>分享App</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
|
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
|
||||||
@@ -131,13 +131,15 @@
|
|||||||
userMes: {},
|
userMes: {},
|
||||||
signShow: false,
|
signShow: false,
|
||||||
signContent: '是否要退出登录?',
|
signContent: '是否要退出登录?',
|
||||||
playData:{}
|
playData:{},
|
||||||
|
isAndorid:true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//第一次加载
|
//第一次加载
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
|
this.getOS()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo'])
|
...mapState(['userInfo'])
|
||||||
@@ -153,6 +155,17 @@
|
|||||||
},
|
},
|
||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获得操作系统
|
||||||
|
getOS(){
|
||||||
|
let oprateOs = ''
|
||||||
|
oprateOs = uni.getSystemInfoSync().platform
|
||||||
|
// console.log(oprateOs)
|
||||||
|
if(oprateOs == 'android'){
|
||||||
|
this.isAndorid = true
|
||||||
|
}else{
|
||||||
|
this.isAndorid = false
|
||||||
|
}
|
||||||
|
},
|
||||||
haveSelected(data){
|
haveSelected(data){
|
||||||
console.log(data,' 选择的是')
|
console.log(data,' 选择的是')
|
||||||
if(data.index == 0){
|
if(data.index == 0){
|
||||||
@@ -216,32 +229,7 @@
|
|||||||
// 新写分享
|
// 新写分享
|
||||||
newOnShare(){
|
newOnShare(){
|
||||||
this.$refs.share.open()
|
this.$refs.share.open()
|
||||||
},
|
},
|
||||||
//分享app
|
|
||||||
// onShare(){
|
|
||||||
// let shareData = {
|
|
||||||
// shareUrl:"https://www.nuttyreading.com/nuttyreading.apk",
|
|
||||||
// shareTitle:"疯子读书",
|
|
||||||
// type:'0',
|
|
||||||
// summary:'疯子读书,请使用浏览器打开本链接,自动下载安装包', // 分享内容的摘要
|
|
||||||
// shareContent:"疯子读书,请使用浏览器打开本链接,自动下载安装包",
|
|
||||||
// shareImg:"static/fengziIcon.jpg",
|
|
||||||
// appId : "wx47134a8f15083734", // 默认不传type的时候,必须传appId和appPath才会显示小程序图标
|
|
||||||
// appPath : "https://www.nuttyreading.com/nuttyreading.apk",
|
|
||||||
// appWebUrl : "https://www.nuttyreading.com/nuttyreading.apk",
|
|
||||||
// };
|
|
||||||
// // 调用
|
|
||||||
// let shareObj = appShare(shareData,res => {
|
|
||||||
// console.log("疯子读书",res);
|
|
||||||
// // 分享成功后关闭弹窗
|
|
||||||
// // 第一种关闭弹窗的方式
|
|
||||||
// closeShare();
|
|
||||||
// });
|
|
||||||
// setTimeout(() => {
|
|
||||||
// // 第二种关闭弹窗的方式
|
|
||||||
// shareObj.close();
|
|
||||||
// },5000);
|
|
||||||
// },
|
|
||||||
|
|
||||||
// 注销账户
|
// 注销账户
|
||||||
logout(){
|
logout(){
|
||||||
|
|||||||
@@ -288,7 +288,7 @@
|
|||||||
orderType: "vip", //订单类型
|
orderType: "vip", //订单类型
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/rechargeSave",
|
url: "book/buyOrder/rechargeSave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
|
|||||||
@@ -401,7 +401,7 @@
|
|||||||
productId: that.stepsCj.priceTypeId // 充值的类型id
|
productId: that.stepsCj.priceTypeId // 充值的类型id
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/rechargeSave",
|
url: "book/buyOrder/rechargeSave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头1
|
header: { //默认 无 说明:请求头1
|
||||||
|
|||||||
@@ -359,7 +359,7 @@
|
|||||||
orderType: "point", //订单类型
|
orderType: "point", //订单类型
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/rechargeSave",
|
url: "book/buyOrder/rechargeSave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头1
|
header: { //默认 无 说明:请求头1
|
||||||
|
|||||||
@@ -23,21 +23,25 @@
|
|||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="sear_list" v-if="this.show==1">
|
<view class="sear_list" v-if="this.show==1">
|
||||||
<view class="bl_tioa" v-for="(item,index) in bookList" @click="onBookJump(item)">
|
|
||||||
<image :src="item.productImages"></image>
|
<view class="flexbox" style="display: flex; flex-wrap: wrap; justify-content: space-evenly;">
|
||||||
<view>
|
<view class="bl_tioa" v-for="(item,index) in bookList" @click="onBookJump(item)">
|
||||||
<text class="bok_name">{{item.productName}}</text>
|
<image :src="item.productImages"></image>
|
||||||
|
<view>
|
||||||
|
<text class="bok_name">{{item.productName}}</text>
|
||||||
|
</view>
|
||||||
|
<!-- <view>
|
||||||
|
<text>作者:<text style="color: #333;">{{item.authorName}}</text></text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text>出版商:<text style="color: #333;">{{item.publisherName}}</text></text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text style="line-height: 20rpx;">{{item.title}}</text>
|
||||||
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- <view>
|
|
||||||
<text>作者:<text style="color: #333;">{{item.authorName}}</text></text>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<text>出版商:<text style="color: #333;">{{item.publisherName}}</text></text>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<text style="line-height: 20rpx;">{{item.title}}</text>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="height: 1px;"></view>
|
<view style="height: 1px;"></view>
|
||||||
<view>
|
<view>
|
||||||
<view v-if="status==0" style="text-align: center;">
|
<view v-if="status==0" style="text-align: center;">
|
||||||
@@ -49,13 +53,14 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="this.show==1&&this.bookList==''">
|
|
||||||
<u-divider text="暂无数据"></u-divider>
|
|
||||||
</view>
|
|
||||||
<view style="padding-bottom: 20rpx;">
|
<view style="padding-bottom: 20rpx;">
|
||||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="this.show==1&&this.bookList==''">
|
||||||
|
<u-divider text="暂无数据"></u-divider>
|
||||||
|
</view>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -285,8 +290,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sear_list {
|
.sear_list {
|
||||||
margin: 50rpx 30rpx 0 30rpx; display: flex; flex-wrap: wrap; justify-content: space-between;
|
margin: 50rpx 30rpx 0 30rpx;
|
||||||
|
// justify-content: space-between;
|
||||||
|
|
||||||
.bl_tioa {
|
.bl_tioa {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
|
|||||||
@@ -4,9 +4,19 @@
|
|||||||
<!-- 顶部导航栏 -->
|
<!-- 顶部导航栏 -->
|
||||||
<z-nav-bar title="讲书"></z-nav-bar>
|
<z-nav-bar title="讲书"></z-nav-bar>
|
||||||
</view>
|
</view>
|
||||||
<view class="tip">
|
<view class="" style="padding:40rpx 20rpx;">
|
||||||
<text>请选择要查看的书籍:</text>
|
<view class="mytabs flexbox">
|
||||||
|
<view :class="['item','item1', contentShow == 1 ? 'active' :'']" @click="setData(1)">
|
||||||
|
已购图书
|
||||||
|
</view>
|
||||||
|
<view :class="['item','item2', contentShow == 2 ? 'active' :'']" @click="setData(2)">
|
||||||
|
推荐图书
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="tip">
|
||||||
|
<text>请选择要查看的书籍:</text>
|
||||||
|
</view> -->
|
||||||
<view class="mainContainer">
|
<view class="mainContainer">
|
||||||
<view class="item" v-if="bookList.length > 0">
|
<view class="item" v-if="bookList.length > 0">
|
||||||
<u-row gutter="16" justify="flex-start" >
|
<u-row gutter="16" justify="flex-start" >
|
||||||
@@ -33,7 +43,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 评价对话框 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
<public-module></public-module>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -62,6 +73,7 @@ import { data } from 'jquery';
|
|||||||
status:3,
|
status:3,
|
||||||
shupingList:[],
|
shupingList:[],
|
||||||
bfaid:null,
|
bfaid:null,
|
||||||
|
contentShow: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
@@ -93,11 +105,24 @@ import { data } from 'jquery';
|
|||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
setData(e) {
|
||||||
|
this.contentShow = e
|
||||||
|
this.getBooks()
|
||||||
|
},
|
||||||
getBooks(){
|
getBooks(){
|
||||||
this.$http
|
if(this.contentShow == 1){
|
||||||
.post('book/teach/getTeachBooks',{
|
|
||||||
'limit': 100,
|
$http.request({
|
||||||
'page': this.page
|
url: "book/teach/getUserTeachBooks",
|
||||||
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
|
data: {
|
||||||
|
id: this.userInfo.id,
|
||||||
|
'limit': 100,
|
||||||
|
'page': this.page
|
||||||
|
},
|
||||||
|
header: { //默认 无 说明:请求头
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res,'讲书列表')
|
console.log(res,'讲书列表')
|
||||||
@@ -114,6 +139,42 @@ import { data } from 'jquery';
|
|||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log(e,'e')
|
console.log(e,'e')
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
$http.request({
|
||||||
|
url: "book/teach/getUserBestTeachBooks",
|
||||||
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
|
data: {
|
||||||
|
id: this.userInfo.id,
|
||||||
|
'limit': 100,
|
||||||
|
'page': this.page
|
||||||
|
},
|
||||||
|
header: { //默认 无 说明:请求头
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// this.$http
|
||||||
|
// .post('book/teach/getUserBestTeachBooks',{
|
||||||
|
// id: this.userInfo.id,
|
||||||
|
// 'limit': 100,
|
||||||
|
// 'page': this.page
|
||||||
|
// })
|
||||||
|
.then(res => {
|
||||||
|
console.log(res,'讲书列表')
|
||||||
|
if(res.code == 0 && res.page.records.length > 0){
|
||||||
|
this.bookList = res.page.records
|
||||||
|
this.totalPage = res.page.pages
|
||||||
|
this.status = 3
|
||||||
|
console.log(this.bookList,'this.bookList')
|
||||||
|
}else{
|
||||||
|
this.bookList = []
|
||||||
|
this.totalPage = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e,'e')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 书评详情
|
// 书评详情
|
||||||
toDetail(val){
|
toDetail(val){
|
||||||
@@ -133,6 +194,31 @@ import { data } from 'jquery';
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.mytabs {
|
||||||
|
// background: url('@/static/icon/bgtushu.png') no-repeat left top;
|
||||||
|
height: 80rpx;
|
||||||
|
// margin-bottom: 30rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background-color: #c6ead0;
|
||||||
|
width: 48%;
|
||||||
|
// margin: 0 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #3c7f56;
|
||||||
|
font-size: 36rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item.active {
|
||||||
|
background-color: #3c7f56;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item1 {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.tip{
|
.tip{
|
||||||
padding: 20rpx; background-color: #fff;
|
padding: 20rpx; background-color: #fff;
|
||||||
text{ font-size: 36rpx;}
|
text{ font-size: 36rpx;}
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
<view class="mainContent">
|
<view class="mainContent">
|
||||||
<view class="title">{{talkBookDetail.title}}</view>
|
<view class="title">{{talkBookDetail.title}}</view>
|
||||||
<view class="voices" v-if="talkBookDetail.voices != '' && audioShow">
|
<view class="voices" v-if="talkBookDetail.voices != '' && audioShow">
|
||||||
<audio style="text-align: left" :src="talkBookDetail.voices" poster="../../static/icon/fengziIcon.jpg"
|
<audio style="text-align: left; overflow: hidden;" :src="talkBookDetail.voices"
|
||||||
:name="talkBookDetail.title" :author="bookInfo.author.authorName" :action="audioAction" controls></audio>
|
poster="../../static/icon/home_icon_0.png" :name="talkBookDetail.title"
|
||||||
</view>
|
:author="bookInfo.author.authorName" :action="audioAction" controls></audio>
|
||||||
|
</view>
|
||||||
<view class="content" v-if="talkBookDetail.content != ''" v-html="talkBookDetail.content"></view>
|
<view class="content" v-if="talkBookDetail.content != ''" v-html="talkBookDetail.content"></view>
|
||||||
<view class="content" v-else></view>
|
<view class="content" v-else></view>
|
||||||
<view class="time">
|
<view class="time">
|
||||||
@@ -14,14 +15,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="tuijin" v-if="!isBuy && bookInfo.productId != null">
|
<view class="tuijin" v-if="!isBuy && bookInfo.productId != null">
|
||||||
<p>觉得这本书还不错?</p>
|
<p>觉得这本书还不错?</p>
|
||||||
<view class="flexbox" style="justify-content: space-between; border: 1px solid #55aa7f; padding: 10rpx; border-radius: 10rpx;">
|
<view class="flexbox"
|
||||||
|
style="justify-content: space-between; border: 1px solid #55aa7f; padding: 10rpx; border-radius: 10rpx;">
|
||||||
<view class="flexbox">
|
<view class="flexbox">
|
||||||
<view class="img">
|
<view class="img">
|
||||||
<image v-if="bookInfo.images != ''" :src="bookInfo.images" mode="aspectFit"></image>
|
<image v-if="bookInfo.images != ''" :src="bookInfo.images" mode="aspectFit"></image>
|
||||||
<image v-else src="../../static/icon/wufeng.jpg" mode="aspectFit"></image>
|
<image v-else src="../../static/icon/wufeng.jpg" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text style=" display: inline-block; margin-top: 40rpx;">{{bookInfo.name}}</text><br/>
|
<text style=" display: inline-block; margin-top: 40rpx;">{{bookInfo.name}}</text><br />
|
||||||
<text>作者:{{bookInfo.author.authorName}}</text>
|
<text>作者:{{bookInfo.author.authorName}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -36,6 +38,8 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
<public-module></public-module>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -52,20 +56,22 @@
|
|||||||
method: 'pause'
|
method: 'pause'
|
||||||
},
|
},
|
||||||
audioShow: false,
|
audioShow: false,
|
||||||
voicesImg:'',
|
voicesImg: '',
|
||||||
isBuy: false,
|
isBuy: false,
|
||||||
playData: {},
|
playData: {},
|
||||||
teachId: null, // 讲书id
|
teachId: null, // 讲书id
|
||||||
bookId: null, // 书籍id
|
bookId: null, // 书籍id
|
||||||
bookInfo: {
|
bookInfo: {
|
||||||
author:{
|
author: {
|
||||||
authorName:''
|
authorName: ''
|
||||||
}
|
}
|
||||||
}, // 书籍信息
|
}, // 书籍信息
|
||||||
talkBookDetail: {},
|
talkBookDetail: {},
|
||||||
|
windowWidth: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||||
console.log(e, 'onLoad')
|
console.log(e, 'onLoad')
|
||||||
this.bookId = e.bookId
|
this.bookId = e.bookId
|
||||||
this.teachId = e.teachId
|
this.teachId = e.teachId
|
||||||
@@ -80,14 +86,14 @@
|
|||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setUserInfo']),
|
...mapMutations(['setUserInfo']),
|
||||||
// 购买
|
// 购买
|
||||||
gotoBuy(){
|
gotoBuy() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../bookShop/commodityDetail?id=' + this.bookInfo.productId
|
url: '../bookShop/commodityDetail?id=' + this.bookInfo.productId
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getBookInfo() {
|
getBookInfo() {
|
||||||
// 获取书本基本信息
|
// 获取书本基本信息
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/book/getBookInfo', {
|
.post('book/book/getBookInfo', {
|
||||||
'bookId': this.bookId,
|
'bookId': this.bookId,
|
||||||
'userId': this.userInfo.id
|
'userId': this.userInfo.id
|
||||||
@@ -96,18 +102,18 @@
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res, 'res')
|
console.log(res, 'res')
|
||||||
this.bookInfo = res.book
|
this.bookInfo = res.book
|
||||||
|
|
||||||
if(!this.bookInfo.author || this.bookInfo.author == null){
|
if (!this.bookInfo.author || this.bookInfo.author == null) {
|
||||||
this.bookInfo.author = {
|
this.bookInfo.author = {
|
||||||
'authorName' : '未知'
|
'authorName': '未知'
|
||||||
}
|
}
|
||||||
console.log(this.bookInfo.author.authorName,'this.bookInfo.author.authorName')
|
console.log(this.bookInfo.author.authorName, 'this.bookInfo.author.authorName')
|
||||||
}
|
}
|
||||||
//console.log(this.bookInfo.author.authorName,'this.bookInfo.author.authorName')
|
//console.log(this.bookInfo.author.authorName,'this.bookInfo.author.authorName')
|
||||||
this.voicesImg = res.book.images
|
this.voicesImg = res.book.images
|
||||||
// this.bookInfo.name = res.book.name
|
// this.bookInfo.name = res.book.name
|
||||||
this.isBuy = res.book.isBuy
|
this.isBuy = res.book.isBuy
|
||||||
console.log(this.voicesImg,'this.voicesImg')
|
console.log(this.voicesImg, 'this.voicesImg')
|
||||||
// this.freeChapterCount = res.book.freeChapterCount
|
// this.freeChapterCount = res.book.freeChapterCount
|
||||||
} else {
|
} else {
|
||||||
console.log(res.msg)
|
console.log(res.msg)
|
||||||
@@ -128,7 +134,7 @@
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res, 'res')
|
console.log(res, 'res')
|
||||||
this.talkBookDetail = res.bookTeach
|
this.talkBookDetail = res.bookTeach
|
||||||
|
|
||||||
// this.isBuy = res.book.isBuy
|
// this.isBuy = res.book.isBuy
|
||||||
// this.freeChapterCount = res.book.freeChapterCount
|
// this.freeChapterCount = res.book.freeChapterCount
|
||||||
} else {
|
} else {
|
||||||
@@ -163,27 +169,38 @@
|
|||||||
.voices {
|
.voices {
|
||||||
margin: 10rpx auto;
|
margin: 10rpx auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .uni-audio-name {
|
||||||
|
// white-space: wrap !important;
|
||||||
|
width: 340rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #55aa7f;
|
color: #55aa7f;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 10px;
|
margin: 40rpx 0;
|
||||||
}
|
}
|
||||||
.time{
|
|
||||||
text-align: right; font-size: 24rpx; margin-top: 20rpx; color: #999;
|
.time {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
font-size: 28rpx; text-align:justify;
|
font-size: 28rpx;
|
||||||
|
text-align: justify;
|
||||||
color: #666;
|
color: #666;
|
||||||
line-height: 48rpx;
|
line-height: 48rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tuijin {
|
.tuijin {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
@@ -198,15 +215,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 28rpx; margin-bottom: 20rpx;
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
color: #55aa7f;
|
color: #55aa7f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.btn{ margin-right: 20rpx;
|
|
||||||
text{ display: inline-block; margin-top:52rpx; font-size: 30rpx;
|
.btn {
|
||||||
padding: 5px 8px;
|
margin-right: 20rpx;
|
||||||
background: #55aa7f; color: #fff;
|
|
||||||
border-radius: 5px;
|
text {
|
||||||
}}
|
display: inline-block;
|
||||||
|
margin-top: 52rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
padding: 5px 8px;
|
||||||
|
background: #55aa7f;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// .opbtn{font-size: 14rpx;}
|
// .opbtn{font-size: 14rpx;}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--父组件-->
|
<!--父组件-->
|
||||||
|
|
||||||
<view class="container" style="padding-bottom: 10rpx;">
|
<view class="container" style="padding-bottom: 10rpx;">
|
||||||
<!-- <view class="mini"></view> -->
|
<!-- <view class="mini"></view> -->
|
||||||
<view>
|
<view>
|
||||||
@@ -70,6 +70,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<u-divider v-else text="暂无讲书目录"></u-divider>
|
<u-divider v-else text="暂无讲书目录"></u-divider>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
<public-module></public-module>
|
||||||
<!-- <z-navigation></z-navigation> -->
|
<!-- <z-navigation></z-navigation> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -267,10 +267,10 @@
|
|||||||
addconfirm(e) { //点击确定按钮
|
addconfirm(e) { //点击确定按钮
|
||||||
this.addressChanged = true
|
this.addressChanged = true
|
||||||
this.addreShow = false;
|
this.addreShow = false;
|
||||||
this.addressForm.areaidpathtext = e.value[0].UName + ' ' + e.value[1].UName + ' ' + e.value[2].UName
|
this.addressForm.areaidpathtext = e.value[0].UName + '-' + e.value[1].UName + '-' + e.value[2].UName
|
||||||
this.provId = e.value[0].provId
|
this.provId = e.value[0].provId
|
||||||
this.cityId = e.value[1].cityId
|
this.cityId = e.value[1].cityId
|
||||||
this.countyId = e.value[2].countyId
|
this.countyId = e.value[2].regionCode
|
||||||
},
|
},
|
||||||
|
|
||||||
addcancel() { //点击取消按钮
|
addcancel() { //点击取消按钮
|
||||||
@@ -284,9 +284,9 @@
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
let link_add = ''
|
let link_add = ''
|
||||||
if (!this.isShowDel) {
|
if (!this.isShowDel) {
|
||||||
link_add = 'book/useraddress/save'
|
link_add = 'book/userAddress/save'
|
||||||
} else {
|
} else {
|
||||||
link_add = 'book/useraddress/update'
|
link_add = 'book/userAddress/update'
|
||||||
// this.addconfirm(e)
|
// this.addconfirm(e)
|
||||||
}
|
}
|
||||||
if (this.addressForm.areaidpath == '') {
|
if (this.addressForm.areaidpath == '') {
|
||||||
@@ -296,15 +296,30 @@
|
|||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.addressForm.userid = this.userInfo.id
|
// this.addressForm.userId = this.userInfo.id
|
||||||
if(this.addressChanged){ // 如果修改过地址区域,就重新赋值,否则保持不变
|
// this.addressForm.consigneePhone = this.addressForm.userphone
|
||||||
this.addressForm.areaidpath = `${this.provId}_${this.cityId}_${this.countyId}`
|
// this.addressForm.consigneeName = this.addressForm.username
|
||||||
this.addressChanged = false
|
// this.addressForm.regionCode = ''
|
||||||
}
|
|
||||||
this.addressForm.areaid = this.countyId
|
// // this.addressForm.userid = this.userInfo.id
|
||||||
this.addressForm.isdefault = this.addressForm.isDafault ? 1 : 0
|
// if(this.addressChanged){ // 如果修改过地址区域,就重新赋值,否则保持不变
|
||||||
|
// this.addressForm.areaidpath = `${this.provId}_${this.cityId}_${this.countyId}`
|
||||||
|
// this.addressChanged = false
|
||||||
|
// }
|
||||||
|
// this.addressForm.areaid = this.countyId
|
||||||
|
// this.addressForm.isDefault = this.addressForm.isDafault ? 1 : 0
|
||||||
|
|
||||||
let data = this.addressForm
|
// let data = this.addressForm
|
||||||
|
let data = {
|
||||||
|
'id':this.addressForm.addressid,
|
||||||
|
'detailAddress' : this.addressForm.useraddress,
|
||||||
|
'regionCode':this.countyId,
|
||||||
|
'userId':this.userInfo.id,
|
||||||
|
'consigneePhone':this.addressForm.userphone,
|
||||||
|
'consigneeName': this.addressForm.username,
|
||||||
|
'isDefault':this.addressForm.isDafault ? 1 : 0
|
||||||
|
}
|
||||||
|
console.log(data,'保存参数')
|
||||||
$http.request({
|
$http.request({
|
||||||
url: link_add,
|
url: link_add,
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
@@ -315,7 +330,7 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '地址添加成功',
|
title: '操作成功',
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
});
|
});
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
@@ -334,17 +349,28 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
changeSwitch(e) {
|
changeSwitch(e) {
|
||||||
|
e ? this.addressForm.isdefault = 1 : this.addressForm.isdefault = 0
|
||||||
this.addressForm.isDafault = e
|
this.addressForm.isDafault = e
|
||||||
console.log(this.addressForm)
|
console.log(this.addressForm, e)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 编辑地址获取信息
|
// 编辑地址获取信息
|
||||||
getAddress() {
|
getAddress() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
.post(`book/userAddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.addressForm = res.list[this.editIndex]
|
this.addressForm = {
|
||||||
|
'useraddress':res.list[this.editIndex].detailAddress,
|
||||||
|
'userphone':res.list[this.editIndex].consigneePhone,
|
||||||
|
'username':res.list[this.editIndex].consigneeName,
|
||||||
|
'isdefault':res.list[this.editIndex].isDefault,
|
||||||
|
'isDafault':res.list[this.editIndex].isDefault == 1 ? true : false,
|
||||||
|
'areaidpathtext':res.list[this.editIndex].province +'-'+ res.list[this.editIndex].city +'-'+ res.list[this.editIndex].county
|
||||||
|
,'addressid':res.list[this.editIndex].id
|
||||||
|
}
|
||||||
|
this.countyId = res.list[this.editIndex].regionCode
|
||||||
|
// this.addressForm = res.list[this.editIndex]
|
||||||
if (this.addressForm.isdefault == 1) {
|
if (this.addressForm.isdefault == 1) {
|
||||||
this.addressForm.isDafault = true
|
this.addressForm.isDafault = true
|
||||||
}
|
}
|
||||||
@@ -357,15 +383,9 @@
|
|||||||
let addressArr = [];
|
let addressArr = [];
|
||||||
addressArr.push(this.addressForm.addressid)
|
addressArr.push(this.addressForm.addressid)
|
||||||
this.deleteShow = false
|
this.deleteShow = false
|
||||||
|
this.$http
|
||||||
$http.request({
|
.get(`book/userAddress/delete?id=${this.addressForm.addressid}`)
|
||||||
url: "book/useraddress/delete",
|
.then(res => {
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
|
||||||
data:addressArr,
|
|
||||||
header: { //默认 无 说明:请求头
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '地址删除成功',
|
title: '地址删除成功',
|
||||||
|
|||||||
@@ -10,18 +10,19 @@
|
|||||||
<view class="addrContent">
|
<view class="addrContent">
|
||||||
<view class="addrContentTop">
|
<view class="addrContentTop">
|
||||||
<view class="userName">
|
<view class="userName">
|
||||||
{{item.username}}
|
{{item.consigneeName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userTel">
|
<view class="userTel">
|
||||||
{{item.userphone}}
|
{{item.consigneePhone}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userMoren" v-if="item.isdefault==1">
|
<view class="userMoren" v-if="item.isDefault==1">
|
||||||
默认
|
默认
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="addrContentBottom">
|
<view class="addrContentBottom">
|
||||||
<view class="userAddress">
|
<view class="userAddress">
|
||||||
{{item.areaidpathtext}} {{item.useraddress}}
|
{{item.province}} {{item.city}} {{item.county}}
|
||||||
|
{{item.detailAddress}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -63,7 +64,8 @@
|
|||||||
methods: {
|
methods: {
|
||||||
getUserAddress() {
|
getUserAddress() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
.post(`book/userAddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
|
// .post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.addressList = res.list
|
this.addressList = res.list
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<view class="page">
|
||||||
<z-nav-bar></z-nav-bar>
|
<z-nav-bar></z-nav-bar>
|
||||||
<!-- 公共组件-每个页面必须引入 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
<public-module></public-module>
|
<public-module></public-module>
|
||||||
<view class="title">忘记密码</view>
|
<view class="title">忘记密码</view>
|
||||||
<view class="input_box">
|
<view class="input_box">
|
||||||
<text class="input_tit">手机号</text>
|
<text class="input_tit">手机号</text>
|
||||||
@@ -15,239 +15,298 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="input_box">
|
<view class="input_box">
|
||||||
<text class="input_tit">密码</text>
|
<text class="input_tit">密码</text>
|
||||||
<input type="password" v-model="password" placeholder="请输入密码" />
|
<input type="password" maxlength="8" v-model="password" placeholder="请输入密码" @input="inputMethod(password)" />
|
||||||
</view>
|
</view>
|
||||||
|
<view class="" style="font-size: 28rpx; color: #999;">
|
||||||
|
<p v-if="note != ''">{{note}}</p>
|
||||||
|
<p v-html="str2" style="margin-top: 10rpx;"></p>
|
||||||
|
</view>
|
||||||
<view class="input_box">
|
<view class="input_box">
|
||||||
<text class="input_tit">确认密码</text>
|
<text class="input_tit">确认密码</text>
|
||||||
<input type="password" v-model="confirmPassword" placeholder="请确认密码" />
|
<input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" />
|
||||||
</view>
|
</view>
|
||||||
<view class="btn_box"><button @click="onSubmit">提 交</button></view>
|
<view class="btn_box"><button @click="onSubmit">提 交</button></view>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import musicPlay from '@/components/music.vue'
|
import musicPlay from '@/components/music.vue'
|
||||||
import md5 from '@/plugins/md5';
|
import md5 from '@/plugins/md5';
|
||||||
var clear;
|
// 密码验证的正则
|
||||||
export default {
|
//1、密码为八位及以上并且字母数字特殊字符三项都包括
|
||||||
data() {
|
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
|
||||||
return {
|
//2、密码为八位及以上并且字母、数字、特殊字符三项中有两项,强度是中等
|
||||||
playData:{},
|
var mediumRegex = new RegExp(
|
||||||
//手机号账号
|
"^(?=.{8,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[a-z])(?=.*\\W))|((?=.*[0-9])(?=.*\\W))|((?=.*[A-Z])(?=.*\\W))).*$",
|
||||||
phone: '',
|
"g");
|
||||||
// 密码
|
var enoughRegex = new RegExp("(?=.{8,}).*", "g");
|
||||||
password: '',
|
var clear;
|
||||||
//验证码
|
export default {
|
||||||
code: '',
|
data() {
|
||||||
//确认密码
|
return {
|
||||||
confirmPassword: '',
|
playData: {},
|
||||||
//验证码
|
//手机号账号
|
||||||
codeText: '获取验证码',
|
phone: '',
|
||||||
//验证码已发
|
// 密码
|
||||||
readonly: false
|
password: '',
|
||||||
};
|
//验证码
|
||||||
},
|
code: '',
|
||||||
//第一次加载
|
//确认密码
|
||||||
onLoad(e) {},
|
confirmPassword: '',
|
||||||
//页面显示
|
//验证码
|
||||||
onShow() {},
|
codeText: '获取验证码',
|
||||||
components:{
|
//验证码已发
|
||||||
musicPlay
|
readonly: false,
|
||||||
|
passwordOk:false,
|
||||||
},
|
note: '',
|
||||||
//方法
|
str2: '',
|
||||||
methods: {
|
};
|
||||||
//获取验证码
|
|
||||||
getCode() {
|
|
||||||
if (this.readonly) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '验证码已发送',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.phone) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入手机号',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.$base.phoneRegular.test(this.phone)) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入正确的手机号',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$http
|
|
||||||
// .post('api/common/v1/send_sms', {
|
|
||||||
.post('book/user/sms/sendcode', {
|
|
||||||
phone: this.phone,
|
|
||||||
type: 3000
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
this.getCodeState();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//验证码按钮文字状态
|
//第一次加载
|
||||||
getCodeState() {
|
onLoad(e) {},
|
||||||
const _this = this;
|
//页面显示
|
||||||
this.readonly = true;
|
onShow() {},
|
||||||
this.codeText = '60S后重新获取';
|
components: {
|
||||||
var s = 60;
|
musicPlay
|
||||||
clear = setInterval(() => {
|
|
||||||
s--;
|
},
|
||||||
_this.codeText = s + 'S后重新获取';
|
//方法
|
||||||
if (s <= 0) {
|
methods: {
|
||||||
clearInterval(clear);
|
// 密码验证
|
||||||
_this.codeText = '获取验证码';
|
inputMethod(value) {
|
||||||
_this.readonly = false;
|
this.passwordOk = false
|
||||||
|
// console.log('输入的值为:', value)
|
||||||
|
if (strongRegex.test(value)) {
|
||||||
|
//console.log('强密码-----',value)
|
||||||
|
this.str2 = "<span style='color:#18bc37'>密码强度很不错哦!</span>"
|
||||||
|
// this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
|
||||||
|
this.note = ''
|
||||||
|
this.passwordOk = true
|
||||||
|
} else if (mediumRegex.test(value)) {
|
||||||
|
// console.log('中等密码-----',value)
|
||||||
|
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度为8位。'
|
||||||
|
this.str2 = "<span style='color:#2979ff'>密码强度中等!</span>"
|
||||||
|
this.passwordOk = true
|
||||||
|
} else if (enoughRegex.test(value)) {
|
||||||
|
// console.log('弱密码-----',value)
|
||||||
|
// this.str2 = "<span style='color:#f3a73f'>密码强度太弱!</span>"
|
||||||
|
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度为8位。'
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.passwordOk = false
|
||||||
|
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度为8位。'
|
||||||
|
this.str2 = ""
|
||||||
|
//console.log('密码-----',value)
|
||||||
}
|
}
|
||||||
}, 1000);
|
},
|
||||||
},
|
//获取验证码
|
||||||
onSubmit() {
|
getCode() {
|
||||||
if (!this.phone) {
|
if (this.readonly) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入手机号',
|
title: '验证码已发送',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.$base.phoneRegular.test(this.phone)) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入正确的手机号',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.code) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入验证码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.password) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入密码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.confirmPassword) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入确认密码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.confirmPassword != this.password) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '两次密码不一致',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.$base.passwordRegular.test(this.password)) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入不少于6位且包含数字和字母的密码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$http
|
|
||||||
// .post('api/common/v1/forget_password', {
|
|
||||||
.post('book/user/setPassword', {
|
|
||||||
phone: this.phone,
|
|
||||||
code:this.code,
|
|
||||||
// password: md5(this.password),
|
|
||||||
password: this.password
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
uni.showModal({
|
|
||||||
title:"提示",
|
|
||||||
content:"密码修改成功!",
|
|
||||||
showCancel:false,
|
|
||||||
success: (res) => {
|
|
||||||
uni.navigateBack();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
if (!this.phone) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入手机号',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.$base.phoneRegular.test(this.phone)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入正确的手机号',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$http
|
||||||
|
// .post('api/common/v1/send_sms', {
|
||||||
|
.post('book/user/sms/sendcode', {
|
||||||
|
phone: this.phone,
|
||||||
|
type: 3000
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.getCodeState();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//验证码按钮文字状态
|
||||||
|
getCodeState() {
|
||||||
|
const _this = this;
|
||||||
|
this.readonly = true;
|
||||||
|
this.codeText = '60S后重新获取';
|
||||||
|
var s = 60;
|
||||||
|
clear = setInterval(() => {
|
||||||
|
s--;
|
||||||
|
_this.codeText = s + 'S后重新获取';
|
||||||
|
if (s <= 0) {
|
||||||
|
clearInterval(clear);
|
||||||
|
_this.codeText = '获取验证码';
|
||||||
|
_this.readonly = false;
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
if(!this.passwordOk){
|
||||||
|
console.log('不满足密码格式',this.note)
|
||||||
|
uni.showToast({
|
||||||
|
title:this.note,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.phone) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入手机号',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.$base.phoneRegular.test(this.phone)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入正确的手机号',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.code) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入验证码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入密码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.confirmPassword) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入确认密码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.confirmPassword != this.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '两次密码不一致',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.$base.passwordRegular.test(this.password)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入不少于6位且包含数字和字母的密码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$http
|
||||||
|
// .post('api/common/v1/forget_password', {
|
||||||
|
.post('book/user/setPassword', {
|
||||||
|
phone: this.phone,
|
||||||
|
code: this.code,
|
||||||
|
// password: md5(this.password),
|
||||||
|
password: this.password
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
uni.showModal({
|
||||||
|
title: "提示",
|
||||||
|
content: "密码修改成功!",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//页面隐藏
|
||||||
|
onHide() {},
|
||||||
|
//页面卸载
|
||||||
|
onUnload() {},
|
||||||
|
//页面下来刷新
|
||||||
|
onPullDownRefresh() {},
|
||||||
|
//页面上拉触底
|
||||||
|
onReachBottom() {},
|
||||||
|
//用户点击分享
|
||||||
|
onShareAppMessage(e) {
|
||||||
|
return this.wxShare();
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
//页面隐藏
|
|
||||||
onHide() {},
|
|
||||||
//页面卸载
|
|
||||||
onUnload() {},
|
|
||||||
//页面下来刷新
|
|
||||||
onPullDownRefresh() {},
|
|
||||||
//页面上拉触底
|
|
||||||
onReachBottom() {},
|
|
||||||
//用户点击分享
|
|
||||||
onShareAppMessage(e) {
|
|
||||||
return this.wxShare();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
.page {
|
|
||||||
background-color: #ffffff;
|
.page {
|
||||||
padding: 0 65rpx;
|
background-color: #ffffff;
|
||||||
min-height: 100vh;
|
padding: 0 65rpx;
|
||||||
|
min-height: 100vh;
|
||||||
.title {
|
|
||||||
padding: 60rpx 0 40rpx 0;
|
.title {
|
||||||
font-size: 60rpx;
|
padding: 60rpx 0 40rpx 0;
|
||||||
color: #333333;
|
font-size: 60rpx;
|
||||||
}
|
color: #333333;
|
||||||
.input_box {
|
}
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
.input_box {
|
||||||
height: 100rpx;
|
display: flex;
|
||||||
padding-top: 30rpx;
|
justify-content: space-between;
|
||||||
border-bottom: 1rpx solid #eeeeee;
|
height: 100rpx;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #eeeeee;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text{
|
|
||||||
font-size: 30rpx;
|
text {
|
||||||
width: 180rpx;
|
font-size: 30rpx;
|
||||||
|
width: 180rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
flex: 1;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
height: 78rpx;
|
||||||
|
line-height: 78rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: $themeColor;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
input {
|
|
||||||
flex: 1;
|
.btn_box {
|
||||||
height: 70rpx;
|
margin-top: 70rpx;
|
||||||
line-height: 70rpx;
|
|
||||||
font-size: 30rpx;
|
button {
|
||||||
|
font-size: 32rpx;
|
||||||
|
@include theme('btn_bg') color: #fff;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
button {
|
|
||||||
height: 78rpx;
|
.protocol {
|
||||||
line-height: 78rpx;
|
font-size: 24rpx;
|
||||||
font-size: 30rpx;
|
color: #999999;
|
||||||
color: $themeColor;
|
text-align: center;
|
||||||
&:active {
|
margin-top: 20rpx;
|
||||||
background-color: transparent;
|
|
||||||
|
text {
|
||||||
|
color: $themeColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.btn_box {
|
</style>
|
||||||
margin-top: 70rpx;
|
|
||||||
button {
|
|
||||||
font-size: 32rpx;
|
|
||||||
@include theme('btn_bg')
|
|
||||||
color: #fff;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.protocol {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
text {
|
|
||||||
color: $themeColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -64,7 +64,11 @@
|
|||||||
|
|
||||||
<view class="qie_huan" style="display: flex; justify-content: center;">
|
<view class="qie_huan" style="display: flex; justify-content: center;">
|
||||||
<view style="width: 30%;" @click="type = 1000" v-if="type == 2000">密码登录</view>
|
<view style="width: 30%;" @click="type = 1000" v-if="type == 2000">密码登录</view>
|
||||||
<view style="width: 30%;" @click="type = 2000" v-if="type == 1000">验证码登录</view>
|
<view style="width:50%; display: flex; justify-content:space-between;" v-if="type == 1000">
|
||||||
|
<text @click="type = 2000">验证码登录</text>
|
||||||
|
<text v-if="type == 1000" @click="onPageJump('/pages/user/forget')">忘记密码?</text>
|
||||||
|
<!-- <text @click="resetPassWord()">忘记密码</text> -->
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<z-popup v-model="HealthOpen" type="center" :hideOnBlur="false">
|
<z-popup v-model="HealthOpen" type="center" :hideOnBlur="false">
|
||||||
@@ -188,6 +192,13 @@
|
|||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setUserInfo']),
|
...mapMutations(['setUserInfo']),
|
||||||
...mapMutations(['setHealthMes']),
|
...mapMutations(['setHealthMes']),
|
||||||
|
// 修改密码
|
||||||
|
resetPassWord(){
|
||||||
|
console.log('重置密码')
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/home/shop/goodsDetail"
|
||||||
|
})
|
||||||
|
},
|
||||||
// 显示协议
|
// 显示协议
|
||||||
showXieyi(str){
|
showXieyi(str){
|
||||||
if(str == 'user'){
|
if(str == 'user'){
|
||||||
|
|||||||
@@ -91,14 +91,14 @@
|
|||||||
<u-popup :show="passwordShow" :round="10" @close="cancelPass">
|
<u-popup :show="passwordShow" :round="10" @close="cancelPass">
|
||||||
<view class="tanchu">
|
<view class="tanchu">
|
||||||
<view class="dp_title">请修改密码</view>
|
<view class="dp_title">请修改密码</view>
|
||||||
<u--input v-model="userMes.password" placeholder="请输入新密码" :password="true" border="surround" clearable
|
<u--input maxlength="8" v-model="userMes.password" placeholder="请输入新密码" :password="true" border="surround" clearable
|
||||||
@input="inputMethod(userMes.password)">
|
@input="inputMethod(userMes.password)">
|
||||||
</u--input>
|
</u--input>
|
||||||
<view class="" style="font-size: 28rpx; color: #999;">
|
<view class="" style="font-size: 28rpx; color: #999;">
|
||||||
<p v-if="note != ''">{{note}}</p>
|
<p v-if="note != ''">{{note}}</p>
|
||||||
<p v-html="str2" style="margin-top: 10rpx;"></p>
|
<p v-html="str2" style="margin-top: 10rpx;"></p>
|
||||||
</view>
|
</view>
|
||||||
<u--input v-model="userMes.Repassword" placeholder="请再确认密码" :password="true" border="surround" clearable
|
<u--input maxlength="8" v-model="userMes.Repassword" placeholder="请再确认密码" :password="true" border="surround" clearable
|
||||||
style="margin-top: 20rpx;"></u--input>
|
style="margin-top: 20rpx;"></u--input>
|
||||||
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="chosePassword()"
|
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="chosePassword()"
|
||||||
style="margin-top: 50rpx;"></u-button>
|
style="margin-top: 50rpx;"></u-button>
|
||||||
@@ -207,24 +207,26 @@
|
|||||||
// 密码验证
|
// 密码验证
|
||||||
inputMethod(value) {
|
inputMethod(value) {
|
||||||
this.passwordOk = false
|
this.passwordOk = false
|
||||||
console.log('输入的值为:', value)
|
// console.log('输入的值为:', value)
|
||||||
if (strongRegex.test(value)) {
|
if (strongRegex.test(value)) {
|
||||||
//console.log('强密码-----',value)
|
//console.log('强密码-----',value)
|
||||||
this.str2 = "<span style='color:#18bc37'>密码强度很不错哦!</span>"
|
this.str2 = "<span style='color:#18bc37'>密码强度很不错哦!</span>"
|
||||||
// this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
|
// this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度为8位。'
|
||||||
this.note = ''
|
this.note = ''
|
||||||
this.passwordOk = true
|
this.passwordOk = true
|
||||||
} else if (mediumRegex.test(value)) {
|
} else if (mediumRegex.test(value)) {
|
||||||
//console.log('中等密码-----',value)
|
//console.log('中等密码-----',value)
|
||||||
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
|
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度为8位。'
|
||||||
this.str2 = "<span style='color:#2979ff'>密码强度中等!</span>"
|
this.str2 = "<span style='color:#2979ff'>密码强度中等!</span>"
|
||||||
this.passwordOk = true
|
this.passwordOk = true
|
||||||
} else if (enoughRegex.test(value)) {
|
} else if (enoughRegex.test(value)) {
|
||||||
//console.log('弱密码-----',value)
|
//console.log('弱密码-----',value)
|
||||||
this.str2 = "<span style='color:#f3a73f'>密码强度太弱!</span>"
|
this.str2 = "<span style='color:#f3a73f'>密码强度太弱!</span>"
|
||||||
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
|
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度为8位。'
|
||||||
} else {
|
} else {
|
||||||
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
|
this.passwordOk = false
|
||||||
|
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度为8位。'
|
||||||
|
this.str2 = ""
|
||||||
//console.log('密码-----',value)
|
//console.log('密码-----',value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
BIN
static/icon/morenAvavter.png
Normal file
BIN
static/icon/morenAvavter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
@@ -64,6 +64,7 @@ export const mutations = {
|
|||||||
} else {
|
} else {
|
||||||
state.loadingShow = data;
|
state.loadingShow = data;
|
||||||
}
|
}
|
||||||
|
// console.log('加载状态',state.loadingShow)
|
||||||
},
|
},
|
||||||
//微信场景参数
|
//微信场景参数
|
||||||
setChatScenesInfo(state, data) {
|
setChatScenesInfo(state, data) {
|
||||||
|
|||||||
24
uni_modules/uni-countdown/changelog.md
Normal file
24
uni_modules/uni-countdown/changelog.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
## 1.2.2(2022-01-19)
|
||||||
|
- 修复 在微信小程序中样式不生效的bug
|
||||||
|
## 1.2.1(2022-01-18)
|
||||||
|
- 新增 update 方法 ,在动态更新时间后,刷新组件
|
||||||
|
## 1.2.0(2021-11-19)
|
||||||
|
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-countdown](https://uniapp.dcloud.io/component/uniui/uni-countdown)
|
||||||
|
## 1.1.3(2021-10-18)
|
||||||
|
- 重构
|
||||||
|
- 新增 font-size 支持自定义字体大小
|
||||||
|
## 1.1.2(2021-08-24)
|
||||||
|
- 新增 支持国际化
|
||||||
|
## 1.1.1(2021-07-30)
|
||||||
|
- 优化 vue3下小程序事件警告的问题
|
||||||
|
## 1.1.0(2021-07-30)
|
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||||
|
## 1.0.5(2021-06-18)
|
||||||
|
- 修复 uni-countdown 重复赋值跳两秒的 bug
|
||||||
|
## 1.0.4(2021-05-12)
|
||||||
|
- 新增 组件示例地址
|
||||||
|
## 1.0.3(2021-05-08)
|
||||||
|
- 修复 uni-countdown 不能控制倒计时的 bug
|
||||||
|
## 1.0.2(2021-02-04)
|
||||||
|
- 调整为uni_modules目录规范
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"uni-countdown.day": "day",
|
||||||
|
"uni-countdown.h": "h",
|
||||||
|
"uni-countdown.m": "m",
|
||||||
|
"uni-countdown.s": "s"
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import en from './en.json'
|
||||||
|
import zhHans from './zh-Hans.json'
|
||||||
|
import zhHant from './zh-Hant.json'
|
||||||
|
export default {
|
||||||
|
en,
|
||||||
|
'zh-Hans': zhHans,
|
||||||
|
'zh-Hant': zhHant
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"uni-countdown.day": "天",
|
||||||
|
"uni-countdown.h": "时",
|
||||||
|
"uni-countdown.m": "分",
|
||||||
|
"uni-countdown.s": "秒"
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"uni-countdown.day": "天",
|
||||||
|
"uni-countdown.h": "時",
|
||||||
|
"uni-countdown.m": "分",
|
||||||
|
"uni-countdown.s": "秒"
|
||||||
|
}
|
||||||
@@ -0,0 +1,271 @@
|
|||||||
|
<template>
|
||||||
|
<view class="uni-countdown">
|
||||||
|
<text v-if="showDay" :style="[timeStyle]" class="uni-countdown__number">{{ d }}</text>
|
||||||
|
<text v-if="showDay" :style="[splitorStyle]" class="uni-countdown__splitor">{{dayText}}</text>
|
||||||
|
<text :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
|
||||||
|
<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
|
||||||
|
<text :style="[timeStyle]" class="uni-countdown__number">{{ i }}</text>
|
||||||
|
<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</text>
|
||||||
|
<text :style="[timeStyle]" class="uni-countdown__number">{{ s }}</text>
|
||||||
|
<text v-if="!showColon" :style="[splitorStyle]" class="uni-countdown__splitor">{{secondText}}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
initVueI18n
|
||||||
|
} from '@dcloudio/uni-i18n'
|
||||||
|
import messages from './i18n/index.js'
|
||||||
|
const {
|
||||||
|
t
|
||||||
|
} = initVueI18n(messages)
|
||||||
|
/**
|
||||||
|
* Countdown 倒计时
|
||||||
|
* @description 倒计时组件
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=25
|
||||||
|
* @property {String} backgroundColor 背景色
|
||||||
|
* @property {String} color 文字颜色
|
||||||
|
* @property {Number} day 天数
|
||||||
|
* @property {Number} hour 小时
|
||||||
|
* @property {Number} minute 分钟
|
||||||
|
* @property {Number} second 秒
|
||||||
|
* @property {Number} timestamp 时间戳
|
||||||
|
* @property {Boolean} showDay = [true|false] 是否显示天数
|
||||||
|
* @property {Boolean} show-colon = [true|false] 是否以冒号为分隔符
|
||||||
|
* @property {String} splitorColor 分割符号颜色
|
||||||
|
* @event {Function} timeup 倒计时时间到触发事件
|
||||||
|
* @example <uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'UniCountdown',
|
||||||
|
emits: ['timeup'],
|
||||||
|
props: {
|
||||||
|
showDay: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
showColon: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
start: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
},
|
||||||
|
fontSize: {
|
||||||
|
type: Number,
|
||||||
|
default: 14
|
||||||
|
},
|
||||||
|
splitorColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
},
|
||||||
|
day: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
hour: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
minute: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
second: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
timestamp: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timer: null,
|
||||||
|
syncFlag: false,
|
||||||
|
d: '00',
|
||||||
|
h: '00',
|
||||||
|
i: '00',
|
||||||
|
s: '00',
|
||||||
|
leftTime: 0,
|
||||||
|
seconds: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
dayText() {
|
||||||
|
return t("uni-countdown.day")
|
||||||
|
},
|
||||||
|
hourText(val) {
|
||||||
|
return t("uni-countdown.h")
|
||||||
|
},
|
||||||
|
minuteText(val) {
|
||||||
|
return t("uni-countdown.m")
|
||||||
|
},
|
||||||
|
secondText(val) {
|
||||||
|
return t("uni-countdown.s")
|
||||||
|
},
|
||||||
|
timeStyle() {
|
||||||
|
const {
|
||||||
|
color,
|
||||||
|
backgroundColor,
|
||||||
|
fontSize
|
||||||
|
} = this
|
||||||
|
return {
|
||||||
|
color,
|
||||||
|
backgroundColor,
|
||||||
|
fontSize: `${fontSize}px`,
|
||||||
|
width: `${fontSize * 22 / 14}px`, // 按字体大小为 14px 时的比例缩放
|
||||||
|
lineHeight: `${fontSize * 20 / 14}px`,
|
||||||
|
borderRadius: `${fontSize * 3 / 14}px`,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
splitorStyle() {
|
||||||
|
const { splitorColor, fontSize, backgroundColor } = this
|
||||||
|
return {
|
||||||
|
color: splitorColor,
|
||||||
|
fontSize: `${fontSize * 12 / 14}px`,
|
||||||
|
margin: backgroundColor ? `${fontSize * 4 / 14}px` : ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
day(val) {
|
||||||
|
this.changeFlag()
|
||||||
|
},
|
||||||
|
hour(val) {
|
||||||
|
this.changeFlag()
|
||||||
|
},
|
||||||
|
minute(val) {
|
||||||
|
this.changeFlag()
|
||||||
|
},
|
||||||
|
second(val) {
|
||||||
|
this.changeFlag()
|
||||||
|
},
|
||||||
|
start: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal, oldVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.startData();
|
||||||
|
} else {
|
||||||
|
if (!oldVal) return
|
||||||
|
clearInterval(this.timer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created: function(e) {
|
||||||
|
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
||||||
|
this.countDown()
|
||||||
|
},
|
||||||
|
// #ifndef VUE3
|
||||||
|
destroyed() {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
// #ifdef VUE3
|
||||||
|
unmounted() {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
methods: {
|
||||||
|
toSeconds(timestamp, day, hours, minutes, seconds) {
|
||||||
|
if (timestamp) {
|
||||||
|
return timestamp - parseInt(new Date().getTime() / 1000, 10)
|
||||||
|
}
|
||||||
|
return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds
|
||||||
|
},
|
||||||
|
timeUp() {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
this.$emit('timeup')
|
||||||
|
},
|
||||||
|
countDown() {
|
||||||
|
let seconds = this.seconds
|
||||||
|
let [day, hour, minute, second] = [0, 0, 0, 0]
|
||||||
|
if (seconds > 0) {
|
||||||
|
day = Math.floor(seconds / (60 * 60 * 24))
|
||||||
|
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
|
||||||
|
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
|
||||||
|
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
|
||||||
|
} else {
|
||||||
|
this.timeUp()
|
||||||
|
}
|
||||||
|
if (day < 10) {
|
||||||
|
day = '0' + day
|
||||||
|
}
|
||||||
|
if (hour < 10) {
|
||||||
|
hour = '0' + hour
|
||||||
|
}
|
||||||
|
if (minute < 10) {
|
||||||
|
minute = '0' + minute
|
||||||
|
}
|
||||||
|
if (second < 10) {
|
||||||
|
second = '0' + second
|
||||||
|
}
|
||||||
|
this.d = day
|
||||||
|
this.h = hour
|
||||||
|
this.i = minute
|
||||||
|
this.s = second
|
||||||
|
},
|
||||||
|
startData() {
|
||||||
|
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
||||||
|
if (this.seconds <= 0) {
|
||||||
|
this.seconds = this.toSeconds(0, 0, 0, 0, 0)
|
||||||
|
this.countDown()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
clearInterval(this.timer)
|
||||||
|
this.countDown()
|
||||||
|
this.timer = setInterval(() => {
|
||||||
|
this.seconds--
|
||||||
|
if (this.seconds < 0) {
|
||||||
|
this.timeUp()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.countDown()
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
update(){
|
||||||
|
this.startData();
|
||||||
|
},
|
||||||
|
changeFlag() {
|
||||||
|
if (!this.syncFlag) {
|
||||||
|
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
||||||
|
this.startData();
|
||||||
|
this.syncFlag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$font-size: 14px;
|
||||||
|
|
||||||
|
.uni-countdown {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&__splitor {
|
||||||
|
margin: 0 2px;
|
||||||
|
font-size: $font-size;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__number {
|
||||||
|
border-radius: 3px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: $font-size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
86
uni_modules/uni-countdown/package.json
Normal file
86
uni_modules/uni-countdown/package.json
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-countdown",
|
||||||
|
"displayName": "uni-countdown 倒计时",
|
||||||
|
"version": "1.2.2",
|
||||||
|
"description": "CountDown 倒计时组件",
|
||||||
|
"keywords": [
|
||||||
|
"uni-ui",
|
||||||
|
"uniui",
|
||||||
|
"countdown",
|
||||||
|
"倒计时"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": ""
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../temps/example_temps"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"category": [
|
||||||
|
"前端组件",
|
||||||
|
"通用组件"
|
||||||
|
],
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": ["uni-scss"],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "y"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "y",
|
||||||
|
"微信浏览器(Android)": "y",
|
||||||
|
"QQ浏览器(Android)": "y"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "y",
|
||||||
|
"IE": "y",
|
||||||
|
"Edge": "y",
|
||||||
|
"Firefox": "y",
|
||||||
|
"Safari": "y"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "y",
|
||||||
|
"阿里": "y",
|
||||||
|
"百度": "y",
|
||||||
|
"字节跳动": "y",
|
||||||
|
"QQ": "y"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
uni_modules/uni-countdown/readme.md
Normal file
10
uni_modules/uni-countdown/readme.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
## CountDown 倒计时
|
||||||
|
> **组件名:uni-countdown**
|
||||||
|
> 代码块: `uCountDown`
|
||||||
|
|
||||||
|
倒计时组件。
|
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-countdown)
|
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||||
17
uni_modules/uni-link/changelog.md
Normal file
17
uni_modules/uni-link/changelog.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
## 1.0.0(2021-11-19)
|
||||||
|
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-link](https://uniapp.dcloud.io/component/uniui/uni-link)
|
||||||
|
## 1.1.7(2021-11-08)
|
||||||
|
## 0.0.7(2021-09-03)
|
||||||
|
- 修复 在 nvue 下不显示的 bug
|
||||||
|
## 0.0.6(2021-07-30)
|
||||||
|
- 新增 支持自定义插槽
|
||||||
|
## 0.0.5(2021-06-21)
|
||||||
|
- 新增 download 属性,H5平台下载文件名
|
||||||
|
## 0.0.4(2021-05-12)
|
||||||
|
- 新增 组件示例地址
|
||||||
|
## 0.0.3(2021-03-09)
|
||||||
|
- 新增 href 属性支持 tel:|mailto:
|
||||||
|
|
||||||
|
## 0.0.2(2021-02-05)
|
||||||
|
- 调整为uni_modules目录规范
|
||||||
128
uni_modules/uni-link/components/uni-link/uni-link.vue
Normal file
128
uni_modules/uni-link/components/uni-link/uni-link.vue
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<template>
|
||||||
|
<a v-if="isShowA" class="uni-link" :href="href"
|
||||||
|
:class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
|
||||||
|
:style="{color,fontSize:fontSize+'px'}" :download="download">
|
||||||
|
<slot>{{text}}</slot>
|
||||||
|
</a>
|
||||||
|
<!-- #ifndef APP-NVUE -->
|
||||||
|
<text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
|
||||||
|
:style="{color,fontSize:fontSize+'px'}" @click="openURL">
|
||||||
|
<slot>{{text}}</slot>
|
||||||
|
</text>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef APP-NVUE -->
|
||||||
|
<text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
|
||||||
|
:style="{color,fontSize:fontSize+'px'}" @click="openURL">
|
||||||
|
{{text}}
|
||||||
|
</text>
|
||||||
|
<!-- #endif -->
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* Link 外部网页超链接组件
|
||||||
|
* @description uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=1182
|
||||||
|
* @property {String} href 点击后打开的外部网页url
|
||||||
|
* @property {String} text 显示的文字
|
||||||
|
* @property {String} downlaod H5平台下载文件名
|
||||||
|
* @property {Boolean} showUnderLine 是否显示下划线
|
||||||
|
* @property {String} copyTips 在小程序端复制链接时显示的提示语
|
||||||
|
* @property {String} color 链接文字颜色
|
||||||
|
* @property {String} fontSize 链接文字大小
|
||||||
|
* @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link>
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'uniLink',
|
||||||
|
props: {
|
||||||
|
href: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
download: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
showUnderLine: {
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
copyTips: {
|
||||||
|
type: String,
|
||||||
|
default: '已自动复制网址,请在手机浏览器里粘贴该网址'
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: '#999999'
|
||||||
|
},
|
||||||
|
fontSize: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 14
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isShowA() {
|
||||||
|
// #ifdef H5
|
||||||
|
this._isH5 = true;
|
||||||
|
// #endif
|
||||||
|
if ((this.isMail() || this.isTel()) && this._isH5 === true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this._isH5 = null;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
isMail() {
|
||||||
|
return this.href.startsWith('mailto:');
|
||||||
|
},
|
||||||
|
isTel() {
|
||||||
|
return this.href.startsWith('tel:');
|
||||||
|
},
|
||||||
|
openURL() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (this.isTel()) {
|
||||||
|
this.makePhoneCall(this.href.replace('tel:', ''));
|
||||||
|
} else {
|
||||||
|
plus.runtime.openURL(this.href);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
window.open(this.href)
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: this.href
|
||||||
|
});
|
||||||
|
uni.showModal({
|
||||||
|
content: this.copyTips,
|
||||||
|
showCancel: false
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
makePhoneCall(phoneNumber) {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
.uni-link {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #endif */
|
||||||
|
.uni-link--withline {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
87
uni_modules/uni-link/package.json
Normal file
87
uni_modules/uni-link/package.json
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-link",
|
||||||
|
"displayName": "uni-link 超链接",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打",
|
||||||
|
"keywords": [
|
||||||
|
"uni-ui",
|
||||||
|
"uniui",
|
||||||
|
"link",
|
||||||
|
"超链接",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": ""
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../temps/example_temps"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"category": [
|
||||||
|
"前端组件",
|
||||||
|
"通用组件"
|
||||||
|
],
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": ["uni-scss"],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "y"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "y",
|
||||||
|
"微信浏览器(Android)": "y",
|
||||||
|
"QQ浏览器(Android)": "y"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "y",
|
||||||
|
"IE": "y",
|
||||||
|
"Edge": "y",
|
||||||
|
"Firefox": "y",
|
||||||
|
"Safari": "y"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "y",
|
||||||
|
"阿里": "y",
|
||||||
|
"百度": "y",
|
||||||
|
"字节跳动": "y",
|
||||||
|
"QQ": "y"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "y",
|
||||||
|
"联盟": "y"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
uni_modules/uni-link/readme.md
Normal file
11
uni_modules/uni-link/readme.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
## Link 链接
|
||||||
|
> **组件名:uni-link**
|
||||||
|
> 代码块: `uLink`
|
||||||
|
|
||||||
|
|
||||||
|
uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页。
|
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-link)
|
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||||
70
uni_modules/uni-upgrade-center-app/changelog.md
Normal file
70
uni_modules/uni-upgrade-center-app/changelog.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
## 0.6.4(2023-09-01)
|
||||||
|
chore: 优化代码结构
|
||||||
|
## 0.6.3(2023-08-30)
|
||||||
|
- 修复 下载 wgt 时如果后缀名不正确,重命名后安装
|
||||||
|
## 0.6.2(2022-11-21)
|
||||||
|
- 处理 cloudfunctions 目录
|
||||||
|
## 0.6.1(2022-08-17)
|
||||||
|
- 修复 后台添加应用市场,但都没有启用的情况下报错的Bug (需要 uni-admin 1.9.3+)
|
||||||
|
## 0.6.0(2022-07-19)
|
||||||
|
- 新增 支持多应用商店配置(需要 uni-admin 1.9.3+)
|
||||||
|
## 0.4.1(2022-05-27)
|
||||||
|
- 修复 上版引出的报错问题
|
||||||
|
## 0.4.0(2022-05-27)
|
||||||
|
- 新增 Android 支持跳转手机自带商店,填写升级包地址时请填写跳转商店链接
|
||||||
|
- 新增 改为云对象调用方式,使用更直观
|
||||||
|
## 0.3.3(2022-04-14)
|
||||||
|
- 修复 调用 check-update,当 code 为 0 时没有回调
|
||||||
|
## 0.3.2(2022-01-12)
|
||||||
|
- 优化显示逻辑
|
||||||
|
## 0.3.1(2021-11-24)
|
||||||
|
- 修复 vue3 上图片不显示的Bug
|
||||||
|
## 0.3.0(2021-11-18)
|
||||||
|
- 移除 wgt 安装成功后提示,防止重启过快弹框不消失
|
||||||
|
## 0.2.2(2021-08-25)
|
||||||
|
- 兼容vue3.0
|
||||||
|
## 0.2.1(2021-07-26)
|
||||||
|
- 修复 使用腾讯云并手动填写地址时,导致下载链接失效的bug
|
||||||
|
## 0.2.0(2021-07-13)
|
||||||
|
- 更新文档 关于报错local_storage_key 为空,请不要将页面路径设置为pages.json中第一项
|
||||||
|
## 0.1.9(2021-06-28)
|
||||||
|
- 更新文档
|
||||||
|
- 修复 wgt安装失败时,按钮状态不对
|
||||||
|
## 0.1.8(2021-06-16)
|
||||||
|
- 修复 跳转安装时,导致上次下载的apk还没安装就被删掉的bug
|
||||||
|
## 0.1.7(2021-06-03)
|
||||||
|
- 修改 移除static中的图片
|
||||||
|
## 0.1.6(2021-06-03)
|
||||||
|
- 修改 下载更新按钮使用CSS渐变色
|
||||||
|
## 0.1.5(2021-04-22)
|
||||||
|
- 更新check-update函数。现在返回一个Promise,有更新时成功回调,其他情况错误回调
|
||||||
|
## 0.1.4(2021-04-13)
|
||||||
|
- 更新文档。明确云函数调用结果
|
||||||
|
## 0.1.3(2021-04-13)
|
||||||
|
- 解耦云函数与弹框处理。utils中新增 call-check-version.js,可用于单独检测是否有更新
|
||||||
|
## 0.1.2(2021-04-07)
|
||||||
|
- 更新版本对比函数 compare
|
||||||
|
## 0.1.1(2021-04-07)
|
||||||
|
- 修复 腾讯云空间下载链接不能下载问题
|
||||||
|
## 0.1.0(2021-04-07)
|
||||||
|
- 新增使用uni.showModal提示升级示例
|
||||||
|
- 修改iOS升级提示方式
|
||||||
|
## 0.0.7(2021-04-02)
|
||||||
|
- 修复在iOS上打开弹框报错
|
||||||
|
## 0.0.6(2021-04-01)
|
||||||
|
- 兼容旧版本安卓
|
||||||
|
## 0.0.5(2021-04-01)
|
||||||
|
- 修复低版本安卓上进度条错位
|
||||||
|
## 0.0.4(2021-04-01)
|
||||||
|
- 更新readme
|
||||||
|
- 修复check-update语法错误
|
||||||
|
## 0.0.3(2021-04-01)
|
||||||
|
- 新增前台更新弹框,详见readme
|
||||||
|
- 更新前台检查更新方法
|
||||||
|
|
||||||
|
## 0.0.2(2021-03-29)
|
||||||
|
- 更新文档
|
||||||
|
- 移除 dependencies
|
||||||
|
|
||||||
|
## 0.0.1(2021-03-25)
|
||||||
|
- 升级中心前台检查更新
|
||||||
BIN
uni_modules/uni-upgrade-center-app/images/app_update_close.png
Normal file
BIN
uni_modules/uni-upgrade-center-app/images/app_update_close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
BIN
uni_modules/uni-upgrade-center-app/images/bg_top.png
Normal file
BIN
uni_modules/uni-upgrade-center-app/images/bg_top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
81
uni_modules/uni-upgrade-center-app/package.json
Normal file
81
uni_modules/uni-upgrade-center-app/package.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-upgrade-center-app",
|
||||||
|
"displayName": "升级中心 uni-upgrade-center - App",
|
||||||
|
"version": "0.6.4",
|
||||||
|
"description": "uni升级中心 - 客户端检查更新",
|
||||||
|
"keywords": [
|
||||||
|
"uniCloud",
|
||||||
|
"update",
|
||||||
|
"升级",
|
||||||
|
"wgt"
|
||||||
|
],
|
||||||
|
"repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center-app",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "^3.2.14"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "插件不采集任何数据",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "",
|
||||||
|
"type": "unicloud-template-page"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "u"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "y",
|
||||||
|
"微信浏览器(Android)": "y",
|
||||||
|
"QQ浏览器(Android)": "y"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "y",
|
||||||
|
"IE": "y",
|
||||||
|
"Edge": "y",
|
||||||
|
"Firefox": "y",
|
||||||
|
"Safari": "y"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "u",
|
||||||
|
"阿里": "u",
|
||||||
|
"百度": "u",
|
||||||
|
"字节跳动": "u",
|
||||||
|
"QQ": "u",
|
||||||
|
"京东": "u"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
555
uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
Normal file
555
uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
Normal file
@@ -0,0 +1,555 @@
|
|||||||
|
<template>
|
||||||
|
<view class="mask flex-center">
|
||||||
|
<view class="content botton-radius">
|
||||||
|
<view class="content-top">
|
||||||
|
<text class="content-top-text">{{title}}</text>
|
||||||
|
<image class="content-top" style="top: 0;" width="100%" height="100%" src="../images/bg_top.png">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view class="content-header"></view>
|
||||||
|
<view class="content-body">
|
||||||
|
<view class="title">
|
||||||
|
<text>{{subTitle}}</text>
|
||||||
|
<!-- <text style="padding-left:20rpx;font-size: 0.5em;color: #666;">v.{{version}}</text> -->
|
||||||
|
</view>
|
||||||
|
<view class="body">
|
||||||
|
<scroll-view class="box-des-scroll" scroll-y="true">
|
||||||
|
<text class="box-des">
|
||||||
|
{{contents}}
|
||||||
|
</text>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
<view class="footer flex-center">
|
||||||
|
<template v-if="isAppStore">
|
||||||
|
<button class="content-button" style="border: none;color: #fff;" plain @click="jumpToAppStore">
|
||||||
|
{{downLoadBtnTextiOS}}
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<template v-if="!downloadSuccess">
|
||||||
|
<view class="progress-box flex-column" v-if="downloading">
|
||||||
|
<progress class="progress" border-radius="35" :percent="downLoadPercent" activeColor="#3DA7FF" show-info
|
||||||
|
stroke-width="10" />
|
||||||
|
<view style="width:100%;font-size: 28rpx;display: flex;justify-content: space-around;">
|
||||||
|
<text>{{downLoadingText}}</text>
|
||||||
|
<text>({{downloadedSize}}/{{packageFileSize}}M)</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<button v-else class="content-button" style="border: none;color: #fff;" plain @click="updateApp">
|
||||||
|
{{downLoadBtnText}}
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
<button v-else-if="downloadSuccess && !installed" class="content-button" style="border: none;color: #fff;"
|
||||||
|
plain :loading="installing" :disabled="installing" @click="installPackage">
|
||||||
|
{{installing ? '正在安装……' : '下载完成,立即安装'}}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button v-if="installed && isWGT" class="content-button" style="border: none;color: #fff;" plain
|
||||||
|
@click="restart">
|
||||||
|
安装完毕,点击重启
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<image v-if="!is_mandatory" class="close-img" src="../images/app_update_close.png" @click.stop="closeUpdate">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const localFilePathKey = 'UNI_ADMIN_UPGRADE_CENTER_LOCAL_FILE_PATH'
|
||||||
|
const platform_iOS = 'iOS';
|
||||||
|
let downloadTask = null;
|
||||||
|
let openSchemePromise
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对比版本号,如需要,请自行修改判断规则
|
||||||
|
* 支持比对 ("3.0.0.0.0.1.0.1", "3.0.0.0.0.1") ("3.0.0.1", "3.0") ("3.1.1", "3.1.1.1") 之类的
|
||||||
|
* @param {Object} v1
|
||||||
|
* @param {Object} v2
|
||||||
|
* v1 > v2 return 1
|
||||||
|
* v1 < v2 return -1
|
||||||
|
* v1 == v2 return 0
|
||||||
|
*/
|
||||||
|
function compare(v1 = '0', v2 = '0') {
|
||||||
|
v1 = String(v1).split('.')
|
||||||
|
v2 = String(v2).split('.')
|
||||||
|
const minVersionLens = Math.min(v1.length, v2.length);
|
||||||
|
|
||||||
|
let result = 0;
|
||||||
|
for (let i = 0; i < minVersionLens; i++) {
|
||||||
|
const curV1 = Number(v1[i])
|
||||||
|
const curV2 = Number(v2[i])
|
||||||
|
|
||||||
|
if (curV1 > curV2) {
|
||||||
|
result = 1
|
||||||
|
break;
|
||||||
|
} else if (curV1 < curV2) {
|
||||||
|
result = -1
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result === 0 && (v1.length !== v2.length)) {
|
||||||
|
const v1BiggerThenv2 = v1.length > v2.length;
|
||||||
|
const maxLensVersion = v1BiggerThenv2 ? v1 : v2;
|
||||||
|
for (let i = minVersionLens; i < maxLensVersion.length; i++) {
|
||||||
|
const curVersion = Number(maxLensVersion[i])
|
||||||
|
if (curVersion > 0) {
|
||||||
|
v1BiggerThenv2 ? result = 1 : result = -1
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 从之前下载安装
|
||||||
|
installForBeforeFilePath: '',
|
||||||
|
|
||||||
|
// 安装
|
||||||
|
installed: false,
|
||||||
|
installing: false,
|
||||||
|
|
||||||
|
// 下载
|
||||||
|
downloadSuccess: false,
|
||||||
|
downloading: false,
|
||||||
|
|
||||||
|
downLoadPercent: 0,
|
||||||
|
downloadedSize: 0,
|
||||||
|
packageFileSize: 0,
|
||||||
|
|
||||||
|
tempFilePath: '', // 要安装的本地包地址
|
||||||
|
|
||||||
|
// 默认安装包信息
|
||||||
|
title: '更新日志',
|
||||||
|
contents: '',
|
||||||
|
is_mandatory: false,
|
||||||
|
|
||||||
|
// 可自定义属性
|
||||||
|
subTitle: '发现新版本',
|
||||||
|
downLoadBtnTextiOS: '立即跳转更新',
|
||||||
|
downLoadBtnText: '立即下载更新',
|
||||||
|
downLoadingText: '安装包下载中,请稍后'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad({
|
||||||
|
local_storage_key
|
||||||
|
}) {
|
||||||
|
if (!local_storage_key) {
|
||||||
|
console.error('local_storage_key为空,请检查后重试')
|
||||||
|
uni.navigateBack()
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
const localPackageInfo = uni.getStorageSync(local_storage_key);
|
||||||
|
if (!localPackageInfo) {
|
||||||
|
console.error('安装包信息为空,请检查后重试')
|
||||||
|
uni.navigateBack()
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
const requiredKey = ['version', 'url', 'type']
|
||||||
|
for (let key in localPackageInfo) {
|
||||||
|
if (requiredKey.indexOf(key) !== -1 && !localPackageInfo[key]) {
|
||||||
|
console.error(`参数 ${key} 必填,请检查后重试`)
|
||||||
|
uni.navigateBack()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, localPackageInfo)
|
||||||
|
this.checkLocalStoragePackage()
|
||||||
|
},
|
||||||
|
onBackPress() {
|
||||||
|
// 强制更新不允许返回
|
||||||
|
if (this.is_mandatory) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadTask && downloadTask.abort()
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
openSchemePromise = null
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isWGT() {
|
||||||
|
return this.type === 'wgt'
|
||||||
|
},
|
||||||
|
isiOS() {
|
||||||
|
return !this.isWGT ? this.platform.includes(platform_iOS) : false;
|
||||||
|
},
|
||||||
|
isAppStore() {
|
||||||
|
return this.isiOS || (!this.isiOS && !this.isWGT && this.url.indexOf('.apk') === -1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkLocalStoragePackage() {
|
||||||
|
// 如果已经有下载好的包,则直接提示安装
|
||||||
|
const localFilePathRecord = uni.getStorageSync(localFilePathKey)
|
||||||
|
if (localFilePathRecord) {
|
||||||
|
const {
|
||||||
|
version,
|
||||||
|
savedFilePath,
|
||||||
|
installed
|
||||||
|
} = localFilePathRecord
|
||||||
|
|
||||||
|
// 比对版本
|
||||||
|
if (!installed && compare(version, this.version) === 0) {
|
||||||
|
this.downloadSuccess = true;
|
||||||
|
this.installForBeforeFilePath = savedFilePath;
|
||||||
|
this.tempFilePath = savedFilePath
|
||||||
|
} else {
|
||||||
|
// 如果保存的包版本小 或 已安装过,则直接删除
|
||||||
|
this.deleteSavedFile(savedFilePath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async closeUpdate() {
|
||||||
|
if (this.downloading) {
|
||||||
|
if (this.is_mandatory) {
|
||||||
|
return uni.showToast({
|
||||||
|
title: '下载中,请稍后……',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 500
|
||||||
|
})
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '是否取消下载?',
|
||||||
|
cancelText: '否',
|
||||||
|
confirmText: '是',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
downloadTask && downloadTask.abort()
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.downloadSuccess && this.tempFilePath) {
|
||||||
|
// 包已经下载完毕,稍后安装,将包保存在本地
|
||||||
|
await this.saveFile(this.tempFilePath, this.version)
|
||||||
|
uni.navigateBack()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
updateApp() {
|
||||||
|
this.checkStoreScheme().catch(() => {
|
||||||
|
this.downloadPackage()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 跳转应用商店
|
||||||
|
checkStoreScheme() {
|
||||||
|
const storeList = (this.store_list || []).filter(item => item.enable)
|
||||||
|
if (storeList && storeList.length) {
|
||||||
|
storeList
|
||||||
|
.sort((cur, next) => next.priority - cur.priority)
|
||||||
|
.map(item => item.scheme)
|
||||||
|
.reduce((promise, cur, curIndex) => {
|
||||||
|
openSchemePromise = (promise || (promise = Promise.reject())).catch(() => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.runtime.openURL(cur, (err) => {
|
||||||
|
reject(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return openSchemePromise
|
||||||
|
}, openSchemePromise)
|
||||||
|
return openSchemePromise
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.reject()
|
||||||
|
},
|
||||||
|
downloadPackage() {
|
||||||
|
this.downloading = true;
|
||||||
|
|
||||||
|
//下载包
|
||||||
|
downloadTask = uni.downloadFile({
|
||||||
|
url: this.url,
|
||||||
|
success: res => {
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
this.downloadSuccess = true;
|
||||||
|
// fix: wgt 文件下载完成后后缀不是 wgt
|
||||||
|
// if (this.isWGT && res.tempFilePath.split('.').slice(-1) !== 'wgt') {
|
||||||
|
if (this.isWGT && res.tempFilePath.split('.').slice(-1)[0] !== 'wgt'){
|
||||||
|
const failCallback = (e) => {
|
||||||
|
console.log('[FILE RENAME FAIL]:', JSON.stringify(e));
|
||||||
|
}
|
||||||
|
plus.io.resolveLocalFileSystemURL(res.tempFilePath, function(entry) {
|
||||||
|
entry.getParent((parent) => {
|
||||||
|
const newName = `new_wgt_${Date.now()}.wgt`
|
||||||
|
entry.copyTo(parent, newName, (res) => {
|
||||||
|
this.tempFilePath = res.fullPath
|
||||||
|
this.downLoadComplete()
|
||||||
|
}, failCallback)
|
||||||
|
}, failCallback)
|
||||||
|
}, failCallback);
|
||||||
|
} else {
|
||||||
|
this.tempFilePath = res.tempFilePath
|
||||||
|
this.downLoadComplete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
downloadTask.onProgressUpdate(res => {
|
||||||
|
this.downLoadPercent = res.progress;
|
||||||
|
this.downloadedSize = (res.totalBytesWritten / Math.pow(1024, 2)).toFixed(2);
|
||||||
|
this.packageFileSize = (res.totalBytesExpectedToWrite / Math.pow(1024, 2)).toFixed(2);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
downLoadComplete() {
|
||||||
|
this.downloading = false;
|
||||||
|
|
||||||
|
this.downLoadPercent = 0
|
||||||
|
this.downloadedSize = 0
|
||||||
|
this.packageFileSize = 0
|
||||||
|
|
||||||
|
downloadTask = null;
|
||||||
|
|
||||||
|
// 强制更新,直接安装
|
||||||
|
if (this.is_mandatory) {
|
||||||
|
this.installPackage();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
installPackage() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// wgt资源包安装
|
||||||
|
if (this.isWGT) {
|
||||||
|
this.installing = true;
|
||||||
|
}
|
||||||
|
plus.runtime.install(this.tempFilePath, {
|
||||||
|
force: false
|
||||||
|
}, async res => {
|
||||||
|
this.installing = false;
|
||||||
|
this.installed = true;
|
||||||
|
|
||||||
|
// wgt包,安装后会提示 安装成功,是否重启
|
||||||
|
if (this.isWGT) {
|
||||||
|
// 强制更新安装完成重启
|
||||||
|
if (this.is_mandatory) {
|
||||||
|
uni.showLoading({
|
||||||
|
icon: 'none',
|
||||||
|
title: '安装成功,正在重启……'
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.restart();
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const localFilePathRecord = uni.getStorageSync(localFilePathKey)
|
||||||
|
uni.setStorageSync(localFilePathKey, {
|
||||||
|
...localFilePathRecord,
|
||||||
|
installed: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, async err => {
|
||||||
|
// 如果是安装之前的包,安装失败后删除之前的包
|
||||||
|
if (this.installForBeforeFilePath) {
|
||||||
|
await this.deleteSavedFile(this.installForBeforeFilePath)
|
||||||
|
this.installForBeforeFilePath = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 安装失败需要重新下载安装包
|
||||||
|
this.installing = false;
|
||||||
|
this.installed = false;
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: '更新失败,请重新下载',
|
||||||
|
content: err.message,
|
||||||
|
showCancel: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 非wgt包,安装跳出覆盖安装,此处直接返回上一页
|
||||||
|
if (!this.isWGT && !this.is_mandatory) {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
restart() {
|
||||||
|
this.installed = false;
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
//更新完重启app
|
||||||
|
plus.runtime.restart();
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
saveFile(tempFilePath, version) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.saveFile({
|
||||||
|
tempFilePath,
|
||||||
|
success({
|
||||||
|
savedFilePath
|
||||||
|
}) {
|
||||||
|
uni.setStorageSync(localFilePathKey, {
|
||||||
|
version,
|
||||||
|
savedFilePath
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deleteSavedFile(filePath) {
|
||||||
|
uni.removeStorageSync(localFilePathKey)
|
||||||
|
return uni.removeSavedFile({
|
||||||
|
filePath
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToAppStore() {
|
||||||
|
plus.runtime.openURL(this.url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-center {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mask {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: rgba(0, 0, 0, .65);
|
||||||
|
}
|
||||||
|
|
||||||
|
.botton-radius {
|
||||||
|
border-bottom-left-radius: 30rpx;
|
||||||
|
border-bottom-right-radius: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
width: 600rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 50rpx;
|
||||||
|
font-family: Source Han Sans CN;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: block;
|
||||||
|
/* #endif */
|
||||||
|
line-height: 200px;
|
||||||
|
text-align: center;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-top {
|
||||||
|
position: absolute;
|
||||||
|
top: -195rpx;
|
||||||
|
left: 0;
|
||||||
|
width: 600rpx;
|
||||||
|
height: 270rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-top-text {
|
||||||
|
font-size: 45rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #F8F8FA;
|
||||||
|
position: absolute;
|
||||||
|
top: 120rpx;
|
||||||
|
left: 50rpx;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-header {
|
||||||
|
height: 70rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 33rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #3DA7FF;
|
||||||
|
line-height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
height: 150rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-des-scroll {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 40rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-des {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #000000;
|
||||||
|
line-height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-box {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
width: 90%;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-img {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
z-index: 1000;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -120rpx;
|
||||||
|
left: calc(50% - 70rpx / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-button {
|
||||||
|
text-align: center;
|
||||||
|
flex: 1;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
margin: 0 18rpx;
|
||||||
|
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
|
||||||
|
background: linear-gradient(to right, #1785ff, #3DA7FF);
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-column {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
126
uni_modules/uni-upgrade-center-app/readme.md
Normal file
126
uni_modules/uni-upgrade-center-app/readme.md
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
## 升级中心 - app插件与 `uni-admin` 版本关系
|
||||||
|
|
||||||
|
### `uni-admin >= 1.9.3`:云函数 `checkVersion` 废弃,使用 uni-admin 自带的 `uni-upgrade-center` 云函数。
|
||||||
|
|
||||||
|
# uni-upgrade-center - App
|
||||||
|
|
||||||
|
### 概述
|
||||||
|
|
||||||
|
> 统一管理App及App在`Android`、`iOS`平台上`App安装包`和`wgt资源包`的发布升级
|
||||||
|
|
||||||
|
> uni升级中心分为业务插件和后台管理插件。本插件为业务插件,包括uni升级中心客户端检查更新的前后端逻辑。后台管理系统另见 [uni-upgrade-center - Admin](https://ext.dcloud.net.cn/plugin?id=4470)
|
||||||
|
|
||||||
|
### uni升级中心 - 客户端检查更新插件
|
||||||
|
- 一键式检查更新,同时支持整包升级与wgt资源包更新
|
||||||
|
- 好看、实用、可自定义的客户端提示框
|
||||||
|
|
||||||
|
## 安装指引
|
||||||
|
|
||||||
|
1. 依赖数据库`opendb-app-versions`,如果没有此库,请在云服务空间中创建。
|
||||||
|
|
||||||
|
2. 使用`HBuilderX 3.1.0+`,因为要使用到`uni_modules`
|
||||||
|
|
||||||
|
3. 在插件市场打开本插件页面,在右侧点击`使用 HBuilderX 导入插件`,选择要导入的项目点击确定
|
||||||
|
|
||||||
|
4. 绑定一个服务空间。自 `0.6.0` 起,依赖 `uni-admin 1.9.3+` 的 `uni-upgrade-center 云函数`,请和 uni-admin 项目关联同一个服务空间
|
||||||
|
|
||||||
|
5. 找到`/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version`,右键上传部署。自 `0.6.0` 起,依赖 `uni-admin 1.9.3+` 的 `uni-upgrade-center 云函数`,插件不再单独提供云函数,这样可以省下一个云函数名额。
|
||||||
|
|
||||||
|
6. 在`pages.json`中添加页面路径。**注:请不要设置为pages.json中第一项**
|
||||||
|
```json
|
||||||
|
"pages": [
|
||||||
|
// ……其他页面配置
|
||||||
|
{
|
||||||
|
"path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
|
||||||
|
"style": {
|
||||||
|
"disableScroll": true,
|
||||||
|
"app-plus": {
|
||||||
|
"backgroundColorTop": "transparent",
|
||||||
|
"background": "transparent",
|
||||||
|
"titleNView": false,
|
||||||
|
"scrollIndicator": false,
|
||||||
|
"popGesture": "none",
|
||||||
|
"animationType": "fade-in",
|
||||||
|
"animationDuration": 200
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
7. 将`@/uni_modules/uni-upgrade-center-app/utils/check-update`import到需要用到的地方,调用一下即可
|
||||||
|
1. 默认使用当前绑定的服务空间,如果要请求其他服务空间,可以使用其他服务空间的 `callFunction`。[详情](https://uniapp.dcloud.io/uniCloud/cf-functions.html#call-by-function-cross-space)
|
||||||
|
|
||||||
|
8. 升级弹框可自行编写,也可以使用`uni.showModal`,或使用现有的升级弹框样式,如果不满足UI需求请自行替换资源文件。在`utils/check-update.js`中都有实例。
|
||||||
|
|
||||||
|
9. wgt更新时,打包前请务必将manifest.json中的版本修改为更高版本。
|
||||||
|
|
||||||
|
### 更新下载安装`check-update.js`
|
||||||
|
|
||||||
|
*该函数在utils目录下*
|
||||||
|
|
||||||
|
1. 如果是静默更新,则不会打开更新弹框,会在后台下载后安装,下次启动应用生效
|
||||||
|
|
||||||
|
2. 如果是 iOS,则会直接打开AppStore的链接
|
||||||
|
|
||||||
|
3. 其他情况,会将`check-version`返回的结果保存在localStorage中,并跳转进入`upgrade-popup.vue`打开更新弹框
|
||||||
|
|
||||||
|
### 检查更新函数`check-version`
|
||||||
|
|
||||||
|
*该函数在uniCloud/cloudfunctions目录下*
|
||||||
|
|
||||||
|
1. 使用检查更新需要传递三个参数 `appid`、`appVersion`、`wgtVersion`
|
||||||
|
|
||||||
|
2. `appid` 使用 plus.runtime.appid 获取,*注:真机运行时为固定值HBuilder,在调试的时候请使用本地调试云函数*
|
||||||
|
|
||||||
|
3. `appVersion` 使用 plus.runtime.version 获取
|
||||||
|
|
||||||
|
4. `wgtVersion` 使用 plus.runtime.getProperty(plus.runtime.appid,(wgtInfo) => { wgtInfo.version }) 获取
|
||||||
|
|
||||||
|
5. `check-version`云函数内部会自动获取 App 平台
|
||||||
|
|
||||||
|
|
||||||
|
**Tips**
|
||||||
|
|
||||||
|
1. `check-version`云函数内部有版本对比函数(compare)。
|
||||||
|
- 使用多段式版本格式(如:"3.0.0.0.0.1.0.1", "3.0.0.0.0.1")。如果不满足对比规则,请自行修改。
|
||||||
|
- 如果修改,请将*pages/upgrade-popup.vue*中*compare*函数一并修改
|
||||||
|
|
||||||
|
## 项目代码说明
|
||||||
|
|
||||||
|
### 更新弹框
|
||||||
|
- `upgrade-popup.vue` - 更新应用:
|
||||||
|
- 如果云函数`check-version`返回的参数表明需要更新,则将参数保存在localStorage中,带着键值跳转该页面
|
||||||
|
- 进入时会先从localStorage中尝试取出之前存的安装包路径(此包不会是强制安装类型的包)
|
||||||
|
- 如果有已经保存的包,则和传进来的 `version` 进行比较,如果相等则安装。大于和小于都不进行安装,因为admin端可能会调整包的版本。不符合更新会将此包删除
|
||||||
|
- 如果本地没有包或者包不符合安装条件,则进行下载安装包
|
||||||
|
- 点击下载会有进度条、已下载大小和下载包的大小
|
||||||
|
- 下载完成会提示安装:
|
||||||
|
- 如果是 wgt 包,安装时则会提示 正在安装…… 和 安装完成。安装完成会提示是否重启
|
||||||
|
- 如果是 原生安装包,则直接跳出去覆盖安装
|
||||||
|
- 下载过程中,如果退出会提示是否取消下载。如果是强制更新,则只会提示正在下载请稍后,此时不可退出
|
||||||
|
- 如果是下载完成了没有安装就退出,则会将下载完成的包保存在本地。将包的本地路径和包version保存在localStorage中
|
||||||
|
|
||||||
|
### 工具类 utils
|
||||||
|
- `call-check-version`
|
||||||
|
- 请求云函数`check-version`拿取版本检测结果
|
||||||
|
- `check-update`
|
||||||
|
- 调用`call-check-version`并根据结果判断是否显示更新弹框
|
||||||
|
|
||||||
|
### 云函数
|
||||||
|
- `check-version` - 检查应用更新:
|
||||||
|
- 根据传参,先检测传参是否完整,appid appVersion wgtVersion 必传
|
||||||
|
- 先从数据库取出所有该平台(会从上下文读取平台信息)的所有线上发行更新
|
||||||
|
- 再从所有线上发行更新中取出版本最大的一版。如果可以,尽量先检测wgt的线上发行版更新
|
||||||
|
- 使用上一步取出的版本包的版本号 和传参 appVersion、wgtVersion 来检测是否有更新。必须同时大于这两项,因为上一次可能是wgt热更新,否则返回暂无更新
|
||||||
|
- 如果库中 wgt包 版本大于传参 appVersion,但是不满足 min_uni_version < appVersion,则不会使用wgt更新,会接着判断库中 app包version 是否大于 appVersion
|
||||||
|
- 返回结果:
|
||||||
|
|
||||||
|
|code|message|
|
||||||
|
|:-:|:-:|
|
||||||
|
|0|当前版本已经是最新的,不需要更新|
|
||||||
|
|101|wgt更新|
|
||||||
|
|102|整包更新|
|
||||||
|
|-101|暂无更新或检查appid是否填写正确|
|
||||||
|
|-102|请检查传参是否填写正确|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
export default function() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
|
||||||
|
let data = {
|
||||||
|
action: 'checkVersion',
|
||||||
|
appid: plus.runtime.appid,
|
||||||
|
appVersion: plus.runtime.version,
|
||||||
|
wgtVersion: widgetInfo.version
|
||||||
|
}
|
||||||
|
uniCloud.callFunction({
|
||||||
|
name: 'uni-upgrade-center',
|
||||||
|
data,
|
||||||
|
success: (e) => {
|
||||||
|
console.log("e: ", e);
|
||||||
|
resolve(e)
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
reject({
|
||||||
|
message: '请在App中使用'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
158
uni_modules/uni-upgrade-center-app/utils/check-update.js
Normal file
158
uni_modules/uni-upgrade-center-app/utils/check-update.js
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
import callCheckVersion from './call-check-version'
|
||||||
|
|
||||||
|
// 推荐再App.vue中使用
|
||||||
|
const PACKAGE_INFO_KEY = '__package_info__'
|
||||||
|
|
||||||
|
export default function() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
callCheckVersion().then(async (e) => {
|
||||||
|
if (!e.result) return;
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
message,
|
||||||
|
is_silently, // 是否静默更新
|
||||||
|
url, // 安装包下载地址
|
||||||
|
platform, // 安装包平台
|
||||||
|
type // 安装包类型
|
||||||
|
} = e.result;
|
||||||
|
|
||||||
|
// 此处逻辑仅为实例,可自行编写
|
||||||
|
if (code > 0) {
|
||||||
|
// 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
|
||||||
|
const {
|
||||||
|
fileList
|
||||||
|
} = await uniCloud.getTempFileURL({
|
||||||
|
fileList: [url]
|
||||||
|
});
|
||||||
|
if (fileList[0].tempFileURL)
|
||||||
|
e.result.url = fileList[0].tempFileURL;
|
||||||
|
|
||||||
|
resolve(e)
|
||||||
|
|
||||||
|
// 静默更新,只有wgt有
|
||||||
|
if (is_silently) {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: e.result.url,
|
||||||
|
success: res => {
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
// 下载好直接安装,下次启动生效
|
||||||
|
plus.runtime.install(res.tempFilePath, {
|
||||||
|
force: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提示升级一
|
||||||
|
* 使用 uni.showModal
|
||||||
|
*/
|
||||||
|
// return updateUseModal(e.result)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提示升级二
|
||||||
|
* 官方适配的升级弹窗,可自行替换资源适配UI风格
|
||||||
|
*/
|
||||||
|
uni.setStorageSync(PACKAGE_INFO_KEY, e.result)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/uni_modules/uni-upgrade-center-app/pages/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('更新弹框跳转失败', err)
|
||||||
|
uni.removeStorageSync(PACKAGE_INFO_KEY)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return
|
||||||
|
} else if (code < 0) {
|
||||||
|
// TODO 云函数报错处理
|
||||||
|
console.error(message)
|
||||||
|
return reject(e)
|
||||||
|
}
|
||||||
|
return resolve(e)
|
||||||
|
}).catch(err => {
|
||||||
|
// TODO 云函数报错处理
|
||||||
|
console.error(err.message)
|
||||||
|
reject(err)
|
||||||
|
})
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用 uni.showModal 升级
|
||||||
|
*/
|
||||||
|
function updateUseModal(packageInfo) {
|
||||||
|
const {
|
||||||
|
title, // 标题
|
||||||
|
contents, // 升级内容
|
||||||
|
is_mandatory, // 是否强制更新
|
||||||
|
url, // 安装包下载地址
|
||||||
|
platform, // 安装包平台
|
||||||
|
type // 安装包类型
|
||||||
|
} = packageInfo;
|
||||||
|
|
||||||
|
let isWGT = type === 'wgt'
|
||||||
|
let isiOS = !isWGT ? platform.includes('iOS') : false;
|
||||||
|
let confirmText = isiOS ? '立即跳转更新' : '立即下载更新'
|
||||||
|
|
||||||
|
return uni.showModal({
|
||||||
|
title,
|
||||||
|
content: contents,
|
||||||
|
showCancel: !is_mandatory,
|
||||||
|
confirmText,
|
||||||
|
success: res => {
|
||||||
|
if (res.cancel) return;
|
||||||
|
|
||||||
|
// 安装包下载
|
||||||
|
if (isiOS) {
|
||||||
|
plus.runtime.openURL(url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: '后台下载中……',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
|
||||||
|
// wgt 和 安卓下载更新
|
||||||
|
downloadTask = uni.downloadFile({
|
||||||
|
url,
|
||||||
|
success: res => {
|
||||||
|
if (res.statusCode !== 200) {
|
||||||
|
console.error('下载安装包失败', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 下载好直接安装,下次启动生效
|
||||||
|
plus.runtime.install(res.tempFilePath, {
|
||||||
|
force: false
|
||||||
|
}, () => {
|
||||||
|
if (is_mandatory) {
|
||||||
|
//更新完重启app
|
||||||
|
plus.runtime.restart();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '安装成功是否重启?',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
//更新完重启app
|
||||||
|
plus.runtime.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, err => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '更新失败',
|
||||||
|
content: err
|
||||||
|
.message,
|
||||||
|
showCancel: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user