hookehuyr

时间格式化方法统一调用

...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
66 import { ref, defineProps, computed } from 'vue' 66 import { ref, defineProps, computed } from 'vue'
67 import icon_address from '@/images/icon/address@2x.png' 67 import icon_address from '@/images/icon/address@2x.png'
68 import Taro from '@tarojs/taro' 68 import Taro from '@tarojs/taro'
69 -import moment from '@/utils/moment.min.js' 69 +import { formatDate } from '@/utils/tools.js'
70 70
71 const props = defineProps({ 71 const props = defineProps({
72 data: Object, 72 data: Object,
...@@ -77,10 +77,6 @@ const props = defineProps({ ...@@ -77,10 +77,6 @@ const props = defineProps({
77 // return false 77 // return false
78 // }) 78 // })
79 79
80 -const formatDate = (date) => {
81 - return moment(date).format('YYYY-MM-DD HH:mm')
82 -}
83 -
84 const formatStatus = (item) => { 80 const formatStatus = (item) => {
85 if (item?.is_end) { 81 if (item?.is_end) {
86 return '已结束'; 82 return '已结束';
......
1 <!-- 1 <!--
2 * @Date: 2022-09-26 14:36:57 2 * @Date: 2022-09-26 14:36:57
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-31 17:17:34 4 + * @LastEditTime: 2022-11-01 16:02:50
5 * @FilePath: /swx/src/pages/activityDetail/index.vue 5 * @FilePath: /swx/src/pages/activityDetail/index.vue
6 * @Description: 活动详情页 6 * @Description: 活动详情页
7 --> 7 -->
...@@ -150,7 +150,7 @@ import activityBar from '@/components/activity-bar.vue' ...@@ -150,7 +150,7 @@ import activityBar from '@/components/activity-bar.vue'
150 import Taro from '@tarojs/taro' 150 import Taro from '@tarojs/taro'
151 import PosterBuilder from '@/components/PosterBuilder/index.vue'; 151 import PosterBuilder from '@/components/PosterBuilder/index.vue';
152 import { ref, onMounted } from "vue"; 152 import { ref, onMounted } from "vue";
153 -import moment from '@/utils/moment.min.js' 153 +import { formatDate } from '@/utils/tools.js'
154 import { infoUserAPI } from '@/api/User/index'; 154 import { infoUserAPI } from '@/api/User/index';
155 import { qrCodeActivityAPI } from '@/api/Activity/index'; 155 import { qrCodeActivityAPI } from '@/api/Activity/index';
156 import icon_share from '@/images/icon/share.png' 156 import icon_share from '@/images/icon/share.png'
...@@ -166,10 +166,6 @@ onMounted(async () => { ...@@ -166,10 +166,6 @@ onMounted(async () => {
166 } 166 }
167 }) 167 })
168 168
169 -const formatDate = (date) => {
170 - return moment(date).format('YYYY-MM-DD HH:mm')
171 -}
172 -
173 const show_share = ref(false); 169 const show_share = ref(false);
174 const share_options = [ 170 const share_options = [
175 { name: '微信', icon: 'wechat', openType: 'share' }, 171 { name: '微信', icon: 'wechat', openType: 'share' },
......
1 <!-- 1 <!--
2 * @Date: 2022-09-21 14:51:44 2 * @Date: 2022-09-21 14:51:44
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-11-01 13:44:31 4 + * @LastEditTime: 2022-11-01 16:05:33
5 * @FilePath: /swx/src/pages/my/index.vue 5 * @FilePath: /swx/src/pages/my/index.vue
6 * @Description: 我的页面 6 * @Description: 我的页面
7 --> 7 -->
...@@ -110,7 +110,7 @@ import "./index.less"; ...@@ -110,7 +110,7 @@ import "./index.less";
110 import { $ } from '@tarojs/extend' 110 import { $ } from '@tarojs/extend'
111 import mixin from '@/utils/mixin'; 111 import mixin from '@/utils/mixin';
112 import { infoUserAPI } from '@/api/User/index'; 112 import { infoUserAPI } from '@/api/User/index';
113 -import moment from '@/utils/moment.min.js' 113 +import { formatDate } from '@/utils/tools.js'
114 114
115 export default { 115 export default {
116 name: "myPage", 116 name: "myPage",
...@@ -131,9 +131,9 @@ export default { ...@@ -131,9 +131,9 @@ export default {
131 if (code) { 131 if (code) {
132 data.activity_list.forEach(item => { 132 data.activity_list.forEach(item => {
133 item.server_time = data.server_time; 133 item.server_time = data.server_time;
134 - item.reg_begin_time = this.formatDate(item.reg_begin_time); 134 + item.reg_begin_time = formatDate(item.reg_begin_time);
135 - item.reg_end_time = this.formatDate(item.reg_end_time); 135 + item.reg_end_time = formatDate(item.reg_end_time);
136 - item.activity_time = this.formatDate(item.activity_time); 136 + item.activity_time = formatDate(item.activity_time);
137 }) 137 })
138 this.activity_list = data.activity_list; 138 this.activity_list = data.activity_list;
139 this.nickname = data.user.nickname; 139 this.nickname = data.user.nickname;
...@@ -151,9 +151,6 @@ export default { ...@@ -151,9 +151,6 @@ export default {
151 } 151 }
152 }, 152 },
153 methods: { 153 methods: {
154 - formatDate (date) {
155 - return moment(date).format('YYYY-MM-DD HH:mm')
156 - },
157 // 创建的活动 154 // 创建的活动
158 createActivity () { 155 createActivity () {
159 if (!this.host_id) { 156 if (!this.host_id) {
......
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-11-01 16:00:09 4 + * @LastEditTime: 2022-11-01 16:06:26
5 * @FilePath: /swx/src/pages/myCreateActivity/index.vue 5 * @FilePath: /swx/src/pages/myCreateActivity/index.vue
6 * @Description: 创建的活动页面 6 * @Description: 创建的活动页面
7 --> 7 -->
...@@ -118,9 +118,9 @@ import { $ } from '@tarojs/extend' ...@@ -118,9 +118,9 @@ import { $ } from '@tarojs/extend'
118 import mixin from '@/utils/mixin'; 118 import mixin from '@/utils/mixin';
119 import { getCurrentPageParam } from "@/utils/weapp"; 119 import { getCurrentPageParam } from "@/utils/weapp";
120 import { hostListAPI } from '@/api/Host/index' 120 import { hostListAPI } from '@/api/Host/index'
121 -import moment from '@/utils/moment.min.js'
122 import { addListAPI, endActivityAPI, delActivityAPI, copyActivityAPI } from '@/api/Activity/index'; 121 import { addListAPI, endActivityAPI, delActivityAPI, copyActivityAPI } from '@/api/Activity/index';
123 import { hostStore } from '@/stores/host' 122 import { hostStore } from '@/stores/host'
123 +import { formatDate } from '@/utils/tools.js'
124 124
125 export default { 125 export default {
126 name: "myCreateActivityPage", 126 name: "myCreateActivityPage",
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
163 this.activity_count = data.activity_count ? data.activity_count : 0; 163 this.activity_count = data.activity_count ? data.activity_count : 0;
164 this.volunteer_count = data.volunteer_count ? data.volunteer_count : 0; 164 this.volunteer_count = data.volunteer_count ? data.volunteer_count : 0;
165 this.player_count = data.player_count ? data.player_count : 0; 165 this.player_count = data.player_count ? data.player_count : 0;
166 - this.server_time = this.formatDate(data.server_time); 166 + this.server_time = formatDate(data.server_time);
167 this.activity_list.forEach(item => { 167 this.activity_list.forEach(item => {
168 item.server_time = this.server_time 168 item.server_time = this.server_time
169 }); 169 });
...@@ -219,9 +219,6 @@ export default { ...@@ -219,9 +219,6 @@ export default {
219 }; 219 };
220 }, 220 },
221 methods: { 221 methods: {
222 - formatDate (date) {
223 - return moment(date).format('YYYY-MM-DD HH:mm')
224 - },
225 onScrollToLower () { 222 onScrollToLower () {
226 if(!this.flag){ 223 if(!this.flag){
227 return 224 return
......
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-31 17:15:17 4 + * @LastEditTime: 2022-11-01 16:06:39
5 * @FilePath: /swx/src/pages/myFollowUser/index.vue 5 * @FilePath: /swx/src/pages/myFollowUser/index.vue
6 * @Description: 陪伴的用户页面 6 * @Description: 陪伴的用户页面
7 --> 7 -->
...@@ -122,11 +122,7 @@ import { $ } from '@tarojs/extend' ...@@ -122,11 +122,7 @@ import { $ } from '@tarojs/extend'
122 import mixin from '@/utils/mixin'; 122 import mixin from '@/utils/mixin';
123 import { getCurrentPageParam } from "@/utils/weapp"; 123 import { getCurrentPageParam } from "@/utils/weapp";
124 import { hostListAPI } from '@/api/Host/index' 124 import { hostListAPI } from '@/api/Host/index'
125 -import moment from '@/utils/moment.min.js' 125 +import { formatDate } from '@/utils/tools.js'
126 -
127 -const formatDate = (date) => {
128 - return moment(date).format('YYYY-MM-DD HH:mm')
129 -}
130 126
131 const onPhoneClick = (number) => { 127 const onPhoneClick = (number) => {
132 Taro.makePhoneCall({ 128 Taro.makePhoneCall({
......
1 <!-- 1 <!--
2 * @Date: 2022-09-29 16:32:03 2 * @Date: 2022-09-29 16:32:03
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-31 17:16:24 4 + * @LastEditTime: 2022-11-01 16:06:56
5 * @FilePath: /swx/src/pages/userInfo/index.vue 5 * @FilePath: /swx/src/pages/userInfo/index.vue
6 * @Description: 用户资料 6 * @Description: 用户资料
7 --> 7 -->
...@@ -119,7 +119,7 @@ import "./index.less"; ...@@ -119,7 +119,7 @@ import "./index.less";
119 import { infoMemberAPI } from '@/api/Member/index'; 119 import { infoMemberAPI } from '@/api/Member/index';
120 import { getCurrentPageParam } from "@/utils/weapp"; 120 import { getCurrentPageParam } from "@/utils/weapp";
121 import mixin from '@/utils/mixin'; 121 import mixin from '@/utils/mixin';
122 -import moment from '@/utils/moment.min.js' 122 +import { formatDate } from '@/utils/tools.js'
123 123
124 export default { 124 export default {
125 name: "userInfoPage", 125 name: "userInfoPage",
...@@ -180,9 +180,6 @@ export default { ...@@ -180,9 +180,6 @@ export default {
180 }, 180 },
181 onPartnerCancel (event) { 181 onPartnerCancel (event) {
182 this.show_partner_popup = false; 182 this.show_partner_popup = false;
183 - },
184 - formatDate (date) {
185 - return moment(date).format('YYYY-MM-DD HH:mm')
186 } 183 }
187 } 184 }
188 }; 185 };
......
1 /* 1 /*
2 * @Date: 2022-04-18 15:59:42 2 * @Date: 2022-04-18 15:59:42
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-31 17:26:32 4 + * @LastEditTime: 2022-11-01 16:01:31
5 * @FilePath: /swx/src/utils/tools.js 5 * @FilePath: /swx/src/utils/tools.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
......