SSM项目之商铺系统-店铺注册之前端开发(十)

2024-02-18 02:32

本文主要是介绍SSM项目之商铺系统-店铺注册之前端开发(十),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

由于我是后台开发人员,所以我们直接去阿里公司的Suimobile里下载相应的模板使用

直接看写好的前端页面

 

我们建立这样一个文件,是我们增加文件的页面


<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>SUI Mobile Demo</title><meta name="description" content="MSUI: Build mobile apps with simple HTML, CSS, and JS components."><meta name="author" content="阿里巴巴国际UED前端"><meta name="viewport" content="initial-scale=1, maximum-scale=1"><link rel="shortcut icon" href="/favicon.ico"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"><!-- Google Web Fonts --><link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css"><link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css"><link rel="apple-touch-icon-precomposed" href="/assets/img/apple-touch-icon-114x114.png"><script>//ga</script><script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "//hm.baidu.com/hm.js?ba76f8230db5f616edc89ce066670710";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script></head>
<body>
<div class="page-group"><div id="page-label-input" class="page"><header class="bar bar-nav"><a class="button button-link button-nav pull-left back" href="/demos/form"><span class="icon icon-left"></span>返回</a><h1 class="title">商店信息</h1></header><div class="content"><div class="list-block"><ul><!-- Text inputs --><li><div class="item-content"><div class="item-inner"><div class="item-title label">商铺名称</div><div class="item-input"><input type="text" id="shop-name" placeholder="商铺名称"></div></div></div></li><!--商铺分类 下拉列表--><li><div class="item-content"><div class="item-inner"><div class="item-title label">商铺分类</div><div class="item-input"><select id="shop-category"></select></div></div></div></li><!--区域分类  下拉列表--><li><div class="item-content"><div class="item-inner"><div class="item-title label">所属区域</div><div class="item-input"><select id="shop-area"></select></div></div></div></li><!--详细地址 text--><li><div class="item-content"><div class="item-inner"><div class="item-title label">详细地址</div><div class="item-input"><input type="text" id="shop-addr" placeholder="详细地址"></div></div></div></li><!--联系电话 text--><li><div class="item-content"><div class="item-inner"><div class="item-title label">联系电话</div><div class="item-input"><input type="text" id="shop-phone" placeholder="联系电话"></div></div></div></li><!--缩略图 上传控件--><li><div class="item-content"><div class="item-inner"><div class="item-title label">缩略图</div><div class="item-input"><input type="file" id="shop-img"></div></div></div></li><!--店铺简介 textarea--></li><li class="align-top"><div class="item-content"><div class="item-inner"><div class="item-title label">店铺简介</div><div class="item-input"><textarea id="shop-desc"></textarea></div></div></div></li><!--验证码--></ul></div><div class="content-block"><div class="row"><div class="col-50"><a href="#" class="button button-big button-fill button-danger">返回</a></div><div class="col-50"><a href="#" class="button button-big button-fill button-success" id="submit">提交</a></div></div></div></div></div>
</div>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
<script type='text/javascript'src='../resources/js/shop/shopoperation.js' charset='utf-8'></script></body>
</html>

注意:每个框体里都要有一个id,供我们js操作,js就是通过这个id将后台传入的数据存入id相同的html文本框中

接下来我们建立controller来访问到这个页面

我们通过这样一个controller

package storepro.web.shopadmin;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;@Controller
@RequestMapping("/shopadmin")
public class ShopAdminController {@RequestMapping(value = "/shopoperation", method = RequestMethod.GET)public String shopOperation() {return "shop/shopoperation";}
}

我们通过@Controller注解这是一个控制器,通过@RequestMapping注解访问他的url地址和访问方法,通过return返回这个controller返回的html,这里注意,我们本应该这么写return "/WEB-INF/html/shop/shopoperation.html";但是我们在springmvc中配置了访问url的方法

自动添加了前后缀,所以只需要一部分就够了。 

之后输入url打开页面即可。

这里有一个问题整整让我解决了半天

