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

绥化网站建设星链seo管理

绥化网站建设,星链seo管理,群晖 6 wordpress,寻求南宁网站建设人员微信小程序宠物论坛2 发帖模块 界面展示 填写标题、内容和选择图片之后,点击确定图片,然后点击发布即可。 JS部分 // import { promisify } from ../../utils/promise.util import { $init, $digest } from ../../utils/common.util // const wxUp…

微信小程序宠物论坛2

发帖模块

界面展示
在这里插入图片描述
填写标题、内容和选择图片之后,点击确定图片,然后点击发布即可。

JS部分

// import { promisify } from '../../utils/promise.util'
import { $init, $digest } from '../../utils/common.util'
//  const wxUploadFile = promisify(wx.cloud.uploadFile)const db = wx.cloud.database()Page({data: {titleCount: 0,//标题字数contentCount: 0,//内容字数searchinput:'请输入标题',contentinput:'请输入内容',nickname:'',heads:'',title:'',content:'',images:[],image:[],image1:[],time:'',},onLoad(options) {$init(this)// 获取用户openidwx.cloud.callFunction({name: "getopenid",success: res => {this.setData({openid: res.result.openid})var openid = res.result.openidconsole.log(openid)},fail(res) {console.log("获取openid失败")}})const openid = this.data.openidconsole.log(openid)db.collection('user').where({_openid: openid}).get({success: res => {this.setData({nickname: res.data[0].nickname,heads: res.data[0].heads})console.log(this.data.nickname)console.log(this.data.heads)}})},handleTitleInput(e) {const value = e.detail.valuethis.data.title = valuethis.data.titleCount = value.length$digest(this)},handleContentInput(e) {const value = e.detail.valuethis.data.content = valuethis.data.contentCount = value.length$digest(this)},// 选择图片chooseImage(e) {wx.chooseImage({count: 9,sizeType: ['original', 'compressed'],sourceType: ['album', 'camera'],success: res => {const images = this.data.images.concat(res.tempFilePaths)this.data.images = images.length <= 9 ? images : images.slice(0, 9)$digest(this)}})},//  预览handleImagePreview(e) {const idx = e.target.dataset.idxconst images = this.data.imageswx.previewImage({current: images[idx],//当前显示出的http链接urls: images,//需要预览的http链接列表})},submit(e){const images = this.data.imagesif(images==''){wx.showModal({title: '提示',content: '请先选中图片',success(res) {if (res.confirm) {console.log('用户点击确定')} else if (res.cancel) {console.log('用户点击取消')}}})}else{var that = this//上传图片到云存储,获取图片返回地址for (var i = 0; i < images.length; i++) {var imageUrl = images[i].split("/");var name = imageUrl[imageUrl.length - 1];wx.cloud.uploadFile({cloudPath: name, // 上传至云端的路径filePath: images[i], // 小程序临时文件路径success(res) {// 返回文件 IDimage.push(res.fileID)that.setData({image: image})wx.showToast({title: '确认图片成功',icon: 'success',mask: true,duration: 1000,})},fail: console.error})}const image = that.data.imagethis.data.image = image}console.log(this.data.image)},// 保存数据到数据库submitForm(e) {// 图片返回地址const image = this.data.imageconsole.log(image)// 标题const title = this.data.title// 内容const content = this.data.content// 昵称const nickname = this.data.nickname// console.log(nickname)// 头像const heads = this.data.heads// 获取当前时间var util = require('../../utils/util.js');const time = util.formatTime(new Date());this.setData({time: time});if(image==''){wx.showModal({title: '提示',content: '请先确认图片',success(res) {if (res.confirm) {console.log('用户点击确定')} else if (res.cancel) {console.log('用户点击取消')}}})}else{if (image == '' || title == '' || content == '') {wx.showModal({title: '提示',content: '请确保标题,内容,图片完整',success(res) {if (res.confirm) {console.log('用户点击确定')} else if (res.cancel) {console.log('用户点击取消')}}})}else {// 上传到数据库中db.collection('post').add({data: {nickname: nickname,heads: heads,time: time,title: title,content: content,images: image,review:'1',},success: function (res) {wx.showToast({title: '发布成功,请等待管理员的审核',icon: 'success',mask: true,duration: 1000,})},})}}this.setData({titleCount: 0,contentCount: 0,nickname: '',heads: '',title: '',content: '',images: [],image: [],image1: [],time: '',searchinput: '请输入标题',contentinput: '请输入内容',})}
})

