qwewewe
This commit is contained in:
parent
42565511df
commit
3c82008e2e
@ -31,7 +31,6 @@ 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,
|
||||||
});
|
});
|
||||||
@ -63,7 +62,6 @@ 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) => {
|
||||||
@ -77,7 +75,6 @@ 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);
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
// 引入公共资源(原生小程序中需确保路径正确,若为工具类可直接 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 = [
|
||||||
@ -146,17 +147,23 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleContact() {
|
handleContact() {
|
||||||
wx.requestSubscribeMessage({
|
const accountInfo = wx.getAccountInfoSync();
|
||||||
tmplIds: ['9dCV3z7vRPBGm8iMtSXsD7ZVyUjld46w7HTH9zLnzWw'],
|
request('wechat/template', 'post', {
|
||||||
success: (res) => {
|
app_id: accountInfo.miniProgram.appId
|
||||||
wx.navigateTo({
|
}).then((res) => {
|
||||||
url: `/pages/contact/index`
|
// return
|
||||||
});
|
wx.requestSubscribeMessage({
|
||||||
},
|
tmplIds: [res.template_id],
|
||||||
fail: (err) => {
|
success: (res) => {
|
||||||
console.log(err);
|
wx.navigateTo({
|
||||||
}
|
url: `/pages/contact/index`
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user