zs 3 anni fa
parent
commit
015cd78830

+ 13 - 1
pages/competition/index.js

@@ -22,7 +22,7 @@ Page({
     date2: '2018-01-24',//默认结束时间 
     singledate: '2018-09-01',
     time: '12:01',
-    datas:''
+    szList: [],
   },
   // 确定选择
   szChange: function (e) {
@@ -34,6 +34,9 @@ Page({
       if (list[index][val]) data.push(list[index][val])
       else data.push(list[index][0])
     }
+    //存值
+    let sz = [...that.data.szList, { type: data[0], name: data[1] }]
+    that.setData({ szList: sz })
     that.setData({ value: data })
     that.search();
   },
@@ -45,6 +48,15 @@ Page({
     if (e.detail.column == '0') list[1] = array[parseInt(e.detail.value) + 1];
     that.setData({ list: list });
   },
+  //删除
+  toDel: function (e) {
+    const that=this;
+    let list=that.data.szList;
+    let value =e.currentTarget.dataset.index;
+    let data=list.filter((i,index)=>index!=value)
+    this.setData({szList:data})
+
+  },
   search: function () {
     const that = this;
     let data = that.data.levelArray;

+ 4 - 3
pages/competition/index.wxml

@@ -49,10 +49,11 @@
       </view>
       <view class="multone">
         <view class="mult1">
-          <view class="mult">赛制</view>
-          <view class="mults">{{datas}}
-            <text class=" icon iconfont icon-jianhao"></text>
+          <view class="mult11">赛制</view>
+          <view class="mults" wx:for="{{szList}}" wx:key="item">
+            <text>{{item.type}}-{{item.name}}</text>
           </view>
+          <text class=" icon iconfont icon-jianhao" bindtap="toDel" data-index="{{index}}"></text>
         </view>
       </view>
       <view>

+ 9 - 0
pages/competition/index.wxss

@@ -93,6 +93,15 @@
   background-color: white;
   font-weight: 500;
 }
+.mult11{
+  float: left;
+  width: 15%;
+  padding-left:15px;
+  font-size: 14px;
+  line-height: 80rpx;
+  background-color: white;
+  font-weight: 500;
+}
 .mults{
   margin-top: -1px;
   background-color: white;

+ 39 - 14
pages/match/index.js

@@ -9,57 +9,82 @@ Page({
   data: {
     src: '/image/detail.jpg',
     src1: '/image/head1.png',
+    fileList: '/image/head1.png',
     frameStyle: { useTop: false, name: '参赛阵容', leftArrow: false, useBar: false },
     // 主体高度
     infoHeight: '',
     lists: [
       {
-        id: '1',name:'老头1',head:'/image/tou.png'
+        id: '1', name: '老头1', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头2',head:'/image/tou.png'
+        id: '1', name: '老头2', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头3',head:'/image/tou.png'
+        id: '1', name: '老头3', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头4',head:'/image/tou.png'
+        id: '1', name: '老头4', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头5',head:'/image/tou.png'
+        id: '1', name: '老头5', head: '/image/tou.png'
       }
     ],
     list: [
       {
-        id: '1',name:'老头1',head:'/image/tou.png'
+        id: '1', name: '老头1', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头2',head:'/image/tou.png'
+        id: '1', name: '老头2', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头3',head:'/image/tou.png'
+        id: '1', name: '老头3', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头4',head:'/image/tou.png'
+        id: '1', name: '老头4', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头5',head:'/image/tou.png'
+        id: '1', name: '老头5', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头6',head:'/image/tou.png'
+        id: '1', name: '老头6', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头7',head:'/image/tou.png'
+        id: '1', name: '老头7', head: '/image/tou.png'
       },
 
       {
-        id: '1',name:'老头8',head:'/image/tou.png'
+        id: '1', name: '老头8', head: '/image/tou.png'
       },
       {
-        id: '1',name:'老头9',head:'/image/tou.png'
+        id: '1', name: '老头9', head: '/image/tou.png'
       },
+      {
+        id: '1', name: '老头10', head: '/image/tou.png'
+      }
     ],
   },
+  // 上传图片
+  afterRead: function (event) {
+    const { file } = event.detail;
+    // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+    wx.uploadFile({
+      url: app.globalData.fileUrl + '/baoan/elimg/upload',
+      filePath: file.url,
+      name: 'file',
+      formData: {},
+      success: (res) => {
+        console.log(res);
+        if (res.statusCode == '200') {
+          this.setData({ 'el_img': JSON.parse(res.data).uri })
+          let data = [{ name: JSON.parse(res.data).name, url: `${app.globalData.imageUrl}` + JSON.parse(res.data).uri }]
+          this.setData({ fileList: data })
+        } else {
+          wx.showToast({ title: `${res.data.errmsg}`, icon: 'fail', duration: 2000 })
+        }
+      },
+    });
+  },
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
   },

+ 22 - 3
pages/match/index.wxml

@@ -6,9 +6,9 @@
     <view class="two">
       <view class="two1"><text class="twos">参赛阵容</text></view>
       <view class="tworight">
-      <view class="two-1">
-        <image class="imgs" src="{{src1}}"></image>
-      </view>
+        <view class="two-1">
+          <image class="imgs" src="{{src1}}"></image>
+        </view>
         <view class="two-2" wx:key="item" wx:for="{{lists}}">
           <view class="two2">
             <view class="two-left">
@@ -19,5 +19,24 @@
         </view>
       </view>
     </view>
+    <view class="thr">
+      <view class="thrright">
+        <view class="thrleft"><text class="thrss">马尼拉队</text></view>
+        <view class="thr-1" wx:key="item" wx:for="{{list}}">
+          <view class="thr1">
+            <view class="thr-left">
+              <image class="img" src="{{item.head}}"></image>
+            </view>
+            <view class="thr-right"><text class="names">{{item.name}}</text> </view>
+          </view>
+        </view>
+      </view>
+
+    </view>
+    <view class="four">
+      <view class="four1"><text class="fours">现场照片</text>
+        <van-uploader file-list="{{fileList}}" bind:after-read="afterRead" />
+      </view>
+    </view>
   </view>
 </mobile-main>

+ 67 - 3
pages/match/index.wxss

@@ -17,6 +17,7 @@
   float: left;
   padding: 2%;
   background-color: #ffffff;
+  margin-bottom: 0.5%;
 }
 .two-left{
   width: 90%;
@@ -24,8 +25,8 @@
   background-color: #eeeeee;
 }
 .imgs{
-  width: 100%;
-  height: 37.51px; 
+  width: 85%;
+  height: 40.83px; 
 }
 .img{
   width: 100%;
@@ -35,7 +36,7 @@
   padding-top: 15px;
   padding-left: 5px;
   float: left;
-  width: 11%;
+  width: 15%;
   background-color: #ffffff;
 }
 .two2{
@@ -54,4 +55,67 @@
   margin-left: 10px;
   font-size: 13px;
   color: #727272;
+}
+.thr-left{
+  width: 90%;
+  height: 50.64px;
+  background-color: #eeeeee;
+}
+.img{
+  width: 100%;
+  height: 50.64px; 
+}
+.thr{
+  background-color: #ffffff;
+}
+.thrright{
+  background-color: #ffffff;
+  margin-bottom: 2%;
+}
+.thr-1{
+  padding-top: 10px;
+  padding-left: 6.5px;
+  float: left;
+  width: 14.5%;
+  background-color: #ffffff;
+  padding-bottom: 5px;
+}
+.thr1{
+  background-color: #ffffff;
+}
+.thr-2{
+  padding-top: 10px;
+  padding-left: 8px;
+  float: left;
+  width: 18%;
+  height: 75px;
+  background-color: #ffffff;
+  /* border: 1px solid red; */
+}
+.thr2{
+  float: left;
+  width: 50px;
+  height: 50px;
+  border: 2px solid #dddcdc;
+}
+.names{
+  margin-left: 7px;
+  font-size: 13px;
+  color: #727272;
+}
+.thrss{
+  font-size: 14px;
+  font-weight: 500;
+}
+.thrleft{
+  float: left;
+  height: 105px;
+  padding-top: 68px;
+  padding-left: 10px;
+  padding-right: 2px;
+  background-color: #ffffff;
+  margin-bottom: 2%;
+}
+.four{
+
 }