jwyu 2 lat temu
rodzic
commit
36c2bfceac
5 zmienionych plików z 155 dodań i 7 usunięć
  1. 1 1
      api/user.js
  2. 2 1
      pages.json
  3. 3 3
      pages/report/report.vue
  4. 83 0
      pages/voice/components/noAuth.vue
  5. 66 2
      pages/voice/voice.vue

+ 1 - 1
api/user.js

@@ -48,7 +48,7 @@ export const apiUserLogin=params=>{
  * @param company_name 公司名
  * @param permission 选择的权限
  * @param real_name 姓名
- * @param source 来源:我的1、活动2、图库3、研报4
+ * @param source 来源:我的1、活动2、图库3、研报4、问答社区5、价格驱动6、沙盘推演7、语音播报8
  * @param source_agent 来源平台:1:小程序、2:小程序(pc)、3:公众号、4:官网web(pc)
  * @param from_page 来源页面: '活动列表'、'活动详情'等
  */

+ 2 - 1
pages.json

@@ -347,7 +347,8 @@
   			"van-col": "/wxcomponents/vant/col/index",
 			"van-progress": "/wxcomponents/vant/progress/index",
 			"van-dialog": "/wxcomponents/vant/dialog/index",
-			"van-cell": "/wxcomponents/vant/cell/index"
+			"van-cell": "/wxcomponents/vant/cell/index",
+			"van-tree-select": "/wxcomponents/vant/tree-select/index"
 		}
 	}
 }

+ 3 - 3
pages/report/report.vue

