xbx #10
@ -12,6 +12,12 @@ const install = (Vue, vm) => {
|
||||
},
|
||||
createLivesp({spec_name}){
|
||||
return vm.$u.post("Streaming/createLivesp",{spec_name})
|
||||
},
|
||||
getStoreGoodsList(){
|
||||
return vm.$u.post("article/getStoreGoodsList")
|
||||
},
|
||||
createChatRoom({chat_name,live_desc,spec,goods_id,cover_img}){
|
||||
return vm.$u.post("Streaming/createChatRoom",{chat_name,live_desc,spec,goods_id,cover_img})
|
||||
}
|
||||
}
|
||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||
|
71
components/release/shop-item.vue
Normal file
71
components/release/shop-item.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view class="item" @click="xuanzhongs">
|
||||
<image :src="image"></image>
|
||||
<view class="title u-line-1" >{{title}}</view>
|
||||
<view class="info">
|
||||
<text>{{price}}</text>
|
||||
<text>销量:{{num}}</text>
|
||||
</view>
|
||||
<u-checkbox class="xuanzhong" active-color="#FF7A15" :name="sid" v-model="xuanzhong" @change="xuanzhongs">
|
||||
</u-checkbox>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:"shop-item",
|
||||
data(){
|
||||
return {
|
||||
xuanzhong:false,
|
||||
}
|
||||
},
|
||||
props:['image','title','price','num','sid'],
|
||||
methods:{
|
||||
xuanzhongs(){
|
||||
this.xuanzhong = !this.xuanzhong
|
||||
this.$emit("xuanzhong")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.item{
|
||||
width: 214rpx;
|
||||
// height: 297rpx;
|
||||
background-color: #fff;
|
||||
border-radius:10rpx 10rpx 0 0;
|
||||
padding-bottom: 14rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
>image{
|
||||
width: 100%;
|
||||
height: 207rpx;
|
||||
}
|
||||
.title{
|
||||
width: 194rpx;
|
||||
margin: 19rpx auto;
|
||||
margin-bottom: 0;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
.info{
|
||||
display: flex;
|
||||
padding: 0 10rpx;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
>text:first-child{
|
||||
font-size: 26rpx;
|
||||
color: #FF3131;
|
||||
}
|
||||
>text:last-child{
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
|
||||
}
|
||||
}
|
||||
.xuanzhong{
|
||||
position: absolute;
|
||||
left: 8rpx;
|
||||
top: 8rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -5,7 +5,7 @@
|
||||
<view class="titles">标签</view>
|
||||
<view class="form-view" @click="show_add()">+ 新建标签</view>
|
||||
<view class="form-view" :class=" {'cur': rSelect.indexOf(item.id)!=-1} " @tap="tapInfo(item.id)" v-for="(item,index) in fileListes"
|
||||
:key="index">{{item.spec_name}}</view>
|
||||
:key="index">{{item.name}}</view>
|
||||
</view>
|
||||
<!-- 添加标签的按钮 -->
|
||||
<u-popup v-model="show" mode="center" border-radius="14" :closeable="true">
|
||||
@ -15,8 +15,10 @@
|
||||
<view class="u-inputes">
|
||||
<u-input v-model="form.name" />
|
||||
</view>
|
||||
<u-button class="custom-style-button" shape="circle" size="default">确定</u-button>
|
||||
<u-button class="custom-style-button" shape="circle" size="default" @click="chuangjian">确定</u-button>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -50,6 +52,25 @@
|
||||
} else {
|
||||
this.rSelect.splice(this.rSelect.indexOf(e), 1); //取消
|
||||
}
|
||||
this.$emit("qiehuan",this.rSelect)
|
||||
},
|
||||
chuangjian(){
|
||||
this.$u.api.createLivesp({spec_name:this.form.name}).then((res)=>{
|
||||
if(res.errCode != 0){
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
}else{
|
||||
this.show_add()
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'success'
|
||||
})
|
||||
this.$emit("chuangjian")
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
pages.json
12
pages.json
@ -195,6 +195,18 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/release/selectshop",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择商品",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"backgroundColor": "#2D2D2D",
|
||||
"titleColor": "#FFFFFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
@ -167,6 +167,9 @@ export default {
|
||||
|
||||
},
|
||||
methods: {
|
||||
release(){
|
||||
this.publishstate = true
|
||||
},
|
||||
publish(){
|
||||
|
||||
},
|
||||
@ -177,13 +180,6 @@ export default {
|
||||
name: e[1].label
|
||||
}
|
||||
},
|
||||
// 发布页面跳转
|
||||
release(){
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/release/tosign'
|
||||
// });
|
||||
this.publishstate = true
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
|
89
pages/release/selectshop.vue
Normal file
89
pages/release/selectshop.vue
Normal file
@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<view class="selectshop">
|
||||
<view class="title">我的商品</view>
|
||||
<u-checkbox-group>
|
||||
<view class="list">
|
||||
<shopItem @xuanzhong="xuanzhong" class="items" v-for="(i,j) in list" :key="j" :image="i.goods_image" :title="i.goods_name" :price="i.goods_marketprice" :num="i.goods_salenum" :sid="i.goods_id" ref="shop"></shopItem>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
<view class="jiaru" @click="jiaru">加入售货袋</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import shopItem from "../../components/release/shop-item"
|
||||
export default {
|
||||
name:"selectshop",
|
||||
data(){
|
||||
return {
|
||||
list:[],
|
||||
sele:[]
|
||||
}
|
||||
},
|
||||
components:{
|
||||
shopItem
|
||||
},
|
||||
methods:{
|
||||
|
||||
xuanzhong(){
|
||||
// console.log(this.$refs.shop)
|
||||
this.sele = []
|
||||
for(let i of this.$refs.shop){
|
||||
// console.log(i)
|
||||
if(i.xuanzhong){
|
||||
this.sele.push(i.sid)
|
||||
}
|
||||
}
|
||||
console.log(this.sele)
|
||||
},
|
||||
jiaru(){
|
||||
let that = this
|
||||
uni.setStorageSync("gouwudai",that.sele.join(","))
|
||||
this.$u.route({
|
||||
type:"back",
|
||||
delta:1
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.$u.api.getStoreGoodsList().then((res)=>{
|
||||
this.list = res.data.list
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.selectshop{
|
||||
padding: 15rpx 30rpx;
|
||||
padding-left: 6rpx;
|
||||
background-color: #2D2D2D;
|
||||
min-height: calc(100vh - 45px);
|
||||
.title{
|
||||
color: #FF780F;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
margin-left: 26rpx;
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 35rpx;
|
||||
.items{
|
||||
margin-left: 24rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
}
|
||||
.jiaru{
|
||||
position: fixed;
|
||||
bottom: 33rpx;
|
||||
right: 30rpx;
|
||||
height: 80rox;
|
||||
width: 348rpx;
|
||||
background-color: #999;
|
||||
font-size: 36rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -22,16 +22,16 @@
|
||||
<view class="values"><text>{{max_two}}</text>/20</view>
|
||||
<u-form-item label-position="right">
|
||||
<u-input v-model="form.values" placeholder="我的售货袋" />
|
||||
<view class="rightes">售货袋</view>
|
||||
<view class="rightes" @click="navto('selectshop')">售货袋</view>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<!-- 标签的引入 -->
|
||||
<tap_tosign :fileListes="fileListes"></tap_tosign>
|
||||
<tap_tosign :fileListes="fileListes" @chuangjian="chuangjian" @qiehuan="qiehuan"></tap_tosign>
|
||||
<view class="titles">直播封面图</view>
|
||||
<u-upload :max-count="1" :show-progress="true" del-color="#ececec" upload-text="上传" del-bg-color="#fff"></u-upload>
|
||||
<u-upload :form-data="{'name':'article_cover'}" action='https://dmmall.sdbairui.com/storeapi/Upload/uploadFile' name="article_cover" :max-count="1" :show-progress="false" :before-upload="tupian" del-color="#ececec" upload-text="上传" del-bg-color="#fff"></u-upload>
|
||||
</view>
|
||||
<view class="button-uview">
|
||||
<u-button>{{relerest}}</u-button>
|
||||
<u-button @click="kaibo">{{relerest}}</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -57,8 +57,8 @@
|
||||
titleMaxLength : '20',
|
||||
show: false,
|
||||
relerest: '开始直播',
|
||||
fileListes:[]
|
||||
|
||||
fileListes:[],
|
||||
rSelect:[]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@ -71,7 +71,7 @@
|
||||
// console.log(e);
|
||||
},
|
||||
mask_u() {
|
||||
this.show = !this.show
|
||||
|
||||
},
|
||||
// 获取验证码倒计时
|
||||
getCode() {
|
||||
@ -79,6 +79,37 @@
|
||||
},
|
||||
loading() {
|
||||
|
||||
},
|
||||
qiehuan(a){
|
||||
// console.log(a)
|
||||
this.rSelect = a
|
||||
},
|
||||
chuangjian(){
|
||||
this.init()
|
||||
},
|
||||
tupian(a){
|
||||
console.log(a)
|
||||
},
|
||||
navto(url){
|
||||
this.$u.route({
|
||||
url:"/pages/release/" + url
|
||||
})
|
||||
},
|
||||
kaibo(){
|
||||
this.$u.api.createChatRoom({
|
||||
chat_name:this.max,
|
||||
live_desc:this.form.text,
|
||||
spec:this.rSelect.join(","),
|
||||
goods_id:uni.getStorageSync("gouwudai"),
|
||||
|
||||
})
|
||||
},
|
||||
init(){
|
||||
this.$u.api.getLiveSpec().then((res)=>{
|
||||
console.log(res)
|
||||
this.fileListes = res.data
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -92,10 +123,7 @@
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.$u.api.getLiveSpec().then((res)=>{
|
||||
console.log(res)
|
||||
this.fileListes = res.data
|
||||
})
|
||||
this.init()
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user