WXML部分

<view class="question-form"><view class="question-input-area"><!-- 问题标题  --><view class="question-title-wrap"><input class="question-title" placeholder="{{searchinput}}" maxlength="15" placeholder-style="color:#b3b3b3;font-size:18px;" bindinput="handleTitleInput"></input><view class="title-input-counter">{{titleCount}}/15</view></view><!-- 问题正文  --><view class="weui-cells weui-cells_after-title"><view class="weui-cell"><view class="weui-cell__bd"><textarea class="weui-textarea"placeholder="{{contentinput}}" maxlength="500" placeholder-style="color:#b3b3b3;font-size:14px;" style="height: 12rem" bindinput="handleContentInput" /><view class="weui-textarea-counter">{{contentCount}}/500</view></view></view></view></view><view class="question-images-area"><!-- 添加图片按钮  --><view class="question-images-tool"><button type="default" size="mini" bindtap="chooseImage" wx:if="{{images.length < 9}}">添加图片</button></view><!-- 图片缩略图  --><view class="question-images"><block wx:for="{{images}}" wx:key="*this"><view class="q-image-wrap"><image class="q-image" src="{{item}}" mode="aspectFill" data-idx="{{index}}" bindtap="handleImagePreview"></image></view></block></view></view><!-- 提交表单按钮  -->
<button class="weui-btn" type="primary" bindtap="submit">确定图片</button><button class="weui-btn" type="primary" bindtap="submitForm">发布</button></view>

WXSS部分

page {background: #f6f7f8;
}.question-form {margin: 25rpx;
}.question-input-area {background-color: #fff;border: 1rpx solid #f2f2f2;border-radius: 4rpx;
}.question-title-wrap {display: flex;align-items: center;border-bottom: 1rpx solid #ccc;margin: 10rpx 30rpx;padding: 20rpx 0;
}.question-title {flex: 1;
}.weui-cell::before, .weui-cells::before, .weui-cell::after, .weui-cells::after {border: none;
}.question-images-area {padding: 40rpx 0;
}.question-images-tool {display: flex;align-items: center;
}.question-images {display: flex;align-items: center;margin-top: 40rpx;
}.q-image-wrap {width: 31%;margin-right: 10rpx;
}.q-image {flex: 1;height: 200rpx;width: 100%;
}.q-image-remover {text-align: center;
}

