Compare commits
526 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d5e4d52dbe
|
|||
|
d5d9e98534
|
|||
|
71a82a10b0
|
|||
| e3e470ab88 | |||
| 3d4ee2bd4c | |||
| 6af21ad216 | |||
| 9c026bf64d | |||
| 4436bbd282 | |||
| 27bdf1f2b0 | |||
| 76d13c5a71 | |||
|
6d4d2e5d8d
|
|||
|
6a25fe34a7
|
|||
| 0d96af99e1 | |||
|
5c47aa8e5c
|
|||
| 5ad768f842 | |||
|
|
e674a2c0df | ||
| 5194e15ec8 | |||
| 0a5115b8f4 | |||
| 1d8cd6512f | |||
| 6306573ee4 | |||
| 21b9995c1c | |||
| 065cea4e11 | |||
| f86e9ae009 | |||
| dddbabd207 | |||
| 6f344dc550 | |||
|
03c6779b96
|
|||
| 8518677f05 | |||
|
|
e0aafebcdc | ||
| e43003e0cd | |||
| 7f30cf8020 | |||
| 62d610b025 | |||
| 5806077877 | |||
| 50fb33d8e4 | |||
| 164dff3db5 | |||
| 5b287c7049 | |||
| fc44bb5fd6 | |||
| ecea27ccff | |||
| 3d2e0a9525 | |||
| 4b0cbcf814 | |||
|
|
ecb5f19fc0 | ||
| f54b94f0c6 | |||
| abda1f39f5 | |||
| 9e6c36b65a | |||
|
|
71fb73b61a | ||
|
|
83b06e2ab5 | ||
| b575501bb7 | |||
| d69486d1ab | |||
| d3c68b8c93 | |||
| 40e4d10bd7 | |||
| 7790481afb | |||
|
|
7c0720fab2 | ||
| 1f966b261e | |||
| 421112db2e | |||
| 920976dedd | |||
| 91a655e224 | |||
| 4e3665acc7 | |||
|
|
1643bf51b2 | ||
| d234176f22 | |||
|
b75e885e70
|
|||
| 9eaf84d496 | |||
| dbbd64269f | |||
|
677890a06d
|
|||
| dd3d3c17c4 | |||
|
|
78169d8cde | ||
|
|
7f0d1063f0 | ||
|
|
c81ee7e961 | ||
| 6864f22576 | |||
| a91fa4708b | |||
| bfffb44fe2 | |||
| 16c2c1fa71 | |||
| 4c8e2ba4b6 | |||
| 96d7ad439a | |||
| 390bda7c0e | |||
| 0ae19c2ddf | |||
|
26cb84748a
|
|||
| c6cd88dc48 | |||
|
a34880e6a6
|
|||
|
3d840a0546
|
|||
| 30539ddf64 | |||
| 51823edb12 | |||
|
e58f571de4
|
|||
| c4821f888f | |||
|
|
69760e6377 | ||
| 080f0c6d86 | |||
| 4e842b127c | |||
| 627cfc4aa0 | |||
| 1e94eb864f | |||
| 64597b26fa | |||
| 05b334fdcb | |||
| dc636e30b7 | |||
| f9950c4a14 | |||
| 5dff8c8d96 | |||
| 35da48a87b | |||
| 5dd4023f97 | |||
| 10957c96d6 | |||
| 86d765d6ba | |||
| bea615253c | |||
| 48f50dbc89 | |||
|
|
891f1b4194 | ||
| fb16e774b8 | |||
|
|
97c95c2024 | ||
|
|
9d8d54cf02 | ||
| 417ec2106e | |||
| 2b1b1f1395 | |||
| 18dd96dec7 | |||
| 6dd010fd42 | |||
|
|
41cda556ce | ||
| 6b4bfee380 | |||
| cb0a6fafa3 | |||
| fd1801de3d | |||
|
418068102c
|
|||
| 72fa854e78 | |||
| 2a382aa0b4 | |||
| bb651df8a0 | |||
|
9c388e898c
|
|||
| 473b96f552 | |||
| 1a2c40955b | |||
| 5291d70c6c | |||
|
f98cdd7937
|
|||
| 60913ab612 | |||
|
|
ee04a8cb08 | ||
| 711eeadc28 | |||
|
8286dbfa58
|
|||
|
cb95d1ead1
|
|||
| f577de11f1 | |||
| 689aecc572 | |||
| 8ba87795b3 | |||
|
|
e51675d2e7 | ||
|
43e09e977d
|
|||
|
|
91927fdc57 | ||
|
|
8f83aeec8e | ||
| d5202c02cc | |||
| 631e8ae3e6 | |||
|
|
b2b740c207 | ||
| 7191b29b44 | |||
|
|
50c790c7fc | ||
| ec8831152e | |||
| 6f5c2d1fc9 | |||
|
9f17c5478c
|
|||
| 41ea8122e6 | |||
| 06ee3b9038 | |||
| 5b763fdb82 | |||
| 31689af773 | |||
| caaea4de62 | |||
| cada935c17 | |||
| 9e9a6dcc5b | |||
| a702558eac | |||
| 2a180ba05f | |||
|
|
2a5e4b89b2 | ||
| fd31d14881 | |||
|
|
aae9f78a91 | ||
|
a39aa6e059
|
|||
| 3e6f7ebf1b | |||
|
35838e3a9e
|
|||
|
d0d034cd7f
|
|||
|
d8a92db5c2
|
|||
| 67a8316666 | |||
|
51d8f6a762
|
|||
| f77b4ebc02 | |||
|
|
b1a705e0f8 | ||
| c14b4338e9 | |||
|
ec3420a026
|
|||
|
aeb62f16ef
|
|||
| b7c9ec2354 | |||
|
9160a98de7
|
|||
| a5962d96df | |||
|
e7932d26ce
|
|||
| 8b98de3d8b | |||
|
c33ccebd25
|
|||
| 1af3d1a003 | |||
|
fb297a74ce
|
|||
| 5a2fc6e94c | |||
|
884bf6945f
|
|||
|
3be650b24e
|
|||
| 9029e3c8ba | |||
|
|
c2346375c8 | ||
| 95c7f10f2d | |||
| c13d87a07f | |||
|
33e8942180
|
|||
| 16da95c248 | |||
| 97676d75fb | |||
|
94dc78555a
|
|||
|
176501939d
|
|||
| 7b3ba99d2c | |||
| e427748a79 | |||
| 93000ac032 | |||
| b86b1c8245 | |||
| df52535848 | |||
| 718e3ff45d | |||
|
27470faee1
|
|||
|
05aa790d32
|
|||
|
686955424b
|
|||
|
6f0ed8e3f9
|
|||
|
be2780fbc4
|
|||
|
7d13fc8e85
|
|||
| 7deb5d312b | |||
| e784bbf596 | |||
| 55742478b2 | |||
| d79b0c5da7 | |||
| ba4d2dfa51 | |||
|
|
3da4dad3cb | ||
|
|
5c895d247f | ||
| 2ddeb4bc61 | |||
| 41d2258a5d | |||
| da21482a81 | |||
|
|
9158f27afb | ||
| 6313f642ea | |||
| f46cc4d645 | |||
| 7d8027678d | |||
| 2aca3ae153 | |||
| dc03b9f410 | |||
|
d520fe8017
|
|||
| 1541851988 | |||
|
ce1c1a4f16
|
|||
| 0c40a45155 | |||
| cb2e91f65a | |||
| f06f211417 | |||
|
c0c3f51695
|
|||
| aa1d4631b2 | |||
| b266c9c775 | |||
| 899b93fc4f | |||
| 1f4fac94ae | |||
|
12efa8d79c
|
|||
|
f6ffcdec64
|
|||
| f0c2b00a02 | |||
| 9f58e1c7a2 | |||
| cd0e8bbf9e | |||
|
|
ce1a8d6256 | ||
| b8681f7c01 | |||
| 505e3354a3 | |||
| 4d76db71fe | |||
| f9224f10cf | |||
| a4a9843bdc | |||
|
3713cab533
|
|||
| f83fb04e1c | |||
| 07ac250ddd | |||
| b087d85337 | |||
|
65c1e2fd63
|
|||
| 736ee9e555 | |||
|
1c3ed37983
|
|||
| 0f03c543e1 | |||
|
bc2731f1f9
|
|||
| b3398be7e1 | |||
|
90e9e06915
|
|||
|
2a58f2f63f
|
|||
| 7393fefdf4 | |||
| f4ae3578a2 | |||
|
|
137279b774 | ||
| 5a1a8f01c0 | |||
| ca5c1a37ba | |||
|
572271d807
|
|||
| f746e39440 | |||
| c4adcbc182 | |||
| 5688828bad | |||
| b9b32fb655 | |||
| 3de426b55e | |||
| e224cffc1c | |||
| 281c12e502 | |||
|
3d552b84c7
|
|||
| e0216062f1 | |||
|
ed6674f3ff
|
|||
| 459e7fad0f | |||
|
|
e8ae43c726 | ||
| f1fbeb65a1 | |||
| a95336a5a6 | |||
| 2a79e45d77 | |||
| 5ae02daab8 | |||
|
1b0528f7dc
|
|||
|
ca9b43a597
|
|||
| e3c548c9b0 | |||
| 2811bf31cd | |||
| 4413250c40 | |||
|
d604351cf3
|
|||
|
1a3b39f31e
|
|||
|
87e5515b98
|
|||
|
213a7fb9ff
|
|||
| 0b3e2b3e1e | |||
|
5801c2f91c
|
|||
| 8e94b1b5f1 | |||
| 3b01c1acca | |||
| 1936105b1b | |||
| 02639fc9e1 | |||
| bb4f971af1 | |||
|
54dd8a6eb0
|
|||
| 2f7651f217 | |||
|
eb886368e9
|
|||
|
e55aa62bcc
|
|||
| f9a2ada1d3 | |||
|
|
6d4d8c5675 | ||
| a6bdc88c61 | |||
| c03fff99e0 | |||
| eb1dce5d6b | |||
| 3b5515d317 | |||
| 529325e203 | |||
|
|
22812469a8 | ||
| a6907f3f69 | |||
| a871e050f6 | |||
| c39d6ba811 | |||
| fb3713093f | |||
|
e8f46674c4
|
|||
| b85ab380ef | |||
| 87185d7d0f | |||
| 22cdf3e415 | |||
|
ab4e50a9ae
|
|||
|
d2c6bcb1bc
|
|||
| 1d48546424 | |||
| d8d3434988 | |||
| 083153929b | |||
| d19771b182 | |||
|
a45db4afbf
|
|||
| 1db45d40a7 | |||
|
|
ef79718190 | ||
|
|
23b2b11bc8 | ||
|
|
21d3201c4b | ||
| 91ca2fdd19 | |||
|
0e7139bc16
|
|||
| 3acaf94a37 | |||
| 523dadd55d | |||
|
693048f1ab
|
|||
|
f9fa80665b
|
|||
| cb178c1407 | |||
| 9a0dc4c6d1 | |||
| 1ef4db7dc4 | |||
| 37d8ab7a2b | |||
| 20259ddf00 | |||
|
|
703689d272 | ||
| 6c724d4f4c | |||
|
|
b3a7b2d032 | ||
|
|
b34ac35821 | ||
| def8f0cf1b | |||
|
6984ea9374
|
|||
| 39b2749ac9 | |||
| c01470b52d | |||
| 6e900dcd3b | |||
| 7956517c4a | |||
| 43e15cc4a7 | |||
|
|
e1c908152a | ||
|
|
aad2bca5c6 | ||
| f79db4aa62 | |||
| 4739ef71a9 | |||
|
a22b3fba71
|
|||
| 003bc07c6b | |||
|
|
e6f73f01cd | ||
| 52bce327cc | |||
|
|
74fcc50696 | ||
| 33b0137c06 | |||
| 7c05459daf | |||
| 610d012e67 | |||
| 8c3121d5ed | |||
|
8df5bc2701
|
|||
|
0c8e81f484
|
|||
|
e3407b1046
|
|||
|
55297a6587
|
|||
|
52508a1098
|
|||
|
22a67d23c4
|
|||
| 39466d3360 | |||
|
|
2e95172a75 | ||
|
|
234f11eeef | ||
| 8b6bf2da03 | |||
| 520fa5497c | |||
| 9a4e4f5efe | |||
| 9b93b6a5a9 | |||
| 199a1d3d96 | |||
|
b9b9a8e829
|
|||
| d00b4a75ac | |||
| 9631e9f827 | |||
| 097f7e3cba | |||
|
|
fe8af80983 | ||
| a9098c3156 | |||
| 228e34d8fc | |||
| e5a322fd35 | |||
| cef9296a78 | |||
| f32f7df14a | |||
| 817c886d84 | |||
|
5abe5620f5
|
|||
|
9e96eeb575
|
|||
| 6d6b1648bc | |||
| 02702bc447 | |||
| 1ee0dd4b25 | |||
|
|
0290189205 | ||
|
|
502e020000 | ||
| a0cb2a668e | |||
| 597c92e9cd | |||
|
07e1661a18
|
|||
| 26254aba84 | |||
|
6bf4fdc7e3
|
|||
|
6eeebf25c0
|
|||
| 83e57ceea6 | |||
| 9d3f8da629 | |||
|
93dbdca573
|
|||
|
57fcf69974
|
|||
|
f4313dce9d
|
|||
| f4ba942870 | |||
| a088c895d2 | |||
|
fc86ad2579
|
|||
|
eb0d648f6a
|
|||
|
|
9a9276fc94 | ||
| 71e984b2ed | |||
|
|
2afd55f79e | ||
|
|
090b7cc753 | ||
| c56743765c | |||
| 1a1a0de460 | |||
| 24410d0ee7 | |||
|
9f444ad070
|
|||
|
e11f20885f
|
|||
|
e6b7b50a1e
|
|||
| 201f858833 | |||
| 8bf42a75dd | |||
|
9054432b59
|
|||
|
2c6cdbead9
|
|||
| 2cb8f90281 | |||
| 79d8f91769 | |||
|
2a8ee65a94
|
|||
|
9872770472
|
|||
|
7a7b126fe3
|
|||
| b158080eb7 | |||
|
|
046f2e50c5 | ||
|
|
1313a90d5e | ||
|
|
ed0edbab2f | ||
|
|
361e9a76fd | ||
| 720af35b11 | |||
|
|
1b5bf33166 | ||
|
|
c4c11781fb | ||
| e1519b8d68 | |||
| 0057bcd28e | |||
| 9881ea099d | |||
|
b0f224d79b
|
|||
|
045f6e6e01
|
|||
|
09a7dbdf5c
|
|||
| a47238a7a4 | |||
|
|
0a2441b1a9 | ||
| c035566fe4 | |||
|
|
ef4a4010ff | ||
| df29f86630 | |||
|
|
7b9bee2f1e | ||
| 42d39fb4c3 | |||
|
|
6ed05ecf31 | ||
|
|
692495f108 | ||
| 8cd7c3d0a0 | |||
| 5343196342 | |||
| dbb7a91330 | |||
| fe9a54987e | |||
| f6c6ffa176 | |||
| 396bb37c94 | |||
| 13bdc08c86 | |||
| 43845b4810 | |||
|
|
cc934696d1 | ||
|
|
afc7731781 | ||
| 1f9299602e | |||
| 2fd62acb73 | |||
| f69a82ace5 | |||
|
|
1f5af9d92b | ||
| 20ba2e4e8f | |||
| 2a946145e9 | |||
|
e354152beb
|
|||
| f83048e5c6 | |||
| 20b1c0da43 | |||
|
35e0c39d1d
|
|||
| 1e9f442b7b | |||
|
|
48b7219954 | ||
| 715793414f | |||
| 0a52842e35 | |||
| 0ee518854c | |||
| 4416b76d96 | |||
| 5e22f0429c | |||
|
|
38f92c6766 | ||
|
95f893a277
|
|||
| f63594706f | |||
| d54a378a9e | |||
| 6a361e3245 | |||
|
b070a559dc
|
|||
|
b146783790
|
|||
|
335f4c5564
|
|||
| 0bc6be9b9f | |||
| 0266a556d9 | |||
|
|
51cd6f8261 | ||
| af768bff80 | |||
| c118eced7f | |||
|
|
11865d4068 | ||
| bb4f3b2918 | |||
|
8727ae913d
|
|||
|
1da6974fe3
|
|||
|
bd996de410
|
|||
| 7ae10c200d | |||
|
|
8a213ba094 | ||
| 1c16a85e18 | |||
| 4ef16728f9 | |||
| 680fa48e85 | |||
| 854976c8f0 | |||
| 223dd51db7 | |||
|
|
5b31193750 | ||
| 865e2a741a | |||
| 48722ef768 | |||
| ff7c6b358d | |||
| c9c7e08a8d | |||
|
|
f30c4f4922 | ||
|
|
ea10c99cd1 | ||
| ba2cab7950 | |||
|
2ec14481fd
|
|||
|
b9b8384011
|
|||
|
|
d817d0c28b | ||
| cdd0105acb | |||
| 6d00107944 | |||
| 04adc72d92 | |||
| 120e062fcd | |||
| 2851c8e0b2 | |||
|
|
8bb1cdfd39 | ||
| f21df2f107 | |||
|
ee08038a64
|
|||
| 280915560d | |||
|
41f4050768
|
|||
| b12a3c1722 | |||
|
4004f3715b
|
|||
| 208f27aa93 | |||
| 6eabd3a575 | |||
|
2ea9b89acc
|
|||
| 100f31c6f9 | |||
|
b2d284f666
|
|||
| dbafe8b4c1 | |||
| 185f5979b6 | |||
| 410a7850e6 | |||
| c931e87209 | |||
| 94636380f1 | |||
| 5abb3f2496 | |||
| a1b14b4f5e | |||
| dd71a0f32a |
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
.vscode
|
||||
/node_modules/*
|
||||
unpackage
|
||||
manifest.json
|
||||
manifest.json
|
||||
deming.keystore
|
||||
74
App.vue
@@ -1,6 +1,76 @@
|
||||
<script>
|
||||
export default {}
|
||||
import { mapMutations, mapState } from 'vuex';
|
||||
export default {
|
||||
globalData: {
|
||||
im: {}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["hasLogin"])
|
||||
},
|
||||
onLaunch() {
|
||||
getApp().globalData.im = this.imService
|
||||
// 缓存token
|
||||
uni.getStorage({
|
||||
key: "token",
|
||||
success: (res) => {
|
||||
this.loginIn(res.data);
|
||||
}
|
||||
})
|
||||
// 刷新token
|
||||
if (this.hasLogin) {
|
||||
this.refreshToken_function();
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
//app关闭默认的启动 方法关闭启动图。但是这个时间不能太晚,6s 超时后依旧会主动关闭。
|
||||
setTimeout(()=>{
|
||||
plus.navigator.closeSplashscreen();
|
||||
},3000)
|
||||
// #endif
|
||||
},
|
||||
onShow(){
|
||||
this.getVersion();
|
||||
},
|
||||
onHide(){
|
||||
|
||||
},
|
||||
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值
|
||||
}
|
||||
})
|
||||
},
|
||||
getVersion() {
|
||||
this.$u.post("Specialci/checkVersion",{ app_version: this.$app_version }).then(res => {
|
||||
// console.log(res);
|
||||
if(res.data.app_version != this.$app_version) {
|
||||
this.$u.route('/pageE/setting/updateVersion', {
|
||||
status: res.data.is_focus_upgrade
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "/static/css/normalize";
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
@import "/static/css/normalize";
|
||||
/* 顶部自定义导航留白 */
|
||||
.status_bar {
|
||||
width: 100%;
|
||||
height: var(--status-bar-height);
|
||||
}
|
||||
/* 自定义下拉 */
|
||||
.load-size {
|
||||
::v-deep.u-more-text {
|
||||
font-size: 20rpx !important;
|
||||
}
|
||||
}
|
||||
/* #endif */
|
||||
</style>
|
||||
|
||||
@@ -49,4 +49,12 @@ unescapeHTML(temp){}
|
||||
* @return { object } promise 对象 resolve 返回文件服务器地址 reject 返回错误信息
|
||||
*/
|
||||
uploadFile({ url, name, filePath }) {}
|
||||
|
||||
/**
|
||||
* 广告位跳转
|
||||
* @param { String } type 跳转类型 1 商品 2 店铺 3 领取优惠券
|
||||
* @param { String | Number } id 跳转id 商品id/商家id...
|
||||
* @return { undefined } undefined
|
||||
*/
|
||||
jumpPage({ type, id }) ()
|
||||
```
|
||||
@@ -54,6 +54,10 @@ export default {
|
||||
getRecommendList(){
|
||||
return vm.$u.post('MemberExpert/recommendList');
|
||||
},
|
||||
// 获取所有达人
|
||||
getAllRecommendList({ page }) {
|
||||
return vm.$u.post('MemberExpert/getRecommendList', { page });
|
||||
},
|
||||
// 达人(搜索)列表
|
||||
getExpertList({ page, store_id, live_status, like_nickname }){
|
||||
return vm.$u.post('MemberExpert/expertList', {
|
||||
@@ -81,6 +85,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 +177,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}){
|
||||
@@ -177,9 +196,9 @@ export default {
|
||||
});
|
||||
},
|
||||
// 商品搜索
|
||||
ShopSearch({keyword,page = 1,order = 'goods_salenum'}){
|
||||
ShopSearch({keyword, page = 1, order = 'goods_salenum',sid=''}){
|
||||
return vm.$u.post('ShopSearch/search',{
|
||||
keyword,page,order
|
||||
keyword,page,order,store_id:sid
|
||||
})
|
||||
},
|
||||
// 秒杀推荐
|
||||
@@ -187,9 +206,10 @@ export default {
|
||||
return vm.$u.post('Spike/recommendedSpike');
|
||||
},
|
||||
// 秒杀详情
|
||||
getSpikeInfo({ groupbuy_id }) {
|
||||
getSpikeInfo({ groupbuy_id, goods_id }) {
|
||||
return vm.$u.post('Spike/spikeInfo', {
|
||||
groupbuy_id: groupbuy_id
|
||||
groupbuy_id: groupbuy_id,
|
||||
goods_id: goods_id,
|
||||
});
|
||||
},
|
||||
// 秒杀列表
|
||||
@@ -206,13 +226,23 @@ export default {
|
||||
});
|
||||
},
|
||||
// 拼团商品详情
|
||||
getPinTuanDetails({ pintuan_id }) {
|
||||
return vm.$u.post('Specialci/pintuanInfo', { pintuan_id: pintuan_id });
|
||||
getPinTuanDetails({ pintuan_id, goods_id }) {
|
||||
return vm.$u.post('Specialci/pintuanInfo', {
|
||||
pintuan_id: pintuan_id,
|
||||
goods_id: goods_id,
|
||||
});
|
||||
},
|
||||
// 推荐拼团
|
||||
getPinTuanPush() {
|
||||
return vm.$u.post('Specialci/pintuanPush');
|
||||
},
|
||||
// 拼团验证
|
||||
pintuanVerify({ pintuan_id, pintuangroup_headid }) {
|
||||
return vm.$u.post('Specialci/pintuanVerify', {
|
||||
pintuan_id: pintuan_id,
|
||||
pintuangroup_headid: pintuangroup_headid,
|
||||
});
|
||||
},
|
||||
// 开团/参团
|
||||
withImmediate({ pintuan_id, pintuangroup_headid, pintuangroup_id}) {
|
||||
return vm.$u.post('Specialci/withImmediate', {
|
||||
@@ -241,17 +271,22 @@ export default {
|
||||
});
|
||||
},
|
||||
// 我的优惠券(已有的)
|
||||
getMemberCouponList({ store_id, gc_id, type, status }) {
|
||||
getMemberCouponList({ store_id, gc_id, type, status, page }) {
|
||||
return vm.$u.post('Coupon/getMemberCouponList', {
|
||||
store_id: store_id,
|
||||
gc_id: gc_id,
|
||||
type: type,
|
||||
status: status,
|
||||
page: page,
|
||||
});
|
||||
},
|
||||
// 获取直播列表
|
||||
tabLiveList(){
|
||||
return vm.$u.post('Specialci/tabLiveList')
|
||||
tabLiveList({page}){
|
||||
return vm.$u.post('Specialci/tabLiveList',{page})
|
||||
},
|
||||
// 商城-活动广告
|
||||
getStoreActivity() {
|
||||
return vm.$u.post('adv/storeActivity')
|
||||
},
|
||||
// 获取图文视频详情
|
||||
articleInfo({article_id}){
|
||||
@@ -259,7 +294,76 @@ export default {
|
||||
},
|
||||
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({type}) {
|
||||
return vm.$u.post('ShopSearch/searchWordList',{type})
|
||||
},
|
||||
// 提交试穿订单
|
||||
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 })
|
||||
},
|
||||
// 收藏商品
|
||||
addFavoriteGoods({ fid }) {
|
||||
return vm.$u.post('member/addFavoriteGoods',{ fid: fid })
|
||||
},
|
||||
// 取消收藏(商品/店铺)
|
||||
removeFavorite({ fid, type }) {
|
||||
return vm.$u.post('Member/removeFavorite',{
|
||||
fav_id: fid,
|
||||
type: type
|
||||
})
|
||||
},
|
||||
//店铺列表
|
||||
storeList({ page, name_search }) {
|
||||
return vm.$u.post('shop/storeList',{
|
||||
page,
|
||||
name_search: name_search
|
||||
})
|
||||
},
|
||||
// 是否弹出新人优惠券
|
||||
isNewmembervoucher() {
|
||||
return vm.$u.post('Coupon/isNewmembervoucher')
|
||||
},
|
||||
//待发货退款
|
||||
addrefundall({order_id,reason_info}) {
|
||||
return vm.$u.post('order/add_refund_all',{order_id,reason_info})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
},
|
||||
// 设置-用户信息
|
||||
@@ -216,6 +217,12 @@ export default {
|
||||
page: page,
|
||||
});
|
||||
},
|
||||
// 删除浏览记录
|
||||
delMemberBrowse({ goods_id }) {
|
||||
return vm.$u.post('Member/delMemberBrowse', {
|
||||
goods_id: goods_id,
|
||||
});
|
||||
},
|
||||
// 意见反馈列表
|
||||
getFeedbackList({ page }) {
|
||||
return vm.$u.post('Member/feedbackList', {
|
||||
@@ -230,15 +237,26 @@ 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);
|
||||
},
|
||||
// 各种订单数量
|
||||
getOrderNumber() {
|
||||
return vm.$u.post('order/orderNumber');
|
||||
},
|
||||
// 售后列表
|
||||
getAfterSaleList({ page }) {
|
||||
return vm.$u.post('order/afterSaleList', { page: page });
|
||||
// getAfterSaleList({ page }) {
|
||||
// return vm.$u.post('order/afterSaleList', { page: page });
|
||||
// },
|
||||
// 试穿列表
|
||||
goodsTryOrderList({ page }) {
|
||||
return vm.$u.post('order/goodsTryOrderList', { page });
|
||||
},
|
||||
// 试穿订单确认完成
|
||||
goodsTryConfirm({ id }) {
|
||||
return vm.$u.post('order/goodsTryConfirm', { id: id });
|
||||
},
|
||||
// 订单详情
|
||||
getOrderInfo({ order_id }) {
|
||||
@@ -250,6 +268,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 +290,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 = {
|
||||
@@ -283,8 +314,8 @@ export default {
|
||||
return vm.$u.post('Message/informationList', { });
|
||||
},
|
||||
// 关注列表
|
||||
snsfriendList({ }) {
|
||||
return vm.$u.post('message/snsfriendList', { });
|
||||
snsfriendList({page}) {
|
||||
return vm.$u.post('message/snsfriendList', {page});
|
||||
},
|
||||
// 关注达人
|
||||
attentionMember({ member_id }) {
|
||||
@@ -326,6 +357,105 @@ export default {
|
||||
code: code,
|
||||
});
|
||||
},
|
||||
}
|
||||
// 获取可送洗商品
|
||||
getSendOrderList({ page }) {
|
||||
return vm.$u.post('member/getSendOrderList', {
|
||||
page: page,
|
||||
});
|
||||
},
|
||||
// 送洗列表-平台订单 实体店订单
|
||||
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({ page = 1,role } = {}) {
|
||||
return vm.$u.post('member/attentionMemberList', { page, role });
|
||||
},
|
||||
// 可用优惠券商品
|
||||
couponGoodsList({ voucher_id, page, order }) {
|
||||
return vm.$u.post('Coupon/couponGoodsList', {
|
||||
page: page,
|
||||
vouchertemplate_id: voucher_id,
|
||||
order: order,
|
||||
});
|
||||
},
|
||||
//取消红点
|
||||
dynamicRead({id}) {
|
||||
return vm.$u.post('message/dynamicRead', {
|
||||
friend_tomid:id
|
||||
});
|
||||
},
|
||||
//店铺取关
|
||||
attentionMemberRemove({id}) {
|
||||
return vm.$u.post('Member/attentionMemberRemove', {
|
||||
friend_tomid:id
|
||||
});
|
||||
},
|
||||
// 设置里的帮助
|
||||
getSettingHelpList() {
|
||||
return vm.$u.post('document/help');
|
||||
},
|
||||
//获取默认头像
|
||||
getDefaultAvatar(){
|
||||
return vm.$u.post("member/getDefaultAvatar")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
var md5 = require("../static/js/md5.min.js")
|
||||
const install = (Vue, vm) => {
|
||||
// 此为自定义配置参数,具体参数见上方说明
|
||||
Vue.prototype.$u.http.setConfig({
|
||||
baseUrl: 'https://dmmall.sdbairui.com/api',
|
||||
baseUrl: 'https://mall.dmygkeji.com/api',
|
||||
loadingText: '努力加载中~',
|
||||
loadingTime: 800
|
||||
|
||||
loadingTime: 800,
|
||||
originalData: true
|
||||
});
|
||||
|
||||
// 请求拦截,配置Token等参数
|
||||
@@ -12,11 +13,79 @@ const install = (Vue, vm) => {
|
||||
|
||||
const token = uni.getStorageSync('token');
|
||||
|
||||
config.header.Authorization = 'Bearer' + " " + token;
|
||||
|
||||
config.header.Authorization = 'Bearer' + " " + token;
|
||||
Date.prototype.Format = function (fmt) { // author: meizz
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, // 月份
|
||||
"d+": this.getDate(), // 日
|
||||
"h+": this.getHours(), // 小时
|
||||
"m+": this.getMinutes(), // 分
|
||||
"s+": this.getSeconds(), // 秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), // 季度
|
||||
"S": this.getMilliseconds() // 毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt))
|
||||
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
let time = new Date().Format("yyyyMMddhhmmss")
|
||||
config.header.Sign = md5('DBCA4F8DA7BC0BA2' + time) + '-' + time
|
||||
return config;
|
||||
|
||||
}
|
||||
|
||||
// 响应拦截,如配置,每次请求结束都会执行本方法
|
||||
Vue.prototype.$u.http.interceptor.response = (res) => {
|
||||
if(parseInt(res.data.errCode) == 0) {
|
||||
// res为服务端返回值,可能有errCode,result等字段
|
||||
// 这里对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.data.action != "memberinfo") {
|
||||
uni.showToast({
|
||||
title: "您还没有登录,请先去登录哦!",
|
||||
icon: "none"
|
||||
})
|
||||
setTimeout(() => {
|
||||
// 此为uView的方法,详见路由相关文档
|
||||
uni.navigateTo({
|
||||
url: "/pageA/login/login",
|
||||
})
|
||||
}, 1000)
|
||||
// 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)
|
||||
// }
|
||||
// if (res.cancel) {
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
}
|
||||
return false;
|
||||
} else if (res.errCode == 1) {
|
||||
console.log(res.message);
|
||||
return res.data;
|
||||
} else {
|
||||
// 如果返回false,则会调用Promise的reject回调,
|
||||
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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,15 @@ const store = new Vuex.Store({
|
||||
pintuangroup_headid: '', // 拼团团长id 有为开团 无为参团
|
||||
groupbuyInfo: {}, // 秒杀详情
|
||||
loadmore: {}, // 下拉加载返回的数据
|
||||
hasLogin: false, // 登录状态
|
||||
token: "", // 储存token
|
||||
showLoginModel: false, // 登录框
|
||||
question: {}, // 帮助与反馈
|
||||
showCoupons: true, // 是否显示新人领取优惠券
|
||||
},
|
||||
getters: {
|
||||
getOrderAddress(state) {
|
||||
return state.orderAddress;
|
||||
return state.orderAddress || {};
|
||||
},
|
||||
getGoodsType(state) {
|
||||
return state.goodsDetails.type;
|
||||
@@ -25,6 +34,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;
|
||||
},
|
||||
@@ -49,6 +78,12 @@ const store = new Vuex.Store({
|
||||
setLoadMore(state, info) {
|
||||
state.loadmore = info;
|
||||
},
|
||||
setQuestion(state, question) {
|
||||
state.question = question;
|
||||
},
|
||||
updateShowCoupons(state, status) {
|
||||
state.showCoupons = status;
|
||||
}
|
||||
}
|
||||
})
|
||||
export default store;
|
||||
export default store;
|
||||
|
||||
123
components/comment/index.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view class="comment-item">
|
||||
<view class="user">
|
||||
<u-avatar :src="content.member_avatar" class="avatar" size="60"></u-avatar>
|
||||
<text class="name">{{ content.member_nickname }}</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" @click="previewImage(content.geval_image)"></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;
|
||||
},
|
||||
methods: {
|
||||
previewImage(urls) {
|
||||
console.log(urls);
|
||||
// uni.previewImage({
|
||||
// urls: urls,
|
||||
// });
|
||||
},
|
||||
}
|
||||
};
|
||||
</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>
|
||||
@@ -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>
|
||||
@@ -1,18 +1,21 @@
|
||||
<template>
|
||||
<view class="video-item" v-if="item" @click="toDetailsPage(item.article_id)">
|
||||
<image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
|
||||
<view class="header_fist" v-else>
|
||||
<view class="backes"></view>
|
||||
<image class="head" :src="item.article_pic" ></image>
|
||||
<view class="video-item" v-if="item" @click="toDetailsPage(item.article_id,item.video_path)">
|
||||
<image class="head" :src="item.article_pic" v-if="item.type == 1"></image>
|
||||
<view class="header_fist" v-else>
|
||||
<view class="backes">
|
||||
<u-icon name="play-circle-fill" color="#ffffff" size="20"></u-icon>
|
||||
<text>视频</text>
|
||||
</view>
|
||||
<image class="head" :src="item.article_pic" mode="aspectFill"></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">
|
||||
<image :src="item.member_avatar"></image>
|
||||
<text>{{ item.member_nickname }}</text>
|
||||
</view>
|
||||
<image src="/static/image/common/4.png" @click.stop="showAction"></image>
|
||||
<image class="img-imp" src="/static/image/common/4.png" @click.stop="showAction"></image>
|
||||
<view class="action" v-if="show == item.article_id">
|
||||
<view class="bubble">
|
||||
<view @click.stop="articleLike">
|
||||
@@ -37,33 +40,35 @@
|
||||
</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;
|
||||
display:-webkit-box;
|
||||
-webkit-box-orient:vertical;
|
||||
-webkit-line-clamp:2;
|
||||
height: 80rpx;
|
||||
}
|
||||
.jianjie{
|
||||
margin:0 auto;
|
||||
margin-top: 20rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 22rpx;
|
||||
color: #666;
|
||||
line-height: 30rpx;
|
||||
@@ -99,20 +104,22 @@
|
||||
}
|
||||
}
|
||||
>image{
|
||||
width: 37rpx;
|
||||
width: 35rpx;
|
||||
height: 8rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.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 +135,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 +148,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);
|
||||
}
|
||||
}
|
||||
@@ -170,12 +177,22 @@
|
||||
.header_fist{
|
||||
position: relative;
|
||||
.backes{
|
||||
z-index: 99;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
background: rgba(0,0,0,0.6);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
top: 10rpx;
|
||||
left: 10rpx;
|
||||
width: 80rpx;
|
||||
height: 30rpx;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 30rpx;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
& > text {
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -194,30 +211,44 @@ 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");
|
||||
}
|
||||
})
|
||||
},
|
||||
// 屏蔽
|
||||
articleAddShield() {
|
||||
this.$u.api.articleAddShield({
|
||||
article_id: this.item.article_id,
|
||||
@@ -225,15 +256,23 @@ export default {
|
||||
}).then(res => {
|
||||
// console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.$emit("getArticlelist");
|
||||
}
|
||||
this.$u.toast(res.message);
|
||||
this.$emit("updateList");
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetailsPage(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/photo/index?id=' + id
|
||||
});
|
||||
|
||||
toDetailsPage(id,type) {
|
||||
if (type) {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/video/video?id=' + id
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/photo/index?id=' + id
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<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>
|
||||
<image :src="item.member_avatar"></image>
|
||||
<text class="u-line-1" style="width:130rpx">{{name}}</text>
|
||||
</view>
|
||||
<view class="pingbi">
|
||||
<image></image>
|
||||
<view class="pingbi" @click.stop="articleAddShield">
|
||||
<image src="/static/image/common/7.png"></image>
|
||||
<text>屏蔽用户</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -70,6 +70,31 @@ export default {
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
zhibo(){
|
||||
this.$u.route({
|
||||
url:"/pages/zhibo/index",
|
||||
params:{
|
||||
url:this.url,
|
||||
id:this.zid,
|
||||
rid:this.rid
|
||||
}
|
||||
})
|
||||
},
|
||||
articleAddShield() {
|
||||
console.log(this.item)
|
||||
this.$u.api.articleAddShield({
|
||||
member_id: this.item.user_id,
|
||||
}).then(res => {
|
||||
// console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.$u.toast(res.message);
|
||||
this.$emit("updateList");
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
props:['name','image','url','zid','rid','item']
|
||||
}
|
||||
</script>
|
||||
@@ -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 class="notice" :style="{height : height + 'px'}">
|
||||
<view v-for="(item,index) in notice" :key="index" @click="gotoInfo(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;
|
||||
@@ -37,6 +36,7 @@
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
line-height: 40rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
.notice_view > view:nth-child(3){
|
||||
height: 84rpx;
|
||||
@@ -75,21 +75,31 @@
|
||||
<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 : [],
|
||||
height : ''
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
list(newVal,old) {
|
||||
// console.log(newVal);
|
||||
this.notice = newVal;
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
gotoInfo(index) {
|
||||
console.log(index);
|
||||
this.$u.route({
|
||||
url: "/pageD/notice/info",
|
||||
params: {
|
||||
index: index
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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--;
|
||||
// })
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -44,48 +44,57 @@
|
||||
this.$emit('tochange');
|
||||
let member_mobile = this.member_mobile;
|
||||
// 校验手机号
|
||||
let type_phone = this.$u.test.mobile(member_mobile)
|
||||
console.log(member_mobile)
|
||||
console.log(this.smslog_type)
|
||||
let type_phone = this.$u.test.mobile(member_mobile);
|
||||
// console.log(member_mobile);
|
||||
// console.log(this.smslog_type);
|
||||
// 判断是否有手机号为空
|
||||
if (type_phone == false) {
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
this.$refs.uToast.show({
|
||||
title: "手机号格式不正确"
|
||||
})
|
||||
} else {
|
||||
// 验证码倒计时
|
||||
if (this.$refs.uCode.canGetCode) {
|
||||
// 模拟向后端请求验证码
|
||||
uni.showLoading({
|
||||
title: '正在获取验证码'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
// 这里此提示会被this.start()方法中的提示覆盖
|
||||
this.$u.toast('验证码已发送');
|
||||
// 通知验证码组件内部开始倒计时
|
||||
this.$refs.uCode.start();
|
||||
}, 2000);
|
||||
uni.showLoading({
|
||||
title: '正在获取验证码'
|
||||
})
|
||||
// 请求接口
|
||||
this.$u.api.sendSmsCode({
|
||||
member_mobile: this.member_mobile,
|
||||
smslog_type: this.smslog_type
|
||||
}).then((res) => {
|
||||
if (res.errCode == 0) {
|
||||
console.log(res);
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
// 这里此提示会被this.start()方法中的提示覆盖
|
||||
// this.$u.toast('验证码已发送');
|
||||
// 通知验证码组件内部开始倒计时
|
||||
this.$refs.uCode.start();
|
||||
}, 100);
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.toast('倒计时结束后再发送');
|
||||
// this.$u.toast('倒计时结束后再发送');
|
||||
// console.log("倒计时结束后再发送");
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
end() {
|
||||
this.$u.toast('倒计时结束');
|
||||
// this.$u.toast('倒计时结束');
|
||||
},
|
||||
start() {
|
||||
// this.$u.toast('倒计时开始');
|
||||
console.log(this.smslog_type)
|
||||
// console.log(this.smslog_type)
|
||||
// 倒计时请求
|
||||
this.$u.api.sendSmsCode({
|
||||
member_mobile: this.member_mobile,
|
||||
smslog_type: this.smslog_type
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,19 @@ export default {
|
||||
},
|
||||
// 判断是不是编辑页面 调用接口
|
||||
confirmBtn() {
|
||||
if(!this.debounce) return;
|
||||
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)) {
|
||||
@@ -106,6 +118,7 @@ export default {
|
||||
},
|
||||
addAddress() {
|
||||
if(!this.validateValue()) return false;
|
||||
this.debounce = false;
|
||||
this.$u.api.addressAdd({
|
||||
area_id: this.area_id,
|
||||
city_id: this.city_id,
|
||||
@@ -118,26 +131,20 @@ 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');
|
||||
}
|
||||
})
|
||||
},
|
||||
editAddress() {
|
||||
if(!this.validateValue()) return false;
|
||||
this.debounce = false;
|
||||
this.$u.api.addressEdit({
|
||||
address_id: this.info.address_id,
|
||||
area_id: this.area_id,
|
||||
@@ -151,20 +158,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');
|
||||
}
|
||||
})
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
@click="removeFavorite"
|
||||
@open="open"
|
||||
>
|
||||
<view class="item u-border-bottom">
|
||||
<image src="@/pageE/static/mine/23.png"></image>
|
||||
<view class="item u-border-bottom" @click="viewGoodsDetails(item)">
|
||||
<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 | date }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -30,21 +30,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
show: false
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
show: false
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
show: false,
|
||||
}
|
||||
],
|
||||
show: false,
|
||||
list: [],
|
||||
options: [
|
||||
{
|
||||
text: '删除',
|
||||
@@ -59,14 +45,45 @@ export default {
|
||||
this.getGoodsFavoritesList();
|
||||
},
|
||||
methods: {
|
||||
getGoodsFavoritesList() {
|
||||
this.$u.api.getFavoritesList().then(res => {
|
||||
if(res.errCode == 0) {}
|
||||
viewGoodsDetails(item) {
|
||||
if(this.closeAction()) return false;
|
||||
const list = this.list.filter(item => {
|
||||
return item.show;
|
||||
})
|
||||
if(list.length) return false;
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: item.fav_id,
|
||||
}
|
||||
})
|
||||
},
|
||||
removeFavorite(id) {
|
||||
closeAction() {
|
||||
let status = false;
|
||||
this.list.map((val, idx) => {
|
||||
if(val.show) {
|
||||
status = true;
|
||||
this.$set(this.list[idx], 'show', false);
|
||||
};
|
||||
})
|
||||
this.$forceUpdate();
|
||||
return status;
|
||||
},
|
||||
getGoodsFavoritesList() {
|
||||
this.$u.api.getFavoritesList().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.list = res.data;
|
||||
this.list.forEach(item => {
|
||||
Object.assign(item, { show: false });
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
removeFavorite(index) {
|
||||
const id = this.list[index].fav_id;
|
||||
this.$u.api.removeFavorite({
|
||||
id: id
|
||||
fid: id,
|
||||
type: 'goods'
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.getGoodsFavoritesList();
|
||||
@@ -82,6 +99,7 @@ export default {
|
||||
this.list.map((val, idx) => {
|
||||
if(index != idx) this.list[idx].show = false;
|
||||
})
|
||||
this.$forceUpdate();
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -99,6 +117,7 @@ export default {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.title-wrap {
|
||||
flex: 1;
|
||||
.item-top {
|
||||
font-size: 30rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
<view class="c-coupon">
|
||||
<view class="coupon-usable">
|
||||
<view class="info-type" :style="{ backgroundImage: 'url(' + '/static/image/mine/30.png' + ')', backgroundSize:'contain', backgroundRepeat: 'no-repeat' }">
|
||||
<div class="wrap_left_top"></div>
|
||||
{{ couponInfo.type == 2 ? '店铺优惠券' : '平台优惠券' }}
|
||||
<div class="wrap_left_top" v-if="couponInfo.type == 1">{{ couponInfo.vouchertemplate_id == 1 ? '新人专享' : '平台优惠券' }}</div>
|
||||
<div class="wrap_left_top" v-else-if="couponInfo.type == 2">店铺优惠券</div>
|
||||
</view>
|
||||
<view class="coupon-info">
|
||||
<view class="info-usable">
|
||||
<view class="price">¥<span>{{ couponInfo.vouchertemplate_price }}</span></view>
|
||||
<view class="condition">满{{ couponInfo.vouchertemplate_limit }}使用</view>
|
||||
</view>
|
||||
<view class="info-store u-line-1">仅限{{ couponInfo.vouchertemplate_storename }}商品使用</view>
|
||||
<view class="info-store u-line-1">仅限{{ couponInfo.type == 2 ? couponInfo.vouchertemplate_storename : '指定商品' }}使用</view>
|
||||
<view class="info-integral">兑换积分:{{ couponInfo.vouchertemplate_points }}积分</view>
|
||||
<view class="info-date">有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}</view>
|
||||
</view>
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
<view class="c-coupon" v-if="goodsClass.length">
|
||||
<view :class="couponInfo.voucher_state != 1 ? 'coupon-unable' : 'coupon-usable'">
|
||||
<view class="info-type" :style="{ backgroundImage: 'url(' + (couponInfo.voucher_state == 1 ? '/static/image/mine/30.png' : '/static/image/mine/31.png') + ')', backgroundSize:'contain', backgroundRepeat: 'no-repeat' }">
|
||||
<div class="wrap_left_top"></div>
|
||||
{{ couponInfo.type == 2 ? '店铺优惠券' : '平台优惠券' }}
|
||||
<div class="wrap_left_top" v-if="couponInfo.type == 1">{{ couponInfo.vouchertemplate_id == 1 ? '新人专享' : '平台优惠券' }}</div>
|
||||
<div class="wrap_left_top" v-else-if="couponInfo.type == 2">店铺优惠券</div>
|
||||
</view>
|
||||
<view class="coupon-info">
|
||||
<view class="info-usable">
|
||||
<view class="price">¥<span>{{ couponInfo.voucher_price }}</span></view>
|
||||
<view class="condition">满{{ couponInfo.voucher_limit }}使用</view>
|
||||
</view>
|
||||
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '平台' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
|
||||
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '指定商品' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
|
||||
<view class="info-integral">兑换积分:{{ couponInfo.voucher_points }}积分</view>
|
||||
<view class="info-date">有效期{{ couponInfo.voucher_startdate }}-{{ couponInfo.voucher_enddate }}</view>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="order-item">
|
||||
<view class="order-item" v-if="order.extend_store">
|
||||
<view class="order-title">
|
||||
<view class="store-info">
|
||||
<image :src="order.extend_store.store_avatar"></image>
|
||||
@@ -12,87 +12,143 @@
|
||||
<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">{{ goods.goods_spec | concatSpec }}</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, 11].indexOf(order.view_type) >= 0">
|
||||
<!-- || order.view_type == 2 -->
|
||||
<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 && order.shipping_code" @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="cancel" v-if="order.view_type == 9" @click="cancelOrder">取消订单</view> -->
|
||||
<view class="phone" v-if="order.view_type == 3 && order.takeawayer_phone" @click="makePhone(order.takeawayer_phone)">
|
||||
<u-icon name="phone-fill" color="#FF780F" size="28"></u-icon>
|
||||
<text>联系骑手</text>
|
||||
</view>
|
||||
<!-- || order.view_type == 9 -->
|
||||
<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: 售后
|
||||
}
|
||||
},
|
||||
props: {
|
||||
order: Object
|
||||
},
|
||||
created() {
|
||||
this.viewState();
|
||||
mounted() {
|
||||
// this.viewState();
|
||||
},
|
||||
filters: {
|
||||
concatSpec(value) {
|
||||
let spec = '';
|
||||
for (const key in value) {
|
||||
if (value.hasOwnProperty(key)) {
|
||||
const element = value[key];
|
||||
spec = spec + element + ';'
|
||||
}
|
||||
}
|
||||
return spec;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
viewState() {
|
||||
let state;
|
||||
switch (this.order.order_state) {
|
||||
case 0: // 已取消
|
||||
state = '已取消';
|
||||
break;
|
||||
case 10: // 未付款
|
||||
state = '待支付';
|
||||
break;
|
||||
case 20: // 已付款
|
||||
state = '交易成功';
|
||||
break;
|
||||
case 30: // 已发货
|
||||
state = '待收货';
|
||||
break;
|
||||
case 40: // 已收货
|
||||
if(this.order.evaluation_state == 0) state = '待评价';
|
||||
else 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 = '已退款';
|
||||
}
|
||||
|
||||
this.state = state;
|
||||
},
|
||||
|
||||
cancelOrder() {
|
||||
this.$u.api.cancelOrder({
|
||||
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) {
|
||||
this.$u.route('/pageE/order/' + url, {
|
||||
oid: this.order.order_id,
|
||||
type:this.order.view_type
|
||||
});
|
||||
},
|
||||
payNow(pay_sn, order_amount, id) {
|
||||
this.$u.route('/pageC/cart/cashier', {
|
||||
pay_sn: pay_sn,
|
||||
price: order_amount,
|
||||
order_id: id
|
||||
});
|
||||
},
|
||||
makePhone(phone) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
});
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
state() {
|
||||
let state;
|
||||
// console.log(this.order.view_type);
|
||||
switch (this.order.view_type) {
|
||||
case 1:
|
||||
state = '待支付';
|
||||
break;
|
||||
case 2:
|
||||
state = '待发货';
|
||||
break;
|
||||
case 3:
|
||||
state = '待收货';
|
||||
break;
|
||||
case 4:
|
||||
state = '待评价';
|
||||
break;
|
||||
case 5:
|
||||
state = '交易成功';
|
||||
break;
|
||||
case 6:
|
||||
state = '待退款';
|
||||
break;
|
||||
case 7:
|
||||
state = '已退款';
|
||||
break;
|
||||
case 9:
|
||||
state = '拼团中';
|
||||
break;
|
||||
case 10:
|
||||
state = '已取消';
|
||||
break;
|
||||
case 11:
|
||||
state = '已拒绝';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// console.log(state);
|
||||
return state;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@@ -114,6 +170,7 @@ export default {
|
||||
height: 50rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
background-color: aquamarine;
|
||||
}
|
||||
.store-name {
|
||||
font-size: 26rpx;
|
||||
@@ -146,6 +203,7 @@ export default {
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.goods-sku {
|
||||
align-self: baseline;
|
||||
max-width: 230rpx;
|
||||
background: rgba(236,236,236,1);
|
||||
border-radius: 6rpx;
|
||||
@@ -179,7 +237,7 @@ export default {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
@mixin btn-class($width, $color) {
|
||||
width: $width;
|
||||
// width: $width;
|
||||
height: 60rpx;
|
||||
border: 2rpx solid $color;
|
||||
color: $color;
|
||||
@@ -193,7 +251,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 {
|
||||
@@ -202,6 +260,15 @@ export default {
|
||||
.submit {
|
||||
@include btn-class($width: 216rpx, $color: rgba(255,119,15,1));
|
||||
}
|
||||
.phone {
|
||||
@include btn-class($width: 206rpx, $color: rgba(255,119,15,1));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.u-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
192
components/mine/order-item/try.vue
Normal 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>
|
||||
@@ -1,339 +1,341 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- <image v-if="type" class="welcome_images" src="../../static/pageA/welcome_img.jpg" mode="aspectFill"></image> -->
|
||||
<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"
|
||||
enable-danmu danmu-btn></video>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="type" class="welcome_jumpes" @click="leap_over">跳过{{remaining}}</view>
|
||||
<view v-if="banner" class="welcome_jumpes" @click="leap_overto">跳过</view>
|
||||
<!-- 轮播图 -->
|
||||
<view class="uni-padding-wrap" v-if="banner" >
|
||||
<view>
|
||||
<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" >
|
||||
<view class="swiper-item uni-bg-red">
|
||||
<image :src=" 'https://' + item.launch_path"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 用户协议弹窗 -->
|
||||
<view class="welcome_backes" v-if="protocol">
|
||||
<view class="content">
|
||||
<view class="title">{{ agreement.document_title }}</view>
|
||||
<!-- <text class="protocol_content"></text> -->
|
||||
<scroll-view scroll-y class="scroll">
|
||||
<rich-text class="protocol_content" :nodes="agreement.document_content"></rich-text>
|
||||
</scroll-view>
|
||||
<view class="to_agree" @click="to_agree">我同意</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import common from '@/static/js/common.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
remaining: 4,
|
||||
type: true,
|
||||
banner: false,
|
||||
protocol: false,
|
||||
heightOut: '',
|
||||
imgurl: [],
|
||||
loop: 'true',
|
||||
vide0_url: '',
|
||||
agreement: { // 用户协议内容
|
||||
document_title: "",
|
||||
document_content: ""
|
||||
},
|
||||
heightesStyle : {
|
||||
height : ''
|
||||
},
|
||||
title: 'video',
|
||||
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
|
||||
};
|
||||
},
|
||||
onReady: function(res) {
|
||||
this.videoContext = uni.createVideoContext('myVideo')
|
||||
},
|
||||
methods: {
|
||||
apiwelcome() {
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'agreement'
|
||||
}).then((res) => {
|
||||
if (res.errCode == 0) {
|
||||
let agreement = res.data;
|
||||
// console.log(agreement.document_content)
|
||||
agreement.document_content = common.unescapeHTML(agreement.document_content);
|
||||
// console.log(agreement);
|
||||
this.agreement = agreement;
|
||||
}
|
||||
})
|
||||
// 启动页
|
||||
this.$u.api.pageList({}).then((res) => {
|
||||
console.log('协议', res)
|
||||
let data_image = res.data.welcome_page
|
||||
let vide0_url = res.data.start_page[0].launch_path
|
||||
this.list = data_image;
|
||||
this.vide0_url = vide0_url;
|
||||
console.log(this.list)
|
||||
})
|
||||
},
|
||||
// 3秒倒计时
|
||||
remaining_time() {
|
||||
this.timer = setInterval(() => {
|
||||
this.remaining--;
|
||||
if (this.remaining <= 0) {
|
||||
clearInterval(this.timer);
|
||||
console.log("完了")
|
||||
this.type = !this.type
|
||||
this.banner = !this.banner;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
leap_over() {
|
||||
this.type = !this.type
|
||||
this.banner = !this.banner;
|
||||
clearInterval(this.timer)
|
||||
// 获取屏幕高度
|
||||
this.getSystemInfo()
|
||||
},
|
||||
leap_overto() {
|
||||
this.protocol = true;
|
||||
this.banner = false;
|
||||
},
|
||||
getSystemInfo() {
|
||||
let that = this;
|
||||
// 获取屏幕高度
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.heightOut = res.windowHeight;
|
||||
console.log('666666666666666' + that.heightOut)
|
||||
}
|
||||
});
|
||||
},
|
||||
// 我同意
|
||||
to_agree() {
|
||||
uni.navigateTo({
|
||||
url: '/pageA/login/login'
|
||||
});
|
||||
},
|
||||
// 视频引入
|
||||
bindInputBlur: function(e) {
|
||||
this.inputValue = e.target.value
|
||||
},
|
||||
bindButtonTap: function() {
|
||||
var that = this
|
||||
uni.chooseVideo({
|
||||
sourceType: ['album', 'camera'],
|
||||
maxDuration: 60,
|
||||
camera: ['front', 'back'],
|
||||
success: function(res) {
|
||||
this.src = res.tempFilePath
|
||||
}
|
||||
})
|
||||
},
|
||||
bindSendDanmu: function() {
|
||||
this.videoContext.sendDanmu({
|
||||
text: this.inputValue,
|
||||
color: this.getRandomColor()
|
||||
})
|
||||
},
|
||||
videoErrorCallback: function(e) {
|
||||
console.log('视频错误信息:')
|
||||
console.log(e.target.errMsg)
|
||||
},
|
||||
getRandomColor: function() {
|
||||
const rgb = []
|
||||
for (let i = 0; i < 3; ++i) {
|
||||
let color = Math.floor(Math.random() * 256).toString(16)
|
||||
color = color.length == 1 ? '0' + color : color
|
||||
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()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uni-padding-wrap{
|
||||
// height: 400rpx;
|
||||
}
|
||||
.welcome_jumpes {
|
||||
width: 94rpx;
|
||||
height: 36rpx;
|
||||
opacity: 0.5;
|
||||
border-radius: 18rpx;
|
||||
position: absolute;
|
||||
right: 37rpx;
|
||||
top: 66rpx;
|
||||
font-size: 22rpx;
|
||||
text-align: center;
|
||||
line-height: 35rpx;
|
||||
color: #fff;
|
||||
background: #C4CAC6;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#myVideo {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
uni-video {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.uni-video-container {
|
||||
background-color: none !important;
|
||||
}
|
||||
|
||||
.welcome_images {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
height: 100%
|
||||
}
|
||||
|
||||
uni-swiper,
|
||||
uni-view,
|
||||
uni-image {
|
||||
width: 100%;
|
||||
// position: fixed;
|
||||
height: 100%
|
||||
}
|
||||
|
||||
uni-image {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 轮播图分页器颜色
|
||||
uni-swiper .uni-swiper-dot-active {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.welcome_backes {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
background: #999999;
|
||||
|
||||
.content {
|
||||
width: 558rpx;
|
||||
height: 730rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
margin: auto;
|
||||
|
||||
.title {
|
||||
width: 558rpx;
|
||||
text-align: center;
|
||||
height: 29rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 29rpx;
|
||||
margin: 30rpx 0 24rpx 0;
|
||||
}
|
||||
|
||||
.scroll {
|
||||
height: 560rpx;
|
||||
|
||||
.protocol_content {
|
||||
width: 494rpx;
|
||||
height: 528rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
display: block;
|
||||
text-align: left;
|
||||
margin: 80rpx auto 33rpx;
|
||||
letter-spacing: 1rpx;
|
||||
text-align: justify;
|
||||
line-height: 36rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.to_agree {
|
||||
width: 558rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(255, 121, 16, 1);
|
||||
text-align: center;
|
||||
padding-top: 27rpx;
|
||||
border-top: #D8D8D8 solid 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view>
|
||||
<!-- <image v-if="type" class="welcome_images" src="../../static/pageA/welcome_img.jpg" mode="aspectFill"></image> -->
|
||||
<view v-if="type" id="video_mp4">
|
||||
<view class="page-body">
|
||||
<view class="page-section">
|
||||
<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>
|
||||
</view>
|
||||
<view v-if="type" class="welcome_jumpes" @click="leap_over">跳过{{remaining}}</view>
|
||||
<view v-if="banner" class="welcome_jumpes" @click="leap_overto">跳过</view>
|
||||
<!-- 轮播图 -->
|
||||
<view class="uni-padding-wrap" v-if="banner" >
|
||||
<view>
|
||||
<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="300" @animationfinish="tiaoguos" @change="qiehuan">
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 用户协议弹窗 -->
|
||||
<view class="welcome_backes" v-if="protocol">
|
||||
<view class="content">
|
||||
<view class="title">{{ agreement.document_title }}</view>
|
||||
<!-- <text class="protocol_content"></text> -->
|
||||
<scroll-view scroll-y class="scroll">
|
||||
<rich-text class="protocol_content" :nodes="agreement.document_content"></rich-text>
|
||||
</scroll-view>
|
||||
<view class="to_agree" @click="to_agree">我同意</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import common from '@/static/js/common.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
remaining: 7,
|
||||
type: false,
|
||||
banner: true,
|
||||
protocol: false,
|
||||
heightOut: '',
|
||||
imgurl: [],
|
||||
vide0_url: '',
|
||||
agreement: { // 用户协议内容
|
||||
document_title: "",
|
||||
document_content: ""
|
||||
},
|
||||
heightesStyle : {
|
||||
height : ''
|
||||
},
|
||||
title: 'video',
|
||||
src: '',
|
||||
inputValue: '',
|
||||
controls: false,
|
||||
list: [],
|
||||
background: ['color1', 'color2', 'color3'],
|
||||
indicatorDots: true,
|
||||
interval: 2000,
|
||||
duration: 500,
|
||||
swiper_index: "",
|
||||
tiaoguo:false,
|
||||
weizhi:0
|
||||
};
|
||||
},
|
||||
onReady: function(res) {
|
||||
this.videoContext = uni.createVideoContext('myVideo');
|
||||
},
|
||||
methods: {
|
||||
tiaoguos(a){
|
||||
console.log(a.detail)
|
||||
if(this.weizhi == a.detail.current && a.detail.current == this.list.length -1){
|
||||
this.leap_overto()
|
||||
}
|
||||
this.weizhi = a.detail.current
|
||||
|
||||
},
|
||||
qiehuan(a){
|
||||
console.log(a)
|
||||
this.tiaoguo = a.detail.current
|
||||
},
|
||||
apiwelcome() {
|
||||
this.$u.api.documentInfo({
|
||||
document_code: 'agreement'
|
||||
}).then((res) => {
|
||||
if (res.errCode == 0) {
|
||||
let agreement = res.data;
|
||||
// console.log(agreement.document_content)
|
||||
agreement.document_content = common.unescapeHTML(agreement.document_content);
|
||||
// console.log(agreement);
|
||||
this.agreement = agreement;
|
||||
}
|
||||
})
|
||||
// 启动页
|
||||
this.$u.api.pageList({}).then((res) => {
|
||||
console.log('协议', res)
|
||||
let data_image = res.data.welcome_page
|
||||
let vide0_url = res.data.start_page[0].launch_path
|
||||
this.list = data_image;
|
||||
this.vide0_url = vide0_url;
|
||||
})
|
||||
},
|
||||
// 3秒倒计时
|
||||
remaining_time() {
|
||||
// this.timer = setInterval(() => {
|
||||
// this.remaining--;
|
||||
// if (this.remaining <= 0) {
|
||||
// clearInterval(this.timer);
|
||||
// console.log("完了")
|
||||
// // this.type = !this.type;
|
||||
// // this.banner = !this.banner;
|
||||
// }
|
||||
// }, 1000);
|
||||
},
|
||||
leap_over() {
|
||||
// this.type = !this.type
|
||||
this.banner = !this.banner;
|
||||
clearInterval(this.timer)
|
||||
// 获取屏幕高度
|
||||
this.getSystemInfo()
|
||||
},
|
||||
leap_overto() {
|
||||
this.protocol = true;
|
||||
this.banner = false;
|
||||
},
|
||||
getSystemInfo() {
|
||||
let that = this;
|
||||
// 获取屏幕高度
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.heightOut = res.windowHeight;
|
||||
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;
|
||||
console.log(e.target.value);
|
||||
},
|
||||
bindButtonTap: function() {
|
||||
var that = this
|
||||
uni.chooseVideo({
|
||||
sourceType: ['album', 'camera'],
|
||||
maxDuration: 60,
|
||||
camera: ['front', 'back'],
|
||||
success: function(res) {
|
||||
this.src = res.tempFilePath
|
||||
}
|
||||
})
|
||||
},
|
||||
bindSendDanmu: function() {
|
||||
this.videoContext.sendDanmu({
|
||||
text: this.inputValue,
|
||||
color: this.getRandomColor()
|
||||
})
|
||||
},
|
||||
videoErrorCallback: function(e) {
|
||||
console.log('视频错误信息:',e);
|
||||
},
|
||||
timeupdate(e) {
|
||||
console.log(e);
|
||||
},
|
||||
getRandomColor: function() {
|
||||
const rgb = []
|
||||
for (let i = 0; i < 3; ++i) {
|
||||
let color = Math.floor(Math.random() * 256).toString(16)
|
||||
color = color.length == 1 ? '0' + color : color
|
||||
rgb.push(color)
|
||||
}
|
||||
return '#' + rgb.join('')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 3秒倒计时调用
|
||||
this.remaining_time();
|
||||
this.apiwelcome();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uni-padding-wrap{
|
||||
// height: 400rpx;
|
||||
}
|
||||
.btn-init {
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
bottom: 100rpx;
|
||||
right: 230rpx;
|
||||
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: 40rpx;
|
||||
color: #fff;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
#myVideo {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
uni-video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.uni-video-container {
|
||||
background-color: none !important;
|
||||
}
|
||||
|
||||
.welcome_images {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
uni-swiper,
|
||||
uni-view,
|
||||
uni-image {
|
||||
width: 100%;
|
||||
// position: fixed;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
uni-image {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 轮播图分页器颜色
|
||||
uni-swiper .uni-swiper-dot-active {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.welcome_backes {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
background: #999999;
|
||||
|
||||
.content {
|
||||
width: 558rpx;
|
||||
height: 730rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
margin: auto;
|
||||
|
||||
.title {
|
||||
width: 558rpx;
|
||||
text-align: center;
|
||||
height: 29rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 29rpx;
|
||||
margin: 30rpx 0 24rpx 0;
|
||||
}
|
||||
|
||||
.scroll {
|
||||
height: 560rpx;
|
||||
|
||||
.protocol_content {
|
||||
display: block;
|
||||
width: 494rpx;
|
||||
height: 528rpx;
|
||||
margin: 10rpx auto 30rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
line-height: 36rpx;
|
||||
text-align: justify;
|
||||
letter-spacing: 1rpx;
|
||||
text-indent: 2rem;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.to_agree {
|
||||
width: 558rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(255, 121, 16, 1);
|
||||
text-align: center;
|
||||
padding-top: 27rpx;
|
||||
border-top: #D8D8D8 solid 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,16 +2,21 @@
|
||||
<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 :list="classifyList" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="60" font-size="24" inactive-color="#333333"></u-tabs>
|
||||
</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>
|
||||
<view v-if="groupList[i]" class="group-container">
|
||||
<sitem :info="info" v-for="(info, index) in groupList[i].slice(0, 3)" :key="index"></sitem>
|
||||
</view>
|
||||
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList[i] || !groupList[i].length" style="margin: 0 auto;"></u-empty>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -23,17 +28,43 @@ 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[this.current] = res.data;
|
||||
console.log(this.groupList);
|
||||
this.$forceUpdate();
|
||||
})
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
@@ -52,8 +83,10 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.group{
|
||||
.top{
|
||||
height: 90rpx;
|
||||
background-color: #ffffff;
|
||||
.top {
|
||||
padding: 0 30rpx;
|
||||
height:80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -62,23 +95,24 @@ export default {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
>text:last-child{
|
||||
font-size: 18rpx;
|
||||
color: #999;
|
||||
}
|
||||
.more {
|
||||
font-size: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
// .label{
|
||||
// display: flex;
|
||||
// font-size: 24rpx;
|
||||
// color: #999;
|
||||
// >text{
|
||||
// margin-right: 34rpx;
|
||||
// }
|
||||
// }
|
||||
.list{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 21rpx;
|
||||
.list {
|
||||
box-sizing: border-box;
|
||||
padding: 0 30rpx;
|
||||
.group-container {
|
||||
display: flex;
|
||||
> view {
|
||||
&:not(:nth-child(3n)) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,10 @@
|
||||
<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>
|
||||
<view>立即拼团</view>
|
||||
<view class="value">¥{{ info.pintuan_goods_price }}</view>
|
||||
<view class="btn">立即拼团</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -16,19 +16,27 @@ 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.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// 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,
|
||||
id: this.info.pintuan_goods_id,
|
||||
// type: 2,
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -37,11 +45,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{
|
||||
@@ -52,18 +61,22 @@ export default {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.price{
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: space-between;
|
||||
margin-top: 10rpx;
|
||||
> view:first-child{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// align-content: flex-end;
|
||||
justify-content: space-between;
|
||||
margin-top: 16rpx;
|
||||
.value {
|
||||
font-size: 26rpx;
|
||||
color: #FF3131;
|
||||
margin-bottom: 4rpx;
|
||||
// margin-bottom: 12rpx;
|
||||
}
|
||||
> view:last-child{
|
||||
.btn {
|
||||
font-size: 22rpx;
|
||||
height: 22rpx;
|
||||
color: #FDD360;
|
||||
text-align: end;
|
||||
// margin-top:8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 :list="classifyList" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="60" font-size="24" inactive-color="#333333"></u-tabs>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
||||
<swiper class="swiper-box" :current="swiperCurrent" @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">
|
||||
<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> -->
|
||||
<view class="goods-item">
|
||||
<item v-for="item in goodsList[index]" :key="item.goods_id" :info="item"></item>
|
||||
</view>
|
||||
<u-empty text="暂无商品" mode="list" color="#000" margin-top="20" v-if="!goodsList[index] || !goodsList[index].length"></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> -->
|
||||
</view>
|
||||
<u-loadmore class="load-size" :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore"></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});
|
||||
}
|
||||
@@ -52,7 +48,7 @@ export default {
|
||||
this.getGoodsClassRecommend();
|
||||
},
|
||||
methods: {
|
||||
loadMore(page) {
|
||||
loadMore() {
|
||||
if(!this.timer) return false;
|
||||
this.loadStatus = "loading";
|
||||
this.page++;
|
||||
@@ -61,27 +57,25 @@ 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 => {
|
||||
console.log(res)
|
||||
if (res.errCode == 0) {
|
||||
// 初始化 current
|
||||
this.current = 0;
|
||||
this.classifyList = res.data.gc_recommend;
|
||||
// this.getGoodsRecommend(this.classifyList[0].gc_id);
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -90,68 +84,67 @@ export default {
|
||||
page: page,
|
||||
gc_id: gc_id,
|
||||
})
|
||||
// this.swiperCurrent = this.current;
|
||||
if (res.errCode == 0) {
|
||||
if(reload) this.goodsList = res.data.goodsList;
|
||||
else this.goodsList.push(...res.data.goodsList);
|
||||
this.timer = true;
|
||||
if(reload) this.goodsList[this.current] = res.data.goodsList;
|
||||
else this.goodsList[this.current].push(...res.data.goodsList);
|
||||
// console.log(this.goodsList);
|
||||
this.setSwiperHeight();
|
||||
}
|
||||
this.$forceUpdate();
|
||||
return res.data.goodsList.length;
|
||||
},
|
||||
setSwiperHeight() {
|
||||
// height: 230px, margin-bottom: 13
|
||||
this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (230 + 13) + 'px';
|
||||
// height: 480rpx, margin-bottom: 26rpx
|
||||
const height = Math.ceil(this.goodsList[this.current].length / 2) * (450 + 26);
|
||||
this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
|
||||
// console.log(this.swiperHeight);
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
||||
transition(e) {
|
||||
let dx = e.detail.dx;
|
||||
this.$refs.uTabs.setDx(dx);
|
||||
this.current = index;
|
||||
this.swiperCurrent = this.current;
|
||||
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
|
||||
},
|
||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||
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{
|
||||
.top{
|
||||
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;
|
||||
|
||||
// }
|
||||
.goods-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.swiper-box {
|
||||
height: 100%;
|
||||
padding-top: 20rpx;
|
||||
.swiper-item {
|
||||
// height: 100%;
|
||||
.goods-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
// height: 100%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,10 @@
|
||||
<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="price">¥{{ info.goods_price }}</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 style="font-size:22rpx;color:#999;text-decoration:line-through;display: inline-block;margin-left:20rpx"> ¥{{info.goods_marketprice}}</text></text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -16,20 +16,27 @@ 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.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// console.log(this.goodsInfo.mobile_body);
|
||||
// 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',
|
||||
params: {
|
||||
id: this.info.goods_id,
|
||||
// type: 1,
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -37,14 +44,14 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.item{
|
||||
width: 330rpx;
|
||||
height: 460rpx;
|
||||
height: 450rpx;
|
||||
margin-bottom: 26rpx;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 10rpx 10rpx 0rpx 0rpx;
|
||||
.img{
|
||||
width: 330rpx;
|
||||
height: 272rpx;
|
||||
background: rgba(245,245,245,1);
|
||||
height: 300rpx;
|
||||
background: rgb(114, 110, 110);
|
||||
border-radius: 10rpx 10rpx 0rpx 0rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
@@ -55,14 +62,18 @@ export default {
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
.title{
|
||||
font-size: 30rpx;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
height: 60rpx;
|
||||
line-height: 30rpx;
|
||||
color: #333;
|
||||
margin-bottom: 13rpx;
|
||||
}
|
||||
.jianjie{
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 20rpx;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.price{
|
||||
color: #FF3131;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<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="connect" @click="toOthersPage">
|
||||
<view class="time" v-if="type == 'spike'">
|
||||
<image src="/static/image/common/15.png"></image>
|
||||
<text>{{ info.groupbuy_starttime_histime }}</text>
|
||||
@@ -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.goods_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,15 @@ export default {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
>text:last-child{
|
||||
font-size: 18rpx;
|
||||
color: #999;
|
||||
}
|
||||
.more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
.connect{
|
||||
padding: 15rpx;
|
||||
display: flex;
|
||||
.time{
|
||||
display: flex;
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
<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">
|
||||
<view class="avatar">
|
||||
<image :src="info.member_avatar[0]"></image>
|
||||
<image :src="info.member_avatar[1]"></image>
|
||||
<image src="/static/image/common/32.png"></image>
|
||||
<image src="/static/image/common/31.png"></image>
|
||||
</view>
|
||||
<view class="num">{{ info.pintuan_limit_number }}人团</view>
|
||||
</view>
|
||||
@@ -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" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -35,23 +38,31 @@ 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.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// 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,
|
||||
id: this.recommendData.groupbuy_id,
|
||||
// type: 2,
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -59,8 +70,11 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.recommend{
|
||||
.top{
|
||||
.recommend {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #ffffff;
|
||||
.top {
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -69,12 +83,15 @@ export default {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
>text:last-child{
|
||||
font-size: 18rpx;
|
||||
color: #999;
|
||||
}
|
||||
.more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
.connect{
|
||||
padding:10rpx 0 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.user {
|
||||
@@ -142,10 +159,11 @@ export default {
|
||||
}
|
||||
}
|
||||
.img{
|
||||
width: 213rpx;
|
||||
height: 160rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 13rpx;
|
||||
width: 210rpx;
|
||||
height: 200rpx;
|
||||
margin-left: 10rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: antiquewhite;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<text class="num">00</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text>-</text>
|
||||
<text class="heng">-</text>
|
||||
<text class="num">{{ time.bigHour }}</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
@@ -17,9 +17,10 @@
|
||||
<text class="num">00</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="next" @click="viewMore">
|
||||
查看更多>
|
||||
</view>
|
||||
<view class="next" @click="viewMore">
|
||||
<text>查看更多</text>
|
||||
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<sitem v-for="(item, index) in list.slice(0, 3)" :key="index" :item="item"></sitem>
|
||||
@@ -45,8 +46,11 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.seckill{
|
||||
background-color: #fff;
|
||||
padding: 0 30rpx 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.top{
|
||||
height: 60rpx;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -62,24 +66,36 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20rpx;
|
||||
.heng {
|
||||
margin: 0 6rpx;
|
||||
}
|
||||
.num{
|
||||
box-sizing: content-box;
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
background-color: #bfbfbf;
|
||||
margin: 0 10rpx;
|
||||
padding: 2rpx;
|
||||
padding: 2rpx 4rpx;
|
||||
margin: 0 6rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 25rpx;
|
||||
border-radius: 4rpx;
|
||||
box-sizing: content-box;
|
||||
background-color: #000;
|
||||
}
|
||||
.mah {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.next{
|
||||
font-size: 18rpx;
|
||||
color: #999;
|
||||
font-size: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<view class="item" @click="spikeGoods">
|
||||
<image class="head" :src="item.groupbuy_image1"></image>
|
||||
<image class="head" :src="item.groupbuy_image1" mode="aspectFill"></image>
|
||||
<text class="title u-line-2">{{ item.goods_name }}</text>
|
||||
<view class="price">
|
||||
<text>¥{{ item.groupbuy_price }}</text>
|
||||
<text class="origin">¥{{ item.goods_price }}</text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="info" v-if="0">
|
||||
<text>剩余{{ item.inventory | formatValue }}件</text>
|
||||
<text>立即购买</text>
|
||||
</view>
|
||||
@@ -26,20 +26,28 @@ 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.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// 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,
|
||||
id: this.item.goods_id,
|
||||
// type: 3,
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -48,23 +56,28 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.item{
|
||||
width: 220rpx;
|
||||
width: 30%;
|
||||
margin-right: 50rpx;
|
||||
.head{
|
||||
width: 210rpx;
|
||||
height: 131rpx;
|
||||
width: 100%;
|
||||
height: 210rpx;
|
||||
border-radius: 6rpx;
|
||||
background-color: antiquewhite;
|
||||
}
|
||||
.title{
|
||||
width: 200rpx;
|
||||
height: 30rpx;
|
||||
margin-top: 6rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 30rpx;
|
||||
color: #333;
|
||||
margin-top: 16rpx;
|
||||
-webkit-line-clamp: 1 !important;
|
||||
}
|
||||
.price{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 19rpx;
|
||||
margin-top: 10rpx;
|
||||
>text:first-child{
|
||||
font-size: 26rpx;
|
||||
color: #FF3131;
|
||||
@@ -81,7 +94,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 20rpx;
|
||||
margin-top: 19rpx;
|
||||
margin-top: 10rpx;
|
||||
>text:first-child{
|
||||
color: #666;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<view class="special">
|
||||
<view v-if="type == 'spike'">
|
||||
<image :src="item.groupbuy_image1"></image>
|
||||
<view v-if="type == 'spike'" @click="spikeGoods">
|
||||
<image :src="item.groupbuy_image1" mode="aspectFill"></image>
|
||||
<view class="right">
|
||||
<view class="name u-line-1">{{ item.goods_name }}</view>
|
||||
<view class="price">
|
||||
<view class="groupbuy-price">{{ item.groupbuy_price }}</view>
|
||||
<view class="goods-price">{{ item.goods_price }}</view>
|
||||
<view class="groupbuy-price">¥{{ item.groupbuy_price }}</view>
|
||||
<view class="goods-price">¥{{ item.goods_price }}</view>
|
||||
</view>
|
||||
<view class="buy">
|
||||
<view class="num">剩余{{ item.inventory }}件</view>
|
||||
<view class="btn" @click="spikeGoods">立即购买</view>
|
||||
<view class="btn">立即购买</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="type == 'group'">
|
||||
<view v-if="type == 'group'" @click="toDetailsPage">
|
||||
<image :src="item.pintuan_image"></image>
|
||||
<view class="right">
|
||||
<view class="right">
|
||||
<view class="name u-line-1">{{ item.pintuan_goods_name }}</view>
|
||||
<view class="price group">
|
||||
<view class="groupbuy-price">{{ item.pintuan_goods_price }}</view>
|
||||
<view class="btn" @click="toDetailsPage">立即拼团</view>
|
||||
<view class="groupbuy-price">¥{{ item.pintuan_goods_price }}</view>
|
||||
<view class="btn">立即拼团</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -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.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// 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.goods_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.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// 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_goods_id,
|
||||
// type: 2,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,17 +2,21 @@
|
||||
<view class="coupon-swiper">
|
||||
<view class="top">
|
||||
<view class="title">全部优惠券</view>
|
||||
<view class="view-more" @click="toCouponPage">查看更多></view>
|
||||
<view class="view-more" @click="toCouponPage">
|
||||
<text>查看更多</text>
|
||||
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
|
||||
</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>
|
||||
<!-- :style="{ height: swiperHeight }" -->
|
||||
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
|
||||
<u-tabs :list="couponGroupList" name="gc_name" :is-scroll="true" :current="couponCurrent" @change="couponTabsChange" active-color="#FF780F" :show-bar="false" height="60" font-size="24" inactive-color="#333333"></u-tabs>
|
||||
<swiper class="box" :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
|
||||
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
||||
<!-- 最多显示四个 -->
|
||||
<view v-for="(coupon, index) in couponList.slice(0, 4)" :key="index" class="coupon-item">
|
||||
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
|
||||
<view v-if="couponList[i]">
|
||||
<view v-for="(coupon, index) in couponList[i].slice(0, 4)" :key="index" class="coupon-item">
|
||||
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList[i] || !couponList[i].length"></u-empty>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -56,16 +60,18 @@ export default {
|
||||
gc_id: gc_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponList = res.data;
|
||||
this.couponList[this.couponCurrent] = res.data;
|
||||
} else {
|
||||
this.couponList = [];
|
||||
this.couponList[this.couponCurrent] = [];
|
||||
}
|
||||
// 设置 swiper 高度
|
||||
this.setViewHeight();
|
||||
this.$forceUpdate();
|
||||
})
|
||||
},
|
||||
couponTabsChange(index) {
|
||||
this.couponCurrent = index;
|
||||
this.swiperCouponCurrent = this.couponCurrent;
|
||||
},
|
||||
couponAnimationFinish(e) {
|
||||
const current = e.detail.current;
|
||||
@@ -75,10 +81,10 @@ export default {
|
||||
setViewHeight() {
|
||||
// 一个优惠券的高度 97px, 下距离 10px
|
||||
let num = 0;
|
||||
num = this.couponList.length
|
||||
? this.couponList.length > 4 ? 4 : this.couponList.length
|
||||
num = this.couponList[this.couponCurrent].length
|
||||
? this.couponList[this.couponCurrent].length > 4 ? 4 : this.couponList[this.couponCurrent].length
|
||||
: 1
|
||||
this.swiperHeight = (97 + 10) * num - 10 + 'px';
|
||||
this.swiperHeight = (200 + 20) * num + 'rpx';
|
||||
},
|
||||
toCouponPage() {
|
||||
this.$u.route({
|
||||
@@ -93,8 +99,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;
|
||||
@@ -104,19 +113,23 @@ export default {
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
.view-more {
|
||||
font-size: 18rpx;
|
||||
font-size: 20rpx;
|
||||
color: rgba(153,153,153,1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.swiper-coupon-item {
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
// padding: 30rpx {
|
||||
// top: 0;
|
||||
// };
|
||||
.coupon-item {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
padding-top: 20rpx;
|
||||
.swiper-coupon-item {
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
.coupon-item {
|
||||
height: 200rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -23,7 +23,6 @@
|
||||
},
|
||||
methods: {
|
||||
type_logines(){
|
||||
console.log("2345")
|
||||
this.show = this.type_login
|
||||
}
|
||||
},
|
||||
|
||||
7
main.js
@@ -1,11 +1,16 @@
|
||||
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'
|
||||
|
||||
// 当前 app 版本号
|
||||
Vue.prototype.$app_version = '1.0.0';
|
||||
|
||||
Vue.prototype.imService = new IMService();
|
||||
Vue.prototype.a = 1;
|
||||
import store from '@/common/store/index.js'
|
||||
|
||||
Vue.prototype.$store = store;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "deming",
|
||||
"appid" : "__UNI__62A680B",
|
||||
"name" : "德铭阳光",
|
||||
"appid" : "__UNI__EBFF00A",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
@@ -11,14 +11,21 @@
|
||||
"nvueCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"alwaysShowBeforeRender" : false,
|
||||
"waiting" : false,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"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" : "E:/Source-code/appleidmore/安卓png/72x72psd.PNG",
|
||||
"xhdpi" : "E:/Source-code/appleidmore/安卓png/96x96psd.PNG",
|
||||
"xxhdpi" : "E:/Source-code/appleidmore/安卓png/144x144.PNG",
|
||||
"xxxhdpi" : "E:/Source-code/appleidmore/安卓png/192x192.PNG"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "E:/Source-code/appleidmore/苹果png/appstore 1024X1024.PNG",
|
||||
"iphone" : {
|
||||
"app@2x" : "E:/Source-code/appleidmore/苹果png/120x120.PNG",
|
||||
"app@3x" : "E:/Source-code/appleidmore/苹果png/180x180.PNG",
|
||||
"spotlight@2x" : "E:/Source-code/appleidmore/苹果png/80x80.PNG",
|
||||
"spotlight@3x" : "E:/Source-code/appleidmore/苹果png/120x120.PNG",
|
||||
"settings@2x" : "E:/Source-code/appleidmore/苹果png/58x58psd.PNG",
|
||||
"settings@3x" : "E:/Source-code/appleidmore/苹果png/87X87.PNG",
|
||||
"notification@2x" : "E:/Source-code/appleidmore/苹果png/40X40.PNG",
|
||||
"notification@3x" : "E:/Source-code/appleidmore/苹果png/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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
package-lock.json
generated
@@ -4,10 +4,15 @@
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"blueimp-md5": {
|
||||
"version": "2.17.0",
|
||||
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.17.0.tgz",
|
||||
"integrity": "sha512-x5PKJHY5rHQYaADj6NwPUR2QRCUVSggPzrUKkeENpj871o9l9IefJbO2jkT5UvYykeOK9dx0VmkIo6dZ+vThYw=="
|
||||
},
|
||||
"uview-ui": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.5.0.tgz",
|
||||
"integrity": "sha512-1UdMUGJqWx60ALbXXXs3rQHKUNBARDIV5XHc06mKFxpccO/i0tzoSqS6RuPdmYwXU1q59wnIU+NLABvcU5u4vw=="
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.6.2.tgz",
|
||||
"integrity": "sha512-AvTXUk8A/AdJazxTziApw0NMv61jlE9cEO+Jxe84cTvcm2Ej7Ngf8zb3a6aSPVi6OVu81vTCC71R1wN7dZC3ig=="
|
||||
},
|
||||
"vuex": {
|
||||
"version": "3.5.1",
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
"url": "http://git.luyuan.tk/luyuan/deming.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"uview-ui": "^1.5.0",
|
||||
"blueimp-md5": "^2.17.0",
|
||||
"uview-ui": "^1.6.2",
|
||||
"vuex": "^3.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,32 +3,28 @@
|
||||
<view>
|
||||
<view class="login">
|
||||
<view class="content">
|
||||
<view class="title">手机登录</view>
|
||||
<view class="title">请绑定手机号</view>
|
||||
<view class="labales">
|
||||
<text>手机号</text>
|
||||
<input type="tel" placeholder="" />
|
||||
<input type="number" maxlength="11" v-model="phone" placeholder="手机号" />
|
||||
</view>
|
||||
<view class="labales">
|
||||
<text>请输入验证码</text>
|
||||
<input type="tel" placeholder="" />
|
||||
<text class="identifying">获取验证码</text>
|
||||
<view class="labales flex-inp">
|
||||
<input type="number" maxlength="6" placeholder="请输入验证码" v-model="sms_code" />
|
||||
<u-button id="btn" class="identifying" :hair-line="false" hover-class="none" :class="is_sendcode ? 'sended' : ''" @click="getCode" :disabled="is_sendcode">{{ is_sendcode ? time_count + "后可以重新发送" : "发送验证码" }}</u-button>
|
||||
</view>
|
||||
<!-- 服务协议 -->
|
||||
<view class="pact">
|
||||
<view></view>
|
||||
<checkbox-group @change="change">
|
||||
<checkbox class="check-tit" color="#1ADE00" :checked="checked" />
|
||||
</checkbox-group>
|
||||
<text>我已详细阅读并同意</text>
|
||||
<text class="pact_text">《用户协议》</text>
|
||||
<text class="pact_text">《隐私协议》</text>
|
||||
<text class="pact_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>
|
||||
</u-checkbox-group>
|
||||
<text class="pact_text" v-for="(item,index) in pactList" :key="index" @click="infoPact(index)">
|
||||
{{ item }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- denglu QQ weixin -->
|
||||
<u-button>{{login}}</u-button>
|
||||
|
||||
<view class="btn-login" @click="bindPhone">{{login}}</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -36,81 +32,151 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
checked: false,
|
||||
disabled: false
|
||||
}],
|
||||
value: '',
|
||||
login: '注册',
|
||||
show: true
|
||||
phone: "",
|
||||
sms_code: "",
|
||||
login: '绑定',
|
||||
show: true,
|
||||
checked: false,
|
||||
// 时间
|
||||
timer: null,
|
||||
is_sendcode: false, // 60s
|
||||
time_count: 60,
|
||||
pactList: [ "《用户协议》", "《隐私协议》", "《使用协议》" ],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 选中某个复选框时,由checkbox时触发
|
||||
checkboxChange(e) {
|
||||
//console.log(e);
|
||||
},
|
||||
// 选中任一checkbox时,由checkbox-group触发
|
||||
checkboxGroupChange(e) {
|
||||
// console.log(e);
|
||||
},
|
||||
mask_u(){
|
||||
this.show = !this.show
|
||||
},
|
||||
// 勾选协议
|
||||
change(e) {
|
||||
this.checked = !this.checked;
|
||||
console.log(this.checked);
|
||||
},
|
||||
// 获取验证码
|
||||
getCode() {
|
||||
if (this.$u.test.isEmpty(this.phone)) {
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号格式不能为空!',
|
||||
type: 'error',
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(!(/^1[3456789]\d{9}$/.test(this.phone))){
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号格式不正确!',
|
||||
type: 'warning',
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.$u.api.sendSmsCode({
|
||||
member_mobile: this.phone,
|
||||
smslog_type: 4,
|
||||
}).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
console.log(res);
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'success',
|
||||
})
|
||||
// 发送验证码
|
||||
this.getSendCode();
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 绑定手机号
|
||||
bindPhone() {
|
||||
if (this.$u.test.isEmpty(this.phone)) {
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号不能为空!',
|
||||
type: 'error',
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(!(/^1[3456789]\d{9}$/.test(this.phone))){
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号格式不正确!',
|
||||
type: 'warning',
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(this.$u.test.isEmpty(this.sms_code)){
|
||||
this.$refs.uToast.show({
|
||||
title: '验证码不能为空!',
|
||||
type: 'warning',
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(this.sms_code.length == 0){
|
||||
this.$refs.uToast.show({
|
||||
title: '验证码有误!',
|
||||
type: 'warning',
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(!this.checked){
|
||||
this.$refs.uToast.show({
|
||||
title: '请同意协议!',
|
||||
type: 'warning',
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.$u.api.mobileBind({
|
||||
member_mobile: this.phone,
|
||||
sms_code: this.sms_code,
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
if (res.errCode == 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'success',
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pageA/topick/topick'
|
||||
});
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 协议详情
|
||||
infoPact(index) {
|
||||
// console.log(index);
|
||||
uni.navigateTo({
|
||||
url: '/pageA/pactList/pactList?index=' + index
|
||||
});
|
||||
},
|
||||
// 60s
|
||||
getSendCode() {
|
||||
const TIME_COUNT = 60;
|
||||
if (!this.timer) {
|
||||
this.time_count = TIME_COUNT;
|
||||
this.is_sendcode = true;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.time_count > 0 && this.time_count <= TIME_COUNT) {
|
||||
this.time_count--;
|
||||
} else {
|
||||
this.is_sendcode = false;
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uni-page-wrapper{
|
||||
background: #fff;
|
||||
}
|
||||
.login {
|
||||
// background: url(../../static/pageA/loginbackground.png) no-repeat!important;
|
||||
.images {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.backes {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
|
||||
}
|
||||
|
||||
text {
|
||||
z-index: 9;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.more_Login {
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
width: 630rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.more_Login text {
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
float: left;
|
||||
font-size: 30rpx;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
line-height: 36px;
|
||||
margin: 97rpx 0;
|
||||
}
|
||||
|
||||
.more_Login .other {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
@@ -124,163 +190,87 @@
|
||||
z-index: 99999;
|
||||
margin: 0 auto;
|
||||
padding-top: 130rpx;
|
||||
|
||||
.labales {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
border-bottom: 1px #BFBFBF solid;
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-inp {
|
||||
justify-content: space-between;
|
||||
margin-top: 70rpx;
|
||||
}
|
||||
|
||||
.labales text {
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.labales {
|
||||
border-bottom: 1px #BFBFBF solid;
|
||||
margin-bottom: 90rpx;
|
||||
}
|
||||
|
||||
.labales {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
.identifying {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
font-size: 30rpx;
|
||||
flex-shrink: 0;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #FF780F!important;
|
||||
color: #FF780F !important;
|
||||
border: none;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.pact text {
|
||||
font-size: 22rpx;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
line-height: 36px;
|
||||
.sended {
|
||||
color: #666 !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.pact {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin: 20rpx 0;
|
||||
&>text {
|
||||
font-size: 22rpx;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.check-tit {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
::v-deep uni-checkbox .uni-checkbox-input {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-color: #d1d1d1 !important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
|
||||
::v-deep uni-checkbox .uni-checkbox-input-checked:before {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.pact_text {
|
||||
font-size: 22px;
|
||||
font-weight: 400;
|
||||
color: rgba(129, 188, 253, 1) !important;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
//单选框的样式
|
||||
.pact {
|
||||
position: relative;
|
||||
padding-left: 38rpx;
|
||||
}
|
||||
.btn-login {
|
||||
width: 650rpx;
|
||||
height: 90rpx;
|
||||
margin: 300rpx auto 0;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
border-radius: 50rpx !important;
|
||||
background-color: #FF780F;
|
||||
}
|
||||
|
||||
.u-checkbox-group {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.u-checkbox__icon--square {
|
||||
border-radius: 50rpx !important;
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
|
||||
.u-btn {
|
||||
width: 628rpx;
|
||||
height: 98rpx;
|
||||
background: rgba(255, 120, 15, 1) !important;
|
||||
border-radius: 49rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 36rpx;
|
||||
color: rgba(255, 255, 255, 1) !important;
|
||||
line-height: 36px;
|
||||
border: 1px #ff780f solid;
|
||||
outline: none;
|
||||
border-color: rgba(255, 120, 15, 1) !important;
|
||||
margin-top: 225rpx;
|
||||
}
|
||||
|
||||
.warp {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.rect {
|
||||
width: 558rpx;
|
||||
height: 300rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-wrap:wrap;
|
||||
display: -webkit-flex; /* Safari */
|
||||
.rect_view{
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
.image{
|
||||
width: 45rpx;
|
||||
height: 53rpx;
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
flex:1;
|
||||
margin-top: 77rpx;
|
||||
}
|
||||
.rect_view:nth-child(2) image{
|
||||
width: 57rpx;
|
||||
height: 45rpx;
|
||||
}
|
||||
|
||||
.rect_butoon{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
height: 85rpx;
|
||||
text-align: center;
|
||||
line-height: 85rpx;
|
||||
border-top: 1px #999999 solid;
|
||||
}
|
||||
view{
|
||||
color: #666;
|
||||
font-size:24rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
}
|
||||
}
|
||||
.rect_view:nth-child(1) image,.rect_view:nth-child(1) view{
|
||||
float: right;
|
||||
}
|
||||
.rect_view:nth-child(1) image{
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.rect_view:nth-child(1){
|
||||
position: relative;
|
||||
margin-right: 79rpx;
|
||||
}
|
||||
.rect_view:nth-child(1) view{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
.rect_view:nth-child(2) image,.rect_view:nth-child(2) view{
|
||||
float: left;
|
||||
}
|
||||
.rect_view:nth-child(2) image{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.rect_view:nth-child(2){
|
||||
position: relative;
|
||||
}
|
||||
.rect_view:nth-child(2) view{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
u-button{
|
||||
margin-top: 225rpx;
|
||||
}
|
||||
button::after{ border: none; }
|
||||
</style>
|
||||
|
||||
@@ -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"
|
||||
@@ -32,25 +33,26 @@
|
||||
</view>
|
||||
<!-- 注册 -->
|
||||
<view class="more_Login">
|
||||
<text @click="registerUrl()">{{register}}</text>
|
||||
<text @click="registerUrl()">{{register}}</text>
|
||||
<text class="other" @click="mask_u">其他方式登录</text>
|
||||
</view>
|
||||
</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>
|
||||
<view class="rect_butoon" @click="show = false">取消</view>
|
||||
<view class="rect_butoon" @click="show = false">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-mask>
|
||||
@@ -59,7 +61,11 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import IMService from '@/static/imservice.js'
|
||||
import identifying from '@/components/logininput/identifying'
|
||||
import {
|
||||
mapMutations
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -81,40 +87,60 @@
|
||||
sms_code: '', //验证码
|
||||
// 协议渲染
|
||||
pact_text: [{
|
||||
"id": '1',
|
||||
"text": "《用户协议》"
|
||||
}, {
|
||||
"id": '2',
|
||||
"text": "《隐私协议》"
|
||||
}, {
|
||||
"id": '3',
|
||||
"text": "《使用协议》"
|
||||
},
|
||||
|
||||
]
|
||||
"id": '1',
|
||||
"text": "《用户协议》"
|
||||
}, {
|
||||
"id": '2',
|
||||
"text": "《隐私协议》"
|
||||
}, {
|
||||
"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.imService.lianjie)
|
||||
this.imService.disconnect()
|
||||
// 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) => {
|
||||
console.log(res)
|
||||
this.$u.api.sendSmsCode({}).then((res) => {
|
||||
if (res.errCode == 0) {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 协议跳转
|
||||
pact_click(index){
|
||||
pact_click(index) {
|
||||
console.log(index)
|
||||
uni.navigateTo({
|
||||
url: '/pageA/pactList/pactList?index=' + index
|
||||
url: '/pageA/pactList/pactList?index=' + index
|
||||
});
|
||||
},
|
||||
// 用户登录
|
||||
loginOn() {
|
||||
let me = this;
|
||||
// uni.navigateTo({
|
||||
// url: '/pageE/zhibo/index'
|
||||
// });
|
||||
@@ -123,25 +149,22 @@
|
||||
// console.log(this.sms_code)
|
||||
// 判断手机号是否为空
|
||||
// 校验手机号
|
||||
let type_phone = this.$u.test.mobile( this.member_mobile)
|
||||
if( this.member_mobile == ''){
|
||||
let type_phone = this.$u.test.mobile(this.member_mobile)
|
||||
if (this.member_mobile == '') {
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号不能为空',
|
||||
type: 'error'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (type_phone == false) {
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号格式不正确',
|
||||
type: 'error'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if( this.sms_code == ''){
|
||||
this.$refs.uToast.show({
|
||||
if (this.sms_code == '') {
|
||||
this.$refs.uToast.show({
|
||||
title: '验证码不能为空',
|
||||
type: 'error'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
@@ -152,83 +175,126 @@
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
if (res.errCode == 0) {
|
||||
if(res.data == ''){
|
||||
if (res.data == '') {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}else{
|
||||
uni.setStorageSync('token', res.data.token);//存储一个字符传值
|
||||
uni.navigateTo({
|
||||
url : '/pageA/topick/topick'
|
||||
})
|
||||
} else {
|
||||
me.loginIn(res.data.token); //存储一个字符传值
|
||||
// 缓存用户的信息
|
||||
// uni.setStorageSync({
|
||||
// key: 'user_info',
|
||||
// data: res.data,
|
||||
// success: function() {
|
||||
// console.log('success');
|
||||
// // 跳转首页
|
||||
// uni.navigateTo({
|
||||
// url : '/pageA/topick/topick'
|
||||
// })
|
||||
// }
|
||||
// });
|
||||
uni.setStorageSync('user_info',res.data);
|
||||
this.imService.disconnect()
|
||||
if (res.data.member.has_labels) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
} else {
|
||||
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'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 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'
|
||||
},
|
||||
load: true
|
||||
}).then((data) => {
|
||||
console.log(data)
|
||||
|
||||
}, (err) => {
|
||||
console.log(err)
|
||||
});
|
||||
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 => {
|
||||
if (res.errCode == 0) {
|
||||
this.loginIn(res.data.token);
|
||||
uni.setStorageSync('user_info',res.data);
|
||||
this.show = false;
|
||||
console.log(res.data.member.member_mobilebind);
|
||||
if(res.data.member.member_mobilebind) {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pageA/bindinges/bindinges'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
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);
|
||||
uni.setStorageSync('user_info',res.data);
|
||||
this.show = false;
|
||||
console.log(res.data.member.member_mobilebind);
|
||||
if(res.data.member.member_mobilebind) {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pageA/bindinges/bindinges'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -238,10 +304,6 @@
|
||||
url: '/pageA/register/register'
|
||||
});
|
||||
},
|
||||
// 授权登录
|
||||
getApplogin() {
|
||||
console.log("11")
|
||||
},
|
||||
// 选中某个复选框时,由checkbox时触发
|
||||
checkboxChange(e) {
|
||||
//console.log(e);
|
||||
@@ -255,6 +317,11 @@
|
||||
},
|
||||
tochange() {
|
||||
|
||||
},
|
||||
goIndex() {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -296,10 +363,12 @@
|
||||
width: 630rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.u-checkbox__icon-wrap .u-icon{
|
||||
width: 26rpx!important;
|
||||
|
||||
.u-checkbox__icon-wrap .u-icon {
|
||||
width: 26rpx !important;
|
||||
height: 26rpx;
|
||||
}
|
||||
|
||||
.more_Login text {
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
@@ -378,6 +447,7 @@
|
||||
position: relative;
|
||||
padding-left: 40rpx;
|
||||
overflow: hidden;
|
||||
padding-bottom:10px
|
||||
// overflow: hidden; //超出的文本隐藏
|
||||
// text-overflow: ellipsis; //溢出用省略号显示
|
||||
// white-space: nowrap; //溢出不换行
|
||||
@@ -397,20 +467,28 @@
|
||||
height: 22rpx;
|
||||
}
|
||||
|
||||
.buttones > view {
|
||||
width: 628rpx;
|
||||
height: 98rpx;
|
||||
background: rgba(255, 120, 15, 1) !important;
|
||||
border-radius: 49rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 36rpx;
|
||||
color: rgba(255, 255, 255, 1) !important;
|
||||
line-height: 98rpx;
|
||||
border: 1px #ff780f solid;
|
||||
outline: none;
|
||||
border-color: rgba(255, 120, 15, 1) !important;
|
||||
text-align: center;
|
||||
}
|
||||
.buttones {
|
||||
.btn {
|
||||
width: 628rpx;
|
||||
height: 98rpx;
|
||||
background: rgba(255, 120, 15, 1) !important;
|
||||
border-radius: 49rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 36rpx;
|
||||
color: rgba(255, 255, 255, 1) !important;
|
||||
line-height: 98rpx;
|
||||
border: 1px #ff780f solid;
|
||||
outline: none;
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
})
|
||||
@@ -60,12 +69,15 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.packlist{}
|
||||
.packlist > view{
|
||||
width:676px;
|
||||
font-size:26rpx;
|
||||
color: #333;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
padding: 16upx 0;
|
||||
font-size: 30upx;
|
||||
color: #333;
|
||||
}
|
||||
.rict_type {
|
||||
text-indent: 1rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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: true,
|
||||
member_mobile: '', //手机号
|
||||
smslog_type : '1',//状态
|
||||
sms_code : '', //验证码
|
||||
@@ -89,6 +94,7 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['loginIn']),
|
||||
// 协议跳转
|
||||
pact_click(index){
|
||||
console.log(index)
|
||||
@@ -97,89 +103,83 @@
|
||||
});
|
||||
},
|
||||
// 用户注册
|
||||
loginIn(){
|
||||
let type_phone = this.$u.test.mobile( this.member_mobile)
|
||||
if( this.member_mobile == ''){
|
||||
loginIns(){
|
||||
console.log(this.is_check);
|
||||
let me = this;
|
||||
let type_phone = this.$u.test.mobile(this.member_mobile)
|
||||
if(this.member_mobile == ''){
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号不能为空',
|
||||
type: 'error'
|
||||
title: '手机号不能为空!',
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (type_phone == false) {
|
||||
this.$refs.uToast.show({
|
||||
title: '手机号格式不正确',
|
||||
type: 'error'
|
||||
title: '手机号格式不正确!',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if( this.sms_code == ''){
|
||||
if(this.sms_code == ''){
|
||||
this.$refs.uToast.show({
|
||||
title: '验证码不能为空',
|
||||
type: 'error'
|
||||
title: '验证码不能为空!',
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (!this.is_check) {
|
||||
this.$refs.uToast.show({
|
||||
title: '请同意协议!',
|
||||
})
|
||||
return false;
|
||||
}
|
||||
this.$u.api.phoneRegister({
|
||||
member_mobile: this.member_mobile,
|
||||
sms_code: this.sms_code
|
||||
}).then((res) => {
|
||||
console.log('3333333333',res);
|
||||
// 校验手机号
|
||||
|
||||
// console.log(res)
|
||||
if(res.errCode == 0){
|
||||
// 缓存用户的信息
|
||||
uni.setStorage({
|
||||
key: 'token',
|
||||
data: res.data.token,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
// 跳转选择页面
|
||||
uni.navigateTo({
|
||||
url : '/pageA/topick/topick'
|
||||
})
|
||||
}
|
||||
});
|
||||
//存储一个字符传值
|
||||
me.loginIn(res.data.token);
|
||||
// 缓存用户的信息
|
||||
uni.setStorageSync('user_info',res.data);
|
||||
// 跳转选择页面
|
||||
if (uni.getStorageSync("token")) {
|
||||
uni.navigateTo({
|
||||
url: '/pageA/topick/topick'
|
||||
})
|
||||
}
|
||||
// 注册返回参数
|
||||
// this.$refs.uToast.show({
|
||||
// title: res.message,
|
||||
// type: 'success',
|
||||
// url: '/pageA/topick/topick'
|
||||
// })
|
||||
}
|
||||
if(res.errCode == 1){
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
if(res.errCode == 2){
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'primary',
|
||||
url: '/pageA/login/login'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选中某个复选框时,由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;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -314,6 +314,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;
|
||||
@@ -434,10 +440,6 @@
|
||||
.pact {
|
||||
position: relative;
|
||||
padding-left: 40rpx;
|
||||
overflow: hidden;
|
||||
// overflow: hidden; //超出的文本隐藏
|
||||
// text-overflow: ellipsis; //溢出用省略号显示
|
||||
// white-space: nowrap; //溢出不换行
|
||||
}
|
||||
.phones{
|
||||
margin-bottom: 90rpx!important;
|
||||
|
||||
@@ -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,22 +30,21 @@
|
||||
show: false,
|
||||
tab_lables: [],
|
||||
submites: '选好了进入首页',
|
||||
rSelect:[]
|
||||
rSelect: [],
|
||||
list: [],
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
onLoad() {
|
||||
// 标签的列表展示
|
||||
console.log("11111222")
|
||||
this.$u.api.labelList({
|
||||
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.tab_lables = res.data
|
||||
})
|
||||
},
|
||||
|
||||
mounted(){
|
||||
this.$u.api.labelList({
|
||||
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.tab_lables = res.data
|
||||
})
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 选中某个复选框时,由checkbox时触发
|
||||
checkboxChange(e) {
|
||||
@@ -59,21 +58,38 @@
|
||||
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() {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
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);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -360,9 +376,10 @@
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
// 选中的样式
|
||||
.cur {
|
||||
background-color: #ff5d00!important;
|
||||
color: #fff!important;
|
||||
background-color: #ff5d00 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,45 +1,76 @@
|
||||
<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() {
|
||||
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{
|
||||
|
||||
.welcome_jumpes {
|
||||
width: 90rpx;
|
||||
height: 35rpx;
|
||||
opacity:0.5;
|
||||
border-radius:18rpx;
|
||||
opacity: 0.5;
|
||||
border-radius: 18rpx;
|
||||
position: absolute;
|
||||
right: 37rpx;
|
||||
top: 34rpx;
|
||||
font-size:20rpx;
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
line-height: 35rpx;
|
||||
color: #fff;
|
||||
background: #C4CAC6;
|
||||
}
|
||||
|
||||
.welcome_images {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
|
||||
126
pageB/comment/index.vue
Normal 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>
|
||||
@@ -1,27 +1,35 @@
|
||||
<template>
|
||||
<view class="userinfo">
|
||||
|
||||
<view class="user">
|
||||
<view class="info">
|
||||
<image></image>
|
||||
<view>
|
||||
<text>达人昵称</text>
|
||||
<text>关注数量</text>
|
||||
<view class="avatar">
|
||||
<image :src="item.member_avatar" mode="aspectFill"></image>
|
||||
<view class="posi-type" v-if="item.live_status != 0" @click="tozhibo">
|
||||
<view>
|
||||
<u-icon name="play-right-fill" color="#fff" size="20rpx"></u-icon>
|
||||
</view>
|
||||
<text>正在直播</text>
|
||||
</view>
|
||||
</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="guanzhu">关注</view>
|
||||
<view class="btn" :class="[ is_follow ? 'btn-follow' : 'btn-unfollow' ]" @click="following">{{ is_follow ? "已关注" : "关注" }}</view>
|
||||
</view>
|
||||
<view class="profile">个性签名</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,130 @@ image{
|
||||
.info{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
>image{
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
|
||||
.avatar {
|
||||
position: relative;
|
||||
&>image{
|
||||
z-index: 99;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
>view{
|
||||
margin-left: 40rpx;
|
||||
.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: {
|
||||
tozhibo(){
|
||||
this.$u.route({
|
||||
url:"/pages/zhibo/index",
|
||||
params:{
|
||||
url:item.url,
|
||||
id:item.live_id,
|
||||
rid:item.chatroom_id
|
||||
}
|
||||
})
|
||||
},
|
||||
// 打开个性
|
||||
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);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,11 +31,16 @@
|
||||
height: 60rpx;
|
||||
background-color: #ececec;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
// text-align: center;
|
||||
// line-height: 60rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 6rpx;
|
||||
margin-right: 26rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: #ececec 1rpx solid;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.xuanzhong{
|
||||
border: #ff780f 1rpx solid;
|
||||
@@ -50,15 +55,33 @@ export default {
|
||||
name:"guige",
|
||||
data(){
|
||||
return {
|
||||
select:0
|
||||
select: 0
|
||||
}
|
||||
},
|
||||
props:['item','title'],
|
||||
watch:{
|
||||
props:['item','title', 'default'],
|
||||
watch: {
|
||||
select(){
|
||||
// console.log(this.select)
|
||||
this.$emit("sel", this.select);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setDefaultValue();
|
||||
},
|
||||
methods: {
|
||||
setDefaultValue() {
|
||||
for (const ikey in this.item) {
|
||||
if (this.item.hasOwnProperty(ikey)) {
|
||||
const ielement = this.item[ikey];
|
||||
for (const dkey in this.default) {
|
||||
if (this.default.hasOwnProperty(dkey)) {
|
||||
const delement = this.default[dkey];
|
||||
if(ikey == dkey) this.select = ikey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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;
|
||||
@@ -143,46 +229,46 @@ export default {
|
||||
}
|
||||
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
.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>
|
||||
@@ -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" style="padding:0 30rpx;height:692rpx">
|
||||
<sitem v-for="i in 10"></sitem>
|
||||
<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>
|
||||
</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>
|
||||
@@ -1,51 +1,89 @@
|
||||
<template>
|
||||
<view class="shopone">
|
||||
<image></image>
|
||||
<view>
|
||||
<text>sadas</text>
|
||||
<text>dasadas</text>
|
||||
<text>dsadas</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<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>
|
||||
<style lang="scss" scoped>
|
||||
image{
|
||||
background-color: #0f0;
|
||||
}
|
||||
.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;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
name:"shopone"
|
||||
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>
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.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;
|
||||
}
|
||||
}
|
||||
.scroll-box {
|
||||
margin: 88rpx 0 100rpx 0;
|
||||
height: 100%;
|
||||
}
|
||||
.editing {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
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>
|
||||
@@ -1,84 +1,259 @@
|
||||
<template>
|
||||
<view class="userinfo">
|
||||
<view class="userinfo" @click="stopClick()">
|
||||
<view class="userhead">
|
||||
<image :src="list.member_avatar"></image>
|
||||
<text>+</text>
|
||||
<image class="avatar" :src="item.member_avatar" @click="gotoInfo(item.role,item.member_id,item.store_id)"></image>
|
||||
<!-- <text class="follow" @click="following(item.member_id)">{{ is_follow ? "✓" : "+" }}</text> -->
|
||||
<image class="follow" :src=" !is_follow ? '../../static/image/userinfo/follow.png' : '../../static/image/userinfo/followed.png' " mode="" @click="following(item.member_id)"></image>
|
||||
</view>
|
||||
<view class="zan">
|
||||
<image></image>
|
||||
<text>{{list.like_num}}</text>
|
||||
<!-- 点赞 -->
|
||||
<view class="operat zan">
|
||||
<image class="operat-img" :src=" is_like ? '../../static/image/userinfo/dianzan1.png' : '../../static/image/userinfo/dianzan.png' "
|
||||
mode="" @click="likeType(item.article_id)"></image>
|
||||
<text class="operat-span">{{item.like_num}}</text>
|
||||
</view>
|
||||
<view class="shoucang">
|
||||
<image></image>
|
||||
<text>{{list.collect_num}}</text>
|
||||
<!-- 收藏 -->
|
||||
<view class="operat shoucang">
|
||||
<image class="operat-img" :src=" is_collect ? '../../static/image/userinfo/shoucang1.png' : '../../static/image/userinfo/shoucang.png' "
|
||||
mode="" @click="collecting(item.article_id)"></image>
|
||||
<text class="operat-span">{{item.collect_num}}</text>
|
||||
</view>
|
||||
<view class="pinglun">
|
||||
<image></image>
|
||||
<text>{{list.comment_num}}</text>
|
||||
<!-- 评论 -->
|
||||
<view class="operat pinglun">
|
||||
<image class="operat-img" :src=" is_content ? '../../static/image/userinfo/pinglun1.png' : '../../static/image/userinfo/pinglun.png' "
|
||||
mode="" @click="editing(item.article_id)"></image>
|
||||
<text class="operat-span">{{ comment_num }}</text>
|
||||
</view>
|
||||
<view class="gouwu">
|
||||
<image></image>
|
||||
<!-- 购物车 -->
|
||||
<view class="operat gouwu" v-if="cart_num">
|
||||
<image class="operat-img" :src=" is_cart ? '../../static/image/userinfo/gouwuche1.png' : '../../static/image/userinfo/gouwuche.png' "
|
||||
mode="" @click="carting()"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
image{
|
||||
background-color: #0f0;
|
||||
}
|
||||
.userinfo{
|
||||
width: 110rpx;
|
||||
height: 570rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
>view{
|
||||
.userinfo {
|
||||
width: 110rpx;
|
||||
height: 570rpx;
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.userhead {
|
||||
position: relative;
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
align-items: center;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 50%;
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
border: 2rpx solid #fff;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.follow {
|
||||
z-index: 100;
|
||||
position: absolute;
|
||||
top: 80rpx;
|
||||
left: 34rpx;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.operat {
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
// padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.operat-span {
|
||||
margin-top: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
>text{
|
||||
margin-top: 17rpx;
|
||||
}
|
||||
>image{
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
>view:first-child{
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
>image{
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #fff;
|
||||
|
||||
}
|
||||
>text{
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
font-size: 36rpx;
|
||||
background-color: #FF780F;
|
||||
position: absolute;
|
||||
top: 75rpx;
|
||||
border-radius: 50%;
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.operat-img {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
name:'userinfo',
|
||||
data(){
|
||||
return {
|
||||
|
||||
export default {
|
||||
name: 'userinfo',
|
||||
props: ['list', 'cart', 'comment', 'num'],
|
||||
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,
|
||||
cart_num: 0,
|
||||
comment_num: this.list.comment_num || 0,
|
||||
item: this.list || {},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
list(newValue, old) {
|
||||
// console.log(newValue.goods.length);
|
||||
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;
|
||||
this.comment_num = this.list.comment_num || 0;
|
||||
this.cart_num = newValue.goods.length;
|
||||
},
|
||||
cart(newValue, old) {
|
||||
// console.log(newValue);
|
||||
this.is_cart = newValue;
|
||||
},
|
||||
comment(newValue, old) {
|
||||
// console.log(newValue,old);
|
||||
this.is_content = newValue;
|
||||
},
|
||||
num(newVal, old) {
|
||||
// console.log(newVal);
|
||||
this.comment_num = newVal;
|
||||
// this.item.comment_num = newVal;
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
methods: {
|
||||
// 关注
|
||||
following(id) {
|
||||
uni.request({
|
||||
url: "https://mall.dmygkeji.com/api/member/attentionMember",
|
||||
method: "POST",
|
||||
data: {
|
||||
member_id: id
|
||||
},
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.errCode == 0) {
|
||||
this.is_follow = !this.is_follow;
|
||||
console.log(this.is_follow);
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: "none"
|
||||
})
|
||||
} else if (res.data.errCode == 401) {
|
||||
uni.showToast({
|
||||
title: "您还没有登录,请先登录!",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点赞
|
||||
likeType(id) {
|
||||
// console.log(id);
|
||||
uni.request({
|
||||
url: "https://mall.dmygkeji.com/api/article/articleLike",
|
||||
method: "POST",
|
||||
data: {
|
||||
article_id: id
|
||||
},
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
if (res.data.errCode == 0) {
|
||||
// console.log(res);
|
||||
this.is_like = !this.is_like;
|
||||
this.list.like_num = res.data.data.num;
|
||||
} else if (res.data.errCode == 401) {
|
||||
uni.showToast({
|
||||
title: "您还没有登录,请先登录!",
|
||||
icon: "none"
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 收藏
|
||||
collecting(id) {
|
||||
uni.request({
|
||||
url: "https://mall.dmygkeji.com/api/article/articleCollect",
|
||||
method: "POST",
|
||||
data: {
|
||||
article_id: id
|
||||
},
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
if (res.data.errCode == 0) {
|
||||
console.log(res.data.num);
|
||||
this.is_collect = !this.is_collect;
|
||||
this.list.collect_num = res.data.data.num;
|
||||
} else if (res.data.errCode == 401) {
|
||||
uni.showToast({
|
||||
title: "您还没有登录,请先登录!",
|
||||
icon: "none"
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 评论
|
||||
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
|
||||
});
|
||||
},
|
||||
gotoInfo(type,id,s_id) {
|
||||
if (type == 2) {
|
||||
uni.navigateTo({
|
||||
url: "/pageC/merchant/index?id=" + s_id
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pageB/details/index?id=" + id
|
||||
})
|
||||
}
|
||||
},
|
||||
// 冒泡
|
||||
stopClick() {
|
||||
}
|
||||
}
|
||||
},
|
||||
props:['list']
|
||||
}
|
||||
</script>
|
||||
}
|
||||
</script>
|
||||
|
||||
251
pageB/coupon/details.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<view class="coupon-details">
|
||||
<view class="coupon-container">
|
||||
<view class="title">新人专享好礼</view>
|
||||
<view class="coupon-main">
|
||||
<image src="/static/image/common/29.png" class="bg"></image>
|
||||
<view class="left">
|
||||
<view class="price"><text class="sign">¥</text><text class="value">{{ price }}</text></view>
|
||||
<view class="label">专属优惠券</view>
|
||||
</view>
|
||||
<view class="btn" @click="exchangeCoupon">立即领取</view>
|
||||
</view>
|
||||
<view class="tag">
|
||||
<view>
|
||||
<image src="/static/image/common/25.png"></image>
|
||||
<text>全场包邮</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="/static/image/common/26.png"></image>
|
||||
<text>延误必赔</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="/static/image/common/27.png"></image>
|
||||
<text>免费上门取件</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="/static/image/common/28.png"></image>
|
||||
<text>退货免运费</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title-container">
|
||||
<image src="/static/image/common/22.png" class="bg"></image>
|
||||
<view class="title">首席搭配师</view>
|
||||
</view>
|
||||
<view class="content-container">
|
||||
<image src="/static/image/common/23.png" class="people"></image>
|
||||
<view class="tag">
|
||||
<view class="">双十一成交破亿</view>
|
||||
<view class="">单场千万级大咖</view>
|
||||
<view class="">品牌特卖TOP1</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="bg-view"></view>
|
||||
<view>我们有万能穿搭公式</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
price: 0
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.price = option.price;
|
||||
},
|
||||
methods: {
|
||||
exchangeCoupon() {
|
||||
this.$u.api.getCoupon({ id: 1 }).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
url: '/pageE/tool/MineCoupon'
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.coupon-details {
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
background-color: #FFDFAC;
|
||||
padding-top: 30rpx;
|
||||
.coupon-container {
|
||||
width: 690rpx;
|
||||
height: 368rpx;
|
||||
background: linear-gradient(-87deg, rgba(247,162,30,1), rgba(255,120,15,1));
|
||||
box-shadow: 0rpx 4rpx 2rpx 0rpx rgba(102,102,102,0.2);
|
||||
border-radius: 20rpx;
|
||||
margin: 0 auto 70rpx;
|
||||
padding: 22rpx {
|
||||
top: 40rpx
|
||||
};
|
||||
.title {
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(255,255,255,1);
|
||||
line-height: 34rpx;
|
||||
text-shadow: 0rpx 4rpx 2rpx rgba(102,102,102,0.2);
|
||||
text-align: center;
|
||||
}
|
||||
.coupon-main {
|
||||
margin: 26rpx auto 20rpx;
|
||||
width: 665rpx;
|
||||
height: 194rpx;
|
||||
position: relative;
|
||||
.bg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 665rpx;
|
||||
height: 194rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
.left {
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
left: 122rpx;
|
||||
.price {
|
||||
margin-bottom: 16rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
line-height: 80rpx;
|
||||
> text {
|
||||
font-weight: bold;
|
||||
color: rgba(255,120,15,1);
|
||||
}
|
||||
.sign {
|
||||
font-size: 54rpx;
|
||||
}
|
||||
.value {
|
||||
font-size: 102rpx;
|
||||
}
|
||||
}
|
||||
.label {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255,120,15,1);
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
top: 62rpx;
|
||||
right: 60rpx;
|
||||
width: 192rpx;
|
||||
height: 70rpx;
|
||||
background: linear-gradient(-87deg, rgba(247,162,30,1), rgba(255,120,15,1));
|
||||
border-radius: 20rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
font-size: 27rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(255,255,255,1);
|
||||
}
|
||||
}
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255,255,255,1);
|
||||
> view {
|
||||
> image {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.title-container {
|
||||
position: relative;
|
||||
height: 124rpx;
|
||||
.bg {
|
||||
position: absolute;
|
||||
width: 504rpx;
|
||||
height: 124rpx;
|
||||
z-index: 1;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -75%);
|
||||
}
|
||||
.title {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: 750rpx;
|
||||
height: 59rpx;
|
||||
background: rgba(255,255,255,0.27);
|
||||
font-size: 60rpx;
|
||||
font-weight: 800;
|
||||
color: rgba(255,122,16,1);
|
||||
text-align: center;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
.content-container {
|
||||
height: 684rpx;
|
||||
position: relative;
|
||||
.people {
|
||||
width: 348rpx;
|
||||
height: 684rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0%);
|
||||
}
|
||||
.tag {
|
||||
> view {
|
||||
position: absolute;
|
||||
height: 48rpx;
|
||||
background: rgba(229,0,79,0.36);
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(255,255,255,1);
|
||||
line-height: 48rpx;
|
||||
padding: 0 24rpx;
|
||||
&:nth-child(1) {
|
||||
top: 104rpx;
|
||||
right: 71rpx;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
top: 271rpx;
|
||||
left: 30rpx;
|
||||
}
|
||||
&:nth-child(3) {
|
||||
top: 373rpx;
|
||||
right: 33rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
position: absolute;
|
||||
top: 459rpx;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0%);
|
||||
width: 581rpx;
|
||||
height: 86rpx;
|
||||
background: linear-gradient(-87deg,rgba(247,162,30,1),rgba(255,120,15,1));
|
||||
border-radius: 20rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(255,255,255,1);
|
||||
line-height: 86rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
89
pageB/coupon/index.vue
Normal file
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<u-popup v-model="showCoupon" mode="center" class="u-coupon-popup">
|
||||
<view class="coupon">
|
||||
<view class="price">{{ newMemberCoupon.price }}</view>
|
||||
<image src="/static/image/common/30.png" class="coupon-image" @click="viewCoupon"></image>
|
||||
<image src="/static/image/common/24.png" class="close-image" @click="showCoupon=false"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showCoupon: true,
|
||||
newMemberCoupon: {},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
showCoupon(value) {
|
||||
if(!value) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.isNewmembervoucher();
|
||||
},
|
||||
methods: {
|
||||
viewCoupon() {
|
||||
this.$u.route('/pageB/coupon/details', {
|
||||
price: this.newMemberCoupon.price
|
||||
});
|
||||
},
|
||||
// 是否显示新人优惠券
|
||||
isNewmembervoucher() {
|
||||
this.$u.api.isNewmembervoucher().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.newMemberCoupon = res.data;
|
||||
} else {
|
||||
this.showCoupon = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page{
|
||||
background-color: rgba(0,0,0,0);
|
||||
}
|
||||
.u-coupon-popup {
|
||||
/deep/ .u-mode-center-box {
|
||||
background-color: transparent;
|
||||
}
|
||||
.coupon {
|
||||
width: 750rpx;
|
||||
height: 583rpx;
|
||||
position: relative;
|
||||
.price {
|
||||
z-index: 3;
|
||||
color: #EBB36E;
|
||||
position: absolute;
|
||||
font-size: 92rpx;
|
||||
font-weight: bold;
|
||||
top: 200rpx;
|
||||
left: 50%;
|
||||
font-family: PingFang SC;
|
||||
transform: translate(-68%, 0);
|
||||
}
|
||||
.coupon-image {
|
||||
width: 568rpx;
|
||||
height: 583rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-60%, 0);
|
||||
}
|
||||
.close-image {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 155rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -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,16 @@
|
||||
}"
|
||||
: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">
|
||||
<view class="box">
|
||||
<view class="list">
|
||||
<view >
|
||||
<videoItem v-for="item in 10"></videoItem>
|
||||
</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>
|
||||
:show-bar="false">
|
||||
</u-tabs>
|
||||
<scroll-view class="scroll-box" scroll-y="true">
|
||||
<view class="box">
|
||||
<videoItem v-for="item in listInfo" :key="item.article_id" :item="item"
|
||||
@getArticlelist="getArticlelist"></videoItem>
|
||||
<view class="no-data" v-if="!listInfo && page">暂无数据</view>
|
||||
<u-loadmore v-else class="load-size" color="#999999" :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
@@ -61,39 +38,118 @@
|
||||
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: 1,
|
||||
status: 'loadmore',
|
||||
iconType: 'circle',
|
||||
loadText: {
|
||||
loadmore: '轻轻上拉',
|
||||
loading: '努力加载中',
|
||||
nomore: '实在没有了'
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
// console.log(option);
|
||||
this.member_id = option.id;
|
||||
this.getUserInfo(option.id);
|
||||
this.getArticlelist();
|
||||
|
||||
},
|
||||
onReachBottom() {
|
||||
// this.page++;
|
||||
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.is_attention);
|
||||
if(this.userInfo.is_attention == 1){
|
||||
this.$u.api.dynamicRead({id}).then((res)=>{
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取列表
|
||||
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);
|
||||
if (this.page == 1) {
|
||||
this.listInfo = res.data.list;
|
||||
this.status = "loadmore";
|
||||
} else if (res.data.length == 0) {
|
||||
this.status = "nomore";
|
||||
} else {
|
||||
this.listInfo = this.listInfo.concat(res.data.list);
|
||||
}
|
||||
this.page++;
|
||||
} 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
|
||||
}
|
||||
if (a == 0) {
|
||||
this.page = 1;
|
||||
this.getArticlelist();
|
||||
} else if (a == 1) {
|
||||
this.page = 1;
|
||||
this.getArticlelist();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,49 @@
|
||||
<template>
|
||||
<view class="follow">
|
||||
<view class="sosuo" @click="searchValue">
|
||||
<image src="/static/image/common/10.png"></image>
|
||||
<text>输入达人名称</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<darenItem style="margin-top:20rpx;margin-right:23rpx" v-for="item in recommendList" :key="item.id" :info="item" v-on:pChangeType="changeType" ></darenItem>
|
||||
</view>
|
||||
<scroll-view scroll-y :style="{ height: viewHeight }" @scrolltolower="loadmore" class="container">
|
||||
<view class="sosuo" @click="searchValue">
|
||||
<image src="/static/image/common/10.png"></image>
|
||||
<text>输入达人名称</text>
|
||||
</view>
|
||||
<view class="list" style="margin-left:-20rpx">
|
||||
<darenItem style="margin-top:20rpx;margin-left:20rpx;" v-for="item in recommendList" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus" bgColor="#ECECEC" font-size="14" margin-top="40" margin-bottom="20" v-if="recommendList.length > pageSize" @loadmore="loadmore"></u-loadmore>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.follow{
|
||||
background-color: #ECECEC;
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
padding: 20rpx 30rpx;
|
||||
.sosuo{
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
>image{
|
||||
width: 29rpx;
|
||||
height: 29rpx;
|
||||
}
|
||||
>text{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: calc(100% + 23rpx);
|
||||
margin-right: -23rpx;
|
||||
}
|
||||
.container {
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 30rpx;
|
||||
.sosuo{
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
>image{
|
||||
width: 29rpx;
|
||||
height: 29rpx;
|
||||
}
|
||||
>text{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: calc(100% + 23rpx);
|
||||
margin-right: -23rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
@@ -50,22 +56,45 @@ export default {
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
pageSize: 2,
|
||||
recommendList: [], // 推荐达人
|
||||
page: 1,
|
||||
loadStatus: 'loadmore',
|
||||
timer: true,
|
||||
viewHeight: '',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.setViewHeight();
|
||||
},
|
||||
onShow() {
|
||||
this.getRecommendList();
|
||||
},
|
||||
methods: {
|
||||
getRecommendList() {
|
||||
this.$u.api.getRecommendList().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.recommendList = res.data.list;
|
||||
}
|
||||
async getRecommendList({ load = 'reload' } = {}) {
|
||||
const res = await this.$u.api.getAllRecommendList({ page: this.page });
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
if(load == 'reload') this.recommendList = res.data.list;
|
||||
if(load == 'loadmore') this.recommendList.push(...res.data.list);
|
||||
}
|
||||
return res.data.list.length;
|
||||
},
|
||||
loadmore() {
|
||||
if(!this.timer) return false;
|
||||
this.timer = false;
|
||||
this.loadStatus = "loading";
|
||||
this.page++;
|
||||
this.getRecommendList({ load: "loadmore" }).then(length => {
|
||||
this.loadStatus = "nomore";
|
||||
if(length == 0) this.page--;
|
||||
}).catch(() => {
|
||||
this.loadStatus = "nomore";
|
||||
this.page--;
|
||||
})
|
||||
},
|
||||
changeType(member_id){
|
||||
console.log(member_id);
|
||||
// console.log(member_id);
|
||||
this.$emit("pChangeType")
|
||||
this.$u.api.attentionMember({
|
||||
member_id: member_id
|
||||
@@ -76,9 +105,13 @@ export default {
|
||||
},
|
||||
searchValue() {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/search/index'
|
||||
url: '/pageB/search/index?type=2&curent=1'
|
||||
})
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
this.viewHeight = res.windowHeight + 'px';
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,72 +1,140 @@
|
||||
<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>
|
||||
</view>
|
||||
<userinfo class="userinfo" :list="list"></userinfo>
|
||||
<shpoone class="shpoone"></shpoone>
|
||||
<shoplist></shoplist>
|
||||
<!-- 用户操作 -->
|
||||
<userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" :num="comment_num" @openCart="openPopup"></userinfo>
|
||||
<!-- 评论 -->
|
||||
<u-popup v-model="is_comment" class="pl" mode="bottom" border-radius="10" @touchmove.stop.prevent="moveHandle">
|
||||
<view class="comment-top">
|
||||
<text>评论</text>
|
||||
<u-icon name="close" color="#333" size="28" @click="is_comment=false"></u-icon>
|
||||
</view>
|
||||
<scroll-view class="scroll-box" scroll-y="true" lower-threshold="50" @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 class="icon" name="play-right-fill" color="#666" size="10rpx" v-if="0"></u-icon>
|
||||
<text v-if="0">{{ 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)">
|
||||
{{ child_end[item.id] ? "暂无更多回复" : "展开更多回复" }}
|
||||
<u-icon name="arrow-down" v-if="!child_end[item.id]"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="no-data" v-if="!commentList.length">还没有评论,快来评论吧!</view>
|
||||
<u-loadmore v-else class="load-size" :status="status" size="20" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
|
||||
</scroll-view>
|
||||
<view class="editing" @touchend.prevent="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" :focus="is_focus" :placeholder="edit_text_other" @focus="focus" v-model="send_value">
|
||||
<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="cart-title u-line-1">{{ item.goods_advword }}</text>
|
||||
<text class="cart-info u-line-2">{{ 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 +143,517 @@
|
||||
}
|
||||
}
|
||||
.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 {
|
||||
height: 40rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
line-height: 38rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
background-color: rgba(0, 0, 0, .6);
|
||||
}
|
||||
}
|
||||
}
|
||||
.userinfo{
|
||||
z-index: 9999;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-285rpx);
|
||||
right: 30rpx;
|
||||
}
|
||||
.shpoone{
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
.pl {
|
||||
.comment-top {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
padding: 0 20rpx;
|
||||
line-height: 88rpx;
|
||||
background-color: #ECECEC;
|
||||
& > text {
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.scroll-box {
|
||||
z-index: 99;
|
||||
margin: 88rpx 0 100rpx 0;
|
||||
height: 600rpx;
|
||||
.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;
|
||||
pointer-events: none;
|
||||
.time {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.reply {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
padding: 0 20rpx 10rpx 90rpx;
|
||||
pointer-events: none;
|
||||
}
|
||||
.child-content {
|
||||
margin: 6rpx 90rpx 6rpx;
|
||||
// pointer-events: none;
|
||||
.child-box {
|
||||
pointer-events: none;
|
||||
.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;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
.more-reply {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.no-data {
|
||||
margin-top: 200rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.editing {
|
||||
z-index: 1000;
|
||||
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%;
|
||||
font-size: 24rpx;
|
||||
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-around;
|
||||
width: 500rpx;
|
||||
color: #343434;
|
||||
font-size: 28rpx;
|
||||
.cart-title {
|
||||
line-height: 40rpx;
|
||||
font-size: 29rpx;
|
||||
}
|
||||
.cart-info {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.name {
|
||||
width: 500rpx;
|
||||
height: 80rpx;
|
||||
font-size: 24rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
margin:8rpx 0;
|
||||
line-height:36rpx;
|
||||
}
|
||||
.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,
|
||||
comment_num: 0,
|
||||
is_more: true,
|
||||
edit_text: "有爱评论,说点好听的 ~",
|
||||
edit_text_other: "有爱评论,说点好听的 ~",
|
||||
commentList: [], // 评论
|
||||
allList: {}, // 全部子评论
|
||||
child_end: {},
|
||||
status: 'loadmore',
|
||||
iconType: 'circle',
|
||||
loadText: {
|
||||
loadmore: '轻轻上拉',
|
||||
loading: '努力加载中',
|
||||
nomore: '暂时没有更多了',
|
||||
no: '评论'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option){
|
||||
this.article_id = option.id;
|
||||
this.articleInfo(this.article_id);
|
||||
this.allList = {};
|
||||
},
|
||||
// 监听返回按钮
|
||||
onBackPress() {
|
||||
if (this.cart_type) {
|
||||
this.cart_type = !this.cart_type;
|
||||
} else if (this.is_edit) {
|
||||
this.is_edit = !this.is_edit;
|
||||
} else if (this.is_comment) {
|
||||
this.is_comment = !this.is_comment;
|
||||
} 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();
|
||||
}
|
||||
},
|
||||
// 获取评论
|
||||
getComment() {
|
||||
this.$u.post("article/articleCommentList",{
|
||||
article_id: this.article_id,
|
||||
page: this.page,
|
||||
}).then(res => {
|
||||
this.status = "loading";
|
||||
// console.log(res);
|
||||
if (res.errCode == 0) {
|
||||
if (this.commentList.length < 8) {
|
||||
this.status = "nomore";
|
||||
}
|
||||
if (this.page == 0) {
|
||||
this.commentList = res.data;
|
||||
} else if (res.data.length == 0 && this.page > 0) {
|
||||
this.status = "nomore";
|
||||
} else {
|
||||
this.commentList = this.commentList.concat(res.data);
|
||||
}
|
||||
this.page++;
|
||||
let list = this.commentList;
|
||||
list.forEach((item,index) => {
|
||||
// console.log(item);
|
||||
item.page = 0;
|
||||
item.commentList = [];
|
||||
this.page_[item.id] = 0;
|
||||
this.child_end[item.id] = false;
|
||||
})
|
||||
this.commentList = list;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 打开评论输入
|
||||
openKeyInput(data,index) {
|
||||
let me = this;
|
||||
// console.log(data);
|
||||
this.is_edit = true;
|
||||
setTimeout(() => {
|
||||
this.is_focus = true;
|
||||
}, 200)
|
||||
uni.onKeyboardHeightChange(function(res){
|
||||
if (res.height == 0) {
|
||||
me.is_focus = false;
|
||||
}
|
||||
})
|
||||
this.comment_id = index;
|
||||
if (data.content) {
|
||||
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() {
|
||||
if (this.send_value.length == 0) {
|
||||
this.$u.toast("内容不能为空!");
|
||||
return;
|
||||
}
|
||||
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);
|
||||
this.send_value = "";
|
||||
if (res.errCode == 0) {
|
||||
this.comment_num = res.data.num;
|
||||
// console.log(this.comment_num);
|
||||
this.is_edit = false;
|
||||
// console.log(res.data.data.reply_id);
|
||||
let p_id = res.data.data.pid;
|
||||
// console.log(p_id);
|
||||
if (res.data.data.pid) {
|
||||
this.commentList[this.comment_id].reply_count = true;
|
||||
// console.log(this.allList[p_id]);
|
||||
if (this.allList[p_id]) {
|
||||
this.allList[p_id].push(res.data.data);
|
||||
} else {
|
||||
this.allList[p_id] = [];
|
||||
this.allList[p_id].push(res.data.data);
|
||||
}
|
||||
// console.log(this.allList);
|
||||
} else {
|
||||
this.commentList.unshift(res.data.data);
|
||||
}
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 发现回复列表
|
||||
getReplyList(id) {
|
||||
uni.showLoading({
|
||||
title: "loading..."
|
||||
})
|
||||
this.$u.post("article/articleReplyList", {id: id, page: this.page_[id]}).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.errCode == 0) {
|
||||
if (this.page_[id] == 0) {
|
||||
this.allList[id] = res.data;
|
||||
} else {
|
||||
this.allList[id] = this.allList[id].concat(res.data);
|
||||
}
|
||||
this.page_[id]++;
|
||||
this.$forceUpdate();
|
||||
// console.log(this.allList);
|
||||
} else if (res.errCode == 1) {
|
||||
this.child_end[id] = true;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
})
|
||||
},
|
||||
// 预览图片
|
||||
viewImage(e) {
|
||||
let arr = [];
|
||||
this.list.photo.forEach(item => {
|
||||
arr.push(item.url);
|
||||
})
|
||||
uni.previewImage({
|
||||
urls: arr,
|
||||
current: e.currentTarget.dataset.url,
|
||||
})
|
||||
},
|
||||
// 评论滚动到底部
|
||||
scrollBottom(e) {
|
||||
console.log(1);
|
||||
this.getComment();
|
||||
},
|
||||
// 跳转到商品
|
||||
gotoInfo(id) {
|
||||
console.log(id);
|
||||
uni.navigateTo({
|
||||
url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
|
||||
})
|
||||
},
|
||||
// 禁止滚动
|
||||
moveHandle(e) {
|
||||
console.log(e);
|
||||
return;
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
focus(e) {
|
||||
setTimeout(function(){
|
||||
uni.showSoftKeybord;
|
||||
}, 200)
|
||||
}
|
||||
},
|
||||
onLoad(o){
|
||||
this.id = o.id
|
||||
this.articleInfo(this.id)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
44
pageB/playVideo/index.nvue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view style="width:750rpx" :style="{'height':height}">
|
||||
<image @click="calose()" style="width:30rpx;height:30rpx;position: fixed;top:80rpx;right:30rpx;" src="/static/image/clons.png"></image>
|
||||
<video :src="url" class="video" :style="{'padding-top':top,'height': width}" :autoplay="true"></video>
|
||||
</view>
|
||||
</template>
|
||||
<style>
|
||||
.video{
|
||||
width: 750rpx;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
name:"video",
|
||||
data(){
|
||||
return {
|
||||
url:"",
|
||||
top:0,
|
||||
height:0,
|
||||
width:0
|
||||
}
|
||||
},
|
||||
onLoad(a){
|
||||
const res = uni.getSystemInfoSync();
|
||||
let height = res.windowHeight
|
||||
let width = res.windowWidth
|
||||
this.width = width + ( (height - width) / 2) + 'px'
|
||||
console.log(this.width)
|
||||
this.top = (height - width) / 2+ 'px'
|
||||
console.log(this.top)
|
||||
this.height = height + 'px';
|
||||
console.log(a)
|
||||
this.url = a.url
|
||||
},
|
||||
methods:{
|
||||
calose(){
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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,19 +13,83 @@ export default {
|
||||
name:"search",
|
||||
data(){
|
||||
return{
|
||||
keyword:""
|
||||
type: '', // 1 商家达人社区 2 商品
|
||||
keyword: "",
|
||||
searchwordlist: [],
|
||||
sid:0
|
||||
}
|
||||
},
|
||||
},
|
||||
// type: 1 商品 2: 其他
|
||||
onLoad(option) {
|
||||
console.log(option.id)
|
||||
if(option.id != undefined || option.id){
|
||||
this.sid = option.id
|
||||
}
|
||||
this.type = option.type;
|
||||
this.curent = option.curent || 0
|
||||
this.getWordList();
|
||||
if(option.type == 1) this.setNavSearchInput('搜索您需要的商品');
|
||||
else if(option.type == 2) this.setNavSearchInput('请输入搜索内容');
|
||||
},
|
||||
// 点击搜索按钮
|
||||
onNavigationBarButtonTap(e) {
|
||||
if(e.index == 0) this.search(this.keyword);
|
||||
},
|
||||
// 输入框文本变化
|
||||
onNavigationBarSearchInputChanged(e) {
|
||||
this.keyword = e.text;
|
||||
},
|
||||
// 点击键盘搜索按钮
|
||||
onNavigationBarSearchInputConfirmed(value) {
|
||||
this.search(this.keyword);
|
||||
},
|
||||
methods:{
|
||||
setNavSearchInput(placeholder) {
|
||||
// #ifdef APP-PLUS
|
||||
// 修改 placeholder
|
||||
webview.setStyle({
|
||||
'titleNView': {
|
||||
"searchInput": { //修改当前窗口search样式
|
||||
"placeholder": placeholder,
|
||||
}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
getWordList() {
|
||||
this.$u.api.searchwordlist({type:this.type}).then(res => {
|
||||
console.log(res)
|
||||
this.searchwordlist = res.data;
|
||||
|
||||
})
|
||||
},
|
||||
search(value){
|
||||
// console.log(value)
|
||||
this.$u.route({
|
||||
url:"/pageB/search/out",
|
||||
params:{
|
||||
value,
|
||||
type:"shop"
|
||||
// console.log(value)
|
||||
if(!value) {
|
||||
this.$u.toast('搜索内容不可为空');
|
||||
return false;
|
||||
}
|
||||
let params = {
|
||||
value: value,
|
||||
type: this.type,
|
||||
curent:this.curent
|
||||
}
|
||||
if(this.type == 2) {
|
||||
this.$u.route({
|
||||
url: "/pageB/search/out",
|
||||
params: params,
|
||||
})
|
||||
}else{
|
||||
if(this.sid !=0 ){
|
||||
params.sid = this.sid
|
||||
console.log(this.sid)
|
||||
}
|
||||
})
|
||||
this.$u.route({
|
||||
url: "/pageB/search/searchGoods",
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +121,8 @@ export default {
|
||||
}
|
||||
.label{
|
||||
display: flex;
|
||||
>text{
|
||||
flex-wrap: wrap;
|
||||
> text {
|
||||
margin-top: 20rpx;
|
||||
margin-right: 30rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
@@ -1,198 +1,309 @@
|
||||
<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">
|
||||
<swiper-item>
|
||||
<scroll-view :scroll-y="true" style="height:100%">
|
||||
<view style="padding-top:30rpx">
|
||||
<shop></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>
|
||||
<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 class="xz" @click="sx(1)">
|
||||
<text>价格</text>
|
||||
<view class="jiage">
|
||||
<view class="top"></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>
|
||||
<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>
|
||||
|
||||
</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>
|
||||
<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>
|
||||
<view class="evaluation" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">社区</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore" v-show="current == 0" :scroll-top="scrollTop" @scroll="scroll">
|
||||
<view v-for="goods in goodsList" :key="goods.store_id" class="goods-item" @click="toDetailsPage(goods.store_id)">
|
||||
<image :src="goods.store_avatar"></image>
|
||||
<view class="right">
|
||||
<view class="name u-line-1">{{ goods.store_name }}</view>
|
||||
<view class="briefing u-line-2">{{ goods.store_description }}</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>
|
||||
<scroll-view style="width:100%;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 2 " :scroll-top="scrollTop" @scroll="scroll">
|
||||
<view class="box" style="padding: 0 30rpx;">
|
||||
<view style="display:flex">
|
||||
<view>
|
||||
<videoItem v-for="(item,id) in goodsList.filter((_, index) => !(index&1))" :key="id" :item="item"
|
||||
@getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<videoItem v-for="(item,id) in goodsList.filter((_, index) => index&1)" :key="id" :item="item"
|
||||
@getArticlelist="getArticlelist"></videoItem>
|
||||
</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>
|
||||
<scroll-view style="width:100%;padding: 0rpx 30rpx;margin-right:23rpx;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 1 " :scroll-top="scrollTop" @scroll="scroll">
|
||||
<view class="list" >
|
||||
<darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0px 3rpx 7rpx 0px rgba(153, 153, 153, 0.35);" v-for="item in goodsList" :key="item.member_id" :info="item" v-on:pChangeType="changeType"></darenItem>
|
||||
</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>
|
||||
<style lang="scss" scoped>
|
||||
.out{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
.sosuo{
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
border-bottom: 1rpx solid #ececec;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
flex-shrink: 0;
|
||||
|
||||
>image{
|
||||
width: 18rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 24rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
align-items: center;
|
||||
}
|
||||
.swiper{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.list{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
}
|
||||
.select{
|
||||
width: 100%;
|
||||
height: 89rpx;
|
||||
border-bottom: 1rpx solid #ececec;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
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;
|
||||
border-left: 11rpx solid #fff ;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import shop from "../components/search/shop"
|
||||
import darenItem from "@/components/index/daren-item/index"
|
||||
import videoItem from "@/components/index/video-item/index"
|
||||
import darenItem from "@/components/index/daren-item/index"
|
||||
export default {
|
||||
name:"out",
|
||||
components:{
|
||||
shop,
|
||||
darenItem
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
list:[
|
||||
{
|
||||
name:"店铺"
|
||||
},{
|
||||
name:"达人"
|
||||
}
|
||||
],
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
keyword:"",
|
||||
type:"",
|
||||
shoplist:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
transition(e) {
|
||||
let dx = e.detail.dx;
|
||||
this.$refs.uTabs.setDx(dx);
|
||||
},
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
this.$refs.uTabs.setFinishCurrent(current);
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
sx(type){
|
||||
console.log(type)
|
||||
data() {
|
||||
return {
|
||||
pageSize: 12,
|
||||
cid: '',
|
||||
page: 1,
|
||||
current: 0,
|
||||
priceOrderAsc: true, // 是否升序
|
||||
goodsList: [],
|
||||
scrollHeight: '',
|
||||
loadStatus: 'loadmore',
|
||||
timer: true, // 防止上拉加载短时间内多次调用,
|
||||
value:"",
|
||||
scrollTop: 0,
|
||||
old: {
|
||||
scrollTop: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
components:{
|
||||
videoItem,
|
||||
darenItem
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
this.page = 1;
|
||||
this.ShopSearch({ laod: 'reload' });
|
||||
},
|
||||
priceOrderAsc(value) {
|
||||
this.page = 1;
|
||||
this.ShopSearch({ laod: 'reload' });
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.value = option.value;
|
||||
this.current = option.curent
|
||||
this.setViewHeight();
|
||||
this.ShopSearch()
|
||||
this.setNavSearchInput(this.value);
|
||||
|
||||
},
|
||||
onNavigationBarSearchInputConfirmed(value) {
|
||||
this.value = value.text
|
||||
this.page = 1
|
||||
// console.log(this.value)
|
||||
this.ShopSearch()
|
||||
},
|
||||
methods: {
|
||||
scroll: function(e) {
|
||||
this.old.scrollTop = e.detail.scrollTop; // 必要
|
||||
},
|
||||
huadong(e){
|
||||
console.log(e.detail.current)
|
||||
},
|
||||
search(){
|
||||
this.$u.api.ShopSearch({keyword:this.keyword}).then((res)=>{
|
||||
this.shoplist[0] = res.data.data
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(o){
|
||||
this.type = o.type
|
||||
this.keyword = o.value
|
||||
this.search()
|
||||
// 动态设置导航栏搜索框内容
|
||||
setNavSearchInput(keyword) {
|
||||
// #ifdef APP-PLUS
|
||||
let webView = this.$mp.page.$getAppWebview();
|
||||
webView.setTitleNViewSearchInputText(keyword);
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let inputSearch=document.querySelector('.uni-input-input[type=search]');
|
||||
var evt = new InputEvent('input', {
|
||||
inputType: 'insertText',
|
||||
data: keyword,
|
||||
dataTransfer: null,
|
||||
isComposing: false
|
||||
});
|
||||
if(inputSearch){
|
||||
inputSearch.value = keyword;
|
||||
inputSearch.dispatchEvent(evt);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
changeType(member_id){
|
||||
console.log(member_id);
|
||||
this.$emit("pChangeType")
|
||||
this.$u.api.attentionMember({
|
||||
member_id: member_id
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
for(let i in this.goodsList){
|
||||
|
||||
if(this.goodsList[i].member_id == member_id){
|
||||
this.goodsList[i].is_attention = res.message == "已取消关注!" ? 0 : 1
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
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 ShopSearch({ load = 'reload' } = {}) {
|
||||
// const res = await this.$u.api.ShopSearch({
|
||||
// keyword: this.value,
|
||||
// page: this.page,
|
||||
// order: sort,
|
||||
// })
|
||||
console.log(this.value)
|
||||
let res = {}
|
||||
if(this.current == 0) {
|
||||
res = await this.$u.api.storeList({
|
||||
name_search: this.value,
|
||||
page: this.page
|
||||
})
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
if(load == 'reload') this.goodsList = res.data.list.data;
|
||||
else if(load == 'loadmore') this.goodsList.push(...res.data.list.data);
|
||||
}
|
||||
console.log(this.goodsList)
|
||||
return res.data.list.data.length;
|
||||
} else if (this.current == 1) {
|
||||
|
||||
res = await this.$u.api.getExpertList({
|
||||
like_nickname: this.value,
|
||||
page: this.page
|
||||
})
|
||||
this.timer = true;
|
||||
console.log(JSON.stringify(res))
|
||||
if(res.errCode == 0) {
|
||||
if(load == 'reload') this.goodsList = res.data.list;
|
||||
else if(load == 'loadmore') this.goodsList.push(...res.data.list);
|
||||
}
|
||||
console.log(this.goodsList)
|
||||
return res.data.list.length;
|
||||
} else if (this.current == 2) {
|
||||
res = await this.$u.api.getArticlelist({
|
||||
value: this.value,
|
||||
page: this.page
|
||||
})
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
if(load == 'reload') this.goodsList = res.data.list;
|
||||
else if(load == 'loadmore') this.goodsList.push(...res.data.list);
|
||||
}
|
||||
console.log(this.goodsList)
|
||||
return res.data.list.length;
|
||||
}
|
||||
|
||||
},
|
||||
loadMore() {
|
||||
if(this.goodsList.length < this.pageSize) return false;
|
||||
if(!this.timer) return false;
|
||||
this.loadStatus = "loading";
|
||||
this.page++;
|
||||
this.ShopSearch({ 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.page = 1;
|
||||
this.current = current;
|
||||
this.goodsList = []
|
||||
this.ShopSearch()
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 92 + 'px';
|
||||
},
|
||||
toDetailsPage(id) {
|
||||
this.$u.route('/pageC/merchant/index', {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.list{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: calc(100% + 23rpx);
|
||||
margin-right: -23rpx;
|
||||
}
|
||||
.classify-goods {
|
||||
.tab-container {
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 40rpx;
|
||||
display: flex;
|
||||
// margin-bottom: 30rpx;
|
||||
height: 92rpx;
|
||||
> view {
|
||||
height: 30rpx;
|
||||
line-height: 1;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</style>
|
||||
245
pageB/search/searchGoods.vue
Normal file
@@ -0,0 +1,245 @@
|
||||
<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" :scroll-top="scrollTop" @scroll="scroll">
|
||||
<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-1">{{ goods.goods_advword }}</view>
|
||||
<view class="price">¥{{ goods.goods_price }}
|
||||
<text style="font-size:22rpx;color:#999;text-decoration:line-through;display: inline-block;margin-left:20rpx"> ¥{{goods.goods_marketprice}}</text>
|
||||
</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, // 防止上拉加载短时间内多次调用,
|
||||
value:"",
|
||||
scrollTop: 0,
|
||||
old: {
|
||||
scrollTop: 0
|
||||
},
|
||||
sid:''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
this.page = 1;
|
||||
this.ShopSearch({ laod: 'reload' });
|
||||
},
|
||||
priceOrderAsc(value) {
|
||||
this.page = 1;
|
||||
this.ShopSearch({ laod: 'reload' });
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.value = option.value
|
||||
this.sid = option.sid
|
||||
this.setViewHeight();
|
||||
this.ShopSearch()
|
||||
this.setNavSearchInput(this.value);
|
||||
|
||||
},
|
||||
onNavigationBarSearchInputConfirmed(value) {
|
||||
this.value = value.text
|
||||
this.page = 1
|
||||
this.ShopSearch()
|
||||
},
|
||||
methods: {
|
||||
scroll: function(e) {
|
||||
this.old.scrollTop = e.detail.scrollTop; // 必要
|
||||
},
|
||||
setNavSearchInput(keyword) {
|
||||
console.log(keyword);
|
||||
// #ifdef APP-PLUS
|
||||
let webView = this.$mp.page.$getAppWebview();
|
||||
webView.setTitleNViewSearchInputText(keyword);
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let inputSearch=document.querySelector('.uni-input-input[type=search]');
|
||||
const evt = new InputEvent('input', {
|
||||
inputType: 'insertText',
|
||||
data: keyword,
|
||||
dataTransfer: null,
|
||||
isComposing: false
|
||||
});
|
||||
if(inputSearch){
|
||||
inputSearch.value = keyword;
|
||||
inputSearch.dispatchEvent(evt);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
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 ShopSearch({ load = 'reload' } = {}) {
|
||||
console.log(this.value);
|
||||
console.log(this.sid)
|
||||
|
||||
const sort = this.setOrderSort();
|
||||
const res = await this.$u.api.ShopSearch({
|
||||
keyword: this.value,
|
||||
page: this.page,
|
||||
order: sort,
|
||||
sid:this.sid
|
||||
})
|
||||
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);
|
||||
}
|
||||
console.log(res)
|
||||
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.ShopSearch({ load: 'loadmore' }).then(length => {
|
||||
if(length == 0) {
|
||||
this.page--;
|
||||
this.loadStatus = 'nomore';
|
||||
} else {
|
||||
this.loadStatus = 'loading';
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loadStatus = "nomore";
|
||||
this.page--;
|
||||
})
|
||||
},
|
||||
switchCurrent(current) {
|
||||
this.page = 1
|
||||
if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc;
|
||||
this.scrollTop = this.old.scrollTop
|
||||
this.$nextTick(function() {
|
||||
this.scrollTop = 0
|
||||
});
|
||||
this.ShopSearch()
|
||||
this.current = current;
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 92 + 'px';
|
||||
},
|
||||
toDetailsPage(id) {
|
||||
this.$u.route('/pageB/sdetails/index', {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.classify-goods {
|
||||
.tab-container {
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 40rpx;
|
||||
display: flex;
|
||||
// margin-bottom: 30rpx;
|
||||
height: 92rpx;
|
||||
> view {
|
||||
height: 30rpx;
|
||||
line-height: 1;
|
||||
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;
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
.briefing {
|
||||
font-size: 28rpx;
|
||||
color: rgba(102,102,102,1);
|
||||
}
|
||||
.price {
|
||||
font-size: 26rpx;
|
||||
color: rgba(255,49,49,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
pageB/static/cart.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
298
pageB/triedDress/index.vue
Normal 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: Math.floor(new Date(this.time).getTime() / 1000),
|
||||
}).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>
|
||||
945
pageB/video/video.nvue
Normal file
@@ -0,0 +1,945 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<video id="videoId" :style="videoSize" :src="src" autoplay="true" :show-fullscreen-btn="false" @play="playing"
|
||||
@pause="pausing" @ended="videoEnd" @timeupdate="timeupdate" :show-play-btn="false" :controls="false" @click="stoping"
|
||||
:enable-progress-gesture="false" :show-center-play-btn="false"></video>
|
||||
<!-- 用户操作 -->
|
||||
<userinfo class="user-info" :style="{ top: fixTop }" :list="list" :cart="cart_type" :comment="is_comment" :num="comment_num"
|
||||
@openCart="openPopup"></userinfo>
|
||||
<!-- 视频信息 -->
|
||||
<cover-view class="info-box">
|
||||
<view class="video-info-box" :style="{ width: time_count > 99 ? '180rpx' : '160rpx' }">
|
||||
<image class="image-play" src="../../static/videoIcon.png" mode=""></image>
|
||||
<text class="video-slip">视频</text>
|
||||
<text class="time">{{ time_count }}s</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name" @click="gotoInfo(list)">@{{ list.member_nickname }}</text>
|
||||
</view>
|
||||
<view @click="stopClick">
|
||||
<text class="title">{{ list.article_title }}</text>
|
||||
</view>
|
||||
<view @click="stopClick">
|
||||
<text class="centent">{{ list.article_content }}</text>
|
||||
</view>
|
||||
<view class="label-box" @click="stopClick">
|
||||
<block v-for="(item,index) in list.label" :key="index">
|
||||
<text class="label" :style="{ width: labelLen[index] * 40 + 'rpx' }">{{ item.name }}</text>
|
||||
</block>
|
||||
</view>
|
||||
</cover-view>
|
||||
<!-- 单个商品 -->
|
||||
<cover-view class="good-one" :style="{ bottom: fixTop - 100 }" v-if="cart_len == 1 && cart_type">
|
||||
<view class="one-list" v-for="(item,index) in list.goods" :key="index" @click="goGoodInfo(item.goods_id)">
|
||||
<image class="one-image" :src="item.goods_image" mode=""></image>
|
||||
<view class="one-box">
|
||||
<text class="title-one">{{ item.goods_advword }}</text>
|
||||
<text class="content-one">{{ item.goods_name }}</text>
|
||||
<text class="good-price">¥{{ item.goods_promotion_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</cover-view>
|
||||
<!-- 遮罩层 -->
|
||||
<cover-view class="mask" @click.stop="stopClick" :style="videoSize" v-if="is_edit || is_comment || cart_type && cart_len >= 2">
|
||||
<!-- 评论 -->
|
||||
<cover-view class="content-box" v-if="is_comment" ref="contentBox">
|
||||
<view class="content-title">
|
||||
<text class="tips">评论</text>
|
||||
<text class="close-down" @click="closeComment">×</text>
|
||||
</view>
|
||||
<scroller class="comment-list">
|
||||
<view class="" v-for="(item,index) in commentList" :key="index">
|
||||
<view class="comment-list-box">
|
||||
<view class="comment-list-header">
|
||||
<image class="avatar" :src="item.member_avatar" mode=""></image>
|
||||
<view class="comment-title-info">
|
||||
<text class="comment-title">{{ item.member_nickname }}</text>
|
||||
<text class="comment-time">{{ item.create_time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="reply" @click="openKeyInput(item,index)">回复</text>
|
||||
</view>
|
||||
<view class="content-main">
|
||||
<text class="content-style">{{ item.content }}</text>
|
||||
</view>
|
||||
<view class="more-content-box">
|
||||
<view class="child-box" v-for="(child,cid) in allList[item.id]" :key="cid">
|
||||
<view class="child-info">
|
||||
<image class="child-avatar" :src="child.member_avatar" mode=""></image>
|
||||
<text class="child-name">{{ child.member_nickname }}</text>
|
||||
<text v-if="0">{{ child.reply_member_nickname }}</text>
|
||||
</view>
|
||||
<text class="child_content">{{ child.content }}</text>
|
||||
</view>
|
||||
<!-- <view> -->
|
||||
<text class="more-comment" @click="getReplyList(item.id)" v-if="item.reply_count">
|
||||
{{ child_end[item.id] ? "暂无更多回复" : "展开更多回复" }}
|
||||
</text>
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="send-box" @click="openKeyInput">
|
||||
<input class="send-val" type="text" :placeholder="edit_text" placeholder-class="placeholder-class"
|
||||
disabled="true" @click="openKeyInput" />
|
||||
<text class="btn-send">发送</text>
|
||||
</view>
|
||||
<loading class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
|
||||
<loading-indicator class="indicator"></loading-indicator>
|
||||
<text class="indicator-text">努力加载中</text>
|
||||
</loading>
|
||||
</scroller>
|
||||
</cover-view>
|
||||
<!-- 评论框 -->
|
||||
<cover-view class="edit-box" :style="videoSize" v-if="is_edit" @click="hideEdit">
|
||||
<view class="input-main">
|
||||
<input class="edit-input" type="text" :focus="is_focus" :placeholder=" edit_text_other ? edit_text_other : edit_text"
|
||||
placeholder-class="placeholder-class" v-model="send_value" />
|
||||
<text class="btn-send" @click="sendComment">发送</text>
|
||||
</view>
|
||||
<!-- <view class="key-height" :style="{ height: editTop }"></view> -->
|
||||
</cover-view>
|
||||
<!-- 购物车 -->
|
||||
<cover-view class="cart-box" v-if="cart_type">
|
||||
<view class="cart-title">
|
||||
<text class="tips">全部商品</text>
|
||||
<text class="close-down" @click="cart_type = false">×</text>
|
||||
</view>
|
||||
<scroller class="cart-list">
|
||||
<view class="" v-for="(item,index) in list.goods" :key="index">
|
||||
<view class="cart-list-header" @click="goGoodInfo(item.goods_id)">
|
||||
<image class="goods-img" :src="item.goods_image" mode=""></image>
|
||||
<view class="goods-info">
|
||||
<text class="good-title">{{ item.goods_advword }}</text>
|
||||
<text class="good-name">{{ item.goods_name }}</text>
|
||||
<text class="good-price">{{ item.goods_promotion_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<loading v-if="0" class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
|
||||
<loading-indicator class="indicator"></loading-indicator>
|
||||
<text class="indicator-text">努力加载中</text>
|
||||
</loading>
|
||||
</scroller>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<!-- 返回按钮 -->
|
||||
<cover-image class="close" @click="goBack" src="../../static/close.png">
|
||||
</cover-image>
|
||||
<!-- 暂停按钮 -->
|
||||
<cover-view class="pause" :style="{ top: fixTop + 100 }">
|
||||
<cover-image class="pause-img" src="../../static/videoPlay.png" @click="stoping" v-if="!is_play">
|
||||
</cover-image>
|
||||
</cover-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import userinfo from "../components/userinfo/index" // 点赞组件
|
||||
const temp_url = "https://mall.dmygkeji.com/api/";
|
||||
export default {
|
||||
components: {
|
||||
userinfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
videoSize: {},
|
||||
fixTop: 0,
|
||||
editTop: 0,
|
||||
list: {},
|
||||
labelLen: [],
|
||||
cart_len: 0, // 购物车个数
|
||||
cart_type: false, // 显示购物车
|
||||
is_comment: false, // 显示评论
|
||||
is_edit: false, // 显示输入
|
||||
is_focus: false, //
|
||||
comment_num: 0, // 评论数
|
||||
edit_text: "有爱评论,说点好听的 ~",
|
||||
edit_text_other: "有爱评论,说点好听的 ~",
|
||||
pid: 0, // 主键
|
||||
reply_id: 0, // 回复id
|
||||
allList: {}, // 全部子评论
|
||||
page_: {},
|
||||
page: 0,
|
||||
comment_id: 0,
|
||||
send_value: "", // 评论
|
||||
commentList: [], // 评论列表
|
||||
src: "",
|
||||
is_play: true,
|
||||
time_count: 0,
|
||||
linear: null,
|
||||
loadinging: false,
|
||||
child_end: {},
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.article_id = option.id;
|
||||
this.getVideoInfo(option.id);
|
||||
this.getInfo();
|
||||
this.allList = {};
|
||||
},
|
||||
onReady() {
|
||||
this.videoBox = uni.createVideoContext("videoId", this);
|
||||
},
|
||||
onHide() {
|
||||
if (uni.getSystemInfoSync().platform == "ios") {
|
||||
console.log("ios");
|
||||
} else if (uni.getSystemInfoSync().platform == "android") {
|
||||
this.videoBox.pause();
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
if (this.cart_type) {
|
||||
this.cart_type = !this.cart_type;
|
||||
} else if (this.is_edit) {
|
||||
this.is_edit = !this.is_edit;
|
||||
} else if (this.is_comment) {
|
||||
this.is_comment = !this.is_comment;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
methods: {
|
||||
moveHandle() {
|
||||
return false;
|
||||
},
|
||||
// 获取信息
|
||||
getVideoInfo(article_id) {
|
||||
uni.request({
|
||||
url: temp_url + "article/articleInfo",
|
||||
method: "POST",
|
||||
data: {
|
||||
article_id: article_id
|
||||
},
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
},
|
||||
success: (res) => {
|
||||
this.list = res.data.data.info;
|
||||
this.src = res.data.data.info.video_path;
|
||||
this.cart_len = res.data.data.info.goods.length;
|
||||
console.log(this.cart_len);
|
||||
let item = res.data.data.info.label;
|
||||
let arr = [];
|
||||
item.forEach(data => {
|
||||
let str = escape(data.name);
|
||||
if (str.indexOf('%u')) {
|
||||
// console.log(data.name);
|
||||
arr.push(Math.floor(data.name.length / 2));
|
||||
} else {
|
||||
arr.push(data.name.length);
|
||||
}
|
||||
})
|
||||
this.labelLen = arr;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取评论
|
||||
getComment() {
|
||||
uni.request({
|
||||
url: temp_url + "article/articleCommentList",
|
||||
method: "POST",
|
||||
data: {
|
||||
article_id: this.article_id,
|
||||
page: this.page,
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.errCode == 0) {
|
||||
// console.log(res.data);
|
||||
this.commentList = res.data.data;
|
||||
}
|
||||
let list = this.commentList;
|
||||
list.forEach((item,index) => {
|
||||
console.log(item);
|
||||
item.page = 0;
|
||||
item.commentList = [];
|
||||
this.page_[item.id] = 0;
|
||||
this.child_end[item.id] = false;
|
||||
})
|
||||
console.log(list);
|
||||
this.commentList = list;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 发布评论
|
||||
sendComment() {
|
||||
console.log(this.article_id, this.send_value, this.pid, this.reply_id);
|
||||
if (this.send_value.length == 0) {
|
||||
uni.showToast({
|
||||
title: "输入内容不能为空!",
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
}
|
||||
uni.request({
|
||||
url: temp_url + "article/articleAddComment",
|
||||
method: "POST",
|
||||
data: {
|
||||
article_id: this.article_id,
|
||||
content: this.send_value,
|
||||
pid: this.pid,
|
||||
reply_id: this.reply_id,
|
||||
},
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
this.is_edit = false;
|
||||
this.send_value = "";
|
||||
if (res.data.errCode == 0) {
|
||||
this.comment_num = res.data.num;
|
||||
let p_id = res.data.data.data.pid;
|
||||
console.log(this.pid, this.reply_id, this.comment_id);
|
||||
if (res.data.data.data.pid) {
|
||||
this.commentList[this.comment_id].reply_count = true;
|
||||
console.log(this.allList[p_id]);
|
||||
if (this.allList[p_id]) {
|
||||
this.allList[p_id].push(res.data.data.data);
|
||||
} else {
|
||||
this.allList[p_id] = [];
|
||||
this.allList[p_id].push(res.data.data.data);
|
||||
}
|
||||
console.log(this.allList);
|
||||
} else {
|
||||
this.commentList.unshift(res.data.data.data);
|
||||
}
|
||||
// console.log(this.commentList);
|
||||
} else if (res.data.errCode == 401) {
|
||||
uni.showToast({
|
||||
title: "您还没有登录,请先登录!",
|
||||
icon: "none",
|
||||
// success: () => {
|
||||
// setTimeout(function() {
|
||||
// this.$u.route("/pageA/login/login")
|
||||
// }, 2000)
|
||||
// }
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 发现回复列表
|
||||
getReplyList(id) {
|
||||
uni.showLoading({
|
||||
title: "loading..."
|
||||
})
|
||||
uni.request({
|
||||
url: temp_url + "article/articleReplyList",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: id,
|
||||
page: this.page_[id],
|
||||
},
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
},
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
console.log(this.page_);
|
||||
if (res.data.errCode == 0) {
|
||||
if (this.page_[id] == 0) {
|
||||
this.allList[id] = res.data.data;
|
||||
} else {
|
||||
this.allList[id] = this.allList[id].concat(res.data.data);
|
||||
}
|
||||
this.page_[id]++;
|
||||
this.$forceUpdate();
|
||||
} else if (res.data.errCode == 1) {
|
||||
this.child_end[id] = true;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
console.log(this.allList);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取手机信息
|
||||
getInfo() {
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
this.videoSize = {
|
||||
width: "750rpx",
|
||||
height: res.screenHeight + "px",
|
||||
}
|
||||
this.fixTop = res.screenHeight / 3;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 播放
|
||||
playing(e) {
|
||||
// console.log(e);
|
||||
if (e.type == "play") {}
|
||||
},
|
||||
pausing(e) {
|
||||
if (e.type == "pause") {
|
||||
this.is_play = false;
|
||||
}
|
||||
},
|
||||
// 结束
|
||||
videoEnd(e) {
|
||||
// console.log(e);
|
||||
if (e.type == "ended") {
|
||||
this.is_play = false;
|
||||
this.time_count = 0;
|
||||
}
|
||||
},
|
||||
// 暂停
|
||||
stoping() {
|
||||
this.is_play = !this.is_play;
|
||||
if (this.is_play) {
|
||||
this.videoBox.play();
|
||||
} else {
|
||||
this.videoBox.pause();
|
||||
}
|
||||
},
|
||||
// 监听视频
|
||||
timeupdate(e) {
|
||||
this.time_count = parseInt(e.detail.duration) - parseInt(e.detail.currentTime);
|
||||
// console.log(e.detail.currentTime,e.detail.duration);
|
||||
if (e.detail.duration == e.detail.currentTime) {
|
||||
// this.is_play = false;
|
||||
}
|
||||
// let num = parseInt((e.detail.currentTime/e.detail.duration)*100);
|
||||
// this.linear = num + "%";
|
||||
// console.log(this.time_count);
|
||||
},
|
||||
// 打开弹窗
|
||||
openPopup(data) {
|
||||
// console.log(data);
|
||||
if (this.cart_len >= 2) {
|
||||
|
||||
}
|
||||
this.cart_type = data.cart;
|
||||
this.is_comment = data.comment;
|
||||
if (this.is_comment) {
|
||||
this.page = 0;
|
||||
this.getComment();
|
||||
// this.is_play = true;
|
||||
}
|
||||
},
|
||||
// 打开评论输入
|
||||
openKeyInput(data, index) {
|
||||
// console.log(data);
|
||||
let me = this;
|
||||
this.is_focus = true;
|
||||
setTimeout(() => {
|
||||
this.is_edit = true;
|
||||
}, 500)
|
||||
uni.onKeyboardHeightChange(function(res) {
|
||||
console.log(res);
|
||||
if (res.height == 0) {
|
||||
me.is_focus = false;
|
||||
me.is_edit = false;
|
||||
} else {
|
||||
me.editTop = res.height + "rpx";
|
||||
}
|
||||
})
|
||||
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);
|
||||
},
|
||||
blue() {
|
||||
this.is_focus = false;
|
||||
},
|
||||
// 关闭评论
|
||||
closeComment() {
|
||||
this.is_comment = false;
|
||||
this.is_edit = false;
|
||||
// console.log(this.is_comment,this.is_play);
|
||||
// if (!this.is_comment && this.is_play) {
|
||||
// console.log(1);
|
||||
// this.is_play = false;
|
||||
// }
|
||||
},
|
||||
// 下拉加载
|
||||
onloading(e) {
|
||||
console.log(e);
|
||||
this.loadinging = true;
|
||||
setTimeout(() => {
|
||||
this.loadinging = false;
|
||||
}, 2000)
|
||||
},
|
||||
// 跳转
|
||||
goGoodInfo(id) {
|
||||
uni.navigateTo({
|
||||
url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
|
||||
})
|
||||
},
|
||||
gotoInfo(id) {
|
||||
console.log(id);
|
||||
},
|
||||
// 收起键盘
|
||||
hideEdit() {},
|
||||
// stop
|
||||
stopClick(event) {
|
||||
event.stopPropagation();
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
background-color: #FF0000 !important;
|
||||
}
|
||||
|
||||
/* 关闭 */
|
||||
.close {
|
||||
z-index: 99;
|
||||
position: fixed;
|
||||
top: 100rpx;
|
||||
right: 70rpx;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
/* 暂停 */
|
||||
.pause {
|
||||
z-index: 99;
|
||||
position: fixed;
|
||||
left: 330rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
/* #ifdef H5 */
|
||||
top: 500rpx;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.pause-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
/* 用户操作 */
|
||||
.user-info {
|
||||
position: fixed;
|
||||
right: 26rpx;
|
||||
/* #ifdef H5 */
|
||||
top: 400rpx;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/* 底部信息 */
|
||||
.info-box {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.video-info-box {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 40rpx;
|
||||
padding: 4rpx 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #666666;
|
||||
border-radius: 10rpx;
|
||||
background-color: rgba(255, 255, 255, .6);
|
||||
}
|
||||
|
||||
.good-one {
|
||||
position: fixed;
|
||||
right: 160rpx;
|
||||
width: 420rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.one-list {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.one-image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.one-box {
|
||||
justify-content: space-around;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.title-one {
|
||||
width: 200rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
lines: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.content-one {
|
||||
width: 200rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
lines: 2;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.mask {
|
||||
z-index: 10000;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.content-box {
|
||||
z-index: 999;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 750rpx;
|
||||
height: 700rpx;
|
||||
padding-bottom: 50rpx;
|
||||
margin-bottom: 88rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.content-title {
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 88rpx;
|
||||
padding: 0 20rpx;
|
||||
background-color: #ECECEC;
|
||||
}
|
||||
|
||||
.comment-list {
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.comment-list-box {
|
||||
padding: 20rpx 30rpx;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.content-main {
|
||||
flex-direction: row;
|
||||
padding-left: 100rpx;
|
||||
}
|
||||
|
||||
|
||||
.content-style {
|
||||
width: 600rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
lines: 2;
|
||||
}
|
||||
|
||||
.more-content-box {
|
||||
margin-left: 100rpx;
|
||||
}
|
||||
|
||||
.child-box {}
|
||||
|
||||
.child-info {
|
||||
margin: 10rpx 0;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.child-avatar {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.child-name {
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.child_content {
|
||||
width: 550rpx;
|
||||
padding-top: 6rpx;
|
||||
margin-left: 40rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.more-comment {
|
||||
width: 150rpx;
|
||||
height: 40rpx;
|
||||
font-size: 22rpx;
|
||||
line-height: 4;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.comment-list-header {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.comment-title-info {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.comment-title {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.comment-time,
|
||||
.reply {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.send-box {
|
||||
z-index: 10000;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 750rpx;
|
||||
height: 88rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
border-top-width: 1rpx;
|
||||
border-color: #ececec;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.send-val {
|
||||
width: 600rpx;
|
||||
height: 88rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.btn-send {
|
||||
padding: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.close-down {
|
||||
padding: 10rpx;
|
||||
font-size: 50rpx;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.edit-box {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 750rpx;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
.input-main {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
/* #ifdef H5 */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 750rpx;
|
||||
padding: 0 20rpx;
|
||||
line-height: 80rpx;
|
||||
background-color: #fff;
|
||||
border-top-right-radius: 10rpx;
|
||||
border-top-left-radius: 10rpx;
|
||||
}
|
||||
|
||||
.key-height {
|
||||
width: 750rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.edit-input {
|
||||
width: 600rpx;
|
||||
height: 80rpx;
|
||||
padding: 0 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.cart-box {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 750rpx;
|
||||
height: 700rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.cart-title {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 88rpx;
|
||||
padding: 0 20rpx;
|
||||
border-color: #f2f2f2;
|
||||
border-bottom-width: 1rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.cart-list {}
|
||||
|
||||
.cart-list-header {
|
||||
padding: 20rpx;
|
||||
flex-direction: row;
|
||||
border-bottom-width: 1rpx;
|
||||
border-bottom-color: #ececec;
|
||||
}
|
||||
|
||||
.goods-img {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.goods-info {
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.good-title {
|
||||
width: 500rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
lines: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.good-name {
|
||||
width: 500rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 30rpx;
|
||||
lines: 2;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.good-price {
|
||||
font-size: 28rpx;
|
||||
color: #FF3131;
|
||||
}
|
||||
|
||||
.image-play {
|
||||
width: 22rpx;
|
||||
height: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.video-slip {
|
||||
color: #666;
|
||||
font-size: 24rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #666;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: #fff;
|
||||
font-size: 36rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 700rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
lines: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.centent {
|
||||
width: 700rpx;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
lines: 2;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.label-box {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.label {
|
||||
width: 100rpx;
|
||||
height: 40rpx;
|
||||
padding: 4rpx 10rpx;
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
line-height: 38rpx;
|
||||
color: #666666;
|
||||
border-radius: 10rpx;
|
||||
background-color: rgba(255, 255, 255, .6);
|
||||
}
|
||||
|
||||
.loading {
|
||||
width: 750rpx;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.indicator-text {
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.indicator {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.placeholder-class {
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
@@ -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>
|
||||
@@ -66,17 +67,17 @@
|
||||
</view>
|
||||
</view>
|
||||
<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>
|
||||
<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">
|
||||
<scroll-view class="coupon-choose" scroll-y style="height: 50vh;" v-if="this.couponType.type == 1">
|
||||
<view class="title">优惠券详情</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" style="height: 200rpx"></u-empty>
|
||||
</scroll-view>
|
||||
<scroll-view class="coupon-choose" scroll-y style="height: 50vh;" v-if="this.couponType.type == 2">
|
||||
<view class="title">优惠券详情</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>
|
||||
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_list[this.couponType.store_id].length" style="height: 200rpx"></u-empty>
|
||||
</scroll-view>
|
||||
</u-popup>
|
||||
<view class="bottom">
|
||||
@@ -121,7 +122,7 @@ export default {
|
||||
choiceCoupon: {}, // 使用的平台优惠券
|
||||
goodsClass: [],
|
||||
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
|
||||
|
||||
debounce: true,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -141,22 +142,26 @@ export default {
|
||||
return num;
|
||||
},
|
||||
setFreight(freight, index) {
|
||||
return freight[index];
|
||||
return freight[index] || '0.00';
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.orderType = this.$store.state.orderType;
|
||||
this.orderInfo = this.$store.state.orderInfo;
|
||||
console.log(this.orderType);
|
||||
console.log(this.orderInfo);
|
||||
// console.log('orderType' + 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,38 @@ 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 if(this.orderType == 3) {
|
||||
this.sendOrder(0);
|
||||
} else {
|
||||
this.sendOrder(1);
|
||||
}
|
||||
},
|
||||
// @params {Number} ifcart 是否是购物车商品
|
||||
sendOrder(ifcart) {
|
||||
// 拼接后端需要的数据形式
|
||||
let id = [], temp = '';
|
||||
@@ -236,28 +239,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,31 +309,47 @@ export default {
|
||||
},
|
||||
setTotalPrice() {
|
||||
const goods = this.orderInfo.store_goods_total;
|
||||
const freight = this.freight;
|
||||
let price = 0;
|
||||
// 商品价格加上运费
|
||||
[goods, freight].forEach(object => {
|
||||
for (const key in object) {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
const element = object[key];
|
||||
price += Number(element);
|
||||
}
|
||||
}
|
||||
})
|
||||
// 减去优惠券
|
||||
// 平台
|
||||
if(JSON.stringify(this.choiceCoupon) != '{}') price -= Number(this.choiceCoupon.voucher_price);
|
||||
// 店铺
|
||||
if(JSON.stringify(this.storeCoupon) != '{}') {
|
||||
for (const key in this.storeCoupon) {
|
||||
if (this.storeCoupon.hasOwnProperty(key)) {
|
||||
const element = this.storeCoupon[key];
|
||||
price -= element.voucher_price;
|
||||
}
|
||||
let [freight, price, minPrice] = [0, 0, 0];
|
||||
// 运费
|
||||
for (const key in this.freight) {
|
||||
if (this.freight.hasOwnProperty(key)) {
|
||||
const element = this.freight[key];
|
||||
freight += Number(element);
|
||||
}
|
||||
}
|
||||
// console.log(price);
|
||||
this.totalPrice = price.toFixed(2);
|
||||
// 商品价格减去优惠券
|
||||
// 店铺
|
||||
for (const gid in goods) {
|
||||
if (goods.hasOwnProperty(gid)) {
|
||||
// 计算最小价格
|
||||
minPrice += 0.01;
|
||||
// 每个店铺所有商品的价格
|
||||
let sprice = Number(goods[gid]);
|
||||
if(JSON.stringify(this.storeCoupon) != '{}') {
|
||||
for (const cid in this.storeCoupon) {
|
||||
if (this.storeCoupon.hasOwnProperty(cid)) {
|
||||
const cprice = this.storeCoupon[cid];
|
||||
// 商品减去优惠券价格
|
||||
if(gid == cid) {
|
||||
sprice -= cprice.voucher_price;
|
||||
// 每个店铺最低付款 0.01
|
||||
if(sprice <= 0) sprice = 0.01;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 所有商品总价
|
||||
price += sprice;
|
||||
}
|
||||
}
|
||||
// 平台
|
||||
if(JSON.stringify(this.choiceCoupon) != '{}') price -= Number(this.choiceCoupon.voucher_price);
|
||||
// 每个店铺最低付款 0.01
|
||||
if(price <= minPrice) price = minPrice;
|
||||
// console.log("minPrice" + minPrice);
|
||||
// console.log("freight:" + freight);
|
||||
// console.log("price:" + price);
|
||||
this.totalPrice = (price + freight).toFixed(2);
|
||||
},
|
||||
setDelivery(index) {
|
||||
if(index == 1) {
|
||||
@@ -391,6 +419,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 +443,8 @@ export default {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
border: 1rpx solid #000;
|
||||
margin-right: 15rpx;
|
||||
background-color: aquamarine;
|
||||
}
|
||||
> view {
|
||||
font-size: 28rpx;
|
||||
@@ -445,6 +481,8 @@ export default {
|
||||
justify-content: space-between;
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
height: 88rpx;
|
||||
line-height: 44rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
.cart-info {
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
<view class="price">¥{{ price }}</view>
|
||||
</view>
|
||||
<view class="pay-view">
|
||||
<u-radio-group v-model="pay_way" @change="radioGroupChange" size="16">
|
||||
<u-radio-group v-model="pay_way" size="16">
|
||||
<view v-for="(item, index) in payLiat" :key="index" class="pay-item">
|
||||
<view class="pay-way">
|
||||
<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,44 +39,58 @@ 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) {
|
||||
// console.log(e);
|
||||
},
|
||||
// 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));
|
||||
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)
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
},
|
||||
// 微信支付
|
||||
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 +100,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 +143,18 @@ export default {
|
||||
/deep/ .u-radio-group {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
.u-radio__icon-wrap {
|
||||
width: 30rpx !important;
|
||||
height: 30rpx !important;
|
||||
padding: 4rpx;
|
||||
border: 1px solid #FF780F;
|
||||
}
|
||||
.active {
|
||||
}
|
||||
.default {
|
||||
}
|
||||
.radio-view {
|
||||
padding: 6rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.active {
|
||||
border: 2rpx solid rgba(255,120,15,1);
|
||||
}
|
||||
.default {
|
||||
border: 2rpx solid rgba(219,219,219,1);
|
||||
|
||||
}
|
||||
.u-radio {
|
||||
.u-icon {
|
||||
@@ -145,13 +166,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;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<u-checkbox-group class="cart-main" @change="storeChange">
|
||||
<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">
|
||||
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="26" :name="s_index" @change="storeaAloneChange"></u-checkbox>
|
||||
<view class="name" @click="viewStoreDetails(store.store_id)">
|
||||
<image :src="store.store_avatar"></image>
|
||||
<view>{{ store.store_name }}</view>
|
||||
</view>
|
||||
@@ -12,10 +12,10 @@
|
||||
<view class="goods">
|
||||
<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>
|
||||
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="26" :name="g_index"></u-checkbox>
|
||||
<image :src="goods.goods_image" @click="viewGoodsDetails(goods.goods_id)"></image>
|
||||
<view class="info">
|
||||
<view class="name u-line-2">{{ goods.goods_name }}</view>
|
||||
<view class="name u-line-2" @click="viewGoodsDetails(goods.goods_id)">{{ goods.goods_name }}</view>
|
||||
<view class="cart-info">
|
||||
<view class="price">¥{{ goods.goods_price }}</view>
|
||||
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :index="goods.cart_id" @minus="reduce" @plus="plus" v-model="goods.goods_num"></u-number-box>
|
||||
@@ -31,7 +31,7 @@
|
||||
</view>
|
||||
<view class="balance">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="35" label-size="30" @change="totalChange">
|
||||
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="26" label-size="30" @change="totalChange">
|
||||
全选
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
@@ -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) {
|
||||
@@ -209,7 +238,7 @@ export default {
|
||||
// #ifdef APP-PLUS
|
||||
let currentWebview = page.$getAppWebview();
|
||||
let titleObj = currentWebview.getStyle().titleNView;
|
||||
console.log(JSON.stringify(titleObj.buttons[0]));
|
||||
// console.log(JSON.stringify(titleObj.buttons[0]));
|
||||
if (!titleObj.buttons) {
|
||||
return;
|
||||
}
|
||||
@@ -280,6 +309,7 @@ export default {
|
||||
.info {
|
||||
width: 418rpx;
|
||||
height: 160rpx;
|
||||
line-height: 48rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
@@ -296,10 +326,13 @@ export default {
|
||||
font-weight: 500;
|
||||
color: rgba(255,49,49,1);
|
||||
}
|
||||
.u-numberbox {
|
||||
/deep/ .u-numberbox {
|
||||
border: 1rpx solid rgba(217,215,215,1);
|
||||
border-radius:4px;
|
||||
/deep/ .u-number-input {
|
||||
.u-icon-minus, .u-icon-plus {
|
||||
width: 38rpx;
|
||||
}
|
||||
.u-number-input {
|
||||
margin: 0;
|
||||
color: #333 !important;
|
||||
border: 1rpx #D9D7D7 solid {
|
||||
@@ -308,31 +341,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
// .num {
|
||||
// display: flex;
|
||||
// width: 118rpx;
|
||||
// height: 39rpx;
|
||||
// border: 1rpx solid rgba(217,215,215,1);
|
||||
// border-radius:4px;
|
||||
// .reduce, .increase {
|
||||
// flex: 1;
|
||||
// font-size: 11rpx;
|
||||
// color: #FF780F;
|
||||
// line-height: 39rpx;
|
||||
// text-align: center;
|
||||
// }
|
||||
// .value {
|
||||
// flex: 1;
|
||||
// font-size: 22rpx;
|
||||
// color:rgba(51,51,51,1);
|
||||
// line-height: 39rpx;
|
||||
// text-align: center;
|
||||
// border: 1rpx #D9D7D7 solid {
|
||||
// top: 0px;
|
||||
// bottom: 0px;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
218
pageC/classify/goods.vue
Normal file
@@ -0,0 +1,218 @@
|
||||
<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-1">{{ goods.goods_advword }}</view>
|
||||
<!-- <view class="price">¥{{ goods.goods_price }}</view> -->
|
||||
<view class="price">
|
||||
<view class="present">¥{{ goods.goods_price }}</view>
|
||||
<view class="origin">¥{{ goods.goods_marketprice }}</view>
|
||||
</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 - (res.windowWidth / 750) * 90 + '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;
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
.briefing {
|
||||
font-size: 28rpx;
|
||||
color: rgba(102,102,102,1);
|
||||
}
|
||||
// .price {
|
||||
// font-size: 26rpx;
|
||||
// color: rgba(255,49,49,1);
|
||||
// }
|
||||
.price {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.present {
|
||||
font-size: 26rpx;
|
||||
color: rgba(255,49,49,1);
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.origin {
|
||||
text-decoration: line-through;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -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,21 @@
|
||||
onReady() {
|
||||
this.getMenuItemTop()
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
if(e.index == 0) this.$u.route('/pageB/search/index',{ type: 2 });
|
||||
},
|
||||
onNavigationBarSearchInputClicked() {
|
||||
this.$u.route('/pageB/search/index', { type: 2 });
|
||||
},
|
||||
methods: {
|
||||
toSearchPage() {
|
||||
this.$u.route({
|
||||
url: "pageB/search/index",
|
||||
prarms: {
|
||||
type: 2
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取分类列表
|
||||
getClassifyList() {
|
||||
this.$u.api.getGoodsClassifyList().then(res => {
|
||||
@@ -161,6 +175,12 @@
|
||||
}
|
||||
}
|
||||
}, 10)
|
||||
},
|
||||
toClassifyPage(id, name) {
|
||||
this.$u.route('pageC/classify/goods', {
|
||||
cid: id,
|
||||
cname: name,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<template>
|
||||
<view class="imageTop">
|
||||
<image :src="url"></image>
|
||||
<image :src="url" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.imageTop{
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
margin-bottom: 20rpx;
|
||||
overflow: hidden;
|
||||
>image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -21,6 +22,6 @@ export default {
|
||||
return {
|
||||
}
|
||||
},
|
||||
props:['url']
|
||||
props:['url'],
|
||||
}
|
||||
</script>
|
||||
@@ -1,18 +1,51 @@
|
||||
<template>
|
||||
<view class="listItem">
|
||||
<video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video>
|
||||
<image v-else :src="url"></image>
|
||||
<view v-if="type == '2'" class="video-container">
|
||||
<image :src="url" mode="aspectFill" class="video"></image>
|
||||
<view class="backs"></view>
|
||||
<image src="/static/videoPlay.png" mode="aspectFill" class="play-video"></image>
|
||||
</view>
|
||||
<image v-else :src="url" mode="aspectFill"></image>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.listItem{
|
||||
width: 365rpx;
|
||||
height: 500rpx;
|
||||
margin-bottom: 20rpx;
|
||||
>image,video{
|
||||
overflow: hidden;
|
||||
> image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.video-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
.video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.backs {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: rgba($color: #000000, $alpha: 0.35);
|
||||
z-index: 9;
|
||||
}
|
||||
.play-video {
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
z-index: 19;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
@@ -23,6 +56,6 @@ export default {
|
||||
|
||||
}
|
||||
},
|
||||
props:['url','type']
|
||||
props:['url','type'],
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<view class="videoTop">
|
||||
<video :src="url" :show-fullscreen-btn="true"></video>
|
||||
<image :src="url" mode="aspectFill" class="video"></image>
|
||||
<view class="backs"></view>
|
||||
<image src="/static/videoPlay.png" mode="aspectFill" class="play-video"></image>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
@@ -8,10 +10,31 @@
|
||||
width: 100%;
|
||||
height: 284rpx;
|
||||
margin-bottom: 20rpx;
|
||||
>video{
|
||||
position: relative;
|
||||
.video{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
.backs {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
z-index: 9;
|
||||
}
|
||||
.play-video {
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
z-index: 19;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
@@ -21,6 +44,6 @@ export default {
|
||||
return {
|
||||
}
|
||||
},
|
||||
props:['url']
|
||||
props:['url'],
|
||||
}
|
||||
</script>
|
||||
@@ -1,36 +1,39 @@
|
||||
<template>
|
||||
<view class="group">
|
||||
<view>
|
||||
<u-tabs-swiper ref="uTabs" :list="tabList" name="gc_name" :current="current" @change="tabsChange" :is-scroll="true" active-color="#FF780F" swiperWidth="750" height="88" :show-bar="false"></u-tabs-swiper>
|
||||
<!-- <u-tabs-swiper ref="uTabs" :list="tabList" name="gc_name" :current="current" @change="tabsChange" :is-scroll="true" active-color="#FF780F" swiperWidth="750" height="88" :show-bar="false"></u-tabs-swiper> -->
|
||||
<u-tabs :list="tabList" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="88" font-size="24" inactive-color="#333333"></u-tabs>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
||||
<swiper :current="swiperCurrent" @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">
|
||||
<SpecialGoods v-for="(item, index) in pinTuanList" :key="index" :item="item" type='group'></SpecialGoods>
|
||||
<!-- <loadmore ref="loadmore" @callback="getPinTuanList" bgColor="#FFF"></loadmore> -->
|
||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList.length"></u-empty>
|
||||
<scroll-view scroll-y style="width: 100%;" @scrolltolower="onreachBottom">
|
||||
<view v-if="pinTuanList[index]">
|
||||
<SpecialGoods v-for="(item, index) in pinTuanList[index]" :key="index" :item="item" type='group'></SpecialGoods>
|
||||
</view>
|
||||
<u-empty text="暂无商品" mode="list" color="#000" margin-top="120" v-if="!pinTuanList[index] || !pinTuanList[index].length"></u-empty>
|
||||
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="pinTuanList[index] && pinTuanList[index].length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import loadmore from "@/components/loadmore/index";
|
||||
import SpecialGoods from "../../components/shop/special-shop/index";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageSize: 6,
|
||||
tabList: [],
|
||||
current: -1,
|
||||
swiperCurrent: 0,
|
||||
page: 0,
|
||||
pinTuanList: [],
|
||||
swiperHeight: '',
|
||||
timer: '', // 限制下拉刷新
|
||||
timer: true, // 限制下拉刷新
|
||||
loadStatus: 'loadmore',
|
||||
}
|
||||
},
|
||||
components: {
|
||||
loadmore,
|
||||
SpecialGoods,
|
||||
},
|
||||
onLoad() {
|
||||
@@ -39,8 +42,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: {
|
||||
@@ -48,29 +50,51 @@ export default {
|
||||
async getGoodsClass() {
|
||||
return await this.$u.api.getGoodsClass().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.tabList = res.data;
|
||||
this.current = 0;
|
||||
this.tabList = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拼团列表
|
||||
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[this.current] = res.data;
|
||||
else if(load == 'loadmore') this.pinTuanList[this.current].push(...res.data);
|
||||
}
|
||||
this.$forceUpdate();
|
||||
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.current = index;
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
||||
transition(e) {
|
||||
let dx = e.detail.dx;
|
||||
this.$refs.uTabs.setDx(dx);
|
||||
},
|
||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
@@ -78,27 +102,9 @@ 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';
|
||||
this.swiperHeight = res.windowHeight - (res.windowWidth / 750) * 88 + 'px';
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
209
pageC/merchant/classifyGoods.vue
Normal file
@@ -0,0 +1,209 @@
|
||||
<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">
|
||||
<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 - (res.windowWidth / 750) * 90 + 'px';
|
||||
// console.log(this.scrollHeight);
|
||||
},
|
||||
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>
|
||||
@@ -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;
|
||||
|
||||
194
pageC/merchant/goods.vue
Normal file
@@ -0,0 +1,194 @@
|
||||
<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">
|
||||
<goodsItem :info="goods"></goodsItem>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-bottom="120" 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: 5,
|
||||
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 == 3 && this.current == 3) this.priceOrderAsc = !this.priceOrderAsc;
|
||||
this.current = current;
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
const otherHeight = 347 + 140 + 20 + 98;
|
||||
this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * otherHeight + 'px';
|
||||
// console.log(this.scrollHeight);
|
||||
},
|
||||
}
|
||||
};
|
||||
</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>
|
||||
@@ -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,70 @@
|
||||
<image></image>
|
||||
<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> -->
|
||||
<view class="top" :style="{'background':'url(' + info.store_banner + ') 100% 100% no-repeat' }">
|
||||
<view class="mantle"></view>
|
||||
<view class="main-container" :style="{ 'padding-top': paddingTop }">
|
||||
<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" @click="attentionMember">
|
||||
<image :src="info.is_attention == 0 ? '/static/image/shop/14.png' : '/static/image/shop/8.png'"></image>
|
||||
<view>{{ info.is_attention == 0 ? "关注" : "已关注" }}</view>
|
||||
</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">
|
||||
<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>
|
||||
<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" class="container-top">
|
||||
<videoTop :url="item.article_pic" v-if="item.type == 2" @click.native="toDetailsPage({ id: item.article_id, type: item.type })"></videoTop>
|
||||
<imageTop v-else :url="item.article_pic" @click.native="toDetailsPage({ id: item.article_id, type: item.type })"></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 v-if="indexlist.length" class="container-bottom">
|
||||
<listitem v-for="item in indexlist" :key="item.article_id" :type="item.type" :url="item.article_pic" class="bottom-item" @click.native="toDetailsPage({ id: item.article_id, type: item.type })"></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="customers()">
|
||||
<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,49 +84,163 @@ import listitem from "../components/merchant/list-item"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
sid: '',
|
||||
show: false,
|
||||
cur: 0,
|
||||
list:[],
|
||||
indexlist:[],
|
||||
indextop:[],
|
||||
info:{}
|
||||
list: [],
|
||||
indexlist: [],
|
||||
indextop: [],
|
||||
info: {},
|
||||
page: 1,
|
||||
scrollHeiht: '',
|
||||
paddingTop: 0,
|
||||
}
|
||||
},
|
||||
components:{
|
||||
item,
|
||||
goods,
|
||||
videoTop,
|
||||
imageTop,
|
||||
listitem
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getStoreInfo();
|
||||
this.getArticlelist();
|
||||
// this.getStoreImgVideoList();
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
console.log(e.index);
|
||||
if(e.index == 0) this.$u.route('/pageC/cart/index');
|
||||
// if(e.index == 0) this.show = true;
|
||||
},
|
||||
onNavigationBarSearchInputClicked() {
|
||||
this.$u.route('pageB/search/index', {
|
||||
type: 1,
|
||||
id:this.sid
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
uni.navigateTo({
|
||||
url: './details'
|
||||
});
|
||||
customers(){
|
||||
console.log(this.$store.state.hasLogin)
|
||||
if(!this.$store.state.hasLogin){
|
||||
this.$refs.uToast.show({
|
||||
title: "请先登录",
|
||||
type: 'warning'
|
||||
})
|
||||
}else{
|
||||
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
|
||||
this.uuid = uuid;
|
||||
this.name = name;
|
||||
this.avatar = avatar;
|
||||
this.online = false;
|
||||
this.unReadMessage = 0;
|
||||
this.text = text;
|
||||
this.time = time;
|
||||
this.date = date
|
||||
}
|
||||
// console.log(123)
|
||||
this.$u.api.getAtwillUserInfo({
|
||||
id:this.sid
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
let user = new Friend(res.data.member_id,res.data.store_name,res.data.member_avatar)
|
||||
this.$u.route({
|
||||
url:"/pageD/privateChat/privateChat",
|
||||
params:{
|
||||
id:JSON.stringify(user)
|
||||
}
|
||||
|
||||
})
|
||||
}).catch((err)=>{
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
toDetailsPage({ id, type }) {
|
||||
// console.log(11);
|
||||
let src = type == 1 ? 'pageB/photo/index' : 'pageB/video/video';
|
||||
this.$u.route(src, { id: id });
|
||||
},
|
||||
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 });
|
||||
}
|
||||
},
|
||||
getStoreInfo() {
|
||||
// console.log(this.sid )
|
||||
this.$u.api.getStoreInfo({ id: this.sid }).then((res)=>{
|
||||
// console.log(JSON.stringify(res))
|
||||
this.info = res.data;
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
// 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();
|
||||
// })
|
||||
// },
|
||||
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) {
|
||||
let articleList = res.data.list;
|
||||
// articleList.unshift({}, {}, {}, {});
|
||||
// articleList.push({}, {});
|
||||
if(JSON.stringify(res.data) != '[]') {
|
||||
if(articleList.length > 0) {
|
||||
this.indextop = [articleList[0]]
|
||||
// this.indextop = [res.data.list[0], res.data.list[1]];
|
||||
}
|
||||
if(articleList.length > 1) {
|
||||
this.indextop.push(articleList[1]);
|
||||
this.indexlist.push(...articleList.slice(2,));
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
this.scrollHeiht = res.windowHeight - res.windowWidth / 750 * (350 + 140 + 20) + 'px';
|
||||
this.paddingTop = res.windowWidth / 750 * (90 + 50) + 'px';
|
||||
// console.log(this.paddingTop);
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
|
||||
// console.log(res.data)
|
||||
this.list= res.data.list
|
||||
})
|
||||
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,)
|
||||
})
|
||||
this.$u.api.getStoreInfo({id:1}).then((res)=>{
|
||||
console.log(res)
|
||||
this.info = res.data
|
||||
})
|
||||
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));
|
||||
overflow: hidden;
|
||||
.top {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
@@ -131,53 +248,72 @@ export default {
|
||||
z-index: 9;
|
||||
width: 750rpx;
|
||||
height: 350rpx;
|
||||
background-color: #999999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 168rpx 60rpx 0 30rpx;
|
||||
> image {
|
||||
margin-right: 40rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
background-color: aqua;
|
||||
// background-color: #999999;
|
||||
.mantle {
|
||||
width: 750rpx;
|
||||
height: 350rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
background-color: #999999;
|
||||
opacity: 0.7;
|
||||
}
|
||||
.info {
|
||||
width: 220rpx;
|
||||
color: rgba(255,255,255,1);
|
||||
.name {
|
||||
margin-bottom: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.num {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
margin-left: auto;
|
||||
width: 162rpx;
|
||||
height: 60rpx;
|
||||
border: 2rpx solid rgba(255,255,255,1);
|
||||
border-radius: 30rpx;
|
||||
.main-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// padding-top: calc(var(--status-bar-height) + 54);
|
||||
padding: 0 60rpx 0 30rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 19;
|
||||
width: 750rpx;
|
||||
height: 350rpx;
|
||||
> image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
flex-shrink: 0;
|
||||
margin-right: 14rpx;
|
||||
background-color: aqua;
|
||||
margin-right: 40rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
// background-color: aqua;
|
||||
}
|
||||
> view {
|
||||
white-space: nowrap;
|
||||
font-size: 26rpx;
|
||||
.info {
|
||||
width: 220rpx;
|
||||
color: rgba(255,255,255,1);
|
||||
.name {
|
||||
margin-bottom: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.num {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
margin-left: auto;
|
||||
width: 162rpx;
|
||||
height: 60rpx;
|
||||
border: 2rpx solid rgba(255,255,255,1);
|
||||
border-radius: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
> image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
flex-shrink: 0;
|
||||
margin-right: 14rpx;
|
||||
}
|
||||
> view {
|
||||
white-space: nowrap;
|
||||
font-size: 26rpx;
|
||||
color: rgba(255,255,255,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.follow {
|
||||
height: 140rpx;
|
||||
background-color: #ffffff;
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
@@ -212,14 +348,14 @@ export default {
|
||||
margin-right: 35rpx;
|
||||
}
|
||||
text-align: center;
|
||||
width: 90rpx;
|
||||
width: 96rpx;
|
||||
> image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 20rpx;
|
||||
background-color: aqua;
|
||||
// background-color: aqua;
|
||||
}
|
||||
.nickname {
|
||||
font-size: 22rpx;
|
||||
@@ -230,13 +366,30 @@ export default {
|
||||
}
|
||||
}
|
||||
.main{
|
||||
padding-bottom: 98rpx;
|
||||
.video-image {
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
.container-top {
|
||||
> view {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
.container-bottom {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
.bottom-item {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.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 +404,6 @@ export default {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-bottom: 15rpx;
|
||||
background-color: aqua;
|
||||
}
|
||||
> view {
|
||||
font-size: 24rpx;
|
||||
@@ -259,12 +411,5 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.item{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
// margin-top: 20rpx;
|
||||
padding:25rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
88
pageC/merchant/storeClassify.vue
Normal 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>
|
||||
@@ -3,13 +3,13 @@
|
||||
<view class="title">
|
||||
<view class="name">全部秒杀</view>
|
||||
<view class="time">
|
||||
<text class="num">{{ seckillTime.littleHour }}</text>
|
||||
<text class="num">{{ seckillTime.littleHour || '00' }}</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text>-</text>
|
||||
<text class="num">{{ seckillTime.bigHour }}</text>
|
||||
<text class="num">{{ seckillTime.bigHour || '00' }}</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text class="mah">:</text>
|
||||
@@ -18,11 +18,12 @@
|
||||
</view>
|
||||
<view class="spike-list">
|
||||
<SpecialGoods v-for="(item, index) in spikeList" :key="index" :item="item" type='spike'></SpecialGoods>
|
||||
<u-empty mode="list" v-if="!spikeList.length" :margin-top="240"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import SpecialGoods from "../../components/shop/special-shop/index"
|
||||
import SpecialGoods from "@/components/shop/special-shop/index"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -41,6 +42,7 @@ export default {
|
||||
// 全部秒杀
|
||||
getSpikeList() {
|
||||
this.$u.api.getSpikeList({ page: this.page }).then(res => {
|
||||
console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.spikeList = res.data.list;
|
||||
this.seckillTime = {
|
||||
@@ -71,14 +73,22 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20rpx;
|
||||
> text {
|
||||
text-align: center;
|
||||
line-height: 26rpx;
|
||||
}
|
||||
.num{
|
||||
box-sizing: content-box;
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
background-color: #bfbfbf;
|
||||
// box-sizing: content-box;
|
||||
width: 26rpx;
|
||||
// height: 25rpx;
|
||||
background-color: #000;
|
||||
color: #ffffff;
|
||||
margin: 0 10rpx;
|
||||
padding: 2rpx;
|
||||
}
|
||||
.mah {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
<template>
|
||||
<view id="actives">
|
||||
<view id="actives" :style="{height : height + 'px'}">
|
||||
<!-- 活动消息推送 -->
|
||||
<view class="activity" v-for="(item, index) in actives" :key="index">
|
||||
<view class="times">{{item.type}}</view>
|
||||
<view class="content">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="images_about">
|
||||
<image :src="item.goods_image"></image>
|
||||
<view>
|
||||
<text>{{item.summary}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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.picture" mode="aspectFill"></image>
|
||||
<view>
|
||||
<text class="u-line-2">{{item.summary}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<u-loadmore :status="loadStatus" bg-color="#ECECEC" margin-top="20" v-if="loadStatus=='nomore'" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -20,23 +23,32 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
actives: [
|
||||
|
||||
]
|
||||
height:'600',
|
||||
actives: [],
|
||||
loadStatus: 'loadmore'
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
this.messageactivityList()
|
||||
var _that = this
|
||||
_that.messageactivityList();
|
||||
uni.getSystemInfo({
|
||||
success: function (res) {
|
||||
console.log(res.windowHeight);
|
||||
_that.height = res.windowHeight
|
||||
}
|
||||
});
|
||||
},
|
||||
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;
|
||||
// 目前没有分页,只无数据提示用,他们建议这样做
|
||||
if(!this.actives.length) this.loadStatus = 'nomore';
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -45,16 +57,23 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ECECEC;
|
||||
}
|
||||
uni-page-body{
|
||||
height: 100%;
|
||||
}
|
||||
#actives{
|
||||
background: #ECECEC;
|
||||
height: 100%;
|
||||
.time {
|
||||
padding: 30rpx 0;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.activity{
|
||||
|
||||
.times{
|
||||
width:100%;
|
||||
font-size:28rpx;
|
||||
@@ -64,16 +83,16 @@
|
||||
padding: 39rpx 0 30rpx;
|
||||
}
|
||||
.content{
|
||||
width:630rpx;
|
||||
width:94%;
|
||||
padding: 30rpx;
|
||||
background:rgba(255,255,255,1);
|
||||
border-radius:20rpx;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
image{
|
||||
width: 137rpx;
|
||||
flex-shrink: 0;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
float: left;
|
||||
}
|
||||
.title{
|
||||
font-size:30rpx;
|
||||
@@ -81,25 +100,18 @@
|
||||
padding: 0rpx 0 19rpx;
|
||||
}
|
||||
.images_about{
|
||||
overflow: hidden;
|
||||
text{
|
||||
display: table-cell;
|
||||
display: flex;
|
||||
& > view{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
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;
|
||||
height:140rpx;
|
||||
background:rgba(241,241,241,1);
|
||||
padding: 20rpx;
|
||||
background: rgba(241,241,241,1);
|
||||
& > text {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
<template>
|
||||
<view class="attention">
|
||||
<view class="attention_box" v-for="(item,index) in attention" :key="index">
|
||||
<view>
|
||||
<image :src="item.url"></image>
|
||||
<view class="attention_box" v-for="(item,index) in attention" :key="index" @click="navto(item.friend_tomid)">
|
||||
<view style="position:relative">
|
||||
<image :src="item.friend_tomavatar" mode="aspectFill"></image>
|
||||
<view class="tishi" v-if="item.unread_message"></view>
|
||||
</view>
|
||||
<view>{{item.name}}</view>
|
||||
<view>状态:{{item.type}}</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>{{item.friend_tomname}}</view>
|
||||
<view>{{item.live_status ? '正在直播' : '未直播'}}</view>
|
||||
<view class="cur_two" @click="tapClick(index)">已关注</view>
|
||||
<!-- <view class="cur" @click="tapClick(index)" v-else = "item.about == 2">未关注</view> -->
|
||||
</view>
|
||||
<u-loadmore :status="status" icon-type="iconType"/>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -19,42 +22,27 @@
|
||||
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: [],
|
||||
page:1,
|
||||
status:'loadmore'
|
||||
};
|
||||
},
|
||||
onReachBottom(){
|
||||
if(this.status == 'loading' || this.status == 'nomore'){
|
||||
return ;
|
||||
}else{
|
||||
this.status = "loading"
|
||||
this.page++
|
||||
this.snsfriendList()
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.snsfriendList()
|
||||
},
|
||||
onShow(){
|
||||
this.page = 1;
|
||||
this.snsfriendList();
|
||||
},
|
||||
methods: {
|
||||
// 点击切换颜色
|
||||
tapClick(index) {
|
||||
@@ -64,13 +52,29 @@
|
||||
this.rSelect.push(index); //选中添加到数组里
|
||||
} else {
|
||||
this.rSelect.splice(this.rSelect.indexOf(index), 1); //取消
|
||||
|
||||
}
|
||||
},
|
||||
snsfriendList(){
|
||||
this.$u.api.snsfriendList({}).then((res)=>{
|
||||
this.$u.api.snsfriendList({page:this.page}).then((res)=>{
|
||||
console.log(res)
|
||||
// this.attention = res.data
|
||||
if(this.page > 1){
|
||||
this.attention.push(...res.data.data)
|
||||
}else{
|
||||
this.attention = res.data.data;
|
||||
}
|
||||
this.status = "loadmore"
|
||||
if(res.data.data.length < parseInt(res.data.per_page)){
|
||||
this.status = "nomore"
|
||||
}
|
||||
})
|
||||
},
|
||||
navto(id){
|
||||
// /pageB/details/index
|
||||
this.$u.route({
|
||||
url:"/pageB/details/index",
|
||||
params:{
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -81,6 +85,15 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tishi{
|
||||
position: absolute;
|
||||
top: 5rpx;
|
||||
left: 80rpx;
|
||||
background-color: #ff5d00;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.attention {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -102,7 +115,7 @@
|
||||
view image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
display: block;
|
||||
border-radius: 50%;
|
||||
margin: 24rpx auto 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,544 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="content-box" @touchstart="touchstart" id="content-box" :class="{'content-showfn':showFunBtn}">
|
||||
<!-- 背景图- 定位方式 -->
|
||||
<image class="content-box-bg" :src="_user_info.chatBgImg" :style="{ height: imgHeight }"></image>
|
||||
<view class="content-box-loading" v-if="!loading"><u-loading mode="flower"></u-loading></view>
|
||||
<view class="message" v-for="(item, index) in messageList" :key="index" :id="`msg-${item.hasBeenSentId}`">
|
||||
<view class="message-item " :class="item.isItMe ? 'right' : 'left'">
|
||||
<image class="img" :src="item.fromUserHeadImg" mode="" @tap="linkToBusinessCard(item.fromUserId)"></image>
|
||||
<!-- contentType = 1 文本 -->
|
||||
<view class="content" v-if="item.contentType == 1">{{ item.content }}</view>
|
||||
<!-- contentType = 2 语音 -->
|
||||
<view
|
||||
class="content contentType2"
|
||||
:class="[{ 'content-type-right': item.isItMe }]"
|
||||
v-if="item.contentType == 2"
|
||||
@tap="handleAudio(item)"
|
||||
hover-class="contentType2-hover-class"
|
||||
:style="{width:`${130+(item.contentDuration*2)}rpx`}"
|
||||
>
|
||||
<view
|
||||
class="voice_icon"
|
||||
:class="[
|
||||
{ voice_icon_right: item.isItMe },
|
||||
{ voice_icon_left: !item.isItMe },
|
||||
{ voice_icon_right_an: item.anmitionPlay && item.isItMe },
|
||||
{ voice_icon_left_an: item.anmitionPlay && !item.isItMe }
|
||||
]"
|
||||
></view>
|
||||
<view class="">{{ item.contentDuration }}''</view>
|
||||
</view>
|
||||
<!-- contentType = 3 图片 -->
|
||||
<view
|
||||
class="content contentType3"
|
||||
v-if="item.contentType == 3"
|
||||
@tap="viewImg([item.content])"
|
||||
>
|
||||
<image :src="item.content" class="img" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部聊天输入框 -->
|
||||
<view class="input-box" :class="{ 'input-box-mpInputMargin': mpInputMargin }">
|
||||
<view class="input-box-flex">
|
||||
<!-- #ifndef H5 -->
|
||||
<image v-if="chatType === 'voice'" class="icon_img" :src="require('@/static/pageD/voice.png')" @click="switchChatType('keyboard')"></image>
|
||||
<image v-if="chatType === 'keyboard'" class="icon_img" :src="require('@/static/pageD/keyboard.png')" @click="switchChatType('voice')"></image>
|
||||
<!-- #endif -->
|
||||
<view class="input-box-flex-grow">
|
||||
<input
|
||||
v-if="chatType === 'voice'"
|
||||
type="text"
|
||||
class="content"
|
||||
id="input"
|
||||
v-model="formData.content"
|
||||
:hold-keyboard="true"
|
||||
:confirm-type="'send'"
|
||||
:confirm-hold="true"
|
||||
placeholder-style="color:#DDDDDD;"
|
||||
:cursor-spacing="10"
|
||||
@confirm="sendMsg(null)"
|
||||
/>
|
||||
<view
|
||||
class="voice_title"
|
||||
v-if="chatType === 'keyboard'"
|
||||
:style="{ background: recording ? '#c7c6c6' : '#FFFFFF' }"
|
||||
@touchstart.stop.prevent="startVoice"
|
||||
@touchmove.stop.prevent="moveVoice"
|
||||
@touchend.stop="endVoice"
|
||||
@touchcancel.stop="cancelVoice"
|
||||
>
|
||||
{{ voiceTitle }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能性按钮 -->
|
||||
<image class=" icon_btn_add" :src="require('@/static/pageD/add.png')" @tap="switchFun"></image>
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<button class="btn" type="primary" size="mini" @touchend.prevent="sendMsg(null)">发送</button>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<view class="fun-box" :class="{'show-fun-box':showFunBtn}">
|
||||
<u-grid :col="4" hover-class="contentType2-hover-class" :border="false" @click="clickGrid">
|
||||
<u-grid-item v-for="(item, index) in funList" :index="index" :key="index" bg-color="#eaeaea">
|
||||
<u-icon :name="item.icon" :size="52"></u-icon>
|
||||
<view class="grid-text">{{ item.title }}</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- //语音动画 -->
|
||||
<view class="voice_an" v-if="recording">
|
||||
<view class="voice_an_icon">
|
||||
<view id="one" class="wave"></view>
|
||||
<view id="two" class="wave"></view>
|
||||
<view id="three" class="wave"></view>
|
||||
<view id="four" class="wave"></view>
|
||||
<view id="five" class="wave"></view>
|
||||
<view id="six" class="wave"></view>
|
||||
<view id="seven" class="wave"></view>
|
||||
</view>
|
||||
<view class="text">{{voiceIconText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fromUserInfo: {},
|
||||
formData: {
|
||||
content: '',
|
||||
limit: 15,
|
||||
index: 1
|
||||
},
|
||||
messageList: [],
|
||||
loading: true, //标识是否正在获取数据
|
||||
imgHeight: '1000px',
|
||||
mpInputMargin: false, //适配微信小程序 底部输入框高度被顶起的问题
|
||||
chatType:"voice", // 图标类型 'voice'语音 'keyboard'键盘
|
||||
voiceTitle: '按住 说话',
|
||||
Recorder: uni.getRecorderManager(),
|
||||
Audio: uni.createInnerAudioContext(),
|
||||
recording: false, //标识是否正在录音
|
||||
isStopVoice: false, //加锁 防止点击过快引起的当录音正在准备(还没有开始录音)的时候,却调用了stop方法但并不能阻止录音的问题
|
||||
voiceInterval:null,
|
||||
voiceTime:0, //总共录音时长
|
||||
canSend:true, //是否可以发送
|
||||
PointY:0, //坐标位置
|
||||
voiceIconText:"正在录音...",
|
||||
showFunBtn:false, //是否展示功能型按钮
|
||||
AudioExam:null, //正在播放音频的实例
|
||||
funList: [
|
||||
{ icon:"photo-fill",title:"照片",uploadType:["album"] },
|
||||
{ icon:"camera-fill",title:"拍摄",uploadType:["camera"] },
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//拼接消息 处理滚动
|
||||
async joinData() {
|
||||
if (!this.loading) {
|
||||
//如果没有获取数据 即loading为false时,return 避免用户重复上拉触发加载
|
||||
return;
|
||||
}
|
||||
this.loading = false;
|
||||
const data = await this.getMessageData();
|
||||
//获取节点信息
|
||||
const { index } = this.formData;
|
||||
const sel = `#msg-${index > 1 ? this.messageList[0].hasBeenSentId : data[data.length - 1].hasBeenSentId}`;
|
||||
this.messageList = [...data, ...this.messageList];
|
||||
//填充数据后,视图会自动滚动到最上面一层然后瞬间再跳回bindScroll的指定位置 ---体验不是很好,后期优化
|
||||
this.$nextTick(() => {
|
||||
this.bindScroll(sel);
|
||||
//如果还有数据
|
||||
if (this.formData.limit >= data.length) {
|
||||
this.formData.index++;
|
||||
setTimeout(() => {
|
||||
this.loading = true;
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
},
|
||||
//处理滚动
|
||||
bindScroll(sel, duration = 0) {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query
|
||||
.select(sel)
|
||||
.boundingClientRect(data => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: data && data.top - 40,
|
||||
duration
|
||||
});
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
//获取消息
|
||||
getMessageData() {
|
||||
let getData = () => {
|
||||
let arr = [];
|
||||
let startIndex = (this.formData.index - 1) * this.formData.limit;
|
||||
let endIndex = startIndex + this.formData.limit;
|
||||
for (let i = startIndex; i < endIndex; i++) {
|
||||
const isItMe = Math.random() > 0.5 ? true : false;
|
||||
arr.unshift({
|
||||
hasBeenSentId: i, //已发送过去消息的id
|
||||
content: `很高兴认识你,这是第${i + 1}条消息。`,
|
||||
fromUserHeadImg: isItMe ? this._user_info.headImg : this.fromUserInfo.fromUserHeadImg, //用户头像
|
||||
fromUserId: isItMe ? this._user_info.id : this.fromUserInfo.fromUserId,
|
||||
isItMe, //true此条信息是我发送的 false别人发送的
|
||||
createTime: Date.now(),
|
||||
contentType: 1, // 1文字文本 2语音
|
||||
anmitionPlay: false //标识音频是否在播放
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
const data = getData();
|
||||
setTimeout(() => {
|
||||
resolve(data);
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
//切换语音或者键盘方式
|
||||
switchChatType(type) {
|
||||
this.chatType = type;
|
||||
this.showFunBtn =false;
|
||||
},
|
||||
//切换功能性按钮
|
||||
switchFun(){
|
||||
this.chatType = 'keyboard'
|
||||
this.showFunBtn = !this.showFunBtn;
|
||||
uni.hideKeyboard()
|
||||
},
|
||||
//发送消息
|
||||
sendMsg(data) {
|
||||
const params = {
|
||||
hasBeenSentId: Date.now(), //已发送过去消息的id
|
||||
content: this.formData.content,
|
||||
fromUserHeadImg: this._user_info.headImg, //用户头像
|
||||
fromUserId: this._user_info.id,
|
||||
isItMe: true, //true此条信息是我发送的 false别人发送的
|
||||
createTime: Date.now(),
|
||||
contentType: 1
|
||||
};
|
||||
|
||||
if (data) {
|
||||
if(data.contentType == 2){
|
||||
//说明是发送语音
|
||||
params.content = data.content;
|
||||
params.contentType = data.contentType;
|
||||
params.contentDuration = data.contentDuration;
|
||||
params.anmitionPlay = false;
|
||||
}else if(data.contentType == 3){
|
||||
//发送图片
|
||||
params.content = data.content;
|
||||
params.contentType = data.contentType;
|
||||
}
|
||||
} else if (!this.$u.trim(this.formData.content)) {
|
||||
//验证输入框书否为空字符传
|
||||
return;
|
||||
}
|
||||
|
||||
this.messageList.push(params);
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.formData.content = '';
|
||||
// #ifdef MP-WEIXIN
|
||||
if(params.contentType == 1){
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 99999,
|
||||
duration: 0, //小程序如果有滚动效果 input的焦点也会随着页面滚动...
|
||||
});
|
||||
}else{
|
||||
setTimeout(()=>{
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 99999,
|
||||
duration: 0, //小程序如果有滚动效果 input的焦点也会随着页面滚动...
|
||||
});
|
||||
},150)
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 99999,
|
||||
duration: 100
|
||||
});
|
||||
// #endif
|
||||
|
||||
if(this.showFunBtn){
|
||||
this.showFunBtn = false;
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (params.contentType == 1) {
|
||||
this.mpInputMargin = true;
|
||||
}
|
||||
// #endif
|
||||
//h5浏览器并没有很好的办法控制键盘一直处于唤起状态 而且会有样式性的问题
|
||||
// #ifdef H5
|
||||
uni.hideKeyboard();
|
||||
// #endif
|
||||
});
|
||||
},
|
||||
//用户触摸屏幕的时候隐藏键盘
|
||||
touchstart() {
|
||||
uni.hideKeyboard();
|
||||
},
|
||||
// userid 用户id
|
||||
linkToBusinessCard(userId) {
|
||||
this.$u.route({
|
||||
url: 'pages/businessCard/businessCard',
|
||||
params: {
|
||||
userId
|
||||
}
|
||||
});
|
||||
},
|
||||
//准备开始录音
|
||||
startVoice(e) {
|
||||
if(!this.Audio.paused){
|
||||
//如果音频正在播放 先暂停。
|
||||
this.stopAudio(this.AudioExam)
|
||||
}
|
||||
this.recording = true;
|
||||
this.isStopVoice = false;
|
||||
this.canSend = true;
|
||||
this.voiceIconText = "正在录音..."
|
||||
this.PointY = e.touches[0].clientY;
|
||||
this.Recorder.start({
|
||||
format: 'mp3'
|
||||
});
|
||||
},
|
||||
//录音已经开始
|
||||
beginVoice(){
|
||||
if (this.isStopVoice) {
|
||||
this.Recorder.stop();
|
||||
return;
|
||||
}
|
||||
this.voiceTitle = '松开 结束'
|
||||
this.voiceInterval = setInterval(()=>{
|
||||
this.voiceTime ++;
|
||||
},1000)
|
||||
},
|
||||
//move 正在录音中
|
||||
moveVoice(e){
|
||||
const PointY = e.touches[0].clientY
|
||||
const slideY = this.PointY - PointY;
|
||||
if(slideY > uni.upx2px(120)){
|
||||
this.canSend = false;
|
||||
this.voiceIconText = '松开手指 取消发送 '
|
||||
}else if(slideY > uni.upx2px(60)){
|
||||
this.canSend = true;
|
||||
this.voiceIconText = '手指上滑 取消发送 '
|
||||
}else{
|
||||
this.voiceIconText = '正在录音... '
|
||||
}
|
||||
},
|
||||
//结束录音
|
||||
endVoice() {
|
||||
this.isStopVoice = true; //加锁 确保已经结束录音并不会录制
|
||||
this.Recorder.stop();
|
||||
this.voiceTitle = '按住 说话'
|
||||
},
|
||||
//录音被打断
|
||||
cancelVoice(e){
|
||||
this.voiceTime = 0;
|
||||
this.voiceTitle = '按住 说话';
|
||||
this.canSend = false;
|
||||
this.Recorder.stop();
|
||||
},
|
||||
//处理录音文件
|
||||
handleRecorder({ tempFilePath,duration }) {
|
||||
let contentDuration;
|
||||
// #ifdef MP-WEIXIN
|
||||
this.voiceTime = 0;
|
||||
if (duration < 600) {
|
||||
this.voiceIconText="说话时间过短";
|
||||
setTimeout(()=>{
|
||||
this.recording = false;
|
||||
},200)
|
||||
return;
|
||||
}
|
||||
contentDuration = duration/1000;
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
contentDuration = this.voiceTime +1;
|
||||
this.voiceTime = 0;
|
||||
if(contentDuration <= 0) {
|
||||
this.voiceIconText="说话时间过短";
|
||||
setTimeout(()=>{
|
||||
this.recording = false;
|
||||
},200)
|
||||
return;
|
||||
};
|
||||
// #endif
|
||||
|
||||
this.recording = false;
|
||||
const params = {
|
||||
contentType: 2,
|
||||
content: tempFilePath,
|
||||
contentDuration: Math.ceil(contentDuration)
|
||||
};
|
||||
this.canSend && this.sendMsg(params);
|
||||
},
|
||||
//控制播放还是暂停音频文件
|
||||
handleAudio(item) {
|
||||
this.AudioExam = item;
|
||||
this.Audio.paused ? this.playAudio(item) : this.stopAudio(item);
|
||||
},
|
||||
//播放音频
|
||||
playAudio(item) {
|
||||
this.Audio.src = item.content;
|
||||
this.Audio.hasBeenSentId = item.hasBeenSentId;
|
||||
this.Audio.play();
|
||||
item.anmitionPlay = true;
|
||||
},
|
||||
//停止音频
|
||||
stopAudio(item) {
|
||||
item.anmitionPlay = false;
|
||||
this.Audio.src = '';
|
||||
this.Audio.stop();
|
||||
},
|
||||
//关闭动画
|
||||
closeAnmition() {
|
||||
const hasBeenSentId = this.Audio.hasBeenSentId;
|
||||
const item = this.messageList.find(it => it.hasBeenSentId == hasBeenSentId);
|
||||
item.anmitionPlay = false;
|
||||
},
|
||||
//点击宫格时触发
|
||||
clickGrid(index){
|
||||
if(index == 0){
|
||||
this.chooseImage(['album'])
|
||||
}else if(index == 1){
|
||||
this.chooseImage(['camera'])
|
||||
}
|
||||
},
|
||||
//发送图片
|
||||
chooseImage(sourceType){
|
||||
uni.chooseImage({
|
||||
sourceType,
|
||||
sizeType:['compressed'],
|
||||
success:res=>{
|
||||
this.showFunBtn = false;
|
||||
for(let i = 0;i<res.tempFilePaths.length;i++){
|
||||
const params = {
|
||||
contentType: 3,
|
||||
content: res.tempFilePaths[i],
|
||||
};
|
||||
this.sendMsg(params)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//查看大图
|
||||
viewImg(imgList){
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
// #ifndef MP-WEIXIN
|
||||
indicator: 'number'
|
||||
// #endif
|
||||
});
|
||||
},
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop < 50) {
|
||||
this.joinData();
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap({ index }) {
|
||||
if (index == 0) {
|
||||
//用户详情 设置
|
||||
} else if (index == 1) {
|
||||
//返回按钮
|
||||
this.$u.route({
|
||||
type: 'switchTab',
|
||||
url: 'pages/home/home'
|
||||
});
|
||||
}
|
||||
},
|
||||
//返回按钮事件
|
||||
onBackPress(e) {
|
||||
//以下内容对h5不生效
|
||||
//--所以如果用浏览器自带的返回按钮进行返回的时候页面不会重定向 正在寻找合适的解决方案
|
||||
this.$u.route({
|
||||
type: 'switchTab',
|
||||
url: 'pages/home/home'
|
||||
});
|
||||
return true;
|
||||
},
|
||||
onLoad(info) {
|
||||
// { messageId,fromUserName,fromUserHeadImg } = info
|
||||
const userInfo = this.firendList.filter(item => item.userId == info.fromUserId)[0];
|
||||
console.log(userInfo)
|
||||
this.fromUserInfo = {
|
||||
fromUserName: userInfo.userName,
|
||||
fromUserHeadImg: userInfo.headImg,
|
||||
fromUserId: 4,
|
||||
messageId: 2
|
||||
};
|
||||
|
||||
//录音开始事件
|
||||
this.Recorder.onStart(e => {
|
||||
|
||||
this.beginVoice();
|
||||
});
|
||||
//录音结束事件
|
||||
this.Recorder.onStop(res => {
|
||||
clearInterval(this.voiceInterval);
|
||||
this.handleRecorder(res);
|
||||
});
|
||||
|
||||
//音频停止事件
|
||||
this.Audio.onStop(e => {
|
||||
this.closeAnmition();
|
||||
});
|
||||
|
||||
//音频播放结束事件
|
||||
this.Audio.onEnded(e => {
|
||||
this.closeAnmition();
|
||||
});
|
||||
},
|
||||
onReady() {
|
||||
//自定义返回按钮 因为原生的返回按钮不可阻止默认事件
|
||||
// #ifdef H5
|
||||
const icon = document.getElementsByClassName('uni-page-head-btn')[0];
|
||||
icon.style.display = 'none';
|
||||
// #endif
|
||||
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.fromUserInfo.fromUserName
|
||||
});
|
||||
this.joinData();
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
this.imgHeight = res.windowHeight + 'px';
|
||||
}
|
||||
});
|
||||
|
||||
uni.onKeyboardHeightChange(res => {
|
||||
if (res.height == 0) {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.mpInputMargin = false;
|
||||
// #endif
|
||||
}else{
|
||||
this.showFunBtn = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss'
|
||||
</style>
|
||||
@@ -1,354 +0,0 @@
|
||||
page {
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
.content {
|
||||
&-showfn{
|
||||
padding-bottom: 0rpx;
|
||||
padding-bottom: calc(420rpx + constant(safe-area-inset-bottom));
|
||||
padding-bottom: calc(420rpx + env(safe-area-inset-bottom) );
|
||||
/* #ifdef MP-WEIXIN */
|
||||
/* #endif */
|
||||
}
|
||||
&-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
min-height: calc(100vh - env(safe-area-inset-top) - 200rpx);
|
||||
box-sizing: content-box;
|
||||
position: relative;
|
||||
padding-bottom: 120rpx;
|
||||
|
||||
/* #ifdef APP-PLUS */
|
||||
margin-bottom: 0rpx;
|
||||
margin-bottom: constant(safe-area-inset-bottom);
|
||||
margin-bottom: env(safe-area-inset-bottom);
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
padding-bottom: 0rpx;
|
||||
padding-bottom: calc(120rpx + constant(safe-area-inset-bottom));
|
||||
padding-bottom: calc(120rpx + env(safe-area-inset-bottom) );
|
||||
/* #endif */
|
||||
|
||||
&-bg {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
bottom: 0;
|
||||
bottom: constant(safe-area-inset-bottom);
|
||||
bottom: env(safe-area-inset-bottom);
|
||||
/* #endif */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
&-loading {
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.message {
|
||||
padding: 13rpx 20rpx;
|
||||
}
|
||||
|
||||
.message-item {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
|
||||
.img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
max-width: 500rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
// 语音
|
||||
.contentType2 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
.voice_icon {
|
||||
height: 34rpx;
|
||||
width: 34rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
.voice_icon_right {
|
||||
background-image: url(../../static/voice-left-3.png);
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.voice_icon_left {
|
||||
background-image: url(../../static/voice-right-3.png);
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.voice_icon_right_an {
|
||||
animation: voiceAn_right 1s linear alternate infinite;
|
||||
}
|
||||
.voice_icon_left_an {
|
||||
animation: voiceAn_left 1s linear alternate infinite;
|
||||
}
|
||||
@keyframes voiceAn_right {
|
||||
0% {
|
||||
background-image: url(../../static/voice-left-1.png);
|
||||
}
|
||||
50% {
|
||||
background-image: url(../../static/voice-left-2.png);
|
||||
}
|
||||
100% {
|
||||
background-image: url(../../static/voice-left-3.png);
|
||||
}
|
||||
}
|
||||
@keyframes voiceAn_left {
|
||||
0% {
|
||||
background-image: url(../../static/voice-right-1.png);
|
||||
}
|
||||
50% {
|
||||
background-image: url(../../static/voice-right-2.png);
|
||||
}
|
||||
100% {
|
||||
background-image: url(../../static/voice-right-3.png);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//图片
|
||||
.contentType3{
|
||||
padding: 0;
|
||||
border-radius: 2rpx;
|
||||
background-color: transparent !important;
|
||||
.img{
|
||||
width: 200rpx;
|
||||
height: auto;
|
||||
max-width: 300rpx;
|
||||
max-height: 400rpx;
|
||||
}
|
||||
}
|
||||
.contentType3::after{
|
||||
border: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
.content-type-right {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
&.right {
|
||||
flex-direction: row-reverse;
|
||||
|
||||
.content {
|
||||
background-color: $uni-color-success;
|
||||
margin-right: 28rpx;
|
||||
word-break: break-all;
|
||||
line-height: 36rpx;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 10rpx solid transparent;
|
||||
border-bottom: 10rpx solid transparent;
|
||||
border-left: 16rpx solid $uni-color-success;
|
||||
position: absolute;
|
||||
right: -16rpx;
|
||||
top: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.left {
|
||||
.content {
|
||||
background-color: $uni-text-color-inverse;
|
||||
margin-left: 28rpx;
|
||||
word-break: break-all;
|
||||
line-height: 36rpx;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 10rpx solid transparent;
|
||||
border-bottom: 10rpx solid transparent;
|
||||
border-right: 16rpx solid $uni-text-color-inverse;
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input-box {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: content-box;
|
||||
z-index: 999;
|
||||
background-color: #eaeaea;
|
||||
|
||||
/* #ifdef APP-PLUS */
|
||||
margin-bottom: 0rpx;
|
||||
margin-bottom: constant(safe-area-inset-bottom);
|
||||
margin-bottom: env(safe-area-inset-bottom);
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
padding-bottom: 0rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/* #endif */
|
||||
|
||||
&-flex {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
image{
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
.icon_img {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.icon_btn_add{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
&-grow {
|
||||
flex-grow: 1;
|
||||
|
||||
.content {
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
caret-color: $uni-color-success;
|
||||
}
|
||||
|
||||
.voice_title {
|
||||
text-align: center;
|
||||
background-color: #ffffff;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-left: 20rpx;
|
||||
background-color: $u-type-success;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.fun-box{
|
||||
opacity: 0;
|
||||
transition: all 0.1s ease-in-out;
|
||||
height: 0;
|
||||
.grid-text{
|
||||
padding-top: 10rpx;
|
||||
color: $uni-text-color-grey;
|
||||
}
|
||||
|
||||
}
|
||||
.show-fun-box{
|
||||
opacity: 1;
|
||||
height: 300rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.input-box-mpInputMargin {
|
||||
/* #ifdef MP-WEIXIN */
|
||||
padding-bottom: 0rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.voice_an{
|
||||
width: 300rpx;
|
||||
height: 300rpx;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-55%);
|
||||
background-color: rgba(41,41,41,0.7);
|
||||
color: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
.text{
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
@keyframes runVoice{
|
||||
0%{
|
||||
height: 10%;
|
||||
}
|
||||
20%{
|
||||
height: 50%;
|
||||
}
|
||||
50%{
|
||||
height: 100%;
|
||||
}
|
||||
80%{
|
||||
height: 50%;
|
||||
}
|
||||
100%{
|
||||
height: 0%;
|
||||
}
|
||||
}
|
||||
.wave{
|
||||
width:6rpx;
|
||||
height: 100%;
|
||||
margin-left: 10rpx;
|
||||
border-radius: 50rpx;
|
||||
background-color: #999;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
}
|
||||
.voice_an_icon{
|
||||
width: 200rpx;
|
||||
height: 100rpx;
|
||||
line-height: 50rpx;
|
||||
margin: 50rpx 0;
|
||||
}
|
||||
.voice_an_icon #one{
|
||||
animation:runVoice 0.6s infinite 0.1s;
|
||||
}
|
||||
.voice_an_icon #two{
|
||||
animation:runVoice 0.6s infinite 0.3s;
|
||||
}
|
||||
.voice_an_icon #three{
|
||||
animation:runVoice 0.6s infinite 0.6s;
|
||||
}
|
||||
.voice_an_icon #four{
|
||||
animation:runVoice 0.6s infinite 0.1s;
|
||||
}
|
||||
.voice_an_icon #five{
|
||||
animation:runVoice 0.6s infinite 0.3s;
|
||||
}
|
||||
.voice_an_icon #six{
|
||||
animation:runVoice 0.6s infinite 0.6s;
|
||||
}
|
||||
.voice_an_icon #seven{
|
||||
animation:runVoice 0.6s infinite 0.1s;
|
||||
}
|
||||
}
|
||||
}
|
||||
63
pageD/components/GoEasyAudioPlayer/GoEasyAudioPlayer.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div class="goeasy-audio-player" @click="playAudio">
|
||||
<div class="audio-facade" :style="{width:Math.ceil(duration)*7 + 50 + 'px'}">
|
||||
<div class="audio-facade-bg" :class="{'play-icon':play}"> </div>
|
||||
<div>{{Math.ceil(duration) || 0}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const innerAudioContext = uni.createInnerAudioContext();
|
||||
export default {
|
||||
name: "GoEasyAudioPlayer",
|
||||
props : ['src', 'duration'],
|
||||
data () {
|
||||
return {
|
||||
play : false
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
playAudio () {
|
||||
this.play = true;
|
||||
innerAudioContext.src = this.src;
|
||||
innerAudioContext.play();
|
||||
setTimeout(() => {
|
||||
this.play = false;
|
||||
}, this.duration*1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.goeasy-audio-player{
|
||||
margin-top: 12rpx;
|
||||
-webkit-tap-highlight-color:rgba(0,0,0,0);
|
||||
}
|
||||
.audio-facade{
|
||||
min-width: 20rpx;
|
||||
padding: 6rpx 10rpx;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
background: #FF780F;
|
||||
font-size: 24rpx;
|
||||
border-radius: 14rpx;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
.audio-facade-bg{
|
||||
background: url("./images/voice.png") no-repeat center;
|
||||
background-size: 30rpx;
|
||||
width: 40rpx;
|
||||
}
|
||||
.audio-facade-bg.play-icon{
|
||||
background: url("./images/play.gif") no-repeat center;
|
||||
background-size: 30rpx;
|
||||
-moz-transform:rotate(180deg);
|
||||
-webkit-transform:rotate(180deg);
|
||||
-o-transform:rotate(180deg);
|
||||
transform:rotate(180deg);
|
||||
}
|
||||
</style>
|
||||
BIN
pageD/components/GoEasyAudioPlayer/images/play.gif
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
pageD/components/GoEasyAudioPlayer/images/voice.png
Normal file
|
After Width: | Height: | Size: 300 B |
55
pageD/components/GoEasyVideoPlayer/GoEasyVideoPlayer.vue
Normal 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>
|
||||
BIN
pageD/components/GoEasyVideoPlayer/images/play.png
Normal file
|
After Width: | Height: | Size: 560 B |
BIN
pageD/images/Arrow-Left.png
Normal file
|
After Width: | Height: | Size: 222 B |
BIN
pageD/images/Avatar-1.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
pageD/images/Avatar-2.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
pageD/images/Avatar-3.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
pageD/images/Avatar-4.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
pageD/images/GoEasyDemo-Vue-IM-Chat-gif.gif
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
pageD/images/Vector.png
Normal file
|
After Width: | Height: | Size: 714 B |
BIN
pageD/images/file-content.png
Normal file
|
After Width: | Height: | Size: 808 B |
BIN
pageD/images/file-icon.png
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
pageD/images/file.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
pageD/images/green-dot.png
Normal file
|
After Width: | Height: | Size: 373 B |