35 Commits

Author SHA1 Message Date
5c9d7b89b2 修复:查看图书详情后返回首页屏幕定位问题、及选择的图书标签返回后会重置选择第一个 2025-12-31 16:40:30 +08:00
24b63154af 1.更改文字错误;2.修复首页“标签图书”刷新异常 2025-12-12 14:20:59 +08:00
liuyuan
0b849c9508 提交 2025-09-08 10:51:27 +08:00
liuyuan
3254d33cd0 修改问题 2025-07-01 16:37:29 +08:00
liuyuan
93d1834feb 618活动修改 2025-06-12 17:07:43 +08:00
liuyuan
742151ec5e 618活动修改充值、天医币、积分 2025-06-12 14:46:28 +08:00
liuyuan
e415f34fa8 提交 2025-06-12 14:26:50 +08:00
liuyuan
9a2c26ace8 提交 2025-04-11 10:30:47 +08:00
d1b9024fb1 提交 2025-03-19 15:05:33 +08:00
a2bf3311f9 tijiao 2025-02-27 10:06:26 +08:00
8135b187a9 提交 2024-12-09 11:23:21 +08:00
9f2fe5e8a0 首页 价格显示活动价以及显示原价 2024-11-07 09:17:15 +08:00
6211bfda7c 提交 2024-11-04 18:08:04 +08:00
@fawn-nine
38c79bcd47 6 2024-09-30 15:43:46 +08:00
@fawn-nine
ce2e56bff0 评价添加数目 2024-09-30 14:46:13 +08:00
@fawn-nine
806c08174f 11 2024-09-27 17:04:35 +08:00
@fawn-nine
eedeb5c37f 修改请求时长配置 2024-08-14 16:14:10 +08:00
@fawn-nine
c348bdad91 ios隐藏充值 2024-07-25 10:44:20 +08:00
@fawn-nine
202e283817 ios付款方式调整 引入申诉反馈功能 2024-07-24 11:38:03 +08:00
@fawn-nine
3a0b5d5f9d 更换苹果支付模式 2024-07-19 13:28:31 +08:00
@fawn-nine
6f61f656d7 ios应对审核调整 2024-07-19 09:21:29 +08:00
@fawn-nine
b68ca5a615 提交 2024-07-16 12:50:58 +08:00
@fawn-nine
7487f74259 微调 2024-07-15 17:04:49 +08:00
guilinlan jin
2c7bd95cc1 mac提交 2024-07-12 16:35:47 +08:00
@fawn-nine
8da6c50ded app 内购+充值bug 2024-07-12 16:02:51 +08:00
@fawn-nine
9843424e1c 新闻跳转地址修改 2024-07-08 10:23:38 +08:00
@fawn-nine
55227e230c 设置 2024-06-14 16:30:06 +08:00
@fawn-nine
8f4ee51d7d 首页app跳转 2024-06-14 09:38:24 +08:00
@fawn-nine
b152b9154a 版本+1 2024-06-04 17:09:49 +08:00
@fawn-nine
7a7798c75a 版本+1 2024-06-03 14:02:10 +08:00
@fawn-nine
4374b2ed72 分享 首页播报 2024-06-03 11:53:59 +08:00
@fawn-nine
3b22a391c1 隐藏个人中心优惠券 2024-05-24 11:26:37 +08:00
@fawn-nine
c9837306b9 首页搜索图标宽度调整 2024-05-24 10:20:00 +08:00
@fawn-nine
5dd51e16a3 修改首页样式 2024-05-23 15:47:47 +08:00
@fawn-nine
49d42b6442 修改附件大小,清理不必要的内存 2024-05-22 10:42:16 +08:00
104 changed files with 15887 additions and 4921 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.DS_Store
.hbuilderx/
node_modules
unpackage/dist
unpackage/release

View File

@@ -4,6 +4,9 @@
"version" : "0.0",
"configurations" : [
{
"app" : {
"launchtype" : "local"
},
"app-plus" : {
"launchtype" : "remote"
},
@@ -20,7 +23,7 @@
"type" : "uniCloud"
},
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-ios"
},
{

560
App.vue
View File

@@ -1,292 +1,310 @@
<script>
import {
music,
bgm
} from '@/utils/music.js'
import store from '@/store/index.js';
import socket from '@/config/socket';
// #ifdef H5
import {
h5Login
} 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 {
data(){
return{
platform:null, // 系统
}
},
onLaunch: function(e) {
// 检测自动更新
// #ifdef APP-PLUS
updata()
// #endif
import { music, bgm } from "@/utils/music.js";
import { iap } from "@/utils/myIapCheck.js";
import store from "@/store/index.js";
import socket from "@/config/socket";
// #ifdef H5
import { h5Login } 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";
uni.getSystemInfo({
success(res) {
Vue.prototype.winWidth = res.screenWidth
Vue.prototype.winHeight = res.screenHeight
}
})
export default {
data() {
return {
lastCheckTime: 0, // 记录上一次检查时间
platform: null, // 系统
};
},
onLaunch: function (e) {
// 检测自动更新
// #ifdef APP-PLUS
// updata();
// 检测是否有未关闭苹果内购订单
// iap.getChannels();
// console.log('引入了?');
// #endif
// 取出初始播放信息
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.getSystemInfo({
success(res) {
Vue.prototype.winWidth = res.screenWidth;
Vue.prototype.winHeight = res.screenHeight;
},
});
},
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
});
}
});
// end
// 取出播放弹窗显示或者隐藏
uni.getStorage({
key: 'playVisible',
success: function(res) {
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) {
// #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: {
}
};
// 取出初始播放信息
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,
});
},
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,
});
},
});
// end
// 取出播放弹窗显示或者隐藏
uni.getStorage({
key: "playVisible",
success: function (res) {
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) {
const interval = 1000 * 60 * 60 * 6; // 检查间隔单位毫秒此处为6小时
const currentTime = Date.now();
if (currentTime - this.lastCheckTime > interval) {
this.lastCheckTime = currentTime; // 更新上一次检查时间
updata();
} else {
console.log("距离上次检查时间过短,不重复检查");
}
// #ifdef APP-PLUS
// 检测是否有未关闭苹果内购订单
iap.getChannels();
// console.log('引入了?');
// #endif
// console.log(plus.runtime.arguments, 'plus.runtime.arguments-----')
// #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: {},
};
</script>
<style lang="scss">
@import "uview-ui/index.scss";
/* #ifndef APP-NVUE */
@import './style/common.scss';
@import './style/input.scss';
@import './style/table.scss';
@import "uview-ui/index.scss";
/* #ifndef APP-NVUE */
@import "./style/common.scss";
@import "./style/input.scss";
@import "./style/table.scss";
page {
height: 100%;
background-color: #f7faf9;
}
page {
height: 100%;
background-color: #f7faf9;
}
/* #endif */
/* #endif */
/* #ifdef H5 */
//修复H5底部导航挡住内容bug
uni-app {
height: auto;
}
/* #ifdef H5 */
//修复H5底部导航挡住内容bug
uni-app {
height: auto;
}
/*每个页面公共css */
@font-face {
font-family: 'iconfont';
/* project id 1997429 */
src: url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot');
src: url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot?#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff2') format('woff2'),
url('https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff') format('woff'),
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');
}
/*每个页面公共css */
@font-face {
font-family: "iconfont";
/* project id 1997429 */
src: url("https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot");
src: url("https://at.alicdn.com/t/font_1997429_8xzvctxta3u.eot?#iefix")
format("embedded-opentype"),
url("https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff2")
format("woff2"),
url("https://at.alicdn.com/t/font_1997429_8xzvctxta3u.woff") format("woff"),
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;
}
.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
.uni-input-form {
height: 100%;
}
//修复H5输入框上下不居中bug
.uni-input-form {
height: 100%;
}
//去除地图上高德地图标识符
.amap-copyright {
display: none !important;
}
//去除地图上高德地图标识符
.amap-copyright {
display: none !important;
}
.amap-logo {
display: none !important;
}
.amap-logo {
display: none !important;
}
.amap-ui-control-zoom {
width: 60upx !important;
}
.amap-ui-control-zoom {
width: 60upx !important;
}
.amap-ui-control-zoom>* {
width: 60upx !important;
height: 60upx !important;
line-height: 60upx !important;
}
.amap-ui-control-zoom > * {
width: 60upx !important;
height: 60upx !important;
line-height: 60upx !important;
}
.amap-ui-control-theme-dark {
display: none !important;
}
.amap-ui-control-theme-dark {
display: none !important;
}
//设置圆角
checkbox.round .wx-checkbox-input,
checkbox.round .uni-checkbox-input {
border-radius: 100upx;
}
//设置圆角
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;
}
//设置背景色
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>
/* #endif */
</style>

37
common/appcomact.js Normal file
View File

@@ -0,0 +1,37 @@
export function getItem(key){
// #ifdef APP-PLUS
return plus.storage.getItem(key);
// #endif
// #ifdef APP-PLUS
return uni.getStorageSync(key);
// #endif
};
export function setItem(key,value){
// #ifdef APP-PLUS
return plus.storage.setItem(key,value);
// #endif
// #ifdef APP-PLUS
return uni.setStorageSync(key,value);
// #endif
};
export function removeItem(key){
// #ifdef APP-PLUS
return plus.storage.removeItem(key)
// #endif
// #ifdef APP-PLUS
return uni.removeStorageSync(key);
// #endif
};
export function setFullscreen(type){
// #ifdef APP-PLUS
plus.navigator.setFullscreen(type);
// #endif
// #ifndef APP-PLUS
return false;
// #endif
}

142
common/commonJS.js Normal file
View File

@@ -0,0 +1,142 @@
import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'
import $http from '@/config/requestConfig'
import { mapState, mapMutations } from "vuex";
export default {
...mapMutations(["setUserInfo"]),
showToast(title, icon) {
return uni.showToast({
title: title,
icon: icon ? icon : 'none'
})
},
//拨打电话
handleMakingPhoneCalls(value, title) {
uni.showModal({
title: title ? title : '联系我们',
content: value,
confirmText: '确认',
success(res) {
if (res.confirm) {
uni.makePhoneCall({
phoneNumber: value, //电话号码
success: function (e) {
console.log(e);
},
fail: function (e) {
console.log(e);
}
})
}
}
})
},
//复制内容
handleCopy(value, title) {
uniCopy({
content: value,
success: (res) => {
uni.showToast({
title: title + '复制成功',
icon: 'none'
})
},
error: (e) => {
}
})
},
//用户协议
async getAgreement(id) {
console.log('id at line 56:', id)
var data = {
id: id
}
var result = {
title:'',
content:''
}
await $http
.request({
url: "sys/agreement/getAgreement",
method: "POST",
data: data,
header: {
"Content-Type": "application/json",
},
}).then((res) => {
console.log('res at line 111:', res)
if (res.code == 0) {
result = res.agreement
}
})
return result
},
async getCheckCourseStatus(data) {
var result
await $http
.post('app/phone.do?getCheckCourseStatus', {
customerType
:
"D",
token
: uni.getStorageSync("token")
,
customerOid
: uni.getStorageSync("customerOid"),
oid: data.oid
})
.then(async res => {
result = res.obj
})
return result
},
// 退出登录
signOut() {
uni.showModal({
title: "提示",
content: "确定要退出当前账户吗?",
success: function (res) {
if (res.confirm) {
setUserInfo({ token: null });
uni.reLaunch({
url: "/pages/user/login",
});
} else if (res.cancel) {
// 取消操作
}
},
});
},
// 注销账户
logout() {
let that = this;
uni.showModal({
title: "提示",
content: "确定要注销当前账户吗?",
success: function (res) {
if (res.confirm) {
uni.showModal({
title: "提示",
showCancel: false,
content: `注销申请已提交成功,请联系客服进行后续操作022-24142321`,
success: function (res1) {
if (res1.confirm) {
that.signOut();
}
},
});
} else if (res.cancel) {
// 取消操作
}
},
});
},
}

58
common/http.api.js Normal file
View File

@@ -0,0 +1,58 @@
// 如果没有通过拦截器配置域名的话可以在这里写上完整的URL(加上域名部分)
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作更多内容详见uView对拦截器的介绍部分
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
// 此处没有使用传入的params参数
// 此处使用了传入的params参数一切自定义即可
let getByViews = (params = {}) => vm.$u.post('/api/getbooklistbyviews', params);
let getByTime = (params = {}) => vm.$u.post('/api/getbooklistbytime', params);
// 图书详情和目录
let getDetail = (params = {}) => vm.$u.post('/api/getbookinfo', params);
// 首页banner
let getBanner = (params = {}) => vm.$u.post('/api/getbanner', params);
// 获取分类信息
let getCategorys = (params = {}) => vm.$u.post('/api/categorylist', params);
// 根据分类名字获取图书
let getByCname = (params = {}) => vm.$u.post('/api/getbooklistbycategory', params);
let getByCid = (params = {}) => vm.$u.post('/api/getbooklistbycid', params);
let getRankList = (params = {}) => vm.$u.post('/api/getbooklistbyrank', params);
let getText = (params = {}) => vm.$u.post('/api/getcontent', params);
let getSearch = (params = {}) => vm.$u.post('/api/search', params);
// 更新阅读量
let updateViews = (params = {}) => vm.$u.post('/api/updateviews', params);
// 注册or登录
let loginto = (params = {}) => vm.$u.post('/member/login', params);
// 修改密码
let editpass = (params = {}) => vm.$u.post('/member/editpass', params);
vm.$u.api = {
getByViews,
getByTime,
getBanner,
getCategorys,
getByCname,
getByCid,
getRankList,
getDetail,
getText,
getSearch,
updateViews,
loginto,
editpass
};
}
export default {
install
}

View File

@@ -0,0 +1,68 @@
import md5 from './md5.js'
// 这里的vm就是我们在vue文件里面的this所以我们能在这里获取vuex的变量比如存放在里面的token
// 同时我们也可以在此使用getApp().globalData如果你把token放在getApp().globalData的话也是可以使用的
const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({
baseUrl: vm.apidomain,
// 如果将此值设置为true拦截回调中将会返回服务端返回的所有数据response而不是response.data
// 设置为true后就需要在this.$u.http.interceptor.response进行多一次的判断请打印查看具体值
// originalData: true,
// 设置自定义头部content-type
header: {
'content-type': 'application/x-www-form-urlencoded'
}
});
// 请求拦截配置Token等参数
Vue.prototype.$u.http.interceptor.request = (config) => {
// config.header.Token = 'xxxxxx';
// 方式一存放在vuex的token假设使用了uView封装的vuex方式https://uviewui.com/components/globalVariable.html
// config.header.token = vm.token;
// 方式二如果没有使用uView封装的vuex方法那么需要使用$store.state获取
// config.header.token = vm.$store.state.token;
// 方式三如果token放在了globalData通过getApp().globalData获取
// config.header.token = getApp().globalData.username;
// 方式四如果token放在了Storage本地存储中拦截是每次请求都执行的所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
// const token = uni.getStorageSync('token');
// config.header.token = token;
// const token = uni.getStorageSync('access_token');
// if(token){
// config.header.access_token = token;
// // config.header.Token = 'xxxxxx';
// }
if (config.data) {
let tmp = uni.getStorageSync('lifeData');
if(tmp['vuex_uid']){
config.data['userid'] = tmp['vuex_uid']
}
if(tmp['vuex_token']){
config.data['token'] = tmp['vuex_token']
}
}
// console.log(config);
return config;
}
// 响应拦截,判断状态码是否通过
Vue.prototype.$u.http.interceptor.response = (res) => {
if (typeof res.status !== 'undefined') {
// res为服务端返回值可能有coderesult等字段
// 这里对res.result进行返回将会在this.$u.post(url).then(res => {})的then回调中的res的到
// 如果配置了originalData为true请留意这里的返回值
return res;
} else {
// vm.$u.toast('抱歉出错了:' + res)
// console.log('httpinert.js', res);
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值
return false;
}
}
}
export default {
install
}

695
common/md5.js Normal file
View File

