Browse Source

修复bug

zhaoxiaohai 3 years ago
parent
commit
92e6d8bfe5

+ 1 - 1
components/My_DisplayItem/index.wxml

@@ -6,7 +6,7 @@
     </view>
     <!-- 展示文本信息 -->
     <view class="display-item-textExplain">
-        <view class="textExplain-title">{{content.ftitle}}</view>
+        <view class="textExplain-title u-line-1">{{content.ftitle}}</view>
         <view class="textExplain-explain u-line-1">{{content.fcontent}}</view>
         <view class="textExplain-userData-time">
             <view class="textExplain-userData">

+ 1 - 1
components/My_DisplayItem/index.wxss

@@ -24,7 +24,7 @@
 
 /* 文本说明 */
 .display-item-textExplain {
-    flex: 1;
+    width: 460rpx;
     height: 100%;
 }
 

+ 22 - 2
components/My_selectTime/index.js

@@ -4,6 +4,10 @@ Component({
      * 组件的属性列表
      */
     properties: {
+        type: {
+            type: String,
+            value: "YTD"
+        },
         /* 最小时间 */
         minDate: {
             type: Number,
@@ -12,7 +16,17 @@ Component({
         /* 最大选择时间 */
         maxDate: {
             type: Number,
-            value: Date.parse(new Date())-568080000000 //当前时间
+            value: Date.parse(new Date()) - 568080000000 //当前时间
+        },
+        /* 完整版本最大时间 */
+        intactMaxDate: {
+            type: Number,
+            value: Date.parse(new Date())+ 1000 * 60 * 60 * 24 * 3
+        },
+        /* 完整版本最小时间 */
+        intactMinDate: {
+            type: Number,
+            value: Date.parse(new Date()) //当前时间
         },
         /* 弹窗显示 */
         showSelectTime: {
@@ -46,8 +60,14 @@ Component({
      */
     methods: {
         submit() {
-            const time = new Date(this.data.currentDate),
+            const time = new Date(this.data.currentDate);
+            let setTime="";
+            if(this.data.type=='YTD'){
                 setTime = time.getFullYear() + '-' + (time.getMonth() + 1) + "-" + time.getDate();
+            }else{
+                setTime = time.getFullYear() + '-' + (time.getMonth() + 1) + "-" + time.getDate() + " " + time.getHours()+ ':' +time.getMinutes();
+            }
+                console.log(setTime)
             this.triggerEvent("getTimeData", setTime)
             this.setData({
                 showSelectTime: false

+ 13 - 4
components/My_selectTime/index.wxml

@@ -1,8 +1,17 @@
 <!-- 时间选择器 -->
-<van-action-sheet show="{{ showSelectTime }}" bind:close="dateOnClose">
+<van-action-sheet wx:if="{{type=='YTD'}}" show="{{ showSelectTime }}" bind:close="dateOnClose">
     <van-datetime-picker type="date" show-toolbar="{{false}}" value="{{ currentDate }}" bind:input="onInput" min-date="{{ minDate }}" max-date="{{ maxDate }}" formatter="{{ formatter }}" />
     <!-- 提交按钮 -->
-<view class="submit_but">
-    <van-button bindtap="submit" custom-class="custom-class" round color="linear-gradient(180deg, #82E0E9 0%, #4BBECF 100%);">确定</van-button>
-</view>
+    <view class="submit_but">
+        <van-button bindtap="submit" custom-class="custom-class" round color="linear-gradient(180deg, #82E0E9 0%, #4BBECF 100%);">确定</van-button>
+    </view>
+</van-action-sheet>
+
+<!-- 时间选择器 -->
+<van-action-sheet wx:if="{{type=='intact'}}" show="{{ showSelectTime }}" bind:close="dateOnClose">
+    <van-datetime-picker type="datetime" show-toolbar="{{false}}" value="{{ currentDate }}" min-date="{{ intactMinDate }}" max-date="{{ intactMaxDate }}" bind:input="onInput" />
+    <!-- 提交按钮 -->
+    <view class="submit_but">
+        <van-button bindtap="submit" custom-class="custom-class" round color="linear-gradient(180deg, #82E0E9 0%, #4BBECF 100%);">确定</van-button>
+    </view>
 </van-action-sheet>

+ 1 - 10
pages/announceDemand/index.js

@@ -11,8 +11,6 @@ Page({
      * 页面的初始数据
      */
     data: {
-        maxDate: Number,
-        minDate: Number,
         showCalendar: false, //日历显示
         tsupplyanddemandid: 0, //ID 0为新增
         popups: false, //弹出层控制
@@ -33,7 +31,6 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-        this.setTime()
         if (options.data != undefined) {
             const data = JSON.parse(options.data);
             let attinfos = [];
@@ -63,13 +60,6 @@ Page({
             attinfos: data.detail.fileList
         })
     },
-    /* 设置下架时间范围 */
-    setTime() {
-        this.setData({
-            maxDate: Date.parse(new Date()) + 1000 * 60 * 60 * 24 * 31,
-            minDate: Date.parse(new Date())
-        })
-    },
     /* 打开时间选择器 */
     setDate() {
         this.selectComponent("#SetDate").dateOnClose()
@@ -129,6 +119,7 @@ Page({
                 "fissupply": 0
             }
         }).then(res => {
+            console.log(res)
             if (res.msg != "成功") return wx.showToast({
                 title: res.data,
                 icon: "none"

+ 1 - 1
pages/announceDemand/index.wxml

@@ -26,7 +26,7 @@
 </van-action-sheet>
 
 <!-- 时间选择器 -->
-<My_selectTime id="SetDate" maxDate="{{maxDate}}" minDate="{{minDate}}" bind:getTimeData="setSoldOut"></My_selectTime>
+<My_selectTime id="SetDate" type="intact" bind:getTimeData="setSoldOut"></My_selectTime>
 
 <!-- 提交按钮 -->
 <view class="submit_but">

+ 1 - 0
pages/userCenter/index.js

@@ -122,6 +122,7 @@ Page({
                 "frole": this.data.frole
             }
         }).then(res => {
+            console.log(res)
             if (res.msg == "成功") {
                 wx.showToast({
                     title: '保存成功',