131 Commits

Author SHA1 Message Date
fc86ad2579 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-07 11:41:03 +08:00
eb0d648f6a 完成 2020-08-07 11:40:13 +08:00
gyh
71e984b2ed Merge pull request 'gdpaoup' (#127) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/127
2020-08-06 20:46:53 +08:00
Gdpao
2afd55f79e gdpaomg 2020-08-06 20:46:40 +08:00
Gdpao
090b7cc753 gdpaoup 2020-08-06 20:42:03 +08:00
c56743765c Merge pull request 'upgrade 8.6' (#126) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/126
2020-08-06 17:53:11 +08:00
1a1a0de460 upgrade 8.6 2020-08-06 17:52:25 +08:00
24410d0ee7 Merge pull request 'xbx' (#125) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/125
2020-08-06 16:25:31 +08:00
9f444ad070 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-06 16:24:49 +08:00
e11f20885f 完成 2020-08-06 16:22:40 +08:00
e6b7b50a1e 聊天本地缓存 2020-08-06 15:57:56 +08:00
201f858833 Merge pull request 'refund 8.6' (#124) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/124
2020-08-06 10:51:00 +08:00
8bf42a75dd Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into zhy 2020-08-06 10:50:11 +08:00
9054432b59 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-06 10:49:27 +08:00
2c6cdbead9 Merge branch 'zhy' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-06 10:48:46 +08:00
2cb8f90281 refund 8.6 2020-08-06 10:48:21 +08:00
79d8f91769 Merge pull request 'xbx' (#123) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/123
2020-08-06 10:48:03 +08:00
2a8ee65a94 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-06 10:45:18 +08:00
9872770472 Merge branch 'zmr' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-06 10:45:03 +08:00
7a7b126fe3 聊天 2020-08-06 10:40:26 +08:00
gyh
b158080eb7 Merge pull request 'gdpaoup' (#122) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/122
2020-08-06 10:37:14 +08:00
Gdpao
046f2e50c5 gdpaoup 2020-08-06 10:35:59 +08:00
Niujiawei
1313a90d5e 修改样式 2020-08-05 22:44:08 +08:00
Niujiawei
ed0edbab2f 修改样式 2020.08.05 2020-08-05 22:06:09 +08:00
Niujiawei
361e9a76fd 修改样式等相关文件 2020-08-05 21:39:02 +08:00
gyh
720af35b11 Merge pull request 'gdpaoup' (#120) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/120
2020-08-05 21:11:49 +08:00
Gdpao
1b5bf33166 gdpaomg 2020-08-05 21:11:32 +08:00
Gdpao
c4c11781fb gdpaoup 2020-08-05 21:06:29 +08:00
e1519b8d68 Merge pull request 'store 8.5' (#119) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/119
2020-08-05 17:40:03 +08:00
0057bcd28e store 8.5 2020-08-05 17:38:11 +08:00
9881ea099d Merge pull request 'xbx' (#118) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/118
2020-08-05 17:01:52 +08:00
b0f224d79b 聊天列表 2020-08-05 17:00:04 +08:00
045f6e6e01 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-05 10:47:18 +08:00
09a7dbdf5c 1 2020-08-05 10:47:08 +08:00
gyh
a47238a7a4 Merge pull request 'gdpaoup3' (#117) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/117
2020-08-04 23:14:02 +08:00
Gdpao
0a2441b1a9 gdpaoup3 2020-08-04 23:13:28 +08:00
gyh
c035566fe4 Merge pull request '修改样式2020.0804' (#116) from zmr into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/116
2020-08-04 22:41:58 +08:00
Niujiawei
ef4a4010ff 修改样式2020.0804 2020-08-04 22:34:03 +08:00
gyh
df29f86630 Merge pull request 'gdpaoup2' (#115) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/115
2020-08-04 22:15:29 +08:00
Gdpao
7b9bee2f1e gdpaoup2 2020-08-04 22:13:50 +08:00
gyh
42d39fb4c3 Merge pull request 'gdpaoup' (#114) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/114
2020-08-04 21:50:39 +08:00
Gdpao
6ed05ecf31 gdpaoup 2020-08-04 21:50:12 +08:00
Gdpao
692495f108 gdpaoup 2020-08-04 21:46:52 +08:00
8cd7c3d0a0 Merge pull request 'upgrade 8.4' (#113) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/113
2020-08-04 21:14:42 +08:00
5343196342 upgrade 8.4 2020-08-04 21:13:47 +08:00
dbb7a91330 Merge pull request 'upgrade 9.4' (#112) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/112
2020-08-04 20:11:57 +08:00
fe9a54987e upgrade 8.4 2020-08-04 20:11:45 +08:00
f6c6ffa176 upgrade 8.4 2020-08-04 20:09:21 +08:00
396bb37c94 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into zhy 2020-08-04 20:03:05 +08:00
13bdc08c86 upgrade 9.4 2020-08-04 20:00:58 +08:00
gyh
43845b4810 Merge pull request 'gdpao' (#111) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/111
2020-08-04 19:47:48 +08:00
Gdpao
cc934696d1 gdpaoup 2020-08-04 19:46:42 +08:00
Gdpao
afc7731781 gdpao 2020-08-04 19:39:31 +08:00
1f9299602e Merge pull request 'classify 8.4' (#110) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/110
2020-08-04 19:10:00 +08:00
2fd62acb73 classify 8.4 2020-08-04 19:08:04 +08:00
gyh
f69a82ace5 Merge pull request 'gdpaoup' (#109) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/109
2020-08-04 14:38:17 +08:00
Gdpao
1f5af9d92b gdpaoup 2020-08-04 14:36:35 +08:00
20ba2e4e8f Merge pull request '人数' (#108) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/108
2020-08-04 11:44:41 +08:00
2a946145e9 Merge branch 'master' into xbx 2020-08-04 11:44:28 +08:00
e354152beb 人数 2020-08-04 11:43:33 +08:00
f83048e5c6 Merge pull request 'rid' (#107) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/107
2020-08-04 10:42:49 +08:00
20b1c0da43 Merge branch 'master' into xbx 2020-08-04 10:42:38 +08:00
35e0c39d1d rid 2020-08-04 10:41:54 +08:00
gyh
1e9f442b7b Merge pull request 'gdpaoup3' (#106) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/106
2020-08-03 21:42:24 +08:00
Gdpao
48b7219954 gdpaoup3 2020-08-03 21:40:22 +08:00
715793414f Merge pull request 'time none8.3' (#105) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/105
2020-08-03 21:00:41 +08:00
0a52842e35 time none8.3 2020-08-03 20:59:24 +08:00
gyh
0ee518854c Merge pull request 'gdpaoup2' (#104) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/104
2020-08-03 19:52:53 +08:00
4416b76d96 Merge pull request 'kuandu' (#103) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/103
2020-08-03 19:51:35 +08:00
5e22f0429c Merge branch 'master' into xbx 2020-08-03 19:51:22 +08:00
Gdpao
38f92c6766 gdpaoup2 2020-08-03 19:51:05 +08:00
95f893a277 kuandu 2020-08-03 19:50:56 +08:00
f63594706f Merge pull request 'z8.3' (#102) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/102
2020-08-03 18:39:12 +08:00
d54a378a9e z8.3 2020-08-03 18:38:04 +08:00
6a361e3245 Merge pull request 'xbx' (#101) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/101
2020-08-03 15:57:46 +08:00
b070a559dc 直播 2020-08-03 15:56:51 +08:00
b146783790 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-03 14:42:23 +08:00
335f4c5564 修改顺序 2020-08-03 14:41:49 +08:00
0bc6be9b9f Merge pull request 'z8.3' (#100) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/100
2020-08-03 14:39:38 +08:00
gyh
0266a556d9 Merge pull request 'gdpaoup' (#99) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/99
2020-08-03 14:38:20 +08:00
Gdpao
51cd6f8261 gdpaoup 2020-08-03 14:37:02 +08:00
af768bff80 z8.3 2020-08-03 14:34:56 +08:00
gyh
c118eced7f Merge pull request 'gdpao' (#98) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/98
2020-08-03 14:31:20 +08:00
Gdpao
11865d4068 gdpao 2020-08-03 14:26:52 +08:00
bb4f3b2918 Merge pull request 'xbx' (#97) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/97
2020-08-03 10:36:49 +08:00
8727ae913d Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-08-03 10:35:41 +08:00
1da6974fe3 直播 2020-08-03 10:34:06 +08:00
bd996de410 goeasy 2020-08-03 09:05:30 +08:00
gyh
7ae10c200d Merge pull request 'gdpao' (#96) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/96
2020-08-01 17:24:12 +08:00
Gdpao
8a213ba094 gdpao 2020-08-01 17:22:46 +08:00
1c16a85e18 Merge pull request '8.1' (#95) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/95
2020-08-01 17:18:21 +08:00
4ef16728f9 8.1 2020-08-01 17:17:37 +08:00
680fa48e85 Merge pull request 'comment 8.1' (#94) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/94
2020-08-01 16:37:27 +08:00
854976c8f0 comment 8.1 2020-08-01 16:36:48 +08:00
gyh
223dd51db7 Merge pull request 'update' (#93) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/93
2020-08-01 11:20:41 +08:00
Gdpao
5b31193750 update 2020-08-01 11:16:53 +08:00
865e2a741a Merge pull request 'order comment 7.31' (#92) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/92
2020-07-31 21:52:01 +08:00
48722ef768 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into zhy 2020-07-31 21:49:05 +08:00
ff7c6b358d order comment 7.31 2020-07-31 21:47:41 +08:00
gyh
c9c7e08a8d Merge pull request 'gyh change' (#90) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/90
2020-07-31 10:08:00 +08:00
Gdpao
f30c4f4922 gdpaoup 2020-07-31 10:07:37 +08:00
Gdpao
ea10c99cd1 gdpao 2020-07-31 09:59:22 +08:00
ba2cab7950 Merge pull request 'xbx' (#91) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/91
2020-07-31 09:41:50 +08:00
2ec14481fd Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-07-31 09:40:18 +08:00
b9b8384011 修正错误 2020-07-31 09:40:06 +08:00
Gdpao
d817d0c28b gyh change 2020-07-31 08:45:30 +08:00
cdd0105acb Merge pull request 'adv 7.30' (#89) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/89
2020-07-30 20:34:06 +08:00
6d00107944 adv 7.30 2020-07-30 20:33:16 +08:00
04adc72d92 Merge pull request 'send wash 7.29' (#88) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/88
2020-07-29 19:01:59 +08:00
120e062fcd send wash 7.29 2020-07-29 19:01:10 +08:00
gyh
2851c8e0b2 Merge pull request 'gyhup' (#87) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/87
2020-07-29 15:38:31 +08:00
Gdpao
8bb1cdfd39 gyhup 2020-07-29 15:04:57 +08:00
f21df2f107 Merge pull request 'xbx' (#86) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/86
2020-07-28 20:49:57 +08:00
ee08038a64 Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-07-28 20:49:21 +08:00
280915560d Merge pull request 'send 7.28' (#85) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/85
2020-07-28 20:48:10 +08:00
41f4050768 直播 2020-07-28 20:47:52 +08:00
b12a3c1722 send 7.28 2020-07-28 20:47:31 +08:00
4004f3715b Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx 2020-07-27 18:02:22 +08:00
208f27aa93 Merge pull request 'loadmore 7.27' (#84) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/84
2020-07-27 18:01:21 +08:00
6eabd3a575 loadmore 7.27 2020-07-27 17:59:47 +08:00
2ea9b89acc 直播 2020-07-27 17:32:17 +08:00
100f31c6f9 Merge pull request 'lxb' (#83) from lxb into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/83
2020-07-27 14:40:40 +08:00
b2d284f666 直播列表 2020-07-27 14:35:32 +08:00
dbafe8b4c1 Merge pull request 'order 7.25' (#82) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/82
2020-07-25 17:51:40 +08:00
185f5979b6 order 7.25 2020-07-25 17:51:01 +08:00
410a7850e6 Merge pull request 'order 7.25' (#81) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/81
2020-07-25 15:18:30 +08:00
c931e87209 order 7.25 2020-07-25 15:17:52 +08:00
94636380f1 Merge pull request 'comment 7.24' (#80) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/80
2020-07-24 20:36:00 +08:00
5abb3f2496 comment 7.24 2020-07-24 20:35:28 +08:00
a1b14b4f5e Merge pull request 'comment 7.24' (#79) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/79
2020-07-24 19:50:24 +08:00
dd71a0f32a comment 7.2 2020-07-24 19:48:57 +08:00
161 changed files with 10102 additions and 2866 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
/node_modules/*
unpackage
manifest.json
deming.keystore

40
App.vue
View File

@@ -1,6 +1,44 @@
<script>
export default {}
import { mapMutations, mapState } from 'vuex';
export default {
computed: {
...mapState(["hasLogin"])
},
onLaunch() {
// 缓存token
uni.getStorage({
key: "token",
success: (res) => {
this.loginIn(res.data);
}
})
// 刷新token
if (this.hasLogin) {
this.refreshToken_function();
}
},
methods: {
...mapMutations(['loginIn']),
// 刷新token
refreshToken_function(){
this.$u.api.refreshToken({}).then((res) => {
// console.log(res);
if (res.errCode == 0) {
let token = res.data.token;
uni.setStorageSync('token', token);//存储toke值
}
})
},
}
}
</script>
<style lang="scss">
/* #ifndef APP-PLUS-NVUE */
@import "/static/css/normalize";
/* 顶部自定义导航留白 */
.status_bar {
width: 100%;
height: var(--status-bar-height);
}
/* #endif */
</style>

View File

@@ -81,6 +81,14 @@ export default {
getGoodsClassRecommend() {
return vm.$u.post('Goods/getGoodsClassRecommend');
},
// goodsListByClassId
goodsListByClassId({ gc_id, page, order }) {
return vm.$u.post('goods/goodsListByClassId', {
gc_id: gc_id,
page: page,
order: order,
});
},
// 商品推荐
getGoodsRecommend({page, gc_id}){
return vm.$u.post('Goods/getGoodsRecommend', {
@@ -165,10 +173,17 @@ export default {
goods_id: id
});
},
getStoreGoodsList({ id, page = 0}){
getStoreGoodsList({ id, page, order, gc_id }){
return vm.$u.post('Store/getStoreGoodsList', {
id: id,
page:page
page: page,
order: order,
gc_id: gc_id,
});
},
getStoreClassifyList({ id }) {
return vm.$u.post('Store/getStoreClassifyList', {
id: id
});
},
getStoreImgVideoList({id}){
@@ -253,13 +268,60 @@ export default {
tabLiveList(){
return vm.$u.post('Specialci/tabLiveList')
},
// 商城-活动广告
getStoreActivity() {
return vm.$u.post('adv/storeActivity')
},
// 获取图文视频详情
articleInfo({article_id}){
return vm.$u.post('article/articleInfo',{article_id})
},
getStoreInfo({id}){
return vm.$u.post('Store/getStoreInfo',{id})
}
},
// 评论标签+数量
getEvaluateSpec({ id }) {
return vm.$u.post('Specialci/getEvaluateSpec', {
goods_id: id,
})
},
// 获取商品评论
getAllEvalue({ goods_id, page, type }) {
return vm.$u.post('Specialci/getAllEvalue', {
goods_id: goods_id,
page: page,
type: type,
})
},
// 搜索发现列表
searchwordlist() {
return vm.$u.post('ShopSearch/searchwordlist')
},
// 提交试穿订单
saveGoodsTry({ member_name, member_mobile, area_info, address_detail, goods_id, num, store_id, appointment_time }) {
return vm.$u.post('Order/saveGoodsTry', {
member_name: member_name,
member_mobile: member_mobile,
area_info: area_info,
address_detail: address_detail,
goods_id: goods_id,
num: num,
store_id: store_id,
appointment_time: appointment_time,
})
},
// 达人上架商品
goodsShelves({live_id}){
return vm.$u.post('Specialci/goodsShelves',{live_id})
},
//
addFavoriteStore({ id }) {
return vm.$u.post('member/addFavoriteStore',{ fid: id })
},
//店家id获取用户信息
getAtwillUserInfo({ id }) {
return vm.$u.post('Specialci/getAtwillUserInfo',{ store_id: id })
},
}
}

View File

@@ -175,9 +175,10 @@ export default {
return vm.$u.post('Member/getFavoritesList', params);
},
// 取消收藏(商品/店铺)
removeFavorite({ id }) {
removeFavorite({ id, type }) {
return vm.$u.post('Member/removeFavorite', {
id: id,
fav_id: id,
type: type,
});
},
// 设置-用户信息
@@ -230,15 +231,22 @@ export default {
});
},
// 订单列表
getOrderList({ page, type, refund_state }) {
getOrderList({ page, type }) {
let params = { page: page };
if(type >= 0 || typeof type == 'string') Object.assign(params, {state_type: type});
if(refund_state) Object.assign(params, {refund_state: refund_state});
if(type > 0) Object.assign(params, {type: type});
return vm.$u.post('Order/orderList', params);
},
// 售后列表
getAfterSaleList({ page }) {
return vm.$u.post('order/afterSaleList', { page: page });
// getAfterSaleList({ page }) {
// return vm.$u.post('order/afterSaleList', { page: page });
// },
// 试穿列表
goodsTryOrderList() {
return vm.$u.post('order/goodsTryOrderList');
},
// 试穿订单确认完成
goodsTryConfirm({ id }) {
return vm.$u.post('order/goodsTryConfirm', { id: id });
},
// 订单详情
getOrderInfo({ order_id }) {
@@ -250,6 +258,16 @@ export default {
if(msg) Object.assign(params, {msg: msg});
return vm.$u.post('Order/buyer_cancel', params);
},
// add_refund
refundOrder({ order_id, goods_id, goods_num, reason_info, refund_amount } = {}) {
return vm.$u.post('order/add_refund', {
order_id: order_id,
goods_id: goods_id,
refund_amount: refund_amount,
goods_num: goods_num,
reason_info: reason_info,
});
},
// 删除订单
deleteOrder({ order_id }) {
return vm.$u.post('order/order_delete', { order_id: order_id });
@@ -262,6 +280,9 @@ export default {
getOrderEvaluateInfo({ id }) {
return vm.$u.post('Order/getOrderEvaluateInfo', { id: id });
},
orderLogistics({ id }) {
return vm.$u.post('Order/orderLogistics', { order_id: id });
},
// 订单评价/修改评价
updateOrderEvaluate({ id, content, scores_one, scores_two, scores_three, file }) {
let params = {
@@ -326,6 +347,70 @@ export default {
code: code,
});
},
// 送洗列表-平台订单 实体店订单
sendLaundryOrderList({ type, page }) {
return vm.$u.post('member/sendLaundryOrderList', {
type: type,
page: page,
});
},
// 送洗-获取衣服类型
getClothesTypeList() {
return vm.$u.post('member/getClothesTypeList');
},
// 送洗评价
sendOrderComment({ id, comment }) {
return vm.$u.post('member/sendOrderComment', {
id: id,
comment: comment,
});
},
// 送洗确认完成
sendLaundryOrderConfirm({ id }) {
return vm.$u.post('member/sendOrderConfirm', {
id: id,
});
},
// 提交送洗
sendLaundrySave({
type,
tid,
condition,
member_name,
member_phone,
area_info,
address_info,
goods_name,
order_id,
goods_id,
goods_images,
}) {
return vm.$u.post('member/sendLaundrySave', {
type: type,
tid: tid,
condition: condition,
member_name: member_name,
member_phone: member_phone,
area_info: area_info,
address_info: address_info,
goods_name: goods_name,
order_id: order_id,
goods_id: goods_id,
goods_images: goods_images,
});
},
// 送洗评论列表
sendCommentList() {
return vm.$u.post('member/sendCommentList');
},
// 发现收藏列表
articleCollectList() {
return vm.$u.post('article/articleCollectList');
},
// 关注用户列表
attentionMemberList() {
return vm.$u.post('member/attentionMemberList');
},
}
}
}

View File

@@ -3,8 +3,8 @@ const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({
baseUrl: 'https://dmmall.sdbairui.com/api',
loadingText: '努力加载中~',
loadingTime: 800
loadingTime: 800,
originalData: true
});
// 请求拦截配置Token等参数
@@ -18,6 +18,44 @@ const install = (Vue, vm) => {
}
// 响应拦截,如配置,每次请求结束都会执行本方法
Vue.prototype.$u.http.interceptor.response = (res) => {
if(parseInt(res.data.errCode) == 0) {
// res为服务端返回值可能有errCoderesult等字段
// 这里对res.result进行返回将会在this.$u.post(url).then(res => {})的then回调中的res的到
// 如果配置了originalData为true请留意这里的返回值
return res.data;
} else if(res.data.errCode == 401) {
// 假设201为token失效这里跳转登录
// vm.$u.toast('您还没有登录哦,请先去登录!');
if (res.data.action != "memberinfo") {
uni.showModal({
title: "温馨提示",
content: "您还未登录,请立即登录",
cancelText: "以后再说",
confirmText: "立即登录",
confirmColor: "#FF780F",
success(res) {
// console.log(res);
if (res.confirm) {
setTimeout(() => {
// 此为uView的方法详见路由相关文档
vm.$u.route('/pageA/login/login')
}, 500)
}
}
})
}
return false;
} else if (res.errCode == 1) {
console.log(res.message);
} else {
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值
return res;
}
}
}
export default {

View File

@@ -1,5 +1,9 @@
import Vue from 'vue'
import Vuex from 'vuex'
import {
mapMutations
} from 'vuex';
Vue.use(Vuex)
const store = new Vuex.Store({
@@ -12,10 +16,13 @@ const store = new Vuex.Store({
pintuangroup_headid: '', // 拼团团长id 有为开团 无为参团
groupbuyInfo: {}, // 秒杀详情
loadmore: {}, // 下拉加载返回的数据
hasLogin: false, // 登录状态
token: "", // 储存token
showLoginModel: false, // 登录框
},
getters: {
getOrderAddress(state) {
return state.orderAddress;
return state.orderAddress || {};
},
getGoodsType(state) {
return state.goodsDetails.type;
@@ -25,6 +32,26 @@ const store = new Vuex.Store({
}
},
mutations: {
// 登录
loginIn(state, token) {
state.hasLogin = true;
state.token = token;
uni.setStorage({
key: "token",
data: token
})
},
// 退出登录
logout(state) {
state.hasLogin = false;
state.token = "";
uni.removeStorage({
key: "token"
})
uni.removeStorage({
key: "user_info"
})
},
setOrderType(state, type) {
state.orderType = type;
},
@@ -48,7 +75,7 @@ const store = new Vuex.Store({
},
setLoadMore(state, info) {
state.loadmore = info;
},
}
}
})
export default store;

View File

@@ -0,0 +1,115 @@
<template>
<view class="comment-item">
<view class="user">
<u-avatar :src="content.member_avatar" class="avatar" size="60"></u-avatar>
<text class="name">{{ content.geval_frommembername }}</text>
<u-rate v-if="reply" :disabled='true' :count="count" v-model="rate" size="23" active-color="#FF780F" inactive-color="#F0EDF1" gutter="10"></u-rate>
</view>
<view class="content">
<view class="text">{{ content.geval_content }}</view>
</view>
<view class="image-container">
<image :src="src" v-for="(src, index) in content.geval_image" :key="index"></image>
</view>
<view class="reply" v-if="reply && content.geval_explain">
<view class="title">掌柜回复</view>
<view class="content u-line-4">{{ content.geval_explain }}</view>
</view>
<view class="time" v-if="reply">
<image src="/static/image/common/20.png"></image>
<view class="value">{{ content.geval_addtime }}</view>
</view>
</view>
</template>
<script>
/*
* @description 显示评价
* @property {Boolean} reply 是否显示回复/时间/评分
**/
export default {
data() {
return {
count: 5,
rate: 0,
}
},
props: {
content: Object,
reply: Boolean,
},
created() {
if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two;
}
};
</script>
<style lang="scss" scoped>
.comment-item {
background-color: #ffffff;
.user {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.name {
margin: 0 20rpx;
font-size: 26rpx;
color: rgba(153,153,153,1);
}
}
.content {
margin-bottom: 20rpx;
.text {
font-size: 26rpx;
color: rgba(51,51,51,1);
line-height: 40rpx;
margin-bottom: 20rpx;
}
> image {
width: 210rpx;
height: 210rpx;
border-radius: 10px;
&:not(:nth-child(3n)) {
margin-right: 30rpx;
}
}
}
.image-container {
margin: 20rpx 0;
> image {
width: 210rpx;
height: 210rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
&:not(:nth-child(3n)) {
margin-right: 30rpx;
}
}
}
.reply {
padding: 30rpx;
background: rgba(240,238,238,1);
border-radius: 10rpx;
font-size: 24rpx;
color: rgba(102,102,102,1);
margin-bottom: 20rpx;
.title {
margin-bottom: 16rpx;
}
.content {
line-height: 36rpx;
}
}
.time {
display: flex;
align-items: center;
> image {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
}
.value {
font-size: 24rpx;
color: rgba(153,153,153,1);
}
}
}
</style>

View File

@@ -1,24 +1,38 @@
<template>
<view class="daren-item" @click="toDetailsPage">
<image class="head" :src="info.member_avatar"></image>
<view class="daren-item">
<image class="head" @click="toDetailsPage" :src="info.member_avatar"></image>
<text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">关注</view>
<view class="guanzhu action" @tap="changeType(info.member_id)" v-else >未关注</view>
<view class="guanzhu action" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">关注</view>
<view class="guanzhu" @tap="changeType(info.member_id)" v-else >未关注</view>
</view>
</template>
<script>
import { mapState } from 'vuex';
export default {
name:"daren-item",
props: {
info: Object,
},
computed: {
...mapState(["login","hasLogin"]),
},
watch: {
info(newVal, old) {
// console.log(newVal);
},
deep: true
},
methods: {
toDetailsPage() {
// 判断是否登录
const toke = uni.getStorageSync('token');
if (toke) {
console.log(toke);
// console.log();
if (this.hasLogin) {
this.$u.route({
url: "/pageB/details/index",
params: {
id: this.info.member_id
}
});
}else{
uni.navigateTo({
url: '/pageA/login/login'
@@ -32,8 +46,8 @@ export default {
// })
},
changeType:function(type){
console.log("111")
this.$emit("pChangeType",type)
// console.log("111")
this.$emit("pChangeType",type);
},
},
@@ -54,7 +68,7 @@ export default {
height: 80rpx;
border-radius: 50%;
margin-top: 24rpx;
background-color: #0f0;
background-color: #0077AA;
}
.name{
font-size: 26rpx;
@@ -80,6 +94,7 @@ export default {
}
.action{
background: #f3f3f3;
color: #FF780F;
}
}
</style>

View File

@@ -5,7 +5,7 @@
<view class="backes"></view>
<image class="head" :src="item.article_pic" ></image>
</view>
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
<view class="title" v-if="">{{ item.article_title }}</view>
<view class="jianjie">{{ item.article_content }}</view>
<view class="user">
<view class="info">
@@ -37,23 +37,24 @@
</template>
<style lang="scss" scoped>
.video-item{
margin-top: 20rpx;
flex-shrink: 0;
width: 335rpx;
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
padding-bottom: 20rpx;
border-radius: 20rpx;
margin-top: 20rpx;
overflow: hidden;
border-radius: 20rpx;
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
.head{
width: 100%;
height: 334rpx;
}
.title{
margin:0 auto;
margin-top: 20rpx;
font-size: 22rpx;
margin-top: 4rpx;
font-size: 28rpx;
color: #333;
font-weight: 500;
line-height: 30rpx;
line-height: 40rpx;
width: 300rpx;
overflow:hidden;
text-overflow:ellipsis;
@@ -63,7 +64,7 @@
}
.jianjie{
margin:0 auto;
margin-top: 20rpx;
margin-top: 10rpx;
font-size: 22rpx;
color: #666;
line-height: 30rpx;
@@ -105,14 +106,15 @@
.action {
z-index: 19;
position: absolute;
right: 0rpx;
bottom: 55rpx;
right: -10rpx;
bottom: 60rpx;
// width: 234rpx;
border-radius: 6rpx;
background: rgba(255,255,255,1);
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(35,24,21,0.12);
border-radius: 6rpx;
.bubble {
position: relative;
border-radius: 20rpx;
background-color: #fff;
&::after {
position: absolute;
@@ -128,9 +130,9 @@
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(35,24,21,0.12);
}
> view {
padding: 9rpx 12rpx;
display: flex;
align-items: center;
padding: 20rpx 30rpx;
&:not(:last-child) {
border-bottom: 2rpx #ECECEC solid;
}
@@ -141,17 +143,17 @@
}
> image {
&:first-child {
@include image-class($width: 21rpx, $height: 22rpx, $right: 12rpx);
@include image-class($width: 30rpx, $height: 30rpx, $right: 12rpx);
}
&:nth-child(2) {
@include image-class($width: 22rpx, $height: 22rpx, $right: 12rpx);
@include image-class($width: 30rpx, $height: 30rpx, $right: 12rpx);
}
&:last-child {
@include image-class($width: 24rpx, $height: 20rpx, $right: 9rpx);
@include image-class($width: 30rpx, $height: 30rpx, $right: 9rpx);
}
}
> text {
font-size: 20rpx;
font-size: 24rpx;
color: rgba(51,51,51,1);
}
}
@@ -194,27 +196,40 @@ export default {
// console.log(this.item);
this.show = -1;
},
watch: {
item(newVal, old) {
// console.log(newVal);
this.item = newVal;
},
deep: true
},
methods: {
showAction() {
this.show = this.show > 0 ? -1 : this.item.article_id;
},
// 点赞
articleLike() {
this.item.is_like = !this.item.is_like;
this.$u.api.articleLike({
article_id: this.item.article_id,
}).then(res => {
console.log(res)
if(res.errCode == 0) {
this.$emit("getArticlelist");
this.$u.toast(res.message);
// this.$emit("getArticlelist");
}
})
},
// 收藏
articleCollect() {
this.item.is_collect = !this.item.is_collect;
this.$u.api.articleCollect({
article_id: this.item.article_id,
}).then(res => {
console.log(res)
console.log(res);
if(res.errCode == 0) {
this.$emit("getArticlelist");
this.$u.toast(res.message);
// this.$emit("getArticlelist");
}
})
},
@@ -225,6 +240,7 @@ export default {
}).then(res => {
// console.log(res)
if(res.errCode == 0) {
this.$u.toast(res.message);
this.$emit("getArticlelist");
}
})
@@ -233,7 +249,6 @@ export default {
uni.navigateTo({
url: '/pageB/photo/index?id=' + id
});
},
},
}

View File

@@ -1,14 +1,14 @@
<template>
<view class="zhibo">
<image class="head"></image>
<view class="zhibo" @click="zhibo">
<image class="head" :src="image"></image>
<view class="user">
<view class="name">
<image></image>
<text>这是名字</text>
<text class="u-line-1" style="width:130rpx">{{name}}</text>
</view>
<view class="pingbi">
<image></image>
<text>屏蔽用户</text>
<text>1屏蔽用户</text>
</view>
</view>
</view>
@@ -70,6 +70,19 @@ export default {
return {
}
},
methods:{
zhibo(){
this.$u.route({
url:"/pages/zhibo/index",
params:{
url:this.url,
id:this.zid,
rid:this.rid
}
})
}
},
props:['name','image','url','zid','rid']
}
</script>

View File

@@ -1,13 +1,13 @@
<template>
<view class="notice">
<view v-for="(item,index) in notice">
<view class="time_notice">2020-05-14 20:11</view>
<view v-for="(item,index) in notice" :key="index">
<view class="time_notice">{{ item.addtime }}</view>
<view class="notice_view">
<image :src="item.url" mode="aspectFill" ></image>
<view class="text_view">{{item.content}}</view>
<image :src="item.picture" mode="aspectFill" ></image>
<view class="text_view u-line-2">{{ item.content }}</view>
<view class="notice_list">
<text>查看详情</text>
<view> > </view>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
</view>
</view>
@@ -15,7 +15,6 @@
</template>
<style lang="scss" scoped>
.notice {
background: #ECECEC;
.notice_view{
width: 690rpx;
height: 489rpx;
@@ -75,21 +74,20 @@
<script>
export default {
name: "notice",
props: ['list'],
data() {
return {
notice : [
{
time : '2020-05-14 20:11',
content:'潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名照',
url : '../../../pageE/static/mine/23.png'
},
{
time : '2020-05-14 20:11',
content:'潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名照',
url : '../../../pageE/static/mine/23.png'
}
]
notice : []
};
},
watch: {
list(newVal,old) {
// console.log(newVal);
this.notice = newVal;
}
},
methods: {
}
}
</script>

View File

@@ -1,7 +1,7 @@
<template>
<view id="info_title">
<view>
<view class="url_info" v-for="(item,index) in list" :key="index" @click="route_skip(index)">
<view class="url_info" v-for="(item,index) in information" :key="index" @click="route_skip(index)">
<image :src="item.url"></image>
<text>{{item.text}}</text>
</view>
@@ -56,33 +56,15 @@
props:['information'],
name: "info_title",
data() {
return {
list: [{
id: 0,
url: '../../static/pageD/info(11).png',
text: '公告/资讯'
},
{
id: 0,
url: '../../static/pageD/info(6).png',
text: '活动消息'
},
{
id: 0,
url: '../../static/pageD/info(14).png',
text: '交易物流'
},
{
id: 0,
url: '../../static/pageD/info(15).png',
text: '关注消息'
},
],
}
},
watch: {
information(newVal, old) {
console.log(newVal);
},
deep: true
},
methods: {
// 点击顶部的标题模块跳转
route_skip(index) {

View File

@@ -42,17 +42,6 @@ export default {
// this.loadStatus = "nomore";
// this.tpage--;
// })
// this.$parent.callback({ page: this.tpage }).then(length => {
// if(length == 0) {
// this.tpage--;
// this.status = 'nomore';
// } else {
// this.status = 'loading';
// }
// }).catch(() => {
// this.loadStatus = "nomore";
// this.tpage--;
// })
}
}
};

View File

@@ -68,7 +68,8 @@
this.$refs.uCode.start();
}, 2000);
} else {
this.$u.toast('倒计时结束后再发送');
// this.$u.toast('倒计时结束后再发送');
console.log("倒计时结束后再发送");
}
}

View File

@@ -7,12 +7,12 @@
<view>
<input type="text" placeholder="手机号" maxlength="11" v-model="phone" />
</view>
<view class="area" @click="show=true">
<input type="text" placeholder="省市区" v-model="address" disabled />
<view>
<view class="area">
<input type="text" placeholder="省市区" v-model="address" disabled @click="show=true" />
<!-- <view @click="chooseArea">
<image src="/static/image/mine/24.png"></image>
<text>定位</text>
</view>
</view> -->
</view>
<view>
<input type="text" placeholder="详细地址" v-model="area" />
@@ -49,6 +49,7 @@ export default {
area: '', // 详细地址
area_id: '', // 地区id 省
city_id: '', // 城市id
debounce: true,
}
},
props: {
@@ -78,8 +79,20 @@ export default {
},
// 判断是不是编辑页面 调用接口
confirmBtn() {
if(!this.debounce) return;
this.debounce = false;
this.info ? this.editAddress() : this.addAddress();
},
// chooseArea() {
// uni.chooseLocation({
// success: function (res) {
// console.log('位置名称:' + res.name);
// console.log('详细地址:' + res.address);
// console.log('纬度:' + res.latitude);
// console.log('经度:' + res.longitude);
// }
// });
// },
// 验证
validateValue() {
if(this.$u.test.isEmpty(this.name)) {
@@ -118,20 +131,13 @@ export default {
// latitude,
}).then((res)=>{
if (res.errCode == 0) {
uni.redirectTo({
url: '/pageE/more/Address'
});
// this.$refs.uToast.show({
// title: res.message,
// type: 'success',
// // url: '/pageE/more/Address',
// callback() {
// uni.redirectTo({
// url: '/pageE/more/Address'
// });
// }
// })
this.$refs.uToast.show({
title: res.message,
type: 'success',
back: true,
})
} else {
this.debounce = true;
this.showToast(res.message, 'warning');
}
})
@@ -151,20 +157,13 @@ export default {
// latitude,
}).then((res)=>{
if (res.errCode == 0) {
uni.redirectTo({
url: '/pageE/more/Address'
});
// this.$refs.uToast.show({
// title: res.message,
// type: 'success',
// // url: '/pageE/more/Address',
// callback() {
// uni.redirectTo({
// url: '/pageE/more/Address'
// });
// }
// })
this.$refs.uToast.show({
title: res.message,
type: 'success',
back: true,
})
} else {
this.debounce = true;
this.showToast(res.message, 'warning');
}
})

View File

@@ -3,22 +3,22 @@
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action
v-for="(item, index) in list" :key="index"
:index='index'
:index='item.fav_id'
:show="item.show"
:options="options"
@click="removeFavorite"
@open="open"
>
<view class="item u-border-bottom">
<image src="@/pageE/static/mine/23.png"></image>
<image :src="item.goods_image"></image>
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="title-wrap">
<view class="item-top u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
<view class="item-top u-line-2">{{ item.goods_name }}</view>
<view class="item-bottom">
<view class="item-price">99</view>
<view class="item-price">{{ item.favlog_price }}</view>
<view class="item-date">
<image src="@/pageE/static/mine/26.png"></image>
<view>2020-05-17</view>
<view>{{ item.fav_time }}</view>
</view>
</view>
</view>
@@ -30,20 +30,7 @@
export default {
data() {
return {
list: [
{
id: 1,
show: false
},
{
id: 2,
show: false
},
{
id: 3,
show: false,
}
],
list: [],
show: false,
options: [
{
@@ -61,17 +48,18 @@ export default {
methods: {
getGoodsFavoritesList() {
this.$u.api.getFavoritesList().then(res => {
if(res.errCode == 0) {}
if(res.errCode == 0) {
this.list = res.data;
}
})
},
removeFavorite(id) {
this.$u.api.removeFavorite({
id: id
}).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.getGoodsFavoritesList();
} else {
this.$u.toast(res.message);
}
})
},

View File

@@ -1,13 +1,13 @@
<template>
<view class="comment">
<view class="user-info">
<image src="@/pageE/static/mine/23.png" class="user-avatar"></image>
<view class="user-name">***</view>
<image :src="info.member_avatar" class="user-avatar"></image>
<view class="user-name">{{ info.member_nickname }}</view>
</view>
<view class="user-comment">
<view class="text u-line-2">宝贝收到了和卖家描述的一样,质量不错,很漂亮一直想买这样的杯子这个蓝色的稍微有点小瑕疵不过自己用没问题没问题没问题</view>
<view class="text u-line-2">{{ info.comment }}</view>
<view class="image">
<image v-for="(src, index) in ImageList" :key="index" :src="src" mode="aspectFit"></image>
<image v-for="(src, index) in info.images" :key="index" :src="src" mode="aspectFit"></image>
</view>
</view>
</view>
@@ -15,14 +15,10 @@
<script>
export default {
data() {
return {
ImageList: [
require('@/pageE/static/mine/23.png'),
require('@/pageE/static/mine/23.png'),
require('@/pageE/static/mine/23.png'),
require('@/pageE/static/mine/23.png')
]
}
return {}
},
props: {
info: Object,
}
};
</script>

View File

@@ -12,70 +12,76 @@
<image :src="goods.goods_image"></image>
<view class="goods-text">
<view class="goods-name u-line-2">{{ goods.goods_name }}</view>
<view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40">XL;红色条纹XL;红色条纹XL;红色条纹</view>
<view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">距离结束23:23:38</view>
<view class="goods-price u-line-1" v-if="order.order_state == 20 || order.order_state == 40">总价99.00实付款99</view>
<view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40 && goods.goods_spec">
<text v-for="(spec, index) in goods.goods_spec" :key="index">{{ spec + ';' }}</text>
</view>
<view class="goods-time u-line-1" v-if="order.view_type == 1">结束时间{{ order.end_time | date('yyyy-mm-dd hh:MM') }}</view>
<view class="goods-price u-line-1" v-if="order.order_state == 20 || order.order_state == 40">总价{{ goods.goods_price }}实付款{{ goods.goods_pay_price }}</view>
<view class="goods-date" v-if="order.order_state == 20 || order.order_state == 40">
<image src="@/pageE/static/mine/26.png"></image>
<view>{{ order.add_time | date }}</view>
<view>{{ order.add_time | date('yyyy-mm-dd hh:MM') }}</view>
</view>
</view>
</view>
</view>
<view class="order-btn" v-if="[10, 30, 20, 40].indexOf(order.order_state) >= 0">
<view class="logistics" v-if="order.order_state == 30">确认收货</view>
<view class="logistics" v-if="order.order_state == 30" @click="toOtherPage('Logistics')">查看物流</view>
<view class="comment" v-if="order.order_state == 40 && order.evaluation_state == 0" @click="toOtherPage('Comment')">立即评价</view>
<view class="calcel" v-if="order.order_state == 10" @click="cancelOrder">取消支付</view>
<view class="payment" v-if="order.order_state == 10">立即支付</view>
<view class="service" v-if="order.order_state == 20">联系官方客服</view>
<view class="submit" v-if="order.order_state == 20">提交官方审核</view>
<view class="order-btn" v-if="[1, 2, 3, 4, 8].indexOf(order.view_type) >= 0">
<view class="cancel" v-if="(order.view_type == 3 || order.view_type == 2) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
<view class="cancel" v-if="order.view_type == 1" @click="cancelOrder">取消支付</view>
<view class="payment" v-if="order.view_type == 1" @click="payNow(order.pay_sn, order.order_amount,order.order_id)">立即支付</view>
<view class="service" v-if="order.view_type == 8">联系官方客服</view>
<view class="submit" v-if="order.view_type == 8">提交官方审核</view>
</view>
</view>
</template>
<script>
import common from '@/static/js/common.js';
export default {
data() {
return {
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付, 7: 售后
state: '',
}
},
props: {
order: Object
},
created() {
mounted() {
this.viewState();
},
methods: {
viewState() {
let state;
switch (this.order.order_state) {
case 0: // 已取消
state = '已取消';
break;
case 10: // 未付款
switch (this.order.view_type) {
case 1:
state = '待支付';
break;
case 20: // 已付款
state = '交易成功';
case 2:
state = '待发货';
break;
case 30: // 已发货
case 3:
state = '待收货';
break;
case 40: // 已收货
if(this.order.evaluation_state == 0) state = '待评价';
else state = '交易成功'
case 4:
state = '待评价';
break;
case 5:
state = '交易成功';
break;
case 6:
state = '待退款';
break;
case 7:
state = '已退款';
break;
case 9:
state = '拼团中';
break;
default:
break;
}
if(this.order.refund_state) state = '已退款';
// 申请退款
if(this.order.refund_data) {
if([1, 2].indexOf(this.order.refund_data.refund_state) >= 0) state = '待退款';
if(this.order.refund_data.refund_state == 3) state = '已退款';
}
// console.log(state);
this.state = state;
},
cancelOrder() {
@@ -83,8 +89,19 @@ export default {
order_id: this.order.order_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("refreshOrderList", { reload: 'again' });
this.$emit("refreshOrderList");
}
this.$u.toast(res.message);
})
},
confirmReceive() {
this.$u.api.confirmReceive({
order_id: this.order.order_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("refreshOrderList");
}
this.$u.toast(res.message);
})
},
toOtherPage(url) {
@@ -92,6 +109,13 @@ export default {
oid: this.order.order_id,
});
},
payNow(pay_sn, order_amount, id) {
this.$u.route('/pageC/cart/cashier', {
pay_sn: pay_sn,
price: order_amount,
order_id: id
});
},
},
};
</script>
@@ -114,6 +138,7 @@ export default {
height: 50rpx;
border-radius: 50%;
margin-right: 15rpx;
background-color: aquamarine;
}
.store-name {
font-size: 26rpx;
@@ -146,6 +171,7 @@ export default {
line-height: 38rpx;
}
.goods-sku {
display: inline-block;
max-width: 230rpx;
background: rgba(236,236,236,1);
border-radius: 6rpx;
@@ -193,7 +219,7 @@ export default {
.logistics, .comment, .payment {
@include btn-class($width: 160rpx, $color: rgba(255,119,15,1));
}
.calcel {
.cancel {
@include btn-class($width: 160rpx, $color: rgba(155,153,153,1));
}
.service {

View File

@@ -0,0 +1,192 @@
<template>
<view class="order-item">
<view class="order-title">
<view class="store-info">
<image :src="order.store_avatar"></image>
<view class="store-name">{{ order.store_name }}</view>
</view>
<view class="order-status">{{ state }}</view>
</view>
<view class="goods-info">
<view class="goods-item">
<image :src="order.goods_image"></image>
<view class="goods-text">
<view class="goods-name u-line-2">{{ order.goods_name }}</view>
<!-- <view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40 && goods.goods_spec">
<text v-for="(spec, index) in goods.goods_spec" :key="index">{{ spec + ';' }}</text>
</view> -->
<!-- <view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">结束时间{{ order.add_time * 1000 | date('yyyy-mm-dd hh:MM') }}</view> -->
</view>
</view>
</view>
<view class="order-btn" v-if="order.goods_try_order_status == 20">
<view class="logistics" @click="confirmOrder">确认完成</view>
</view>
</view>
</template>
<script>
import common from '@/static/js/common.js';
export default {
data() {
return {
state: '',
}
},
props: {
order: Object
},
created() {
this.viewState();
},
filters: {},
methods: {
// "goods_try_order_status": 0, 试穿订单状态 0:待处理订单 20:同意 40:拒绝此订单 50:完成
viewState() {
let state;
switch (this.order.goods_try_order_status) {
case 0:
state = '等待商家回复';
break;
case 20:
state = '商家已接单';
break;
case 40:
state = '商家已拒绝';
break;
case 50:
state = '订单已结束';
break;
default:
break;
}
this.state = state;
},
confirmOrder() {
this.$u.api.goodsTryConfirm({
id: this.order.goods_try_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("refreshOrderList");
}
this.$u.toast(res.message);
})
},
toOtherPage(url) {
this.$u.route('/pageE/order/' + url, {
oid: this.order.order_id,
});
},
},
};
</script>
<style lang="scss" scoped>
.order-item {
width: 690rpx;
background: rgba(255,255,255,1);
border-radius: 20rpx;
padding: 30rpx;
.order-title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.store-info {
display: flex;
align-items: center;
> image {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
margin-right: 15rpx;
background-color: aquamarine;
}
.store-name {
font-size: 26rpx;
color: rgba(51,51,51,1);
}
}
.order-status {
font-size: 28rpx;
color: rgba(255,120,15,1);
}
}
.goods-info {
.goods-item {
display: flex;
margin-bottom: 28rpx;
> image {
flex-shrink: 0;
width: 180rpx;
height: 160rpx;
border-radius: 10rpx;
margin-right: 30rpx;
}
.goods-text {
display: flex;
flex-direction: column;
justify-content: space-between;
.goods-name {
font-size: 28rpx;
color: rgba(51,51,51,1);
line-height: 38rpx;
}
.goods-sku {
max-width: 230rpx;
background: rgba(236,236,236,1);
border-radius: 6rpx;
padding: 10rpx 15rpx;
font-size: 24rpx;
color: rgba(153,153,153,1);
}
.goods-time {
font-size: 24rpx;
color: rgba(255,49,49,1);
}
.goods-price {
font-size: 24rpx;
color: rgba(253,211,96,1);
}
.goods-date {
display: flex;
align-items: center;
font-size: 24rpx;
color: rgba(153,153,153,1);
> image {
width: 24rpx;
height: 24rpx;
margin-right: 21rpx;
}
}
}
}
}
.order-btn {
display: flex;
justify-content: flex-end;
@mixin btn-class($width, $color) {
width: $width;
height: 60rpx;
border: 2rpx solid $color;
color: $color;
border-radius: 30rpx;
padding: 15rpx 23rpx;
font-size: 28rpx;
&:not(:last-child) {
margin-right: 30rpx;
}
}
.logistics, .comment, .payment {
@include btn-class($width: 160rpx, $color: rgba(255,119,15,1));
}
.calcel {
@include btn-class($width: 160rpx, $color: rgba(155,153,153,1));
}
.service {
@include btn-class($width: 216rpx, $color: rgba(155,153,153,1));
}
.submit {
@include btn-class($width: 216rpx, $color: rgba(255,119,15,1));
}
}
}
</style>

View File

@@ -4,7 +4,7 @@
<view v-if="type" id="video_mp4">
<view class="page-body">
<view class="page-section">
<video id="myVideo" :src=" 'https://' + vide0_url" :controls="controls" :autoplay="autoplayes" :loop="loop" @error="videoErrorCallback"
<video id="myVideo" enable-progress-gesture="false" :src=" 'https://' + vide0_url" autoplay controls="false" @error="videoErrorCallback" @timeupdate="timeupdate"
enable-danmu danmu-btn></video>
</view>
</view>
@@ -17,11 +17,12 @@
<view class="uni-padding-wrap">
<view class="page-section swiper">
<view class="page-section-spacing">
<swiper class="swiper" :indicator-dots="true" :style="{height:heightOut+'px'}" :autoplay="false" :interval="3000" :duration="1000">
<swiper-item v-for="item in list" >
<swiper class="swiper" :indicator-dots="true" :style="{height:heightOut+'px'}" :autoplay="false" :interval="3000" :duration="1000" @animationfinish="">
<swiper-item v-for="(item,index) in list" :key="index">
<view class="swiper-item uni-bg-red">
<image :src=" 'https://' + item.launch_path"></image>
</view>
<view class="btn-init" v-if="parseInt(index) == 2" @click="goNext">立即体验</view>
</swiper-item>
</swiper>
</view>
@@ -48,13 +49,12 @@
export default {
data() {
return {
remaining: 4,
remaining: 7,
type: true,
banner: false,
protocol: false,
heightOut: '',
imgurl: [],
loop: 'true',
vide0_url: '',
agreement: { // 用户协议内容
document_title: "",
@@ -67,28 +67,16 @@
src: '',
inputValue: '',
controls: false,
autoplayes: true,
list: [],
danmuList: [{
text: '第 1s 出现的弹幕',
color: '#ff0000',
time: 1
},
{
text: '第 3s 出现的弹幕',
color: '#ff00ff',
time: 3
}
],
background: ['color1', 'color2', 'color3'],
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500
duration: 500,
swiper_index: "",
};
},
onReady: function(res) {
this.videoContext = uni.createVideoContext('myVideo')
this.videoContext = uni.createVideoContext('myVideo');
},
methods: {
apiwelcome() {
@@ -110,7 +98,6 @@
let vide0_url = res.data.start_page[0].launch_path
this.list = data_image;
this.vide0_url = vide0_url;
console.log(this.list)
})
},
// 3秒倒计时
@@ -120,7 +107,7 @@
if (this.remaining <= 0) {
clearInterval(this.timer);
console.log("完了")
this.type = !this.type
this.type = !this.type;
this.banner = !this.banner;
}
}, 1000);
@@ -142,19 +129,32 @@
uni.getSystemInfo({
success: function(res) {
that.heightOut = res.windowHeight;
console.log('666666666666666' + that.heightOut)
console.log(that.heightOut)
}
});
},
// 立即体验
goNext() {
this.protocol = true;
this.banner = false;
},
// 我同意
to_agree() {
uni.setStorage({
key: 'launchFlag',
data: true,
success: function() {
console.log('点击存储launchFlag');
}
});
uni.navigateTo({
url: '/pageA/login/login'
});
},
// 视频引入
bindInputBlur: function(e) {
this.inputValue = e.target.value
this.inputValue = e.target.value;
console.log(e.target.value);
},
bindButtonTap: function() {
var that = this
@@ -174,8 +174,10 @@
})
},
videoErrorCallback: function(e) {
console.log('视频错误信息:')
console.log(e.target.errMsg)
console.log('视频错误信息:',e);
},
timeupdate(e) {
console.log(e);
},
getRandomColor: function() {
const rgb = []
@@ -185,34 +187,12 @@
rgb.push(color)
}
return '#' + rgb.join('')
},
changeIndicatorDots(e) {
this.indicatorDots = !this.indicatorDots
},
changeAutoplay(e) {
this.autoplay = !this.autoplay
},
intervalChange(e) {
this.interval = e.target.value
},
durationChange(e) {
this.duration = e.target.value
},
refreshToken_function(){
this.$u.api.refreshToken({}).then((res) => {
console.log(res)
if (res.errCode == 0) {
let token = res.data.token;
uni.setStorageSync('token', token);//存储toke值
}
})
}
},
mounted() {
this.refreshToken_function()
// 3秒倒计时调用
this.remaining_time()
this.apiwelcome()
this.remaining_time();
this.apiwelcome();
}
}
</script>
@@ -221,34 +201,41 @@
.uni-padding-wrap{
// height: 400rpx;
}
.welcome_jumpes {
width: 94rpx;
height: 36rpx;
opacity: 0.5;
border-radius: 18rpx;
.btn-init {
z-index: 1000;
position: absolute;
right: 37rpx;
top: 66rpx;
bottom: 100rpx;
right: 30%;
width: 300rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
border-radius: 40rpx;
background-color: #007AFF;
}
.welcome_jumpes {
z-index: 100;
position: absolute;
top: 80rpx;
right: 60rpx;
width: 100rpx;
height: 40rpx;
border-radius: 20rpx;
font-size: 22rpx;
text-align: center;
line-height: 35rpx;
line-height: 40rpx;
color: #fff;
background: #C4CAC6;
z-index: 10;
background-color: rgba(0,0,0,0.5);
}
#myVideo {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
width: 100%;
}
uni-video {
width: 100%;
height: auto;
height: 100%;
}
.uni-video-container {
@@ -257,8 +244,8 @@
.welcome_images {
width: 100%;
height: 100vh;
position: fixed;
height: 100%
}
uni-swiper,
@@ -266,7 +253,7 @@
uni-image {
width: 100%;
// position: fixed;
height: 100%
height: 100vh;
}
uni-image {

View File

@@ -2,16 +2,19 @@
<view class="group">
<view class="top">
<text>全部拼团</text>
<text @click="viewMore">查看更多></text>
<view class="more" @click="viewMore">
<text>查看更多</text>
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
</view>
</view>
<view class="label">
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60"></u-tabs-swiper>
</view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 130px">
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 340rpx;">
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
<!-- 最多显示3个 -->
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length"></u-empty>
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length" style="margin: 0 auto;"></u-empty>
</swiper-item>
</swiper>
</view>
@@ -23,17 +26,41 @@ export default {
components:{
sitem
},
props: {
groupList: Array,
classifyList: Array,
},
data(){
return {
current: 0,
current: -1,
swiperCurrent: 0,
groupList: [], // 拼团商品
classifyList: [],
}
},
watch: {
current(value) {
this.getPinTuanList(this.classifyList[value].gc_id);
}
},
created() {
this.getGoodsClass();
},
methods: {
// 获取优惠券拼团分类
getGoodsClass() {
this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) {
this.classifyList = res.data;
this.current = 0;
}
})
},
// 拼团列表
getPinTuanList(id) {
this.$u.api.getPinTuanList({
page: 0,
gc_id: id,
}).then(res => {
this.groupList = res.data;
})
},
tabsChange(index) {
this.swiperCurrent = index;
},
@@ -52,8 +79,10 @@ export default {
</script>
<style lang="scss" scoped>
.group{
background-color: #ffffff;
.top {
height: 90rpx;
padding: 0 30rpx;
height:80rpx;
width: 100%;
display: flex;
align-items: center;
@@ -62,23 +91,22 @@ export default {
font-size: 30rpx;
color: #333;
}
>text:last-child{
font-size: 18rpx;
.more {
font-size: 20rpx;
display: flex;
align-items: center;
color: #999;
}
}
// .label{
// display: flex;
// font-size: 24rpx;
// color: #999;
// >text{
// margin-right: 34rpx;
// }
// }
.list {
box-sizing: border-box;
padding: 0 30rpx;
display: flex;
justify-content: space-between;
margin-top: 21rpx;
> view {
&:not(:nth-child(3n)) {
margin-right: 20rpx;
}
}
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view class="item" @click="toDetailsPage">
<image class="head" :src="info.pintuan_image"></image>
<image class="head" :src="info.pintuan_image" mode="widthFix"></image>
<text class="title u-line-1">{{ info.pintuan_goods_name }}</text>
<view class="price">
<view>{{ info.pintuan_goods_price }}</view>
@@ -16,19 +16,26 @@ export default {
},
methods: {
toDetailsPage() {
this.$u.api.getPinTuanDetails({
pintuan_id: this.info.pintuan_id,
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.data,
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.info.pintuan_id);
// this.$u.api.getPinTuanDetails({
// pintuan_id: this.info.pintuan_id,
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.data,
// type: 2,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.info.pintuan_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
})
params: {
id: this.info.pintuan_id,
type: 2,
}
})
}
@@ -37,11 +44,12 @@ export default {
</script>
<style lang="scss" scoped>
.item{
width: 210rpx;
overflow: hidden;
width: 220rpx;
height: 100%;
// overflow: hidden;
.head{
width: 210rpx;
height: 131rpx;
width: 100%;
height: 180rpx;
border-radius: 6rpx;
}
.title{
@@ -59,7 +67,7 @@ export default {
> view:first-child{
font-size: 26rpx;
color: #FF3131;
margin-bottom: 4rpx;
margin-bottom: 12rpx;
}
> view:last-child{
font-size: 22rpx;

View File

@@ -1,33 +1,28 @@
<template>
<view class="list">
<view class="top">
商品推荐
</view>
<view class="top">商品推荐</view>
<view>
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="26" :show-bar="false" @change="tabsChange" height="60"></u-tabs-swiper>
</view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
<view class="goods-item">
<view class="goods-item" v-if="goodsList.length">
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
</view>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
<!-- </scroll-view> -->
<u-empty text="暂无商品" mode="list" color="#000" margin-top="20" v-else></u-empty>
</swiper-item>
</swiper>
<!-- 加载更多 -->
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20"></u-loadmore>
<!-- <loadmore ref="loadmore" @callback="getGoodsRecommend" bgColor="#FFF" :page="page"></loadmore> -->
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore" v-if="goodsList.length>=pageSize"></u-loadmore>
</view>
</template>
<script>
import item from "./item";
import loadmore from "@/components/loadmore/index";
export default {
name:"list",
data() {
return {
pageSize: 12,
current: -1,
swiperCurrent: 0,
goodsList: [],
@@ -40,10 +35,11 @@ export default {
},
components: {
item,
loadmore
},
watch: {
current(index) {
this.page = 1;
this.goodsList = [];
const id = this.classifyList[index].gc_id;
this.getGoodsRecommend({gc_id: id});
}
@@ -61,27 +57,24 @@ export default {
page: this.page,
reload: false,
}).then(length => {
console.log(length);
// console.log(length);
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
this.loadStatus = 'loadmore';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
// this.$refs.loadmore.reachBottom();
// this.getGoodsRecommend(this.classifyList[this.current].gc_id);
},
getGoodsClassRecommend(gc_id) {
getGoodsClassRecommend() {
this.$u.api.getGoodsClassRecommend().then(res => {
if (res.errCode == 0) {
// 初始化 current
this.current = 0;
this.classifyList = res.data.gc_recommend;
// this.getGoodsRecommend(this.classifyList[0].gc_id);
}
})
},
@@ -90,7 +83,9 @@ export default {
page: page,
gc_id: gc_id,
})
// this.swiperCurrent = this.current;
if (res.errCode == 0) {
this.timer = true;
if(reload) this.goodsList = res.data.goodsList;
else this.goodsList.push(...res.data.goodsList);
// console.log(this.goodsList);
@@ -100,11 +95,14 @@ export default {
},
setSwiperHeight() {
// height: 230px, margin-bottom: 13
this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (230 + 13) + 'px';
const height = Math.ceil(this.goodsList.length / 2) * (540 + 26);
this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
// this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px';
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
this.current = index;
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
},
// swiper-item左右移动通知tabs的滑块跟随移动
transition(e) {
@@ -116,42 +114,41 @@ export default {
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
this.swiperCurrent = current;
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
},
}
}
</script>
<style lang="scss" scoped>
.list{
background-color: #ffffff;
padding: 30rpx {
top: 0;
};
.top {
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
height: 74rpx;
line-height: 88rpx;
text-align: center;
color: #333;
}
// .label{
// display: flex;
// color: #999;
// flex-wrap: wrap;
// >text{
// margin-right: 34rpx;
// margin-bottom: 10rpx;
// }
// }
// .item{
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
// margin-top: 20rpx;
// }
.swiper-box {
height: 100%;
padding: 20rpx 0;
margin-bottom: 10rpx;
.swiper-item {
// height: 100%;
.goods-item {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 20rpx;
width: 100%;
// height: 100%;
overflow-y: scroll;
}
}
}
}
</style>

View File

@@ -1,9 +1,9 @@
<template>
<view class="item" @click="toDetailsPage">
<image :src="info.goods_image" class="img"></image>
<image :src="info.goods_image" mode="aspectFill" class="img"></image>
<view class="info">
<text class="title u-line-1">{{ info.goods_name }}</text>
<text class="jianjie u-line-2">{{ info.goods_advword }}</text>
<text class="title u-line-2">{{ info.goods_name }}</text>
<text class="jianjie u-line-1">{{ info.goods_advword }}</text>
<text class="price">{{ info.goods_price }}</text>
</view>
</view>
@@ -16,18 +16,25 @@ export default {
},
methods: {
toDetailsPage() {
this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
if (res.errCode == 0) {
const goods = {
goods: res.data,
type: 1,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.info.goods_id);
// this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
// if (res.errCode == 0) {
// const goods = {
// goods: res.data,
// type: 1,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.info.goods_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// // console.log(this.goodsInfo.mobile_body);
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
})
// console.log(this.goodsInfo.mobile_body);
params: {
id: this.info.goods_id,
type: 1,
}
})
}
@@ -37,13 +44,13 @@ export default {
<style lang="scss" scoped>
.item{
width: 330rpx;
height: 460rpx;
height: 520rpx;
margin-bottom: 26rpx;
background-color: #f8f8f8;
border-radius: 10rpx 10rpx 0rpx 0rpx;
.img{
width: 330rpx;
height: 272rpx;
height: 300rpx;
background: rgba(245,245,245,1);
border-radius: 10rpx 10rpx 0rpx 0rpx;
margin-bottom: 24rpx;
@@ -55,6 +62,7 @@ export default {
flex-direction: column;
justify-content: space-around;
.title{
line-height: 40rpx;
font-size: 30rpx;
color: #333;
margin-bottom: 13rpx;
@@ -63,6 +71,7 @@ export default {
font-size: 26rpx;
color: #666;
margin-bottom: 20rpx;
line-height: 38rpx;
}
.price{
color: #FF3131;

View File

@@ -1,8 +1,11 @@
<template>
<view class="recommend">
<view class="top">
<text>{{ type == 'spike' ? '今日秒杀推荐' : '今日拼团推荐' }}</text>
<text>点击查看更多></text>
<text>今日秒杀推荐</text>
<view class="more" @click="toOthersPage">
<text>点击查看更多</text>
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
</view>
</view>
<view class="connect">
<view class="time" v-if="type == 'spike'">
@@ -33,11 +36,25 @@ export default {
created() {
this.info = this.recommendData;
console.log(this.recommendData);
},
methods: {
toOthersPage() {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.recommendData.groupbuy_id,
type: 3,
}
})
}
}
}
</script>
<style lang="scss" scoped>
.recommend{
margin-bottom: 20rpx;
padding: 0 30rpx;
background-color: #ffffff;
.top{
height: 90rpx;
display: flex;
@@ -47,12 +64,14 @@ export default {
font-size: 30rpx;
color: #333;
}
>text:last-child{
font-size: 18rpx;
.more {
display: flex;
align-items: center;
color: #999;
}
}
.connect{
padding: 15rpx;
display: flex;
.time{
display: flex;

View File

@@ -2,7 +2,10 @@
<view class="recommend">
<view class="top">
<text>今日拼团推荐</text>
<text @click="toDetailsPage">点击查看更多></text>
<view class="more" @click="toDetailsPage">
<text>点击查看详情</text>
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
</view>
</view>
<view class="connect">
<view class="user">
@@ -20,7 +23,7 @@
<text>{{ info.goods_price }}</text>
</view>
</view>
<image class="img" :src="info.groupbuy_image1"></image>
<image class="img" :src="info.pintuan_image" @click="toDetailsPage"></image>
</view>
</view>
</template>
@@ -35,23 +38,30 @@ export default {
props: ['recommendData', 'type'],
created() {
this.info = this.recommendData;
console.log(this.recommendData);
// console.log(this.recommendData);
},
methods: {
toDetailsPage() {
this.$u.api.getPinTuanDetails({
pintuan_id: this.recommendData.pintuan_id
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.data,
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
// this.$u.api.getPinTuanDetails({
// pintuan_id: this.recommendData.pintuan_id
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.data,
// type: 2,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
})
params: {
id: this.recommendData.pintuan_id,
type: 2,
}
})
}
@@ -60,6 +70,9 @@ export default {
</script>
<style lang="scss" scoped>
.recommend {
margin-bottom: 20rpx;
padding: 0 30rpx;
background-color: #ffffff;
.top {
height: 90rpx;
display: flex;
@@ -69,12 +82,15 @@ export default {
font-size: 30rpx;
color: #333;
}
>text:last-child{
font-size: 18rpx;
.more {
display: flex;
align-items: center;
color: #999;
font-size: 20rpx;
}
}
.connect{
padding:10rpx 30rpx 30rpx;
display: flex;
align-items: center;
.user {

View File

@@ -18,7 +18,8 @@
</view>
</view>
<view class="next" @click="viewMore">
查看更多>
<text>查看更多</text>
<u-icon name="arrow-right" color="#999" size="18"></u-icon>
</view>
</view>
<view class="list">
@@ -45,6 +46,9 @@ export default {
</script>
<style lang="scss" scoped>
.seckill{
background-color: #fff;
padding: 30rpx;
margin-bottom: 20rpx;
.top{
height: 60rpx;
display: flex;
@@ -73,7 +77,9 @@ export default {
}
}
.next{
font-size: 18rpx;
font-size: 20rpx;
display: flex;
align-items: center;
color: #999;
}
}

View File

@@ -26,20 +26,27 @@ export default {
methods: {
spikeGoods() {
// console.log(this.item.groupbuy_id);
this.$u.api.getSpikeInfo({
groupbuy_id: this.item.groupbuy_id
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.goodsInfo,
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
this.$store.commit('setGoodsId', this.item.groupbuy_id);
// this.$u.api.getSpikeInfo({
// groupbuy_id: this.item.groupbuy_id
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.goodsInfo,
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
})
params: {
id: this.item.groupbuy_id,
type: 3,
}
})
},

View File

@@ -1,7 +1,7 @@
<template>
<view class="shop-item">
<view class="shop-item" @click="toClassifyPage">
<image :src="info.goodscn_pic"></image>
<text class="u-line-1">{{ info.gc_name }}</text>
<text class="">{{ info.gc_name }}</text>
</view>
</template>
<script>
@@ -9,24 +9,34 @@ export default {
name:"shopItem",
props: {
info: Object,
},
methods: {
toClassifyPage() {
this.$u.route('pageC/classify/goods', {
cid: this.info.gc_id,
cname: this.info.gc_name,
});
}
}
}
</script>
<style lang="scss" scoped>
.shop-item{
display: flex;
flex-direction: column;
align-items: center;
flex-direction: column;
width: 20%;
margin-bottom:34rpx;
>image{
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
>text{
width: 80rpx;
width: 100rpx;
margin-top: 14rpx;
font-size: 24rpx;
color: #333;
margin-top: 14rpx;
}
}
</style>

View File

@@ -42,37 +42,51 @@ export default {
methods: {
spikeGoods() {
// console.log(this.item.groupbuy_id);
this.$u.api.getSpikeInfo({
groupbuy_id: this.item.groupbuy_id
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.goodsInfo,
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
this.$store.commit('setGoodsId', this.item.groupbuy_id);
// this.$u.api.getSpikeInfo({
// groupbuy_id: this.item.groupbuy_id
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.goodsInfo,
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
})
params: {
id: this.item.groupbuy_id,
type: 3,
}
})
},
toDetailsPage() {
this.$u.api.getPinTuanDetails({
pintuan_id: this.item.pintuan_id
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.data,
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.item.pintuan_id);
// this.$u.api.getPinTuanDetails({
// pintuan_id: this.item.pintuan_id
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.data,
// type: 2,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.item.pintuan_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
})
params: {
id: this.item.pintuan_id,
type: 2,
}
})
}

View File

@@ -4,7 +4,7 @@
<view class="title">全部优惠券</view>
<view class="view-more" @click="toCouponPage">查看更多></view>
</view>
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="60" ></u-tabs-swiper>
<!-- :style="{ height: swiperHeight }" -->
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
@@ -78,7 +78,7 @@ export default {
num = this.couponList.length
? this.couponList.length > 4 ? 4 : this.couponList.length
: 1
this.swiperHeight = (97 + 10) * num - 10 + 'px';
this.swiperHeight = (200 + 20) * num + 'rpx';
},
toCouponPage() {
this.$u.route({
@@ -93,8 +93,11 @@ export default {
</script>
<style lang="scss" scoped>
.coupon-swiper {
background-color: #ffffff;
margin-bottom: 40rpx;
.top {
padding-top: 30rpx;
padding: 0 30rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
@@ -109,12 +112,11 @@ export default {
}
}
.swiper-coupon-item {
padding: 0 30rpx;
box-sizing: border-box;
background-color: #ffffff;
// padding: 30rpx {
// top: 0;
// };
.coupon-item {
height: 200rpx;
margin-bottom: 20rpx;
}
}

View File

@@ -23,7 +23,6 @@
},
methods: {
type_logines(){
console.log("2345")
this.show = this.type_login
}
},

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.config.productionTip = false
Vue.use(uView);
App.mpType = 'app'
Vue.prototype.imService = new IMService();
Vue.prototype.a = 1;
import store from '@/common/store/index.js'
Vue.prototype.$store = store;

View File

@@ -1,6 +1,6 @@
{
"name" : "deming",
"appid" : "__UNI__62A680B",
"name" : "德铭阳光",
"appid" : "__UNI__EBFF00A",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@@ -18,7 +18,14 @@
},
/* */
"modules" : {
"OAuth" : {}
"OAuth" : {},
"Share" : {},
"Push" : {},
"Maps" : {},
"LivePusher" : {},
"Payment" : {},
"VideoPlayer" : {},
"Speech" : {}
},
/* */
"distribute" : {
@@ -37,6 +44,7 @@
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
@@ -46,8 +54,10 @@
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
],
"abiFilters" : [ "armeabi-v7a", "x86" ]
},
/* ios */
"ios" : {},
@@ -57,6 +67,78 @@
"oauth" : {
"qq" : {
"appid" : "101884160"
},
"apple" : {},
"weixin" : {
"appid" : "wx556db1531ec35dc7",
"appsecret" : "f441fc15dd21543871a818f40ce92016",
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
}
},
"maps" : {
"amap" : {
"appkey_ios" : "eafe430aa31fa033dcf45a0e87032653",
"appkey_android" : "8045e8a4cd6d544690c786265b248f91"
}
},
"share" : {
"weixin" : {
"appid" : "wx556db1531ec35dc7",
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
}
},
"speech" : {
"ifly" : {}
},
"payment" : {
"alipay" : {},
"weixin" : {
"appid" : "wx556db1531ec35dc7",
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
}
}
},
"splashscreen" : {
"androidStyle" : "default",
"android" : {
"hdpi" : "static/app/start/480x762.png",
"xhdpi" : "static/app/start/720x1242.png",
"xxhdpi" : "static/app/start/1080x1882.png"
},
"iosStyle" : "storyboard",
"ios" : {
"storyboard" : "static/CustomStoryboard.zip"
}
},
"icons" : {
"android" : {
"hdpi" : "static/app/icon/72x72.png",
"xhdpi" : "static/app/icon/96x96.png",
"xxhdpi" : "static/app/icon/144x144.png",
"xxxhdpi" : "static/app/icon/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.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"
}
}
}

View File

@@ -8,21 +8,22 @@
<view class="title">手机登录</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
<input type="tel" placeholder="请输入您的手机号" maxlength="11" v-model="member_mobile" />
</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
<input type="number" placeholder="请输入验证码" maxlength="6" v-model="sms_code" />
<!-- <text class="identifying" @click="getCode">{{text}}</text> -->
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile"></identifying>
</view>
<!-- 服务协议 -->
<view class="pact">
<view class="pact" v-if="0">
<view>
<view></view>
<view style="padding-bottom: 10px;"></view>
<text>我已详细阅读并同意</text>
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}} </text>
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}}
</text>
</view>
<u-checkbox-group @change="checkboxGroupChange" size="27">
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
@@ -37,16 +38,17 @@
</view>
<!-- denglu QQ weixin -->
<view class="buttones">
<view @click="loginOn">{{login}}</view>
<view @click="loginOn" class="btn">{{login}}</view>
<view class="a-go" @click="goIndex">暂不登录</view>
</view>
<u-mask :show="show" @click="show = false">
<view class="warp">
<view class="rect" @tap.stop>
<view class="rect_view" @click="rect_qq()">
<view class="rect_view" @click="loginOther(1)">
<image src="../../static/pageA/qq.png" class="image"></image>
<view>QQ登录</view>
</view>
<view class="rect_view">
<view class="rect_view" @click="loginOther(2)">
<image src="../../static/pageA/weixin.png" class="image"></image>
<view>微信登录</view>
</view>
@@ -60,6 +62,9 @@
</template>
<script>
import identifying from '@/components/logininput/identifying'
import {
mapMutations
} from 'vuex';
export default {
data() {
return {
@@ -89,20 +94,35 @@
}, {
"id": '3',
"text": "《使用协议》"
},
]
}, ],
temp_url: "", // 上个页面路径
pagesArr: ["pages/mine/index"], // 特殊路径
};
},
onLoad() {
// 数据的请求
this.apiwelcome()
this.apiwelcome();
},
onShow() {
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
this.temp_url = prePage.route;
// console.log(this.temp_url);
},
// 切断正常返回
onBackPress(e) {
console.log(1, e);
if (this.pagesArr.includes(this.temp_url) && !this.hasLogin) {
uni.switchTab({
url: '../../pages/index/index'
})
return true;
}
},
methods: {
...mapMutations(['loginIn']),
apiwelcome() {
this.$u.api.sendSmsCode({
}).then((res) => {
this.$u.api.sendSmsCode({}).then((res) => {
console.log(res)
})
},
@@ -115,6 +135,7 @@
},
// 用户登录
loginOn() {
let me = this;
// uni.navigateTo({
// url: '/pageE/zhibo/index'
// });
@@ -159,34 +180,29 @@
})
return false
} else {
uni.setStorageSync('token', res.data.token);//存储一个字符传值
me.loginIn(res.data.token); //存储一个字符传值
// 缓存用户的信息
uni.setStorageSync('user_info',res.data);
if (res.data.member.has_labels) {
uni.switchTab({
url: '/pages/index/index'
})
} else {
uni.navigateTo({
url: '/pageA/topick/topick'
})
// 缓存用户的信息
// uni.setStorageSync({
// key: 'user_info',
// data: res.data,
// success: function() {
// console.log('success');
// // 跳转首页
// uni.navigateTo({
// url : '/pageA/topick/topick'
// })
// }
// });
}
}
// 存储接口请求所需token
uni.setStorageSync('token', res.data.token);//存储一个字符传值
// // 注册返回参数
// this.$refs.uToast.show({
// title: res.message,
// type: 'success',
// url: '/pageA/topick/topick'
// })
}
if (res.errCode == 1) {
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error'
@@ -195,40 +211,75 @@
})
},
// qq授权登录
rect_qq() {
console.log("授权Q")
var vm = this;
loginOther(type) {
var me = this;
uni.getProvider({
service: 'oauth',
success: function(res) {
console.log('qq', res) //weixin
if (~res.provider.indexOf('qq')) {
success: (res) => {
if (type == 1) {
uni.login({
provider: 'qq',
success: function(loginRes) {
console.log(loginRes)
this.getApplogin(loginRes)
vm.$HTTP({
method: 'GET',
baseURL: 'https://graph.qq.com/user/get_user_info',
url: '',
data: {
openid: loginRes.authResult.openid,
access_token: loginRes.authResult.access_token,
appid: '101884160'
success: (qqres) => {
console.log(qqres);
uni.getUserInfo({
provider: 'qq',
success: (data) => {
console.log(data);
this.$u.api.qqLogin({
member_qqopenid: data.userInfo.openId,
member_nickname: data.userInfo.nickName,
member_avatar: data.userInfo.avatarUrl,
}).then(res => {
console.log(res.errCode);
if (res.errCode == 0) {
this.loginIn(res.data.token);
this.show = false;
uni.switchTab({
url: "../../pages/index/index"
})
}
})
}
})
},
load: true
}).then((data) => {
console.log(data)
}, (err) => {
console.log(err)
});
fail: (e) => {
console.log(e);
}
});
} else {
console.log("错误")
uni.login({
provider: 'weixin',
success: (wxres) => {
console.log(wxres);
uni.getUserInfo({
provider: 'weixin',
success: (data) => {
console.log(data);
this.$u.api.wechatLogin({
member_wxopenid: data.userInfo.openId,
member_nickname: data.userInfo.nickName,
member_avatar: data.userInfo.avatarUrl,
}).then(res => {
console.log(res);
if (res.errCode == 0) {
this.loginIn(res.data.token);
this.show = false;
uni.switchTab({
url: "../../pages/index/index"
})
}
})
}
})
},
fail: (e) => {
console.log(e);
}
});
}
},
fail: (e) => {
console.log(e);
}
});
},
@@ -238,10 +289,6 @@
url: '/pageA/register/register'
});
},
// 授权登录
getApplogin() {
console.log("11")
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
//console.log(e);
@@ -255,6 +302,11 @@
},
tochange() {
},
goIndex() {
uni.switchTab({
url: "/pages/index/index"
})
}
},
components: {
@@ -296,10 +348,12 @@
width: 630rpx;
margin: 0 auto;
}
.u-checkbox__icon-wrap .u-icon {
width: 26rpx !important;
height: 26rpx;
}
.more_Login text {
display: inline-block;
width: 50%;
@@ -378,6 +432,7 @@
position: relative;
padding-left: 40rpx;
overflow: hidden;
padding-bottom:10px
// overflow: hidden; //超出的文本隐藏
// text-overflow: ellipsis; //溢出用省略号显示
// white-space: nowrap; //溢出不换行
@@ -397,7 +452,8 @@
height: 22rpx;
}
.buttones > view {
.buttones {
.btn {
width: 628rpx;
height: 98rpx;
background: rgba(255, 120, 15, 1) !important;
@@ -411,6 +467,13 @@
border-color: rgba(255, 120, 15, 1) !important;
text-align: center;
}
.a-go {
margin-top: 24rpx;
text-align: center;
font-size: 26rpx;
color: #f2f2f2;
}
}
.warp {
display: flex;

View File

@@ -19,7 +19,7 @@ export default {
console.log(option)
// 协议类型调用不同的的协议
let typeIindex = option.index;
this.typeIndexRquest(typeIindex)
this.typeIndexRquest(typeIindex);
},
methods: {
typeIndexRquest(typeIindex){
@@ -28,16 +28,22 @@ export default {
this.$u.api.documentInfo({
document_code: 'agreement'
}).then((res)=>{
console.log(res)
// console.log(res.data.document_title);
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content);
this.document_content = data
this.document_content = data;
})
}
if(typeIindex == 1){
this.$u.api.documentInfo({
document_code: 'privacy'
}).then((res)=>{
console.log(res)
// console.log(res.data.document_title);
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content);
this.document_content = data
})
@@ -46,7 +52,10 @@ export default {
this.$u.api.documentInfo({
document_code: 'use'
}).then((res)=>{
console.log(res)
// console.log(res.data.document_title);
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content);
this.document_content = data
})
@@ -62,10 +71,14 @@ export default {
<style lang="scss" scoped>
.packlist{}
.packlist > view{
width:676px;
font-size:26rpx;
color: #333;
width: 90%;
margin: 0 auto;
padding: 16upx 0;
font-size: 26upx;
color: #333;
}
.rict_type {
text-indent: 1rem;
line-height: 1.2;
}
</style>

View File

@@ -8,11 +8,11 @@
<view class="title">手机注册</view>
<view class="labales phones">
<!-- <text></text> -->
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
<input type="tel" placeholder="请输入您的手机号" maxlength="11" v-model="member_mobile" />
</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
<input type="tel" placeholder="请输入验证码" maxlength="6" v-model="sms_code" />
<!-- <text class="identifying" @click="apiwelcome()">获取验证码</text> -->
<!-- 验证码接口的引入 -->
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile" ></identifying>
@@ -24,17 +24,18 @@
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}} </text>
<u-checkbox-group @change="checkboxGroupChange" size="27">
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
shape="circle" size="14" active-color="#19BE6B" ></u-checkbox>
shape="circle" size="30" active-color="#19BE6B" ></u-checkbox>
</u-checkbox-group>
</view>
</view>
<!-- 注册 -->
<view class="more_Login">
<text></text>
<text class="other" @click="mask_u">其他方式登录</text>
<!-- <text class="other" @click="mask_u">其他方式登录</text> -->
</view>
<!-- denglu QQ weixin -->
<view class="u-btn" @click="loginIn">{{login}}</view>
<view class="u-btn" @click="loginIns">{{login}}</view>
<view class="go-login" @click="goLogin">已有账号立即登录</view>
<u-mask :show="show" @click="show = false">
<view class="warp">
<view class="rect" @tap.stop>
@@ -56,7 +57,10 @@
</view>
</template>
<script>
import identifying from '@/components/logininput/identifying'
import identifying from '@/components/logininput/identifying';
import {
mapMutations
} from 'vuex';
export default {
data() {
return {
@@ -67,6 +71,7 @@
value: '',
login: '注册',
show: false,
is_check: null,
member_mobile: '', //手机号
smslog_type : '1',//状态
sms_code : '', //验证码
@@ -89,6 +94,7 @@
},
methods: {
...mapMutations(['loginIn']),
// 协议跳转
pact_click(index){
console.log(index)
@@ -97,25 +103,33 @@
});
},
// 用户注册
loginIn(){
loginIns(){
let me = this;
let type_phone = this.$u.test.mobile( this.member_mobile)
if( this.member_mobile == ''){
this.$refs.uToast.show({
title: '手机号不能为空',
title: '手机号不能为空',
type: 'error'
})
return false;
}
if (type_phone == false) {
this.$refs.uToast.show({
title: '手机号格式不正确',
title: '手机号格式不正确',
type: 'error'
});
return false;
}
if( this.sms_code == ''){
this.$refs.uToast.show({
title: '验证码不能为空',
title: '验证码不能为空',
type: 'error'
})
return false;
}
if (this.is_check) {
this.$refs.uToast.show({
title: '请同意协议!',
type: 'error'
})
return false;
@@ -129,18 +143,16 @@
// console.log(res)
if(res.errCode == 0){
//存储一个字符传值
me.loginIn(res.data.token);
// 缓存用户的信息
uni.setStorage({
key: 'token',
data: res.data.token,
success: function () {
console.log('success');
uni.setStorageSync('user_info',res.data);
// 跳转选择页面
if (uni.getStorageSync("token")) {
uni.navigateTo({
url: '/pageA/topick/topick'
})
}
});
// 注册返回参数
// this.$refs.uToast.show({
// title: res.message,
@@ -165,20 +177,25 @@
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
//console.log(e);
// console.log(e,1);
this.is_check = e.value;
console.log(this.is_check);
},
// 选中任一checkbox时由checkbox-group触发
checkboxGroupChange(e) {
// console.log(e);
// console.log(e,2);
},
mask_u() {
this.show = !this.show
},
goLogin() {
this.$u.route("/pageA/login/login");
},
// 注册接口
tochange() {
// console.log("调用父组件的方法")
// console.log('2222',this._data.member_mobile)
let member_mobile = this._data.member_mobile
let member_mobile = this._data.member_mobile;
}
},
@@ -314,6 +331,12 @@
border-color: rgba(255, 120, 15, 1) !important;
text-align: center;
}
.go-login {
margin-top: 26rpx;
text-align: center;
font-size: 26rpx;
color: #fff;
}
.warp {
display: flex;

View File

@@ -10,7 +10,7 @@
</view>
<!-- 标签 -->
<view class="tab_lable">
<view :class="{'cur': rSelect.indexOf(index)!=-1}" v-for="(item,index) in tab_lables" :key="index" @click="tapClick(index)">{{item.name}}</view>
<view :class="{'cur': rSelect.indexOf(index)!=-1}" v-for="(item,index) in tab_lables" :key="index" @click="tapClick(index,item.id)">{{item.name}}</view>
</view>
<!-- 提交按钮 -->
<view class="submites" @click="toHomePage">{{submites}}</view>
@@ -30,12 +30,12 @@
show: false,
tab_lables: [],
submites: '选好了进入首页',
rSelect:[]
rSelect: [],
list: [],
};
},
onLoad() {
// 标签的列表展示
console.log("11111222")
this.$u.api.labelList({
}).then((res) => {
@@ -44,8 +44,7 @@
})
},
mounted(){
},
mounted() {},
methods: {
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
@@ -59,19 +58,36 @@
this.show = !this.show
},
// 点击切换颜色
tapClick(index) {
console.log(index)
tapClick(index, id) {
// console.log(index);
if (this.rSelect.indexOf(index) == -1) {
console.log(index) //打印下标
this.rSelect.push(index); //选中添加到数组里
if (this.rSelect.length > 9) {
this.$u.toast("只能选择10个标签");
return false;
}
this.rSelect.push(index); // 选中状态
this.list.push(id); //选中添加到数组里
} else {
this.rSelect.splice(this.rSelect.indexOf(index), 1); //取消
this.list.splice(this.rSelect.indexOf(id), 1); //取消
}
// console.log(this.rSelect);
console.log(this.list);
},
toHomePage() {
this.$u.post("StartUp/addLabel", {
label_ids: this.list
}).then(res => {
// console.log(res);
if (res.errCode == 0) {
// this.$u.toast(res.message);
uni.switchTab({
url: '/pages/index/index'
});
} else {
this.$u.toast(res.message);
}
})
},
}
@@ -360,6 +376,7 @@
bottom: 0;
left: 0;
}
// 选中的样式
.cur {
background-color: #ff5d00 !important;

View File

@@ -1,31 +1,61 @@
<template>
<view class="welcome">
<!-- 倒计时跳过 -->
<remaining></remaining>
<remaining v-if="guidePages"></remaining>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
import remaining from '@/components/remaining/remaining';
export default {
computed: {
...mapState(['hasLogin', 'token'])
},
data() {
return {
guidePages: true
}
},
onLoad() {
this.loadExecution();
},
methods: {
},
mounted(){
},
components:{}
loadExecution() {
/**
* 获取本地存储中launchFlag的值
* 若存在,说明不是首次启动,直接进入首页;
* 若不存在,说明是首次启动,进入引导页;
*/
// 获取本地存储中launchFlag标识
const value = uni.getStorageSync('launchFlag') || "";
// console.log(value, this.hasLogin);
if (value) {
this.guidePages = false;
if (this.hasLogin) {
uni.switchTab({
url: '../../pages/index/index'
});
} else {
// launchFlag=true直接跳转到首页
uni.navigateTo({
url: '../../pageA/login/login'
});
}
} else {
// launchFlag!=true显示引导页
this.guidePages = true;
}
}
}
}
</script>
<style>
.welcome {}
.welcome_jumpes {
width: 90rpx;
height: 35rpx;
@@ -40,6 +70,7 @@
color: #fff;
background: #C4CAC6;
}
.welcome_images {
width: 100%;
position: fixed;

126
pageB/comment/index.vue Normal file
View File

@@ -0,0 +1,126 @@
<template>
<scroll-view scroll-y class="comment" @scrolltolower="loadMore">
<view class="label-list">
<view v-for="(label, index) in evaluateSpec" :key="index" :class="{'active': current == index}" @click="current=index">{{ index + '(' + label + ')' }}</view>
</view>
<view class="comment-container">
<view v-for="(item, index) in evalueList" :key="index" class="itme">
<comment :reply="true" :content="item"></comment>
</view>
<u-empty text="暂无评论" mode="list" v-if="!evalueList.length" margin-top="120" color="#333"></u-empty>
</view>
<!-- 加载更多 -->
<u-loadmore :status="loadStatus" bgColor="#EEEBEE" margin-top="20" margin-bottom="20" v-if="evalueList.length >= 12"></u-loadmore>
</scroll-view>
</template>
<script>
import comment from "@/components/comment/index";
export default {
data() {
return {
id: Number,
current: '全部',
page: 0,
evalueList: [],
evaluateSpec: {},
loadStatus: 'loadmore',
timer: true,
}
},
components: {
comment
},
onLoad(option) {
this.id = option.id;
// this.getAllEvalue();
this.getEvaluateSpec();
},
onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageC/cart/index');
},
watch: {
current(value) {
this.page = 0;
this.getAllEvalue({ type: value });
}
},
methods: {
loadMore() {
if(this.evalueList.length < 12) return false;
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.getAllEvalue({ type: this.current, load: 'more' }).then(length => {
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
getEvaluateSpec() {
this.$u.api.getEvaluateSpec({
id: this.id,
}).then(res => {
if(res.errCode == 0) {
this.evaluateSpec = res.data;
this.getAllEvalue();
}
})
},
async getAllEvalue({ type, load } = {}) {
let params = {
goods_id: this.id,
page: this.page,
}
if(type) Object.assign(params, { type: type });
const res = await this.$u.api.getAllEvalue(params);
if (res.errCode == 0) {
if(load) this.evalueList.push(...res.data);
else this.evalueList = res.data;
} else {
this.evalueList = [];
}
return res.data.length;
}
}
};
</script>
<style lang="scss" scoped>
.comment {
height: calc(100vh - var(--window-top));
background-color: #EEEBEE;
padding-bottom: 30rpx;
.label-list {
padding: 30rpx;
background-color: #ffffff;
margin-bottom: 14rpx;
display: flex;
flex-wrap: wrap;
> view {
box-sizing: content-box;
padding: 16rpx 20rpx;
border-radius: 30rpx;
margin: 0 20rpx 20rpx 0;
background: rgba(236,236,236,1);
font-size: 26rpx;
color: rgba(153,153,153,1);
}
.active {
background: rgba(255,120,15,1);
color: #ffffff;
}
}
.comment-container {
.itme {
padding: 30rpx;
background-color: #ffffff;
margin-bottom: 10rpx;
}
}
}
</style>

View File

@@ -1,27 +1,35 @@
<template>
<view class="userinfo">
<view class="user">
<view class="info">
<image></image>
<view class="avatar">
<image :src="item.member_avatar" mode="aspectFill"></image>
<view class="posi-type">
<view>
<text>达人昵称</text>
<text>关注数量</text>
<u-icon name="play-right-fill" color="#fff" size="20rpx"></u-icon>
</view>
<text>正在直播</text>
</view>
<view class="guanzhu">关注</view>
</view>
<view class="profile">个性签名</view>
<view class="box">
<view class="name">{{ item.member_nickname }}</view>
<view class="num">
<text>粉丝数{{ item.fans_num }}</text>
<text>评论数{{ item.comment_num }}</text>
</view>
</view>
</view>
<view class="btn" :class="[ is_follow ? 'btn-follow' : 'btn-unfollow' ]" @click="following">{{ is_follow ? "已关注" : "关注" }}</view>
</view>
<view class="profile" :class="{'u-line-2': is_open }" @click="openPro">
个性签名{{ item.recommend ? item.recommend : "对方很懒没有留下任何东西~~" }}
</view>
</view>
</template>
<style lang="scss" scoped>
image{
background-color: #0f0;
}
.userinfo{
height: 261rpx;
width: 100%;
// height: 261rpx;
padding: 30rpx;
.user{
display: flex;
@@ -31,53 +39,120 @@ image{
.info{
display: flex;
align-items: center;
>image{
.avatar {
position: relative;
&>image{
z-index: 99;
width: 140rpx;
height: 140rpx;
border-radius: 50%;
}
>view{
margin-left: 40rpx;
.posi-type {
z-index: 100;
position: absolute;
bottom: 0;
left: 0;
display: flex;
align-items: center;
border-radius: 30rpx;
background-color: rgba(0,0,0,0.3);
& > view {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
text-align: center;
line-height: 30rpx;
border-radius: 50%;
background-color: rgba(0,0,0,0.5);
}
& > text {
padding: 0 12rpx 0 6rpx;
color: #FF3131;
height: 40rpx;
line-height: 40rpx;
font-size: 20rpx;
}
}
}
.box {
display: flex;
height: 79rpx;
justify-content: space-between;
flex-direction: column;
>text:first-child{
height: 79rpx;
margin-left: 40rpx;
color: #333;
.name {
font-size: 28rpx;
color:#333;
}
>text:last-child{
.num {
font-size: 24rpx;
color: #333;
& > :first-child {
margin-right: 20rpx;
}
}
}
.guanzhu{
}
.btn{
width: 140rpx;
height: 60rpx;
font-size: 26rpx;
color:#fff;
line-height: 60rpx;
border-radius: 30rpx;
background-color: #FF780F;
text-align: center;
color:#fff;
border-radius: 30rpx;
}
.btn-follow {
background-color: #999999;
}
.btn-unfollow {
background-color: #FF780F;
}
}
.profile{
margin-top: 19rpx;
margin-top: 20rpx;
font-size: 24rpx;
color: #333;
margin-left: 14rpx;
line-height: 1.2;
}
}
</style>
<script>
export default {
name:"userinfo",
props: ["list"],
data(){
return {
item: {},
is_open: true,
is_follow: false,
}
},
watch: {
list(newVal, old) {
// console.log(newVal);
this.item = newVal;
this.is_follow = newVal.is_attention;
},
deep: true
},
methods: {
// 打开个性
openPro() {
this.is_open = !this.is_open;
},
// 关注
following() {
this.$u.api.attentionMember({
member_id: this.item.member_id
}).then(res => {
console.log(res);
if (res.errCode == 0) {
this.is_follow = !this.is_follow;
this.$u.toast(res.message);
} else {
this.$u.toast(res.message);
}
})
}
}
}

View File

@@ -36,6 +36,7 @@
box-sizing: border-box;
border-radius: 6rpx;
margin-right: 26rpx;
margin-bottom: 20rpx;
}
.xuanzhong{
border: #ff780f 1rpx solid;

View File

@@ -1,6 +1,7 @@
<template>
<view>
<view class="tloos">
<!-- 普通商品 tool -->
<view class="tloos" v-if="type == 1">
<view class="navs">
<image src="/static/image/common/18.png"></image>
店铺
@@ -13,6 +14,28 @@
<view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view>
<view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view>
</view>
<!-- 拼团 tool -->
<view class="group-tool" v-if="type==2">
<view class="launch" @click="settlementOrder">发起拼团</view>
<view class="involvement" @click="showGroupUser=true">参与拼团</view>
</view>
<!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3">
<view class="left">
<view>
<image src="/static/image/common/18.png"></image>
<text>店铺</text>
</view>
<view>
<image src="/static/image/common/19.png"></image>
<text>客服</text>
</view>
</view>
<view class="btn" v-if="groupbuyInfo.groupbuy_state == 20 && groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity" @click="spikeGoods">立即秒杀</view>
<view class="btn" :class="{'cannot': groupbuyInfo.groupbuy_state == 32 || groupbuyInfo.inventory == groupbuyInfo.groupbuy_buy_quantity}" v-else>
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
</view>
</view>
<u-popup v-model="show" mode="bottom">
<scroll-view scroll-y="true" class="popup">
<view>
@@ -40,9 +63,9 @@
import guige from "./guige"
export default {
name:"tloos",
props: ['id', 'info'],
props: ['id', 'info', 'type'],
components:{
guige
guige,
},
data(){
return {
@@ -107,6 +130,69 @@ export default {
}
</script>
<style lang="scss" scoped>
.group-tool {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 98rpx;
display: flex;
font-size: 32rpx;
color: rgba(255,255,255,1);
z-index: 99;
.launch {
flex: 1;
background: rgba(253,211,96,1);
line-height: 98rpx;
text-align: center;
}
.involvement {
flex: 1;
background: rgba(255,120,15,1);
line-height: 98rpx;
text-align: center;
}
}
.spike-tool {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 98rpx;
display: flex;
z-index: 99;
.left {
width: 190rpx;
display: flex;
align-items: center;
justify-content: space-around;
> view {
text-align: center;
> image {
width: 35rpx;
height: 35rpx;
margin-bottom: 15rpx;
}
> text {
display: block;
font-size: 24rpx;
color: rgba(102,102,102,1);
}
}
}
.btn {
flex: 1;
height: 98rpx;
line-height: 98rpx;
text-align: center;
font-size: 32rpx;
color: rgba(255,255,255,1);
background: rgba(255,120,15,1);
}
.cannot {
background: rgba(221,221,221,1);
}
}
.tloos{
background-color: #fff;
display: flex;

View File

@@ -2,10 +2,17 @@
<u-popup v-model="show" mode="bottom" length="782" border-radius="20">
<view class="top">
<text>全部商品</text>
<image></image>
<u-icon name="close" color="#999999" :size="30" @click="toggerList"></u-icon>
</view>
<scroll-view :scroll-y="true" class="scroll-box">
<view v-for="(item,index) in cartList" :key="index" class="item">
<image :src="item.goods_image" mode="aspectFill"></image>
<view>
<text class="title">{{ item.goods_advword }}</text>
<text class="name">{{ item.goods_name }}{{ item.goods_name }}{{ item.goods_name }}{{ item.goods_name }}{{ item.goods_name }}</text>
<text class="price">{{ item.goods_promotion_price }}</text>
</view>
</view>
<scroll-view :scroll-y="true" style="padding:0 30rpx;height:692rpx">
<sitem v-for="i in 10"></sitem>
</scroll-view>
</u-popup>
</template>
@@ -13,20 +20,24 @@
import sitem from "./item"
export default {
name:'shoplist',
props: ['list'],
components:{
sitem
},
data(){
return {
show: true
show: true,
cartList: [],
}
},
methods: {
toggerList() {
this.show = false;
}
}
}
</script>
<style lang="scss" scoped>
image{
background-color: #0f0;
}
.top{
height: 88rpx;
width: 100%;
@@ -39,9 +50,41 @@ image{
font-size: 30rpx;
color: #333;
}
>image{
width: 33rpx;
height: 33rpx;
}
.scroll-box {
.item {
display: flex;
padding: 20rpx;
border-bottom: 1px solid #ECECEC;
& > image {
flex-shrink: 0;
width: 160rpx;
height: 160rpx;
margin-right: 14rpx;
border-radius: 10rpx;
}
& > view {
display: flex;
flex-direction: column;
justify-content: space-between;
color: #333;
font-size: 28rpx;
.title {
}
.name {
width: 500rpx;
height: 80rpx;
font-size: 24rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.price {
color: #FF3131;
}
}
}
}
</style>

View File

@@ -1,51 +1,89 @@
<template>
<view class="shopone">
<image></image>
<view>
<text>sadas</text>
<text>dasadas</text>
<text>dsadas</text>
<u-popup v-model="is_comment" mode="bottom" border-radius="10" height="700rpx">
<view class="top">
<text>评论</text>
<u-icon name="arrow-down" color="#333" size="28" @click="close"></u-icon>
</view>
<scroll-view class="scroll-box" scroll-y="true" >
<view></view>
</scroll-view>
<view class="editing">
<input type="text" value="" />
<text>发送</text>
</view>
</u-popup>
</view>
</template>
<script>
export default {
name: "shopone",
props: ['comment'],
data() {
return {
is_comment: true
}
},
onReady() {
this.getComment(); // 获取评论
},
watch: {
comment(newValue,old) {
console.log(newValue,old);
},
deep: true
},
methods: {
getComment() {
this.$u.post("Specialci/getAllEvalue", {
goods_id: goods_id,
page: 1
}).then(res => {
console.log(res);
})
},
close() {
this.is_comment = false;
}
}
}
</script>
<style lang="scss" scoped>
image{
background-color: #0f0;
.top {
position: fixed;
top: 0;
width: 100%;
height: 88rpx;
padding: 0 20rpx;
line-height: 88rpx;
background-color: #ECECEC;
& > text {
margin-right: 280rpx;
color: #333;
font-size: 30rpx;
font-weight: 500;
}
.shopone{
width: 442rpx;
height: 200rpx;
background:rgba(0,0,0,0.4);
padding: 20rpx;
display: flex;
border-radius: 10rpx;
>image{
width: 160rpx;
height: 160rpx;
}
>view{
margin-left: 20rpx;
.scroll-box {
margin: 88rpx 0 100rpx 0;
height: 100%;
}
.editing {
position: fixed;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
>text{
font-size: 24rpx;
color: #fff;
line-height: 36rpx;
}
>text:first-child{
font-size: 28rpx;
}
>text:last-child{
font-size: 28rpx;
color: #FF3131;
}
width: 100%;
height: 90rpx;
padding: 0 30rpx;
background-color: #ECECEC;
& > input {
width: 80%;
height: 60rpx;
padding: 0 20rpx;
border-radius: 30rpx;
background-color: #fff;
}
}
</style>
<script>
export default {
name:"shopone"
}
</script>

View File

@@ -1,30 +1,32 @@
<template>
<view class="userinfo">
<view class="userhead">
<image :src="list.member_avatar"></image>
<text>+</text>
<image :src="item.member_avatar"></image>
<text class="follow" v-if="!is_follow" @click="following(item.member_id)">+</text>
<u-icon v-else name="checkmark" color="#ffffff" :size="28" class="follow" @click="following(item.member_id)"></u-icon>
</view>
<view class="zan">
<image></image>
<text>{{list.like_num}}</text>
<!-- 点赞 -->
<view class="operat zan">
<u-icon name="thumb-up-fill" :color=" is_like ? '#FF7807' : '#ffffff' " :size="50" @click="likeType(item.article_id)"></u-icon>
<text>{{item.like_num}}</text>
</view>
<view class="shoucang">
<image></image>
<text>{{list.collect_num}}</text>
<!-- 收藏 -->
<view class="operat shoucang">
<u-icon name="star-fill" :color=" is_collect ? '#FF7807' : '#ffffff' " :size="50" @click="collecting(item.article_id)"></u-icon>
<text>{{item.collect_num}}</text>
</view>
<view class="pinglun">
<image></image>
<text>{{list.comment_num}}</text>
<!-- 评论 -->
<view class="operat pinglun">
<u-icon name="more-circle-fill" :color=" is_content ? '#FF7807' : '#ffffff' " :size="50" @click="editing()"></u-icon>
<text>{{item.comment_num}}</text>
</view>
<view class="gouwu">
<image></image>
<!-- 购物车 -->
<view class="operat gouwu">
<u-icon name="shopping-cart-fill" :color=" is_cart ? '#FF7807' : '#ffffff' " :size="50" @click="carting()"></u-icon>
</view>
</view>
</template>
<style lang="scss" scoped>
image{
background-color: #0f0;
}
.userinfo{
width: 110rpx;
height: 570rpx;
@@ -32,41 +34,39 @@ image{
flex-direction: column;
justify-content: space-between;
align-items: center;
>view{
display: flex;
flex-direction: column;
align-items: center;
font-size: 28rpx;
color: #fff;
>text{
margin-top: 17rpx;
}
>image{
width: 50rpx;
height: 50rpx;
}
}
>view:first-child{
.userhead{
position: relative;
display: flex;
position: relative;
align-items: center;
>image{
&>image{
width: 110rpx;
height: 110rpx;
border-radius: 50%;
border: 2rpx solid #fff;
}
>text{
.follow {
position: absolute;
top: 90rpx;
left: 35%;
width: 36rpx;
height: 36rpx;
font-size: 36rpx;
background-color: #FF780F;
position: absolute;
top: 75rpx;
border-radius: 50%;
line-height: 36rpx;
text-align: center;
line-height: 36rpx;
font-size: 36rpx;
border-radius: 50%;
color: #fff;
background-color: #FF780F;
}
}
.operat {
display: flex;
align-items: center;
flex-direction: column;
& > text {
margin-top: 10rpx;
font-size: 28rpx;
color: #fff;
}
}
}
@@ -74,11 +74,82 @@ image{
<script>
export default {
name:'userinfo',
props:['list','cart','comment'],
data(){
return {
is_follow: this.list.is_attention || false,
is_like: this.list.is_like || false,
is_collect: this.list.is_collect || false,
is_content: false,
is_cart: false,
item: this.list || {}
}
},
props:['list']
watch: {
list(newValue,old) {
// console.log(newValue,old);
this.item = newValue || {};
this.is_follow = this.list.is_attention || false;
this.is_like = this.list.is_like || false;
this.is_collect = this.list.is_collect || false;
},
cart(newValue,old) {
// console.log(newValue,old);
this.is_cart = newValue;
},
comment(newValue,old) {
// console.log(newValue,old);
this.is_content = newValue;
},
deep: true
},
methods: {
// 关注
following(id) {
this.$u.api.attentionMember({member_id: id}).then(res => {
if (res.errCode == 0) {
this.is_follow = !this.is_follow;
this.$u.toast(res.message);
}
})
},
// 点赞
likeType(id) {
// console.log(id);
this.$u.post("article/articleLike",{article_id: id}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.is_like = !this.is_like;
this.list.like_num = res.data.num;
} else {
this.$u.toast(res.message);
}
})
},
// 收藏
collecting(id) {
this.$u.post("article/articleCollect",{article_id: id}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.is_collect = !this.is_collect;
this.list.collect_num = res.data.num;
} else {
this.$u.toast(res.message);
}
})
},
// 评论
editing() {
this.is_content = !this.is_content;
// console.log(this.is_content);
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
},
// 购物车
carting() {
this.is_cart = !this.is_cart;
// console.log(this.is_cart);
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
},
}
}
</script>

View File

@@ -1,7 +1,7 @@
<template>
<view class="details">
<view style="border-top: 1rpx solid #ececec;"></view>
<userinfo></userinfo>
<userinfo :list="userInfo"></userinfo>
<view style="border-top: 20rpx solid #ececec;"></view>
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
'background-color':'#FF780F',
@@ -13,39 +13,15 @@
}"
:bold="false"
@change="dianji"
:show-bar="false"></u-tabs>
<swiper class="card" @change="dianji" :current="num">
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
:show-bar="false">
</u-tabs>
<scroll-view class="scroll-box" scroll-y="true">
<view class="box">
<view class="list">
<view >
<videoItem v-for="item in 10"></videoItem>
<videoItem v-for="item in listInfo" :key="item.article_id" :item="item"
@getArticlelist="getArticlelist"></videoItem>
<view class="no-data" v-show="!listInfo && !page">暂无数据</view>
</view>
<view style="margin-left:20rpx">
<videoItem v-for="item in 10"></videoItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box">
<view class="list">
<view >
<zhiboItem v-for="item in 10"></zhiboItem>
</view>
<view style="margin-left:20rpx">
<zhiboItem v-for="item in 10"></zhiboItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</template>
<style lang="scss" scoped>
@@ -61,39 +37,85 @@
display: flex;
}
}
.scroll-box {
// display: flex;
padding: 20rpx;
box-sizing: border-box;
.box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.no-data {
margin: 100rpx auto 0;
}
}
}
}
</style>
<script>
import videoItem from "@/components/index/video-item/index"
import zhiboItem from "@/components/index/zhibo-item/index"
import userinfo from "../components/details/userinfo"
import videoItem from "@/components/index/video-item/index"
export default {
name:"details",
// name:"details",
components:{
userinfo,
videoItem,
zhiboItem
videoItem
},
data(){
return {
list:[
{
name: '短视频'
}, {
name: '图文'
}, {
name: '短视频'
}
],
num:0
num: 0,
userInfo: {}, // 用户信息
listInfo: [], // 列表详情
member_id: 0,
page: 0,
}
},
onLoad(option) {
// console.log(option);
this.member_id = option.id;
this.getUserInfo(option.id);
this.getArticlelist();
},
methods:{
// 获取信息
getUserInfo(id) {
this.$u.post("MemberExpert/expertInfo",{member_id: id}).then(res => {
// console.log(res);
this.userInfo = res.data.info;
// console.log(this.userInfo);
})
},
// 获取列表
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: this.num + 1,
member_id: this.member_id,
}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.listInfo = res.data.list;
console.log(this.listInfo);
} else {
console.log(res.message);
}
})
},
dianji(a){
console.log(a)
console.log(a);
if(typeof a == "object"){
this.num = a.detail.current
}else{
this.num = a
}
this.getArticlelist();
}
}
}

View File

@@ -1,72 +1,136 @@
<template>
<view class="photo">
<view class="status_bar"></view>
<view class="back">
<image></image>
<u-icon name="close" color="#999999" :size="30" @click="goBack"></u-icon>
</view>
<swiper class="swiper">
<swiper-item>
<image :src="list.article_pic"></image>
<swiper class="swiper" circular autoplay @change="changeSwiper">
<swiper-item v-for="(simg,sindex) in list.photo" :key="sindex">
<image :src="simg.url" mode="widthFix" @tap="viewImage" :data-url="simg.url"></image>
</swiper-item>
<!-- <swiper-item>
<image></image>
</swiper-item> -->
</swiper>
<view class="bottom">
<view class="item">
<view class="item" :style="{ width: photo_len * 20 + 100 + 'rpx' }">
<text>图片</text>
<view v-for="(item,index) in 4" :key="index" :style="{'background-color':index == 2 ? '#fff' : '#ede8e8'}"></view>
<view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view>
</view>
<view class="username">自己黑的哈万岁哦划u将</view>
<view class="title">hasjdhajskhj</view>
<view class="info u-line-2">asdjhasjdkasljdklasjkl</view>
<view class="username">@{{ list.member_nickname }}</view>
<view class="title">{{ list.article_title }}</view>
<view class="info">{{ list.article_content }}</view>
<view class="box">
<view class="label" v-for="(label,id) in list.label" :key="id">{{ label.name }}</view>
</view>
<userinfo class="userinfo" :list="list"></userinfo>
<shpoone class="shpoone"></shpoone>
<shoplist></shoplist>
</view>
<!-- 用户操作 -->
<userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" @openCart="openPopup"></userinfo>
<!-- 评论 -->
<u-popup v-model="is_comment" class="pl" mode="bottom" border-radius="10" height="700rpx">
<view class="top">
<text>评论</text>
<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
</view>
<scroll-view class="scroll-box" scroll-y="true" @scrolltolower="scrollBottom">
<block v-for="(item,index) in commentList" :key="index">
<view class="box">
<image :src="item.member_avatar" mode="aspectFill"></image>
<view class="info">
<text>{{ item.member_nickname }}</text>
<text class="time">{{ item.create_time }}</text>
</view>
<text class="reply" @click="openKeyInput(item,index)">回复</text>
</view>
<view class="content">
{{ item.content }}
</view>
<view class="child-content">
<view class="child-box" v-for="(child,cid) in allList[item.id]" :key="cid">
<view class="info">
<image :src="child.member_avatar" mode=""></image>
<text>{{ child.member_nickname }}</text>
<u-icon v-if="!child.is_nickanme" class="icon" name="play-right-fill" color="#666" size="10rpx"></u-icon>
<text v-if="!child.is_nickanme">{{ child.reply_member_nickname }}</text>
</view>
<view class="child_content">{{ child.content }}</view>
</view>
<view class="more-reply" v-if="item.reply_count" @click="getReplyList(item.id)">展开更多回复<u-icon name="arrow-down"></u-icon></view>
</view>
</block>
<!-- <view class="no-data" v-else>111</view> -->
</scroll-view>
<view class="editing" @click="openKeyInput">
<input type="text" value="" :placeholder="edit_text" disabled="disabled" />
<text>发送</text>
</view>
</u-popup>
<!-- 评论box -->
<u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx">
<view class="edit-box">
<input type="text" :placeholder="edit_text_other" :focus="is_focus" @focus="focus" v-model="send_value" autofocus>
<text @click="sendComment">发送</text>
</view>
</u-popup>
<!-- 购物车 -->
<u-popup v-if="cart_len > 1" class="cart" v-model="cart_type" mode="bottom" length="782" border-radius="20">
<view class="top">
<text>全部商品</text>
<u-icon name="close" color="#999999" :size="30" @click="cart_type = false"></u-icon>
</view>
<scroll-view :scroll-y="true" class="scroll-box">
<view v-for="(item,index) in list.goods" :key="index" class="item" @click="gotoInfo(item.goods_id)">
<image :src="item.goods_image" mode="aspectFill"></image>
<view>
<text class="title">{{ item.goods_advword }}</text>
<text class="name">{{ item.goods_name }}</text>
<text class="price">{{ item.goods_promotion_price }}</text>
</view>
</view>
</scroll-view>
</u-popup>
<!-- 单个 -->
<view class="good-one" v-else v-show="cart_type">
<view class="box" v-for="(item,index) in list.goods" :key="index" @click="gotoInfo(item.goods_id)">
<image :src="item.goods_image" mode="aspectFill"></image>
<view>
<view class="title u-line-1">{{ item.goods_advword }}</view>
<view class="content u-line-2">{{ item.goods_name }}</view>
<view class="price">{{ item.goods_promotion_price }}</view>
</view>
</view>
</view>
<!-- <shoplist :list="list.goods" v-show="list.goods.length > 1 && cart_type" @hideCart="hideCart"></shoplist> -->
</view>
</template>
<style lang="scss" scoped>
.photo{
height: 100vh;
background-color: #ececec;
width: 100%;
height: 100%;
background-color: #000000;
.back{
padding-top: 28rpx;
padding-right: 31rpx;
>image{
width: 31rpx;
height: 31rpx;
float: right;
}
text-align: right;
}
.swiper{
width: 100%;
height: 702rpx;
margin-top: 102rpx;
width: 750rpx;
height: 700rpx;
margin-top: 140rpx;
image{
width: 100%;
height: 100%;
}
}
.bottom{
width: 100%;
height: 270rpx;
background-color: #fff;
position: fixed;
bottom: 0;
display: flex;
flex-direction: column;
align-items: flex-start;
margin-top: 180rpx;
padding: 20rpx 30rpx;
background-color: #fff;
.item{
display: flex;
align-items: center;
padding: 8rpx 16rpx;
font-size: 24rpx;
color: #fff;
background-color: #999;
display: flex;
align-items: center;
border-radius: 10rpx;
background:rgba(153,153,153,.5);
>view{
width: 12rpx;
height: 12rpx;
@@ -75,68 +139,427 @@
}
}
.username{
margin: 20rpx 0;
font-size: 36rpx;
color: #333;
margin-top: 20rpx;
}
.title{
font-size: 26rpx;
font-size: 28rpx;
color: #333;
margin-top: 23rpx;
line-height: 46rpx;
}
.info{
margin: 20rpx 0;
line-height: 1.2;
font-size: 28rpx;
line-height: 42rpx;
margin-top: 20rpx;
}
.box {
display: flex;
flex-wrap: wrap;
.label {
padding: 6rpx 10rpx;
margin: 0 10rpx 10rpx 0;
font-size: 24rpx;
color: #fff;
border-radius: 6rpx;
background-color: #000000;
opacity: 0.5;
}
}
}
.userinfo{
position: absolute;
right: 30rpx;
top: 50%;
transform: translateY(-285rpx);
right: 30rpx;
}
.shpoone{
position: absolute;
top: 50%;
.pl {
.top {
z-index: 1000;
position: fixed;
top: 0;
width: 100%;
height: 88rpx;
padding: 0 20rpx;
line-height: 88rpx;
background-color: #ECECEC;
& > text {
margin-right: 280rpx;
color: #333;
font-size: 30rpx;
font-weight: 500;
}
}
.scroll-box {
z-index: 99;
margin: 88rpx 0 100rpx 0;
height: 100%;
.box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx;
& > image {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
height: 60rpx;
font-size: 26rpx;
color: #333;
.time {
font-size: 22rpx;
color: #999;
}
}
.reply {
font-size: 26rpx;
color: #333;
}
}
.content {
padding: 0 20rpx 10rpx 90rpx;
}
.child-content {
margin: 6rpx 90rpx 6rpx;
.child-box {
.info {
display: flex;
align-items: center;
margin-bottom: 10rpx;
color: #666;
font-size: 20rpx;
& > image {
flex-shrink: 0;
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
border-radius: 50%;
}
.icon {
margin: 0 10rpx;
}
}
.child_content {
margin: 18rpx 0 18rpx 30rpx;
}
}
.more-reply {
font-size: 22rpx;
color: #999;
}
}
}
.no-data {
margin-top: 100rpx;
}
.editing {
position: fixed;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 88rpx;
padding: 0 30rpx;
border-top: 1px solid #ececec;
background-color: #fff;
& > input {
width: 80%;
height: 50rpx;
padding: 0 20rpx;
border-radius: 20rpx;
background-color: #fff;
}
}
}
// 弹出输入框
.edit-box {
display: flex;
align-items: center;
height: 90rpx;
& > input {
width: 80%;
padding: 4rpx 20rpx;
border-radius: 20rpx;
}
}
.cart {
.top{
z-index: 1000;
position: fixed;
top: 0;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 88rpx;
padding: 0 30rpx;
border-bottom: 1rpx solid #ececec;
background-color: #fff;
>text{
font-size: 30rpx;
color: #333;
}
}
.scroll-box {
margin-top: 88rpx;
.item {
display: flex;
padding: 20rpx;
border-bottom: 1px solid #ECECEC;
& > image {
flex-shrink: 0;
width: 160rpx;
height: 160rpx;
margin-right: 14rpx;
border-radius: 10rpx;
}
& > view {
display: flex;
flex-direction: column;
justify-content: space-between;
color: #333;
font-size: 28rpx;
.title {
}
.name {
width: 500rpx;
height: 80rpx;
font-size: 24rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.price {
color: #FF3131;
}
}
}
}
}
.good-one{
z-index: 999;
position: absolute;
right: 139rpx;
top: 54%;
transform: translateY(100rpx);
.box {
display: flex;
align-items: center;
width: 440rpx;
height: 200rpx;
padding: 20rpx;
font-size: 28rpx;
color: #fff;
border-radius: 10rpx;
background-color: rgba(0,0,0,0.5);
& > image {
flex-shrink: 0;
width: 160rpx;
height: 100%;
margin-right: 10rpx;
border-radius: 10rpx;
}
& > view {
width: 200rpx;
}
.title {}
.content {
height: 60rpx;
margin: 10rpx 0;
line-height: 30rpx;
font-size: 24rpx;
}
.price {
color: #FF3131;
}
}
}
}
</style>
<script>
import userinfo from "../components/userinfo/index"
import shpoone from "../components/shpoone/index"
import shoplist from "../components/shoplist/index"
import userinfo from "../components/userinfo/index" // 点赞组件
import contentBox from "../components/shpoone/index" // 评论
// import shoplist from "../components/shoplist/index" // 商品列表
export default {
name:"photo",
onLoad(e) {
console.log('dhdhdhdhd',e)
},
components:{
userinfo,
shpoone,
shoplist
userinfo
},
data(){
return {
list:{}
list:{},
swiper_id: "",
page: 0, // 主评论
page_: [], // 子评论
cart_type: false, // 显示购物车
is_comment: false, // 显示评论
is_focus: false, // 聚焦
is_edit: false, // 输入框
send_value: "", // 输入的值
cartList: [],
cart_len: 0,
photo_len: 0,
edit_text: "有爱评论,说点好听的 ~",
edit_text_other: "有爱评论,说点好听的 ~",
commentList: [], // 评论
allList: [], // 全部子评论
}
},
onLoad(option){
this.article_id = option.id;
this.articleInfo(this.article_id);
},
// 监听返回按钮
onBackPress() {
if (this.cart_type) {
this.cart_type = !this.cart_type;
} else if (this.is_comment) {
this.is_comment = !this.is_comment;
} else if (this.is_edit) {
this.is_edit = !this.is_edit;
} else {
return false;
}
return true;
},
methods:{
// 发现详情
articleInfo(article_id){
this.$u.api.articleInfo({article_id}).then((res)=>{
console.log(res)
this.list = res.data.info
this.list = res.data.info;
this.cart_len = res.data.info.goods.length;
this.photo_len = res.data.info.photo.length;
})
},
// 改变swiper
changeSwiper(e) {
// console.log(e.detail.current);
this.swiper_id = e.detail.current; // 储存swiper id
},
// 更改弹框状态
openPopup(data) {
// console.log(data);
this.cart_type = data.cart;
this.is_comment = data.comment;
if (this.is_comment) {
this.page = 0;
this.getComment(this.article_id,0);
}
},
onLoad(o){
this.id = o.id
this.articleInfo(this.id)
// 获取评论
getComment() {
this.$u.post("article/articleCommentList",{
article_id: this.article_id,
page: this.page,
}).then(res => {
console.log(res);
if (res.errCode == 0 && this.page == 0) {
this.commentList = res.data;
} else if (res.errCode == 0 && this.page > 0) {
this.commentList = this.commentList.concat(res.data);
} else {
}
})
},
// 打开评论输入
openKeyInput(data,index) {
console.log(data);
this.is_edit = true;
this.is_focus = true;
this.comment_id = index;
if (data.id) {
this.edit_text_other = "回复@" + data.member_nickname;
this.pid = data.id;
this.reply_id = data.member_id;
} else {
this.edit_text_other = "有爱评论,说点好听的 ~";
this.pid = "";
this.reply_id = "";
}
// console.log(this.pid, this.edit_text_other);
},
// 发布评论
sendComment() {
this.$u.post("article/articleAddComment",{
article_id: this.article_id,
content: this.send_value,
pid: this.pid,
reply_id: this.reply_id,
}).then(res => {
// console.log(res.data.data);
if (res.errCode == 0) {
this.is_edit = false;
if (res.data.data.pid) {
this.commentList[this.comment_id].reply_count = true;
this.allList[this.comment_id].unshift(res.data.data);
} else {
this.commentList.unshift(res.data.data);
}
} else {
this.$u.toast(res.message);
}
})
},
// 发现回复列表
getReplyList(id) {
this.page_[id] = 0;
if (!this.page_[id] === 0) {
}
console.log(this.page_[id]);
this.$u.post("article/articleReplyList", {id: id, page: this.page_[id]}).then(res => {
console.log(this.page_);
if (res.errCode == 0) {
this.page_[id]++;
this.allList[id] = res.data;
}
})
},
// 预览图片
viewImage(e) {
let arr = [];
this.list.photo.forEach(item => {
arr.push(item.url);
})
uni.previewImage({
urls: arr,
current: e.currentTarget.dataset.url,
})
},
// 评论滚动到底部
scrollBottom(e) {
this.page++;
this.getComment();
},
// 跳转到商品
gotoInfo(id) {
console.log(id);
uni.navigateTo({
url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
focus() {
setTimeout(function(){
uni.showSoftKeybord;
}, 200)
}
},
}
</script>

View File

@@ -1,6 +1,6 @@
<template>
<view class="sdetails">
<u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper>
<u-swiper :list="list" height="500" border-radius="0" mode="dot" @click="viewImage"></u-swiper>
<view class="spike-view" v-if="type == 3">
<view class="left">
<view class="price">
@@ -9,26 +9,47 @@
</view>
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}</view>
</view>
<view class="right">
<view class="right" v-if="!isSpike">
<view class="title">秒杀倒计时</view>
<view class="time">{{ spikeTime }}</view>
</view>
<view class="right" v-else>
<view class="title">时间已结束</view>
</view>
</view>
<view class="info">
<view class="title u-line-2">
<text>{{ goodsInfo.store_name }}</text>{{ goodsInfo.goods_name }}
<text class="store-name">{{ goodsInfo.store_name }}</text>
<text class="goods-name">{{ goodsInfo.goods_name }}</text>
</view>
<view class="pic">
<view class="price-collect">
<view class="pic" v-if="type != 3">
<text>{{ goodsInfo.goods_price }}</text>
<s>{{ goodsInfo.goods_marketprice }}</s>
</view>
<view class="collect">
<u-icon name="star" color="#474747" size="28" v-if="1"></u-icon>
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
<text>收藏</text>
</view>
</view>
</view>
<view class="hr"></view>
<!-- <navs :value="领券"></navs> -->
<navs :value="'产品规格'"></navs>
<navs :value="'产品规格'" @click.native="showSpec=true"></navs>
<!-- <navs :value="'产品颜色'"></navs> -->
<!-- <navs :value="'选择尺码'"></navs> -->
<!-- <navs v-for="(value, index) in goodsInfo.spec_name" :value="value" :key="index"></navs> -->
<view class="comment">
<view class="title">
<view class="left">商品评价{{ evaluate.evaluate_num }}</view>
<view class="right" @click="viewComment">
<text>查看全部</text>
<image src="/static/image/common/1.png"></image>
</view>
</view>
<comment :reply="false" :content="evaluate" v-if="evaluate.evaluate_num"></comment>
<view class="comment-none" v-else>暂无评价</view>
</view>
<view class="hr"></view>
<view class="group-user" v-if="groupUser.length">
<view class="top">
@@ -39,7 +60,7 @@
</view>
</view>
<view class="bottom">
<view class="left" @click="showGroupUser=true">
<view class="left" @click="showGroupUser=true" v-if="user_suc.length">
<view class="avatar">
<image v-for="(user, i) in user_suc" :src="user[0].member_avatar" :key="i"></image>
</view>
@@ -62,7 +83,7 @@
</view>
</view>
</view>
<u-popup v-model="showGroupUser" mode="center">
<u-popup v-model="showGroupUser" mode="center" z-index="10078">
<view class="launch-container">
<view class="title u-line-1">正在拼团</view>
<scroll-view class="launch-view">
@@ -71,6 +92,7 @@
<image class="avatar" :src="user[0].member_avatar"></image>
<view class="name u-line-1">{{ user[0].member_nickname }}</view>
</view>
<view class="pintuan-none" v-if="!groupUser.length">暂无拼团</view>
</view>
</scroll-view>
<image class="close" src="/static/image/common/17.png" @click="showGroupUser=false"></image>
@@ -96,20 +118,55 @@
</view>
<view class="rich">
<rich-text :nodes="goodsInfo.mobile_body"></rich-text>
</view>
<!-- 选择规格数量 -->
<u-popup v-model="showSpec" mode="bottom">
<scroll-view scroll-y="true" class="spec-popup">
<view>
<view class="head">
<image class="image" :src="goodsInfo.goods_image"></image>
<view class="info">
<text class="u-line-2">{{goodsInfo.goods_name}}</text>
<text>{{goodsInfo.goods_price}}</text>
</view>
</view>
<guige @sel="self" ref="guige" v-for="(item,index) in goodsInfo.spec_value" :key="index" :title="goodsInfo.spec_name[index]" :item="item"></guige>
<view class="num">
<text>购买数量</text>
<u-number-box v-model="goodsNumber" @change="valChange"></u-number-box>
</view>
<view style="height:100rpx"></view>
</view>
<u-toast ref="uToast" />
</scroll-view>
</u-popup>
<!-- 普通商品 tool -->
<view class="tloos" v-if="type == 1">
<view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)" v-if="!showSpec">
<image src="/static/image/common/18.png"></image>
店铺
</view>
<view class="navs" style="margin-right:30rpx" v-if="!showSpec" @click="customers()">
<image src="/static/image/common/19.png"></image>
客服
</view>
<view class="button" style="background:rgba(253,211,96,0.6);" v-if="goodsInfo.goods_try == 1" @click="tryDress">试穿试送</view>
<view class="button" style="background:rgba(253,211,96,1);" @click="addCart">加入购物车</view>
<view class="button" style="background:rgba(255,120,15,1);" @click="settlementOrder">立即购买</view>
</view>
<!-- 拼团 tool -->
<view class="group-tool" v-if="type==2">
<view class="launch" @click="settlementOrder">发起拼团</view>
<view class="involvement" @click="showGroupUser=true">参与拼团</view>
</view>
<!-- 秒杀 -->
<!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3">
<view class="left">
<view>
<view class="left" v-if="!showSpec">
<view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
<image src="/static/image/common/18.png"></image>
<text>店铺</text>
</view>
<view>
<view @click="customers()">
<image src="/static/image/common/19.png"></image>
<text>客服</text>
</view>
@@ -119,99 +176,122 @@
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
</view>
</view>
<!-- 普通商品 tool -->
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="goodsInfo" v-if="type==1"></tloos>
<!-- <tloos @buy="buy" @xuanze="xuanze" :id="id" :info="goodsInfo" :type="type"></tloos> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
/*
* 详情是请求完存在store的在这里从store取值
**/
import navs from "../components/sdetails/navs"
import tloos from "../components/sdetails/tloos"
import comment from "@/components/comment/index";
import navs from "../components/sdetails/navs";
import guige from "../components/sdetails/guige"
import tloos from "../components/sdetails/tloos";
export default {
name: "sdetails",
data() {
return {
list: [], // 轮播图列表
goodsInfo: {},
info:{},
glist:[],
id:0, // 商品id
goodsInfo: {}, // 商品信息
storeInfo: {},
glist: [], // 规格列表
id: 0, // 商品id/秒杀id/拼团 id
type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券
groupUser: [], // 拼团用户
user_suc: [], // 拼团成功用户
avatarWidth: '',
pintuan_id: '', // 拼团id
showGroupUser: false, // 拼团
showInvolvementUser: false, // 参团
involvemenGroupInfo: [], // 参团的人
groupbuyInfo: {}, // 秒杀详情
spikeTime: '',
timer: '', // 时间定时器
isSpike: false, // 是否超过秒杀时间
timer: '', // 秒杀时间定时器
spec_id: '', // 规格 id, 下单用的
evaluate: {}, // 评价内容
showSpec: false, // 是否显示选择规格
goodsNumber: 1,
sel: "", // 拼接的规格
quanxuan: false, // 规格是否选择
debounce: true,
storeid:0 //店铺id
}
},
components: {
comment,
navs,
tloos
tloos,
guige,
},
watch: {
sel(value){
this.xuanze(value);
},
},
onLoad(option) {
// this.init();
// console.log(option);
this.type = Number(option.type);
this.id = option.id;
this.setTitle();
},
onShow() {
// if(this.pintuan_id) {
// this.$u.api.getPinTuanDetails({
// pintuan_id: this.pintuan_id
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.data,
// type: 2,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.pintuan_id);
// }
// })
// }
this.debounce = true;
this.showSpec = false;
this.showGroupUser = false;
this.showInvolvementUser = false;
this.getGoodsDetails(this.id);
},
onLoad() {
this.init();
onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageC/cart/index');
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
init() {
this.id = this.$store.state.goods_id;
this.type = this.$store.getters.getGoodsType;
const info = this.$store.getters.getGoodsInfo;
if(this.type == 2) {
this.user_suc = info.user_suc;
this.groupUser = info.user;
this.pintuan_id = info.pintuan_id;
customers(){
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
}
if (this.type == 3) {
this.groupbuyInfo = this.$store.state.groupbuyInfo;
this.setSpikeTime();
console.log(123)
this.$u.api.getAtwillUserInfo({
id:this.storeid
}).then((res)=>{
console.log(res)
let user = new Friend(res.data.member_id,res.data.member_nickname,res.data.member_avatar)
this.$u.route({
url:"/pageD/privateChat/privateChat",
params:{
id:JSON.stringify(user)
}
// console.log(this.groupbuyInfo);
this.goodsInfo = info.goods;
// 设置轮播图
let list = [];
info.goods_image[0].forEach(item => {
let temp = {
image: item
}
list.push(temp);
})
this.list = list;
this.setTitle();
}).catch((err)=>{
console.log(err)
})
},
setSwiperList(list) {
let img = [];
list.forEach(item => {
let temp = {
image: item[1]
}
img.push(temp);
})
this.list = img;
},
spikeGoods() {
this.settlementOrder()
},
setSpikeTime() {
const time = this.groupbuyInfo.groupbuy_endtime;
setSpikeTime(time) {
// const time = this.groupbuyInfo.groupbuy_endtime;
this.timer = setInterval(() => {
let spikeTime = time * 1000 - new Date().getTime();
if(spikeTime <= 0) this.isSpike = true;
// 计算天数
const days = Math.floor(spikeTime/(24*3600*1000));
//计算出小时数
@@ -229,61 +309,118 @@ export default {
// console.log(this.spikeTime);
}, 1000)
},
buy(info){
if(info.type == 2){ // 加入购物车
addCart() {
this.$u.api.addCart({
goods_id: this.id,
quantity: info.value,
quantity: this.goodsNumber,
}).then(res => {
this.$refs.uToast.show({
title: res.message,
type: res.errCode == 0 ? 'success' : 'warning',
})
})
} else if (info.type == 1) { // 支付
this.settlementOrder({num: info.value});
}
},
purchase() {
this.settlementOrder();
},
getGoodsDetails(id) {
this.id = id;
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
if (res.errCode == 0) {
this.goodsInfo = res.data.goods;
let list = [];
res.data.goods_image[0].forEach(item => {
let temp = {
image: item
switch (this.type) {
case 1:
this.ordinaryDetails(id);
break;
case 2:
this.pinTuanDetails(id);
break;
case 3:
this.spikeGoodsDetails(id);
break;
case 4:
break;
default:
break;
}
list.push(temp);
})
this.list = list;
this.info = res.data.goods;
},
// 普通商品详情
ordinaryDetails(id) {
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
console.log(res)
if (res.errCode == 0) {
this.evaluate = res.data.goods_evaluate_info;
this.goodsInfo = res.data.goods;
this.storeInfo = res.data.store;
this.setSwiperList(res.data.goods_image);
this.glist = res.data.spec_list;
this.storeid = res.data.store.store_id
// console.log(this.goodsInfo.mobile_body);
}
})
},
// 下单
// 拼团详情
pinTuanDetails(id) {
this.$u.api.getPinTuanDetails({
pintuan_id: id
}).then(res => {
if(res.errCode == 0) {
this.evaluate = res.data.data.goods_evaluate_info;
this.goodsInfo = res.data.data.goods;
this.setSwiperList(res.data.data.goods_image);
this.glist = res.data.data.spec_list;
this.user_suc = res.data.data.user_suc;
this.groupUser =res.data.data.user;
console.log(this.groupUser);
}
})
},
// 秒杀详情
spikeGoodsDetails(id) {
this.$u.api.getSpikeInfo({
groupbuy_id: id
}).then(res => {
if(res.errCode == 0) {
this.groupbuyInfo = res.data.groupbuyInfo;
this.evaluate = res.data.goodsInfo.goods_evaluate_info;
this.goodsInfo = res.data.goodsInfo.goods;
this.setSwiperList(res.data.goodsInfo.goods_image);
this.setSpikeTime(res.data.groupbuyInfo.groupbuy_endtime);
}
})
},
// 试穿
tryDress() {
this.$u.route({
url: '/pageB/triedDress/index',
params: {
id: this.id,
}
})
},
/*
* @params {Number} type 拼团或者开团
* @description 下单 订单步骤1展示结算数据
* @params {Number} type involvement 拼团或者 默认开团
* @params {Number} num 数量
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
**/
settlementOrder({type, num = 1} = {}) {
// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
if(!this.debounce) return;
this.debounce = false;
let params = {
ifcart: 0,
ifcart: ifcart,
cart_id: [this.goodsInfo.goods_id + '|' + num],
}
if(this.type == 2) {
if(type == 'involvement') {
// const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id);
console.log(this.$store.state.pintuangroup_headid);
Object.assign(params, {
pintuan_id: this.pintuan_id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id
pintuan_id: this.id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id,
})
} else {
const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', userId);
Object.assign(params, {
pintuan_id: this.pintuan_id,
pintuan_id: this.id,
})
}
}
@@ -294,19 +431,47 @@ export default {
this.$u.route({
url: '/pageC/cart/ConfirmOrder'
})
} else {
this.debounce = true;
}
})
},
// 参团
involvemenGroup(user) {
this.involvemenGroupInfo = user;
this.showGroupUser = false;
this.showInvolvementUser = true;
// console.log(this.involvemenGroupInfo);
},
xuanze(id){
console.log(id)
// this.getGoodsDetails(this.glist[id])
valChange(e) {
// console.log(this.value)
},
self(){
// console.log(this.$refs.guige)
let index = 0;
let arr = [];
for(let i in this.goodsInfo.spec_value){
// console.log(i)
// console.log(this.$refs.guige[index++].select)
// index++;
let sel = this.$refs.guige[index++].select
if(sel != 0){
arr.push(sel)
}
}
// console.log(arr.length)
if(arr.length == index){
this.sel = arr.join("|")
this.quanxuan = true
// console.log(this.sel)
}
},
xuanze(id){
// console.log(id)
this.getGoodsDetails(this.glist[id])
this.id = this.glist[id];
},
// 设置页面标题
setTitle() {
let title = '';
switch (this.type) {
@@ -318,9 +483,6 @@ export default {
break;
case 3:
title = '秒杀商品详情';
break;
case 1:
break;
default:
break;
@@ -329,6 +491,28 @@ export default {
title: title
});
},
toOthersPage(url) {
this.$u.route(url);
},
viewComment() {
this.$u.route({
url: 'pageB/comment/index',
params: {
id: this.goodsInfo.goods_id
}
})
},
// 查看轮播图
viewImage(index) {
let arr = [];
this.list.forEach(item => {
arr.push(item.image);
})
uni.previewImage({
urls: arr,
current: arr[index]
})
}
},
}
</script>
@@ -336,6 +520,7 @@ export default {
.sdetails {
padding-bottom: 98rpx;
position: relative;
background-color: #EEEBEE;
.spike-view {
position: absolute;
top: 396rpx;
@@ -397,20 +582,31 @@ export default {
}
}
.info {
background:rgba(255,255,255,1);
padding: 30rpx;
margin-bottom: 20rpx;
.title{
flex-wrap: wrap;
margin-bottom: 30rpx;
>text{
padding: 13rpx;
font-size: 24rpx;
color:#fff;
margin-right: 13rpx;
background-color: #FF780F;
.store-name {
display: inline-block;
border-radius: 25rpx;
padding: 8rpx 10rpx;
margin: 0 10rpx 4rpx 0;
vertical-align: middle;
font-size: 20rpx;
color: #fff;
border-radius: 30rpx;
background-color: #FF780F;
margin-bottom: 10rpx;
}
.goods-name {
line-height: 1.5;
}
}
.price-collect {
display: flex;
align-items: center;
justify-content: space-between;
.pic{
>text{
font-size: 32rpx;
@@ -423,6 +619,44 @@ export default {
margin-left: 30rpx;
}
}
.collect {
margin-left: auto;
display: flex;
align-items: center;
> text {
margin-left: 12rpx;
}
}
}
}
.comment {
margin-top: 20rpx;
background:rgba(255,255,255,1);
padding: 30rpx;
.title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
.left {
font-size: 30rpx;
color: rgba(51,51,51,1);
}
.right {
font-size: 24rpx;
color: rgba(153,153,153,1);
> image {
width: 8rpx;
height: 16rpx;
margin-left: 10rpx;
}
}
}
.comment-none {
font-size: 26rpx;
text-align: center;
margin-top: 30rpx;
}
}
.hr {
width: 100%;
@@ -430,6 +664,7 @@ export default {
background-color: #ececec;
}
.group-user {
background: rgba(255,255,255,1);
padding: 30rpx;
.top {
margin-bottom: 28rpx;
@@ -580,6 +815,11 @@ export default {
margin-right: 80rpx;
}
}
.pintuan-none {
font-size: 36rpx;
color: #333;
margin: 100rpx auto 0;
}
}
}
@@ -685,7 +925,8 @@ export default {
display: flex;
font-size: 32rpx;
color: rgba(255,255,255,1);
z-index: 99;
z-index: 10076;
background-color: #FFFFFF;
.launch {
flex: 1;
background: rgba(253,211,96,1);
@@ -706,7 +947,8 @@ export default {
width: 100%;
height: 98rpx;
display: flex;
z-index: 99;
z-index: 10076;
background-color: #FFFFFF;
.left {
width: 190rpx;
display: flex;
@@ -739,5 +981,82 @@ export default {
background: rgba(221,221,221,1);
}
}
.tloos{
background-color: #fff;
display: flex;
position: fixed;
height: 98rpx;
width: 100%;
bottom:0;
border-top: 1rpx solid #ececec;
z-index: 10076;
.navs{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #666;
flex-shrink: 0;
margin-left: 30rpx;
>image{
width: 35rpx;
height: 35rpx;
margin-bottom: 15rpx;
}
}
.button{
width: 100%;
height: 100%;
line-height: 98rpx;
text-align: center;
color: #fff;
}
}
.spec-popup {
padding: 30rpx;
box-sizing: border-box;
max-height: 750rpx;
.head{
display: flex;
margin-bottom: 30rpx;
.image{
width: 195rpx;
height: 195rpx;
border-radius: 10rpx;
flex-shrink: 0;
}
.info{
display: flex;
padding: 21rpx 0;
justify-content: space-between;
margin-left: 27rpx;
flex-direction: column;
>text:first-child{
font-size: 28rpx;
color: #333;
}
>text:last-child{
font-size: 30rpx;
color: #ff3131;
}
}
}
.num{
height: 84rpx;
display: flex;
border-bottom: #ececec solid 2rpx;
justify-content: space-between;
align-items: center;
>text{
font-size: 26rpx;
color: #666;
}
}
}
}
</style>

View File

@@ -1,19 +1,9 @@
<template>
<view class="search">
<view class="sosuo">
<image></image>
<u-search placeholder="搜索您需要的商品" v-model="keyword" height="60" :action-style="{
'font-size':'32rpx',
'color':'#FF780F',
'overflow':'unset'
}"
@search="search"
></u-search>
</view>
<view class="list">
<view class="title">搜索发现</view>
<view class="label">
<text>这是标签</text>
<text v-for="(label, index) in searchwordlist" :key="index" @click="search(label.word)">{{ label.word }}</text>
</view>
</view>
</view>
@@ -23,17 +13,43 @@ export default {
name:"search",
data(){
return{
keyword:""
keyword: "",
searchwordlist: [],
}
},
created() {
this.getWordList();
},
// 点击搜索按钮
onNavigationBarButtonTap(e) {
if(e.index == 0) this.search(this.keyword);
},
// 输入框文本变化
onNavigationBarSearchInputChanged(e) {
this.keyword = e.text;
},
// 点击键盘搜索按钮
onNavigationBarSearchInputConfirmed(value) {
this.search(this.keyword);
},
methods:{
getWordList() {
this.$u.api.searchwordlist().then(res => {
this.searchwordlist = res.data;
})
},
search(value){
// console.log(value)
if(!value) {
this.$u.toast('搜索内容不可为空');
return false;
}
this.$u.route({
url: "/pageB/search/out",
params: {
value,
type:"shop"
value: value,
type: "shop",
order: 'goods_salenum'
}
})
}
@@ -67,6 +83,7 @@ export default {
}
.label{
display: flex;
flex-wrap: wrap;
> text {
margin-top: 20rpx;
margin-right: 30rpx;

View File

@@ -1,11 +1,10 @@
<template>
<view class="out">
<view class="sosuo">
<image></image>
<u-search placeholder="搜索您需要的商品" v-model="keyword" height="60" :show-action="false"></u-search>
</view>
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32" active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0" height="88"></u-tabs-swiper>
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32"
active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0"
height="88"></u-tabs-swiper>
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition"
@animationfinish="animationfinish">
<swiper-item>
<scroll-view :scroll-y="true" style="height:100%">
<view style="padding-top:30rpx">
@@ -16,48 +15,32 @@
<swiper-item>
<scroll-view :scroll-y="true" style="height:100%">
<view class="list">
<darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem>
<!-- <darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem> -->
</view>
</scroll-view>
</swiper-item>
</swiper>
<view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);">
<view class="select">
<view @click="sx(0)" data-type="xl">销量</view>
<view @click="sx(0)" class="xz" data-type="xl">销量</view>
<view class="xz" @click="sx(1)">
<text>价格</text>
<view class="jiage">
<view class="top"></view>
<view class="top topxz"></view>
<view class="bottom bottomxz"></view>
</view>
</view>
<view data-type="hp" @click="sx(2)">好评</view>
</view>
<swiper class="swiper" :current="swiperCurrent" @change="huadong">
<swiper-item>
<view class="swiper" :current="swiperCurrent" @change="huadong">
<scroll-view :scroll-y="true" style="height:100%">
<view style="padding-top:30rpx">
<shop v-for="(i,j) in shoplist[0]" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid" :image="i.goods_image"></shop>
<shop v-for="(i,j) in shoplist" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid"
:image="i.goods_image"></shop>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view :scroll-y="true" style="height:100%">
<view class="list">
<!-- <darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem> -->
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view :scroll-y="true" style="height:100%">
D
</scroll-view>
</swiper-item>
</swiper>
</view>
</view>
</template>
<style lang="scss" scoped>
@@ -65,6 +48,7 @@
display: flex;
flex-direction: column;
height: 100vh;
.sosuo {
width: 100%;
height: 88rpx;
@@ -80,11 +64,14 @@
margin-right: 24rpx;
flex-shrink: 0;
}
align-items: center;
}
.swiper {
width: 100%;
height: 100%;
.list {
display: flex;
flex-wrap: wrap;
@@ -92,6 +79,7 @@
padding-left: 30rpx;
}
}
.select {
width: 100%;
height: 89rpx;
@@ -101,14 +89,17 @@
padding: 0 40rpx;
flex-shrink: 0;
justify-content: space-between;
>view {
font-size: 32rpx;
color: #333;
display: flex;
font-weight: 400;
.jiage {
display: flex;
flex-direction: column;
.top {
width: 12rpx;
border-bottom: 12rpx solid #707070;
@@ -116,20 +107,24 @@
border-right: 11rpx solid #fff;
margin-bottom: 2rpx;
}
.bottom {
width: 12rpx;
border-top: 12rpx solid #707070;
border-left: 11rpx solid #fff;
border-right: 11rpx solid #fff;
}
.topxz {
border-bottom: 12rpx solid #FF780F;
}
.bottomxz {
border-top: 12rpx solid #FF780F;
}
}
}
.xz {
color: #FF780F;
}
@@ -148,13 +143,11 @@ export default {
},
data() {
return {
list:[
{
list: [{
name: "店铺"
}, {
name: "达人"
}
],
}],
current: 0,
swiperCurrent: 0,
keyword: "",
@@ -162,6 +155,11 @@ export default {
shoplist: []
}
},
onLoad(o) {
this.type = o.type
this.keyword = o.value
this.search()
},
methods: {
tabsChange(index) {
this.swiperCurrent = index;
@@ -184,15 +182,12 @@ export default {
console.log(e.detail.current)
},
search() {
this.$u.api.ShopSearch({keyword:this.keyword}).then((res)=>{
this.shoplist[0] = res.data.data
this.$u.api.ShopSearch({
keyword: this.keyword
}).then((res) => {
this.shoplist = res.data.data
})
}
},
onLoad(o){
this.type = o.type
this.keyword = o.value
this.search()
}
}
</script>

BIN
pageB/static/cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

298
pageB/triedDress/index.vue Normal file
View File

@@ -0,0 +1,298 @@
<template>
<view class="tried">
<view class="user-info">
<view>
<label for="name">试穿人:</label>
<input type="text" id="name" placeholder="" v-model="name" />
</view>
<view>
<label for="phone">手机号:</label>
<input type="text" id="phone" placeholder="" maxlength="11" v-model="phone" />
</view>
<view class="area" @click="show=true">
<label for="address">省市区:</label>
<input type="text" id="address" placeholder="" v-model="address" disabled />
<!-- <view>
<image src="/static/image/mine/24.png"></image>
<text>定位</text>
</view> -->
</view>
<view>
<label for="area">详细地址:</label>
<input type="text" id="area" placeholder="" v-model="area" />
</view>
<view @click="showTime=true">
<label for="time">预约时间:</label>
<input type="text" id="time" placeholder="" disabled v-model="time" />
</view>
</view>
<u-picker mode="time" v-model="showTime" :params="params" @confirm="chooseDate"></u-picker>
<view class="goods-container">
<view class="store">
<image :src="store.store_avatar"></image>
<text>{{ store.store_name }}</text>
</view>
<view class="goods">
<image :src="goodsInfo.goods_image"></image>
<view class="right">
<view class="name u-line-2">{{ goodsInfo.goods_name }}</view>
<u-number-box v-model="number" bg-color="#FFFFFF" :min="1" :input-width="38" :input-height="38" color="#FF780F"></u-number-box>
</view>
</view>
</view>
<view class="edit-btn" @click="confirmBtn">确认试穿</view>
<u-select v-model="show"
mode="mutil-column-auto"
:list="areaList"
value-name="area_id"
label-name="area_name"
child-name="_child"
@confirm="setArea">
</u-select>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
show: false,
areaList: [],
checked: false, // 是否设为默认地址
name: '',
phone: '',
address: '', // 选择地址
area: '', // 详细地址
time: '',
showTime: false,
number: 1, // 商品数量
area_id: '', // 地区id 省
city_id: '', // 城市id
goodsInfo: {},
store: {},
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: false
},
debounce: true,
}
},
mounted() {
this.getAreaData();
},
onLoad(option) {
this.ordinaryDetails(option.id);
},
methods: {
verification() {
if(this.$u.test.isEmpty(this.name)) {
this.$u.toast('姓名不可为空');
return false;
}
if(this.$u.test.isEmpty(this.phone)) {
this.$u.toast('手机号不可为空');
return false;
}
if(!this.$u.test.mobile(this.phone)) {
this.$u.toast('请正确填写手机号');
return false;
}
if(this.$u.test.isEmpty(this.address)) {
this.$u.toast('地址不可为空');
return false;
}
if(this.$u.test.isEmpty(this.area)) {
this.$u.toast('详细地址不可为空');
return false;
}
if(this.$u.test.isEmpty(this.time)) {
this.$u.toast('预约时间不可为空');
return false;
}
if(new Date(this.time) < new Date()) {
this.$u.toast('预约时间错误');
return false;
}
if(this.number > this.goodsInfo.goods_storage) {
this.$u.toast('库存不足');
return false;
}
return true;
},
chooseDate(e) {
let time = e.year + '/' + e.month + '/' + e.day + ' ' + e.hour + ':' + e.minute;
this.time = time;
},
confirmBtn() {
if(!this.debounce) return;
if(!this.verification()) return false;
this.debounce = false;
this.$u.api.saveGoodsTry({
member_name: this.name,
member_mobile: this.phone,
area_info: this.address,
address_detail: this.area,
goods_id: this.goodsInfo.goods_id,
num: this.number,
store_id: this.store.store_id,
appointment_time: new Date(this.time),
}).then(res => {
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
back: true,
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
this.debounce = true;
}
})
},
getAreaData() {
this.$u.api.getArea().then((res)=>{
if (res.errCode == 0) {
this.areaList = res.data;
}
})
},
setArea(area) {
// console.log(area);
this.area_id = area[0].value;
this.city_id = area[1].value;
let temp = '';
area.forEach(e => {
temp += e.label + ' ';
});
this.address = temp;
},
ordinaryDetails(id) {
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
if (res.errCode == 0) {
this.goodsInfo = res.data.goods;
this.store = res.data.store;
}
})
},
}
};
</script>
<style lang="scss" scoped>
.tried {
.user-info {
border-top: 1rpx solid rgba(235,235,235,1);
> view {
display: flex;
align-items: center;
height: 98rpx;
padding: 30rpx;
border-bottom: 2rpx solid rgba(235,235,235,1);
font-size: 30rpx;
> label {
width: 150rpx;
margin-right: 20rpx;
}
> input {
flex: 1;
outline: none;
}
}
.area {
padding: 0 30rpx;
display: flex;
> input {
padding: 30rpx 0;
flex: 1;
}
> view {
margin-left: 30rpx;
width: 50rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: rgba(255,120,15,1);
> image {
width: 26rpx;
height: 32rpx;
margin-bottom: 10rpx;
}
}
}
}
.goods-container {
padding: 30rpx;
.store {
display: flex;
align-items: center;
margin-bottom: 20rpx;
> image {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-right: 16rpx;
background-color: antiquewhite;
}
> text {
font-size: 28rpx;
color: rgba(51,51,51,1);
}
}
.goods {
display: flex;
> image {
width: 180rpx;
height: 160rpx;
border-radius: 10rpx;
margin-right: 30rpx;
background-color: aquamarine;
}
.right {
flex: 1;
.name {
font-size: 30rpx;
color: rgba(51,51,51,1);
line-height: 44rpx;
margin-bottom: 30rpx;
}
/deep/ .u-numberbox {
border: 1rpx solid rgba(217,215,215,1);
.u-icon-minus, .u-icon-plus {
width: 38rpx;
.u-icon {
.u-icon__icon {
font-size: 11rpx;
}
}
}
.u-number-input {
margin: 0;
border: 1rpx solid rgba(229,229,229,1) {
top: 0;
bottom: 0;
};
}
}
}
}
}
.edit-btn {
margin: 122rpx auto 0;
width: 690rpx;
height: 98rpx;
background: rgba(255,119,15,1);
border-radius: 49rpx;
font-size: 36rpx;
color:rgba(255,255,255,1);
line-height: 98rpx;
text-align: center;
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view class="order">
<view class="info-address" @click="changeAddress">
<view class="info-address" @click="changeAddress" v-if="JSON.stringify(addressInfo) != '{}'">
<image src="../static/image/2.png" class="address-icon"></image>
<view class="address">
<view class="user-info">
@@ -11,11 +11,12 @@
</view>
<image src="../static/image/1.png" class="right"></image>
</view>
<view v-else class="address-none" @click="changeAddress">请选择地址</view>
<view class="main">
<view v-for="(item, index) in orderInfo.store_cart_list" :key="index">
<view class="goods-info">
<view class="store">
<image class="avatar" :src="item[0].store_avatar"></image>
<image class="avatar" :src="orderInfo.store_list[index].store_avatar"></image>
<view>{{ item[0].store_name }}</view>
<image src="../static/image/1.png" class="right"></image>
</view>
@@ -68,13 +69,13 @@
<u-popup v-model="couponStatus" mode="bottom">
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 1">
<view class="title">优惠券详情</view>
<view class="text">店铺优惠券</view>
<view class="text">平台优惠券</view>
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_all_list" :key="index"></Coupon>
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_all_list.length"></u-empty>
</scroll-view>
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 2">
<view class="title">优惠券详情</view>
<view class="text">平台优惠券</view>
<view class="text">店铺优惠券</view>
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_list[this.couponType.store_id]" :key="index"></Coupon>
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_list[this.couponType.store_id].length"></u-empty>
</scroll-view>
@@ -121,7 +122,7 @@ export default {
choiceCoupon: {}, // 使用的平台优惠券
goodsClass: [],
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
debounce: true,
}
},
components: {
@@ -147,16 +148,20 @@ export default {
onLoad(option) {
this.orderType = this.$store.state.orderType;
this.orderInfo = this.$store.state.orderInfo;
console.log(this.orderType);
console.log(this.orderInfo);
// console.log(this.orderType);
// console.log(this.orderInfo);
this.getGoodsClass();
this.setTotalPrice();
},
onShow() {
this.debounce = true;
this.storeCoupon = {};
this.choiceCoupon = {};
// 判断是不是从选择地址页面返回
if(JSON.stringify(this.$store.state.orderAddress) == '{}') {
this.$store.commit('updateAddress', this.orderInfo.address_info);
if(this.orderInfo.address_info) this.$store.commit('updateAddress', this.orderInfo.address_info);
} else {
this.addressInfo = this.$store.state.orderAddress;
if(this.$store.getters.getOrderAddress) this.addressInfo = this.$store.state.orderAddress;
}
},
beforeDestroy() {
@@ -165,22 +170,8 @@ export default {
watch: {
'$store.state.orderAddress'(value) {
this.addressInfo = value;
this.getFreight();
if(JSON.stringify(value) != '{}') this.getFreight();
},
// storeCoupon: {
// deep: true,
// handler() {
// console.log(222);
// this.setTotalPrice(); // 计算总价
// }
// },
// choiceCoupon: {
// deep: true,
// handler() {
// console.log(111);
// this.setTotalPrice(); // 计算总价
// }
// },
},
methods: {
// 如果有pintuangroup_headid为参团不然为开团
@@ -188,26 +179,36 @@ export default {
let params = {
pintuan_id: this.orderInfo.pintuan_id,
}
// console.log(this.involvemenGroupInfo);
// console.log(this.orderInfo);
// console.log(this.$store.state.pintuangroup_headid);
if(this.orderInfo.pintuangroup_id) {
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
}
// console.log(params);
console.log(params);
this.$u.api.withImmediate(params).then(res => {
this.showGroupUser = false;
this.showInvolvementUser = false;
if(res.errCode == 0) {
this.sendOrder(0);
} else {
this.debounce = true;
this.$u.toast(res.message);
}
})
},
intermediate() {
if(this.orderType == 2) this.withImmediate();
else this.sendOrder(1);
if(!this.debounce) return;
this.debounce = false;
if(this.orderType == 2) {
this.withImmediate();
} else if(this.orderType == 1) {
this.sendOrder(0);
} else {
this.sendOrder(1);
}
},
// @params {Number} ifcart 是否是购物车商品
sendOrder(ifcart) {
// 拼接后端需要的数据形式
let id = [], temp = '';
@@ -236,28 +237,37 @@ export default {
if(JSON.stringify(this.choiceCoupon) != '{}') {
coupon.push(0 + '|' + this.choiceCoupon.voucher_id)
}
// 验证是否选择地址
if(!this.addressInfo || JSON.stringify(this.addressInfo) == '{}') {
this.$u.toast('收货地址不能为空');
return false;
}
let params = {
ifcart: ifcart,
cart_id: id,
address_id: this.addressInfo.address_id,
buy_city_id: this.addressInfo.city_id,
voucher_id: coupon,
}
if(coupon.length) Object.assign(params, { voucher_id: coupon });
if(this.orderType == 2) {
Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id })
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id })
Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id });
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
}
// console.log(params);
this.$u.api.sendOrder(params).then(res => {
if(res.errCode == 0) {
this.$u.route({
type: 'redirect',
url: '/pageC/cart/cashier',
params: {
ifcart: params.ifcart,
pay_sn: res.data.pay_sn,
price: res.data.order_total_amount,
order_id: res.data.order_list[0].order_id,
}
})
} else {
this.debounce = true;
this.$u.toast(res.message);
}
})
@@ -297,6 +307,7 @@ export default {
},
setTotalPrice() {
const goods = this.orderInfo.store_goods_total;
// console.log(this.freight);
const freight = this.freight;
let price = 0;
// 商品价格加上运费
@@ -391,6 +402,14 @@ export default {
height: 22rpx;
}
}
.address-none {
height: 150rpx;
line-height: 150rpx;
margin-bottom: 10rpx;
background:rgba(255,255,255,1);
text-align: center;
color: #333;
}
.main {
margin-bottom: 50rpx;
> view {
@@ -407,8 +426,8 @@ export default {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
border: 1rpx solid #000;
margin-right: 15rpx;
background-color: aquamarine;
}
> view {
font-size: 28rpx;

View File

@@ -11,8 +11,8 @@
<image :src="item.icon"></image>
<text class="name">{{ item.pay_way }}</text>
</view>
<view class="radio-view" :class="pay_way == item.name ? 'active' : 'default'">
<u-radio :name="item.name" active-color="#FF780F" :disabled="item.disabled"></u-radio>
<view class="" :class="pay_way == item.name ? 'active' : 'default'">
<u-radio class="radio-view" shape="circle" :name="item.name" active-color="#FF780F" :disabled="item.disabled"></u-radio>
</view>
</view>
</u-radio-group>
@@ -39,13 +39,18 @@ export default {
}
],
pay_way: 'wxpay_app',
pay_sn: '',
price: '',
pay_sn: '',
ifcart: '',
order_id: '',
}
},
onLoad(option) {
this.pay_sn = option.pay_sn;
console.log(option);
this.ifcart = option.ifcart;
this.price = option.price;
this.pay_sn = option.pay_sn;
this.order_id = option.order_id;
},
methods: {
radioGroupChange(e) {
@@ -54,29 +59,44 @@ export default {
// getProvider() {
// uni.getProvider({service: 'payment'})
// },
// 支付宝支付
payByAlipay (orderInfo) {
payOrder(provider, orderInfo) {
let me = this;
uni.requestPayment({
provider: 'alipay',
orderInfo: orderInfo, //支付宝订单数据
success: function (res) {
provider: provider,
orderInfo: orderInfo, //订单数据
success: (res) => {
console.log('success:' + JSON.stringify(res));
},
fail: function (err) {
console.log('fail:' + JSON.stringify(err));
this.$u.toast("支付成功!");
setTimeout(function(){
if (Boolean(parseInt(me.ifcart))) {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Index',
})
} else {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Details?oid=' + me.order_id,
})
}
});
},2000)
},
// 微信支付
payByWxpay (orderInfo) {
uni.requestPayment({
provider: 'wxpay',
orderInfo: orderInfo, //微信订单数据
success: function (res) {
console.log('success:' + JSON.stringify(res));
},
fail: function (err) {
fail: (err) => {
console.log('fail:' + JSON.stringify(err));
this.$u.toast("支付失败,支付已取消!");
setTimeout(function(){
if (Boolean(parseInt(me.ifcart))) {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Index',
})
} else {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Details?oid=' + me.order_id,
})
}
},2000)
}
});
},
@@ -86,11 +106,15 @@ export default {
payment_code: this.pay_way,
}).then(res => {
if(res.errCode == 0) {
// this.$u.toast(res.message);
// uni.navigateBack();
const orderInfo = JSON.parse(res.data.content);
console.log(orderInfo);
this.pay_way == 'wxpay_app' ? this.payByWxpay(orderInfo) : this.payByAlipay(orderInfo);
let orderInfo, provider;
if(res.data.payment_code == 'wxpay_app') {
provider = 'wxpay';
orderInfo = JSON.parse(res.data.content);
} else if(res.data.payment_code == 'alipay_app') {
provider = 'alipay';
orderInfo = res.data.content;
}
this.payOrder(provider, orderInfo);
}
})
}
@@ -125,15 +149,18 @@ export default {
/deep/ .u-radio-group {
width: 100%;
flex-direction: column;
.radio-view {
padding: 6rpx;
border-radius: 50%;
.u-radio__icon-wrap {
width: 30rpx !important;
height: 30rpx !important;
padding: 4rpx;
border: 1px solid #FF780F;
}
.active {
border: 2rpx solid rgba(255,120,15,1);
}
.default {
border: 2rpx solid rgba(219,219,219,1);
}
.radio-view {
}
.u-radio {
.u-icon {
@@ -145,13 +172,13 @@ export default {
}
}
.pay-item {
height: 98rpx;
background: rgba(255,255,255,1);
padding: 24rpx 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
height: 98rpx;
padding: 24rpx 30rpx;
margin-bottom: 2rpx;
background: rgba(255,255,255,1);
.pay-way {
display: flex;
align-items: center;

View File

@@ -4,7 +4,7 @@
<view v-for="(store, s_index) in list" :key="s_index" class="cart-item">
<view class="store">
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
<view class="name">
<view class="name" @click="viewStoreDetails(store.store_id)">
<image :src="store.store_avatar"></image>
<view>{{ store.store_name }}</view>
</view>
@@ -13,8 +13,8 @@
<u-checkbox-group @change="goodsChange($event, s_index)">
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index"></u-checkbox>
<image :src="goods.goods_image"></image>
<view class="info">
<image :src="goods.goods_image" @click="viewGoodsDetails(goods.goods_id)"></image>
<view class="info" @click="viewGoodsDetails(goods.goods_id)">
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">{{ goods.goods_price }}</view>
@@ -54,6 +54,7 @@ export default {
checkedAll: false,
checkedGoods: [],
totalPrice: '0.00',
debounce: true,
}
},
watch: {
@@ -73,7 +74,12 @@ export default {
deep: true
}
},
onPullDownRefresh() {
this.debounce = true;
this.getCartList();
},
onShow() {
this.debounce = true;
this.getCartList();
},
methods: {
@@ -88,6 +94,8 @@ export default {
},
// 结算
settlementOrder() {
if(!this.debounce) return;
this.debounce = false;
if(!this.checkedGoods.length) return false;
// 拼接后端需要的数据形式
let id = [], temp = '';
@@ -105,12 +113,16 @@ export default {
this.$u.route({
url: '/pageC/cart/ConfirmOrder'
})
} else {
this.$u.toast(res.message);
this.debounce = true;
}
})
},
getCartList() {
this.$u.api.getCartTreeList().then(res => {
if (res.errCode == 0) {
uni.stopPullDownRefresh();
let list = res.data.store_cart_list;
list.forEach((item, l_index) => {
// 判断有无 checked 属性,如果有取值再赋值, 没有给默认值 false
@@ -192,6 +204,23 @@ export default {
})
this.list[value[1]].checked = checked;
this.storeChange();
},
viewStoreDetails(sid) {
this.$u.route({
url: 'pageC/merchant/index',
params: {
id: sid
}
})
},
viewGoodsDetails(gid) {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: gid,
type: 1,
}
})
}
},
onNavigationBarButtonTap(btn) {
@@ -280,6 +309,7 @@ export default {
.info {
width: 418rpx;
height: 160rpx;
line-height: 48rpx;
display: flex;
flex-direction: column;
justify-content: space-between;

193
pageC/classify/goods.vue Normal file
View File

@@ -0,0 +1,193 @@
<template>
<view class="classify-goods">
<view class="tab-container">
<view class="salenum" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">销量</view>
<view class="price" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">
<view class="text">价格</view>
<view class="icon">
<u-icon name="arrow-up-fill" :color="(current == 1 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
<u-icon name="arrow-down-fill" :color="(current == 1 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
</view>
</view>
<view class="evaluation" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">好评</view>
</view>
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-item" @click="toDetailsPage(goods.goods_id)">
<image :src="goods.goods_image"></image>
<view class="right">
<view class="name u-line-1">{{ goods.goods_name }}</view>
<view class="briefing u-line-2">{{ goods.goods_advword }}</view>
</view>
</view>
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
pageSize: 12,
cid: '',
page: 1,
current: 0,
priceOrderAsc: true, // 是否升序
goodsList: [],
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, // 防止上拉加载短时间内多次调用
}
},
watch: {
current(value) {
this.page = 1;
this.goodsListByClassId({ laod: 'reload' });
},
priceOrderAsc(value) {
this.page = 1;
this.goodsListByClassId({ laod: 'reload' });
}
},
onLoad(option) {
this.cid = option.cid;
this.goodsListByClassId({ load: 'reload' });
this.setViewHeight();
this.setTitle(option.cname);
},
methods: {
setOrderSort() {
let sort = '';
if(this.current == 0) {
sort = 'goods_salenum';
} else if (this.current == 1) {
if(this.priceOrderAsc) sort = 'goods_price_asc';
else sort = 'goods_price_desc';
} else if (this.current == 2) {
sort = 'evaluation_count';
}
return sort;
},
// 排序方式 goods_salenum销量 evaluation_count评价 goods_price_asc价格从低到高 goods_price_desc价格从高到低
async goodsListByClassId({ load = 'reload' } = {}) {
const sort = this.setOrderSort();
const res = await this.$u.api.goodsListByClassId({
gc_id: this.cid,
page: this.page,
order: sort,
})
this.timer = true;
if(res.errCode == 0) {
if(load == 'reload') this.goodsList = res.data.data;
else if(load == 'loadmore') this.goodsList.push(...res.data.data);
}
return res.data.data.length;
},
loadMore() {
if(this.goodsList.length < this.pageSize) return false;
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.goodsListByClassId({ load: 'loadmore' }).then(length => {
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
switchCurrent(current) {
if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc;
this.current = current;
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeight = res.windowHeight - (90 / 2) + 'px';
},
setTitle(title) {
uni.setNavigationBarTitle({
title: title
});
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
id: id,
type: 1 // 商品详情 商品类型 1普通 2拼团 3秒杀 4优惠券
});
}
}
};
</script>
<style lang="scss" scoped>
.classify-goods {
.tab-container {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
margin-bottom: 30rpx;
> view {
height: 30rpx;
line-height: 30rpx;
flex: 1;
font-size: 32rpx;
color: rgba(51,51,51,1);
}
.salenum {
text-align: left;
}
.price {
display: flex;
align-items: center;
justify-content: center;
.text {
margin-right: 5rpx;
}
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
.evaluation {
text-align: right;
}
.current {
color: rgba(255,120,15,1);
}
}
.goods-container {
.goods-item {
margin: 0 auto;
width: 690rpx;
display: flex;
background-color: #F5F5F5;
margin-bottom: 30rpx;
align-items: center;
> image {
width: 220rpx;
height: 200rpx;
flex-shrink: 0;
margin-right: 30rpx;
}
.right {
width: 418rpx;
.name {
font-size: 30rpx;
color: rgba(51,51,51,1);
margin-bottom: 20rpx;
}
.briefing {
font-size: 28rpx;
color: rgba(102,102,102,1);
line-height: 42rpx;
}
}
}
}
}
</style>

View File

@@ -15,7 +15,7 @@
<text>{{item.gc_name}}</text>
</view>
<view class="item-container">
<view class="thumb-box" v-for="(item1, index1) in item._child" :key="index1">
<view class="thumb-box" v-for="(item1, index1) in item._child" :key="index1" @click="toClassifyPage(item1.gc_id, item1.gc_name)">
<image class="item-menu-image" :src="item1.img" mode=""></image>
<view class="item-menu-name">{{item1.gc_name}}</view>
</view>
@@ -49,7 +49,18 @@
onReady() {
this.getMenuItemTop()
},
onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageB/search/index');
},
onNavigationBarSearchInputClicked() {
this.$u.route('/pageB/search/index');
},
methods: {
toSearchPage() {
this.$u.route({
url: "pageB/search/index"
})
},
// 获取分类列表
getClassifyList() {
this.$u.api.getGoodsClassifyList().then(res => {
@@ -161,6 +172,12 @@
}
}
}, 10)
},
toClassifyPage(id, name) {
this.$u.route('pageC/classify/goods', {
cid: id,
cname: name,
});
}
}
}

View File

@@ -1,6 +1,6 @@
<template>
<view class="imageTop">
<image :src="url"></image>
<image :src="url" mode="aspectFit"></image>
</view>
</template>
<style lang="scss" scoped>

View File

@@ -1,7 +1,7 @@
<template>
<view class="listItem">
<video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video>
<image v-else :src="url"></image>
<image v-else :src="url" mode="aspectFit"></image>
</view>
</template>
<style lang="scss" scoped>

View File

@@ -5,9 +5,9 @@
</view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index">
<scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
<scroll-view scroll-y style="width: 100%;" @scrolltolower="onreachBottom">
<SpecialGoods v-for="(item, index) in pinTuanList" :key="index" :item="item" type='group'></SpecialGoods>
<!-- <loadmore ref="loadmore" @callback="getPinTuanList" bgColor="#FFF"></loadmore> -->
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="pinTuanList.length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList.length"></u-empty>
</scroll-view>
</swiper-item>
@@ -15,22 +15,22 @@
</view>
</template>
<script>
import loadmore from "@/components/loadmore/index";
import SpecialGoods from "../../components/shop/special-shop/index";
export default {
data() {
return {
pageSize: 12,
tabList: [],
current: -1,
swiperCurrent: 0,
page: 0,
pinTuanList: [],
swiperHeight: '',
timer: '', // 限制下拉刷新
timer: true, // 限制下拉刷新
loadStatus: 'loadmore',
}
},
components: {
loadmore,
SpecialGoods,
},
onLoad() {
@@ -39,8 +39,7 @@ export default {
},
watch: {
current(index) {
// console.log(this.tabList);
this.getPinTuanList({id: this.tabList[index].gc_id });
this.getPinTuanList({ id: this.tabList[index].gc_id, load: 'reload' });
}
},
methods: {
@@ -54,14 +53,39 @@ export default {
})
},
// 拼团列表
async getPinTuanList({ id, page }) {
async getPinTuanList({ id, page, load }) {
const res = await this.$u.api.getPinTuanList({
page: this.page,
gc_id: id,
})
this.pinTuanList = res.data;
this.timer = true;
if (res.errCode == 0) {
if(load == 'reload') this.pinTuanList = res.data;
else if(load == 'loadmore') this.pinTuanList.push(...res.data);
}
return res.data.length;
},
// scroll-view到底部加载更多
onreachBottom() {
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.getPinTuanList({
id: this.tabList[this.current].gc_id,
load: 'loadmore',
}).then(length => {
console.log(length);
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loadmore';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
@@ -78,24 +102,6 @@ export default {
this.swiperCurrent = current;
this.current = current;
},
// scroll-view到底部加载更多
onreachBottom() {
this.$$refs.loadmore.reachBottom();
// if(!this.timer) return false;
// this.loadStatus = "loading";
// this.page++;
// this.getPinTuanList().then(length => {
// if(length == 0) {
// this.page--;
// this.status = 'nomore';
// } else {
// this.status = 'loading';
// }
// }).catch(() => {
// this.loadStatus = "nomore";
// this.page--;
// })
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.swiperHeight = res.windowHeight - (88 / 2) + 'px';

View File

@@ -0,0 +1,215 @@
<template>
<view class="classify-goods">
<view class="tab-container">
<view class="overall" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">综合</view>
<view class="salenum" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">销量</view>
<view class="new" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">新品</view>
<view class="price" :class="{ 'current' : current == 3 }" @click="switchCurrent(3)">
<view class="text">价格</view>
<view class="icon">
<u-icon name="arrow-up-fill" :color="(current == 3 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
<u-icon name="arrow-down-fill" :color="(current == 3 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
</view>
</view>
</view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<goodsItem :info="goods"></goodsItem>
</view>
</view>
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
</scroll-view>
</view>
</template>
<script>
import goodsItem from "@/components/shop/list/item"
export default {
data() {
return {
pageSize: 15,
cid: '',
page: 1,
current: 0,
priceOrderAsc: true, // 是否升序
goodsList: [],
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, // 防止上拉加载短时间内多次调用
}
},
components: {
goodsItem
},
watch: {
current(value) {
this.page = 1;
this.goodsList = [];
this.getStoreGoodsList({ laod: 'reload' });
},
priceOrderAsc(value) {
this.page = 1;
this.getStoreGoodsList({ laod: 'reload' });
}
},
onLoad(option) {
if(option.cid == 'all') {
this.current = 0;
this.cid = 0;
} else if(option.cid == 'new') {
this.current = 2;
this.cid = 0;
} else {
this.cid = option.cid;
}
this.setTitle(option.name);
this.sid = option.sid;
this.setViewHeight();
this.getStoreGoodsList({ load: 'reload' });
},
methods: {
setOrderSort() {
let sort = '';
if(this.current == 0) {
sort = 'goods_sort';
} else if(this.current == 1) {
sort = 'goods_salenum';
} else if(this.current == 2) {
sort = 'goods_addtime';
} else if(this.current == 3) {
if(this.priceOrderAsc) sort = 'goods_price_asc';
else sort = 'goods_price_desc';
}
return sort;
},
// 排序方式 goods_salenum销量 evaluation_count评价 goods_price_asc价格从低到高 goods_price_desc价格从高到低
async getStoreGoodsList({ load = 'reload' } = {}) {
const sort = this.setOrderSort();
let params = {
id: this.sid,
page: this.page,
order: sort,
};
console.log(this.cid);
if(this.cid) Object.assign(params, { gc_id: this.cid })
const res = await this.$u.api.getStoreGoodsList(params);
this.timer = true;
if(res.errCode == 0) {
this.pageSize = res.data.per_page;
if(load == 'reload') this.goodsList = res.data.data;
else if(load == 'loadmore') this.goodsList.push(...res.data.data);
}
return res.data.data.length;
},
loadMore() {
if(this.goodsList.length < this.pageSize) return false;
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.getStoreGoodsList({ load: 'loadmore' }).then(length => {
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
switchCurrent(current) {
if(current == 3 && this.current == 3) this.priceOrderAsc = !this.priceOrderAsc;
this.current = current;
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeight = res.windowHeight - 90 / 2 + 'px';
// console.log(this.scrollHeight);
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
id: id,
type: 1 // 商品详情 商品类型 1普通 2拼团 3秒杀 4优惠券
});
},
setTitle(title){
uni.setNavigationBarTitle({
title: title
});
},
}
};
</script>
<style lang="scss" scoped>
.classify-goods {
width: 100%;
background-color: #FFFFFF;
.tab-container {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
justify-content: space-between;
> view {
height: 30rpx;
line-height: 30rpx;
font-size: 32rpx;
color: rgba(51,51,51,1);
}
.price {
display: flex;
align-items: center;
justify-content: flex-end;
.text {
margin-right: 5rpx;
}
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
.current {
color: rgba(255,120,15,1);
}
}
.scroll-container {
box-sizing: border-box;
padding: 0 30rpx;
.goods-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
// .goods-view {
// margin: 0 auto;
// width: 690rpx;
// display: flex;
// background-color: #F5F5F5;
// margin-bottom: 30rpx;
// align-items: center;
// > image {
// width: 220rpx;
// height: 170rpx;
// flex-shrink: 0;
// margin-right: 30rpx;
// }
// .right {
// width: 418rpx;
// .name {
// font-size: 30rpx;
// color: rgba(51,51,51,1);
// margin-bottom: 20rpx;
// }
// .briefing {
// font-size: 28rpx;
// color: rgba(102,102,102,1);
// line-height: 36rpx;
// }
// }
// }
}
}
</style>

View File

@@ -3,14 +3,14 @@
<view class="top">
<image :src="info.store_avatar"></image>
<view class="name">{{info.store_name}}</view>
<view class="info">创建时间{{store_addtime|date}} | {{info.live_store_address}}</view>
<view class="info">创建时间{{ info.store_addtime | date('yyyy年mm月dd日') }} | {{ info.live_store_address || '暂无地址' }}</view>
<view class="num">
<view>
<view class="value">{{info.store_collect}}</view>
<view class="title">粉丝数</view>
</view>
<view>
<view class="value">23435</view>
<view class="value">{{ info.evaluatecount }}</view>
<view class="title">评价</view>
</view>
<view>
@@ -22,9 +22,9 @@
<view class="bottom">
<view class="title">
<view>工商执照</view>
<image></image>
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
</view>
<view class="image-list">
<view class="image-list" v-if="info.business_licence_number_electronic">
<image :src="info.business_licence_number_electronic"></image>
</view>
</view>
@@ -37,9 +37,9 @@ export default {
info:{}
}
},
onLoad(){
this.$u.api.getStoreInfo({id:1}).then((res)=>{
console.log(res)
onLoad(option){
this.$u.api.getStoreInfo({id: option.id}).then((res)=>{
// console.log(res)
this.info = res.data
})
}
@@ -113,11 +113,6 @@ export default {
font-weight: 500;
color: rgba(51,51,51,1);
}
> image {
width: 24rpx;
height: 14rpx;
background-color: aqua;
}
}
.image-list {
background-color: #ffffff;

200
pageC/merchant/goods.vue Normal file
View File

@@ -0,0 +1,200 @@
<template>
<view class="classify-goods">
<view class="tab-container">
<view class="overall" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">综合</view>
<view class="salenum" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">销量</view>
<view class="new" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">新品</view>
<view class="price" :class="{ 'current' : current == 3 }" @click="switchCurrent(3)">
<view class="text">价格</view>
<view class="icon">
<u-icon name="arrow-up-fill" :color="(current == 3 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
<u-icon name="arrow-down-fill" :color="(current == 3 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
</view>
</view>
</view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container">
<view v-for="(goods, index) in goodsList" :key="index" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<goodsItem :info="goods"></goodsItem>
</view>
</view>
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
</scroll-view>
</view>
</template>
<script>
import goodsItem from "@/components/shop/list/item"
export default {
data() {
return {
pageSize: 15,
cid: '',
page: 1,
current: 0,
priceOrderAsc: true, // 是否升序
goodsList: [],
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, // 防止上拉加载短时间内多次调用
}
},
components: {
goodsItem
},
props: {
sid: String
},
watch: {
current(value) {
this.page = 1;
this.goodsList = [];
this.getStoreGoodsList({ laod: 'reload' });
},
priceOrderAsc(value) {
this.page = 1;
this.getStoreGoodsList({ laod: 'reload' });
}
},
created() {
this.setViewHeight();
this.getStoreGoodsList({ load: 'reload' });
},
methods: {
setOrderSort() {
let sort = '';
if(this.current == 0) {
sort = 'goods_sort';
} else if(this.current == 1) {
sort = 'goods_salenum';
} else if(this.current == 2) {
sort = 'goods_addtime';
} else if(this.current == 3) {
if(this.priceOrderAsc) sort = 'goods_price_asc';
else sort = 'goods_price_desc';
}
return sort;
},
// 排序方式 goods_salenum销量 evaluation_count评价 goods_price_asc价格从低到高 goods_price_desc价格从高到低
async getStoreGoodsList({ load = 'reload' } = {}) {
const sort = this.setOrderSort();
const res = await this.$u.api.getStoreGoodsList({
id: this.sid,
page: this.page,
order: sort,
})
this.timer = true;
if(res.errCode == 0) {
this.pageSize = res.data.per_page;
if(load == 'reload') this.goodsList = res.data.data;
else if(load == 'loadmore') this.goodsList.push(...res.data.data);
}
return res.data.data.length;
},
loadMore() {
if(this.goodsList.length < this.pageSize) return false;
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.getStoreGoodsList({ load: 'loadmore' }).then(length => {
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
switchCurrent(current) {
if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc;
this.current = current;
},
setViewHeight() {
const res = uni.getSystemInfoSync();
const otherHeight = 347 + 140 + 20 + 98;
this.scrollHeight = res.windowHeight - otherHeight / 2 + 'px';
// console.log(this.scrollHeight);
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
id: id,
type: 1 // 商品详情 商品类型 1普通 2拼团 3秒杀 4优惠券
});
}
}
};
</script>
<style lang="scss" scoped>
.classify-goods {
width: 100%;
background-color: #FFFFFF;
.tab-container {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
justify-content: space-between;
> view {
height: 30rpx;
line-height: 30rpx;
font-size: 32rpx;
color: rgba(51,51,51,1);
}
.price {
display: flex;
align-items: center;
justify-content: flex-end;
.text {
margin-right: 5rpx;
}
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
.current {
color: rgba(255,120,15,1);
}
}
.scroll-container {
box-sizing: border-box;
padding: 0 30rpx;
.goods-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
// .goods-view {
// margin: 0 auto;
// width: 690rpx;
// display: flex;
// background-color: #F5F5F5;
// margin-bottom: 30rpx;
// align-items: center;
// > image {
// width: 220rpx;
// height: 170rpx;
// flex-shrink: 0;
// margin-right: 30rpx;
// }
// .right {
// width: 418rpx;
// .name {
// font-size: 30rpx;
// color: rgba(51,51,51,1);
// margin-bottom: 20rpx;
// }
// .briefing {
// font-size: 28rpx;
// color: rgba(102,102,102,1);
// line-height: 36rpx;
// }
// }
// }
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view class="merchant">
<view v-if="show">
<!-- <view v-if="show" class="show-hide">
<view>
<image></image>
<view>消息</view>
@@ -13,67 +13,67 @@
<image></image>
<view>我的</view>
</view>
</view>
</view> -->
<view class="top" :style="{'background-image':'url(' + info.store_banner + ')'}">
<image :src="info.store_avatar"></image>
<view class="info">
<view class="name u-line-1">{{info.store_name}}</view>
<view class="num">粉丝数{{info.store_collect}}</view>
</view>
<view class="btn">
<image></image>
<view>{{ 0 ? "关注" : "已关注" }}</view>
<view class="btn" @click="attentionMember">
<image src="/static/image/shop/8.png"></image>
<view>{{ info.is_attention == 0 ? "关注" : "已关注" }}</view>
</view>
</view>
<view class="follow">
<view class="follow" v-if="info.attention_member && info.attention_member.length">
<view class="title">关注</view>
<scroll-view scroll-x class="list">
<view class="list-items">
<view v-for="(item, index) in 9" :key="index" class="item">
<image></image>
<view class="nickname u-line-1">用户昵称</view>
<view v-for="(item, index) in info.attention_member" :key="index" class="item">
<image :src="item.friend_frommavatar"></image>
<view class="nickname u-line-1">{{ item.friend_frommname }}</view>
</view>
</view>
</scroll-view>
</view>
<view class="main">
<view class="classify" v-if="cur==0">
<scroll-view class="video-image" scroll-y v-if="cur==0 && indextop.length" :style="{ height: scrollHeiht }">
<view v-for="item in indextop" :key="item.id">
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.url"></imageTop>
<videoTop :url="item.article_pic" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.article_pic"></imageTop>
</view>
<view style="display: flex;flex-wrap: wrap;">
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem>
<view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length">
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.article_pic"></listitem>
</view>
</view>
<!-- 商品筛选排序未完成 -->
</scroll-view>
<view class="item" v-if="cur==1">
<item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item>
<goods :sid="sid"></goods>
</view>
</view>
<view class="tabbar">
<view @click="cur=0">
<image></image>
<view @click="switchCurrent(0)">
<image src="/static/image/shop/9.png"></image>
<view>商品分类</view>
</view>
<view @click="cur=1">
<image></image>
<view>商品列表</view>
<view @click="switchCurrent(1)">
<image src="/static/image/shop/10.png" v-if="cur != 1"></image>
<image src="/static/image/shop/13.png" v-else></image>
<view :style="{ color: cur == 1 ? '#FF780F' : '#999999' }">商品列表</view>
</view>
<view @click="toDetailsPage">
<image></image>
<view @click="switchCurrent(2)">
<image src="/static/image/shop/11.png"></image>
<view>店铺信息</view>
</view>
<view>
<image></image>
<view @click="switchCurrent(3)">
<image src="/static/image/shop/12.png"></image>
<view>联系客服</view>
</view>
</view>
</view>
</template>
<script>
import item from "@/components/shop/list/item"
// import item from "@/components/shop/list/item"
import goods from "./goods"
import videoTop from "../components/merchant/video-top"
import imageTop from "../components/merchant/image-top"
import listitem from "../components/merchant/list-item"
@@ -81,47 +81,103 @@ import listitem from "../components/merchant/list-item"
export default {
data() {
return {
sid: '',
show: false,
cur: 0,
list: [],
indexlist: [],
indextop: [],
info:{}
info: {},
page: 0,
scrollHeiht: '',
}
},
components:{
item,
goods,
videoTop,
imageTop,
listitem
},
onPullDownRefresh() {
this.getStoreInfo();
this.getArticlelist();
// this.getStoreImgVideoList();
},
onNavigationBarButtonTap(e) {
// console.log(e.index);
if(e.index == 1) this.$u.route('/pageC/cart/index');
// if(e.index == 0) this.show = true;
},
methods: {
toDetailsPage() {
uni.navigateTo({
url: './details'
});
switchCurrent(current) {
this.cur = current;
if(current == 0) {
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid });
} else if(current == 2) {
this.$u.route('/pageC/merchant/details', { id: this.sid });
}
},
onLoad(){
this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
// console.log(res.data)
this.list= res.data.list
getStoreInfo() {
this.$u.api.getStoreInfo({ id: this.sid }).then((res)=>{
this.info = res.data;
uni.stopPullDownRefresh();
})
this.$u.api.getStoreImgVideoList({id:1}).then((res)=>{
console.log(res.data)
this.indextop = [res.data[0],res.data[1]]
this.indexlist = res.data.slice(2,)
},
getStoreImgVideoList() {
this.$u.api.getStoreImgVideoList({ id: this.sid }).then((res)=>{
if(res.data.length) {
this.indextop = [res.data[0], res.data[1]];
this.indexlist = res.data.slice(2,);
}
uni.stopPullDownRefresh();
})
this.$u.api.getStoreInfo({id:1}).then((res)=>{
console.log(res)
this.info = res.data
},
attentionMember() {
this.$u.api.attentionMember({ member_id: this.info.member_id }).then(res => {
if(res.errCode == 0) {
this.getStoreInfo();
}
this.$u.toast(res.message);
})
},
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: 0,
store_id: this.sid,
}).then(res => {
uni.stopPullDownRefresh();
if (res.errCode == 0) {
// this.articleList = res.data.list;
if(res.data.list.length > 0) {
this.indextop = [res.data.list[0]]
this.indextop = [res.data.list[0], res.data.list[1]];
}
if(res.data.list.length > 1) {
this.indextop.push(res.data.list[1]);
this.indexlist.push(...res.data.list.slice(2,));
}
}
})
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeiht = res.windowHeight - (73 + 20 + 170) + 'px';
}
},
onLoad(option){
this.sid = option.id;
// console.log(this.sid);
this.getStoreInfo();
this.getArticlelist();
this.setViewHeight();
// this.getStoreImgVideoList();
}
};
</script>
<style lang="scss" scoped>
.merchant {
min-height: 100vh;
// min-height: 100vh;
background-color: #ECECEC;
padding-top: calc(350rpx - var(--window-top));
.top {
@@ -168,7 +224,6 @@ export default {
height: 28rpx;
flex-shrink: 0;
margin-right: 14rpx;
background-color: aqua;
}
> view {
white-space: nowrap;
@@ -230,13 +285,18 @@ export default {
}
}
.main{
.video-image {
padding-bottom: 98rpx;
}
> view {
margin-top: 20rpx;
}
}
.tabbar {
border-top: 1rpx #DBDADA solid;
width: 100%;
height: 98rpx;
background: rgb(95, 64, 64);
background: rgba(251,251,251,1);
display: flex;
padding: 10rpx 55rpx;
position: fixed;
@@ -251,7 +311,6 @@ export default {
width: 40rpx;
height: 40rpx;
margin-bottom: 15rpx;
background-color: aqua;
}
> view {
font-size: 24rpx;
@@ -259,12 +318,5 @@ export default {
}
}
}
.item{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
// margin-top: 20rpx;
padding:25rpx;
}
}
</style>

View File

@@ -0,0 +1,88 @@
<template>
<view class="classify">
<view class="item-view" @click="viewGoods({ type: 'all', name: '全部宝贝' })">
<view>全部宝贝</view>
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
<view class="item-view" @click="viewGoods({ type: 'new', name: '新品上架' })">
<view>新品上架</view>
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
<view class="classify-container">
<view v-for="classifyA in classifyList" :key="classifyA.gc_parent_id" class="classify-view">
<view class="title">{{ classifyA.gc_parent_name }}</view>
<view class="classifyA-view">
<view v-for="classifyB in classifyA.gc_child" :key="classifyB.gc_id" class="classifyB-item u-line-1" @click="viewGoods({ type: classifyB.gc_parent_id, name: classifyB.gc_parent_name })">{{ classifyB.gc_parent_name }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
classifyList: [],
}
},
onLoad(option) {
this.sid = option.id;
this.getStoreClassifyList();
},
methods: {
viewGoods({ type, name }) {
console.log(11);
this.$u.route('pageC/merchant/classifyGoods', { sid: this.sid, cid: type, name: name });
},
getStoreClassifyList() {
this.$u.api.getStoreClassifyList({ id: this.sid }).then(res => {
this.classifyList = res.data;
})
},
}
};
</script>
<style lang="scss" scoped>
.classify {
padding-top: 20rpx;
background-color: #ECECEC;
min-height: calc(100vh - var(--window-top));
.item-view {
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 35rpx 30rpx;
font-size: 30rpx;
color: rgba(51,51,51,1);
background-color: #FFFFFF;
}
.classify-container {
.classify-view {
padding: 30rpx 35rpx;
background-color: #FFFFFF;
margin-bottom: 20rpx;
.title {
font-size: 30rpx;
color: rgba(51,51,51,1);
margin-bottom: 34rpx;
}
.classifyA-view {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.classifyB-item {
width: 335rpx;
height: 74rpx;
line-height: 74rpx;
background: rgba(255,241,230,1);
padding: 0 20rpx;
font-size: 30rpx;
color: rgba(51,51,51,1);
margin-bottom: 20rpx;
}
}
}
}
}
</style>

View File

@@ -1,18 +1,20 @@
<template>
<view id="actives">
<!-- 活动消息推送 -->
<view class="activity" v-for="(item, index) in actives" :key="index">
<view class="times">{{item.type}}</view>
<block v-for="(item, index) in actives" :key="index">
<view class="time">{{ item.addtime }}</view>
<view class="activity">
<view class="content">
<view class="title">{{item.title}}</view>
<view class="images_about">
<image :src="item.goods_image"></image>
<image :src="item.goods_image" mode="aspectFill"></image>
<view>
<text>{{item.summary}}</text>
<text class="u-line-2">{{item.summary}}</text>
</view>
</view>
</view>
</view>
</block>
</view>
</template>
@@ -30,13 +32,13 @@
},
methods: {
titletext(){
console.log("22345")
},
// 活动消息列表
messageactivityList(){
this.$u.api.messageactivityList({}).then((res)=>{
console.log(res)
this.actives = res.data
if (res.errCode == 0) {
this.actives = res.data;
}
})
}
},
@@ -52,9 +54,14 @@
#actives{
background: #ECECEC;
height: 100%;
.time {
padding: 30rpx 0;
color: #666;
text-align: center;
font-size: 28rpx;
}
}
.activity{
.times{
width:100%;
font-size:28rpx;
@@ -71,9 +78,9 @@
margin: 0 auto;
overflow: hidden;
image{
width: 137rpx;
flex-shrink: 0;
width: 140rpx;
height: 140rpx;
float: left;
}
.title{
font-size:30rpx;
@@ -81,25 +88,17 @@
padding: 0rpx 0 19rpx;
}
.images_about{
overflow: hidden;
text{
display: table-cell;
height: 140rpx;
vertical-align: middle;
width: 400rpx;
padding-left: 15rpx;
line-height: 36rpx;
display: block;
overflow:hidden; //超出的文本隐藏
text-overflow:ellipsis; //用省略号显示
white-space:nowrap; //不换行
}
view{
display: inline-block;
float: left;
width:430rpx;
display: flex;
& > view{
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
height: 140rpx;
padding: 20rpx;
background: rgba(241,241,241,1);
& > text {
}
}
}
}

View File

@@ -2,10 +2,10 @@
<view class="attention">
<view class="attention_box" v-for="(item,index) in attention" :key="index">
<view>
<image :src="item.url"></image>
<image :src="item.friend_tomavatar" mode="aspectFill"></image>
</view>
<view>{{item.name}}</view>
<view>状态{{item.type}}</view>
<view>{{item.friend_tomname}}</view>
<view>{{item.live_status ? '正在直播' : '未直播'}}</view>
<view class="cur_two" @click="tapClick(index)" v-if = "item.about == 1">已关注</view>
<view class="cur" @click="tapClick(index)" v-else = "item.about == 2">未关注</view>
</view>
@@ -19,37 +19,7 @@
return {
rSelect:[],
type : '未关注',
attention: [{
url: '../../pageE/static/mine/1.png',
name: '达人昵称',
type: '正在直播',
about: 1
},
{
url: '../../pageE/static/mine/1.png',
name: '达人昵称',
type: '正在直播',
about: 2
},
{
url: '../../pageE/static/mine/1.png',
name: '达人昵称',
type: '正在直播',
about: 1
},
{
url: '../../pageE/static/mine/1.png',
name: '达人昵称',
type: '正在直播',
about: 1
},
{
url: '../../pageE/static/mine/1.png',
name: '达人昵称',
type: '正在直播',
about: 1
}
]
attention: []
};
},
onLoad(){
@@ -64,13 +34,11 @@
this.rSelect.push(index); //选中添加到数组里
} else {
this.rSelect.splice(this.rSelect.indexOf(index), 1); //取消
}
},
snsfriendList(){
this.$u.api.snsfriendList({}).then((res)=>{
console.log(res)
// this.attention = res.data
this.attention = res.data;
})
}
},
@@ -102,7 +70,7 @@
view image {
width: 80rpx;
height: 80rpx;
display: block;
border-radius: 50%;
margin: 24rpx auto 0;
}

View File

@@ -0,0 +1,62 @@
<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: #D02129;
font-size: 24rpx;
border-radius: 14rpx;
color: #ffffff;
display: flex;
}
.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.3 KiB

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

BIN
pageD/images/Arrow-Left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
pageD/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
pageD/images/Vector.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

BIN
pageD/images/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

BIN
pageD/images/group-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

BIN
pageD/images/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
pageD/images/im.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 KiB

BIN
pageD/images/jianpan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

BIN
pageD/images/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
pageD/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
pageD/images/pending.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

BIN
pageD/images/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
pageD/images/vedio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

View File

@@ -25,44 +25,20 @@
export default {
data() {
return {
actives: [
{
url: '../../pageE/static/mine/1.png',
name: '您的订单已发货',
type: '2020-05-14 20:11',
about: '百搭休闲格纹裙!你值得有用!'
},
{
url: '../../pageE/static/mine/1.png',
name: '百元趋势新品',
type: '2020-05-14 20:11',
about: '百搭休闲格纹裙!你值得有用!'
},
{
url: '../../pageE/static/mine/1.png',
name: '百元趋势新品',
type: '2020-05-14 20:11',
about: '百搭休闲格纹裙!你值得有用!'
},
{
url: '../../pageE/static/mine/1.png',
name: '百元趋势新品',
type: '2020-05-14 20:11',
about: '百搭休闲格纹裙!你值得有用!'
},
{
url: '../../pageE/static/mine/1.png',
name: '百元趋势新品',
type: '2020-05-14 20:11',
about: '百搭休闲格纹裙!你值得有用!'
},
]
actives: [],
page: 1
};
},
onLoad() {
this.getCartList();
},
methods: {
titletext(){
console.log("22345")
getCartList() {
this.$u.post("message/orderDeliveryList",{page: this.page}).then(res => {
if (res.errCode == 0) {
this.actives == res.data;
}
})
}
},
components:{
@@ -72,7 +48,6 @@
<style lang="scss" scoped>
#actives{
background: #ECECEC;
height: 100%;
}
.activity{

View File

@@ -1,7 +1,7 @@
<template>
<view>
<!-- 公告咨询 -->
<notice></notice>
<notice :list="list"></notice>
</view>
</template>
@@ -10,18 +10,18 @@
export default {
data() {
return {
list: [],
};
},
onLoad(){
this.informationList()
this.informationList();
},
methods: {
titletext(){
console.log("22345")
},
informationList(){
this.$u.api.informationList({}).then((res)=>{
console.log(res)
this.list = res.data;
})
}
},
@@ -32,6 +32,9 @@
</script>
<style lang="scss" scoped>
page {
background-color: #ECECEC;
}
.sousuo {
height: 113rpx;
border: 1px #f00 solid;

View File

@@ -0,0 +1,615 @@
<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.messages = privateMessages.sentMessages;
this.pendingMessages = privateMessages.pendingMessages;
uni.setNavigationBarTitle({
title : this.friend.name
});
setTimeout(() => {
uni.setNavigationBarColor({
backgroundColor : '#D02129',
frontColor : '#ffffff'
});
}, 10);
this.initialListeners();
//每次进入聊天页面,总是滚动到底部
this.scrollToBottom()
},
onUnload() {
//退出聊天页面之前,清空页面传入的监听器
this.imService.onNewPrivateMessageReceive = (friendId, message)=> {};
this.imService.onPrivateHistoryLoad = (friendId, messages) =>{};
//将未读消息数清零
this.imService.resetFriendUnReadMessage(this.friend);
},
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: 24rpx;
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("../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("../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("../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("../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("../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("../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("../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:#D02129;
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

@@ -58,5 +58,6 @@ export default {
min-height: calc(100vh - var(--window-top));
background: #ECECEC;
padding: 20rpx 35rpx 0;
line-height: 45rpx;
}
</style>

View File

@@ -29,6 +29,7 @@
</view>
<view class="edit-tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系客服</view>
<view class="edit-btn" @click="updateMemberInfo">完成</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
@@ -67,6 +68,34 @@ export default {
onLoad() {
this.getUserInfo();
},
// 监听头像裁剪
created() {
// uni.$on('uAvatarCropper', path => {
// const url = this.$u.http.config.baseUrl + '/Upload/uploadfile';
// this.avatar = path;
// // 可以在此上传到服务端
// // uni.uploadFile({
// // url: 'http://www.example.com/upload',
// // filePath: path,
// // name: 'file',
// // complete: (res) => {
// // console.log(res);
// // }
// // });
// common.uploadFile({
// url: url,
// name: 'avatar',
// filePath: path
// }).then(result => {
// // console.log(result);
// this.$set(this, 'avatar', result.file_path);
// // this.avatar = result.file_path;
// this.uploadPath = result.file_name;
// }, error => {
// this.$u.toast(error);
// })
// })
},
onNavigationBarButtonTap(e) {
if( e.index == 0 ) uni.navigateBack();
},
@@ -85,7 +114,7 @@ export default {
filePath: res.tempFilePaths[0]
}).then(result => {
// console.log(result);
this.$set(this, 'avatar', result.file_path);
// this.$set(this, 'avatar', result.file_path);
// this.avatar = result.file_path;
this.uploadPath = result.file_name;
}, error => {
@@ -94,6 +123,17 @@ export default {
}
});
},
// 头像裁剪
// chooseAvatar() {
// this.$u.route({
// url: '/uview-ui/components/u-avatar-cropper/u-avatar-cropper',
// params: {
// destWidth: 300,
// rectWidth: 200,
// fileType: 'jpg',
// }
// })
// },
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {
@@ -103,7 +143,7 @@ export default {
userInfo.member_mobile,
userInfo.member_birthday,
userInfo.member_sex,
userInfo.member_avatar,
userInfo.member_avatar + '?' + new Date().getTime(),
];
}
})
@@ -116,7 +156,11 @@ export default {
birthday: this.birthday,
}).then(res => {
if (res.errCode == 0) {
this.getUserInfo();
// this.getUserInfo();
this.$refs.uToast.show({
title: res.message,
back: true,
})
}
})
},

Some files were not shown because too many files have changed in this diff Show More