jwyu 3 жил өмнө
parent
commit
3044a44e9c

+ 1 - 0
README.md

@@ -4,5 +4,6 @@
   2. 该项目使用自定义tabbar,自定义tabbar在根目录custom-tab-bar(文件名不可修改),原生小程序写法。
   3. 该项目大图请放在oss中,在utils/config中配置,已使用全局mixin将图片挂在data中
   4. 分包请按照‘pages-分包模块名’命名
+  5. 所有接口请用 api 开头
 
 	

+ 9 - 0
api/activity.js

@@ -6,9 +6,18 @@ import {httpGet,httpPost} from "@/utils/request.js"
  * 活动列表
  * @param {active_state} 活动状态 1-未开始 2-进行中 3-已结束
  * @param {activity_type} 活动类型 1-线上会议 3-线下沙龙
+ * @param {title} 活动类别/标题(搜索可用)
  * @param page
  * @param limit
  */
 export const apiActivityList=params=>{
     return httpGet('/activity/getPageList',params)
+}
+
+/**
+ * 活动详情
+ * @param activity_id 
+ */
+export const apiActivityDetail=params=>{
+    return httpGet('/activity/getActivityDetail',params)
 }

+ 7 - 0
api/user.js

@@ -37,4 +37,11 @@ export const apiUserLogin=params=>{
  */
 export const apiApplyPermission=params=>{
 	return httpPost('/user/apply',params)
+}
+
+/**
+ * 获取用户最近一条申请单信息
+ */
+export const apiLastApplyRecord=()=>{
+	return httpGet('/user/get_last_apply_record',{})
 }

+ 15 - 5
pages-activity/detail.vue

@@ -33,6 +33,7 @@
 
 <script>
 // 活动详情
+import {apiActivityDetail} from '@/api/activity'
 export default {
   name: "ActivityDetail",
   data() {
@@ -57,12 +58,21 @@ export default {
   },
   onLoad(options) {
     this.id = options.id;
-    setTimeout(()=>{
-        uni.redirectTo({
-            url: '/pages-activity/noAuthority'
-        });
-    },2000)
+    this.getDetail()
+    // setTimeout(()=>{
+    //     uni.redirectTo({
+    //         url: '/pages-activity/noAuthority'
+    //     });
+    // },2000)
   },
+  methods: {
+    async getDetail(){
+      const res=await apiActivityDetail({activity_id:Number(this.id)})
+      if(res.code===200){
+        
+      }
+    }
+  }
 };
 </script>
 

+ 1 - 1
pages-applyPermission/applyResult.vue

@@ -11,7 +11,7 @@
 export default {
   methods: {
     handleBack(){
-      uni.navigateTo();
+      uni.navigateBack();
     }
   }
 }

+ 65 - 31
pages/activity/activity.vue

@@ -2,23 +2,24 @@
     <view class="activity-page">
         <van-sticky style="background: #fff">
             <view class="search-wrap">
-                <van-search
-                    shape="round"
-                    :value="searchVal"
-                    placeholder="搜索您想要的商品名"
+                <van-search 
+                    shape="round" 
+                    :value="searchVal" 
+                    placeholder="搜索您想要的商品名" 
+                    @change="searchValChange" 
+                    @search="onSearch" 
+                    @clear="onClearSearch" 
                 />
             </view>
             <view class="flex tabs-wrap" @click="tabChange">
                 <view
                     :class="['tab-item', tabActive === '1' && 'tab-active']"
                     data-type="1"
-                    >线上会议</view
-                >
+                    >线上会议</view>
                 <view
                     :class="['tab-item', tabActive === '3' && 'tab-active']"
                     data-type="3"
-                    >线下沙龙</view
-                >
+                    >线下沙龙</view>
             </view>
             <view class="flex status-wrap" @click="statusChange">
                 <view
@@ -26,25 +27,22 @@
                         'status-item',
                         statusActive === '1' && 'status-active',
                     ]"
-                    data-status="1"
-                    >本周预告</view
-                >
+                    data-status="1">本周预告
+                </view>
                 <view
                     :class="[
                         'status-item',
                         statusActive === '2' && 'status-active',
                     ]"
-                    data-status="2"
-                    >进行中</view
-                >
+                    data-status="2">进行中
+                </view>
                 <view
                     :class="[
                         'status-item',
                         statusActive === '3' && 'status-active',
                     ]"
