From ef797181908bea442b9201a49ccdb91ea33689fb Mon Sep 17 00:00:00 2001
From: Gdpao <1341331954@qq.com>
Date: Tue, 11 Aug 2020 22:15:58 +0800
Subject: [PATCH] gdpaoup
---
App.vue | 1 +
common/http.interceptor.js | 42 ++--
components/shop/list/index.vue | 2 +-
pageB/components/userinfo/index.vue | 40 ++--
pageB/details/index.vue | 4 +-
pageB/photo/index.vue | 3 +-
pageB/video/video.nvue | 344 +++++++++++++++++++++-------
pages.json | 8 +-
pages/index/index.vue | 66 ++++--
static/image/userinfo/follow.png | Bin 0 -> 1306 bytes
static/image/userinfo/followed.png | Bin 0 -> 1510 bytes
11 files changed, 376 insertions(+), 134 deletions(-)
create mode 100644 static/image/userinfo/follow.png
create mode 100644 static/image/userinfo/followed.png
diff --git a/App.vue b/App.vue
index 4ad52c3..e15be00 100644
--- a/App.vue
+++ b/App.vue
@@ -41,6 +41,7 @@
@import "/static/css/normalize";
/* 顶部自定义导航留白 */
.status_bar {
+ z-index: 1000;
width: 100%;
height: var(--status-bar-height);
}
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index f1a4095..df8471e 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -47,24 +47,30 @@ const install = (Vue, vm) => {
// 假设201为token失效,这里跳转登录
// vm.$u.toast('您还没有登录哦,请先去登录!');
if (res.data.data.action != "memberinfo") {
- uni.showModal({
- title: "温馨提示",
- content: "您还未登录,请立即登录",
- cancelText: "以后再说",
- confirmText: "立即登录",
- confirmColor: "#FF780F",
- success(res) {
- // console.log(res);
- if (res.confirm) {
- setTimeout(() => {
- // 此为uView的方法,详见路由相关文档
- vm.$u.route('/pageA/login/login')
- }, 500)
- }
- if (res.cancel) {
- }
- }
- })
+ 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) {
diff --git a/components/shop/list/index.vue b/components/shop/list/index.vue
index a9fcf49..f731bd1 100644
--- a/components/shop/list/index.vue
+++ b/components/shop/list/index.vue
@@ -14,7 +14,7 @@
-
+
diff --git a/pageB/details/index.vue b/pageB/details/index.vue
index bea3575..08c9a84 100644
--- a/pageB/details/index.vue
+++ b/pageB/details/index.vue
@@ -19,7 +19,7 @@
- 暂无数据
+ 暂无数据
@@ -74,7 +74,7 @@ export default {
userInfo: {}, // 用户信息
listInfo: [], // 列表详情
member_id: 0,
- page: 0,
+ page: 1,
}
},
onLoad(option) {
diff --git a/pageB/photo/index.vue b/pageB/photo/index.vue
index 894737e..fd55862 100644
--- a/pageB/photo/index.vue
+++ b/pageB/photo/index.vue
@@ -81,7 +81,6 @@
{{ item.goods_advword }}
- {{ item.goods_name }}
{{ item.goods_promotion_price }}
@@ -330,7 +329,7 @@
& > view {
display: flex;
flex-direction: column;
- justify-content: space-between;
+ justify-content: space-around;
color: #333;
font-size: 28rpx;
.title {
diff --git a/pageB/video/video.nvue b/pageB/video/video.nvue
index ceba9e7..aa0ae33 100644
--- a/pageB/video/video.nvue
+++ b/pageB/video/video.nvue
@@ -1,18 +1,17 @@
-
-
-
-
+ @pause="pausing" @ended="videoEnd" @timeupdate="timeupdate" :show-play-btn="false" controls="false" @click="stoping"
+ :enable-progress-gesture="false" :show-center-play-btn="false">
-
- >
+
+
+
视频
- {{ time_count == 1 ? 0 : time_count }}s
+ {{ time_count }}s
@{{ list.member_nickname }}
@@ -29,40 +28,81 @@
-
-
- 评论
- ×
+
+
+
+
+
+ {{ item.goods_advword }}
+ {{ item.goods_name }}
+ ¥{{ item.goods_promotion_price }}
+
-
+
+
+
+
+
+ 评论
+ ×
+
+
+
+
+
+
+ 全部商品
+ ×
+
+
+
+
- 回复
-
- {{ item.content }}
-
-
-
-
- 发送
-
-
-
- 努力加载中
-
-
+
+
+ 努力加载中
+
+
+
-
- |
-
+
+
+
+
+
+
@@ -76,6 +116,7 @@
data() {
return {
videoSize: {},
+ fixTop: 0,
list: {},
labelLen: [],
cart_type: false, // 显示购物车
@@ -98,7 +139,22 @@
onReady() {
this.videoBox = uni.createVideoContext("videoId", this);
},
+ 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({
@@ -113,6 +169,7 @@
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;
let item = res.data.data.info.label;
let arr = [];
item.forEach(data => {
@@ -139,40 +196,40 @@
},
success: (res) => {
if (res.data.errCode == 0) {
- console.log(res.data);
+ // console.log(res.data);
this.commentList = res.data.data;
}
}
})
},
// 发布评论
- sendComment() {
- if (this.send_value.length == 0) {
- this.$u.toast("内容不能为空!");
- 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,
- },
- success: (res) => {
- if (res.data.errCode == 0) {
- this.send_value = "";
- this.comment_num = res.data.num;
- console.log(res.data);
- } else {
- uni.showToast({
- title: res.data.message,
- icon: "none"
- })
- }
- }
- })
+ sendComment() {
+ if (this.send_value.length == 0) {
+ this.$u.toast("内容不能为空!");
+ 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,
+ },
+ success: (res) => {
+ if (res.data.errCode == 0) {
+ this.send_value = "";
+ this.comment_num = res.data.num;
+ console.log(res.data);
+ } else {
+ uni.showToast({
+ title: res.data.message,
+ icon: "none"
+ })
+ }
+ }
+ })
},
// 获取手机信息
getInfo() {
@@ -180,8 +237,13 @@
success: (res) => {
this.videoSize = {
width: "750rpx",
- height: res.screenHeight + "px"
+ height: res.screenHeight + "px",
}
+ this.fixTop = "400rpx";
+ this.fixTop = res.screenHeight / 3;
+ // #ifdef H5
+ this.fixTop = 400 + 'rpx'
+ // #endif
}
})
},
@@ -190,6 +252,19 @@
// 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;
@@ -202,8 +277,9 @@
// 监听视频
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;
+ // this.is_play = false;
}
// let num = parseInt((e.detail.currentTime/e.detail.duration)*100);
// this.linear = num + "%";
@@ -211,17 +287,23 @@
},
// 打开弹窗
openPopup(data) {
- console.log(data);
+ // console.log(data);
this.cart_type = data.cart;
this.is_comment = data.comment;
if (this.is_comment) {
this.page = 0;
this.getComment();
+ // this.is_play = true;
}
},
// 关闭评论
closeComment() {
this.is_comment = 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) {
@@ -231,6 +313,12 @@
this.loadinging = false;
}, 2000)
},
+ // 跳转
+ goGoodInfo(id) {
+ uni.navigateTo({
+ url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
+ })
+ },
// stop
stopClick(event) {
event.stopPropagation();
@@ -248,16 +336,16 @@
/* 关闭 */
.close {
position: fixed;
- top: 80rpx;
- right: 60rpx;
+ top: 100rpx;
+ right: 70rpx;
width: 30rpx;
height: 30rpx;
}
/* 暂停 */
.pause {
+ z-index: 99;
position: fixed;
- top: 600rpx;
left: 330rpx;
width: 100rpx;
height: 100rpx;
@@ -266,7 +354,6 @@
/* 用户操作 */
.user-info {
position: fixed;
- top: 360rpx;
right: 30rpx;
}
@@ -289,6 +376,53 @@
border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6);
}
+
+ .good-one {
+ position: absolute;
+ bottom: 300rpx;
+ right: 100rpx;
+ width: 450rpx;
+ 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-between;
+ }
+
+ .title-one {
+ width: 100rpx;
+ font-size: 28rpx;
+ color: #fff;
+ lines: 1;
+ }
+
+ .content-one {
+ width: 100rpx;
+ font-size: 24rpx;
+ color: #fff;
+ lines: 2;
+ }
+
+ .mask {
+ z-index: 999999;
+ position: fixed;
+ top: 0;
+ left: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ }
.content-box {
z-index: 99;
@@ -320,19 +454,19 @@
align-items: center;
justify-content: space-between;
}
-
+
.content-main {
flex-direction: row;
padding-left: 100rpx;
}
-
+
.content-style {
width: 600rpx;
font-size: 26rpx;
color: #333;
lines: 2;
}
-
+
.comment-list-header {
flex-direction: row;
}
@@ -360,6 +494,7 @@
font-weight: 500;
color: #333;
}
+
.send-box {
z-index: 10000;
position: fixed;
@@ -375,24 +510,77 @@
border-color: #ececec;
background-color: #fff;
}
-
+
.send-val {
width: 600rpx;
height: 88rpx;
font-size: 36rpx;
}
-
+
.btn-send {
font-size: 30rpx;
color: #303133;
}
-
+
.close-down {
+ padding: 10rpx;
font-size: 50rpx;
text-align: center;
color: #333;
}
+ .cart-box {
+ z-index: 99;
+ 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;
+ margin-right: 10rpx;
+ }
+
+ .goods-info {
+ justify-content: space-around;
+ }
+
+ .good-title {
+ color: #333;
+ font-size: 30rpx;
+ }
+
+ .good-price {
+ font-size: 28rpx;
+ color: #FF3131;
+ }
+
.image-play {
width: 22rpx;
height: 20rpx;
diff --git a/pages.json b/pages.json
index 595ed7e..8f5bbbe 100644
--- a/pages.json
+++ b/pages.json
@@ -57,8 +57,7 @@
"navigationBarTitleText": "",
"navigationStyle": "custom",
"app-plus": {
- "titleNView": false,
- "animationType": "slide-in-bottom"
+ "titleNView": false
}
}
},
@@ -105,7 +104,10 @@
{
"path" : "video/video",
"style" : {
- "navigationStyle":"custom"
+ "navigationStyle":"custom",
+ "app-plus": {
+ "softinputMode": "adjustResize"
+ }
}
},
{
diff --git a/pages/index/index.vue b/pages/index/index.vue
index d0f1b7f..d63f779 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -20,7 +20,7 @@
-
+
@@ -98,17 +98,24 @@