diff --git a/miniprogram-3/miniprogram/app.json b/miniprogram-3/miniprogram/app.json index 88f8df6..d94b621 100644 --- a/miniprogram-3/miniprogram/app.json +++ b/miniprogram-3/miniprogram/app.json @@ -8,8 +8,14 @@ "pages/52/52", "pages/53/53", "pages/54/54", + "pages/61/6-1", + "pages/62/62", + "pages/63/63", + "pages/64/64", "pages/42/42", "pages/31/31", + "pages/71/71", + "pages/72/72", "pages/index/index" ], "window": { diff --git a/miniprogram-3/miniprogram/image/zhongjiang.png b/miniprogram-3/miniprogram/image/zhongjiang.png new file mode 100644 index 0000000..50968f5 Binary files /dev/null and b/miniprogram-3/miniprogram/image/zhongjiang.png differ diff --git a/miniprogram-3/miniprogram/pages/2/2.js b/miniprogram-3/miniprogram/pages/2/2.js index 1b42e3c..ae7ae51 100644 --- a/miniprogram-3/miniprogram/pages/2/2.js +++ b/miniprogram-3/miniprogram/pages/2/2.js @@ -50,6 +50,8 @@ Page({ if (randomWeight <= cumulativeWeight) { // 将选中的 index 赋值给 app.js 中的 chosen_index 变量 getApp().globalData.chosen_index = index_list[i]; + // getApp().globalData.chosen_index = 0; + console.log('选中的 index:', index_list[i]); // 隐藏加载动画 diff --git a/miniprogram-3/miniprogram/pages/3/3.js b/miniprogram-3/miniprogram/pages/3/3.js index 23300dc..cd3d099 100644 --- a/miniprogram-3/miniprogram/pages/3/3.js +++ b/miniprogram-3/miniprogram/pages/3/3.js @@ -2,6 +2,7 @@ const db = wx.cloud.database(); const app = getApp(); // 获取全局应用实例 + Page({ data: { dataobj: undefined @@ -70,7 +71,7 @@ Page({ // 更新记录中的 score 属性 await db.collection('demolist').doc(record._id).update({ data: { - score: newScore + score:newScore } }); diff --git a/miniprogram-3/miniprogram/pages/31/31.js b/miniprogram-3/miniprogram/pages/31/31.js index 4705899..d38bc48 100644 --- a/miniprogram-3/miniprogram/pages/31/31.js +++ b/miniprogram-3/miniprogram/pages/31/31.js @@ -70,7 +70,7 @@ Page({ // 更新记录中的 score 属性 await db.collection('demolist').doc(record._id).update({ data: { - score: newScore + score:newScore } }); diff --git a/miniprogram-3/miniprogram/pages/4/4.js b/miniprogram-3/miniprogram/pages/4/4.js index 3e2b826..385b662 100644 --- a/miniprogram-3/miniprogram/pages/4/4.js +++ b/miniprogram-3/miniprogram/pages/4/4.js @@ -23,27 +23,76 @@ Page({ } const record = data[0]; - const newScore = record.score + 0.5; // 更新后的 score 值 - + var newScore = record.score ; // 更新后的 score 值 + const flag = Math.round(Math.random());//生成0和1的随机数,用做判断随机事件 + console.log(flag); // 更新记录中的 score 属性 - await db.collection('demolist').doc(record._id).update({ - data: { - score: newScore - } + if(record.score>=10&&flag){ + const value = Math.round(Math.random()); + if(value){ + newScore = newScore *2;//作为上去总结知识点的奖励 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../71/71' }); - - console.log(`更新成功,新的 score 值为:${newScore}`); - + }else{ + newScore = 0;//中大奖,积分归零 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../72/72' + }); + } + }else if(record.score>=-10){ + newScore = newScore +0.5; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); // 数据更新成功后隐藏加载动画并跳转 wx.hideLoading(); wx.redirectTo({ url: '../5-1/5-1' }); + }//进入绝境事件,积分翻倍 + else{ + newScore = newScore +1; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../61/6-1' + }); + } + + + } catch (error) { console.error('更新失败:', error); wx.hideLoading(); // 如果出错也隐藏加载动画 } }, + async updateScoreForIndex_1() { try { // 显示加载动画 @@ -63,22 +112,69 @@ Page({ } const record = data[0]; - const newScore = record.score + 1; // 更新后的 score 值 - + var newScore = record.score ; // 更新后的 score 值 + const flag = Math.round(Math.random());//生成0和1的随机数,用做判断随机事件 + console.log(flag); // 更新记录中的 score 属性 - await db.collection('demolist').doc(record._id).update({ - data: { - score: newScore - } + if(record.score>=10&&flag){ + const value = Math.round(Math.random()); + if(value){ + newScore = newScore *2;//作为上去总结知识点的奖励 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../71/71' }); - - console.log(`更新成功,新的 score 值为:${newScore}`); - + }else{ + newScore = 0;//中大奖,积分归零 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../72/72' + }); + } + }else if(record.score>=-10){ + newScore = newScore +1; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); // 数据更新成功后隐藏加载动画并跳转 wx.hideLoading(); wx.redirectTo({ url: '../52/52' }); + }//进入绝境事件,积分翻倍 + else{ + newScore = newScore +2; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../62/62' + }); + } + + } catch (error) { console.error('更新失败:', error); wx.hideLoading(); // 如果出错也隐藏加载动画 @@ -103,22 +199,68 @@ Page({ } const record = data[0]; - const newScore = record.score + 2; // 更新后的 score 值 - + var newScore = record.score ; // 更新后的 score 值 + const flag = Math.round(Math.random());//生成0和1的随机数,用做判断随机事件 + console.log(flag); // 更新记录中的 score 属性 - await db.collection('demolist').doc(record._id).update({ - data: { - score: newScore - } + if(record.score>=10&&flag){ + const value = Math.round(Math.random()); + if(value){ + newScore = newScore *2;//作为上去总结知识点的奖励 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../71/71' }); - - console.log(`更新成功,新的 score 值为:${newScore}`); - + }else{ + newScore = 0;//中大奖,积分归零 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../72/72' + }); + } + }else if(record.score>=-10){ + newScore = newScore +2; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); // 数据更新成功后隐藏加载动画并跳转 wx.hideLoading(); wx.redirectTo({ url: '../53/53' }); + }//进入绝境事件,积分翻倍 + else{ + newScore = newScore +1; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../63/63' + }); + } + } catch (error) { console.error('更新失败:', error); wx.hideLoading(); // 如果出错也隐藏加载动画 @@ -143,22 +285,67 @@ Page({ } const record = data[0]; - const newScore = record.score + 3; // 更新后的 score 值 - + var newScore = record.score ; // 更新后的 score 值 + const flag = Math.round(Math.random());//生成0和1的随机数,用做判断随机事件 + console.log(flag); // 更新记录中的 score 属性 - await db.collection('demolist').doc(record._id).update({ - data: { - score: newScore - } + if(record.score>=10&&flag){ + const value = Math.round(Math.random()); + if(value){ + newScore = newScore *2;//作为上去总结知识点的奖励 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../71/71' }); - - console.log(`更新成功,新的 score 值为:${newScore}`); - + }else{ + newScore = 0;//中大奖,积分归零 + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../72/72' + }); + } + }else if(record.score>=-10){ + newScore = newScore +3; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); // 数据更新成功后隐藏加载动画并跳转 wx.hideLoading(); wx.redirectTo({ url: '../54/54' }); + }//进入绝境事件 + else{ + newScore = 0; + await db.collection('demolist').doc(record._id).update({ + data: { + score: newScore + } + }); + console.log(`更新成功,新的 score 值为:${newScore}`); + // 数据更新成功后隐藏加载动画并跳转 + wx.hideLoading(); + wx.redirectTo({ + url: '../64/64' + }); + } } catch (error) { console.error('更新失败:', error); wx.hideLoading(); // 如果出错也隐藏加载动画 diff --git a/miniprogram-3/miniprogram/pages/5-1/5-1.wxml b/miniprogram-3/miniprogram/pages/5-1/5-1.wxml index d2eaf7e..baafc18 100644 --- a/miniprogram-3/miniprogram/pages/5-1/5-1.wxml +++ b/miniprogram-3/miniprogram/pages/5-1/5-1.wxml @@ -10,7 +10,7 @@ -虽然,加0.5分 +勇气可嘉,加0.5分 姓名:{{dataobj.name}} 学号:{{dataobj.xuehao}} diff --git a/miniprogram-3/miniprogram/pages/52/52.wxml b/miniprogram-3/miniprogram/pages/52/52.wxml index 45b2609..6557ee4 100644 --- a/miniprogram-3/miniprogram/pages/52/52.wxml +++ b/miniprogram-3/miniprogram/pages/52/52.wxml @@ -10,7 +10,7 @@ -虽然,加1分 +沾点边,加1分 姓名:{{dataobj.name}} 学号:{{dataobj.xuehao}} diff --git a/miniprogram-3/miniprogram/pages/53/53.wxml b/miniprogram-3/miniprogram/pages/53/53.wxml index e6475af..e5fa0e2 100644 --- a/miniprogram-3/miniprogram/pages/53/53.wxml +++ b/miniprogram-3/miniprogram/pages/53/53.wxml @@ -10,7 +10,7 @@ -虽然,加2分 +有点瑕疵,加2分 姓名:{{dataobj.name}} 学号:{{dataobj.xuehao}} diff --git a/miniprogram-3/miniprogram/pages/54/54.wxml b/miniprogram-3/miniprogram/pages/54/54.wxml index 66f8dbc..067a010 100644 --- a/miniprogram-3/miniprogram/pages/54/54.wxml +++ b/miniprogram-3/miniprogram/pages/54/54.wxml @@ -10,7 +10,7 @@ -虽然,加3分 +完美,加3分 姓名:{{dataobj.name}} 学号:{{dataobj.xuehao}} diff --git a/miniprogram-3/miniprogram/pages/61/6-1.js b/miniprogram-3/miniprogram/pages/61/6-1.js new file mode 100644 index 0000000..812432e --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/6-1.js @@ -0,0 +1,83 @@ +// pages/5-1/5-1.js +const db = wx.cloud.database(); +const app = getApp(); // 获取全局应用实例 + +Page({ + data: { + dataobj: undefined + }, + get_data() { + const chosenIndex = app.globalData.chosen_index; // 获取 chosen_index + db.collection("demolist").where({ index: chosenIndex }).get({ + success: res => { + console.log(res); + if (res.data.length > 0) { + this.setData({ + dataobj: res.data[0] + }, () => { + console.log(this.data.dataobj); + }); + } else { + console.log("没有数据"); + } + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.get_data() + + }, + + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/61/6-1.json b/miniprogram-3/miniprogram/pages/61/6-1.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/6-1.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/61/6-1.wxml b/miniprogram-3/miniprogram/pages/61/6-1.wxml new file mode 100644 index 0000000..0157cc9 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/6-1.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + +触发绝境,双倍积分+1! + +姓名:{{dataobj.name}} +学号:{{dataobj.xuehao}} + + 分数:{{dataobj.score}} + + + + + + diff --git a/miniprogram-3/miniprogram/pages/61/6-1.wxss b/miniprogram-3/miniprogram/pages/61/6-1.wxss new file mode 100644 index 0000000..302efc5 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/6-1.wxss @@ -0,0 +1,6 @@ +/* pages/1/1.wxss */ +.box{ + width: auto; + height: 100rpx; + background-color:white; +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/61/61.js b/miniprogram-3/miniprogram/pages/61/61.js new file mode 100644 index 0000000..06c2c88 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/61.js @@ -0,0 +1,66 @@ +// pages/61/61.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/61/61.json b/miniprogram-3/miniprogram/pages/61/61.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/61.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/61/61.wxml b/miniprogram-3/miniprogram/pages/61/61.wxml new file mode 100644 index 0000000..5d9dbe4 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/61.wxml @@ -0,0 +1,2 @@ + +pages/61/61.wxml \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/61/61.wxss b/miniprogram-3/miniprogram/pages/61/61.wxss new file mode 100644 index 0000000..e950369 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/61/61.wxss @@ -0,0 +1 @@ +/* pages/61/61.wxss */ \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/62/62.js b/miniprogram-3/miniprogram/pages/62/62.js new file mode 100644 index 0000000..5f07c93 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/62/62.js @@ -0,0 +1,82 @@ +// pages/52/52.js +const db = wx.cloud.database(); +const app = getApp(); // 获取全局应用实例 + +Page({ + data: { + dataobj: undefined + }, + get_data() { + const chosenIndex = app.globalData.chosen_index; // 获取 chosen_index + db.collection("demolist").where({ index: chosenIndex }).get({ + success: res => { + console.log(res); + if (res.data.length > 0) { + this.setData({ + dataobj: res.data[0] + }, () => { + console.log(this.data.dataobj); + }); + } else { + console.log("没有数据"); + } + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.get_data() + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/62/62.json b/miniprogram-3/miniprogram/pages/62/62.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/62/62.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/62/62.wxml b/miniprogram-3/miniprogram/pages/62/62.wxml new file mode 100644 index 0000000..7143e63 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/62/62.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + +触发绝境,双倍积分+2! + +姓名:{{dataobj.name}} +学号:{{dataobj.xuehao}} + + 分数:{{dataobj.score}} + + + + + + diff --git a/miniprogram-3/miniprogram/pages/62/62.wxss b/miniprogram-3/miniprogram/pages/62/62.wxss new file mode 100644 index 0000000..302efc5 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/62/62.wxss @@ -0,0 +1,6 @@ +/* pages/1/1.wxss */ +.box{ + width: auto; + height: 100rpx; + background-color:white; +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/63/63.js b/miniprogram-3/miniprogram/pages/63/63.js new file mode 100644 index 0000000..de35a24 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/63/63.js @@ -0,0 +1,82 @@ +// pages/53/53.js +const db = wx.cloud.database(); +const app = getApp(); // 获取全局应用实例 + +Page({ + data: { + dataobj: undefined + }, + get_data() { + const chosenIndex = app.globalData.chosen_index; // 获取 chosen_index + db.collection("demolist").where({ index: chosenIndex }).get({ + success: res => { + console.log(res); + if (res.data.length > 0) { + this.setData({ + dataobj: res.data[0] + }, () => { + console.log(this.data.dataobj); + }); + } else { + console.log("没有数据"); + } + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.get_data() + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/63/63.json b/miniprogram-3/miniprogram/pages/63/63.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/63/63.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/63/63.wxml b/miniprogram-3/miniprogram/pages/63/63.wxml new file mode 100644 index 0000000..4bcfda3 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/63/63.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + 触发绝境,双倍积分+4! + +姓名:{{dataobj.name}} +学号:{{dataobj.xuehao}} + + 分数:{{dataobj.score}} + + + + + + diff --git a/miniprogram-3/miniprogram/pages/63/63.wxss b/miniprogram-3/miniprogram/pages/63/63.wxss new file mode 100644 index 0000000..302efc5 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/63/63.wxss @@ -0,0 +1,6 @@ +/* pages/1/1.wxss */ +.box{ + width: auto; + height: 100rpx; + background-color:white; +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/64/64.js b/miniprogram-3/miniprogram/pages/64/64.js new file mode 100644 index 0000000..1a4bc9b --- /dev/null +++ b/miniprogram-3/miniprogram/pages/64/64.js @@ -0,0 +1,82 @@ +// pages/54/54.js +const db = wx.cloud.database(); +const app = getApp(); // 获取全局应用实例 + +Page({ + data: { + dataobj: undefined + }, + get_data() { + const chosenIndex = app.globalData.chosen_index; // 获取 chosen_index + db.collection("demolist").where({ index: chosenIndex }).get({ + success: res => { + console.log(res); + if (res.data.length > 0) { + this.setData({ + dataobj: res.data[0] + }, () => { + console.log(this.data.dataobj); + }); + } else { + console.log("没有数据"); + } + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.get_data() + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/64/64.json b/miniprogram-3/miniprogram/pages/64/64.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/64/64.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/64/64.wxml b/miniprogram-3/miniprogram/pages/64/64.wxml new file mode 100644 index 0000000..d26132a --- /dev/null +++ b/miniprogram-3/miniprogram/pages/64/64.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + +触发绝境和完美回答,直接归零! + +姓名:{{dataobj.name}} +学号:{{dataobj.xuehao}} + + 分数:{{dataobj.score}} + + + + + + diff --git a/miniprogram-3/miniprogram/pages/64/64.wxss b/miniprogram-3/miniprogram/pages/64/64.wxss new file mode 100644 index 0000000..302efc5 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/64/64.wxss @@ -0,0 +1,6 @@ +/* pages/1/1.wxss */ +.box{ + width: auto; + height: 100rpx; + background-color:white; +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/71/71.js b/miniprogram-3/miniprogram/pages/71/71.js new file mode 100644 index 0000000..1a4bc9b --- /dev/null +++ b/miniprogram-3/miniprogram/pages/71/71.js @@ -0,0 +1,82 @@ +// pages/54/54.js +const db = wx.cloud.database(); +const app = getApp(); // 获取全局应用实例 + +Page({ + data: { + dataobj: undefined + }, + get_data() { + const chosenIndex = app.globalData.chosen_index; // 获取 chosen_index + db.collection("demolist").where({ index: chosenIndex }).get({ + success: res => { + console.log(res); + if (res.data.length > 0) { + this.setData({ + dataobj: res.data[0] + }, () => { + console.log(this.data.dataobj); + }); + } else { + console.log("没有数据"); + } + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.get_data() + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/71/71.json b/miniprogram-3/miniprogram/pages/71/71.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/71/71.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/71/71.wxml b/miniprogram-3/miniprogram/pages/71/71.wxml new file mode 100644 index 0000000..9773f1c --- /dev/null +++ b/miniprogram-3/miniprogram/pages/71/71.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + +来讲台上总结一下刚才的知识点,积分翻倍! + +姓名:{{dataobj.name}} +学号:{{dataobj.xuehao}} + + 分数:{{dataobj.score}} + + + + + + diff --git a/miniprogram-3/miniprogram/pages/71/71.wxss b/miniprogram-3/miniprogram/pages/71/71.wxss new file mode 100644 index 0000000..302efc5 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/71/71.wxss @@ -0,0 +1,6 @@ +/* pages/1/1.wxss */ +.box{ + width: auto; + height: 100rpx; + background-color:white; +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/72/72.js b/miniprogram-3/miniprogram/pages/72/72.js new file mode 100644 index 0000000..1a4bc9b --- /dev/null +++ b/miniprogram-3/miniprogram/pages/72/72.js @@ -0,0 +1,82 @@ +// pages/54/54.js +const db = wx.cloud.database(); +const app = getApp(); // 获取全局应用实例 + +Page({ + data: { + dataobj: undefined + }, + get_data() { + const chosenIndex = app.globalData.chosen_index; // 获取 chosen_index + db.collection("demolist").where({ index: chosenIndex }).get({ + success: res => { + console.log(res); + if (res.data.length > 0) { + this.setData({ + dataobj: res.data[0] + }, () => { + console.log(this.data.dataobj); + }); + } else { + console.log("没有数据"); + } + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.get_data() + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/72/72.json b/miniprogram-3/miniprogram/pages/72/72.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/72/72.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram-3/miniprogram/pages/72/72.wxml b/miniprogram-3/miniprogram/pages/72/72.wxml new file mode 100644 index 0000000..08db5ac --- /dev/null +++ b/miniprogram-3/miniprogram/pages/72/72.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + +有maybe,积分归零! + +姓名:{{dataobj.name}} +学号:{{dataobj.xuehao}} + + 分数:{{dataobj.score}} + + + + + + diff --git a/miniprogram-3/miniprogram/pages/72/72.wxss b/miniprogram-3/miniprogram/pages/72/72.wxss new file mode 100644 index 0000000..302efc5 --- /dev/null +++ b/miniprogram-3/miniprogram/pages/72/72.wxss @@ -0,0 +1,6 @@ +/* pages/1/1.wxss */ +.box{ + width: auto; + height: 100rpx; + background-color:white; +} \ No newline at end of file diff --git a/miniprogram-3/project.config.json b/miniprogram-3/project.config.json index 1ee1388..8a9facc 100644 --- a/miniprogram-3/project.config.json +++ b/miniprogram-3/project.config.json @@ -34,7 +34,8 @@ "userConfirmedBundleSwitch": false, "packNpmManually": false, "packNpmRelationList": [], - "minifyWXSS": true + "minifyWXSS": true, + "ignoreUploadUnusedFiles": true }, "appid": "wx1b82b26a362cc917", "projectname": "quickstart-wx-cloud", diff --git a/miniprogram-3/project.private.config.json b/miniprogram-3/project.private.config.json index 41a49d8..94eb630 100644 --- a/miniprogram-3/project.private.config.json +++ b/miniprogram-3/project.private.config.json @@ -35,6 +35,6 @@ } }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "miniprogram-3", + "projectname": "miniprogram-4", "libVersion": "3.6.0" } \ No newline at end of file