修改bug 添加新功能跳转 夜校小程序
This commit is contained in:
parent
9c4951106f
commit
1551608ee7
@ -46,7 +46,7 @@
|
|||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx867e324c44b9e016",
|
"appid" : "wxd7e2deffbaa22254",
|
||||||
"UniversalLinks" : ""
|
"UniversalLinks" : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,145 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="box flex flex-column align-items">
|
|
||||||
<view class="center flex flex-column align-items" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
|
|
||||||
<view class="centerBox flex align-items">
|
|
||||||
<image :src="item.headimage" mode="" style="width: 280rpx;height: 200rpx;"></image>
|
|
||||||
<view class="right flex flex-column" style="align-items: self-start;">
|
|
||||||
<span class="title white-space w-400">{{item.title}}</span>
|
|
||||||
<span class="time hui w-400 white-space">收藏时间:2024.11.112024.11.112024.11.11</span>
|
|
||||||
<span class="minge hui w-400 white-space">课程名额:{{ Number(item.sign_num + item.virtual_num)}}/{{item.limit_num}}</span>
|
|
||||||
<span class="price hui w-400 white-space" v-if="item.feel == 0">课程价格:¥{{item.price}}</span>
|
|
||||||
<span class="price hui w-400 white-space" v-if="item.feel == 1">课程价格:¥{{item.price}}</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<span class="line-row"></span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list:[],
|
|
||||||
page:1,
|
|
||||||
limit:10,
|
|
||||||
order:'normal'
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
this.page = 1
|
|
||||||
this.list = []
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
getList(){
|
|
||||||
uni.$u.http.get('/api/school/classes/classes_list', {
|
|
||||||
params:{
|
|
||||||
page:this.page,
|
|
||||||
limit:this.limit,
|
|
||||||
order:this.order,
|
|
||||||
collect:1
|
|
||||||
}
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 1) {
|
|
||||||
this.list = res.data.list.data
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.msg,
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 跳转详情
|
|
||||||
toDetail(id){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/center/detail?id=" + id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.w-100 {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.w-400{
|
|
||||||
width: 400rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.justify-center {
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.space-between {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-items {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-column {
|
|
||||||
flex-flow: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.justify-start {
|
|
||||||
justify-content: start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mar-top-30 {
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
.hui{
|
|
||||||
font-family: PingFang SC, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #7A7A7A;
|
|
||||||
}
|
|
||||||
.white-space {
|
|
||||||
overflow: hidden;
|
|
||||||
/* 确保超出容器的文本被隐藏 */
|
|
||||||
white-space: nowrap;
|
|
||||||
/* 确保文本在一行内显示 */
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
.box{
|
|
||||||
width: 750rpx;
|
|
||||||
height: 100vh;
|
|
||||||
background-color: #F1F2F8;
|
|
||||||
.center{
|
|
||||||
width: 690rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
.centerBox{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.right{
|
|
||||||
margin-left: 32rpx;
|
|
||||||
.title{
|
|
||||||
font-family: PingFang SC, PingFang SC;
|
|
||||||
font-weight: 800;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #343434;
|
|
||||||
margin-bottom: 32rpx;
|
|
||||||
}
|
|
||||||
.minge{
|
|
||||||
margin: 8rpx 0 0 0 ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.line-row{
|
|
||||||
margin-top: 52rpx;
|
|
||||||
width: 400rpx;
|
|
||||||
height: 1rpx;
|
|
||||||
background: #D9D9D9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -197,12 +197,6 @@
|
|||||||
"navigationBarTitleText": "报名成功"
|
"navigationBarTitleText": "报名成功"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "my/Collect",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "收藏课程"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "my/classCheck",
|
"path": "my/classCheck",
|
||||||
"style": {
|
"style": {
|
||||||
|
@ -232,6 +232,7 @@
|
|||||||
isCanvasToTempFilePath
|
isCanvasToTempFilePath
|
||||||
@success="sunccessimg"
|
@success="sunccessimg"
|
||||||
custom-style="width:661rpx;height: 1072rpx;position:absolute;left:45rpx;right:44rpx;top:200rpx;background-image: url(https://naweigetetest2.hschool.com.cn/dyqc/fenxiang.png);background-size: 100%;"
|
custom-style="width:661rpx;height: 1072rpx;position:absolute;left:45rpx;right:44rpx;top:200rpx;background-image: url(https://naweigetetest2.hschool.com.cn/dyqc/fenxiang.png);background-size: 100%;"
|
||||||
|
css=""
|
||||||
>
|
>
|
||||||
<l-painter-image
|
<l-painter-image
|
||||||
:src="detail.user.avatar"
|
:src="detail.user.avatar"
|
||||||
@ -250,7 +251,7 @@
|
|||||||
>
|
>
|
||||||
<l-painter-image
|
<l-painter-image
|
||||||
:src="detail.images[0]"
|
:src="detail.images[0]"
|
||||||
css="width: 620rpx; height: 620rpx; border-radius: 24rpx;margin: 0 auto;display: block;"
|
css="width: 620rpx; height: 620rpx; border-radius: 24rpx;margin: 0 auto;display: block;object-fit: cover;"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<l-painter-view css="margin-top: 30rpx;display: flex;justify-content: space-between;width:100%;">
|
<l-painter-view css="margin-top: 30rpx;display: flex;justify-content: space-between;width:100%;">
|
||||||
@ -730,30 +731,16 @@ export default {
|
|||||||
},
|
},
|
||||||
// 保存海报
|
// 保存海报
|
||||||
save() {
|
save() {
|
||||||
// wx.saveImageToPhotosAlbum({
|
const base64 = this.path.replace(/^data:image\/\w+;base64,/, ""); //图片替换
|
||||||
// filePath: e,
|
const arrayBuffer = uni.base64ToArrayBuffer(base64);
|
||||||
// success: function(res) {
|
const filePath = `${wx.env.USER_DATA_PATH}/temp_${Date.now()}.png`;
|
||||||
// wx.showToast({
|
|
||||||
// title: '保存成功',
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// fail: function(err) {
|
|
||||||
// console.log(err, '失败')
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let base64 = this.path.replace(/^data:image\/\w+;base64,/, ""); //图片替换
|
|
||||||
let filePath = wx.env.USER_DATA_PATH + '/qrcode.png';
|
|
||||||
uni.getFileSystemManager().writeFile({
|
uni.getFileSystemManager().writeFile({
|
||||||
filePath: filePath, //创建一个临时文件名
|
filePath, //创建一个临时文件名
|
||||||
data: base64, //写入的文本或二进制数据
|
data: arrayBuffer, //写入的文本或二进制数据
|
||||||
encoding: 'base64', //写入当前文件的字符编码
|
encoding: 'binary', //写入当前文件的字符编码
|
||||||
success: (res) => {
|
success: () => {
|
||||||
uni.saveImageToPhotosAlbum({
|
uni.saveImageToPhotosAlbum({
|
||||||
filePath: res,
|
filePath,
|
||||||
success: () => {
|
success: () => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '保存成功',
|
title: '保存成功',
|
||||||
@ -765,7 +752,7 @@ export default {
|
|||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '保存失败',
|
title: '保存失败,请检查权限',
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 5000
|
duration: 5000
|
||||||
})
|
})
|
||||||
|
@ -106,7 +106,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="row-right">
|
<span class="row-right">
|
||||||
<input type="number" placeholder="请填写活动人数" class="input" v-model="form.stock"
|
<input type="number" placeholder="请填写活动人数" class="input" v-model="form.stock"
|
||||||
placeholder-class="plasty" />
|
/>
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
<span class="line-row"></span>
|
<span class="line-row"></span>
|
||||||
@ -792,7 +792,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
apply() {
|
apply() {
|
||||||
let url = '';
|
let url = '/api/school.new_activity/add';
|
||||||
let params = {};
|
let params = {};
|
||||||
this.form.cate_ids = this.list.map(item => item.id).join(',');
|
this.form.cate_ids = this.list.map(item => item.id).join(',');
|
||||||
// 校验详细地址
|
// 校验详细地址
|
||||||
@ -860,11 +860,19 @@ export default {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 校验退款政策
|
||||||
// 校验人数
|
if (this.form.refund_id == '') {
|
||||||
if (this.form.stock == '') {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入活动人数!',
|
title: '请选择退款政策!',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 校验人数
|
||||||
|
if (this.form.stock == '' || this.form.stock < 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入正确的活动人数!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -890,7 +898,6 @@ export default {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
url = '/api/school.new_activity/add'
|
|
||||||
let hdtime = dayjs(this.form.date).format('YYYY-MM-DD HH:mm:ss') + ' - ' + dayjs(this.form.date1).format('YYYY-MM-DD HH:mm:ss');
|
let hdtime = dayjs(this.form.date).format('YYYY-MM-DD HH:mm:ss') + ' - ' + dayjs(this.form.date1).format('YYYY-MM-DD HH:mm:ss');
|
||||||
let bmtime = dayjs(this.form.birth).format('YYYY-MM-DD HH:mm:ss') + ' - ' + dayjs(this.form.birth1).format('YYYY-MM-DD HH:mm:ss');
|
let bmtime = dayjs(this.form.birth).format('YYYY-MM-DD HH:mm:ss') + ' - ' + dayjs(this.form.birth1).format('YYYY-MM-DD HH:mm:ss');
|
||||||
params = {
|
params = {
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
</u-search>
|
</u-search>
|
||||||
<span class="searchBtn" @click.stop="search()">搜索</span>
|
<span class="searchBtn" @click.stop="search()">搜索</span>
|
||||||
</view>
|
</view>
|
||||||
<image src="/static/index/schoolNight.png" alt="" class="imgstop_ye" ></image>
|
<image src="/static/index/schoolNight.png" alt="" class="imgstop_ye" @click="toshool"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +107,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="flex align-items justify-center" style="margin-top: 20rpx;margin-bottom: 32rpx;" >
|
<view class="flex align-items justify-center" style="margin-top: 20rpx;margin-bottom: 32rpx;" >
|
||||||
<image class="imgs_con" v-for="(items_img,index) in item.images.slice(0,3)" :key="index" :src="items_img"></image>
|
<view class="imgs_con_div" v-for="(items_img,index) in item.images.slice(0,3)" :key="index">
|
||||||
|
<image class="imgs_con" mode="widthFix" :src="items_img"></image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -269,6 +271,58 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//跳转夜校
|
||||||
|
toshool(){
|
||||||
|
uni.$u.http
|
||||||
|
.get("/api/user/auto_login_token", {
|
||||||
|
encryption:1
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
if (res.data.token == null && res.data.time == null && res.data.encryption_data == '') {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请登录',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
complete: function() {
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index',
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
wx.openEmbeddedMiniProgram({
|
||||||
|
appId: 'wx867e324c44b9e016',
|
||||||
|
path: 'pages/index/index',
|
||||||
|
extraData: res.data,
|
||||||
|
envVersion: 'trial',
|
||||||
|
success(res) {
|
||||||
|
// 打开成功
|
||||||
|
console.log('成功!',res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: "请求失败,请稍后再试",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
// 获取本地标签列表
|
// 获取本地标签列表
|
||||||
getitembq(){
|
getitembq(){
|
||||||
if (uni.getStorageSync("bqlist") != "") {
|
if (uni.getStorageSync("bqlist") != "") {
|
||||||
@ -509,7 +563,54 @@ export default {
|
|||||||
// 跳转详情
|
// 跳转详情
|
||||||
detail(id) {
|
detail(id) {
|
||||||
if (this.cate_ids == 1) { //夜校
|
if (this.cate_ids == 1) { //夜校
|
||||||
// wx.navigateToMiniProgram(Object object);
|
uni.$u.http
|
||||||
|
.get("/api/user/auto_login_token", {
|
||||||
|
encryption:1
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
if (res.data.token == null && res.data.time == null && res.data.encryption_data == '') {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请登录',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
complete: function() {
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index',
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
wx.navigateToMiniProgram({
|
||||||
|
appId: 'wx867e324c44b9e016',
|
||||||
|
path: 'pages/center/detail?id='+id,
|
||||||
|
extraData: res.data,
|
||||||
|
envVersion: 'trial',
|
||||||
|
success(res) {
|
||||||
|
// 打开成功
|
||||||
|
console.log('成功!',res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: "请求失败,请稍后再试",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
@ -832,18 +933,24 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.imgs_con{
|
.imgs_con_div{
|
||||||
width: 202rpx;
|
margin-right: 12rpx;
|
||||||
height: 202rpx;
|
width: 202rpx;
|
||||||
margin-right: 12rpx;
|
height: 202rpx;
|
||||||
|
overflow: hidden;
|
||||||
&:first-child{
|
&:first-child{
|
||||||
border-radius: 18rpx 0 0 18rpx;
|
border-radius: 18rpx 0 0 18rpx;
|
||||||
}
|
}
|
||||||
&:nth-child(3){
|
&:nth-child(3){
|
||||||
border-radius: 0 18rpx 18rpx 0;
|
border-radius: 0 18rpx 18rpx 0;
|
||||||
}
|
}
|
||||||
|
.imgs_con{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
|
BIN
static/shou.png
BIN
static/shou.png
Binary file not shown.
Before Width: | Height: | Size: 76 KiB |
Loading…
x
Reference in New Issue
Block a user