微信小程序完整版demo:爱靓女(PHP后端)-小程序 资源下载

[复制链接]
查看3490 | 回复0 | 2020-2-28 14:57 | 显示全部楼层 |阅读模式
商业模板
模板封面:
模板演示: 点击查看演示
购买咨询: QQ:515138
语言: 中文版 
平台: 手机版
颜色: 红色 多色 
适用: 科技/电子/数码/通信 
【实例简介】爱靓女小程序
【实例截图】

微信小程序完整版demo:爱靓女(PHP后端)-小程序 资源下载

微信小程序完整版demo:爱靓女(PHP后端)-小程序 资源下载

微信小程序完整版demo:爱靓女(PHP后端)-小程序 资源下载

微信小程序完整版demo:爱靓女(PHP后端)-小程序 资源下载

【核心代码】
  1. //index.js
  2. //获取应用实例
  3. var app = getApp();

  4. var SystemInfo = wx.getSystemInfoSync()
  5. Page({
  6.     data: {
  7.         list: [],
  8.         page: 1,
  9.         hasMore: true,
  10.         loading: false,
  11.         currentType: 0,
  12.         windowHeight: SystemInfo.windowHeight,
  13.         typeMap: {
  14.             0: '全部',
  15.             1: '清纯美女',
  16.             2: '唯美写真',
  17.             3: '性感美女',
  18.             4: '明星美女',
  19.             5: '丝袜美女',
  20.             6: '美女模特'
  21.         }
  22.     },
  23.     //事件处理函数
  24.     bindViewTap: function() {
  25.         wx.navigateTo({
  26.             url: '../logs/logs'
  27.         })
  28.     },
  29.     previewImage(event) {
  30.         var imgs = event.currentTarget.dataset.imgs;
  31.         var currentUrl = event.currentTarget.dataset.src;
  32.         wx.previewImage({
  33.             current: currentUrl, // 当前显示图片的http链接
  34.             urls: imgs // 需要预览的图片http链接列表
  35.         });
  36.     },
  37.     onLoad: function() {
  38.         console.log('onLoad')
  39.         var that = this
  40.             //调用应用实例的方法获取全局数据
  41.         app.getUserInfo(function(userInfo) {
  42.             //更新数据
  43.             that.setData({
  44.                 userInfo: userInfo
  45.             })
  46.         });
  47.         this.loadData();
  48.     },
  49.     loadData() {
  50.         var that = this;
  51.         this.data.loading = true;
  52.         wx.request({
  53.             url: 'https://xxxx.com/allgirls.php?',
  54.             data: {
  55.                 p: this.data.page,
  56.                 type: this.data.currentType
  57.             },
  58.             method: "GET",
  59.             header: {
  60.                 'content-type': 'application/json'
  61.             },
  62.             success: function(res) {
  63.                 var list = res.data.girls;
  64.                 if (list.length === 0) {
  65.                     that.hasMore = false;
  66.                     return;
  67.                 }

  68.                 list.forEach(function(item) {
  69.                     item.imgs = item.content.split(',');
  70.                     var ret = [];
  71.                     item.imgs.forEach(function(item) {
  72.                         if (/^http/i.test(item)) {
  73.                             ret.push(that.replaceDomain(item));
  74.                         }
  75.                     });
  76.                     item.imgs = ret;
  77.                     item.image = that.replaceDomain(item.image);
  78.                     that.data.list.push(item);
  79.                 });

  80.                 that.setData({
  81.                     list: that.data.list
  82.                 });
  83.                 that.data.page  ;
  84.                 that.data.loading = false;
  85.             }
  86.         });
  87.     },
  88.     changeType(event) {
  89.         this.setData({
  90.             currentType: event.target.dataset.type,
  91.             page: 1,
  92.             list: []
  93.         });
  94.         this.loadData();
  95.     },

  96.     replaceDomain(imgUrl) {
  97.         return imgUrl.replace('//ocnt0imhl.bkt.clouddn.com', '//file.13384.com')
  98.     },
  99.     loadMore() {
  100.         if (!this.data.hasMore || this.data.loading) return;
  101.         this.loadData();
  102.     },
  103.     onShareAppMessage: function() {
  104.         return {
  105.             title: '爱靓女,看美女,应有尽有',
  106.             path: '/pages/girls/girls',
  107.             success: function(res) {
  108.                 // 分享成功
  109.             },
  110.             fail: function(res) {
  111.                 // 分享失败
  112.             }
  113.         }
  114.     }
  115. })
复制代码
安装说明:小程序demo
1、将php文件夹的文件,放到服务器跟目录,修改你服务器上的数据库名称,用户名密码。
2、将data文件下的db.sql数据导入你的数据库
3、将剩下的文件,全部放入小程序的目录

爱靓女.zip (759.47 KB, 下载次数: 0, 售价: 10 丢币)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则