Browse Source

denglu

master
tianyi@bogon 3 years ago
parent
commit
8f248ec3ba
  1. 89
      pages/index/addHangOrder.vue
  2. 55
      pages/login/login.vue

89
pages/index/addHangOrder.vue

@ -2,19 +2,17 @@
<template> <template>
<view class=""> <view class="">
<view> <view>
<button size="default" type="default" @tap="inputDialogToggle('attrAdd',categoryId)" <button size="default" type="default" @tap="inputDialogToggle('add',categoryId)"
hover-class="is-hover">新增挂单</button> hover-class="is-hover">新增挂单</button>
</view> </view>
<view class="order-list"> <view class="order-list" v-for="(item, index) in regList" :key="index" @tap="clickCollapse">
<ul> <ul>
<!-- <li v-for="(item, index) in indexList" :key="index" @tap="clickCollapse"> --> <li>
<li @tap="clickCollapse">
<!-- <view class="name">{{item.categoryName}}</view> -->
<view class="name"> <view class="name">
<view>张三的订单</view> <view>{{item.saleName}}</view>
<view class="name-date"> <view class="name-date">
<text>销售员</text> <text>{{item.createByName}}</text>
<text>2023-10-10 12:01:23</text> <text>{{item.createTime}}</text>
</view> </view>
</view> </view>
<view class="btn-list"> <view class="btn-list">
@ -25,11 +23,11 @@
<uni-icons type="bottom" size="25" style="position: absolute;bottom:0;right:30rpx;"></uni-icons> <uni-icons type="bottom" size="25" style="position: absolute;bottom:0;right:30rpx;"></uni-icons>
</li> </li>
</ul> </ul>
</view>
<view class="order-collapse-item" v-if="isCollapse"> <view class="order-collapse-item" v-if="isCollapse">
<view class="collapse-1"> <view class="collapse-1">
<view class="order-notes"> <view class="order-notes">
<text style="color: red;">备注:</text>张三13895968700北京丰台总部基地给张三9折折扣张三13895968700北京丰台总部基地给张三9折折扣张三13895968700北京丰台总部基地给张三9折折扣 <text style="color: red;">备注:</text>
{{item.remark}}
</view> </view>
<view class="shop-list"> <view class="shop-list">
<view class="order-name"> <view class="order-name">
@ -38,10 +36,11 @@
</view> </view>
<view class="specs-name">颜色:黑色,尺码:s码 * 2</view> <view class="specs-name">颜色:黑色,尺码:s码 * 2</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 class="del-icon" @tap="delGoodsPrecs"><uni-icons color="red" type="trash"
size="26"></uni-icons></view>
</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 语音识别弹出层 --> <!-- 语音识别弹出层 -->
<view> <view>
@ -127,6 +126,11 @@
<uni-popup-dialog ref="inputClose" mode="input" title="挂单名称" placeholder="请输入挂单名称" <uni-popup-dialog ref="inputClose" mode="input" title="挂单名称" placeholder="请输入挂单名称"
@confirm="addReg"></uni-popup-dialog> @confirm="addReg"></uni-popup-dialog>
</uni-popup> </uni-popup>
<!-- 编辑挂单 -->
<uni-popup ref="setDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="挂单名称" placeholder="请输入挂单名称"
@confirm="setDetail"></uni-popup-dialog>
</uni-popup>
<!-- 查看大图弹出层 --> <!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff" @change="change"> <uni-popup ref="imgPopup" background-color="#fff" @change="change">
<view class="img-popup-content"> <view class="img-popup-content">
@ -145,7 +149,8 @@
isCollapse: false, isCollapse: false,
voiceText: '', voiceText: '',
recordState: false, recordState: false,
pageNumber: 1 pageNumber: 1,
regList:[]
} }
}, },
onLoad() { onLoad() {
@ -164,7 +169,7 @@
} }
this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => { this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.regList = res.result; this.regList = res.result.records;
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
@ -257,9 +262,13 @@
this.$refs.popup.open(type) this.$refs.popup.open(type)
} }
}, },
//临时改价弹窗 //新增挂单弹窗
inputDialogToggle() { inputDialogToggle(type) {
if(type="add"){
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}else if('edit'){
this.$refs.setDialog.open()
}
}, },
//通过商品id查询商品详细信息 //通过商品id查询商品详细信息
getById(id) { getById(id) {
@ -282,7 +291,7 @@
console.log(e) console.log(e)
this.tui.request("/app/sale/saveOrder", "POST", { this.tui.request("/app/sale/saveOrder", "POST", {
saleName: e saleName: e
}, false, true).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.tui.toast("新增成功") this.tui.toast("新增成功")
this.getRegList(); this.getRegList();
@ -294,9 +303,41 @@
}) })
}, },
//删除商品规格确认弹窗 //删除商品规格确认弹窗
delGoodsPrecs(){ delGoodsPrecs(id) {
this.msgType = type uni.showModal({
this.$refs.alertDialog.open() title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
this.tui.request("/app/sale/delById", "POST", {
id: id
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("删除成功")
this.getRegList();
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
}
})
},
//编辑挂单信息
setDetail(){
this.tui.request("/app/sale/setSaleDetail", "POST", {
saleDetailList:'',
saleId:''
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("删除成功")
this.getRegList();
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
} }
} }
} }
@ -335,20 +376,24 @@
width: 53%; width: 53%;
float: left; float: left;
} }
.del-icon { .del-icon {
position: absolute; position: absolute;
top: 10rpx; top: 10rpx;
right: 10rpx; right: 10rpx;
} }
.shop-list { .shop-list {
margin: 10rpx 0; margin: 10rpx 0;
border-top: 1px solid #fff; border-top: 1px solid #fff;
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
position: relative; position: relative;
} }
.shop-list:last-child { .shop-list:last-child {
border-bottom: none; border-bottom: none;
} }
.name-date { .name-date {
font-size: 28rpx; font-size: 28rpx;
} }
@ -383,19 +428,23 @@
margin: 0 auto; margin: 0 auto;
padding: 20rpx; padding: 20rpx;
} }
.specs-name { .specs-name {
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.order-name { .order-name {
height: 80rpx; height: 80rpx;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
line-height: 80rpx; line-height: 80rpx;
img { img {
height: 32rpx; height: 32rpx;
width: 32rpx; width: 32rpx;
} }
} }
.img-popup-content { .img-popup-content {
width: 500rpx; width: 500rpx;
height: 500rpx; height: 500rpx;

55
pages/login/login.vue

@ -55,13 +55,10 @@
<uni-popup ref="popup" background-color="#fff" @change="change"> <uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content"> <view class="popup-content">
<view class="popup-title"> <view class="popup-title">
<text>选择店铺</text> <text>选择登录店铺</text>
</view> </view>
<view class="popup-container"> <view class="popup-container" v-for="item in shopList" :key="item" @tap="checkShop(item.id)">
<text style="display: inline-block">张三的店</text> <text style="display: inline-block">{{item.shopName}}</text>
</view>
<view class="popup-container">
<text style="display: inline-block">李四的店</text>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@ -105,6 +102,7 @@
choose: false, choose: false,
isChoose: false, isChoose: false,
clock: 60, // 倒计时 clock: 60, // 倒计时
shopList: []
} }
}, },
computed: mapState(['type']), computed: mapState(['type']),
@ -137,9 +135,8 @@
}, },
//登录 //登录
goLogin() { goLogin() {
let data = {} let data = {},
console.log(this.loginWay) loginUrl=''
console.log(this.wayValue)
if (this.loginWay) { //true if (this.loginWay) { //true
data = { data = {
username: this.username, username: this.username,
@ -149,6 +146,7 @@
saveLogin: true, saveLogin: true,
type: this.wayValue type: this.wayValue
} }
loginUrl='/auth/login'
} else { } else {
data = { data = {
phone: this.phone, phone: this.phone,
@ -156,37 +154,53 @@
saveLogin: true, saveLogin: true,
type: this.wayValue type: this.wayValue
} }
loginUrl='/auth/smsLogin'
} }
this.tui.request("/auth/login", "POST", data, true, true).then((res) => { this.tui.request(loginUrl, "POST", data, true, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.setStorageSync("hiver_token", res.result.accessToken) uni.setStorageSync("hiver_token", res.result.accessToken)
let state = { let state = {
token: res.result.accessToken token: res.result.accessToken
} }
this.login(state) this.login(state)
this.getUserInfo().then((type) => { //多店铺的时候,在这里加上打开店铺选择弹窗
console.log('this.type', type) if (res.result.shopList.length > 1 && this.wayValue == 0) {
if (type == 2) { this.shopList = res.result.shopList;
this.toggle("center");
} else if (this.wayValue == 1) { //物流公司登录
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/logistics'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
} else { //下游客户登录
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
// url: '/pages/index/logistics'
url: '/pages/other/custom' url: '/pages/other/custom'
}) })
}, 200) }, 200)
this.tui.toast('登录成功', 2000, true)
}
} else { } else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//多店铺的时候点击选择需要登录的店铺
checkShop(id) {
this.tui.request("/app/sale/delById", "POST", {
id: id
}, false, false).then((res) => {
if (res.code == 200) {
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
// url: '/pages/index/logistics' // url: '/pages/index/logistics'
}) })
}, 200) }, 200)
}
})
//多店铺的时候,在这里加上打开店铺选择弹窗
this.toggle("center");
//end
this.tui.toast('登录成功', 2000, true) this.tui.toast('登录成功', 2000, true)
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
return return
@ -338,6 +352,7 @@
.code-box { .code-box {
display: flex; display: flex;
} }
.popup-content { .popup-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;

Loading…
Cancel
Save