260 Commits
zmr ... master

Author SHA1 Message Date
qxf
3c154f1416 Merge pull request 'qxf' (#116) from qxf into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/116
2020-12-01 18:03:14 +08:00
亓雪峰
3325704faa Merge branch 'master' of https://git.luyuan.tk/luyuan/demingshangjia into qxf 2020-12-01 18:01:46 +08:00
亓雪峰
125c198f5d 优化 用户协议与隐私政策 2020-12-01 17:55:49 +08:00
亓雪峰
1e06c5067f 隐私政策修改 2020-11-30 14:43:34 +08:00
aad77ed2cb Merge pull request '用户协议,隐私政策分开显示' (#115) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/115
2020-11-27 17:38:55 +08:00
365c797e28 用户协议,隐私政策分开显示 2020-11-27 17:38:15 +08:00
a50daa3326 Merge pull request '添加用户隐私协议' (#114) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/114
2020-11-27 14:09:36 +08:00
d47a2b7740 添加用户隐私协议 2020-11-27 14:07:25 +08:00
qxf
e405a2bd2b Merge pull request 'qxf' (#113) from qxf into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/113
2020-11-27 11:41:50 +08:00
亓雪峰
42b5488a52 登录时检查网络 2020-11-27 11:40:33 +08:00
亓雪峰
99ab0696ba 登录时检查网络连接是否正常 2020-11-27 11:36:15 +08:00
亓雪峰
02d289b31d Update manifest.json 2020-11-27 11:27:43 +08:00
ab87f8822b Merge pull request '添加用户反馈模块' (#112) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/112
2020-11-25 16:26:51 +08:00
6945c21f10 添加用户反馈模块 2020-11-25 16:25:32 +08:00
亓雪峰
1529dcb6e6 Update login.vue 2020-11-09 17:43:58 +08:00
亓雪峰
da02e25fd1 修复 网络不通的情况下登录卡死的问题 2020-11-09 17:34:14 +08:00
亓雪峰
005ae548a8 修复 编译nvue文件样式报错的问题 2020-11-09 09:48:34 +08:00
亓雪峰
c330638827 修复 腾讯云cos配置失效的问题 2020-11-09 09:47:18 +08:00
亓雪峰
812bb07e1e 修复更换头像刷新不及时的问题 2020-10-17 09:52:15 +08:00
亓雪峰
b139bf1224 仅主评论可回复 2020-10-15 22:53:10 +08:00
亓雪峰
5757c4bce3 使用达人账号登录改为展示达人名称 2020-10-15 22:52:53 +08:00
亓雪峰
8aab721c0e 修复骑手派送传参问题 2020-10-15 21:20:04 +08:00
亓雪峰
2d76a8ea63 Update chatservice.js 2020-10-14 23:22:46 +08:00
亓雪峰
dfd9fb1b67 Update manifest.json 2020-10-14 15:31:40 +08:00
ee6e4102b6 Merge pull request '更换' (#111) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/111
2020-09-25 17:43:48 +08:00
9e8d4d4b58 更换 2020-09-25 17:41:56 +08:00
gyh
055cdb654a Merge pull request 'gdpao' (#110) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/110
2020-09-21 15:04:44 +08:00
Gdpao
e2e5cf8b42 gdpao 2020-09-21 15:03:27 +08:00
gyh
2f1b89c6a6 Merge pull request 'gdpao' (#109) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/109
2020-09-20 18:20:36 +08:00
Gdpao
841dc290b2 gdpao 2020-09-20 18:19:35 +08:00
gyh
0610a0b157 Merge pull request 'gdpao' (#108) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/108
2020-09-19 20:04:32 +08:00
Gdpao
49fe886234 gdpao 2020-09-19 20:02:43 +08:00
0f26f6737b Merge pull request '更换图片' (#107) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/107
2020-09-19 16:15:29 +08:00
fb5c8aa476 更换图片 2020-09-19 16:14:56 +08:00
gyh
a732778481 Merge pull request 'gdpao' (#106) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/106
2020-09-18 14:23:48 +08:00
Gdpao
2d7922ff96 gdpao 2020-09-18 14:22:31 +08:00
5b3dbd1dc2 Merge pull request '更改了字体 修复了10秒消失' (#105) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/105
2020-09-18 09:52:24 +08:00
880ce7487b 更改了字体 修复了10秒消失 2020-09-18 09:51:48 +08:00
a6a65153ea Merge pull request 'xbx' (#104) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/104
2020-09-17 19:44:21 +08:00
c77a7a4d5b 删除了断流提示 2020-09-17 19:18:42 +08:00
32bcfb92e1 消除了退出之后的探矿 2020-09-17 19:11:27 +08:00
100d4d67b9 一分钟之后文字消失 2020-09-17 19:04:55 +08:00
a1d9339948 Merge pull request 'xbx' (#103) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/103
2020-09-16 19:06:03 +08:00
a4fee4682f 删除了清楚定时器 2020-09-16 19:05:13 +08:00
f74c8a8776 十秒提交一次 2020-09-16 19:01:33 +08:00
gyh
2f62fde4f6 Merge pull request 'gdpas' (#102) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/102
2020-09-16 17:08:29 +08:00
Gdpao
905ae3b9da gdpas 2020-09-16 11:33:14 +08:00
gyh
341d733a16 Merge pull request 'gdpao' (#101) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/101
2020-09-15 17:41:25 +08:00
Gdpao
c02acd7259 gdpao 2020-09-15 16:46:40 +08:00
aa0d7a4a06 Merge pull request '修复了清楚图片' (#100) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/100
2020-09-11 20:43:37 +08:00
45b6086398 修复了清楚图片 2020-09-11 20:43:21 +08:00
f81ce05547 Merge pull request 'xbx' (#99) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/99
2020-09-11 20:23:56 +08:00
fb81800253 涉黄提示 2020-09-11 20:23:34 +08:00
1f6d2b4ab3 删除了派送方式 2020-09-11 20:03:26 +08:00
52277be0c9 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-09-11 19:46:31 +08:00
391fda5abc 修改了选择 2020-09-11 19:46:19 +08:00
f770b05dcd Merge pull request '修改了热度 => 观看人数' (#98) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/98
2020-09-11 16:46:32 +08:00
6d3d176cd8 修改了热度 => 观看人数 2020-09-11 16:43:54 +08:00
gyh
909082f7ca Merge pull request 'gdpao' (#97) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/97
2020-09-11 15:37:57 +08:00
Gdpao
dadb891236 gdpao 2020-09-11 15:25:57 +08:00
42e3c7d6a7 Merge pull request 'xbx' (#96) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/96
2020-09-10 17:21:57 +08:00
8434b1e611 不变型 2020-09-10 17:21:26 +08:00
a0ccf26c99 member_id 2020-09-10 17:13:40 +08:00
gyh
541d8f9f6e Merge pull request 'gdzb' (#95) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/95
2020-09-10 16:14:22 +08:00
5f56b7a27c Merge pull request 'xbx' (#94) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/94
2020-09-10 16:01:29 +08:00
0c41f85630 修复 2020-09-10 16:01:16 +08:00
0087c0c3cd 修复了层次 2020-09-10 15:58:54 +08:00
Gdpao
c270f238bd gdzb 2020-09-10 14:48:17 +08:00
5add00c60a Merge pull request 'xbx' (#93) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/93
2020-09-10 11:38:51 +08:00
c236af5986 删除 2020-09-10 11:38:33 +08:00
d86dc49da2 修改了标题提示 2020-09-10 11:37:37 +08:00
4c8309ca66 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-09-10 10:05:18 +08:00
e173f3c2a8 Merge branch 'xbx' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-09-10 10:05:14 +08:00
d0107c5729 临时修复了提示 2020-09-10 10:05:04 +08:00
gyh
1309fec9c3 Merge pull request 'gyh' (#92) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/92
2020-09-10 09:58:33 +08:00
b2d7ae4ec5 临时修复了提示 2020-09-10 09:27:12 +08:00
Gdpao
75e02e0228 gdpao 2020-09-10 09:20:30 +08:00
Gdpao
3e8caffe19 gdpaoup 2020-09-07 17:10:24 +08:00
gyh
571489743a Merge pull request 'gdpao' (#91) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/91
2020-09-07 16:22:45 +08:00
Gdpao
f7f3fee4ad gdpao 2020-09-07 16:22:11 +08:00
gyh
1f70d8dfcb Merge pull request 'gdpaoup' (#90) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/90
2020-09-05 20:05:02 +08:00
Gdpao
8c89864beb gdpaoup 2020-09-05 17:22:53 +08:00
gyh
af908a3dda Merge pull request 'gdpao' (#89) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/89
2020-09-05 15:32:35 +08:00
9ee97373bc Merge pull request 'xbx' (#88) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/88
2020-09-05 15:28:45 +08:00
Gdpao
388daaa901 gdpao 2020-09-05 12:30:22 +08:00
0f85f77520 添加了一个输出 2020-09-05 12:18:05 +08:00
23916ea7fa 解决了划走之后的问题 2020-09-05 12:09:57 +08:00
gyh
539309b370 Merge pull request 'GDPAO' (#87) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/87
2020-09-04 19:53:27 +08:00
Gdpao
0824d97080 GDPAO 2020-09-04 19:52:43 +08:00
b98baa39aa Merge pull request '文案' (#86) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/86
2020-09-03 18:08:38 +08:00
0619bbd901 文案 2020-09-03 18:08:10 +08:00
60cb9294fc Merge pull request '添加了强制重新渲染' (#85) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/85
2020-09-03 11:45:18 +08:00
cd89acf38c 添加了强制重新渲染 2020-09-03 11:44:16 +08:00
gyh
c4114bcfc5 Merge pull request 'gdpao' (#84) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/84
2020-09-03 10:27:40 +08:00
Gdpao
f2e3427260 gdpao 2020-09-03 10:26:55 +08:00
gyh
dbf18d4091 Merge pull request 'gdpao' (#83) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/83
2020-09-02 14:52:12 +08:00
Gdpao
7d066ca67d gdpao 2020-09-02 14:05:08 +08:00
gyh
22901579b9 Merge pull request 'gdpao' (#82) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/82
2020-09-01 20:36:06 +08:00
Gdpao
3ecaac3190 gdpaomg 2020-09-01 20:35:48 +08:00
Gdpao
c5b3505dcd gdpao 2020-09-01 20:32:15 +08:00
b9eceb6ecf Merge pull request '添加了购买人数' (#81) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/81
2020-09-01 17:33:52 +08:00
2bdd8e2b7f 添加了购买人数 2020-09-01 16:59:55 +08:00
5017534a24 Merge pull request '字体换行' (#80) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/80
2020-09-01 16:55:45 +08:00
f9f6bba08b 字体换行 2020-09-01 16:53:49 +08:00
2f103eafbe Merge pull request '修改了大小写' (#79) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/79
2020-09-01 16:15:23 +08:00
64824a8fb7 修改了大小写 2020-09-01 16:15:09 +08:00
721087e372 Merge pull request '添加活动消息' (#78) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/78
2020-09-01 16:07:09 +08:00
164b7f8e4c Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-09-01 16:06:27 +08:00
a80c2e53b8 添加活动消息 2020-09-01 16:05:34 +08:00
f7da2d452c Merge pull request '添加了直播' (#77) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/77
2020-09-01 11:38:42 +08:00
e91b35d1e3 添加了直播 2020-09-01 11:38:18 +08:00
gyh
115400353f Merge pull request 'gdpao' (#76) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/76
2020-09-01 09:19:14 +08:00
Gdpao
dd5a59cccb gdpao 2020-09-01 08:46:33 +08:00
c9b9dc1610 Merge pull request 'xbx' (#75) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/75
2020-08-29 00:14:35 +08:00
a6328358e2 修复了登录跳转 2020-08-28 15:54:36 +08:00
7c839816d4 删除了平台达人的购物袋 2020-08-28 15:48:12 +08:00
13524dcefc 更换图标 2020-08-28 15:18:40 +08:00
784cd1ec89 添加了图标 2020-08-28 15:17:29 +08:00
aac975e921 消息完成 2020-08-28 15:04:32 +08:00
1305931e3b 通知和提示 2020-08-28 14:51:35 +08:00
gyh
0562cfd830 Merge pull request 'gdpao' (#74) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/74
2020-08-28 14:18:37 +08:00
Gdpao
14b0d68ce4 gdpao 2020-08-28 14:17:51 +08:00
40e252c400 通知页面 2020-08-27 16:02:27 +08:00
5dd01ffa93 Merge pull request 'xbx' (#73) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/73
2020-08-27 14:04:24 +08:00
gyh
06bbd3d600 Merge pull request 'gdpao' (#72) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/72
2020-08-27 11:29:14 +08:00
Gdpao
3097bf8b91 gdpao 2020-08-27 11:28:17 +08:00
c5305c5a72 添加了铃声 2020-08-27 11:01:26 +08:00
4e02daa854 t添加了提示和直播 2020-08-27 09:52:43 +08:00
gyh
022192c9d6 Merge pull request 'gdpao' (#71) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/71
2020-08-25 11:13:35 +08:00
Gdpao
94c22fdef1 gdpao 2020-08-25 11:12:33 +08:00
gyh
8ce148950a Merge pull request 'gdpao' (#70) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/70
2020-08-24 15:49:30 +08:00
Gdpao
e58a1a6ef6 gdpao 2020-08-24 15:48:54 +08:00
6d4c9dc5a4 Merge pull request '添加了退出登录' (#69) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/69
2020-08-22 16:59:04 +08:00
9361f5bffe 添加了退出登录 2020-08-22 16:58:18 +08:00
gyh
3fe8f15aad Merge pull request 'gdpao' (#68) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/68
2020-08-20 15:34:59 +08:00
Gdpao
84c02f90f7 gdpao 2020-08-20 15:34:04 +08:00
93dfeaa36d Merge pull request '关闭按钮' (#67) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/67
2020-08-20 11:07:11 +08:00
fc4c187702 Merge branch 'master' into xbx 2020-08-20 11:06:58 +08:00
84240fedb8 关闭按钮 2020-08-20 11:05:24 +08:00
gyh
4c3808d2ff Merge pull request 'gdpao' (#66) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/66
2020-08-19 19:27:26 +08:00
Gdpao
32d23e4bb0 gdpao 2020-08-19 19:26:54 +08:00
gyh
380bd7dc9c Merge pull request 'gdpao' (#65) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/65
2020-08-18 15:59:42 +08:00
Gdpao
b35222853d gdpao 2020-08-18 15:58:57 +08:00
e07c2288dc Merge pull request '修复了提交' (#64) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/64
2020-08-18 15:56:34 +08:00
2f4e938a2b 修复了提交 2020-08-18 15:56:10 +08:00
baf39b01e2 Merge pull request '域名' (#63) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/63
2020-08-18 15:31:33 +08:00
79990e56d2 域名 2020-08-18 15:31:03 +08:00
19187b67fc Merge pull request 'paixu' (#62) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/62
2020-08-18 15:27:14 +08:00
5fd62e4010 paixu 2020-08-18 15:26:20 +08:00
22bc2a4b89 Merge pull request '替换域名' (#61) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/61
2020-08-18 15:20:10 +08:00
7090635886 替换域名 2020-08-18 15:19:29 +08:00
87c321be99 Merge pull request '达人链接聊天室' (#60) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/60
2020-08-17 08:59:20 +08:00
4f7fc23c23 达人链接聊天室 2020-08-17 08:57:44 +08:00
gyh
3641264d19 Merge pull request 'gyh' (#59) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/59
2020-08-17 08:48:45 +08:00
Gdpao
cf7d689ce0 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into gyh 2020-08-15 19:11:56 +08:00
gyh
1cc6fc56d1 Merge pull request 'gdpao' (#58) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/58
2020-08-15 19:11:25 +08:00
Gdpao
d1aaa525ed Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into gyh 2020-08-15 19:09:29 +08:00
Gdpao
8ff58e1a31 gdpao 2020-08-15 19:09:02 +08:00
b1c7f612f1 Merge pull request '删除验证' (#57) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/57
2020-08-15 19:08:05 +08:00
4bf837d53e 删除验证 2020-08-15 17:52:55 +08:00
5fc375e589 Merge pull request '添加空提示' (#56) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/56
2020-08-15 16:06:47 +08:00
3d04824b83 添加空提示 2020-08-15 16:06:20 +08:00
960f0453ec Merge pull request 'xbx' (#55) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/55
2020-08-15 15:58:53 +08:00
1cc3f289fe 添加了梦层 2020-08-15 15:58:26 +08:00
3884f93ad8 修复了商家名字 2020-08-15 13:33:58 +08:00
gyh
e759f15852 Merge pull request 'gdpaoup' (#54) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/54
2020-08-14 20:50:35 +08:00
Gdpao
3e7165ef19 gdpao 2020-08-14 20:50:23 +08:00
Gdpao
2bf46d983a gdpaoup 2020-08-14 20:48:14 +08:00
fd78ec19db Merge pull request 'xbx' (#53) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/53
2020-08-14 17:11:41 +08:00
f57ebac022 修复了不刷新 2020-08-14 17:11:17 +08:00
8276bf358f 信息 2020-08-14 17:09:31 +08:00
67edac985e Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-08-14 14:51:16 +08:00
74b10f4620 直播人数 2020-08-14 14:38:43 +08:00
gyh
12d095dc05 Merge pull request 'gdpaoup' (#52) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/52
2020-08-14 12:18:34 +08:00
Gdpao
c9c714d4e3 gdpaoup 2020-08-14 12:17:28 +08:00
17e336f0fc Merge pull request '修正了' (#51) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/51
2020-08-14 11:08:04 +08:00
bfa4ed6edb 修正了 2020-08-14 11:07:09 +08:00
0e33599174 Merge pull request 'xbx' (#50) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/50
2020-08-14 09:41:26 +08:00
7755f54f07 返回 2020-08-14 09:40:54 +08:00
0b5892cfbd 返回提示 2020-08-14 09:35:56 +08:00
ff4c3982ba Merge pull request '图片上传' (#49) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/49
2020-08-14 08:49:15 +08:00
36080fd730 图片上传 2020-08-14 08:48:40 +08:00
gyh
81ec6586e3 Merge pull request 'gdpao' (#48) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/48
2020-08-14 08:28:18 +08:00
Gdpao
150c3337e4 gdpao 2020-08-14 08:26:50 +08:00
fbdd3f20b4 Merge pull request '直播人数' (#47) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/47
2020-08-13 16:25:21 +08:00
0b0ac462a7 直播人数 2020-08-13 16:24:55 +08:00
7c16e8c190 Merge pull request '透明图标' (#46) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/46
2020-08-13 12:10:49 +08:00
1f54899b66 透明图标 2020-08-13 12:10:21 +08:00
7e37f71d56 Merge pull request 'xbx' (#45) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/45
2020-08-13 12:01:13 +08:00
3c44ad2811 修改了语音的样式 2020-08-13 12:00:44 +08:00
186f1cdb27 语音样式 2020-08-13 11:58:06 +08:00
209cb7d9fb Merge pull request 'xbx' (#44) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/44
2020-08-13 11:37:40 +08:00
e4f917a9cf 关闭直播页面 2020-08-13 11:36:47 +08:00
06092fb183 直播热度与按钮修改 2020-08-13 11:32:40 +08:00
cmx
252e4b7deb Merge pull request 'update adout upload adout tencentCOS' (#43) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/43
2020-08-12 15:18:55 +08:00
cmxdd
9baac8ef63 update adout upload adout tencentCOS 2020-08-12 15:17:48 +08:00
5b2745051e Merge pull request '修改了图片' (#42) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/42
2020-08-12 15:02:46 +08:00
f58cc207c4 Merge branch 'master' into xbx 2020-08-12 15:02:41 +08:00
192bd462d4 修改了图片 2020-08-12 15:01:25 +08:00
efde545104 Merge pull request '更换图片' (#41) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/41
2020-08-12 11:34:02 +08:00
b1e5b24319 更换图片 2020-08-12 11:31:57 +08:00
cmx
2ea72995a9 Merge pull request 'fixed bug' (#40) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/40
2020-08-11 20:39:12 +08:00
cmxdd
26c2e044dc fixed bug 2020-08-11 20:37:54 +08:00
5500dc9f73 Merge pull request 'xbx' (#39) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/39
2020-08-11 18:28:33 +08:00
d97b749a0a 文本 2020-08-11 18:27:31 +08:00
cf76518bc9 time 2020-08-11 14:31:45 +08:00
8d7e4b2ce4 消息 2020-08-11 11:25:44 +08:00
cmx
7bfce17816 Merge pull request 'fixed bug adout publish shop' (#38) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/38
2020-08-11 09:41:52 +08:00
cmxdd
7cf5577cb0 fixed bug adout publish shop 2020-08-11 09:41:12 +08:00
cmx
e33e07178d Merge pull request 'cmx' (#37) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/37
2020-08-10 20:26:57 +08:00
cmxdd
9fac4e8a2e fixed bug adout shop 2020-08-10 20:24:58 +08:00
cmxdd
e223fd5ff9 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into cmx 2020-08-10 19:06:34 +08:00
gyh
d7c6625416 Merge pull request 'GDPAO' (#36) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/36
2020-08-10 19:04:54 +08:00
Gdpao
0a8f2f815d GDPAO 2020-08-10 19:03:44 +08:00
42a08e07ba Merge pull request '防止多次点击' (#35) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/35
2020-08-10 17:38:51 +08:00
4e350f4dd0 Merge branch 'master' into xbx 2020-08-10 17:38:46 +08:00
e946b98abf 防止多次点击 2020-08-10 17:31:56 +08:00
cmxdd
2759972de6 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into cmx 2020-08-10 16:55:34 +08:00
bee3ab9fba Merge pull request 'xbx' (#34) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/34
2020-08-10 16:48:34 +08:00
a318ea9f84 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-08-10 16:47:52 +08:00
3eaee9009a 聊天 2020-08-10 16:47:27 +08:00
cmxdd
2ab2d1c38e fixed bug 2020-08-10 15:55:21 +08:00
gyh
d8840edb30 Merge pull request 'gdpao' (#33) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/33
2020-08-10 14:48:10 +08:00
Gdpao
1d98624753 gdpao 2020-08-10 14:47:20 +08:00
75a4bbedbe Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-08-10 14:45:35 +08:00
cmx
d4a9b38f99 Merge pull request 'cmx' (#32) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/32
2020-08-10 12:08:34 +08:00
cmxdd
3b9e429c80 Merge branch 'cmx' of http://git.luyuan.tk/luyuan/demingshangjia into cmx 2020-08-10 12:07:30 +08:00
cmxdd
a9d4708d2c fixe bug about image 2020-08-10 12:04:09 +08:00
cmx
7206d00afc Merge pull request 'master' (#31) from master into cmx
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/31
2020-08-10 11:32:18 +08:00
cmx
798f499263 Merge pull request 'cmx' (#30) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/30
2020-08-10 11:31:51 +08:00
cmxdd
64da585bd7 add login out 2020-08-10 11:31:03 +08:00
cmxdd
959afc776a fixed bg adout login 2020-08-10 11:27:06 +08:00
f89803cf9b 消息 2020-08-10 10:41:20 +08:00
cmx
795726bdb8 Merge pull request 'cmx' (#29) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/29
2020-08-10 10:25:18 +08:00
cmxdd
de2b7fe26d uopdate about conflict 2020-08-10 10:24:36 +08:00
cmxdd
a0e780d05b update adout color of tag 2020-08-10 10:01:10 +08:00
cmxdd
0b5fa511bf update adout tag color 2020-08-10 09:56:01 +08:00
a1cba0a7fd Merge pull request 'meiyan' (#26) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/26
2020-08-09 18:37:34 +08:00
1b03d1be7e Merge branch 'master' into xbx 2020-08-09 18:37:26 +08:00
55695f164b meiyan 2020-08-09 18:36:37 +08:00
084826e144 Merge pull request 'xbx' (#25) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/25
2020-08-08 18:35:18 +08:00
ab4b418c8f Merge branch 'master' into xbx 2020-08-08 18:35:11 +08:00
56eb7e551c Merge branch 'xbx' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-08-08 18:34:45 +08:00
0279128637 解决了不出现的问题 2020-08-08 18:34:43 +08:00
d78b787967 Merge pull request 'xbx' (#24) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/24
2020-08-08 17:30:06 +08:00
242f22d2ce Merge branch 'master' into xbx 2020-08-08 17:29:58 +08:00
427442f50a 关闭 2020-08-08 17:28:34 +08:00
641cb4a4a2 选中颜色 2020-08-08 16:53:44 +08:00
78d60bd9ac 消息提示 2020-08-08 16:32:37 +08:00
217e8b51ed 临时测试 2020-08-08 15:17:36 +08:00
74a9778a62 最初版本 合并 2020-08-08 15:09:56 +08:00
e83b5b1311 Merge pull request 'xbx' (#23) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/23
2020-08-07 18:03:55 +08:00
ceb2b8084d 聊天完成 2020-08-07 16:55:00 +08:00
4453742f3c 删除聊天搜索 2020-08-07 15:07:45 +08:00
93c412a515 聊天完成 2020-08-07 14:44:11 +08:00
cmxdd
71a25fd11d fixed bug 2020-08-06 17:02:11 +08:00
cmxdd
6ec2318d0c update photo adout publish 2020-08-06 14:40:11 +08:00
cmxdd
04a4ed523f update bug 2020-08-06 11:48:45 +08:00
cmxdd
e67e2fe701 update code adout order 2020-08-06 10:04:38 +08:00
cmx
7d82d8d156 Merge pull request 'Merge pull request 'cmx' (#21) from cmx into master' (#22) from master into cmx
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/22
2020-08-05 20:12:03 +08:00
86 changed files with 5198 additions and 623 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.vscode
node_modules
unpackage
unpackage
manifest.json

28
App.vue
View File

@@ -1,18 +1,38 @@
<script>
export default {
globalData: {
im: {}
},
onLaunch: function() {
console.log('App Launch');
// 禁止旋转
// #ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary');
// #endif
getApp().globalData.im = this.imService
// console.log('App Launch');
// 缓存token
uni.getStorage({
key: "token",
success: (res) => {
// uni.switchTab({
// url: "/pages/index/index"
// })
}
})
},
onShow: function() {
console.log('App Show');
// console.log('App Show');
},
onHide: function() {
console.log('App Hide');
// console.log('App Hide');
}
};
</script>
<style lang="scss">
/*每个页面公共css */
/* #ifndef APP-PLUS-NVUE */
@import 'uview-ui/index.scss';
</style>
/* #endif*/
</style>

7
common/cos-wx-sdk-v5.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -77,7 +77,6 @@ const install = (Vue, vm) => {
return vm.$u.post("/Takeawayer/tryOrderSnList")
},
// 投诉骑手
reportorder({order_id,takeawayer_id,order_list,content}){
return vm.$u.post("/takeawayer/complaintTakeawayer",{order_id,takeawayer_id,order_list,content})
},
@@ -86,8 +85,8 @@ const install = (Vue, vm) => {
return vm.$u.post("/article/articleInfo",{article_id})
},
// 回复评论
reply({article_id,pid,content}){
return vm.$u.post("/article/articleAddComment",{article_id,pid,content})
reply({article_id,pid,content,reply_id}){
return vm.$u.post("/article/articleAddComment",{article_id,pid,content,reply_id})
},
// 达人是否可以直播
canlive(){
@@ -114,13 +113,17 @@ const install = (Vue, vm) => {
return vm.$u.post("/order/goodsTryOrderInfo",{goods_try_id})
},
// 绑定物流订单
bindpushid({order_id,shipping_code,shipping_express_id}){
return vm.$u.post("/order/send",{order_id,shipping_code,shipping_express_id})
bindpushid({store_deliver_type,order_id,shipping_code,shipping_express_id}){
return vm.$u.post("/order/send",{store_deliver_type,order_id,shipping_code,shipping_express_id})
},
// 绑定骑手
bindcarer({order_id,takeawayer_id}){
return vm.$u.post("/order/orderRider",{order_id,takeawayer_id})
bindcarer({store_deliver_type,order_id,takeawayer_id}){
return vm.$u.post("/order/send",{store_deliver_type,order_id,takeawayer_id})
},
// 自提
bindmention({store_deliver_type,shipping_express_id,deliver_explain,order_id,sendimg}) {
return vm.$u.post("/order/send",{store_deliver_type,shipping_express_id,deliver_explain,order_id,sendimg})
},
// 发货物流公司
pushcompany(){
return vm.$u.post("/order/getExpress")
@@ -132,9 +135,35 @@ const install = (Vue, vm) => {
// 试穿
agreetest({goods_try_id,type,takeawayer_id}){
return vm.$u.post("/order/goodsTryAgree",{goods_try_id,type,takeawayer_id})
},
// 物流
getcarinfo({order_id}) {
return vm.$u.post("/Order/orderLogistics",{order_id})
},
messageList({page = 1}){
return vm.$u.post("/message/messageList",{page})
},
isread(){
return vm.$u.post("/message/isread")
},
messageInfo({id}){
return vm.$u.post("/message/messageInfo",{id})
},
// 达人验证码
getCode({member_mobile,smslog_type=2}) {
return vm.$u.post("/Sms/sendSmsCode",{member_mobile,smslog_type})
},
// 达人登录
starLogin({member_mobile,sms_code}) {
return vm.$u.post("/Login/platformExpertPhoneLogin",{member_mobile,sms_code})
},
//上传直播间人数
//https://mall.dmygkeji.com/storeapi/Streaming/changeLiveRealtimeNumber?live_id=1&realtime_number=10
changeLiveRealtimeNumber({id,number}){
return vm.$u.post("Streaming/changeLiveRealtimeNumber",{live_id:id,realtime_number:number})
}
}
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = api;

View File

@@ -1,7 +1,7 @@
const install = (Vue, vm) => {
// 此为自定义配置参数,具体参数见上方说明
Vue.prototype.$u.http.setConfig({
baseUrl: 'https://dmmall.sdbairui.com/storeapi',
baseUrl: 'https://mall.dmygkeji.com/storeapi',
loadingText: '努力加载中~',
loadingTime: 800,
originalData: true,

View File

@@ -0,0 +1,63 @@
<template>
<div class="goeasy-audio-player" @click="playAudio">
<div class="audio-facade" :style="{width:Math.ceil(duration)*7 + 50 + 'px'}">
<div class="audio-facade-bg" :class="{'play-icon':play}"> </div>
<div>{{Math.ceil(duration) || 0}}</div>
</div>
</div>
</template>
<script>
const innerAudioContext = uni.createInnerAudioContext();
export default {
name: "GoEasyAudioPlayer",
props : ['src', 'duration'],
data () {
return {
play : false
}
},
methods : {
playAudio () {
this.play = true;
innerAudioContext.src = this.src;
innerAudioContext.play();
setTimeout(() => {
this.play = false;
}, this.duration*1000)
}
}
}
</script>
<style scoped>
.goeasy-audio-player{
margin-top: 12rpx;
-webkit-tap-highlight-color:rgba(0,0,0,0);
}
.audio-facade{
min-width: 20rpx;
padding: 6rpx 10rpx;
height: 72rpx;
line-height: 72rpx;
background: #FF780F;
font-size: 24rpx;
border-radius: 14rpx;
color: #ffffff;
display: flex;
flex-direction: row-reverse;
}
.audio-facade-bg{
background: url("./images/voice.png") no-repeat center;
background-size: 30rpx;
width: 40rpx;
}
.audio-facade-bg.play-icon{
background: url("./images/play.gif") no-repeat center;
background-size: 30rpx;
-moz-transform:rotate(180deg);
-webkit-transform:rotate(180deg);
-o-transform:rotate(180deg);
transform:rotate(180deg);
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

View File

@@ -0,0 +1,55 @@
<template>
<video
v-if="show"
class="video-player"
controls = ""
@play="onPlayStart"
id="videoPlayer"
autoplay="true"
@fullscreenchange="onVideoFullScreenChange"
:src="url">
</video>
</template>
<script>
export default {
name: "GoEasyVideoPlayer",
data () {
return {
show : false,
context: null,
url: ''
}
},
methods : {
play (video) {
this.show = true;
this.url = video.url;
this.context = uni.createVideoContext('videoPlayer');
},
onVideoFullScreenChange (e) {
//当退出全屏播放时,隐藏播放器
if(this.show && !e.detail.fullScreen){
this.show = false;
this.context.stop();
}
},
onPlayStart () {
//播放开始时,立即全屏
this.context.requestFullScreen({
direction : 0
});
}
}
}
</script>
<style scoped>
.video-player{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

View File

@@ -1,6 +1,6 @@
<template>
<view class="content-item">
<view class="image">
<view class="image" @click="toDetailsPage">
<image class="cover" :src="info.article_pic" alt="没有图片"></image>
<image src="/static/image/user/5.png" class="play-icon" v-if="type==2"></image>
</view>

View File

@@ -10,14 +10,17 @@
<view class="status" v-if="info.view_type==1">待处理订单</view>
<view class="status" v-else-if="info.view_type==2">已发货订单</view>
<view class="status" v-else-if="info.view_type==3">已完成订单</view>
<view class="status" v-else-if="info.view_type==4">申请退款订单</view>
<view class="status" v-else-if="info.view_type==4">申请退款</view>
<view class="status" v-else-if="info.view_type==5">已退款订单</view>
<view class="status" v-else-if="info.view_type==6">拒绝退款订单</view>
<view class="status" v-else-if="info.view_type==6">商家同意</view>
<view class="status" v-else-if="info.view_type==7">商家拒绝</view>
<view class="status" v-else-if="info.view_type==10">待支付订单</view>
</view>
<view class="name u-line-1">{{info.extend_order_goods[0].goods_name}}</view>
<view class="info">
<view class="num">{{info.extend_order_goods[0].goods_num}}件商品</view>
<view class="price">实付<span>{{info.extend_order_goods[0].goods_pay_price}}</span></view>
<view class="num">{{info.count_number}}件商品</view>
<view class="price">{{ info.view_type==10 ? "待支付" : "实付" }}<span>{{info.order_amount}}</span></view>
<view class="time">{{ info.view_type==10 ? info.add_time.slice(5,16) : info.payment_time.slice(5,16) }}</view>
</view>
</view>
</view>
@@ -47,14 +50,14 @@ export default {
height: 220rpx;
background: rgba(255,255,255,1);
border-radius: 10rpx;
padding: 30rpx;
padding: 20rpx 10rpx;
display: flex;
align-items: center;
> image {
width: 160rpx;
height: 160rpx;
flex-shrink: 0;
margin-right: 25rpx;
margin-right: 20rpx;
}
.goods {
display: flex;
@@ -81,9 +84,10 @@ export default {
margin-bottom: 30rpx;
}
.info {
width: 100%;
width: 470rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
color: rgba(102,102,102,1);
.price {
@@ -93,6 +97,9 @@ export default {
}
}
}
.time {
font-size: 20rpx;
}
}
}
</style>

View File

@@ -2,18 +2,21 @@
<view class="item" @click="toDetailsPage">
<image :src="info.goods_pic"></image>
<view class="goods">
<view class="">
<view class="box">
<view class="boxid">
{{info.goods_try_id}}
</view>
<!-- 0:待处理订单 20:同意 40:拒绝此订单 -->
<view class="status" v-if="info.goods_try_order_status==0">待处理订单</view>
<view class="status" v-if="info.goods_try_order_status==20">已接单订单</view>
<view class="status" v-if="info.goods_try_order_status==40">已拒绝订单</view>
<view class="status" v-if="info.goods_try_order_status==50">已完成订单</view>
</view>
<view class="name u-line-1">{{info.goods_name}}</view>
<view class="info">
<view class="num">{{info.goods_try_num}}件商品</view>
<view class="price">实付<span>{{info.price}}</span></view>
<!-- <view class="time">{{ info.payment_time.slice(5,16) }}</view> -->
</view>
</view>
</view>
@@ -31,6 +34,9 @@ export default {
toDetailsPage() {
let type =0
let info = this.info
if(info.is_delete == 1){
return ;
}
if(info.goods_try_order_status==0){
type=1
}else if(info.goods_try_order_status==20){
@@ -67,7 +73,15 @@ export default {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
justify-content: space-between;
.box{
width: 100%;
display: flex;
font-size: 24rpx;
}
.boxid{
flex: 1;
}
.status {
align-self: flex-end;
font-size: 26rpx;

View File

@@ -18,12 +18,19 @@ export default {
xuanzhong:false,
}
},
props:['image','title','price','num','sid'],
props:['image','title','price','num','sid','wxuanzhong'],
methods:{
xuanzhongs(){
this.xuanzhong = !this.xuanzhong
this.$emit("xuanzhong")
}
},
watch:{
},
created(){
this.xuanzhong = this.wxuanzhong
console.log(this.wxuanzhong)
}
}
</script>

View File

@@ -2,10 +2,16 @@
<view id="release">
<!-- 标签 -->
<view>
<view class="titles">标签</view>
<view class="titles flex-title">
<text>标签</text>
<text @click="editing">{{ is_edit ? "取消编辑" : "编辑" }}</text>
</view>
<view class="form-view" @click="show_add()">+ 新建标签</view>
<view class="form-view" :class=" {'cur': rSelect.indexOf(item.id)!=-1} " @tap="tapInfo(item.id)" v-for="(item,index) in fileListes"
:key="index">{{item.name}}</view>
:key="index">
{{item.name}}
<u-icon v-show="is_edit && item.user_id != 0" class="close" name="close" color="#666" size="18" @click="isTable(item.id,index)"></u-icon>
</view>
</view>
<!-- 添加标签的按钮 -->
<u-popup v-model="show" mode="center" border-radius="14" :closeable="true">
@@ -35,7 +41,8 @@
action: 'http://www.example.com/upload',
fileList: [],
show: false,
rSelect: []
rSelect: [],
is_edit: false,
}
},
props:['fileListes'],
@@ -44,6 +51,10 @@
console.log(this.show)
this.show = !this.show
},
// 编辑标签
editing() {
this.is_edit = !this.is_edit;
},
// 颜色切换
tapInfo(e) {
if (this.rSelect.indexOf(e) == -1) {
@@ -54,6 +65,31 @@
}
this.$emit("qiehuan",this.rSelect)
},
// 删除标签
isTable(id,index) {
uni.showModal({
title: "提示",
content: "是否删除此标签?",
success: (res) => {
console.log();
if (res.confirm) {
this.delTable(id,index);
}
}
})
},
delTable(id,index) {
let me = this;
this.$u.post("Streaming/deltLabel", {label_id: id}).then(res => {
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
this.fileListes.splice(index,1);
}
})
},
chuangjian(){
this.$u.api.createLivesp({spec_name:this.form.name}).then((res)=>{
if(res.errCode != 0){
@@ -62,7 +98,8 @@
type: 'error'
})
}else{
this.show_add()
this.show_add();
this.fileListes.push(res.data);
this.$refs.uToast.show({
title: res.message,
type: 'success'
@@ -80,7 +117,12 @@
#release {
width: 690rpx;
margin: 0 auto;
.flex-title {
display: flex;
justify-content: space-between;
}
.form-view {
background: rgba(255, 255, 255, 1);
border-radius: 6rpx;
@@ -90,6 +132,10 @@
display: inline-block;
margin-bottom: 28rpx;
color: #333;
.close {
margin-left: 10rpx;
vertical-align: middle;
}
}
.titles {

View File

@@ -1,11 +1,12 @@
import Vue from 'vue'
import App from './App'
import IMService from './static/imservice.js'
import uView from "uview-ui";
Vue.use(uView);
Vue.config.productionTip = false
Vue.prototype.imService = new IMService();
Vue.prototype.a = 1;
App.mpType = 'app'
const app = new Vue({

View File

@@ -1,9 +1,9 @@
{
"name" : "hdemingshangjia",
"appid" : "",
"name" : "德铭阳光商家",
"appid" : "__UNI__EA895BE",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "1.0.1",
"versionCode" : 103,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@@ -16,8 +16,20 @@
"autoclose" : true,
"delay" : 0
},
"safearea" : {
//安全区域配置仅iOS平台生效
"bottom" : {
// 底部安全区域配置
"offset" : "none" // 底部安全区域偏移,"none"表示不空出安全区域,"auto"自动计算空出安全区域,默认值为"none"
}
},
/* */
"modules" : {},
"modules" : {
"Push" : {},
"OAuth" : {},
"VideoPlayer" : {},
"LivePusher" : {}
},
/* */
"distribute" : {
/* android */
@@ -45,12 +57,68 @@
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
],
"abiFilters" : [ "armeabi-v7a", "x86" ]
},
/* ios */
"ios" : {},
"ios" : {
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "应用将在您上传图文视频等服务中使用您的相册。",
"NSMicrophoneUsageDescription" : "应用将会在您开启直播时使用您的麦克风。",
"NSCameraUsageDescription" : "应用将会在您开启直播时使用您的摄像头。"
}
},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs" : {
"ad" : {},
"push" : {},
"oauth" : {},
"maps" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
},
"splashscreen" : {
"iosStyle" : "storyboard",
"ios" : {
"storyboard" : "/Users/xf/workspace/wwwroot/deming-uniapp/static/CustomStoryboard.zip"
},
"androidStyle" : "default",
"android" : {
"hdpi" : "/Users/xf/workspace/wwwroot/deming-uniapp/static/app/start/480x762.png",
"xhdpi" : "/Users/xf/workspace/wwwroot/deming-uniapp/static/app/start/720x1242.png",
"xxhdpi" : "/Users/xf/workspace/wwwroot/deming-uniapp/static/app/start/1080x1882.png"
}
}
}
},
/* */
@@ -72,7 +140,7 @@
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics": {
"enable": false
"uniStatistics" : {
"enable" : false
}
}

View File

@@ -13,6 +13,30 @@
}
}
},
{
"path": "pages/login/agreements",
"style": {
"navigationBarTitleText": "用户协议",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"titleColor": "#333333"
}
}
}
},
{
"path": "pages/login/privacy_policy",
"style": {
"navigationBarTitleText": "隐私政策",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"titleColor": "#333333"
}
}
}
},
{
"path": "pages/release/tosign",
"style": {
@@ -37,10 +61,19 @@
}
}
},
{
"path": "pages/messages/privateChat",
"style": {
"navigationBarTitleText": "uni-app",
"app-plus": {
"titleNView": true
}
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "德铭阳光在线",
"navigationBarTitleText": "德铭阳光商家",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
@@ -59,17 +92,17 @@
}
}
}
},
{
"path": "pages/index/otherdetails",
"style": {
"navigationBarTitleText": "试穿订单详情",
"app-plus": {
"titleNView": {
"titleColor": "#333333"
}
}
}
},
{
"path": "pages/index/otherdetails",
"style": {
"navigationBarTitleText": "试穿订单详情",
"app-plus": {
"titleNView": {
"titleColor": "#333333"
}
}
}
},
{
"path": "pages/release/video",
@@ -146,7 +179,7 @@
"titleColor": "#333333",
"buttons": [ //原生标题栏按钮配置,
{
"text": "保存",
"text": "保存",
"fontSize":"14px"
}
]
@@ -213,6 +246,18 @@
}
}
},
{
"path": "pages/user/feedback",
"style": {
"navigationBarTitleText": "用户反馈",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"titleColor": "#333333"
}
}
}
},
{
"path": "pages/user/complaintDetails",
"style": {
@@ -247,8 +292,30 @@
"animationType": "slide-in-bottom"
}
}
},
{
"path": "pages/messages/list",
"style": {
"navigationBarTitleText": "活动列表",
"app-plus": {
}
}
},
{
"path": "pages/messages/info",
"style": {
"navigationBarTitleText": "活动详情",
"app-plus": {
}
}
}
],
,{
"path" : "pages/index/mention",
"style" : {
"navigationBarTitleText": "上传凭证"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
@@ -257,32 +324,30 @@
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#3cc51f",
"selectedColor": "#FF780F",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"height": "50px",
"fontSize": "10px",
"iconWidth": "24px",
"spacing": "3px",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "",
"selectedIconPath": "",
"iconPath": "static/image/tabbar/index.png",
"selectedIconPath": "static/image/tabbar/indexselect.png",
"text": "首页",
"selectedColor": "#FBFBFB"
}, {
"pagePath": "pages/messages/messagesList",
"iconPath": "",
"selectedIconPath": "",
"iconPath": "static/image/tabbar/info.png",
"selectedIconPath": "static/image/tabbar/infoselect.png",
"text": "消息",
"selectedColor": "#FBFBFB"
}, {
"pagePath": "pages/user/index",
"iconPath": "",
"selectedIconPath": "",
"iconPath": "static/image/tabbar/mine.png",
"selectedIconPath": "static/image/tabbar/mineselect.png",
"text": "我的",
"selectedColor": "#FBFBFB"
}]
}
}
}

View File

@@ -1,22 +1,78 @@
<template>
<view class="details">
<view class="goods-info">
<image :src="info.extend_order_goods[0].goods_image"></image>
<view class="info-right">
<view class="name u-line-1">{{ info.extend_order_goods[0].goods_name }}</view>
<view class="info">
<view class="num">{{ info.extend_order_goods[0].goods_num }}件商品</view>
<view class="price">
实付
<span>{{ info.extend_order_goods[0].goods_pay_price }}</span>
<view class="box" v-if="type<4">
<view class="goods-info" v-for="list in info.extend_order_goods">
<image :src="list.image_480_url"></image>
<view class="info-right">
<view class="name u-line-1">{{ list.goods_name }}</view>
<view class="info">
<view class="num">{{ list.goods_num }}件商品</view>
<view class="price">
实付
<span>{{ list.goods_pay_price }}</span>
</view>
</view>
</view>
</view>
</view>
<u-radio-group class="box" v-model="value" v-if="type>3">
<view class="goods-info" v-for="list in info.goods_list">
<image :src="list.image_480_url"></image>
<view class="info-right">
<view class="name u-line-1">{{ list.goods_name }}</view>
<view class="info">
<view class="num">{{ list.goods_num }}件商品</view>
<view class="price">
{{ type == 10 ? "待支付" : "实付" }}
<span>{{ list.goods_pay_price }}</span>
</view>
</view>
</view>
<!-- <u-radio :name="list.refund_id" v-if="type==4" shape="circle" @change="radioGroupChange"> -->
</u-radio >
</view>
</u-radio-group>
<!-- 待处理 -->
<view class="user-info" v-if="type == 1">
<view class="info-title">收件人信息</view>
<view class="info-container">
<view>
<view class="title">姓名</view>
<view class="value">{{ info.extend_order_common.reciver_name }}</view>
<image src="/static/image/home/chat.png" @click="tochat(info.buyer_id)"></image>
</view>
<view>
<view class="title">手机号</view>
<view class="value" @longtap="longtap(info.extend_order_common.reciver_info.mob_phone)">{{ info.extend_order_common.reciver_info.mob_phone }}</view>
</view>
<view>
<view class="title">收货地址</view>
<view class="value u-line-2" @longtap="longtap(info.extend_order_common.reciver_info.address)">{{ info.extend_order_common.reciver_info.address }}</view>
</view>
<view>
<view class="title">派送方式</view>
<view class="value u-line-1">{{ users_type == 0 ? "-" : users_type == 1 ? "快递" : users_type == 2 ? "骑手" : "自提" }}</view>
</view>
<view class="remark">
<view class="title">订单备注</view>
<view class="value" @longtap="longtap(info.extend_order_common.order_message)">{{ info.extend_order_common.order_message }}</view>
</view>
<view @click="showInvoice">
<view class="title">开具发票</view>
<view class="invoice">
<text>{{ is_invoice ? "是" : "否" }}</text>
<u-icon name="arrow-right" color="#999" size="20" style="margin-left: 10rpx;"></u-icon>
</view>
</view>
</view>
</view>
<view class="refunds-user" v-if="type == 2 || type == 3 || type == 4 || type == 5 || type == 6">
<!-- 待处理之后的 -->
<view class="refunds-title" v-if="type!=1">收件人信息</view>
<view class="refunds-user" v-if="type == 2 || type == 3 || type == 4 || type == 5 || type == 6|| type == 7">
<view>
<image src="/static/image/home/2.png"></image>
<view>{{ info.extend_order_common.reciver_name }}</view>
<image src="/static/image/home/chat.png" @click="tochat(info.buyer_id)"></image>
</view>
<view>
<image src="/static/image/home/3.png"></image>
@@ -27,44 +83,101 @@
<view class="address u-line-1">{{ info.extend_order_common.reciver_info.address }}</view>
</view>
</view>
<view class="user-info" v-if="type == 1">
<view class="info-title">收件人信息</view>
<view class="info-container">
<view>
<view class="title">姓名</view>
<view class="value">{{ info.extend_order_common.reciver_name }}</view>
</view>
<view>
<view class="title">手机号</view>
<view class="value">{{ info.extend_order_common.reciver_info.mob_phone }}</view>
</view>
<view>
<view class="title">收货地址</view>
<view class="value u-line-1">{{ info.extend_order_common.reciver_info.address }}</view>
</view>
</view>
</view>
<view class="delivery" v-if="type == 1">
<!-- 待处理 -->
<view class="delivery" v-if="type == 1 && cur != -1">
<view class="title">派送方式</view>
<view class="methods">
<view :class="{ active: cur == 0 }" @click="pushstyleA">快递</view>
<view :class="{ active: cur == 1 }" @click="pushstyleB">骑手</view>
<view :style="{'color': this.cur == -1 ? '#333' : '' }" :class="{ active: cur == 0 }" @click="pushstyleA">快递</view>
<view :style="{'color': this.cur == -1 ? '#333' : '' }" :class="{ active: cur == 1 }" @click="pushstyleB">骑手</view>
<view :class="{ active: cur == 2 }" @click="pushstyleC">自提</view>
</view>
<view v-if="pushstyleBshow && (pushid || selctcar)" >
<view class="title">{{cur == 0 ? '快递单号':'骑手信息'}}</view>
<view class="value">{{ cur == 0 ? pushid ? companyidA.express_name + ": " + pushid : '' : selctcar ? selctcar.label : '' }}</view>
</view>
<view class="btn" @click="confirmpushstyle">确认</view>
</view>
<!-- 已发货 -->
<view class="pushtimeline" v-if="type == 2">
<view class="timelinetitle">物流信息</view>
<view class="timelineid">订单单号:{{ info.order_sn }}</view>
<view class="timelinebox" v-for="list in info.express_list">
<view class="timelinecontent">{{list.content}}</view>
<view class="timelinetime">{{list.kd_time}}</view>
</view>
<view v-if="ordered_type == 1">
<view class="timelinetitle">物流信息</view>
<view class="timelineid">订单单号:&nbsp;&nbsp;&nbsp;{{ info.order_sn }}</view>
<view class="timelinebox" v-for="(list,index) in info.express_list" :key="index">
<view class="timelinecontent">{{list.content}}</view>
<view class="timelinetime">{{list.kd_time}}</view>
</view>
</view>
<view v-else-if="ordered_type == 2">
<view class="timelinetitle">骑手信息</view>
<view class="refunds-user-two">
<view>
<image src="/static/image/home/2.png"></image>
<view>{{ takeawayer_info.takeawayer_name }}</view>
</view>
<view>
<image src="/static/image/home/3.png"></image>
<view>{{ takeawayer_info.takeawayer_mobile }}</view>
</view>
<view>
<image src="/static/image/home/4.png"></image>
<view class="address u-line-1">{{ takeawayer_info.company_name }}</view>
</view>
</view>
</view>
<view v-else style="padding-bottom: 20rpx;">
<view class="timelinetitle">自提信息</view>
<view>
<view class="ziti-title">凭证图片</view>
<image class="certificate-img" :src="mineBy_img" @tap="viewImage" mode="aspectFill"></image>
</view>
<view>
<view class="ziti-title">备注:</view>
<view class="u-line-5">{{ mineBy_text }}</view>
</view>
</view>
</view>
<!-- 已完成 -->
<!-- 退款处理 -->
<view class="refunds-option" v-if="type == 4">
<view :class="{ active: cur == 0 }" @click="unrefuse">不处理</view>
<view :class="{ active: cur == 1 }" @click="refuse">确定处理</view>
</view>
<view class="refund" v-if="type == 5 || type == 6">退款状态:{{ type == 5 ? '同意退款请注意查收' : '拒绝退款请等待客服联系' }}</view>
<!-- 同意退款/拒绝退款 -->
<view class="refund" v-if="type == 5 ">退款状态:同意退款请注意查收</view>
<view class="refund" v-if="type == 6 ">退款状态:商家同意退款等待后台处理</view>
<view class="refund" v-if="type == 7 ">退款状态:商家拒绝退款请等待客服联系</view>
<view class="pain-box" v-if="type == 10 ">
<view class="info-container">
<view>
<view class="title">姓名</view>
<view class="value">{{ info.extend_order_common.reciver_name }}</view>
<image src="/static/image/home/chat.png" @click="tochat(info.buyer_id)"></image>
</view>
<view>
<view class="title">手机号</view>
<view class="value" @longtap="longtap(info.extend_order_common.reciver_info.mob_phone)">{{ info.extend_order_common.reciver_info.mob_phone }}</view>
</view>
<view>
<view class="title">收货地址</view>
<view class="value u-line-2" @longtap="longtap(info.extend_order_common.reciver_info.address)">{{ info.extend_order_common.reciver_info.address }}</view>
</view>
<view>
<view class="title">派送方式</view>
<view class="value u-line-1">{{ users_type == 0 ? "-" : users_type == 1 ? "快递" : users_type == 2 ? "骑手" : "自提" }}</view>
</view>
<view class="remark">
<view class="title">订单备注</view>
<view class="value" @longtap="longtap(info.extend_order_common.order_message)">{{ info.extend_order_common.order_message }}</view>
</view>
<view @click="showInvoice">
<view class="title">开具发票</view>
<view class="invoice">
<text>{{ is_invoice ? "是" : "否" }}</text>
<u-icon name="arrow-right" color="#999" size="20" style="margin-left: 10rpx;"></u-icon>
</view>
</view>
</view>
</view>
<u-popup v-model="showDelivery" mode="center" border-radius="10" class="delivery-popup">
<view class="title">骑手信息</view>
<view class="input-info">
@@ -74,7 +187,8 @@
</view>
<view class="btn" @click="showDelivery = false">确认</view>
</u-popup>
<u-picker mode="selector" v-model="show" :default-selector="[0]" :range="list" range-key="content" @confirm="getselect"></u-picker>
<!-- <u-picker mode="selector" v-model="show" :default-selector="[0]" :range="list" range-key="content" @confirm="getselect" confirm-color="#ff780f;"></u-picker> -->
<u-select v-model="show" :list="list" @confirm="getselect" confirm-color="#FF780F"></u-select>
<!-- companylist -->
<u-picker
mode="selector"
@@ -86,10 +200,10 @@
title="请选择公司"
confirm-text="下一步"
></u-picker>
<u-popup v-model="showExpress" mode="center" border-radius="10" class="delivery-popup">
<u-popup v-model="showExpress" :mask-close-able="false" mode="center" border-radius="10" class="delivery-popup">
<view class="title">填写快递单号</view>
<view class="input-info"><input type="text" placeholder="请输入快递单号" v-model="pushid" /></view>
<view class="btn" @click="showExpress = false">确认</view>
<view class="input-info"><input type="text" style="color: #333; line-height: 1;" placeholder="请输入快递单号" v-model="pushid" /></view>
<view class="btn" @click="saveDelivery">确认</view>
</u-popup>
<u-popup v-model="showRefunds" mode="center" border-radius="10" class="refunds-popup">
<view v-if="cur == 1" class="popup-tips">
@@ -107,6 +221,42 @@
<view class="determine" @click="confirm">确定</view>
</view>
</u-popup>
<u-popup class="invoice-box" v-model="show_invoice" :mask-close-able="false" mode="center" length="540rpx" border-radius="10">
<view class="title">
<text>发票信息</text>
<u-icon class="close" name="close" @click="show_invoice=false"></u-icon>
</view>
<view class="info">
<view>
<text>发票抬头</text>
<view class="u-line-2">{{ invoiceList.invoice_title }}</view>
</view>
<view v-if="invoice_type==2">
<text>税号</text>
<text>{{ invoiceList.invoice_code }}</text>
</view>
<view v-if="invoice_type==2">
<text>单位地址</text>
<view class="u-line-3">{{ invoiceList.invoice_goto_addr }}</view>
</view>
<view>
<text>电话号码</text>
<text>{{ invoiceList.invoice_rec_mobphone }}</text>
</view>
<view v-if="invoice_type==2">
<text>开户银行</text>
<view class="u-line-3">{{ invoiceList.invoice_reg_bname }}</view>
</view>
<view v-if="invoice_type==2">
<text>银行账户</text>
<text>{{ invoiceList.invoice_reg_baccount }}</text>
</view>
<view v-if="invoice_type==1">
<text>身份证号</text>
<text>{{ invoiceList.invoice_code }}</text>
</view>
</view>
</u-popup>
<u-toast ref="uToast" />
</view>
</template>
@@ -115,7 +265,8 @@ export default {
data() {
return {
status: 1, // 订单状态
cur: Number,
cur: null,
show_invoice: false, // 发票
showDelivery: false, // 填写骑手信息
showExpress: false, // 填写快递单号
showRefunds: false, // 平台退货处理
@@ -128,39 +279,129 @@ export default {
express: '',
type: '',
orderid: 0,
info: {},
info: {
extend_order_goods:[{}],
extend_order_common:{
reciver_info:{
mob_phone:"",
address:""
},
receive_name:""
}
},
list: [],
pushid: null,
pushstate: false, //显示物流单号
selctcar: null, //骑手信息
companyidA: null, //物流派送公司id
companyidB: null //骑手派送公司id
companyidB: null, //骑手派送公司id
value:"",
refundid:null,
is_invoice: 0, // 判断发票
invoice_type: null,
invoiceList: {}, // 发票数据
users_type: "", // 用户选择发货type
ordered_type: 0, // 发货方式的状态
takeawayer_info: {}, // 骑手信息
mineBy_img: "", // 自提图片
mineBy_text: "", // 自提备注
pushstyleBshow: false
};
},
onLoad(option) {
this.type = option.type;
// console.log(this.type)
this.orderid = option.id;
this.resetinfo();
if (this.type == 1) {
// 获取快递公司
this.getcompanyinfo();
}
if (this.type == 2) {
this.getcarinfo();
// 获取物流信息
// this.getcarinfo();
}
// 订单状态: 0:全部 1已付款未发货 2已发货 3已完成 4申请退款/退货 5已退款/退货 6拒绝退款/退货
},
methods: {
// 跳转详情页面
tochat(ID){
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.online = false;
this.unReadMessage = 0;
this.text = text;
this.time = time;
this.date = date
}
console.log(ID)
const token = uni.getStorageSync('token');
let that = this
uni.request({
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId: ID
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
console.log(res)
res = res.data
let user = new Friend(res.data.member_id,res.data.member_nickname,res.data.member_avatar)
that.$u.route({
url:"/pages/messages/privateChat",
params:{
id:JSON.stringify(user)
}
})
}
})
},
// 退款单选
radioGroupChange(e) {
this.refundid = e
console.log(e);
},
pushstyle(index) {
// console.log(this.users_type);
if (this.users_type == 1 && index == 1) {
this.showcompany = true;
} else if (this.users_type == 2 && index == 2) {
this.show = true;
} else if (this.users_type == 3 && index == 3) {
this.cur = 2;
}
},
// 人工配送
pushstyleA() {
console.log(this.cur)
if(this.cur != 0 && this.cur != -1){
return ;
}
this.cur = 0;
this.showcompany = true;
},
// 选择骑手
pushstyleB() {
if(this.cur != 1 && this.cur != -1){
return ;
}
this.cur = 1;
this.show = true;
},
// 自提
pushstyleC() {
if(this.cur != 2 && this.cur != -1){
return ;
}
this.cur = 2;
this.pushstyleBshow = true
},
// 获取物流公司列表
getcompanyinfo() {
let that = this;
@@ -171,6 +412,26 @@ export default {
}
});
},
// 查询物流
// getcarinfo() {
// this.$u.api.getcarinfo({
// order_id: this.orderid
// }).then(res => {
// console.log(res);
// })
// },
// 保存订单号
saveDelivery() {
if (!this.pushid) {
uni.showToast({
title: "请填写快递单号!",
icon: "none"
})
return
}
this.showExpress = false;
this.pushstyleBshow = true
},
// 取消退款
cancel() {
this.showRefunds = false;
@@ -179,13 +440,20 @@ export default {
//
confirm() {
this.showRefunds = false;
// if (!this.refundid) {
// this.$refs.uToast.show({
// title: "请选择商品",
// type: "warning"
// });
// return;
// }
if (this.cur == 0) {
console.log(this.refundid);
// 确定退款
return;
this.$u.api.refund({
refund_id: this.orderid,
seller_state:2,
seller_message:""
refund_id: this.refundid,
seller_state: 3,
seller_message: ""
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
@@ -197,16 +465,21 @@ export default {
title: res.message,
type: 'success'
});
console.log(res);
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
console.log(prePage.$vm);
prePage.$vm.del_id = this.orderid;
uni.navigateBack({
delta: 1
});
}
});
} else {
// 不进行退款
return;
this.$u.api.refund({
refund_id: this.orderid,
seller_state:3,
seller_message:""
refund_id: this.refundid,
seller_state: 2,
seller_message: ""
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
@@ -218,6 +491,9 @@ export default {
title: res.message,
type: 'success'
});
uni.navigateBack({
delta: 1
});
console.log(res);
}
});
@@ -233,39 +509,36 @@ export default {
this.cur = 0;
this.showRefunds = true;
},
// 获取物流信息
getcarinfo() {
this.$u.api.getpushinfo({
order_id: this.orderid
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
console.log(res);
}
});
},
// 选择快递公司
getselectcompany(e) {
let obj = this.companylist[e[0]];
this.companyidA = obj.express_id;
this.companyidA = obj;
this.showExpress = true;
},
// 绑定配送方式
confirmpushstyle() {
// console.log(this.cur);
if (this.cur < 0) {
this.$refs.uToast.show({
title: '请选择派送方式!',
type: 'warning ',
})
return;
}
if (this.cur == 0) {
console.log(this.pushid);
if (!this.companyidA) {
this.$refs.uToast.show({
title: '请选择派送方式!',
type: 'warning ',
})
return;
}
// console.log(this.pushid);
this.$u.api.bindpushid({
store_deliver_type: 1,
order_id: this.orderid,
shipping_code: this.pushid,
shipping_express_id: this.companyidA
shipping_express_id: this.companyidA.express_id
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
@@ -282,8 +555,16 @@ export default {
});
}
});
} else {
} else if (this.cur == 1) {
if (!this.selctcar) {
this.$refs.uToast.show({
title: '请选择派送方式!',
type: 'warning ',
})
return;
}
this.$u.api.bindcarer({
store_deliver_type: 2,
order_id: this.orderid,
takeawayer_id: this.selctcar.takeawayer_id
}).then(res => {
@@ -298,13 +579,27 @@ export default {
title: res.message,
type: 'success'
});
uni.navigateBack({
delta: 1
});
}
});
} else {
uni.navigateTo({
url: "mention?id=" + this.orderid
})
}
},
// 显示发票
showInvoice() {
if (this.is_invoice) {
this.show_invoice = true;
}
},
// 选择骑手
getselect(e) {
this.selctcar = this.list[e[0]];
this.selctcar = this.list[e[0].value];
this.pushstyleBshow = true
},
// 获取订单信息
resetinfo() {
@@ -319,6 +614,21 @@ export default {
});
} else {
this.info = res.data;
this.cur = res.data.member_deliver_type - 1;
this.users_type = res.data.member_deliver_type; // 用户选择发货方式
this.invoiceList = res.data.extend_order_common.invoice_info;
this.is_invoice = this.invoiceList.invoice_id || false;
this.invoice_type = this.invoiceList.invoice_type;
this.ordered_type = res.data.store_deliver_type; // 发货方式
// console.log(this.users_type,this.cur);
// 骑手
this.takeawayer_info = res.data.takeawayer || {}; // 骑手信息
// 自提
this.mineBy_img = res.data.extend_order_common.sendimg; // 自提图片
this.mineBy_text = res.data.extend_order_common.deliver_explain; // 自提备注
// 退款id
this.refundid = res.data.refund_list[0].refund_id;
// console.log(this.invoiceList,this.is_invoice,this.invoice_type);
}
});
this.$u.api.takeawayerlist({}).then(res => {
@@ -331,12 +641,30 @@ export default {
} else {
let arr = res.data;
for (let index in arr) {
arr[index].content = arr[index].company_name + '——' + arr[index].contacts + '——' + arr[index].contact_number;
arr[index].value = index;
arr[index].label = arr[index].company_name + ' ' + arr[index].contacts + ' ' + arr[index].contact_number;
}
this.list = arr;
}
});
}
},
// 预览图片
viewImage() {
console.log(this.mineBy_img);
uni.previewImage({
urls: this.mineBy_img,
current: 1
})
},
// 复制到粘贴板
longtap(text) {
console.log(text);
uni.setClipboardData({
data: text,
success: (res) => {
}
});
}
}
};
</script>
@@ -348,6 +676,7 @@ export default {
background-color: #ececec;
.goods-info {
background-color: #ffffff;
width: 750rpx;
padding: 30rpx;
display: flex;
align-items: center;
@@ -381,6 +710,12 @@ export default {
}
}
}
.refunds-title{
padding: 25rpx 30rpx;
font-weight: 500;
color: #333333;
background-color: #ffffff;
}
.refunds-user {
padding: 25rpx 30rpx;
background-color: #ffffff;
@@ -388,6 +723,7 @@ export default {
> view {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
@mixin image-class($width, $right) {
> image {
@@ -409,11 +745,57 @@ export default {
@include image-class($width: 36rpx, $right: 22rpx);
}
> view {
flex: 1;
font-size: 26rpx;
color: rgba(51, 51, 51, 1);
}
}
}
.refunds-user-two {
padding: 25rpx 0;
background-color: #ffffff;
margin-bottom: 20rpx;
> view {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
@mixin image-class($width, $right) {
> image {
flex-shrink: 0;
width: $width;
height: 40rpx;
margin-right: $right;
}
}
&:first-child {
@include image-class($width: 40rpx, $right: 20rpx);
}
&:nth-child(2) {
margin-left: 4rpx;
@include image-class($width: 32rpx, $right: 24rpx);
}
&:last-child {
margin-left: 2rpx;
@include image-class($width: 36rpx, $right: 22rpx);
}
> view {
flex: 1;
font-size: 26rpx;
color: rgba(51, 51, 51, 1);
}
}
}
.ziti-title {
margin: 20rpx 0 10rpx;
font-size: 28rpx;
color: #333;
}
.certificate-img {
width: 320rpx;
height: 240rpx;
border-radius: 4rpx;
}
.user-info {
.info-title {
font-size: 30rpx;
@@ -428,10 +810,16 @@ export default {
padding: 0 30rpx;
background-color: #ffffff;
margin-bottom: 20rpx;
.remark {
padding: 10rpx 0;
height: 100%;
min-height: 88rpx;
}
> view {
height: 88rpx;
display: flex;
align-items: center;
height: 88rpx;
padding: 10rpx 0;
color: rgba(51, 51, 51, 1);
&:not(:last-child) {
border-bottom: 2rpx solid #ececec;
@@ -443,10 +831,60 @@ export default {
}
.value {
font-size: 26rpx;
flex: 1;
}
.invoice {
margin-left: auto;
font-size: 26rpx;
color: #333;
}
image{
width: 40rpx;
height: 40rpx;
}
}
}
}
.pain-box {
.info-container {
padding: 0 30rpx;
margin-bottom: 20rpx;
background-color: #ffffff;
.remark {
padding: 10rpx 0;
height: 100%;
min-height: 88rpx;
}
> view {
display: flex;
align-items: center;
height: 88rpx;
padding: 10rpx 0;
color: rgba(51, 51, 51, 1);
&:not(:last-child) {
border-bottom: 2rpx solid #ececec;
}
.title {
width: 150rpx;
font-size: 30rpx;
margin-right: 10rpx;
}
.value {
font-size: 26rpx;
flex: 1;
}
.invoice {
margin-left: auto;
font-size: 26rpx;
color: #333;
}
image{
width: 40rpx;
height: 40rpx;
}
}
}
}
.delivery {
flex: 1;
background-color: #ffffff;
@@ -461,10 +899,11 @@ export default {
.methods {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
> view {
font-size: 30rpx;
color: rgba(0, 0, 51, 1);
width: 335rpx;
color: #999;
width: 30%;
height: 80rpx;
border: 1rpx solid rgba(236, 236, 236, 1);
background: rgba(236, 236, 236, 1);
@@ -472,9 +911,6 @@ export default {
text-align: center;
line-height: 80rpx;
margin-bottom: 20rpx;
&:nth-child(2n-1) {
margin-right: 20rpx;
}
}
.active {
border: 1rpx solid #ff780f;
@@ -484,11 +920,11 @@ export default {
}
.btn {
position: absolute;
bottom: 40rpx;
left: 50%;
transform: translate(-50%, 0);
width: 690rpx;
height: 98rpx;
margin: 40rpx 0;
background: rgba(255, 120, 15, 1);
border-radius: 49rpx;
font-size: 36rpx;
@@ -510,6 +946,7 @@ export default {
color: rgba(51, 51, 51, 1);
}
.timelineid {
margin: 18rpx 0;
min-height: 40rpx;
font-size: 24rpx;
font-weight: 400;
@@ -616,5 +1053,35 @@ export default {
}
}
}
.invoice-box {
.title {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 20rpx 20rpx 0 20rpx;
text-align: center;
.close {
margin-left: 180rpx;
}
}
.info {
padding: 30rpx;
& > view {
display: flex;
margin: 10rpx 0;
& > text:first-child {
flex-shrink: 0;
width: 140rpx !important;
text-align: right;
}
& > text:last-child {
width: 320rpx !important;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
}
}
</style>

View File

@@ -2,31 +2,26 @@
<view class="home">
<view class="image-swiper"><u-swiper :list="imageList" mode="dot" border-radius="20"></u-swiper></view>
<view class="tab-swiper">
<u-tabs-swiper
ref="uTabs"
:list="list"
:current="current"
@change="tabsChange"
active-color="#FF780F"
inactive-color="#333333"
font-size="26"
height="98"
:show-bar="false"
swiperWidth="750"
gutter="52"
></u-tabs-swiper>
<u-tabs :list="list" font-size="26" gutter="10" item-width="130" bar-width="120" active-color="#FF780F" :current="current" @change="tabsChange"></u-tabs>
</view>
<view class="order-list" v-if="current == 0">
<view v-for="(item, index) in allorder" :key="index"><OrderItem :info="item"></OrderItem></view>
<u-empty margin-top="20" v-if="!allorder.length" mode="order"></u-empty>
</view>
<view v-else-if="current == 1">
<view v-for="(item, index) in testlist" :key="index"><testList :info="item"></testList></view>
<u-empty margin-top="20" v-if="!testlist.length" mode="order"></u-empty>
</view>
<view v-else-if="current == 2">
<view v-for="(item, index) in worklist" :key="index"><OrderItem :info="item"></OrderItem></view>
<u-empty margin-top="20" v-if="!worklist.length" mode="order"></u-empty>
</view>
<view v-else-if="current == 3">
<view v-for="(item, index) in translist" :key="index"><OrderItem :info="item"></OrderItem></view>
<u-empty margin-top="20" v-if="!translist.length" mode="order"></u-empty>
</view>
<view v-else-if="current == 4">
<view class="complaint">
@@ -34,7 +29,7 @@
<view class="title">选择订单号</view>
<view class="worker" v-if="JSON.stringify(worker) != '{}'">
<view>{{ worker.name }}</view>
<u-icon name="edit-pen" @click="worker = {}"></u-icon>
<u-icon name="arrow-down" @click="worker = {}"></u-icon>
</view>
<view v-else class="select" @click="showSelect = true">
<view>请选择</view>
@@ -50,11 +45,23 @@
</view>
</view>
<view v-else-if="current == 5">
<view v-for="(item, index) in finshlist" :key="index"><OrderItem :cur="current"></OrderItem></view>
<view v-for="(item, index) in finshlist" :key="index">
<OrderItem :info="item"></OrderItem>
</view>
<u-empty margin-top="20" v-if="!finshlist.length" mode="order"></u-empty>
</view>
<view v-else-if="current == 6">
<view v-for="(item, index) in badlist" :key="index"><OrderItem :cur="current"></OrderItem></view>
<view v-for="(item, index) in badlist" :key="index">
<OrderItem :info="item"></OrderItem>
</view>
<u-empty margin-top="20" v-if="!badlist.length" mode="order"></u-empty>
</view>
<view v-else-if="current == 7">
<view v-for="(item, index) in paidList" :key="index">
<OrderItem :info="item"></OrderItem>
</view>
<u-empty margin-top="20" v-if="!paidList.length" mode="order"></u-empty>
</view>
<view class="release-btn" @click="publish">
<image src="../../static/image/index/publish.png"></image>
<view class="text">发布</view>
@@ -123,7 +130,10 @@ export default {
},
{
name: '退货订单'
}
},
{
name: '待支付订单'
}
],
imageList: [],
showSelect: false,
@@ -141,8 +151,10 @@ export default {
finshlist: [], //已完成列表
badlist: [], //退货列表
carlist: [], //可投诉订单列表
paidList: [], // 待支付订单
reportinfo: null, //投诉信息
reportcontent: '' //投诉内容
reportcontent: '', //投诉内容
del_id: 0, // 删除id
};
},
onLoad() {
@@ -150,15 +162,17 @@ export default {
this.getswiper();
// 获取可投诉列表
this.getcarlist();
// 所有订单
this.getallorder(0);
const user = uni.getStorageSync('userinfo');
console.log(user)
this.imService.login(user.member_id,user.member_nickname,user.member_avatar)
this.imService.connectIM()
// 订单状态: 0:全部 1已付款未发货 2已发货 3已完成 4申请退款/退货 5已退款/退货 6拒绝退款/退货
},
onShow() {
this.current=0
// 初始化数据
this.resetarr()
// 所有订单
this.getallorder(0);
this.publishstate = false;
this.tabsChange(this.current);
},
onReachBottom() {
this.num++;
@@ -174,6 +188,7 @@ export default {
this.badlist = [];
this.badlist = [];
this.testlist = [];
this.paidList = [];
},
// 根据current请求不同的接口
reset() {
@@ -197,8 +212,11 @@ export default {
this.getallorder(3);
} else if (current == 6) {
// 退货订单
this.getallorder(5);
}
this.getallorder(4);
} else if (current == 7) {
// 待支付订单
this.getallorder(10);
}
},
// 关闭发布弹窗
close() {
@@ -290,7 +308,7 @@ export default {
getshiftlist() {
let that = this;
this.$u.api.getshiftlist({}).then(res => {
console.log(res);
// console.log(JSON.stringify(res));
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
@@ -328,24 +346,28 @@ export default {
this.badlist.push(arr[index]);
} else if (type == 5) {
this.badlist.push(arr[index]);
}
} else if (type == 10) {
this.paidList.push(arr[index]);
}
}
}
});
},
// 获取轮播图
getswiper() {
this.imageList = [
{
image: '../../static/image/index/swiper.png'
},
{
image: '../../static/image/index/swiper.png'
},
{
image: '../../static/image/index/swiper.png'
}
];
this.$u.post("adv/indexAdv").then(res => {
let item = res.data;
let arr;
arr = item.map(data => {
console.log(data);
return {
image: data.adv_code,
adv_id: data.adv_id,
adv_link: data.adv_link,
}
})
this.imageList = arr;
})
},
// 打开发布弹窗
publish() {
@@ -353,6 +375,13 @@ export default {
},
// 骑手投诉点击确定
setWorker(e) {
if(e[0].label==null){
this.$refs.uToast.show({
title: "选择无效",
type: 'error'
});
return
}
let arr = this.carlist;
for (let index in arr) {
if (arr[index].takeawayer_id == e[0].value) {
@@ -370,9 +399,6 @@ export default {
this.current = index;
this.num = 1;
this.resetarr();
if (index == 6) {
this.getallorder(4);
}
this.reset();
},
// 发布内容跳转页面
@@ -400,15 +426,15 @@ export default {
}
.complaint {
margin: 0 30rpx;
padding: 75rpx 30rpx;
padding: 100rpx 20rpx;
background-color: #ffffff;
.select-container {
display: flex;
align-items: center;
margin-bottom: 60rpx;
margin-bottom: 100rpx;
.title {
width: 180rpx;
font-size: 30rpx;
width: 150rpx;
font-size: 26rpx;
color: rgba(51, 51, 51, 1);
margin-right: 20rpx;
text-align: right;
@@ -446,8 +472,8 @@ export default {
box-sizing: border-box;
display: flex;
.title {
width: 180rpx;
font-size: 30rpx;
width: 150rpx;
font-size: 26rpx;
text-align: right;
color: rgba(51, 51, 51, 1);
margin-right: 20rpx;
@@ -533,7 +559,7 @@ export default {
.list {
display: flex;
align-items: center;
justify-content: space-between;
justify-content: space-around;
width: 100%;
> view {
display: flex;

147
pages/index/mention.vue Normal file
View File

@@ -0,0 +1,147 @@
<template>
<view class="container">
<view class="upload">
<view class="title">
<text>上传凭证</text>
<text class="tips">仅可上传1张凭证</text>
</view>
<u-upload class="upload-box" :form-data="coverformdata" upload-text="" :action="action" :header="header" name="common" :max-count="1" @on-success="uploadSuc"></u-upload>
</view>
<view class="remarks">
<view>备注:</view>
<textarea class="textarea-box" v-model="textareaVal" placeholder="请输入内容..." placeholder-class="placeholder-style" />
</view>
<u-button class="btn-submit" @click="submitInfo">提交</u-button>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
header: {
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
},
action: "https://mall.dmygkeji.com/api/Upload/uploadfile",
coverformdata: {
name: 'common'
},
img_url: "", // 图片路径
textareaVal: "", // 备注
};
},
onLoad(option) {
// console.log(option);
this.order_id = option.id;
},
methods: {
// 上传成功
uploadSuc(e) {
if (e.errCode == 0) {
this.$refs.uToast.show({
title: e.message,
type: "success"
})
// console.log(e.data);
this.img_url = e.data.file_path;
} else {
this.$refs.uToast.show({
title: e.message,
})
}
},
// 自提提交
submitInfo() {
if (!this.img_url) {
this.$refs.uToast.show({
title: "请上传凭证!",
type: "warning"
})
return;
}
if (!this.$u.trim(this.textareaVal)) {
this.$refs.uToast.show({
title: "请填写备注!",
type: "warning"
})
return;
}
// 提交
this.$u.api.bindmention({
store_deliver_type: 3,
shipping_express_id: "e1000",
deliver_explain: this.textareaVal,
order_id: this.order_id,
sendimg: this.img_url,
}).then(res => {
console.log(res);
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: "success",
isTab: "true",
url: "/pages/index/index"
})
} else {
this.$refs.uToast.show({
title: res.message,
type: "warning"
})
}
})
}
}
}
</script>
<style lang="scss">
.container {
padding: 30rpx;
}
::v-deep.uicon-plus {
font-size: 50rpx !important;
}
.upload {
.title {
display: flex;
align-items: center;
font-size: 30rpx;
font-weight: 400;
color: #333;
.tips {
font-size: 20rpx;
color: #999;
}
}
.upload-box {
margin: 20rpx 0;
}
}
.remarks {
.textarea-box {
width: calc(100% - 42rpx);
padding: 20rpx;
margin-top: 20rpx;
font-size: 28rpx;
color: #333;
border-radius: 10rpx;
border: 1px solid #BABABA;
}
.placeholder-style {
color: #999;
font-size: 26rpx;
}
}
.btn-submit {
width: 690rpx;
height: 98rpx !important;
margin-top: 70rpx;
font-size: 36rpx !important;
text-align: center;
line-height: 98rpx !important;
color: #fff !important;
border-radius: 50rpx;
background-color: #FF780F !important;
}
</style>

View File

@@ -13,21 +13,9 @@
</view>
</view>
</view>
<view class="refunds-user" v-if="type == 2 || type == 3 || type == 4">
<view>
<image src="/static/image/home/2.png"></image>
<view>{{ info.goods_try_member_name }}</view>
</view>
<view>
<image src="/static/image/home/3.png"></image>
<view>{{ info.goods_try_member_mobile }}</view>
</view>
<view>
<image src="/static/image/home/4.png"></image>
<view class="address u-line-1">{{ info.goods_try_area_info }}</view>
</view>
</view>
<view class="user-info" v-if="type == 1">
<!-- 待处理订单/已发货订单收货人信息 -->
<view class="user-info">
<view class="info-title">收件人信息</view>
<view class="info-container">
<view>
@@ -42,8 +30,29 @@
<view class="title">收货地址</view>
<view class="value u-line-1">{{ info.goods_try_area_info }}</view>
</view>
<view v-if="type==2">
<view class="title">派送方式</view>
<view class="value u-line-1">{{ info.goods_try_deliver_goods_type==1?"人工送达":"骑手" }}</view>
</view>
</view>
</view>
<!-- 已拒绝/已完成订单收货人信息 -->
<!-- <view class="refunds-user" v-if="type == 3 || type == 4">
<view>
<image src="/static/image/home/2.png"></image>
<view>{{ info.goods_try_member_name }}</view>
</view>
<view>
<image src="/static/image/home/3.png"></image>
<view>{{ info.goods_try_member_mobile }}</view>
</view>
<view>
<image src="/static/image/home/4.png"></image>
<view class="address u-line-1">{{ info.goods_try_area_info }}</view>
</view>
</view> -->
<!-- 待处理订单 -->
<view class="delivery" v-if="type == 1">
<view class="title">派送方式</view>
<view class="methods">
@@ -53,35 +62,44 @@
<view class="btn" @click="confirmpushstyle">确认</view>
</view>
<!-- <view class="refunds-option" v-if="type==4">
<view :class="{active: cur==0}" @click="cur=0;showRefunds=true">不处理</view>
<view :class="{active: cur==1}" @click="cur=1;showRefunds=true">确定处理</view>
</view> -->
<!-- <u-popup v-model="showDelivery" mode="center" border-radius="10" class="delivery-popup">
<view class="title">骑手信息</view>
<view class="input-info">
<input type="text" placeholder="请输入您的姓名" v-model="name" />
<input type="text" placeholder="请输入您的手机号" v-model="phone" />
<input type="text" placeholder="请输入您的公司名称" v-model="company" />
<!-- 已发货 -->
<!-- 人工送达 -->
<view class="refunds-user" v-if="info.goods_try_deliver_goods_type==1&&type==2">
<view>
<view>人工送达请等待货物正在飞速与你接近</view>
</view>
<view class="btn">确认</view>
</u-popup> -->
</view>
<!-- 骑手 -->
<view class="refunds-title" v-if="type==2">配送信息</view>
<view class="refunds-title" v-if="type==3||type==4">提示信息</view>
<view class="refunds-user" v-if="info.goods_try_deliver_goods_type==2&&type==2">
<view>
<image src="/static/image/home/2.png"></image>
<view>{{ info.takeawayer_name }}</view>
</view>
<view>
<image src="/static/image/home/3.png"></image>
<view>{{ info.takeawayer_mobile }}</view>
</view>
<!-- 骑手公司 -->
<!-- <view>
<image src="/static/image/home/4.png"></image>
<view class="address u-line-1">{{ info.goods_try_area_info }}</view>
</view> -->
</view>
<!-- 已经拒绝 -->
<view class="refunds-user" v-if="type==3">
<view>
<view>抱歉商家正忙无法接单期待下次为您服务</view>
</view>
</view>
<!-- 已完成订单 -->
<view class="refunds-user" v-if="type==4">
<view>
<view>订单配送完成期待下次为您服务</view>
</view>
</view>
<u-picker mode="selector" v-model="show" :default-selector="[0]" :range="list" range-key="content" @confirm="getselect"></u-picker>
<!-- <u-popup v-model="showExpress" mode="center" border-radius="10" class="delivery-popup">
<view class="title" @click="bindpushid">填写快递单号</view>
<view class="input-info">
<input type="text" placeholder="请输入快递单号" v-model="express" />
</view>
<view class="btn">确认</view>
</u-popup> -->
<!-- <u-popup v-model="showRefunds" mode="center" border-radius="10" class="refunds-popup">
<view v-if="cur==1" class="popup-tips">确定处理<br />平台将进行退款</view>
<view v-if="cur==0" class="popup-tips">确定不处理<br />平台将进行联系</view>
<view class="popup-btn">
<view class="cancel" @click="showRefunds=false">取消</view>
<view class="determine">确定</view>
</view>
</u-popup> -->
<u-toast ref="uToast" />
</view>
</template>
@@ -135,12 +153,19 @@ export default {
type: 'error'
});
} else {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
uni.navigateBack({
delta: 1
});
}
});
} else {
this.$u.api.agreetest({
goods_try_id: this.orderid,
type: 1,
type: 2,
takeawayer_id: this.selctcar.takeawayer_id
}).then(res => {
console.log(res);
@@ -150,6 +175,13 @@ export default {
type: 'error'
});
} else {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
uni.navigateBack({
delta: 1
});
}
});
}
@@ -234,6 +266,13 @@ export default {
}
}
}
.refunds-title{
padding: 25rpx 30rpx;
font-weight: 500;
color: #333333;
background-color: #ffffff;
border-bottom: 2rpx solid #ececec;
}
.refunds-user {
padding: 25rpx 30rpx;
background-color: #ffffff;
@@ -290,7 +329,7 @@ export default {
border-bottom: 2rpx solid #ececec;
}
.title {
width: 150rpx;
width: 170rpx;
font-size: 30rpx;
margin-right: 10rpx;
}

506
pages/login/agreements.vue Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,8 @@
<template>
<!-- login页面 -->
<view>
<view class="login">
<image class="images" :src="url"></image>
<view class="login" @touchmove.stop.prevent="moveHandle">
<!-- <image class="images" :src="url"></image> -->
<view class="backes"></view>
<view class="title_top">德铭阳光在线-商家端</view>
<view class="content">
@@ -11,33 +11,57 @@
商家登录
</view>
<view v-bind:class="[state==1 ? 'show' : '']" @click="changetab(1)">
达人登录
商家达人
</view>
<view v-bind:class="[state==2 ? 'show' : '']" @click="changetab(2)">
平台达人
</view>
</view>
<view class="" v-if="state==0">
<view class="labales">
<image src="../../static/image/login/login(3).png"></image>
<input v-model="zhanghao" type="text" placeholder="请输入账号" />
<input v-model="zhanghao" type="text" @blur="getBlurVal" placeholder="请输入账号" />
</view>
<view class="labales">
<image src="../../static/image/login/login(1).png"></image>
<input v-model="mima" type="password" placeholder="请输入密码" />
</view>
</view>
<view class="" v-else>
<view class="" v-else-if="state==1">
<view class="labales">
<image src="../../static/image/login/login(3).png"></image>
<input v-model="zhanghaoA" type="text" placeholder="请输入账号" />
<input v-model="zhanghaoA" type="text" @blur="getBlurVal1" placeholder="请输入账号" />
</view>
<view class="labales">
<image src="../../static/image/login/login(1).png"></image>
<input v-model="mimaA" type="password" placeholder="请输入密码" />
</view>
</view>
<view v-else>
<view class="labales">
<image src="../../static/image/login/login(3).png"></image>
<input v-model="phone" type="number" maxlength="11" placeholder="请输入手机号" />
</view>
<view class="labales">
<image src="../../static/image/login/safe.png"></image>
<input v-model="code" type="number" placeholder="请输入验证码" />
<u-button class="get-code" :class=" is_sendcode ? 'stopClick' : '' " :disabled="is_sendcode" @click="getCode">
{{ is_sendcode ? time_count + "后可以重新发送" : "发送验证码" }}
</u-button>
</view>
</view>
</view>
<!-- 服务协议 -->
<view class="pact">
<view class="pact-container">
<u-checkbox v-model="consentPact" shape="circle" size="30" label-size="26" icon-size="12" active-color="#ff780f">
<text>我已详细阅读并同意</text>
</u-checkbox>
<text class="pact-items" v-for="item in pactList" :key="item.id" @click="viewAgreement(item.id)"> {{ item.text }}</text>
</view>
</view>
<!-- denglu QQ weixin -->
<button @click="logins">{{ login }}</button>
<button @click="logins">{{ login }}</button>
<!-- <u-button :custom-style="customStyle" ></u-button> -->
<u-toast ref="uToast" />
</view>
@@ -56,13 +80,25 @@ export default {
value: '',
login: '登录',
show: false,
zhanghao: 'seller',
mima: '123456',
zhanghaoA: '18953829598 ',
mimaA: '123456',
zhanghao: '',
mima: '',
zhanghaoA: '',
mimaA: '',
url: '',
phone: "",
code: "",
state:0,
clickstate:false
clickstate:false,
// 时间
timer: null,
is_sendcode: false, // 60s
time_count: 60,
consentPact: true,
pactList: [{
"text": "《用户协议》"
},{
"text":"《隐私政策》"
}]
};
},
methods: {
@@ -70,61 +106,133 @@ export default {
changetab(num){
this.state = num
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
//console.log(e);
},
// 选中任一checkbox时由checkbox-group触发
checkboxGroupChange(e) {
// console.log(e);
},
mask_u() {
this.show = !this.show;
},
// 获取验证码倒计时
getCode() {
console.log('11');
this.loading();
if (!this.$u.test.mobile(this.phone)) {
this.$refs.uToast.show({
title: '手机号码有误!',
})
return;
}
this.$u.api.getCode({
member_mobile: this.phone,
}).then(res => {
console.log(res);
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: 'success',
})
this.getSendCode();
} else {
this.$refs.uToast.show({
title: res.message,
type: "warning"
})
}
})
},
loading() {},
// 失去焦点获取数据
getBlurVal(e) {
// console.log(e.detail.value);
this.zhanghao = this.$u.trim(e.detail.value,"all");
},
getBlurVal1(e) {
this.zhanghaoA = this.$u.trim(e.detail.value,"all");
// console.log(this.$u.trim(this.zhanghaoA));
},
logins() {
// 检查网络
uni.getNetworkType({
success: (res) => {
console.log(res.networkType);
if (res.networkType == 'none') {
this.$refs.uToast.show({
title: '网络似乎断开了,请检查网络后重试',
type: 'error'
});
}
},
});
// 不同意协议不让登录
if(!this.consentPact) return false;
// 判断是否可以点击
if(this.clickstate==false){
this.clickstate=true
}else{
this.$refs.uToast.show({
title: "不能重复提交",
type: 'error'
});
return
}
// console.log(this.zhanghao);
// if(this.clickstate==false){
// this.clickstate=true
// }else{
// 此验证存在逻辑问题,会出现卡死在这里的情况
// this.$refs.uToast.show({
// title: "不能重复提交",
// type: 'error'
// });
// return
// }
// 清除本地存储才可以正常登陆(具体原因没有仔细检查)
uni.clearStorage();
// uni.clearStorage();
// 账号登录1达人0商家
if(this.state==1){
this.$u.api.login({ member_name: this.zhanghaoA, member_password: this.mimaA }).then(res => {
console.log(JSON.stringify(res))
if (res.errCode != 0) {
// 恢复按钮可点击状态
this.clickstate=false
// this.clickstate=false
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('userinfo', res.data);
uni.setStorageSync('rongyun', res.data.rongcloud_token);
this.$u.route({
url: '/pages/user/myinfo'
url: '/pages/user/myinfo',
type:"redirect"
});
}
});
}else{
}else if (this.state == 2) {
if (!this.$u.test.mobile(this.phone)) {
this.$refs.uToast.show({
title: '手机号码有误!',
})
return;
}
if (this.code.length < 4) {}
this.$u.api.starLogin({
member_mobile: this.phone,
sms_code: this.code,
}).then(res => {
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: 'success',
})
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('userinfo', res.data);
uni.setStorageSync('rongyun', res.data.rongcloud_token);
this.$u.route({
url: '/pages/user/myinfo',
type:"redirect"
});
} else {
this.$refs.uToast.show({
title: res.message,
type: "warning"
})
}
})
} else{
this.$u.api.shoplogin({ member_name: this.zhanghao, member_password: this.mima }).then(res => {
console.log(JSON.stringify(res))
if (res.errCode != 0) {
// 恢复按钮可点击状态
this.clickstate=false
// this.clickstate=false
this.$refs.uToast.show({
title: res.message,
type: 'error'
@@ -133,31 +241,89 @@ export default {
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('userinfo', res.data);
uni.setStorageSync('rongyun', res.data.rongcloud_token);
this.$u.route({
url: '/pages/index/index',
type: 'switchTab'
});
// this.$u.route({
// url: '/pages/index/index',
// type: 'switchTab'
// });
uni.switchTab({
url: '/pages/index/index',
})
}
});
}
},
// 60s
getSendCode() {
const TIME_COUNT = 60;
if (!this.timer) {
this.time_count = TIME_COUNT;
this.is_sendcode = true;
this.timer = setInterval(() => {
if (this.time_count > 0 && this.time_count <= TIME_COUNT) {
this.time_count--;
} else {
this.is_sendcode = false;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
}
},
moveHandle(){
return;
},
viewAgreement(index) {
console.log(index);
if (index == 0) {
this.$u.route({
url: '/pages/login/agreements',
params: {
title: "用户协议"
}
});
}
if (index == 1) {
this.$u.route({
url: '/pages/login/privacy_policy',
params: {
title: "隐私政策"
}
});
}
}
},
onLoad() {
let token = uni.getStorageSync('token');
let user = uni.getStorageSync('userinfo');
console.log( user.role == 2 ? '/pages/index/index' : '/pages/user/myinfo')
if (token != undefined && token) {
this.$u.route({
url: '/pages/index/index'
url: user.role == 2 ? '/pages/index/index' : '/pages/user/myinfo',
type: user.role == 2 ? 'tab' : 'to'
});
}
}
},
};
</script>
<style lang="scss" scoped>
.login:before{
background: url(../../static/bg.png) no-repeat;
background-size: cover;
width: 750rpx;
height: 100vh;
content: "";
position: absolute;
top: 0;
left: 0;
z-index: -1;/*-1 可以当背景*/
transform: scale(1.1);
-webkit-filter: blur(3px);
filter: blur(3px);
}
.login {
// background: url(../../static/pageA/loginbackground.png) no-repeat!important;
.images {
position: fixed;
width: 100%;
@@ -205,7 +371,7 @@ export default {
.title {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 150rpx;
margin-bottom: 120rpx;
color: #fff;
display: flex;
justify-content: flex-start;
@@ -230,27 +396,44 @@ export default {
.labales text {
font-size: 30rpx;
}
.get-code {
width: auto !important;
height: 60rpx !important;
padding: 0 30rpx !important;
font-size: 24rpx !important;
line-height: 60rpx !important;
color: #fff !important;
border: none !important;
border-radius: 10rpx !important;
&::after {
border: none !important;
}
}
.labales {
display: flex;
align-items: center;
height: 90rpx;
line-height: 90rpx;
border-bottom: 1px #fff solid;
margin-bottom: 180rpx;
height: 70rpx;
line-height: 70rpx;
position: relative;
&:first-child {
margin-bottom: 100rpx;
}
&:nth-child(2) {
margin-bottom: 80rpx;
}
input {
width: 80%;
margin-left: 60rpx;
margin-left: 30rpx;
color: #fff;
letter-spacing: 2rpx;
background-color: none;
}
}
.labales image {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 39rpx;
flex-shrink: 0;
width: 38rpx;
height: 40rpx;
}
.labales:nth-child(3) {
@@ -276,27 +459,27 @@ export default {
letter-spacing: 2rpx;
}
.pact text {
font-size: 22rpx;
font-weight: 400;
color: rgba(255, 255, 255, 1);
line-height: 36px;
}
.pact_text {
font-size: 22px;
font-weight: 400;
color: rgba(129, 188, 253, 1) !important;
line-height: 36px;
}
//单选框的样式
.pact {
position: relative;
padding-left: 40rpx;
width: 670rpx;
margin: 0 auto 40rpx;
font-size: 26rpx;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
.pact-container {
display: flex;
justify-content: flex-end;
align-items: center;
flex-wrap: wrap;
/deep/ .u-checkbox {
.u-checkbox__label {
margin-right: 0;
}
}
.pact-items {
color: rgba(255, 120, 15, 1);
}
}
}
.u-checkbox-group {

File diff suppressed because one or more lines are too long

70
pages/messages/info.vue Normal file
View File

@@ -0,0 +1,70 @@
<template>
<view>
<image :src="list.picture" class="picture" mode="widthFix"></image>
<view class="box">
<view class="info">
<text class="title u-line-2">{{ list.title }}</text>
<u-divider class="time">{{ list.addtime }}</u-divider>
<!-- <text class="time"></text> -->
</view>
<view class="content">{{ list.summary }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: 0,
list: [],
};
},
onLoad(option) {
// console.log(option);
this.id = option.id;
// 获取数据
this.informationList();
},
methods: {
informationList(){
console.log(this.id)
this.$u.api.messageInfo({id:this.id}).then((res)=>{
this.list = res.data
console.log(res);
})
}
}
}
</script>
<style lang="scss">
page {
}
.picture {
width: 750rpx;
}
.box {
width: 100%;
padding: 20rpx;
.info {
.title {
font-size: 38rpx;
color: rgba(0,0,0,.84);
line-height: 1.2;
}
.time {
padding: 40rpx 0;
}
}
.content {
padding: 0 6rpx;
font-size: 34rpx;
color: rgba(0,0,0,.6);
line-height: 1.4;
letter-spacing: 1rpx;
text-indent: 2rem;
}
}
</style>

92
pages/messages/list.vue Normal file
View File

@@ -0,0 +1,92 @@
<template>
<view class="box">
<view class="item" v-for="(item,index) in list" :key="index" @click="navto(item.id)">
<view class="time">{{item.addtime}}</view>
<view class="info">
<image class="img" :src="item.picture"></image>
<view class="title u-line-2">{{item.title}}</view>
<view class="next">
<text>查看详情</text>
<image class="right" src="@/static/image/user/1.png"></image>
</view>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.box{
min-height: 100vh;
background-color: #EAEAEA;
.item{
display: flex;
flex-direction: column;
align-items: center;
.time{
font-size: 28rpx;
color: #666;
padding: 30rpx 0;
}
.info{
width: 690rpx;
// height: 489rpx;
border-radius: 20rpx;
overflow: hidden;
background-color: #fff;
.img{
width: 100%;
height: 280rpx;
}
.title{
height: 80rpx;
margin: 30rpx 25rpx;
font-size: 26rpx;
line-height: 40rpx;
}
.next{
display: flex;
height: 84rpx;
align-items: center;
justify-content: space-between;
padding: 0 25rpx;
border-top: 1rpx solid #ebebeb;
>text{
font-size: 26rpx;
color:#666;
}
>image{
width: 9rpx;
height: 17rpx;
}
}
}
}
}
</style>
<script>
export default {
data(){
return {
list:[]
}
},
onLoad(){
this.$u.api.messageList({page:1}).then((res)=>{
console.log(res)
this.list = res.data
})
},
methods:{
navto(id){
console.log(id)
this.$u.route({
url:"/pages/messages/info",
params:{
id
}
})
}
}
}
</script>

View File

@@ -1,19 +1,30 @@
<template>
<!-- login页面 -->
<view>
<view class="border_serach">
<view :style="{'height':swiperHeight + 'px'}">
<!-- <view class="border_serach">
<view class="u-search">
<u-search :show-action="false" input-align="left" shape="round" placeholder="搜索" v-model="keyword"></u-search>
</view>
</view>
</view> -->
<!-- 消息列表 -->
<view class="massage_list" v-for="(item,index) in list" :key="index">
<view class="massage_list" @click="navto()">
<view class="images">
<image :src="item.url" ></image>
<image src="@/static/image/7.png" ></image>
</view>
<view class="names">活动消息</view>
<view class="content u-line-1">{{huodong.data.title}}</view>
<view class="times">{{huodong.data.addtime}}</view>
<view class="tishi" v-if="huodong.count != 0"></view>
</view>
<!-- <u-empty text="并没有什么消息" mode="message" v-if="Object.keys(list).length == 0" style="margin: auto"></u-empty> -->
<view class="massage_list" v-for="(item,index) in list" :key="index" @click="gochat(item)">
<view class="images">
<image :src="item.avatar" ></image>
</view>
<view class="names">{{item.name}}</view>
<view class="content">{{item.content}}</view>
<view class="content u-line-1">{{item.text}}</view>
<view class="times">{{item.time}}</view>
<view class="tishi" v-if="item.unReadMessage"></view>
</view>
<u-toast ref="uToast" />
</view>
@@ -23,37 +34,68 @@
data() {
return {
keyword: '搜索',
list: [{
name: '瘦瘦',
content: "木糖少女小紫薯西装领连衣裙夏季新款女装装领连衣裙夏季装领连衣裙夏季装领连衣裙夏季夏收腰格子格纹裙子",
url: '../../static/image/tosign/tosigin(5).png',
id : '1',
time : '1015'
},
{
name: '瘦瘦',
content: "木糖少女小紫薯西装领连衣裙夏季新款女装装领连衣裙夏季装领连衣裙夏季装领连衣裙夏季夏收腰格子格纹裙子",
url: '../../static/image/tosign/tosigin(5).png',
id : '1',
time : '1015'
},
{
name: '瘦瘦',
content: "木糖少女小紫薯西装领连衣裙夏季新款女装装领连衣裙夏季装领连衣裙夏季装领连衣裙夏季夏收腰格子格纹裙子",
url: '../../static/image/tosign/tosigin(5).png',
id : '1',
time : '1015'
},
list: [
],
huodong:{
data:{
}
}
};
},
methods: {
gochat(id){
console.log(id)
this.$u.route({
url:"/pages/messages/privateChat",
params:{
id:JSON.stringify(id)
}
})
},
onFriendListChange(onlineFriends) {
//todo:比较垃圾的处理方式因为Uniapp的基于MAP的双向绑定在H5端不稳定H5端偶尔会抽风
// 下边这一行删掉,有时候页面可以更新,有时候不行,大家有优雅的方式,也欢迎跟我们沟通
console.log(onlineFriends,121212)
this.information_dl = onlineFriends;
this.$forceUpdate();
},
navto(){
console.log(1212)
this.$u.route({
url:"/pages/messages/list"
})
}
},
onShow(){
// this.list = this.imService.friends;
this.imService.onFriendListChange=this.onFriendListChange;
},
onLoad(){
const res = uni.getSystemInfoSync();
this.swiperHeight = res.windowHeight;
this.list = this.imService.friends;
this.$u.api.isread().then((res)=>{
console.log(res)
this.huodong = res.data
})
}
};
</script>
<style lang="scss" scoped>
.tishi{
position: absolute;
bottom: 30rpx;
right: 30rpx;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: #FF0000;
}
.u-search{
width: 690rpx;
margin: 0 auto;
@@ -67,6 +109,7 @@
position: relative;
border-bottom: 1px #ECECEC solid;
overflow: hidden;
position: relative;
zoom: 1;
.images{
width: 84rpx;
@@ -94,10 +137,7 @@
font-size: 26rpx;
color: #666666;
height: 30rpx;
height: 30rpx;
overflow:hidden; //超出的文本隐藏
text-overflow:ellipsis; //用省略号显示
white-space:nowrap; //不换行
line-height: 30rpx;
}
.times{
position: absolute;

View File

@@ -0,0 +1,617 @@
<template>
<div class="chatInterface">
<div class="chat-scroll-container">
<scroll-view ref="myScroll" scroll-y="true" class="scroll-view" :scroll-into-view="contentPosition">
<div :class="[allHistoryLoaded ? 'top gray' : 'top']" @click="loadMoreHistoryMessage">
<span class="description">{{allHistoryLoaded ? '已经没有更多的历史消息' : '点击加载更多历史消息'}}</span>
</div>
<!--已经收到的消息-->
<div v-for="(message, key) in messages || []"
:id="'message_' + message.timestamp"
:key="message.timestamp"
class = "message-item"
:class="{'self' : message.senderId == (currentUser && currentUser.uuid)}">
<div :class="friend.online ? 'avatar' : 'avatar offline-gray'"
v-if="message.senderId != (currentUser && currentUser.uuid)">
<image :src="friend.avatar" ></image>
</div>
<div class="avatar" v-else>
<image :src="currentUser.avatar"></image>
</div>
<div class="content">
<span class="text-content" v-if="message.type =='text'">{{message.payload.text}}</span>
<image class="image-content" v-if="message.type == 'image'" :src="message.payload.url" :data-url="message.payload.url" @click="showImageFullScreen" mode="widthFix" @load="scrollToBottom"></image>
<div class="video-snapshot" v-if="message.type == 'video'" :data-url="message.payload.video.url" @click="playVideo">
<image :src="message.payload.thumbnail.url" mode="aspectFit" @load="scrollToBottom"></image>
<div class="video-play-icon"></div>
</div>
<GoEasyAudioPlayer v-if="message.type =='audio'" :src="message.payload.url" :duration="message.payload.duration" />
</div>
</div>
<!--发送中的消息-->
<div v-for="(message, index) in pendingMessages || []"
:key="index"
:id="'pendingMessage_' + index"
class = "message-item"
:class="{'self' : message.senderId == (currentUser && currentUser.uuid)}">
<div :class="friend.online ? 'avatar' : 'avatar offline-gray'"
v-if="message.senderId != (currentUser && currentUser.uuid)">
<image :src="friend.avatar"></image>
</div>
<div class="avatar" v-else>
<image :src="currentUser.avatar"></image>
</div>
<div class="content">
<b class="pending"></b>
<span class="text-content" v-if="message.type =='text'">{{message.payload.text}}</span>
<image class="image-content" v-if="message.type == 'image'" :src="message.payload.url" mode="widthFix" @load="scrollToBottom"></image>
<div v-if="message.type == 'video'" class="video-snapshot">
<image :src="message.payload.thumbnail.url" mode="aspectFit" @load="scrollToBottom"></image>
<div class="video-play-icon"></div>
</div>
<GoEasyAudioPlayer v-if="message.type =='audio'" :src="message.payload.url" :duration="message.payload.duration" />
</div>
</div>
</scroll-view>
</div>
<div class="action-box" v-if="!video.visible">
<div class="action-top">
<div :class="[audio.visible ? 'record-icon record-open':'record-icon']" @click="switchAudioKeyboard"></div>
<div class="record-input" @longpress="onRecordStart" @touchend="onRecordEnd" v-if="audio.visible" >{{audio.recording ? '松开发送' : '按住录音'}}</div>
<div class="message-input" v-else>
<input type="text" placeholder="发送消息" v-model="content">
</div>
<div class="file-icon img-video" @click="sendImage"></div>
<div class="file-icon" @click="sendVideo"></div>
<span class="send-message-btn" @click="sendMessage">发送</span>
</div>
</div>
<div class="record-loading" v-if="audio.recording"></div>
<video style="width:100%;height: 100%" :src="video.url" v-if="video.visible" id="videoPlayer" autoplay="true" @fullscreenchange="onVideoFullScreenChange" @play="onVideoPlayStart"></video>
</div>
</template>
<script>
import GoEasyAudioPlayer from "../../components/GoEasyAudioPlayer/GoEasyAudioPlayer";
const recorderManager = uni.getRecorderManager();
export default {
name: "privateChat",
components : {
GoEasyAudioPlayer,
},
data() {
return {
//聊天文本框
content: '',
friend: null,
currentUser: null,
//已经接收到的消息
messages: [],
//正在发送中的消息
pendingMessages : [],
//已经加载完所有历史消息
allHistoryLoaded: false,
contentPosition : '',
audio : {
//语音录音中
recording : false,
//录音按钮展示
visible : false
},
video : {
visible : false,
url : '',
context : null
}
}
},
watch : {
//每当新增了发送中的消息,都滑动到底部
pendingMessages(){
this.scrollToBottom()
}
},
onReady () {
this.video.context = uni.createVideoContext('videoPlayer');
},
onLoad(options) {
if(!this.imService.currentUser){
uni.navigateTo({
url : '../login/login'
});
}
//对话数据
this.friend = JSON.parse(options.id);
this.currentUser = this.imService.currentUser;
let privateMessages = this.imService.getPrivateMessages(this.friend.uuid);
this.imService.uid = this.friend.uuid;
this.messages = privateMessages.sentMessages;
this.pendingMessages = privateMessages.pendingMessages;
uni.setNavigationBarTitle({
title : this.friend.name
});
setTimeout(() => {
uni.setNavigationBarColor({
backgroundColor : '#FF780F',
frontColor : '#333333'
});
}, 10);
this.initialListeners();
//每次进入聊天页面,总是滚动到底部
this.scrollToBottom()
},
onUnload() {
//退出聊天页面之前,清空页面传入的监听器
this.imService.onNewPrivateMessageReceive = (friendId, message)=> {};
this.imService.onPrivateHistoryLoad = (friendId, messages) =>{};
//将未读消息数清零
this.imService.resetFriendUnReadMessage(this.friend);
this.imService.uid = 0;
},
methods: {
initialListeners () {
//传入监听器,收到一条私聊消息总是滚到到页面底部
this.imService.onNewPrivateMessageReceive = (friendId, message)=> {
if (friendId == this.friend.uuid) {
//收到新消息,是滚动到最底部
this.scrollToBottom()
}
};
//传入监听器,完成一次私聊历史加载时,如果加载结果为空,显示没有更多消息
this.imService.onPrivateHistoryLoad = (friendId, messages) =>{
if (messages.length == 0) {
//灰色,就不能点击了
this.allHistoryLoaded = true
}
};
// 录音监听器
this.initRecorderListeners();
},
initRecorderListeners(){
var self = this;
// 监听录音开始
recorderManager.onStart(function(){
self.audio.recording = true;
});
//录音结束后,发送
recorderManager.onStop(function(res){
self.audio.recording = false;
self.imService.sendPrivateAudioMessage(self.friend.uuid, res)
});
// 监听录音报错
recorderManager.onError(function(res){
console.log("录音报错:",res);
})
},
sendMessage() {//发送消息
if (this.content.trim() != '') {
this.imService.sendPrivateTextMessage(this.friend.uuid, this.content);
let that = this
setTimeout(function(){
that.scrollToBottom();
},500)
}
this.content = "";
},
loadMoreHistoryMessage() {//历史消息
let lastMessageTimeStamp = Date.now();
let lastMessage = this.messages[0];
if (lastMessage) {
lastMessageTimeStamp = lastMessage.timestamp;
}
this.imService.loadPrivateHistoryMessage(this.friend.uuid, lastMessageTimeStamp);
},
onRecordStart () {
try{
recorderManager.start();
}catch(e){
console.log("e:",e);
uni.showModal({
title: '录音错误',
content : '请在app和小程序端体验录音Uni官方明确H5不支持getRecorderManager, 详情查看Uni官方文档'
});
}
},
onRecordEnd () {
try{
recorderManager.stop();
}catch(e){
console.log("e:",e);
uni.showModal({
title: '录音错误',
content : '请在app和小程序端体验录音Uni官方明确H5不支持getRecorderManager, 详情查看Uni官方文档'
});
}
},
sendVideo () {//发送文件
uni.chooseVideo({
success : (res) => {
console.log(res)
this.imService.sendPrivateVideoMessage(this.friend.uuid, res)
}
})
},
sendImage() {
uni.chooseImage({
count :1,
success :(res) => {
console.log(res)
this.imService.sendPrivateImageMessage(this.friend.uuid,res);
}
})
},
showImageFullScreen (e) {
var imagesUrl = [e.currentTarget.dataset.url];
uni.previewImage({
urls: imagesUrl
});
},
//语音录制按钮和键盘输入的切换
switchAudioKeyboard() {
this.audio.visible = !this.audio.visible;
},
playVideo (e) {
this.video.visible = true;
this.video.url =e.currentTarget.dataset.url;
},
onVideoPlayStart () {
this.video.context.requestFullScreen({
direction : 0
});
},
onVideoFullScreenChange (e) {
//当退出全屏播放时,隐藏播放器
if(this.video.visible && !e.detail.fullScreen){
this.video.visible = false;
this.video.context.stop();
}
},
scrollToBottom () {
this.$nextTick(() => {
if(this.messages && this.messages.length !=0){
this.contentPosition = 'message_' + (this.messages[this.messages.length-1].timestamp || '');
}
})
}
}
}
</script>
<style >
page {
height: 100%;;
}
uni-page-body, uni-page-refresh {
height: 100%;;
}
.chatInterface{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow-x: hidden;
}
.chatInterface .chat-scroll-container{
overflow: hidden;
padding-left: 20rpx;
padding-right: 20rpx;
height: 100%;
display: flex;
flex: 1;
}
.chatInterface .scroll-view{
flex: 1;
overflow: auto;
box-sizing: border-box;
}
.chatInterface .top{
font-size: 20rpx;
height: 90rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
-webkit-tap-highlight-color: transparent;
color: blue;
}
.chatInterface .top .description{
/* text-decoration: underline; */
}
.chatInterface .message-item{
/* max-height: 400rpx; */
margin-top: 40rpx;
overflow: hidden;
}
.chatInterface .avatar{
width: 80rpx;
height: 80rpx;
margin-right:20rpx ;
}
.chatInterface .message-item.self .avatar{
margin-left: 20rpx;
}
.chatInterface .message-item .avatar image{
width: 100%;
height: 100%;
}
.chatInterface .content{
font-size: 34rpx;
line-height: 44rpx;
/* max-height: 400rpx; */
display: flex;
align-items: center;
justify-content: right;
}
.chatInterface .content .image-content{
padding: 16rpx;
border-radius: 12rpx;
width: 300rpx;
height: 300rpx;
}
.chatInterface .content .text-content{
padding: 16rpx;
border-radius: 12rpx;
max-width: 520rpx;
}
.chatInterface .content .pending{
background: url("../../static/images/pending.gif") no-repeat center;
background-size: 30rpx;
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
flex-grow: 0;
flex-shrink: 0;
}
.chatInterface .action-box{
display: flex;
height: 80rpx;
padding-top: 20rpx;
padding-bottom: 20rpx;
backdrop-filter: blur(0.27rpx);
width: 100%;
}
.chatInterface .action-top{
display: flex;
padding-top: 20rpx;
padding-bottom: 20rpx;
backdrop-filter: blur(0.27rem);
height: 80rpx;
width: 100%;
}
.chatInterface .record-icon{
font-size: 32rpx;
width: 80rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
background: url("../../static/images/record-appearance-icon.png") no-repeat center;
background-size: 50%;
-webkit-tap-highlight-color:rgba(0,0,0,0);
}
.chatInterface .action-top .file-icon{
background: url("../../static/images/vedio.png") no-repeat center;
background-size: 70%;
color: #9D9D9D;
position: relative;
width:80rpx;
height: 80rpx;
line-height: 80rpx;
-webkit-tap-highlight-color:rgba(0,0,0,0);
}
.chatInterface .record-icon.record-open{
background: url("../../static/images/jianpan.png") no-repeat center;
background-size: 70%;
-webkit-tap-highlight-color:rgba(0,0,0,0);
}
.chatInterface .action-top .img-video{
background: url("../../static/images/file.png") no-repeat center;
background-size: 74%;
}
.chatInterface .record-input{
width: 480rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 12rpx;
font-size: 28rpx;
background: #cccccc;
color: #ffffff;
text-align: center;
}
.chatInterface .message-input{
border-radius: 12rpx;
}
.chatInterface .message-input input{
width: 440rpx;
height: 80rpx;
line-height: 80rpx;
padding-left: 20rpx;
font-size: 28rpx;
}
.chatInterface .send-message-btn{
font-size: 32rpx;
width: 80rpx;
line-height: 80rpx;
}
.record-loading{
position: absolute;
top:50%;
left: 50%;
width: 300rpx;
height: 300rpx;
margin: -150rpx -150rpx;
background: #262628;
background: url("../../static/images/recording-loading.gif") no-repeat center;
background-size: 100%;
border-radius: 40rpx;
}
.chatInterface .img-layer{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #000000;
z-index: 9999;
padding: 6rpx;
display: flex;
justify-content: center;
align-items: center;
}
.chatInterface .img-layer uni-image {
height: 100%!important;
}
.chatInterface .img-layer {
height: 100%!important;
width: 100%!important;
}
.chatInterface .content .file-content .file-info{
height: 0.5rem;
width: 1.5rem;
display: flex;
flex-direction: column;
padding: 0 0.1rem;
}
.chatInterface .content .file-content .file-info .title{
height: 0.3rem;
line-height: 0.3rem;
overflow: hidden;
font-size: 0.16rem;
padding: 0;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
color: #262628;
text-align: left;
}
.chatInterface .content .file-content .file-info .size{
font-size: 0.14rem;
height: 0.2rem;
line-height: 0.2rem;
padding: 0;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
color: #999999;
text-align: left;
}
.chatInterface .video-snapshot{
position: relative;
height: 300rpx;
max-width: 400rpx;
background: #000000;
}
.chatInterface .video-snapshot image{
max-height: 300rpx;
max-width: 400rpx;
}
.chatInterface .video-snapshot video{
max-height: 300rpx;
max-width: 400rpx;
}
.video-snapshot .video-play-icon{
position: absolute;
width: 40rpx;
height: 40rpx;
border-radius: 20rpx;
background:url("../../static/images/play.png") no-repeat center;
background-size: 100%;
top:50%;
left: 50%;
margin:-20rpx;
}
.chatInterface .avatar{
overflow: hidden;
float: left;
}
.chatInterface .avatar img{
width: 100%;
height: 100%;
display: block;
}
.chatInterface .content{
float: left;
overflow: hidden;
}
.chatInterface .content span{
font-family: Source Han Sans CN;
letter-spacing: -0.41px;
color: #262628;
background: #efefef;
display: inline-block;
word-break: break-all;
}
.chatInterface .message-item.self{
margin-right: 0;
}
.chatInterface .message-item.self .avatar{
margin-right: 0;
float: right;
}
.chatInterface .message-item.self .content{
text-align: right;
float: right;
}
.chatInterface .message-item.self .content span{
color: #ffffff;
background:#FF780F;
word-break: break-all;
text-align: left;
max-width: 520rpx;
}
.chatInterface .action-box{
background: #FAFAFA;
display: flex;
align-content: center;
align-items: center;
}
.chatInterface .message-input{
background: #efefef;
border: 0;
outline: none;
}
.chatInterface .send-message-btn{
flex-grow: 1;
text-align: center;
color: #95949A;
}
.chatInterface .member-layer{
width:100%;
height: 100%;
background: #FFFFFF;
top: 0;
left: 0;
position: absolute;
}
.member-layer .member{
display: flex;
flex-wrap: wrap;
}
.chatInterface .group-icon{
position: absolute;
}
.chatInterface .gray{
color: gray!important;
text-decoration: none!important;
}
</style>

View File

@@ -3,7 +3,7 @@
<u-form :model="form" ref="uForm">
<u-form-item label="标题" label-position="right"><u-input v-model="form.name" placeholder="请输入标题" /></u-form-item>
<!-- form-data -->
<view class="titles">封面</view>
<view class="titles">封面<text>建议图片尺寸为334*334</text></view>
<u-upload
:form-data="coverformdata"
:max-count="1"
@@ -16,7 +16,7 @@
:file-list="fileListA"
@on-success="uploadcover"
></u-upload>
<view class="titles">图片</view>
<view class="titles">图片<text>最多选择5张图片建议图片尺寸为750*700</text></view>
<u-upload
:form-data="imgformdata"
name="article_image"
@@ -31,10 +31,14 @@
></u-upload>
<!-- 标签 -->
<view>
<view class="titles">标签</view>
<view class="form-view" @click="show_add()">+ 新建标签</view>
<view :class="[item.state == true ? 'active' : '', 'form-view']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
<view class="titles flex-title">
<text>标签</text>
<text @click="editing">{{ is_edit ? "取消编辑" : "编辑" }}</text>
</view>
<view class="form-view active" @click="show_add()">+ 新建标签</view>
<view :class="['form-view', item.state == true ? 'active' : '']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
{{ item.name }}
<u-icon v-show="is_edit && item.user_id != 0" class="close" name="close" color="#666" size="18" @click="isTable(item.id,index)"></u-icon>
</view>
</view>
<!-- 简介 -->
@@ -49,7 +53,14 @@
<view class="listes_shoping" v-for="(item, index) in list" :key="index">
<view>
<u-checkbox-group>
<u-checkbox @change="checkboxChange" shape="circle" active-color="#FF780F" v-model="item.checked" :name="item.goods_id"></u-checkbox>
<u-checkbox
shape="circle"
size="40"
active-color="#FF780F"
v-model="item.checked"
:name="index"
@change="checkboxChange"
></u-checkbox>
</u-checkbox-group>
</view>
<view><image :src="item.goods_image" mode="widthFix"></image></view>
@@ -61,7 +72,7 @@
<view class="u-button" @click="changes()">确定</view>
</u-popup>
<!-- 底部选择商品列表 -->
<view @click="show_two = true">
<view @click="show_two = true" v-if="userinfo.role != 4">
选择商品
<image class="images" src="../../static/image/tosign/bhottom.png"></image>
</view>
@@ -73,13 +84,13 @@
</view>
</view>
<!-- 提交 -->
<u-button class="custom-style" shape="circle" size="default" @click="publish">发表</u-button>
<u-button :hair-line="false" class="custom-style" shape="circle" size="default" @click="publish">发表</u-button>
</u-form>
<!-- 添加标签的按钮 -->
<u-popup v-model="show" mode="center" border-radius="14">
<view class="text">创建属于你的标签吧</view>
<view class="u-inputes"><u-input v-model="tagcontent" /></view>
<u-button class="custom-style-button" shape="circle" size="default" @click="addLiveSpec">确定</u-button>
<u-button :hair-line="false" class="custom-style-button" shape="circle" size="default" @click="addLiveSpec">确定</u-button>
</u-popup>
<u-toast ref="uToast" />
</view>
@@ -95,7 +106,7 @@ export default {
sex: ''
},
// 演示地址,请勿直接使用
action: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
action: 'https://mall.dmygkeji.com/storeapi/Upload/uploadFile',
coverformdata: {
name: 'article_cover'
},
@@ -118,17 +129,26 @@ export default {
checked: false,
list: [],
List_tosign: [],
flagA: true,
flagB: false,
scrollTop: 0,
imgarr: [], //上传图片数组
cover: '', //图文封面
selectarr: [], //选中标签
tagcontent: ''
tagcontent: '',
is_edit: false, // 编辑
userinfo:{},
device: null, // 手机信息
};
},
onLoad() {
// 缓存取选择好的数据
// 缓存取选择好的数据\
this.userinfo = uni.getStorageSync("userinfo")
this.tosign();
this.getLiveSpec();
this.device = uni.getSystemInfoSync(); // 获取信息
},
methods: {
publish() {
@@ -137,34 +157,37 @@ export default {
for (let index in arr) {
newarr.push(arr[index].file_id);
}
this.$u.api.publishphoto({
article_title: this.form.name,
article_content: this.form.intro,
article_pic: this.imgarrA[0].file_name,
file_id: newarr,
goods_id_arr: this.arres_list,
label_arr: this.selectarr
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
setTimeout(function(){
uni.navigateBack({
delta:1
})
},1000)
}
});
console.log(this.imgarrA,newarr);
this.$u.api
.publishphoto({
article_title: this.form.name,
article_content: this.form.intro,
article_pic: this.imgarrA[0].file_name,
file_id: newarr,
goods_id_arr: this.arres_list,
label_arr: this.selectarr
})
.then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
setTimeout(function() {
uni.navigateBack({
delta: 1
});
}, 1000);
}
});
},
// 获取商品数组变化
getshoplist() {
getshoplist(id) {
let arr = this.arres_list;
let newarr = this.list;
this.shoplist = [];
@@ -175,6 +198,7 @@ export default {
}
}
}
console.log(this.shoplist)
},
// 改变选中状态
changeselect(num) {
@@ -207,35 +231,90 @@ export default {
},
// 创建标签
addLiveSpec() {
this.$u.api.createLivesp({
spec_name: this.tagcontent
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
this.tagcontent = '';
this.show = false;
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
}
});
this.$u.api
.createLivesp({
spec_name: this.tagcontent
})
.then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
this.tagcontent = '';
this.show = false;
res.data.state = false;
this.fileListes.push(res.data);
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
}
});
},
// 删除标签
isTable(id,index) {
uni.showModal({
title: "提示",
content: "是否删除此标签?",
success: (res) => {
console.log();
if (res.confirm) {
this.delTable(id,index);
}
}
})
},
delTable(id,index) {
let me = this;
this.$u.post("Streaming/deltLabel", {label_id: id}).then(res => {
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
this.fileListes.splice(index,1);
}
})
},
// 上传封面
uploadcover(data) {
let obj = data.data;
obj.url = obj.file_path;
this.imgarrA.push(obj);
// console.log(data.data);
// #ifdef APP-PLUS
plus.io.getImageInfo({
src: data.data.file_path,
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
})
// #endif
if (data.errCode != 0) {
this.$refs.uToast.show({
title: '上传失败',
type: 'error'
});
} else {
let obj = data.data;
obj.url = obj.file_path;
this.imgarrA.push(obj);
}
},
// 上传图片
uploadphoto(data) {
let obj = data.data;
obj.url = obj.file_path;
this.imgarrB.push(obj);
if (data.errCode != 0) {
this.$refs.uToast.show({
title: '上传失败',
type: 'error'
});
} else {
let obj = data.data;
obj.url = obj.file_path;
this.imgarrB.push(obj);
}
},
changes() {
let that = this;
@@ -244,13 +323,20 @@ export default {
show_add() {
this.show = !this.show;
},
// 编辑标签
editing() {
this.is_edit = !this.is_edit;
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
let id = e.name;
let that = this;
let num =Number(e.name)
if (e.value == true) {
this.pushes(id);
that.pushes(that.list[num].goods_id);
that.list[num].checked=true
} else {
this.delarr(id);
that.delarr(that.list[num].goods_id);
that.list[num].checked=false
}
},
// 删除直播商品
@@ -305,19 +391,27 @@ export default {
#release {
width: 690rpx;
margin: 0 auto;
padding-bottom:20rpx;
.flex-title {
display: flex;
justify-content: space-between;
}
.form-view {
background: rgba(255, 120, 15, 1);
border-radius: 6rpx;
margin-right: 20rpx;
font-size: 24rpx;
padding: 8rpx 20rpx;
display: inline-block;
padding: 8rpx 20rpx;
margin-right: 20rpx;
margin-bottom: 28rpx;
font-size: 24rpx;
color: #fff;
border-radius: 6rpx;
background-color: #cdc7c8;
.close {
margin-left: 10rpx;
vertical-align: middle;
}
}
.active {
background: red;
background-color: #ff780f;
}
.scroll {
width: 100%;
@@ -328,6 +422,10 @@ export default {
font-weight: 400;
color: rgba(51, 51, 51, 1);
margin: 30rpx 0;
>text{
font-size: 20rpx;
color: #999;
}
}
textarea {
@@ -427,6 +525,28 @@ export default {
color: #333;
}
}
.u-btn {
width: 628rpx;
height: 98rpx;
background: rgba(255, 120, 15, 1) !important;
border-radius: 49rpx;
margin: 0 auto;
font-size: 36rpx;
color: rgba(255, 255, 255, 1) !important;
line-height: 36px;
border: 1px #ff780f solid;
outline: none;
border-color: rgba(255, 120, 15, 1) !important;
}
.custom-style-button {
background: rgba(255, 120, 15, 1) !important;
color: #fff !important;
font-size: 28rpx;
width: 200rpx;
margin-bottom: 23rpx;
line-height: 60rpx;
height: 60rpx;
}
.titles_border,
.uni-textarea-compute {

View File

@@ -3,10 +3,10 @@
<view class="title">我的商品</view>
<u-checkbox-group>
<view class="list">
<shopItem @xuanzhong="xuanzhong" class="items" v-for="(i,j) in list" :key="j" :image="i.goods_image" :title="i.goods_name" :price="i.goods_marketprice" :num="i.goods_salenum" :sid="i.goods_id" ref="shop"></shopItem>
<shopItem @xuanzhong="xuanzhong" :wxuanzhong="sele.indexOf(i.goods_id + '') > -1" class="items" v-for="(i,j) in list" :key="j" :image="i.goods_image" :title="i.goods_name" :price="i.goods_marketprice" :num="i.goods_salenum" :sid="i.goods_id" ref="shop"></shopItem>
</view>
</u-checkbox-group>
<view class="jiaru" @click="jiaru">加入售货袋</view>
<view class="jiaru" @click="jiaru" :style="{'background-color': sele.length > 0 ? 'rgba(255, 120, 15, 1' : ''}">加入售货袋</view>
</view>
</template>
<script>
@@ -45,6 +45,11 @@ export default {
}
},
onLoad(){
this.sele = uni.getStorageSync("gouwudai").split(',')
if(this.sele[0] == ""){
this.sele = []
}
console.log(this.sele[0])
this.$u.api.getStoreGoodsList().then((res)=>{
this.list = res.data.list
})

View File

@@ -1,38 +1,39 @@
<template>
<!-- tosign页面 -->
<view>
<view class="tosign">
<view class="tosign" style="">
<image class="images" src="../../static/image/login/login(2).png"></image>
<view class="backes"></view>
<!-- z自定义导航卡 -->
<u-navbar title="" class="content" :background="background" :is-back="false" :border-bottom="false">
<!-- <image src="../../static/image/tosign/tosigin(4).png"></image> -->
<image src="../../static/image/tosign/tosigin(1).png"></image>
<image src="../../static/image/tosign/tosigin(1).png" @click="fanhui"></image>
</u-navbar>
<view id="content_tosign">
<u-form :model="form" ref="uForm">
<u-form-item label-position="right">
<u-input v-model="max" placeholder="优秀的标题可以卖的更好哦~" />
<u-input v-model="max" :placeholder="userinfo.role != 4 ? '优秀的标题可以卖的更好哦~' : '优秀的标题可以吸引更多人观看哦~'" />
</u-form-item>
<view class="values"><text>{{this.titleMaxLength - this.max.length}}</text>/20</view>
<u-form-item label-position="right">
<u-input v-model="form.text" placeholder="请填写直播简介" />
</u-form-item>
<view class="values"><text>{{20 - form.text.length}}</text>/20</view>
<u-form-item label-position="right" >
<u-input v-model="form.values" placeholder="我的售货袋" @click="navto('selectshop')"/>
<u-form-item label-position="right" v-if="userinfo.role != 4">
<u-input :disabled="true" v-model="form.values" placeholder="我的售货袋" @click="navto('selectshop')"/>
<view class="rightes" @click="navto('selectshop')">售货袋</view>
</u-form-item>
</u-form>
<!-- 标签的引入 -->
<tap_tosign :fileListes="fileListes" @chuangjian="chuangjian" @qiehuan="qiehuan"></tap_tosign>
<view class="titles">直播封面图</view>
<u-upload :form-data="{'name':'article_cover'}" action='https://dmmall.sdbairui.com/storeapi/Upload/uploadFile' name="article_cover" :header="{'Authorization' : 'Bearer' + ' ' + token}" :max-count="1" :show-progress="true" @on-change="tupian" del-color="#ececec" upload-text="上传" del-bg-color="#fff"></u-upload>
<u-upload ref="upload" :form-data="{'name':'article_cover'}" action='https://mall.dmygkeji.com/storeapi/Upload/uploadFile' name="article_cover" :header="{'Authorization' : 'Bearer' + ' ' + token}" :max-count="1" :show-progress="true" @on-change="tupian" @on-success="sccg" del-color="#ececec" upload-text="上传" del-bg-color="#fff" :before-upload="shangchuan"></u-upload>
</view>
<view class="button-uview">
<u-button @click="kaibo">{{relerest}}</u-button>
<u-button :hair-line="false" @click="kaibo">{{relerest}}</u-button>
</view>
<u-toast ref="uToast" />
</view>
</view>
</template>
@@ -61,10 +62,28 @@
fileListes:[],
rSelect:[],
image:"",
token:""
token:"",
tiaozhuan:false,
userinfo:{}
};
},
methods: {
fanhui(){
this.$u.route({
type:"back",
delta:1
})
},
shangchuan(){
uni.showLoading({
title: '上传中',
mask:true
});
},
tupian(){
uni.hideLoading()
},
sccg() {},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
//console.log(e);
@@ -91,8 +110,21 @@
this.init()
},
tupian(a){
console.log(JSON.parse(a.data))
this.image = JSON.parse(a.data).data.file_name
// console.log(JSON.parse(a.data));
let info = JSON.parse(a.data);
console.log(info);
// console.log(JSON.stringify(a.data))
if(info.errCode == 1){
this.$refs.uToast.show({
title: info.message,
type: 'error'
});
this.$refs.upload.clear()
return ;
}
this.image = info.data.file_name;
},
navto(url){
this.$u.route({
@@ -100,6 +132,11 @@
})
},
kaibo(){
if(this.tiaozhuan){
return ;
}
this.tiaozhuan = true
console.log(this.image)
this.$u.api.createChatRoom({
chat_name:this.max,
live_desc:this.form.text,
@@ -107,15 +144,24 @@
goods_id:uni.getStorageSync("gouwudai"),
cover_img:this.image
}).then((res)=>{
console.log(res)
console.log(JSON.stringify(res))
if(res.errCode == 1){
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
this.tiaozhuan = false
}
this.$u.route({
url:"/pages/release/zhibo",
type:"redirectTo",
params:{
url:res.data.url.replace("&","*"),
id:res.data.chat_id,
live_id: res.data.live_id
}
})
this.tiaozhuan = true
})
},
init(){
@@ -142,6 +188,8 @@
//
this.token = uni.getStorageSync('token');
this.userinfo = uni.getStorageSync("userinfo")
console.log(this.userinfo)
var config = {
appkey: 'mgb7ka1',
debug:true
@@ -477,11 +525,11 @@
}
.button-uview {
position: fixed;
bottom: 40rpx;
left: 0;
right: 0;
margin: auto;
z-index: 10;
// position: fixed;
// bottom: 40rpx;
// left: 0;
// right: 0;
margin: 20rpx auto;
// z-index: 10;
}
</style>

View File

@@ -1,8 +1,8 @@
<template>
<view id="release">
<view id="release" >
<u-form :model="form" ref="uForm">
<u-form-item label="标题" label-position="right"><u-input v-model="form.name" placeholder="请输入标题" /></u-form-item>
<view class="titles">封面</view>
<view class="titles">封面<text>建议图片尺寸为334*334</text></view>
<u-upload
:form-data="coverformdata"
:max-count="1"
@@ -15,32 +15,41 @@
:file-list="fileListA"
@on-success="uploadcover"
></u-upload>
<view class="titles">视频</view>
<view class="videobox" v-if="videostate == false" @click="uploadvideo">
<view class="titles">视频<text>建议视频时长在5分钟内视频大小不超过100M</text></view>
<view class="videobox video-flex" v-if="videostate == false" @click="uploadvideo">
<u-icon name="plus" class="u-add-btn" size="40"></u-icon>
<view class="videotext">选择视频</view>
</view>
<view class="videobox" v-else @click="uploadvideo"><video :src="videopath" controls></video></view>
<view class="videobox" v-else @click="uploadvideo">
<video v-if="!is_video" :src="videopath" controls></video>
<view v-else class="video-mode">
<image src="../../static/videoPlay.png" mode=""></image>
</view>
</view>
<!-- 标签 -->
<view>
<view class="titles">标签</view>
<view class="form-view" @click="show_add()">+ 新建标签</view>
<view :class="[item.state == true ? 'active' : '', 'form-view']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
<view class="titles flex-title">
<text>标签</text>
<text @click="editing">{{ is_edit ? "取消编辑" : "编辑" }}</text>
</view>
<view class="form-view active" @click="show_add()">+ 新建标签</view>
<view :class="['form-view', item.state == true ? 'active' : '']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
{{ item.name }}
<u-icon v-show="is_edit && item.user_id != 0" class="close" name="close" color="#666" size="18" @click="isTable(item.id,index)"></u-icon>
</view>
</view>
<!-- 简介 -->
<view class="titles">正文</view>
<view class="titles_border"><textarea placeholder="请输入内容..." v-model="form.intro"></textarea></view>
<view class="show_two">
<u-popup v-model="show_two" mode="bottom" :closeable="true">
<u-popup v-model="show_two" mode="bottom" @close="closeGood" :closeable="true">
<view class="title"><text>选择商品</text></view>
<!-- 商品列表 -->
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll">
<view class="listes_shoping" v-for="(item, index) in list" :key="index">
<view>
<u-checkbox-group>
<u-checkbox @change="checkboxChange" shape="circle" active-color="#FF780F" v-model="item.checked" :name="item.goods_id"></u-checkbox>
<u-checkbox shape="circle" size="40" active-color="#FF780F" v-model="item.checked" :name="index" @change="checkboxChange"></u-checkbox>
</u-checkbox-group>
</view>
<view><image :src="item.goods_image" mode="widthFix"></image></view>
@@ -52,7 +61,7 @@
<view class="u-button" @click="changes()">确定</view>
</u-popup>
<!-- 底部选择商品列表 -->
<view @click="show_two = true">
<view @click="selectGoods" v-if="userinfo.role != 4">
选择商品
<image class="images" src="../../static/image/tosign/bhottom.png"></image>
</view>
@@ -64,19 +73,96 @@
</view>
</view>
<!-- 提交 -->
<u-button class="custom-style" shape="circle" size="default" @click="publish">发表</u-button>
<u-button class="custom-style" shape="circle" size="default" :hair-line="false" @click="publish">发表</u-button>
</u-form>
<!-- 添加标签的按钮 -->
<u-popup v-model="show" mode="center" border-radius="14" :closeable="true">
<view class="text">创建属于你的标签吧</view>
<view class="u-inputes"><u-input v-model="tagcontent" /></view>
<u-button class="custom-style-button" shape="circle" size="default" @click="addLiveSpec">确定</u-button>
<u-button :hair-line="false" class="custom-style-button" shape="circle" size="default" @click="addLiveSpec">确定</u-button>
</u-popup>
<u-toast ref="uToast" />
</view>
</template>
<script>
let COS = require('../../common/cos-wx-sdk-v5.js');
// 上传文件
const upload_file_server = (_this, filepath) => {
// 腾讯云配置
let cosConfig = {
Bucket: 'dmmall-1302895943', //replace with yours
Region: 'ap-shanghai', //replace with yours
SecretId: 'AKID7z1lFeo0tV9YmmvZ52mrxlNmvqHTcuCF', //replace with yours
SecretKey: 'd3zTJ0RFwMYVE7jAMJzQ4UbS4YmmJiPq' //replace with yours
};
// 腾讯云配置
// let cosConfig = {
// Bucket: 'dmmall-1300406074', //replace with yours
// Region: 'ap-shanghai', //replace with yours
// SecretId: 'AKIDjDPJhni9gTzEB9iGNWQ3PTVGjv74q7EL', //replace with yours
// SecretKey: 'ye3SZOvAQO5X5LK3Vy933h6G86h4mqpG' //replace with yours
// };
// 获取本地文件
let filePath = filepath;
// 自定义文件名以及路径
let time = new Date();
var y = time.getFullYear();
var m = time.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = time.getDate();
d = d < 10 ? '0' + d : d;
let str = y + m + d;
let Key = 'video/' + str + '/' + filePath.substr(filePath.lastIndexOf('/') + 1);
// 初始化凭证
var cos = new COS({
SecretId: cosConfig.SecretId,
SecretKey: cosConfig.SecretKey
});
//上传文件
cos.postObject(
{
Bucket: cosConfig.Bucket,
Region: cosConfig.Region,
Key: Key,
StorgeClass: 'STANDARD', //存储方式
FilePath: filePath
},
(err, data) => {
console.log(err, data, 12345);
if (err == null) {
if (data.statusCode == 200) {
_this.videopath = 'https://dmmall-1302895943.cos.ap-shanghai.myqcloud.com/' + Key;
uni.hideLoading();
_this.videostate = true;
} else {
uni.showToast({
title: '上传失败!',
icon: 'none'
});
}
} else {
return;
}
}
);
};
// 选择图片(通用)
const cImage = _this => {
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
// _this.is_video = true;
uni.showLoading({
title: '上传中'
});
const tempFilePaths = res.tempFilePath;
console.log(tempFilePaths);
upload_file_server(_this, tempFilePaths);
}
});
};
export default {
data() {
return {
@@ -92,12 +178,13 @@ export default {
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
},
// 演示地址,请勿直接使用
action: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
action: 'https://mall.dmygkeji.com/storeapi/Upload/uploadFile',
fileListA: [],
imgarrA: [],
videopath: '', //视频链接
fileListes: [],
show: false,
is_video: false,
show_two: false,
arres_list: [],
shoplist: [], //选择商品列表
@@ -106,13 +193,30 @@ export default {
selectarr: [], //选中标签
tagcontent: '', //新建标签名字
selectvideo: '', //视频名字
videostate: false //视频状态
videostate: false, //视频状态
progress: 0,
is_edit: false, // 编辑标签
userinfo:{}
};
},
onLoad() {
this.userinfo = uni.getStorageSync("userinfo")
this.getLiveSpec();
this.resetgood();
},
watch: {
show() {
let me = this;
if (this.show) {
this.is_video = true;
} else {
setTimeout(function() {
me.is_video = false;
},600)
}
},
immediate: true
},
methods: {
// 获取可以推荐的商品
resetgood() {
@@ -141,20 +245,28 @@ export default {
label_arr: this.selectarr
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
// this.$refs.uToast.show({
// title: res.message,
// type: 'error'
// });
uni.showToast({
title: res.message,
icon: "none"
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
setTimeout(function(){
// this.$refs.uToast.show({
// title: res.message,
// type: 'success'
// });
uni.showToast({
title: res.message,
icon: "none"
})
setTimeout(function() {
uni.navigateBack({
delta:1
})
},1000)
delta: 1
});
}, 1000);
}
});
},
@@ -182,23 +294,42 @@ export default {
this.selectarr.push(this.fileListes[num].id);
}
},
// 选择商品
selectGoods() {
this.show_two = true;
this.is_video = true;
},
// 选择商品弹窗关闭
closeGood() {
this.is_video = false;
},
// 创建标签
addLiveSpec() {
this.$u.api.createLivesp({
spec_name: this.tagcontent
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
// this.$refs.uToast.show({
// title: res.message,
// type: 'error',
// });
uni.showToast({
title: res.message,
icon: "none"
})
} else {
this.tagcontent = '';
this.show = false;
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
res.data.state = false;
this.fileListes.push(res.data);
// this.$refs.uToast.show({
// title: res.message,
// type: 'success'
// });
uni.showToast({
title: res.message,
icon: "none"
})
}
});
},
@@ -207,10 +338,14 @@ export default {
let that = this;
this.$u.api.getLiveSpec({}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
// this.$refs.uToast.show({
// title: res.message,
// type: 'error'
// });
uni.showToast({
title: res.message,
icon: "none"
})
} else {
let arr = res.data;
for (let index in arr) {
@@ -220,6 +355,34 @@ export default {
}
});
},
// 删除标签
isTable(id,index) {
uni.showModal({
title: "提示",
content: "是否删除此标签?",
success: (res) => {
if (res.confirm) {
this.delTable(id,index);
}
}
})
},
delTable(id,index) {
let me = this;
this.$u.post("Streaming/deltLabel", {label_id: id}).then(res => {
if (res.errCode == 0) {
// this.$refs.uToast.show({
// title: res.message,
// type: 'success'
// });
uni.showToast({
title: res.message,
icon: "none"
})
this.fileListes.splice(index,1);
}
})
},
// 上传封面
uploadcover(data) {
let obj = data.data;
@@ -228,41 +391,16 @@ export default {
},
// 上传视频
uploadvideo() {
let url = this.action;
let that = this;
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
self.src = res.tempFilePath;
const tempFilePaths = res.tempFilePath;
uni.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: tempFilePaths,
name: 'article_video',
formData: {
name: 'article_video'
},
header: {
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
},
success: uploadFileRes => {
let obj = JSON.parse(uploadFileRes.data);
that.videopath = obj.data.url;
that.selectvideo = obj.data.key;
that.videostate = true;
},
fail: function(error) {
console.log(error);
}
});
}
});
cImage(this);
},
// 新建标签
show_add() {
this.show = !this.show;
},
// 编辑标签
editing() {
this.is_edit = !this.is_edit;
},
// 选择直播商品点击确定
changes() {
let that = this;
@@ -270,11 +408,14 @@ export default {
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
let id = e.name;
let that = this;
let num = Number(e.name);
if (e.value == true) {
this.pushes(id);
that.pushes(that.list[num].goods_id);
that.list[num].checked = true;
} else {
this.delarr(id);
that.delarr(that.list[num].goods_id);
that.list[num].checked = false;
}
},
// 删除直播商品
@@ -307,6 +448,11 @@ export default {
#release {
width: 690rpx;
margin: 0 auto;
padding-bottom:20rpx;
.flex-title {
display: flex;
justify-content: space-between;
}
.titles_border,
.uni-textarea-compute {
border: 1px #bababa solid !important;
@@ -433,7 +579,7 @@ export default {
-webkit-line-clamp: 2;
}
.form-view {
background: rgba(255, 120, 15, 1);
background: #cdc7c8;
border-radius: 6rpx;
margin-right: 20rpx;
font-size: 24rpx;
@@ -441,26 +587,51 @@ export default {
display: inline-block;
margin-bottom: 28rpx;
color: #fff;
.close {
margin-left: 10rpx;
vertical-align: middle;
}
}
.active {
background: red;
background: #ff780f;
}
.titles {
font-size: 30rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
margin: 30rpx 0;
>text{
font-size: 20rpx;
color: #999;
}
}
.video-flex {
flex-direction: column;
font-size: 28rpx;
color: #666;
}
.videobox {
width: 200rpx;
height: 200rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #f4f5f6;
background-color: #f4f5f6;
margin-left: 10rpx;
border-radius: 10rpx;
.video-mode {
width: 200rpx;
height: 200rpx;
line-height: 280rpx;
text-align: center;
border-radius: 10rpx;
background-color: #000;
& > image {
width: 100rpx;
height: 100rpx;
}
}
}
.videotext {
margin-top: 10rpx;
@@ -475,7 +646,20 @@ export default {
.custom-style {
background: rgba(255, 120, 15, 1) !important;
color: #fff !important;
// font-size: 36rpx;
}
.u-btn {
width: 628rpx;
height: 98rpx;
background: rgba(255, 120, 15, 1) !important;
border-radius: 49rpx;
margin: 0 auto;
font-size: 36rpx;
color: rgba(255, 255, 255, 1) !important;
line-height: 36px;
border: 1px #ff780f solid;
outline: none;
border-color: rgba(255, 120, 15, 1) !important;
}
.custom-style-button {
background: rgba(255, 120, 15, 1) !important;

View File

@@ -1,16 +1,16 @@
<template>
<div>
<live-pusher id='livePusher' ref="livePusher" class="livePusher" :url="url"
mode="SD" :muted="false" :enable-camera="true" :auto-focus="true" :beauty="meiyan + 1" whiteness="2"
mode="FHD" :muted="false" :enable-camera="true" :auto-focus="true" :beauty="meiyan + 1" whiteness="0"
aspect="9:16" @statechange="statechange" @netstatus="netstatus" @error = "error"
:style="{'height':height + 'px'}"
></live-pusher>
<div class="bottom" :style="{'height':height + 'px'}" v-if="show" @click="show = false">
<div class="bottom" :style="{'height':height }" v-if="show" @click="show = false">
<div class="tanchuceng" @click="zuzhi">
<div class="head">
<div style="flex-direction: row;align-items:center">
<text class="title">全部商品</text>
<text class="num">2件</text>
<text class="num">{{list.length}}件</text>
</div>
<!-- <div class="add">
<text style="font-size:28rpx;color: #fff;text-align:center">添加/管理商品</text>
@@ -35,21 +35,21 @@
</div>
</div>
<div class="user">
<div v-if="zhibo" class="user">
</div>
<div style="position: fixed;top: 60rpx;left: 30rpx;flex-direction: row;align-items:center">
<div v-if="zhibo" style="position: fixed;top: 60rpx;left: 30rpx;flex-direction: row;align-items:center">
<image class="userhead" :src="info.member_avatar"></image>
<div class="userinfo">
<text class="username">{{info.member_name}}</text>
<text class="username" style="font-size:20rpx">{{time}} | sadasdas</text>
<text class="username">{{info.member_nickname}}</text>
<text class="username" style="font-size:20rpx">{{time}} | {{room.onlineUsers.users.length - 1 < 0 ? 0 : room.onlineUsers.users.length - 1}}</text>
</div>
</div>
<image class="closeimg" src="../../static/image/close.png" @click="closes"></image>
<image class="menuimg" src="../../static/image/menu.png" @click="tool = true"></image>
<image class="shoptapimg" @click="xianshi" src="../../static/image/shop.png"></image>
<text style="font-size:26rpx;color:#fff;width:512rpx;position:fixed;left:30rpx;top:793rpx">德铭阳光在线绿色直播请遵循相关法律法规警察叔叔24小时巡查哦。为了保障直播系统稳定现将全局开放防主播沉迷功能。主播积累直播16小时将自动下播休息2小时后方可继续开播。请大家注意休息/避免空播
<image v-if="zhibo" class="closeimg" src="../../static/image/close.png" @click="closes"></image>
<image v-if="zhibo" class="menuimg" src="../../static/image/menu.png" @click="tool = true"></image>
<image v-if="zhibo && list.length != 0" class="shoptapimg" @click="xianshi" src="../../static/image/shop.png" ></image>
<text v-if="zhibo && fen" style="font-size:26rpx;color:#fff;width:512rpx;position:fixed;left:30rpx;top:793rpx;">本平台提倡绿色健康直播,严禁在平台内外出现诱导未成年人诈骗、赌博、低俗色情、吸烟酗酒等不当行为,若有违反,将向相关部门依法追究您的法律责任。如因此给平台造成损失,有权向您全额追偿
</text>
<div class="danmulist">
<div v-if="zhibo" class="danmulist">
<text class="danmuitem" v-for="(i,j) in danmulist" :key="j">{{i.senderNickname}}:{{i.content}}</text>
</div>
@@ -59,12 +59,12 @@
<text class="menutitle">直播工具</text>
<view class="menutool">
<view class="menutoolitem" @click="switchCamera">
<image class="menutoolitemimg"></image>
<image src="../../static/images/fanzhuan.png" class="menutoolitemimg"></image>
<text class="menutoolitemtitle">翻转</text>
</view>
<picker @change="bindPickerChange" :value="meiyan" :range="[1,2,3,4,5,6,7,8,9]">
<view class="menutoolitem">
<image class="menutoolitemimg"></image>
<image src="../../static/images/meiyan.png" class="menutoolitemimg"></image>
<text class="menutoolitemtitle">美颜</text>
</view>
</picker>
@@ -72,6 +72,31 @@
</view>
</view>
</div>
<div class="jieshu" v-if="!zhibo" :style="{'height':height + 'px'}">
<div class="jieshuback" :style="{'height':height + 'px'}" @click="closes1"></div>
<image class="closeimg" src="../../static/image/cloneb.png" @click="closes"></image>
<text class="jieshutitle">徳铭阳光在线</text>
<image class="jieshuheadimg" @click="closes1" :src="info.member_avatar"></image>
<text class="jieshuusername">{{info.member_nickname}}</text>
<div class="jieshubox">
<view class="jieshuboxitem">
<text style="color:#fff;font-size:30rpx">{{jieshu.newfans}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">新粉丝</text>
</view>
<view class="jieshuboxitem">
<text style="color:#fff;font-size:30rpx">{{jieshu.headcount}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">观看人数</text>
</view>
<view class="jieshuboxitem" v-if="list.length != 0">
<text style="color:#fff;font-size:30rpx">RMB {{jieshu.sales_amount}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">直播销量</text>
</view>
<view class="jieshuboxitem" v-if="list.length != 0">
<text style="color:#fff;font-size:30rpx">{{jieshu.buy_num}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">购买人数</text>
</view>
</div>
</div>
<!-- <button class="btn" @click="start">开始推流1</button>
<button class="btn" @click="pause">暂停推流</button>
<button class="btn" @click="resume">resume</button>
@@ -84,6 +109,58 @@
</div>
</template>
<style lang="scss" scoped>
.jieshuboxitem{
width: 210rpx;
height: 120rpx;
align-items: center;
justify-content: center;
}
.jieshubox{
width: 438rpx;
height: 288rpx;
border-width: 1rpx;
border-color: #fff;
margin-top: 78rpx;
flex-direction: row;
flex-wrap: wrap;
}
.jieshuusername{
font-size: 30rpx;
margin-top: 31rpx;
color: #fff;
}
.jieshuheadimg{
width: 154rpx;
height: 154rpx;
border-radius: 77rpx;
}
.jieshutitle{
font-size: 30rpx;
color:#fff;
width: 350rpx;
position: absolute;
top: 70rpx;
left: 31rpx;
height: 31rpx;
}
.jieshuback{
background-color: #000;
opacity: 0.8;
position: absolute;
left: 0;
top: 0;
width: 750rpx;
}
.jieshu{
z-index: 9999;
position: fixed;
top: 0;
left: 0;
width: 750rpx;
align-items: center;
justify-content: center;
}
.shoptapimg{
width: 65rpx;
height: 65rpx;
@@ -99,11 +176,13 @@
bottom: 24rpx;
}
.closeimg{
position: fixed;
position: absolute;
top: 70rpx;
right: 31rpx;
width: 31rpx;
height: 31rpx;
width: 51rpx;
height: 51rpx;
padding:10rpx;
z-index:99999;
}
.username{
font-size: 24rpx;
@@ -155,7 +234,9 @@
border-bottom-width: 2rpx;
border-style: solid;
border-color: #ECECEC;
/* #ifndef APP-PLUS-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
}
@@ -190,7 +271,9 @@
border-bottom-width: 2rpx;
border-style: solid;
border-color: #ECECEC;
/* #ifndef APP-PLUS-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: space-between;
@@ -231,6 +314,8 @@
overflow: hidden;
top: 0;
left: 0;
width: 750rpx;
height: 335rpx;
}
.menutitle{
font-size: 30rpx;
@@ -260,11 +345,16 @@
position: fixed;
left: 30rpx;
bottom: 118rpx;
width: 690rpx;
}
.danmuitem{
font-size: 26rpx;
font-size: 30rpx;
color: #fff;
flex-direction: column-reverse;
/* #ifndef APP-PLUS-NVUE */
word-wrap:anywhere;
/* #endif */
font-weight: bold;
}
.livePusher{
width: 750rpx;
@@ -288,32 +378,96 @@
time:'00:00:00',
room:{},
chatRoomService:{},
danmulist:[]
danmulist:[],
zhibo:true,
jieshu:{},
renshumax:0,
changeLiveRealtimeNumber:{},
fen:true
},
onReady() {
// 注意需要在onReady中 或 onLoad 延时
this.context = uni.createLivePusherContext("livePusher", this);
onLaunch: function() {
console.log('App Launch');
},
onShow: function() {
if(!this.zhibo){
return ;
}
this.stop()
this.startPreview()
let that = this
uni.getSystemInfo({
success(a){
console.log(a.windowHeight)
that.height = a.windowHeight
// that.start()
}
this.start()
// var message = {
// senderNickname : this.room.currentUser.nickname ,
// type : 1,
// content : '重连'
// }
// this.chatRoomService.sendMessages(this.room.id, message);
},
onHide: function() {
console.log('App Hide');
this.chatRoomService.warrings = ()=>{};
},
//模拟onshow生命周期
created() {
//监听当前窗口显示
currentWebview.addEventListener('show',e=>{
console.log('search show');
this.startPreview()
this.start()
})
},
//摧毁之前的声明周期
beforeDestroy() {
//移除监听事件
console.log(123)
currentWebview.removeEventListener('show',e=>{})
},
onReady() {
// 注意需要在onReady中 或 onLoad 延时
let that = this
setTimeout(()=>{
uni.getSystemInfo({
success(a){
console.log(a.windowHeight,1212)
that.height = a.windowHeight
// that.start()
setTimeout(()=>{
that.context = uni.createLivePusherContext("livePusher", that);
that.startPreview()
},500)
}
})
},500)
},
onBackPress(options) {
if (options.from === 'navigateBack' || !this.zhibo) {
return false;
}
this.closes();
return true;
},
onLoad(a){
console.log(getApp().globalData.im)
uni.setKeepScreenOn({
keepScreenOn: true
});
this.url = a.url.replace("*","&")
let that = this
const token = uni.getStorageSync('token');
console.log('Bearer' + " " + token)
this.chatroom_id = a.id
this.live_id = a.live_id
uni.request({
url:"https://dmmall.sdbairui.com/storeapi/Streaming/liveStreamList",
url:"https://mall.dmygkeji.com/storeapi/Streaming/liveStreamList",
method:"POST",
header:{
'Authorization' : 'Bearer' + " " + token
@@ -324,7 +478,7 @@
}
})
uni.request({
url:"https://dmmall.sdbairui.com/storeapi/member/memberInfo",
url:"https://mall.dmygkeji.com/storeapi/member/memberInfo",
method:"POST",
header:{
'Authorization' : 'Bearer' + " " + token
@@ -336,7 +490,7 @@
console.log(uni.getStorageSync('userinfo'),123)
//当前用户
var currentUser = {
id : res.data.data.memberInfo.member_id + "",
id : Date.parse(new Date()) + "",
nickname : res.data.data.memberInfo.member_nickname + "",
avatar: res.data.data.memberInfo.member_avatar
};
@@ -345,13 +499,16 @@
id : a.id + "",
name : a.id + ""
};
console.log(room)
that.chatRoomService = getApp().globalData.im
console.log(room,currentUser)
//构造chatRoomService
that.chatRoomService = new ChatRoomService(room, currentUser);
that.chatRoomService.subscribeRoomMessage(room,currentUser)
that.chatRoomService.initialWhenNewMessage(that.whenNewMessage);
that.chatRoomService.connectGoEasyIM();
that.chatRoomService.warrings = that.jinggao
//获取当前聊天室数据
that.room = that.chatRoomService.room;
console.log(that.room)
that.chatRoomService.initialWhenOnlineUserChange(that.renqu)
}
})
let shi = 0;
@@ -363,6 +520,9 @@
miao = parseInt(miao)
miao = miao + 1
// console.log(miao)
if(fen > 0){
that.fen = false;
}
if(miao == 60){
miao = 0;
fen +=1
@@ -382,6 +542,24 @@
}
that.time = shi + ":" + fen + ":" + miao
}, 1000);
setInterval(()=>{
console.log("定时")
uni.request({
url:"https://mall.dmygkeji.com/storeapi/Streaming/changeLiveRealtimeNumber",
method:"POST",
header:{
'Authorization' : 'Bearer' + " " + token
},
data:{
live_id:that.live_id,
realtime_number: that.room.onlineUsers.users.length - 1 < 0 ? 0 : that.room.onlineUsers.users.length - 1
},
success(res){
console.log(JSON.stringify(res))
}
})
},
10 * 1000)
// var roomToken = JSON.parse(options.roomToken);
@@ -433,6 +611,38 @@
},
methods: {
jinggao(text){
console.log(text)
if(text.message_type == 1){
uni.showModal({
title: '警告',
content: text.content,
showCancel:false,
success: function (res) {
}
});
}else if(text.message_type == 2){
uni.showModal({
title: '警告',
content: text.content,
showCancel:false,
success: function (res) {
uni.navigateBack({
delta: 1
});
}
});
this.stop()
}
},
renqu(res){
if(res.users.length > this.renqu){
this.renqu = res.users.length
}
this.$forceUpdate()
},
whenNewMessage (message) {//新消息监听
// if(message.type == this.room.MessageType.PROP){
// this.propAnimation(parseInt(message.content))
@@ -454,7 +664,19 @@
duration: 2000
});
},
closes1() {
console.log(111);
},
closes(){
console.log(this.zhibo)
if(!this.zhibo){
uni.navigateBack({
delta:1
});
return ;
}
this.chatRoomService.warrings = ()=>{};
const token = uni.getStorageSync('token');
let that = this
console.log(that.url)
@@ -464,7 +686,7 @@
success: function (res) {
if (res.confirm) {
uni.request({
url:"https://dmmall.sdbairui.com/storeapi/Streaming/destroyChatRoom",
url:"https://mall.dmygkeji.com/storeapi/Streaming/destroyChatRoom",
data:{
chatroom_id:that.chatroom_id,
live_id:that.live_id,
@@ -476,9 +698,12 @@
},
success(res){
console.log(res)
uni.navigateBack({
delta: 1
});
that.stop()
that.jieshu = res.data.data
that.zhibo = false
// uni.navigateBack({
// delta: 1
// });
// that.list= res.data.data
}
})
@@ -490,6 +715,7 @@
},
statechange(e) {
console.log("statechange:" + JSON.stringify(e));
console.log(e)
},
netstatus(e) {
// console.log("netstatus:" + JSON.stringify(e));
@@ -498,6 +724,7 @@
console.log("error:" + JSON.stringify(e));
},
start: function() {
console.log("开始")
console.log(this.url)
this.context.start({
success: (a) => {
@@ -587,9 +814,10 @@
arr.push(this.list[i].goods_id)
}
}
console.log(arr.join(','))
let that = this
uni.request({
url:"https://dmmall.sdbairui.com/storeapi/Streaming/updateGoods",
url:"https://mall.dmygkeji.com/storeapi/Streaming/updateGoods",
method:"POST",
data:{
goods_id:arr.join(',')
@@ -600,7 +828,7 @@
success(res){
console.log(res)
uni.request({
url:"https://dmmall.sdbairui.com//storeapi/Streaming/liveStreamList",
url:"https://mall.dmygkeji.com//storeapi/Streaming/liveStreamList",
method:"POST",
header:{
'Authorization' : 'Bearer' + " " + token

View File

@@ -47,6 +47,7 @@ export default {
this.$u.api.reportdetail({
id: id
}).then(res => {
console.log(res)
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,

View File

@@ -6,7 +6,7 @@
</view>
<view class="imgbox">
<view v-if="type==1">
<image :src="list" mode="" v-for="list in info.article_image"></image>
<image :src="list" mode="" @tap="viewImage" v-for="list in info.article_image"></image>
</view>
<view v-else>
<video :src="info.video_path" controls></video>
@@ -31,12 +31,12 @@
<view class="comment-list">
<view class="item" v-for="(item, index) in info.articlecomment" :key="index">
<view class="info">
<image></image>
<image :src="item.member_avatar"></image>
<view class="center">
<view class="name">{{item.member_nickname}}</view>
<view class="name">{{item.member_nickname}}{{item.reply_member_nickname==null?"评论了文章":" 回复了 "+item.reply_member_nickname}}</view>
<view class="time">{{item.create_time}}</view>
</view>
<view class="btn" @click="showreply(item.id)">回复</view>
<view class="btn" @click="showreply(item.id,item.member_id)" v-if="item.pid==0">回复</view>
</view>
<view class="content u-line-1">{{item.content}}</view>
</view>
@@ -63,7 +63,8 @@ export default {
},
type:1,
content:"",
pid:null
pid:null,
replyid:null
};
},
onLoad(option) {
@@ -74,9 +75,10 @@ export default {
},
methods: {
// 展示回复弹框
showreply(id){
showreply(id,replyid){
this.showChat = true
this.pid = id
this.replyid = replyid
},
// 回复评论
reply(){
@@ -91,7 +93,8 @@ export default {
this.$u.api.reply({
pid:that.pid,
content:that.content,
article_id: that.id
article_id: that.id,
reply_id:that.replyid
}).then(res => {
if (res.errCode != 0) {
this.$refs.uToast.show({
@@ -101,6 +104,8 @@ export default {
} else {
this.pid = "";
this.content = "";
this.getdetail();
this.showChat = false
this.$refs.uToast.show({
title: res.message,
type: 'success'
@@ -129,7 +134,13 @@ export default {
this.info = res.data.article[0];
}
});
}
},
// 预览图片
viewImage() {
uni.previewImage({
urls: this.info.article_image
})
}
}
};
</script>

117
pages/user/feedback.vue Normal file
View File

@@ -0,0 +1,117 @@
<template>
<view class="write-complaints">
<view class="main-container">
<view class="text-box">
<u-input class="textarea" placeholder="发表您的意见吧,我们会做得更好。 (必填)" v-model="text" type="textarea" :clearable="false" :maxlength="200" />
<span class="text-length">{{ text.length }}/200</span>
</view>
<u-input class="phone" placeholder="请输入手机号方便联系 (非必填)" v-model="phone" type="number" />
</view>
<view class="write-btn" @click="submit">发表意见</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
phone: '',
text: '',
}
},
methods: {
submit() {
if(!this.verifyContent()) return false;
// console.log(this.phone);
// console.log(this.text);
this.$u.toast('提交成功');
this.phone = "";
this.text = "";
},
verifyContent() {
if(this.$u.test.isEmpty(this.text)) {
this.$u.toast('内容不可为空');
return false;
}
if(!this.$u.test.isEmpty(this.phone)) {
if(!this.$u.test.mobile(this.phone)) {
this.$u.toast('手机格式错误');
return false;
}
}
return true;
},
writeFeedback() {
if(!this.verifyContent()) return false;
this.$u.api.writeFeedback({
fb_content: this.text,
fb_images: this.imageList,
}).then(res => {
if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
duration: 2000,
callback:() => {
this.$u.route({
type: "navigateBack",
url: '/pageE/more/Complaints',
})
}
})
} else {
this.$u.toast(res.message);
}
})
},
},
}
</script>
<style lang="scss" scoped>
.write-complaints {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
.main-container {
background-color: #ffffff;
.text-box {
padding-bottom: 60rpx;
position: relative;
&::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
height: 3rpx;
width: 750rpx;
background-color: #ECECEC;
}
.text-length {
height: 60rpx;
position: absolute;
right: 40rpx;
bottom: 0;
color: #999;
}
}
/deep/ .textarea {
padding: 0 30rpx !important;
width: 100% !important;
margin-bottom: 10rpx;
}
/deep/ .phone {
padding: 20rpx 30rpx !important;
}
}
.write-btn {
margin: 120rpx auto 0;
width: 690rpx;
height: 98rpx;
background: rgba(255,120,15,1);
border-radius: 46rpx;
font-size: 36rpx;
color: rgba(255,255,255,1);
text-align: center;
line-height: 98rpx;
}
}
</style>

View File

@@ -1,21 +1,21 @@
<template>
<view class="user">
<view class="head" @click="toOthersPage('info')">
<view class="info">
<image :src="info.member_avatar"></image>
<view class="info" :key="num">
<image :src="info.member_avatar+'?'+new Date().getTime()"></image>
<view class="name">
<text>{{info.member_nickname==null?"新用户":info.member_nickname}}</text>
<text>账号{{info.member_name}}</text>
<text>个性签名{{info.signature==""?"该用户很懒没有签名!":info.signature}}</text>
<text class="u-line-2">个性签名{{info.signature==""?"该用户很懒没有签名!":info.signature}}</text>
</view>
</view>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="toOthersPage('fans')">
<text>我的粉丝</text>
<image src="/static/image/user/1.png"></image>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="toOthersPage('content')">
<view class="nav" @click="toOthersPage('content')">
<text>内容管理</text>
<image src="/static/image/user/1.png"></image>
</view>
@@ -23,6 +23,29 @@
<text>骑手投诉</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="toOthersPage('feedback')">
<text>用户反馈</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="viewAgreement(0)">
<text>用户协议</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="viewAgreement(1)">
<text>隐私政策</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="clearCache">
<text>清除缓存</text>
<text>{{ fileSizeString }}</text>
</view>
<view class="nav" @click="isLoginOut = true">
<text>退出登录</text>
<image src="/static/image/user/1.png"></image>
</view>
<u-modal v-model="isLoginOut" show-confirm-button show-cancel-button :content="content" @confirm="loginOut"></u-modal>
<u-toast ref="uToast" />
</view>
</template>
@@ -31,13 +54,84 @@ export default {
name:"user",
data() {
return {
info:{}
info:{},
isLoginOut: false,
content: "是否退出登录?",
num:0,
fileSizeString: "", // 缓存大小
}
},
watch: {
isLoginOut() {
// console.log(this.isLoginOut);
// if (this.isLoginOut) {
// uni.hideTabBar();
// } else {
// setTimeout(function() {
// uni.showTabBar();
// },200)
// }
}
},
onLoad() {
this.getCache();
},
onShow() {
this.getmyinfo()
},
methods: {
// 获取缓存
getCache() {
let _this = this;
// #ifdef APP-PLUS
plus.cache.calculate(function(size) {
console.log(size);
let sizeCache = size;
if (sizeCache == 0) {
_this.fileSizeString = "0B";
} else if (sizeCache < 1024) {
_this.fileSizeString = sizeCache + "B";
} else if (sizeCache < 1048576) {
_this.fileSizeString = (sizeCache / 1024).toFixed(2) + "KB";
} else if (sizeCache < 1073741824) {
_this.fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB";
} else {
_this.fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB";
}
});
// #endif
},
// 清除缓存
clearCache() {
// #ifdef APP-PLUS
uni.showModal({
title: "确定要清理缓存吗?",
cancelColor: "#999",
confirmColor: "#f00",
success: (res) => {
// console.log(res);
if (res.confirm) {
plus.cache.clear(function(e) {
console.log(e);
})
this.getCache();
}
}
})
// #endif
},
// 退出登陆
loginOut(){
uni.clearStorage();
this.imService.disconnect();
this.$refs.uToast.show({
title: "退出登陆成功!",
type: 'success'
});
uni.reLaunch({
url:"../login/login"
})
},
// 获取个人信息
getmyinfo(){
let that = this;
@@ -50,6 +144,7 @@ export default {
});
} else {
this.info = res.data.memberInfo
this.num++
}
});
},
@@ -57,7 +152,26 @@ export default {
uni.navigateTo({
url: '/pages/user/' + url
});
}
},
viewAgreement(index) {
if (index == 0) {
this.$u.route({
url: '/pages/login/agreements',
params: {
title: "用户协议"
}
});
}
if (index == 1) {
this.$u.route({
url: '/pages/login/privacy_policy',
params: {
title: "隐私政策"
}
});
}
}
},
}
</script>
@@ -78,6 +192,7 @@ export default {
align-items: center;
>image{
flex-shrink: 0;
width: 110rpx;
height: 110rpx;
border-radius: 50%;

View File

@@ -1,18 +1,19 @@
<template>
<view class="info">
<view class="head" @click="chooseImage">
<image :src="fileurl" :key="num"></image>
<image :src="fileurl+'?'+new Date().getTime()"></image>
<text>更换头像</text>
</view>
<view class="item">
<text class="title">用户名</text>
<text class="title" v-if="role == 2">店铺名称</text>
<text class="title" v-else>达人名称</text>
<input type="text" value="" v-model="info.member_nickname" placeholder="请输入用户名"/>
</view>
<view class="item">
<text class="title">个性签名</text>
<input type="text" value="" v-model="info.signature" placeholder="请输入个性签名"/>
</view>
<view class="password" @click="updatePwd">
<view class="password" @click="updatePwd" v-if="role != 4">
<text>修改密码</text>
<image src="/static/image/user/1.png"></image>
</view>
@@ -27,14 +28,25 @@ export default {
fileurl: "",
filename:"",
info:{},
num:0
num:0,
role: 0,
};
},
onLoad() {
this.getmyinfo()
this.getmyinfo();
let userinfo = uni.getStorageSync("userinfo");
this.role = userinfo.role;
// console.log(this.role);
},
// 保存信息
onNavigationBarButtonTap() {
let that = this;
let obj ={
nickname:that.info.member_nickname,
avatar:that.filename,
signature:that.info.signature
}
console.log(obj)
this.$u.api.changeinfo({
nickname:that.info.member_nickname,
avatar:that.filename,
@@ -51,6 +63,9 @@ export default {
title: res.message,
type: 'success'
});
uni.navigateBack({
delta:1
})
}
});
},
@@ -73,7 +88,13 @@ export default {
},
// 获取图片,上传图片
chooseImage(sourceType) {
let that = this
let that = this;
let photo_type = "";
if (this.role == 2) {
photo_type = "store_avatar"
} else {
photo_type = "avatar"
}
const token = uni.getStorageSync('token');
uni.chooseImage({
count: 1,
@@ -81,24 +102,27 @@ export default {
success: function(res) {
console.log(JSON.stringify(res.tempFilePaths));
const tempFilePaths = res.tempFilePaths;
that.fileurl = tempFilePaths[0]
uni.uploadFile({
url: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
url: 'https://mall.dmygkeji.com/storeapi/Upload/uploadFile',
filePath: tempFilePaths[0],
name: 'avatar',
name: photo_type,
formData:{
name:"avatar"
name: photo_type,
store_id: that.info.store_id
},
header:{
Authorization:'Bearer' + " " + token
},
success: uploadFileRes => {
let obj = JSON.parse(uploadFileRes.data)
that.fileurl = obj.data.file_path
that.fileurl = obj.data.file_path+'?'+new Date().getTime()
that.filename = obj.data.file_name
that.num++
console.log(that.fileurl,that.filename)
}
},
fail: (res) => {
console.log(res);
}
});
}
});

View File

@@ -2,15 +2,19 @@
<view class="user">
<view class="head" @click="toOthersPage('info')">
<view class="info">
<image :src="info.member_avatar"></image>
<image :src="info.member_avatar + '?' + (new Date().getTime())"></image>
<view class="name">
<text>{{info.member_nickname==null?"新用户":info.member_nickname}}</text>
<text>账号{{info.member_name}}</text>
<text>个性签名{{info.signature==""?"该用户很懒没有签名!":info.signature}}</text>
<text class="u-line-2">个性签名{{info.signature==""?"该用户很懒没有签名!":info.signature}}</text>
</view>
</view>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="navtos()">
<text>活动消息</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="toOthersPage('fans')">
<text>我的粉丝</text>
<image src="/static/image/user/1.png"></image>
@@ -19,9 +23,17 @@
<text>内容管理</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="release-btn" @click="publish">
<image src="../../static/image/index/publish.png"></image>
<view class="text">发布</view>
<view class="nav" @click="clearCache">
<text>清除缓存</text>
<text>{{ fileSizeString }}</text>
</view>
<view class="nav" @click="is_loginout = true">
<text>退出登录</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="release-btn" @click="publish">
<image src="../../static/image/index/publish.png"></image>
<view class="text">发布</view>
</view>
<u-popup v-model="publishstate" mode="bottom">
<view class="publish">
@@ -42,6 +54,7 @@
<image src="../../static/image/index/close.png" class="off" @click="close"></image>
</view>
</u-popup>
<u-modal v-model="is_loginout" show-confirm-button show-cancel-button :content="content" @confirm="loginOut"></u-modal>
<u-toast ref="uToast" />
</view>
</template>
@@ -50,14 +63,81 @@ export default {
name:"user",
data() {
return {
publishstate:false,
publishstate: false,
is_loginout: false,
content: "是否退出登录?",
info:{},
fileSizeString: "", // 缓存大小
}
},
onLoad() {
onShow(){
this.getmyinfo()
},
onLoad() {
this.getCache();
const user = uni.getStorageSync('userinfo');
console.log(user)
this.imService.login(user.member_id,user.member_nickname,user.member_avatar)
this.imService.connectIM()
},
methods: {
// 获取缓存
getCache() {
let _this = this;
// #ifdef APP-PLUS
plus.cache.calculate(function(size) {
console.log(size);
let sizeCache = size;
if (sizeCache == 0) {
_this.fileSizeString = "0B";
} else if (sizeCache < 1024) {
_this.fileSizeString = sizeCache + "B";
} else if (sizeCache < 1048576) {
_this.fileSizeString = (sizeCache / 1024).toFixed(2) + "KB";
} else if (sizeCache < 1073741824) {
_this.fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB";
} else {
_this.fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB";
}
});
// #endif
},
// 清除缓存
clearCache() {
// #ifdef APP-PLUS
uni.showModal({
title: "确定要清理缓存吗?",
cancelColor: "#999",
confirmColor: "#f00",
success: (res) => {
// console.log(res);
if (res.confirm) {
plus.cache.clear(function(e) {
console.log(e);
})
this.getCache();
}
}
})
// #endif
},
navtos(){
this.$u.route({
url:"/pages/messages/list"
})
},
// 退出登录
loginOut(){
this.imService.disconnect()
uni.clearStorage();
this.$refs.uToast.show({
title: "退出登陆成功!",
type: 'success'
});
uni.reLaunch({
url:"../login/login"
})
},
// 获取个人信息
getmyinfo(){
let that = this;
@@ -89,33 +169,33 @@ export default {
},
// 跳转发布页面
navto(url) {
// 判断直播权限
if(url=="release/tosign"){
this.$u.api.canlive({}).then(res => {
console.log(res);
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
if(res.data.live_stataes==0){
this.$u.route({
url: `/pages/${url}`
});
}else{
this.$refs.uToast.show({
title: "当前用户没有直播权限",
type: 'error'
});
}
}
});
}else{
// // 判断直播权限
// if(url=="release/tosign"){
// this.$u.api.canlive({}).then(res => {
// console.log(JSON.stringify(res));
// if (res.errCode != 0) {
// this.$refs.uToast.show({
// title: res.message,
// type: 'error'
// });
// } else {
// if(res.data.live_stataes==0){
// this.$u.route({
// url: `/pages/${url}`
// });
// }else{
// this.$refs.uToast.show({
// title: "当前用户没有直播权限",
// type: 'error'
// });
// }
// }
// });
// }else{
this.$u.route({
url: `/pages/${url}`
});
}
// }
}
@@ -198,10 +278,10 @@ export default {
align-items: center;
>image{
flex-shrink: 0;
width: 110rpx;
height: 110rpx;
border-radius: 50%;
background-color: #0f0;
}
.name{
font-size: 24rpx;

BIN
static/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

View File

@@ -62,7 +62,7 @@ function ChatRoomService(room, user) {
//获取实例
ChatRoomService.prototype.connectGoEasyIM = function () {
this.im = GoEasyIM.getInstance({
appkey: 'BC-453aa755c4ea48148abefc55a86df283',
appkey: 'BC-d9b5e639006b4ee2a4bc9eddc4235a6a',
host: 'hangzhou.goeasy.io'
});

BIN
static/image/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
static/image/cloneb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/image/home/chat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/image/login/safe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/image/shopback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

BIN
static/images/Avatar-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/images/Avatar-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/images/Avatar-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
static/images/Avatar-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
static/images/Vector.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

BIN
static/images/fanzhuan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

BIN
static/images/file-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

BIN
static/images/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
static/images/green-dot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

BIN
static/images/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/images/im.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 KiB

BIN
static/images/jianpan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
static/images/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
static/images/meiyan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
static/images/pending.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

BIN
static/images/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
static/images/vedio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

956
static/imservice.js Normal file
View File

@@ -0,0 +1,956 @@
/*
* @Author: jack.lu
* @Date: 2020-4-21 10:10:20
* @Last Modified by: jack.lu
* @Last Modified time: 2020-4-21 15:01:41
*/
import GoEasyIM from './goeasy-im-1.0.9';
import restApi from './restapi';
import music from './music.mp3'
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.online = false;
this.unReadMessage = parseInt(unReadMessage);
this.text = text;
this.time = time;
this.date = date
}
function Group(uuid, name, avatar) {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.unReadMessage = 0;
}
function CurrentUser(uuid, name, avatar) {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
}
function IMService() {
this.im = GoEasyIM.getInstance({
host:'hangzhou.goeasy.io',//qos=1
appkey:'BC-d9b5e639006b4ee2a4bc9eddc4235a6a'
});
//当前“我”
this.currentUser = null;
//我的好友
this.friends = {};
this.friendsarr = [];
//我的群
this.groups = {};
//私聊消息记录map格式每个好友对应一个数组
this.privateMessages = {};
//群聊消息记录map格式每个群对应一个数组
this.groupMessages = {};
this.uid = 0;
/*
* 监听器们
*
* 可以在页面里,根据需求,重写以下监听器,
* 便于当各种事件触发时,页面能够执行对应的响应
*
*/
//收到一条私聊消息
this.onNewPrivateMessageReceive = function (friendId, message) {};
//完成一次私聊历史加载
this.onPrivateHistoryLoad = function (friendId, messages) {};
//收到一条群聊消息
this.onNewGroupMessageReceive = function (groupId, message) {};
//完成一次群聊历史加载
this.onGroupHistoryLoad = function (groupId, messages) {};
//好友列表发生改变
this.onFriendListChange = function (friends) {};
//群列表发生改变
this.onGroupListChange = function (groups) {};
this.whenNewMessage = function () {
};
this.whenOnlineUserChange = function () {
};
this.warrings = function() {
};
}
//登录
IMService.prototype.login = function (uuid, name, avatar) {
//初始化当前用户
this.currentUser = new CurrentUser(uuid, name, avatar);
//初始化联系人信息,包括群
this.initialContacts();
return true;
};
//初始化联系人信息
IMService.prototype.initialContacts = function (friendList) {
//查询并初始化好友信息
// let friendList = restApi.findFriends(this.currentUser);
let value = uni.getStorageSync('imlist');
console.log(value)
if(value != undefined && !value){
return ;
}
value = JSON.parse(value)
let that = this
console.log(value)
for(let i of value){
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId:i[0]
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
console.log(res)
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2],i[3]);
console.log(that.friends)
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date && b.unReadMessage == 0){
return 0;
}else{
return 1;
}
}
friends.sort(paixu)
}
that.friendsarr = []
for(let i in that.friends){
console.log(i)
that.friendsarr.push(that.friends[i])
}
sorts(that.friendsarr)
console.log("历史记录")
that.onFriendListChange(that.friends);
}
})
}
//将用户列表初始化为一个map便于后续根据friendId得到friend
// friendList.map(friend => {
// this.friends[friend.uuid] = new Friend(friend.uuid, friend.name, friend.avatar);
// });
//查询并初始化与自己相关的群信息
// let groupList = restApi.findGroups(this.currentUser);
// //将群列表初始化为一个map方便后续根据groupId索引
// groupList.map(group => {
// this.groups[group.uuid] = new Group(group.uuid, group.name, group.avatar);
// });
};
//获取群成员
IMService.prototype.getGroupMembers = function (groupId) {
let members = restApi.findGroupMembers(groupId);
let membersMap = {};
members.map(item => {
membersMap[item.uuid] = item
});
return membersMap;
};
IMService.prototype.getGroupMessages = function (groupId) {
if (!this.groupMessages[groupId]) {
this.groupMessages[groupId] = {
sentMessages:[],
pendingMessages:[]
};
}
return this.groupMessages[groupId]
};
IMService.prototype.getPrivateMessages = function (friendId) {
if (!this.privateMessages[friendId]) {
this.privateMessages[friendId] = {
sentMessages:[],
pendingMessages:[]
};
}
return this.privateMessages[friendId]
};
//重置群聊未读消息
IMService.prototype.resetGroupUnReadMessage = function (group) {
this.groups[group.uuid].unReadMessage = 0;
this.onGroupListChange(this.groups);
};
//将好友的未读消息数字清零
IMService.prototype.resetFriendUnReadMessage = function (friend) {
if(friend && friend.uuid){
this.friends[friend.uuid].unReadMessage = 0;
}
this.onFriendListChange(this.friends);
};
//连接GoEasy
IMService.prototype.connectIM = function () {
//初始化IM相关的监听器
try {
this.initialIMListeners();
} catch (error) {
console.log(123)
}
try {
this.im.connect({
id: this.currentUser.uuid,
data: {
avatar: this.currentUser.avatar,
name: this.currentUser.name
}
}).then(() => {
console.log('连接成功')
//订阅与自己相关的群信息
this.subscribeGroupMessage();
//初始化好友们的在线状态
this.initialFriendOnlineStatus();
//订阅我的好友们的上下线信息
this.subscribeFriendsPresence();
}).catch(error => {
console.log('连接失败,请确保网络正常appkey和host正确code:' + error.code + " content:" + error.content);
});
} catch (error) {
console.log(12323)
}
};
//IM监听
IMService.prototype.initialIMListeners = function () {
this.im.on(GoEasyIM.EVENT.CONNECTED, () => {
console.log('连接成功.')
});
this.im.on(GoEasyIM.EVENT.DISCONNECTED, () => {
console.log('连接断开.')
});
//监听好友上下线
this.im.on(GoEasyIM.EVENT.USER_PRESENCE, (user) => {
console.log(user)
//更新好友在线状态
let onlineStatus = user.action == 'online' ? true : false;
let friend = this.friends[user.userId];
friend.online = onlineStatus;
//如果页面传入了相应的listener执行listener
this.onFriendListChange(this.friends);
});
//监听私聊消息
this.im.on(GoEasyIM.EVENT.PRIVATE_MESSAGE_RECEIVED, (message) => {
console.log(message)
if(message.senderId == 0){
console.log(message.payload.text)
this.warrings(JSON.parse(message.payload.text))
return;
}
//如果不是自己发的,朋友未读消息数 +1
if (message.senderId != this.currentUser.uuid) {
let friend = this.friends[message.senderId];
console.log(friend)
// return ;
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date && b.unReadMessage == 0){
return 0;
}else{
return 1;
}
}
friends.sort(paixu)
}
if(message.senderId != this.uid){
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = music;
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
}
let that = this
if(!friend && friend == undefined){
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId:message.senderId
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
console.log(res)
that.friends[message.senderId] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar);
friend = that.friends[message.senderId];
console.log(friend)
friend.unReadMessage++;
friend.text = message.type != "text" ? "其他消息" : message.payload.text
let time = new Date(message.timestamp)
friend.date = message.timestamp
friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds())
console.log(that.friends)
that.friendsarr = []
for(let i in that.friends){
console.log(i)
that.friendsarr.push(that.friends[i])
}
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
let value = uni.getStorageSync('imlist');
console.log(value)
that.onFriendListChange(that.friends);
}
})
}else{
console.log(friend)
friend.unReadMessage++;
friend.text = message.type != "text" ? "其他消息" : message.payload.text
let time = new Date(message.timestamp)
friend.date = message.timestamp
friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds())
console.log(this.friends)
that.friendsarr = []
for(let i in this.friends){
that.friendsarr.push(this.friends[i])
}
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
let value = uni.getStorageSync('imlist');
console.log(value)
this.onFriendListChange(this.friends);
}
// let value = uni.getStorageSync('imlist');
// value = JSON.parse(value)
// if(value.indexOf(message.senderId) == -1){
// value.unshift(message.senderId)
// }
// uni.setStorageSync('imlist',JSON.stringify(value))
}
//更新私聊消息记录
let friendId;
if (this.currentUser.uuid == message.senderId) {
friendId = message.receiverId;
} else {
friendId = message.senderId;
}
removePrivatePendingMessage(this, friendId, message);
let friendMessages = this.getPrivateMessages(friendId);
friendMessages.sentMessages.push(message);
//如果页面传入了相应的listener执行listener
this.onNewPrivateMessageReceive(friendId, message);
});
// //监听群聊消息
// this.im.on(GoEasyIM.EVENT.GROUP_MESSAGE_RECEIVED, (message) => {
// let groupId = message.groupId;
// //群未读消息+1
// let group = this.groups[groupId];
// group.unReadMessage++;
// removeGroupPendingMessage(this, groupId, message);
// //如果页面传入了相应的listener执行listener
// this.onGroupListChange(this.groups);
// //更新群聊消息记录
// let groupMessages = this.getGroupMessages(groupId);
// let sentMessages = groupMessages.sentMessages;
// sentMessages.push(message);
// //如果页面传入了相应的listener执行listener
// this.onNewGroupMessageReceive(groupId, message);
// })
};
IMService.prototype.sendMessagesSetStorage = function (friendId,message){
let friend = this.friends[friendId];
console.log(friend)
// return ;
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date && b.unReadMessage == 0){
return 0;
}else{
return 1;
}
}
friends.sort(paixu)
}
let that = this
if(!friend && friend == undefined){
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId:friendId
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
console.log(res)
that.friends[friendId] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar);
friend = that.friends[friendId];
console.log(friend)
friend.text = message
let time = new Date()
friend.date = time.getTime()
friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds())
console.log(that.friends)
that.friendsarr = []
for(let i in that.friends){
console.log(i)
that.friendsarr.push(that.friends[i])
}
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,0])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
that.onFriendListChange(that.friends);
}
})
}else{
console.log(friend)
friend.text = message
let time = new Date()
friend.date = time.getTime()
friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds())
console.log(this.friends)
that.friendsarr = []
for(let i in this.friends){
that.friendsarr.push(this.friends[i])
}
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,0])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
this.onFriendListChange(this.friends);
}
}
//订阅群消息
IMService.prototype.subscribeGroupMessage = function (id) {
this.im.subscribeGroup([id])
.then(() => {
console.log('订阅群消息成功')
})
.catch(error => {
console.log('订阅群消息失败')
console.log(error)
})
};
//初始化好友在线状态
IMService.prototype.initialFriendOnlineStatus = function () {
let friendIds = Object.keys(this.friends);
this.im.hereNow({
userIds: friendIds
}).then(result => {
let onlineFriends = result.content;
onlineFriends.map(user => {
let friend = this.friends[user.userId];
friend.online = true;
});
this.onFriendListChange(this.friends);
}).catch(error => {
console.log(error)
if (error.code == 401) {
console.log("获取在线用户失败您尚未开通用户在线状态请登录GoEasy查看应用详情里自助启用.");
}
})
};
//监听所有好友上下线
IMService.prototype.subscribeFriendsPresence = function () {
let friendIds = Object.keys(this.friends);
this.im.subscribeUserPresence(friendIds)
.then(() => {
console.log('监听好友上下线成功')
})
.catch(error => {
console.log(error);
if (error.code == 401) {
console.log("监听好友上下线失败您尚未开通用户状态提醒请登录GoEasy查看应用详情里自助启用.");
}
});
};
//加载单聊历史消息
IMService.prototype.loadPrivateHistoryMessage = function (friendId, timeStamp) {
this.im.history({
friendId: friendId,
lastTimestamp: timeStamp
}).then(result => {
let history = result.content;
let privateMessages = this.getPrivateMessages(friendId);
let friendMessages = privateMessages.sentMessages;
for (let i = history.length - 1; i >=0; i--) {
friendMessages.unshift(history[i])
}
//如果页面传入了相应的listener执行listener
this.onPrivateHistoryLoad(friendId, history);
}).catch(error => {
console.log(error);
if (error.code == 401) {
console.log("您尚未开通历史消息请登录GoEasy查看应用详情里自助启用.");
}
})
};
//发送私聊消息
IMService.prototype.sendPrivateTextMessage = function (friendId, text) {
let textMessage = this.im.createTextMessage({
text: text
});
this.sendPrivateMessage(friendId, textMessage);
this.sendMessagesSetStorage(friendId, text)
};
//私聊图片消息
IMService.prototype.sendPrivateImageMessage = function (friendId, imageFile) {
let imageMessage = this.im.createImageMessage({
file: imageFile,
onProgress :function (progress) {
console.log(progress)
}
});
this.sendPrivateMessage(friendId, imageMessage);
this.sendMessagesSetStorage(friendId, '其他消息')
};
//私聊视频消息
IMService.prototype.sendPrivateVideoMessage = function (friendId, videoFile) {
let videoMessage = this.im.createVideoMessage({
file: videoFile,
onProgress :function (progress) {
console.log(progress)
}
});
this.sendPrivateMessage(friendId, videoMessage);
this.sendMessagesSetStorage(friendId, '其他消息')
};
IMService.prototype.sendPrivateAudioMessage = function (friendId, audiofile) {
let audioMessage = this.im.createAudioMessage({
file: audiofile,
onProgress :function (progress) {
console.log(progress)
}
});
this.sendPrivateMessage(friendId, audioMessage);
this.sendMessagesSetStorage(friendId, '其他消息')
};
//发送私聊消息
IMService.prototype.sendPrivateMessage = function (friendId, message) {
//加入pendingMessage列表成功后将会被挪除
let privateMessages = this.getPrivateMessages(friendId);
privateMessages.pendingMessages.push(message);
//发送
this.im.sendPrivateMessage(friendId, message)
.then((res) => {
console.log(res)
})
.catch(e => {
console.log(e)
})
};
//发送群聊消息
IMService.prototype.sendGroupTextMessage = function (groupId, message) {
let textMessage = this.im.createTextMessage({
text:message
});
this.sendGroupMessage(groupId, textMessage);
};
//私聊图片消息
IMService.prototype.sendGroupImageMessage = function (groupId, imageFile) {
let imageMessage = this.im.createImageMessage({
file: imageFile,
onProgress :function (progress) {
console.log(progress)
}
});
this.sendGroupMessage(groupId, imageMessage);
};
//私聊视频消息
IMService.prototype.sendGroupVideoMessage = function (groupId, videoFile) {
let videoMessage = this.im.createVideoMessage({
file: videoFile,
onProgress :function (progress) {
console.log(progress)
}
});
this.sendGroupMessage(groupId, videoMessage);
};
IMService.prototype.sendGroupAudioMessage = function (groupId, audioFile) {
let audioMessage = this.im.createAudioMessage({
file: audioFile,
onProgress :function (progress) {
console.log(progress)
}
});
this.sendGroupMessage(groupId, audioMessage);
};
IMService.prototype.sendGroupMessage =function(groupId, groupMessage) {
//先放入Pending列表待成功后挪除
let groupMessages = this.getGroupMessages(groupId);
let pendingMessages = groupMessages.pendingMessages;
pendingMessages.push(groupMessage)
this.im.sendGroupMessage(groupId, groupMessage)
.then((res) => {
console.log(res)
})
.catch(e => {
console.log(e)
})
}
//群聊历史消息
IMService.prototype.loadGroupHistoryMessage = function (groupId, timeStamp) {
this.im.history({
groupId: groupId,
lastTimestamp: timeStamp
}).then(result => {
let history = result.content;
let groupMessages = this.getGroupMessages(groupId);
let sentGroupMessages = groupMessages.sentMessages;
for (let i = history.length - 1; i >= 0; i--) {
sentGroupMessages.unshift(history[i]);
}
this.onGroupHistoryLoad(groupId, history);
}).catch(error => {
console.log(error)
if (error.code == 401) {
console.log("您尚未开通历史消息请登录GoEasy查看应用详情里自助启用.");
}
})
};
IMService.prototype.disconnect = function () {
this.im.disconnect()
};
function removePrivatePendingMessage(imService,friendId, message){
let privateMessages = imService.getPrivateMessages(friendId);
let pendingMessages = privateMessages.pendingMessages;
let pendingMessageIndex = pendingMessages.findIndex(item => item.messageId == message.messageId);
if(pendingMessageIndex > -1) {
pendingMessages.splice(pendingMessageIndex,1);
}
}
function removeGroupPendingMessage(imService,groupId, message){
let groupMessages = imService.getGroupMessages(groupId);
let pendingMessages = groupMessages.pendingMessages;
let pendingMessageIndex = pendingMessages.findIndex(item => item.messageId == message.messageId);
if(pendingMessageIndex > -1) {
pendingMessages.splice(pendingMessageIndex,1);
}
}
//下面是合并的
//用户
function User(id, nickname, avatar) {
this.id = id;
this.nickname = nickname;
this.avatar = avatar;
}
//消息
function Message(senderUserId, senderNickname, content, type) {
this.senderNickname = senderNickname;
this.senderUserId = senderUserId;
this.content = content;
this.type = type
}
//聊天室
function Room(id, name, currentUser) {
this.id = id;
this.name = name;
this.currentUser = currentUser;
this.onlineUsers = {
count: 0,
users: []
};
this.messages = [];
this.MessageType = {
CHAT: 0,//文字聊天
PROP: 1//道具
};
this.Prop = {
HEART: 0,//桃心
ROCKET: 1//火箭
};
}
IMService.prototype.initialWhenNewMessage = function (whenNewMessage) {
this.whenNewMessage = whenNewMessage;
};
IMService.prototype.initialWhenOnlineUserChange = function (whenOnlineUserChange) {
this.whenOnlineUserChange = whenOnlineUserChange;
};
//监听新消息
IMService.prototype.listenerNewMessage = function () {
this.im.on(GoEasyIM.EVENT.GROUP_MESSAGE_RECEIVED, (message) => {
console.log(message)
if(message.senderId == 0){
return ;
}
var content = JSON.parse(message.payload.text);
this.addNewMessage(message);
this.whenNewMessage(content);
})
}
IMService.prototype.addNewMessage = function (message) {
var content = JSON.parse(message.payload.text);
let messageContent = "";
//聊天消息
if (content.type == this.room.MessageType.CHAT) {
messageContent = content.content;
}
//道具消息
if (content.type == this.room.MessageType.PROP) {
if (content.content == this.room.Prop.ROCKET) {
messageContent = "送出了一枚大火箭";
}
if (content.content == this.room.Prop.HEART) {
messageContent = "送出了一个大大的比心";
}
}
//添加消息
let newMessage = new Message(message.senderId, content.senderNickname, messageContent);
this.room.messages.push(newMessage);
};
//监听用户上下线
IMService.prototype.listenerGroupPresence = function () {
this.im.on(GoEasyIM.EVENT.GROUP_PRESENCE, (event) => {
//更新在线用户数
this.room.onlineUsers.count = event.groupOnlineCount;
if (event.action == 'join' || event.action == 'online') {
let userData = JSON.parse(event.userData);
//添加新用户
let user = new User(event.userId, userData.nickname, userData.avatar);
//添加在线用户,避免用户重复
if (!this.room.onlineUsers.users.find(item => item.id == event.userId)) {
this.room.onlineUsers.users.push(user);
}
//添加进入房间的消息
let message = new Message(event.userId, userData.nickname, " 进入房间", this.room.MessageType.CHAT);
this.room.messages.push(message);
} else {
let offlineUserIndex = this.room.onlineUsers.users.findIndex(item => item.id == event.userId);
if (offlineUserIndex > -1) {
//将离开的用户从onlineUsers中删掉
let offlineUser = Object.assign(this.room.onlineUsers.users[offlineUserIndex]);
this.room.onlineUsers.users.splice(offlineUserIndex, 1);
//添加离开消息
let message = new Message(offlineUser.id, offlineUser.nickname, " 离开房间", this.room.MessageType.CHAT)
this.room.messages.push(message);
}
}
this.whenOnlineUserChange(this.room.onlineUsers);
})
};
//查询和初始化在线用户列表和在线用户数
IMService.prototype.initialOnlineUsers = function (roomId) {
let self = this;
//查询最新上线的用户列表
this.im.groupHereNow(roomId)
.then(result => {
if (result.code == 200) {
let users = [];
result.content && result.content.map(function (onlineUser) {
let userData = JSON.parse(onlineUser.userData);
let user = new User(onlineUser.userId, userData.nickname, userData.avatar);
users.push(user);
});
self.room.onlineUsers = {
users: users
};
}
}).catch(e => {
if (e.code == 401) {
console.log("您还没有开通用户在线状态提醒登录goeasy->我的应用->查看详情->高级功能,自助开通.");
} else {
console.log(e);
}
});
//获取聊天室在线用户数
this.im.groupOnlineCount(roomId)
.then(result => {
this.room.onlineUsers.count = result.content.onlineCount;
}).catch(e => {
console.log(e)
})
};
//订阅聊天室成员上下线
IMService.prototype.subscribePresence = function (roomId) {
this.im.subscribeGroupPresence([roomId])
.then(() => {
console.log('成员上下线订阅成功')
}).catch(e => {
console.log(e)
})
}
//订阅聊天室消息
IMService.prototype.subscribeRoomMessage = function (room, user) {
this.room = new Room(room.id, room.name, user);
//监听上下线提醒
this.listenerGroupPresence();
//监听新消息
this.listenerNewMessage();
//订阅用户上下线事件
this.subscribePresence(this.room.id);
//订阅聊天室消息
// this.subscribeRoomMessage(this.room.id);
this.im.subscribeGroup([this.room.id])
.then(result => {
console.log('消息订阅成功')
}).catch(e => {
console.log(e,'失败')
})
}
//历史消息
IMService.prototype.initialChatHistory = function (roomId) {
var self = this;
this.im.history({
groupId: roomId
}).then(res => {
res.content.forEach(function (message) {
self.addNewMessage(message);
})
}).catch(function (error) {
if (error.code == 401) {
console.log("您还没有开通历史消息的权限登录goeasy->我的应用->查看详情->高级功能,自助开通.");
} else {
console.log(error);
}
})
};
//发送消息
IMService.prototype.sendMessages = function (roomId, content) {
var contentMessage = {
text: JSON.stringify(content)
};
let message = this.im.createTextMessage(contentMessage);
this.im.sendGroupMessage(roomId, message)
.then(() => {
console.log('消息发送成功')
}).catch(e => {
console.log(e);
})
};
//退出聊天室
IMService.prototype.quitRoom = function (roomId) {
this.im.disconnect()
};
export default IMService;

BIN
static/music.mp3 Normal file

Binary file not shown.

79
static/restapi.js Normal file
View File

@@ -0,0 +1,79 @@
//用户数据示例
let users = [
{
"uuid": "08c0a6ec-a42b-47b2-bb1e-15e0f5f9a19a",
"name": "Mattie",
"password": "123",
"avatar": '../../static/images/Avatar-1.png'
},
{
"uuid": "3bb179af-bcc5-4fe0-9dac-c05688484649",
"name": "Wallace",
"password": "123",
"avatar": '../../static/images/Avatar-2.png'
},
{
"uuid": "fdee46b0-4b01-4590-bdba-6586d7617f95",
"name": "Tracy",
"password": "123",
"avatar": '../../static/images/Avatar-3.png'
},
{
"uuid": "33c3693b-dbb0-4bc9-99c6-fa77b9eb763f",
"name": "Juanita",
"password": "123",
"avatar": '../../static/images/Avatar-4.png'
}
];
//群数据示例
let groups = [
{
"uuid": "group-a42b-47b2-bb1e-15e0f5f9a19a",
"name": "群1",
"userList": ['08c0a6ec-a42b-47b2-bb1e-15e0f5f9a19a', '3bb179af-bcc5-4fe0-9dac-c05688484649', 'fdee46b0-4b01-4590-bdba-6586d7617f95', '33c3693b-dbb0-4bc9-99c6-fa77b9eb763f']
},
{
"uuid": "group-4b01-4590-bdba-6586d7617f95",
"name": "群2",
"userList": ['08c0a6ec-a42b-47b2-bb1e-15e0f5f9a19a', 'fdee46b0-4b01-4590-bdba-6586d7617f95', '33c3693b-dbb0-4bc9-99c6-fa77b9eb763f']
},
{
"uuid": "group-dbb0-4bc9-99c6-fa77b9eb763f",
"name": "群3",
"userList": ['08c0a6ec-a42b-47b2-bb1e-15e0f5f9a19a', '3bb179af-bcc5-4fe0-9dac-c05688484649']
}
];
function RestApi() {
}
RestApi.prototype.findFriends = function (user) {
var friendList = users.filter(v => v.uuid != user.uuid);
return friendList;
}
RestApi.prototype.findGroups = function (user) {
var groupList = groups.filter(v => v.userList.find(id => id == user.uuid));
return groupList;
}
RestApi.prototype.findUser = function (username, password) {
var user = users.find(user => (user.name == username && user.password == password))
return user;
}
RestApi.prototype.findGroupMembers = function (groupId) {
let members = [];
let group = groups.find(v => v.uuid == groupId);
users.map(user => {
if (group.userList.find(v => v == user.uuid)) {
members.push(user)
}
});
return members;
}
export default new RestApi();

BIN
static/videoPlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB