Browse Source

Merge branch 'master' of http://git.cc-lotus.info/ball-court/court-badminton

guhongwei 2 years ago
parent
commit
4b35fb1405

+ 9 - 6
commpents/hg-editor/hg-editor.js

@@ -31,15 +31,18 @@ Component({
    * 组件的方法列表
    */
   methods: {
-    _onEditorReady: function () {
+    _onEditorReady: async function () {
       const that = this;
       that.createSelectorQuery().select('#editor').context(function (res) {
         that.editorCtx = res.context
-        that.editorCtx.setContents({
-          html: that.data.name,
-          success: (res) => { },
-          fail: (res) => { console.log(res) }
-        })
+        let html = that.data.name;
+        if (html) {
+          that.editorCtx.setContents({
+            html: html,
+            success: (res) => { },
+            fail: (res) => { console.log(res) }
+          })
+        }
       }).exec()
     },
     //插入图片

+ 2 - 2
pages/news/index.js

@@ -38,7 +38,7 @@ Page({
     //搜索
     onSearch: function (e) {
         const that = this;
-        that.setData({ 'searchInfo.name': e.detail.value });
+        that.setData({ 'searchInfo.title': e.detail.value });
         that.watchLogin()
     },
     /**
@@ -56,7 +56,7 @@ Page({
             key: 'user',
             success: async (res) => {
                 let info = { skip: 0, limit: 1000 };
-                if (searchInfo && searchInfo.name) info.title = searchInfo.name;
+                if (searchInfo && searchInfo.title) info.title = searchInfo.title;
                 info.type = type; info.is_show = "0";
                 const arr = await app.$get(`/newCourt/api/news`, { ...info });
                 if (arr.errcode == '0') {

+ 2 - 2
pages/news/index.wxml

@@ -6,7 +6,7 @@
         <view class="zero two">
             <view class="a" wx:if="{{tabs.active=='0'}}">
                 <view class="two_1">
-                    <input type="text" value="{{searchInfo.name}}" bindconfirm="onSearch" placeholder="请输入关键词" />
+                    <input type="text" value="{{searchInfo.title}}" bindconfirm="onSearch" placeholder="请输入关键词" />
                 </view>
                 <view class="two_2">
                     <scroll-view scroll-y="true" class="scroll-view">
@@ -16,7 +16,7 @@
                                     <view class="name">{{item.title}}</view>
                                     <view class="brief">{{item.brief}}</view>
                                     <view class="other">
-                                        <text>{{typeList[item.type].label||'暂无'}}</text>
+                                        <text>{{typeList[item.type].label||'未知'}}</text>
                                         <text>来源:{{item.origin}}</text>
                                     </view>
                                 </view>

+ 1 - 1
pages/news/info.js

@@ -35,7 +35,7 @@ Page({
                     if (arr.errcode == '0') {
                         that.setData({ form: arr.data });
                         let content = arr.data.content.replace(/\<img/gi, '<img style="width:100%;height:auto;margin: 5px 0"');
-                        this.setData({ 'form.content': content });
+                        that.setData({ 'form.content': content });
                     }
                 }
             },

+ 1 - 1
pages/news/info.wxml

@@ -4,7 +4,7 @@
             <view class="one_1">{{form.title}}</view>
             <view class="one_2">
                 <view class="type">
-                    <text>{{typeList[form.type].label||'暂无'}}</text>
+                    <text>{{typeList[form.type].label||'未知'}}</text>
                     <text>来源:{{form.origin||'暂无'}}</text>
                 </view>
                 <view class="time">{{form.create_time||'暂无'}}</view>

+ 2 - 7
pages/news/mess.js

@@ -18,7 +18,7 @@ Page({
     //查询
     onSearch: function (e) {
         const that = this;
-        that.setData({ 'searchInfo.name': e.detail.value });
+        that.setData({ 'searchInfo.title': e.detail.value });
         that.watchLogin()
     },
     // 添加
@@ -50,11 +50,6 @@ Page({
             }
         })
     },
-    // 关闭弹框
-    toClose: function () {
-        const that = this;
-        that.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
-    },
     /**
      * 生命周期函数--监听页面加载
      */
@@ -70,7 +65,7 @@ Page({
             key: 'user',
             success: async (res) => {
                 let info = { skip: 0, limit: 1000 };
-                if (searchInfo && searchInfo.name) info.name = searchInfo.name;
+                if (searchInfo && searchInfo.title) info.title = searchInfo.title;
                 const arr = await app.$get(`/newCourt/api/news`, { ...info });
                 if (arr.errcode == '0') {
                     that.setData({ list: arr.data })

+ 2 - 2
pages/news/mess.wxml

@@ -2,7 +2,7 @@
     <view slot="info" class="container main">
         <view class="zero one">
             <view class="one_1">
-                <input type="text" value="{{searchInfo.name}}" bindconfirm="onSearch" placeholder="请输入资讯名称" />
+                <input type="text" value="{{searchInfo.title}}" bindconfirm="onSearch" placeholder="请输入资讯名称" />
             </view>
             <view class="one_2">
                 <button type="primary" bindtap="toAdd">添加</button>
@@ -18,7 +18,7 @@
                         <view class="other">
                             <view class="other_1">
                                 <text>资讯类型:</text>
-                                <text>{{typeList[item.type].label}}</text>
+                                <text>{{typeList[item.type].label||'未知'}}</text>
                             </view>
                             <view class="other_1">
                                 <text>信息来源:</text>