Selaa lähdekoodia

图片预览及图片拖动功能完成

sys 3 vuotta sitten
vanhempi
commit
f3975201ef

+ 2 - 3
.env.dev.js

@@ -1,7 +1,6 @@
 const config = {
-    // baseUrl: 'lsadmin.test.cc',
-	baseUrl: 'lsadmin.lcpcp.cc',
-	webUrl: 'lsadmin.lcpcp.cc',
+	baseUrl: 'testapi.jhcs888.com',
+	socketUrl: 'testapi.jhcs888.com',
     appName:'开发环境'
 }
 module.exports = config;

+ 2 - 2
.env.prod.js

@@ -1,6 +1,6 @@
 const config = {
-    baseUrl: 'wap.hbfhls.com',
-    webUrl: 'wap.hbfhls.com',
+    baseUrl: 'testapi.jhcs888.com',
+    socketUrl: 'testapi.jhcs888.com',
     appName:'正式环境'
 }
 module.exports = config;

+ 3 - 2
api/ajax.js

@@ -1,6 +1,6 @@
 import tools from "@/common/js/tools";
 import store from '@/store/index'
-let BASE_URL ='http://' + process.uniEnv.baseUrl;
+let BASE_URL ='https://' + process.uniEnv.baseUrl;
 
 
 /**
@@ -18,8 +18,9 @@ export const request = (url, method, data, show = false) => {
   }
   return new Promise((resolve, reject) => {
     // 封装主体:网络请求
+    console.log(url)
     uni.request({
-      url:  url,
+      url:BASE_URL+  url,
       data: data,
       method: method || 'post',
       header: {

+ 3 - 1
api/common.js

@@ -1,6 +1,8 @@
-import {request,uploadFile} from './ajax.js'
+import {request} from './ajax.js'
 
 const commonUrl = '/api/common/'
 // 发送短信
 export const commonSend = (data) => request(commonUrl + 'send', 'post', { ...data })
+// 获取sts
+export const getSts = (data) => request(commonUrl + 'sts', 'post', { ...data })
 

+ 63 - 0
common/js/tools.js

@@ -146,4 +146,67 @@ tools.imgDeal = function (str) {
 }
 
 
+/**
+ * 获取平台类型  1:微信,2:支付宝
+ * @returns {boolean|number}
+ */
+tools.platformType = function () {
+    let ua = window.navigator.userAgent.toLowerCase();
+    if (ua.indexOf('micromessenger') != -1) {
+        return 1;
+    } else if (ua.indexOf('alipay') != -1) {
+        return 2;
+    } else {
+        return 0;
+    }
+}
+
+
+/**
+ * 获取开发平台
+ * @returns {string}
+ */
+tools.getPlatform = function () {
+    let platForm = undefined;
+    // #ifdef H5
+    platForm = 'H5';
+    //#endif
+    // #ifdef APP-PLUS
+    platForm = 'APP';
+    //#endif
+    // #ifdef APP-PLUS-NVUE
+    platForm = 'APP';
+    //#endif
+    // #ifdef APP-NVUE
+    platForm = 'APP';
+    //#endif
+    // #ifdef MP-WEIXIN
+    platForm = 'MP-WEIXIN'; // 小程序
+    //#endif
+    // #ifdef MP-ALIPAY
+    platForm = 'MP-ALIPAY';
+    //#endif
+    // #ifdef MP-BAIDU
+    platForm = 'MP-BAIDU';
+    //#endif
+    // #ifdef MP-TOUTIAO
+    platForm = 'MP-TOUTIAO';
+    //#endif
+    // #ifdef MP-LARK
+    platForm = 'MP-LARK';
+    //#endif
+    // #ifdef MP-QQ
+    platForm = 'MP-QQ';
+    //#endif
+    // #ifdef MP-KUAISHOU
+    platForm = 'MP-KUAISHOU';
+    //#endif
+    // #ifdef QUICKAPP-WEBVIEW
+    platForm = 'QUICKAPP-WEBVIEW';
+    //#endif
+    return platForm;
+
+}
+
+
 export default tools

+ 3 - 3
common/js/upLoadingFile.js

