当前位置: 首页 > wzjs >正文

做合法的海外购网站需要什么手续网络营销大师排行榜

做合法的海外购网站需要什么手续,网络营销大师排行榜,做网站咸阳,wordpress 同步微信素材前面47和48章节对代码进行了分析和解读。但是还是又很多地方需要加精。如方法中的注释,执行中的提示,特别是添加和修改中,相关值的初始化,另外还有页面的刷新,并且在页面刷新时的异步操作 同步化实现。 但这里唯一不好…

        前面47和48章节对代码进行了分析和解读。但是还是又很多地方需要加精。如方法中的注释,执行中的提示,特别是添加和修改中,相关值的初始化,另外还有页面的刷新,并且在页面刷新时的异步操作 同步化实现。

但这里唯一不好的是 使用的数据传输在页面上进行的。推荐可以修改为云对象的方式。

不妨来看看代码:

<template><view class="category"><!-- 分类管理 --><!-- 第二步 --><!-- 这里的row add 中间有一个空格,下面样式就可以写成 .row.add --><view class="row add" @click="clickAdd"><view class="left"><!-- https://uviewui.com/components/icon.html 使用的是uview的icon --><u-icon name="plus" color="#576b95" size="22"></u-icon><text class="text">新增分类</text></view></view><!-- 第一步 --><view class="row" v-for="(item,index) in categoryList" :key="item._id"><view class="left"><!-- 分类名称 --><view class="name">{{item.name}}</view></view><view class="right"><!-- 编辑和删除图标 --><!-- 使用的u-icon组件,自动生成一个class名字为 u-icon --><u-icon name="edit-pen" size="26" color="#576b95" @click="updateData(item._id,item.name)"></u-icon><u-icon name="trash" size="26" color="#EC544F" @click="deleteData(item._id)"></u-icon></view></view><!-- 第三步 --><!-- https://uniapp.dcloud.net.cn/component/uniui/uni-popup.html 使用这里弹出层 官方  使用的是输入框示例 --><!-- 下载安装相应的组件  ref来获取方法进行相应的动作,uview 是通过show 来完成相应的动作 --><!-- @confirm 这是一个回调函数,我们通过这就知道输入的到底是什么 --><uni-popup ref="inputDialog"><uni-popup-dialog mode="input" :value="iptValue" placeholder="请输入分类名称" title="分类名称"@confirm="dialogConfirm"></uni-popup-dialog></uni-popup></view>
</template><script>const db = uniCloud.database()export default {data() {return {// categoryList:[{_id:1,name:"水果"},{_id:2,name:"肉类"}],// 上面是模拟数据  实际写的是空 下面这样的  真实数据来之云存储,并给该变量赋值categoryList: [],iptValue: "",updateID: null};},onLoad() {this.getCateGory()},methods: {//获取数据库中的分类getCateGory() {db.collection("green-mall-categories").get().then(res => {// console.log(res);this.categoryList = res.result.data})},//添加分类clickAdd() {// 值的初始化this.iptValue = "" // 防止修改后,该值不为空,那么新增就先置为空。this.updateID = null; //防止修改后,该值不为空,那么新增就先置为空。//https://uniapp.dcloud.net.cn/component/uniui/uni-popup.html  使用的是Popup Methods中open  // 这里的inputDialog 的属性是ref在uni-popup中// 所以这里使用的是 this.$refs.inputDialog.open();this.$refs.inputDialog.open();},//点击确认按钮   这里的name 是我们green-mall-categories 表里提供的keyasync dialogConfirm(e) {// popup的处理,解决添加时值未空的操作,应该popup有判断,但是自己还是做一个if (!e) {this.warningshow("分类名称为空");return}// 修改的判断,没有变化也不要请求数据库,这里上线了都流量费呀if (this.iptValue == e) {this.warningshow("分类名称未修改");return}//下面才是真的操作if (this.updateID) {//这里 有一个异步同步化的操作,满满的知识载荷await db.collection("green-mall-categories").doc(this.updateID).update({name: e}).then(res => {this.warningshow("修改分类成功");this.getCateGory();})} else {await db.collection("green-mall-categories").add({name: e}).then(res => {this.warningshow("添加分类成功");this.getCateGory();})}//把输入或修改的值改为空,以免下一次在调用就还有上一次的值// this.iptValue = "";},//修改一条分类updateData(id, name) {this.iptValue = name;this.updateID = id;this.$refs.inputDialog.open();},//删除一条分类deleteData(id) {uni.showModal({content: "是否删除该分类?",success: res => {if (res.confirm) {db.collection("green-mall-categories").doc(id).remove().then(res => {this.warningshow("删除分类成功");this.getCateGory();})}},fail: err => {console.log(err);}})},//弹窗提示,人性化的提示。warningshow(str) {uni.showToast({title: str})}}}
</script><style lang="scss">.category {padding: 30rpx;.row {@include flex-box();border-bottom: 1px solid $border-color-light;padding: 26rpx 0;.left {font-size: 34rpx;}.right {@include flex-box();//使用的u-icon组件,自动生成一个class名字为 u-icon .u-icon {margin-left: 30rpx;}}}// 对应的class 就是 row add.row.add {.left {color: $brand-theme-color-aux;@include flex-box();.text {font-size: 36rpx;padding-left: 10rpx;}}}}
</style>

http://www.dtcms.com/wzjs/112678.html

相关文章:

  • 用摄像头直播网站怎么做seo优化关键词排名优化
  • 阿里云怎么注册域名焦作seo推广
  • java开发网站跟php开发网站区别百度搜索广告
  • 哪些网站是用php编写的网站的优化从哪里进行
  • 做外贸网站企业淘宝指数官网
  • 湛江网站制作推广常用的网络营销方法
  • 网站地图页面关键词排名优化网站
  • 天津广告公司网站建设seo搜索工具栏
  • 网站开发界面aso应用商店优化原因
  • 公安备案 交互式网站就在刚刚武汉宣布最新消息
  • Linux主机设置网站首页百度商业平台
  • 做网站版权所有怎么写怎么查百度搜索排名
  • 丽水市建设局网站搜索热门关键词
  • 小程序商家入驻平台seo神器
  • 创建网站要钱吗产品推销
  • dedecms小说网站模板优化方案模板
  • 怎样用自己的服务器做网站广东公共广告20120708
  • 荣誉章标志做网站百度官方版下载
  • 购物网站 app西安网站建设公司排名
  • 机关门户网站app建设思考站外seo是什么
  • 淘宝网站开发用到哪些技术优化设计答案六年级上册语文
  • 网站常用布局seo sem是指什么意思
  • 建设电商网站哪个平台比较好2021年度关键词有哪些
  • 重庆网站设计公司网站制作网络推广
  • 网站建设的社会效益可行性分析代理公司注册
  • 天津市建设厅政府网站商家推广平台有哪些
  • 公司备案证查询网站查询网站查询今天重大新闻国内最新消息
  • 阿里云服务器上做网站湖南长沙疫情最新消息
  • 网站整站程序智能网站排名优化
  • 手机和电脑网站分开做seo入门到精通