• 基于微信小程序校园二手交易市场(springboot+ mybatis-plus+mysql+原生微信小程序)


    一、系统介绍

    近年来,随着微信在我国互联网中的广泛使用,基于微信的小程序应用也如雨后春笋,2020年全网小程序已超600万,其中,微信小程序数量超380万。本论文所研究的正是基于微信小程序的电子商城的设计与开发。当前国内,已经是电子商务高速蓬勃发展的时代,人们通过移动互联网消费已是大势所趋。而微信,作为当前社交网络APP中的佼佼者,它不仅仅是一个单纯的手机应用程序,而是一套完整的社交网络生态系统。2017年,微信小程序正式上线,它是一种不用下载就能使用的应用,基于微信平台开发出来的小程序具有用户体验好、流量获取易、开发成本低、微信生态强的优势。它是一项真正的创新,经过几年的发展,已经构造了全新的微信小程序开发环境和开发者生态。本文所研究的"微信小程序电子商城",是根据实际用户的需求,基于微信小程序的开发模式,运用分层式的软件架构,完成了系统的功能设计、数据库设计,并在设计中充分考虑了系统的安全性。通过实际开发并运行,证明该系统稳定、易于操作,且能够满足实际商业活动的需要。 
     

    二、系统功能

       1.微信小程序端:首页、分类、发布商品、购物车、我的、在线下单、订单列表、关于我们等。
       2.后台管理端:banner管理、商品类别管理、用户管理、商品管理、订单管理、意见反馈、系统配置等。

    三、功能截图:

    1.微信小程序端: 

     2.后台管理端:

     

     

     

     

      四、代码实现: 

    1. <view>
    2. <SearchBar>SearchBar>
    3. <view class="index_swiper">
    4. <swiper autoplay indicator-dots circular>
    5. <swiper-item
    6. wx:for="{{swiperList}}"
    7. wx:for-item="swiper"
    8. wx:key="id"
    9. >
    10. <navigator url="/pages/product_detail/index?id={{swiper.id}}">
    11. <image mode="widthFix" src="{{baseUrl+'image/banner/'+swiper.images}}">image>
    12. navigator>
    13. swiper-item>
    14. swiper>
    15. view>
    16. <view class="index_bigType">
    17. <view class="bigTypeRow">
    18. <navigator
    19. bindtap="handleTypeJump"
    20. data-index="{{index}}"
    21. wx:for="{{bigTypeList_row1}}"
    22. wx:for-item="bigType"
    23. wx:for-index="index"
    24. wx:key="id">
    25. <image mode="widthFix" src="{{baseUrl+'image/bigType/'+bigType.image}}">image>
    26. <view style="text-align: center;font-family: 微软雅黑;padding-bottom: 6rpx;">{{bigType.name}}view>
    27. navigator>
    28. view>
    29. <view class="bigTypeRow">
    30. <navigator
    31. bindtap="handleTypeJump"
    32. data-index="{{index+5}}"
    33. wx:for="{{bigTypeList_row2}}"
    34. wx:for-item="bigType"
    35. wx:for-index="index"
    36. wx:key="id">
    37. <image mode="widthFix" src="{{baseUrl+'image/bigType/'+bigType.image}}">image>
    38. <view style="text-align: center;font-family: 微软雅黑;padding-bottom: 6rpx;">{{bigType.name}}view>
    39. navigator>
    40. view>
    41. view>
    42. <view class="index_hot_product">
    43. <view class="product_title">
    44. 热卖推荐
    45. view>
    46. <view class="list">
    47. <view class="product_detail"
    48. wx:for="{{hotProductList}}"
    49. wx:for-item="hotProduct"
    50. wx:for-index="index"
    51. wx:key="id"
    52. >
    53. <navigator url="/pages/product_detail/index?id={{hotProduct.id}}">
    54. <image mode="widthFix" src="{{baseUrl+'image/product/'+hotProduct.proPic}}">image>
    55. <view class="product_name">{{hotProduct.name}}view>
    56. <view class="product_price"> ¥ {{hotProduct.price}}view>
    57. <button size="mini" type="warn" class="product_botton" >立即购买button>
    58. navigator>
    59. view>
    60. view>
    61. view>
    62. view>

    1. package com.campus.controller.admin;
    2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
    3. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
    4. import com.campus.entity.Banner;
    5. import com.campus.entity.FeedBack;
    6. import com.campus.entity.PageBean;
    7. import com.campus.entity.R;
    8. import com.campus.service.IBannerService;
    9. import com.campus.service.IFeedBackService;
    10. import com.campus.util.DateUtil;
    11. import org.apache.commons.io.FileUtils;
    12. import org.springframework.beans.factory.annotation.Autowired;
    13. import org.springframework.beans.factory.annotation.Value;
    14. import org.springframework.web.bind.annotation.*;
    15. import org.springframework.web.multipart.MultipartFile;
    16. import java.io.File;
    17. import java.util.HashMap;
    18. import java.util.Map;
    19. /**
    20. * 管理端-意见反馈Controller控制器
    21. * @create 2022-02-10 7:50
    22. */
    23. @RestController
    24. @RequestMapping("/admin/feedBack")
    25. public class AdminFeedBackController {
    26. @Autowired
    27. private IFeedBackService feedBackService;
    28. @Value("${imagesFilePath}")
    29. private String imagesFilePath;
    30. /**
    31. * 分页查询
    32. * @param pageBean
    33. * @return
    34. */
    35. @RequestMapping("/list")
    36. public R list(@RequestBody PageBean pageBean){
    37. System.out.println(pageBean);
    38. String query=pageBean.getQuery().trim();
    39. Page page=new Page<>(pageBean.getPageNum(),pageBean.getPageSize());
    40. Page pageResult = feedBackService.page(page, new QueryWrapper().like("title", query));
    41. Map map=new HashMap<>();
    42. map.put("feedBackList",pageResult.getRecords());
    43. map.put("total",pageResult.getTotal());
    44. return R.ok(map);
    45. }
    46. /**
    47. * 查询所有数据 下拉框用到
    48. * @return
    49. */
    50. @RequestMapping("/listAll")
    51. public R listAll(){
    52. Map map=new HashMap<>();
    53. map.put("feedBackList",feedBackService.list());
    54. return R.ok(map);
    55. }
    56. /**
    57. * 添加或者修改
    58. * @param feedBack
    59. * @return
    60. */
    61. @PostMapping("/save")
    62. public R save(@RequestBody FeedBack feedBack){
    63. if( feedBack.getId()==null || feedBack.getId()==-1){
    64. feedBackService.save(feedBack);
    65. }else{
    66. feedBackService.saveOrUpdate( feedBack);
    67. }
    68. return R.ok();
    69. }
    70. /**
    71. * 删
    72. * @param id
    73. * @return
    74. */
    75. @GetMapping("/delete/{id}")
    76. public R delete(@PathVariable(value = "id") Integer id){
    77. // 加个判断 大类下面如果有小类,返回报错提示
    78. feedBackService.removeById(id);
    79. return R.ok();
    80. }
    81. /**
    82. * 根据id查询
    83. * @param id
    84. * @return
    85. */
    86. @GetMapping("/{id}")
    87. public R findById(@PathVariable(value = "id") Integer id){
    88. System.out.println("id="+id);
    89. FeedBack feedBack = feedBackService.getById(id);
    90. Map map=new HashMap<>();
    91. map.put("feedBack", feedBack);
    92. return R.ok(map);
    93. }
    94. /**
    95. * 上传商品大类图片
    96. * @param file
    97. * @return
    98. * @throws Exception
    99. */
    100. @RequestMapping("/uploadImage")
    101. public Map uploadImage(MultipartFile file)throws Exception{
    102. Map map=new HashMap();
    103. if(!file.isEmpty()){
    104. // 获取文件名
    105. String fileName = file.getOriginalFilename();
    106. // 获取文件的后缀名
    107. String suffixName = fileName.substring(fileName.lastIndexOf("."));
    108. String newFileName=DateUtil.getCurrentDateStr()+suffixName;
    109. FileUtils.copyInputStreamToFile(file.getInputStream(), new File(imagesFilePath+"/banner/"+newFileName));
    110. map.put("code", 0);
    111. map.put("msg", "上传成功");
    112. Map map2=new HashMap();
    113. map2.put("title", newFileName);
    114. map2.put("src", "/image/banner/"+newFileName);
    115. map.put("data", map2);
    116. }
    117. return map;
    118. }
    119. }

  • 相关阅读:
    pycharm终端激活环境时报错
    6.jQuery中的Ajax上传文件
    【计算机网络原理】初始网络基础
    【嵌入式开发工具】STM32+Keil实现软件工程搭建与开发调试
    shell脚本中循环语句(极其粗糙版)
    7.网络原理之TCP_IP(下)
    目标检测算法——YOLOv5结合轻量化网络MobileNetV3
    解决webpack打包、编译、热更新Node内存不足问题
    重温以太坊的升级之路
    模型推理后处理C++代码优化案例
  • 原文地址:https://blog.csdn.net/qq_40925004/article/details/127886135