first commit
|
|
@ -0,0 +1,801 @@
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
onLaunch: function() {
|
||||||
|
let that = this
|
||||||
|
// #ifdef MP-WEIXIN || MP-TOUTIAO
|
||||||
|
//是否开启小程序自动登录 881
|
||||||
|
this.$u.get('/app/common/type/881').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
if (res.data.value == '是') {
|
||||||
|
//没有登录的时候开始自动登录
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
uni.login({
|
||||||
|
provider: 'weixin',
|
||||||
|
success: function(loginRes) {
|
||||||
|
console.log(loginRes, 'code')
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
let data = {
|
||||||
|
code: loginRes.code
|
||||||
|
}
|
||||||
|
that.$Request.get('/app/Login/wxLogin', data).then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('openId', res.data.open_id)
|
||||||
|
uni.setStorageSync('unionId', res.data.unionId)
|
||||||
|
uni.setStorageSync('sessionkey', res.data
|
||||||
|
.session_key)
|
||||||
|
|
||||||
|
let invitationCode = '';
|
||||||
|
if (uni.getStorageSync('invitation')) {
|
||||||
|
invitationCode = uni.getStorageSync(
|
||||||
|
'invitation')
|
||||||
|
}
|
||||||
|
let qdCodeion = ''
|
||||||
|
if (uni.getStorageSync('qdCodeion')) {
|
||||||
|
qdCodeion = uni.getStorageSync('qdCodeion')
|
||||||
|
}
|
||||||
|
let sendData = {
|
||||||
|
openId: uni.getStorageSync('openId'),
|
||||||
|
unionId: uni.getStorageSync('unionId'),
|
||||||
|
userName: '游客',
|
||||||
|
avatar: '/static/images/logo.png',
|
||||||
|
sex: 1, //性别
|
||||||
|
inviterCode: invitationCode, //别人登录进来携带你的邀请码
|
||||||
|
qdCode: qdCodeion
|
||||||
|
};
|
||||||
|
let postData = {
|
||||||
|
openId: sendData.openId, //小程序openId
|
||||||
|
unionId: sendData.unionId, //unionId
|
||||||
|
userName: sendData.userName, //微信名称
|
||||||
|
avatar: sendData.avatar, //头像
|
||||||
|
sex: sendData.sex, //性别
|
||||||
|
phone: '',
|
||||||
|
inviterCode: sendData.inviterCode,
|
||||||
|
qdCode: sendData.qdCode
|
||||||
|
};
|
||||||
|
that.$Request.postJson(
|
||||||
|
'/app/Login/insertWxUser', postData)
|
||||||
|
.then(
|
||||||
|
res => {
|
||||||
|
uni.hideLoading();
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.setStorageSync('token', res
|
||||||
|
.token)
|
||||||
|
uni.setStorageSync('userName',
|
||||||
|
res.user.userName)
|
||||||
|
uni.setStorageSync('avatar',
|
||||||
|
res.user.avatar)
|
||||||
|
uni.setStorageSync('phone', res
|
||||||
|
.user.phone)
|
||||||
|
uni.setStorageSync(
|
||||||
|
'invitationCode', res
|
||||||
|
.user
|
||||||
|
.invitationCode)
|
||||||
|
if (res.user.qdCode) {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'qdCode', res.user
|
||||||
|
.qdCode)
|
||||||
|
}
|
||||||
|
uni.setStorageSync('autoPrice',
|
||||||
|
res.user.autoPrice)
|
||||||
|
uni.setStorageSync('sex', res
|
||||||
|
.user.sex)
|
||||||
|
uni.setStorageSync('userId',
|
||||||
|
res.user.userId)
|
||||||
|
uni.setStorageSync('openId',
|
||||||
|
res.user.openId)
|
||||||
|
that.$u.api.userVip({
|
||||||
|
userId: uni
|
||||||
|
.getStorageSync(
|
||||||
|
'userId')
|
||||||
|
}).then(rest => {
|
||||||
|
if (rest.code ==
|
||||||
|
0 && rest
|
||||||
|
.data && rest
|
||||||
|
.data.isVip ==
|
||||||
|
2) {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'isVIP',
|
||||||
|
true)
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'isVIP',
|
||||||
|
false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
code: loginRes.code,
|
||||||
|
anonymous_code: loginRes.anonymousCode
|
||||||
|
}
|
||||||
|
that.$Request.post('/app/Login/dyLogin', data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
let invitationCode = '';
|
||||||
|
if (uni.getStorageSync('invitation')) {
|
||||||
|
invitationCode = uni.getStorageSync(
|
||||||
|
'invitation')
|
||||||
|
}
|
||||||
|
let qdCodeion = ''
|
||||||
|
if (uni.getStorageSync('qdCodeion')) {
|
||||||
|
qdCodeion = uni.getStorageSync('qdCodeion')
|
||||||
|
}
|
||||||
|
that.$Request.postJson(
|
||||||
|
'/app/Login/dyRegister', {
|
||||||
|
userName: '游客', //抖音名称
|
||||||
|
avatar: '/static/images/logo.png', //头像
|
||||||
|
sex: 1, //性别
|
||||||
|
// phone: '',
|
||||||
|
inviterCode: invitationCode,
|
||||||
|
dyOpenId: res.data.dyOpenId,
|
||||||
|
qdCode: qdCodeion
|
||||||
|
}).then(ress => {
|
||||||
|
uni.hideLoading()
|
||||||
|
if (ress.code == 0) {
|
||||||
|
uni.setStorageSync('token',
|
||||||
|
ress.token)
|
||||||
|
uni.setStorageSync('userName',
|
||||||
|
ress.user.userName)
|
||||||
|
uni.setStorageSync('avatar',
|
||||||
|
ress.user.avatar)
|
||||||
|
uni.setStorageSync('phone',
|
||||||
|
ress.user.phone)
|
||||||
|
uni.setStorageSync(
|
||||||
|
'invitationCode', ress
|
||||||
|
.user
|
||||||
|
.invitationCode)
|
||||||
|
if (ress.user.qdCode) {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'qdCode', ress.user
|
||||||
|
.qdCode)
|
||||||
|
}
|
||||||
|
uni.setStorageSync('sex', ress
|
||||||
|
.user.sex)
|
||||||
|
uni.setStorageSync('userId',
|
||||||
|
ress.user.userId)
|
||||||
|
uni.setStorageSync('openId',
|
||||||
|
ress.user.dyOpenId)
|
||||||
|
that.$u.api.userVip({
|
||||||
|
userId: uni
|
||||||
|
.getStorageSync(
|
||||||
|
'userId')
|
||||||
|
}).then(rest => {
|
||||||
|
if (rest.code ==
|
||||||
|
0 && rest
|
||||||
|
.data && rest
|
||||||
|
.data.isVip ==
|
||||||
|
2) {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'isVIP',
|
||||||
|
true)
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'isVIP',
|
||||||
|
false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-KUAISHOU
|
||||||
|
let data = {
|
||||||
|
code: loginRes.code,
|
||||||
|
}
|
||||||
|
that.$Request.post('/app/Login/ksLogin', data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
let invitationCode = '';
|
||||||
|
if (uni.getStorageSync('invitation')) {
|
||||||
|
invitationCode = uni.getStorageSync(
|
||||||
|
'invitation')
|
||||||
|
}
|
||||||
|
let qdCodeion = '';
|
||||||
|
if (uni.getStorageSync('qdCodeion')) {
|
||||||
|
qdCodeion = uni.getStorageSync('qdCodeion')
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$Request.postJson(
|
||||||
|
'/app/Login/ksRegister', {
|
||||||
|
userName: '游客', //名称
|
||||||
|
avatar: '/static/images/logo.png', //头像
|
||||||
|
sex: 1, //性别
|
||||||
|
// phone: '',
|
||||||
|
inviterCode: invitationCode,
|
||||||
|
ksOpenId: res.data.ksOpenId,
|
||||||
|
qdCode: qdCodeion
|
||||||
|
}).then(ress => {
|
||||||
|
uni.hideLoading()
|
||||||
|
if (ress.code == 0) {
|
||||||
|
uni.setStorageSync('token',
|
||||||
|
ress.token)
|
||||||
|
uni.setStorageSync('userName',
|
||||||
|
ress.user.userName)
|
||||||
|
uni.setStorageSync('avatar',
|
||||||
|
ress.user.avatar)
|
||||||
|
uni.setStorageSync('phone',
|
||||||
|
ress.user.phone)
|
||||||
|
uni.setStorageSync(
|
||||||
|
'invitationCode', ress
|
||||||
|
.user
|
||||||
|
.invitationCode)
|
||||||
|
if (ress.user.qdCode) {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'qdCode', ress.user
|
||||||
|
.qdCode)
|
||||||
|
}
|
||||||
|
uni.setStorageSync('sex', ress
|
||||||
|
.user.sex)
|
||||||
|
uni.setStorageSync('userId',
|
||||||
|
ress.user.userId)
|
||||||
|
uni.setStorageSync('openId',
|
||||||
|
ress.user.ksOpenId)
|
||||||
|
that.$u.api.userVip({
|
||||||
|
userId: uni
|
||||||
|
.getStorageSync(
|
||||||
|
'userId')
|
||||||
|
}).then(rest => {
|
||||||
|
if (rest.code ==
|
||||||
|
0 && rest
|
||||||
|
.data && rest
|
||||||
|
.data.isVip ==
|
||||||
|
2) {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'isVIP',
|
||||||
|
true)
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync(
|
||||||
|
'isVIP',
|
||||||
|
false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setInterval(d => { //定时器,定时去调取聊天未读消息
|
||||||
|
let userId = uni.getStorageSync('userId')
|
||||||
|
if (userId) {
|
||||||
|
this.$Request.getT('/app/message/selectMessageCount').then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
let num = res.data
|
||||||
|
uni.setStorageSync('numCount', num)
|
||||||
|
if (num == 0) {
|
||||||
|
uni.removeTabBarBadge({
|
||||||
|
index: 3
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.setTabBarBadge({
|
||||||
|
index: 3,
|
||||||
|
text: num + ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
//#ifdef H5
|
||||||
|
|
||||||
|
this.$u.get('/app/common/type/108').then(res => { //// 是否开启公众号自动登陆 108
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
if (res.data.value == '是') {
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
let openid = uni.getStorageSync('openId');
|
||||||
|
let userId = uni.getStorageSync('userId');
|
||||||
|
if (!userId) {
|
||||||
|
if (openid) {
|
||||||
|
that.$u.get('/app/Login/openid/login?openId=' + openid).then(
|
||||||
|
res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.setStorageSync('token', res.token)
|
||||||
|
uni.setStorageSync('userId', res.user.userId)
|
||||||
|
uni.setStorageSync('userName', res.user.userName)
|
||||||
|
uni.setStorageSync('phone', res.user.phone)
|
||||||
|
uni.setStorageSync('invitationCode', res.user
|
||||||
|
.invitationCode)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//#endif
|
||||||
|
//#ifdef APP-PLUS
|
||||||
|
// APP检测更新 具体打包流程可以参考:https://ask.dcloud.net.cn/article/35667
|
||||||
|
plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定
|
||||||
|
//获取是否热更新过
|
||||||
|
const updated = uni.getStorageSync('updated'); // 尝试读取storage
|
||||||
|
if (updated.completed === true) {
|
||||||
|
// 如果上次刚更新过
|
||||||
|
// 删除安装包及安装记录
|
||||||
|
console.log('安装记录被删除,更新成功');
|
||||||
|
uni.removeSavedFile({
|
||||||
|
filePath: updated.packgePath,
|
||||||
|
success: res => {
|
||||||
|
uni.removeStorageSync('updated');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (updated.completed === false) {
|
||||||
|
uni.removeStorageSync('updated');
|
||||||
|
plus.runtime.install(updated.packgePath, {
|
||||||
|
force: true
|
||||||
|
});
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'updated',
|
||||||
|
data: {
|
||||||
|
completed: true,
|
||||||
|
packgePath: updated.packgePath
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
console.log('成功安装上次的更新,应用需要重启才能继续完成');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '应用将重启以完成更新',
|
||||||
|
showCancel: false,
|
||||||
|
complete: () => {
|
||||||
|
plus.runtime.restart();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//获取当前系统版本信息
|
||||||
|
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||||
|
//请求后台接口 解析数据 对比版本
|
||||||
|
that.$Request.getT('/app/user/selectNewApp').then(res => {
|
||||||
|
res = res.data[0];
|
||||||
|
if (res.wgtUrl && widgetInfo.version < res.version) {
|
||||||
|
let downloadLink = '';
|
||||||
|
let androidLink = res.androidWgtUrl;
|
||||||
|
let iosLink = res.iosWgtUrl;
|
||||||
|
let ready = false;
|
||||||
|
//校验是是不是热更新
|
||||||
|
if (res.wgtUrl.match(RegExp(/.wgt/))) {
|
||||||
|
// 判断系统类型
|
||||||
|
if (plus.os.name.toLowerCase() === 'android') {
|
||||||
|
console.log('安卓系统');
|
||||||
|
if (androidLink && androidLink !== '#') {
|
||||||
|
// 我这里默认#也是没有地址,请根据业务自行修改
|
||||||
|
console.log('发现下载地址');
|
||||||
|
// 安卓:创建下载任务
|
||||||
|
if (androidLink.match(RegExp(/.wgt/))) {
|
||||||
|
console.log('确认wgt热更新包');
|
||||||
|
downloadLink = androidLink;
|
||||||
|
ready = true;
|
||||||
|
} else {
|
||||||
|
console.log('安卓推荐.wgt强制更新,.apk的强制更新请您自行修改程序');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('下载地址是空的,无法继续');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('苹果系统');
|
||||||
|
if (iosLink && iosLink !== '#') {
|
||||||
|
// 我这里默认#也是没有地址,请根据业务自行修改
|
||||||
|
console.log('发现下载地址');
|
||||||
|
// 苹果(A):进行热更新(如果iosLink是wgt更新包的下载地址)判断文件名中是否含有.wgt
|
||||||
|
if (iosLink.match(RegExp(/.wgt/))) {
|
||||||
|
console.log('确认wgt热更新包');
|
||||||
|
downloadLink = iosLink;
|
||||||
|
ready = true;
|
||||||
|
} else {
|
||||||
|
console.log('苹果只支持.wgt强制更新');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('下载地址是空的,无法继续');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ready) {
|
||||||
|
console.log('任务开始');
|
||||||
|
let downloadTask = uni.downloadFile({
|
||||||
|
url: downloadLink,
|
||||||
|
success: res => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
// 保存下载的安装包
|
||||||
|
console.log('保存安装包');
|
||||||
|
uni.saveFile({
|
||||||
|
tempFilePath: res.tempFilePath,
|
||||||
|
success: res => {
|
||||||
|
const packgePath = res
|
||||||
|
.savedFilePath;
|
||||||
|
// 保存更新记录到stroage,下次启动app时安装更新
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'updated',
|
||||||
|
data: {
|
||||||
|
completed: false,
|
||||||
|
packgePath: packgePath
|
||||||
|
},
|
||||||
|
success: () => {
|
||||||
|
console
|
||||||
|
.log(
|
||||||
|
'成功保存记录'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 任务完成,关闭下载任务
|
||||||
|
console.log(
|
||||||
|
'任务完成,关闭下载任务,下一次启动应用时将安装更新'
|
||||||
|
);
|
||||||
|
downloadTask.abort();
|
||||||
|
downloadTask = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('下载地址未准备,无法开启下载任务');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//不是热更新是在线更新 校验是否强制升级
|
||||||
|
if (res.method == 'true') {
|
||||||
|
uni.showModal({
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '立即更新',
|
||||||
|
title: '发现新版本',
|
||||||
|
content: res.des,
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.$queue.showLoading('下载中...');
|
||||||
|
if (uni.getSystemInfoSync().platform ==
|
||||||
|
'android') {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: androidLink,
|
||||||
|
success: downloadResult => {
|
||||||
|
if (downloadResult
|
||||||
|
.statusCode ===
|
||||||
|
200) {
|
||||||
|
plus.runtime
|
||||||
|
.install(
|
||||||
|
downloadResult
|
||||||
|
.tempFilePath, {
|
||||||
|
force: false
|
||||||
|
},
|
||||||
|
d => {
|
||||||
|
console
|
||||||
|
.log(
|
||||||
|
'install success...'
|
||||||
|
);
|
||||||
|
plus.runtime
|
||||||
|
.restart();
|
||||||
|
},
|
||||||
|
e => {
|
||||||
|
console
|
||||||
|
.error(
|
||||||
|
'install fail...'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (uni.getSystemInfoSync().platform ==
|
||||||
|
'ios') {
|
||||||
|
plus.runtime.openURL(iosLink, function(
|
||||||
|
res) {});
|
||||||
|
}
|
||||||
|
} else if (res.cancel) {
|
||||||
|
console.log('取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showModal({
|
||||||
|
title: '发现新版本',
|
||||||
|
confirmText: '立即更新',
|
||||||
|
cancelText: '下次更新',
|
||||||
|
content: res.des,
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.$queue.showLoading('下载中...');
|
||||||
|
if (uni.getSystemInfoSync().platform ==
|
||||||
|
'android') {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: androidLink,
|
||||||
|
success: downloadResult => {
|
||||||
|
if (downloadResult
|
||||||
|
.statusCode ===
|
||||||
|
200) {
|
||||||
|
plus.runtime
|
||||||
|
.install(
|
||||||
|
downloadResult
|
||||||
|
.tempFilePath, {
|
||||||
|
force: false
|
||||||
|
},
|
||||||
|
d => {
|
||||||
|
console
|
||||||
|
.log(
|
||||||
|
'install success...'
|
||||||
|
);
|
||||||
|
plus.runtime
|
||||||
|
.restart();
|
||||||
|
},
|
||||||
|
e => {
|
||||||
|
console
|
||||||
|
.error(
|
||||||
|
'install fail...'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (uni.getSystemInfoSync().platform ==
|
||||||
|
'ios') {
|
||||||
|
plus.runtime.openURL(iosLink, function(
|
||||||
|
res) {});
|
||||||
|
}
|
||||||
|
} else if (res.cancel) {
|
||||||
|
console.log('取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow: function() {
|
||||||
|
console.log('App Show')
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
let userId = uni.getStorageSync('userId')
|
||||||
|
if (userId) {
|
||||||
|
let clientid = plus.push.getClientInfo().clientid;
|
||||||
|
let sysPhone = 1;
|
||||||
|
if (plus.os.name.toLowerCase() === 'android') {
|
||||||
|
sysPhone = 1;
|
||||||
|
} else {
|
||||||
|
sysPhone = 2;
|
||||||
|
}
|
||||||
|
this.$Request.getT('/app/user/updateClientId?clientId=' + clientid + '&userId=' +
|
||||||
|
userId + '&sysPhone=' + sysPhone).then(res => {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
// this.$u.get('/app/common/type/109').then(res => { // 是否开启公众号自动注册 109
|
||||||
|
// if (res.code == 0 && res.data) {
|
||||||
|
// uni.setStorageSync('kefu', res.data.value)
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//微信小程序IOS系统支付功能开关 882
|
||||||
|
this.$u.get('/app/common/type/882').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
let value = res.data.value
|
||||||
|
const sysInfo = uni.getSystemInfoSync()
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
if (sysInfo.osName == 'ios') { //是ios系统
|
||||||
|
if (value == '是') { //开启
|
||||||
|
uni.setStorageSync('isWxIosPay', true)
|
||||||
|
} else { //关闭
|
||||||
|
uni.setStorageSync('isWxIosPay', false)
|
||||||
|
}
|
||||||
|
} else { //不是ios下,直接打开
|
||||||
|
uni.setStorageSync('isWxIosPay', true)
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
//不在微信小程序也直接打开
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
uni.setStorageSync('isWxIosPay', true)
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//是否开启苹果登录 833
|
||||||
|
this.$u.get('/app/common/type/833').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('checkIosLogin', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//是否开启苹果支付 834
|
||||||
|
this.$u.get('/app/common/type/834').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('checkIosPay', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//是否开启微信登录 835
|
||||||
|
this.$u.get('/app/common/type/835').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('checkWxLogin', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//是否开启手机号一键登录 836
|
||||||
|
this.$u.get('/app/common/type/836').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('checkPhoneLogin', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$u.get('/app/common/type/817').then(res => { //是否开启购买整部视频 817
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('zhengbu', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$u.get('/app/common/type/818').then(res => { //是否开启购买单集视频 818
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('danbu', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 微信激励广告id 252
|
||||||
|
this.$u.get('/app/common/type/252').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('adUnitId', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 播放类型 1:抖音云 2:三方云
|
||||||
|
this.$u.get('/app/common/type/821').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('playType', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 是否开启看广告(微信) 251
|
||||||
|
this.$u.get('/app/common/type/251').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data && res.data.value) {
|
||||||
|
uni.setStorageSync('isGuanggao', res.data.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 是否开启看广告(抖音) 254
|
||||||
|
this.$u.get('/app/common/type/254').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data && res.data.value) {
|
||||||
|
uni.setStorageSync('isGuanggaody', res.data.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$u.get('/app/common/type/202').then(res => { //客服配置 1 二维码客服 2 微信公众号客服 3电话客服
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('kefu', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$u.get('/app/common/type/206').then(res => { //客服电话
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('kefuPhone', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$u.get('/app/common/type/204').then(res => { //微信客服链接
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('kefuUrl', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$u.get('/app/common/type/203').then(res => { //微信客服appid
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('kefuAppId', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//会员开关
|
||||||
|
this.$u.get('/app/common/type/248').then(res => { //会员开关
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('isVips', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//热搜词 249
|
||||||
|
this.$u.get('/app/common/type/249').then(res => { //热搜词
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('moreSearch', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//安卓下载地址 49
|
||||||
|
this.$u.get('/app/common/type/49').then(res => { //热搜词
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('AppUrl', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//微信虚拟支付OfferID 823
|
||||||
|
this.$u.get('/app/common/type/823').then(res => { //热搜词
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('OfferID', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//微信虚拟支付环境(0 米大师正式环境, 1 米大师沙箱环境) 824
|
||||||
|
this.$u.get('/app/common/type/824').then(res => { //热搜词
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('payEnv', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//充值提示 825
|
||||||
|
this.$u.get('/app/common/type/825').then(res => { //热搜词
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('moneyTips', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//是否开启卡密充值 855
|
||||||
|
this.$u.get('/app/common/type/855').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('kmPaySel', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//是否开启分类 849
|
||||||
|
this.$u.get('/app/common/type/849').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('homeTypeSel', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//是否开启收益充值余额 856
|
||||||
|
this.$u.get('/app/common/type/856').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('syPaySel', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//抖音im客服 857
|
||||||
|
this.$u.get('/app/common/type/857').then(res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('imId', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$u.get('/app/common/type/858').then(res => { //是否开启公众号充值
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('isAccountPay', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//抖音广告id
|
||||||
|
this.$u.get('/app/common/type/860').then(res => { //抖音广告
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
uni.setStorageSync('dyadUnitId', res.data.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
||||||
|
//是否开启pc端使用 850
|
||||||
|
this.$u.get('/app/common/type/850').then(res => {
|
||||||
|
if (res.code == 0 && res.data && res.data.value === '否') {
|
||||||
|
if (window.location.href.indexOf('/pages/me/erweimaRegister') === -1) {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/me/erweimaRegister'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onHide: function() {
|
||||||
|
console.log('App Hide')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
|
||||||
|
@import "uview-ui/index.scss";
|
||||||
|
@import 'components/colorui/main.css';
|
||||||
|
@import 'components/colorui/icon.css';
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
/**
|
||||||
|
* 缓存数据优化
|
||||||
|
* var cache = require('utils/cache.js');
|
||||||
|
* import cache from '../cache'
|
||||||
|
* 使用方法 【
|
||||||
|
* 一、设置缓存
|
||||||
|
* string cache.put('k', 'string你好啊');
|
||||||
|
* json cache.put('k', { "b": "3" }, 2);
|
||||||
|
* array cache.put('k', [1, 2, 3]);
|
||||||
|
* boolean cache.put('k', true);
|
||||||
|
* 二、读取缓存
|
||||||
|
* 默认值 cache.get('k')
|
||||||
|
* string cache.get('k', '你好')
|
||||||
|
* json cache.get('k', { "a": "1" })
|
||||||
|
* 三、移除/清理
|
||||||
|
* 移除: cache.remove('k');
|
||||||
|
* 清理:cache.clear();
|
||||||
|
* 】
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
|
var postfix = '_mallStore'; // 缓存前缀
|
||||||
|
/**
|
||||||
|
* 设置缓存
|
||||||
|
* @param {[type]} k [键名]
|
||||||
|
* @param {[type]} v [键值]
|
||||||
|
* @param {[type]} t [时间、单位秒]
|
||||||
|
*/
|
||||||
|
function put(k, v, t) {
|
||||||
|
uni.setStorageSync(k, v)
|
||||||
|
var seconds = parseInt(t);
|
||||||
|
if (seconds > 0) {
|
||||||
|
var timestamp = Date.parse(new Date());
|
||||||
|
timestamp = timestamp / 1000 + seconds;
|
||||||
|
uni.setStorageSync(k + postfix, timestamp + "")
|
||||||
|
} else {
|
||||||
|
uni.removeStorageSync(k + postfix)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存
|
||||||
|
* @param {[type]} k [键名]
|
||||||
|
* @param {[type]} def [获取为空时默认]
|
||||||
|
*/
|
||||||
|
function get(k, def) {
|
||||||
|
var deadtime = parseInt(uni.getStorageSync(k + postfix))
|
||||||
|
if (deadtime) {
|
||||||
|
if (parseInt(deadtime) < Date.parse(new Date()) / 1000) {
|
||||||
|
if (def) {
|
||||||
|
return def;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var res = uni.getStorageSync(k);
|
||||||
|
if (res) {
|
||||||
|
return res;
|
||||||
|
} else {
|
||||||
|
if (def == undefined || def == "") {
|
||||||
|
def = false;
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(k) {
|
||||||
|
uni.removeStorageSync(k);
|
||||||
|
uni.removeStorageSync(k + postfix);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理所有缓存
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
function clear() {
|
||||||
|
uni.clearStorageSync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
put: put,
|
||||||
|
get: get,
|
||||||
|
remove: remove,
|
||||||
|
clear: clear,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
const ROOTPATH1 = "https://duanju.xianmxkj.com/sqx_fast"; //
|
||||||
|
const ROOTPATH = "https://duanju.xianmxkj.com/sqx_fast"; //后台服务域名
|
||||||
|
const ROOTPATH2 = "https://duanju.xianmxkj.com"; //后台服务域名
|
||||||
|
|
||||||
|
// const ROOTPATH1 = location.origin + "/sqx_fast"; //
|
||||||
|
// const ROOTPATH = location.origin + "/sqx_fast"; //后台服务域名
|
||||||
|
// const ROOTPATH2 = location.origin; //后台服务域名
|
||||||
|
|
||||||
|
// const ROOTPATH1 = "https://duanju12.xianmxkj.com/sqx_fast"; //
|
||||||
|
// const ROOTPATH = "https://duanju12.xianmxkj.com/sqx_fast"; //后台服务域名
|
||||||
|
// const ROOTPATH2 = "https://duanju12.xianmxkj.com"; //后台服务域名
|
||||||
|
|
||||||
|
// const ROOTPATH1 = "https://wap.xingqiu1985.com/sqx_fast"; //
|
||||||
|
// const ROOTPATH = "https://wap.xingqiu1985.com/sqx_fast"; //后台服务域名
|
||||||
|
// const ROOTPATH2 = "https://wap.xingqiu1985.com"; //后台服务域名
|
||||||
|
|
||||||
|
|
||||||
|
// const ROOTPATH1 = "https://jc.118zp.com/sqx_fast"; //
|
||||||
|
// const ROOTPATH = "https://jc.118zp.com/sqx_fast"; //后台服务域名
|
||||||
|
// const ROOTPATH2 = "https://jc.118zp.com"; //后台服务域名
|
||||||
|
|
||||||
|
// const ROOTPATH1 = "http://192.168.0.132:8100/sqx_fast"; //后台服务域名
|
||||||
|
// const ROOTPATH = "http://192.168.0.132:8100/sqx_fast"; //后台服务域名
|
||||||
|
// const ROOTPATH2 = "http://192.168.0.132:8100"; //后台服务域名
|
||||||
|
module.exports = {
|
||||||
|
APIHOST: ROOTPATH,
|
||||||
|
APIHOST1: ROOTPATH1,
|
||||||
|
APIHOST2: ROOTPATH2
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
// 如果没有通过拦截器配置域名的话,可以在这里写上完整的URL(加上域名部分)
|
||||||
|
// let hotSearchUrl = 'http://192.168.1.16:8080/sqx_fast/';
|
||||||
|
// let indexUrl = 'http://192.168.1.16:8080/sqx_fast/';
|
||||||
|
|
||||||
|
// 此处第二个参数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) => {
|
||||||
|
let wxLogin = (params = {}) => vm.$u.get('app/Login/wxLogin', params); //微信小程序登陆
|
||||||
|
let insertWxUser = (params = {}) => vm.$u.post('app/Login/insertWxUser', params); //小程序登录新增或修改个人信息
|
||||||
|
let selectPhone = (params = {}) => vm.$u.post('app/Login/selectPhone', params); //获取手机号
|
||||||
|
let userVip = (params = {}) => vm.$u.get('app/UserVip/selectUserVip', params); //用户会员信息
|
||||||
|
let userinfo = (params = {}) => vm.$u.get('app/user/selectUserById', params); //个人信息
|
||||||
|
let updateUser = (params = {}) => vm.$u.post('app/user/updateUser', params); //修改个人信息
|
||||||
|
|
||||||
|
let bannerList = (params = {}) => vm.$u.get('banner/selectBannerList', params); //轮播图
|
||||||
|
let gaidList = (params = {}) => vm.$u.get('app/banner/clickBanner', params); //金刚图列表
|
||||||
|
let msg = (params = {}) => vm.$u.get('app/message/selectMessage', params); //公告
|
||||||
|
let selectBannerPage = (params = {}) => vm.$u.get('app/banner/selectBannerPage', params); //剧情壁纸
|
||||||
|
|
||||||
|
let courseClass = (params = {}) => vm.$u.get('app/courseClassification/selectClassification', params); //资源分类
|
||||||
|
let courseList = (params = {}) => vm.$u.get('app/course/selectCourse', params); //资源列表
|
||||||
|
let courseDet = (params = {}) => vm.$u.get('app/course/selectCourseById', params); //资源详情
|
||||||
|
let courseComment = (params = {}) => vm.$u.get('app/courseComment/selectCourseComment', params); //获取资源评论列表
|
||||||
|
let insertComment = (params = {}) => vm.$u.post('app/courseComment/insertCourseComment', params); //发表评论
|
||||||
|
let courseCollect = (params = {}) => vm.$u.post('app/courseCollect/insertCourseCollect', params); //收藏资源
|
||||||
|
let courseOrder = (params = {}) => vm.$u.get('/app/order/insertCourseOrders', params); //获取订单号
|
||||||
|
let updateGood = (params = {}) => vm.$u.get('/app/courseComment/updateGoodsNum', params); //获取点赞
|
||||||
|
|
||||||
|
let SearchList = (params = {}) => vm.$u.get('app/appSearchController/selectAppSearchNum', params); //热搜记录
|
||||||
|
let SearchDet = (params = {}) => vm.$u.get('app/appSearchController/deleteAppSearch', params); //删除历史记录
|
||||||
|
let search = (params = {}) => vm.$u.get('app/course/selectCourseTitle', params); //搜索
|
||||||
|
let searchs = (params = {}) => vm.$u.get('app/course/selectCourseTitles', params); //搜索
|
||||||
|
// app/course/selectCourse
|
||||||
|
|
||||||
|
// 学习
|
||||||
|
let latelyCourse = (params = {}) => vm.$u.get('app/CourseUser/selectLatelyCourse', params); //最近学习
|
||||||
|
let selectCourse = (params = {}) => vm.$u.get('app/CourseUser/selectCourseUser', params); //已购资源
|
||||||
|
let collectList = (params = {}) => vm.$u.get('app/courseCollect/selectByUserId', params); //资源收藏列表
|
||||||
|
|
||||||
|
// 我的
|
||||||
|
let orderList = (params = {}) => vm.$u.get('app/order/selectOrderByUserId', params); //我的订单
|
||||||
|
let inviter = (params = {}) => vm.$u.get('app/invite/selectInviteByUserIdLists', params); //我的邀请
|
||||||
|
let moneyList = (params = {}) => vm.$u.get('app/invite/queryUserMoneyDetails', params); //钱包明细
|
||||||
|
let queryInviter = (params = {}) => vm.$u.get('app/invite/selectInviteMoney', params); //邀请战绩
|
||||||
|
let vipDet = (params = {}) => vm.$u.get('app/VipDetails/selectVipDetails', params); //会员价格列表
|
||||||
|
let VipOrders = (params = {}) => vm.$u.get('app/order/insertVipOrders', params); //购买会员
|
||||||
|
let integral = (params = {}) => vm.$u.get('app/integral/selectByUserId', params); //查看用户积分
|
||||||
|
let integralDet = (params = {}) => vm.$u.get('app/integral/details', params); //查看积分获取列表
|
||||||
|
let message = (params = {}) => vm.$u.get('app/message/selectMessageByUserId', params); //查询用户消息
|
||||||
|
let wxPay = (params = {}) => vm.$u.post('app/wxPay/wxPayJsApiOrder', params); //微信支付
|
||||||
|
|
||||||
|
let userMoney = (params = {}) => vm.$u.get('app/invite/selectUserMoney', params); //查看钱包
|
||||||
|
let cashMoney = (params = {}) => vm.$u.get('app/cash/cashMoney', params); //申请提现
|
||||||
|
let selectPay = (params = {}) => vm.$u.get('app/cash/selectPayDetails', params); //提现记录
|
||||||
|
let moneyDet = (params = {}) => vm.$u.get('app/cash/queryUserMoneyDetails', params); //钱包明细
|
||||||
|
let type = (params = {}) => vm.$u.get('app/common/type', params); //钱包明细
|
||||||
|
|
||||||
|
|
||||||
|
let help = (params = {}) => vm.$u.get('app/helpWord/selectHelpList', params); //帮助中心
|
||||||
|
let helpDet = (params = {}) => vm.$u.get('app/helpWord/selectHelpWordDetails', params); //帮助中心 详情
|
||||||
|
|
||||||
|
//获取视频
|
||||||
|
let selectCourseDetailsById = (params = {}) => vm.$u.get('app/course/selectCourseDetailsById', params);
|
||||||
|
|
||||||
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||||
|
vm.$u.api = {
|
||||||
|
wxLogin,
|
||||||
|
insertWxUser,
|
||||||
|
selectPhone,
|
||||||
|
userVip,
|
||||||
|
userinfo,
|
||||||
|
updateUser,
|
||||||
|
|
||||||
|
bannerList,
|
||||||
|
gaidList,
|
||||||
|
msg,
|
||||||
|
selectBannerPage,
|
||||||
|
courseClass,
|
||||||
|
courseList,
|
||||||
|
courseDet,
|
||||||
|
courseComment,
|
||||||
|
insertComment,
|
||||||
|
collectList,
|
||||||
|
updateGood,
|
||||||
|
|
||||||
|
SearchList,
|
||||||
|
SearchDet,
|
||||||
|
search,
|
||||||
|
searchs,
|
||||||
|
|
||||||
|
courseCollect,
|
||||||
|
courseOrder,
|
||||||
|
latelyCourse,
|
||||||
|
selectCourse,
|
||||||
|
|
||||||
|
orderList,
|
||||||
|
inviter,
|
||||||
|
queryInviter,
|
||||||
|
vipDet,
|
||||||
|
integral,
|
||||||
|
integralDet,
|
||||||
|
message,
|
||||||
|
VipOrders,
|
||||||
|
wxPay,
|
||||||
|
moneyList,
|
||||||
|
userMoney,
|
||||||
|
cashMoney,
|
||||||
|
selectPay,
|
||||||
|
moneyDet,
|
||||||
|
type,
|
||||||
|
|
||||||
|
help,
|
||||||
|
helpDet,
|
||||||
|
selectCourseDetailsById
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
install
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
// 这里的vm,就是我们在vue文件里面的this,所以我们能在这里获取vuex的变量,比如存放在里面的token变量
|
||||||
|
import {APIHOST} from './config.js'
|
||||||
|
const install = (Vue, vm) => {
|
||||||
|
// 此为自定义配置参数,具体参数见上方说明
|
||||||
|
Vue.prototype.$u.http.setConfig({
|
||||||
|
// baseUrl: 'http://192.168.0.119:8080/sqx_fast',
|
||||||
|
baseUrl: APIHOST,
|
||||||
|
// loadingText: '努力加载中~',
|
||||||
|
loadingTime: 800,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 请求拦截,配置Token等参数
|
||||||
|
Vue.prototype.$u.http.interceptor.request = (config) => {
|
||||||
|
// 引用token
|
||||||
|
// 方式一,存放在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;
|
||||||
|
// config.header.Token = 'xxxxxx';
|
||||||
|
|
||||||
|
// 可以对某个url进行特别处理,此url参数为this.$u.get(url)中的url值
|
||||||
|
// if(config.url == '/user/login') config.header.noToken = true;
|
||||||
|
// 最后需要将config进行return
|
||||||
|
return config;
|
||||||
|
// 如果return一个false值,则会取消本次请求
|
||||||
|
// if(config.url == '/user/rest') return false; // 取消某次请求
|
||||||
|
}
|
||||||
|
|
||||||
|
// 响应拦截,判断状态码是否通过
|
||||||
|
Vue.prototype.$u.http.interceptor.response = (res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
// res为服务端返回值,可能有code,result等字段
|
||||||
|
// 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到
|
||||||
|
// 如果配置了originalData为true,请留意这里的返回值
|
||||||
|
return res;
|
||||||
|
} else if (res.code == 201) {
|
||||||
|
// 假设201为token失效,这里跳转登录
|
||||||
|
vm.$u.toast('验证失败,请重新登录');
|
||||||
|
setTimeout(() => {
|
||||||
|
// 此为uView的方法,详见路由相关文档
|
||||||
|
vm.$u.route('/pages/login/login')
|
||||||
|
}, 1500)
|
||||||
|
return false;
|
||||||
|
} else if (res.code == 401) {
|
||||||
|
// 假设201为token失效,这里跳转登录
|
||||||
|
vm.$u.toast('验证失败,请重新登录');
|
||||||
|
uni.removeStorageSync("token")
|
||||||
|
uni.removeStorageSync("userId")
|
||||||
|
uni.removeStorageSync("phone")
|
||||||
|
uni.removeStorageSync("openid")
|
||||||
|
uni.removeStorageSync("userName")
|
||||||
|
uni.removeStorageSync("relation")
|
||||||
|
uni.removeStorageSync("relation_id")
|
||||||
|
uni.removeStorageSync("isInvitation")
|
||||||
|
uni.removeStorageSync("zhiFuBao")
|
||||||
|
uni.removeStorageSync("zhiFuBaoName")
|
||||||
|
// 此为uView的方法,详见路由相关文档
|
||||||
|
vm.$u.route('/pages/login/login')
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
// 如果返回false,则会调用Promise的reject回调,
|
||||||
|
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
install
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,356 @@
|
||||||
|
import configdata from './config'
|
||||||
|
import cache from './cache'
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
config: function(name) {
|
||||||
|
var info = null;
|
||||||
|
if (name) {
|
||||||
|
var name2 = name.split("."); //字符分割
|
||||||
|
if (name2.length > 1) {
|
||||||
|
info = configdata[name2[0]][name2[1]] || null;
|
||||||
|
} else {
|
||||||
|
info = configdata[name] || null;
|
||||||
|
}
|
||||||
|
if (info == null) {
|
||||||
|
let web_config = cache.get("web_config");
|
||||||
|
if (web_config) {
|
||||||
|
if (name2.length > 1) {
|
||||||
|
info = web_config[name2[0]][name2[1]] || null;
|
||||||
|
} else {
|
||||||
|
info = web_config[name] || null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
},
|
||||||
|
logout: function() {
|
||||||
|
let that = this;
|
||||||
|
uni.removeStorageSync("token")
|
||||||
|
uni.removeStorageSync("userId")
|
||||||
|
uni.removeStorageSync("phone")
|
||||||
|
uni.removeStorageSync("openid")
|
||||||
|
uni.removeStorageSync("userName")
|
||||||
|
uni.removeStorageSync("relation")
|
||||||
|
uni.removeStorageSync("relation_id")
|
||||||
|
uni.removeStorageSync("isInvitation")
|
||||||
|
uni.removeStorageSync("zhiFuBao")
|
||||||
|
uni.removeStorageSync("zhiFuBaoName")
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: '用户信息失效,请重新登录!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
post: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/x-www-form-urlencoded";
|
||||||
|
url = that.config("APIHOST") + url;
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
postT: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/x-www-form-urlencoded";
|
||||||
|
url = that.config("APIHOST1") + url;
|
||||||
|
// let token = uni.getStorageSync("token");
|
||||||
|
let token = uni.getStorageSync("token");
|
||||||
|
if (token) {
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header,
|
||||||
|
"token": token
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header,
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
postJson: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/json";
|
||||||
|
url = that.config("APIHOST1") + url;
|
||||||
|
// let token = uni.getStorageSync("token");
|
||||||
|
let token = uni.getStorageSync("token");
|
||||||
|
if (token) {
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header,
|
||||||
|
"token": token
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header,
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getT: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/x-www-form-urlencoded";
|
||||||
|
url = that.config("APIHOST1") + url;
|
||||||
|
// let token = uni.getStorageSync("token");
|
||||||
|
let token = uni.getStorageSync("token");
|
||||||
|
if (token) {
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "GET",
|
||||||
|
header: {
|
||||||
|
"content-type": header,
|
||||||
|
"token": token
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "GET",
|
||||||
|
header: {
|
||||||
|
"content-type": header
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
posts: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/x-www-form-urlencoded";
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
postF: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/json";
|
||||||
|
url = that.config("APIHOST") + url;
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
postFs: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/json";
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"content-type": header
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
get: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/x-www-form-urlencoded";
|
||||||
|
url = that.config("APIHOST") + url;
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "GET",
|
||||||
|
header: {
|
||||||
|
"content-type": header
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getJd: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/x-www-form-urlencoded";
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "GET",
|
||||||
|
header: {
|
||||||
|
"content-type": header
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
get1: function(url, data, header) {
|
||||||
|
let that = this;
|
||||||
|
header = header || "application/json";
|
||||||
|
url = that.config("APIHOST") + url;
|
||||||
|
return new Promise((succ, error) => {
|
||||||
|
uni.request({
|
||||||
|
url: url,
|
||||||
|
data: data,
|
||||||
|
method: "GET",
|
||||||
|
success: function(result) {
|
||||||
|
if (result.data.code == 401) {
|
||||||
|
that.logout();
|
||||||
|
}
|
||||||
|
succ.call(self, result.data)
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
error.call(self, e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,207 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author maxd
|
||||||
|
* @date 2019.8.1
|
||||||
|
*/
|
||||||
|
module.exports = {
|
||||||
|
//微信的appId
|
||||||
|
getWxAppid() {
|
||||||
|
return 'wxef277af6b5cf522e'
|
||||||
|
},
|
||||||
|
//全局邀请码
|
||||||
|
getInvitation() {
|
||||||
|
return uni.getStorageSync("publicRelation")
|
||||||
|
},
|
||||||
|
//获取APP下载地址
|
||||||
|
getAppDownUrl() {
|
||||||
|
return uni.getStorageSync("appurl")
|
||||||
|
},
|
||||||
|
//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
|
||||||
|
publicYuMing() {
|
||||||
|
return 'https://duanju.xianmxkj.com'
|
||||||
|
},
|
||||||
|
//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
|
||||||
|
publicYuMingAll() {
|
||||||
|
return 'https://duanju.xianmxkj.com/sqx_fast'
|
||||||
|
},
|
||||||
|
minMoney() {
|
||||||
|
return uni.getStorageSync("minMoney") ? uni.getStorageSync("minMoney") : '0.3'
|
||||||
|
},
|
||||||
|
invitaionNum() {
|
||||||
|
return uni.getStorageSync("invitaionNum")
|
||||||
|
},
|
||||||
|
maxMoney() {
|
||||||
|
return uni.getStorageSync("maxMoney") ? uni.getStorageSync("maxMoney") : '0.7'
|
||||||
|
},
|
||||||
|
teamMoney() {
|
||||||
|
return uni.getStorageSync("teamMoney")
|
||||||
|
},
|
||||||
|
logout() {
|
||||||
|
this.remove("token");
|
||||||
|
this.remove("userId");
|
||||||
|
this.remove("mobile");
|
||||||
|
this.remove("openid");
|
||||||
|
this.remove("nickName");
|
||||||
|
this.remove("relation");
|
||||||
|
this.remove("avatar");
|
||||||
|
this.remove("relation_id");
|
||||||
|
this.remove("isInvitation");
|
||||||
|
this.remove("member");
|
||||||
|
this.remove("sex");
|
||||||
|
},
|
||||||
|
loginClear() {
|
||||||
|
this.remove("token");
|
||||||
|
this.remove("userId");
|
||||||
|
this.remove("mobile");
|
||||||
|
this.remove("nickName");
|
||||||
|
this.remove("avatar");
|
||||||
|
this.remove("relation_id");
|
||||||
|
this.remove("isInvitation");
|
||||||
|
this.remove("member");
|
||||||
|
this.remove("sex");
|
||||||
|
},
|
||||||
|
showLoading(title) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: title
|
||||||
|
});
|
||||||
|
},
|
||||||
|
showToast(title) {
|
||||||
|
uni.showToast({
|
||||||
|
title: title,
|
||||||
|
mask: false,
|
||||||
|
duration: 4000,
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getSearchKeys: function(key) {
|
||||||
|
let list = "套套,情趣用品,避孕,男用,女用,成人用品,保健品,冈本 杜蕾斯 杰士邦 第六感 倍力乐 诺丝 多乐士 斯香妮 双一 雨蝶 玛尼仕,充气娃娃,娃娃充气 阴蒂 刺激 超薄 螺纹 震动 润滑 女液体 延时 ";
|
||||||
|
return list.includes(key);
|
||||||
|
},
|
||||||
|
setJson: function(key, value) {
|
||||||
|
let jsonString = JSON.stringify(value);
|
||||||
|
try {
|
||||||
|
uni.setStorageSync(key, jsonString);
|
||||||
|
} catch (e) {
|
||||||
|
// error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setData: function(key, value) {
|
||||||
|
try {
|
||||||
|
uni.setStorageSync(key, value);
|
||||||
|
} catch (e) {
|
||||||
|
// error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getData: function(key) {
|
||||||
|
try {
|
||||||
|
const value = uni.getStorageSync(key);
|
||||||
|
if (value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// error
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
getJson: function(key) {
|
||||||
|
try {
|
||||||
|
const value = uni.getStorageSync(key);
|
||||||
|
if (value) {
|
||||||
|
return JSON.parse(value);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// error
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
clear: function() {
|
||||||
|
uni.clearStorage();
|
||||||
|
},
|
||||||
|
get: function(key) { //获取队列里面全部的数据
|
||||||
|
let data = this.getJson(key);
|
||||||
|
if (data instanceof Array) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
insert: function(param) { //队列插入数据
|
||||||
|
param.capacityNum = param.capacityNum || 100; //队列容量 默认队列中超过100条数据,自动删除尾部
|
||||||
|
let data = this.getJson(param.key);
|
||||||
|
if (data instanceof Array) {
|
||||||
|
if (data.length > param.capacityNum) {
|
||||||
|
let total = data.length - param.capacityNum;
|
||||||
|
for (let i = 0; i < total; i++) {
|
||||||
|
data.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.unshift(param.value);
|
||||||
|
} else {
|
||||||
|
data = [];
|
||||||
|
data.push(param.value);
|
||||||
|
}
|
||||||
|
this.setJson(param.key, data);
|
||||||
|
},
|
||||||
|
removeItem: function(key, itemIds) { //提供itemIds数组 批量删除队列中的某项数据
|
||||||
|
let data = this.getJson(key);
|
||||||
|
if (data instanceof Array) {
|
||||||
|
for (let i = 0; i < itemIds.length; i++) {
|
||||||
|
for (let p = 0; p < data.length; p++) {
|
||||||
|
if (itemIds[i] === data[p].itemid) {
|
||||||
|
data.splice(p, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.setJson(key, data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isExist: function(key, itemId) { //检测某条数据在队列中是否存在
|
||||||
|
let data = this.getJson(key);
|
||||||
|
if (data instanceof Array) {
|
||||||
|
for (let p = 0; p < data.length; p++) {
|
||||||
|
if (itemId === data[p].itemid) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
isExistPdd: function(key, itemId) { //检测某条数据在队列中是否存在
|
||||||
|
let data = this.getJson(key);
|
||||||
|
if (data instanceof Array) {
|
||||||
|
for (let p = 0; p < data.length; p++) {
|
||||||
|
if (itemId === data[p].goodsId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
isExistJd: function(key, itemId) { //检测某条数据在队列中是否存在
|
||||||
|
let data = this.getJson(key);
|
||||||
|
if (data instanceof Array) {
|
||||||
|
for (let p = 0; p < data.length; p++) {
|
||||||
|
if (itemId === data[p].skuId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
remove: function(key) { //删除某条队列
|
||||||
|
try {
|
||||||
|
uni.removeStorageSync(key);
|
||||||
|
//localStorage.removeItem(key)
|
||||||
|
} catch (e) {
|
||||||
|
// error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCount: function(key) { //获取队列中全部数据数量
|
||||||
|
|
||||||
|
let data = this.getJson(key);
|
||||||
|
if (data instanceof Array) {
|
||||||
|
return data.length;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="contont">
|
||||||
|
<view class="contont-box" @click.stop.prevent="setImg()">
|
||||||
|
<view class="contont-box-icon flex align-center justify-end">
|
||||||
|
<image @click.stop.prevent="clickClose" src="../../static/images/index/closeVideo.png" mode="">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<image src="../../static/images/index/hdimgIcon.png" mode="aspectFill"></image>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "activityComp",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickClose() {
|
||||||
|
this.$emit('clickCloseHd')
|
||||||
|
},
|
||||||
|
setImg() {
|
||||||
|
this.$emit('setImgs')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.contont {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 200rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
|
||||||
|
.contont-box {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 114rpx;
|
||||||
|
height: 104rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contont-box-icon {
|
||||||
|
image {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,184 @@
|
||||||
|
/*
|
||||||
|
Animation 微动画
|
||||||
|
基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* css 滤镜 控制黑白底色gif的 */
|
||||||
|
.gif-black{
|
||||||
|
mix-blend-mode: screen;
|
||||||
|
}
|
||||||
|
.gif-white{
|
||||||
|
mix-blend-mode: multiply;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Animation css */
|
||||||
|
[class*=animation-] {
|
||||||
|
animation-duration: .5s;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
animation-fill-mode: both
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-fade {
|
||||||
|
animation-name: fade;
|
||||||
|
animation-duration: .8s;
|
||||||
|
animation-timing-function: linear
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-scale-up {
|
||||||
|
animation-name: scale-up
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-scale-down {
|
||||||
|
animation-name: scale-down
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-slide-top {
|
||||||
|
animation-name: slide-top
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-slide-bottom {
|
||||||
|
animation-name: slide-bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-slide-left {
|
||||||
|
animation-name: slide-left
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-slide-right {
|
||||||
|
animation-name: slide-right
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-shake {
|
||||||
|
animation-name: shake
|
||||||
|
}
|
||||||
|
|
||||||
|
.animation-reverse {
|
||||||
|
animation-direction: reverse
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fade {
|
||||||
|
0% {
|
||||||
|
opacity: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes scale-up {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(.2)
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes scale-down {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(1.8)
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slide-top {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-100%)
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slide-bottom {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(100%)
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes shake {
|
||||||
|
|
||||||
|
0%,
|
||||||
|
100% {
|
||||||
|
transform: translateX(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
10% {
|
||||||
|
transform: translateX(-9px)
|
||||||
|
}
|
||||||
|
|
||||||
|
20% {
|
||||||
|
transform: translateX(8px)
|
||||||
|
}
|
||||||
|
|
||||||
|
30% {
|
||||||
|
transform: translateX(-7px)
|
||||||
|
}
|
||||||
|
|
||||||
|
40% {
|
||||||
|
transform: translateX(6px)
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
transform: translateX(-5px)
|
||||||
|
}
|
||||||
|
|
||||||
|
60% {
|
||||||
|
transform: translateX(4px)
|
||||||
|
}
|
||||||
|
|
||||||
|
70% {
|
||||||
|
transform: translateX(-3px)
|
||||||
|
}
|
||||||
|
|
||||||
|
80% {
|
||||||
|
transform: translateX(2px)
|
||||||
|
}
|
||||||
|
|
||||||
|
90% {
|
||||||
|
transform: translateX(-1px)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slide-left {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-100%)
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateX(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slide-right {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(100%)
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateX(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="cu-custom" :style="[{height:CustomBar + 'px'}]">
|
||||||
|
<view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]">
|
||||||
|
<view class="action" @tap="BackPage" v-if="isBack">
|
||||||
|
<text class="cuIcon-back"></text>
|
||||||
|
<slot name="backText"></slot>
|
||||||
|
</view>
|
||||||
|
<view class="content" :style="[{top:StatusBar + 'px'}]">
|
||||||
|
<slot name="content"></slot>
|
||||||
|
</view>
|
||||||
|
<slot name="right"></slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
StatusBar: this.StatusBar,
|
||||||
|
CustomBar: this.CustomBar
|
||||||
|
};
|
||||||
|
},
|
||||||
|
name: 'cu-custom',
|
||||||
|
computed: {
|
||||||
|
style() {
|
||||||
|
var StatusBar= this.StatusBar;
|
||||||
|
var CustomBar= this.CustomBar;
|
||||||
|
var bgImage = this.bgImage;
|
||||||
|
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
|
||||||
|
if (this.bgImage) {
|
||||||
|
style = `${style}background-image:url(${bgImage});`;
|
||||||
|
}
|
||||||
|
return style
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
bgColor: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
isBack: {
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
bgImage: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
BackPage() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,312 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="mix-list-cell" :class="border" hover-class="cell-hover" :hover-stay-time="50">
|
||||||
|
<text class="cell-tit">{{title}}</text>
|
||||||
|
<input class="main-input" :value="value" :type="_type" placeholder-class="placeholder-class"
|
||||||
|
:maxlength="maxlength" :placeholder="placeholder" :password="type==='password'&&!showPassword"
|
||||||
|
@input="onInput" :disabled="readOnly" />
|
||||||
|
|
||||||
|
<!-- 是否可见密码 -->
|
||||||
|
<image v-if="_isShowPass&&type==='password'&&!_isShowCode" class="img cuIcon"
|
||||||
|
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'" @tap="showPass"></image>
|
||||||
|
<!-- 倒计时 -->
|
||||||
|
<view v-if="_isShowCode&&!_isShowPass" :class="['vercode',{'vercode-run': second>0}]" @click="setCode">
|
||||||
|
{{ getVerCodeSecond }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var _this, countDown;
|
||||||
|
/**
|
||||||
|
* 简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
|
||||||
|
* 比如加入image, iconSize可控等
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showPassword: false, //是否显示明文
|
||||||
|
second: 0, //倒计时
|
||||||
|
isRunCode: false, //是否开始倒计时
|
||||||
|
typeList: {
|
||||||
|
left: 'icon-zuo',
|
||||||
|
right: 'icon-you',
|
||||||
|
up: 'icon-shang',
|
||||||
|
down: 'icon-xia'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
readOnly: {
|
||||||
|
//是否显示获取验证码(二选一)
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
type: String, //类型
|
||||||
|
logo: String, //类型
|
||||||
|
value: String, //值
|
||||||
|
placeholder: String, //框内提示
|
||||||
|
isShowCode: {
|
||||||
|
//是否显示获取验证码(二选一)
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
codeText: {
|
||||||
|
type: String,
|
||||||
|
default: "获取验证码",
|
||||||
|
},
|
||||||
|
setTime: {
|
||||||
|
//倒计时时间设置
|
||||||
|
type: [Number, String],
|
||||||
|
default: 60,
|
||||||
|
},
|
||||||
|
maxlength: {
|
||||||
|
//最大长度
|
||||||
|
type: [Number, String],
|
||||||
|
default: 30,
|
||||||
|
},
|
||||||
|
isShowPass: {
|
||||||
|
//是否显示密码图标(二选一)
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '标题'
|
||||||
|
},
|
||||||
|
tips: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
navigateType: {
|
||||||
|
type: String,
|
||||||
|
default: 'right'
|
||||||
|
},
|
||||||
|
border: {
|
||||||
|
type: String,
|
||||||
|
default: 'b-b'
|
||||||
|
},
|
||||||
|
hoverClass: {
|
||||||
|
type: String,
|
||||||
|
default: 'cell-hover'
|
||||||
|
},
|
||||||
|
iconColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
_this = this
|
||||||
|
//准备触发
|
||||||
|
this.$on('runCodes', (val) => {
|
||||||
|
this.runCodes(val);
|
||||||
|
});
|
||||||
|
clearInterval(countDown); //先清理一次循环,避免缓存
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showPass() {
|
||||||
|
//是否显示密码
|
||||||
|
this.showPassword = !this.showPassword
|
||||||
|
},
|
||||||
|
onInput(e) {
|
||||||
|
//传出值
|
||||||
|
this.$emit('input', e.target.value)
|
||||||
|
},
|
||||||
|
setCode() {
|
||||||
|
//设置获取验证码的事件
|
||||||
|
if (this.isRunCode) {
|
||||||
|
//判断是否开始倒计时,避免重复点击
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$emit('setCode')
|
||||||
|
},
|
||||||
|
runCodes(val) {
|
||||||
|
console.error("runCodes")
|
||||||
|
//开始倒计时
|
||||||
|
if (String(val) == "0") {
|
||||||
|
|
||||||
|
//判断是否需要终止循环
|
||||||
|
this.second = 0; //初始倒计时
|
||||||
|
clearInterval(countDown); //清理循环
|
||||||
|
this.isRunCode = false; //关闭循环状态
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.isRunCode) {
|
||||||
|
//判断是否开始倒计时,避免重复点击
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.isRunCode = true
|
||||||
|
this.second = this._setTime //倒数秒数
|
||||||
|
|
||||||
|
let _this = this;
|
||||||
|
countDown = setInterval(function() {
|
||||||
|
_this.second--
|
||||||
|
if (_this.second == 0) {
|
||||||
|
_this.isRunCode = false
|
||||||
|
clearInterval(countDown)
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
_type() {
|
||||||
|
//处理值
|
||||||
|
const type = this.type
|
||||||
|
return type == 'password' ? 'text' : type
|
||||||
|
},
|
||||||
|
_isShowPass() {
|
||||||
|
//处理值
|
||||||
|
return String(this.isShowPass) !== 'false'
|
||||||
|
},
|
||||||
|
_isShowCode() {
|
||||||
|
//处理值
|
||||||
|
return String(this.isShowCode) !== 'false'
|
||||||
|
},
|
||||||
|
_setTime() {
|
||||||
|
//处理值
|
||||||
|
const setTime = Number(this.setTime)
|
||||||
|
return setTime > 0 ? setTime : 60
|
||||||
|
},
|
||||||
|
getVerCodeSecond() {
|
||||||
|
//验证码倒计时计算
|
||||||
|
if (this.second <= 0) {
|
||||||
|
return this.codeText;
|
||||||
|
} else {
|
||||||
|
if (this.second < 10) {
|
||||||
|
return '0' + this.second + "s";
|
||||||
|
} else {
|
||||||
|
return this.second + "s";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss'>
|
||||||
|
.main-input {
|
||||||
|
flex: 1;
|
||||||
|
text-align: left;
|
||||||
|
/* color: white; */
|
||||||
|
font-size: 16px;
|
||||||
|
padding-right: 6px;
|
||||||
|
margin-left: 10px;
|
||||||
|
border: 1rpx solid #d9d9d9;
|
||||||
|
height: 90rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
padding: 0upx 30upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon .mix-list-cell.b-b:after {
|
||||||
|
left: 45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder-class {
|
||||||
|
/* color: white; */
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mix-list-cell {
|
||||||
|
border-radius: 32upx;
|
||||||
|
margin-top: 1px;
|
||||||
|
font-size: 32upx;
|
||||||
|
background: #ffffff;
|
||||||
|
text-align: left;
|
||||||
|
display: flex;
|
||||||
|
margin: 32upx;
|
||||||
|
/* padding: 24upx 32upx; */
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&.cell-hover {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.b-b:after {
|
||||||
|
left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-icon {
|
||||||
|
align-self: center;
|
||||||
|
width: 28px;
|
||||||
|
max-height: 30px;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-more {
|
||||||
|
align-self: center;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #606266;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-tit {
|
||||||
|
width: 80px;
|
||||||
|
font-size: 16px;
|
||||||
|
/* color: white; */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-tip {
|
||||||
|
font-size: 14px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.items {
|
||||||
|
position: absolute;
|
||||||
|
height: 48px;
|
||||||
|
width: 100%;
|
||||||
|
background: #FFFFFF;
|
||||||
|
/*opacity:0.05;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-list {
|
||||||
|
opacity: 0.8;
|
||||||
|
z-index: 88;
|
||||||
|
background: white;
|
||||||
|
border: 1px solid white;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 18px;
|
||||||
|
/* Input 高度 */
|
||||||
|
color: #333333;
|
||||||
|
padding: 16px;
|
||||||
|
margin-top: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vercode {
|
||||||
|
color: #e10a07;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vercode-run {
|
||||||
|
color: black !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oBorder {
|
||||||
|
|
||||||
|
border-radius: 2.5rem;
|
||||||
|
-webkit-box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||||
|
box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,184 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view id="_drag_button" class="drag" :style="'left: ' + left + 'px; top:' + top + 'px;'"
|
||||||
|
@touchstart="touchstart" @touchmove.stop.prevent="touchmove" @touchend="touchend"
|
||||||
|
:class="{transition: isDock && !isMove }">
|
||||||
|
<view class="drag-box" @click.stop.prevent="click(videoInfo[0])">
|
||||||
|
<image :src="videoInfo[0].titleImg" mode="aspectFill"></image>
|
||||||
|
<view class="drag-close flex align-center justify-center">
|
||||||
|
<image @click.stop.prevent="clickClose" src="../../static/images/index/closeVideo.png" mode="">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view class="drag-playing">
|
||||||
|
<image src="../../static/images/index/playVideoIcon.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'drag-button',
|
||||||
|
props: {
|
||||||
|
isDock: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
existTabBar: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
videoInfo: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
width: 0,
|
||||||
|
height: 0,
|
||||||
|
offsetWidth: 0,
|
||||||
|
offsetHeight: 0,
|
||||||
|
windowWidth: 0,
|
||||||
|
windowHeight: 0,
|
||||||
|
isMove: true,
|
||||||
|
edge: 16,
|
||||||
|
text: '按钮'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const sys = uni.getSystemInfoSync();
|
||||||
|
|
||||||
|
this.windowWidth = sys.windowWidth;
|
||||||
|
this.windowHeight = sys.windowHeight;
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.existTabBar && (this.windowHeight -= 50);
|
||||||
|
// #endif
|
||||||
|
if (sys.windowTop) {
|
||||||
|
this.windowHeight += sys.windowTop;
|
||||||
|
}
|
||||||
|
console.log(sys)
|
||||||
|
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query.select('#_drag_button').boundingClientRect(data => {
|
||||||
|
this.width = data.width;
|
||||||
|
this.height = data.height;
|
||||||
|
this.offsetWidth = data.width / 2;
|
||||||
|
this.offsetHeight = data.height / 2;
|
||||||
|
// this.left = this.windowWidth - this.width - this.edge;
|
||||||
|
this.left = this.edge;
|
||||||
|
this.top = this.windowHeight - (2 * this.height) - this.edge;
|
||||||
|
}).exec();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//关闭
|
||||||
|
clickClose() {
|
||||||
|
this.$emit('clickClose')
|
||||||
|
},
|
||||||
|
//点击封面
|
||||||
|
click(item) {
|
||||||
|
this.$emit('btnClick', item);
|
||||||
|
},
|
||||||
|
touchstart(e) {
|
||||||
|
this.$emit('btnTouchstart');
|
||||||
|
},
|
||||||
|
touchmove(e) {
|
||||||
|
// 单指触摸
|
||||||
|
if (e.touches.length !== 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isMove = true;
|
||||||
|
|
||||||
|
this.left = e.touches[0].clientX - this.offsetWidth;
|
||||||
|
|
||||||
|
let clientY = e.touches[0].clientY - this.offsetHeight;
|
||||||
|
// #ifdef H5
|
||||||
|
// clientY += this.height;
|
||||||
|
// #endif
|
||||||
|
let edgeBottom = this.windowHeight - this.height - this.edge;
|
||||||
|
|
||||||
|
// 上下触及边界
|
||||||
|
if (clientY < this.edge) {
|
||||||
|
this.top = this.edge;
|
||||||
|
} else if (clientY > edgeBottom) {
|
||||||
|
this.top = edgeBottom;
|
||||||
|
} else {
|
||||||
|
this.top = clientY
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
touchend(e) {
|
||||||
|
if (this.isDock) {
|
||||||
|
let edgeRigth = this.windowWidth - this.width - this.edge;
|
||||||
|
|
||||||
|
if (this.left < this.windowWidth / 2 - this.offsetWidth) {
|
||||||
|
this.left = this.edge;
|
||||||
|
} else {
|
||||||
|
this.left = edgeRigth;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isMove = false;
|
||||||
|
|
||||||
|
this.$emit('btnTouchend');
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.drag {
|
||||||
|
width: 150rpx;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 888;
|
||||||
|
|
||||||
|
&.transition {
|
||||||
|
transition: left .3s ease, top .3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drag-box {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.drag-close {
|
||||||
|
// width: 100%;
|
||||||
|
// margin-top: 10rpx;
|
||||||
|
position: absolute;
|
||||||
|
top: -10rpx;
|
||||||
|
right: -10rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.drag-playing {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 34rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="page-box">
|
||||||
|
<view class="centre" :style="isShow==true?'margin:0;padding:200rpx 0 0 0':''">
|
||||||
|
<image src="../static/images/learn/none.png" mode=""></image>
|
||||||
|
<view class="tips">
|
||||||
|
<!-- 暂无资源 -->
|
||||||
|
{{title}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '暂无数据'
|
||||||
|
},
|
||||||
|
isShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goNav() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.centre {
|
||||||
|
text-align: center;
|
||||||
|
margin: 200rpx auto;
|
||||||
|
font-size: 32rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 360rpx;
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
margin: 0 auto 20rpx;
|
||||||
|
// border: 1px dotted #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn1 {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 600rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
border-radius: 44rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
background: #ff7581;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="page-box">
|
||||||
|
<view class="centre">
|
||||||
|
<image src="../static/images/learn/none.png" mode=""></image>
|
||||||
|
<view class="tips">
|
||||||
|
暂未登录
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="goNav()">{{content}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
content: {
|
||||||
|
type: String,
|
||||||
|
default: '立即登录'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goNav() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.centre {
|
||||||
|
text-align: center;
|
||||||
|
margin: 200rpx auto;
|
||||||
|
font-size: 32rpx;
|
||||||
|
image {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 360rpx;
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
margin: 0 auto 20rpx;
|
||||||
|
// border: 1px dotted #000000;
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #5074FF;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 600rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
background: #5074FF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,157 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="list flex align-center justify-center">
|
||||||
|
<view class="list-box">
|
||||||
|
<view class="list-box-title flex align-center justify-between">
|
||||||
|
<view class="list-box-title-name">
|
||||||
|
{{title}}
|
||||||
|
</view>
|
||||||
|
<view @click="clickItem('more')" class="list-box-title-more flex align-center">
|
||||||
|
查看更多
|
||||||
|
<u-icon name="arrow-right" color="#666666" size="24"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-video flex justify-between">
|
||||||
|
<view @click="clickItem('video',item)" class="list-box-video-item" v-for="(item,index) in list"
|
||||||
|
:key="index">
|
||||||
|
<view class="list-box-video-item-img">
|
||||||
|
<u-image width="100%" height="100%" border-radius="24rpx" mode="aspectFill"
|
||||||
|
:src="item.titleImg"></u-image>
|
||||||
|
<view class="list-box-video-item-img-txt" v-if="item.over == 1">
|
||||||
|
共{{item.courseDetailsCount?item.courseDetailsCount:0}}集
|
||||||
|
</view>
|
||||||
|
<view class="list-box-video-item-img-txt" v-else>
|
||||||
|
更新至{{item.courseDetailsCount?item.courseDetailsCount:0}}集
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-video-item-videoTitle">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-video-item-tips" v-if="item.courseLabel">
|
||||||
|
{{item.courseLabel.split(',')[0]}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="list.length==2" class="list-box-video-item" style="height: 0;"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "recommendVideo",
|
||||||
|
props: {
|
||||||
|
//视频数组
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
},
|
||||||
|
//模块标题
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '本周热门'
|
||||||
|
},
|
||||||
|
//模块类型
|
||||||
|
typeId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* @param {string} type 点击类型 more:更多 video:视频
|
||||||
|
* @param {Object} item 参数
|
||||||
|
* 点击事件
|
||||||
|
*/
|
||||||
|
clickItem(type, item) {
|
||||||
|
if (type == 'more') { //查看更多
|
||||||
|
this.$emit(type, this.typeId)
|
||||||
|
} else { //查看视频
|
||||||
|
this.$emit(type, item)
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
|
||||||
|
.list-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ffffff;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-title-name {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-title-more {
|
||||||
|
color: #666666;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-video {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
.list-box-video-item {
|
||||||
|
width: 220rpx;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-video-item-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 280rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.list-box-video-item-img-txt {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 22rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-video-item-videoTitle {
|
||||||
|
margin-top: 18rpx;
|
||||||
|
width: 100%;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-video-item-tips {
|
||||||
|
width: fit-content;
|
||||||
|
color: #666666;
|
||||||
|
font-size: 22rpx;
|
||||||
|
background-color: #F2F5FF;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
<template xlang="wxml" minapp="mpvue">
|
||||||
|
<view class="tki-qrcode">
|
||||||
|
<canvas class="tki-qrcode-canvas" :canvas-id="cid" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
||||||
|
<image v-if="show" :src="result" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import QRCode from "./qrcode.js"
|
||||||
|
let qrcode
|
||||||
|
export default {
|
||||||
|
name: "tki-qrcode",
|
||||||
|
props: {
|
||||||
|
cid: {
|
||||||
|
type: String,
|
||||||
|
default: 'tki-qrcode-canvas'
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: Number,
|
||||||
|
default: 200
|
||||||
|
},
|
||||||
|
unit: {
|
||||||
|
type: String,
|
||||||
|
default: 'upx'
|
||||||
|
},
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
val: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
type: String,
|
||||||
|
default: '#ffffff'
|
||||||
|
},
|
||||||
|
foreground: {
|
||||||
|
type: String,
|
||||||
|
default: '#000000'
|
||||||
|
},
|
||||||
|
pdground: {
|
||||||
|
type: String,
|
||||||
|
default: '#000000'
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
iconSize: {
|
||||||
|
type: Number,
|
||||||
|
default: 40
|
||||||
|
},
|
||||||
|
lv: {
|
||||||
|
type: Number,
|
||||||
|
default: 3
|
||||||
|
},
|
||||||
|
onval: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
loadMake: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
usingComponents: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
showLoading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
loadingText: {
|
||||||
|
type: String,
|
||||||
|
default: '二维码生成中'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
result: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
_makeCode() {
|
||||||
|
let that = this
|
||||||
|
if (!this._empty(this.val)) {
|
||||||
|
qrcode = new QRCode({
|
||||||
|
context: that, // 上下文环境
|
||||||
|
canvasId: that.cid, // canvas-id
|
||||||
|
usingComponents: that.usingComponents, // 是否是自定义组件
|
||||||
|
// loadingText: that.loadingText, // loading文字
|
||||||
|
text: that.val, // 生成内容
|
||||||
|
size: that.cpSize, // 二维码大小
|
||||||
|
background: that.background, // 背景色
|
||||||
|
foreground: that.foreground, // 前景色
|
||||||
|
pdground: that.pdground, // 定位角点颜色
|
||||||
|
correctLevel: that.lv, // 容错级别
|
||||||
|
image: that.icon, // 二维码图标
|
||||||
|
imageSize: that.iconSize, // 二维码图标大小
|
||||||
|
cbResult: function(res) { // 生成二维码的回调
|
||||||
|
that._result(res)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '二维码内容不能为空',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_clearCode() {
|
||||||
|
this._result('')
|
||||||
|
qrcode.clear()
|
||||||
|
},
|
||||||
|
_saveCode() {
|
||||||
|
let that = this;
|
||||||
|
if (this.result != "") {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: that.result,
|
||||||
|
success: function() {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '二维码保存成功',
|
||||||
|
// icon: 'success',
|
||||||
|
// duration: 2000
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_result(res) {
|
||||||
|
this.result = res;
|
||||||
|
this.$emit('result', res)
|
||||||
|
},
|
||||||
|
_empty(v) {
|
||||||
|
let tp = typeof v,
|
||||||
|
rt = false;
|
||||||
|
if (tp == "number" && String(v) == "") {
|
||||||
|
rt = true
|
||||||
|
} else if (tp == "undefined") {
|
||||||
|
rt = true
|
||||||
|
} else if (tp == "object") {
|
||||||
|
if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
|
||||||
|
} else if (tp == "string") {
|
||||||
|
if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
|
||||||
|
} else if (tp == "function") {
|
||||||
|
rt = false
|
||||||
|
}
|
||||||
|
return rt
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
size: function(n, o) {
|
||||||
|
if (n != o && !this._empty(n)) {
|
||||||
|
this.cSize = n
|
||||||
|
if (!this._empty(this.val)) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this._makeCode()
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
val: function(n, o) {
|
||||||
|
if (this.onval) {
|
||||||
|
if (n != o && !this._empty(n)) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this._makeCode()
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
cpSize() {
|
||||||
|
if (this.unit == "upx") {
|
||||||
|
return uni.upx2px(this.size)
|
||||||
|
} else {
|
||||||
|
return this.size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
if (this.loadMake) {
|
||||||
|
if (!this._empty(this.val)) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this._makeCode()
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.tki-qrcode {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tki-qrcode-canvas {
|
||||||
|
position: fixed;
|
||||||
|
top: -99999upx;
|
||||||
|
left: -99999upx;
|
||||||
|
z-index: -99999;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- #ifdef MP-TOUTIAO -->
|
||||||
|
<!-- 抖音im客服 -->
|
||||||
|
<view class="imKefu">
|
||||||
|
<button open-type="im" class="imKefu-btn" :data-im-id="imId" @im="imCallback" @error="onimError">
|
||||||
|
<image class="imKefu-img" src="../../static/images/me/imMsg.png" mode=""></image>
|
||||||
|
<view class="imKefu-txt">
|
||||||
|
在线客服
|
||||||
|
</view>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "ttMsg",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
imId: '', //客服抖音号
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.imId = uni.getStorageSync('imId')
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
imCallback(e) {
|
||||||
|
console.log("跳转IM客服成功", e.detail);
|
||||||
|
},
|
||||||
|
onimError(e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '拉起IM客服失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
console.log("拉起IM客服失败", e.detail);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.imKefu-btn::after {
|
||||||
|
border: none;
|
||||||
|
background-color: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imKefu-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
padding-left: 0px;
|
||||||
|
padding-right: 0px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-decoration: none;
|
||||||
|
// line-height: 140rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
color: #000000;
|
||||||
|
/* background-color: #fff; */
|
||||||
|
background: rgba(255, 255, 255, 0);
|
||||||
|
font-size: 22rpx;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imKefu {
|
||||||
|
position: fixed;
|
||||||
|
right: 30rpx;
|
||||||
|
bottom: 200rpx;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
z-index: 999999;
|
||||||
|
|
||||||
|
.imKefu-img {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imKefu-txt {
|
||||||
|
width: 100rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #000000;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
font-size: 22rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,237 @@
|
||||||
|
/**
|
||||||
|
* 瀑布流组件
|
||||||
|
*/
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="list flex align-center justify-center">
|
||||||
|
<view class="list-box flex justify-between flex-wrap">
|
||||||
|
<!-- 左边数据 -->
|
||||||
|
<view class="list-box-ite">
|
||||||
|
<view @click="clickItem(item)" class="list-box-ite-item" v-for="(item,index) in arrListLeft"
|
||||||
|
:key="index">
|
||||||
|
<view class="list-box-ite-item-img">
|
||||||
|
<u-lazy-load border-radius="24rpx 24rpx 0 0" :image="item.titleImg"></u-lazy-load>
|
||||||
|
<view class="list-box-ite-item-img-t" v-if="item.over == 1">
|
||||||
|
共{{item.courseDetailsCount?item.courseDetailsCount:0}}集
|
||||||
|
</view>
|
||||||
|
<view class="list-box-ite-item-img-t" v-else>
|
||||||
|
更新至{{item.courseDetailsCount?item.courseDetailsCount:0}}集
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-ite-item-txt">
|
||||||
|
<view class="list-box-ite-item-txt-t">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-ite-item-txt-l" v-if="item.courseLabel">
|
||||||
|
{{item.courseLabel}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 右边数据 -->
|
||||||
|
<view class="list-box-ite">
|
||||||
|
<view @click="clickItem(item)" class="list-box-ite-item" v-for="(item,index) in arrListRight"
|
||||||
|
:key="index">
|
||||||
|
<view class="list-box-ite-item-img">
|
||||||
|
<u-lazy-load border-radius="24rpx 24rpx 0 0" :image="item.titleImg"></u-lazy-load>
|
||||||
|
<view class="list-box-ite-item-img-t" v-if="item.over == 1">
|
||||||
|
共{{item.courseDetailsCount?item.courseDetailsCount:0}}集
|
||||||
|
</view>
|
||||||
|
<view class="list-box-ite-item-img-t" v-else>
|
||||||
|
更新至{{item.courseDetailsCount?item.courseDetailsCount:0}}集
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-ite-item-txt">
|
||||||
|
<view class="list-box-ite-item-txt-t">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-ite-item-txt-l" v-if="item.courseLabel">
|
||||||
|
{{item.courseLabel}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "videoList",
|
||||||
|
props: {
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
arrListLeft: [], //左边数据
|
||||||
|
arrListRight: [], //右边数据
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
list: {
|
||||||
|
handler() {
|
||||||
|
console.log(1111111)
|
||||||
|
this.spliceArrayListr()
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.spliceArrayListr()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* @param {Object} item
|
||||||
|
* 点击事件
|
||||||
|
*/
|
||||||
|
clickItem(item) {
|
||||||
|
this.$emit('success', item);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @param {Array} list 原数组
|
||||||
|
* @param {number} type 1:是从奇数开始,2是从偶数开始
|
||||||
|
* 拆分数据
|
||||||
|
*/
|
||||||
|
spliceArrayListr() {
|
||||||
|
this.arrListRight = []
|
||||||
|
this.arrListLeft = []
|
||||||
|
this.list.map((item, index) => {
|
||||||
|
if (index % 2 === 0) {
|
||||||
|
this.arrListLeft.push(item)
|
||||||
|
} else {
|
||||||
|
this.arrListRight.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
|
.list-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-ite {
|
||||||
|
width: calc((100% - 20rpx) / 2);
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-ite-item {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.list-box-ite-item-img {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
min-height: 300rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 300rpx;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-ite-item-img-t {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10rpx;
|
||||||
|
right: 0;
|
||||||
|
max-width: 80%;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background-color: rgba(51, 51, 51, 0.7);
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 22rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-ite-item-txt {
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 0 0 24rpx 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-ite-item-txt-t {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-ite-item-txt-l {
|
||||||
|
color: #999999;
|
||||||
|
font-size: 22rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.list-box-item {
|
||||||
|
width: calc((100% - 20rpx) / 2);
|
||||||
|
// height: 100%;
|
||||||
|
min-height: 320rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-item-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-item-txt {
|
||||||
|
width: 100%;
|
||||||
|
// height: 120rpx;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
border-radius: 0 0 24rpx 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-item-txt-t {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-item-txt-l {
|
||||||
|
color: #999999;
|
||||||
|
font-size: 22rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,115 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="https://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
|
||||||
|
<script language="JavaScript" type="text/JavaScript">
|
||||||
|
/**
|
||||||
|
弹出iframe页面(iframe后面会添加灰色蒙版)
|
||||||
|
**/
|
||||||
|
window.onload = function () {
|
||||||
|
// https://duanjugjblack.xianmxkj.com
|
||||||
|
showIframe('http://192.168.0.113:8080/'); // 调用自定义函数
|
||||||
|
};
|
||||||
|
// "<div class='mobile_preview_header'><i class='mobile_preview_header_icon'></i></div>" +
|
||||||
|
// "<div class='mobile_preview_footer'><i class='mobile_preview_footer_icon'></i></div>"
|
||||||
|
function showIframe(url){
|
||||||
|
$("<div id='showMobilePreview'>" +
|
||||||
|
"<div class='mobile_preview_frame'><iframe id='YuFrameMobilePreview' name='YuFrameMobilePreview' ></iframe></div>" +
|
||||||
|
+
|
||||||
|
"</div>").prependTo('body');
|
||||||
|
|
||||||
|
$("#YuFrameMobilePreview").attr("src", url);
|
||||||
|
//添加背景遮罩
|
||||||
|
// Gray
|
||||||
|
$("<div id='YuFrameMobilePreviewBg' style='cursor:pointer;width:100%;height:100%;background-color: #ffffff;display:block;z-index:9998;position:absolute;left:0px;top:0px;filter:Alpha(Opacity=30);/* IE */-moz-opacity:0.4;/* Moz + FF */opacity: 0.4; '/>").prependTo('body');
|
||||||
|
|
||||||
|
//点击背景遮罩移除iframe和背景
|
||||||
|
// $("#YuFrameMobilePreviewBg").click(function() {
|
||||||
|
// $("#showMobilePreview").remove();
|
||||||
|
// $("#YuFrameMobilePreviewBg").remove();
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style type="text/css">
|
||||||
|
#showMobilePreview {
|
||||||
|
z-index: 9999;
|
||||||
|
width: 391px;
|
||||||
|
height: 768px;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
opacity: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile_preview_header {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 40px;
|
||||||
|
width: 387px;
|
||||||
|
background: #eeeff2;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 40px;
|
||||||
|
border-top-right-radius: 50px;
|
||||||
|
border-top-left-radius: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile_preview_header_icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 65px;
|
||||||
|
height: 10px;
|
||||||
|
background: #c8c9cc;
|
||||||
|
border-radius: 9px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile_preview_frame {
|
||||||
|
width: 375px;
|
||||||
|
/* min-height: 294px;
|
||||||
|
height: 667px;
|
||||||
|
max-height: calc(100vh - 166px);
|
||||||
|
top: 40px; */
|
||||||
|
height: 100%;
|
||||||
|
left: 0;
|
||||||
|
/* border: 6px solid #eeeff2; */
|
||||||
|
position: relative;
|
||||||
|
background-color: #fff;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#YuFrameMobilePreview {
|
||||||
|
border: none;
|
||||||
|
width: 375px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile_preview_footer {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 52px;
|
||||||
|
width: 387px;
|
||||||
|
background: #eeeff2;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 45px;
|
||||||
|
border-bottom-right-radius: 50px;
|
||||||
|
border-bottom-left-radius: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile_preview_footer_icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 43px;
|
||||||
|
height: 43px;
|
||||||
|
background: #c8c9cc;
|
||||||
|
border-radius: 50%;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<html>
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
import Vue from 'vue'
|
||||||
|
import App from './App'
|
||||||
|
|
||||||
|
|
||||||
|
import HttpRequest from './common/httpRequest'
|
||||||
|
import HttpCache from './common/cache'
|
||||||
|
import queue from './common/queue'
|
||||||
|
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
Vue.prototype.$Request = HttpRequest;
|
||||||
|
Vue.prototype.$queue = queue;
|
||||||
|
|
||||||
|
Vue.prototype.$Sysconf = HttpRequest.config;
|
||||||
|
Vue.prototype.$SysCache = HttpCache;
|
||||||
|
|
||||||
|
App.mpType = 'app'
|
||||||
|
|
||||||
|
// 引入全局uView
|
||||||
|
import uView from "uview-ui";
|
||||||
|
Vue.use(uView);
|
||||||
|
|
||||||
|
|
||||||
|
const app = new Vue({
|
||||||
|
...App
|
||||||
|
})
|
||||||
|
|
||||||
|
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
|
||||||
|
import httpInterceptor from '@/common/http.interceptor.js'
|
||||||
|
Vue.use(httpInterceptor, app)
|
||||||
|
|
||||||
|
// http接口API集中管理引入部分
|
||||||
|
import httpApi from '@/common/http.api.js'
|
||||||
|
Vue.use(httpApi, app)
|
||||||
|
|
||||||
|
app.$mount()
|
||||||
|
|
@ -0,0 +1,171 @@
|
||||||
|
{
|
||||||
|
"name" : "短剧",
|
||||||
|
"appid" : "__UNI__CA593C1",
|
||||||
|
"description" : "",
|
||||||
|
"versionName" : "1.0.0",
|
||||||
|
"versionCode" : "100",
|
||||||
|
"transformPx" : false,
|
||||||
|
/* 5+App特有相关 */
|
||||||
|
"app-plus" : {
|
||||||
|
"safearea" : {
|
||||||
|
"bottom" : {
|
||||||
|
"offset" : "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"usingComponents" : true,
|
||||||
|
"nvueStyleCompiler" : "uni-app",
|
||||||
|
"compilerVersion" : 3,
|
||||||
|
"splashscreen" : {
|
||||||
|
"alwaysShowBeforeRender" : true,
|
||||||
|
"waiting" : true,
|
||||||
|
"autoclose" : true,
|
||||||
|
"delay" : 0
|
||||||
|
},
|
||||||
|
/* 模块配置 */
|
||||||
|
"modules" : {
|
||||||
|
"Payment" : {},
|
||||||
|
"VideoPlayer" : {},
|
||||||
|
"Camera" : {},
|
||||||
|
"Record" : {},
|
||||||
|
"Push" : {},
|
||||||
|
"OAuth" : {}
|
||||||
|
},
|
||||||
|
/* 应用发布信息 */
|
||||||
|
"distribute" : {
|
||||||
|
/* android打包配置 */
|
||||||
|
"android" : {
|
||||||
|
"permissions" : [
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
|
],
|
||||||
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
|
||||||
|
},
|
||||||
|
/* ios打包配置 */
|
||||||
|
"ios" : {
|
||||||
|
"dSYMs" : false
|
||||||
|
},
|
||||||
|
/* SDK配置 */
|
||||||
|
"sdkConfigs" : {
|
||||||
|
"payment" : {
|
||||||
|
"weixin" : {
|
||||||
|
"__platform__" : [ "ios", "android" ],
|
||||||
|
"appid" : "wxeaffcaea958472d3",
|
||||||
|
"UniversalLinks" : "https://maxiong.xianmxkj.com/"
|
||||||
|
},
|
||||||
|
"alipay" : {
|
||||||
|
"__platform__" : [ "ios", "android" ]
|
||||||
|
},
|
||||||
|
"appleiap" : {}
|
||||||
|
},
|
||||||
|
"oauth" : {
|
||||||
|
"apple" : {},
|
||||||
|
"univerify" : {},
|
||||||
|
"weixin" : {
|
||||||
|
"appid" : "wxeaffcaea958472d3",
|
||||||
|
"appsecret" : "32f6f3ce599abff2fa0191a36780c66c",
|
||||||
|
"UniversalLinks" : "https://maxiong.xianmxkj.com/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ad" : {},
|
||||||
|
"push" : {
|
||||||
|
"unipush" : {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"icons" : {
|
||||||
|
"android" : {
|
||||||
|
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||||
|
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||||
|
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||||
|
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||||
|
},
|
||||||
|
"ios" : {
|
||||||
|
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||||
|
"ipad" : {
|
||||||
|
"app" : "unpackage/res/icons/76x76.png",
|
||||||
|
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||||
|
"notification" : "unpackage/res/icons/20x20.png",
|
||||||
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
|
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||||
|
"settings" : "unpackage/res/icons/29x29.png",
|
||||||
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
|
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||||
|
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||||
|
},
|
||||||
|
"iphone" : {
|
||||||
|
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||||
|
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||||
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
|
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||||
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
|
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||||
|
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||||
|
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* 快应用特有相关 */
|
||||||
|
"quickapp" : {},
|
||||||
|
/* 小程序特有相关 */
|
||||||
|
"mp-weixin" : {
|
||||||
|
"appid" : "wx433dd5d4fb7bedf2",
|
||||||
|
"libVersion" : "latest",
|
||||||
|
"setting" : {
|
||||||
|
"urlCheck" : false,
|
||||||
|
"minified" : true
|
||||||
|
},
|
||||||
|
"__usePrivacyCheck__" : true,
|
||||||
|
"usingComponents" : true,
|
||||||
|
"optimization" : {
|
||||||
|
"subPackages" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mp-alipay" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-baidu" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-toutiao" : {
|
||||||
|
"usingComponents" : true,
|
||||||
|
"appid" : "tt561d20a0c924905201",
|
||||||
|
"setting" : {
|
||||||
|
"urlCheck" : false,
|
||||||
|
"minified" : true,
|
||||||
|
"postcss" : true,
|
||||||
|
"es6" : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : false
|
||||||
|
},
|
||||||
|
"h5" : {
|
||||||
|
"title" : "短剧",
|
||||||
|
"domain" : "https://jiaoyu.xianmxkj.com",
|
||||||
|
"router" : {
|
||||||
|
"mode" : "history"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mp-kuaishou" : {
|
||||||
|
"appid" : "ks699465318929951101"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,815 @@
|
||||||
|
<template>
|
||||||
|
<view class="assist">
|
||||||
|
<!-- 背景图片 -->
|
||||||
|
<image src="../static/assist/zlBg.png" class="bg" mode="widthFix"></image>
|
||||||
|
<!-- 内容 -->
|
||||||
|
<view class="content">
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<image v-if="isBack" src="/static/images/index/left.png" class="left_viewimage" @tap="goBack"></image>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- 标题 -->
|
||||||
|
<view class="content-title">
|
||||||
|
邀好友助力
|
||||||
|
</view>
|
||||||
|
<!-- 副标题 -->
|
||||||
|
<view class="content-titles">
|
||||||
|
免费领会员
|
||||||
|
</view>
|
||||||
|
<!-- 邀请好友展示框 -->
|
||||||
|
<view class="content-hy flex align-center justify-center">
|
||||||
|
<view class="content-hy-box">
|
||||||
|
<view class="content-hy-box-title1" v-if="rlueList[rlueIndex] && rlueList[rlueIndex].inviteMonth>0">
|
||||||
|
{{userName}},再邀请<span>{{getUserPeopNum}}</span>位好友,可再得{{rlueList[rlueIndex].inviteMonth}}个月会员
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-title1" v-else>
|
||||||
|
{{userName}},再邀请<span>{{getUserPeopNum}}</span>位好友,可升级永久免费无限会员
|
||||||
|
</view>
|
||||||
|
<view class="" v-for="(item,index) in rlueList" :key="index">
|
||||||
|
<view v-if="index>rlueIndex" class="content-hy-box-title2">
|
||||||
|
<block v-if="item.inviteMonth>0">
|
||||||
|
再邀请{{item.inviteCount - nowPeopNum}}位好友,可再得{{item.inviteMonth}}个月会员
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
再邀请{{item.inviteCount - nowPeopNum}}位好友,可升级永久免费无限会员
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-peop">
|
||||||
|
<view class="content-hy-box-peop-my flex align-center justify-center">
|
||||||
|
<image :src="avatar?avatar:'../../static/images/logo.png'" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-peop-title">
|
||||||
|
您已注册成功,还需邀请
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-peop-list flex align-center justify-between flex-wrap">
|
||||||
|
<view class="content-hy-box-peop-list-i flex align-center justify-center"
|
||||||
|
v-for="(item,index) in getPeopNum" :key="index">
|
||||||
|
<block v-if="getPeopList[index]">
|
||||||
|
<view class="content-hy-box-peop-list-ia flex align-center justify-center"
|
||||||
|
style="border: none;">
|
||||||
|
<image style="width: 100%;height: 100%;border-radius: 50%;"
|
||||||
|
:src="getPeopList[index].avatar?getPeopList[index].avatar:'../../static/images/logo.png'"
|
||||||
|
mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-peop-list-it flex align-center justify-center">
|
||||||
|
{{getPeopList[index].userName}}
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view @click="onSaveImg()"
|
||||||
|
class="content-hy-box-peop-list-ia flex align-center justify-center">
|
||||||
|
<u-icon name="plus" color="#ffffff" size="28"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-peop-list-it flex align-center justify-center">
|
||||||
|
待助力
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-peop-list-i flex align-center justify-center"
|
||||||
|
style="height: 0;">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<block v-if="getPeopList.length>0">
|
||||||
|
<!-- 进度条 -->
|
||||||
|
<view class="content-hy-box-schedule">
|
||||||
|
<u-line-progress height="16" inactive-color="#f5e0b0" active-color="#edb840"
|
||||||
|
:show-percent="false" :percent="getMathNum()" :round="true"></u-line-progress>
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-schedulet">
|
||||||
|
距离领取会员仅差<span>{{getUserPeopNum}}</span>位好友
|
||||||
|
</view>
|
||||||
|
<view class="content-hy-box-peops">
|
||||||
|
<swiper class="content-hy-box-peopss" next-margin="80px" :circular="true"
|
||||||
|
:indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000">
|
||||||
|
<swiper-item class="content-hy-box-peopssi" v-for="(item,index) in getPeopList"
|
||||||
|
:key="index">
|
||||||
|
<view class="content-hy-box-peopssis flex align-center">
|
||||||
|
<image :src="item.avatar?item.avatar:'../../static/images/logo.png'" mode="">
|
||||||
|
</image>
|
||||||
|
<view class="content-hy-box-peopssit">
|
||||||
|
{{item.userName}}已为您助力
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 助力按钮 -->
|
||||||
|
<!-- #ifndef MP-KUAISHOU -->
|
||||||
|
<view class="content-btn flex align-center justify-center" @click="onSaveImg()">
|
||||||
|
{{getPeopList.length==0?'开始助力':'继续助力'}}
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-KUAISHOU -->
|
||||||
|
<view class="content-btn flex align-center justify-center">
|
||||||
|
<u-button open-type="share" :custom-style="customStyle" :hair-line="false"
|
||||||
|
style="width: 100%;height: 100%;" shape="circle"
|
||||||
|
:ripple="true">{{getPeopList.length==0?'开始助力':'继续助力'}}</u-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- 活动流程 -->
|
||||||
|
<view class="content-lc">
|
||||||
|
<view class="content-lc-title flex align-center justify-center">
|
||||||
|
活动流程
|
||||||
|
</view>
|
||||||
|
<view class="content-lc-ls flex justify-between">
|
||||||
|
<view class="content-lc-ls-i">
|
||||||
|
<image src="../static/assist/as1.png" mode=""></image>
|
||||||
|
<view class="content-lc-ls-it">
|
||||||
|
点击发起助力
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="content-lc-ls-ir" src="../static/assist/asr.png" mode=""></image>
|
||||||
|
<view class="content-lc-ls-i">
|
||||||
|
<image src="../static/assist/as2.png" mode=""></image>
|
||||||
|
<view class="content-lc-ls-it">
|
||||||
|
邀请对应数量好友
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="content-lc-ls-ir" src="../static/assist/asr.png" mode=""></image>
|
||||||
|
<view class="content-lc-ls-i">
|
||||||
|
<image src="../static/assist/as3.png" mode=""></image>
|
||||||
|
<view class="content-lc-ls-it">
|
||||||
|
每位好友注册成功
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="content-lc-ls-ir" src="../static/assist/asr.png" mode=""></image>
|
||||||
|
<view class="content-lc-ls-i">
|
||||||
|
<image src="../static/assist/as4.png" mode=""></image>
|
||||||
|
<view class="content-lc-ls-it">
|
||||||
|
领取对应时间会员
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 活动规则 -->
|
||||||
|
<view class="content-rule">
|
||||||
|
<view class="content-rule-title flex align-center justify-center">
|
||||||
|
活动规则
|
||||||
|
</view>
|
||||||
|
<view class="content-rule-list">
|
||||||
|
<view class="content-rule-list-i flex align-center" v-for="(item,index) in rlueList" :key="index">
|
||||||
|
<image :src="item.inviteImg" mode=""></image>
|
||||||
|
<view class="content-rule-list-i-r">
|
||||||
|
<view class="content-rule-list-i-r-t" v-if="item.inviteMonth>0">
|
||||||
|
领取{{item.inviteMonth}}个月会员
|
||||||
|
</view>
|
||||||
|
<view class="content-rule-list-i-r-t" v-else>
|
||||||
|
领取永久会员
|
||||||
|
</view>
|
||||||
|
<view class="content-rule-list-i-r-b" v-if="item.inviteMonth>0">
|
||||||
|
邀请{{item.inviteCount}}位好友,您可以免费{{item.inviteMonth}}个月无限看短剧。
|
||||||
|
</view>
|
||||||
|
<view class="content-rule-list-i-r-b" v-else>
|
||||||
|
邀请{{item.inviteCount}}位好友,您可以永久免费无限看短剧。
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <image src="../../static/images/logo.png" mode=""></image> -->
|
||||||
|
|
||||||
|
<tki-qrcode ref="qrcode" :val="erweima" :size="100" background="#ffffff" foreground="#000000" pdground="#000000"
|
||||||
|
:onval="true" :loadMake="true" @result="qrR" :show="false"></tki-qrcode>
|
||||||
|
|
||||||
|
<view class="cu-modal" :class="modalName == 'Image' ? 'show' : ''" @tap="hideModal">
|
||||||
|
<view class="cu-dialog" v-if="bgImg && erweimapath && haibaoShow" @tap="hideModal">
|
||||||
|
<view class="bg-img">
|
||||||
|
<wm-poster @success="posterSuccess" @successH5="successH5" :imgSrc="bgImg"
|
||||||
|
:Referrer="'我的邀请码:'+invitationCode" :QrSrc="erweimapath" :LineType="false"></wm-poster>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import tkiQrcode from '../../components/tki-qrcode/tki-qrcode.vue';
|
||||||
|
import wmPoster from '../components/wm-poster/wm-posterordershd.vue';
|
||||||
|
import config from '../../common/config.js'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
tkiQrcode,
|
||||||
|
wmPoster
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
customStyle: {
|
||||||
|
width: '100%',
|
||||||
|
height: '98rpx',
|
||||||
|
border: 'none',
|
||||||
|
background: 'transparent',
|
||||||
|
color: '#ffffff',
|
||||||
|
fontSize: '12px',
|
||||||
|
fontWeight: '500',
|
||||||
|
|
||||||
|
// padding: '24px 20px',
|
||||||
|
},
|
||||||
|
avatar: '',
|
||||||
|
inviteAwardId: '', //等级id
|
||||||
|
rlueList: [], //规则列表
|
||||||
|
getPeopNum: 0, //当前需要邀请的人数
|
||||||
|
getUserPeopNum: 0, //还需要邀请的人数
|
||||||
|
rlueIndex: 0, //当前等级对应的下标
|
||||||
|
nowPeopNum: 0, //已经邀请的人数
|
||||||
|
getPeopList: [], //已经邀请的人列表
|
||||||
|
userName: '', //用户名称
|
||||||
|
avatar: '', //用户头像
|
||||||
|
erweima: '',
|
||||||
|
modalName: '',
|
||||||
|
bgImg: '',
|
||||||
|
erweimapath: '',
|
||||||
|
haibaoShow: false,
|
||||||
|
invitationCode: 0,
|
||||||
|
erweimapath: '',
|
||||||
|
haibaoImgH5: '',
|
||||||
|
qdCode: '', //渠道码
|
||||||
|
isBack: false,
|
||||||
|
bgImgs: '',
|
||||||
|
tuiguang: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
return {
|
||||||
|
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||||
|
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||||
|
title: this.tuiguang,
|
||||||
|
imageUrl: this.bgImgs
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareTimeline(res) {
|
||||||
|
return {
|
||||||
|
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||||
|
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||||
|
title: this.tuiguang,
|
||||||
|
imageUrl: this.bgImgs
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
this.isBack = false
|
||||||
|
} else {
|
||||||
|
this.isBack = true
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
if (uni.getStorageSync('qdCode')) {
|
||||||
|
this.qdCode = uni.getStorageSync('qdCode')
|
||||||
|
}
|
||||||
|
this.getBgImg()
|
||||||
|
this.invitationCode = uni.getStorageSync('invitationCode')
|
||||||
|
// h5携带邀请码去首页
|
||||||
|
// #ifdef H5
|
||||||
|
this.erweima = config.APIHOST2 + '/?invitation=' + this
|
||||||
|
.invitationCode + '&qdCode=' + this.qdCode
|
||||||
|
// #endif
|
||||||
|
// app直接去app注册页面
|
||||||
|
// #ifdef APP
|
||||||
|
this.erweima = config.APIHOST2 + '/pages/login/registerApp?invitation=' + this
|
||||||
|
.invitationCode + '&qdCode=' + this.qdCode
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.getWxEq()
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
this.getTouTiao()
|
||||||
|
// #endif
|
||||||
|
this.getUserInfo()
|
||||||
|
this.getActivity()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack();
|
||||||
|
},
|
||||||
|
//获取头条二维码
|
||||||
|
getTouTiao() {
|
||||||
|
let that = this
|
||||||
|
uni.downloadFile({
|
||||||
|
url: config.APIHOST +
|
||||||
|
'/app/invite/dyCreateQr?invitationCode=' + that
|
||||||
|
.invitationCode + ',' + that.qdCode + '&page=/pages/index/index',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
that.erweimapath = res.tempFilePath
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取微信二维码
|
||||||
|
getWxEq() {
|
||||||
|
let that = this
|
||||||
|
uni.downloadFile({
|
||||||
|
url: config.APIHOST +
|
||||||
|
'/app/invite/mpCreateQr?invitationCode=' + that
|
||||||
|
.invitationCode + ',' + that.qdCode,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
that.erweimapath = res.tempFilePath
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取背景图
|
||||||
|
getBgImg() {
|
||||||
|
this.$Request.get('/app/common/type/812').then(res => {
|
||||||
|
if (res.code == 0 && res.data.value) {
|
||||||
|
this.bgImg = res.data.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$u.get('app/banner/selectBannerList?classify=5').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.bgImgs = res.data[0].imageUrl
|
||||||
|
this.tuiguang = res.data[0].describes
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
showModal() {
|
||||||
|
console.log(this.erweima, '二维码地址')
|
||||||
|
// #ifndef H5
|
||||||
|
if (!this.haibaoImg) {
|
||||||
|
this.haibaoShow = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.modalName = 'Image';
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
//微信浏览器
|
||||||
|
if (!this.haibaoImg) {
|
||||||
|
this.haibaoShow = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.modalName = 'Image';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!this.haibaoImgH5) {
|
||||||
|
this.haibaoShow = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.previewImage({
|
||||||
|
urls: [this.haibaoImgH5],
|
||||||
|
current: 1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
onSaveImg() {
|
||||||
|
this.showModal();
|
||||||
|
},
|
||||||
|
posterSuccess(haibaoImg) {
|
||||||
|
this.haibaoImg = haibaoImg;
|
||||||
|
this.modalName = 'Image';
|
||||||
|
uni.hideLoading();
|
||||||
|
},
|
||||||
|
successH5(haibaoImg) {
|
||||||
|
this.haibaoImgH5 = haibaoImg
|
||||||
|
uni.previewImage({
|
||||||
|
urls: [haibaoImg],
|
||||||
|
current: 1,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
hideModal() {
|
||||||
|
this.modalName = null;
|
||||||
|
},
|
||||||
|
qrR(path) {
|
||||||
|
console.log(path, '二维码回调地址')
|
||||||
|
this.erweimapath = path;
|
||||||
|
},
|
||||||
|
//计算百分比
|
||||||
|
getMathNum() {
|
||||||
|
return (this.getPeopList.length / this.getPeopNum).toFixed(2) * 100
|
||||||
|
},
|
||||||
|
//获取登录用户信息
|
||||||
|
getUserInfo() {
|
||||||
|
this.$u.api.userinfo().then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.userName = res.data.userName;
|
||||||
|
this.avatar = res.data.avatar;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取活动等级
|
||||||
|
getActivity() {
|
||||||
|
this.$Request.getT('/app/invite/selectInviteAwardByUserId').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data) {
|
||||||
|
this.inviteAwardId = res.data.inviteAwardId
|
||||||
|
this.getPeopNum = res.data.inviteCount
|
||||||
|
this.getActivityrule()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取活动规则列表
|
||||||
|
getActivityrule() {
|
||||||
|
this.$Request.getT('/app/invite/selectInviteAwardList', {
|
||||||
|
page: 1,
|
||||||
|
limit: 100
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data) {
|
||||||
|
this.rlueList = res.data.records
|
||||||
|
this.rlueIndex = this.rlueList.findIndex(item => item.inviteAwardId === this
|
||||||
|
.inviteAwardId)
|
||||||
|
this.getActivityList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取邀请人列表
|
||||||
|
getActivityList() {
|
||||||
|
this.$Request.getT('/app/invite/selectInviteUserListByUserId').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data) {
|
||||||
|
this.nowPeopNum = res.data.length
|
||||||
|
|
||||||
|
this.getPeopList = res.data
|
||||||
|
this.getUserPeopNum = Number(this.getPeopNum) - Number(res.data.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.assist {
|
||||||
|
background-color: #F22947;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: #f8cfc3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left_viewimage {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
position: absolute;
|
||||||
|
top: 60rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 78rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #FFF4E4;
|
||||||
|
text-shadow: 0rpx 6rpx 9rpx rgba(118, 4, 17, 0.26);
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-titles {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 100rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #FFF4E4;
|
||||||
|
text-shadow: 0rpx 6rpx 9rpx rgba(118, 4, 17, 0.26);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
|
||||||
|
.content-hy-box {
|
||||||
|
padding: 40rpx 0;
|
||||||
|
width: 615rpx;
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(0deg, #FBEDCC 0%, #FFF7F0 98%);
|
||||||
|
border-radius: 48rpx 48rpx 24rpx 24rpx;
|
||||||
|
|
||||||
|
.content-hy-box-title1 {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
text-align: center;
|
||||||
|
color: #F22947;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 54rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-title2 {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
color: #F22947;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peop {
|
||||||
|
width: 550rpx;
|
||||||
|
height: auto;
|
||||||
|
background: linear-gradient(45deg, #f27e8c 0%, #fa3653 100%);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peop-my {
|
||||||
|
width: 100%;
|
||||||
|
height: 90rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peop-title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peop-list {
|
||||||
|
width: calc(100% - 60rpx);
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peop-list-i {
|
||||||
|
width: 32%;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.content-hy-box-peop-list-ia {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px dashed #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peop-list-it {
|
||||||
|
color: #ffffff;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-schedule {
|
||||||
|
width: 550rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-schedulet {
|
||||||
|
width: 550rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
font-size: 22rpx;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #F22A48;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peops {
|
||||||
|
width: 550rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 26rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peopss {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.content-hy-box-peopssi {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peopssis {
|
||||||
|
width: 90%;
|
||||||
|
// width: 300rpx;
|
||||||
|
height: 100%;
|
||||||
|
background-color: green;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
background: linear-gradient(-90deg, #FCE9A4 0%, #FDFBD4 100%);
|
||||||
|
border-radius: 25rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-hy-box-peopssit {
|
||||||
|
width: 80%;
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-btn {
|
||||||
|
width: 666rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: linear-gradient(-90deg, #F22C49 0%, #FF7989 100%);
|
||||||
|
border: 1px solid #FFD4CF;
|
||||||
|
border-radius: 49rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-lc {
|
||||||
|
width: 666rpx;
|
||||||
|
height: 344rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
|
||||||
|
.content-lc-title {
|
||||||
|
width: 434rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: linear-gradient(90deg, #FF969B 0%, #FF345B 100%);
|
||||||
|
border-radius: 0rpx 0rpx 50rpx 50rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-lc-ls {
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
|
||||||
|
.content-lc-ls-ir {
|
||||||
|
width: 26rpx;
|
||||||
|
height: 16rpx;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-lc-ls-i {
|
||||||
|
width: 100rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-lc-ls-it {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #9C2A2A;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-rule {
|
||||||
|
width: 666rpx;
|
||||||
|
height: auto;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
|
||||||
|
.content-rule-title {
|
||||||
|
width: 434rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: linear-gradient(90deg, #FF969B 0%, #FF345B 100%);
|
||||||
|
border-radius: 0rpx 0rpx 50rpx 50rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-rule-list {
|
||||||
|
width: 626rpx;
|
||||||
|
height: auto;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-rule-list-i {
|
||||||
|
padding: 18rpx 12rpx;
|
||||||
|
background-color: #FFF8E6;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 106rpx;
|
||||||
|
height: 82rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-rule-list-i-r {
|
||||||
|
margin-left: 18rpx;
|
||||||
|
|
||||||
|
.content-rule-list-i-r-t {
|
||||||
|
color: #9C2A2A;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-rule-list-i-r-b {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #9C2A2A;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="margin bg-white padding-sm radius" v-if="collectList.length" v-for="(item,index) in collectList" :key='index' @click="goDet(item.courseId)" >
|
||||||
|
<view class="flex">
|
||||||
|
<u-image width="280rpx" height="200rpx" :src="item.titleImg"></u-image>
|
||||||
|
<view class="flex-sub margin-left flex flex-direction justify-between" style="width:420rpx;">
|
||||||
|
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="text-gray text-26 margin-top">最近{{item.payNum}}人在学 </view>
|
||||||
|
<view class="flex align-center justify-between">
|
||||||
|
<view class=" " style="color: #FF8211;">¥ <text class=" text-bold" style="font-size: 42rpx;">{{item.price}}</text></view>
|
||||||
|
<view class="btn">马上学习</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 空数据 -->
|
||||||
|
<empty v-if="!collectList.length"></empty>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '@/components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
limit: 10,
|
||||||
|
page: 1,
|
||||||
|
collectList: [],//收藏资源
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getCollectList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取收藏信息
|
||||||
|
getCollectList() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
let data = {
|
||||||
|
userId: this.userId,
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit,
|
||||||
|
}
|
||||||
|
this.$u.api.collectList(data).then(res => {
|
||||||
|
if(res.code == 0) {
|
||||||
|
if( this.page == 1) {
|
||||||
|
this.collectList = res.data.records
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.collectList = [...this.collectList, ...res.data.records]
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goDet(e) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/course/courseDet?id=' + e
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
this.page = this.page + 1;
|
||||||
|
this.getCollectList();
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
this.getCollectList();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.btn {
|
||||||
|
width: 150upx;
|
||||||
|
height: 60upx;
|
||||||
|
background: #5074FF;
|
||||||
|
border-radius: 30upx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,321 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="mix-list-cell" :class="border" hover-class="cell-hover" :hover-stay-time="50">
|
||||||
|
<text class="cell-tit">{{title}}</text>
|
||||||
|
<input
|
||||||
|
class="main-input"
|
||||||
|
:value="value"
|
||||||
|
:type="_type"
|
||||||
|
placeholder-class="placeholder-class"
|
||||||
|
:maxlength="maxlength"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:password="type==='password'&&!showPassword"
|
||||||
|
@input="onInput"
|
||||||
|
:disabled="readOnly"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 是否可见密码 -->
|
||||||
|
<image
|
||||||
|
v-if="_isShowPass&&type==='password'&&!_isShowCode"
|
||||||
|
class="img cuIcon"
|
||||||
|
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'"
|
||||||
|
@tap="showPass"
|
||||||
|
></image>
|
||||||
|
<!-- 倒计时 -->
|
||||||
|
<view
|
||||||
|
v-if="_isShowCode&&!_isShowPass"
|
||||||
|
:class="['vercode',{'vercode-run': second>0}]"
|
||||||
|
@click="setCode"
|
||||||
|
>{{ getVerCodeSecond }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var _this, countDown;
|
||||||
|
/**
|
||||||
|
* 简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
|
||||||
|
* 比如加入image, iconSize可控等
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showPassword: false, //是否显示明文
|
||||||
|
second: 0, //倒计时
|
||||||
|
isRunCode: false, //是否开始倒计时
|
||||||
|
typeList: {
|
||||||
|
left: 'icon-zuo',
|
||||||
|
right: 'icon-you',
|
||||||
|
up: 'icon-shang',
|
||||||
|
down: 'icon-xia'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
readOnly: {
|
||||||
|
//是否显示获取验证码(二选一)
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
type: String, //类型
|
||||||
|
logo: String, //类型
|
||||||
|
value: String, //值
|
||||||
|
placeholder: String, //框内提示
|
||||||
|
isShowCode: {
|
||||||
|
//是否显示获取验证码(二选一)
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
codeText: {
|
||||||
|
type: String,
|
||||||
|
default: "获取验证码",
|
||||||
|
},
|
||||||
|
setTime: {
|
||||||
|
//倒计时时间设置
|
||||||
|
type: [Number, String],
|
||||||
|
default: 60,
|
||||||
|
},
|
||||||
|
maxlength: {
|
||||||
|
//最大长度
|
||||||
|
type: [Number, String],
|
||||||
|
default: 30,
|
||||||
|
},
|
||||||
|
isShowPass: {
|
||||||
|
//是否显示密码图标(二选一)
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '标题'
|
||||||
|
},
|
||||||
|
tips: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
navigateType: {
|
||||||
|
type: String,
|
||||||
|
default: 'right'
|
||||||
|
},
|
||||||
|
border: {
|
||||||
|
type: String,
|
||||||
|
default: 'b-b'
|
||||||
|
},
|
||||||
|
hoverClass: {
|
||||||
|
type: String,
|
||||||
|
default: 'cell-hover'
|
||||||
|
},
|
||||||
|
iconColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
_this = this
|
||||||
|
//准备触发
|
||||||
|
this.$on('runCodes', (val) => {
|
||||||
|
this.runCodes(val);
|
||||||
|
});
|
||||||
|
clearInterval(countDown);//先清理一次循环,避免缓存
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showPass() {
|
||||||
|
//是否显示密码
|
||||||
|
this.showPassword = !this.showPassword
|
||||||
|
},
|
||||||
|
onInput(e) {
|
||||||
|
//传出值
|
||||||
|
this.$emit('input', e.target.value)
|
||||||
|
},
|
||||||
|
setCode() {
|
||||||
|
//设置获取验证码的事件
|
||||||
|
if (this.isRunCode) {
|
||||||
|
//判断是否开始倒计时,避免重复点击
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$emit('setCode')
|
||||||
|
},
|
||||||
|
runCodes(val) {
|
||||||
|
console.error("runCodes")
|
||||||
|
//开始倒计时
|
||||||
|
if (String(val) == "0") {
|
||||||
|
|
||||||
|
//判断是否需要终止循环
|
||||||
|
this.second = 0; //初始倒计时
|
||||||
|
clearInterval(countDown);//清理循环
|
||||||
|
this.isRunCode = false; //关闭循环状态
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.isRunCode) {
|
||||||
|
//判断是否开始倒计时,避免重复点击
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.isRunCode = true
|
||||||
|
this.second = this._setTime //倒数秒数
|
||||||
|
|
||||||
|
let _this = this;
|
||||||
|
countDown = setInterval(function () {
|
||||||
|
_this.second--
|
||||||
|
if (_this.second == 0) {
|
||||||
|
_this.isRunCode = false
|
||||||
|
clearInterval(countDown)
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
_type() {
|
||||||
|
//处理值
|
||||||
|
const type = this.type
|
||||||
|
return type == 'password' ? 'text' : type
|
||||||
|
},
|
||||||
|
_isShowPass() {
|
||||||
|
//处理值
|
||||||
|
return String(this.isShowPass) !== 'false'
|
||||||
|
},
|
||||||
|
_isShowCode() {
|
||||||
|
//处理值
|
||||||
|
return String(this.isShowCode) !== 'false'
|
||||||
|
},
|
||||||
|
_setTime() {
|
||||||
|
//处理值
|
||||||
|
const setTime = Number(this.setTime)
|
||||||
|
return setTime > 0 ? setTime : 60
|
||||||
|
},
|
||||||
|
getVerCodeSecond() {
|
||||||
|
//验证码倒计时计算
|
||||||
|
if (this.second <= 0) {
|
||||||
|
return this.codeText;
|
||||||
|
} else {
|
||||||
|
if (this.second < 10) {
|
||||||
|
return '0' + this.second + "s";
|
||||||
|
} else {
|
||||||
|
return this.second + "s";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss'>
|
||||||
|
.main-input {
|
||||||
|
flex: 1;
|
||||||
|
text-align: left;
|
||||||
|
color: black;
|
||||||
|
font-size: 16px;
|
||||||
|
padding-right: 6px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon .mix-list-cell.b-b:after {
|
||||||
|
left: 45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder-class {
|
||||||
|
color: black;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mix-list-cell {
|
||||||
|
/* border-radius: 16upx; */
|
||||||
|
border-bottom: 4upx solid #F8F8F8;
|
||||||
|
margin-top: 1px;
|
||||||
|
font-size: 32upx;
|
||||||
|
background: white;
|
||||||
|
text-align: left;
|
||||||
|
display: flex;
|
||||||
|
margin: 32upx;
|
||||||
|
padding: 24upx 32upx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&.cell-hover {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.b-b:after {
|
||||||
|
left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-icon {
|
||||||
|
align-self: center;
|
||||||
|
width: 28px;
|
||||||
|
max-height: 30px;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-more {
|
||||||
|
align-self: center;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #606266;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-tit {
|
||||||
|
width: 80px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-tip {
|
||||||
|
font-size: 14px;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.items {
|
||||||
|
position: absolute;
|
||||||
|
height: 48px;
|
||||||
|
width: 100%;
|
||||||
|
background: #FFFFFF;
|
||||||
|
/*opacity:0.05;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-list {
|
||||||
|
opacity: 0.8;
|
||||||
|
z-index: 88;
|
||||||
|
background: white;
|
||||||
|
border: 1px solid white;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 18px; /* Input 高度 */
|
||||||
|
color: #333333;
|
||||||
|
padding: 16px;
|
||||||
|
margin-top: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vercode {
|
||||||
|
color: #FF2638;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vercode-run {
|
||||||
|
color: black !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oBorder {
|
||||||
|
|
||||||
|
border-radius: 2.5rem;
|
||||||
|
-webkit-box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||||
|
box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,273 @@
|
||||||
|
<template>
|
||||||
|
<view style="background: #FFFFFF;">
|
||||||
|
<!-- <view v-if="loading"></view> -->
|
||||||
|
<canvas v-if="!tempFilePath" :canvas-id="CanvasID" :style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||||
|
<image v-else lazy-load :src="tempFilePath" mode="widthFix" class="is-response" @longpress="toSave(tempFilePath)"></image>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var _this;
|
||||||
|
export default {
|
||||||
|
name: 'wm-poster',
|
||||||
|
props: {
|
||||||
|
CanvasID: {
|
||||||
|
//CanvasID 等同于 canvas-id
|
||||||
|
Type: String,
|
||||||
|
default: 'PosterCanvas'
|
||||||
|
},
|
||||||
|
imgSrc: {
|
||||||
|
//展示图
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
QrSrc: {
|
||||||
|
//二维码
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
Title: {
|
||||||
|
//文本内容
|
||||||
|
Type: String,
|
||||||
|
default: '优享帮'
|
||||||
|
},
|
||||||
|
TitleColor: {
|
||||||
|
//标题颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#000000'
|
||||||
|
},
|
||||||
|
LineType: {
|
||||||
|
//标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||||
|
Type: [String, Boolean],
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
PriceTxt: {
|
||||||
|
//价格值
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
PriceColor: {
|
||||||
|
//价格颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#e31d1a'
|
||||||
|
},
|
||||||
|
OriginalTxt: {
|
||||||
|
//原价值
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
OriginalColor: {
|
||||||
|
//默认颜色(如原价与扫描二维码颜色)
|
||||||
|
Type: String,
|
||||||
|
default: '#b8b8b8'
|
||||||
|
},
|
||||||
|
Width: {
|
||||||
|
//画布宽度 (高度根据图片比例计算 单位upx)
|
||||||
|
Type: String,
|
||||||
|
default: 700
|
||||||
|
},
|
||||||
|
CanvasBg: {
|
||||||
|
//canvas画布背景色
|
||||||
|
Type: String,
|
||||||
|
default: '#ffffff'
|
||||||
|
},
|
||||||
|
Referrer: {
|
||||||
|
//推荐人信息
|
||||||
|
Type: String,
|
||||||
|
default: '优享帮精选好物'
|
||||||
|
},
|
||||||
|
ViewDetails: {
|
||||||
|
//描述提示文字
|
||||||
|
Type: String,
|
||||||
|
default: '长按或扫描识别二维码领券'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
tempFilePath: '',
|
||||||
|
canvasW: 0,
|
||||||
|
canvasH: 0,
|
||||||
|
canvasImgSrc: '',
|
||||||
|
ctx: null
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toSave(url) {
|
||||||
|
//#ifndef H5
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: url,
|
||||||
|
success: function(image) {
|
||||||
|
console.log('图片信息:', JSON.stringify(image));
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: image.path,
|
||||||
|
success: function() {
|
||||||
|
console.log('save success');
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报已保存相册',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
|
async OnCanvas() {
|
||||||
|
this.loading = true;
|
||||||
|
// this.$queue.showLoading('海报生成中...');
|
||||||
|
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||||
|
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||||
|
C_P = uni.upx2px(30), //canvas Paddng 间距
|
||||||
|
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||||
|
let _strlineW = 0; //文本宽度
|
||||||
|
let _imgInfo = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.imgSrc
|
||||||
|
}); //广告图
|
||||||
|
let _QrCode = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.QrSrc
|
||||||
|
}); //二维码或太阳码
|
||||||
|
let r = [_imgInfo.width, _imgInfo.height];
|
||||||
|
let q = [_QrCode.width, _QrCode.height];
|
||||||
|
let imgW = C_W - C_P * 2;
|
||||||
|
if (r[0] != imgW) {
|
||||||
|
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||||
|
r[0] = imgW;
|
||||||
|
}
|
||||||
|
if (q[0] != C_Q) {
|
||||||
|
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||||
|
q[0] = C_Q;
|
||||||
|
}
|
||||||
|
_this.canvasW = C_W;
|
||||||
|
_this.canvasH = r[1] + q[1] + 128;
|
||||||
|
_this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||||
|
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||||
|
|
||||||
|
//添加图片展示
|
||||||
|
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], r[1]);
|
||||||
|
//添加图片展示 end
|
||||||
|
|
||||||
|
//设置文本
|
||||||
|
//#ifdef H5
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||||
|
//#endif
|
||||||
|
//#ifdef APP-PLUS
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||||
|
_this.Title=_this.Title.substring(0,20)
|
||||||
|
//#endif
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||||
|
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||||
|
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||||
|
let _num = 1;
|
||||||
|
for (let i = 0; i < _this.Title.length; i++) {
|
||||||
|
_strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||||
|
if (_strlineW > r[0]) {
|
||||||
|
if (_num == 2 && _this.LineType) {
|
||||||
|
//文字换行数量大于二进行省略号处理
|
||||||
|
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||||
|
_strlineW = 0;
|
||||||
|
_strLastIndex = i;
|
||||||
|
_num++;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||||
|
_strlineW = 0;
|
||||||
|
_strHeight += 20;
|
||||||
|
_strLastIndex = i;
|
||||||
|
_num++;
|
||||||
|
}
|
||||||
|
} else if (i == _this.Title.length - 1) {
|
||||||
|
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||||
|
_strlineW = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//设置文本 end
|
||||||
|
//设置价格
|
||||||
|
_strlineW = C_P;
|
||||||
|
_strHeight += uni.upx2px(60);
|
||||||
|
if (_num == 1) {
|
||||||
|
_strHeight += 20; //单行标题时占位符
|
||||||
|
}
|
||||||
|
if (_this.PriceTxt != '') {
|
||||||
|
//判断是否有销售价格
|
||||||
|
_this.ctx.setFillStyle(_this.PriceColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(38));
|
||||||
|
_this.ctx.fillText('券后价 ¥' + _this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||||
|
_strlineW += _this.ctx.measureText('券后价 ¥' + _this.PriceTxt).width + uni.upx2px(10);
|
||||||
|
}
|
||||||
|
// #ifdef H5
|
||||||
|
if (_this.PriceTxt != '' && _this.OriginalTxt != '') {
|
||||||
|
//判断是否有销售价格且原价
|
||||||
|
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
_this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||||
|
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||||
|
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(10)); //终点
|
||||||
|
_this.ctx.stroke();
|
||||||
|
//设置价格 end
|
||||||
|
|
||||||
|
//添加二维码
|
||||||
|
_strHeight += uni.upx2px(20);
|
||||||
|
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||||
|
//添加二维码 end
|
||||||
|
|
||||||
|
//添加推荐人与描述
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(30));
|
||||||
|
_this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||||
|
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
_this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||||
|
//添加推荐人与描述 end
|
||||||
|
//延迟后渲染至canvas上
|
||||||
|
setTimeout(function() {
|
||||||
|
_this.ctx.draw(true, ret => {
|
||||||
|
_this.getNewImage();
|
||||||
|
});
|
||||||
|
}, 600);
|
||||||
|
},
|
||||||
|
async getImageInfo({
|
||||||
|
imgSrc
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, errs) => {
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: imgSrc,
|
||||||
|
success: function(image) {
|
||||||
|
resolve(image);
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
errs(err);
|
||||||
|
_this.$queue.showToast('海报生成失败');
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getNewImage() {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: _this.CanvasID,
|
||||||
|
quality: 1,
|
||||||
|
complete: res => {
|
||||||
|
_this.tempFilePath = res.tempFilePath;
|
||||||
|
_this.$emit('success', res);
|
||||||
|
_this.loading = false;
|
||||||
|
_this.$queue.showToast('长按图片保存海报');
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
this
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
_this = this;
|
||||||
|
this.OnCanvas();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -0,0 +1,321 @@
|
||||||
|
<template>
|
||||||
|
<view style="background: #FFFFFF;">
|
||||||
|
<canvas v-if="!tempFilePath" :canvas-id="CanvasID"
|
||||||
|
:style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||||
|
@longpress="saveqrcode"></image>
|
||||||
|
<!-- <button v-if="openSettingBtnHidden" class="purple_btn btn_box" hover-class="none" open-type="openSetting"
|
||||||
|
@opensetting='handleSetting'>请开启保存权限</button> -->
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
|
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||||
|
@longpress="toSave(tempFilePath)"></image>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var _this;
|
||||||
|
export default {
|
||||||
|
name: 'wm-poster',
|
||||||
|
props: {
|
||||||
|
CanvasID: {
|
||||||
|
//CanvasID 等同于 canvas-id
|
||||||
|
Type: String,
|
||||||
|
default: 'PosterCanvas'
|
||||||
|
},
|
||||||
|
imgSrc: {
|
||||||
|
//展示图
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
QrSrc: {
|
||||||
|
//二维码
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
Title: {
|
||||||
|
//文本内容
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
TitleColor: {
|
||||||
|
//标题颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#000000'
|
||||||
|
},
|
||||||
|
LineType: {
|
||||||
|
//标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||||
|
Type: [String, Boolean],
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
PriceTxt: {
|
||||||
|
//价格值
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
PriceColor: {
|
||||||
|
//价格颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#e31d1a'
|
||||||
|
},
|
||||||
|
OriginalTxt: {
|
||||||
|
//原价值
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
OriginalColor: {
|
||||||
|
//默认颜色(如原价与扫描二维码颜色)
|
||||||
|
Type: String,
|
||||||
|
default: '#b8b8b8'
|
||||||
|
},
|
||||||
|
Width: {
|
||||||
|
//画布宽度 (高度根据图片比例计算 单位upx)
|
||||||
|
Type: String,
|
||||||
|
default: 700
|
||||||
|
},
|
||||||
|
CanvasBg: {
|
||||||
|
//canvas画布背景色
|
||||||
|
Type: String,
|
||||||
|
default: '#ffffff'
|
||||||
|
},
|
||||||
|
Referrer: {
|
||||||
|
//推荐人信息
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
ViewDetails: {
|
||||||
|
//描述提示文字
|
||||||
|
Type: String,
|
||||||
|
default: '长按或扫描识别二维码进入'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
tempFilePath: '',
|
||||||
|
canvasW: 0,
|
||||||
|
canvasH: 0,
|
||||||
|
canvasImgSrc: '',
|
||||||
|
ctx: null,
|
||||||
|
openSettingBtnHidden: true //是否授权
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
saveqrcode() {
|
||||||
|
var that = this
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: that.tempFilePath, // canvas 标签的 id 或 canvas-id
|
||||||
|
success: function(res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报已保存相册',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toSave(url) {
|
||||||
|
//#ifdef APP-PLUS || MP-TOUTIAO || MP-KUAISHOU
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: url,
|
||||||
|
success: function(image) {
|
||||||
|
console.log('图片信息:', JSON.stringify(image));
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: image.path,
|
||||||
|
success: function() {
|
||||||
|
console.log('save success');
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报已保存相册',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
|
async OnCanvas() {
|
||||||
|
this.loading = true;
|
||||||
|
// this.$queue.showLoading('海报生成中...');
|
||||||
|
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||||
|
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||||
|
C_P = uni.upx2px(0), //canvas Paddng 间距
|
||||||
|
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||||
|
let _strlineW = 0; //文本宽度
|
||||||
|
let _imgInfo = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.imgSrc
|
||||||
|
}); //广告图
|
||||||
|
let _QrCode = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.QrSrc
|
||||||
|
}); //二维码或太阳码
|
||||||
|
let r = [_imgInfo.width, _imgInfo.height];
|
||||||
|
let q = [_QrCode.width, _QrCode.height];
|
||||||
|
let imgW = C_W - (C_P * 2.5);
|
||||||
|
if (r[0] != imgW) {
|
||||||
|
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||||
|
r[0] = imgW;
|
||||||
|
}
|
||||||
|
if (q[0] != C_Q) {
|
||||||
|
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||||
|
q[0] = C_Q;
|
||||||
|
}
|
||||||
|
_this.canvasW = C_W;
|
||||||
|
_this.canvasH = r[1] + q[1] + 25;
|
||||||
|
_this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||||
|
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||||
|
|
||||||
|
//添加图片展示
|
||||||
|
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], r[1]);
|
||||||
|
//添加图片展示 end
|
||||||
|
|
||||||
|
//设置文本
|
||||||
|
//#ifdef H5
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||||
|
//#endif
|
||||||
|
//#ifdef MP-WEIXIN
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(34)); //设置标题字体大小
|
||||||
|
//#endif
|
||||||
|
//#ifdef APP-PLUS
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||||
|
_this.Title = _this.Title.substring(0, 20)
|
||||||
|
//#endif
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||||
|
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||||
|
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||||
|
let _num = 1;
|
||||||
|
// for (let i = 0; i < _this.Title.length; i++) {
|
||||||
|
// _strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||||
|
// if (_strlineW > r[0]) {
|
||||||
|
// if (_num == 2 && _this.LineType) {
|
||||||
|
// //文字换行数量大于二进行省略号处理
|
||||||
|
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||||
|
// _strlineW = 0;
|
||||||
|
// _strLastIndex = i;
|
||||||
|
// _num++;
|
||||||
|
// break;
|
||||||
|
// } else {
|
||||||
|
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||||
|
// _strlineW = 0;
|
||||||
|
// _strHeight += 20;
|
||||||
|
// _strLastIndex = i;
|
||||||
|
// _num++;
|
||||||
|
// }
|
||||||
|
// } else if (i == _this.Title.length - 1) {
|
||||||
|
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||||
|
// _strlineW = 0;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//设置文本 end
|
||||||
|
//设置价格
|
||||||
|
_strlineW = C_P;
|
||||||
|
_strHeight += uni.upx2px(60);
|
||||||
|
if (_num == 1) {
|
||||||
|
_strHeight += 20; //单行标题时占位符
|
||||||
|
}
|
||||||
|
// if (_this.PriceTxt != '') {
|
||||||
|
// //判断是否有销售价格
|
||||||
|
// _this.ctx.setFillStyle(_this.PriceColor);
|
||||||
|
// _this.ctx.setFontSize(uni.upx2px(38));
|
||||||
|
// _this.ctx.fillText('现价 ¥' + _this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||||
|
// _strlineW += _this.ctx.measureText('现价 ¥' + _this.PriceTxt).width + uni.upx2px(10);
|
||||||
|
// }
|
||||||
|
// // #ifdef H5
|
||||||
|
// if (_this.PriceTxt != '' && _this.OriginalTxt != '') {
|
||||||
|
// //判断是否有销售价格且原价
|
||||||
|
// _this.ctx.setFillStyle(_this.OriginalColor);
|
||||||
|
// _this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
// _this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||||
|
// }
|
||||||
|
// #endif
|
||||||
|
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||||
|
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||||
|
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(
|
||||||
|
10)); //终点
|
||||||
|
_this.ctx.stroke();
|
||||||
|
//设置价格 end
|
||||||
|
|
||||||
|
//添加二维码
|
||||||
|
_strHeight += uni.upx2px(20);
|
||||||
|
let toTop = uni.upx2px(20);
|
||||||
|
// _this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||||
|
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P - uni.upx2px(20), _this.canvasH - q[1] - toTop, q[
|
||||||
|
0], q[1]);
|
||||||
|
//添加二维码 end
|
||||||
|
|
||||||
|
//添加推荐人与描述
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(30));
|
||||||
|
// _this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||||
|
_this.ctx.fillText(_this.Referrer, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2);
|
||||||
|
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
// _this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||||
|
_this.ctx.fillText(_this.ViewDetails, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2 +
|
||||||
|
20);
|
||||||
|
//添加推荐人与描述 end
|
||||||
|
//延迟后渲染至canvas上
|
||||||
|
setTimeout(function() {
|
||||||
|
_this.ctx.draw(true, ret => {
|
||||||
|
_this.getNewImage();
|
||||||
|
});
|
||||||
|
}, 600);
|
||||||
|
},
|
||||||
|
async getImageInfo({
|
||||||
|
imgSrc
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, errs) => {
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: imgSrc,
|
||||||
|
success: function(image) {
|
||||||
|
resolve(image);
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
errs(err);
|
||||||
|
_this.$queue.showToast('海报生成失败');
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getNewImage() {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: _this.CanvasID,
|
||||||
|
quality: 1,
|
||||||
|
complete: res => {
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
_this.tempFilePath = res.tempFilePath;
|
||||||
|
_this.$emit('success', res);
|
||||||
|
} else {
|
||||||
|
_this.$emit('successH5', res.tempFilePath);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifndef H5
|
||||||
|
_this.tempFilePath = res.tempFilePath;
|
||||||
|
_this.$emit('success', res);
|
||||||
|
// #endif
|
||||||
|
_this.loading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: '长按图片保存海报',
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
this
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
_this = this;
|
||||||
|
this.OnCanvas();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -0,0 +1,324 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<canvas v-if="!tempFilePath" :canvas-id="CanvasID"
|
||||||
|
:style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||||
|
@longpress="saveqrcode"></image>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-TOUTIAO -->
|
||||||
|
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||||
|
@longpress="saveqrcode"></image>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
|
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||||
|
@longpress="toSave(tempFilePath)"></image>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var _this;
|
||||||
|
export default {
|
||||||
|
name: 'wm-poster',
|
||||||
|
props: {
|
||||||
|
CanvasID: {
|
||||||
|
//CanvasID 等同于 canvas-id
|
||||||
|
Type: String,
|
||||||
|
default: 'PosterCanvas'
|
||||||
|
},
|
||||||
|
imgSrc: {
|
||||||
|
//展示图
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
QrSrc: {
|
||||||
|
//二维码
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
Title: {
|
||||||
|
//文本内容
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
TitleColor: {
|
||||||
|
//标题颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#000000'
|
||||||
|
},
|
||||||
|
LineType: {
|
||||||
|
//标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||||
|
Type: [String, Boolean],
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
PriceTxt: {
|
||||||
|
//价格值
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
PriceColor: {
|
||||||
|
//价格颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#e31d1a'
|
||||||
|
},
|
||||||
|
OriginalTxt: {
|
||||||
|
//原价值
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
OriginalColor: {
|
||||||
|
//默认颜色(如原价与扫描二维码颜色)
|
||||||
|
Type: String,
|
||||||
|
default: '#b8b8b8'
|
||||||
|
},
|
||||||
|
Width: {
|
||||||
|
//画布宽度 (高度根据图片比例计算 单位upx)
|
||||||
|
Type: String,
|
||||||
|
default: 700
|
||||||
|
},
|
||||||
|
CanvasBg: {
|
||||||
|
//canvas画布背景色
|
||||||
|
Type: String,
|
||||||
|
default: '#ffffff'
|
||||||
|
},
|
||||||
|
Referrer: {
|
||||||
|
//推荐人信息
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
ViewDetails: {
|
||||||
|
//描述提示文字
|
||||||
|
Type: String,
|
||||||
|
default: '长按或扫描识别二维码进入'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
tempFilePath: '',
|
||||||
|
canvasW: 0,
|
||||||
|
canvasH: 0,
|
||||||
|
canvasImgSrc: '',
|
||||||
|
ctx: null,
|
||||||
|
openSettingBtnHidden: true //是否授权
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
saveqrcode() {
|
||||||
|
var that = this
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: that.tempFilePath, // canvas 标签的 id 或 canvas-id
|
||||||
|
success: function(res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报已保存相册',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toSave(url) {
|
||||||
|
//#ifdef APP-PLUS
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: url,
|
||||||
|
success: function(image) {
|
||||||
|
console.log('图片信息:', JSON.stringify(image));
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: image.path,
|
||||||
|
success: function() {
|
||||||
|
console.log('save success');
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报已保存相册',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
|
async OnCanvas() {
|
||||||
|
this.loading = true;
|
||||||
|
// this.$queue.showLoading('海报生成中...');
|
||||||
|
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||||
|
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||||
|
C_P = uni.upx2px(0), //canvas Paddng 间距
|
||||||
|
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||||
|
let _strlineW = 0; //文本宽度
|
||||||
|
let _imgInfo = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.imgSrc
|
||||||
|
}); //广告图
|
||||||
|
let _QrCode = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.QrSrc
|
||||||
|
}); //二维码或太阳码
|
||||||
|
let r = [_imgInfo.width, _imgInfo.height];
|
||||||
|
let q = [_QrCode.width, _QrCode.height];
|
||||||
|
let imgW = C_W - (C_P * 2.5);
|
||||||
|
if (r[0] != imgW) {
|
||||||
|
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||||
|
r[0] = imgW;
|
||||||
|
}
|
||||||
|
if (q[0] != C_Q) {
|
||||||
|
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||||
|
q[0] = C_Q;
|
||||||
|
}
|
||||||
|
_this.canvasW = C_W;
|
||||||
|
_this.canvasH = r[1];
|
||||||
|
// _this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||||
|
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||||
|
|
||||||
|
//添加图片展示
|
||||||
|
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], _this.canvasH);
|
||||||
|
//添加图片展示 end
|
||||||
|
|
||||||
|
//设置文本
|
||||||
|
//#ifdef H5
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||||
|
//#endif
|
||||||
|
//#ifdef MP-WEIXIN
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(34)); //设置标题字体大小
|
||||||
|
//#endif
|
||||||
|
//#ifdef APP-PLUS
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||||
|
_this.Title = _this.Title.substring(0, 20)
|
||||||
|
//#endif
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||||
|
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||||
|
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||||
|
let _num = 1;
|
||||||
|
// for (let i = 0; i < _this.Title.length; i++) {
|
||||||
|
// _strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||||
|
// if (_strlineW > r[0]) {
|
||||||
|
// if (_num == 2 && _this.LineType) {
|
||||||
|
// //文字换行数量大于二进行省略号处理
|
||||||
|
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||||
|
// _strlineW = 0;
|
||||||
|
// _strLastIndex = i;
|
||||||
|
// _num++;
|
||||||
|
// break;
|
||||||
|
// } else {
|
||||||
|
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||||
|
// _strlineW = 0;
|
||||||
|
// _strHeight += 20;
|
||||||
|
// _strLastIndex = i;
|
||||||
|
// _num++;
|
||||||
|
// }
|
||||||
|
// } else if (i == _this.Title.length - 1) {
|
||||||
|
// _this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||||
|
// _strlineW = 0;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//设置文本 end
|
||||||
|
//设置价格
|
||||||
|
_strlineW = C_P;
|
||||||
|
_strHeight += uni.upx2px(60);
|
||||||
|
if (_num == 1) {
|
||||||
|
_strHeight += 20; //单行标题时占位符
|
||||||
|
}
|
||||||
|
// if (_this.PriceTxt != '') {
|
||||||
|
// //判断是否有销售价格
|
||||||
|
// _this.ctx.setFillStyle(_this.PriceColor);
|
||||||
|
// _this.ctx.setFontSize(uni.upx2px(38));
|
||||||
|
// _this.ctx.fillText('现价 ¥' + _this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||||
|
// _strlineW += _this.ctx.measureText('现价 ¥' + _this.PriceTxt).width + uni.upx2px(10);
|
||||||
|
// }
|
||||||
|
// // #ifdef H5
|
||||||
|
// if (_this.PriceTxt != '' && _this.OriginalTxt != '') {
|
||||||
|
// //判断是否有销售价格且原价
|
||||||
|
// _this.ctx.setFillStyle(_this.OriginalColor);
|
||||||
|
// _this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
// _this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||||
|
// }
|
||||||
|
// #endif
|
||||||
|
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||||
|
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||||
|
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(
|
||||||
|
10)); //终点
|
||||||
|
_this.ctx.stroke();
|
||||||
|
//设置价格 end
|
||||||
|
|
||||||
|
//添加二维码
|
||||||
|
_strHeight += uni.upx2px(20);
|
||||||
|
let toTop = uni.upx2px(20);
|
||||||
|
// _this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||||
|
_this.ctx.drawImage(_QrCode.path, _this.canvasW / 2 - q[0] / 2 + uni.upx2px(25), _this.canvasH / 2 - q[
|
||||||
|
1] / 2 + uni.upx2px(20), q[0], q[
|
||||||
|
1]);
|
||||||
|
//添加二维码 end
|
||||||
|
|
||||||
|
//添加推荐人与描述
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(30));
|
||||||
|
// _this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||||
|
// _this.ctx.fillText(_this.Referrer, C_P, _this.canvasH - q[1] - toTop + q[1] / 2);
|
||||||
|
_this.ctx.setFillStyle('red');
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
// _this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||||
|
_this.ctx.fillText('扫一扫,注册领会员', _this.canvasW / 2 - q[0] / 2 - uni.upx2px(5), _this.canvasH / 2 - q[
|
||||||
|
1] / 2 - uni.upx2px(10));
|
||||||
|
//添加推荐人与描述 end
|
||||||
|
//延迟后渲染至canvas上
|
||||||
|
setTimeout(function() {
|
||||||
|
_this.ctx.draw(true, ret => {
|
||||||
|
_this.getNewImage();
|
||||||
|
});
|
||||||
|
}, 600);
|
||||||
|
},
|
||||||
|
async getImageInfo({
|
||||||
|
imgSrc
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, errs) => {
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: imgSrc,
|
||||||
|
success: function(image) {
|
||||||
|
resolve(image);
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
errs(err);
|
||||||
|
_this.$queue.showToast('海报生成失败');
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getNewImage() {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: _this.CanvasID,
|
||||||
|
quality: 1,
|
||||||
|
complete: res => {
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
_this.tempFilePath = res.tempFilePath;
|
||||||
|
_this.$emit('success', res);
|
||||||
|
} else {
|
||||||
|
_this.$emit('successH5', res.tempFilePath);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifndef H5
|
||||||
|
_this.tempFilePath = res.tempFilePath;
|
||||||
|
_this.$emit('success', res);
|
||||||
|
// #endif
|
||||||
|
_this.loading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: '长按图片保存海报',
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
this
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
_this = this;
|
||||||
|
this.OnCanvas();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -0,0 +1,261 @@
|
||||||
|
<template>
|
||||||
|
<view style="background: #FFFFFF;">
|
||||||
|
<canvas v-if="!tempFilePath" :canvas-id="CanvasID" :style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||||
|
<image v-else lazy-load :src="tempFilePath" mode="widthFix" class="is-response" @longpress="toSave(tempFilePath)"></image>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var _this;
|
||||||
|
export default {
|
||||||
|
name: 'wm-poster',
|
||||||
|
props: {
|
||||||
|
CanvasID: { //CanvasID 等同于 canvas-id
|
||||||
|
Type: String,
|
||||||
|
default: 'PosterCanvas'
|
||||||
|
},
|
||||||
|
imgSrc: { //展示图
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
QrSrc: { //二维码
|
||||||
|
Type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
Title: { //文本内容
|
||||||
|
Type: String,
|
||||||
|
default: '优享帮'
|
||||||
|
},
|
||||||
|
TitleColor: { //标题颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#000000'
|
||||||
|
},
|
||||||
|
LineType: { //标题显示行数 (注超出2行显示会导致画布布局絮乱)
|
||||||
|
Type: [String, Boolean],
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
PriceTxt: { //价格值
|
||||||
|
Type: String,
|
||||||
|
default: '99.99'
|
||||||
|
},
|
||||||
|
PriceColor: { //价格颜色
|
||||||
|
Type: String,
|
||||||
|
default: '#e31d1a'
|
||||||
|
},
|
||||||
|
OriginalTxt: { //原价值
|
||||||
|
Type: String,
|
||||||
|
default: '199.99'
|
||||||
|
},
|
||||||
|
OriginalColor: { //默认颜色(如原价与扫描二维码颜色)
|
||||||
|
Type: String,
|
||||||
|
default: '#b8b8b8'
|
||||||
|
},
|
||||||
|
Width: { //画布宽度 (高度根据图片比例计算 单位upx)
|
||||||
|
Type: String,
|
||||||
|
default: 700
|
||||||
|
},
|
||||||
|
CanvasBg: { //canvas画布背景色
|
||||||
|
Type: String,
|
||||||
|
default: '#ffffff'
|
||||||
|
},
|
||||||
|
Referrer: { //推荐人信息
|
||||||
|
Type: String,
|
||||||
|
default: '优享帮精选好物'
|
||||||
|
},
|
||||||
|
ViewDetails: { //描述提示文字
|
||||||
|
Type: String,
|
||||||
|
default: '长按或扫描二维码免费领取'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tempFilePath: '',
|
||||||
|
canvasW: 0,
|
||||||
|
canvasH: 0,
|
||||||
|
canvasImgSrc: '',
|
||||||
|
ctx: null
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toSave(url) {
|
||||||
|
//#ifndef H5
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: url,
|
||||||
|
success: function(image) {
|
||||||
|
console.log('图片信息:', JSON.stringify(image));
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: image.path,
|
||||||
|
success: function() {
|
||||||
|
console.log('save success');
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报已保存相册',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
|
async OnCanvas() {
|
||||||
|
|
||||||
|
this.$queue.showLoading('海报生成中...');
|
||||||
|
|
||||||
|
_this.ctx = uni.createCanvasContext(_this.CanvasID, this);
|
||||||
|
const C_W = uni.upx2px(_this.Width), //canvas宽度
|
||||||
|
C_P = uni.upx2px(30), //canvas Paddng 间距
|
||||||
|
C_Q = uni.upx2px(150); //二维码或太阳码宽高
|
||||||
|
let _strlineW = 0; //文本宽度
|
||||||
|
let _imgInfo = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.imgSrc
|
||||||
|
}); //广告图
|
||||||
|
let _QrCode = await _this.getImageInfo({
|
||||||
|
imgSrc: _this.QrSrc
|
||||||
|
}); //二维码或太阳码
|
||||||
|
let r = [_imgInfo.width, _imgInfo.height];
|
||||||
|
let q = [_QrCode.width, _QrCode.height];
|
||||||
|
let imgW = C_W - C_P * 2;
|
||||||
|
if (r[0] != imgW) {
|
||||||
|
r[1] = Math.floor((imgW / r[0]) * r[1]);
|
||||||
|
r[0] = imgW;
|
||||||
|
}
|
||||||
|
if (q[0] != C_Q) {
|
||||||
|
q[1] = Math.floor((C_Q / q[0]) * q[1]);
|
||||||
|
q[0] = C_Q;
|
||||||
|
}
|
||||||
|
_this.canvasW = C_W;
|
||||||
|
_this.canvasH = r[1] + q[1] + 128;
|
||||||
|
_this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||||
|
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||||
|
|
||||||
|
//添加图片展示
|
||||||
|
_this.ctx.drawImage(_imgInfo.path, C_P, C_P, r[0], r[1]);
|
||||||
|
//添加图片展示 end
|
||||||
|
|
||||||
|
//设置文本
|
||||||
|
//#ifdef H5
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(32)); //设置标题字体大小
|
||||||
|
//#endif
|
||||||
|
//#ifndef H5
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||||
|
//#endif
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||||
|
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||||
|
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||||
|
let _num = 1;
|
||||||
|
for (let i = 0; i < _this.Title.length; i++) {
|
||||||
|
_strlineW += _this.ctx.measureText(_this.Title[i]).width;
|
||||||
|
if (_strlineW > r[0]) {
|
||||||
|
if (_num == 2 && _this.LineType) {
|
||||||
|
//文字换行数量大于二进行省略号处理
|
||||||
|
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i - 8) + '...', C_P, _strHeight);
|
||||||
|
_strlineW = 0;
|
||||||
|
_strLastIndex = i;
|
||||||
|
_num++;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i), C_P, _strHeight);
|
||||||
|
_strlineW = 0;
|
||||||
|
_strHeight += 20;
|
||||||
|
_strLastIndex = i;
|
||||||
|
_num++;
|
||||||
|
}
|
||||||
|
} else if (i == _this.Title.length - 1) {
|
||||||
|
_this.ctx.fillText(_this.Title.substring(_strLastIndex, i + 1), C_P, _strHeight);
|
||||||
|
_strlineW = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//设置文本 end
|
||||||
|
|
||||||
|
//设置价格
|
||||||
|
_strlineW = C_P;
|
||||||
|
_strHeight += uni.upx2px(60);
|
||||||
|
if (_num == 1) {
|
||||||
|
_strHeight += 20; //单行标题时占位符
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_this.PriceTxt != '') { //判断是否有销售价格
|
||||||
|
_this.ctx.setFillStyle(_this.PriceColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(38));
|
||||||
|
_this.ctx.fillText(_this.PriceTxt, _strlineW, _strHeight); //商品价格
|
||||||
|
_strlineW += _this.ctx.measureText(_this.PriceTxt).width + uni.upx2px(10);
|
||||||
|
}
|
||||||
|
if (_this.PriceTxt != '' && _this.OriginalTxt != '') { //判断是否有销售价格且原价
|
||||||
|
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
_this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||||
|
}
|
||||||
|
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||||
|
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||||
|
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(10)); //终点
|
||||||
|
_this.ctx.stroke();
|
||||||
|
//设置价格 end
|
||||||
|
|
||||||
|
//添加二维码
|
||||||
|
_strHeight += uni.upx2px(20);
|
||||||
|
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||||
|
//添加二维码 end
|
||||||
|
|
||||||
|
//添加推荐人与描述
|
||||||
|
_this.ctx.setFillStyle(_this.TitleColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(30));
|
||||||
|
_this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||||
|
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||||
|
_this.ctx.setFontSize(uni.upx2px(24));
|
||||||
|
_this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||||
|
//添加推荐人与描述 end
|
||||||
|
|
||||||
|
//延迟后渲染至canvas上
|
||||||
|
setTimeout(function() {
|
||||||
|
_this.ctx.draw(true, (ret) => {
|
||||||
|
_this.getNewImage();
|
||||||
|
});
|
||||||
|
|
||||||
|
}, 600);
|
||||||
|
// setTimeout(function () {
|
||||||
|
// uni.hideLoading();
|
||||||
|
|
||||||
|
// }, 3000);
|
||||||
|
},
|
||||||
|
async getImageInfo({
|
||||||
|
imgSrc
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, errs) => {
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: imgSrc,
|
||||||
|
success: function(image) {
|
||||||
|
resolve(image);
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
errs(err);
|
||||||
|
uni.hideLoading();
|
||||||
|
_this.$queue.showToast("海报生成失败")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
getNewImage() {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: _this.CanvasID,
|
||||||
|
quality: 1,
|
||||||
|
complete: (res) => {
|
||||||
|
_this.tempFilePath = res.tempFilePath;
|
||||||
|
_this.$emit('success', res);
|
||||||
|
_this.$queue.showToast("长按图片保存海报")
|
||||||
|
// uni.hideLoading();
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
_this = this;
|
||||||
|
this.OnCanvas();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -0,0 +1,301 @@
|
||||||
|
<template>
|
||||||
|
<view class="page-box">
|
||||||
|
<view class="order" v-if="courseList.length" v-for="(item, index) in courseList" :key="index"
|
||||||
|
@click="goCourse(item.courseId)">
|
||||||
|
<view class="item">
|
||||||
|
<view class="left">
|
||||||
|
<image :src="item.titleImg" mode="aspectFill" style="width: 200rpx;height: 200rpx;"></image>
|
||||||
|
</view>
|
||||||
|
<view class="flex-sub content flex flex-direction justify-between" style="width:420rpx;">
|
||||||
|
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="text-gray text-26 margin-top">最近{{item.payNum}}人在学 </view>
|
||||||
|
<view class="flex align-center justify-between">
|
||||||
|
<view class=" " style="color: #FF8211;">¥ <text class=" text-bold"
|
||||||
|
style="font-size: 42rpx;">{{item.price}}</text></view>
|
||||||
|
<view class="btn">马上学习</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="content flex-sub flex flex-direction justify-between">
|
||||||
|
<view class="flex flex-direction justify-between flex-sub">
|
||||||
|
<view class="title u-line-2" style="width: 380rpx;">{{ item.title }}</view>
|
||||||
|
<view class="buttom margin-top">
|
||||||
|
<view class="price">
|
||||||
|
¥{{ priceInt(item.price) }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex margin-top-sm">
|
||||||
|
<view>
|
||||||
|
<u-avatar v-for="(ite,ind) in item.avatar" :key='ind' v-if="ind < 3" class="head" size="44" :src="ite"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="text-gray number">{{item.courseCount}}人已观看</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 空数据 -->
|
||||||
|
<empty v-if="!courseList.length" title="暂无资源"></empty>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '@/components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
userId: '',
|
||||||
|
courseList: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.userId = uni.getStorageSync('userId')
|
||||||
|
this.getCourseList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 我的资源列表
|
||||||
|
getCourseList() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
let data = {
|
||||||
|
userId: this.userId,
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit,
|
||||||
|
}
|
||||||
|
this.$u.api.selectCourse(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
res.data.list.forEach(ret => {
|
||||||
|
if (ret.avatar) {
|
||||||
|
ret.avatar = ret.avatar.split(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.courseList = res.data.list
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.courseList = [...this.courseList, ...res.data.list]
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 跳转资源详情
|
||||||
|
goCourse(e) {
|
||||||
|
console.log(e)
|
||||||
|
let userId = uni.getStorageSync('userId')
|
||||||
|
if (userId) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/course/courseDet?id=' + e
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/login/login"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
this.page = this.page + 1;
|
||||||
|
this.getCourseList();
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
this.courseList = []
|
||||||
|
this.getCourseList();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 价格小数
|
||||||
|
priceDecimal() {
|
||||||
|
return val => {
|
||||||
|
if (val !== parseInt(val)) return val.slice(-2);
|
||||||
|
else return '00';
|
||||||
|
};
|
||||||
|
},
|
||||||
|
// 价格整数
|
||||||
|
priceInt() {
|
||||||
|
return val => {
|
||||||
|
// if (val !== parseInt(val)) return val.split('.')[0];
|
||||||
|
// else return val;
|
||||||
|
return val
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.btn {
|
||||||
|
width: 150upx;
|
||||||
|
height: 60upx;
|
||||||
|
background: #5074FF;
|
||||||
|
border-radius: 30upx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order {
|
||||||
|
width: 700rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin: 20rpx auto;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.store {
|
||||||
|
margin: 0 10rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
color: $u-type-warning-dark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 280rpx;
|
||||||
|
height: 240rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
.title {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttom {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #E6E6E6;
|
||||||
|
|
||||||
|
.price {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #FF3838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.number {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #999999;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.head1 {
|
||||||
|
position: relative;
|
||||||
|
left: -5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head2 {
|
||||||
|
position: relative;
|
||||||
|
left: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.number {
|
||||||
|
line-height: 50rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.total-price {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
line-height: 52rpx;
|
||||||
|
width: 160rpx;
|
||||||
|
border-radius: 26rpx;
|
||||||
|
border: 2rpx solid $u-border-color;
|
||||||
|
font-size: 26rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: $u-type-info-dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
.evaluate {
|
||||||
|
color: $u-type-warning-dark;
|
||||||
|
border-color: $u-type-warning-dark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.centre {
|
||||||
|
text-align: center;
|
||||||
|
margin: 200rpx auto;
|
||||||
|
font-size: 32rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 360rpx;
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
margin: 0 auto 20rpx;
|
||||||
|
border: 1px dotted #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #5074FF;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 600rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
background: #5074FF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
注意:由于app环境下ios跟Android存在差异,故需要分别适配
|
||||||
|
detail.nvue文件默认为Android版本,打包则用这个
|
||||||
|
如果打ios包,请把detailIOS.nvue改名为detail.nvue,原来的detail.nvue改为其他名称打包即可
|
||||||
|
打安卓包同样操作即可
|
||||||
|
|
@ -0,0 +1,208 @@
|
||||||
|
<template>
|
||||||
|
<view class="">
|
||||||
|
<view class="feedback-title">
|
||||||
|
<text>问题和意见</text>
|
||||||
|
<text @tap="chooseMsg">快速键入</text>
|
||||||
|
</view>
|
||||||
|
<view class="feedback-body" style="background: #F5F5F5;">
|
||||||
|
<textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" />
|
||||||
|
</view>
|
||||||
|
<view class="feedback-title">
|
||||||
|
<text>QQ/邮箱</text>
|
||||||
|
</view>
|
||||||
|
<view class="feedback-body">
|
||||||
|
<input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<button style="" class="feedback-submit" @tap="send">提交</button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
|
||||||
|
stars: [1, 2, 3, 4, 5],
|
||||||
|
imageList: [],
|
||||||
|
sendDate: {
|
||||||
|
score: 5,
|
||||||
|
content: '',
|
||||||
|
contact: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let deviceInfo = {
|
||||||
|
appid: plus.runtime.appid,
|
||||||
|
imei: plus.device.imei, //设备标识
|
||||||
|
p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
|
||||||
|
md: plus.device.model, //设备型号
|
||||||
|
app_version: plus.runtime.version,
|
||||||
|
plus_version: plus.runtime.innerVersion, //基座版本号
|
||||||
|
os: plus.os.version,
|
||||||
|
net: '' + plus.networkinfo.getCurrentType()
|
||||||
|
};
|
||||||
|
this.sendDate = Object.assign(deviceInfo, this.sendDate);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
close(e) {
|
||||||
|
this.imageList.splice(e, 1);
|
||||||
|
},
|
||||||
|
chooseMsg() {
|
||||||
|
//快速输入
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: this.msgContents,
|
||||||
|
success: res => {
|
||||||
|
this.sendDate.content = this.msgContents[res.tapIndex];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
chooseImg() {
|
||||||
|
//选择图片
|
||||||
|
uni.chooseImage({
|
||||||
|
sourceType: ['camera', 'album'],
|
||||||
|
sizeType: 'compressed',
|
||||||
|
count: 8 - this.imageList.length,
|
||||||
|
success: res => {
|
||||||
|
this.imageList = this.imageList.concat(res.tempFilePaths);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
chooseStar(e) {
|
||||||
|
//点击评星
|
||||||
|
this.sendDate.score = e;
|
||||||
|
},
|
||||||
|
previewImage() {
|
||||||
|
//预览图片
|
||||||
|
uni.previewImage({
|
||||||
|
urls: this.imageList
|
||||||
|
});
|
||||||
|
},
|
||||||
|
send() {
|
||||||
|
//发送反馈
|
||||||
|
console.log(JSON.stringify(this.sendDate));
|
||||||
|
|
||||||
|
if (!this.sendDate.content) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '请输入反馈内容'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// if (this.$queue.getChatSearchKeys(this.sendDate.content)) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: "输入内容带有非法关键字请重新输入",
|
||||||
|
// mask: false,
|
||||||
|
// duration: 1500,
|
||||||
|
// icon: "none"
|
||||||
|
// });
|
||||||
|
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
if (!this.sendDate.contact) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '请填写QQ或邮箱'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// this.$queue.showLoading('加载中...');
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中...'
|
||||||
|
})
|
||||||
|
this.$u.post('/app/message/insertMessage', {
|
||||||
|
title: this.sendDate.contact,
|
||||||
|
content: JSON.stringify(this.sendDate),
|
||||||
|
state: 2
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '投诉成功'
|
||||||
|
});
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showModal({
|
||||||
|
showCancel: false,
|
||||||
|
title: '投诉失败',
|
||||||
|
content: res.msg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
@font-face {
|
||||||
|
font-family: uniicons;
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: #FFFFFF !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
view {
|
||||||
|
font-size: 28upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*问题反馈*/
|
||||||
|
.feedback-title {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20upx;
|
||||||
|
color: #8f8f94;
|
||||||
|
font-size: 28upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-star-view.feedback-title {
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-body {
|
||||||
|
|
||||||
|
font-size: 32upx;
|
||||||
|
padding: 16upx;
|
||||||
|
margin: 16upx;
|
||||||
|
border-radius: 16upx;
|
||||||
|
background: #F5F5F5;
|
||||||
|
/* color: #FFF; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-textare {
|
||||||
|
height: 200upx;
|
||||||
|
font-size: 32upx;
|
||||||
|
line-height: 50upx;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
// padding: 20upx 30upx 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-input {
|
||||||
|
font-size: 32upx;
|
||||||
|
height: 60upx;
|
||||||
|
// padding: 15upx 20upx;
|
||||||
|
line-height: 60upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.feedback-submit {
|
||||||
|
background: #ff7581;
|
||||||
|
color: #ffffff;
|
||||||
|
margin: 20upx;
|
||||||
|
margin-top: 32upx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,243 @@
|
||||||
|
<!-- 帮助反馈页面 -->
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- <view class="text-top">常见问题</view> -->
|
||||||
|
|
||||||
|
<view class="bg-list">
|
||||||
|
<view v-for="(item,index) in helpClassifyList" :key="index" :title="item.helpClassifyName"
|
||||||
|
class="list-title padding-bottom">
|
||||||
|
<view class="flex align-center justify-between" @click.stop="openList(item)">
|
||||||
|
<view class="text-title">{{item.helpClassifyName}}</view>
|
||||||
|
<view @click.stop="openList(item)" >
|
||||||
|
<image src="../static/up.png" style="width: 21rpx;height: 15rpx;" v-if="item.parentId==0"></image>
|
||||||
|
<image src="../static/dowm.png" style="width: 21rpx;height: 15rpx;" v-else></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-for="(problemItem,problemIndex) in item.helpWordList" :key="problemIndex" class="list-question"
|
||||||
|
hover-class="hover" @click="onClick(problemItem)" v-if="item.parentId==0">
|
||||||
|
<view class="text-item">{{problemItem.helpWordTitle}}</view>
|
||||||
|
<view class="line" v-if="problemIndex!=item.helpWordList.length-1"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bg-box">
|
||||||
|
<view class="bg-white-box">
|
||||||
|
<image src="../static/icon-letter.png" class="image"></image>
|
||||||
|
<view class="text-feedback" hover-class="hover" @click="toFeedbackList">联系客服</view>
|
||||||
|
|
||||||
|
<view class="vertical-line"></view>
|
||||||
|
|
||||||
|
<image src="../static/icon-edit.png" class="image"></image>
|
||||||
|
<view class="text-feedback" hover-class="hover" @click="toFeedback">我要反馈</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
helpClassifyList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getlist()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openList(item) {
|
||||||
|
var oldhelpClassifyList=item
|
||||||
|
if(oldhelpClassifyList.parentId==1){
|
||||||
|
item.parentId=0
|
||||||
|
}else{
|
||||||
|
item.parentId=1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getlist() {
|
||||||
|
let data={
|
||||||
|
types:1
|
||||||
|
}
|
||||||
|
this.$u.api.help(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.helpClassifyList = res.data
|
||||||
|
for (var i = 0; i < this.helpClassifyList.length; i++) {
|
||||||
|
this.helpClassifyList[i].parentId = 1
|
||||||
|
}
|
||||||
|
// this.helpClassifyList.isTrue = false
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
onClick(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/helpDetail/helpDetail?title=' + item.helpWordTitle + '&helpWordId=' + item.helpWordId,
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
toFeedbackList() {
|
||||||
|
let kefu = uni.getStorageSync('kefu'); // 用户端联系方式 1 手机号 2企业微信
|
||||||
|
let kefuPhone = uni.getStorageSync('kefuPhone');
|
||||||
|
if (kefu == 1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/me/setting/kefu'
|
||||||
|
})
|
||||||
|
}else if (kefu == 3) {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: kefuPhone //仅为示例
|
||||||
|
});
|
||||||
|
} else if(kefu == 2){
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
let that = this
|
||||||
|
try {
|
||||||
|
wx.openCustomerServiceChat({
|
||||||
|
extInfo: {
|
||||||
|
url:uni.getStorageSync('kefuUrl')
|
||||||
|
},
|
||||||
|
corpId: uni.getStorageSync('kefuAppId'),
|
||||||
|
success(res) {},
|
||||||
|
fail(res) {
|
||||||
|
console.error(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error("catchcatch" + error)
|
||||||
|
uni.showToast({
|
||||||
|
title: '请更新至微信最新版本'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
let url =uni.getStorageSync('kefuUrl');
|
||||||
|
if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//#ifndef H5
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/webView?url=' + url
|
||||||
|
});
|
||||||
|
//#endif
|
||||||
|
//#ifdef H5
|
||||||
|
window.location.href = url;
|
||||||
|
//#endif
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
toFeedback() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/feedback/index',
|
||||||
|
success: res => {},
|
||||||
|
fail: () => {},
|
||||||
|
complete: () => {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.bg-box {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-list {
|
||||||
|
margin-bottom: 100rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
padding: 30rpx
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-white-box {
|
||||||
|
background-color: #F7F7F7;
|
||||||
|
margin: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
color: #000;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vertical-line {
|
||||||
|
height: 20rpx;
|
||||||
|
background-color: #cecece;
|
||||||
|
width: 2rpx;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
height: 1rpx;
|
||||||
|
background-color: #d3d3d3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.text-title {
|
||||||
|
color: #000;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-item {
|
||||||
|
color: #999999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
padding: 24rpx 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-title {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-question {
|
||||||
|
color: #000;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hover {
|
||||||
|
background-color: #ffffff;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-feedback {
|
||||||
|
padding: 20rpx;
|
||||||
|
/* color: #000000; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-top {
|
||||||
|
margin: 30rpx;
|
||||||
|
color: #000;
|
||||||
|
font-size: 34rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
|
||||||
|
<!-- <view class="helpTitle">{{ resultData.helpWordTitle }}</view> -->
|
||||||
|
<view class="helpCon" v-html="content"></view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
helpWordId: '',
|
||||||
|
resultData:[],
|
||||||
|
content:''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.helpWordId = options.helpWordId
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: options.title
|
||||||
|
});
|
||||||
|
if (this.helpWordId) {
|
||||||
|
this.getContent()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getContent() {
|
||||||
|
let data = {
|
||||||
|
helpWordId: this.helpWordId,
|
||||||
|
}
|
||||||
|
this.$u.api.helpDet(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.resultData = res.data
|
||||||
|
this.content = res.data.helpWordContent.replace(new RegExp("img","g"),'img style="width:100%;height:auto;"')
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.helpTitle {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 50rpx 30rpx 30rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.helpCon {
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin: 30rpx 30rpx 50rpx;
|
||||||
|
color: #000;
|
||||||
|
line-height: 2em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
<!-- 我的积分 -->
|
||||||
|
<template>
|
||||||
|
<view class="">
|
||||||
|
<view class="margin radius" style="background: url(@/me/static/integral/bg.png) 100% no-repeat;position: relative;">
|
||||||
|
<image src="@/me/static/integral/bg.png" style="width: 100%;height: 220rpx;"></image>
|
||||||
|
<view class="padding" style="position: absolute;top: 0;width: 640rpx;">
|
||||||
|
<view class="text-19">当前积分</view>
|
||||||
|
<view class="flex justify-between margin-top">
|
||||||
|
<view class="text-bold" style="font-size: 34px;">{{integralNum}}</view>
|
||||||
|
<view class="" style="position: relative;overflow: hidden;width: 90px;">
|
||||||
|
<!-- <view style="position: absolute;bottom:0;">
|
||||||
|
<view class="flex">
|
||||||
|
<u-image src="@/me/static/integral/integrate.png" width="43rpx" height="37rpx" style="width: 43rpx;height: 37rpx;"></u-image>
|
||||||
|
<view class="margin-left-sm">积分明细</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-gap height="30" bg-color="#F7F7F7"></u-gap>
|
||||||
|
<view class="margin">
|
||||||
|
<view class="flex justify-between u-border-bottom padding-tb" v-for="(item,index) in integralList" :key="index" >
|
||||||
|
<view class="u-font-16 text-bold">{{item.content}}</view>
|
||||||
|
<view class="flex justify-between" style="width: 120rpx;border: 2rpx solid #FFA800;background: rgba(255, 247, 226, 0.5);border-radius: 36rpx;height: 40rpx;">
|
||||||
|
<u-image src="@/me/static/integral/jinbi.png" width="36rpx" height="36rpx"></u-image>
|
||||||
|
<view class="margin-right-sm" style="line-height: 36rpx;">+2</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
integralList: [],
|
||||||
|
integralNum: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getIntegral()
|
||||||
|
this.getIntegralDet()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getIntegral() {
|
||||||
|
this.$u.api.integral().then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.integralNum = res.data.integralNum
|
||||||
|
}else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getIntegralDet() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$u.api.integralDet(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.integralList = res.data.records
|
||||||
|
}else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,168 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="bg-white padding">
|
||||||
|
<view class="box" style="">
|
||||||
|
<view class="text-19">总资产(元)</view>
|
||||||
|
<view class="text-bold padding-tb"><text style="font-size: 68rpx;">{{inviterRecord}}</text>元</view>
|
||||||
|
<!-- <view>累计提现:325.05元</view> -->
|
||||||
|
</view>
|
||||||
|
<view class="padding-top flex align-center justify-between">
|
||||||
|
<view>
|
||||||
|
<view class="text-19">总资产(元)</view>
|
||||||
|
<view class="text-bold "><text style="font-size: 48rpx;">{{inviterRecord}}</text></view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="getOut">提现</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="margin-top padding bg-white radius">
|
||||||
|
<view class="flex align-center">
|
||||||
|
<view class="linh"></view>
|
||||||
|
<view class="u-font-16 text-bold " style="color: #333333;" >账单明细</view>
|
||||||
|
</view>
|
||||||
|
<view style="text-align: left">
|
||||||
|
<view v-for="(item, index) in userList" :key="index" class="item">
|
||||||
|
<view>
|
||||||
|
<view style="color: #333333;font-weight: bold;">{{item.title}}</view>
|
||||||
|
<view class="margin-top-sm" style="color: #999999;">{{item.createTime}}</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text v-if="item.type==1" style="color: #333333;font-size:34upx;font-weight: 600"> + ¥{{item.money}}</text>
|
||||||
|
<text v-else style="color: #333333;font-size: 34upx;font-weight: 600"> - ¥{{item.money}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="userList.length===0" style="text-align: center;margin-top: 60px">暂无记录</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
userList: [],
|
||||||
|
inviterRecord: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getData()
|
||||||
|
this.getInviter()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getInviter()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getData() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$u.api.queryInviter(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.inviterRecord = res.data.inviteMoney.money
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
uni.removeStorageSync('token')
|
||||||
|
uni.removeStorageSync('userName')
|
||||||
|
uni.removeStorageSync('openId')
|
||||||
|
uni.removeStorageSync('avatar')
|
||||||
|
uni.removeStorageSync('phone')
|
||||||
|
uni.removeStorageSync('invitationCode')
|
||||||
|
uni.removeStorageSync('userId')
|
||||||
|
uni.removeStorageSync('zhiFuBao')
|
||||||
|
uni.removeStorageSync('zhiFuBaoName')
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getInviter() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$u.api.moneyList(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if(this.page == 1) {
|
||||||
|
this.userList = res.data.records
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.userList = [...this.userList, ...res.data.records]
|
||||||
|
}else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getOut() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/invite/cashDetail'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
this.page = this.page + 1;
|
||||||
|
this.getInviter()
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
// this.userList = []
|
||||||
|
this.getInviter()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.box{
|
||||||
|
background: linear-gradient(90deg, #90A7FF 0%, #5074FF 100%);
|
||||||
|
border-radius: 16rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 50rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
background: #5074FF;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32rpx;
|
||||||
|
width: 160rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 70rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
.linh{
|
||||||
|
width:8rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
background: #2474FF;
|
||||||
|
margin-right: 15rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.item {
|
||||||
|
/* background: white; */
|
||||||
|
/* padding: 32rpx; */
|
||||||
|
margin: 32rpx 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
/* box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1); */
|
||||||
|
/* border-radius: 16upx; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,373 @@
|
||||||
|
<template>
|
||||||
|
<view class="cash">
|
||||||
|
<view
|
||||||
|
style="background-color: #ff7581;height: 400upx;border-bottom-right-radius: 40upx;border-bottom-left-radius: 40upx;">
|
||||||
|
<view style="font-size: 32upx;color: #FFFFFF;padding-top: 100upx;">可提现总额</view>
|
||||||
|
<view style="font-size: 40upx;color: #FFFFFF;padding-top: 20upx;">¥ {{mayMoney}}</view>
|
||||||
|
|
||||||
|
<view
|
||||||
|
style="width: 90%;height: max-content;margin-left: 40upx;background-color: #FFFFFF;box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;margin-top: 50upx;border-radius: 20upx;">
|
||||||
|
<view style="display: flex;flex-direction: row;padding: 20upx;">
|
||||||
|
<view style="font-size: 32upx;color: #333333;">提现金额 <text style="font-size: 28upx;color: #ff7581;"
|
||||||
|
v-if="shouxufei">(注:提现手续费为{{shouxufei * 100}}%)</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="display: flex;flex-direction: row;padding: 20upx;">
|
||||||
|
<view style="font-size: 40upx;color: #333333;">¥</view>
|
||||||
|
<input type="number" v-model="money" placeholder="请输入金额"
|
||||||
|
style="font-size: 40upx;color: #333333;text-align: left;margin-left: 10upx;width: 100%;" />
|
||||||
|
</view>
|
||||||
|
<view style="background: #E6E6E6;width: 100%;height: 1upx;"></view>
|
||||||
|
|
||||||
|
<view style="display: flex;flex-direction: row;flex-wrap: wrap;">
|
||||||
|
<view style="display: flex;flex-direction: row;" v-for="(item, index) in moneyList" :key="index">
|
||||||
|
<view>
|
||||||
|
<view style="padding: 20upx;" @click="getOut1(item.money)">
|
||||||
|
<view
|
||||||
|
style="padding-top: 40upx;width: 180upx; height: 120upx;background-color: #FFFFFF;border:1px solid #ff7581;border-radius: 10upx;">
|
||||||
|
{{ item.money }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view @click="getOut"
|
||||||
|
style="margin: 32upx;font-size: 18px;background: #ff7581;color: white;border-radius: 10px;height: 40px;line-height: 40px">
|
||||||
|
提现
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="display: flex;width: 100%;justify-content: center;">
|
||||||
|
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;width: 33%;" @click="goZhifuBao">提现账号
|
||||||
|
</view>
|
||||||
|
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;width: 33%;" @click="goqianbao">钱包明细
|
||||||
|
</view>
|
||||||
|
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;width: 33%;" @click="gojilu">提现记录
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
money: '',
|
||||||
|
mayMoney: '0',
|
||||||
|
shouxufei: '',
|
||||||
|
moneyList: [{
|
||||||
|
money: '10'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
money: '20'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
money: '50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
money: '100'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
money: '200'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
money: '500'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
value: 0,
|
||||||
|
min: '',
|
||||||
|
token: '',
|
||||||
|
userId: '',
|
||||||
|
zhifubao: '',
|
||||||
|
zhifubaoName: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getshouxufei();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.token = uni.getStorageSync('token')
|
||||||
|
this.userId = uni.getStorageSync('userId')
|
||||||
|
this.zhifubao = uni.getStorageSync('zhiFuBao')
|
||||||
|
this.zhifubaoName = uni.getStorageSync('zhiFuBaoName')
|
||||||
|
|
||||||
|
|
||||||
|
this.getcashMoney()
|
||||||
|
|
||||||
|
},
|
||||||
|
onNavigationBarButtonTap() {
|
||||||
|
// this.list();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取收取费
|
||||||
|
getshouxufei() {
|
||||||
|
this.$u.get('app/common/type/152').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data && res.data.value) {
|
||||||
|
this.shouxufei = res.data.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$u.get('app/common/type/112').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data && res.data.value) {
|
||||||
|
this.cashMoney = res.data.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
// 可提现金额
|
||||||
|
getcashMoney() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$u.api.queryInviter(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.mayMoney = res.data.inviteMoney.money
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提现记录
|
||||||
|
gojilu() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/invite/cashList'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//钱包明细
|
||||||
|
goqianbao() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/invite/moneyList'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
list() {
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: '/me/invite/cashList'
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
goZhifuBao() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/invite/zhifubao'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getMoney() {
|
||||||
|
let that = this;
|
||||||
|
let token = that.token
|
||||||
|
let userId = that.userId
|
||||||
|
if (token) {
|
||||||
|
//this.$queue.showLoading("加载中...");
|
||||||
|
//可以提现金额查询预估收入查询
|
||||||
|
let data = {
|
||||||
|
money: that.money
|
||||||
|
}
|
||||||
|
this.$u.api.cashMoney(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '提现申请成功,预计三个工作日到账',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
that.money = ''
|
||||||
|
setTimeout(function() {
|
||||||
|
that.getcashMoney()
|
||||||
|
}, 1500)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//校验用户输入金额
|
||||||
|
checkMobile(money) {
|
||||||
|
return RegExp(/^1[34578]\d{9}$/).test(money);
|
||||||
|
},
|
||||||
|
getOut() {
|
||||||
|
let that = this;
|
||||||
|
let token = that.token
|
||||||
|
let userId = that.userId
|
||||||
|
console.log(token)
|
||||||
|
let cashMoney = that.cashMoney;
|
||||||
|
|
||||||
|
if (token) {
|
||||||
|
if (that.zhifubao && that.zhifubaoName) {
|
||||||
|
if (!/^\d+$/.test(that.money)) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let shouxufei = parseFloat(that.money * that.shouxufei).toFixed(2);
|
||||||
|
if (parseFloat(that.mayMoney).toFixed(1) >= parseFloat(that.money) + shouxufei * 1) {
|
||||||
|
if (parseFloat(that.money).toFixed(1) >= parseFloat(cashMoney)) {
|
||||||
|
if (that.shouxufei > 0) {
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: "提现申请提示",
|
||||||
|
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + that
|
||||||
|
.money + '元\n\n提现手续费:' + shouxufei +
|
||||||
|
'\n\n收款人账号:' + that.zhifubao + '',
|
||||||
|
success: (e) => {
|
||||||
|
if (e.confirm) {
|
||||||
|
// that.money = money
|
||||||
|
that.getMoney();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showModal({
|
||||||
|
title: "提现申请提示",
|
||||||
|
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + that
|
||||||
|
.money + '元\n\n收款人账号:' + that.zhifubao +
|
||||||
|
'',
|
||||||
|
success: (e) => {
|
||||||
|
if (e.confirm) {
|
||||||
|
// that.money = money
|
||||||
|
that.getMoney();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: "提现金额必须大于或等于" + cashMoney + "元才可提现"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: "您的余额不足"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/me/invite/zhifubao"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getOut1(money) {
|
||||||
|
let that = this;
|
||||||
|
let token = that.token
|
||||||
|
let userId = that.userId
|
||||||
|
if (token) {
|
||||||
|
if (that.zhifubao && that.zhifubaoName) {
|
||||||
|
if (parseFloat(this.mayMoney).toFixed(1) >= parseFloat(money)) {
|
||||||
|
if (parseFloat(money).toFixed(1) >= 10) {
|
||||||
|
if (this.shouxufei > 0) {
|
||||||
|
let shouxufei = parseFloat(money * this.shouxufei).toFixed(2);
|
||||||
|
uni.showModal({
|
||||||
|
title: '提现申请提示',
|
||||||
|
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + money +
|
||||||
|
'元\n\n提现手续费:' + shouxufei +
|
||||||
|
'\n\n收款人账号:' + that.zhifubao + '',
|
||||||
|
confirmColor: '#ff7581',
|
||||||
|
success: e => {
|
||||||
|
if (e.confirm) {
|
||||||
|
this.money = money
|
||||||
|
that.getMoney();
|
||||||
|
// uni.showToast({
|
||||||
|
// icon: 'none',
|
||||||
|
// title: '提现成功'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提现申请提示',
|
||||||
|
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n提现金额:' + money +
|
||||||
|
'元\n\n收款人账号:' + that.zhifubao +
|
||||||
|
'',
|
||||||
|
success: e => {
|
||||||
|
if (e.confirm) {
|
||||||
|
this.money = money
|
||||||
|
that.getMoney();
|
||||||
|
// uni.showToast({
|
||||||
|
// icon: 'none',
|
||||||
|
// title: '提现成功'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '提现金额必须大于或等于10元才可提现'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '您的余额不足'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/invite/zhifubao'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
// @import '../../static/css/index.css';
|
||||||
|
|
||||||
|
.view2-view-text {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #000000;
|
||||||
|
margin-left: 20upx;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view2-view-image-right {
|
||||||
|
width: 18upx;
|
||||||
|
height: 30upx;
|
||||||
|
margin-left: 50upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cash {
|
||||||
|
text-align: center;
|
||||||
|
background: white;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.cash-top {
|
||||||
|
padding: 32upx 32upx 50upx 32upx;
|
||||||
|
/* border-bottom: 1px solid gainsboro; */
|
||||||
|
background: #5074FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leiji {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #ffffff;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
<template>
|
||||||
|
<view style="text-align: left">
|
||||||
|
<view v-if="list.length" v-for="(item, index) in list" :key="index" class="item">
|
||||||
|
<view>
|
||||||
|
<view style="margin-bottom: 8upx;text-align: right;">
|
||||||
|
<text style="margin-bottom: 8upx;color: green" v-if="item.state==1"> 提现成功</text>
|
||||||
|
<text style="margin-bottom: 8upx;color: green" v-if="item.state==0"> 提现中</text>
|
||||||
|
<text style="margin-bottom: 8upx;color: #FD6416" v-if="item.state==-1"> 提现失败</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="color: #999999;font-size: 28upx;">
|
||||||
|
<view style="margin-bottom: 8upx"> 收款人账号:{{item.zhifubao}}</view>
|
||||||
|
<view style="margin-bottom: 8upx"> 收款人姓名:{{item.zhifubaoName}}</view>
|
||||||
|
<view style="margin-bottom: 8upx"> 发起时间:{{item.createAt}}</view>
|
||||||
|
<view style="margin-bottom: 8upx" v-if="item.state==1">成功时间 {{item.outAt}}</view>
|
||||||
|
<view style="margin-bottom: 8upx;color: #FD6416" v-if="item.state==-1">{{item.refund}}</view>
|
||||||
|
|
||||||
|
<view style="margin-bottom: 8upx;text-align: right;">
|
||||||
|
<!-- 提现金额: -->
|
||||||
|
<text style="color: #FD6416;font-size: 32upx;font-weight: 600"> ¥{{item.money}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="page-box" v-if="!list.length">
|
||||||
|
<view class="centre">
|
||||||
|
<image src="../../static/images/learn/none.png" mode=""></image>
|
||||||
|
<view class="tips">
|
||||||
|
暂无记录
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
limit: 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad: function(e) {
|
||||||
|
this.getMoney();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getMoney() {
|
||||||
|
let that = this;
|
||||||
|
let token = uni.getStorageSync('token')
|
||||||
|
|
||||||
|
if (token) {
|
||||||
|
//可以提现金额查询预估收入查询
|
||||||
|
let data = {
|
||||||
|
page: that.page,
|
||||||
|
limit: that.limit
|
||||||
|
}
|
||||||
|
that.$u.api.selectPay(data).then(res => {
|
||||||
|
if (that.page == 1) {
|
||||||
|
that.list = res.data.list
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.list = res.data.list;
|
||||||
|
})
|
||||||
|
// this.$Request.getT("/cash/selectCashOutList/" + userId).then(res => {
|
||||||
|
// if (res.status === 0 && res.data) {
|
||||||
|
// that.list = res.data;
|
||||||
|
// }
|
||||||
|
// uni.hideLoading();
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
this.page = this.page + 1;
|
||||||
|
this.getMoney();
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
// that.list = []
|
||||||
|
this.getMoney();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
/* @import "../../static/css/index.css"; */
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
background: white;
|
||||||
|
padding: 32rpx;
|
||||||
|
margin: 32rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: 16upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centre {
|
||||||
|
text-align: center;
|
||||||
|
margin: 200rpx auto;
|
||||||
|
font-size: 32rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 360rpx;
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
margin: 0 auto 20rpx;
|
||||||
|
// border: 1px dotted #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 600rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
background: #ff7581;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,768 @@
|
||||||
|
<!-- 我的邀请 -->
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<u-image src="/me/static/invite/juxing.png" alt="" width="100%" mode="widthFix"></u-image>
|
||||||
|
<view class="padding" style="position: relative;height: 360rpx;">
|
||||||
|
<u-image src="@/me/static/invite/fenxiang.png" alt="" width="100%" height="100%"></u-image>
|
||||||
|
<view class="text-center padding-top yaoqing">
|
||||||
|
<view class="margin-top-xl margin-bottom-sm padding-top-sm text-xxl text-red text-bold">
|
||||||
|
{{invitationCode}}
|
||||||
|
</view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<u-button @tap="sharurl" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||||
|
:ripple="true">一键分享</u-button>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifdef APP -->
|
||||||
|
<u-button @tap="sharurl" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||||
|
:ripple="true">一键分享</u-button>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifdef MP-TOUTIAO || MP-KUAISHOU -->
|
||||||
|
<u-button open-type="share" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||||
|
:ripple="true">一键分享</u-button>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<u-button open-type="share" :custom-style="customStyle" :hair-line="false" shape="circle" size="mini"
|
||||||
|
:ripple="true">一键分享</u-button>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-KUAISHOU -->
|
||||||
|
<u-button style="margin-left: 50rpx;" @click.stop="onSaveImg()" :custom-style="customStyle"
|
||||||
|
:hair-line="false" shape="circle" size="mini" :ripple="true">保存海报</u-button>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="margin padding bg-white radius" v-if="inviterList.length">
|
||||||
|
<view class="flex justify-between" style="line-height: 80rpx;" v-for="(item, index) in inviterList"
|
||||||
|
:key='index'>
|
||||||
|
<view class="flex">
|
||||||
|
<!-- <u-image :src="item.avatar == null?avatar:item.avatar" width="40px" mode="widthFix"></u-image> -->
|
||||||
|
<image src="../static/invite/5.png" style="width: 80rpx;" mode="widthFix"></image>
|
||||||
|
<text class="margin-left-sm">{{item.userName}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="width: 160rpx;">
|
||||||
|
<text>获得</text>
|
||||||
|
<text class="margin-left-xs text-red">{{item.money}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="padding" style="position: relative;height: 160px;">
|
||||||
|
<u-image src="@/me/static/invite/yaoqing.png" alt="" width="100%" height="100%"></u-image>
|
||||||
|
<view class="text-center padding-top flex justify-center flex-direction zhanji">
|
||||||
|
<view class="flex justify-around margin-top-sm" @click="goNav('/me/invite/inviteDet')">
|
||||||
|
<view>
|
||||||
|
<view class="margin-bottom-sm">已邀请</view>
|
||||||
|
<view class="text-red"><text class="text-bold u-font-18">{{inviterNumber}}</text>人</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="margin-bottom-sm">累计收益</view>
|
||||||
|
<view class="text-red"><text class="text-bold u-font-18">{{cumulativeRevenue}}</text>元</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="margin-bottom-sm">已提现</view>
|
||||||
|
<view class="text-red">¥<text class="text-bold u-font-18">{{withdrawn}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="padding" style="position: relative;height: 250rpx;">
|
||||||
|
<u-image src="@/me/static/invite/jiqiao.png" alt="" width="100%" height="100%"></u-image>
|
||||||
|
<view class="padding-top jiqiao" style="">
|
||||||
|
<view class="padding-top-xl padding-lr padding-bottom" style="line-height: 48rpx;">
|
||||||
|
<block v-if="price2==0">
|
||||||
|
<view class="flex padding-sm" style="background-color: #ffffff;">
|
||||||
|
<text class="cuIcon-title text-yellow"></text>
|
||||||
|
<view>邀请好友可得开通会员及消费金额 {{price}}%的佣金奖励</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view class="flex padding-sm" style="background-color: #ffffff;">
|
||||||
|
<text class="cuIcon-title text-yellow"></text>
|
||||||
|
<view>可得一级好友开通会员及消费金额 {{price}}%的佣金奖励</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex padding-sm" style="background-color: #ffffff;">
|
||||||
|
<text class="cuIcon-title text-yellow"></text>
|
||||||
|
<view>可得二级好友开通会员及消费金额 {{price2}}%的佣金奖励</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<tki-qrcode ref="qrcode" :val="erweima" :size="200" background="#fff" foreground="#000" pdground="#000"
|
||||||
|
:onval="true" :loadMake="true" @result="qrR" :show="false"></tki-qrcode>
|
||||||
|
<view class="cu-modal" :class="modalName == 'Image' ? 'show' : ''" @tap="hideModal">
|
||||||
|
<view class="cu-dialog" v-if="bgImg && erweimapath && haibaoShow" @tap="hideModal">
|
||||||
|
<view class="bg-img">
|
||||||
|
<wm-poster @success="posterSuccess" @successH5="successH5" :imgSrc="bgImg"
|
||||||
|
:Referrer="'我的邀请码:'+invitationCode" :QrSrc="erweimapath" :LineType="false"></wm-poster>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let settingWritePhotosAlbum = false;
|
||||||
|
import tkiQrcode from '../../components/tki-qrcode/tki-qrcode.vue';
|
||||||
|
import wmPoster from '../components/wm-poster/wm-posterorders.vue';
|
||||||
|
import config from '../../common/config.js'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
tkiQrcode,
|
||||||
|
wmPoster
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
erweimapath: '',
|
||||||
|
poster: {},
|
||||||
|
qrShow: false,
|
||||||
|
haibaoImg: null,
|
||||||
|
haibaoShow: false,
|
||||||
|
modalName: '',
|
||||||
|
canvasId: 'default_PosterCanvasId',
|
||||||
|
avatar: '../../static/images/logo.png',
|
||||||
|
customStyle: {
|
||||||
|
background: '#FFE0E0',
|
||||||
|
border: '0',
|
||||||
|
color: 'rgb(254,30,35)',
|
||||||
|
fontSize: '12px',
|
||||||
|
fontWeight: '500',
|
||||||
|
padding: '15px 20px',
|
||||||
|
},
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
inviterName: '', //邀请码
|
||||||
|
cumulativeRevenue: '', //累计收益
|
||||||
|
inviterNumber: '', //邀请人数
|
||||||
|
withdrawn: '', //已提现
|
||||||
|
inviterList: [],
|
||||||
|
erweima: '',
|
||||||
|
bgImg: '',
|
||||||
|
tuiguang: '',
|
||||||
|
invitationCode: 0,
|
||||||
|
price: 0,
|
||||||
|
price2: 0,
|
||||||
|
h5SaveImg: '',
|
||||||
|
modalName: '',
|
||||||
|
haibaoImgH5: '',
|
||||||
|
qdCode: '', //渠道码
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
return {
|
||||||
|
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||||
|
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||||
|
title: this.tuiguang,
|
||||||
|
imageUrl: this.bgImg
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareTimeline(res) {
|
||||||
|
return {
|
||||||
|
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
|
||||||
|
.qdCode, //这是为了传参 onload(data){let id=data.id;}
|
||||||
|
title: this.tuiguang,
|
||||||
|
imageUrl: this.bgImg
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getInviter()
|
||||||
|
this.queryInviter()
|
||||||
|
|
||||||
|
this.invitationCode = uni.getStorageSync('invitationCode')
|
||||||
|
this.getUserInfoBl()
|
||||||
|
this.getBgImg()
|
||||||
|
if (uni.getStorageSync('qdCode')) {
|
||||||
|
this.qdCode = uni.getStorageSync('qdCode')
|
||||||
|
}
|
||||||
|
// h5携带邀请码去首页
|
||||||
|
// #ifdef H5
|
||||||
|
this.erweima = config.APIHOST2 + '/?invitation=' + this
|
||||||
|
.invitationCode + '&qdCode=' + this.qdCode
|
||||||
|
// #endif
|
||||||
|
// app直接去app注册页面
|
||||||
|
// #ifdef APP
|
||||||
|
this.erweima = config.APIHOST2 + '/pages/login/registerApp/?invitation=' + this
|
||||||
|
.invitationCode + '&qdCode=' + this.qdCode
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.getWxEq()
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
this.getTouTiao()
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取用户分销比例
|
||||||
|
getUserInfoBl() {
|
||||||
|
this.$Request.getT('/app/user/selectUserById').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
//一级分销
|
||||||
|
if (res.data.rate) {
|
||||||
|
this.price = (Number(res.data.rate) * 100).toFixed(0)
|
||||||
|
} else {
|
||||||
|
this.price = 0
|
||||||
|
}
|
||||||
|
//二级分销
|
||||||
|
if (res.data.twoRate) {
|
||||||
|
this.price2 = (Number(res.data.twoRate) * 100).toFixed(0)
|
||||||
|
} else {
|
||||||
|
this.price2 = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取头条二维码
|
||||||
|
getTouTiao() {
|
||||||
|
let that = this
|
||||||
|
uni.downloadFile({
|
||||||
|
url: config.APIHOST +
|
||||||
|
'/app/invite/dyCreateQr?invitationCode=' + that
|
||||||
|
.invitationCode + ',' + that.qdCode + '&page=/pages/index/index',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
that.erweimapath = res.tempFilePath
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取微信二维码
|
||||||
|
getWxEq() {
|
||||||
|
let that = this
|
||||||
|
uni.downloadFile({
|
||||||
|
url: config.APIHOST +
|
||||||
|
'/app/invite/mpCreateQr?invitationCode=' + that
|
||||||
|
.invitationCode + ',' + that.qdCode,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
that.erweimapath = res.tempFilePath
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
sharurl() {
|
||||||
|
let that = this;
|
||||||
|
uni.showModal({
|
||||||
|
title: '链接推广',
|
||||||
|
content: this.tuiguang + this.erweima,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '关闭',
|
||||||
|
confirmText: '一键复制',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: this.tuiguang + this.erweima,
|
||||||
|
success: function() {
|
||||||
|
console.log('success');
|
||||||
|
uni.showToast({
|
||||||
|
title: '复制成功',
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
posterSuccess(haibaoImg) {
|
||||||
|
this.haibaoImg = haibaoImg;
|
||||||
|
this.modalName = 'Image';
|
||||||
|
uni.hideLoading();
|
||||||
|
},
|
||||||
|
successH5(haibaoImg) {
|
||||||
|
this.haibaoImgH5 = haibaoImg
|
||||||
|
uni.previewImage({
|
||||||
|
urls: [haibaoImg],
|
||||||
|
current: 1,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showModal() {
|
||||||
|
// #ifndef H5
|
||||||
|
if (!this.haibaoImg) {
|
||||||
|
this.haibaoShow = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.modalName = 'Image';
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
//微信浏览器
|
||||||
|
if (!this.haibaoImg) {
|
||||||
|
this.haibaoShow = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.modalName = 'Image';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!this.haibaoImgH5) {
|
||||||
|
this.haibaoShow = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.previewImage({
|
||||||
|
urls: [this.haibaoImgH5],
|
||||||
|
current: 1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
hideModal() {
|
||||||
|
this.modalName = null;
|
||||||
|
},
|
||||||
|
qrR(path) {
|
||||||
|
this.erweimapath = path;
|
||||||
|
},
|
||||||
|
getInviter() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$u.api.inviter(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.inviterList = res.data.list
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
queryInviter() {
|
||||||
|
this.$u.api.queryInviter().then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.cumulativeRevenue = res.data.inviteMoney.moneySum //累计收益
|
||||||
|
this.inviterNumber = res.data.inviteCount //邀请人数
|
||||||
|
this.withdrawn = res.data.inviteMoney.cashOut //已提现
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
goNav(e) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: e
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//获取背景图
|
||||||
|
getBgImg() {
|
||||||
|
this.$u.get('app/banner/selectBannerList?classify=5').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.bgImg = res.data[0].imageUrl
|
||||||
|
this.tuiguang = res.data[0].describes
|
||||||
|
console.log(this.bgImg)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//生成h5海报
|
||||||
|
createH5Poster() {
|
||||||
|
let that = this;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
const ctx = uni.createCanvasContext('poster');
|
||||||
|
ctx.fillRect(0, 0, 375, 673);
|
||||||
|
ctx.setFillStyle("#FFF");
|
||||||
|
ctx.fillRect(0, 0, 375, 673);
|
||||||
|
let imgUrl = that.bgImg;
|
||||||
|
uni.downloadFile({
|
||||||
|
url: imgUrl,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res, '***************')
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: that.erweima,
|
||||||
|
success: (res2) => {
|
||||||
|
console.log(res2)
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
ctx.drawImage(res.tempFilePath, 0, 0, 375,
|
||||||
|
500);
|
||||||
|
// 长按识别二维码访问
|
||||||
|
let textTop = 0;
|
||||||
|
ctx.setFontSize(19);
|
||||||
|
ctx.setFillStyle('#333');
|
||||||
|
ctx.fillText("长按识别图中二维码", 17, textTop + 590);
|
||||||
|
// 二维码
|
||||||
|
ctx.drawImage(res2.tempFilePath, 238, textTop +
|
||||||
|
526, 120, 120);
|
||||||
|
ctx.draw(true, () => {
|
||||||
|
// canvas画布转成图片并返回图片地址
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: 'poster',
|
||||||
|
width: 375,
|
||||||
|
height: 673,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(
|
||||||
|
"海报制作成功!"
|
||||||
|
);
|
||||||
|
resolve(res
|
||||||
|
.tempFilePath
|
||||||
|
);
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni
|
||||||
|
.hideLoading();
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: com => {
|
||||||
|
console.log(com)
|
||||||
|
uni.showToast({
|
||||||
|
title: com,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
// that.yu.toast(err)
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//生成海报
|
||||||
|
createPoster() {
|
||||||
|
let that = this;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报生成中'
|
||||||
|
});
|
||||||
|
const ctx = uni.createCanvasContext('poster');
|
||||||
|
ctx.fillRect(0, 0, 375, 673);
|
||||||
|
ctx.setFillStyle("#FFF");
|
||||||
|
ctx.fillRect(0, 0, 375, 673);
|
||||||
|
let imgUrl = that.bgImg;
|
||||||
|
uni.downloadFile({
|
||||||
|
url: imgUrl,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res, '***************')
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: config.APIHOST +
|
||||||
|
'/app/invite/mpCreateQr?invitationCode=' + that
|
||||||
|
.invitationCode,
|
||||||
|
// url: 'https://jiaoyu.xianmxkj.com/sqx_fast/app/invite/mpCreateQr?invitationCode=' +
|
||||||
|
// that.invitationCode,
|
||||||
|
success: (res2) => {
|
||||||
|
console.log(res2)
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
ctx.drawImage(res.tempFilePath, 0, 0, 375,
|
||||||
|
500);
|
||||||
|
// 长按识别二维码访问
|
||||||
|
let textTop = 0;
|
||||||
|
ctx.setFontSize(19);
|
||||||
|
ctx.setFillStyle('#333');
|
||||||
|
ctx.fillText("长按识别图中二维码", 17, textTop + 590);
|
||||||
|
// 二维码
|
||||||
|
ctx.drawImage(res2.tempFilePath, 238, textTop +
|
||||||
|
526, 120, 120);
|
||||||
|
ctx.draw(true, () => {
|
||||||
|
// canvas画布转成图片并返回图片地址
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: 'poster',
|
||||||
|
width: 375,
|
||||||
|
height: 673,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(
|
||||||
|
"海报制作成功!"
|
||||||
|
);
|
||||||
|
resolve(res
|
||||||
|
.tempFilePath
|
||||||
|
);
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni
|
||||||
|
.hideLoading();
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: com => {
|
||||||
|
console.log(com)
|
||||||
|
uni.showToast({
|
||||||
|
title: com,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
// that.yu.toast(err)
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '海报制作失败,图片下载失败',
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 保存图片
|
||||||
|
async onSaveImg() {
|
||||||
|
this.showModal();
|
||||||
|
return
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
this.showModal();
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
let imgUrl = await this.createPoster();
|
||||||
|
uni.showLoading({
|
||||||
|
title: '海报下载中'
|
||||||
|
});
|
||||||
|
if (settingWritePhotosAlbum) {
|
||||||
|
uni.getSetting({
|
||||||
|
success: res => {
|
||||||
|
if (res.authSetting['scope.writePhotosAlbum']) {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: imgUrl,
|
||||||
|
success: () => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存成功'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先在设置页面打开“保存相册”使用权限',
|
||||||
|
confirmText: '去设置',
|
||||||
|
cancelText: '算了',
|
||||||
|
success: data => {
|
||||||
|
if (data.confirm) {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.openSetting();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
settingWritePhotosAlbum = true;
|
||||||
|
uni.authorize({
|
||||||
|
scope: 'scope.writePhotosAlbum',
|
||||||
|
success: () => {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: imgUrl,
|
||||||
|
success: () => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存成功'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1110;
|
||||||
|
opacity: 0;
|
||||||
|
outline: 0;
|
||||||
|
text-align: center;
|
||||||
|
-ms-transform: scale(1.185);
|
||||||
|
transform: scale(1.185);
|
||||||
|
backface-visibility: hidden;
|
||||||
|
perspective: 2000upx;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
transition: all 0.3s ease-in-out 0s;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal.show {
|
||||||
|
opacity: 1;
|
||||||
|
transition-duration: 0.3s;
|
||||||
|
-ms-transform: scale(1);
|
||||||
|
transform: scale(1);
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #E0EFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poster_canvas {
|
||||||
|
width: 750upx;
|
||||||
|
height: 1334upx;
|
||||||
|
position: fixed;
|
||||||
|
top: -10000upx;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.yaoqing {
|
||||||
|
width: 100%;
|
||||||
|
height: 136px;
|
||||||
|
position: absolute;
|
||||||
|
margin: auto;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
/* background-image: url('@/me/static/invite/fenxiang.png'); */
|
||||||
|
/* background-size: 100%; */
|
||||||
|
/* background-repeat: no-repeat; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.zhanji {
|
||||||
|
width: 100%;
|
||||||
|
height: 119px;
|
||||||
|
position: absolute;
|
||||||
|
margin: auto;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
/* background-image: url('@/me/static/invite/yaoqing.png'); */
|
||||||
|
/* background-size: 100%; */
|
||||||
|
/* background-repeat: no-repeat; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.jiqiao {
|
||||||
|
width: 100%;
|
||||||
|
height: 160rpx;
|
||||||
|
position: absolute;
|
||||||
|
margin: auto;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
/* background-image: url('@/me/static/invite/jiqiao.png');
|
||||||
|
background-size: 100%;
|
||||||
|
background-repeat: no-repeat; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,144 @@
|
||||||
|
<template>
|
||||||
|
<view style="padding-bottom: 50rpx;">
|
||||||
|
<view class="padding margin radius bg-white" style="">
|
||||||
|
<view class="text-19">当前收益</view>
|
||||||
|
<view class="flex justify-between margin-top">
|
||||||
|
<view class="text-bold text-black">¥<text style="font-size: 34px;">{{inviterRecord}}</text></view>
|
||||||
|
<view class="" style="position: relative;overflow: hidden;width: 90px;">
|
||||||
|
<view style="position: absolute;bottom:0;">
|
||||||
|
<!-- <view class="flex"> -->
|
||||||
|
<button @tap="getOut" class="cu-btn round">立即提现</button>
|
||||||
|
<!-- </view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="margin padding bg-white radius">
|
||||||
|
<view class="u-font-16 text-bold margin-bottom">邀请明细</view>
|
||||||
|
<!-- <view class="flex justify-between" style="line-height: 30px;" v-for="(item,index) in userList" >
|
||||||
|
<view class="flex" style="width: 300rpx;">
|
||||||
|
<u-image :src="item.avatar" width="30px" mode="widthFix"></u-image>
|
||||||
|
<view class="margin-left-sm userName_view">{{item.userName}}</view>
|
||||||
|
</view>
|
||||||
|
<view style="width: 120rpx;">邀请好友</view>
|
||||||
|
<view style="width: 120rpx;">
|
||||||
|
<text class="margin-left text-red">赚{{item.money}}</text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="flex justify-between align-center" style="margin-bottom: 40rpx;"
|
||||||
|
v-for="(item,index) in userList">
|
||||||
|
<view class="flex align-center">
|
||||||
|
<image :src="item.avatar?item.avatar:'../../static/images/logo.png'"
|
||||||
|
style="width: 80rpx;height:80rpx;border-radius: 50rpx;"></image>
|
||||||
|
<view class="margin-left-sm">
|
||||||
|
<view class="userName_view">{{item.userName}}</view>
|
||||||
|
<view class="text-cut" style="font-size: 24rpx;" v-if="item.userType && item.userType == 2">二级好友
|
||||||
|
</view>
|
||||||
|
<view class="text-cut" style="font-size: 24rpx;" v-else>一级好友
|
||||||
|
</view>
|
||||||
|
<!-- <u-image :src="item.avatar" width="30px" mode="widthFix"></u-image> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="margin-left flex-sub text-right">
|
||||||
|
<text class="margin-left text-red">赚{{item.money}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<empty v-if="userList.length == 0" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '../../components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page: 1,
|
||||||
|
limit: 50,
|
||||||
|
userList: [],
|
||||||
|
inviterRecord: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getData()
|
||||||
|
this.getInviter()
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
this.page = this.page + 1;
|
||||||
|
this.getInviter();
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
this.getData();
|
||||||
|
this.getInviter();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getData() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$u.api.queryInviter(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.inviterRecord = res.data.inviteMoney.money
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getInviter() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$u.api.inviter(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.userList = res.data.list
|
||||||
|
} else {
|
||||||
|
this.userList = [...this.userList, ...res.data.list]
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getOut() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/invite/cashDetail'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.cu-btn {
|
||||||
|
background: rgba(255, 117, 129, 0.2);
|
||||||
|
color: #ff7581;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userName_view {
|
||||||
|
width: 280rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-bottom: 4rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
<template>
|
||||||
|
<view style="text-align: left">
|
||||||
|
<view v-if="list.length" v-for="(item, index) in list" :key="index" class="item">
|
||||||
|
<view>
|
||||||
|
|
||||||
|
<view style="color: #000000;font-size: 28upx;">
|
||||||
|
<view style="margin-bottom: 8upx;"> 类型: {{item.title}}</view>
|
||||||
|
<view style="margin-bottom: 8upx"> 内容: {{item.content}}</view>
|
||||||
|
<view style="margin-bottom: 8upx"> 时间: {{item.createTime}}</view>
|
||||||
|
<view style="margin-bottom: 8upx;text-align: right;">
|
||||||
|
<!-- 提现金额: -->
|
||||||
|
<text v-if="item.type==2" style="color: #FD6416;font-size: 32upx;font-weight: 600"> - ¥{{item.money}}</text>
|
||||||
|
<text v-if="item.type==1" style="color: #FD6416;font-size: 32upx;font-weight: 600">+ ¥{{item.money}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="page-box" v-if="!list.length">
|
||||||
|
<view class="centre">
|
||||||
|
<image src="../../static/images/learn/none.png" mode=""></image>
|
||||||
|
<view class="tips">
|
||||||
|
暂无明细
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
limit: 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad: function(e) {
|
||||||
|
this.getMoney();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getMoney() {
|
||||||
|
let that = this;
|
||||||
|
let token = uni.getStorageSync('token')
|
||||||
|
|
||||||
|
if (token) {
|
||||||
|
let data = {
|
||||||
|
page : that.page,
|
||||||
|
limit : that.limit
|
||||||
|
}
|
||||||
|
that.$u.api.moneyDet(data).then(res => {
|
||||||
|
if(that.page == 1) {
|
||||||
|
that.list = res.data.records
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.list = [...that.list, ...res.data.records]
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
this.page = this.page + 1;
|
||||||
|
this.getMoney();
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
// that.list = []
|
||||||
|
this.getMoney();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
/* @import "../../static/css/index.css"; */
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
background: white;
|
||||||
|
padding: 32rpx;
|
||||||
|
margin: 32rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: 16upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centre {
|
||||||
|
text-align: center;
|
||||||
|
margin: 200rpx auto;
|
||||||
|
font-size: 32rpx;
|
||||||
|
image {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 360rpx;
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
margin: 0 auto 20rpx;
|
||||||
|
// border: 1px dotted #000000;
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #5074FF;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 600rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
background: #5074FF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,171 @@
|
||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<list-cell title="收款人姓名" type="text" placeholder="请输入支付宝收款人姓名" v-model="zhiFuBaoName"></list-cell>
|
||||||
|
|
||||||
|
<list-cell title="支付宝账号" type="text" placeholder="请输入要绑定的支付宝手机号" v-model="zhiFuBao"></list-cell>
|
||||||
|
|
||||||
|
|
||||||
|
<button :class="zhiFuBao&&zhiFuBaoName?'confirm-btn':'confirm-btn1'" @click="toLogin"
|
||||||
|
:disabled="logining">绑定账户</button>
|
||||||
|
<view style="padding: 32upx 64upx;font-size: 24upx;color: #999999;">提示:请正确填写收款人的支付宝账户和真实的收款人姓名,否则将无法正常收款</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import listCell from '@/me/components/com-input';
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
listCell
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
zhiFuBao: '',
|
||||||
|
zhiFuBaoName: '',
|
||||||
|
logining: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let userId = uni.getStorageSync('userId');
|
||||||
|
|
||||||
|
if (userId) {
|
||||||
|
this.$u.api.userinfo().then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data.zhiFuBao) {
|
||||||
|
this.zhiFuBao = res.data.zhiFuBao;
|
||||||
|
}
|
||||||
|
if (res.data.zhiFuBaoName) {
|
||||||
|
this.zhiFuBaoName = res.data.zhiFuBaoName;
|
||||||
|
}
|
||||||
|
// console.log(this.zhiFuBao )
|
||||||
|
// console.log(this.zhiFuBaoName )
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
inputChange(e) {
|
||||||
|
const key = e.currentTarget.dataset.key;
|
||||||
|
this[key] = e.detail.value;
|
||||||
|
},
|
||||||
|
navBack() {
|
||||||
|
uni.navigateBack();
|
||||||
|
},
|
||||||
|
|
||||||
|
toLogin() {
|
||||||
|
// console.log(this.zhiFuBao )
|
||||||
|
// console.log(this.zhiFuBaoName )
|
||||||
|
// const {
|
||||||
|
// zhiFuBao,
|
||||||
|
// zhiFuBaoName
|
||||||
|
// } = this;
|
||||||
|
let zhiFuBao = this.zhiFuBao
|
||||||
|
let zhiFuBaoName = this.zhiFuBaoName
|
||||||
|
console.log(zhiFuBao)
|
||||||
|
console.log(zhiFuBaoName)
|
||||||
|
if (!zhiFuBao) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请设置收款人姓名',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} else if (!zhiFuBaoName) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请设置收款人支付宝账号',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$u.post('app/user/updateUser?zhiFuBao=' + zhiFuBao + '&zhiFuBaoName=' + zhiFuBaoName).then(
|
||||||
|
res => {
|
||||||
|
// console.log(res);
|
||||||
|
uni.setStorageSync('zhiFuBao', zhiFuBao)
|
||||||
|
uni.setStorageSync('zhiFuBaoName', zhiFuBaoName)
|
||||||
|
uni.showToast({
|
||||||
|
title: '修改成功',
|
||||||
|
icon: 'none',
|
||||||
|
complete() {
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
// if (!zhifubao) {
|
||||||
|
// this.$queue.showToast("请设置收款人支付宝账号");
|
||||||
|
// } else if (!zhifubaoName) {
|
||||||
|
// this.$queue.showToast("请设置收款人姓名");
|
||||||
|
// } else {
|
||||||
|
// this.$queue.showLoading("修改中...");
|
||||||
|
// this.$Request.postT("/cash/userinfo?userId=" + userId + "&zhifubao=" + zhifubao + "&zhifubaoName=" + zhifubaoName).then(
|
||||||
|
// res => {
|
||||||
|
// if (res.status === 0) {
|
||||||
|
// if (res.data.zhifubao) {
|
||||||
|
// this.zhifubao = res.data.zhifubao;
|
||||||
|
// }
|
||||||
|
// if (res.data.zhifubaoName) {
|
||||||
|
// this.zhifubaoName = res.data.zhifubaoName;
|
||||||
|
// }
|
||||||
|
// this.navBack();
|
||||||
|
// } else {
|
||||||
|
// // this.$queue.showToast(res.msg)
|
||||||
|
// }
|
||||||
|
// uni.hideLoading();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss'>
|
||||||
|
page {
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding-top: 32upx;
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm-btn1 {
|
||||||
|
width: 300px;
|
||||||
|
height: 42px;
|
||||||
|
line-height: 42px;
|
||||||
|
border-radius: 30px;
|
||||||
|
margin-top: 70upx;
|
||||||
|
/* background: whitesmoke; */
|
||||||
|
background: #ff7581;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 32rpx;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
border-radius: 60px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.confirm-btn {
|
||||||
|
width: 300px;
|
||||||
|
height: 42px;
|
||||||
|
line-height: 42px;
|
||||||
|
border-radius: 30px;
|
||||||
|
margin-top: 70upx;
|
||||||
|
background: #ff7581;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
border-radius: 60px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,191 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="jf flex align-center justify-between">
|
||||||
|
<view class="jf-l">
|
||||||
|
<view class="jf-l-t">
|
||||||
|
当前积分
|
||||||
|
</view>
|
||||||
|
<view class="jf-l-b">
|
||||||
|
{{num}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="jf-r">
|
||||||
|
<view class="jf-r-t">
|
||||||
|
兑换说明
|
||||||
|
</view>
|
||||||
|
<view class="jf-r-b">
|
||||||
|
{{bili}}:1兑换,最少{{bili}}积分
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="listTitle flex align-center">
|
||||||
|
<u-icon name="order" color="#2e2f33" size="50"></u-icon>
|
||||||
|
<text>
|
||||||
|
兑换数量
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="list">
|
||||||
|
<view class="list-input">
|
||||||
|
<u-input v-model="value" placeholder="请输入兑换数量" type="number" :border="true" />
|
||||||
|
</view>
|
||||||
|
<view class="list-btn">
|
||||||
|
<view @click="userIntegral()" class="list-btn-s flex align-center justify-center">
|
||||||
|
提交兑换
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '../../components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
num: 0,
|
||||||
|
value: '',
|
||||||
|
bili: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getNum()
|
||||||
|
this.getBili()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//兑换积分
|
||||||
|
userIntegral() {
|
||||||
|
if (!this.value) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入兑换的积分数量',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (Number(this.value) < Number(this.bili)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '兑换的积分数量不能小于' + this.bili + '积分',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
integral: this.value
|
||||||
|
}
|
||||||
|
this.$Request.postT('/app/integral/creditsExchange', data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '积分兑换成功'
|
||||||
|
})
|
||||||
|
this.getNum()
|
||||||
|
this.value = ''
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取积分兑换比例
|
||||||
|
getBili() {
|
||||||
|
this.$u.get('/app/common/type/104').then(res => { // 积分兑换比例 104
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
this.bili = res.data.value
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取当前积分
|
||||||
|
getNum() {
|
||||||
|
this.$Request.getT('/app/integral/selectByUserId').then(res => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.num = res.data.integralNum
|
||||||
|
} else {
|
||||||
|
this.num = 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jf {
|
||||||
|
width: 100%;
|
||||||
|
height: 252rpx;
|
||||||
|
background: linear-gradient(90deg, rgba(255, 117, 129, 0.6) 0%, #ff7581 100%);
|
||||||
|
padding: 0 40rpx;
|
||||||
|
|
||||||
|
.jf-l-t {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jf-l-b {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jf-r {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.jf-r-b {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.listTitle {
|
||||||
|
width: 100%;
|
||||||
|
height: 110rpx;
|
||||||
|
margin-top: -40rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 30rpx 30rpx 0 0;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
|
||||||
|
text {
|
||||||
|
color: #2e2f33;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
padding-top: 8rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.list-input {
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-btn {
|
||||||
|
padding: 40rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-btn-s {
|
||||||
|
width: 100%;
|
||||||
|
height: 88rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7581;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,235 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="jf flex align-center justify-between">
|
||||||
|
<view class="jf-l">
|
||||||
|
<view class="jf-l-t">
|
||||||
|
当前积分
|
||||||
|
</view>
|
||||||
|
<view class="jf-l-b">
|
||||||
|
{{num}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="jf-r" @click="goNav('/me/jifen/duihuan')">
|
||||||
|
积分兑换
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="listTitle flex align-center">
|
||||||
|
<u-icon name="order" color="#2e2f33" size="50"></u-icon>
|
||||||
|
<text>
|
||||||
|
积分明细
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="list">
|
||||||
|
<scroll-view @scrolltolower="scrolltolower" :refresher-enabled="refresherTriggered"
|
||||||
|
@scrolltoupper="scrolltoupper" scroll-y="true"
|
||||||
|
style="width: 100%;height: 100%;background-color: #ffffff;padding-bottom: 30rpx;">
|
||||||
|
<view class="list-item flex align-center justify-center" v-for="(item,index) in list" :key="index">
|
||||||
|
<view class="list-item-box flex align-center justify-between">
|
||||||
|
<view class="list-item-box-l">
|
||||||
|
<view class="list-item-box-l-t">
|
||||||
|
{{item.content}}
|
||||||
|
</view>
|
||||||
|
<view class="list-item-box-l-b">
|
||||||
|
{{item.createTime}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list-item-box-r" v-if="item.type == 1">
|
||||||
|
+{{item.num}}
|
||||||
|
</view>
|
||||||
|
<view class="list-item-box-r" v-else>
|
||||||
|
-{{item.num}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="" style="width: 100%;height: 30rpx;" v-if="list.length>0"></view>
|
||||||
|
<u-loadmore v-if="list.length>0" :status="status" />
|
||||||
|
<empty :isShow="true" title="暂无明细" v-if="list.length == 0" />
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '../../components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
boxStyle: {
|
||||||
|
margin: 0,
|
||||||
|
padding: '200rpx 0 0 0',
|
||||||
|
},
|
||||||
|
num: 0,
|
||||||
|
list: [],
|
||||||
|
status: 'loadmore',
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
pages: 1,
|
||||||
|
refresherTriggered: true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getNum()
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.getNum()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goNav(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//上拉刷新
|
||||||
|
scrolltoupper() {
|
||||||
|
this.page = 1
|
||||||
|
this.refresherTriggered = true
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
//加载更多
|
||||||
|
scrolltolower() {
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.status = 'loading'
|
||||||
|
this.page += 1
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
//获取积分明细
|
||||||
|
getList() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit
|
||||||
|
}
|
||||||
|
this.$Request.getT('/app/integral/details', data).then(res => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.refresherTriggered = false
|
||||||
|
}, 1500)
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.pages = res.data.pages
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.status = 'loadmore'
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.list = res.data.records
|
||||||
|
} else {
|
||||||
|
this.list = [...this.list, ...res.data.records]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取当前积分
|
||||||
|
getNum() {
|
||||||
|
this.$Request.getT('/app/integral/selectByUserId').then(res => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.num = res.data.integralNum
|
||||||
|
} else {
|
||||||
|
this.num = 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jf {
|
||||||
|
width: 100%;
|
||||||
|
height: 252rpx;
|
||||||
|
background: linear-gradient(90deg, rgba(255, 117, 129, 0.6) 0%, #ff7581 100%);
|
||||||
|
padding: 0 40rpx;
|
||||||
|
|
||||||
|
.jf-l-t {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jf-l-b {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jf-r {
|
||||||
|
padding: 20rpx 40rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
color: #ff7581;
|
||||||
|
background-color: #ffffff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.listTitle {
|
||||||
|
width: 100%;
|
||||||
|
height: 110rpx;
|
||||||
|
margin-top: -40rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 30rpx 30rpx 0 0;
|
||||||
|
border-bottom: 1px solid hsla(0, 0%, 90.2%, .8);
|
||||||
|
padding-left: 20rpx;
|
||||||
|
|
||||||
|
text {
|
||||||
|
color: #2e2f33;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
padding-top: 8rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
height: calc(100vh - 252rpx - 70rpx - 88rpx);
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef H5 */
|
||||||
|
height: calc(100vh - 252rpx - 70rpx);
|
||||||
|
/* #endif */
|
||||||
|
background-color: #ffffff;
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item-box {
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
padding: 30rpx 0;
|
||||||
|
border-bottom: 1px solid hsla(0, 0%, 90.2%, .8);
|
||||||
|
|
||||||
|
.list-item-box-l-t {
|
||||||
|
color: #2e2f33;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item-box-l-b {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #aeb2c1;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item-box-r {
|
||||||
|
color: #2e2f33;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,163 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="list flex align-center justify-center" v-for="(item,index) in list" :key="index"
|
||||||
|
@click="goCourse(item.courseId,item.courseDetailsId)">
|
||||||
|
<view class="list-box flex align-center justify-between">
|
||||||
|
<view class="list-box-l">
|
||||||
|
<image :src="item.titleImg" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r flex flex-wrap">
|
||||||
|
<view class="list-box-r-title">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r-jilu">
|
||||||
|
看到{{item.courseDetailsName}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r-new flex align-center justify-between">
|
||||||
|
<view class="list-box-r-new-l">
|
||||||
|
{{item.over==1?'完结':'更新'+item.courseDetailsCount+'集'}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r-new-r">
|
||||||
|
继续观看
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="" style="margin: 20rpx;" v-if="list.length > 0">
|
||||||
|
<u-loadmore :status="status" />
|
||||||
|
</view>
|
||||||
|
<empty v-if="list.length == 0" title="暂无记录" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '../../components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: 'loadmore',
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
pages: 1,
|
||||||
|
limit: 10,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.page = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.page += 1
|
||||||
|
this.status = 'loading'
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 跳转资源详情
|
||||||
|
goCourse(e, courseDetailsId) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/detail/detail?id=' + e + '&courseDetailsId=' + courseDetailsId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取观看记录
|
||||||
|
getList() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit,
|
||||||
|
classify: 1
|
||||||
|
}
|
||||||
|
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.pages = res.data.pages
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.status = 'loadmore'
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.list = res.data.records
|
||||||
|
} else {
|
||||||
|
this.list = [...this.list, ...res.data.records]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
.list-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-l {
|
||||||
|
width: 150rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r {
|
||||||
|
width: calc(100% - 170rpx);
|
||||||
|
height: 200rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.list-box-r-title {
|
||||||
|
width: 100%;
|
||||||
|
color: #2e2f33;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r-jilu {
|
||||||
|
width: 100%;
|
||||||
|
color: #ff7581;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r-new {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.list-box-r-new-l {
|
||||||
|
color: #aeb2c1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r-new-r {
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
background-color: #ff7581;
|
||||||
|
color: #ffffff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="list flex align-center justify-center" v-for="(item,index) in list" :key="index"
|
||||||
|
@click="goCourse(item.courseId,item.courseDetailsId)">
|
||||||
|
<view class="list-box flex align-center justify-between">
|
||||||
|
<view class="list-box-l">
|
||||||
|
<image :src="item.titleImg" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r flex flex-wrap">
|
||||||
|
<view class="list-box-r-title">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r-jilu">
|
||||||
|
看到{{item.courseDetailsName}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r-new flex align-center justify-between">
|
||||||
|
<view class="list-box-r-new-l">
|
||||||
|
{{item.over==1?'完结':'更新'+item.courseDetailsCount+'集'}}
|
||||||
|
</view>
|
||||||
|
<view class="list-box-r-new-r">
|
||||||
|
继续观看
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="" style="margin: 20rpx;" v-if="list.length > 0">
|
||||||
|
<u-loadmore :status="status" />
|
||||||
|
</view>
|
||||||
|
<empty v-if="list.length == 0" title="暂无记录" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '../../components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: 'loadmore',
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
pages: 1,
|
||||||
|
limit: 10,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.page = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.page += 1
|
||||||
|
this.status = 'loading'
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 跳转资源详情
|
||||||
|
goCourse(e, courseDetailsId) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/detail/detail?id=' + e + '&courseDetailsId=' + courseDetailsId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取观看记录
|
||||||
|
getList() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit,
|
||||||
|
classify: 3
|
||||||
|
}
|
||||||
|
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.pages = res.data.pages
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.status = 'loadmore'
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.list = res.data.records
|
||||||
|
} else {
|
||||||
|
this.list = [...this.list, ...res.data.records]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
.list-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-l {
|
||||||
|
width: 150rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r {
|
||||||
|
width: calc(100% - 170rpx);
|
||||||
|
height: 200rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.list-box-r-title {
|
||||||
|
width: 100%;
|
||||||
|
color: #2e2f33;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r-jilu {
|
||||||
|
width: 100%;
|
||||||
|
color: #ff7581;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r-new {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.list-box-r-new-l {
|
||||||
|
color: #aeb2c1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-box-r-new-r {
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
background-color: #ff7581;
|
||||||
|
color: #ffffff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,125 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="list flex align-center justify-between flex-wrap">
|
||||||
|
<view class="list-item" v-for="(item,index) in list" :key="index" @click="goCourse(item.courseId,item.courseDetailsId)">
|
||||||
|
<view class="list-item-img">
|
||||||
|
<image :src="item.titleImg" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<view class="list-item-title">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list-item" style="height: 0;"></view>
|
||||||
|
</view>
|
||||||
|
<view class="" style="margin: 20rpx;" v-if="list.length > 0">
|
||||||
|
<u-loadmore :status="status" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<empty v-if="list.length == 0" title="暂无记录" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '../../components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: 'loadmore',
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
pages: 1,
|
||||||
|
limit: 10,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.page = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.page += 1
|
||||||
|
this.status = 'loading'
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 跳转资源详情
|
||||||
|
goCourse(e,courseDetailsId) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/detail/detail?id=' + e+'&courseDetailsId='+courseDetailsId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取观看记录
|
||||||
|
getList() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit,
|
||||||
|
classify: 2
|
||||||
|
}
|
||||||
|
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.pages = res.data.pages
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.status = 'loadmore'
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.list = res.data.records
|
||||||
|
} else {
|
||||||
|
this.list = [...this.list, ...res.data.records]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
width: calc((100% - 40rpx) / 3);
|
||||||
|
height: 100%;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.list-item-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 280rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item-title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 0 0 24rpx 24rpx;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,150 @@
|
||||||
|
<template>
|
||||||
|
<view style="padding-bottom: 40rpx;">
|
||||||
|
<view class="plot flex align-center justify-center">
|
||||||
|
<view class="plot-box">
|
||||||
|
<view class="plot-box-item flex justify-between" @click="goCourse(item.courseId,item.courseDetailsId)"
|
||||||
|
v-for="(item,index) in jqList" :key="index">
|
||||||
|
<view class="plot-box-item-l">
|
||||||
|
<image :src="item.titleImg" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="plot-box-item-r">
|
||||||
|
<view class="plot-box-item-r-title">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="plot-box-item-r-content" v-html="item.details">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<empty v-if="jqList.length == 0" />
|
||||||
|
<u-loadmore v-if="jqList.length > 4" :status="status" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '../../components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
jqList: [], //剧情列表
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
pages: 1,
|
||||||
|
status: 'loadmore',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getJqList()
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.page += 1
|
||||||
|
this.status = 'loading'
|
||||||
|
this.getJqList()
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.page = 1
|
||||||
|
this.getJqList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 跳转资源详情
|
||||||
|
goCourse(e, courseDetailsId) {
|
||||||
|
let userId = uni.getStorageSync('userId')
|
||||||
|
if (userId) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/detail/detail?id=' + e + '&courseDetailsId=' + courseDetailsId
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/login/login"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取剧情列表
|
||||||
|
*/
|
||||||
|
getJqList() {
|
||||||
|
let data = {
|
||||||
|
limit: this.limit,
|
||||||
|
page: this.page,
|
||||||
|
sort: '',
|
||||||
|
}
|
||||||
|
this.$u.api.courseList(data).then(res => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.pages = res.data.totalPage
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.status = 'loadmore'
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.jqList = res.data.list
|
||||||
|
} else {
|
||||||
|
this.jqList = [...this.jqList, ...res.data.list]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.plot {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
|
||||||
|
.plot-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plot-box-item {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plot-box-item-l {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 260rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 260rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.plot-box-item-r {
|
||||||
|
width: calc(686rpx - 260rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.plot-box-item-r-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2e2f33;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plot-box-item-r-content {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #2e2f33;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
<!-- 消息中心 -->
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view v-if="msgList.length" class="flex margin-lr padding-tb-sm u-border-bottom" v-for="(item,index) in msgList"
|
||||||
|
:key='index'>
|
||||||
|
<u-image src="@/me/static/message/xitong.png" width="82rpx" mode="widthFix"></u-image>
|
||||||
|
<view class="flex-sub margin-left">
|
||||||
|
<view class="flex justify-between">
|
||||||
|
<view class="text-bold text-lg">{{item.title}}</view>
|
||||||
|
<view class="text-gray">{{item.createAt}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="text-gray">{{item.content}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<empty v-if="!msgList.length" title="暂无消息" :isShow="false"></empty>
|
||||||
|
<!-- <view class="page-box" v-if="!msgList.length">
|
||||||
|
<view class="centre">
|
||||||
|
<image src="../static/none.png" mode=""></image>
|
||||||
|
<view class="tips">
|
||||||
|
暂无消息
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import empty from '@/components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
msgList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getMsg()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMsg() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
limit: this.limit,
|
||||||
|
state: 5
|
||||||
|
}
|
||||||
|
this.$u.api.message(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.msgList = res.data.list
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.msgList = [...this.msgList, ...res.data.list]
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
this.page = this.page + 1;
|
||||||
|
this.getMsg()
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
// this.msgList = []
|
||||||
|
this.getMsg()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
page {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centre {
|
||||||
|
text-align: center;
|
||||||
|
margin: 200rpx auto;
|
||||||
|
font-size: 32rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 360rpx;
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
margin: 0 auto 20rpx;
|
||||||
|
// border: 1px dotted #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #5074FF;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 600rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
background: #5074FF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,758 @@
|
||||||
|
<template>
|
||||||
|
<view style="padding: 20rpx 0;">
|
||||||
|
<!-- 视频简介 -->
|
||||||
|
<view class="info flex align-center justify-center">
|
||||||
|
<view class="info-box flex align-center">
|
||||||
|
<view class="info-box-l">
|
||||||
|
<image :src="titleImg" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<view class="info-box-r">
|
||||||
|
<view class="info-box-r-t">
|
||||||
|
{{type==1?name:courseDetailsName}}
|
||||||
|
</view>
|
||||||
|
<view class="info-box-r-b flex align-center" v-if="type == 1">
|
||||||
|
全集价格:
|
||||||
|
<view class="flex align-center">
|
||||||
|
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||||
|
src="../../static/images/me/jindou.png" mode="">
|
||||||
|
</image>
|
||||||
|
{{parsePrice(zongPrice)}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-box-r-b flex align-center" v-else>
|
||||||
|
单集价格:
|
||||||
|
<view class="flex align-center">
|
||||||
|
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||||
|
src="../../static/images/me/jindou.png" mode="">
|
||||||
|
</image>
|
||||||
|
{{parsePrice(price)}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 价格提示 -->
|
||||||
|
<view class="price flex align-center justify-center">
|
||||||
|
<view class="price-box flex align-center justify-between">
|
||||||
|
<view class="price-box-title">
|
||||||
|
需支付
|
||||||
|
</view>
|
||||||
|
<view class="price-box-price flex align-center" v-if="type==1">
|
||||||
|
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||||
|
src="../../static/images/me/jindou.png" mode="">
|
||||||
|
</image>
|
||||||
|
{{parsePrice(zongPrice)}}
|
||||||
|
</view>
|
||||||
|
<view class="price-box-price flex align-center" v-else>
|
||||||
|
<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;"
|
||||||
|
src="../../static/images/me/jindou.png" mode="">
|
||||||
|
</image>
|
||||||
|
{{parsePrice(price)}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 支付方式 -->
|
||||||
|
<view v-if="payList.length>0" class="pay flex align-center justify-center">
|
||||||
|
<view class="pay-box">
|
||||||
|
<view class="pay-box-title">
|
||||||
|
支付方式
|
||||||
|
</view>
|
||||||
|
<u-radio-group style="width: 100%;" size="44" v-model="payAway">
|
||||||
|
<view class="pay-box-item flex align-center justify-between" v-for="(item,index) in payList"
|
||||||
|
:key="index">
|
||||||
|
<view class="pay-box-item-l flex align-center">
|
||||||
|
<image :src="item.imgurl" mode=""></image>
|
||||||
|
{{item.name}}
|
||||||
|
</view>
|
||||||
|
<view class="pay-box-item-r">
|
||||||
|
<u-radio active-color="5074FF" :name="item.payAway"></u-radio>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-radio-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="illustrate flex align-center justify-center">
|
||||||
|
<view class="illustrate-box flex align-center">
|
||||||
|
<u-checkbox v-model="checked" :size="40" shape="circle"></u-checkbox>
|
||||||
|
<text @click="checked = !checked">我已经阅读并同意</text>
|
||||||
|
<view @click="goXieyi()" class="illustrate-box-txt">
|
||||||
|
《付费须知说明》
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 支付 -->
|
||||||
|
<view class="submit flex align-center justify-center">
|
||||||
|
<view class="submit-box flex align-center justify-center" @click="getOrderInfo()">
|
||||||
|
支付 ¥{{type==1?parsePrice(zongPrice):parsePrice(price)}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
<!-- 抖音im客服 -->
|
||||||
|
<ttMsg />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ttMsg from '../../components/ttMsg/ttMsg.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
ttMsg
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
courseId: '', //整部视频id
|
||||||
|
courseDetailsId: '', //单集id
|
||||||
|
titleImg: '', //图片
|
||||||
|
courseDetailsName: '', //名称
|
||||||
|
price: 0, //单价
|
||||||
|
zongPrice: 0, //总价
|
||||||
|
type: 1, //类型:1:整部 2:单部
|
||||||
|
name: '', //全集名称
|
||||||
|
payList: [],
|
||||||
|
payAway: 1,
|
||||||
|
checked: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
// #ifdef APP
|
||||||
|
if (plus.os.name.toLowerCase() === 'android') {
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/weixin.png',
|
||||||
|
name: '微信支付',
|
||||||
|
payAway: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/zhifubao.png',
|
||||||
|
name: '支付宝支付',
|
||||||
|
payAway: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
this.payAway = 1
|
||||||
|
} else {
|
||||||
|
let checkIosPay = this.$queue.getData('checkIosPay');
|
||||||
|
if (checkIosPay === '是') {
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}]
|
||||||
|
this.payAway = 3
|
||||||
|
} else {
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/weixin.png',
|
||||||
|
name: '微信支付',
|
||||||
|
payAway: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/zhifubao.png',
|
||||||
|
name: '支付宝支付',
|
||||||
|
payAway: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
this.payAway = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}]
|
||||||
|
this.payAway = 3
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/weixin.png',
|
||||||
|
name: '微信支付',
|
||||||
|
payAway: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
this.payAway = 1
|
||||||
|
} else {
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/zhifubao.png',
|
||||||
|
name: '支付宝支付',
|
||||||
|
payAway: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
this.payAway = 2
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/zhifubao.png',
|
||||||
|
name: '抖音支付',
|
||||||
|
payAway: 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
this.payAway = 4
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-KUAISHOU
|
||||||
|
const osName = uni.getSystemInfoSync().osName;
|
||||||
|
if (osName != 'ios') { //安卓
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/zhifubao.png',
|
||||||
|
name: '快手支付',
|
||||||
|
payAway: 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
this.payAway = 5
|
||||||
|
} else {
|
||||||
|
this.payList = [{
|
||||||
|
imgurl: '/static/images/pay/lingqian.png',
|
||||||
|
name: '金豆支付',
|
||||||
|
payAway: 3
|
||||||
|
}]
|
||||||
|
this.payAway = 3
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
if (option.info) {
|
||||||
|
let info = JSON.parse(decodeURIComponent(option.info))
|
||||||
|
this.courseId = info.courseId
|
||||||
|
this.courseDetailsId = info.courseDetailsId
|
||||||
|
this.titleImg = info.titleImg
|
||||||
|
this.courseDetailsName = info.courseDetailsName
|
||||||
|
this.price = info.price
|
||||||
|
this.zongPrice = info.zongPrice
|
||||||
|
this.name = info.name
|
||||||
|
this.type = info.type
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//去付费须知说明
|
||||||
|
goXieyi() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/setting/payXieYi'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @param {Number} price
|
||||||
|
* 价格保留两位小数
|
||||||
|
*/
|
||||||
|
parsePrice(price) {
|
||||||
|
return price.toFixed(2)
|
||||||
|
},
|
||||||
|
//生成订单
|
||||||
|
getOrderInfo() {
|
||||||
|
if (this.checked == false) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '请阅读并同意《付费须知说明》',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
courseId: this.courseId
|
||||||
|
}
|
||||||
|
if (this.type != 1) { //购买单集
|
||||||
|
data.courseDetailsId = this.courseDetailsId
|
||||||
|
}
|
||||||
|
this.$Request.getT('/app/order/insertCourseOrders', data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.payOrder(res.data.orders.ordersId)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @param {Object} orderId 订单id
|
||||||
|
*/
|
||||||
|
payOrder(orderId) {
|
||||||
|
let that = this
|
||||||
|
if (that.payAway == 4) { //抖音支付
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付中...'
|
||||||
|
})
|
||||||
|
this.$Request.postT('/app/dyPay/payVirtualAppOrder', {
|
||||||
|
orderId: orderId
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
tt.requestOrder({
|
||||||
|
data: JSON.stringify(res.data.data), // 请勿在前端对data做任何处理
|
||||||
|
byteAuthorization: res.data
|
||||||
|
.byteAuthorization, // 请勿在前端对byteAuthorization做任何处理
|
||||||
|
success(redd) {
|
||||||
|
console.log(JSON.stringify(redd))
|
||||||
|
tt.getOrderPayment({
|
||||||
|
orderId: redd.orderId,
|
||||||
|
success(reee) {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
setTimeout(function() {
|
||||||
|
let data = {
|
||||||
|
flag: true
|
||||||
|
}
|
||||||
|
uni.$emit('back', data)
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail(ee) {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
console.log(ee)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (that.payAway == 5) { //快手支付
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付中...'
|
||||||
|
})
|
||||||
|
this.$Request.postT('/app/ksPay/payAppOrder', {
|
||||||
|
orderId: orderId
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
ks.pay({
|
||||||
|
serviceId: '1', //服务类型id(固定值为‘1’)
|
||||||
|
orderInfo: res.data,
|
||||||
|
success(succ) {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
setTimeout(function() {
|
||||||
|
let data = {
|
||||||
|
flag: true
|
||||||
|
}
|
||||||
|
uni.$emit('back', data)
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
uni.hideLoading()
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
title: '支付失败,请重试!',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
switch (this.payAway) { //1:微信支付,2:支付宝支付 3:金豆支付
|
||||||
|
case 1: //微信支付
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
that.$Request.postT("/app/wxPay/wxPayJsApiOrder", {
|
||||||
|
orderId: orderId,
|
||||||
|
}).then(red => {
|
||||||
|
if (red.code == 0) {
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'wxpay',
|
||||||
|
timeStamp: red.data.timestamp,
|
||||||
|
nonceStr: red.data.noncestr,
|
||||||
|
package: red.data.package,
|
||||||
|
signType: red.data.signType,
|
||||||
|
paySign: red.data.sign,
|
||||||
|
success: function(redd) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付成功'
|
||||||
|
});
|
||||||
|
uni.hideLoading();
|
||||||
|
setTimeout(function() {
|
||||||
|
let data = {
|
||||||
|
flag: true
|
||||||
|
}
|
||||||
|
uni.$emit('back', data)
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
uni.hideLoading();
|
||||||
|
that.$queue.showToast(
|
||||||
|
'支付失败');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: red.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
console.log(ua)
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
that.$Request.postT("/app/wxPay/wxPayMpOrder", {
|
||||||
|
orderId: orderId,
|
||||||
|
}).then(red => {
|
||||||
|
if (red.code == 0) {
|
||||||
|
that.callPay(red.data);
|
||||||
|
} else {
|
||||||
|
that.isPay = true
|
||||||
|
uni.showToast({
|
||||||
|
title: red.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
that.$Request.postT("/app/wxPay/payAppOrder", {
|
||||||
|
orderId: orderId,
|
||||||
|
}).then(red => {
|
||||||
|
if (red.code == 0) {
|
||||||
|
console.log(red, '+++++++++++++++++++++')
|
||||||
|
that.setPayment('wxpay', JSON.stringify(red.data));
|
||||||
|
} else {
|
||||||
|
that.isPay = true
|
||||||
|
uni.showToast({
|
||||||
|
title: red.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
break;
|
||||||
|
case 2: //支付宝
|
||||||
|
// #ifdef H5
|
||||||
|
that.$Request.postT("/app/aliPay/payOrder", {
|
||||||
|
orderId: orderId,
|
||||||
|
classify: 2
|
||||||
|
}).then(red => {
|
||||||
|
if (red.code == 0) {
|
||||||
|
const div = document.createElement('div')
|
||||||
|
div.innerHTML = red.data //此处form就是后台返回接收到的数据
|
||||||
|
document.body.appendChild(div)
|
||||||
|
document.forms[0].submit()
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: red.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
that.$Request.postT("/app/aliPay/payOrder", {
|
||||||
|
orderId: orderId,
|
||||||
|
classify: 1
|
||||||
|
}).then(red => {
|
||||||
|
if (red.code == 0) {
|
||||||
|
that.setPayment('alipay', red.data);
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: red.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
break;
|
||||||
|
default: //零钱
|
||||||
|
that.$Request.postT("/app/order/payOrders", {
|
||||||
|
orderId: orderId,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
setTimeout(function() {
|
||||||
|
let data = {
|
||||||
|
flag: true
|
||||||
|
}
|
||||||
|
uni.$emit('back', data)
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: res.msg,
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '支付失败,余额不足!',
|
||||||
|
confirmText: '去充值',
|
||||||
|
complete(ret) {
|
||||||
|
if (ret.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/wallet/wallet'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callPay: function(response) {
|
||||||
|
if (typeof WeixinJSBridge === "undefined") {
|
||||||
|
if (document.addEventListener) {
|
||||||
|
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
|
||||||
|
} else if (document.attachEvent) {
|
||||||
|
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
|
||||||
|
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.onBridgeReady(response);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onBridgeReady: function(response) {
|
||||||
|
let that = this;
|
||||||
|
if (!response.package) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
WeixinJSBridge.invoke(
|
||||||
|
'getBrandWCPayRequest', {
|
||||||
|
"appId": response.appid, //公众号名称,由商户传入
|
||||||
|
"timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
|
||||||
|
"nonceStr": response.noncestr, //随机串
|
||||||
|
"package": response.package,
|
||||||
|
"signType": response.signType, //微信签名方式:
|
||||||
|
"paySign": response.sign //微信签名
|
||||||
|
},
|
||||||
|
function(res) {
|
||||||
|
if (res.err_msg === "get_brand_wcpay_request:ok") {
|
||||||
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||||
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||||
|
uni.removeStorageSync('EditAddress')
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付成功'
|
||||||
|
});
|
||||||
|
uni.hideLoading();
|
||||||
|
setTimeout(function() {
|
||||||
|
let data = {
|
||||||
|
flag: true
|
||||||
|
}
|
||||||
|
uni.$emit('back', data)
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
WeixinJSBridge.log(response.err_msg);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
setPayment(name, order) {
|
||||||
|
let that = this;
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: name,
|
||||||
|
orderInfo: order, //微信、支付宝订单数据
|
||||||
|
success: function(res) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付成功'
|
||||||
|
});
|
||||||
|
uni.hideLoading();
|
||||||
|
setTimeout(function() {
|
||||||
|
let data = {
|
||||||
|
flag: true
|
||||||
|
}
|
||||||
|
uni.$emit('back', data)
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
uni.hideLoading();
|
||||||
|
console.log(err, 12)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
/deep/.u-radio {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.illustrate {
|
||||||
|
width: 100%;
|
||||||
|
margin: 30rpx 0;
|
||||||
|
|
||||||
|
.illustrate-box {
|
||||||
|
width: 686rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.illustrate-box-txt {
|
||||||
|
color: #5173F8;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.u-radio__label {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
|
.info-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-box-l {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-box-r {
|
||||||
|
margin-left: 30rpx;
|
||||||
|
|
||||||
|
.info-box-r-t {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-box-r-b {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
color: #5074FF;
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
|
||||||
|
.price-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-box-price {
|
||||||
|
color: #5074FF;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
|
||||||
|
.pay-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay-box-title {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay-box-item {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
|
||||||
|
.pay-box-item-l {
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
|
||||||
|
.submit-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
background-color: #5074FF;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,203 @@
|
||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="cu-form-group"
|
||||||
|
style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||||
|
<view class="title">手机号</view>
|
||||||
|
<input type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
|
||||||
|
@input="inputChange" />
|
||||||
|
</view>
|
||||||
|
<view class="cu-form-group"
|
||||||
|
style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||||
|
<text class="title">验证码</text>
|
||||||
|
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange"
|
||||||
|
@confirm="toLogin" />
|
||||||
|
<button class="send-msg" @click="sendMsg" :disabled="sending">{{ sendTime }}</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<button class="confirm-btn" @click="toLogin" :disabled="logining">立即换绑
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import listCell from '@/components/com-input';
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
// listCell
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
mobile: '',
|
||||||
|
code: '',
|
||||||
|
logining: false,
|
||||||
|
sending: false,
|
||||||
|
sendTime: '获取验证码',
|
||||||
|
count: 60,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
inputChange(e) {
|
||||||
|
const key = e.currentTarget.dataset.key;
|
||||||
|
this[key] = e.detail.value;
|
||||||
|
},
|
||||||
|
navBack() {
|
||||||
|
uni.navigateBack();
|
||||||
|
},
|
||||||
|
countDown() {
|
||||||
|
const {
|
||||||
|
count
|
||||||
|
} = this;
|
||||||
|
if (count === 1) {
|
||||||
|
this.count = 60;
|
||||||
|
this.sending = false;
|
||||||
|
this.sendTime = '获取验证码'
|
||||||
|
} else {
|
||||||
|
this.count = count - 1;
|
||||||
|
this.sending = true;
|
||||||
|
this.sendTime = count - 1 + '秒后重新获取';
|
||||||
|
setTimeout(this.countDown.bind(this), 1000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sendMsg() {
|
||||||
|
const {
|
||||||
|
mobile
|
||||||
|
} = this;
|
||||||
|
if (!mobile) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入手机号',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
} else if (mobile.length !== 11) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入正确的手机号',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在发送验证码...'
|
||||||
|
})
|
||||||
|
this.$u.get('/app/Login/sendMsg/' + mobile + '/login').then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.sending = true;
|
||||||
|
uni.showToast({
|
||||||
|
title: '验证码发送成功请注意查收',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
this.countDown();
|
||||||
|
uni.hideLoading();
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showModal({
|
||||||
|
showCancel: false,
|
||||||
|
title: '短信发送失败',
|
||||||
|
content: res.msg ? res.msg : '请一分钟后再获取验证码'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toLogin() {
|
||||||
|
const {
|
||||||
|
mobile,
|
||||||
|
code,
|
||||||
|
} = this;
|
||||||
|
if (!mobile) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入手机号',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
} else if (code.length == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入验证码',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.logining = true;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '更换中...'
|
||||||
|
})
|
||||||
|
this.$u.post('/app/user/updatePhone?phone=' + mobile + '&msg=' + code).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
// this.$queue.remove('invitation');
|
||||||
|
// uni.setStorageSync('token', res.token)
|
||||||
|
// uni.setStorageSync('userId', res.userId)
|
||||||
|
// uni.setStorageSync('mobile', res.mobile)
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: '更换成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showModal({
|
||||||
|
showCancel: false,
|
||||||
|
title: '更换失败',
|
||||||
|
content: res.msg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss'>
|
||||||
|
page {
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-msg {
|
||||||
|
border-radius: 30px;
|
||||||
|
color: white;
|
||||||
|
height: 30px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 30px;
|
||||||
|
background: #ff7581;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
top: 0;
|
||||||
|
padding-top: 32upx;
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
position: relative;
|
||||||
|
z-index: 90;
|
||||||
|
background: #ffffff;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.confirm-btn {
|
||||||
|
width: 300px;
|
||||||
|
height: 42px;
|
||||||
|
line-height: 42px;
|
||||||
|
border-radius: 30px;
|
||||||
|
margin-top: 70px;
|
||||||
|
background: #ff7581;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
border-radius: 60px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
<template>
|
||||||
|
<view class="">
|
||||||
|
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/bind')">
|
||||||
|
<view>修改手机号</view>
|
||||||
|
<view><u-icon name="arrow-right"></u-icon></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between padding bg-white solid-bottom"
|
||||||
|
@click="goNav('/me/feedbackIndex/feedbackIndex')">
|
||||||
|
<view>帮助中心</view>
|
||||||
|
<view><u-icon name="arrow-right"></u-icon></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/feedback/index')">
|
||||||
|
<view>意见反馈</view>
|
||||||
|
<view><u-icon name="arrow-right"></u-icon></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/xieyi')">
|
||||||
|
<view>用户协议</view>
|
||||||
|
<view><u-icon name="arrow-right"></u-icon></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/mimi')">
|
||||||
|
<view>隐私协议</view>
|
||||||
|
<view><u-icon name="arrow-right"></u-icon></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between padding bg-white solid-bottom" @click="goNav('/me/setting/logOff')">
|
||||||
|
<view>注销账号</view>
|
||||||
|
<view><u-icon name="arrow-right"></u-icon></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between padding bg-white solid-bottom" @click="loginOut">
|
||||||
|
<view>退出登录</view>
|
||||||
|
<view><u-icon name="arrow-right"></u-icon></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goNav(e) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: e
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 退出登录
|
||||||
|
loginOut() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '退出提醒',
|
||||||
|
content: '确定要退出登录么',
|
||||||
|
confirmColor: '#ff7581',
|
||||||
|
success: e => {
|
||||||
|
if (e.confirm) {
|
||||||
|
this.avatar = '/static/images/logo.png';
|
||||||
|
this.userName = '';
|
||||||
|
// this.isLogin = false
|
||||||
|
// 清除本地数据
|
||||||
|
uni.removeStorageSync('token')
|
||||||
|
uni.removeStorageSync('userName')
|
||||||
|
uni.removeStorageSync('avatar')
|
||||||
|
uni.removeStorageSync('phone')
|
||||||
|
uni.removeStorageSync('invitationCode')
|
||||||
|
uni.removeStorageSync('sex')
|
||||||
|
uni.removeStorageSync('userId')
|
||||||
|
uni.removeStorageSync('openId')
|
||||||
|
uni.removeStorageSync('zhiFuBao')
|
||||||
|
uni.removeStorageSync('zhiFuBaoName')
|
||||||
|
uni.removeStorageSync('isVIP')
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '退出登录成功'
|
||||||
|
})
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
<template>
|
||||||
|
<view style="height: 100vh;margin: 32upx;">
|
||||||
|
<view style="text-align: center;background: #FFFFFF;padding: 40upx;border-radius: 32upx;">
|
||||||
|
<view style="font-size: 38upx;">添加客服微信咨询</view>
|
||||||
|
<!-- <view style="font-size: 32upx;margin-top: 32upx;">微信号:{{weixin}}</view>
|
||||||
|
<view @click="copyHref"
|
||||||
|
style="background: #ff7581;width:200upx;margin-top: 32upx;font-size: 30upx;margin-left: 36%;color: #FFFFFF;padding: 4upx 20upx;border-radius: 24upx;">
|
||||||
|
一键复制</view> -->
|
||||||
|
|
||||||
|
<image @click="saveImg" mode="aspectFit" style="margin-top: 32upx" :src="image"></image>
|
||||||
|
<view style="font-size: 28upx;margin-top: 32upx" v-if="isWeiXin">{{ isWeiXin ? '长按识别上方二维码' : '' }}</view>
|
||||||
|
<!-- <view @click="goChat"
|
||||||
|
style="width:260upx;margin-top: 32upx;font-size: 30upx;margin-left: 28%;color: #557EFD;padding: 4upx 20upx;border-radius: 24upx;">
|
||||||
|
联系在线客服</view> -->
|
||||||
|
<!-- <view v-if="isWeiXin" style="font-size: 24upx;margin-top: 80upx" @click="rests">无法识别?</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
image: '',
|
||||||
|
isWeiXin: false,
|
||||||
|
weixin: '',
|
||||||
|
webviewStyles: {
|
||||||
|
progress: {
|
||||||
|
color: '#1A1929 '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
// #ifdef H5
|
||||||
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('micromessenger') !== -1) {
|
||||||
|
this.isWeiXin = true;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
//客服二维码
|
||||||
|
this.$u.get('/app/common/type/205').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data && res.data.value) {
|
||||||
|
this.image = res.data.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 客服微信号 /
|
||||||
|
this.$u.get('/app/common/type/207').then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data && res.data.value) {
|
||||||
|
this.weixin = res.data.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
uni.stopPullDownRefresh(); // 停止刷新
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//邀请码复制
|
||||||
|
copyHref() {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: this.weixin,
|
||||||
|
success: r => {
|
||||||
|
this.$queue.showToast('复制成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveImg() {
|
||||||
|
let that = this;
|
||||||
|
let imgArr = []
|
||||||
|
imgArr.push(that.image);
|
||||||
|
//预览图片
|
||||||
|
uni.previewImage({
|
||||||
|
urls: imgArr,
|
||||||
|
current: imgArr[0]
|
||||||
|
});
|
||||||
|
// uni.saveImageToPhotosAlbum({
|
||||||
|
// filePath: that.image,
|
||||||
|
// success(res) {
|
||||||
|
// that.$queue.showToast('保存成功');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
rests() {
|
||||||
|
uni.showToast({
|
||||||
|
title: '已刷新请再次长按识别',
|
||||||
|
mask: false,
|
||||||
|
duration: 1500,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
|
},
|
||||||
|
// 在线客服
|
||||||
|
goChat() {
|
||||||
|
let token = this.$queue.getData('token');
|
||||||
|
if (token) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/my/setting/chat'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.goLoginInfo();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//统一登录跳转
|
||||||
|
goLoginInfo() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/public/loginphone'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* @import '../../static/css/index.css'; */
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #F5F5F5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="icon flex align-center justify-center">
|
||||||
|
<u-icon name="info-circle-fill" color="#ff7581" size="100"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
注销短剧服务
|
||||||
|
</view>
|
||||||
|
<view class="shuoming">
|
||||||
|
短剧服务帐号注销后,您将放弃以下权益且无法找回
|
||||||
|
</view>
|
||||||
|
<view class="list flex align-center justify-center">
|
||||||
|
<view class="list-box">
|
||||||
|
<view class="list-box-item">
|
||||||
|
·<text style="margin-left: 10rpx;">您将无法通过该帐号登录、使用短剧平台;</text>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-item">
|
||||||
|
·<text style="margin-left: 10rpx;">您将无法访问帐号的个人信息(包括帐号名称、昵称、头像等);</text>
|
||||||
|
</view>
|
||||||
|
<view class="list-box-item">
|
||||||
|
·<text style="margin-left: 10rpx;">您帐号的所有权益,将视为主动放弃</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tishi">
|
||||||
|
点击【确认注销】即代表您已同意<text @click="goXieOff()">《用户注销协议》</text>
|
||||||
|
</view>
|
||||||
|
<view class="submit flex align-center justify-center">
|
||||||
|
<view class="submit-box flex align-center justify-center" @click="submit()">
|
||||||
|
确认注销
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//用户注销协议
|
||||||
|
goXieOff() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/setting/offXieyi'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//确认注销
|
||||||
|
submit() {
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确认注销后,您将退出登录,并清除所有数据!',
|
||||||
|
cancelText: '我再想想',
|
||||||
|
confirmText: '确认注销',
|
||||||
|
confirmColor: '#ff7581',
|
||||||
|
complete(ret) {
|
||||||
|
if (ret.confirm) {
|
||||||
|
let data = {
|
||||||
|
state: 3,
|
||||||
|
content: '我要注销账号',
|
||||||
|
userId: uni.getStorageSync('userId')
|
||||||
|
}
|
||||||
|
that.$Request.postJson('/app/message/insertMessage', data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '操作成功',
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '确认',
|
||||||
|
confirmColor: '#fd6416'
|
||||||
|
})
|
||||||
|
that.loginOut()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 退出登录
|
||||||
|
loginOut() {
|
||||||
|
this.avatar = '/static/images/logo.png';
|
||||||
|
this.userName = '';
|
||||||
|
// this.isLogin = false
|
||||||
|
// 清除本地数据
|
||||||
|
uni.removeStorageSync('token')
|
||||||
|
uni.removeStorageSync('userName')
|
||||||
|
uni.removeStorageSync('avatar')
|
||||||
|
uni.removeStorageSync('phone')
|
||||||
|
uni.removeStorageSync('invitationCode')
|
||||||
|
uni.removeStorageSync('sex')
|
||||||
|
uni.removeStorageSync('userId')
|
||||||
|
uni.removeStorageSync('openId')
|
||||||
|
uni.removeStorageSync('zhiFuBao')
|
||||||
|
uni.removeStorageSync('zhiFuBaoName')
|
||||||
|
uni.removeStorageSync('isVIP')
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/me/index'
|
||||||
|
})
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.icon {
|
||||||
|
width: 100%;
|
||||||
|
padding-top: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shuoming {
|
||||||
|
font-size: 16rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
// height: 100rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
.list-box {
|
||||||
|
padding: 20rpx;
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: #ffffff;
|
||||||
|
|
||||||
|
.list-box-item {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 16rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tishi {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
font-size: 18rpx;
|
||||||
|
|
||||||
|
text {
|
||||||
|
color: #ff7581;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
width: 100%;
|
||||||
|
height: 88rpx;
|
||||||
|
margin-top: 60rpx;
|
||||||
|
|
||||||
|
.submit-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7581;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<template>
|
||||||
|
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="home1">
|
||||||
|
<view style="font-size: 28upx;" v-html="content"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
content:''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getGuize();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getGuize(){
|
||||||
|
this.$u.get('app/common/type/155').then(res => {
|
||||||
|
this.content = res.data.value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
/* background: #1c1b20; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<template>
|
||||||
|
<view style="line-height: 26px;padding: 32upx;" class="home1">
|
||||||
|
<view style="font-size: 28upx;" v-html="content"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
content:''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getGuize();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getGuize(){
|
||||||
|
this.$u.get('app/common/type/246').then(res => {
|
||||||
|
this.content = res.data.value
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page{
|
||||||
|
/* background: #1c1b20; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<template>
|
||||||
|
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="home1">
|
||||||
|
<view style="font-size: 28upx;" v-html="content"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
content: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getGuize();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getGuize() {
|
||||||
|
this.$u.get('app/common/type/500').then(res => {
|
||||||
|
this.content = res.data.value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
/* background: #1c1b20; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
<template>
|
||||||
|
<view style="line-height: 26px;padding: 32upx;" class="home1">
|
||||||
|
<view style="font-size: 28upx;" v-html="content"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
content:''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getGuize();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getGuize(){
|
||||||
|
// this.$Request.getT('/agreement/find?id=1').then(res =>{
|
||||||
|
// if(res.status === 0){
|
||||||
|
// this.content = res.data.content;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
this.$u.get('app/common/type/154').then(res => {
|
||||||
|
this.content = res.data.value
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page{
|
||||||
|
/* background: #1c1b20; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 445 B |
|
After Width: | Height: | Size: 334 KiB |
|
After Width: | Height: | Size: 437 B |
|
After Width: | Height: | Size: 947 B |
|
After Width: | Height: | Size: 856 B |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 364 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 429 B |