自互联网诞生以来,通过不同的方式影响着人们的工作生活,从信息共享到在线交互,事务管理,大数据,人工智能等各个方面。并随着移动网进一步发展,信息技术和现代的生活联系愈加紧密,因此也诞生了许多新的IT行业,其中典型的代表就是电子商务。
电子商务是利用计算机网络和现实交易形成的现代商务,目前在各个国家都快速的发展。电子商务不仅仅包括在线销售,还延伸出快递物流、线上支付、事务处理、网络营销、信息收集等方面。
传统的商务因为人工成本的增加,店铺租金的压力,客户接待量的限制,在发展中受到了许多的约束,电子商务不受时空限制,摆脱了传统商务经营的弊端,使得客户随时随地的在线高速公路服务区加油,推动了企业商务的发展。电子商务和实体商务相辅相成,虽然在一定程度上冲击了线下商户的经营,但是也可以弥补传统销售的不足,提高了用户的高速公路服务区加油需求,减少高速公路服务区加油时间,推动国家的经济发展。因此,高速公路服务区充电桩在线预订系统在国内取得了迅速的发展,各种类型的电子商务商城琳琅满目,国内比较有代表的商城有淘宝、京东等卖场,国外有亚马逊和易趣等。随着移动技术的进一步发展,各种在线支付业务和商务流程逐渐成熟,电子商务无论是在功能上还是安全方面都有了可靠的保证。
目前,高速公路服务区经营压力日益严重,人员工资逐渐增加,经营成本的压力给高速公路服务区带来了前所未有的挑战,因此开发出高速公路服务区充电桩在线预订系统,扩大经营面积,提高经营业绩。通过线上促销带动销售业绩,会员可以通过网上下订单,选择附近的高速公路服务区,在线订购,提高购买的方便性。
首页是在index页面中,该页面包括头部文件header。在首页中先引入相关的JS和CSS样式。在对应模块中调用数据库操作方法,把读取的结果赋赋给RS数据集合对象,通过循环显示信息。
点击高速公路服务区,先打开高速公路服务区的列表界面,在列表界面读取信息,详细表达所有相关高速公路服务区信息,通过后台的数据库操作,把列表绑定到result数据集合中,使用while循环,把所有的信息显示到高速公路服务区界面。
管理员对公告信息进行管理,包括增删改查,在添加中,填写公告的基本信息后把信息插入到数据库中,返回到公告管理列表,在列表中通过关键词搜索可以查询某一个公告。在列表中存在编辑和删除链接,点击删除,通过对应的ID值构造删除语句,删除成功后,更新列表信息。点击编辑跳转到用户修改列表页面,在用户修改页面对信息进行更正后,提交信息即可把更新后的信息保存到数据库,再返回到公告列表页面。
对相同系统进行比较,更深入的进行技术学习。了解当前热门编程语言,分析开发本系统需要的技术经验。最终选择JAVA技术和MySQL数据库存储。JAVA对于开发本系统可更快、更便捷,也更分便于本人的学习。
高速公路服务区充电桩在线预订系统包括高速公路服务区管理、订单管理、用户管理、评论管理、系统管理、注册登录模块,高速公路服务区浏览查询,高速公路服务区订单,个人中心。
最后完成本系统后,进行系统的测试,以达到客户的要求为目的,并进行环境的部署和维护。按照软件工程的流程进行实践和开发,克服学习的困难和理论研究的繁琐。
关键代码:
<template>
<mescroll-uni @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-bar bg-white search" :style="[{top:CustomBar + 'px'}]">
<picker v-if="queryList.length>1" mode="selector" :range="queryList" range-key="queryName" :value="queryIndex" @change="queryChange" style="padding-left: 20upx;">
<view><image style="width: 20upx;height: 33upx;" src="../../static/center/to.png"></image></view>
</picker>
<view v-if="queryIndex==0" class="search-form round">
<text class="cuIcon-search"></text>
<input v-model="searchForm.yonghuzhanghao" type="text" placeholder="用户账号" ></input>
</view>
<view v-if="queryIndex==1" class="search-form round">
<text class="cuIcon-search"></text>
<input v-model="searchForm.xingbie" type="text" placeholder="性别" ></input>
</view>
<view class="action">
<button @tap="search" :style="{width:'auto',borderRadius:'8rpx',height:'80rpx',fontSize:'28rpx',color:'#fff',backgroundColor:btnColor[0],borderColor:btnColor[0]}" class="cu-btn shadow-blur round">搜索</button>
</view>
</view>
<view :style="2 != 1 ? 'display: flex;' : ''">
<!-- 样式1 -->
<!-- 样式2 -->
<!-- 样式3 -->
<!-- 样式4 -->
<view class="list-box5" :style='{"padding":"24rpx","boxShadow":"0 0 12rpx rgba(255,0,0,0)","margin":"0","borderColor":"red","backgroundColor":"rgba(255, 255, 255, 1)","borderRadius":"0","borderWidth":"0","width":"100%","borderStyle":"solid","height":"auto"}' style="box-sizing: border-box;">
<block v-for="(product,index) in list" :key="index">
<view @tap="onDetailTap(product)" v-if="index%6==0" class="list-item" :style='{"padding":"20rpx 30rpx","boxShadow":"0 0 12rpx rgba(255,0,0,0)","margin":"14rpx 0","borderColor":"rgba(22, 113, 193, 1)","backgroundColor":"rgba(255, 255, 255, 1)","borderRadius":"60rpx 0 60rpx 0","borderWidth":"4rpx","width":"100%","borderStyle":"solid","height":"auto"}' style="display: flex;">
<view style="display: flex;justify-content: space-between;">
<text v-if="userid && isAuth('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="!userid && isAuthFront('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="userid && isAuth('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
<text v-if="!userid && isAuthFront('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
</view>
</view>
<view @tap="onDetailTap(product)" v-if="index%6==1" class="list-item" :style='{"padding":"20rpx 30rpx","boxShadow":"0 0 12rpx rgba(255,0,0,0)","margin":"14rpx 0","borderColor":"rgba(22, 113, 193, 1)","backgroundColor":"#f5f5f5","borderRadius":"60rpx 0 60rpx 0","borderWidth":"4rpx","width":"100%","borderStyle":"solid","height":"auto"}' style="display: flex;">
<view style="display: flex;justify-content: space-between;">
<text v-if="userid && isAuth('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="!userid && isAuthFront('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="userid && isAuth('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
<text v-if="!userid && isAuthFront('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
</view>
</view>
<view @tap="onDetailTap(product)" v-if="index%6==2" class="list-item" :style='{"padding":"20rpx 30rpx","boxShadow":"0 0 12rpx rgba(255,0,0,0)","margin":"14rpx 0","borderColor":"rgba(22, 113, 193, 1)","backgroundColor":"rgba(255, 255, 255, 1)","borderRadius":"60rpx 0 60rpx 0","borderWidth":"4rpx","width":"100%","borderStyle":"solid","height":"auto"}' style="display: flex;">
<view style="display: flex;justify-content: space-between;">
<text v-if="userid && isAuth('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="!userid && isAuthFront('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="userid && isAuth('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
<text v-if="!userid && isAuthFront('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
</view>
</view>
<view @tap="onDetailTap(product)" v-if="index%6==3" class="list-item" :style='{"padding":"20rpx 30rpx","boxShadow":"0 0 12rpx rgba(255,0,0,0)","margin":"14rpx 0","borderColor":"rgba(22, 113, 193, 1)","backgroundColor":"#f5f5f5","borderRadius":"60rpx 0 60rpx 0","borderWidth":"4rpx","width":"100%","borderStyle":"solid","height":"auto"}' style="display: flex;">
<view style="display: flex;justify-content: space-between;">
<text v-if="userid && isAuth('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="!userid && isAuthFront('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="userid && isAuth('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
<text v-if="!userid && isAuthFront('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
</view>
</view>
<view @tap="onDetailTap(product)" v-if="index%6==4" class="list-item" :style='{"padding":"20rpx 30rpx","boxShadow":"0 0 12rpx rgba(255,0,0,0)","margin":"14rpx 0","borderColor":"rgba(22, 113, 193, 1)","backgroundColor":"rgba(255, 255, 255, 1)","borderRadius":"60rpx 0 60rpx 0","borderWidth":"4rpx","width":"100%","borderStyle":"solid","height":"auto"}' style="display: flex;">
<view style="display: flex;justify-content: space-between;">
<text v-if="userid && isAuth('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="!userid && isAuthFront('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="userid && isAuth('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
<text v-if="!userid && isAuthFront('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
</view>
</view>
<view @tap="onDetailTap(product)" v-if="index%6==5" class="list-item" :style='{"padding":"20rpx 30rpx","boxShadow":"0 0 12rpx rgba(255,0,0,0)","margin":"14rpx 0","borderColor":"rgba(22, 113, 193, 1)","backgroundColor":"#f5f5f5","borderRadius":"60rpx 0 60rpx 0","borderWidth":"4rpx","width":"100%","borderStyle":"solid","height":"auto"}' style="display: flex;">
<view style="display: flex;justify-content: space-between;">
<text v-if="userid && isAuth('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="!userid && isAuthFront('yonghu','修改')" class="cuIcon-edit" @click.stop="onUpdateTap(product.id)">修改</text>
<text v-if="userid && isAuth('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
<text v-if="!userid && isAuthFront('yonghu','删除')" class="cuIcon-delete" @click.stop="onDeleteTap(product.id)">删除</text>
</view>
</view>
</block>
</view>
<!-- 样式5 -->
</view>
<button :style='{"padding":"0","boxShadow":"0 0 16rpx rgba(0,0,0,0) inset","margin":"0","backgroundColor":"rgba(37, 147, 230, 1)","borderColor":"rgba(37, 147, 230, 1)","borderRadius":"80rpx","color":"#fff","borderWidth":"1","width":"60%","fontSize":"28rpx","borderStyle":"solid","height":"80rpx"}' v-if="userid && isAuth('yonghu','新增')" class="add-btn" @click="onAddTap()">新增</button>
<button :style='{"padding":"0","boxShadow":"0 0 16rpx rgba(0,0,0,0) inset","margin":"0","backgroundColor":"rgba(37, 147, 230, 1)","borderColor":"rgba(37, 147, 230, 1)","borderRadius":"80rpx","color":"#fff","borderWidth":"1","width":"60%","fontSize":"28rpx","borderStyle":"solid","height":"80rpx"}' v-if="!userid && isAuthFront('yonghu','新增')" class="add-btn" @click="onAddTap()">新增</button>
</mescroll-uni>
</template>
<script>
export default {
data() {
return {
btnColor: ['#409eff','#67c23a','#909399','#e6a23c','#f56c6c','#356c6c','#351c6c','#f093a9','#a7c23a','#104eff','#10441f','#a21233','#503319'],
queryList:[
{
queryName:"用户账号",
},
{
queryName:"性别",
},
],
sactiveItem: {"padding":"0 28rpx","boxShadow":"0 0 0px rgba(0,0,0,.3)","margin":"0","borderColor":"rgba(255, 255, 255, 1)","backgroundColor":"rgba(124, 194, 247, 1)","color":"#fff","borderRadius":"0","borderWidth":"2rpx 0","width":"160rpx","lineHeight":"80rpx","fontSize":"28rpx","borderStyle":"solid"},
sitem: {"padding":"0 20rpx","boxShadow":"0 0 0px rgba(0,0,0,.3)","margin":"0","borderColor":"rgba(255, 255, 255, 1)","backgroundColor":"rgba(82, 142, 187, 1)","color":"rgba(255, 255, 255, 1)","borderRadius":"0","borderWidth":"2rpx 0","width":"160rpx","lineHeight":"80rpx","fontSize":"28rpx","borderStyle":"solid"},
queryIndex: 0,
list: [],
userid: '',
mescroll: null, //mescroll实例对象
downOption: {
auto: false //是否在初始化后,自动执行下拉回调callback; 默认true
},
upOption: {
noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
textNoMore: '~ 没有更多了 ~',
},
hasNext: true,
searchForm:{},
CustomBar: '0'
};
},
computed: {
baseUrl() {
return this.$base.url;
}
},
async onShow() {
this.btnColor = this.btnColor.sort(()=> {
return (0.5-Math.random());
});
this.hasNext = true
// 重新加载数据
if (this.mescroll) this.mescroll.resetUpScroll()
},
onLoad(options) {
if(options.userid) {
this.userid=options.userid;
} else {
this.userid = "";
}
this.hasNext = true
// 重新加载数据
if (this.mescroll) this.mescroll.resetUpScroll()
},
methods: {
//查询条件切换
queryChange(e) {
this.queryIndex=e.detail.value;
this.searchForm.yonghuzhanghao="";
this.searchForm.xingbie="";
},
//类别搜索
// mescroll组件初始化的回调,可获取到mescroll对象
mescrollInit(mescroll) {
this.mescroll = mescroll;
},
/*下拉刷新的回调 */
downCallback(mescroll) {
this.hasNext = true
// 重置分页参数页数为1
mescroll.resetUpScroll()
},
/*上拉加载的回调: mescroll携带page的参数, 其中num:当前页 从1开始, size:每页数据条数,默认10 */
async upCallback(mescroll) {
let params = {
page: mescroll.num,
limit: mescroll.size
}
if(this.searchForm.yonghuzhanghao){
params['yonghuzhanghao'] = '%' + this.searchForm.yonghuzhanghao + '%'
}
if(this.searchForm.xingbie){
params['xingbie'] = '%' + this.searchForm.xingbie + '%'
}
let res = {}
if(this.userid) {
res = await this.$api.page(`yonghu`, params);
} else {
res = await this.$api.list(`yonghu`, params);
}
// 如果是第一页数据置空
if (mescroll.num == 1) this.list = [];
this.list = this.list.concat(res.data.list);
if (res.data.list.length == 0) this.hasNext = false;
mescroll.endSuccess(mescroll.size, this.hasNext);
},
// 详情
onDetailTap(item) {
uni.setStorageSync("useridTag",this.userid);
this.$utils.jump(`./detail?id=${item.id}&userid=`+this.userid)
},
// 修改
onUpdateTap(id){
uni.setStorageSync("useridTag",this.userid);
this.$utils.jump(`./add-or-update?id=${id}`)
},
// 添加
onAddTap(){
uni.setStorageSync("useridTag",this.userid);
this.$utils.jump(`./add-or-update`)
},
onDeleteTap(id){
var _this = this;
uni.showModal({
title: '提示',
content: '是否确认删除',
success: async function(res) {
if (res.confirm) {
await _this.$api.del('yonghu', JSON.stringify([id]));
_this.hasNext = true
// 重置分页参数页数为1
_this.mescroll.resetUpScroll()
}
}
});
},
// 搜索
async search(){
this.mescroll.num = 1
let searchForm = {
page: this.mescroll.num,
limit: this.mescroll.size
}
if(this.searchForm.yonghuzhanghao){
searchForm['yonghuzhanghao'] = '%' + this.searchForm.yonghuzhanghao + '%'
}
if(this.searchForm.xingbie){
searchForm['xingbie'] = '%' + this.searchForm.xingbie + '%'
}
let res = {};
if(this.userid) {
res = await this.$api.page(`yonghu`, searchForm);
} else {
res = await this.$api.list(`yonghu`, searchForm);
}
// 如果是第一页数据置空
if (this.mescroll.num == 1) this.list = [];
this.list = this.list.concat(res.data.list);
if (res.data.list.length == 0) this.hasNext = false;
this.mescroll.endSuccess(this.mescroll.size, this.hasNext);
}
}
};
</script>
<style>
/* product */
page {
background: #EEEEEE;
}
view {
font-size: 28upx;
}
.uni-product-list {
display: flex;
width: 100%;
flex-wrap: wrap;
flex-direction: row;
margin-top: 0upx;
// justify-content: space-around;
}
.uni-product {
padding: 10upx;
margin: 10upx;
display: flex;
flex-direction: column;
background: #FFFFFF;
}
.image-view {
height: 330upx;
width: 330upx;
margin: 12upx 0;
}
.uni-product-image {
height: 330upx;
width: 330upx;
}
.uni-product-title {
width: 300upx;
word-break: break-all;
display: -webkit-box;
overflow: hidden;
line-height: 1.5;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.uni-product-price {
margin-top: 10upx;
font-size: 28upx;
line-height: 1.5;
position: relative;
}
.uni-product-price-original {
color: #e80080;
}
.uni-product-price-favour {
color: #888888;
text-decoration: line-through;
margin-left: 10upx;
}
.uni-product-tip {
position: absolute;
right: 10upx;
background-color: #ff3333;
color: #ffffff;
padding: 0 10upx;
border-radius: 5upx;
}
uni-image > div, uni-image > img {
width: 100%;
height: 140px;
object-fit: cover;
}
.add-btn {
position: fixed;
left: 30upx;
right: 30upx;
// #ifndef MP
bottom: 106upx;
// #endif
// #ifdef MP-WEIXIN
bottom: 16upx;
// #endif
z-index: 95;
display: flex;
align-items: center;
justify-content: center;
width: 690upx;
height: 80upx;
font-size: 32upx;
color: #fff;
background-color: red;
border-radius: 10upx;
box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
}
.list {
padding: 20upx 20upx 20upx;
}
.listm {
background: #fff;
border-radius: 15upx;
box-shadow: 0 0 2upx rgba(0, 0, 0, 0.1);
margin-bottom: 20upx;
padding: 30upx;
}
.listmpic {
border-radius: 10upx;
width: 166upx;
margin-right: 20upx;
}
.listmr {
// width: 460upx;
display: inline-block;
flex: 1;
display: flex;
justify-content: space-between;
flex-direction: column;
}
.news-box6 .dian::before {
content: "";
display: block;
width: 8px;
height: 8px;
background-color: red;
position: absolute;
top: -4px;
left: 50%;
transform: translateX(-50%);
border-radius: 100%;
z-index: 1;
}
.hide1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}
.hide2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.hide4 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4;
line-clamp: 4;
-webkit-box-orient: vertical;
}
</style>