平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

604 lines
14 KiB

<!-- 新增挂单 -->
<template>
<view class="">
<view>
<button size="default" type="default" @tap="inputDialogToggle('attrAdd',categoryId)"
hover-class="is-hover">新增挂单</button>
</view>
<view class="order-list">
<ul>
<!-- <li v-for="(item, index) in indexList" :key="index" @tap="clickCollapse"> -->
<li @tap="clickCollapse">
<!-- <view class="name">{{item.categoryName}}</view> -->
<view class="name">
<view>张三的订单</view>
<view class="name-date">
<text>销售员</text>
<text>2023-10-10 12:01:23</text>
</view>
</view>
<view class="btn-list">
<view class="bj-btn" @tap.stop="inputDialogToggle('edit', item)">编辑</view>
<view class="bj-btn" @tap.stop="scanCodeAdd">扫码开单</view>
<view class="bj-btn" @tap="toggle('center')">语音备注</view>
</view>
<uni-icons type="bottom" size="25" style="position: absolute;bottom:0;right:30rpx;"></uni-icons>
</li>
</ul>
</view>
<view class="order-collapse-item" v-if="isCollapse">
<view class="collapse-1">
<view class="order-notes">
<text style="color: red;">备注:</text>张三13895968700北京丰台总部基地给张三9折折扣张三13895968700北京丰台总部基地给张三9折折扣张三13895968700北京丰台总部基地给张三9折折扣
</view>
<view class="shop-list">
<view class="order-name">
女士连衣裙(HD738206579)
<img src="/static/images/datu.png" @tap="largeImg" alt="">
</view>
<view class="specs-name">颜色:黑色,尺码:s码 * 2</view>
<view class="specs-name">颜色:黑色,尺码:s码 * 2</view>
<view class="del-icon" @tap="delGoodsPrecs"><uni-icons color="red" type="trash" size="26"></uni-icons></view>
</view>
</view>
</view>
<!-- 语音识别弹出层 -->
<view>
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content">
<view class="popup-title">
<text>语音录入</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view>
<view class="popup-container">
<textarea name="" id="" style="width:100%;border:1px solid #eee;" v-model="voiceText"
placeholder="等待语音识别中..."></textarea>
<view>
<text style="color:red;font-size:22rpx;">*长按“语音”按钮录入,系统将自动识别</text>
</view>
<view class="popup-bottom">
<view class="popup-btn" @touchstart="kaishi" @touchend="jieshu">语音</view>
<view class="popup-btn" @tap="">确认</view>
</view>
</view>
</view>
</uni-popup>
</view>
<view class="voice-model" v-if="recordState == true">
<img src="/static/images/maikefeng.png" alt="">
<view class="voice-text">语音识别中...</view>
</view>
<!-- 商品弹出层 -->
<view>
<uni-popup ref="shopPopup" background-color="#fff" @change="change">
<view class="shop-popup-content">
<view class="shop-popup-title">
<view class="shop-popup-title-left">
<img src="/static/images/logo.png" alt="">
</view>
<view class="shop-popup-title-right">
<view class="shop-popup-title-right-box" style="color: #088FEB;">创意小众单肩包</view>
<view class="shop-popup-title-right-box">QS2023101001</view>
<view class="shop-popup-title-right-box" style="color: darkorange;"
@tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥0.00</text>
<text style="color: 088FEB;">临时改价</text>
</view>
</view>
</view>
<view class="shop-popup-container">
<ul>
<!-- <li v-for="items in attrList" :key="items.id"> -->
<li>
<view class="shop-title-fur">
<view class="shop-name">男装</view>
</view>
<view class="shop-content-fur">
<!-- <view class="content-low" v-for="item in items.attributeValue" :key="item.id" @tap="delItem(item, 'attrNameDel')">男装</view> -->
<view class="shop-content-low">男装</view>
</view>
</li>
</ul>
<view class="shop-checkList">
<view class="shop-checkList-box">
<text>女装</text>
<text>S码</text>
<text>黄色</text>
</view>
<uni-number-box :value="numberValue" @change="change" />
</view>
</view>
<view class="shop-popup-bottom">
<view class="shop-popup-bottom-left">
<text>2 款 9 件</text>
<text>¥2952.00</text>
</view>
<view class="shop-popup-bottom-right">
<view class="bottom-btn" @tap="">选好了</view>
</view>
</view>
</view>
</uni-popup>
</view>
<!-- 新增挂单输入框 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="挂单名称" placeholder="请输入挂单名称"
@confirm="addReg"></uni-popup-dialog>
</uni-popup>
<!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff" @change="change">
<view class="img-popup-content">
<img src="/static/images/logo.png" alt="" style="width: 100%;height: 100%;">
</view>
</uni-popup>
</view>
</template>
<script>
var plugin = requirePlugin("WechatSI")
let manager = plugin.getRecordRecognitionManager()
export default {
data() {
return {
isCollapse: false,
voiceText: '',
recordState: false,
pageNumber: 1
}
},
onLoad() {
this.getRegList();
this.initRecord();
},
methods: {
//挂单列表
getRegList() {
let obj = {
status: "7",
pageVo: {
pageNumber: this.pageNumber,
pageSize: 10
}
}
this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => {
if (res.code == 200) {
this.regList = res.result;
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
},
//点击切换折叠状态
clickCollapse() {
this.isCollapse = !this.isCollapse
},
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
//关闭弹出层
close() {
this.$refs.popup.close()
},
//按住语音识别,开始
kaishi() {
wx.vibrateShort()
this.recordState = true
manager.start({
duration: 60000,
lang: "zh_CN"
});
},
//松开语音识别,结束
jieshu() {
this.recordState = false
manager.stop()
},
//语音内容为空
showRecordEmptyTip() {
uni.showToast({
title: "请重新说一遍",
icon: 'error'
})
},
//语音识别功能初始化
initRecord() {
//有新的识别内容返回,则会调用此事件
manager.onRecognize = (res) => {
this.voiceText = res.result
}
manager.onStart = function(res) {
this.voiceText = "onStart:" + res.msg + "正在录音"
}
// 识别结束事件
manager.onStop = (res) => {
this.voiceText = res.result
if (res.result == '') {
this.showRecordEmptyTip()
return
} else {
uni.showModal({
content: JSON.stringify(res)
})
}
}
// 识别错误事件
manager.onError = (res) => {
this.voiceText = res.msg;
}
},
//扫一扫功能
scanCodeAdd() {
uni.scanCode({
success: (res) => {
console.log(typeof(res.result))
this.toggle('bottom', res.result);
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
//弹出商品规格选择
toggle(type, id) {
this.type = type
if (type == 'bottom') {
this.$refs.shopPopup.open(type)
this.getById(id);
} else {
this.$refs.popup.open(type)
}
},
//临时改价弹窗
inputDialogToggle() {
this.$refs.inputDialog.open()
},
//通过商品id查询商品详细信息
getById(id) {
this.tui.request("/app/product/getById", "POST", {
id: id
}, false, true).then((res) => {
if (res.code == 200) {
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//查看大图
largeImg() {
this.$refs.imgPopup.open()
},
//新增挂单
addReg(e) {
console.log(e)
this.tui.request("/app/sale/saveOrder", "POST", {
saleName: e
}, false, true).then((res) => {
if (res.code == 200) {
this.tui.toast("新增成功")
this.getRegList();
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
},
//删除商品规格确认弹窗
delGoodsPrecs(){
this.msgType = type
this.$refs.alertDialog.open()
}
}
}
</script>
<style lang="scss" scoped>
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
margin-top: 20upx;
}
.order-list {
width: 95%;
border-radius: 10upx;
background: #fff;
height: auto;
margin: 20upx auto;
}
.order-list ul {}
.order-list li {
width: 100%;
height: 160rpx;
line-height: 80rpx;
font-size: 37rpx;
border-bottom: 0.5px solid #eee;
margin: 0 auto;
position: relative;
}
.name {
width: 53%;
float: left;
}
.del-icon{
position: absolute;
top: 10rpx;
right: 10rpx;
}
.shop-list{
margin: 10rpx 0;
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
position: relative;
}
.shop-list:last-child{
border-bottom: none;
}
.name-date {
font-size: 28rpx;
}
.bj-btn {
width: auto;
/* height: 60rpx; */
font-size: 26rpx;
background: #fff;
margin: 0;
float: left;
padding-right: 20rpx;
color: blue;
text-decoration: underline;
}
.save-btn {
width: 95%;
height: 80rpx;
text-align: center;
line-height: 80rpx;
margin: 0 auto;
background: #088FEB;
color: #fff;
}
.order-collapse-item {
background: #eee;
height: auto;
width: 95%;
border-radius: 20rpx;
margin: 0 auto;
padding: 20rpx;
}
.specs-name{
padding-bottom: 20rpx;
}
.order-name {
height: 80rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 80rpx;
img{
height: 32rpx;
width: 32rpx;
}
}
.img-popup-content {
width: 500rpx;
height: 500rpx;
}
.order-notes {
height: 100rpx;
line-height: 50rpx;
text-overflow: ellipsis;
overflow: hidden;
white-space: pre-wrap;
text-overflow: -o-ellipsis-lastline;
display: -webkit-box; //特别显示模式
-webkit-line-clamp: 2; //行数
line-clamp: 2;
-webkit-box-orient: vertical; //盒子中内容竖直排列
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: 600rpx;
background-color: #fff;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20rpx;
}
.popup-bottom {
display: flex;
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 50rpx;
}
.popup-btn {
flex: 1;
text-align: center;
background: linear-gradient(90deg, #FF9797, #FFC1E0);
}
.popup-btn:last-child {
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
.voice-model {
width: 300rpx;
height: 300rpx;
display: flex;
justify-content: center;
flex-flow: column;
position: fixed;
left: 50%;
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;
color: #fff;
text-align: center;
margin-left: -150rpx;
z-index: 999;
}
.voice-model img {
width: 200rpx;
height: 200rpx;
margin: 0 auto;
}
.btn-list {
width: 47%;
float: left;
}
.shop-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
height: 1200rpx;
background-color: #fff;
}
.shop-popup-title-right-box {
height: 50rpx;
line-height: 50rpx;
}
.shop-popup-title-right {
width: 400rpx;
margin-left: 30rpx;
}
.shop-popup-title-left {
width: 150rpx;
height: 150rpx;
}
.shop-popup-title-left image {
width: 150rpx;
height: 150rpx;
}
.shop-popup-title {
display: flex;
height: 180rpx;
border-bottom: 1px solid #eee;
}
.shop-popup-container {
width: 95%;
border-radius: 10upx;
background: #fff;
height: auto;
margin: 20upx auto;
}
.shop-title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
}
.shop-name {
font-size: 30rpx;
width: 50%;
float: left;
height: 70rpx;
line-height: 70rpx;
}
.shop-content-fur {
padding-bottom: 25rpx;
}
.shop-content-low {
width: auto;
border: 1px solid #eee;
display: inline-block;
min-width: 90rpx;
padding: 5rpx;
font-size: 35rpx;
text-align: center;
color: #777;
margin: 20rpx 0 0 20rpx;
}
.shop-content-low:hover {
background: #eee;
}
.shop-checkList {
display: flex;
height: 50rpx;
font-size: 28rpx;
line-height: 50rpx;
padding: 20rpx 10rpx;
border-top: 1px solid #eee;
}
.shop-checkList-box {
height: 50rpx;
width: 60%;
}
.shop-popup-bottom {
width: 100%;
height: 100rpx;
position: fixed;
bottom: 0;
display: flex;
}
.shop-popup-bottom-left {
width: 50%;
line-height: 80rpx;
}
.shop-popup-bottom-right {
width: 50%;
line-height: 100rpx;
.bottom-btn {
width: 70%;
line-height: 35px;
height: 70rpx;
text-align: center;
/* margin-top: 10rpx; */
color: #fff;
font-size: 28rpx;
margin: 0 auto;
background: linear-gradient(90deg, #60F3FF, #088FEB);
border-radius: 70rpx;
}
}
</style>