交易大厅接口对接及界面优化
This commit is contained in:
parent
4ad08f699d
commit
5885261a60
16
App.vue
16
App.vue
@ -22,6 +22,7 @@ import {
|
|||||||
history
|
history
|
||||||
} from '@/api/public.js'
|
} from '@/api/public.js'
|
||||||
import Routine from './libs/routine.js';
|
import Routine from './libs/routine.js';
|
||||||
|
import voice from'./plugin/voice/voice.js'
|
||||||
export default {
|
export default {
|
||||||
globalData: {
|
globalData: {
|
||||||
spid: 0,
|
spid: 0,
|
||||||
@ -119,8 +120,7 @@ import {
|
|||||||
// #endif
|
// #endif
|
||||||
that.getConfigData()
|
that.getConfigData()
|
||||||
|
|
||||||
|
//#ifdef APP-PLUS
|
||||||
//#ifdef APP-PLUS
|
|
||||||
jpushModule.setLoggerEnable(true);
|
jpushModule.setLoggerEnable(true);
|
||||||
jpushModule.initJPushService()
|
jpushModule.initJPushService()
|
||||||
jpushModule.addConnectEventListener(result=>{
|
jpushModule.addConnectEventListener(result=>{
|
||||||
@ -152,6 +152,14 @@ import {
|
|||||||
let extras = result.extras
|
let extras = result.extras
|
||||||
|
|
||||||
console.log("通知", result)
|
console.log("通知", result)
|
||||||
|
// if(result.content=="您有新的订单,请注意查看。"){
|
||||||
|
// console.log("通知", '11111111')
|
||||||
|
// voice.init()
|
||||||
|
// }
|
||||||
|
if(result.extras.type=='ORDER_CREATE'){
|
||||||
|
voice.init()
|
||||||
|
|
||||||
|
}
|
||||||
// 点击事件
|
// 点击事件
|
||||||
if (notificationEventType == 'notificationOpened') {
|
if (notificationEventType == 'notificationOpened') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -173,6 +181,10 @@ import {
|
|||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
// console.log(voice.in)
|
||||||
|
|
||||||
|
// voice.connectSocketGlobal()
|
||||||
|
|
||||||
let that = this
|
let that = this
|
||||||
// 记录H5和公众号
|
// 记录H5和公众号
|
||||||
if (this.$store.state.app.token) {
|
if (this.$store.state.app.token) {
|
||||||
|
@ -24,7 +24,7 @@ export function getCommunityList(data) {
|
|||||||
*/
|
*/
|
||||||
export function getCommunityshow(data) {
|
export function getCommunityshow(data) {
|
||||||
|
|
||||||
return request.get('community/show/'+data,{}, {
|
return request.get('community/show/' + data, {}, {
|
||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -43,23 +43,35 @@ export function getCommunitygetOrderList(data) {
|
|||||||
* 发起转售
|
* 发起转售
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getCommunitycreate( data) {
|
export function getCommunitycreate(data) {
|
||||||
return request.post(`community/create`, data, { login: true });
|
return request.post(`community/create`, data, {
|
||||||
|
login: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改转售
|
* 修改转售
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getCommunityUpdate( data) {
|
export function getCommunityUpdate(data) {
|
||||||
return request.post(`community/update`, data, { login: true });
|
return request.post(`community/update`, data, {
|
||||||
|
login: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 加入购物车
|
* 加入购物车
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getCommunityaddCart(data) {
|
export function getCommunityaddCart(data) {
|
||||||
return request.get('community/addCart', data, {
|
return request.post('community/addCart', data, {
|
||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//商品宝贝详情
|
||||||
|
|
||||||
|
export function getProductDetail(id) {
|
||||||
|
return request.get('store/product/detail/' + id, {
|
||||||
|
noAuth: true
|
||||||
|
});
|
||||||
}
|
}
|
@ -158,7 +158,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin-top: 21rpx;
|
margin-top: 23rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title1 {
|
.title1 {
|
||||||
@ -173,7 +173,7 @@
|
|||||||
font-family: PingFang SC-Regular, PingFang SC;
|
font-family: PingFang SC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
margin-top: 9rpx;
|
margin-top: 11rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<scroll-view scroll-y="true">
|
<scroll-view scroll-y="true" @touchmove.stop>
|
||||||
<block>
|
<block>
|
||||||
<view v-if="bought.length" @touchmove="onTouchmove" id="goods" class="goods">
|
<view v-if="bought.length" @touchmove="onTouchmove" id="goods" class="goods">
|
||||||
<view class="picTxt acea-row" v-for="(item, i) in bought" :key="i">
|
<view class="picTxt acea-row" v-for="(item, i) in bought" :key="i">
|
||||||
@ -33,10 +33,12 @@
|
|||||||
|
|
||||||
|
|
||||||
<view class="picTxt_one" v-if="item.attrValue.length>0">
|
<view class="picTxt_one" v-if="item.attrValue.length>0">
|
||||||
<picker class="slecte" @change="bindPickerChange($event,item.attrValue,i)"
|
<picker class="slecte" v-if="item.attrValue.length>1"
|
||||||
:value="index" :range="item.attrValue" :range-key="'sku'">
|
@change="bindPickerChange($event,item.attrValue,i)" :value="index"
|
||||||
|
:range="item.attrValue" :range-key="'sku'">
|
||||||
<view class="uni-input">{{item.attrValue[index].sku}}</view>
|
<view class="uni-input">{{item.attrValue[index].sku}}</view>
|
||||||
</picker>
|
</picker>
|
||||||
|
|
||||||
<view class="" style="margin-top: 10rpx;">
|
<view class="" style="margin-top: 10rpx;">
|
||||||
库存:{{item.attrValue[index].stock}}
|
库存:{{item.attrValue[index].stock}}
|
||||||
</view>
|
</view>
|
||||||
@ -53,17 +55,19 @@
|
|||||||
<view class="price">
|
<view class="price">
|
||||||
<span>出售价格</span>
|
<span>出售价格</span>
|
||||||
<input type="text" :value="item.price" placeholder="输入出售价格"
|
<input type="text" :value="item.price" placeholder="输入出售价格"
|
||||||
|
@input="producrprice($event,i)" adjust-position=""
|
||||||
placeholder-style="color: #CCCCCC;" />
|
placeholder-style="color: #CCCCCC;" />
|
||||||
</view>
|
</view>
|
||||||
<view class="price_num">
|
<view class="price_num">
|
||||||
<span>出售数量</span>
|
<span>出售数量</span>
|
||||||
<subtractive v-if='item.num==0' style="margin-top: 10rpx;margin-left: 20rpx;" class="step" :min="1"
|
<subtractive v-if='item.num==0' style="margin-top: 10rpx;margin-left: 20rpx;"
|
||||||
:max="item.attrValue[index].stock" :value="peicenumber" :isMax="true" :isMin="true" index="11"
|
class="step" :min="1" :max="item.attrValue[index].stock" :value="peicenumber"
|
||||||
@eventChange="numberChange($event,i)"></subtractive>
|
:isMax="true" :isMin="true" index="11" @eventChange="numberChange($event,i)">
|
||||||
|
</subtractive>
|
||||||
<subtractive v-else style="margin-top: 10rpx;margin-left: 20rpx;" class="step" :min="1"
|
|
||||||
:max="item.attrValue[index].stock" :value="item.num" :isMax="true" :isMin="true" index="11"
|
<subtractive v-else style="margin-top: 10rpx;margin-left: 20rpx;" class="step"
|
||||||
@eventChange="numberChange($event,i)"></subtractive>
|
:min="1" :max="item.attrValue[index].stock" :value="item.num" :isMax="true"
|
||||||
|
:isMin="true" index="11" @eventChange="numberChange($event,i)"></subtractive>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -164,22 +168,33 @@
|
|||||||
this.getBounht();
|
this.getBounht();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//价格
|
||||||
|
producrprice(e, i) {
|
||||||
|
this.bought[i].price = e.detail.value
|
||||||
|
|
||||||
|
},
|
||||||
// picker修改事件
|
// picker修改事件
|
||||||
bindPickerChange: function(e, storage, num) {
|
bindPickerChange: function(e, storage, num) {
|
||||||
this.bought[num].attrValue[this.index].stock=storage[e.detail.value].stock
|
this.bought[num].attrValue[this.index].sku = storage[e.detail.value].sku
|
||||||
this.bought[num].product_attr_unique=storage[e.detail.value].unique
|
this.bought[num].attrValue[this.index].stock = storage[e.detail.value].stock
|
||||||
|
this.bought[num].product_attr_unique = storage[e.detail.value].unique
|
||||||
this.pickerData = storage[this.index] // 这里就是选中的对象
|
this.pickerData = storage[this.index] // 这里就是选中的对象
|
||||||
|
|
||||||
|
if (this.bought[num].attrValue[this.index].stock == 0) {
|
||||||
|
this.$util.Tips({
|
||||||
|
title: '库存不足'
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击关闭按钮
|
// 点击关闭按钮
|
||||||
close() {
|
close() {
|
||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
numberChange(data,i) {
|
numberChange(data, i) {
|
||||||
this.peicenumber = data.number;
|
this.peicenumber = data.number;
|
||||||
this.bought[i].num=data.number
|
this.bought[i].num = data.number
|
||||||
|
|
||||||
},
|
},
|
||||||
tabs(index) {
|
tabs(index) {
|
||||||
this.isActive = index
|
this.isActive = index
|
||||||
@ -207,7 +222,7 @@
|
|||||||
},
|
},
|
||||||
searchBut() {
|
searchBut() {
|
||||||
this.whereb.page = this.wherec.page = this.wheres.page =
|
this.whereb.page = this.wherec.page = this.wheres.page =
|
||||||
this.bought = []
|
this.bought = []
|
||||||
this.isActive == 0 ? this.getBounht() : ''
|
this.isActive == 0 ? this.getBounht() : ''
|
||||||
},
|
},
|
||||||
getBounht() {
|
getBounht() {
|
||||||
@ -241,13 +256,11 @@
|
|||||||
if (item.product_id == val.product_id) {
|
if (item.product_id == val.product_id) {
|
||||||
that.$set(item, 'check', true);
|
that.$set(item, 'check', true);
|
||||||
that.$set(item, 'num', val.num);
|
that.$set(item, 'num', val.num);
|
||||||
|
that.$set(item, 'price', val.price);
|
||||||
}else{
|
|
||||||
that.$set(item, 'num', 0);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
/*已选中的商品打钩*/
|
/*已选中的商品打钩*/
|
||||||
getCheckedGoods() {
|
getCheckedGoods() {
|
||||||
@ -258,19 +271,18 @@
|
|||||||
},
|
},
|
||||||
/*点击选中与否*/
|
/*点击选中与否*/
|
||||||
goodsCheck(item) {
|
goodsCheck(item) {
|
||||||
this.$set(item, 'check', !item.check);
|
this.$set(item, 'check', !item.check);
|
||||||
|
console.log( item.num)
|
||||||
if (item.check) {
|
if (item.check) {
|
||||||
if(this.peicenumber>0){
|
if (this.peicenumber > 0) {
|
||||||
item.num=this.peicenumber
|
item.num = this.peicenumber
|
||||||
}else{
|
}
|
||||||
item.num=1
|
|
||||||
}
|
if (!item.product_attr_unique) {
|
||||||
|
item.product_attr_unique = item.attrValue[0].unique
|
||||||
if(!item.product_attr_unique){
|
|
||||||
item.product_attr_unique=item.attrValue[0].unique
|
|
||||||
}
|
}
|
||||||
this.checkedArr.push(item)
|
this.checkedArr.push(item)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.checkedArr.splice(this.checkedArr.findIndex(itemn => ((itemn.spu_id == item.spu_id) || (item
|
this.checkedArr.splice(this.checkedArr.findIndex(itemn => ((itemn.spu_id == item.spu_id) || (item
|
||||||
.spu_id == (
|
.spu_id == (
|
||||||
@ -280,9 +292,8 @@
|
|||||||
},
|
},
|
||||||
/*确定提交*/
|
/*确定提交*/
|
||||||
submit() {
|
submit() {
|
||||||
|
|
||||||
this.$emit('getProduct', this.checkedArr);
|
this.$emit('getProduct', this.checkedArr);
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -331,6 +342,7 @@
|
|||||||
.iconclose {
|
.iconclose {
|
||||||
width: 44rpx;
|
width: 44rpx;
|
||||||
height: 44rpx;
|
height: 44rpx;
|
||||||
|
line-height: 44rpx;
|
||||||
border: 2rpx solid #fff;
|
border: 2rpx solid #fff;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -393,27 +405,29 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 10rpx;
|
|
||||||
border-top: 2rpx solid #E7E6E4;
|
border-top: 2rpx solid #E7E6E4;
|
||||||
|
|
||||||
.picTxt_one {
|
.picTxt_one {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
|
||||||
.slecte {
|
.slecte {
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
width: 140rpx;
|
width: 280rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
line-height: 50rpx;
|
line-height: 60rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
font-family: PingFang SC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #CCCCCC;
|
color: #959595;
|
||||||
|
background-color: #E7E6E4;
|
||||||
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid #CCCCCC;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,9 +53,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="content_center-one">
|
<view class="content_center-one">
|
||||||
<view class="center-one">
|
<view class="center-one">
|
||||||
<view class="center-one-img">
|
<view class="center-one-img">
|
||||||
<image src="../../annex/static/left.png" mode=""></image>
|
<image src="../../annex/static/left.png" mode=""></image>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="release_btn button" form-type="submit">发布</button>
|
<button class="release_btn button" form-type="submit">发布</button>
|
||||||
@ -154,7 +154,8 @@
|
|||||||
|
|
||||||
padding: 0 28rpx;
|
padding: 0 28rpx;
|
||||||
margin-top: 28rpx;
|
margin-top: 28rpx;
|
||||||
.content_center-one {
|
|
||||||
|
.content_center-one {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 28rpx;
|
padding: 0 28rpx;
|
||||||
|
|
||||||
@ -200,6 +201,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.release_item {
|
.release_item {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
@ -389,7 +391,6 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.release_btn {
|
.release_btn {
|
||||||
margin-top: 100rpx;
|
margin-top: 100rpx;
|
||||||
}
|
}
|
||||||
|
@ -127,12 +127,12 @@
|
|||||||
</image>
|
</image>
|
||||||
<text class="text">交易大厅</text>
|
<text class="text">交易大厅</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="examine" @click="navigator(`/pages/commissionedSales/index/index`)">
|
<view class="examine" @click="navigator(`/pages/commissionedSales/index/index?mer_id=${mer_id}`)">
|
||||||
<image class="icon_img" src="@/static/images/weituo.png" mode="aspectFill">
|
<image class="icon_img" src="@/static/images/weituo.png" mode="aspectFill">
|
||||||
</image>
|
</image>
|
||||||
<text class="text">委托销售</text>
|
<text class="text">委托销售</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="examine" @click="navigator(`/pages/releaseManagement/index`)">
|
<view class="examine" @click="navigator(`/pages/releaseManagement/index?mer_id=${mer_id}`)">
|
||||||
<image class="icon_img" src="@/static/images/fabu.png" mode="aspectFill">
|
<image class="icon_img" src="@/static/images/fabu.png" mode="aspectFill">
|
||||||
</image>
|
</image>
|
||||||
<text class="text">发布管理</text>
|
<text class="text">发布管理</text>
|
||||||
@ -313,10 +313,11 @@
|
|||||||
this.isShow = true
|
this.isShow = true
|
||||||
this.mer_id = res.data.service.mer_id
|
this.mer_id = res.data.service.mer_id
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!res.data.mer_info) {
|
if (!res.data.mer_info) {
|
||||||
that.$set(this, 'jurisdiction', false);
|
that.$set(this, 'jurisdiction', false);
|
||||||
}
|
}
|
||||||
console.log(that.userInfoData);
|
// console.log(that.userInfoData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,13 +188,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(num) {
|
onLoad(num) {
|
||||||
|
|
||||||
this.tabTitle = this.tabs[0].name
|
this.tabTitle = this.tabs[0].name
|
||||||
|
|
||||||
if(num.key=='2'){
|
if (num.key == '2') {
|
||||||
this.activeItem='tabThree'
|
this.activeItem = 'tabThree'
|
||||||
}
|
}
|
||||||
|
|
||||||
//有时进入页面需要获取默认的第一个标签做逻辑判断 -- 如下:
|
//有时进入页面需要获取默认的第一个标签做逻辑判断 -- 如下:
|
||||||
// console.log(this.tabs[0])
|
// console.log(this.tabs[0])
|
||||||
},
|
},
|
||||||
|
@ -75,9 +75,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="textarea">
|
<view class="textarea">
|
||||||
<textarea placeholder='请输入商品描述' name="comment"
|
<textarea placeholder='请输入商品描述' name="comment" placeholder-class='placeholder'
|
||||||
placeholder-class='placeholder' v-model="formData.content"
|
v-model="formData.content" maxlength="600"></textarea>
|
||||||
maxlength="600"></textarea>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="release_item">
|
<view class="release_item">
|
||||||
@ -96,18 +95,60 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between-wrapper'>
|
<view class='item acea-row row-between-wrapper'>
|
||||||
<view class='name' style="font-size: 28rpx;rfont-family: PingFang SC;font-weight: 400;color: #F84221;">价格:¥{{price}}</view>
|
<view class='name'
|
||||||
<view class="select">
|
style="font-size: 28rpx;rfont-family: PingFang SC;font-weight: 400;color: #F84221;">
|
||||||
|
价格:¥{{price}}</view>
|
||||||
|
<!-- <view class="select">
|
||||||
<view class="select_count" @click="addprice">
|
<view class="select_count" @click="addprice">
|
||||||
<text v-if="!isshow" class="text1">点击输入价格</text>
|
<text v-if="!isshow" class="text1">点击输入价格</text>
|
||||||
<view v-else >
|
<view v-else >
|
||||||
<input type="number" value="" v-model="price" placeholder="请输入价格"
|
<input type="number" value="" v-model="price" placeholder="请输入价格"
|
||||||
style="text-align: right;font-size: 28rpx;" />
|
style="text-align: right;font-size: 28rpx;" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
<view class="popup_group">
|
||||||
|
<view class="radio" v-if="this.formData.product_info.length>0">
|
||||||
|
<view class="radio_label ">送货方式</view>
|
||||||
|
<checkbox-group class="select_group flex_start" @change="deliveryWayChange">
|
||||||
|
<label class="radio_select" v-for="(val, i) in deliveryFreeList"
|
||||||
|
:key="val.value">
|
||||||
|
<view>
|
||||||
|
<checkbox :value="val.value"
|
||||||
|
:checked="delivery_way.includes(val.value)" />
|
||||||
|
</view>
|
||||||
|
<view>{{ val.name }}</view>
|
||||||
|
</label>
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="popup_group_item" v-if="delivery_way.includes('2')">
|
||||||
|
<view class="popup_group_item_label">是否包邮</view>
|
||||||
|
<view class="popup_group_item_value">
|
||||||
|
<view class="popup_group_item_message">
|
||||||
|
<switch :checked="delivery_free == '1'" color="#E93323"
|
||||||
|
style="transform:scale(0.8)" @change="deliveryFreeChange" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<!-- <view class="popup_group_item" v-if="delivery_way.includes('2') && delivery_free == 0"
|
||||||
|
@click="tempIdSelect">
|
||||||
|
<view class="popup_group_item_label">运费模板</view>
|
||||||
|
<view class="popup_group_item_value">
|
||||||
|
<view class="popup_group_item_message">
|
||||||
|
<span v-if="setFormData.tempName"
|
||||||
|
class="popup_group_item_message_value">{{ setFormData.tempName }}</span>
|
||||||
|
<span v-else>请选择运费模板</span>
|
||||||
|
</view>
|
||||||
|
<view><span class="iconfont"></span></view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="release_btn button" form-type="submit">发布</button>
|
<button class="release_btn button" form-type="submit">发布</button>
|
||||||
@ -136,29 +177,20 @@
|
|||||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse">
|
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse">
|
||||||
</authorize>
|
</authorize>
|
||||||
|
|
||||||
<!-- <m-tabbar native>
|
|
||||||
<template v-slot:tabbar_index_2>
|
|
||||||
<view class="custom_style">
|
|
||||||
<view class="custom_style_icon"></view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</m-tabbar> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
mapGetters
|
mapGetters
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
import {
|
|
||||||
getCommunitygetOrderList
|
|
||||||
} from '@/api/trading-floor.js'
|
|
||||||
|
|
||||||
import authorize from '@/components/Authorize';
|
import authorize from '@/components/Authorize';
|
||||||
import avatar from "@/components/yq-avatar/yq-avatar.vue";
|
import avatar from "@/components/yq-avatar/yq-avatar.vue";
|
||||||
import associated from '@/components/shoppinglist/shoppinglist.vue';
|
import associated from '@/components/shoppinglist/shoppinglist.vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
TOKENNAME,
|
TOKENNAME,
|
||||||
HTTP_REQUEST_URL
|
HTTP_REQUEST_URL
|
||||||
@ -177,26 +209,47 @@
|
|||||||
import {
|
import {
|
||||||
configMap
|
configMap
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
|
import {
|
||||||
|
getCommunitycreate,
|
||||||
|
|
||||||
|
} from '@/api/trading-floor.js'
|
||||||
|
|
||||||
|
import {
|
||||||
|
|
||||||
|
getUserInfo
|
||||||
|
} from '@/api/user.js'
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
avatar,
|
avatar,
|
||||||
associated,
|
associated,
|
||||||
|
|
||||||
authorize,
|
authorize,
|
||||||
easyLoadimage,
|
easyLoadimage,
|
||||||
mTabbar
|
mTabbar,
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formData: {
|
formData: {
|
||||||
image: [],
|
image: [],
|
||||||
content: "",
|
content: "",
|
||||||
topic_id: "",
|
topic_id: 0,
|
||||||
spu_id: [],
|
category_id: 0,
|
||||||
video_link: ''
|
video_link: '',
|
||||||
|
is_type: 3,
|
||||||
|
resale_type:2,
|
||||||
|
product_info: []
|
||||||
},
|
},
|
||||||
price:0,
|
price: 0,
|
||||||
|
deliveryFreeList: [{
|
||||||
|
value: '1',
|
||||||
|
name: '到店核销'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
name: '快递配送'
|
||||||
|
}
|
||||||
|
],
|
||||||
imageSrc: '',
|
imageSrc: '',
|
||||||
productList: [],
|
productList: [],
|
||||||
topicName: {},
|
topicName: {},
|
||||||
@ -227,7 +280,16 @@
|
|||||||
video_link: "",
|
video_link: "",
|
||||||
showVideo: false,
|
showVideo: false,
|
||||||
videoplay: false,
|
videoplay: false,
|
||||||
videoContext: ''
|
videoContext: '',
|
||||||
|
delivery_free: 1,
|
||||||
|
templateListPage: {
|
||||||
|
page: 1,
|
||||||
|
limit: 10000
|
||||||
|
},
|
||||||
|
merId: '',
|
||||||
|
delivery_way: [], // 配送方式 1 到店核销 2 快递配送
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -252,13 +314,12 @@
|
|||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
this.videoContext = uni.createVideoContext('myVideo', this);
|
this.videoContext = uni.createVideoContext('myVideo', this);
|
||||||
// #endif
|
// #endif
|
||||||
|
this.getUserInfo()
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.list()
|
|
||||||
// uni.hideTabBar()
|
// uni.hideTabBar()
|
||||||
this.id = options.id;
|
this.id = options.id;
|
||||||
this.order_id = options.order_id;
|
|
||||||
// console.log("options.order_id", options.order_id)
|
|
||||||
this.tabActive = options.type || 1;
|
this.tabActive = options.type || 1;
|
||||||
if (this.community_app_switch.length == 1) {
|
if (this.community_app_switch.length == 1) {
|
||||||
this.tabActive = this.community_app_switch[0]
|
this.tabActive = this.community_app_switch[0]
|
||||||
@ -267,16 +328,8 @@
|
|||||||
this.isAuto = true;
|
this.isAuto = true;
|
||||||
this.isShowAuth = true
|
this.isShowAuth = true
|
||||||
} else {
|
} else {
|
||||||
if (this.id) {
|
|
||||||
this.getDetail()
|
|
||||||
} else {
|
|
||||||
// const data = getStorage('addPlant');
|
|
||||||
// if(data){
|
|
||||||
// this.formData.content = data.content || '';
|
|
||||||
// this.formData.image = data.image || [];
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
if (this.order_id) this.getOrderGoods()
|
|
||||||
}
|
}
|
||||||
this.videoContext = uni.createVideoContext("myvideo", this);
|
this.videoContext = uni.createVideoContext("myvideo", this);
|
||||||
},
|
},
|
||||||
@ -285,18 +338,50 @@
|
|||||||
this.formData.content = ''
|
this.formData.content = ''
|
||||||
this.formData.image = []
|
this.formData.image = []
|
||||||
this.formData.topic_id = ''
|
this.formData.topic_id = ''
|
||||||
this.formData.spu_id = ''
|
|
||||||
|
|
||||||
this.formData.video_link = ''
|
this.formData.video_link = ''
|
||||||
this.productList = []
|
this.productList = []
|
||||||
this.topicName = {}
|
this.topicName = {}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
list(){
|
getUserInfo: function() {
|
||||||
getCommunitygetOrderList().then(res=>{
|
let that = this;
|
||||||
console.log(res.data)
|
getUserInfo().then(res => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.merId = res.data.service.mer_id
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// 是否包邮选择
|
||||||
|
deliveryFreeChange(val) {
|
||||||
|
if (val.detail.value) {
|
||||||
|
this.delivery_free = '1';
|
||||||
|
} else {
|
||||||
|
this.delivery_free = '0';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 送货方式选择
|
||||||
|
deliveryWayChange(obj) {
|
||||||
|
this.delivery_way = obj.detail.value;
|
||||||
|
if(this.formData.product_info.length>0){
|
||||||
|
for(let i in this.formData.product_info){
|
||||||
|
this.formData.product_info[i].deliver_method = obj.detail.value.toString();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.$util.Tips({
|
||||||
|
title: '请选择产品,再选择送货方式'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
onLoadFun() {
|
onLoadFun() {
|
||||||
this.isShowAuth = false;
|
this.isShowAuth = false;
|
||||||
},
|
},
|
||||||
@ -304,31 +389,7 @@
|
|||||||
authColse: function(e) {
|
authColse: function(e) {
|
||||||
this.isShowAuth = e;
|
this.isShowAuth = e;
|
||||||
},
|
},
|
||||||
/*获取图文详情*/
|
|
||||||
getDetail() {
|
|
||||||
let that = this
|
|
||||||
plantDetailApi(that.id).then(res => {
|
|
||||||
that.formData = res.data
|
|
||||||
that.productList = res.data.relevance || []
|
|
||||||
that.topicName = res.data.topic || {}
|
|
||||||
}).catch(err => {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: err
|
|
||||||
});
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/*获取关联订单商品*/
|
|
||||||
getOrderGoods() {
|
|
||||||
let that = this
|
|
||||||
orderAssociatePlantApi(that.order_id).then(res => {
|
|
||||||
that.productList = res.data || []
|
|
||||||
that.formData.spu_id = res.data.map(val => val.spu_id)
|
|
||||||
}).catch(err => {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: err
|
|
||||||
});
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/*点击输入价格*/
|
/*点击输入价格*/
|
||||||
addprice() {
|
addprice() {
|
||||||
this.isshow = true
|
this.isshow = true
|
||||||
@ -491,12 +552,13 @@
|
|||||||
},
|
},
|
||||||
/*添加宝贝*/
|
/*添加宝贝*/
|
||||||
addProduct() {
|
addProduct() {
|
||||||
|
|
||||||
this.$refs.associated.open();
|
this.$refs.associated.open();
|
||||||
},
|
},
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
this.$refs.associated.close();
|
this.$refs.associated.close();
|
||||||
|
|
||||||
},
|
},
|
||||||
/*查看视频*/
|
/*查看视频*/
|
||||||
videoshow() {
|
videoshow() {
|
||||||
@ -519,8 +581,25 @@
|
|||||||
},
|
},
|
||||||
/*获取选中的宝贝*/
|
/*获取选中的宝贝*/
|
||||||
getProduct(data) {
|
getProduct(data) {
|
||||||
this.productList = data;
|
this.productList=[]
|
||||||
this.formData.spu_id = data.map(val => val.spu_id)
|
this.price = 0
|
||||||
|
if (data.length > 0) {
|
||||||
|
this.productList = data;
|
||||||
|
for (let i in data) {
|
||||||
|
this.price = Number(this.price) + (Number(data[i].num) * Number(data[i].price))
|
||||||
|
this.formData.product_info.push({
|
||||||
|
product_attr_unique: data[i].product_attr_unique,
|
||||||
|
number: Number(data[i].num),
|
||||||
|
price: data[i].price
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.price = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.$refs.associated.close();
|
this.$refs.associated.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -528,128 +607,64 @@
|
|||||||
* 提交数据
|
* 提交数据
|
||||||
*/
|
*/
|
||||||
formSubmit: function(e) {
|
formSubmit: function(e) {
|
||||||
|
// console.log(this.id)
|
||||||
|
|
||||||
let that = this,
|
let that = this,
|
||||||
|
|
||||||
value = that.formData;
|
value = that.formData;
|
||||||
if (value.image.length == 0) return that.$util.Tips({
|
if (value.image.length == 0) return that.$util.Tips({
|
||||||
title: '请添加话题图片'
|
title: '请添加图文图片'
|
||||||
|
});
|
||||||
|
if (value.product_info.length == 0) return that.$util.Tips({
|
||||||
|
title: '请选择产品'
|
||||||
});
|
});
|
||||||
if (!value.content) return that.$util.Tips({
|
if (!value.content) return that.$util.Tips({
|
||||||
title: '请分享使用心得和体会'
|
title: '请添加商品描述'
|
||||||
});
|
});
|
||||||
if (that.tabActive == 2 && !value.video_link) {
|
if (that.tabActive == 2 && !value.video_link) {
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '请添加话题视频'
|
title: '请添加话题视频'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!value.category_id || !value.topic_id) {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: '请选择话题'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (that.id) {
|
|
||||||
if (value.relevance.length) {
|
|
||||||
value.spu_id = value.relevance.map(val => (val.spu && val.spu.spu_id) || val.spu_id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
value.order_id = that.order_id
|
|
||||||
value.is_type = that.tabActive
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '保存中',
|
title: '保存中',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
that.id ? updatePlantApi(that.id, value).then(res => {
|
getCommunitycreate(value).then(res => {
|
||||||
uni.hideLoading()
|
if (res.status == '200') {
|
||||||
that.$util.Tips({
|
uni.hideLoading()
|
||||||
title: res.messge,
|
that.$util.Tips({
|
||||||
icon: 'success'
|
title: '发布成功',
|
||||||
});
|
icon: 'success'
|
||||||
|
});
|
||||||
setTimeout(function() {
|
|
||||||
if (that.tabActive == 2) {
|
|
||||||
uni.navigateTo({
|
|
||||||
//#ifdef APP
|
|
||||||
url: '/pages/short_video/appSwiper/index?id=' + res.data
|
|
||||||
.community_id + '&user=1&uid=' +
|
|
||||||
that.uid
|
|
||||||
//#endif
|
|
||||||
//#ifndef APP
|
|
||||||
url: '/pages/short_video/nvueSwiper/index?id=' + res.data
|
|
||||||
.community_id + '&user=1&uid=' +
|
|
||||||
that.uid
|
|
||||||
//#endif
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/plantGrass/plant_detail/index?id=' + res.data
|
|
||||||
.community_id + '&type=' + that
|
|
||||||
.tabActive
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 将对象所有值为空
|
|
||||||
* */
|
|
||||||
/**
|
|
||||||
* 将对象所有值为空
|
|
||||||
* */
|
|
||||||
that.formData = {
|
that.formData = {
|
||||||
image: [],
|
image: [],
|
||||||
content: "",
|
content: "",
|
||||||
topic_id: "",
|
topic_id: 0,
|
||||||
spu_id: [],
|
category_id: 0,
|
||||||
video_link: "",
|
video_link: '',
|
||||||
}
|
is_type: 3,
|
||||||
that.topicName = {}
|
product_info: []
|
||||||
}, 1000);
|
|
||||||
}).catch(err => {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: err
|
|
||||||
});
|
|
||||||
}) : createPlantApi(value).then(res => {
|
|
||||||
uni.hideLoading()
|
|
||||||
that.$util.Tips({
|
|
||||||
title: res.messge,
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
setStorage('addPlant', '');
|
|
||||||
setTimeout(function() {
|
|
||||||
if (that.tabActive == 2) {
|
|
||||||
uni.navigateTo({
|
|
||||||
//#ifdef APP
|
|
||||||
url: '/pages/short_video/appSwiper/index?id=' + res.data
|
|
||||||
.community_id + '&user=1&uid=' +
|
|
||||||
that.uid
|
|
||||||
//#endif
|
|
||||||
//#ifndef APP
|
|
||||||
url: '/pages/short_video/nvueSwiper/index?id=' + res.data
|
|
||||||
.community_id + '&user=1&uid=' +
|
|
||||||
that.uid
|
|
||||||
//#endif
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/plantGrass/plant_detail/index?id=' + res.data
|
|
||||||
.community_id + '&type=' + that
|
|
||||||
.tabActive
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 将对象所有值为空
|
|
||||||
* */
|
|
||||||
that.formData = {
|
|
||||||
image: [],
|
|
||||||
content: "",
|
|
||||||
topic_id: "",
|
|
||||||
spu_id: [],
|
|
||||||
video_link: "",
|
|
||||||
}
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/releaseManagement/index?key=' + 2
|
||||||
|
})
|
||||||
|
|
||||||
}, 1000);
|
} else {
|
||||||
|
that.$util.Tips({
|
||||||
|
title: res.messge,
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
// console.log('aaa', value)
|
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: err
|
title: err
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -986,4 +1001,99 @@
|
|||||||
height: 500rpx;
|
height: 500rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popup_group {
|
||||||
|
background: #fff;
|
||||||
|
margin: 31rpx auto;
|
||||||
|
width: 710rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
|
||||||
|
.popup_group_item {
|
||||||
|
padding: 32rpx 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.popup_group_item_value {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.popup_group_item_message {
|
||||||
|
margin-right: 15rpx;
|
||||||
|
color: #bbbbbb;
|
||||||
|
max-width: 400rpx;
|
||||||
|
|
||||||
|
&_value {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 400rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
color: #bbbbbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
>view:not(:last-child) {
|
||||||
|
border-bottom: 1px solid #eeeeee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio {
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
&_label {
|
||||||
|
padding-left: 10rpx;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.select_check {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.select {
|
||||||
|
background: #e93323;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_group {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_start {
|
||||||
|
padding: 0 10rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
&_select {
|
||||||
|
display: flex;
|
||||||
|
margin-right: 110rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -8,6 +8,7 @@
|
|||||||
<view class="content_title" v-if="listobj.author">
|
<view class="content_title" v-if="listobj.author">
|
||||||
<view class="title_one">
|
<view class="title_one">
|
||||||
{{listobj.mer_name}}
|
{{listobj.mer_name}}
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="title_two">
|
<view class="title_two">
|
||||||
{{listobj.care_count>0?listobj.care_count:0}}人关注 {{listobj.sales>0?listobj.sales:0}}销量
|
{{listobj.care_count>0?listobj.care_count:0}}人关注 {{listobj.sales>0?listobj.sales:0}}销量
|
||||||
@ -20,10 +21,11 @@
|
|||||||
<view view class="content_top-two">
|
<view view class="content_top-two">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
¥{{listobj.total_price}}
|
¥{{listobj.total_price}}
|
||||||
|
<!-- <input type="text" :value="listobj.total_price" v-model="listobj.total_price" /> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="top-two_content">
|
<view class="top-two_content">
|
||||||
{{listobj.content}}
|
<textarea :value="listobj.content" placeholder="" style="height: auto;" />
|
||||||
</view>
|
</view>
|
||||||
<view class="top-two_img" v-for="(item,index) in listobj.image">
|
<view class="top-two_img" v-for="(item,index) in listobj.image">
|
||||||
|
|
||||||
@ -42,20 +44,20 @@
|
|||||||
<view class="content_middle">
|
<view class="content_middle">
|
||||||
<view class="middle-one" v-for="(item,b) in listobj.resale" :key='b'>
|
<view class="middle-one" v-for="(item,b) in listobj.resale" :key='b'>
|
||||||
<view class="midding-img">
|
<view class="midding-img">
|
||||||
<image :src="item.spu.image" mode=""></image>
|
<image :src="item.image" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="middle-one_text">
|
<view class="middle-one_text">
|
||||||
<view class="one_text_a">
|
<view class="one_text_a">
|
||||||
{{item.spu.store_name}}
|
{{item.store_name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="one_text_b">
|
<view class="one_text_b">
|
||||||
¥{{item.price}}
|
¥{{item.price}}
|
||||||
</view>
|
</view>
|
||||||
<view class="one_text_c">
|
<view class="one_text_c">
|
||||||
|
|
||||||
<view class="">
|
<!-- <view class="">
|
||||||
采购价:{{item.spu.price}}
|
采购价:{{item.price}}
|
||||||
</view>
|
</view> -->
|
||||||
<view class="">
|
<view class="">
|
||||||
数量: {{item.number}}
|
数量: {{item.number}}
|
||||||
</view>
|
</view>
|
||||||
@ -76,38 +78,31 @@
|
|||||||
<view class="content_enter-two" v-else>
|
<view class="content_enter-two" v-else>
|
||||||
打折
|
打折
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="content_bootm" v-if="listobj.relevance.length>0">
|
<view class="content_bootm" v-if='listobj.resale'>
|
||||||
<view class="content_bootm_txt">
|
<view class="content_bootm_txt">
|
||||||
查看TA提到的宝贝({{listobj.relevance.length}})
|
查看TA提到的宝贝({{listobj.resale.length}})
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="content_bootm_one" v-for="(items,i) in listobj.relevance" :key='i'>
|
<view class="content_bootm_one" v-for="(items,i) in listobj.resale" :key='i' @click="Merchbaby(items)">
|
||||||
<view class="bootm_oneimg">
|
<view class="bootm_oneimg">
|
||||||
<image :src="items.spu.image" mode=""></image>
|
<image :src="items.image" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="" style="margin-top: 15rpx;">
|
||||||
{{items.spu.store_name}}
|
{{items.store_name}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="content_bootm_one">
|
|
||||||
<view class="bootm_oneimg">
|
|
||||||
<image src="@/static/images/bg2.png" mode=""></image>
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
良品铺子肉松饼1000g/箱 面包糕...
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="pay" v-if="this.detail.type==1">
|
<view class="pay" v-if="this.detail.type==1||this.detail.type==2">
|
||||||
<view class="pay_tilte-a">
|
<view class="pay_tilte-a">
|
||||||
合计: <span>¥{{listobj.total_price}}</span>
|
合计: <span>¥{{listobj.total_price}}</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="pay_tilte-b">提交订单</view>
|
<view class="pay_tilte-b" @click="prouctOrder">提交订单</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="domain" v-else>
|
<view class="domain" v-else>
|
||||||
@ -124,7 +119,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getCommunityshow
|
getCommunityshow,
|
||||||
|
getCommunityaddCart
|
||||||
} from '@/api/trading-floor.js'
|
} from '@/api/trading-floor.js'
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
@ -132,7 +128,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detail: {},
|
detail: {},
|
||||||
listobj: {}
|
listobj: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
@ -144,17 +140,35 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//商品详情
|
||||||
shopdetil(id) {
|
shopdetil(id) {
|
||||||
|
|
||||||
getCommunityshow(id).then(res => {
|
getCommunityshow(id).then(res => {
|
||||||
if (res.data.status = 200) {
|
if (res.data.status = 200) {
|
||||||
console.log(res.data)
|
|
||||||
this.listobj = res.data
|
this.listobj = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
},
|
|
||||||
|
|
||||||
|
//商品宝贝详情
|
||||||
|
Merchbaby(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/goods_details/index?id=${item.product_id}`
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
prouctOrder() {
|
||||||
|
getCommunityaddCart(this.listobj).then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/users/order_confirm/index?cartId=' + res.data.cart_id.toString()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -200,7 +214,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.content_titimg {
|
.content_titimg {
|
||||||
width: 136rpx;
|
width: 116rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
margin-top: -10rpx;
|
margin-top: -10rpx;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
@ -214,11 +228,19 @@
|
|||||||
|
|
||||||
.content_top-two {
|
.content_top-two {
|
||||||
.price {
|
.price {
|
||||||
|
display: flex;
|
||||||
margin-top: 21rpx;
|
margin-top: 21rpx;
|
||||||
font-size: 46rpx;
|
font-size: 46rpx;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #F84221
|
color: #F84221;
|
||||||
|
|
||||||
|
input {
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #F84221
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-two_content {
|
.top-two_content {
|
||||||
@ -332,11 +354,12 @@
|
|||||||
.content_bootm_txt {
|
.content_bootm_txt {
|
||||||
margin-top: 42rpx;
|
margin-top: 42rpx;
|
||||||
padding-left: 28rpx;
|
padding-left: 28rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content_bootm_one {
|
.content_bootm_one {
|
||||||
height: 112rpx;
|
height: 112rpx;
|
||||||
line-height: 112rpx;
|
padding-right: 28rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 21rpx;
|
margin-top: 21rpx;
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
<view class='item acea-row row-between-wrapper'>
|
<view class='item acea-row row-between-wrapper'>
|
||||||
<view class='name'
|
<view class='name'
|
||||||
style="font-size: 28rpx;rfont-family: PingFang SC;font-weight: 400;color: #F84221;">
|
style="font-size: 28rpx;rfont-family: PingFang SC;font-weight: 400;color: #F84221;">
|
||||||
价格:¥{{price}}</view>
|
价格:¥{{price.toFixed(2)}}</view>
|
||||||
<!-- <view class="select">
|
<!-- <view class="select">
|
||||||
<view class="select_count" @click="addprice">
|
<view class="select_count" @click="addprice">
|
||||||
<text v-if="!isshow" class="text1">点击输入价格</text>
|
<text v-if="!isshow" class="text1">点击输入价格</text>
|
||||||
@ -109,6 +109,46 @@
|
|||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
<view class="popup_group">
|
||||||
|
<view class="radio" v-if="this.formData.product_info.length>0">
|
||||||
|
<view class="radio_label ">送货方式</view>
|
||||||
|
<checkbox-group class="select_group flex_start" @change="deliveryWayChange">
|
||||||
|
<label class="radio_select" v-for="(val, i) in deliveryFreeList"
|
||||||
|
:key="val.value">
|
||||||
|
<view>
|
||||||
|
<checkbox :value="val.value"
|
||||||
|
:checked="delivery_way.includes(val.value)" />
|
||||||
|
</view>
|
||||||
|
<view>{{ val.name }}</view>
|
||||||
|
</label>
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="popup_group_item" v-if="delivery_way.includes('2')">
|
||||||
|
<view class="popup_group_item_label">是否包邮</view>
|
||||||
|
<view class="popup_group_item_value">
|
||||||
|
<view class="popup_group_item_message">
|
||||||
|
<switch :checked="delivery_free == '1'" color="#E93323"
|
||||||
|
style="transform:scale(0.8)" @change="deliveryFreeChange" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<!-- <view class="popup_group_item" v-if="delivery_way.includes('2') && delivery_free == 0"
|
||||||
|
@click="tempIdSelect">
|
||||||
|
<view class="popup_group_item_label">运费模板</view>
|
||||||
|
<view class="popup_group_item_value">
|
||||||
|
<view class="popup_group_item_message">
|
||||||
|
<span v-if="setFormData.tempName"
|
||||||
|
class="popup_group_item_message_value">{{ setFormData.tempName }}</span>
|
||||||
|
<span v-else>请选择运费模板</span>
|
||||||
|
</view>
|
||||||
|
<view><span class="iconfont"></span></view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="release_btn button" form-type="submit">发布</button>
|
<button class="release_btn button" form-type="submit">发布</button>
|
||||||
@ -143,6 +183,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
mapGetters
|
mapGetters
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
@ -169,8 +210,14 @@
|
|||||||
configMap
|
configMap
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import {
|
import {
|
||||||
getCommunitycreate
|
getCommunitycreate,
|
||||||
|
|
||||||
} from '@/api/trading-floor.js'
|
} from '@/api/trading-floor.js'
|
||||||
|
|
||||||
|
import {
|
||||||
|
|
||||||
|
getUserInfo
|
||||||
|
} from '@/api/user.js'
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -178,7 +225,8 @@
|
|||||||
associated,
|
associated,
|
||||||
authorize,
|
authorize,
|
||||||
easyLoadimage,
|
easyLoadimage,
|
||||||
mTabbar
|
mTabbar,
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -189,9 +237,19 @@
|
|||||||
category_id: 0,
|
category_id: 0,
|
||||||
video_link: '',
|
video_link: '',
|
||||||
is_type: 3,
|
is_type: 3,
|
||||||
|
resale_type:1,
|
||||||
product_info: []
|
product_info: []
|
||||||
},
|
},
|
||||||
price: 0,
|
price: 0,
|
||||||
|
deliveryFreeList: [{
|
||||||
|
value: '1',
|
||||||
|
name: '到店核销'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
name: '快递配送'
|
||||||
|
}
|
||||||
|
],
|
||||||
imageSrc: '',
|
imageSrc: '',
|
||||||
productList: [],
|
productList: [],
|
||||||
topicName: {},
|
topicName: {},
|
||||||
@ -223,6 +281,13 @@
|
|||||||
showVideo: false,
|
showVideo: false,
|
||||||
videoplay: false,
|
videoplay: false,
|
||||||
videoContext: '',
|
videoContext: '',
|
||||||
|
delivery_free: 1,
|
||||||
|
templateListPage: {
|
||||||
|
page: 1,
|
||||||
|
limit: 10000
|
||||||
|
},
|
||||||
|
merId: '',
|
||||||
|
delivery_way: [], // 配送方式 1 到店核销 2 快递配送
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -249,6 +314,7 @@
|
|||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
this.videoContext = uni.createVideoContext('myVideo', this);
|
this.videoContext = uni.createVideoContext('myVideo', this);
|
||||||
// #endif
|
// #endif
|
||||||
|
this.getUserInfo()
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// uni.hideTabBar()
|
// uni.hideTabBar()
|
||||||
@ -280,6 +346,42 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
getUserInfo: function() {
|
||||||
|
let that = this;
|
||||||
|
getUserInfo().then(res => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.merId = res.data.service.mer_id
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 是否包邮选择
|
||||||
|
deliveryFreeChange(val) {
|
||||||
|
if (val.detail.value) {
|
||||||
|
this.delivery_free = '1';
|
||||||
|
} else {
|
||||||
|
this.delivery_free = '0';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 送货方式选择
|
||||||
|
deliveryWayChange(obj) {
|
||||||
|
this.delivery_way = obj.detail.value;
|
||||||
|
if(this.formData.product_info.length>0){
|
||||||
|
for(let i in this.formData.product_info){
|
||||||
|
this.formData.product_info[i].deliver_method = obj.detail.value.toString();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.$util.Tips({
|
||||||
|
title: '请选择产品,再选择送货方式'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
onLoadFun() {
|
onLoadFun() {
|
||||||
this.isShowAuth = false;
|
this.isShowAuth = false;
|
||||||
},
|
},
|
||||||
@ -450,6 +552,7 @@
|
|||||||
},
|
},
|
||||||
/*添加宝贝*/
|
/*添加宝贝*/
|
||||||
addProduct() {
|
addProduct() {
|
||||||
|
|
||||||
this.$refs.associated.open();
|
this.$refs.associated.open();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -478,9 +581,12 @@
|
|||||||
},
|
},
|
||||||
/*获取选中的宝贝*/
|
/*获取选中的宝贝*/
|
||||||
getProduct(data) {
|
getProduct(data) {
|
||||||
|
this.productList=[]
|
||||||
|
this.price = 0
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
this.productList = data;
|
this.productList = data;
|
||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
|
console.log(Number(data[i].num) , Number(data[i].price),(Number(data[i].num) * Number(data[i].price)))
|
||||||
this.price = Number(this.price) + (Number(data[i].num) * Number(data[i].price))
|
this.price = Number(this.price) + (Number(data[i].num) * Number(data[i].price))
|
||||||
this.formData.product_info.push({
|
this.formData.product_info.push({
|
||||||
product_attr_unique: data[i].product_attr_unique,
|
product_attr_unique: data[i].product_attr_unique,
|
||||||
@ -493,7 +599,7 @@ this.productList = data;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.$refs.associated.close();
|
this.$refs.associated.close();
|
||||||
},
|
},
|
||||||
@ -502,8 +608,10 @@ this.productList = data;
|
|||||||
* 提交数据
|
* 提交数据
|
||||||
*/
|
*/
|
||||||
formSubmit: function(e) {
|
formSubmit: function(e) {
|
||||||
console.log(this.id)
|
// console.log(this.id)
|
||||||
|
|
||||||
let that = this,
|
let that = this,
|
||||||
|
|
||||||
value = that.formData;
|
value = that.formData;
|
||||||
if (value.image.length == 0) return that.$util.Tips({
|
if (value.image.length == 0) return that.$util.Tips({
|
||||||
title: '请添加图文图片'
|
title: '请添加图文图片'
|
||||||
@ -894,4 +1002,99 @@ this.productList = data;
|
|||||||
height: 500rpx;
|
height: 500rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popup_group {
|
||||||
|
background: #fff;
|
||||||
|
margin: 31rpx auto;
|
||||||
|
width: 710rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
|
||||||
|
.popup_group_item {
|
||||||
|
padding: 32rpx 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.popup_group_item_value {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.popup_group_item_message {
|
||||||
|
margin-right: 15rpx;
|
||||||
|
color: #bbbbbb;
|
||||||
|
max-width: 400rpx;
|
||||||
|
|
||||||
|
&_value {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 400rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
color: #bbbbbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
>view:not(:last-child) {
|
||||||
|
border-bottom: 1px solid #eeeeee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio {
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
&_label {
|
||||||
|
padding-left: 10rpx;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.select_check {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.select {
|
||||||
|
background: #e93323;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_group {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_start {
|
||||||
|
padding: 0 10rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
&_select {
|
||||||
|
display: flex;
|
||||||
|
margin-right: 110rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -5,10 +5,9 @@
|
|||||||
<view class="search">
|
<view class="search">
|
||||||
<view class="search-content acea-row row-middle">
|
<view class="search-content acea-row row-middle">
|
||||||
<text class="iconfont icon-sousuo"></text>
|
<text class="iconfont icon-sousuo"></text>
|
||||||
<input v-model="where.keyword" confirm-type="search" placeholder="请输入关键字" class="input"
|
<input v-model="where.keyword" confirm-type="search" placeholder="请输入关键字" class="input" />
|
||||||
@confirm="handleSearch" />
|
|
||||||
<view class="search_btn">
|
<view class="search_btn">
|
||||||
<image src="@/static/images/serchbtn.png" mode="aspectFill"></image>
|
<image src="@/static/images/serchbtn.png" mode="aspectFill" @click="handleSearch"></image>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -37,12 +36,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item" v-for='(item,index) in datatlist' :key='index' @click="shopping(item.community_id)">
|
<view class="item" v-for='(item,index) in datatlist' :key='index' @click="shopping(item)">
|
||||||
|
|
||||||
<image class="shopimg" :src="item.image[0]" mode="aspectFit"></image>
|
<image class="shopimg" :src="item.image[0]" mode="aspectFit"></image>
|
||||||
<view class="item_text">
|
<view class="item_text">
|
||||||
<span v-if='item.is_type==3'>调货</span>
|
<span v-if='item.resale_type==1'>调货</span>
|
||||||
<span v-else>委托销售</span>
|
<span v-else>打折</span>
|
||||||
{{item.title}}
|
{{item.title}}
|
||||||
</view>
|
</view>
|
||||||
<view class="item_prices">
|
<view class="item_prices">
|
||||||
@ -64,16 +63,14 @@
|
|||||||
<image src="@/static/images/trad-add.png" mode="aspectFit"></image>
|
<image src="@/static/images/trad-add.png" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<release :isShow='visible' :bottom='true' @close="closeMadle" @cancel="cancel" @confirm="confirm"></release>
|
<release :isShow='visible' :bottom='true' @close="closeMadle" @cancel="cancel" @confirm="confirm"
|
||||||
<view
|
style="z-index: 999999!important;"></release>
|
||||||
v-if="datatlist.length == 0||datatlist.length == 0 && where.page > 1 || datatlist.length == 0 && where1.page > 1||datatlist.length == 0 && where2.page > 1 ">
|
<view v-if="datatlist.length == 0||datatlist.length == 0 && where.page > 1 ">
|
||||||
|
|
||||||
<emptyPage title="暂无商品信息"></emptyPage>
|
<emptyPage title="暂无商品信息"></emptyPage>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<u-loadmore :status="status"
|
<u-loadmore :status="status" />
|
||||||
v-if="datatlist.length == 0 && where.page > 1 || datatlist.length == 0 && where1.page > 1||datatlist.length == 0 && where2.page > 1 " />
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -104,18 +101,7 @@
|
|||||||
keyword: '',
|
keyword: '',
|
||||||
|
|
||||||
},
|
},
|
||||||
where1: {
|
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
keyword: ''
|
|
||||||
|
|
||||||
},
|
|
||||||
where2: {
|
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
keyword: ''
|
|
||||||
|
|
||||||
},
|
|
||||||
visible: false,
|
visible: false,
|
||||||
num: 0,
|
num: 0,
|
||||||
options: [{
|
options: [{
|
||||||
@ -143,70 +129,73 @@
|
|||||||
if (this.status == 'nomore') return;
|
if (this.status == 'nomore') return;
|
||||||
this.status = 'loading';
|
this.status = 'loading';
|
||||||
this.where.page = ++this.where.page;
|
this.where.page = ++this.where.page;
|
||||||
this.getGoods()
|
this.getlist(this.num)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//选择 打折 调货
|
||||||
btntap(index) {
|
btntap(index) {
|
||||||
this.num = index
|
this.num = index
|
||||||
this.getlist()
|
this.getlist()
|
||||||
},
|
},
|
||||||
shopping(pid) {
|
//商品详情
|
||||||
|
shopping(item) {
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
type: 1,
|
type: item.resale_type,
|
||||||
id: pid
|
id: item.community_id
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/trading_hall/product_details/index?key=' + encodeURIComponent(JSON.stringify(
|
url: '/pages/trading_hall/product_details/index?key=' + encodeURIComponent(JSON.stringify(
|
||||||
data))
|
data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//控制 发布弹窗
|
||||||
open() {
|
open() {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
|
||||||
},
|
},
|
||||||
getlist(index) {
|
|
||||||
|
//查询
|
||||||
|
handleSearch() {
|
||||||
if (this.num == 0) {
|
if (this.num == 0) {
|
||||||
this.where = {
|
this.where.resale_type = ''
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
is_type: 3,
|
|
||||||
keyword: '',
|
|
||||||
|
|
||||||
},
|
|
||||||
getCommunitygetOrderList(this.where).then(res => {
|
|
||||||
|
|
||||||
if (res.status == 200) {
|
|
||||||
// this.datatlist = res.data.listcons
|
|
||||||
// console.log(res.data)
|
|
||||||
this.datatlist = []
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
} else if (this.num == 1) {
|
} else if (this.num == 1) {
|
||||||
this.where1 = {
|
this.where.resale_type = 1
|
||||||
page:1,
|
|
||||||
limit:10,
|
|
||||||
keyword:'',
|
|
||||||
},
|
|
||||||
getCommunityList(this.where).then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
this.datatlist = res.data.list
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.where2 = {
|
this.where.resale_type = 2
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
|
|
||||||
keyword: '',
|
|
||||||
|
|
||||||
},
|
|
||||||
this.datatlist = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCommunityList(this.where).then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
if (res.data.list.length < this.where.limit) {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
this.datatlist = res.data.list
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
//列表
|
||||||
|
getlist(index) {
|
||||||
|
if (this.num == 0) {
|
||||||
|
this.where.resale_type = ''
|
||||||
|
} else if (this.num == 1) {
|
||||||
|
this.where.resale_type = 1
|
||||||
|
} else {
|
||||||
|
this.where.resale_type = 2
|
||||||
|
}
|
||||||
|
getCommunityList(this.where).then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
if (res.data.list.length < this.where.limit) {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
this.datatlist = res.data.list
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
closeMadle() {
|
closeMadle() {
|
||||||
@ -226,7 +215,7 @@
|
|||||||
menuAction(action, rowId) {
|
menuAction(action, rowId) {
|
||||||
// console.log(action);
|
// console.log(action);
|
||||||
// 忽略初始化时的传入的空操作
|
// 忽略初始化时的传入的空操作
|
||||||
this.num=action
|
this.num = action
|
||||||
this.getlist(action)
|
this.getlist(action)
|
||||||
if (action === '') {
|
if (action === '') {
|
||||||
this.recomname = this.options[0].text
|
this.recomname = this.options[0].text
|
||||||
@ -309,7 +298,7 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-family: 'PingFang SC';
|
font-family: 'PingFang SC';
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
|
|
||||||
.recom_sym {
|
.recom_sym {
|
||||||
width: 28rpx;
|
width: 28rpx;
|
||||||
@ -344,8 +333,9 @@
|
|||||||
|
|
||||||
.tradline {
|
.tradline {
|
||||||
width: 26rpx;
|
width: 26rpx;
|
||||||
|
height: 4rpx;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
border: 2rpx solid #F84221;
|
background-color: #F84221;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,7 +358,7 @@
|
|||||||
width: 694.74rpx;
|
width: 694.74rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-bottom: 21rpx;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@ -379,7 +369,7 @@
|
|||||||
height: 561rpx;
|
height: 561rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-top: 21rpx;
|
margin-top: 21rpx;
|
||||||
|
|
||||||
border-radius: 14rpx 14rpx 0 0;
|
border-radius: 14rpx 14rpx 0 0;
|
||||||
|
|
||||||
.shopimg {
|
.shopimg {
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
* @Date 2022-01-26
|
* @Date 2022-01-26
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// import store from '../store'
|
|
||||||
|
|
||||||
// 是否播放中
|
// 是否播放中
|
||||||
let isPlaying = false;
|
let isPlaying = false;
|
||||||
// 播放列表
|
// 播放列表
|
||||||
@ -19,166 +17,24 @@ let audioPlayer = null;
|
|||||||
let platform = 'iOS';
|
let platform = 'iOS';
|
||||||
// 定时器
|
// 定时器
|
||||||
let timer = null;
|
let timer = null;
|
||||||
// socket地址
|
|
||||||
const socketUrl = "wss://gateworker.yngod.cn:8686";
|
|
||||||
|
|
||||||
const voice = {
|
const voice = {
|
||||||
// 创建播放器
|
// 创建播放器
|
||||||
init: () => {
|
init: () => {
|
||||||
// platform = plus.os.name;
|
platform = plus.os.name;
|
||||||
// if (platform == 'Android') {
|
if (platform == 'Android') {
|
||||||
// let MediaPlayer = plus.android.importClass("android.media.MediaPlayer");
|
let MediaPlayer = plus.android.importClass("android.media.MediaPlayer");
|
||||||
// audioPlayer = new MediaPlayer()
|
audioPlayer = new MediaPlayer()
|
||||||
// }
|
}
|
||||||
// if (platform == "iOS") {
|
if (platform == "iOS") {
|
||||||
// let AVAudioPlayer = plus.ios.importClass("AVAudioPlayer");
|
let AVAudioPlayer = plus.ios.importClass("AVAudioPlayer");
|
||||||
// audioPlayer = new AVAudioPlayer();
|
audioPlayer = new AVAudioPlayer();
|
||||||
// }
|
}
|
||||||
console.log('创建播放器成功');
|
console.log('创建播放器成功');
|
||||||
// voice.playAudio();
|
voice.playAudio();
|
||||||
},
|
|
||||||
// 连接socket
|
|
||||||
connectSocketGlobal: () => {
|
|
||||||
uni.connectSocket({
|
|
||||||
url: socketUrl,
|
|
||||||
success: (res) => {
|
|
||||||
console.log('连接成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
uni.onSocketOpen((success) => {
|
|
||||||
console.log('WebSocket连接已打开!');
|
|
||||||
let storeIds = store.state.storeIds;
|
|
||||||
if (storeIds.length > 0) {
|
|
||||||
storeIds.forEach(sid => {
|
|
||||||
uni.sendSocketMessage({
|
|
||||||
data: sid.toString(),
|
|
||||||
success: (s) => {
|
|
||||||
console.log('成功');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
store.commit('setData', {
|
|
||||||
key: 'socketIsOpen',
|
|
||||||
val: true
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
uni.onSocketError(function(error) {
|
|
||||||
console.log('WebSocket连接打开失败,请检查!');
|
|
||||||
});
|
|
||||||
|
|
||||||
uni.onSocketMessage((res) => {
|
|
||||||
console.log('接收播报数据', res)
|
|
||||||
//按接收的内容播放信息
|
|
||||||
try {
|
|
||||||
if (typeof res == 'string') {
|
|
||||||
res = JSON.parse(res);
|
|
||||||
}
|
|
||||||
if (typeof res.data == 'string') {
|
|
||||||
res.data = JSON.parse(res.data);
|
|
||||||
}
|
|
||||||
if(res.data?.Hearbeat) {
|
|
||||||
uni.sendSocketMessage({
|
|
||||||
data: "hearbeat",
|
|
||||||
success: (s) => {
|
|
||||||
console.log('成功');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
if (res.data.needPlay) {
|
|
||||||
try {
|
|
||||||
// var parseStr = voice.parseAudioData(res.data);
|
|
||||||
} catch (e) {
|
|
||||||
// console.log('解析出错', e)
|
|
||||||
}
|
|
||||||
// console.log('解析数据', parseStr)
|
|
||||||
// voice.addAudioQueue(parseStr);
|
|
||||||
}
|
|
||||||
} catch (e) {}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//解析服务器数据
|
|
||||||
parseAudioData: function(serverData) {
|
|
||||||
let audio = [];
|
|
||||||
//头部
|
|
||||||
//处理中间数字
|
|
||||||
serverData.data = parseFloat(serverData.data).toString();
|
|
||||||
//如果当前数字中没有小数点,则用.00补足
|
|
||||||
if (serverData.data.indexOf('.') == -1) serverData.data += '.00';
|
|
||||||
let dot = serverData.data.indexOf('.');
|
|
||||||
let l = serverData.data.length;
|
|
||||||
for (let n = 0; n < l; n++) {
|
|
||||||
//如果上一位是0则不加入
|
|
||||||
if (audio[audio.length - 1] != 0 || serverData.data.substr(n, 1) != '0') {
|
|
||||||
audio.push(serverData.data.substr(n, 1));
|
|
||||||
//根据当前数字的位置与dot的位置决定后缀并且当前不是小数点
|
|
||||||
if (serverData.data.substr(n, 1) != '.' && serverData.data.substr(n, 1) != '0') {
|
|
||||||
if (dot - n == 2) {
|
|
||||||
audio.push('ten');
|
|
||||||
} else if (dot - n == 3) {
|
|
||||||
audio.push('hundred');
|
|
||||||
} else if (dot - n == 4) {
|
|
||||||
audio.push('thousand');
|
|
||||||
} else if (dot - n == 5) {
|
|
||||||
audio.push('ten_thousand');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//如果出现1shi则去掉1
|
|
||||||
let _audio = audio.join('&');
|
|
||||||
if (audio[0] == 1) {
|
|
||||||
_audio = _audio.replace('1&shi', 'shi'); //应对一十元问题
|
|
||||||
}
|
|
||||||
if (audio[0] != 0) {
|
|
||||||
_audio = _audio.replace('0&.', '.'); //应对一十点问题
|
|
||||||
}
|
|
||||||
if (_audio.indexOf('.&0') == _audio.length - 2 - 1) { //应对末尾是.0
|
|
||||||
_audio = _audio.substr(0, _audio.length - 2 - 2);
|
|
||||||
}
|
|
||||||
//加入前缀
|
|
||||||
if (_audio) {
|
|
||||||
_audio = 'header_' + serverData.header.toString() + '&' + _audio;
|
|
||||||
} else {
|
|
||||||
_audio = 'header_' + serverData.header.toString();
|
|
||||||
}
|
|
||||||
audio = _audio.split("&");
|
|
||||||
//如果有金额
|
|
||||||
if (l) {
|
|
||||||
audio.push('yuan');
|
|
||||||
}
|
|
||||||
//底部
|
|
||||||
if (serverData.footer) {
|
|
||||||
audio.push('footer');
|
|
||||||
}
|
|
||||||
let result = [];
|
|
||||||
audio.map(item => {
|
|
||||||
if (item != '.')
|
|
||||||
result.push(`/static/audio/tts_${item}.mp3`);
|
|
||||||
else
|
|
||||||
result.push(`/static/audio/tts_dot.mp3`);
|
|
||||||
})
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
// 随机数
|
|
||||||
getRandomKey: () => {
|
|
||||||
var max = 99999;
|
|
||||||
var min = 1;
|
|
||||||
return (Date.parse(new Date()) + '' + parseInt(Math.random() * (max - min + 1) + min, 10)).toString();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 语言播报语音数据 加入到队列里面
|
|
||||||
addAudioQueue: (parseStr) => {
|
|
||||||
let audioList = store.state.audioList;
|
|
||||||
audioList[voice.getRandomKey()] = parseStr;
|
|
||||||
store.commit('setData', {
|
|
||||||
key: 'audioList',
|
|
||||||
val: audioList
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 重置播放列表
|
// 重置播放列表
|
||||||
resetPlayList: () => {
|
resetPlayList: () => {
|
||||||
playIndex = 0;
|
playIndex = 0;
|
||||||
@ -204,20 +60,18 @@ const voice = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let audioList = currentAudio;
|
let audioList = currentAudio;
|
||||||
if (currentAudio.length == 0) {
|
// voice.resetPlayList();
|
||||||
const keys = Object.keys(audioList)
|
// if (currentAudio.length == 0) {
|
||||||
if (keys.length) {
|
// const keys = Object.keys(audioList)
|
||||||
currentAudio = Object.values(audioList)[0]
|
// console.log(audioList)
|
||||||
delete audioList[keys[0]]
|
// if (keys.length) {
|
||||||
playIndex = 0
|
// currentAudio = Object.values(audioList)[0]
|
||||||
// store.commit('setData', {
|
// delete audioList[keys[0]]
|
||||||
// key: 'audioList',
|
// playIndex = 0
|
||||||
// val: audioList
|
// } else {
|
||||||
// });
|
// voice.resetPlayList();
|
||||||
} else {
|
// }
|
||||||
voice.resetPlayList();
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log('正在播报:', currentAudio[playIndex]);
|
console.log('正在播报:', currentAudio[playIndex]);
|
||||||
let path = plus.io.convertLocalFileSystemURL(currentAudio[playIndex]);
|
let path = plus.io.convertLocalFileSystemURL(currentAudio[playIndex]);
|
||||||
let currentTime = 0; // 当前流媒体的播放的位置,单位是秒
|
let currentTime = 0; // 当前流媒体的播放的位置,单位是秒
|
||||||
@ -240,14 +94,16 @@ const voice = {
|
|||||||
audioPlayer.start();
|
audioPlayer.start();
|
||||||
isPlaying = audioPlayer.isPlaying();
|
isPlaying = audioPlayer.isPlaying();
|
||||||
// 获取音乐的总时长
|
// 获取音乐的总时长
|
||||||
// console.log(audioPlayer.getDuration());
|
console.log(isPlaying, audioPlayer.getDuration());
|
||||||
// 当前播放进度 getCurrentPosition 毫秒
|
// 当前播放进度 getCurrentPosition 毫秒
|
||||||
}
|
}
|
||||||
|
|
||||||
timer = setInterval(function() {
|
timer = setInterval(function() {
|
||||||
currentTime = platform == 'iOS' ? audioPlayer.currentTime() : audioPlayer
|
currentTime = platform == 'iOS' ? audioPlayer.currentTime() : audioPlayer
|
||||||
.getCurrentPosition() / 1000;
|
.getCurrentPosition() / 1000;
|
||||||
currentDuration = platform == 'iOS' ? audioPlayer.duration() : audioPlayer
|
currentDuration = platform == 'iOS' ? audioPlayer.duration() : audioPlayer
|
||||||
.getDuration() / 1000;
|
.getDuration() / 1000;
|
||||||
|
// console.log(currentTime, currentDuration)
|
||||||
if (currentTime == currentDuration || currentTime == 0) {
|
if (currentTime == currentDuration || currentTime == 0) {
|
||||||
isPlaying = false;
|
isPlaying = false;
|
||||||
voice.clearTimer();
|
voice.clearTimer();
|
||||||
@ -260,10 +116,10 @@ const voice = {
|
|||||||
if (Object.keys(audioList).length == 0 && currentAudio.length == 0) {
|
if (Object.keys(audioList).length == 0 && currentAudio.length == 0) {
|
||||||
voice.resetPlayList();
|
voice.resetPlayList();
|
||||||
}
|
}
|
||||||
voice.playAudio();
|
// voice.playAudio();
|
||||||
}
|
}
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default voice
|
export default voice
|
@ -54,7 +54,7 @@ body {overflow-x: hidden;}
|
|||||||
-o-box-pack: end;
|
-o-box-pack: end;
|
||||||
-ms-flex-pack: end;
|
-ms-flex-pack: end;
|
||||||
-webkit-justify-content: flex-end;
|
-webkit-justify-content: flex-end;
|
||||||
justify-content: flex-end
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.acea-row.row-left {
|
.acea-row.row-left {
|
||||||
-webkit-box-pack: start;
|
-webkit-box-pack: start;
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 7.0 KiB |
Loading…
x
Reference in New Issue
Block a user