https://blog.csdn.net/Sunmeok/article/details/81330981

这篇关于SSM项目之商铺系统-店铺注册之前端开发(十)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/719773

相关文章

IntelliJ IDEA2025创建SpringBoot项目的实现步骤

《IntelliJIDEA2025创建SpringBoot项目的实现步骤》本文主要介绍了IntelliJIDEA2025创建SpringBoot项目的实现步骤,文中通过示例代码介绍的非常详细,对大家... 目录一、创建 Spring Boot 项目1. 新建项目2. 基础配置3. 选择依赖4. 生成项目5.

golang程序打包成脚本部署到Linux系统方式

《golang程序打包成脚本部署到Linux系统方式》Golang程序通过本地编译(设置GOOS为linux生成无后缀二进制文件),上传至Linux服务器后赋权执行,使用nohup命令实现后台运行,完... 目录本地编译golang程序上传Golang二进制文件到linux服务器总结本地编译Golang程序

Linux系统性能检测命令详解

《Linux系统性能检测命令详解》本文介绍了Linux系统常用的监控命令(如top、vmstat、iostat、htop等)及其参数功能,涵盖进程状态、内存使用、磁盘I/O、系统负载等多维度资源监控,... 目录toppsuptimevmstatIOStatiotopslabtophtopdstatnmon

一文详解SpringBoot中控制器的动态注册与卸载

《一文详解SpringBoot中控制器的动态注册与卸载》在项目开发中,通过动态注册和卸载控制器功能,可以根据业务场景和项目需要实现功能的动态增加、删除,提高系统的灵活性和可扩展性,下面我们就来看看Sp... 目录项目结构1. 创建 Spring Boot 启动类2. 创建一个测试控制器3. 创建动态控制器注

深度解析Java项目中包和包之间的联系

《深度解析Java项目中包和包之间的联系》文章浏览阅读850次,点赞13次,收藏8次。本文详细介绍了Java分层架构中的几个关键包:DTO、Controller、Service和Mapper。_jav... 目录前言一、各大包1.DTO1.1、DTO的核心用途1.2. DTO与实体类(Entity)的区别1

浏览器插件cursor实现自动注册、续杯的详细过程

《浏览器插件cursor实现自动注册、续杯的详细过程》Cursor简易注册助手脚本通过自动化邮箱填写和验证码获取流程,大大简化了Cursor的注册过程,它不仅提高了注册效率,还通过友好的用户界面和详细... 目录前言功能概述使用方法安装脚本使用流程邮箱输入页面验证码页面实战演示技术实现核心功能实现1. 随机

如何在Spring Boot项目中集成MQTT协议

《如何在SpringBoot项目中集成MQTT协议》本文介绍在SpringBoot中集成MQTT的步骤,包括安装Broker、添加EclipsePaho依赖、配置连接参数、实现消息发布订阅、测试接口... 目录1. 准备工作2. 引入依赖3. 配置MQTT连接4. 创建MQTT配置类5. 实现消息发布与订阅

springboot项目打jar制作成镜像并指定配置文件位置方式

《springboot项目打jar制作成镜像并指定配置文件位置方式》:本文主要介绍springboot项目打jar制作成镜像并指定配置文件位置方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录一、上传jar到服务器二、编写dockerfile三、新建对应配置文件所存放的数据卷目录四、将配置文

前端如何通过nginx访问本地端口

《前端如何通过nginx访问本地端口》:本文主要介绍前端如何通过nginx访问本地端口的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、nginx安装1、下载(1)下载地址(2)系统选择(3)版本选择2、安装部署(1)解压(2)配置文件修改(3)启动(4)

怎么用idea创建一个SpringBoot项目

《怎么用idea创建一个SpringBoot项目》本文介绍了在IDEA中创建SpringBoot项目的步骤,包括环境准备(JDK1.8+、Maven3.2.5+)、使用SpringInitializr... 目录如何在idea中创建一个SpringBoot项目环境准备1.1打开IDEA,点击New新建一个项