修改bug 添加新功能跳转 夜校小程序

This commit is contained in:
张凯 2025-05-16 18:38:40 +08:00
parent 9c4951106f
commit 1551608ee7
7 changed files with 140 additions and 190 deletions

View File

@ -46,7 +46,7 @@
"sdkConfigs" : {
"share" : {
"weixin" : {
"appid" : "wx867e324c44b9e016",
"appid" : "wxd7e2deffbaa22254",
"UniversalLinks" : ""
}
}

View File

@ -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>

View File

@ -197,12 +197,6 @@
"navigationBarTitleText": "报名成功"
}
},
{
"path": "my/Collect",
"style": {
"navigationBarTitleText": "收藏课程"
}
},
{
"path": "my/classCheck",
"style": {

View File

@ -232,6 +232,7 @@
isCanvasToTempFilePath
@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%;"
css=""
>
<l-painter-image
:src="detail.user.avatar"
@ -250,7 +251,7 @@
>
<l-painter-image
: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%;">
@ -730,30 +731,16 @@ export default {
},
//
save() {
// wx.saveImageToPhotosAlbum({
// filePath: e,
// success: function(res) {
// 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';
const base64 = this.path.replace(/^data:image\/\w+;base64,/, ""); //
const arrayBuffer = uni.base64ToArrayBuffer(base64);
const filePath = `${wx.env.USER_DATA_PATH}/temp_${Date.now()}.png`;
uni.getFileSystemManager().writeFile({
filePath: filePath, //
data: base64, //
encoding: 'base64', //
success: (res) => {
filePath, //
data: arrayBuffer, //
encoding: 'binary', //
success: () => {
uni.saveImageToPhotosAlbum({
filePath: res,
filePath,
success: () => {
uni.showToast({
title: '保存成功',
@ -765,7 +752,7 @@ export default {
fail: (err) => {
console.log(err);
uni.showToast({
title: '保存失败',
title: '保存失败,请检查权限',
icon: "none",
duration: 5000
})

View File

@ -106,7 +106,7 @@
</span>
<span class="row-right">
<input type="number" placeholder="请填写活动人数" class="input" v-model="form.stock"
placeholder-class="plasty" />
/>
</span>
</view>
<span class="line-row"></span>
@ -792,7 +792,7 @@ export default {
},
apply() {
let url = '';
let url = '/api/school.new_activity/add';
let params = {};
this.form.cate_ids = this.list.map(item => item.id).join(',');
//
@ -860,11 +860,19 @@ export default {
});
return;
}
//
if (this.form.stock == '') {
// 退
if (this.form.refund_id == '') {
uni.showToast({
title: '请输入活动人数!',
title: '请选择退款政策!',
icon: 'none',
duration: 2000
});
return;
}
//
if (this.form.stock == '' || this.form.stock < 1) {
uni.showToast({
title: '请输入正确的活动人数!',
icon: 'none',
duration: 2000
});
@ -890,7 +898,6 @@ export default {
});
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 bmtime = dayjs(this.form.birth).format('YYYY-MM-DD HH:mm:ss') + ' - ' + dayjs(this.form.birth1).format('YYYY-MM-DD HH:mm:ss');
params = {

View File

@ -30,7 +30,7 @@
</u-search>
<span class="searchBtn" @click.stop="search()">搜索</span>
</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>
@ -107,7 +107,9 @@
</view>
<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>
@ -269,6 +271,58 @@ export default {
// }
},
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(){
if (uni.getStorageSync("bqlist") != "") {
@ -509,7 +563,54 @@ export default {
//
detail(id) {
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{
@ -832,17 +933,23 @@ export default {
}
}
.imgs_con{
width: 202rpx;
height: 202rpx;
margin-right: 12rpx;
.imgs_con_div{
margin-right: 12rpx;
width: 202rpx;
height: 202rpx;
overflow: hidden;
&:first-child{
border-radius: 18rpx 0 0 18rpx;
}
&:nth-child(3){
border-radius: 0 18rpx 18rpx 0;
}
.imgs_con{
width: 100%;
height: 100%;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB