xbx #75

Merged
theluyuan merged 7 commits from xbx into master 2020-08-29 00:14:36 +08:00
12 changed files with 249 additions and 21 deletions

View File

@ -10,9 +10,9 @@ export default {
uni.getStorage({
key: "token",
success: (res) => {
uni.switchTab({
url: "/pages/index/index"
})
// uni.switchTab({
// url: "/pages/index/index"
// })
}
})
},

View File

@ -132,9 +132,18 @@ const install = (Vue, vm) => {
// 试穿
agreetest({goods_try_id,type,takeawayer_id}){
return vm.$u.post("/order/goodsTryAgree",{goods_try_id,type,takeawayer_id})
},
messageList({page = 1}){
return vm.$u.post("/message/messageList",{page})
},
isread(){
return vm.$u.post("/message/isread")
},
messageInfo({id}){
return vm.$u.post("/message/messageInfo",{id})
}
}
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = api;

View File

@ -256,6 +256,22 @@
"animationType": "slide-in-bottom"
}
}
},
{
"path": "pages/messages/list",
"style": {
"navigationBarTitleText": "活动列表",
"app-plus": {
}
}
},
{
"path": "pages/messages/info",
"style": {
"navigationBarTitleText": "活动详情",
"app-plus": {
}
}
}
],
"globalStyle": {

View File

@ -147,10 +147,12 @@ export default {
},
onLoad() {
let token = uni.getStorageSync('token');
let user = uni.getStorageSync('userinfo');
console.log( user.role == 2 ? '/pages/index/index' : '/pages/user/myinfo')
if (token != undefined && token) {
this.$u.route({
url: '/pages/index/index'
url: user.role == 2 ? '/pages/index/index' : '/pages/user/myinfo',
type: user.role == 2 ? 'tab' : 'to'
});
}
}

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

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

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

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

View File

@ -7,7 +7,16 @@
</view>
</view> -->
<!-- 消息列表 -->
<u-empty text="并没有什么消息" mode="message" v-if="Object.keys(list).length == 0" style="margin: auto"></u-empty>
<view class="massage_list" @click="navto()">
<view class="images">
<image src="@/static/image/7.png" ></image>
</view>
<view class="names">活动消息</view>
<view class="content u-line-1">{{huodong.data.title}}</view>
<view class="times">{{huodong.data.addtime}}</view>
<view class="tishi" v-if="huodong.count != 0"></view>
</view>
<!-- <u-empty text="并没有什么消息" mode="message" v-if="Object.keys(list).length == 0" style="margin: auto"></u-empty> -->
<view class="massage_list" v-for="(item,index) in list" :key="index" @click="gochat(item)">
<view class="images">
<image :src="item.avatar" ></image>
@ -28,6 +37,11 @@
list: [
],
huodong:{
data:{
}
}
};
},
methods: {
@ -49,6 +63,12 @@
this.$forceUpdate();
},
navto(){
console.log(1212)
this.$u.route({
url:"/pages/messages/list"
})
}
},
onShow(){
// this.list = this.imService.friends;
@ -58,6 +78,10 @@
const res = uni.getSystemInfoSync();
this.swiperHeight = res.windowHeight;
this.list = this.imService.friends;
this.$u.api.isread().then((res)=>{
console.log(res)
this.huodong = res.data
})
}
};
</script>

View File