@@ -545,10 +545,10 @@ movable-area{
 	display: flex;
 	padding:  40rpx 34rpx 20rpx;
 	align-items: center;
-	// justify-content: space-between;
+	justify-content: space-between;
 	.card-item {
-		margin-right: 40rpx;
-		&:last-child { margin-right: 0; }
+		// margin-right: 40rpx;
+		// &:last-child { margin-right: 0; }
 		.card-ico {
 			width: 100rpx;
 			height: 100rpx;

+ 83 - 0
pages/voice/components/noAuth.vue

@@ -0,0 +1,83 @@
+<template>
+  <view class="voice-no-auth">
+        <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
+		<view style="margin-bottom:15px">您暂无权限查看语音播报</view>
+		<view v-if="info.type==='contact'" style="margin-bottom:15px">若想查看可以联系对口销售</view>
+		<view v-else style="margin-bottom:15px">若想查看可以申请开通</view>
+		<view v-if="info.type==='contact'">
+			{{info.name||''}}:<text @click="handleCallPhone(info.mobile+'')">{{info.mobile||''}}</text>
+		</view>
+		<view class="btn" @click="handleGoApply" v-else style="margin-top:30px">立即申请</view>
+  </view>
+</template>
+
+<script>
+import {apiApplyPermission} from '@/api/user'
+export default {    
+    props: {
+        info:null
+    },
+    
+    methods: {
+        handleCall(){
+
+            uni.makePhoneCall({
+                phoneNumber: this.info.mobile,
+                success: (result) => {},
+                fail: (error) => {}
+            })
+        },
+
+        handleAutoApply(){
+            if(!this.info.customer_info.has_apply){
+                if(this.info.customer_info.status=='冻结'||(this.info.customer_info.status=='试用'&&this.info.customer_info.is_suspend==1)){
+                    apiApplyPermission({
+                        company_name:this.info.customer_info.company_name,
+                        real_name:this.info.customer_info.name,
+                        source:8,
+                        from_page:'语音播报'
+                    }).then(res=>{
+                        if(res.code===200){
+                            console.log('主动申请成功');
+                        }
+                    }) 
+                }
+            }
+        },
+
+        handleApply(){
+            if(this.info.customer_info.status=='流失'){
+                apiApplyPermission({
+                    company_name:this.info.customer_info.company_name,
+                    real_name:this.info.customer_info.name,
+                    source:8,
+                    from_page:'语音播报'
+                }).then(res=>{
+                    uni.navigateTo({url:'/pages-applyPermission/applyResult'})
+                })
+                return
+            }
+            uni.navigateTo({ url: '/pages-applyPermission/applyPermission?source=8&from_page=语音播报' })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.voice-no-auth{
+    padding: 34rpx;
+    text-align: center;
+    font-size: $global-font-size-lg;
+    .img{
+        width: 100%;
+        margin-bottom: 50rpx;
+    }
+    .btn{
+        width: 380rpx;
+        line-height: 70rpx;
+        margin-left: auto;
+        margin-right: auto;
+        margin-top: 40rpx;
+    }
+}
+</style>

+ 66 - 2
pages/voice/voice.vue

@@ -1,5 +1,10 @@
 <template>
-    <view class="voice-play-page">
+    <view class="voice-play-page" v-if="isAuth">
+        <view class="top-filter-box">
+            <image src="@/static/question/select.png" mode="aspectFill" />
+            <text>筛选</text>
+        </view>
+          
         <view class="empty-box" v-if="list.length==0&&finished">
             <image
                 :src="globalImgUrls.activityNoAuth"
@@ -29,14 +34,39 @@
         <navigator url="/pages-voice/addVoice">
             <view class="add-btn" v-if="IsVoiceAdmin">新建语音</view>
         </navigator>
+
+        
+        <!-- 筛选弹窗 -->
+        <van-popup 
+            :show="showFilter" 
+            position="bottom"  
+            :close-on-click-overlay="true"
+            @close="showFilter = false"
+        >
+            <view class="fliter-wrap-list">
+                <van-tree-select
+                    :items="items"
+                    :main-active-index="mainActiveIndex"
+                    :active-id="activeId"
+                    @click-nav="onClickNav"
+                    @click-item="onClickItem"
+                />
+            </view>
+        </van-popup>
+
     </view>
+    <noAuth :info="noAuthData" v-else/>
 </template>
 
 <script>
 import {apiVoiceList} from '@/api/voice'
 import {apiGetSceneToParams} from '@/api/common'
+import noAuth from './components/noAuth.vue'
 const moment=require('@/utils/moment-with-locales.min')
 export default {
+    components:{
+        noAuth
+    },
     filters:{
         formatTime(e){
             return moment(e).format('YYYY-MM-DD HH:mm:ss')
@@ -50,7 +80,18 @@ export default {
             finished:false,
             voiceId:0,//分享时进入的音频id
 
-            IsVoiceAdmin:false,
+            IsVoiceAdmin:false,//是否是语音管理员
+
+            isAuth:true,
+            noAuthData:null,
+
+            showFilter:false,
+            options:[
+                {
+                    text:'选项一',
+                    
+                }
+            ]
         }
     },
     onLoad(options){
@@ -114,6 +155,10 @@ export default {
                 if(arr.length===0){
                     this.finished=true
                 }
+            }else if(res.code===403){
+                //无权限用户
+                this.isAuth=false
+                this.noAuthData=res.data
             }
         }
     },
@@ -123,6 +168,21 @@ export default {
 <style lang="scss" scoped>
 .voice-play-page{
     padding: 34rpx;
+    .top-filter-box{
+        position: sticky;
+        top: 0;
+        left: 0;
+        z-index: 99;
+        background-color: #fff;
+        display: flex;
+        align-items: center;
+        image{
+            width: 34rpx;
+            height: 34rpx;
+        }
+        color: #E3B377;
+        font-size: 30rpx;
+    }
 }
 .empty-box{
     text-align: center;
@@ -205,4 +265,8 @@ export default {
     box-shadow: 0px 4rpx 20rpx rgba(160, 126, 84, 0.25);
     border-radius: 40rpx;
 }
+
+.fliter-wrap-list{
+
+}
 </style>