@@ -0,0 +1,695 @@
/**
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.7.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/
(function() {
'use strict';
var ERROR = 'input is invalid type';
var WINDOW = typeof window === 'object';
var root = WINDOW ? window : {};
if (root.JS_MD5_NO_WINDOW) {
WINDOW = false;
}
var WEB_WORKER = !WINDOW && typeof self === 'object';
var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions
.node;
if (NODE_JS) {
root = global;
} else if (WEB_WORKER) {
root = self;
}
var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && typeof module === 'object' && module.exports;
var AMD = typeof define === 'function' && define.amd;
var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
var HEX_CHARS = '0123456789abcdef'.split('');
var EXTRA = [128, 32768, 8388608, -2147483648];
var SHIFT = [0, 8, 16, 24];
var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
var blocks = [],
buffer8;
if (ARRAY_BUFFER) {
var buffer = new ArrayBuffer(68);
buffer8 = new Uint8Array(buffer);
blocks = new Uint32Array(buffer);
}
if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
Array.isArray = function(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
};
}
if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
ArrayBuffer.isView = function(obj) {
return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
};
}
/**
* @method hex
* @memberof md5
* @description Output hash as hex string
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {String} Hex string
* @example
* md5.hex('The quick brown fox jumps over the lazy dog');
* // equal to
* md5('The quick brown fox jumps over the lazy dog');
*/
/**
* @method digest
* @memberof md5
* @description Output hash as bytes array
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {Array} Bytes array
* @example
* md5.digest('The quick brown fox jumps over the lazy dog');
*/
/**
* @method array
* @memberof md5
* @description Output hash as bytes array
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {Array} Bytes array
* @example
* md5.array('The quick brown fox jumps over the lazy dog');
*/
/**
* @method arrayBuffer
* @memberof md5
* @description Output hash as ArrayBuffer
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {ArrayBuffer} ArrayBuffer
* @example
* md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
*/
/**
* @method buffer
* @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
* @memberof md5
* @description Output hash as ArrayBuffer
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {ArrayBuffer} ArrayBuffer
* @example
* md5.buffer('The quick brown fox jumps over the lazy dog');
*/
/**
* @method base64
* @memberof md5
* @description Output hash as base64 string
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {String} base64 string
* @example
* md5.base64('The quick brown fox jumps over the lazy dog');
*/
var createOutputMethod = function(outputType) {
return function(message) {
return new Md5(true).update(message)[outputType]();
};
};
/**
* @method create
* @memberof md5
* @description Create Md5 object
* @returns {Md5} Md5 object.
* @example
* var hash = md5.create();
*/
/**
* @method update
* @memberof md5
* @description Create and update Md5 object
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {Md5} Md5 object.
* @example
* var hash = md5.update('The quick brown fox jumps over the lazy dog');
* // equal to
* var hash = md5.create();
* hash.update('The quick brown fox jumps over the lazy dog');
*/
var createMethod = function() {
var method = createOutputMethod('hex');
if (NODE_JS) {
method = nodeWrap(method);
}
method.create = function() {
return new Md5();
};
method.update = function(message) {
return method.create().update(message);
};
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
var type = OUTPUT_TYPES[i];
method[type] = createOutputMethod(type);
}
return method;
};
var nodeWrap = function(method) {
var crypto = eval("require('crypto')");
var Buffer = eval("require('buffer').Buffer");
var nodeMethod = function(message) {
if (typeof message === 'string') {
return crypto.createHash('md5').update(message, 'utf8').digest('hex');
} else {
if (message === null || message === undefined) {
throw ERROR;
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
}
}
if (Array.isArray(message) || ArrayBuffer.isView(message) ||
message.constructor === Buffer) {
return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
} else {
return method(message);
}
};
return nodeMethod;
};
/**
* Md5 class
* @class Md5
* @description This is internal class.
* @see {@link md5.create}
*/
function Md5(sharedMemory) {
if (sharedMemory) {
blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
blocks[4] = blocks[5] = blocks[6] = blocks[7] =
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
this.blocks = blocks;
this.buffer8 = buffer8;
} else {
if (ARRAY_BUFFER) {
var buffer = new ArrayBuffer(68);
this.buffer8 = new Uint8Array(buffer);
this.blocks = new Uint32Array(buffer);
} else {
this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
}
}
this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
this.finalized = this.hashed = false;
this.first = true;
}
/**
* @method update
* @memberof Md5
* @instance
* @description Update hash
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {Md5} Md5 object.
* @see {@link md5.update}
*/
Md5.prototype.update = function(message) {
if (this.finalized) {
return;
}
var notString, type = typeof message;
if (type !== 'string') {
if (type === 'object') {
if (message === null) {
throw ERROR;
} else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (!Array.isArray(message)) {
if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
throw ERROR;
}
}
} else {
throw ERROR;
}
notString = true;
}
var code, index = 0,
i, length = message.length,
blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
if (this.hashed) {
this.hashed = false;
blocks[0] = blocks[16];
blocks[16] = blocks[1] = blocks[2] = blocks[3] =
blocks[4] = blocks[5] = blocks[6] = blocks[7] =
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
}
if (notString) {
if (ARRAY_BUFFER) {
for (i = this.start; index < length && i < 64; ++index) {
buffer8[i++] = message[index];
}
} else {
for (i = this.start; index < length && i < 64; ++index) {
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
}
}
} else {
if (ARRAY_BUFFER) {
for (i = this.start; index < length && i < 64; ++index) {
code = message.charCodeAt(index);
if (code < 0x80) {
buffer8[i++] = code;
} else if (code < 0x800) {
buffer8[i++] = 0xc0 | (code >> 6);
buffer8[i++] = 0x80 | (code & 0x3f);
} else if (code < 0xd800 || code >= 0xe000) {
buffer8[i++] = 0xe0 | (code >> 12);
buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
buffer8[i++] = 0xf0 | (code >> 18);
buffer8[i++] = 0x80 | ((code >> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
}
}
} else {
for (i = this.start; index < length && i < 64; ++index) {
code = message.charCodeAt(index);
if (code < 0x80) {
blocks[i >> 2] |= code << SHIFT[i++ & 3];
} else if (code < 0x800) {
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else if (code < 0xd800 || code >= 0xe000) {
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
}
}
}
}
this.lastByteIndex = i;
this.bytes += i - this.start;
if (i >= 64) {
this.start = i - 64;
this.hash();
this.hashed = true;
} else {
this.start = i;
}
}
if (this.bytes > 4294967295) {
this.hBytes += this.bytes / 4294967296 << 0;
this.bytes = this.bytes % 4294967296;
}
return this;
};
Md5.prototype.finalize = function() {
if (this.finalized) {
return;
}
this.finalized = true;
var blocks = this.blocks,
i = this.lastByteIndex;
blocks[i >> 2] |= EXTRA[i & 3];
if (i >= 56) {
if (!this.hashed) {
this.hash();
}
blocks[0] = blocks[16];
blocks[16] = blocks[1] = blocks[2] = blocks[3] =
blocks[4] = blocks[5] = blocks[6] = blocks[7] =
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
}
blocks[14] = this.bytes << 3;
blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
this.hash();
};
Md5.prototype.hash = function() {
var a, b, c, d, bc, da, blocks = this.blocks;
if (this.first) {
a = blocks[0] - 680876937;
a = (a << 7 | a >>> 25) - 271733879 << 0;
d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708;
d = (d << 12 | d >>> 20) + a << 0;
c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375;
c = (c << 17 | c >>> 15) + d << 0;
b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209;
b = (b << 22 | b >>> 10) + c << 0;
} else {
a = this.h0;
b = this.h1;
c = this.h2;
d = this.h3;
a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936;
a = (a << 7 | a >>> 25) + b << 0;
d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586;
d = (d << 12 | d >>> 20) + a << 0;
c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819;
c = (c << 17 | c >>> 15) + d << 0;
b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330;
b = (b << 22 | b >>> 10) + c << 0;
}
a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897;
a = (a << 7 | a >>> 25) + b << 0;
d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426;
d = (d << 12 | d >>> 20) + a << 0;
c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341;
c = (c << 17 | c >>> 15) + d << 0;
b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983;
b = (b << 22 | b >>> 10) + c << 0;
a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416;
a = (a << 7 | a >>> 25) + b << 0;
d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417;
d = (d << 12 | d >>> 20) + a << 0;
c += (b ^ (d & (a ^ b))) + blocks[10] - 42063;
c = (c << 17 | c >>> 15) + d << 0;
b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162;
b = (b << 22 | b >>> 10) + c << 0;
a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682;
a = (a << 7 | a >>> 25) + b << 0;
d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101;
d = (d << 12 | d >>> 20) + a << 0;
c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290;
c = (c << 17 | c >>> 15) + d << 0;
b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329;
b = (b << 22 | b >>> 10) + c << 0;
a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510;
a = (a << 5 | a >>> 27) + b << 0;
d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632;
d = (d << 9 | d >>> 23) + a << 0;
c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713;
c = (c << 14 | c >>> 18) + d << 0;
b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302;
b = (b << 20 | b >>> 12) + c << 0;
a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691;
a = (a << 5 | a >>> 27) + b << 0;
d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083;
d = (d << 9 | d >>> 23) + a << 0;
c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335;
c = (c << 14 | c >>> 18) + d << 0;
b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848;
b = (b << 20 | b >>> 12) + c << 0;
a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438;
a = (a << 5 | a >>> 27) + b << 0;
d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690;
d = (d << 9 | d >>> 23) + a << 0;
c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961;
c = (c << 14 | c >>> 18) + d << 0;
b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501;
b = (b << 20 | b >>> 12) + c << 0;
a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467;
a = (a << 5 | a >>> 27) + b << 0;
d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784;
d = (d << 9 | d >>> 23) + a << 0;
c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473;
c = (c << 14 | c >>> 18) + d << 0;
b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734;
b = (b << 20 | b >>> 12) + c << 0;
bc = b ^ c;
a += (bc ^ d) + blocks[5] - 378558;
a = (a << 4 | a >>> 28) + b << 0;
d += (bc ^ a) + blocks[8] - 2022574463;
d = (d << 11 | d >>> 21) + a << 0;
da = d ^ a;
c += (da ^ b) + blocks[11] + 1839030562;
c = (c << 16 | c >>> 16) + d << 0;
b += (da ^ c) + blocks[14] - 35309556;
b = (b << 23 | b >>> 9) + c << 0;
bc = b ^ c;
a += (bc ^ d) + blocks[1] - 1530992060;
a = (a << 4 | a >>> 28) + b << 0;
d += (bc ^ a) + blocks[4] + 1272893353;
d = (d << 11 | d >>> 21) + a << 0;
da = d ^ a;
c += (da ^ b) + blocks[7] - 155497632;
c = (c << 16 | c >>> 16) + d << 0;
b += (da ^ c) + blocks[10] - 1094730640;
b = (b << 23 | b >>> 9) + c << 0;
bc = b ^ c;
a += (bc ^ d) + blocks[13] + 681279174;
a = (a << 4 | a >>> 28) + b << 0;
d += (bc ^ a) + blocks[0] - 358537222;
d = (d << 11 | d >>> 21) + a << 0;
da = d ^ a;
c += (da ^ b) + blocks[3] - 722521979;
c = (c << 16 | c >>> 16) + d << 0;
b += (da ^ c) + blocks[6] + 76029189;
b = (b << 23 | b >>> 9) + c << 0;
bc = b ^ c;
a += (bc ^ d) + blocks[9] - 640364487;
a = (a << 4 | a >>> 28) + b << 0;
d += (bc ^ a) + blocks[12] - 421815835;
d = (d << 11 | d >>> 21) + a << 0;
da = d ^ a;
c += (da ^ b) + blocks[15] + 530742520;
c = (c << 16 | c >>> 16) + d << 0;
b += (da ^ c) + blocks[2] - 995338651;
b = (b << 23 | b >>> 9) + c << 0;
a += (c ^ (b | ~d)) + blocks[0] - 198630844;
a = (a << 6 | a >>> 26) + b << 0;
d += (b ^ (a | ~c)) + blocks[7] + 1126891415;
d = (d << 10 | d >>> 22) + a << 0;
c += (a ^ (d | ~b)) + blocks[14] - 1416354905;
c = (c << 15 | c >>> 17) + d << 0;
b += (d ^ (c | ~a)) + blocks[5] - 57434055;
b = (b << 21 | b >>> 11) + c << 0;
a += (c ^ (b | ~d)) + blocks[12] + 1700485571;
a = (a << 6 | a >>> 26) + b << 0;
d += (b ^ (a | ~c)) + blocks[3] - 1894986606;
d = (d << 10 | d >>> 22) + a << 0;
c += (a ^ (d | ~b)) + blocks[10] - 1051523;
c = (c << 15 | c >>> 17) + d << 0;
b += (d ^ (c | ~a)) + blocks[1] - 2054922799;
b = (b << 21 | b >>> 11) + c << 0;
a += (c ^ (b | ~d)) + blocks[8] + 1873313359;
a = (a << 6 | a >>> 26) + b << 0;
d += (b ^ (a | ~c)) + blocks[15] - 30611744;
d = (d << 10 | d >>> 22) + a << 0;
c += (a ^ (d | ~b)) + blocks[6] - 1560198380;
c = (c << 15 | c >>> 17) + d << 0;
b += (d ^ (c | ~a)) + blocks[13] + 1309151649;
b = (b << 21 | b >>> 11) + c << 0;
a += (c ^ (b | ~d)) + blocks[4] - 145523070;
a = (a << 6 | a >>> 26) + b << 0;
d += (b ^ (a | ~c)) + blocks[11] - 1120210379;
d = (d << 10 | d >>> 22) + a << 0;
c += (a ^ (d | ~b)) + blocks[2] + 718787259;
c = (c << 15 | c >>> 17) + d << 0;
b += (d ^ (c | ~a)) + blocks[9] - 343485551;
b = (b << 21 | b >>> 11) + c << 0;
if (this.first) {
this.h0 = a + 1732584193 << 0;
this.h1 = b - 271733879 << 0;
this.h2 = c - 1732584194 << 0;
this.h3 = d + 271733878 << 0;
this.first = false;
} else {
this.h0 = this.h0 + a << 0;
this.h1 = this.h1 + b << 0;
this.h2 = this.h2 + c << 0;
this.h3 = this.h3 + d << 0;
}
};
/**
* @method hex
* @memberof Md5
* @instance
* @description Output hash as hex string
* @returns {String} Hex string
* @see {@link md5.hex}
* @example
* hash.hex();
*/
Md5.prototype.hex = function() {
this.finalize();
var h0 = this.h0,
h1 = this.h1,
h2 = this.h2,
h3 = this.h3;
return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F];
};
/**
* @method toString
* @memberof Md5
* @instance
* @description Output hash as hex string
* @returns {String} Hex string
* @see {@link md5.hex}
* @example
* hash.toString();
*/
Md5.prototype.toString = Md5.prototype.hex;
/**
* @method digest
* @memberof Md5
* @instance
* @description Output hash as bytes array
* @returns {Array} Bytes array
* @see {@link md5.digest}
* @example
* hash.digest();
*/
Md5.prototype.digest = function() {
this.finalize();
var h0 = this.h0,
h1 = this.h1,
h2 = this.h2,
h3 = this.h3;
return [
h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF,
h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF,
h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF,
h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF
];
};
/**
* @method array
* @memberof Md5
* @instance
* @description Output hash as bytes array
* @returns {Array} Bytes array
* @see {@link md5.array}
* @example
* hash.array();
*/
Md5.prototype.array = Md5.prototype.digest;
/**
* @method arrayBuffer
* @memberof Md5
* @instance
* @description Output hash as ArrayBuffer
* @returns {ArrayBuffer} ArrayBuffer
* @see {@link md5.arrayBuffer}
* @example
* hash.arrayBuffer();
*/
Md5.prototype.arrayBuffer = function() {
this.finalize();
var buffer = new ArrayBuffer(16);
var blocks = new Uint32Array(buffer);
blocks[0] = this.h0;
blocks[1] = this.h1;
blocks[2] = this.h2;
blocks[3] = this.h3;
return buffer;
};
/**
* @method buffer
* @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
* @memberof Md5
* @instance
* @description Output hash as ArrayBuffer
* @returns {ArrayBuffer} ArrayBuffer
* @see {@link md5.buffer}
* @example
* hash.buffer();
*/
Md5.prototype.buffer = Md5.prototype.arrayBuffer;
/**
* @method base64
* @memberof Md5
* @instance
* @description Output hash as base64 string
* @returns {String} base64 string
* @see {@link md5.base64}
* @example
* hash.base64();
*/
Md5.prototype.base64 = function() {
var v1, v2, v3, base64Str = '',
bytes = this.array();
for (var i = 0; i < 15;) {
v1 = bytes[i++];
v2 = bytes[i++];
v3 = bytes[i++];
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
BASE64_ENCODE_CHAR[v3 & 63];
}
v1 = bytes[i];
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
'==';
return base64Str;
};
var exports = createMethod();
if (COMMON_JS) {
module.exports = exports;
} else {
/**
* @method md5
* @description Md5 hash function, export to global in browsers.
* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
* @returns {String} md5 hashes
* @example
* md5(''); // d41d8cd98f00b204e9800998ecf8427e
* md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
* md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
*
* // It also supports UTF-8 encoding
* md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
*
* // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
* md5([]); // d41d8cd98f00b204e9800998ecf8427e
* md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
*/
root.md5 = exports;
if (AMD) {
define(function() {
return exports;
});
}
}
})();

63
components/battery.vue Normal file
View File

@@ -0,0 +1,63 @@
<template>
<view class="battery-container">
<view class="battery-body"><view class="battery" :style="{ width: `${level}%` }"></view></view>
<view class="battery-head"></view>
</view>
</template>
<script>
export default {
props: {
level: {
type: Number,
default: 0
},
charging: {
type: Boolean,
default: false
}
},
data() {
return {};
},
mounted() {},
methods: {}
};
</script>
<style lang="scss" scoped>
.battery-container {
display: flex;
justify-content: center;
align-items: center;
width: 25px;
height: 10px;
.battery-body {
position: relative;
padding: 1px;
width: 22px;
height: 100%;
border-radius: 1px;
border: $minor-text-color solid 1px;
.battery {
height: 100%;
background-color: $minor-text-color;
}
.charging {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
height: 12px;
line-height: 12px;
font-size: 15px;
color: #333;
}
}
.battery-head {
width: 2px;
height: 6px;
background-color: $minor-text-color;
}
}
</style>

121
components/myProgress.vue Normal file
View File

