一、摘要:

本文详细介绍了一种基于微信小程序的校园二手物品交换系统。该系统采用前端微信开发者工具开发,后端使用java和MySQL进行开发。系统实现了用户注册、用户登录、发布二手物品、搜索商品、留言、收藏、二手信息管理等功能。本论文详细阐述了整个系统的设计、实现和测试过程,并对系统进行了评估。通过该系统的实现,可以帮助学生们更加便捷地交换二手物品,提高物品的使用率和流通率,促进校园绿色消费。
关键词:微信小程序;二手物品;交换系统;Java;MySQL

二 、引言:

随着互联网技术的发展,二手交易市场逐渐成为一个新兴的产业。在校园内,学生们的二手物品交易需求日益增加,例如书籍、电子设备、自行车等。然而,传统的二手物品交易通常面临着信息不对称、交易不透明等问题。因此,开发一种基于微信小程序的校园二手物品交换系统显得尤为重要。本文旨在设计并实现一个方便快捷、安全可靠的校园二手物品交换系统,以解决传统二手交易中的问题。
系统架构设计:本系统采用前后端分离的架构模式,前端采用微信开发者工具开发,后端采用Java和MySQL进行开发。前端微信开发者工具可以使用微信提供的API进行开发,实现小程序的基本功能,包括用户注册、用户登录、发布二手物品、搜索商品、留言等。后端使用Java和MySQL进行开发,实现用户信息管理、二手物品信息管理等功能。

三、系统功能模块:

本系统主要包括以下功能模块:

用户注册模块:用户可以输入手机号码、密码等信息进行注册,系统会发送验证码到用户手机进行验证。
用户登录模块:用户可以使用已注册的账号登录系统,进行相关操作。
发布二手物品模块:用户可以将自己的二手物品发布到系统中,填写物品信息、价格等参数,以便其他用户查询和购买。
搜索商品模块:用户可以通过搜索框输入关键字搜索二手物品,系统会根据关键字匹配相关的物品信息,方便用户快速找到需要的物品。
留言模块:用户可以对已发布的二手物品进行留言,与其他用户进行交流和协商。
收藏模块:用户可以将自己感兴趣的二手物品加入收藏夹,方便后续查看和购买。
二手信息管理模块:用户可以对自己的发布的二手物品进行管理,包括编辑信息、删除信息等操作。系统也会根据用户的购买记录和浏览记录等信息推荐相似的二手物品,方便用户快速找到自己需要的物品。

四、界面展示

在这里插入图片描述

//获取首页信息
  getIndex:function(){
    var self=this;
    wx:wx.request({
      url: api+'/Api/getIndex',
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function(res) {
        console.log("index信息:",res);
        wx.setStorageSync("cateAll",res.data.cate)
        self.setData({
          banner:res.data.banners,
          cate:res.data.cate,
          goods:res.data.goods
        })
      }
    })
  },

在这里插入图片描述

bindSaveTap: function(e) {
    console.log(e)
    var formData = {
      name: e.detail.value.name,
      price: e.detail.value.price,
      info: e.detail.value.info,
      uid: app.globalData.userInfo.id,
      cid:this.data.cid,
      uid:this.data.user.id
    }
    console.log(formData)
    this.upload_file(api+"/Api/goods?act=add", this.data.img, 'pic', formData,
      function(res) {
        console.log("11111111",res);
        var data=JSON.parse(res.data)
        if(data.code==1000){
          wx.showToast({
            title: '成功',
            icon: 'success',
            duration: 2000,
            complete:function(){
              wx.navigateTo({
                url: '../myGoods/myGoods',
              })
            }
          })
        }
      },
      function() {})
  },

在这里插入图片描述

getMyGoods(){
    let self=this;
    wx.request({
      url: api+'/Api/goods',
      data:{uid:self.data.user.id,act:"getMyGoods"},
      success(res){
        console.log(res)
        self.setData({goods:res.data.goods})
      }
    })
  },

在这里插入图片描述

  onShow: function () {
    var self=this;
    wx.request({
      url: api+'/Api/category?act=list',
      success(e){
        self.setData({
          cate:e.data.cateAll
        })
      }
    })
   
  },

在这里插入图片描述

getCateGoods:function(e){
    var self = this;
    wx: wx.request({
      url: api + '/Api/category?act=getCateGoods',
      data:{id:e.id},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function (res) {
        console.log("index信息:", res);
        self.setData({
          cateInfo: res.data.cateInfo,
          goods: res.data.goods
        })
      }
    })
  },

在这里插入图片描述

 onLoad: function (res) {
    console.log(res);
    var self = this;
    var user=wx.getStorageSync("user")
    var id = res.id;
    wx.request({
      url: api + '/Api/goods',
      data: { id: id,uid: user.id,act:"info"},
      method: 'GET',
      dataType: 'json',
      success: function (res) {
        console.log("goodsInfo:", res);
        self.setData({
          id: id,
          goodsInfo: res.data.goodsInfo,
          salerInfo: res.data.salerInfo,
          plain:!res.data.plain
        })
      },
      fail: function (res) {
        wx.showToast({
          title: '请求失败!',
        })
      },

    })
  },

 getOrders() {
    let self = this;
    wx.request({
      url: api + '/Api/orders?act=saleOrders',
      data: { sid: self.data.user.id },
      success(res) {
        console.log(res)
        self.setData({ orders: res.data.orders })
      }
    })
  },

在这里插入图片描述

 <navigator url='../myGoods/myGoods'>
    <view class="page-item vc">
      <view class="vc">
        <image src="/images/icon_yuyue.png" mode="scaleToFill" class="p-icon" />
      </view>
      <view class="item-name">我的二手</view>
      <view class="vc">
        <image src="/images/icon_rightgo.png" mode="scaleToFill" class="p-icon" />
      </view>
    </view>
  </navigator>

五、源码获取

大家点赞、收藏、关注、评论啦 、查看👇🏻👇🏻获取联系方式👇🏻👇🏻z194
在这里插入图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