Browse Source

11111111111

master
guoxing 1 year ago
parent
commit
8bdfcdcb38
  1. 16
      common/request.api.js
  2. 15
      pages.json
  3. 157
      pages/home/myCellar.vue
  4. 28
      pages/home/myHome.vue
  5. 230
      pages/records/orderDetail.vue
  6. 137
      pages/records/orderRecords.vue

16
common/request.api.js

@ -70,9 +70,9 @@ export default {
// 結算商品
createOrder: (params = {}) => request.post("/empsreservoorder/createOrder", params),
// 预约记录
orderListByUserSid: (params = {}) => request.post("/lpksreservoorder/orderListByUserSid", params, {}, {}, true),
orderListByUserSid: (params = {}) => request.post("/lpksreservoorder/orderListByUserSid", params, {}, {}),
// 转赠记录
transferRecordsList: (params = {}) => request.post("/transferrecords/transferRecordsList", params, {}, {}, true),
transferRecordsList: (params = {}) => request.post("/transferrecords/transferRecordsList", params, {}, {}),
// 我的
@ -97,7 +97,15 @@ export default {
// 保存实名
saveRealInfo: (params = {}) => request.post("/lpkcustomer/saveRealInfo", params),
// 我的 预约记录
myOrderListByUserSid: (params = {}) => request.post("/lpksreservoorders/orderListByUserSid", params, {}, {}, true),
myOrderListByUserSid: (params = {}) => request.post("/lpksreservoorders/orderListByUserSid", params, {}, {}),
// 我的 订单列表
ordersList: (params = {}) => request.post("/empsreservoorder/ordersList", params, {}, {}),
// 我的 订单详情
orderDetails: (params = {}) => request.get("/empsreservoorder/OrderDetails/"+params, params, {}, {}, true),
// 我的 订单详情 修改订单状态
changePayState: (params = {}) => request.get("/empsreservoorder/changePayState/"+params, params, {}, {}, true),
// 2024-1-15 新需求
// 获取分类和品牌
@ -120,6 +128,8 @@ export default {
// 我的菜窖 新人礼包列表
newUserQuota: (params = {}) => request.post("/appletgiftbag/newUserQuota", params),
// 结算新人礼包 支付
createNewUserBagOrder: (params = {}) => request.post("/empsreservoorder/createNewUserBagOrder", params),
// 我的菜窖 类型列表
vegeCellarTypeList: (params = {}) => request.post("/lpkgoods/vegeCellarTypeList", params),
// 我的菜窖 商品列表

15
pages.json

@ -328,6 +328,21 @@
"style": {
"navigationStyle": "custom"
}
},
{
"path" : "pages/records/orderRecords",
"style" :
{
"navigationBarTitleText" : "我的订单",
"disableScroll": true
}
},
{
"path" : "pages/records/orderDetail",
"style" :
{
"navigationBarTitleText" : "订单详情"
}
}

157
pages/home/myCellar.vue

@ -169,30 +169,50 @@
<!-- 礼包列表弹框 -->
<view class="model" catchtouchmove='preventTouchMove' v-if='showModal2'></view>
<view class="modalDlg2" catchtouchmove='preventTouchMove' v-if='showModal2'>
<view style="display: flex;flex-direction: column;justify-content: center;align-items: center;
background: #fff; margin-top: -50px;">
<view style="display: flex;flex-direction: column;
background: #fff; width: 80%; border-radius: 20px; height: 80vw;">
<image src="https://supervise.yxtsoft.com/lpk/image/newpor_top" mode="aspectFill"
style="margin-left: 5vw;margin-right: 5vw; height: 5vw;"></image>
<image src="https://supervise.yxtsoft.com/lpk/image/newpor_top.png" mode="scaleToFill"
style="width: 100%; height: 15vw; flex-shrink: 0;"></image>
<view style="display: flex;flex-direction: column;overflow-y: auto;">
<radio-group bindchange="radioChange">
<view v-for="(item,index) in newPerGiftList" class="device-list">
<view>
<radio :value="item.goodsSid" checked="true" />
<scroll-view scroll-y="true" style="display: flex;flex-direction: column;height: calc(100% - 30vw);"
bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll">
<radio-group @change="radioChange" style="overflow: hidden;box-sizing: border-box;">
<view v-for="(item,index) in newPerGiftList" class="device-list" style="overflow-y: auto;">
<view style="">
<radio :value="item.sid" style="transform:scale(0.8)" color="#FF9900" />
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<view
style="margin-left: 5px; margin-right: 10px; display: flex;flex-direction: row;align-items: center;flex: 1; ">
<image :src="item.iconUrl" mode="aspectFill"
style="border-radius: 8px;width: 36px;height: 36px;"></image>
<text style="font-size: 14px;color: #101010;margin-left: 5px;">{{item.name}}</text>
<text
style="font-size: 14px;color: #101010;margin-left: 10px;">{{item.weight}}{{item.specificationUnit}}</text>
<text style="font-size: 16px;color: #FF5006;margin-left: 20px;">{{item.name}}</text>
<text
style="font-size: 14px;color: #999;text-decoration:line-through;margin-left: 10px;">{{item.mefenPrice}}</text>
style="border-radius: 8px;width: 46px;height: 46px;"></image>
<view style="display: flex;flex-direction: column; margin-left: 10px; flex: 1;">
<view
style="display: flex;flex-direction: row;align-items: center;box-sizing: border-box;">
<text style="font-size: 14px;color: #101010;margin-right: 10px;
flex: 1; ">{{item.name}}</text>
<text
style="font-size: 16px;color: #FF5006;font-weight: 600; flex-shrink:0;">{{item.prefPrice}}</text>
</view>
<view
style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;">
<text style="font-size: 12px;color: #666;flex: 1;">{{item.weight}}</text>
<text
style="font-size: 12px;color: #999;text-decoration:line-through;margin-left: 10px;">{{item.price}}</text>
</view>
</view>
</view>
</view>
@ -200,15 +220,21 @@
</view>
</scroll-view>
<view>
<text>确认结算</text>
<view
style=" height: 15vw; flex-shrink: 0;display: flex;flex-direction: row;align-items: center;justify-content: center;"
class="newpor_bom">
<text style="background: #FF9900;color: #fff;text-align: center;border-radius: 20px;
padding:8px 25px ;" @click="newporGift">确认结算</text>
</view>
</view>
<image src="../../static/close.png" mode="aspectFill" style="width: 28px;height: 28px;margin-top: 10px;"
@click="colseDialog2()"></image>
</view>
<!-- 转赠弹框 -->
@ -225,7 +251,7 @@
<view style="display: flex;flex-direction: column;">
<view v-for="(item,index) in goods"
style="display: flex;flex-direction: row;margin-top: 15px; margin-bottom: 10px;">
style=" display: flex;flex-direction: row;margin-top: 15px; margin-bottom: 10px;">
<view style="display: flex;flex-direction: row;align-items: center;width: 100%; ">
@ -367,15 +393,16 @@
],
transferInfo: {
}
},
newporGiftSid: "",
}
},
created() {
console.log("==========", getApp().globalData.isNewUser);
// if (getApp().globalData.isNewUser=='1')
// this.showModal = true
// console.log("==========", getApp().globalData.isNewUser);
if (getApp().globalData.isNewUser == '1')
this.showModal = true
},
onShow() {
if (typeof this.$mp.page.getTabBar === 'function' && this.$mp.page.getTabBar()) {
@ -391,7 +418,7 @@
onLoad(options) {
this.shareSid = options.shareSid
console.log("shareSid>>>>", this.shareSid);
// console.log("shareSid>>>>", this.shareSid);
let info = uni.getSystemInfoSync();
@ -545,7 +572,7 @@
let _this = this
_this.$api.newUserQuota().then((resp) => {
console.log("--------", resp);
// console.log("--------", resp);
_this.newPerGiftList = resp
_this.showModal = false
@ -554,10 +581,40 @@
})
},
radioChange(event) {
// console.log("radioChange", event.detail.value);
this.newporGiftSid = event.detail.value
},
newporGift() {
// console.log("radioChange", this.newporGiftSid);
if (!this.newporGiftSid) {
this.shortToast('请先选择优惠礼包')
return
}
var params = {
customerSid: getApp().globalData.sid,
bagSid: this.newporGiftSid,
}
// console.log("params", params);
let _this = this
_this.$api.createNewUserBagOrder(params).then((resp) => {
// console.log("resp", resp);
this.$pay(resp)
}).catch(e => {})
},
colseDialog() {
this.showModal = false
},
colseDialog2() {
this.showModal2 = false
},
colseDialog3() {
this.showModal3 = false
},
@ -588,11 +645,11 @@
vos: list
}
console.log("=========0", params);
// console.log("=========0", params);
_this.$api.transSubmission(params).then((resp) => {
console.log("=========", resp);
// console.log("=========", resp);
_this.showModal3 = false
let shareData = JSON.stringify({
@ -630,37 +687,6 @@
},
shareCard() {
let _this = this
var 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
})
}
}
var params = {
customerSid: getApp().globalData.sid,
brandId: this.brandType,
vos: list
}
console.log("=========0", params);
_this.$api.transSubmission(params).then((resp) => {
console.log("=========", resp);
}).catch(e => {})
}
}
}
@ -683,6 +709,13 @@
border: 0;
}
.newpor_bom {
/* 加载背景图 */
background-image: url(https://supervise.yxtsoft.com/lpk/image/newpor_bom.png);
/* background-image: url(../../static/clound_bj1.png); */
/* 让背景图基于容器大小伸缩 */
background-size: 100% 100%;
}
.top {
@ -820,6 +853,7 @@
height: 100%;
top: 0;
left: 0;
flex-direction: column;
justify-content: center;
align-items: center;
}
@ -828,9 +862,10 @@
box-sizing: border-box;
padding: 26rpx 6%;
display: flex;
justify-content: space-between;
flex-direction: row;
align-items: center;
border-bottom: 1px solid #eee;
width: 100%;
}
.modalDlg3 {

28
pages/home/myHome.vue

@ -10,7 +10,7 @@
<image class="head-img" :src="userInfo.photo"></image>
<view class="name-mob" style="flex: 1;">
<!-- 昵称 -->
<text >{{userInfo.nick}}</text>
<text>{{userInfo.nick}}</text>
<!-- 手机 -->
<text style="font-size:14px;">{{userInfo.mobile}}</text>
</view>
@ -49,28 +49,29 @@
</view>
<!-- 订单记录 -->
<!-- <view class="icon-cow">
<view class="icon-cow">
<text class="title">订单记录</text>
<view class="group">
<view class="icon-name" @click="itemClick('待付款')">
<view class="icon-name" @click="itemClick('我的订单')">
<view class="icon">
<image class="img" src="../../static/img/record-query/obligation.png" mode="aspectFill">
</image>
<view v-if="data.count>0" class="count">{{data.count}}</view>
<!-- <view class="count">{{data.count}}</view> -->
</view>
<text class="name">待付款</text>
<text class="name">我的订单</text>
</view>
<view class="icon-name" @click="itemClick('已付款')">
<!-- <view class="icon-name" @click="itemClick('已付款')">
<view class="icon">
<image class="img" src="../../static/img/record-query/paid.png" mode="aspectFill">
</image>
</view>
<text class="name">已付款</text>
</view>
</view> -->
<view class="icon-name"></view>
<view class="icon-name"></view>
<view class="icon-name"></view>
</view>
</view> -->
</view>
<!-- 转赠记录 -->
<view class="icon-cow">
<text class="title">转赠记录</text>
@ -278,6 +279,17 @@
uni.navigateTo({
url: '/pages/records/reservationRecords2',
})
break;
case "我的订单":
uni.navigateTo({
url: '/pages/records/orderRecords',
})
// uni.navigateTo({
// url:"/pages/records/orderDetail"
// })
break;
case "待付款":

230
pages/records/orderDetail.vue

@ -0,0 +1,230 @@
<template>
<view style="display: flex;flex-direction: column;height: 100vh; background: #F7F7F7;overflow-y: auto;">
<loading-state ref="pageView" @request="request">
<view v-if="data.payStatus=='2'"
style="display: flex;flex-direction: row;align-items: center;width: 100%;justify-content: center;margin-top: 10px;padding: 10px;">
<text style="font-size: 14px;">还剩</text>
<text
style="font-weight: 600;color: #FF5006;font-size: 18px;margin-left: 2px;margin-right: 2px;">{{page.countdown}}</text>
<text style="font-size: 14px;">订单自动取消</text>
</view>
<view
style="background: #fff;border-radius: 10px;display: flex;flex-direction: column;padding: 15px;margin-top: 15px; margin-left: 10px;margin-right: 10px;">
<view v-for="(item,index) in data.ordOrderDetails"
style=" display: flex;flex-direction: row;align-items: center; margin-bottom: 15px;">
<image :src="item.picUrl" style="width: 70px;height: 70px;border-radius: 15px;" mode="scaleToFill">
</image>
<view style="margin-left: 10px;display: flex;flex-direction: column;flex: 1;">
<view style="display: flex;flex-direction: row;width: 100%;">
<text style="flex: 1;">{{item.goodsName}}</text>
<text>{{item.pricePart}}</text>
</view>
<text style="margin-top: 10px;font-size: 12px;color: #999;">{{item.remarks}}</text>
</view>
</view>
<view style="display: flex;flex-direction: column;
border-top: 1px solid #EFEFEF;padding-top: 15px;">
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<text>商品总额</text>
<text>{{data.meet}}</text>
</view>
<view
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;margin-top: 15px;">
<text>附加费</text>
<text>{{data.surcharge}}</text>
</view>
</view>
<view style="display: flex;flex-direction: row;align-items: center;
border-top: 1px solid #EFEFEF;padding-top: 15px;margin-top: 15px;">
<view style="flex: 1;">
</view>
<view v-if="data.payStatus=='4'"
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<text>实付</text>
<text style="font-size: 16px;font-weight: 600;">{{data.totalTee}}</text>
</view>
<view v-if="data.payStatus=='2'"
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<text style="color: #FF5006;margin-right: 3px;font-size: 14px;">需付款</text>
<text style="color: #FF5006;font-size: 16px;font-weight: 600;">{{data.totalTee}}</text>
</view>
<view v-if="data.payStatus=='3'"
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<text style="color: #666;margin-right: 3px;font-size: 14px;">需付款</text>
<text style="color: #666;font-size: 16px;font-weight: 600;">{{data.totalTee}}</text>
</view>
</view>
</view>
<view style="background: #fff;border-radius: 10px;margin-top: 12px;margin-left: 10px;margin-right: 10px;
display: flex;flex-direction: column;padding: 12px 16px;margin-bottom: 150px;">
<text style="font-size: 16px;">订单信息</text>
<view style="display: flex;flex-direction: column;margin-top: 15px; ">
<view style="display: flex;flex-direction: row;align-items: center;">
<text style="font-size: 14px;color: #999;">订单编号</text>
<text
style="margin-left: 15px;font-size: 14px;color: #333;word-break: break-all;">{{data.outTradeNo}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;">
<text style="font-size: 14px;color: #999;">下单时间</text>
<text style="margin-left: 15px;font-size: 14px;color: #333;">{{data.createTime}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;">
<text style="font-size: 14px;color: #999;">支付方式</text>
<text style="margin-left: 15px;font-size: 14px;color: #333;">{{data.payType}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;"
v-if="data.payStatus=='4'">
<text style="font-size: 14px;color: #999;">付款时间</text>
<text style="margin-left: 15px;font-size: 14px;color: #333;">{{data.payTime}}</text>
</view>
</view>
</view>
<view v-if="data.payStatus=='2'" style="width: 100%; background-color: #fff;height: 15vw;position: fixed;bottom: 0;overflow:hidden;
display: flex;flex-direction: row;align-items: center;box-sizing: border-box;">
<view style="flex: 1;"></view>
<text style="font-size: 16px;color: #fff; height: 5vw; background-color: #FF9900;margin-right: 25px;
padding: 5px 20px;border-radius: 20px;" @click="continuePy">继续付款</text>
</view>
</loading-state>
</view>
</template>
<script>
export default {
data() {
return {
page: {
sid: "",
countdown: ""
},
data: {
}
}
},
onLoad(options) {
this.page.sid = options.sid
this.request()
},
methods: {
//
request() {
let _this = this
_this.$api.orderDetails(_this.page.sid).then((resp) => {
_this.data = resp
_this.countTime() //
_this.$nextTick(() => {
_this.$refs.pageView.setLoadState(2)
})
}).catch(e => {
_this.$nextTick(() => {
_this.$refs.pageView.setLoadState(1)
})
})
},
continuePy() {
var list = this.page.countdown.split(":")
var mm = list[0] //
var ss = list[1] //
var totalSeconds = Number(mm)*60+ Number(ss)
this.data.result.remainder = totalSeconds
// console.log("==============",this.data.result.remainder);
this.$pay(this.data.result)
},
countTime() {
var that = this;
var date = new Date();
var now = date.getTime();
var endDate = new Date(that.data.endTime); //
var end = endDate.getTime();
var leftTime = end - now; //
var d, h, m, s, ms;
if (leftTime >= 0) {
d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
m = Math.floor(leftTime / 1000 / 60 % 60);
s = Math.floor(leftTime / 1000 % 60);
ms = Math.floor(leftTime % 1000);
ms = ms < 100 ? "0" + ms : ms
s = s < 10 ? "0" + s : s
m = m < 10 ? "0" + m : m
h = h < 10 ? "0" + h : h
that.page.countdown = m + ":" + s,
//countTime
setTimeout(that.countTime, 1000);
} else {
that.page.countdown = '00:00:00'
that.data.payStatus = '3'
that.changePayState()
}
},
changePayState() {
let _this = this
_this.$api.changePayState(_this.page.sid).then((resp) => {
}).catch(e => {
})
}
}
}
</script>
<style>
</style>

137
pages/records/orderRecords.vue

@ -0,0 +1,137 @@
<template>
<view style="display: flex;flex-direction: column;height: 100vh;background: #f7f7f7;
padding: 10px;">
<!-- 有列表的时候用 :auto='false' 需要你在onload等调用reload方法 -->
<view style="display: flex;flex-direction: row;align-items: center;
padding-left: 10px;padding-bottom: 10px; ">
<text class="label" :class="{'label2':selectIndex===0}" @click="tab(0)">全部</text>
<text class="label" :class="{'label2':selectIndex===1}" @click="tab(1)">待付款</text>
<text class="label" :class="{'label2':selectIndex===2}" @click="tab(2)">已付款</text>
<text class="label" :class="{'label2':selectIndex===3}" @click="tab(3)">已失效</text>
</view>
<z-paging ref="paging" v-model="data" @query="queryList" :pagingStyle='styleObject' :use-page-scroll='false'>
<view v-for="(item,index) in data" style=" display: flex;flex-direction: column;margin-left: 10px;margin-right: 10px;background: #fff;margin-top: 10px;
border-radius: 10px;padding: 15px;box-sizing: border-box;" @click="itemClick(item)">
<view style="display: flex;flex-direction: row;justify-content: space-between;">
<text style="font-size: 16px;color: #333;">{{item.createTime}}</text>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: center;">
<text v-if="item.payStatus=='2'" style="font-size: 14px;color: #FF9900;">待付款</text>
<text v-if="item.payStatus=='4'" style="font-size: 14px;color: #666;">已完成</text>
<text v-if="item.payStatus=='3'" style="font-size: 14px;color: #999;">已失效</text>
<image src="../../static/more.png" style="width: 15px;height: 15px;"></image>
</view>
</view>
<scroll-view scroll-x="true" style=" white-space: nowrap; display: flex;margin-top: 15px;"
bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll">
<view v-for="(children,pos) in item.picUrls" style="display: inline-block;">
<image :src="children" style="margin-right: 10px; width: 70px;height: 70px;border-radius: 10px;"
mode="scaleToFill"></image>
</view>
</scroll-view>
<view
style="display: flex;flex-direction: row;align-items: center;justify-content: center;margin-top: 15px;">
<view style="flex: 1;"></view>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: center;">
<text style="font-size: 14px;color: #333;margin-right: 20px;">{{item.count}}种商品</text>
<text style="font-size: 12px;color: #333;margin-right: 5px;">实付</text>
<text
style="font-size: 18px;color: #333;font-weight: 6000;font-family: sans-serif;">{{item.totalTee}}</text>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
export default {
data() {
return {
selectIndex: 0,
orderState: "",
styleObject: {
'padding-bottom': '10px',
'background': '#f7f7f7',
'margin-top': '40px'
},
data: [
]
}
},
methods: {
tab(index) {
this.selectIndex = index
if (index == 0)
this.orderState = ""
if (index == 1)
this.orderState = "2"
if (index == 2)
this.orderState = "4"
if (index == 3)
this.orderState = "3"
this.$refs.paging.reload()
},
//
queryList(pageNo, pageSize) {
let _this = this
_this.$api.ordersList({
"current": pageNo,
"size": pageSize,
"params": {
"customerSid": getApp().globalData.sid,
"state": _this.orderState, //2 3 4
}
}).then((resp) => {
//
_this.$refs.paging.complete(resp.records)
}).catch(e => {
//
_this.$refs.paging.complete(false);
})
},
itemClick(item){
uni.navigateTo({
url:"/pages/records/orderDetail?sid="+item.sid
})
}
}
}
</script>
<style scoped>
.label {
color: #666;
font-size: 14px;
margin-right: 30px;
}
.label2 {
color: #FF9900;
font-size: 14px;
border-bottom: 1px #FF9900 solid;
padding-bottom: 5px;
margin-right: 30px;
}
</style>
Loading…
Cancel
Save