From 3c82008e2e13e27278ec95e209bc83fadb1d7ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=93=A5?= <17630302050@163.com> Date: Wed, 29 Oct 2025 23:35:16 +0800 Subject: [PATCH] qwewewe --- pages/contact/index.js | 3 --- pages/index/detail.js | 31 +++++++++++++++++++------------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/pages/contact/index.js b/pages/contact/index.js index 8eda5d7..5184e89 100644 --- a/pages/contact/index.js +++ b/pages/contact/index.js @@ -31,7 +31,6 @@ Page({ */ onLoad(options) { const accountInfo = wx.getAccountInfoSync(); - console.log(accountInfo.miniProgram); this.setData({ appid: accountInfo.miniProgram.appId, }); @@ -63,7 +62,6 @@ Page({ page: that.data.page, page_size: that.data.page_size, }).then(res => { - console.log('res', res); // generate stable ids across pages so we can prepend without collisions const base = (that.data.page - 1) * that.data.page_size; const list = res.list.map((item, index) => { @@ -77,7 +75,6 @@ Page({ // only auto-scroll if user is at bottom scrollToId: that.data.isAtBottom ? (list[list.length - 1] ? list[list.length - 1].id : '') : that.data.scrollToId }); - console.log('messages', list); }) }, diff --git a/pages/index/detail.js b/pages/index/detail.js index a3ea738..3329ec4 100644 --- a/pages/index/detail.js +++ b/pages/index/detail.js @@ -1,6 +1,7 @@ // 引入公共资源(原生小程序中需确保路径正确,若为工具类可直接 require,若为静态资源需用绝对路径) const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); +const request = require('../../api/request.js'); // 定义舞蹈列表数据(原生小程序用普通数组存储,无需 ref 响应式包装) const danceList = [ @@ -146,17 +147,23 @@ Page({ }); }, handleContact() { - wx.requestSubscribeMessage({ - tmplIds: ['9dCV3z7vRPBGm8iMtSXsD7ZVyUjld46w7HTH9zLnzWw'], - success: (res) => { - wx.navigateTo({ - url: `/pages/contact/index` - }); - }, - fail: (err) => { - console.log(err); - } - }); - + const accountInfo = wx.getAccountInfoSync(); + request('wechat/template', 'post', { + app_id: accountInfo.miniProgram.appId + }).then((res) => { + // return + wx.requestSubscribeMessage({ + tmplIds: [res.template_id], + success: (res) => { + wx.navigateTo({ + url: `/pages/contact/index` + }); + }, + fail: (err) => { + console.log(err); + } + }); + }) + } }); \ No newline at end of file