@@ -1,6 +1,6 @@
-// import {
-// 	getSts
-// } from "@/api/common.js";
+import {
+	getSts
+} from "@/api/common.js";
 import tools from "./tools";
 import AliOss from 'uploading-oss'
 let ossData = null;

+ 42 - 17
components/en-utils/en-head-img.vue → components/en-from/en-head/en-head-img.vue

@@ -1,23 +1,26 @@
 <template>
 	<view>
-		<view class="box" @click="isShowPop()">
+		<view class="box" @click="isShowPop(true)">
 			<image class="left" :src="value" mode="aspectFill"></image>
 			<view class="right">
 				<text>{{label}}</text>
 				<image src="@/static/img/toRight.png" mode=""></image>
 			</view>
 		</view>
-		<uni-popup ref="popup" type="bottom"  background-color="#fff">
-			<view class="pop-box" @click="this.editImg(2)">使用相机拍一张</view>
-			<view class="pop-box" @click="this.editImg(1)">从相册选择一张</view>
-		</uni-popup>
+    <uni-popup ref="popup" type="bottom">
+      <view class="popup-block">
+        <view class="popup-row" @click="editImg(1)">拍照</view>
+        <view class="popup-row" @click="editImg(2)">从手机里面选择</view>
+        <view class="popup-row" @click="isShowPop(false)">取消</view>
+      </view>
+    </uni-popup>
 	</view>
 </template>
 
 <script>
 	import { upLoadingFileOss } from "@/common/js/upLoadingFile";
 	import tools from '@/common/js/tools.js'
