Browse Source

denglu

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

159
pages/index/addHangOrder.vue

@ -2,19 +2,17 @@
<template>
<view class="">
<view>
<button size="default" type="default" @tap="inputDialogToggle('attrAdd',categoryId)"
<button size="default" type="default" @tap="inputDialogToggle('add',categoryId)"
hover-class="is-hover">新增挂单</button>
</view>
<view class="order-list">
<view class="order-list" v-for="(item, index) in regList" :key="index" @tap="clickCollapse">
<ul>
<!-- <li v-for="(item, index) in indexList" :key="index" @tap="clickCollapse"> -->
<li @tap="clickCollapse">
<!-- <view class="name">{{item.categoryName}}</view> -->
<li>
<view class="name">
<view>张三的订单</view>
<view>{{item.saleName}}</view>
<view class="name-date">
<text>销售员</text>
<text>2023-10-10 12:01:23</text>
<text>{{item.createByName}}</text>
<text>{{item.createTime}}</text>
</view>
</view>
<view class="btn-list">
@ -24,24 +22,25 @@
</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>
</ul>
<view class="order-collapse-item" v-if="isCollapse">
<view class="collapse-1">
<view class="order-notes">
<text style="color: red;">备注:</text>
{{item.remark}}
</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>
<!-- 语音识别弹出层 -->
<view>
@ -126,6 +125,11 @@
<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="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">
@ -145,7 +149,8 @@
isCollapse: false,
voiceText: '',
recordState: false,
pageNumber: 1
pageNumber: 1,
regList:[]
}
},
onLoad() {
@ -164,7 +169,7 @@
}
this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => {
if (res.code == 200) {
this.regList = res.result;
this.regList = res.result.records;
} else {
this.tui.toast(res.message)
}
@ -257,9 +262,13 @@
this.$refs.popup.open(type)
}
},
//临时改价弹窗
inputDialogToggle() {
this.$refs.inputDialog.open()
//新增挂单弹窗
inputDialogToggle(type) {
if(type="add"){
this.$refs.inputDialog.open()
}else if('edit'){
this.$refs.setDialog.open()
}
},
//通过商品id查询商品详细信息
getById(id) {
@ -282,7 +291,7 @@
console.log(e)
this.tui.request("/app/sale/saveOrder", "POST", {
saleName: e
}, false, true).then((res) => {
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("新增成功")
this.getRegList();
@ -292,11 +301,43 @@
}).catch((res) => {
this.tui.toast(res)
})
},
//删除商品规格确认弹窗
delGoodsPrecs(id) {
uni.showModal({
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)
})
}
})
},
//删除商品规格确认弹窗
delGoodsPrecs(){
this.msgType = type
this.$refs.alertDialog.open()
//编辑挂单信息
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)
})
}
}
}
@ -334,21 +375,25 @@
.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;
}
.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;
}
@ -383,19 +428,23 @@
margin: 0 auto;
padding: 20rpx;
}
.specs-name{
padding-bottom: 20rpx;
.specs-name {
padding-bottom: 20rpx;
}
.order-name {
height: 80rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 80rpx;
img{
height: 32rpx;
width: 32rpx;
line-height: 80rpx;
img {
height: 32rpx;
width: 32rpx;
}
}
.img-popup-content {
width: 500rpx;
height: 500rpx;

197
pages/login/login.vue

@ -49,22 +49,19 @@
<view class="" @tap="goRegister">新店铺注册</view>
<view class="" @tap="switchLoginWay">{{loginWay ? '验证码登录' : '账号密码登录'}}</view>
</view>
</view>
<!-- 多店铺的时候,选择店铺的弹窗 -->
<view>
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content">
<view class="popup-title">
<text>选择店铺</text>
</view>
<view class="popup-container">
<text style="display: inline-block">张三的店</text>
</view>
<view class="popup-container">
<text style="display: inline-block">李四的店</text>
</view>
</view>
</uni-popup>
</view>
<!-- 多店铺的时候,选择店铺的弹窗 -->
<view>
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content">
<view class="popup-title">
<text>选择登录店铺</text>
</view>
<view class="popup-container" v-for="item in shopList" :key="item" @tap="checkShop(item.id)">
<text style="display: inline-block">{{item.shopName}}</text>
</view>
</view>
</uni-popup>
</view>
</view>
</template>
@ -105,6 +102,7 @@
choose: false,
isChoose: false,
clock: 60, // 倒计时
shopList: []
}
},
computed: mapState(['type']),
@ -127,8 +125,8 @@
this.captchaId = res.result
this.captchaImg = this.tui.interfaceUrl() + '/common/captcha/draw/' + this
.captchaId
}else{
this.tui.toast(res.message)
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
@ -137,9 +135,8 @@
},
//登录
goLogin() {
let data = {}
console.log(this.loginWay)
console.log(this.wayValue)
let data = {},
loginUrl=''
if (this.loginWay) { //true
data = {
username: this.username,
@ -148,45 +145,62 @@
captchaId: this.captchaId,
saveLogin: true,
type: this.wayValue
}
}
loginUrl='/auth/login'
} else {
data = {
phone:this.phone,
phone: this.phone,
code: this.code,
saveLogin: true,
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) {
uni.setStorageSync("hiver_token", res.result.accessToken)
let state = {
token: res.result.accessToken
}
this.login(state)
this.getUserInfo().then((type) => {
console.log('this.type', type)
if (type == 2) {
setTimeout(() => {
uni.reLaunch({
// url: '/pages/index/logistics'
url: '/pages/other/custom'
})
}, 200)
} else {
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
// url: '/pages/index/logistics'
})
}, 200)
}
})
//多店铺的时候,在这里加上打开店铺选择弹窗
this.toggle("center");
//end
this.tui.toast('登录成功', 2000, true)
//多店铺的时候,在这里加上打开店铺选择弹窗
if (res.result.shopList.length > 1 && this.wayValue == 0) {
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(() => {
uni.reLaunch({
url: '/pages/other/custom'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}
} 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(() => {
uni.reLaunch({
url: '/pages/index/index'
// url: '/pages/index/logistics'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
} else {
this.tui.toast(res.message)
return
@ -199,16 +213,16 @@
this.choose = true
this.setTime()
this.tui.request("/common/captcha/sendLoginSms/" + this.phone, "GET", {
type:this.wayValue
type: this.wayValue
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "发送成功",
icon: 'success'
})
}else{
this.tui.toast(res.message)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
} else if (reg(this.phone, this.clock) && this.isChoose == true) {
console.log('通过了')
@ -248,11 +262,11 @@
uni.navigateTo({
url: '/pages/common/protocol/protocol'
})
},
//打开弹出层
toggle(type) {
this.type = type
this.$refs.popup.open(type)
},
//打开弹出层
toggle(type) {
this.type = type
this.$refs.popup.open(type)
},
}
}
@ -337,40 +351,41 @@
.code-box {
display: flex;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: auto;
background-color: #fff;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20rpx;
height: 100rpx;
border-radius: 10px;
background: #088FEB;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
color: #fff;
}
.phone-btn {
width: 150rpx;
height: 75rpx;
color: #088FEB;
line-height: 75rpx;
font-size: 26rpx;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: auto;
background-color: #fff;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20rpx;
height: 100rpx;
border-radius: 10px;
background: #088FEB;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
color: #fff;
}
.phone-btn {
width: 150rpx;
height: 75rpx;
color: #088FEB;
line-height: 75rpx;
font-size: 26rpx;
}
</style>
Loading…
Cancel
Save