Browse Source

coffee 添加权限

wangningfei 4 years ago
parent
commit
81ed86a7ed
6 changed files with 34 additions and 13 deletions
  1. 2 2
      pages/add/index.js
  2. 2 2
      pages/add/index.wxml
  3. 14 3
      pages/detail/index.wxml
  4. 7 1
      pages/detail/index.wxss
  5. 4 4
      pages/index/index.wxml
  6. 5 1
      pages/my/index.wxml

+ 2 - 2
pages/add/index.js

@@ -79,7 +79,7 @@ Page({
     if (!this.data.form.key2) return util.myShowToast('请输入活动地点!');
     if (!this.data.form.key3) return util.myShowToast('请输入活动时间!');
     if (!this.data.form.key5) return util.myShowToast('请输入活动描述!');
-    // if (!this.data.imgList.length) return util.myShowToast('至少上传一张图片!');
+    if (!this.data.imgList.length) return util.myShowToast('至少上传一张图片!');
 
 
     let params = {
@@ -192,7 +192,7 @@ Page({
         }
         console.log('tempFilePaths',tempFilePaths)
         wx.uploadFile({
-          url: 'https://talk.cirray.cn/api/upload_image', //仅为示例,非真实的接口地址
+          url: 'https://hw.cirray.cn/api/upload_image', //仅为示例,非真实的接口地址
           filePath: tempFilePaths[0],
           name: 'file',
           formData: {},

+ 2 - 2
pages/add/index.wxml

@@ -94,10 +94,10 @@
 						<image src="../../img/close.png"></image>
 					</view>
 				</view>
-				<!-- <view class="pic-add" bindtap="updateImg">
+				<view class="pic-add" bindtap="updateImg">
 					<image src="../../img/plus.png" mode="aspectFill"></image>
 					<text>添加图片</text>
-				</view> -->
+				</view>
 
 			</view>
 			<!-- 提交 -->

+ 14 - 3
pages/detail/index.wxml

@@ -35,6 +35,9 @@
 						<text wx:else>{{currentActivity.attendfee}}/人</text>
 					</view>
 				</view>
+
+				<view wx:if="{{currentActivity.category}}">{{currentActivity.category}}</view>
+
 				<view class="label">
 					<view class="label-icon">
 						<image src="../../img/location.png"></image>
@@ -58,11 +61,19 @@
 						报名截止:{{currentActivity.endtime}}
 					</view>
 				</view>
-				<view class="activity" wx:if='{{currentActivity.content}}'>
+				<view class="activity" wx:if='{{currentActivity.speaker}}'>
+					<view class="activity-title">主讲人:</view>
+					<view class="activity-content">
+						<view>
+							{{currentActivity.speaker}}
+						</view>
+					</view>
+				</view>
+				<view class="activity" wx:if='{{currentActivity.attention}}'>
 					<view class="activity-title">活动介绍</view>
 					<view class="activity-content">
 						<view>
-							{{currentActivity.content}}
+							{{currentActivity.attention}}
 						</view>
 					</view>
 				</view>
@@ -76,7 +87,7 @@
 				</view>
 				<view class="traffic" wx:if='{{currentActivity.latitude && currentActivity.longitude}}'>
 					<!-- <view class="traffic-title"></view> -->
-					<!-- <view class="traffic-desc"></view> -->
+					<view class="traffic-desc" wx:if="{{currentActivity.traffic}}">{{currentActivity.traffic}}</view>
 					<view class="traffic-map">
 						<map id="map" longitude="{{currentActivity.longitude}}" latitude="{{currentActivity.latitude}}" scale="14" markers="{{markers}}"></map>
 					</view>

+ 7 - 1
pages/detail/index.wxss

@@ -122,6 +122,8 @@
 .title-l {
   line-height: 56rpx;
   font-size: 40rpx;
+  width: 80%;
+  
 }
 
 .title-r {
@@ -265,7 +267,7 @@
 }
 
 .traffic {
-  padding-top: 62rpx;
+  padding-top: 32rpx;
   color: #313131;
 }
 
@@ -275,6 +277,7 @@
 
 .traffic-desc {
   font-size: 28rpx;
+  padding-bottom: 25rpx;
 }
 
 .traffic-map {
@@ -379,4 +382,7 @@
   bottom: 0;
   width: auto;
   background: none;
+}
+.title-des{
+  color:#999;
 }

+ 4 - 4
pages/index/index.wxml

@@ -70,14 +70,14 @@
 			</block>
 		</scroll-view>
 	</view>
-	<!-- <view class="add" bindtap="goAdd">
+	<view wx:if="{{userInfo.role == 'organizer'}}" class="add" bindtap="goAdd">
 		<text>+</text>
-	</view> -->
-	<!-- <view class="userinfo">
+	</view>
+	<view class="userinfo">
     <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
     <block wx:else>
       <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
       <text class="userinfo-nickname">{{userInfo.nickName}}</text>
     </block>
-  </view> -->
+  </view>
 </view>

+ 5 - 1
pages/my/index.wxml

@@ -48,9 +48,13 @@
 								<view class="fn-d" wx:else>{{item.attendfee}}/人</view>
 							</view>
 							<view class="fn-r" catchtap="touchHandler">
-								<view class="go-detail" catchtap='goDetail' data-id='{{item.id}}'>
+								<view class="go-detail" wx:if="{{userInfo.role == 'general'}}" catchtap='goDetail' data-id='{{item.id}}'>
 									查看
 								</view>
+								<view class="go-detail" wx:if="{{userInfo.role == 'organizer'}}" catchtap='goEdit' data-id='{{item.id}}'>
+									编辑
+								</view>
+								
 							</view>
 						</view>
 					</view>