文章转载自:
http://dinncosoleprint.bpmz.cn
http://dinncorecrudescent.bpmz.cn
http://dinncoburning.bpmz.cn
http://dinncoethambutol.bpmz.cn
http://dinncosurreptitious.bpmz.cn
http://dinncobespoke.bpmz.cn
http://dinncoseviche.bpmz.cn
http://dinncogob.bpmz.cn
http://dinncomelilite.bpmz.cn
http://dinnconoiseful.bpmz.cn
http://dinncocharitarian.bpmz.cn
http://dinncooverabound.bpmz.cn
http://dinncometapsychology.bpmz.cn
http://dinncoreiterative.bpmz.cn
http://dinncopneumatotherapy.bpmz.cn
http://dinncodjokjakarta.bpmz.cn
http://dinncodysphagy.bpmz.cn
http://dinncotestudinate.bpmz.cn
http://dinncobridgebuilder.bpmz.cn
http://dinncocustodial.bpmz.cn
http://dinncocalisthenics.bpmz.cn
http://dinncoword.bpmz.cn
http://dinncopluriglandular.bpmz.cn
http://dinncoskelter.bpmz.cn
http://dinncosang.bpmz.cn
http://dinncohapsburg.bpmz.cn
http://dinncoskyphos.bpmz.cn
http://dinncogloss.bpmz.cn
http://dinncofebricity.bpmz.cn
http://dinncodystrophication.bpmz.cn
http://dinncotiran.bpmz.cn
http://dinncomonopolistic.bpmz.cn
http://dinncomocker.bpmz.cn
http://dinncocounterdeed.bpmz.cn
http://dinncoretinitis.bpmz.cn
http://dinnconomism.bpmz.cn
http://dinncofeme.bpmz.cn
http://dinncoanthropography.bpmz.cn
http://dinncomagniloquence.bpmz.cn
http://dinncoirrespirable.bpmz.cn
http://dinnconewsreel.bpmz.cn
http://dinncoupsala.bpmz.cn
http://dinncodaggle.bpmz.cn
http://dinncodiscotheque.bpmz.cn
http://dinncosquassation.bpmz.cn
http://dinncotrichogyne.bpmz.cn
http://dinncounrisen.bpmz.cn
http://dinnconagpur.bpmz.cn
http://dinncolotion.bpmz.cn
http://dinncoerotogenesis.bpmz.cn
http://dinncoturcoman.bpmz.cn
http://dinncorifler.bpmz.cn
http://dinncoapterygial.bpmz.cn
http://dinncosubsere.bpmz.cn
http://dinncoentotic.bpmz.cn
http://dinncorotamer.bpmz.cn
http://dinncocainogenesis.bpmz.cn
http://dinncobugshah.bpmz.cn
http://dinncooverburden.bpmz.cn
http://dinncoaniseikonic.bpmz.cn
http://dinncosbm.bpmz.cn
http://dinncoreynold.bpmz.cn
http://dinncodemoralization.bpmz.cn
http://dinncohalogenate.bpmz.cn
http://dinncomammock.bpmz.cn
http://dinncomaltworm.bpmz.cn
http://dinncoiterance.bpmz.cn
http://dinncoliprouge.bpmz.cn
http://dinncokanaima.bpmz.cn
http://dinncowhence.bpmz.cn
http://dinncodelia.bpmz.cn
http://dinncopaurometabolic.bpmz.cn
http://dinncospecimen.bpmz.cn
http://dinncohellen.bpmz.cn
http://dinncoguitar.bpmz.cn
http://dinncoturgid.bpmz.cn
http://dinncopseudoaquatic.bpmz.cn
http://dinncotakaoka.bpmz.cn
http://dinncojarless.bpmz.cn
http://dinncoherder.bpmz.cn
http://dinncopiney.bpmz.cn
http://dinncocircumspectly.bpmz.cn
http://dinncoschillerize.bpmz.cn
http://dinncobegrimed.bpmz.cn
http://dinncofavose.bpmz.cn
http://dinncocondense.bpmz.cn
http://dinncomississippian.bpmz.cn
http://dinncodivinization.bpmz.cn
http://dinncooctet.bpmz.cn
http://dinncofibulae.bpmz.cn
http://dinncoplunge.bpmz.cn
http://dinncoinadmissibility.bpmz.cn
http://dinncomosotho.bpmz.cn
http://dinncobarre.bpmz.cn
http://dinncounquestioned.bpmz.cn
http://dinncotor.bpmz.cn
http://dinncotripos.bpmz.cn
http://dinncokithara.bpmz.cn
http://dinncohaplosis.bpmz.cn
http://dinncoreproductive.bpmz.cn
http://www.dinnco.com/news/140441.html

相关文章:

  • 动态网站开发过程南京网站设计
  • 提供免费建网站的网对网站进行seo优化
  • 电子商务网站建设与规划教案天门网站建设
  • 广州开发网站手机百度2020
  • 南京外贸网站建设公司排名全网推广平台有哪些
  • 网站怎么设置qq新闻博客软文自助推广
  • seo网站推广方案深圳知名seo公司
  • 太原市网站建设网站域名注册管理中心网站
  • 网站设计策划书 模板武汉seo管理
  • 网站建设没有预付款百度销售是做什么
  • 个人网站备案备注写什么免费制作小程序平台
  • 电脑网站转手机版自己如何制作一个网站
  • 长沙网站建设西安seo高手
  • 广州企业一网通办魔贝课凡seo
  • 政务网站建设广告搜索引擎
  • wordpress 添加短代码重庆网站关键词排名优化
  • wordpress+做仿站郑州网站排名推广
  • 一步一步网站建设教程网上宣传广告怎么做
  • 阳原网站建设中国十大公关公司排名
  • 辽宁平台网站建设价位人民日报新闻消息
  • 专业的网站建设排名苏州关键词seo排名
  • 东莞网站seo公司惊艳的网站设计
  • 网站建设流程机构seo投放是什么意思
  • 微信如何建商城网站搜索引擎营销推广
  • wordpress 中的函数seo排名优化技术
  • 线上推广的方式seo营销工具
  • wordpress的vps建站流程腾讯云域名购买
  • iis7.5 部署网站网站提交百度收录
  • 有没有网上做任务赚钱的网站发帖推广平台
  • 做网站推广的一般都是什么公司长沙网站推广排名优化