@@ -0,0 +1,121 @@
<template>
<view class="progress-container">
<view class="progress-container2" id="progress" @touchstart="touchstart" @touchend="touchend" @touchmove="touchmove">
<view class="progress-box"><progress :percent="percent" activeColor="#000" backgroundColor="#1c1c1c" stroke-width="3" /></view>
<view class="ball-box" :class="{ bigger: isTouch, shadow: isTouch }" :style="{ left: `${percent}%` }"></view>
</view>
</view>
</template>
<script>
export default {
props: {
total: {
type: Number,
default: 1
},
index: {
type: Number,
default: 0
}
},
data() {
return {
left: 0, //进度条最左侧位置
right: 0, //进度条最右侧位置
isTouch: false,
// touchTimer: null, //用于触摸节流
percent: 0
};
},
watch: {
index() {
this.percent = (this.index / this.total) * 100;
}
},
mounted() {
this.percent = (this.index / this.total) * 100;
this.getLocation();
},
methods: {
getLocation() {
const query = uni.createSelectorQuery().in(this);
query
.select('#progress')
.boundingClientRect(data => {
this.left = data.left;
this.right = data.right;
})
.exec();
},
touchstart() {
this.isTouch = true;
this.$emit('progressStart');
},
touchend(e) {
this.isTouch = false;
let index = this.calcIndex(e.changedTouches[0].clientX);
this.$emit('progressEnd', index);
this.percent = (index / this.total) * 100;
},
touchmove(e) {
// if (!this.touchTimer) {
let index = this.calcIndex(e.touches[0].clientX);
this.$emit('indexChange', index);
this.percent = (index / this.total) * 100;
// this.touchTimer = setTimeout(() => {
// this.touchTimer = null;
// }, 100)
// }
},
/**
* 输入位置计算index
**/
calcIndex(px) {
let single = (this.right - this.left) / this.total;
let index = Math.round((px - this.left) / single);
index = index < 0 ? 0 : index;
index = index > this.total ? this.total : index;
return index;
}
}
};
</script>
<style lang="scss" scoped>
.progress-container {
padding: 0 10px;
width: 100%;
height: 100%;
.progress-container2 {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
.progress-box {
width: 100%;
}
.ball-box {
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #000;
transform: translateX(-50%);
}
.shadow {
box-shadow: 0px 0px 1px 5px rgba(#888, 0.4);
}
.bigger {
width: 20px;
height: 20px;
}
}
}
</style>

135
components/virtualList.vue Normal file
View File

@@ -0,0 +1,135 @@
<template>
<view class="virtual-list" style="position: relative;">
<movable-area style="position: absolute;right: 0;width: 30px;height: 100%;">
<movable-view class="action-bar-box" direction="vertical" @change="change" :y="y" :animation="false">
<view style="border-bottom: #000 solid 2px;width: 100%;"></view>
<view style="border-bottom: #000 solid 2px;width: 100%;"></view>
</movable-view>
</movable-area>
<scroll-view
scroll-y="true"
:style="{
height: scrollHeight + 'px',
position: 'relative',
zIndex: 1
}"
@scroll="handleScroll"
:scroll-top="scrollTop"
:show-scrollbar="false"
>
<view
class="scroll-bar"
:style="{
height: localHeight + 'px'
}"
></view>
<view
class="list"
:style="{
transform: `translateY(${offset}px)`
}"
>
<view class="item-wrap" v-for="(item, index) in visibleData" :key="index"><slot :item="item" :active="active"></slot></view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'VirtualList',
props: {
// 所有的items
items: Array,
// 可视区域的item数量
remain: Number,
// item大小
size: Number,
// 当前章节
active: Number,
// 可使区域高度
scrollHeight: Number
},
data() {
return {
// 起始
start: 0,
// 结束
end: this.remain,
// list 偏移量
offset: 0,
scrollTop: 0,
y: 0
};
},
created() {
//当前章节滚动至顶部
this.scrollTop = this.size * this.active;
},
computed: {
// 预留项
preCount() {
return Math.min(this.start, this.remain);
},
nextCount() {
return Math.min(this.items.length - this.end, this.remain);
},
// 可视区域的item
visibleData() {
const start = this.start - this.preCount;
const end = this.end + this.nextCount;
return this.items.slice(start, end);
},
localHeight() {
return this.items.length * this.size;
}
},
methods: {
change(e) {
if (e.detail.source !== 'touch') {
return;
}
let y = e.detail.y;
let scroll = (y / (this.scrollHeight - 40)) * (this.localHeight - this.scrollHeight);
scroll = scroll < 0 ? 0 : scroll;
this.scrollTop = scroll;
},
handleScroll(ev) {
const scrollTop = ev.detail.scrollTop;
this.y = (scrollTop / (this.localHeight - this.scrollHeight)) * (this.scrollHeight - 40);
// 开始位置
const start = Math.floor(scrollTop / this.size);
this.start = start < 0 ? 0 : start;
// 结束位置
this.end = this.start + this.remain;
// 计算偏移
const offset = scrollTop - (scrollTop % this.size) - this.preCount * this.size;
this.offset = offset < 0 ? 0 : offset;
}
}
};
</script>
<style scoped>
.list {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.action-bar-box {
padding: 3px;
display: flex;
flex-flow: column;
justify-content: space-around;
align-items: center;
position: absolute;
right: 0;
background-color: transparent;
border-radius: 10rpx;
box-shadow: 0 0 5px #000;
width: 20px;
height: 40px;
z-index: 2;
}
</style>

View File

@@ -1,25 +1,13 @@
let baseUrl = "";
let socketUrl = "";
if (process.env.NODE_ENV === 'development') {
// 开发环境
// baseUrl = "http://localhost:7001/";
// socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/";
baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/";
// baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1
// socketUrl = "ws://8.129.186.35:6001/";
//开发环境
baseUrl = "https://api.nuttyreading.com/"; // 线上正式
//baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
} else if (process.env.NODE_ENV === 'production') {
// 生产环境11
// baseUrl = "http://59.110.212.44:9100/pb/";
// baseUrl = "https://testapi.nuttyreading.com/";
baseUrl = "https://api.nuttyreading.com/"; //1
// baseUrl = "ws://twin-ui.com:6001/";
// socketUrl = "ws://twin-ui.com:6001/";
//生产环境
baseUrl = "https://api.nuttyreading.com/";
//baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
}
const courtConfig = {
//微信公众号APPID
@@ -48,7 +36,7 @@ const courtConfig = {
};
//手机号验证正则表达式
// (中国大陆)
const phoneRegular = /^1\d{10}$/;
const phoneRegular = /^1(3[0-9]|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
// 手机号码验证 支持港澳台 大陆
// const phoneRegular = /^[1][3-8]\d{9}$|^([6|9])\d{7}$|^[0][9]\d{8}$|^[6]([8|6])\d{5}$|^(00){0,1}(65){1}[13689]\d{6,7}$/;
//邮箱验证正则表达式
@@ -60,4 +48,4 @@ export default Object.assign({
phoneRegular,
mailRegular,
passwordRegular
}, courtConfig);
}, courtConfig);

View File

@@ -39,7 +39,8 @@ let $http = new request({
// 'Content-Type': 'application/json;charset=UTF-8',
'Content-Type': 'application/x-www-form-urlencoded',
// 'project_token': base.projectToken, //项目token可删除
}
},
timeout:'60000'
});
// 添加获取七牛云token的方法
$http.getQnToken = function(callback) {
@@ -128,7 +129,7 @@ $http.requestStart = function(options) {
}
if (storeUserInfo.token) {
options.header['token'] = storeUserInfo.token;
};
};
return options;
}
//请求结束

View File

