From 16c21e4152ed5fc249e542faef6abba5963fcb6a Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Wed, 15 Jul 2020 11:34:43 +0800
Subject: [PATCH 1/4] tab
---
pages.json | 24 +++++++++++++++++
pages/index/index.vue | 60 ++++++++++++++++++++++++++++++++++++++++---
2 files changed, 81 insertions(+), 3 deletions(-)
diff --git a/pages.json b/pages.json
index b83611a..d61eeb5 100644
--- a/pages.json
+++ b/pages.json
@@ -57,5 +57,29 @@
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
+ },
+ "tabBar":{
+ "color": "#7A7E83",
+ "selectedColor": "#3cc51f",
+ "borderStyle": "black",
+ "backgroundColor": "#ffffff",
+ "height": "50px",
+ "fontSize": "10px",
+ "iconWidth": "24px",
+ "spacing": "3px",
+ "list": [{
+ "pagePath": "pages/index/index",
+ "iconPath": "",
+ "selectedIconPath": "",
+ "text": "首页",
+ "selectedColor":"#FBFBFB"
+ }, {
+ "pagePath": "pages/user/index",
+ "iconPath": "",
+ "selectedIconPath": "",
+ "text": "我的",
+ "selectedColor":"#FBFBFB"
+ }]
+
}
}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 1e86ffe..e2d1833 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -46,6 +46,7 @@
投诉简介
+
确定
@@ -65,7 +66,7 @@
-
+
发布
@@ -76,7 +77,26 @@
投诉成功
请等待审核结果
- 确认
+ 确认
+
+
+
+
+
+
+
+ 直播
+
+
+
+
+
+
+
+
+
+
+
@@ -136,7 +156,8 @@ export default {
}
]
}
- ]
+ ],
+ publishstate:true
}
},
components: {
@@ -146,6 +167,9 @@ export default {
},
methods: {
+ publish(){
+
+ },
setWorker(e) {
// console.log(e);
this.worker = {
@@ -304,5 +328,35 @@ export default {
margin: 0 auto;
}
}
+ .publish{
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
+ padding: 50rpx 84rpx 31rpx 78rpx;
+ .list{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ >view{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ >image{
+ width: 94rpx;
+ height: 80rpx;
+ }
+ >text{
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 400;
+ }
+ }
+ }
+ .off{
+ width: 37rpx;
+ height: 37rpx;
+ }
+ }
}
\ No newline at end of file
--
2.47.2
From a2f522479b25e62846488517c8520c80e06e11b9 Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Thu, 16 Jul 2020 10:02:57 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E8=B7=AF=E7=94=B1=20uview=E5=8D=87?=
=?UTF-8?q?=E7=BA=A7=20api?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/http.api.js | 17 +++++++++++++++++
common/http.interceptor.js | 17 +++++++++++++++++
main.js | 8 ++++++++
package-lock.json | 6 +++---
package.json | 2 +-
pages/index/index.vue | 32 ++++++++++++++++++++++++--------
6 files changed, 70 insertions(+), 12 deletions(-)
create mode 100644 common/http.api.js
create mode 100644 common/http.interceptor.js
diff --git a/common/http.api.js b/common/http.api.js
new file mode 100644
index 0000000..550c93e
--- /dev/null
+++ b/common/http.api.js
@@ -0,0 +1,17 @@
+
+// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
+// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
+const install = (Vue, vm) => {
+ // 此处没有使用传入的params参数
+ let api = {
+ getLiveSpec(){
+ return vm.$u.get("Streaming/getLiveSpec")
+ }
+ }
+ // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
+ vm.$u.api = api;
+}
+
+export default {
+ install
+}
\ No newline at end of file
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
new file mode 100644
index 0000000..ff4b9f0
--- /dev/null
+++ b/common/http.interceptor.js
@@ -0,0 +1,17 @@
+const install = (Vue, vm) => {
+ // 此为自定义配置参数,具体参数见上方说明
+ Vue.prototype.$u.http.setConfig({
+ baseUrl: 'https://dmmall.sdbairui.com//storeapi/',
+ loadingText: '努力加载中~',
+ loadingTime: 800,
+ // 设置自定义头部content-type
+ // header: {
+ // 'content-type': 'xxx'
+ // }
+ // ......
+ });
+}
+
+export default {
+ install
+}
\ No newline at end of file
diff --git a/main.js b/main.js
index f32c60f..ff7a4ee 100644
--- a/main.js
+++ b/main.js
@@ -11,4 +11,12 @@ App.mpType = 'app'
const app = new Vue({
...App
})
+// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
+import httpInterceptor from '@/common/http.interceptor.js'
+Vue.use(httpInterceptor, app)
+
+// http接口API集中管理引入部分
+import httpApi from '@/common/http.api.js'
+Vue.use(httpApi, app)
+
app.$mount()
diff --git a/package-lock.json b/package-lock.json
index 34b1f21..ec1bd6b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"uview-ui": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.3.3.tgz",
- "integrity": "sha512-aDXZCptHhBCzuPujX9QyCV26y2dX7WgNpm3VX9+6fxoeA6eA8s4CneNTh5jrsKzPrUYbbEs9TSqmN7zIN3a9xQ=="
+ "version": "1.5.2",
+ "resolved": "https://registry.npm.taobao.org/uview-ui/download/uview-ui-1.5.2.tgz?cache=0&sync_timestamp=1594781920423&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuview-ui%2Fdownload%2Fuview-ui-1.5.2.tgz",
+ "integrity": "sha1-4jDud0TIBjMJe74GU+IyvJSyAwk="
}
}
}
diff --git a/package.json b/package.json
index 572e046..cd32e4e 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"description": "",
"main": "main.js",
"dependencies": {
- "uview-ui": "^1.3.3"
+ "uview-ui": "^1.5.2"
},
"devDependencies": {},
"scripts": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index a7421d4..382eaed 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -83,17 +83,17 @@
-
+
直播
-
+
-
+ 图文
-
+
-
+ 视频
@@ -179,9 +179,10 @@ export default {
},
// 发布页面跳转
release(){
- uni.navigateTo({
- url: '/pages/release/tosign'
- });
+ // uni.navigateTo({
+ // url: '/pages/release/tosign'
+ // });
+ this.publishstate = true
},
tabsChange(index) {
this.swiperCurrent = index;
@@ -192,6 +193,15 @@ export default {
this.swiperCurrent = current;
this.current = current;
},
+ navto(url){
+ this.$u.router({
+ url:`/pages/${url}`
+ })
+ // console.log(`/pages/${url}`)
+ // uni.navigateTo({
+ // url: `/pages/${url}`
+ // });
+ }
}
}
@@ -339,10 +349,14 @@ export default {
justify-content: space-between;
align-items: center;
padding: 50rpx 84rpx 31rpx 78rpx;
+ image{
+ background-color: #0f0;
+ }
.list{
display: flex;
align-items: center;
justify-content: space-between;
+ width: 100%;
>view{
display: flex;
flex-direction: column;
@@ -352,6 +366,7 @@ export default {
height: 80rpx;
}
>text{
+ margin-top: 10rpx;
font-size: 28rpx;
color: #333;
font-weight: 400;
@@ -359,6 +374,7 @@ export default {
}
}
.off{
+ margin-top: 81rpx;
width: 37rpx;
height: 37rpx;
}
--
2.47.2
From 616af0337c62b6a9d07b44912c0ccb8bf0c66f48 Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Thu, 16 Jul 2020 11:20:59 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=A0=87=E7=AD=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/http.api.js | 6 +++++
common/http.interceptor.js | 11 ++++++---
components/release/tap_tosign.vue | 6 ++---
pages.json | 22 +++++++++---------
pages/index/index.vue | 2 +-
pages/login/login.vue | 37 ++++++++++++++++++++++++++++---
pages/release/tosign.vue | 11 +++++++--
7 files changed, 72 insertions(+), 23 deletions(-)
diff --git a/common/http.api.js b/common/http.api.js
index 550c93e..10342c3 100644
--- a/common/http.api.js
+++ b/common/http.api.js
@@ -6,6 +6,12 @@ const install = (Vue, vm) => {
let api = {
getLiveSpec(){
return vm.$u.get("Streaming/getLiveSpec")
+ },
+ login({member_name,member_password}){
+ return vm.$u.post("Login/login",{member_name,member_password})
+ },
+ createLivesp({spec_name}){
+ return vm.$u.post("Streaming/createLivesp",{spec_name})
}
}
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index ff4b9f0..ebb8144 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -1,15 +1,20 @@
const install = (Vue, vm) => {
// 此为自定义配置参数,具体参数见上方说明
Vue.prototype.$u.http.setConfig({
- baseUrl: 'https://dmmall.sdbairui.com//storeapi/',
+ baseUrl: 'https://dmmall.sdbairui.com//storeapi',
loadingText: '努力加载中~',
loadingTime: 800,
// 设置自定义头部content-type
// header: {
- // 'content-type': 'xxx'
+ // "Authorization" : "122"
// }
// ......
- });
+ });
+ Vue.prototype.$u.http.interceptor.request = (config) => {
+ const token = uni.getStorageSync('token');
+ config.header.Authorization = 'Bearer' + " " + token;
+ return config;
+ }
}
export default {
diff --git a/components/release/tap_tosign.vue b/components/release/tap_tosign.vue
index aff1e52..c543dc0 100644
--- a/components/release/tap_tosign.vue
+++ b/components/release/tap_tosign.vue
@@ -4,8 +4,8 @@
标签
+ 新建标签
- {{item}}
+ {{item.spec_name}}
@@ -32,11 +32,11 @@
// 演示地址,请勿直接使用
action: 'http://www.example.com/upload',
fileList: [],
- fileListes: ["美妆", "博主穿搭", "美妆", "美妆", "美妆", "美妆", "美妆", "博主穿搭"],
show: false,
rSelect: []
}
},
+ props:['fileListes'],
methods: {
show_add() {
console.log(this.show)
diff --git a/pages.json b/pages.json
index 94fa732..26d5d8c 100644
--- a/pages.json
+++ b/pages.json
@@ -3,6 +3,17 @@
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [
+ {
+ "path": "pages/login/login",
+ "style": {
+ "navigationBarTitleText": "",
+ "navigationStyle": "custom",
+ "app-plus": {
+ "titleNView": false,
+ "animationType": "slide-in-bottom"
+ }
+ }
+ },
{
"path": "pages/release/tosign",
"style": {
@@ -38,17 +49,6 @@
}
}
},
- {
- "path": "pages/login/login",
- "style": {
- "navigationBarTitleText": "",
- "navigationStyle": "custom",
- "app-plus": {
- "titleNView": false,
- "animationType": "slide-in-bottom"
- }
- }
- },
{
"path": "pages/release/video",
"style": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 382eaed..24e55a2 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -194,7 +194,7 @@ export default {
this.current = current;
},
navto(url){
- this.$u.router({
+ this.$u.route({
url:`/pages/${url}`
})
// console.log(`/pages/${url}`)
diff --git a/pages/login/login.vue b/pages/login/login.vue
index eb59b14..d1bff77 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -9,15 +9,16 @@
账号登录
-
+
-
+
- {{login}}
+ {{login}}
+
@@ -32,6 +33,8 @@
value: '',
login: '登录',
show: false,
+ zhanghao:"",
+ mima:""
};
},
@@ -54,6 +57,34 @@
},
loading(){
+ },
+ logins(){
+ this.$u.api.login({member_name:this.zhanghao,member_password:this.mima}).then((res)=>{
+ console.log(res)
+ if(res.errCode != 0){
+ this.$refs.uToast.show({
+ title: res.message,
+ type: 'error'
+ })
+ }else{
+ uni.setStorageSync("token",res.data.token)
+ uni.setStorageSync("userinfo",res.data)
+ this.$u.route({
+ url:"/pages/index/index",
+ type:"switchTab"
+ })
+ }
+
+ })
+ }
+ },
+ onLoad(){
+ let token = uni.getStorageSync('token');
+
+ if(token != undefined && token){
+ this.$u.route({
+ url:"/pages/index/index"
+ })
}
}
};
diff --git a/pages/release/tosign.vue b/pages/release/tosign.vue
index adbcae0..77e05ce 100644
--- a/pages/release/tosign.vue
+++ b/pages/release/tosign.vue
@@ -26,7 +26,7 @@
-
+
直播封面图
@@ -56,7 +56,8 @@
max : '优秀的标题可以卖的更好哦~',
titleMaxLength : '20',
show: false,
- relerest: '开始直播'
+ relerest: '开始直播',
+ fileListes:[]
};
},
@@ -89,6 +90,12 @@
this.max = String(this.max).slice(0, this.titleMaxLength);
}
}
+ },
+ onLoad(){
+ this.$u.api.getLiveSpec().then((res)=>{
+ console.log(res)
+ this.fileListes = res.data
+ })
}
};
--
2.47.2
From feb2b358e113c9ea8a19e5bc4e9fbc5b7d0454ab Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Thu, 16 Jul 2020 11:23:36 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/api/user.js | 13 -------------
1 file changed, 13 deletions(-)
delete mode 100644 common/api/user.js
diff --git a/common/api/user.js b/common/api/user.js
deleted file mode 100644
index a396093..0000000
--- a/common/api/user.js
+++ /dev/null
@@ -1,13 +0,0 @@
-export default {
- init(vm){
- return {
- // 首页协议 列子
- // documentInfo({document_code}) {
- // return vm.$u.post('StartUp/documentInfo', {
- // document_code : document_code
- // });
- // },
-
- }
- }
-}
\ No newline at end of file
--
2.47.2