123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- const app = getApp()
- const util = require("../../../utils/util");
- const api = require('../../../api/api.js');
- const user = require('../../../utils/user.js');
- import moment from 'moment'
- Page({
- data: {
- xnbList:[
- ],
- imgs:['https://jzmall.lifejingzhi.com/file/wx-servant/badge-star.png','https://jzmall.lifejingzhi.com/file/wx-servant/learn-bg.png']
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- // this.getDetail();
- },
- getDetail(){
- util.request(api.getNewFarmerInfo, {
-
- }, 'GET').then(res=> {
- if (res.errno === 0) {
- let list=res.data;
- list.forEach(item=>{
- if(item.files==''){
- item.imgs=[];
- }else{
- item.imgs=item.files.split(',');
- }
-
- })
- this.setData({
- xnbList:list
- });
- }
- }).catch(err=>{
- });
- },
- imgPre (event) {
- var src = event.currentTarget.dataset.src;//获取data-src
- var imgList = event.currentTarget.dataset.imgs;//获取data-list
- //图片预览
- wx.previewImage({
- current: src, // 当前显示图片的http链接
- urls: imgList // 需要预览的图片http链接列表
- })
- },
- goDetail() {
- wx.navigateTo({
- url: '/pages/upgrade/xnbInfo/xnbInfo',
- })
- },
-
- goUpload(){
- wx.navigateTo({
- url: '/pages/upgrade/addXnb/addXnb',
- });
- },
-
- onReachBottom() {
-
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.getDetail();
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
- })
|