@@ -271,7 +271,7 @@ export const setWXPay = function(payInfo, callback) {
'Content-Type': 'application/json'
},
}).then(res => {
console.log(res,'resshoppingPay')
console.log('resshoppingPay',res)
if(res.code === 0){
let payData = {
provider : 'wxpay',

View File

@@ -0,0 +1,405 @@
/**
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
*/
var isIos
// #ifdef APP-PLUS
isIos = (plus.os.name == "iOS")
// #endif
// 判断推送权限是否开启
function judgeIosPermissionPush() {
var result = false;
var UIApplication = plus.ios.import("UIApplication");
var app = UIApplication.sharedApplication();
var enabledTypes = 0;
if (app.currentUserNotificationSettings) {
var settings = app.currentUserNotificationSettings();
enabledTypes = settings.plusGetAttribute("types");
console.log("enabledTypes1:" + enabledTypes);
if (enabledTypes == 0) {
console.log("推送权限没有开启");
} else {
result = true;
console.log("已经开启推送功能!")
}
plus.ios.deleteObject(settings);
} else {
enabledTypes = app.enabledRemoteNotificationTypes();
if (enabledTypes == 0) {
console.log("推送权限没有开启!");
} else {
result = true;
console.log("已经开启推送功能!")
}
console.log("enabledTypes2:" + enabledTypes);
}
plus.ios.deleteObject(app);
plus.ios.deleteObject(UIApplication);
return result;
}
// 判断定位权限是否开启
function judgeIosPermissionLocation() {
var result = false;
var cllocationManger = plus.ios.import("CLLocationManager");
var status = cllocationManger.authorizationStatus();
result = (status != 2)
console.log("定位权限开启:" + result);
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
/* var enable = cllocationManger.locationServicesEnabled();
var status = cllocationManger.authorizationStatus();
console.log("enable:" + enable);
console.log("status:" + status);
if (enable && status != 2) {
result = true;
console.log("手机定位服务已开启且已授予定位权限");
} else {
console.log("手机系统的定位没有打开或未给予定位权限");
} */
plus.ios.deleteObject(cllocationManger);
return result;
}
// 判断麦克风权限是否开启
function judgeIosPermissionRecord() {
var result = false;
var avaudiosession = plus.ios.import("AVAudioSession");
var avaudio = avaudiosession.sharedInstance();
var permissionStatus = avaudio.recordPermission();
console.log("permissionStatus:" + permissionStatus);
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
console.log("麦克风权限没有开启");
} else {
result = true;
console.log("麦克风权限已经开启");
}
plus.ios.deleteObject(avaudiosession);
return result;
}
// 判断相机权限是否开启
function judgeIosPermissionCamera() {
var result = false;
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
console.log("authStatus:" + authStatus);
if (authStatus == 3) {
result = true;
console.log("相机权限已经开启");
} else {
console.log("相机权限没有开启");
}
plus.ios.deleteObject(AVCaptureDevice);
return result;
}
// 判断相册权限是否开启
function judgeIosPermissionPhotoLibrary() {
var result = false;
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
var authStatus = PHPhotoLibrary.authorizationStatus();
console.log("authStatus:" + authStatus);
if (authStatus == 3) {
result = true;
console.log("相册权限已经开启");
} else {
console.log("相册权限没有开启");
}
plus.ios.deleteObject(PHPhotoLibrary);
return result;
}
// 判断通讯录权限是否开启
function judgeIosPermissionContact() {
var result = false;
var CNContactStore = plus.ios.import("CNContactStore");
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
if (cnAuthStatus == 3) {
result = true;
console.log("通讯录权限已经开启");
} else {
console.log("通讯录权限没有开启");
}
plus.ios.deleteObject(CNContactStore);
return result;
}
// 判断日历权限是否开启
function judgeIosPermissionCalendar() {
var result = false;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
if (ekAuthStatus == 3) {
result = true;
console.log("日历权限已经开启");
} else {
console.log("日历权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
// 判断备忘录权限是否开启
function judgeIosPermissionMemo() {
var result = false;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
if (ekAuthStatus == 3) {
result = true;
console.log("备忘录权限已经开启");
} else {
console.log("备忘录权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
// Android权限查询
function requestAndroidPermission(permissionID) {
return new Promise((resolve, reject) => {
plus.android.requestPermissions(
permissionID.split(","),
// [permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
function(resultObj) {
var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission);
result = 1
}
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
var deniedPresentPermission = resultObj.deniedPresent[i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0
}
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1
}
resolve(result);
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
// if (result != 1) {
// gotoAppPermissionSetting()
// }
},
function(error) {
console.log('申请权限错误:' + error.code + " = " + error.message);
resolve({
code: error.code,
message: error.message
});
}
);
});
}
// 使用一个方法,根据参数判断权限
function judgeIosPermission(permissionID) {
if (permissionID == "location") {
return judgeIosPermissionLocation()
} else if (permissionID == "camera") {
return judgeIosPermissionCamera()
} else if (permissionID == "photoLibrary") {
return judgeIosPermissionPhotoLibrary()
} else if (permissionID == "record") {
return judgeIosPermissionRecord()
} else if (permissionID == "push") {
return judgeIosPermissionPush()
} else if (permissionID == "contact") {
return judgeIosPermissionContact()
} else if (permissionID == "calendar") {
return judgeIosPermissionCalendar()
} else if (permissionID == "memo") {
return judgeIosPermissionMemo()
}
return false;
}
// 跳转到**应用**的权限页面
function gotoAppPermissionSetting() {
if (isIos) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
// console.log(plus.device.vendor);
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
// 检查系统的设备服务是否开启
// var checkSystemEnableLocation = async function () {
function checkSystemEnableLocation() {
if (isIos) {
var result = false;
var cllocationManger = plus.ios.import("CLLocationManager");
var result = cllocationManger.locationServicesEnabled();
console.log("系统定位开启:" + result);
plus.ios.deleteObject(cllocationManger);
return result;
} else {
var context = plus.android.importClass("android.content.Context");
var locationManager = plus.android.importClass("android.location.LocationManager");
var main = plus.android.runtimeMainActivity();
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
console.log("系统定位开启:" + result);
return result
}
}
let permissionMap = {
"android": {
"CAMERA_EXTERNAL_STORAGE": {
"name": "android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE,android.permission.CAMERA",
"title": "相机/相册权限说明",
"content": "便于您使用该功能上传您的照片/图片用于上传用户头像、留言上传图片、申诉反馈上传图片等场景中读取和写入相册和文件内容"
},
"CAMERA": {
"name": "android.permission.CAMERA",
"title": "相机权限说明",
"content": "便于您使用该功能上传您的照片/图片用于上传用户头像、留言上传图片、申诉反馈上传图片等场景中拍摄图片"
},
// "EXTERNAL_STORAGE": {
// "name": "android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE",
// "title": "相册权限说明",
// "content": "便于您使用该功能上传您的照片/图片/视频及用于上传工单故障、维修图片、扫码识别设备等信息、意见反馈上传图片、上传设备、客户、设备图片等场景中读取和写入相册和文件内容"
// },
// "LOCATION": {
// "name": "android.location.LocationManager",
// "title": "定位权限说明",
// "content": "便于您使用该功能定位您当前的位置,并上报当前位置给服务器,来智能得按照当前位置给您分配距离您最近的工单信息等功能"
// },
// "CALLPHONE": {
// "name": "android.permission.CALL_PHONE",
// "title": "拨打电话权限说明",
// "content": "便于您使用该功能能够快速和提交工单信息的客户进行联系并进行及时处理"
// },
},
"ios": {}
}
let view = null;
let viewShow = false;
function showViewDesc(permission) {
let plat = isIos ? "ios" : "android";
view = new plus.nativeObj.View('per-modal', {
top: '0px',
left: '0px',
width: '100%',
backgroundColor: 'rgba(0,0,0,0.4)',
//opacity: '.9'
})
view.drawRect({
color: '#fff',
radius: '5px'
}, {
top: '170px',
left: '5%',
width: '90%',
height: "150px",
})
view.drawText(permissionMap[plat][permission]["title"], {
top: '180px',
left: "8%",
height: "30px"
}, {
align: "left",
color: "#000",
}, {
onClick: function(e) {
console.log(e);
}
})
view.drawText(permissionMap[plat][permission]["content"], {
top: '210px',
height: "80px",
left: "8%",
width: "84%"
}, {
whiteSpace: 'normal',
size: "14px",
align: "left",
color: "#656563"
})
setTimeout(()=>{
view.show()
},200)
}
function premissionCheck(permission) {
return new Promise(async (resolve, reject) => {
let plat = isIos ? "ios" : "android";
if (isIos) { // ios
// const camera = permission.judgeIosPermission("camera");//判断ios是否给予摄像头权限
// //ios相册没权限系统会自动弹出授权框
// //let photoLibrary = permission.judgeIosPermission("photoLibrary");//判断ios是否给予相册权限
// if(camera){
// resolve();
// }else{
// reject('需要开启相机使用权限');
// }
resolve(1)
} else { // android
let permission_arr = permissionMap[plat][permission]["name"].split(",");
let flag = true;
for(let i = 0;i<permission_arr.length;i++) {
let status = plus.navigator.checkPermission(permission_arr[i]);
if(status == "undetermined") {
flag = false;
}
}
if (flag == false) { // 未完全授权
showViewDesc(permission);
requestAndroidPermission(permissionMap[plat][permission]["name"]).then((res) => {
viewShow = false;
setTimeout(()=>{
viewShow = true;
},120)
view.close();
// if (res == -1) {
// uni.showModal({
// title: '提示',
// content: '操作权限已被拒绝,请手动前往设置',
// confirmText: "立即设置",
// success: (res) => {
// if (res.confirm) {
// gotoAppPermissionSetting()
// }
// }
// })
// }
resolve(res)
})
} else {
resolve(1)
}
}
})
}
module.exports = {
judgeIosPermission: judgeIosPermission,
requestAndroidPermission: requestAndroidPermission,
checkSystemEnableLocation: checkSystemEnableLocation,
gotoAppPermissionSetting: gotoAppPermissionSetting,
premissionCheck: premissionCheck
}

View File

@@ -0,0 +1,42 @@
export default function uniCopy({content,success,error}) {
if(!content) return error('复制的内容不能为空 !')
content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串
/**
* 小程序端 和 app端的复制逻辑
*/
//#ifndef H5
uni.setClipboardData({
data: content,
success: function() {
success("复制成功~")
console.log('success');
},
fail:function(){
success("复制失败~")
}
});
//#endif
/**
* H5端的复制逻辑
*/
// #ifdef H5
if (!document.queryCommandSupported('copy')) { //为了兼容有些浏览器 queryCommandSupported 的判断
// 不支持
error('浏览器不支持')
}
let textarea = document.createElement("textarea")
textarea.value = content
textarea.readOnly = "readOnly"
document.body.appendChild(textarea)
textarea.select() // 选择对象
textarea.setSelectionRange(0, content.length) //核心
let result = document.execCommand("copy") // 执行浏览器复制命令
if(result){
success("复制成功~")
}else{
error("复制失败请检查h5中调用该方法的方式是不是用户点击的方式调用的如果不是请改为用户点击的方式触发该方法因为h5中安全性不能js直接调用")
}
textarea.remove()
// #endif
}

22
main.js
View File

@@ -16,9 +16,9 @@ import {
Vue.prototype.$getHours = nowHour
// 地址
// Vue.prototype.$baseUrl = "http://192.168.110.100:9100/pb/"
// Vue.prototype.$baseUrl = "http://59.110.212.44:9100/pb/"
//Vue.prototype.$baseUrl = "http://192.168.110.100:9100/pb/"
Vue.prototype.$baseUrl = "https://api.nuttyreading.com/"
// 安卓安卓包下载地址
// Vue.prototype.$apkUrl = "https://www.nuttyreading.com/nuttyreading.apk" // 本地地址
Vue.prototype.$apkUrl = "https://a.app.qq.com/o/simple.jsp?pkgname=com.cn.nuttyreading" // 应用宝
@@ -27,7 +27,7 @@ Vue.prototype.$apkUrl = "https://a.app.qq.com/o/simple.jsp?pkgname=com.cn.nuttyr
uni.getSystemInfo({
success: function (res) {
Vue.prototype.$platform = res.platform;
Vue.prototype.iosHidden = true;
if (res.platform == 'ios') {
@@ -59,6 +59,10 @@ Vue.prototype.$base = base;
//挂载全局http请求
import $http from '@/config/requestConfig'
Vue.prototype.$http = $http;
import commonJS from '@/common/commonJS.js'
Vue.prototype.$commonJS = commonJS
// #ifdef MP-WEIXIN
//挂载全局微信分享
import {
@@ -83,10 +87,14 @@ import '@/plugins/wxJsSDK.js';
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
import config from 'uview-ui/libs/config/config'
Vue.component("mescroll-body", MescrollBody);
// import musicPlay from '@/components/music.vue'
// Vue.component('music-play', musicPlay);
import commonCoupon from '@/pages/component/commonComponents/coupon/index.vue'
Vue.component('common-coupon', commonCoupon);
import commonList from '@/pages/component/commonComponents/list.vue'
Vue.component('common-list', commonList);
import commonGoodsNav from '@/pages/component/commonComponents/goodsNav.vue'
Vue.component('common-goods-nav', commonGoodsNav);
import commonAdvertisement from '@/pages/component/commonComponents/advertisement.vue'
Vue.component('common-advertisement', commonAdvertisement);
App.mpType = 'app'

View File

@@ -3,7 +3,7 @@
"appid" : "__UNI__9788EB5",
"description" : "疯子读书",
"networkTimeout" : {
"request" : 3000
"request" : 30000
},
"transformPx" : false,
"icons" : [
@@ -12,8 +12,9 @@
"src" : "图片路径"
}
],
"versionName" : "1.2.43",
"versionCode" : 1243,
"sassImplementationName" : "node-sass",
"versionName" : "1.2.81",
"versionCode" : 1281,
"app-plus" : {
"compatible" : {
"ignoreVersion" : true
@@ -100,7 +101,8 @@
"UniversalLinks" : "https://verification.nuttyreading.com/uni-universallinks/__UNI__9788EB5/"
}
},
"oauth" : {}
"oauth" : {},
"push" : {}
},
"splashscreen" : {
"iosStyle" : "common",
@@ -117,10 +119,10 @@
},
"idfa" : false,
"urltypes" : "nuttyreading",
"urlschemewhitelist" : "everhealth",
"urlschemewhitelist" : "everhealth,medicine,zmzm",
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "为了给您提供修改头像的功能",
"NSCameraUsageDescription" : "为了给您提供修改头像的功能"
"NSPhotoLibraryUsageDescription" : "为了给您提供修改头像、申诉反馈的图片上传",
"NSCameraUsageDescription" : "为了给您提供修改头像、申诉反馈的图片上传"
}
},
"icons" : {

View File

@@ -9,6 +9,13 @@
"navigationBarTitleText": "首页"
}
},
{
"path" : "pages/mine/wallet/couponList",
"style" :
{
"navigationBarTitleText" : "用户优惠券列表"
}
},
{
"path": "pages/peanut/shopping",
"style": {
@@ -49,6 +56,15 @@
"navigationBarTitleText": "小说1-1"
}
},
{
"path": "pages/read/read",
"style": {
"navigationStyle": "custom",
"app-plus": {
"bounce": "none"
}
}
},
// {
// "path": "pages/eBook/1/bookComent",
// "style": {
@@ -141,6 +157,20 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/user/points",
"style": {
"navigationBarTitleText": "我的积分",
"enablePullDownRefresh": false
}
},
{
"path": "pages/detail/orderLCont",
"style": {
"navigationBarTitleText": "订单详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/user/bindPhone",
"style": {
@@ -602,6 +632,27 @@
"navigationBarTitleText": "国学经典",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/news/news",
"style" :
{
"navigationBarTitleText" : "新闻播报"
}
},
{
"path" : "pages/news/newsForwebview",
"style" :
{
"navigationBarTitleText" : "新闻播报webView"
}
},
{
"path": "pages/user/workOrder",
"style": {
"navigationBarTitleText": "申诉反馈",
"enablePullDownRefresh": true
}
}
// {
// "path": "pages/agreement/yszcPage",

View File

@@ -51,7 +51,7 @@
MonList: {
title: '阴经',
vlue: '属性',
attribute: ['阴经', '属性', '肺经(金)', '脾经()', '心(火)', '肾经(水)', '心包经(冬至前相火,冬至后相水)', '肝经(木)'],
attribute: ['阴经', '属性', '肺经(金)', '脾经()', '心(火)', '肾经(水)', '心包经(冬至前相火,冬至后相水)', '肝经(木)'],
arry: [
['井', '木', '少商', '隐白', '少冲(母穴)', '涌泉(子穴)', '中冲(冬至前母穴冬至后子穴)', '大敦(本穴)'],
['荥', '火', '鱼际', '大都(母穴)', '少府(本穴)', '然谷(泄井当泄荥)', '劳宫(冬至前本穴)', '行间(子穴)'],
@@ -66,12 +66,12 @@
SunList: {
title: '阳经',
vlue: '属性',
attribute: ['阳经', '属性', '大肠经(金)', '脾经()', '心(火)', '膀胱经(水)', '三焦经(冬至前相火,冬至后相水)', '胆经(木)'],
attribute: ['阳经', '属性', '大肠经(金)', '脾经()', '心(火)', '膀胱经(水)', '三焦经(冬至前相火,冬至后相水)', '胆经(木)'],
arry: [
['井', '金', '商阳(本穴)', '厉兑(子穴)', '少泽', '至阴(母穴)', '关冲(冬至后母穴)', '窍阴'],
['荥', '水', '二间(子穴)', '内庭(泄井当泄荥)', '前谷', '通谷(本穴)', '液门(冬至后本穴)', '侠溪(母穴)'],
['俞', '木', '三间', '陷谷', '后匾(母穴)', '束骨(子穴)', '中渚(冬至前回穴,冬至后子穴)', '临泣(本穴)'],
['经', '', '阳溪', '解溪(母穴)', '阳谷(本穴)', '昆仑', '支沟(冬至前本穴)', '阳辅(子穴)'],
['经', '', '阳溪', '解溪(母穴)', '阳谷(本穴)', '昆仑', '支沟(冬至前本穴)', '阳辅(子穴)'],
['合', '土', '曲池(母穴)', '足三里(本穴)', '小海(子穴)', '委中(补井当补合)', '天井(冬至前子穴)', '阳陵泉'],
['原', '', '合谷', '冲阳', '腕骨', '京骨', '阳池', '丘墟'],
['郄', '', '温溜', '梁丘', '养老', '金门', '会宗', '外丘'],

View File

@@ -14,6 +14,7 @@
</view>
<view class="commodityContent">
<view class="commodityPrice">
<span></span><em>{{productInfo.price}}</em>
<span class="oldPrice " v-if="productInfo.activityPrice">原价{{productInfo.activityPrice}}</span>
</view>

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="订单详情"></z-nav-bar>
<view class="adDefault" v-if="consigneeShow && orderContet.orderType == 'order'">
<view class="adDefault" v-if="consigneeShow && orderContet.orderType == 'order' && (orderContet.addressId != 0 && orderContet.addressId != null )">
<view class="defalTop">
<text class="userName">
{{orderContet.consignee.consigneeName}}
@@ -31,9 +31,13 @@
<text class="orderState orderState2" v-if="orderContet.orderStatus==2">待收货</text>
<text class="orderState orderState3" v-if="orderContet.orderStatus==3">已完成</text>
<text class="orderState orderState5" v-if="orderContet.orderStatus==5">已超时</text>
</view>
<view class="orderContent" v-for="(item,index) in orderContet.goodsList" :key="index"
@click="goDetail(item.productId)" v-if="orderContet.goodsList.length > 0">
</view>
<template v-if="orderContet.orderType == 'order' && orderContet.goodsList.length > 0">
<view style="position: relative;" class="orderContent" v-for="(item,index) in orderContet.goodsList" :key="index"
@click="goDetail(item.productId)" >
<!-- <span v-if="item.isVipPrice==1&&item.vipPrice!=0&&item.vipPrice!=null"
style="position: absolute;z-index: 10;top: 4px;left: 0px;margin-right: 10px;text-align: center;font-size: 18rpx;background-color: #f94f04;color: #fff;font-weight: bold;border-radius:4px;width: 80rpx; padding:2px 4px;box-sizing: border-box;">VIP优惠</span>
-->
<image :src="item.productImage" mode=""></image>
<view class="itemJian">
<view class="orderTitle">
@@ -51,21 +55,36 @@
<view class="orderOper" v-if="item.orderStatus == 3">
<view style="width: 100%; text-align: right;">
<view v-if="userRecordid == null" @click.stop="pingji(item.productId)" class="opCan" >评价</view>
<view v-else @click.stop="showZhuiping(item.productId)" class="opCan" >追评</view>
<!-- <view v-else @click.stop="showZhuiping(item.productId)" class="opCan" >追评</view> -->
</view>
</view>
</view>
<br clear="both">
</view>
<view class="orderContent" v-if="orderContet.products==''">
</view>
</template>
<template v-if="orderContet.orderType =='vip'">
<view class="orderContent" >
<image :src="'../../static/icon/oder_vip.png'" style="height: 150rpx;"></image>
<view class="itemJian">
<view class="orderTitle">
<text>VIP开通</text>
</view>
<!-- <view class="orderPrice" >
<text style="font-weight: bold;">{{orderContet.realMoney}}</text>
</view> -->
<br clear="both">
</view>
<br clear="both">
</view>
</template>
<view class="orderContent" v-if="orderContet.orderType == 'point'">
<image src="../../static/icon/oder_chong.png" mode="" style="height: 150rpx;"></image>
<view class="itemJian">
<view class="orderTitle">
<text>充值</text>
</view>
<view class="orderPrice">
<!-- <view class="orderPrice" >
<text style="font-weight: bold;">{{orderContet.realMoney}}</text>
</view>
</view> -->
<br clear="both">
</view>
<br clear="both">
@@ -78,11 +97,20 @@
<span style="color: #666;margin-right: 10rpx;float: left;">运费 : </span>
<span></span>{{orderContet.shippingPrice}}
</view>
<view class="orderReal">
<view class="orderReal" v-if="orderContet.orderType == 'order'&&orderContet.districtPrice&&orderContet.districtPrice>0">
<span style="color: #666;margin-right: 10rpx;float: left;"> 活动立减: </span>
<span style="color: #fa2d12">- {{orderContet.districtPrice}}</span>
</view>
<view class="orderReal" v-if="orderContet.orderType == 'order'&&orderContet.vipDiscountAmount&&orderContet.vipDiscountAmount>0">
<span style="color: #666;margin-right: 10rpx;float: left;"> <span style="color: #f94f04;font-weight: bold;margin-right: 2px;">VIP</span> 专享立减: </span>
<span style="color: #fa2d12">- {{orderContet.vipDiscountAmount}}</span>
</view>
<!-- <view class="orderReal">
<span style="color: #666;margin-right: 10rpx;float: left;">优惠券 : </span>
<b v-if="orderContet.coupon.couponAmount" style="color: #dd3c0c;"><span>-</span>{{orderContet.coupon.couponAmount}}</b>
<b v-else style="color: #dd3c0c;"><span>-</span>0</b>
</view>
</view> -->
<view class="orderReal">
<span style="color: #666;margin-right: 10rpx;float: left;">实付款 : </span>
<b style="color: #dd3c0c;"><span></span>{{orderContet.realPrice}}</b>
@@ -602,7 +630,7 @@
} else if (this.orderContet.orderStatus == 3) {
this.titleStat = '已完成'
}
if(this.orderContet.orderStatus >= 2 && this.orderContet.orderType == 'order'){
if(this.orderContet.orderStatus >= 2 && this.orderContet.orderType == 'order' && this.orderContet.expressOrders != null){
this.sheetList = this.orderContet.expressOrders
}else{
this.sheetList = []

View File

@@ -5,8 +5,8 @@
<view class="header">
<!-- 顶部导航栏 -->
<z-nav-bar backState="2000" title="我的订单"></z-nav-bar>
<view class="ordersTabs">
<view v-for="(item,index) in ordersTabs" @click="ordersTabCLi(item.value)" :key="index"
<view class="ordersTabs">
<view v-for="(item,index) in ordersTabs" @click="ordersTabCLi(item.value)" :key="index"
:class="ordersListTab==item.value?'ordersdefine ordStyle':'ordersdefine'">
{{item.name}}
<view class="ordersnum" v-if="item.value == 0 && map[item.value] > 0">{{map[item.value]}}</view>
@@ -31,7 +31,12 @@
<view class="orderstatus" v-show="item.orderStatus == 3">交易成功</view>
<view class="orderstatus" v-show="item.orderStatus == 4">交易失败</view>
<view class="orderstatus" v-show="item.orderStatus == 5">过期</view>
<view v-for="(item1,index1) in item.productList" :key="index1" class="bookinfolist">
<template v-if="item.orderType == 'order'">
<view style="position: relative;" v-for="(item1,index1) in item.productList" :key="index1" class="bookinfolist">
<!--
<span v-if="item1.product.isVipPrice==1&&item1.product.vipPrice!=0&&item1.vipPrice!=null"
style="position: absolute;z-index: 10;top: 4px;left: 0px;margin-right: 10px;text-align: center;font-size: 18rpx;background-color: #f94f04;color: #fff;font-weight: bold;border-radius:4px;width: 80rpx; padding:2px 4px;box-sizing: border-box;">VIP优惠</span>
-->
<image class="feng" v-if="item1.product.productImages" :src="item1.product.productImages" mode="aspectFill"></image>
<!-- <view class="description" v-html="item.content">
</view> -->
@@ -42,12 +47,37 @@
</span>
</view>
<view class="btns flexbox" style="margin-top:10rpx;padding-bottom: 72rpx;">
<span class="left" style="color: #C0C4CC;"></span>
<view class="left" style="color: #C0C4CC;">
<view class="orderstatusbtn addcomment" v-if="item.orderStatus == 3 && item1.recordId == 0 &&
item.come == 0" @click.stop="pingji(item1.productId,item)">评价</view>
</view>
<span class="right flexbox opbtns" style="color: #C0C4CC;">
×{{item1.quantity}}
</span>
</view>
</view>
</template>
<template v-if="item.orderType == 'point'">
<view class="flexbox" style="align-items: center;">
<view class="" style="height: 150rpx;">
<image src="../../static/icon/oder_chong.png" style="height: 150rpx; width: 150rpx;"></image>
</view>
<view class="">
<text style="font-size: 28rpx;">充值订单</text>
</view>
</view>
</template>
<template v-if="item.orderType == 'vip'">
<view class="flexbox" style="align-items: center;">
<view class="" style="height: 150rpx;">
<image :src="'../../static/icon/oder_vip.png'" style="height: 150rpx; width: 150rpx;"></image>
</view>
<view class="">
<text style="font-size: 28rpx;">VIP开通</text>
</view>
</view>
</template>
<view class="btns flexbox" style="margin-top:10rpx;">
<span class="left" style="color: #C0C4CC;"></span>
<span class="right flexbox opbtns">
@@ -60,11 +90,12 @@
<span class="right flexbox opbtns">
<view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="canceOrder(item)">取消订单</view>
<view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="goPay(item)">付款</view>
<view class="orderstatusbtn" v-if="item.orderStatus == 1">催发货</view>
<!-- <view class="orderstatusbtn alertDeliver" v-if="item.orderStatus == 1">催发货</view> -->
<view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="seeExpressDetail(item)">查看物流</view>
<view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="OverOrder(item)">确认收货</view>
<view class="orderstatusbtn" v-if="item.orderStatus == 3">申请售后</view>
<view class="orderstatusbtn" v-if="item.orderStatus == 3 && userRecordid == null" @click.stop="pingji(item.productId)">评价</view>
<!-- <view class="orderstatusbtn" v-if="item.orderStatus == 3">申请售后</view> -->
<!-- -->
<!-- <view class="orderstatusbtn" v-if=" userRecordid == null && item.come == 0" @click.stop="pingji(item.id)">评价</view> -->
<!-- <view class="orderstatusbtn" v-if="item.orderStatus == 3 && userRecordid != null" @click.stop="showZhuiping(item.productId)">追评</view> -->
</span>
</view>
@@ -264,9 +295,9 @@ import { data } from 'jquery';
},
getBookList(flag, refreshflag){
// 根据tab不同获取最新书评、最热书评、书集列表
// uni.showLoading({
// title: '加载中'
// });
uni.showLoading({
title: '加载中'
});
// 顶部红点数量
$http.request({
@@ -290,6 +321,8 @@ import { data } from 'jquery';
"limit": 10,
"page": this.newestpage
}
console.log('params at line 324:', params)
$http.request({
url: "book/buyOrder/getUserOrderList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -298,6 +331,7 @@ import { data } from 'jquery';
'Content-Type': 'application/json'
},
}).then(res => {
uni.hideLoading()
console.log(res, '内容获取成功')
if (res.code == 0 && res.page && res.page.records.length > 0) {
this.newList = this.newList.concat(res.page.records)
@@ -310,6 +344,7 @@ import { data } from 'jquery';
this.status = 0
}
}).catch(e => {
uni.hideLoading()
console.log(e)
})
},
@@ -382,15 +417,21 @@ import { data } from 'jquery';
}else if(payItem.paymentMethod == 3){
// 苹果充值
console.log('苹果二次支付')
if(this.isAndorid){
uni.showModal({
title:'提示',
showCancel:false,
content:'很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单'
})
}else{
this.iphonepay(payItem)
}
uni.showModal({
content:'apple内购订单不支持继续支付请重新发起支付申请并完成支付',
confirmText:'好的',
showCancel:false
})
return
// if(this.isAndorid){
// uni.showModal({
// title:'提示',
// showCancel:false,
// content:'很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单'
// })
// }else{
// this.iphonepay(payItem)
// }
}
},
// 取消订单
@@ -508,18 +549,18 @@ import { data } from 'jquery';
},
closePingjia(){
this.pingjiaShow = false
this.Pform.comment = ''
this.Pform.html = ''
this.emoji = []
// this.Pform.comment = ''
// this.Pform.html = ''
// this.emoji = []
},
// 提交评价
submitPJ(){
if(this.Pform.comment != ''){
let data={
let data={
'userid':this.userInfo.id,
'orderSn': this.orderSn,
'bookid': this.productID,
'productId': this.productID,
// 'content': this.Pform.html,
'content': this.Pform.comment,
'starLevel':this.Pform.star,
@@ -528,7 +569,7 @@ import { data } from 'jquery';
}
// console.log(data,'data')
$http.request({
url: "buy/record/UserRecordcomment",
url: "buy/record/UserRecordComment",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
@@ -560,10 +601,11 @@ import { data } from 'jquery';
}
},
// 添加评价
pingji(id){
console.log(id)
pingji(id,item){
console.log('评价实例',id, item)
this.pjType = ''
this.productID = id
this.orderSn = item.orderSn
this.pingjiaShow = true
},
getStar(i){
@@ -692,7 +734,8 @@ import { data } from 'jquery';
width:140rpx;
text-align: center;
}
.addcomment{color: #ffaa00; border-color: #ffaa00; margin: 0 ;}
.alertDeliver{ color: #55aa00; border-color: #55aa00;}
.flexbox{display: flex;}
.container{padding: 0 10px;}

File diff suppressed because it is too large Load Diff

View File

@@ -51,7 +51,7 @@
商品总价
<text>{{totalPrice}}</text>
</view>
<view class="yq_youhui" @click="youhuiShow = true">
<!-- <view class="yq_youhui" @click="youhuiShow = true">
<u-icon name="red-packet-fill" color="#e74141" size="18" class="yqLeft"></u-icon>
优惠券
<u-icon name="arrow-right" color="#aaa" size="18" class="yqRight"></u-icon>
@@ -61,7 +61,7 @@
style="background-color: #999;">暂无优惠券</text>
<text class="dagnqian" v-if="youhuiContent.id!=undefined">
- {{youhuiContent.coupons.couponAmount}}</text>
</view>
</view> -->
<view class="yq_yunfei">
<u-icon name="car-fill" color="#e0880c" size="18" class="yqLeft"></u-icon>
运费

View File

@@ -573,7 +573,7 @@
.get('book/clockInForum/getChatList', data)
.then(res => {
console.log(res, '当天我的打卡内容')
if (res.code == 0 && res.chatList.length > 0) {
if (res.code == 0 && res.chatList && res.chatList.length > 0) {
var arr = []
res.chatList.forEach((item1) => {
var pjstr = ''

View File

@@ -0,0 +1,251 @@
<template>
<view
class="container commonPageBox commonDetailPage"
style="height: auto !important; padding-bottom: 0 !important"
>
<u-popup :show="show" v-if="show" mode="center" class="popup_box">
<div class="product_image" scroll-y="true" style="position: relative">
<swiper
:style="{ height: fullHeight }"
class="swiper-tall"
:indicator-dots="indicatorDots"
:autoplay="autoplay"
:previous-margin="previousMargin"
:next-margin="nextMargin"
:circular="circular"
@change="change"
:current="swiperCurrentIndex"
>
<swiper-item
class="swiper-container"
v-for="(img, index) in list"
:key="index"
:item-id="index"
:data-year="index"
>
<view
@click="gotoDetail(img)"
class="swiper-item"
:style="{
background: img ? 'url(' + img.icon + ') center no-repeat' : '',
backgroundSize: '100% 100%',
}"
:animation="animationData[index]"
>
</view>
</swiper-item>
</swiper>
<view style="display: flex;align-items: center;justify-content: center;">
<view @click="close" style="font-weight: bold;background-color: rgba(255, 255, 255, 0.8); color: #333;padding:20rpx 10rpx;width: 200rpx;font-size: 30rpx;border-radius: 40rpx;text-align: center;letter-spacing: 0.5rpx;">
关闭
</view>
</view>
</div>
</u-popup></view
>
</template>
<script>
const stopPenetrate = () => {
return;
};
import { mapState } from "vuex";
export default {
props: ["list"],
data() {
return {
screenHeight: 0,
animationData: {
0: {},
1: {},
2: {},
},
title: "0",
indicatorDots: false,
autoplay: false,
previousMargin: uni.upx2px(82) + "px",
nextMargin: uni.upx2px(82) + "px",
circular: true,
zoomParam: 1.1,
swiperCurrentIndex: 0,
data: [],
max: 0,
show: false,
};
},
onShow() {
this.show = false;
},
onLoad() {},
onHide() {
// this.showSearchList = false
// this.searchList = []
},
computed: {
...mapState(["userInfo"]),
fullHeight() {
const res = uni.getSystemInfoSync();
return (
res.windowHeight - uni.upx2px(60) - (res.statusBarHeight + 44) + "px"
);
},
},
methods: {
gotoDetail(v) {
console.log("v at line 58:", v);
if (v.relationId) {
if (v.type == 0) {
if (v.shopProduct) {
uni.navigateTo({
url: `/pages/bookShop/commodityDetail?id=${v.shopProduct.productId}`,
});
}
}
}
if (v.type == 1) {
uni.navigateTo({
url: `/pages/peanut/reCharge`,
});
}
// if (v.type == 2) {
// uni.navigateTo({
// url: `/pages/mine/vip/index`,
// });
// }
this.show = false;
},
// 放大图片
previewImage(url) {
console.log(url);
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function (res) {
// console.log(res,'+++++')
},
},
});
},
change(e) {
this.swiperCurrentIndex = e.detail.current;
this.title = e.detail.currentItemId;
for (let key in this.animationData) {
if (e.detail.currentItemId == key) {
this.animation.scale(this.zoomParam).step();
this.animationData[key] = this.animation.export();
} else {
this.animation.scale(1.0).step();
this.animationData[key] = this.animation.export();
}
}
},
close() {
this.show = false;
},
selectGoods(data) {
this.$emit("selectGoods", data);
},
open() {
this.animation = uni.createAnimation();
this.animation.scale(this.zoomParam).step();
this.animationData[0] = this.animation.export();
this.show = true;
},
onHandleClickBuy() {
this.$emit("selectGoodsData", this.selectGoodsData);
this.$emit("onHandleClickBuy");
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
components: {},
};
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.goods_image {
width: 70vw;
}
.popup_box {
padding-top: 30rpx;
background-color: transparent;
.popup_content {
padding-bottom: 140rpx;
}
/deep/.list_item {
// border-bottom: none;
border: none !important;
box-shadow: none !important;
}
.product_image {
width: 100vw;
max-height: 90vh;
}
}
/deep/.u-popup__content {
background-color: transparent !important;
}
/deep/.u-popup__content__close {
color: #fff !important;
}
.title_box {
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 0;
.title_price {
color: #ef1224;
font-size: 40rpx;
font-weight: 700;
}
}
.swiper-container {
display: flex;
align-items: center;
}
.swiper-item {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-left: auto;
margin-right: auto;
height: 858upx;
width: 530upx;
line-height: 300upx;
text-align: center;
broder-radius: 6upx;
margin-bottom: 50upx;
}
.swiper-tall {
display: flex;
align-items: center;
}
.swiper-title {
width: 750upx;
text-align: center;
}
</style>

View File

@@ -0,0 +1,287 @@
<template>
<view>
<view v-for="(item, index) in List" :key="index">
<view :class="`youhuiItem ${itemClass}`">
<view class="centerbg">
<view class="centerView" style="position: relative"
><text
v-if="source == 'mine'"
class="border_radius_10"
style="
position: absolute;
right: 10rpx;
top: 10rpx;
font-size: 25rpx;
/* background-color: #fad4bd; */
color: #ed2a2e;
"
>{{ item.couponEntity.couponRange | couponType }}</text
>
<view style="color: #fd4347; width: 200rpx">
<view
style="position: relative; border-right: 1px dashed #fa8277"
>
<text
style="
font-weight: 700;
font-size: 40rpx;
position: absolute;
top: 20rpx;
left: 0rpx;
"
></text
>
<text
style="
font-size: 64rpx;
letter-spacing: 0.1px;
font-weight: 700;
margin-left: 40rpx;
"
>{{ item.couponEntity.couponAmount }}</text
>
<text
v-if="source == 'mine'"
style="
display: block;
color: #333;
font-size: 25rpx;
margin-left: 0rpx;
margin-top: 0rpx;
"
>{{ item.couponEntity.useLevel }}元可用</text
>
</view>
</view>
<view style="width: calc(100% - 220rpx)">
<view>
<view
style="color: #fd4347; font-size: 44rpx; font-weight: bold;"
>{{
item.couponEntity.couponType == 0 ? "现金" : "折扣"
}}优惠券
<!-- <text v-if="source == 'mine'" style="box-sizing: border-box;padding:4rpx 20rpx;margin-left: 10rpx;font-size: 24rpx;background-color: #fff;border-radius: 24rpx;float: right;">去使用</text> -->
</view
>
<text
v-if="source != 'goodsDetail'"
style="
display: block;
font-size: 24rpx;
color: #333;
margin-top: 10rpx;
"
>有效期至{{
item.effectType == 0 ? "永久有效" : item.endTime
}}</text
>
</view>
</view>
</view>
</view>
<view class="bottombg">
<view
style="
width: 100%;
padding: 16rpx 20rpx;
box-sizing: border-box;
margin-right: 6rpx;
position: absolute;
bottom: 0rpx;
text-align: center;
"
>
<view
class="title"
style="
line-height: 34rpx;
margin-bottom: 10rpx;
color: #fff;
font-size: 34rpx;
font-weight: bold;
"
>
{{ item.couponEntity.couponName }}
</view>
<view
v-if="item.couponEntity.remark"
style="
position: absolute;
right: 10rpx;
bottom: 10rpx;
display: flex;
align-items: center;
font-size: 22rpx;
color: #fafafa;
"
>
<!-- 详细信息
<u-icon
size="20rpx"
color="#fafafa"
style="color: #fafafa; float: right;margin-left: 4rpx;"
name="arrow-down-fill"
></u-icon> -->
</view>
</view>
</view>
</view>
<u-collapse
v-if="source != 'goodsDetail'&&item.couponEntity.remark"
style="
margin-top: 0rpx;
z-index: 10 !important;
background-color: #fafafa;
border-bottom-left-radius: 10rpx;
border-bottom-right-radius: 10rpx;
"
:border="false"
>
<u-collapse-item title="详细信息" name="Docs guide">
<view
style="
font-size: 22rpx;
width: 100%;
margin-right: 20rpx !important;
"
>使用说明{{ item.couponEntity.remark }}</view
>
</u-collapse-item>
</u-collapse>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
props: ["List", "source", "itemClass"],
data() {
return {};
},
filters: {
couponType(type) {
// 0无限制 1课程卷 2课程品类卷
var str = "";
switch (type) {
case 0:
str = "全场通用";
break;
case 1:
str = "指定课程可用";
break;
case 2:
str = "指定课程品类可用";
break;
}
return str;
},
},
computed: {
...mapState(["userInfo"]),
},
methods: {},
};
</script>
<style scoped lang="scss">
.youhuiItem {
min-height: 320rpx;
position: relative;
background: linear-gradient(to top right, #fd4c50, #fe393d);
border: 1px solid #d9d9d9;
border-radius: 10rpx;
width: 100%;
padding: 26rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
font-size: 30rpx;
}
.centerbg {
width: 100%;
background-image: linear-gradient(60deg, #ffefd3 0%, #f8be85 100%);
height: calc(100%);
border-radius: 10rpx;
padding-bottom: 86rpx;
box-sizing: border-box;
}
.centerView {
width: 100%;
height: 100%;
overflow: hidden;
padding: 30rpx 20rpx 0 40rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.bottombg {
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
left: 0;
right: 0;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
background-image: url("@/static/icon/coupon/bottom.png") !important;
}
.youhuiItem > view {
}
.youhuiItem.youItem_style {
border-color: #fd6004;
}
::v-deep .u-cell__body {
padding-top: 0 !important ;
padding-bottom: 0 !important ;
z-index: 10 !important ;
.u-cell__title-text {
color: #333 !important;
font-size: 24rpx !important;
}
}
::v-deep .u-collapse-item__content__text {
padding: 10rpx 20rpx !important;
box-sizing: border-box;
}
::v-deep.itemCouponClass {
min-height: 180rpx !important;
.bottombg {
.title {
font-size: 26rpx !important;
}
}
.centerbg {
padding-bottom: 60rpx !important;
}
}
</style>

View File

@@ -0,0 +1,97 @@
<template>
<view class="goods_nav">
<view class="left">
<view v-for="(v,i) in iconList" class="icon_item" v-if="iconList.length>0">
<u-icon :name="v.icon" :color="v.infoColor" size="22" v-if="v.iconType" style="margin:0 auto"
@click="clickIcon(v)"></u-icon>
<uni-icons :type="v.icon" size="22" :color="v.infoColor" style="margin:0 auto" v-else> </uni-icons>
<view :style="`color:${v.infoColor};`">{{ v.text }}</view>
</view>
<slot name="leftSlot"></slot>
</view>
<view class="right">
<view class="button" v-for="(v,i) in customButton"
:style="`background:${v.backgroundColor} !important;color:${v.color};width:${v.width}`"
@click="submit(v)">
{{ v.text }}
</view>
</view>
<slot name="bottomSlot"></slot>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
import {
mapState
} from 'vuex';
export default {
props: ['iconList', 'customButton'],
data() {
return {
}
},
computed: {
...mapState(['userInfo']),
},
methods: {
submit(v) {
this.$emit('submit', v)
},
clickIcon(v) {
this.$emit('clickIcon', v)
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
}
</script>
<style lang="scss" scoped>
.goods_nav {
background-color: #fff;
width: 100%;
padding: 20rpx 30rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: space-between;
.left {
height: 100%;
float: left;
display: flex;
align-items: center;
}
}
.richDetail {
width: 100%;
height: 100%;
}
.button {
float: right;
width: 240rpx;
border-radius: 100rpx;
line-height: 70rpx;
text-align: center;
background: linear-gradient(90deg, rgb(254, 96, 53), rgb(239, 18, 36));
color: rgb(255, 255, 255);
}
.icon_item {
display: flex;
justify-content: center;
flex-direction: column;
}
</style>

View File

@@ -0,0 +1,159 @@
<template>
<view style="width: 100%; height: 100%">
<view v-if="axiosStatus != ''">
<scroll-view
@scrolltolower="lower"
scroll-y="true"
class="scroll-Y"
v-if="dataList && dataList.length > 0"
style="height: 100%"
>
<view
@click="gotoDetail(item, index)"
class="scroll-view-item list_item"
v-for="(item, index) in dataList"
:key="indexKey ? item[indexKey] : item.id"
:index="indexKey ? item[indexKey] : index"
>
<view :class="['titleItem', '']">
<slot name="leftSlot" :row="item" :item="item" :index="index">
</slot>
<template v-if="isCondition">
<slot name="labelSlot" :row="item" :rowIndex="index"></slot>
</template>
<template v-else>
{{ item[label] }}
</template>
<slot name="rightSlot" :row="item" :rowIndex="index"></slot>
</view>
<image
v-if="!isNoIcon"
src="@/static/icon/icon_right.png"
class="rightArrow"
style=""
></image>
</view>
</scroll-view>
<u-empty
v-else-if="noDataIcon && isLoadingHide"
:mode="noDataIcon"
:icon="`http://cdn.uviewui.com/uview/empty/${noDataIcon}.png`"
>
</u-empty>
<u-divider style="width: 100%" v-else text="暂无数据哦~"></u-divider>
</view>
</view>
</template>
<script>
import { mapState } from "vuex";
export default {
props: [
"indexKey",
"dataList",
"label",
"isCondition",
"isNoIcon",
"pagination",
"noDataIcon",
"isLoadingHide",
"axiosStatus",
],
data() {
return {
status: "",
};
},
onLoad() {},
onShow() {
this.status = "";
},
onHide() {
// this.showSearchList = false
// this.searchList = []
},
computed: {
...mapState(["userInfo"]),
},
methods: {
lower() {
this.$emit("lower");
},
gotoDetail(data, index) {
this.$emit("hancleClick", data, index);
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
components: {},
};
</script>
<style lang="scss" scoped>
.list_item {
width: 100%;
padding: 20rpx;
font-size: 30rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #e0e0e0;
display: flex;
align-items: center;
justify-content: space-between;
}
.list_item :last-child(1) {
border-bottom: none;
}
.scroll-view-item:nth-child(2n-1) {
background-color: #f5f5f5 !important;
}
.rightArrow {
width: 40rpx;
height: 40rpx;
}
.scroll-Y {
height: 100%;
}
.scroll-view_H {
white-space: nowrap;
width: 100%;
}
.scroll-view-item {
// height: 300rpx;
// line-height: 300rpx;
// text-align: center;
// font-size: 36rpx;
}
.scroll-view-item_H {
display: inline-block;
width: 100%;
// height: 300rpx;
// line-height: 300rpx;
// text-align: center;
// font-size: 36rpx;
}
.titleItem {
width: calc(100%) !important;
}
/deep/.scroll-view-item:nth-child(2n-1) {
background-color: transparent !important;
}
.list_item:last-child {
border-bottom: none !important;
}
</style>

1254
pages/detail/orderLCont.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,290 @@
<template>
<view>
<public-module></public-module>
<z-nav-bar title="我的优惠券"></z-nav-bar>
<view class="">
<view class="">
<u-tabs
v-if="tabList.length > 0"
:class="['tabList']"
@click="tabClick"
:current="curTagIndex"
:activeStyle="activeStyle"
:scrollable="false"
:list="tabList"
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"
></u-tabs>
</view>
<!-- -->
<view class="tanchu" style="position: relative">
<view
v-if="status!=0"
style="
min-height: 80vh;
z-index: 100;
background-color: #f0f0f0;
opacity: 0.55;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
"
></view>
<view class="listBox" v-if="list.length > 0">
<view style="min-height: 40vh; overflow-y: scroll">
<common-coupon :List="list" :source="'mine'"> </common-coupon>
</view>
<!-- <view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view> -->
</view>
<view class="" v-else>
<u-divider v-show="listStatus == 2" text="已加载全部"></u-divider>
<u-divider v-show="listStatus == 3" text="暂无数据"></u-divider>
<u-divider v-show="listStatus == 1" text="加载中..."></u-divider>
</view>
</view>
</view>
<z-navigation></z-navigation>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
data() {
return {
list: [], // 优惠券列表
listStatus: 88,
curTagIndex: 0, // 当前索引
tabList: [
{
name: "未使用",
id: "0",
},
{
name: "已使用",
id: "1",
},
{
name: "已过期",
id: "2",
},
],
activeStyle: {
background: "#fff",
color: "#666",
padding: "10rpx",
borderRadius: "10rpx",
},
page: 0,
limit: 15,
status: 0,
flag: false, // 请求标记
};
},
onLoad() {
this.page = 1;
this.getUserCouponList();
},
async onReachBottom() {
console.log("触底", this.listStatus, this.flag);
if (this.listStatus != 1 && this.listStatus != 2) {
if (!this.flag) {
this.page++;
await this.getUserCouponList();
}
}
},
filters: {
couponType(type) {
// 0无限制 1课程卷 2课程品类卷
var str = "";
switch (type) {
case 0:
str = "全场通用";
break;
case 1:
str = "指定课程可用";
break;
case 2:
str = "指定课程品类可用";
break;
}
return str;
},
},
computed: {
...mapState(["userInfo"]),
},
methods: {
async tabClick(e) {
console.log("e", e);
this.status = e.id;
// this.curTagIndex = e.index
this.page = 0;
this.page += 1;
this.list = [];
await this.getUserCouponList();
},
async getUserCouponList() {
console.log("进入函数了妈");
this.listStatus = 1;
this.flag = true;
uni.showLoading({
title: "加载中",
});
console.log(
{
page: this.page,
limit: this.limit,
getType: "", //获取类型 0 后台赠送 1 主动获取
status: this.status, //使用状态 0 未使用 1 已使用 2 已过期
userInfo: "", //用户信息
userId: this.userInfo.id,
},
111111111111111111111111111
);
await this.$http
.request({
url: "common/coupon/getCouponHistoryList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
page: this.page,
limit: this.limit,
getType: "", //获取类型 0 后台赠送 1 主动获取
status: this.status, //使用状态 0 未使用 1 已使用 2 已过期
userInfo: "", //用户信息
userId: this.userInfo.id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log(res, "1111111111111");
uni.hideLoading();
if (res.code != 0) return this.$commonJS.showToast(res.errMsg);
if (res.couponList.records.length > 0) {
this.list = this.list.concat(res.couponList.records);
if (res.couponList.pages > this.page) {
this.listStatus = 0;
} else {
this.listStatus = 2;
}
} else {
this.listStatus = 3; // 暂无数据
}
this.flag = false;
})
.catch((e) => {
uni.hideLoading();
console.log(e);
this.flag = false;
this.listStatus = 3;
console.log(e, "数据报错");
this.$commonJS.showToast(e.errMsg);
});
},
},
};
</script>
<style lang="scss" scoped>
.btnBox {
margin-top: 20rpx;
}
.tanchu {
padding: 0 30rpx 40rpx 30rpx;
position: relative;
// max-height: 60vh;
// overflow-y: scroll;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
.addressItem {
border: 2px dashed #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
.addrContent {
margin-left: 40rpx;
flex: 1;
.addrContentTop {
display: flex;
align-items: flex-end;
margin: 0 0 15rpx 0;
position: relative;
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
.userMoren {
border: 1px solid #fd6004;
color: #fd6004;
padding: 3rpx 10rpx;
font-size: 22rpx;
border-radius: 10rpx;
margin: 0 0 0 20rpx;
}
.chooseCheck {
position: absolute;
top: 3rpx;
right: 6rpx;
}
}
.addrContentBottom {
font-size: 32rpx;
}
}
}
.addressItem.addItem_style {
border-color: #fd6004;
}
}
</style>

106
pages/news/news.vue Normal file
View File

@@ -0,0 +1,106 @@
<template>
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="新闻详情"></z-nav-bar>
<view class="box">
<view class="title">
{{news.title}}
</view>
<!-- <view class="content" v-html="news.content"></view> -->
<rich-text v-if="news.content" class="content"
:nodes="formatRichText(news.content)"></rich-text>
</view>
<music-play :playData="playData"></music-play>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
var clear;
import {
mapState
} from 'vuex';
export default {
data() {
return {
playData: {},
newsId: null,
news: {
content: '',
title: ''
}
};
},
//第一次加载
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
this.newsId = e.newsid
console.log(e, '------')
},
computed: {
...mapState(['userInfo'])
},
//页面显示
onShow() {
// 隐藏原生的tabbar
uni.hideTabBar();
this.getData();
},
components: {
musicPlay
},
//方法
methods: {
getData() {
this.$http
.post('common/message/getMessageById?id=' + this.newsId)
.then(res => {
if (res.code == 0) {
this.news.content = res.result.content
this.news.title = res.result.title
}
}).catch(e => {
console.log(e, '获取新闻详情报错')
});
},
formatRichText(html) { //控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
return match;
});
newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) {
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi,
'max-width:100%;');
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(/\<img/gi,
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
return newContent;
},
},
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.box {
background-color: #fff;
padding: 0 10px;
// @include pleft_right(10px);
min-height: calc(100vh - 270rpx);
}
.title{font-size: 32rpx; font-weight: bold; display: block; text-align: center;}
.content { font-size: 26rpx; line-height: 48rpx; margin-top: 10rpx;}
</style>

View File

@@ -0,0 +1,158 @@
<template>
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<!-- <z-nav-bar title="新闻详情"></z-nav-bar> -->
<web-view v-if="urlVisible" :webview-styles="webviewStyles" :src="surl"></web-view>
<!-- <music-play :playData="playData"></music-play> -->
</view>
</template>
<script>
// import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
var clear;
import {
mapState
} from 'vuex';
export default {
data() {
return {
playData: {},
newsObj: null,
news: {
content: '',
title: ''
},
source:'',
urlVisible:false,
surl:'',
type:null,
webviewStyles: {
progress: {
color: '#55aaff'
}
},
};
},
//第一次加载
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
this.newsId = e.newsId
this.type = e.type
this.surl = e.url
this.source = e.source
console.log(e, '------')
// #ifdef APP-PLUS
const pages = getCurrentPages()
const page = pages[pages.length - 1];
const currentWebview = page.$getAppWebview()
currentWebview.setStyle({
titleNView: {
buttons: [{
float: 'right',
type: 'close',
onclick: function() {
uni.navigateBack({
delta: 1
});
}
}]
}
})
// #endif
},
computed: {
...mapState(['userInfo'])
},
//页面显示
onShow() {
// 隐藏原生的tabbar
uni.hideTabBar();
if(this.type == 1 && this.surl != ''){
// this.surl = this.newsObj.url
this.urlVisible = true
this.news = {}
}
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
components: {
// musicPlay
},
//方法
methods: {
getData() {
var _url = "common/message/getMessageById"
if(this.source = 'taihuzhiguang'){ // 太湖之光
_url = "common/taihuWelfare/getTaihuWelfareArticleDetail"
$http.request({
url: `${_url}`,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
id: this.newsId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
this.news.content = res.result.content
this.news.title = res.result.title
}
}).catch(e => {
console.log(e, '获取新闻详情报错')
});
}else{
this.$http
.post(`${_url}?id=${this.newsId}`)
.then(res => {
if (res.code == 0) {
this.news.content = res.result.content
this.news.title = res.result.title
}
}).catch(e => {
console.log(e, '获取新闻详情报错')
});
}
},
formatRichText(html) { //控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
return match;
});
newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) {
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi,
'max-width:100%;');
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(/\<img/gi,
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
return newContent;
},
},
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.box {
background-color: #fff;
// @include pleft_right(10px);
min-height: calc(100vh - 270rpx);
}
.title{font-size: 32rpx; font-weight: bold; display: block; text-align: center;}
.content { font-size: 26rpx; line-height: 48rpx; margin-top: 10rpx;}
</style>

View File

@@ -21,9 +21,9 @@
<p>一款线上电子书APP包含医学类国学类文学类中医古籍等各种类型3D仿真翻页护眼模式等阅读技术打造舒适阅读体验图文混排AI人声读书听书部分电子书也有对应的纸质书给予用户更多的阅读选择</p>
</view>
<view class="" style="text-align: center;">
<!-- https://main.nuttyreading.com/privacy.html -->
<!-- https://www.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://www.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>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<template>
<view style="padding: 0 40rpx; font-size: 28upx">
<view style="padding: 0 20rpx; font-size: 28upx">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<view style="height: 50rpx"></view>
@@ -28,48 +28,29 @@
<text style="margin-left: 20rpx; font-size: 22rpx; color: #888" v-else
>({{ userMes.email }})</text
>
<!-- <text class="tong">累计读书5本
<span style="margin: 0 20upx;">|</span> 今日读50分钟
</text> -->
</view>
<br clear="both" />
</view>
<!-- <view class="now_vip" v-if="userMes.vip==0">
<text>
<image src="../../static/icon/mine_p.png" style="height: 44rpx;"></image>
开通会员畅享海量内容
</text>
<b class="kt_btn" @click="onPageJump('./opeVip')">开通VIP</b>
</view> -->
<!-- <view class="now_vip" v-if="userMes.vip==1">
<text>
<image src="../../static/icon/mine_v.png"></image>
尊贵的VIP会员
<font style="font-size: 14rpx;margin-left: 20rpx;">{{userMes.vipValidtime}}到期</font>
</text>
<b class="kt_btn" @click="onPageJump('./opeVip')">立即续费</b>
</view> -->
<view class="chong_zhi">
<view class="zhanghu" @click="onPageJump('../user/persCount')">
<!-- <view class="zhanghu" @click="onPageJump('../user/persCount')">
我的账户
<text style="float: right; line-height: 85rpx"> > </text>
</view>
<text style="float: right; line-height: 85rpx"> </text>
</view> -->
<view class="chong_list">
<view v-if="iosHide">
<b>{{ userMes.peanutCoin }}</b>
<view @click="onPageJump('/pages/user/persCount')">
<b style="color: #11a669!important;">{{ userMes.peanutCoin }}</b>
天医币
</view>
<view v-if="iosHide">
<b>{{ userMes.conponsCount }}</b>
<view @click="onPageJump('/pages/user/points')">
<b style="color: #11a669!important;">{{ userMes.jf }}</b>
积分
</view>
<view @click="onPageJump('/pages/mine/wallet/couponList')">
<b style="color: #fd6004 !important;">{{ userCouponNum }}</b>
优惠券
</view>
<!-- <b class="chong_btn" @click="onPageJump('../sdkDemo/pay')"> </b> -->
<b class="chong_btn" v-if="iosHide" @click="onPageJump('./reCharge')"
> </b
>
<b class="chong_btn" v-if="$platform == 'android'" @click="onPageJump('./reCharge')"> </b>
</view>
</view>
@@ -77,47 +58,24 @@
<view class="nav_list" @click="onPageJump('../bookShop/orderList')">
<text>我的订单</text>
</view>
<!-- <view class="nav_list" @click="onPageJump('../clock/clockList')">
<text>我的打卡</text>
</view> -->
<!-- <view class="nav_list" @click="onPageJump('../listen/home')" v-if="iosHide">
<text>我的听书</text>
</view> -->
<!-- 暂时去掉 -->
<!-- <view class="nav_list" @click="onPageJump('../listen/setListen')" v-if="iosHide">
<text>听书设置</text>
</view> -->
<!-- <view class="nav_list" @click="onPageJump('../peanut/myComments')">
<text>我的评价</text>
</view> -->
<!-- 暂时去掉 -->
<view class="nav_list" @click="onPageJump('../peanut/shopping')">
<text>购物车</text>
</view>
<!-- <view v-if="showEbook" class="nav_list" @click="onPageJump('../eBook/bookBuy')">
<text>电子书购买记录</text>
</view> -->
<!-- <view v-if="showEbook" class="nav_list" @click="onPageJump('../eBook/bookRecord')">
<text>阅读记录</text>
</view> -->
<view class="nav_list" @click="onPageJump('../user/persData')">
<text>修改个人资料</text>
</view>
<view class="nav_list" @click="onPageJump('../user/address')">
<text>地址管理</text>
</view>
<!-- <view class="nav_list" @click="onGoing()">
<text>帮助与反馈11111</text>
</view> -->
<!-- <view class="nav_list" @click="newOnShare" v-if="isAndorid"> -->
<view class="nav_list" @click="newOnShare">
<text>分享App</text>
</view>
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
<text>关于我们</text>
</view>
<view class="nav_list" @click="onPageJump('/pages/user/workOrder')">
<text>问题反馈/申诉</text>
</view>
<view class="nav_list" @click="signShow = true">
<text>退出登录</text>
</view>
@@ -154,22 +112,16 @@ export default {
return {
showEbook: false, // 显示电子书相关
userMes: {},
userCouponNum: 0,
signShow: false,
signContent: "是否要退出登录?",
playData: {},
isAndorid: true,
platform: null, // 设备系统
playData: {}
};
},
//第一次加载
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
// #ifdef APP-PLUS
this.getOS();
this.platform = uni.getSystemInfoSync().platform;
// console.log('操纵系统',this.platform)
// #endif
},
computed: {
...mapState(["userInfo"]),
@@ -186,17 +138,33 @@ export default {
//方法
methods: {
...mapMutations(["setUserInfo"]),
// 获得操作系统
getOS() {
let oprateOs = "";
oprateOs = uni.getSystemInfoSync().platform;
// console.log(oprateOs)
if (oprateOs == "android") {
this.isAndorid = true;
} else {
this.isAndorid = false;
}
},
async getUserCouponList(){
await this.$http
.request({
url: "common/coupon/getCouponHistoryList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"page":1,
"limit":10,
"getType":"",//获取类型 0 后台赠送 1 主动获取
"status":"0",//使用状态 0 未使用 1 已使用 2 已过期
"userInfo":"",//用户信息
"userId":this.userMes.id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if(res.code != 0) return;
this.userCouponNum = res.couponList.total
}).catch(e => {
console.log(e);
this.$commonJS.showToast(e.errMsg);
})
},
haveSelected(data) {
console.log(data, " 选择的是");
if (data.index == 0) {
@@ -245,6 +213,7 @@ export default {
if (this.userInfo.id != undefined) {
this.$http.post("book/user/info/" + this.userInfo.id).then((res) => {
this.userMes = res.user;
this.getUserCouponList();
if (this.userMes.vip == 1) {
this.userMes.vipValidtime = this.userMes.vipValidtime.substring(
0,
@@ -388,9 +357,8 @@ export default {
.chong_zhi {
background-color: #fff;
margin: 0 0 30upx 0;
padding: 0 30upx;
height: 240upx;
padding: 30upx;
margin-bottom: 30rpx;
.zhanghu {
font-size: 32upx;
@@ -406,7 +374,7 @@ export default {
color: #a3a1a1;
b {
font-size: 45rpx;
font-size: 40rpx;
display: block;
margin: 0 0 10rpx 0;
color: #76757b;
@@ -421,7 +389,7 @@ export default {
color: #fffbf6;
padding: 12rpx 42rpx;
margin: 20rpx 0 0 0;
background: #815219;
background: #11a669;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -12,33 +12,16 @@
<text v-for="item in historyList" @click="serkeyWord(item)">{{item}}</text>
</view>
</view>
<!-- <view class="sear_class" v-if="this.show==1">
<view class="sc_xuan">
<view class="sc_con" v-for="(item,index) in classFen" @click="FenBook(item)"
:class="bookScreen.type == item.id ? 'sc_con sc_con_style' : 'sc_con'">{{item.sort}}</view>
</view>
<view class="sc_xuan">
<view class="sc_con" v-for="(item,index) in classMian" @click="MianBook(item)"
:class="bookScreen.is_charge == item.id ? 'sc_con sc_con_style' : 'sc_con'">{{item.sort}}</view>
</view>
</view> -->
<view class="sear_list" v-if="this.show==1">
<view class="flexbox" style="display: flex; flex-wrap: wrap; justify-content: space-evenly;">
<view class="flexbox" style="display: flex; flex-wrap: wrap;">
<view class="bl_tioa" v-for="(item,index) in bookList" @click="onBookJump(item)">
<image :src="item.productImages"></image>
<view>
<text class="bok_name">{{item.productName}}</text>
<view class="bl_tioa_bg">
<image :src="item.productImages"></image>
<view>
<text class="bok_name">{{item.productName}}</text>
</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>
@@ -291,41 +274,46 @@
}
.sear_list {
margin: 50rpx 30rpx 0 30rpx;
// justify-content: space-between;
margin: 50rpx 30rpx 0 30rpx;
.bl_tioa {
width: 30%;
box-shadow: 0 0px 10px 1px #d3d1d133; padding-bottom: 10rpx;
background-color: #fff; margin-bottom: 20rpx;
// position: relative;
// padding: 0 25upx 10upx 220upx;
// margin: 0 0 60rpx 0;
text-align: center;
border-radius: 15rpx;
min-height: 250rpx;
view {
display: block;
text { display: block;
color: #9b9b9b;
font-size: 24rpx;
line-height: 36rpx;
width: 33.3%;
padding: 10rpx;
.bl_tioa_bg{
height: 360rpx;
background-color: #fff; margin-bottom: 20rpx;
text-align: center;
border-radius: 15rpx;
box-shadow: 0 0px 10px 1px #d3d1d133;
view {
display: block;
text { display: block;
color: #9b9b9b;
font-size: 24rpx;
line-height: 36rpx;
}
.bok_name {
font-weight: bold;
color: #333;
font-size: 26rpx;
line-height: 35rpx;
height: 103rpx;
max-height: 105rpx;
overflow: hidden;
}
}
.bok_name {
font-weight: bold;
color: #333;
font-size: 28rpx;
image {
display: inline-block;
padding-top:20rpx;
width: 160upx;
height: 220upx;
}
}
image { display: inline-block;
padding-top:20rpx;
width: 160upx;
height: 220upx;
}
}
}
</style>

View File

@@ -5,20 +5,43 @@
<scroll-view scroll-y="true">
<view class="cartItem" v-for="(item,index) in cartList" :key="index">
<view class="select">
<checkbox :checked="item.checked" @click="checkboxGroupChange(index,item)"
<checkbox style="transform:scale(0.8)" :checked="item.checked" @click="checkboxGroupChange(index,item)"
class="round checkedItem" />
</view>
<view class="cartContent">
<view class="cartContent" style="position: relative;">
<span v-if="item.isVipPrice==1&&item.vipPrice!=0&&item.vipPrice!=null"
style="position: absolute;z-index: 10;top: 4px;left: 0px;margin-right: 10px;text-align: center;font-size: 18rpx;background-color: #f94f04;color: #fff;font-weight: bold;border-radius:4px;width: 80rpx; padding:2px 4px;box-sizing: border-box;">VIP优惠</span>
<image :src="item.image" mode="" @click="goDetail(item.productId)"></image>
<view class="itemCenter">
<view class="cartTitle" @click="goDetail(item.productId)">
<view class="cartTitle" @click="goDetail(item.productId)" style="display: flex;align-items: center;">
<text>{{item.productName}}</text>
</view>
<view class="itemPrice">
<text v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice*item.productAmount}}</text>
<text v-else>{{item.price*item.productAmount}}</text>
<u-number-box v-model="item.productAmount" @change="valChange($event,item)" :input-width="50"
:input-height="20" :min="1" :max="item.productStock" integer @overlimit='overlimit'></u-number-box>
<text v-if="item.isVipPrice==1&&item.vipPrice!=0&&item.vipPrice!=null">
<text style="color: #e97512;font-size: 16px;font-weight: bold;">{{(item.vipPrice).toFixed(2)}}</text>
<!-- <text style="color: #fa2d12;font-size: 10px;margin-left: 4px;">VIP到手价</text> -->
<text style="color: #8a8a8a;font-size: 14px;margin-left: 4px;font-weight: bold;text-decoration: line-through;">{{(item.price).toFixed(2)}}</text>
</text>
<text
v-else-if="item.activityPrice && item.activityPrice > 0">
<text style="color: #e97512;font-size: 16px;font-weight: bold;">{{(item.activityPrice).toFixed(2)}}</text>
<!-- <text style="color: #613804;font-size: 10px;margin-left: 4px;">活动价</text> -->
<text style="color: #8a8a8a;font-size: 14px;margin-left: 4px;font-weight: bold;text-decoration: line-through;">{{(item.price).toFixed(2)}}</text>
</text>
<text v-else style="color: #e97512;font-size: 16px;font-weight: bold;">{{item.price}}</text>
<u-number-box button-size="20" v-model="item.productAmount" @change="valChange($event,item)"
:input-width="25" :input-height="10" :min="1" :max="item.productStock" integer
@overlimit='overlimit'></u-number-box>
</view>
</view>
</view>
@@ -29,13 +52,20 @@
<!-- 底部操作区 -->
<view class="shopCarFooter">
<view class="selectAll">
<checkbox :checked="all" @click="isSelectAll()" class="round checkedItem" />
<checkbox :checked="all" style="transform:scale(0.8)" @click="isSelectAll()" class="round checkedItem" />
<text class="cartCho">全选</text>
<!-- <text class="cartDel" >删除</text> -->
<button class="mini-btn" style="border-radius: 40rpx; font-size: 30rpx; height: 56rpx; line-height: 56rpx; margin-left: 6rpx;" v-if="isCartDelShow" @click="delCart()" type="warn" size="mini">删除</button>
<button class="mini-btn"
style="border-radius: 40rpx; font-size: 30rpx; height: 56rpx; line-height: 56rpx; margin-left: 6rpx;"
v-if="isCartDelShow" @click="delCart()" type="warn" size="mini">删除</button>
</view>
<view class="exhibition">
<text class="total">合计: <b>{{totalPrice}}</b></text>
<view class="total">合计: <b>{{totalPrice}}</b>
<!-- <text style="display: inline-block;width: 80%;color: #8a8a8a;font-size: 10px;">
不包含运费
</text> -->
</view>
<view class="settlement" @click="setTment()">
结算
</view>
@@ -59,7 +89,7 @@
export default {
data() {
return {
playData:{},
playData: {},
totalPrice: 0, // 总价
all: false, // 是否全选
isCartDelShow: false, // 是否展示删除按钮
@@ -84,8 +114,8 @@
computed: {
...mapState(['userInfo']),
},
components:{
musicPlay
components: {
musicPlay
},
//方法
methods: {
@@ -135,36 +165,40 @@
this.cartList.forEach((item, index) => {
let price = 0;
if (item.checked) {
if(item.activityPrice && item.activityPrice > 0){
price = item.productAmount * item.activityPrice;
}else{
price = item.productAmount * item.price;
if (item.isVipPrice == 1 && item.vipPrice != 0) {
price = (item.productAmount * item.vipPrice).toFixed(2);
} else {
if (item.activityPrice && item.activityPrice > 0) {
price = (item.productAmount * item.activityPrice).toFixed(2);
} else {
price = (item.productAmount * item.price).toFixed(2);
}
}
allprice += price
}
allprice += Number(price)
})
this.totalPrice = allprice
},
this.totalPrice = allprice.toFixed(2)
},
// 超出阈值时
overlimit(){
overlimit() {
uni.showToast({
title:'超出商品数量',
title: '超出商品数量',
icon: 'error',
duration: 1000
})
},
valChange(e, item) {
console.log(e)
let productItem = {}
productItem = item
let productItem = {}
productItem = item
productItem.productAmount = e.value
this.updateCart(productItem)
setTimeout(() => {
this.total()
}, 300)
this.updateCart(productItem)
setTimeout(() => {
this.total()
}, 300)
},
// 更新购物车
updateCart(shagnpin){
updateCart(shagnpin) {
// 已在购物车中添加
$http.request({
url: "book/ordercart/update",
@@ -211,7 +245,7 @@
}).then(res => {
this.isCartDelShow = false
this.totalPrice = 0
this.getCartList()
this.getCartList()
uni.hideLoading()
})
} else {
@@ -223,27 +257,27 @@
// 跳转结算页面
setTment() {
let shangList=[]
let shangList = []
this.cartList.forEach((item, index) => {
if (item.checked) {
shangList.push(index)
shangList.push({productId:item.productId,num:item.productAmount})
}
})
// 如果没有勾选
if(shangList.length == 0){
if (shangList.length == 0) {
uni.showToast({
title: "请先勾选商品",
icon: 'error',
duration: 1000,
})
}else{
uni.navigateTo({
url: '../bookShop/settlement?type=1&list='+JSON.stringify(shangList)
});
} else {
uni.navigateTo({
url: '../bookShop/settlement?type=1&list=' + JSON.stringify(shangList)
});
}
},
// 商品内容跳转
goDetail(id) {
uni.navigateTo({
@@ -264,7 +298,7 @@
padding-top: 20rpx;
.cartItem {
padding: 10rpx 10rpx 10rpx 20rpx;
padding: 10rpx 10rpx 10rpx 10rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
@@ -276,8 +310,8 @@
display: flex;
image {
width: 150rpx;
height: 180rpx;
width: 130rpx;
height: 150rpx;
border-radius: 10rpx;
padding: 10rpx;
margin-right: 15rpx;
@@ -359,4 +393,4 @@
}
}
}
</style>
</style>

1955
pages/read/localread.vue Normal file

File diff suppressed because it is too large Load Diff

2055
pages/read/read.vue Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -107,7 +107,7 @@
// 返回true表示校验通过返回false表示不通过
// 过滤第一层先判断输入为不为空因为required: false不是必填项所以为空应该返回true
if (value) {
return this.$u.test.mobile(value);
return /^\d{5,15}$/.test(value);
} else {
return true
}

View File

@@ -41,7 +41,7 @@
</view>
<view class="triangle borderBottom phoneNumberInput"
:clasfs="[type == 1000 ? 'left_triangle': 'right_triangle']">
<input type="number" v-model="phone" @input="onInput" placeholder="请输入您的手机号"
<input type="number" v-model="phone" @input="onInput" placeholder="请输入您的手机号"
placeholder-class="grey" />
</view>
</view>
@@ -112,10 +112,10 @@
</view>
<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: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>
<view style="width: 30%; font-size: 30rpx;" @click="type = 1000" v-if="type == 2000">密码登录</view>
<view class="methTitle" v-if="type == 1000">
<text @click="type = 2000" style="font-size: 30rpx;">验证码登录</text>
<text v-if="type == 1000" @click="onPageJump('/pages/user/forget')" style="font-size: 30rpx;">忘记密码</text>
<!-- <text @click="resetPassWord()">忘记密码</text> -->
</view>
</view>
@@ -247,7 +247,7 @@
yszcText: {},
quShow: false,
quCodeList: [], // 国家区域码
quCode: 86,
quCode: "86",
};
},
@@ -840,7 +840,7 @@
height: 67rpx;
input {
font-size: 28rpx;
font-size: 32rpx;
margin: 20rpx 0;
}
}
@@ -890,7 +890,9 @@
}
.methTitle{
width:60%; display: flex; justify-content:space-between;
}
.logo_bg {
background-image: url('@/static/icon/login_bg.png');
// background-position: center center;
@@ -946,7 +948,7 @@
font-size: 40rpx;
letter-spacing: 3rpx;
color: #666;
font-size: 34rpx;
&.active {
position: relative;
color: $themeColor;
@@ -1030,7 +1032,7 @@
input {
flex: 1;
font-size: 28rpx;
font-size: 32rpx;
color: #333;
height: 70rpx;
}
@@ -1127,22 +1129,23 @@
.third_party_login_box {
position: fixed;
bottom: 60rpx;
bottom: 20rpx;
width: 100%;
left: 0;
display: flex; align-content: center; align-items: center; justify-content: center;
padding: 0 30rpx;
.third_party_title {
display: flex;
// display: flex;
align-items: center;
&:before,
&:after {
content: '';
flex: 1;
height: 2rpx;
background-color: #f5f5f5;
}
// &:before,
// &:after {
// content: '';
// flex: 1;
// height: 2rpx;
// background-color: #f5f5f5;
// }
text {
font-size: 24rpx;
@@ -1153,14 +1156,14 @@
}
.third_party_content {
margin-top: 60rpx;
display: flex;
justify-content: center;
align-items: center;
// margin-top: 60rpx;
// display: flex;
// justify-content: center;
// align-items: center;
image {
width: 80upx;
height: 80upx;
width: 60upx;
height: 60upx;
margin: 0 20rpx;
}
}

View File

@@ -3,41 +3,53 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="我的账户"></z-nav-bar>
<u-alert
type="warning"
size="20rpx"
:title="goBuyTitle"
:show-icon="true"
>
</u-alert>
<view class="ACTable">
<u-tabs :list="tab_list" @click="tab_click" lineColor="#54a966 100% 100%"
<!-- <u-tabs :list="tab_list" @click="tab_click" lineColor="#54a966 100% 100%"
:activeStyle="{color: '#303133',fontWeight: 'bold',transform: 'scale(1.1)'}" v-if="iosHide"></u-tabs>
<u-tabs :list="tab_list_ios" @click="tab_click" lineColor="#54a966 100% 100%"
:activeStyle="{color: '#303133',fontWeight: 'bold',transform: 'scale(1.1)'}" v-if="!iosHide"></u-tabs>
:activeStyle="{color: '#303133',fontWeight: 'bold',transform: 'scale(1.1)'}" v-if="!iosHide"></u-tabs> -->
<view>
<view
class="AC_chong"
@click="onPageJump('/pages/peanut/reCharge')"
>立即充值
<u-icon
name="arrow-right"
color="#fff"
size="16"
class="rightArrow"
></u-icon>
</view>
</view>
<view v-if="tab_muJian==0">
<view class="AC_mes">
<view style="font-size: 50rpx;font-weight: bold;">{{userMes.peanutCoin}}</view>
<view style="color: #888;font-size: 30rpx;margin-top: 10rpx;">天医币</view>
<text v-if="platform != 'ios'" class="AC_chong" @click="buPoint()">充值</text>
</view>
<view class="AC_con">
<view class="AC_jilu">充值记录</view>
<view v-for="(item,index) in MoneyRecord" class="AC_List">
<view class="AC_jilu PM_font">充值消费记录</view>
<view v-for="(item,index) in MoneyRecord" class="AC_List" @click="goClick(item)">
<view class="AC_title">
{{item.orderType}}
<view>
<text v-if="item.changeAmount>0">+</text>
<text>{{item.changeAmount}}</text>
天医币
</view>
</view>
<view class="AC_mark">{{item.remark}}</view>
<view class="AC_mark" v-if="item.remark">{{item.remark}}</view>
<view class="AC_note" v-if="item.note&&item.note!='null'">说明{{item.note}}</view>
<view class="AC_time">{{item.createTime}}</view>
</view>
</view>
</view>
<view v-if="tab_muJian==1">
<view class="couponList">
<view v-for="(item,index) in couponTabs" @click="couponTabCLi(index)"
<view v-for="(item,index) in couponTabs"
:class="couponListTab==index?'couStyle':''">{{item.name}}</view>
</view>
<view>
@@ -117,16 +129,23 @@
export default {
data() {
return {
goBuyTitle:'【天医币】仅为我平台支付使用币种 。一人民币=一天医币,仅为了方便用户支付使用。【天医币】可以用于在我平台支付书籍或课程使用。【天医币】这个名称是为适应我们平台的定位属性,所起名称。与区块链虚拟货币无任何关系。',
playData: {},
platform: null,
tab_list: [{
name: '天医币',
}, {
name: '优惠券',
}],
tab_list_ios: [{
name: '优惠券',
}],
},
// {
// name: '优惠券',
// }
],
tab_list_ios: [
// {
// name: '优惠券',
// }
],
couponTabs: [{
name: '未使用'
}, {
@@ -190,10 +209,7 @@
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
// #ifdef APP-PLUS
this.platform = uni.getSystemInfoSync().platform
console.log('操纵系统', this.platform)
// #endif
},
computed: {
...mapState(['userInfo'])
@@ -203,19 +219,28 @@
// 隐藏原生的tabbar
uni.hideTabBar();
this.getData();
this.getCourpe();
},
components: {
musicPlay
},
//方法
methods: {
//列表跳转到详情
goClick(data){
if(data.relationId){
uni.navigateTo({
url: "/pages/detail/orderLCont?orderId=" + data.relationId
});
}
},
// 获取
getData() {
if(!this.iosHide){
this.tab_muJian=1
}
var data = {
userId: this.userInfo.id,
};
// 用户详情
if (this.userInfo.id != undefined) {
this.$http
@@ -224,45 +249,29 @@
this.userMes = res.user
});
}
uni.showLoading({
title: '加载中'
})
// 充值记录
this.$http
.post('book/transactiondetails/list?userId=' + this.userInfo.id + '&page=' + this.RecordScreen
.page + '&limit=' + this.RecordScreen.limit)
.then(res => {
this.MoneyRecord = res.page.list
this.totalPage = res.page.totalPage
this.totalCount = res.page.totalCount
});
$http
.request({
url: 'common/transactionDetails/getTransactionDetailsList',
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
uni.hideLoading();
this.MoneyRecord = res.transactionDetailsList;
});
},
// 点击tab
tab_click(e) {
this.tab_muJian = e.index
},
// 优惠券
getCourpe() {
this.$http
.post('/book/couponhistory/appGetUserCenterCoupon?userId=' + this.userInfo.id + '&useStatus=' + this
.couponListTab)
.then(res => {
// this.cardList = res.couponVos
this.cardList = res.couponVos
});
},
// 切换优惠券
couponTabCLi(e) {
this.couponListTab = e
this.getCourpe()
},
// 充值天医币
buPoint() {
uni.navigateTo({
@@ -284,7 +293,7 @@
@import '@/style/mixin.scss';
.ACTable {
padding: 20rpx 30rpx;
padding: 20rpx;
.AC_mes {
margin-top: 50rpx;
@@ -308,52 +317,56 @@
}
.AC_con {
margin-top: 50rpx;
padding: 30rpx 30rpx;
box-shadow: 0 0px 10px 1px #d3d1d133;
background-color: #fff;
border-radius: 15rpx;
border-radius: 0 0 15rpx 15rpx;
margin-bottom: 40rpx;
font-size: 30rpx;
.AC_jilu {
font-size: 32rpx;
text-align: center;
margin-bottom: 30rpx;
font-size: 42rpx;
text-align: left;
color: $themeColor;
padding: 30rpx 20rpx 20rpx;
}
.AC_List {
border-bottom: 1px solid #eee;
padding: 40rpx 10rpx;
overflow: hidden;
padding: 20rpx;
border-bottom: 1rpx solid #e0e0e0;
.AC_title {
font-size: 32rpx;
margin-bottom: 20rpx;
font-weight: bold;
view {
float: right;
font-size: 34rpx;
font-weight: bold;
color: #11a669;
}
}
.AC_mark {
font-size: 28rpx;
margin-bottom: 15rpx;
color: #888;
width: 100%;
font-size: 28rpx;
margin-top: 20rpx;
margin-bottom: 15rpx;
color: #888;
display: inline-block;
}
.AC_note {
color: #888;
font-size: 26rpx;
}
.AC_time {
color: #bababa;
font-size: 25rpx;
font-size: 26rpx;
display: inline-block;
}
}
.AC_List:last-child{
border-bottom: 0;
}
}
.couponList {
@@ -563,10 +576,28 @@
background: #c6c6c6;
}
}
}
/deep/.u-alert__content__title{
font-size: 24rpx !important;
line-height: 28rpx !important;
}
.AC_chong {
display: flex;
align-items: center;
justify-content: space-between;
background-image: linear-gradient(90deg, #54a966 0%, #a3d7ae 100%);
color: #fff;
border-top-left-radius: 15rpx;
border-top-right-radius: 15rpx;
padding: 20rpx 20rpx;
font-size: 36rpx;
font-weight: 800;
text-align: right;
}
.rightArrow {
width: 40rpx;
height: 40rpx;
float: right;
margin-left: 10rpx;
}
</style>

429
pages/user/points.vue Normal file
View File

@@ -0,0 +1,429 @@
<template>
<view class="commonPageBox">
<z-nav-bar title="我的积分"> </z-nav-bar>
<view class="ACTable"><view>
<view class="AC_con">
<common-list
:dataList="MoneyRecord"
isCondition="true"
isNoIcon="true"
label="orderType"
>
<template slot="labelSlot" slot-scope="slotProps">
<view class="label_content AC_List" @click="slotProps.row.relationId?goClick(slotProps.row.relationId):''">
<view class="point_box">
<view class="title"><view class="AC_time">{{slotProps.row.createTime}}</view></view>
<view class="Hot">
<text v-if="slotProps.row.changeAmount > 0">+</text>
<text>{{slotProps.row.changeAmount}}</text>
</view>
</view>
<view class="AC_mark" v-if="slotProps.row.remark">{{slotProps.row.remark}}</view>
</view>
</template>
</common-list>
</view>
</view>
<view style="padding-bottom: 20rpx">
<u-back-top
:scroll-top="scrollTop"
bottom="60"
:customStyle="bgiStyle"
:iconStyle="iconStyle"
>
</u-back-top>
</view>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
data() {
return {
playData: {},
platform: null,
urlList: {
list: "common/jfTransactionDetails/getJfTransactionDetailsList",
},
cardList: [],
couponListTab: 0,
MoneyRecord: [],
userMes: {},
RecordScreen: {
userid: "",
page: 1,
limit: 5,
},
scrollTop: 0,
status: 3,
totalPage: 0,
totalCount: 0,
tab_muJian: 0,
bgiStyle: {
background: "#bbe5d8",
},
iconStyle: {
fontSize: "40rpx",
fontWeight: "bold",
color: "#54a966",
},
};
},
// 返回顶部
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
//第一次加载
onLoad(e) {
},
computed: {
...mapState(["userInfo"]),
},
//页面显示
onShow() {
this.getData();
},
//方法
methods: {
//列表进入详情
goClick(id){
uni.navigateTo({
url: "/pages/detail/orderLCont?orderId=" + id
});
},
//获取数据
getData() {
var data = {
userId: this.userInfo.id,
};
if (!this.iosHide) {
this.tab_muJian = 1;
}
//用户详情
if (this.userInfo.id != undefined) {
this.$http.post("book/user/info/" + this.userInfo.id).then((res) => {
this.userMes = res.user;
});
}
uni.showLoading({
title: '加载中'
})
$http.request({
url: this.urlList.list,
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
uni.hideLoading();
this.MoneyRecord = res.transactionDetailsList;
});
},
},
};
</script>
<style lang="scss" scoped>
.ACTable {
padding: 20rpx;
.AC_mes {
width: 100%;
height: 300rpx;
padding: 40rpx 20rpx;
box-shadow: 0 0px 10px 1px #d3d1d133;
border-radius: 15rpx;
margin-bottom: 10rpx;
position: relative;
.wallet_title {
color: #333;
font-size: 40rpx;
line-height: 60rpx;
font-weight: 500 !important;
margin-bottom: 20rpx;
}
.wallet_number {
color: #333;
font-size: 80rpx;
line-height: 80rpx;
font-weight: bold;
}
}
.AC_con {
overflow: hidden;
border-radius: 15rpx;
font-size: 30rpx;
padding-bottom: 30rpx;
.AC_jilu {
font-size: 42rpx;
text-align: left;
color: #3d75bf;
padding: 10rpx 20rpx 40rpx;
}
/deep/.list_item {
background-color: rgba(255, 255, 255, 0.85) !important;
box-shadow: 0 0px 10px 1px #d3d1d133 !important;
}
}
.couponList {
view {
display: inline-block;
padding: 0 0 25rpx 0;
margin: 40rpx 0 40rpx 0;
width: 33%;
text-align: center;
font-size: 30rpx;
}
.couStyle {
border-bottom: 5rpx solid #54a966;
color: #54a966;
font-weight: bold;
}
}
.card {
width: 100%;
overflow: hidden;
margin-bottom: 30rpx;
padding-left: 10rpx;
position: relative;
}
.card > view {
background: #fff;
border-radius: 5rpx;
}
.card .dot-left,
.card .dot-right {
display: block;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #f5f5f5;
position: absolute;
z-index: 999;
}
.card .dot-left {
bottom: -6rpx;
left: -6rpx;
}
.card .dot-right {
bottom: -6rpx;
right: -6rpx;
}
.card .page-group {
position: absolute;
top: 10rpx;
left: -2rpx;
width: 100%;
max-width: 200rpx;
.fold-page {
display: block;
width: 10rpx;
height: 8rpx;
background: #54a966;
transform: skewY(-40deg);
position: absolute;
top: -5rpx;
left: -8rpx;
z-index: 0;
}
.page {
position: absolute;
z-index: 1;
display: block;
padding: 5rpx 20rpx 3rpx 20rpx;
height: 40rpx;
line-height: 40rpx;
background: linear-gradient(137deg, #54a966 0%, #0d5e1e 100%);
border-radius: 0 20rpx 20rpx 0;
color: #fff;
text-align: center;
font-size: 24rpx;
overflow: hidden;
left: -8rpx;
}
}
.card .page-group.grey {
.fold-page {
background: #c6c6c6;
}
.page {
background: linear-gradient(137deg, #c6c6c6 0%, #999595 100%);
}
}
.card .content {
width: 100%;
height: 180rpx;
border-bottom: 1rpx dotted #f5f5f5;
position: relative;
z-index: 2;
}
.card .content .coupon-detail {
display: flex;
padding: 0 15rpx 0 20rpx;
}
.card .content .coupon-detail > view {
height: 130rpx;
display: flex;
align-items: center;
}
.card .content .coupon-detail > view:first-child {
color: #54a966;
padding-top: 100rpx;
width: 30%;
}
.card .content .coupon-detail > view.grey {
color: #c6c6c6;
}
.card .content .coupon-detail > view:first-child > span:first-child {
font-size: 30rpx;
margin: 0 10rpx 0 0;
}
.card .content .coupon-detail > view:first-child > span:last-child {
font-size: 70rpx;
}
.card .content .coupon-detail > view:last-child > view {
color: #54a966;
border: 1rpx solid #54a966;
border-radius: 50rpx;
font-size: 12px;
line-height: 25px;
width: 150rpx;
height: 50rpx;
margin: 100rpx 0 0 5rpx;
text-align: center;
}
.card .coupon-detail > view:nth-child(2) {
flex-direction: column;
padding-top: 60rpx;
width: 40%;
}
.card .coupon-detail > view:nth-child(2) > view {
width: 100%;
}
.card .coupon-detail > view:nth-child(2) > view:first-child {
color: #333;
font-weight: bold;
font-size: 25rpx;
margin: 0 0 10rpx 0;
}
.card .coupon-detail > view:nth-child(2) > view:last-child {
font-size: 12px;
color: #adadad;
margin-top: 5rpx;
}
.card .coupon-detail > view:nth-child(2) > view:last-child > view {
transform: scale(0.8);
margin-left: -14rpx;
}
.card {
.footer {
color: #999;
font-size: 12px;
padding: 30rpx 15rpx 30rpx 30rpx;
}
.ribbon {
width: 160rpx;
height: 40rpx;
background: #54a966;
position: absolute;
right: -40rpx;
top: 25rpx;
transform: rotateZ(45deg);
text-align: center;
color: #fff;
font-size: 20rpx;
line-height: 44rpx;
}
.ribbon.grey {
background: #c6c6c6;
}
}
}
.Hot {
color: #11a669 !important;
font-size: 32rpx;
font-weight: bold;
}
.AC_chong {
display: flex;
align-items: center;
justify-content: space-between;
background-image: linear-gradient(90deg, #258feb 0%, #73ee9c 100%);
color: #fff;
border-top-left-radius: 15rpx;
border-top-right-radius: 15rpx;
padding: 20rpx 20rpx;
font-size: 36rpx;
font-weight: 800;
text-align: right;
}
.rightArrow {
width: 40rpx;
height: 40rpx;
float: right;
margin-left: 10rpx;
}
.point_box{
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 0;
}
.title{
font-size: 32rpx;
font-weight: bold;
}
.AC_mark {
width: 100%;
display: block;
font-size: 28rpx;
color: #343434;
padding-top: 10rpx;
}
.AC_time {
color: #909090;
font-size: 28rpx;
padding-top: 10rpx;
}
</style>

417
pages/user/workOrder.vue Normal file
View File

@@ -0,0 +1,417 @@
<template>
<view class="page">
<z-nav-bar></z-nav-bar>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<view class="title">问题反馈/申诉</view>
<uni-forms :modelValue="form" :rules="rules" ref="form">
<view class="input_box " style="">
<uni-forms-item label="" name="type" label-width="0">
<view class="">
<text class="input_tit"><i>*</i>问题类型</text>
</view>
<view class="in" style="flex: 1; border: none;">
<!-- <input type="text" v-model="form.type" placeholder="请输入手机号/邮箱" />
-->
<uni-data-select style="width: 100%;" v-model="form.type"
:localdata="typeLIst"></uni-data-select>
</view>
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="account" label-width="0">
<text class="input_tit"><i>*</i>吴门医述账号:</text>
<view class="in">
<input placeholder-style="font-size:26rpx" type="text" v-model="form.account"
placeholder="请输入手机号/邮箱" />
</view>
</uni-forms-item>
</view>
<view class="input_box" v-if="form.type == 3">
<uni-forms-item label="" name="relation" label-width="0">
<text class="input_tit"><i>*</i>订单编号:</text>
<view class="in">
<input type="number" @input="relationInput" placeholder-style="font-size:26rpx"
v-model="form.relation" placeholder="请输入订单编号" />
</view>
<text v-show="relationError" style="font-size: 24rpx; color: red; margin-top: 10rpx;">请填写订单编号</text>
<text v-show="relationErrorPattern"
style="font-size: 24rpx; color: red; margin-top: 10rpx;">订单编号格式错误</text>
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="content" label-width="0">
<text class="input_tit"><i>*</i>问题描述:</text>
<view class="in">
<view class="uni-textarea">
<textarea placeholder-style="font-size:26rpx" v-model="form.content" maxlength="200"
placeholder="请输入您要反馈的问题" />
</view>
</view>
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="contactInformation" label-width="0">
<text class="input_tit"><i>*</i>联系电话:</text>
{{reversedMessage}}
<view class="in">
<input type="number" placeholder-style="font-size:26rpx" @input="telInput"
v-model="form.contactInformation" placeholder="请输入与您联系的手机号" />
</view>
<text v-show="telError" style="font-size: 24rpx; color: red; margin-top: 10rpx;">手机号格式错误</text>
</uni-forms-item>
</view>
<view class="input_box">
<text class="input_tit">问题截图:</text>
<view class="in" style="border: none;" @click="checkPermision">
<u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4"
width="40" height="40" :previewFullImage="true">
</u-upload>
<text style="font-size: 24rpx; color: #999;">可上传4张问题截图</text>
</view>
<!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> -->
</view>
</uni-forms>
<view class="btn_box"><button @click="onSubmit"> </button></view>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import {
mapState,
mapMutations
} from 'vuex';
export default {
data() {
return {
fileList1: [],
playData: {},
//手机号账号
form: {
account: '', // 账号
content: '', // 描述
image: '', //图片
contactInformation: '', // 联系电话
relation: '', // 订单号
type: null, // 反馈类型
},
telError: false,
relationError: false,
relationErrorPattern:false,
rules: {
account: {
rules: [{
required: true,
errorMessage: '请输入账号',
}
]
},
content: {
rules: [{
required: true,
errorMessage: '请输入问题描述',
}
]
},
contactInformation: {
rules: [{
required: true,
errorMessage: '请输入联系电话',
}
]
},
type: {
rules: [{
required: true,
errorMessage: '请选择反馈类型',
}
]
}
},
pageType: '',
typeLIst: [
// { value: 0, text: "请选择" },
{
value: "1",
text: "登陆相关问题"
},
{
value: "2",
text: "账号相关问题"
},
{
value: "3",
text: "订单相关问题"
},
{
value: "4",
text: "购买相关问题"
},
{
value: "5",
text: "VIP相关问题"
},
{
value: "6",
text: "充值相关问题"
},
{
value: "7",
text: "网络暴力举报"
},
{
value: "8",
text: "其他"
},
],
};
},
//第一次加载
onLoad(e) {
console.log('收到的值', e);
this.pageType = e.name
switch (this.pageType) {
case "login":
this.form.type = '1'
break;
case "order":
this.form.type = '3'
break;
}
},
//页面显示
onShow() {
},
computed: {
...mapState(['userInfo']),
reversedMessage: function() {
// `this` 指向 vm 实例
this.form.account = this.userInfo.tel
}
},
//方法
methods: {
relationInput(e) {
this.relationError = false
this.relationErrorPattern = false
},
telInput(e) {
// console.log('键盘输入',e);
this.telError = false
},
async checkPermision(){
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
},
async addPic(e) {
console.log("添加图片");
let that = this;
for (var i = 0; i < e.file.length; i++) {
//console.log(i,e.file[i].url)
uni.uploadFile({
url: this.$baseUrl + "oss/fileoss",
filePath: e.file[i].url,
//files:e.file,
name: "file",
formData: {},
success: (res) => {
that.fileList1.push({
url: JSON.parse(res.data).url,
});
console.log(that.fileList1, "that.uploadPicLIst");
},
fail: (error) => {
console.log("上传失败", error);
},
});
}
},
deletePic(event) {
this.fileList1.splice(event.index, 1)
},
onSubmit() {
this.$refs.form.validate().then(res => {
if (this.form.type == 3) {
if (this.form.relation == '') {
this.relationError = true
return
} else {
if (!this.$base.orderRegular.test(this.form.relation)) {
this.relationErrorPattern = true
return
}
}
}
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
// console.log('this.fileList1',_list);
this.form.image = _list.join(',')
}
if (!this.$base.phoneRegular.test(this.form.contactInformation)) {
this.telError = true
uni.showToast({
title: '手机格式不正确',
icon: 'none'
});
return;
}
// console.log('this.fileList1',this.form.image);
$http.request({
url: "common/sysFeedback/addSysFeedback",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
...this.form
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
uni.showModal({
title: "提示",
content: "提交成功!",
showCancel: false,
success: (res) => {
this.fileList1 = []
// this.$nextTick(() => {
uni.navigateBack({
delta: 1
});
// })
}
});
}).catch(e => {
// console.log('表单错误信息:', err);
uni.showToast({
title: '提交失败',
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
})
})
}
},
//页面隐藏
onHide() {},
//页面卸载
onUnload() {},
//页面下来刷新
onPullDownRefresh() {},
//页面上拉触底
onReachBottom() {},
//用户点击分享
onShareAppMessage(e) {
return this.wxShare();
}
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
::v-deep .uni-forms-item{
margin-bottom: 26rpx !important;
}
.input_tit{
font-weight: bold;
}
.page {
background-color: #ffffff;
padding: 0 65rpx;
min-height: 100vh;
.title {
padding: 30rpx 0 40rpx 0;
font-size: 40rpx;
color: #333333;
}
.input_box {
display: block;
// justify-content: space-between;
// overflow: hidden;
// height: 100rpx;
padding-top: 10rpx;
// border-bottom: 1rpx solid #eeeeee;
align-items: center;
i {
font-size: 24rpx;
color: red;
padding-right: 10rpx;
}
.in {
border: 1rpx solid #eeeeee;
border-radius: 8rpx;
padding: 8rpx;
margin-top: 10rpx;
}
text {
font-size: 30rpx;
width: 180rpx;
}
input {
flex: 1;
height: 50rpx;
// line-height: 70rpx;
font-size: 30rpx;
}
button {
height: 78rpx;
line-height: 78rpx;
font-size: 30rpx;
color: $themeColor;
&:active {
background-color: transparent;
}
}
}
.btn_box {
margin-top: 70rpx;
padding-bottom: 20rpx;
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>

BIN
static/40x40.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/background0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
static/background1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
static/icon/currency.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 KiB

After

Width:  |  Height:  |  Size: 664 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 KiB

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 KiB

After

Width:  |  Height:  |  Size: 149 KiB

BIN
static/icon/pay_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

BIN
static/logo_taihu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Binary file not shown.

BIN
static/wumen40.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
static/xlkj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@@ -27,6 +27,9 @@ button {
button::after {
border: none;
}
.PM_font {
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
}
// 主题背景色
.themeBgColor {
background-color: $themeColor;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More