Compare commits

..

No commits in common. "3c82008e2e13e27278ec95e209bc83fadb1d7ef0" and "0ee66f13383fd906c707fc7c7563ba85e6e4ae96" have entirely different histories.

2 changed files with 15 additions and 19 deletions

View File

@ -31,6 +31,7 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
console.log(accountInfo.miniProgram);
this.setData({ this.setData({
appid: accountInfo.miniProgram.appId, appid: accountInfo.miniProgram.appId,
}); });
@ -62,6 +63,7 @@ Page({
page: that.data.page, page: that.data.page,
page_size: that.data.page_size, page_size: that.data.page_size,
}).then(res => { }).then(res => {
console.log('res', res);
// generate stable ids across pages so we can prepend without collisions // generate stable ids across pages so we can prepend without collisions
const base = (that.data.page - 1) * that.data.page_size; const base = (that.data.page - 1) * that.data.page_size;
const list = res.list.map((item, index) => { const list = res.list.map((item, index) => {
@ -75,6 +77,7 @@ Page({
// only auto-scroll if user is at bottom // only auto-scroll if user is at bottom
scrollToId: that.data.isAtBottom ? (list[list.length - 1] ? list[list.length - 1].id : '') : that.data.scrollToId scrollToId: that.data.isAtBottom ? (list[list.length - 1] ? list[list.length - 1].id : '') : that.data.scrollToId
}); });
console.log('messages', list);
}) })
}, },

View File

@ -1,7 +1,6 @@
// 引入公共资源(原生小程序中需确保路径正确,若为工具类可直接 require若为静态资源需用绝对路径 // 引入公共资源(原生小程序中需确保路径正确,若为工具类可直接 require若为静态资源需用绝对路径
const common_vendor = require("../../common/vendor.js"); const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js"); const common_assets = require("../../common/assets.js");
const request = require('../../api/request.js');
// 定义舞蹈列表数据(原生小程序用普通数组存储,无需 ref 响应式包装) // 定义舞蹈列表数据(原生小程序用普通数组存储,无需 ref 响应式包装)
const danceList = [ const danceList = [
@ -147,23 +146,17 @@ Page({
}); });
}, },
handleContact() { handleContact() {
const accountInfo = wx.getAccountInfoSync(); wx.requestSubscribeMessage({
request('wechat/template', 'post', { tmplIds: ['9dCV3z7vRPBGm8iMtSXsD7ZVyUjld46w7HTH9zLnzWw'],
app_id: accountInfo.miniProgram.appId success: (res) => {
}).then((res) => { wx.navigateTo({
// return url: `/pages/contact/index`
wx.requestSubscribeMessage({ });
tmplIds: [res.template_id], },
success: (res) => { fail: (err) => {
wx.navigateTo({ console.log(err);
url: `/pages/contact/index` }
}); });
},
fail: (err) => {
console.log(err);
}
});
})
} }
}); });