Explorar el Código

通告权限修改

zhaoxiaohai hace 3 años
padre
commit
3938828df7

+ 1 - 2
pages/annunciate/details.js

@@ -16,9 +16,8 @@ Page({
         isEvaluate: false
     },
     onLoad(options) {
-        let auth = [],
+        let auth = wx.getStorageSync('auth').wnotice.optionnames,
             dataAuth = '';
-        (options.auth) ? auth = options.auth.split(","): getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告'])[0].apps[0].meta.auth.forEach(v => auth.push(v.optionname));
         if (auth.some(v => v == '团队内部数据分析') && auth.some(v => v == '经销商数据分析')) {
             dataAuth = 'all';
         } else {

+ 26 - 0
pages/annunciate/details.scss

@@ -42,6 +42,32 @@
 
 /* 通告评价 */
 .evaluate {
+    width: 690rpx;
+    background: #FFFFFF;
+    border-radius: 16rpx;
+    margin: 0 auto;
+    margin-top: 20rpx;
+    box-sizing: border-box;
+    overflow: hidden;
+
+    .mtitle {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        width: 100%;
+        height: 90rpx;
+        padding: 0 20rpx 0 30rpx;
+        border-bottom: 1px solid #EEEEEE;
+        box-sizing: border-box;
+
+        .title-l {
+            font-size: 28rpx;
+            font-family: PingFang SC-Bold, PingFang SC;
+            font-weight: bold;
+            color: #333333;
+        }
+    }
+
     .title-r {
         font-size: 24rpx;
         font-family: PingFang SC-Regular, PingFang SC;

+ 14 - 4
pages/annunciate/details.wxml

@@ -1,8 +1,10 @@
-<van-tabs wx:if="{{viewData}}" sticky color='var(--assist)' title-active-color='var(--assist)' bind:change='tabChange'>
+<van-tabs sticky color='var(--assist)' title-active-color='var(--assist)' bind:change='tabChange'>
     <van-tab title="详情" />
     <van-tab title="数据" />
 </van-tabs>
+
 <DispalyData wx:if="{{tabsTitle=='数据'}}" dataId="{{sat_noticeid}}" dataAuth="{{dataAuth}}" />
+
 <view hidden="{{tabsTitle!='详情'}}">
     <view class="main">
         <view class="title multi-line">{{detailsData.title}}</view>
@@ -31,8 +33,12 @@
         <view class="label">视频</view>
         <video wx:for="{{videoList}}" src="{{item.url}}" />
     </view>
-    <My_card wx:if="{{per.query(auth,'反馈')}}" custom-class="evaluate" title="通告评价" hover>
-        <view slot='title-r' class="title-r">{{evaluate.evaluatecount}}人评分</view>
+
+    <view wx:if="{{per.query(auth,'反馈')}}" class="evaluate" title="通告评价" hover>
+        <view class="mtitle">
+            <view class="title-l">通告评价</view>
+            <view class="title-r">{{evaluate.evaluatecount}}人评分</view>
+        </view>
         <view class="score">
             <text>总体</text>
             <van-rate custom-class='rate' readonly='{{isEvaluate}}' value="{{ rate.nubmer }}" size="{{ 25 }}" color="#ffd21e" void-icon="star" void-color="#eee" bind:change="rateChange" />
@@ -45,7 +51,11 @@
                 <van-button bindtap="submit" disabled='{{isEvaluate}}' loading='{{loading}}' loading-text="提交中..." custom-class='submit' color="var(--assist)">提交</van-button>
             </view>
         </view>
-    </My_card>
+    </view>
+
     <view style="height: 30px;" />
 </view>
+
+
+
 <wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 3 - 9
pages/annunciate/index.js

@@ -24,13 +24,7 @@ Page({
         }]
     },
     onLoad(options) {
-        const auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告'])[0].apps;
-        let authList = [];
-        auth[0].meta.auth.forEach(v => authList.push(v.optionname));
-        this.setData({
-            authList
-        })
-        this.getList();
+        this.getList(true);
     },
     getList(init = false) {
         if (init.detail != undefined) init = init.detail;
@@ -60,9 +54,9 @@ Page({
     toDetails(e) {
         const {
             item
-        } = e.currentTarget.dataset, authList = this.data.authList;
+        } = e.currentTarget.dataset;
         wx.navigateTo({
-            url: `./details?id=${item.sat_noticeid}&auth=${authList}`
+            url: `./details?id=${item.sat_noticeid}`
         })
     },
     onReady() {