diff --git a/manifest.json b/manifest.json index a09c76b..54c7a59 100644 --- a/manifest.json +++ b/manifest.json @@ -46,7 +46,7 @@ "sdkConfigs" : { "share" : { "weixin" : { - "appid" : "wx867e324c44b9e016", + "appid" : "wxd7e2deffbaa22254", "UniversalLinks" : "" } } diff --git a/packageA/my/Collect.vue b/packageA/my/Collect.vue deleted file mode 100644 index 7920c0a..0000000 --- a/packageA/my/Collect.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - - - diff --git a/pages.json b/pages.json index 284d4e4..12608c5 100644 --- a/pages.json +++ b/pages.json @@ -197,12 +197,6 @@ "navigationBarTitleText": "报名成功" } }, - { - "path": "my/Collect", - "style": { - "navigationBarTitleText": "收藏课程" - } - }, { "path": "my/classCheck", "style": { diff --git a/pages/center/detail.vue b/pages/center/detail.vue index eaedd42..efd848a 100644 --- a/pages/center/detail.vue +++ b/pages/center/detail.vue @@ -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="" > @@ -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 }) diff --git a/pages/center/index.vue b/pages/center/index.vue index 6743b2b..d17f0f7 100644 --- a/pages/center/index.vue +++ b/pages/center/index.vue @@ -106,7 +106,7 @@ + /> @@ -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 = { diff --git a/pages/index/index.vue b/pages/index/index.vue index 20000ec..64aacfd 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -30,7 +30,7 @@ 搜索 - + @@ -107,7 +107,9 @@ - + + + @@ -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%; + } } + } diff --git a/static/shou.png b/static/shou.png deleted file mode 100644 index c6d1d6c..0000000 Binary files a/static/shou.png and /dev/null differ