guhongwei 2 anos atrás
pai
commit
d2ea079596

+ 13 - 19
pages/notice/detail.js

@@ -11,8 +11,8 @@ Page({
         frameStyle: { useTop: true, name: '维护公告信息', leftArrow: true, useBar: false },
         // 主体高度
         infoHeight: '',
-        form: { file: [], type: '0' },
-        // 头像
+        form: {},
+        // 文件
         file: [],
         typeList: notice_type,
         //用户列表
@@ -45,6 +45,12 @@ Page({
         let arr = list.filter((i, index) => index != e.detail.index)
         that.setData({ file: arr })
     },
+    // 选择发送时间
+    dateChange: function (e) {
+        const that = this;
+        const { value } = e.detail;
+        that.setData({ 'form.send_time': value })
+    },
     // 选择用户类别
     typeChange: function (e) {
         const that = this;
@@ -52,12 +58,6 @@ Page({
         let data = that.data.typeList[index];
         if (data) that.setData({ 'form.type': data.label });
     },
-    // 选择发送时间
-    dateChange: function (e) {
-        const that = this;
-        const { value } = e.detail;
-        that.setData({ 'form.send_time': value })
-    },
     // 选择接收人
     userAdd() {
         const that = this;
@@ -75,11 +75,6 @@ Page({
         }
         that.setData({ receive_user: receive_user })
     },
-    // 提交保存
-    userSubmit: function () {
-        const that = this;
-        that.toClose()
-    },
     // 关闭弹框
     toClose() {
         const that = this;
@@ -120,13 +115,12 @@ Page({
         wx.getStorage({
             key: 'token',
             success: async res => {
-                let data = res.data;
-                if (data) {
-                    that.setData({ 'form.send_id': data._id });
-                    that.setData({ 'form.send_name': data.nickname });
+                that.setData({ 'form': { send_id: res.data.id, send_name: res.data.nickname, file: [] } });
+                const arr = await app.$get(`/courtAdmin/api/user`, { status: '1' });
+                if (arr.errcode == '0') {
+                    let p1 = arr.data.filter((i) => i.type != '0')
+                    that.setData({ userList: p1 })
                 }
-                const arr = await app.$get(`/courtAdmin/api/user`, { status: '1', type: '2' });
-                if (arr.errcode == '0') that.setData({ userList: arr.data })
             },
             fail: res => {
                 wx.redirectTo({ url: '/pages/index/index', })

+ 3 - 3
pages/notice/detail.wxml

@@ -24,10 +24,10 @@
                 </view>
 
                 <view class="content">
-                    <view class="label textOver">发送类型</view>
+                    <view class="label textOver">接收人类型</view>
                     <view class="value">
                         <picker class="picker" mode="selector" bindchange="typeChange" name="type" range-key="value" range="{{typeList}}">
-                            <view class="input">{{typeList[form.type].value||'选择类型'}}</view>
+                            <view class="input">{{form.type?typeList[form.type].value:'选择接收人类型'}}</view>
                         </picker>
                     </view>
                 </view>
@@ -68,7 +68,7 @@
             <checkbox-group bindchange="userChange">
                 <view class="userList" wx:for="{{userList}}" wx:key="item">
                     <label>
-                        <text>接收人姓名:{{item.nickname}}</text>
+                        <text>{{item.nickname}}--{{item.phone}}</text>
                         <checkbox value="{{item._id}}" checked="{{item.checked}}" />
                     </label>
                 </view>

+ 7 - 6
pages/notice/detail.wxss

@@ -15,6 +15,7 @@
     width: 100%;
     border-bottom: 1px solid #ccc;
     padding: 10px 0;
+    font-size: 14px;
 }
 
 .main .one .content .label {
@@ -32,6 +33,7 @@
     font-size: 14px;
     float: right;
 }
+
 .main .one .content .name {
     float: left;
     width: 100%;
@@ -44,16 +46,15 @@
 }
 
 .main .one .btn {
-    position: absolute;
-    bottom: 50px;
-    width: 95%;
+    float: left;
+    width: 100%;
     text-align: center;
+    margin: 10px 0 0 0;
 }
 
 .main .one .btn button {
-    width: 100%;
-    background-image: linear-gradient(to right, #fd3c1e, #c74df0);
-    border-radius: 25px;
+    width: 50%;
+    font-size: 14px;
 }
 
 .dialog_one {

+ 2 - 3
pages/notice/index.js

@@ -1,5 +1,4 @@
 // pages/login/login.js
-import WxValidate from '../../utils/wxValidate'
 import { notice_type } from '../../utils/dict';
 const app = getApp()
 Page({
@@ -22,7 +21,7 @@ Page({
     back: function () {
         wx.navigateBack({ url: '/pages/me/index' })
     },
-    // 添加用户
+    // 添加通知公告
     toAdd: function () {
         wx.navigateTo({ url: `/pages/notice/detail` })
     },
@@ -55,7 +54,7 @@ Page({
         wx.getStorage({
             key: 'token',
             success: async res => {
-                this.setData({ user: res.data });
+                that.setData({ user: res.data });
                 let params = {};
                 if (res.data.type != '0') params.user_id = res.data.id;
                 const arr = await app.$get(`/courtAdmin/api/notice`, params);

+ 5 - 6
pages/user/detail.wxss

@@ -33,14 +33,13 @@
 }
 
 .main .one .btn {
-    position: absolute;
-    bottom: 50px;
-    width: 95%;
+    float: left;
+    width: 100%;
     text-align: center;
+    margin: 10px 0 0 0;
 }
 
 .main .one .btn button {
-    width: 100%;
-    background-image: linear-gradient(to right, #fd3c1e, #c74df0);
-    border-radius: 25px;
+    width: 50%;
+    font-size: 14px;
 }