-                    data-status="3"
-                    >已结束</view
-                >
+                    data-status="3">已结束
+                </view>
             </view>
         </van-sticky>
 
@@ -57,19 +55,21 @@
             >
                 <view class="status-box status-before">未开始</view>
                 <view class="flex top">
-                    <image
-                        class="avatar"
-                        src="https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/6acec660-4f31-11eb-a16f-5b3e54966275.jpg"
-                        mode="aspectFill"
-                    ></image>
+                    <image class="avatar" :src="item.img" mode="aspectFill"></image>
                     <view class="content">
-                        <view class="van-ellipsis title"
-                            >宏观双周电话会宏观双周电话会</view
-                        >
-                        <view class="name">主讲:某某某</view>
-                        <view class="time"
-                            >时间:{{ start | formatActivityTime(end) }}</view
-                        >
+                        <view class="flex icon-box">
+                            <template v-if="item.city">
+                                <image src='../../static/position.png'></image>
+                                <text>{{item.city}}</text>
+                            </template>
+                            <template v-if="item.hasPlayBack">
+                                <image src='../../static/hf.png'></image>
+                                <text>回放</text>
+                            </template>
+                        </view>
+                        <view class="van-ellipsis title">{{item.activityName}}</view>
+                        <view class="name">主讲:{{item.speaker}}</view>
+                        <view class="time">时间:{{ item.startTime | formatActivityTime(item.endTime) }}</view>
                     </view>
                 </view>
                 <view class="flex bot">
@@ -87,8 +87,6 @@ import { apiActivityList } from '@/api/activity'
 export default {
     data() {
         return {
-            start: '2021-11-12T09:25:01+08:00',
-            end: '2021-11-12T12:25:01+08:00',
             searchVal: '',
             tabActive: '1',
             statusActive: '1',
@@ -118,6 +116,24 @@ export default {
 
 
     methods: {
+        //搜索
+        onSearch(){
+            this.refreshPage()
+            this.getList()
+        },
+
+        //清除搜索内容
+        onClearSearch(){
+            this.searchVal=''
+            this.refreshPage()
+            this.getList()
+        },
+
+        // 同步搜索关键词
+        searchValChange(e){
+            this.searchVal=e.detail
+        },
+
         // 类型切换
         tabChange(e) {
             const type = e.target.dataset.type
@@ -151,6 +167,7 @@ export default {
 
         async getList() {
             const res = await apiActivityList({
+                title:this.searchVal,
                 active_state: Number(this.statusActive),
                 activity_type: Number(this.tabActive),
                 page: this.page,
@@ -252,6 +269,7 @@ export default {
                 font-size: $global-font-size-lg;
                 font-weight: bold;
                 width: 420rpx;
+                padding-right: 130rpx;
                 padding-bottom: 10rpx;
                 border-bottom: 1px solid $global-border-color;
             }
@@ -276,6 +294,22 @@ export default {
                 border: none;
             }
         }
+        .content{
+            width: 420rpx;
+            position: relative;
+            .icon-box{
+                align-items: center;
+                position: absolute;
+                right: 0;
+                top: 8rpx;
+                font-size: $global-font-size-sm;
+                color:$global-text-color-main;
+                image{
+                    width: 26rpx;
+                    height: 26rpx;
+                }
+            }
+        }
     }
 }
 </style>

+ 14 - 12
pages/user/user.vue

@@ -30,20 +30,22 @@
 </template>
 
 <script>
+	import {apiLastApplyRecord} from '@/api/user'
 	export default {
-		data() {
-			return {
-			}
-		},
-		onLoad() {
-			
-		},
-		
 		methods: {
-			handleGoApplyPermission(){
-				uni.navigateTo({
-					url:"/pages-applyPermission/applyPermission"
-				})
+			async handleGoApplyPermission(){
+				const res=await apiLastApplyRecord()
+				if(res.code===200){
+					if(!res.data){
+						uni.navigateTo({
+							url:"/pages-applyPermission/applyPermission"
+						})
+					}else{
+						uni.navigateTo({
+							url:"/pages-applyPermission/applyResult"
+						})
+					}
+				}		
 			}
 		}
 	}

BIN
static/hf.png


BIN
static/logo.png


BIN
static/position.png


+ 3 - 0
utils/request.js

@@ -96,6 +96,9 @@ const http=(url,params,method)=>{
 					refreshToken(url,params,method,resolve)
 					return 
 				}
+
+				// 无权限
+				
 				
 				resolve(res.data)
 			},