|
@@ -1,5 +1,12 @@
|
|
|
// pages/guests/index.js
|
|
|
import api from "../../api/index"
|
|
|
+const {
|
|
|
+ globalData: {
|
|
|
+ systemInfo: {
|
|
|
+ windowWidth
|
|
|
+ }
|
|
|
+ }
|
|
|
+} = getApp()
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -11,11 +18,39 @@ Page({
|
|
|
guests_ordinary: []
|
|
|
},
|
|
|
|
|
|
+ imageload(e) {
|
|
|
+ const {
|
|
|
+ detail: {
|
|
|
+ width,
|
|
|
+ height
|
|
|
+ },
|
|
|
+ currentTarget: {
|
|
|
+ dataset: {
|
|
|
+ index
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } = e;
|
|
|
+ const rwidth = windowWidth * 0.6;
|
|
|
+ const rheight = height / width * rwidth;
|
|
|
+ const item = JSON.parse(JSON.stringify(this.data.guests_marster));
|
|
|
+ item[index].width = rwidth;
|
|
|
+ item[index].height = rheight;
|
|
|
+ this.setData({
|
|
|
+ guests_marster: item
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
- Promise.all([api.getGuests({type: 1}),api.getGuests({type: 2}),api.getGuests({type: 3})]).then(list=>{
|
|
|
+ Promise.all([api.getGuests({
|
|
|
+ type: 1
|
|
|
+ }), api.getGuests({
|
|
|
+ type: 2
|
|
|
+ }), api.getGuests({
|
|
|
+ type: 3
|
|
|
+ })]).then(list => {
|
|
|
const [guests_marster, guests_participate_in, guests_ordinary] = list;
|
|
|
this.setData({
|
|
|
guests_marster: guests_marster || [],
|