zhaoxiaohai 3 年之前
父節點
當前提交
ad8330abab

+ 1 - 1
app.json

@@ -24,8 +24,8 @@
     },
     "pages": [
         "pages/portal/index",
-        "pages/login/index",
         "pages/userCenter/index",
+        "pages/login/index",
         "pages/teamManagement/index",
         "pages/teamManagement/change",
         "pages/productManagement/index",

+ 18 - 1
components/My_Checkbox/index.js

@@ -3,10 +3,18 @@ import {
 } from "../../utils/api"
 const _Http = new ApiModel();
 Component({
+    options:{
+        addGlobalClass: true
+    },
     /**
      * 组件的属性列表
      */
     properties: {
+        /* 类型 */
+        type: {
+            type: String,
+            value: "default" //annunciate
+        },
         /* 标题 */
         title: {
             type: String,
@@ -39,7 +47,8 @@ Component({
                 "classname": "enterprise.system.prodclass",
                 "method": "query_typeselectList",
                 "content": {}
-            }).then(res => {
+            }, false).then(res => {
+                console.log('asdasd')
                 if (res.msg != '成功') return;
                 let dataList = [];
                 for (let i = 0; i < res.data.length; i++) {
@@ -65,6 +74,14 @@ Component({
             })
         },
     },
+    observers: {
+        'dataList,saleprodclass': function (dataList, saleprodclass) {
+            console.log(dataList, saleprodclass)
+            console.log(this.data.dataList)
+            if (dataList.length == 0 || saleprodclass == 0) return;
+
+        }
+    },
 
     /**
      * 组件的初始数据

+ 20 - 3
components/My_Checkbox/index.wxml

@@ -1,13 +1,30 @@
 <view class="checkbox_title">{{title}}</view>
-<checkbox-group change class="checkbox_list" bindchange="checkedChange">
-    <view wx:for="{{dataList}}" style="height: 64rpx;" data-index="{{index}}" wx:key="{{item.index}}" bindtap="pitchOn">
+<checkbox-group wx:if="{{type=='default'}}" change class="checkbox_list" bindchange="checkedChange">
+    <view wx:for="{{dataList}}" style="height: 64rpx;" data-index="{{index}}" wx:key="item.index" bindtap="pitchOn">
         <label class="checkbox_item {{item.checked?'choice':''}}" for="{{item.index}}">{{item.value}}</label>
         <checkbox hidden="{{true}}" id="{{item.index}}" checked="{{item.checked}}" value="{{item.value}}"></checkbox>
     </view>
 </checkbox-group>
+<checkbox-group wx:if="{{type=='annunciate'}}" change class="checkbox_list" bindchange="checkedChange">
+    <view wx:for="{{dataList}}" style="height: 64rpx;" data-index="{{index}}" wx:key="item.index" bindtap="pitchOn">
+        <label class="ac-checkbox_item {{item.checked?'ac-choice':''}}" for="{{item.index}}">
+            <view style='display: flex; align-items: center;'>
+                <view class="item-img">
+                    <image wx:if="{{item.attinfos[0].fobsurl}}" src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
+                    <image wx:else src="/static/tacitly-approve/MRuserImg.png" mode="aspectFill"></image>
+                </view>
+                <view class="partner-name u-line-1">{{item.fagentname}}</view>
+            </view>
+            <view class="checked-icon">
+                <van-icon wx:if="{{item.checked}}" name="checked" color="#4EBFCF" size="28rpx" />
+            </view>
+        </label>
+        <checkbox hidden="{{true}}" id="{{item.index}}" checked="{{item.checked}}" value="{{item.value}}"></checkbox>
+    </view>
+</checkbox-group>
 <view class="checkbox_but">
     <view>
         <van-button type="info" size="large" color="#4EBFCF" custom-class="customClass" bindtap="confirm">确定</van-button>
     </view>
 </view>
-<view style="height: 36rpx;"></view>
+<view style="height: 36rpx;"></view>

+ 50 - 0
components/My_Checkbox/index.wxss

@@ -58,4 +58,54 @@
 .customClass {
     width: 100% !important;
     height: 100% !important;
+}
+
+/* 通告 */
+.ac-checkbox_item {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    min-width: 262rpx;
+    height: 62rpx;
+    background: #F6F7F8;
+    border-radius: 40rpx;
+    box-sizing: border-box;
+    border: 2rpx solid #F6F7F8;
+    overflow: hidden;
+    padding-right: 20rpx;
+}
+
+.ac-choice {
+    border: 2rpx solid #4DC2D4;
+}
+
+.item-img {
+    width: 60rpx;
+    height: 60rpx;
+    border-radius: 50%;
+    overflow: hidden;
+    flex-shrink: 0;
+}
+
+.item-img image {
+    width: 100%;
+    height: 100%;
+}
+
+.partner-name {
+    margin-left: 12rpx;
+    max-width: 450rpx;
+    height: 40rpx;
+    font-size: 28rpx;
+    color: rgba(0, 0, 0, .5);
+    line-height: 40rpx;
+}
+
+.checked-icon {
+    display: flex;
+    align-items: center;
+    width: 28rpx;
+    height: 28rpx;
+    padding-left: 15rpx;
+    flex-shrink: 0;
 }

+ 2 - 2
components/My_MultipleChoice/index.js

@@ -34,9 +34,9 @@ Component({
                 const res = {
                     msg: "成功",
                     data: [{
-                        ftype: "商户公告"
+                        ftype: "合作商通告"
                     }, {
-                        ftype: "团队告"
+                        ftype: "团队告"
                     }]
                 };
                 return this.returnClassify(res)

+ 44 - 1
pages/annunciate/newAndChange.js

@@ -17,6 +17,8 @@ Page({
         fcontent: "", //通告内容
         ftype: "", //通告类型
         popups: false,
+        checkboxShow: false, //多选
+        partnerList: [], //合作商列表
         coverFiles: [], //封面
         defaultFiles: [], //附件
         errTips: {
@@ -97,7 +99,7 @@ Page({
             title: '请检查表单内容',
             icon: "error"
         });
-        let ftype = (this.data.ftype == '团队告') ? '团队' : '商户';
+        let ftype = (this.data.ftype == '团队告') ? '团队' : '商户';
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
             "classname": "customer.noticemag.noticemag",
@@ -211,18 +213,59 @@ Page({
     radioChange({
         detail
     }) {
+        console.log(detail)
+        if (detail == '合作商通告') this.query_cooperation(1)
         this.setData({
             ftype: detail,
             popups: false,
             'errTips.ftype': false
         })
     },
+    /* 合作商列表 */
+    query_cooperation(count) {
+        if (this.data.partnerList.length > 0) return;
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.tagents.tagents",
+            "method": "query_cooperation",
+            "content": {
+                "getdatafromdbanyway": true,
+                "pageNumber": 1,
+                "pageSize": 999,
+                "where": {
+                    "condition": "",
+                    "ftype": "",
+                    "fstatus": ""
+                }
+            }
+        }, false).then(res => {
+            console.log(res)
+            if (res.msg != '成功') {
+                if (count == 1) {
+                    return this.query_cooperation(2)
+                } else {
+                    wx.showToast({
+                        title: res.data,
+                        icon: "none"
+                    })
+                }
+            };
+            this.setData({
+                partnerList: res.data
+            });
+        })
+    },
     /* 打开类目选择 */
     showPop() {
         this.setData({
             popups: !this.data.popups
         })
     },
+    checkboxShowPop() {
+        this.setData({
+            checkboxShow: !this.data.checkboxShow
+        })
+    },
     /* 跳转富文本 */
     toRichText() {
         const that = this;

+ 10 - 4
pages/annunciate/newAndChange.wxml

@@ -19,17 +19,23 @@
                 <My_UploadFiles filesType='file' id="UpFiles" fileList="{{defaultFiles}}" upType="annunciate" UploadShow="2" previewSize="60px" maxCount="99" previewSize="63px" bindimageChange="filesChange"></My_UploadFiles>
             </view>
         </My_GreyRectangleForm>
-        <My_GreyRectangleForm title="发布范围" required>
+        <My_GreyRectangleForm title="发布类型" required>
             <view class="clickPop {{ftype==''?'':'selected'}}" style="color: {{errTips.ftype?'#EF2C48':'#000'}};opacity:{{errTips.ftype?'1':'0.3'}} ;" bindtap="showPop">{{ftype?ftype:"点击选择"}}</view>
         </My_GreyRectangleForm>
+        <My_GreyRectangleForm title="发布范围">
+            <view class="clickPop {{ftype==''?'':'selected'}}" style="color: {{errTips.ftype?'#EF2C48':'#000'}};opacity:{{errTips.ftype?'1':'0.3'}} ;" bindtap="checkboxShowPop">{{ftype?ftype:"全部"}}</view>
+        </My_GreyRectangleForm>
     </view>
 </My_GeneralTemplate>
 
-<!-- 弹出层 -->
+<!-- 发布类型弹出层 -->
 <van-action-sheet show="{{ popups }}" bind:close="showPop">
-    <My_MultipleChoice type='annunciate' title="发布范围" pitchOnItem="{{ftype}}" bind:optionChange="radioChange"></My_MultipleChoice>
+    <My_MultipleChoice type='annunciate' title="发布类型" pitchOnItem="{{ftype}}" bind:optionChange="radioChange" />
+</van-action-sheet>
+<!-- 发布范围弹出层 -->
+<van-action-sheet show="{{ checkboxShow }}" bind:close="checkboxShowPop">
+    <My_Checkbox type='annunciate' title="合作商" dataList='{{partnerList}}' isRequest='{{false}}' />
 </van-action-sheet>
-
 <!-- 提交按钮 -->
 <view class="submit_but">
     <van-button bindtap="submit" custom-class="custom-class" round color="linear-gradient(180deg, #82E0E9 0%, #4BBECF 100%);">发 布</van-button>

+ 2 - 2
project.config.json

@@ -4,7 +4,7 @@
         "ignore": []
     },
     "setting": {
-        "urlCheck": false,
+        "urlCheck": true,
         "es6": true,
         "enhance": true,
         "postcss": true,
@@ -48,7 +48,7 @@
     },
     "compileType": "miniprogram",
     "libVersion": "2.21.2",
-    "appid": "wx210f6f5080f20d0c",
+    "appid": "wx5dc7fd18b6335214",
     "projectname": "%E5%B8%83%E4%B8%87%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F",
     "debugOptions": {
         "hidedInDevtools": []