@ -3,7 +3,7 @@
<u-form :model="form" ref="uForm">
<u-form-item label="标题" label-position="right"><u-input v-model="form.name" placeholder="请输入标题" /></u-form-item>
<!-- form-data -->
<view class="titles">封面</view>
<view class="titles">封面<text>建议图片尺寸为334*334</text></view>
<u-upload
:form-data="coverformdata"
:max-count="1"
@ -16,7 +16,7 @@
:file-list="fileListA"
@on-success="uploadcover"
></u-upload>
<view class="titles">图片</view>
<view class="titles">图片<text>最多选择5张图片建议图片尺寸为750*700</text></view>
<u-upload
:form-data="imgformdata"
name="article_image"
@ -72,7 +72,7 @@
<view class="u-button" @click="changes()">确定</view>
</u-popup>
<!-- 底部选择商品列表 -->
<view @click="show_two = true">
<view @click="show_two = true" v-if="userinfo.role != 4">
选择商品
<image class="images" src="../../static/image/tosign/bhottom.png"></image>
</view>
@ -136,11 +136,14 @@ export default {
cover: '', //
selectarr: [], //
tagcontent: '',
is_edit: false, //
is_edit: false, //
userinfo:{}
};
},
onLoad() {
//
// \
this.userinfo = uni.getStorageSync("userinfo")
this.tosign();
this.getLiveSpec();
},
@ -405,6 +408,10 @@ export default {
font-weight: 400;
color: rgba(51, 51, 51, 1);
margin: 30rpx 0;
>text{
font-size: 20rpx;
color: #999;
}
}
textarea {

View File

@ -20,7 +20,7 @@
<u-input v-model="form.text" placeholder="请填写直播简介" />
</u-form-item>
<view class="values"><text>{{20 - form.text.length}}</text>/20</view>
<u-form-item label-position="right" >
<u-form-item label-position="right" v-if="userinfo.role != 4">
<u-input :disabled="true" v-model="form.values" placeholder="我的售货袋" @click="navto('selectshop')"/>
<view class="rightes" @click="navto('selectshop')">售货袋</view>
</u-form-item>
@ -63,7 +63,8 @@
rSelect:[],
image:"",
token:"",
tiaozhuan:false
tiaozhuan:false,
userinfo:{}
};
},
methods: {
@ -133,7 +134,7 @@
goods_id:uni.getStorageSync("gouwudai"),
cover_img:this.image
}).then((res)=>{
console.log(res)
console.log(JSON.stringify(res))
if(res.errCode == 1){
this.$refs.uToast.show({
title: res.message,
@ -177,6 +178,7 @@
//
this.token = uni.getStorageSync('token');
this.userinfo = uni.getStorageSync("userinfo")
var config = {
appkey: 'mgb7ka1',
debug:true

View File

@ -2,7 +2,7 @@
<view id="release" >
<u-form :model="form" ref="uForm">
<u-form-item label="标题" label-position="right"><u-input v-model="form.name" placeholder="请输入标题" /></u-form-item>
<view class="titles">封面</view>
<view class="titles">封面<text>建议图片尺寸为334*334</text></view>
<u-upload
:form-data="coverformdata"
:max-count="1"
@ -15,7 +15,7 @@
:file-list="fileListA"
@on-success="uploadcover"
></u-upload>
<view class="titles">视频</view>
<view class="titles">视频<text>建议视频时长在5分钟内视频大小不超过100M</text></view>
<view class="videobox video-flex" v-if="videostate == false" @click="uploadvideo">
<u-icon name="plus" class="u-add-btn" size="40"></u-icon>
<view class="videotext">选择视频</view>
@ -61,7 +61,7 @@
<view class="u-button" @click="changes()">确定</view>
</u-popup>
<!-- 底部选择商品列表 -->
<view @click="show_two = true">
<view @click="show_two = true" v-if="userinfo.role != 4">
选择商品
<image class="images" src="../../static/image/tosign/bhottom.png"></image>
</view>
@ -187,10 +187,12 @@ export default {
selectvideo: '', //
videostate: false, //
progress: 0,
is_edit: false, //
is_edit: false, //
userinfo:{}
};
},
onLoad() {
this.userinfo = uni.getStorageSync("userinfo")
this.getLiveSpec();
this.resetgood();
},
@ -581,6 +583,10 @@ export default {
font-weight: 400;
color: rgba(51, 51, 51, 1);
margin: 30rpx 0;
>text{
font-size: 20rpx;
color: #999;
}
}
.video-flex {
flex-direction: column;

View File

@ -46,7 +46,7 @@
</div>
<image v-if="zhibo" class="closeimg" src="../../static/image/close.png" @click="closes"></image>
<image v-if="zhibo" class="menuimg" src="../../static/image/menu.png" @click="tool = true"></image>
<image v-if="zhibo" class="shoptapimg" @click="xianshi" src="../../static/image/shop.png"></image>
<image v-if="zhibo && list.length != 0" class="shoptapimg" @click="xianshi" src="../../static/image/shop.png" ></image>
<text v-if="zhibo" style="font-size:26rpx;color:#fff;width:512rpx;position:fixed;left:30rpx;top:793rpx">德铭阳光在线绿色直播请遵循相关法律法规警察叔叔24小时巡查哦。为了保障直播系统稳定现将全局开放防主播沉迷功能。主播积累直播16小时将自动下播休息2小时后方可继续开播。请大家注意休息/避免空播。
</text>
<div v-if="zhibo" class="danmulist">
@ -87,7 +87,7 @@
<text style="color:#fff;font-size:30rpx">{{renshumax}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">热度</text>
</view>
<view class="jieshuboxitem">
<view class="jieshuboxitem" v-if="list.length != 0">
<text style="color:#fff;font-size:30rpx">RMB {{jieshu.sales_amount}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">直播销量</text>
</view>

BIN
static/image/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB