Browse Source

1111

master
guoxing 1 year ago
parent
commit
829e13c516
  1. 9
      common/request.api.js
  2. 2
      custom-tab-bar/index.js
  3. 13
      pages.json
  4. 71
      pages/good/changePersonnel.vue
  5. 292
      pages/good/reservation.vue
  6. 110
      pages/home/cloudCard2.vue
  7. 17
      pages/home/myCellar.vue
  8. 18
      uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

9
common/request.api.js

@ -105,9 +105,18 @@ export default {
addShoppingCart: (params = {}) => request.post("/shoppingcart/addShoppingCart", params),
// 购物车列表
shoppingCartList: (params = {}) => request.post("/shoppingcart/shoppingCartList", params, {}, {}, true),
// 结算 跳过支付
saveGoods: (params = {}) => request.post("/vegetablecellar/saveGoods", params),
// 我的菜窖 类型列表
vegeCellarTypeList: (params = {}) => request.post("/lpkgoods/vegeCellarTypeList", params),
// 我的菜窖 商品列表
vegeCellarList: (params = {}) => request.post("/lpkgoods/vegeCellarList", params),
// 我的菜窖 预约提菜
getStoreBySid: (params = {}) => request.get("/customerstore/getStoreBySid/" + params, params),
// 我的菜窖 预约提菜 选择时间范围
getExtractSaturAndSun: (params = {}) => request.get("/customerstore/isSaturAndSun", params),
// 我的菜窖 保存预约提菜
submissionExtract: (params = {}) => request.post("/lpksreservoorders/submission", params),
}

2
custom-tab-bar/index.js

@ -40,7 +40,7 @@ Component({
{
"pagePath": "/pages/home/myHome",
"text": "我的",
"text": "记录查询",
"iconPath": "/static/bomicon/bom_NotMy.png",
"selectedIconPath": "/static/bomicon/bom_my.png"
}

13
pages.json

@ -278,8 +278,21 @@
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "pages/good/reservation",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/good/changePersonnel",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",

71
pages/good/changePersonnel.vue

@ -0,0 +1,71 @@
<template>
<view style="display: flex;flex-direction: column; background: #f7f7f7;height: 100%;box-sizing: border-box;position: absolute;width: 100%;">
<NavBar ref="nav" navTitle="提菜人信息" :showIcon="true" :supportChange="false">
</NavBar>
<view style="display: flex;flex-direction: column; margin: 10px; border-radius: 15px; background: #fff;
padding: 10px;">
<view style="display: flex;flex-direction: row;align-items: center;">
<text style="font-size: 14px;color: #999;">提菜人</text>
<input placeholder="请输入提菜人"
style="font-size: 25rpx;flex: 1;height: 35px;line-height: 35px;padding-left: 10px;padding-right: 10px; margin-left: 15px;
border-bottom: 1px #EFEFEF solid;padding-bottom: 1px;"
:value="page.name" @input="onKeyInput1" />
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<text style="font-size: 14px;color: #999;">&ensp;&ensp;</text>
<input placeholder="请输入联系电话" type="number" maxlength="11"
style="font-size: 25rpx;flex: 1;height: 35px;line-height: 35px;padding-left: 10px;padding-right: 10px; margin-left: 15px;"
:value="page.phone" @input="onKeyInput2" />
</view>
</view>
<view
style=" width: 100%; box-sizing: border-box; padding-left: 10vw;padding-right: 10vw;display: flex;flex-direction: row; justify-content: center;align-items: center;">
<text style=" background: #FF9900;color: #fff;margin-top: 20px;margin-bottom: 20px; border-radius: 20px;
padding-top: 10px;padding-bottom: 10px;padding-left: 25vw;padding-right: 25vw; text-align: center;" @click="confirm()">确认</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
page: {
name: "",
phone: ""
}
}
},
onLoad(options) {
this.page.name = options.name
this.page.phone = options.phone
},
methods: {
onKeyInput1(event) {
this.page.name = event.target.value
},
onKeyInput2(event) {
this.page.phone = event.target.value
},
confirm() {
uni.$emit('changePer', this.page)
uni.navigateBack()
},
}
}
</script>
<style lang="scss">
</style>

292
pages/good/reservation.vue

@ -0,0 +1,292 @@
<template>
<view style="width: 100%;height: 100%;overflow: scroll;position: absolute;">
<NavBar ref="nav" navTitle="预约提菜" :showIcon="true" :supportChange="false">
</NavBar>
<loading-state ref="pageView" @request="request">
<view style="background: #FFA35A;width: 100%;height: 100%;overflow: scroll;position: absolute;">
<view style="display: flex;flex-direction: column;background: #F2F2F2; width: 100%;
border-radius: 25px;height: 100vh; padding: 10px;box-sizing: border-box;position: absolute;">
<view style="display: flex;flex-direction: column;background: #fff;
border-radius: 15px;padding: 15px 10px;">
<view
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<text
style="font-size: 16px;color: #000; font-weight: 600;font-family: sans-serif;">{{info.storeName}}</text>
<view style="display: flex;flex-direction: row;align-items: center;" @click="address()">
<text style="font-size: 12px;color: #FF9900;">切换</text>
<image src="../../static/right_icon.png"
style="width: 15px;height: 15px;margin-left: 5px;">
</image>
</view>
</view>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;">
<image src="https://supervise.yxtsoft.com/lpk/image/date.png"
style="width:20px;height: 20px;">
</image>
<text
style="margin-left: 5px;flex: 1;color: #666;font-size: 14px;">{{info.businessHours}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;">
<image src="https://supervise.yxtsoft.com/lpk/image/location.png"
style="width: 20px;height: 20px;">
</image>
<text style="margin-left: 5px;flex: 1; color: #666;font-size: 14px;">{{info.address}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: center;margin-top: 1;">
<text
style="font-size: 14px;color: #000; font-weight: 600;font-family: sans-serif; flex: 1;">提货时间</text>
<uni-datetime-picker type="date" v-model="info.reserveDate":start="info.start" :end="info.end":disabledDate="disabledDate" />
</view>
</view>
<view style="margin-top: 10px;display: flex;flex-direction: row;background: #fff;align-items: center;
border-radius: 15px;padding: 15px 10px;justify-content: space-between;">
<text style="font-size: 14px;color: #000; font-weight: 600;font-family: sans-serif;">提菜人</text>
<view style="display: flex;flex-direction: row;align-items: center;" @click="changePer()">
<text
style="font-size: 14px;color: #000; font-weight: 600;font-family: sans-serif;">{{info.name}}</text>
<text style="font-size: 12px;color: #999; margin-left: 8px;">{{info.phone}}</text>
<image src="../../static/right_icon.png" style="width: 15px;height: 15px;margin-left: 5px;">
</image>
</view>
</view>
<view
style="margin-top: 10px;display: flex;flex-direction: column;background: #fff;border-radius: 15px;padding: 10px;">
<text
style="font-size: 15px; color: #000; font-weight: 600;font-family: sans-serif;">所提菜列表</text>
<view style="width: 100%; display: flex;flex-direction: column; margin-top: 10px;">
<view v-for="(item,index) in pickingUpGoods" @click="itemClick(item.goodsSid)"
style="display: flex;flex-direction: column;justify-content: center;width: 100%; margin-top: 15px; ">
<view style="display: flex;flex-direction: row;align-items: center;width: 100%; ">
<image :src="item.iconUrl" style="width: 90px;height: 90px; border-radius: 10px; "
mode="aspectFill">
</image>
<view
style="display: flex;flex-direction: column;flex: 1; padding-bottom: 15px; margin-left: 10px;"
:style="{'border-bottom':(index == pickingUpGoods.length-1 ? 'none' : '1px #EFEFEF solid')}">
<text style="font-size: 13px;color: #000;">{{item.name}}</text>
<text
style="font-size: 10px;color: #999;margin-top: 5px;">{{item.remark}}</text>
<view
style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;">
<text
style="border: 1px #EE752F solid; border-radius: 5px; padding: 0px 8px;
font-size: 10px;color: #EE752F; margin-right: 10px; ">{{item.weight}}{{item.specificationUnit}}/{{item.unitName}}</text>
<text
style="border: 1px #EE752F solid; background: #FF9900; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
v-if="item.type=='0'">百姓菜!</text>
<text
style="border: 1px #3AA15F solid; background: #40C772; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
v-if="item.type=='1'">精品菜!</text>
<text
style="border: 1px #1D60C7 solid; background: #2489F7; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
v-if="item.type=='2'">企业菜!</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between; margin-top: 15px;
margin-right: 15px;">
<view style="display: flex;flex-direction: row;align-items: center;">
<text style="font-size: 12px;color: #FF5006;">剩余</text>
<text
style="font-size: 14px;color: #FF5006;">{{item.goodsNumber}}{{item.unitName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<image src="../../static/jian_icon.png" mode="aspectFill"
style="width: 20px;height: 20px;" @click.stop="jian(item)">
</image>
<text
style="font-size: 14px;margin-left: 8px;margin-right: 8px;">{{item.count}}</text>
<image src="../../static/jia_icon.png" mode="aspectFill"
style="width: 20px;height: 20px;" @click.stop="jia(item)">
</image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view
style="position: fixed;bottom: 0; width: 100%; box-sizing: border-box; padding-left: 10vw;padding-right: 10vw;display: flex;flex-direction: row; justify-content: center;align-items: center;">
<text style=" background: #FF9900;color: #fff;margin-top: 20px;margin-bottom: 20px; border-radius: 20px;
padding-top: 10px;padding-bottom: 10px;padding-left: 25vw;padding-right: 25vw; text-align: center;"
@click="congirmExtract()">确认提菜</text>
</view>
</view>
</view>
</loading-state>
</view>
</template>
<script>
export default {
data() {
return {
affiliation: "",
info: {
},
pickingUpGoods: [],
disabledDate: [
// '2023-12-16'
],
}
},
onLoad(options) {
uni.$on("address", (e) => {
//
this.info.storeSid = e.sid;
this.info.storeName = e.name;
this.info.businessHours = e.businessHours;
this.info.address = e.address;
})
uni.$on("changePer", (e) => {
//
this.info.name = e.name;
this.info.phone = e.phone;
})
this.request()
this.getSun()
this.pickingUpGoods = JSON.parse(options.pickingUpGoods)
this.affiliation = options.affiliation
},
onUnload() {
uni.$off('address');
uni.$off('changePer');
},
methods: {
getSun() {
let _this = this
_this.$api.getExtractSaturAndSun().then((resp) => {
_this.disabledDate = resp
}).catch(e => {
})
},
address() {
uni.navigateTo({
url: '/pages/SelectAddressActivity'
})
},
changePer() {
uni.navigateTo({
url: '/pages/good/changePersonnel?name=' + this.info.name + "&phone=" + this.info.phone
})
},
//
request() {
let _this = this
_this.$api.getStoreBySid(getApp().globalData.sid).then((resp) => {
_this.info = resp
_this.$nextTick(() => {
_this.$refs.pageView.setLoadState(2)
})
}).catch(e => {
console.log(e);
})
},
congirmExtract() {
let _this = this
let list = []
for (var i = 0; i < this.pickingUpGoods.length; i++) {
var item = this.pickingUpGoods[i]
if (item.count > 0)
list.push({
goodsSid: item.goodsSid,
select: item.count,
})
}
// console.log("ddd", list);
if (list.length == 0) {
this.shortToast('请添加商品')
return
}
var params = {
customerSid: getApp().globalData.sid,
affiliation: _this.affiliation,
reserveDate: _this.info.reserveDate,
storeSid: _this.info.storeSid,
userName: _this.info.name,
userPhone: _this.info.phone,
goodsVos: list
}
console.log("pppp", params);
_this.$api.submissionExtract(params).then((resp) => {
uni.navigateBack()
}).catch(e => {
console.log(e);
})
},
}
}
</script>
<style>
</style>

110
pages/home/cloudCard2.vue

@ -7,6 +7,15 @@
<NavBar ref="nav" navTitle=" " :showIcon="false" :start-change-height="page.startHeight"
:end-change-height="page.endHeight">
</NavBar>
<!-- <view style="background: #F7F7F7; opacity: 0.5; border-radius: 20px;display: flex;flex-direction: row;align-items: center;
padding-left: 10px; margin-left: 20px;width: 40vw; margin-top: 5vh;">
<image src="../../static/search_icon.png" mode="aspectFill" style="width: 25px;height: 25px;">
</image>
<input placeholder="搜索"
style="font-size: 25rpx;flex: 1;height: 35px;line-height: 35px;padding-left: 10px;padding-right: 10px;"
:value="searchInfo.name" @input="onKeyInput" />
</view> -->
<view style="display: flex;flex-direction: row;align-items: center;justify-content: center;;
padding-left: 10vw;padding-right: 10vw; margin-top: 40vw;">
@ -99,8 +108,9 @@
<image :src="item.iconUrl" style="width: 90px;height: 90px; border-radius: 10px; "
mode="aspectFill"></image>
<view style="display: flex;flex-direction: column;flex: 1; padding-bottom: 15px; margin-left: 10px;"
:style="{'border-bottom':(index == goods.length-1 ? 'none' : '1px #EFEFEF solid')}">
<view
style="display: flex;flex-direction: column;flex: 1; padding-bottom: 15px; margin-left: 10px;"
:style="{'border-bottom':(index == goods.length-1 ? 'none' : '1px #EFEFEF solid')}">
<text style="font-size: 13px;color: #000;">{{item.name}}</text>
@ -219,8 +229,17 @@
</view>
</view>
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="base" title="订购协议" :showConfirm="true"
:beforeClose="dialogBeforeClose" @confirm="dialogInputConfirm" :content="dialogContent"
:confirm-text="confirmText"></uni-popup-dialog>
</uni-popup>
</view>
</template>
@ -229,6 +248,10 @@
export default {
data() {
return {
dialogContent: "这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容这里是协议内容,这里是协议内容",
confirmText: "我知道了(5s)",
dialogBeforeClose: false,
countdown: 5,
scrollHeight: "",
scrollLeftTop: "0",
scrollRightTop: "0",
@ -283,7 +306,7 @@
}
this.getAllPriceOrWeight()
this.getgoods()
this.getgoods()
},
onLoad() {
@ -294,7 +317,7 @@
this.page.endHeight = info.windowWidth * 0.8
this.request()
// this.getallPrice()
// this.getweight()
// this.getcount()
@ -517,10 +540,10 @@
settlement() {
//
// if (this.page.weight < 200) {
// this.shortToast('200')
// return
// }
if (this.page.weight < 20) {
this.shortToast('满200斤才可定制云菜窖哦,请继续选菜吧。')
return
}
let list = []
@ -544,19 +567,78 @@
return
}
this.showPop()
// console.log("params", params);
// let _this = this
// _this.$api.createOrder(params).then((resp) => {
// // console.log("resp", resp);
// this.$pay(resp)
// }).catch(e => {})
},
showPop() {
this.$refs.inputDialog.open()
let timeOut = setInterval(() => {
if (this.countdown == 1) {
this.confirmText = "确定"
this.countdown = 5
this.dialogBeforeClose = false
clearInterval(timeOut)
} else {
this.dialogBeforeClose = true
this.countdown = this.countdown - 1;
this.confirmText = "我知道了" + "(" + this.countdown + "s)"
}
}, 1000)
},
dialogInputConfirm(val) {
if (this.confirmText == "确定") {
this.confirmText = "我知道了(5s)",
this.dialogBeforeClose = true,
this.countdown = 5
this.saveGoods()
}
},
saveGoods() {
let list = []
for (var i = 0; i < this.goods.length; i++) {
var item = this.goods[i]
if (item.goodsNumber > 0)
list.push({
goodsSid: item.goodsSid,
goodsNumber: item.goodsNumber,
})
}
// console.log("ddd", list);
if (list.length == 0) {
this.shortToast('请添加商品')
return
}
var params = {
customerSid: getApp().globalData.sid,
cardNumber: 1,
totalTee: this.page.price,
ordOrderDetailsVoList: list
affiliation: this.brandType,
vos: list
}
// console.log("params", params);
let _this = this
_this.$api.createOrder(params).then((resp) => {
_this.$api.saveGoods(params).then((resp) => {
// console.log("resp", resp);
this.$pay(resp)
_this.request()
}).catch(e => {})
},

17
pages/home/myCellar.vue

@ -135,7 +135,7 @@
style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<image src="https://supervise.yxtsoft.com/lpk/image/buchongcaijiao.png"
mode="aspectFit" style="width: 15vm;height: 15vm;"></image>
mode="aspectFit" style="width: 50vw;height: 50vw;"></image>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;">
<text style="font-size: 14px; color: #666;margin-right: 5px;">您的菜窖为空,</text>
<text
@ -399,6 +399,9 @@
})
}
this.request()
this.page.count=0
},
onHide() {
this.colseDialog()
@ -411,7 +414,7 @@
this.page.startHeight = info.windowWidth * 0.6
this.page.endHeight = info.windowWidth * 0.8
this.request()
},
methods: {
@ -507,7 +510,12 @@
},
reservation() {
if (this.pickingUpGoods.length > 0){
this.showModal = true
uni.navigateTo({
url: '/pages/good/reservation?pickingUpGoods='+JSON.stringify(this.pickingUpGoods)+"&affiliation="+this.brandType,
})
// this.showModal = true
}else{
this.shortToast('请先选择商品')
}
@ -561,6 +569,7 @@
opacity: 0.5;
top: 0;
left: 0;
bottom: 65;
}
.modalDlg {
@ -571,8 +580,8 @@
top: 50vw;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
opacity:1;
background-color: #fff;
border-top-right-radius: 20px;
border-top-left-radius: 20px;

18
uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

@ -13,7 +13,7 @@
<input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" >
</slot>
</view>
<view class="uni-dialog-button-group">
<view class="uni-dialog-button-group" v-if="!showConfirm">
<view class="uni-dialog-button" @click="closeDialog">
<text class="uni-dialog-button-text">{{closeText}}</text>
</view>
@ -21,6 +21,13 @@
<text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
</view>
</view>
<!-- 倒计时按钮 -->
<view class="uni-dialog-button-group" v-if="showConfirm">
<view class="uni-dialog-button uni-border-left" @click="onOk">
<text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
</view>
</view>
</view>
</template>
@ -96,17 +103,22 @@
confirmText:{
type: String,
default: ''
}
},
showConfirm: {
type: Boolean,
default: false
},
},
data() {
return {
dialogType: 'error',
dialogType: 'warn',
focus: false,
val: ""
}
},
computed: {
okText() {
console.log('confirmText',this.confirmText);
return this.confirmText || t("uni-popup.ok")
},
closeText() {

Loading…
Cancel
Save