-	
+
 	export default {
 		props:{
 			label: {
@@ -33,16 +36,16 @@
 			return{}
 		},
 		methods:{
-			isShowPop(){
-				let isH5=false
-				// #ifdef H5
-				isH5=true
-				// #endif
+			isShowPop(type){
 
-				if(isH5){
+				if(tools.getPlatform()==='H5'){
 					this.editImg(1)
 				}else{
-					this.$refs.popup.open('bottom')
+				  if(type){
+            this.$refs.popup.open("bottom")
+          }else {
+            this.$refs.popup.close()
+          }
 				}
 			},
 			editImg(type){
@@ -51,7 +54,7 @@
 					sizeType: ["compressed", "camera"],
 					sourceType: [type===1?"album":"camera"],
 					success:(res)=>{
-						if (res.errMsg == "chooseImage:ok"){
+						if (res.errMsg === "chooseImage:ok"){
 							tools.showLoading()
 							this.upLoadOss(res.tempFiles[0].path)
 						}else{
@@ -60,7 +63,6 @@
 					}
 				})
 			},
-			
 			upLoadOss(path){
 				 upLoadingFileOss(path).then((res)=>{
 					 if(res){
@@ -76,9 +78,32 @@
 			},
 		},
 	}
-</script> 
+</script>
 
 <style scoped lang="scss">
+.popup-block {
+  border-radius: 20rpx 20rpx 0rpx 0rpx;
+  overflow: hidden;
+  background-color: #f5f5f5;
+  .popup-row {
+    height: 100rpx;
+    background-color: #fff;
+    text-align: center;
+    line-height: 100rpx;
+    border-bottom: 2rpx solid #f5f5f5;
+    &:nth-child(2) {
+      margin-bottom: 20rpx;
+    }
+    &:last-child {
+      height: 112rpx;
+      border: none;
+      line-height: 112rpx;
+    }
+    &:active {
+      background-color: rgb(244, 244, 244);
+    }
+  }
+}
 	.box{
 		width: 100%;
 		height: 152rpx;
@@ -114,4 +139,4 @@
 		line-height: 130rpx;
 		font-size: 30rpx;
 	}
-</style>
+</style>

+ 592 - 0
components/en-from/en-upload/en-upload.vue

@@ -0,0 +1,592 @@
+<template>
+  <view class="con">
+    <movable-area class="area" :style="{ height: areaHeight }" @mouseenter="mouseenter" @mouseleave="mouseleave">
+      <block v-for="(item, index) in imageList" :key="item.id">
+        <movable-view class="view" :x="item.x" :y="item.y" direction="all" :damping="40" :disabled="item.disable"
+                      @change="onChange($event, item)" @touchstart="touchstart(item)" @mousedown="touchstart(item)"
+                      @touchend="touchend(item)" @mouseup="touchend(item)"
+                      :style="{ width: viewWidth + 'px', height: viewWidth + 'px', 'z-index': item.zIndex, opacity: item.opacity }">
+          <view class="area-con" @click.stop="examineImgOne(index)"
+                :style="{ width: childWidth, height: childWidth, transform: 'scale(' + item.scale + ')' }">
+            <image  class="pre-image" :src="item.src+(imgType===1?'':'?x-oss-process=video/snapshot,t_7000,f_jpg,w_600,h_0,m_fast')" mode="aspectFill"></image>
+            <text v-if="imgType===2" class="bf-img iconfont"> &#xea82;</text>
+            <view class="del-con" @click.stop="delImage(item, index)" @touchstart.stop="delImageMp(item, index)"
+                  @touchend.stop="nothing()" @mousedown.stop="nothing()" @mouseup.stop="nothing()">
+              <view class="del-wrap">
+<!--                <image class="del-image"-->
+<!--                       src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAyMDowNzoyNSAyMTo1NDoyOU4TkJAAAADcSURBVFhH7ZfRCoMwDEXLvkjwwVf/bH/emmAyN6glTW9WBjsgwm28OeCLpj81Sil7zvlJ90UiONS/yY5VogsO6XrBg3IEQ5a/s8vRSWUAKmLqp2w5jz5BiNQEGMo3GbloDLtFXJ1IkaEuhAiiY6gEIqB4yqACSk9piIBiKQ8VUFpLviKg3C2rESKgWERCBZSWiEfgIfffYvrrsAgoISJ3Apy3zuTxcSxLQkV6ykNEPKVQkZEyiAiiZKgDIaC4upACSlcn5fM/+WuDCAHF1E/Z/N9AhkMZnPNDPI+UDjPIXgAQIGjNAAAAAElFTkSuQmCC">-->
+<!--                </image>-->
+                <text  class="del-image iconfont"> &#xe603;</text>
+              </view>
+            </view>
+          </view>
+        </movable-view>
+      </block>
+      <view class="add" v-if="imageList.length < number"
+            :style="{ top: add.y, left: add.x, width: viewWidth + 'px', height: viewWidth + 'px' }" @click="selectMultimedia">
+        <view class="add-wrap" :style="{ width: childWidth, height: childWidth }">
+          <view class="video-data">
+            <text class="video-img iconfont" >&#xe658;</text>
+          </view>
+        </view>
+      </view>
+    </movable-area>
+  </view>
+</template>
+
+<script>
+import tools from "@/common/js/tools";
+import {upLoadingFileOss} from "@/common/js/upLoadingFile";
+
+export default {
+  components:{
+
+  },
+  data() {
+    return {
+      imageList: [],
+      previewList:[],
+      width: 0,
+      add: {
+        x: 0,
+        y: 0
+      },
+      current: 0,
+      colsValue: 0,
+      viewWidth: 0,
+      tempItem: null,
+      timer: null,
+      changeStatus: true,
+      preStatus: true,
+      ossClient:null
+    }
+  },
+  props: {
+    // 返回排序后图片
+    list: {
+      type: Array,
+      default: function() {
+        return []
+      }
+    },
+    imgType: {
+      type: Number,
+      default: 1
+    },
+    fileNum: {
+      type: Number,
+      default: 9
+    },
+    // 选择图片数量限制
+    number: {
+      type: Number,
+      default: 100
+    },
+    // 图片父容器宽度(实际显示的图片宽度为 imageWidth / 1.1 ),单位 rpx
+    imageWidth: {
+      type: Number,
+      default: 230
+    },
+    // 图片列数(cols > 0 则 imageWidth 无效)
+    cols: {
+      type: Number,
+      default: 0
+    },
+    // 图片周围空白填充,单位 rpx
+    padding: {
+      type: Number,
+      default: 10
+    },
+    // 拖动图片时放大倍数 [0, ∞)
+    scale: {
+      type: Number,
+      default: 1.1
+    },
+    // 拖动图片时不透明度
+    opacity: {
+      type: Number,
+      default: 0.7
+    },
+    // 自定义添加(需配合 @aaddImage 事件使用)
+    custom: {
+      type: Boolean,
+      default: false
+    }
+  },
+  computed: {
+    areaHeight() {
+      if (this.imageList.length < this.number) {
+        return Math.ceil((this.imageList.length + 1) / this.colsValue) * this.viewWidth + 'px'
+      } else {
+        return Math.ceil(this.imageList.length / this.colsValue) * this.viewWidth + 'px'
+      }
+    },
+    childWidth() {
+      return this.viewWidth - this.rpx2px(this.padding) * 2 + 'px'
+    },
+  },
+  created() {
+    this.width = uni.getSystemInfoSync().windowWidth
+    this.viewWidth = this.rpx2px(this.imageWidth)
+  },
+  mounted() {
+    const query = uni.createSelectorQuery().in(this)
+    query.select('.area').boundingClientRect(data => {
+      this.colsValue = Math.floor(data.width / this.viewWidth)
+      if (this.cols > 0) {
+        this.colsValue = this.cols
+        this.viewWidth = data.width / this.cols
+      }
+      for (let item of this.list) {
+        this.addProperties(item)
+      }
+    })
+    query.exec()
+  },
+  methods: {
+    examineImgOne( index) {
+      // this.$emit('examineImgOne',index)
+      // this.previewList = this.list
+      // this.current = index
+      // this.$refs.previewImage.open(index);
+      let imgList = []
+      this.imageList.forEach((item)=>{
+        console.log(item)
+        imgList.push(item.src)
+      })
+      uni.previewImage({
+        urls: imgList,
+        current: index,
+        success: () => {
+          
+        }
+      })
+    },
+    startList(imgList){
+      if(imgList.length<=0){
+        let maxImageNum=this.imageList.length
+        if(maxImageNum>0){
+          for (let i=maxImageNum;i>0;--i){
+            let keyNum=i-1;
+            this.delImage(this.imageList[keyNum],keyNum)
+          }
+        }
+      }else {
+        imgList.forEach((item)=>{
+          this.addProperties(item)
+        })
+      }
+
+    },
+    onChange(e, item) {
+      if (!item) return
+      item.oldX = e.detail.x
+      item.oldY = e.detail.y
+      if (e.detail.source === 'touch') {
+        if (item.moveEnd) {
+          item.offset = Math.sqrt(Math.pow(item.oldX - item.absX * this.viewWidth, 2) + Math.pow(item.oldY - item
+              .absY * this.viewWidth, 2))
+        }
+        let x = Math.floor((e.detail.x + this.viewWidth / 2) / this.viewWidth)
+        if (x >= this.colsValue) return
+        let y = Math.floor((e.detail.y + this.viewWidth / 2) / this.viewWidth)
+        let index = this.colsValue * y + x
+        if (item.index != index && index < this.imageList.length) {
+          this.changeStatus = false
+          for (let obj of this.imageList) {
+            if (item.index > index && obj.index >= index && obj.index < item.index) {
+              this.change(obj, 1)
+            } else if (item.index < index && obj.index <= index && obj.index > item.index) {
+              this.change(obj, -1)
+            } else if (obj.id != item.id) {
+              obj.offset = 0
+              obj.x = obj.oldX
+              obj.y = obj.oldY
+              setTimeout(() => {
+                this.$nextTick(() => {
+                  obj.x = obj.absX * this.viewWidth
+                  obj.y = obj.absY * this.viewWidth
+                })
+              }, 0)
+            }
+          }
+          item.index = index
+          item.absX = x
+          item.absY = y
+          this.sortList()
+        }
+      }
+    },
+    change(obj, i) {
+      obj.index += i
+      obj.offset = 0
+      obj.x = obj.oldX
+      obj.y = obj.oldY
+      obj.absX = obj.index % this.colsValue
+      obj.absY = Math.floor(obj.index / this.colsValue)
+      setTimeout(() => {
+        this.$nextTick(() => {
+          obj.x = obj.absX * this.viewWidth
+          obj.y = obj.absY * this.viewWidth
+        })
+      }, 0)
+    },
+    touchstart(item) {
+      this.imageList.forEach(v => {
+        v.zIndex = v.index + 9
+      })
+      item.zIndex = 99
+      item.moveEnd = true
+      this.tempItem = item
+      this.timer = setTimeout(() => {
+        item.scale = this.scale
+        item.opacity = this.opacity
+        clearTimeout(this.timer)
+        this.timer = null
+      }, 200)
+    },
+    touchend(item) {
+      this.previewImage(item)
+      item.scale = 1
+      item.opacity = 1
+      item.x = item.oldX
+      item.y = item.oldY
+      item.offset = 0
+      item.moveEnd = false
+      setTimeout(() => {
+        this.$nextTick(() => {
+          item.x = item.absX * this.viewWidth
+          item.y = item.absY * this.viewWidth
+          this.tempItem = null
+          this.changeStatus = true
+        })
+      }, 0)
+    },
+    previewImage(item) {
+      console.log(item)
+      if (this.timer && this.preStatus && this.changeStatus && item.offset < 28.28) {
+        clearTimeout(this.timer)
+        this.timer = null
+        let src = this.list.findIndex(v => v === item.src)
+        uni.previewImage({
+          urls: this.list,
+          current: src,
+          success: () => {
+            this.preStatus = false
+            setTimeout(() => {
+              this.preStatus = true
+            }, 600)
+          }
+        })
+      } else if (this.timer) {
+        clearTimeout(this.timer)
+        this.timer = null
+      }
+    },
+    mouseenter() {
+      //#ifdef H5
+      this.imageList.forEach(v => {
+        v.disable = false
+      })
+      //#endif
+
+    },
+    mouseleave() {
+      //#ifdef H5
+      if (this.tempItem) {
+        this.imageList.forEach(v => {
+          v.disable = true
+          v.zIndex = v.index + 9
+          v.offset = 0
+          v.moveEnd = false
+          if (v.id == this.tempItem.id) {
+            if (this.timer) {
+              clearTimeout(this.timer)
+              this.timer = null
+            }
+            v.scale = 1
+            v.opacity = 1
+            v.x = v.oldX
+            v.y = v.oldY
+            this.$nextTick(() => {
+              v.x = v.absX * this.viewWidth
+              v.y = v.absY * this.viewWidth
+              this.tempItem = null
+            })
+          }
+        })
+        this.changeStatus = true
+      }
+      //#endif
+    },
+    selectMultimedia() {
+      if (this.imgType === 1) {
+        //图片选择
+        this.uploadingImg();
+      } else {
+        //视频选择
+        this.uploadingVideo();
+      }
+    },
+    uploadingImg() {
+      if (this.list.length > 100) {
+        tools.error('最多上传100张')
+        return;
+      }
+      uni.chooseImage({
+        count: this.fileNum, //默认9
+        sizeType: 'original', //可以指定是原图还是压缩图,默认二者都有 'camera' : 'album'
+        sourceType: ['album'],
+        success: (res) => {
+          console.log(res.tempFiles)
+          if (res.tempFiles !== undefined) {
+            console.log(res.tempFiles)
+            console.log('--------------------')
+            res.tempFiles.forEach((file) => {
+              if (file.size > (1048576 * 3)) {
+                // tools.error('上传的图片最大3MB')
+              } else {
+                if (this.list.length > 100) {
+                  tools.error('最多上传100张')
+                } else {
+                  console.log('--aaaaaaaaaa------------------')
+                  if(tools.getPlatform()==='H5'){
+                    this.uploadingFile(file);
+                  }else {
+                    this.uploadingFile(file.path);
+                  }
+                }
+              }
+            })
+          }
+        },
+        fail: (e) => {
+          console.log(e)
+        }
+      });
+    },
+    uploadingVideo() {
+      uni.chooseVideo({
+        sourceType: ['album'],
+        maxDuration: 60,
+        success: (res) => {
+          console.log(res)
+          this.uploadingFile(res.tempFile);
+        }
+      });
+    },
+    uploadingFile(file) {
+      //图片上传
+      tools.showLoading();
+      console.log('----------------asdsa')
+      upLoadingFileOss(file).then((res) => {
+        console.log('----------------------上传成功')
+        console.log(res)
+        if (res) {
+          console.log(res)
+          console.log('------------url')
+          this.addProperties(res)
+          tools.hideLoading();
+        }else {
+          tools.hideLoading();
+          tools.error('上传失败')
+        }
+      }).catch((err) => {
+        tools.hideLoading();
+      })
+    },
+    addImages() {
+      if (this.custom) {
+        this.$emit('addImage')
+      } else {
+        let checkNumber = this.number - this.imageList.length
+        uni.chooseImage({
+          count: checkNumber,
+          sourceType: ['album', 'camera'],
+          success: res => {
+            let count = checkNumber <= res.tempFilePaths.length ? checkNumber : res.tempFilePaths.length
+            for (let i = 0; i < count; i++) {
+              this.addProperties(res.tempFilePaths[i])
+            }
+          }
+        })
+      }
+    },
+    addImage(image) {
+      this.addProperties(image)
+    },
+    delImage(item, index) {
+      this.imageList.splice(index, 1)
+      for (let obj of this.imageList) {
+        if (obj.index > item.index) {
+          obj.index -= 1
+          obj.x = obj.oldX
+          obj.y = obj.oldY
+          obj.absX = obj.index % this.colsValue
+          obj.absY = Math.floor(obj.index / this.colsValue)
+          this.$nextTick(() => {
+            obj.x = obj.absX * this.viewWidth
+            obj.y = obj.absY * this.viewWidth
+          })
+        }
+      }
+      this.add.x = (this.imageList.length % this.colsValue) * this.viewWidth + 'px'
+      this.add.y = Math.floor(this.imageList.length / this.colsValue) * this.viewWidth + 'px'
+      this.sortList()
+    },
+    delImageMp(item, index) {
+      //#ifdef MP
+      this.delImage(item, index)
+      //#endif
+    },
+    sortList() {
+      let list = this.imageList.slice()
+      list.sort((a, b) => {
+        return a.index - b.index
+      })
+      for (let i = 0; i < list.length; i++) {
+        list[i] = list[i].src
+      }
+      // this.$emit('update:list', list)
+      this.$emit('input', list)
+    },
+    addProperties(item) {
+      console.log('------------------addProperties')
+      console.log(item)
+      let absX = this.imageList.length % this.colsValue
+      let absY = Math.floor(this.imageList.length / this.colsValue)
+      let x = absX * this.viewWidth
+      let y = absY * this.viewWidth
+      this.imageList.push({
+        src: item,
+        x,
+        y,
+        oldX: x,
+        oldY: y,
+        absX,
+        absY,
+        scale: 1,
+        zIndex: 9,
+        opacity: 1,
+        index: this.imageList.length,
+        id: this.guid(),
+        disable: false,
+        offset: 0,
+        moveEnd: false
+      })
+      this.add.x = (this.imageList.length % this.colsValue) * this.viewWidth + 'px'
+      this.add.y = Math.floor(this.imageList.length / this.colsValue) * this.viewWidth + 'px'
+      this.sortList()
+    },
+    nothing() {},
+    rpx2px(v) {
+      return this.width * v / 750
+    },
+    guid() {
+      function S4() {
+        return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
+      }
+      return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import url("../../static/css/en-common.css");
+.con {
+  padding: 30rpx;
+
+  .area {
+    width: 100%;
+
+    .view {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+      .area-con {
+        position: relative;
+
+        .pre-image {
+          width: 100%;
+          height: 100%;
+          border-radius: 10rpx;
+        }
+
+        .bf-img {
+          width: 40rpx;
+          height: 40rpx;
+          position: absolute;
+          left: 50%;
+          top: 50%;
+          //margin: -20rpx 0 0 -20rpx;
+          z-index: 2;
+        }
+
+        .del-con {
+          position: absolute;
+          top: 5rpx;
+          right: 5rpx;
+          //padding: 0 0 20rpx 20rpx;
+
+          .del-wrap {
+            width: 36rpx;
+            height: 36rpx;
+            //background-color: rgba(0, 0, 0, 0.4);
+            border-radius: 0 0 0 10rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+
+            .del-image {
+              //width: 20rpx;
+              //height: 20rpx;
+            }
+          }
+        }
+      }
+    }
+
+    .add {
+      position: absolute;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+      .add-wrap {
+        // display: flex;
+        // justify-content: center;
+        // align-items: center;
+        background: #F7F7F7;
+        border-radius: 10rpx;
+
+        .add-img {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 0 auto;
+          padding-top: 44rpx;
+        }
+
+        .names {
+          color: #6F6F6F;
+          font-size: 28rpx;
+          text-align: center;
+        }
+        .video-data{
+          width: 212rpx;
+          height: 212rpx;
+          //background-color: #fff;
+          text-align: center;
+          line-height: 212rpx;
+          .video-img {
+            font-size: 100rpx;
+            color: #333333;
+          }
+        }
+
+      }
+    }
+  }
+}
+</style>

BIN
components/static/icon/iconfont.ttf


+ 17 - 11
pages/index/index.vue

@@ -1,19 +1,20 @@
 <template>
 	<view class="box-data">
 		<Nav title="首页"></Nav>
-		<view class="border-item"></view>
-		<enInput v-model="text" label="姓名姓名"></enInput>
-		<enSend v-model="phone" ref="enSendObj" @getCode="getCode"></enSend>
-		<enCheckbox v-model="type" label="爱好爱好" :checkboxData="checkboxData"></enCheckbox>
-		<enRadio v-model="sex" label="性别性别" :radioData="radioData"></enRadio>
-		<enSwitch v-model="status" label="状态试"></enSwitch>
-		<enTextarea v-model="content" label="个人简介"></enTextarea>
-		<enDate v-model="birthday" type="datetime" label="生日生日"></enDate>
+<!--		<view class="border-item"></view>-->
+<!--		<enInput v-model="text" label="姓名姓名"></enInput>-->
+<!--		<enSend v-model="phone" ref="enSendObj" @getCode="getCode"></enSend>-->
+<!--		<enCheckbox v-model="type" label="爱好爱好" :checkboxData="checkboxData"></enCheckbox>-->
+<!--		<enRadio v-model="sex" label="性别性别" :radioData="radioData"></enRadio>-->
+<!--		<enSwitch v-model="status" label="状态试"></enSwitch>-->
+<!--		<enTextarea v-model="content" label="个人简介"></enTextarea>-->
+<!--		<enDate v-model="birthday" type="datetime" label="生日生日"></enDate>-->
 
 		<enHeadImg v-model="img" label="修改头像"></enHeadImg>
+		<enUpload v-model="imgs" label="修改头像"></enUpload>
 
 
-		<view class="" @click="toList()">进入列表演示</view>
+<!--		<view class="" @click="toList()">进入列表演示</view>-->
 	</view>
 
 </template>
@@ -25,10 +26,12 @@
 	import enSwitch from "components/en-from/en-switch/en-switch"
 	import enTextarea from "components/en-from/en-textarea/en-textarea"
 	import enDate from "components/en-from/en-date/en-date"
-	import enHeadImg from "@/components/en-utils/en-head-img.vue"
+	import enHeadImg from "components/en-from/en-head/en-head-img"
+	import enUpload from "components/en-from/en-upload/en-upload"
 
 	export default {
 		components: {
+      enUpload,
 			enDate,
 		 enTextarea,
 		 enSwitch,
@@ -41,7 +44,7 @@
 		data() {
 			return {
 				img:require('@/static/img/2.jpg'),
-				
+        imgs:[require('@/static/img/2.jpg')],
 				phone: '13900139001',
 				birthday: '',
 				text: '来自火星的你',
@@ -70,6 +73,9 @@
 			}
 		},
 		watch: {
+      'imgs': function() {
+        console.log('new--------imgs', this.imgs)
+      },
 			'birthday': function() {
 				console.log('new--------birthday', this.birthday)
 			},