Browse Source

feat(购物车): 实现购物车功能及相关订单流程

- 新增购物车页面及API接口
- 在商品详情页添加加入购物车功能
- 修改订单创建流程支持购物车多商品结算
- 调整UI样式和交互细节
- 修复订单状态判断逻辑
master
前端-胡立永 1 week ago
parent
commit
6943211e44
17 changed files with 452 additions and 159 deletions
  1. +1
    -1
      api/api.js
  2. +34
    -0
      api/model/cart.js
  3. +13
    -0
      api/model/index.js
  4. +2
    -1
      components/base/kefu.vue
  5. +7
    -0
      components/base/tabbar.vue
  6. +10
    -0
      components/productItem.vue
  7. +131
    -36
      pages/index/cart.vue
  8. +12
    -9
      pages/index/order.vue
  9. +2
    -2
      pages_order/components/product/submit.vue
  10. +25
    -25
      pages_order/order/createOrder.vue
  11. +166
    -63
      pages_order/order/firmOrder.vue
  12. +27
    -14
      pages_order/order/orderDetail.vue
  13. +1
    -1
      pages_order/order/pictureOrder.vue
  14. +1
    -1
      pages_order/order/voiceOrder.vue
  15. +17
    -3
      pages_order/product/productDetail.vue
  16. +2
    -2
      pages_order/product/productList.vue
  17. +1
    -1
      uni_modules/uv-number-box/components/uv-number-box/props.js

+ 1
- 1
api/api.js View File

@ -5,7 +5,7 @@ import utils from '../utils/utils.js'
let limit = {} let limit = {}
let debounce = {} let debounce = {}
const models = ['login', 'index']
const models = ['login', 'index', 'cart']
const config = { const config = {
// 示例 // 示例


+ 34
- 0
api/model/cart.js View File

@ -0,0 +1,34 @@
// 登录相关接口
const api = {
// 获取购物车信息列表带分页
getCartPageList: {
url: '/cat/getCartPageList',
method: 'GET',
limit : 500,
},
// 加入购物车
addCart: {
url: '/cat/addCart',
method: 'GET',
limit : 500,
},
// 删除购物车信息
deleteCart: {
url: '/cat/deleteCart',
method: 'POST',
auth: true,
},
// 修改购物车信息数量
updateCartNum: {
url: '/cat/updateCartNum',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
}
export default api

+ 13
- 0
api/model/index.js View File

@ -32,6 +32,12 @@ const api = {
method: 'POST', method: 'POST',
limit : 1000, limit : 1000,
}, },
// 商城-加入购物车之后一次下多个订单
createSumOrder: {
url: '/order/createSumOrder',
method: 'POST',
limit : 1000,
},
// 支付订单 // 支付订单
payOrder: { payOrder: {
url: '/index/payOrder', url: '/index/payOrder',
@ -43,6 +49,12 @@ const api = {
method: 'POST', method: 'POST',
limit : 1000, limit : 1000,
}, },
// 取消快捷订单
cancelOrderFast: {
url: '/index/cancelOrder',
method: 'POST',
limit : 1000,
},
// 获取快捷下单信息 // 获取快捷下单信息
getOrderInfo: { getOrderInfo: {
url: '/index/getOrderInfo', url: '/index/getOrderInfo',
@ -135,6 +147,7 @@ const api = {
method: 'POST', method: 'POST',
limit : 1000, limit : 1000,
}, },
} }
export default api export default api

+ 2
- 1
components/base/kefu.vue View File

@ -41,13 +41,14 @@
<style lang="scss"> <style lang="scss">
.float-button { .float-button {
position: fixed; position: fixed;
bottom: 150px;
bottom: 180px;
/* 距离底部的距离 */ /* 距离底部的距离 */
right: 10px; right: 10px;
/* 距离右侧的距离 */ /* 距离右侧的距离 */
width: 50px; width: 50px;
/* 按钮的宽度 */ /* 按钮的宽度 */
height: 50px; height: 50px;
z-index: 99;
/* 按钮的高度 */ /* 按钮的高度 */
/* 其他样式 */ /* 其他样式 */


+ 7
- 0
components/base/tabbar.vue View File

@ -38,6 +38,13 @@
"title": "商品列表", "title": "商品列表",
key: 'category', key: 'category',
}, },
{
"selectedIconPath": "/static/image/tabbar/cart-a.png",
"iconPath": "/static/image/tabbar/cart.png",
"pagePath": "/pages/index/cart",
"title": "购物车",
key: 'cart',
},
{ {
"selectedIconPath": "/static/image/tabbar/center-a.png", "selectedIconPath": "/static/image/tabbar/center-a.png",
"iconPath": "/static/image/tabbar/center.png", "iconPath": "/static/image/tabbar/center.png",


+ 10
- 0
components/productItem.vue View File

@ -18,6 +18,10 @@
type="primary" type="primary"
shape="circle" shape="circle"
text="立即购买"></uv-button> text="立即购买"></uv-button>
<view class="tips">
已售{{ item.payNum }}
</view>
</view> </view>
</view> </view>
</template> </template>
@ -97,12 +101,18 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column;
:deep(.uv-button) { :deep(.uv-button) {
transition: transform 0.2s; transition: transform 0.2s;
&:active { &:active {
transform: scale(0.95); transform: scale(0.95);
} }
} }
.tips{
font-size: 24rpx;
color: #999;
margin-top: 16rpx;
}
} }
@keyframes pulse { @keyframes pulse {


+ 131
- 36
pages/index/cart.vue View File

@ -2,7 +2,13 @@
<view class="page"> <view class="page">
<navbar/> <navbar/>
<view class="user">
<!-- 未登录提示 -->
<view class="not-login" v-if="!isLogin">
<view class="tips">登录后查看您的购物车</view>
<view class="login-btn" @click="$utils.toLogin">立即登录</view>
</view>
<view class="user" v-if="isLogin">
<uv-checkbox-group <uv-checkbox-group
shape="circle" shape="circle"
v-model="checkboxValue"> v-model="checkboxValue">
@ -10,15 +16,16 @@
<uv-swipe-action> <uv-swipe-action>
<view <view
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index">
:key="item.id">
<view style="margin-top: 20rpx;"></view> <view style="margin-top: 20rpx;"></view>
<uv-swipe-action-item <uv-swipe-action-item
@click="e => deleteCart(e, item)"
:options="options"> :options="options">
<view class="item"> <view class="item">
<view class="checkbox"> <view class="checkbox">
<uv-checkbox <uv-checkbox
:name="item.id" :name="item.id"
activeColor="#FA5A0A"
activeColor="#eb3300"
size="40rpx" size="40rpx"
icon-size="35rpx" icon-size="35rpx"
></uv-checkbox> ></uv-checkbox>
@ -26,26 +33,35 @@
<image <image
class="image" class="image"
src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
:src="item.image &&
item.image.split(',')[0]"
mode=""></image> mode=""></image>
<view class="info"> <view class="info">
<view class="title"> <view class="title">
<view class=""> <view class="">
{{ item.title }}
</view>
<view class="">
<uv-number-box v-model="item.num"
@change="valChange"></uv-number-box>
{{ item.name }}
</view> </view>
</view> </view>
<view class="unit"> <view class="unit">
规格{{ item.unit }}
<uv-icon name="arrow-down"></uv-icon>
材质{{ item.material }}
<!-- <uv-icon name="arrow-down"></uv-icon> -->
</view> </view>
<view class="price">
<text>{{ item.price }}</text>
<view
style="display: flex;
justify-content: space-between;
align-items: center;">
<view class="price">
<text>{{ item.price }}</text>/{{item.unit}}
</view>
<view class="">
<uv-number-box v-model="item.selectNum"
@change="e => valChange(item, e)"></uv-number-box>
</view>
</view> </view>
</view> </view>
</view> </view>
</uv-swipe-action-item> </uv-swipe-action-item>
@ -53,6 +69,13 @@
</uv-swipe-action> </uv-swipe-action>
</uv-checkbox-group> </uv-checkbox-group>
<uv-empty
v-if="list.length == 0"
text="空空如也"
textSize="30rpx"
iconSize="200rpx"
icon="list"></uv-empty>
<view class="action"> <view class="action">
<view class="icon"> <view class="icon">
<image src="/static/image/cart/1.png" mode=""></image> <image src="/static/image/cart/1.png" mode=""></image>
@ -71,52 +94,41 @@
{{ checkboxValue.length }}已享受更低优惠 {{ checkboxValue.length }}已享受更低优惠
</view> </view>
</view> </view>
<view class="btn">
<view class="btn"
@click="submit">
去结算 去结算
</view> </view>
</view> </view>
</view> </view>
<kefu/>
<kefu></kefu>
<tabber select="3" />
<tabber select="cart" />
</view> </view>
</template> </template>
<script> <script>
import tabber from '@/components/base/tabbar.vue' import tabber from '@/components/base/tabbar.vue'
import mixinsList from '@/mixins/list.js'
export default { export default {
mixins : [mixinsList],
components: { components: {
tabber, tabber,
}, },
data() { data() {
return { return {
isLogin: false,
value : 0, value : 0,
checkboxValue : [], checkboxValue : [],
options: [ options: [
{ {
text: '删除', text: '删除',
style: { style: {
backgroundColor: '#FA5A0A'
backgroundColor: '#f40'
} }
}, },
], ],
list : [
{
id : 1,
title : '桌布租赁',
num : 1,
price : 299,
unit : '120*40*75【桌子尺寸】',
},
{
id : 2,
title : '桌布租赁',
num : 1,
price : 299,
unit : '120*40*75【桌子尺寸】',
},
],
mixinsListApi : '',
} }
}, },
computed: { computed: {
@ -127,15 +139,72 @@
let price = 0 let price = 0
this.list.forEach(n => { this.list.forEach(n => {
if(this.checkboxValue.includes(n.id)){ if(this.checkboxValue.includes(n.id)){
price += n.price * n.num
price += n.price * n.selectNum
} }
}) })
return price
return Number(price).toFixed(2)
}, },
}, },
onLoad(){
this.checkLogin()
},
onShow() {
this.checkLogin()
},
methods: { methods: {
valChange(){
//
checkLogin() {
const token = uni.getStorageSync('token')
this.isLogin = !!token
if (this.isLogin) {
this.mixinsListApi = 'getCartPageList'
this.getData()
}
},
getDataThen(list, total, result){
result.records = list.map(res => {
return {
...res.shop,
cartId : res.id,
selectNum : res.num,
}
})
},
valChange(item, e) {
this.$api('updateCartNum', {
id: item.id,
num: e.value,
})
},
//
submit(){
if(this.checkboxValue.length == 0){
uni.showToast({
title: '请选择商品',
icon: 'none',
})
return
}
let arr = []
this.list.forEach(n => {
if(this.checkboxValue.includes(n.id)){
arr.push(n)
}
})
this.$store.commit('setPayOrderProduct', arr)
this.$utils.navigateTo('/pages_order/order/createOrder')
},
deleteCart(e, item){
this.$api('deleteCart', {
ids : item.cartId
}, res => {
this.getData()
})
}, },
} }
} }
@ -148,6 +217,31 @@
width: 100%; width: 100%;
} }
} }
.not-login {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 400rpx;
background-color: #fff;
margin: 20rpx;
border-radius: 16rpx;
.tips {
font-size: 32rpx;
color: #666;
margin-bottom: 30rpx;
}
.login-btn {
background-color: $uni-color;
color: #fff;
padding: 20rpx 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
}
}
.user { .user {
.item{ .item{
@ -203,6 +297,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
z-index: 999;
.icon{ .icon{
position: relative; position: relative;
width: 80rpx; width: 80rpx;


+ 12
- 9
pages/index/order.vue View File

@ -12,7 +12,7 @@
<!-- 顶部 --> <!-- 顶部 -->
<view class="top"> <view class="top">
<view class="service"> <view class="service">
<text>{{ item.title }}</text>
<text>{{ item.createTime }}</text>
<!-- <text>{{ item.type_dictText }}</text> --> <!-- <text>{{ item.type_dictText }}</text> -->
</view> </view>
<view class="status"> <view class="status">
@ -20,19 +20,21 @@
</view> </view>
</view> </view>
<!-- --> <!-- -->
<view class="content">
<view class="content"
v-for="(shop, i) in item.children"
:key="i">
<view class="left"> <view class="left">
<image mode="aspectFill" :src="item.image"></image>
<image mode="aspectFill" :src="shop.image && shop.image.split(',')[0]"></image>
</view> </view>
<view class="right"> <view class="right">
<view class="text-hidden-1"> <view class="text-hidden-1">
客户姓名{{ item.name }}
客户姓名{{ shop.title }}
</view> </view>
<view class="text-hidden-1"> <view class="text-hidden-1">
下单时间{{ item.createTime }}
材质{{ shop.material }}
</view> </view>
<view class="text-hidden-1"> <view class="text-hidden-1">
联系电话{{ item.phone }}
数量{{ shop.num }}
</view> </view>
</view> </view>
</view> </view>
@ -111,6 +113,9 @@ export default {
this.getData() this.getData()
} }
}, },
onPullDownRefresh() {
this.getData()
},
methods: { methods: {
getData() { getData() {
let queryParams = { let queryParams = {
@ -120,6 +125,7 @@ export default {
queryParams.state = this.state queryParams.state = this.state
} }
this.$api('getOrderPageBean', queryParams, res => { this.$api('getOrderPageBean', queryParams, res => {
uni.stopPullDownRefresh()
if (res.code == 200) { if (res.code == 200) {
this.orderList = res.result this.orderList = res.result
} }
@ -141,9 +147,6 @@ export default {
url: '/pages_order/order/orderDetail?id=' + id url: '/pages_order/order/orderDetail?id=' + id
}) })
}, },
getOrderList() {
},
} }
} }
</script> </script>


+ 2
- 2
pages_order/components/product/submit.vue View File

@ -22,11 +22,11 @@
</button> </button>
<view class="submit-btn"> <view class="submit-btn">
<!-- <view class="l"
<view class="l"
@click="!disabled && $emit('addCart')" @click="!disabled && $emit('addCart')"
:class="{'disabled': disabled}"> :class="{'disabled': disabled}">
{{ disabled ? '库存不足' : '加入购物车' }} {{ disabled ? '库存不足' : '加入购物车' }}
</view> -->
</view>
<view class="r" <view class="r"
@click="!disabled && $emit('submit')" @click="!disabled && $emit('submit')"
:class="{'disabled': disabled}"> :class="{'disabled': disabled}">


+ 25
- 25
pages_order/order/createOrder.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="page"> <view class="page">
<!-- 导航栏 --> <!-- 导航栏 -->
<navbar :title="titleMap[type]" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" />
<navbar :title="titleMap[type]" leftClick @leftClick="$utils.navigateBack" bgColor="#DC2828" color="#fff" />
<view class="bac"></view> <view class="bac"></view>
@ -351,35 +351,35 @@
// if(this.type != 'give'){ // if(this.type != 'give'){
// let list = []
// this.payOrderProduct.forEach(n => {
// list.push({
// num: n.selectNum || 1,
// shopId: n.shopId || n.id,
// })
// })
// data = {
// addressId,
// payType : this.payMethod,
// list: JSON.stringify(list),
// remark: this.remark || '', //
// }
// api = 'createOrder'
// this.deleteCart(this.payOrderProduct.map(n => n.id).join(','))
// } else {
let list = []
this.payOrderProduct.forEach(n => {
list.push({
num: n.selectNum || 1,
shopId: n.id,
})
})
data = { data = {
addressId, addressId,
num: this.payOrderProduct[0].selectNum || 1,
productId: this.payOrderProduct[0].id,
payType : this.payMethod, payType : this.payMethod,
// isGive : this.isGive,
// memberNum : 1,
list: JSON.stringify(list),
// remark: this.remark || '', // // remark: this.remark || '', //
} }
api = 'createOrder'
api = 'createSumOrder'
this.deleteCart(this.payOrderProduct.map(n => n.cartId).join(','))
// } else {
// data = {
// addressId,
// num: this.payOrderProduct[0].selectNum || 1,
// productId: this.payOrderProduct[0].id,
// payType : this.payMethod,
// // isGive : this.isGive,
// // memberNum : 1,
// // remark: this.remark || '', //
// }
// api = 'createOrder'
// } // }
if(this.coupon.id){ if(this.coupon.id){


+ 166
- 63
pages_order/order/firmOrder.vue View File

@ -8,29 +8,48 @@
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="content-wrapper"> <view class="content-wrapper">
<view class="section-wrapper">
<view class="section-title">
<view class="title-bar"></view>
<text>商品信息</text>
</view>
<view class="product-card">
<image class="product-image" :src="productInfo.image &&
productInfo.image.split(',')[0]" mode="aspectFit"></image>
<view class="product-details">
<view class="product-name">{{productInfo.name || ''}}</view>
<view class="product-tags">
<text class="tag">{{productInfo.categoryName || ''}}</text>
<text class="tag">快速下单</text>
</view>
<view class="product-price">
<text class="price-value">¥{{productInfo.price || ''}}</text>
<text class="price-unit">/{{productInfo.unit || ''}}</text>
</view>
</view>
</view>
</view>
<uv-checkbox-group
shape="circle"
v-model="checkboxValue">
<view class="section-wrapper">
<view class="section-title">
<view class="title-bar"></view>
<text>商品信息</text>
</view>
<view class="product-card" v-for="(info, index) in productInfo.commonShop">
<view class="checkbox">
<uv-checkbox
:name="info.id"
activeColor="#eb3300"
size="40rpx"
icon-size="35rpx"
></uv-checkbox>
</view>
<image class="product-image" :src="info.image &&
info.image.split(',')[0]" mode="aspectFill"></image>
<view class="product-details">
<view class="product-name">{{info.name || ''}}</view>
<view class="product-tags">
<text class="tag">快速下单</text>
</view>
<view class="product-price">
<text class="price-value">¥{{info.price || ''}}</text>
<text class="price-unit">/{{info.unit || ''}}</text>
</view>
<view class="selectNum">
<uv-number-box v-model="info.selectNum"></uv-number-box>
</view>
</view>
</view>
</view>
</uv-checkbox-group>
<!-- 个人信息 --> <!-- 个人信息 -->
<view class="section-wrapper"> <view class="section-wrapper">
<view class="section-title"> <view class="section-title">
@ -49,7 +68,7 @@
{{address.address}} {{address.addressDetails}} {{address.address}} {{address.addressDetails}}
</view> </view>
<view class="address-action"> <view class="address-action">
<text class="address-tip">已添加过的地址</text>
<text class="address-tip">选择其他已添加过的地址</text>
<view class="arrow-right"></view> <view class="arrow-right"></view>
</view> </view>
</view> </view>
@ -71,7 +90,8 @@
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="order-submit"> <view class="order-submit">
<button class="submit-btn" @click="submitOrder">快捷下单</button>
<button class="submit-btn-close" @click="cancelOrderFast">取消</button>
<button class="submit-btn" @click="submitOrder">快捷下单{{ totalPrice }}</button>
</view> </view>
<!-- 地址选择弹窗 --> <!-- 地址选择弹窗 -->
@ -96,7 +116,10 @@
}, },
data() { data() {
return { return {
productInfo: {}, //
checkboxValue : [],
productInfo: {
commonShop : [],
}, //
orderId: '', // ID orderId: '', // ID
address: { address: {
name: '请选择地址', name: '请选择地址',
@ -109,6 +132,20 @@
shouldSubmitOrder: false // shouldSubmitOrder: false //
}; };
}, },
computed: {
totalPrice(){
if (!this.checkboxValue.length || !this.productInfo.commonShop) {
return 0
}
let price = 0
this.productInfo.commonShop.forEach(n => {
if(this.checkboxValue.includes(n.id)){
price += n.price * (n.selectNum || 1)
}
})
return Number(price).toFixed(2)
},
},
onLoad(options) { onLoad(options) {
// ID // ID
if (options.orderId) { if (options.orderId) {
@ -125,10 +162,12 @@
getOrderInfo() { getOrderInfo() {
this.$api('getOrderInfo', res => { this.$api('getOrderInfo', res => {
if (res.code === 200 && res.result[0]) { if (res.code === 200 && res.result[0]) {
//
if (res.result[0].commonShop) {
this.productInfo = res.result[0].commonShop;
}
// commonShop
this.productInfo = res.result[0];
this.productInfo.commonShop.forEach(n => {
this.checkboxValue.push(n.id)
})
} }
}); });
}, },
@ -234,28 +273,52 @@
uni.showLoading({ uni.showLoading({
title: '提交订单中...' title: '提交订单中...'
}); });
//
this.$api('createOrder', {
let list = []
this.productInfo.commonShop.forEach(n => {
if(this.checkboxValue.includes(n.id)){
list.push({
num: n.selectNum || 1,
shopId: n.id,
})
}
})
let data = {
addressId: this.address.id, addressId: this.address.id,
productId: this.productInfo.id,
num : 1,
payType: 1, // payType: 1, //
orderId: this.orderId
}, res => {
orderId: this.orderId,
list: JSON.stringify(list),
}
/*
{
addressId: this.address.id,
productId: this.productInfo.id,
num : 1,
payType: 1, //
orderId: this.orderId
}
*/
//
this.$api('createSumOrder', data, res => {
uni.hideLoading(); uni.hideLoading();
if (res.code === 200) { if (res.code === 200) {
uni.showToast({
title: '下单成功',
icon: 'success',
duration: 1500,
success: () => {
setTimeout(() => {
//
this.$utils.redirectTo('/pages_order/order/orderList');
}, 1500);
}
});
uni.requestPaymentWxPay(res)
.then(e => {
uni.showToast({
title: '下单成功',
icon: 'none'
})
this.paySuccess(res)
}).catch(n => {
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order'
})
})
} else { } else {
uni.showToast({ uni.showToast({
title: res.message || '下单失败', title: res.message || '下单失败',
@ -263,7 +326,32 @@
}); });
} }
}); });
}
},
paySuccess(res){
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order'
})
},
cancelOrderFast(){
uni.showModal({
title: '确认取消吗?',
success : res => {
if(res.confirm){
this.$api('cancelOrderFast', {
orderId : this.orderId
}).then(res => {
uni.showToast({
title: '取消成功',
icon: 'none',
success() {
uni.navigateBack(-1)
}
})
})
}
}
})
},
} }
} }
</script> </script>
@ -282,6 +370,7 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
border-radius: 12rpx; border-radius: 12rpx;
overflow: hidden; overflow: hidden;
width: 100%;
background-color: #fff; background-color: #fff;
} }
@ -309,10 +398,16 @@
.product-card { .product-card {
display: flex; display: flex;
padding: 30rpx; padding: 30rpx;
.checkbox{
display: flex;
justify-content: center;
align-items: center;
}
.product-image { .product-image {
width: 180rpx;
height: 180rpx;
width: 200rpx;
height: 200rpx;
margin-right: 30rpx; margin-right: 30rpx;
background-color: #f9f9f9; background-color: #f9f9f9;
border-radius: 8rpx; border-radius: 8rpx;
@ -323,34 +418,33 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
gap: 6rpx;
.product-name { .product-name {
font-size: 32rpx;
font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
margin-bottom: 15rpx;
} }
.product-tags { .product-tags {
display: flex; display: flex;
margin-bottom: 20rpx;
.tag { .tag {
font-size: 24rpx; font-size: 24rpx;
color: #D03F25; color: #D03F25;
padding: 4rpx 12rpx; padding: 4rpx 12rpx;
background-color: rgba(208, 63, 37, 0.1); background-color: rgba(208, 63, 37, 0.1);
border-radius: 4rpx;
border-radius: 14rpx;
margin-right: 15rpx; margin-right: 15rpx;
} }
} }
.product-price { .product-price {
font-size: 28rpx;
font-size: 26rpx;
color: #666; color: #666;
.price-value { .price-value {
font-size: 40rpx;
font-size: 30rpx;
font-weight: 600; font-weight: 600;
color: #D03F25; color: #D03F25;
} }
@ -428,24 +522,33 @@
} }
.order-submit { .order-submit {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
background-color: #fff; background-color: #fff;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05); box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
gap: 20rpx;
.submit-btn-close{
height: 90rpx;
line-height: 90rpx;
text-align: center;
background-color: rgba($uni-color, 0.2);
border: 1rpx solid $uni-color;
color: $uni-color;
font-size: 32rpx;
border-radius: 45rpx;
border: none;
flex: 1;
}
.submit-btn { .submit-btn {
width: 100%;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
text-align: center; text-align: center;
background-color: #D03F25;
background-color: $uni-color;
color: #fff; color: #fff;
font-size: 32rpx; font-size: 32rpx;
border-radius: 45rpx; border-radius: 45rpx;
border: none; border: none;
flex: 4;
} }
} }


+ 27
- 14
pages_order/order/orderDetail.vue View File

@ -42,32 +42,34 @@
<view class="flex" style="display: flex;"> <view class="flex" style="display: flex;">
<view style="width: 8rpx;height: 30rpx; <view style="width: 8rpx;height: 30rpx;
background: #FD5100;border-radius: 6rpx;" /> background: #FD5100;border-radius: 6rpx;" />
<view class="head-title">服务项目</view>
<view class="head-title">产品</view>
</view> </view>
<view class="flex"> <view class="flex">
<view class="server-item">
<view class="server-item"
v-for="(shop, i) in order.children"
:key="i">
<view class="img-box"> <view class="img-box">
<image :src="order.image" mode="aspectFill"></image>
<image :src="shop.image && shop.image.split(',')[0]" mode="aspectFill"></image>
</view> </view>
<view class="server-info"> <view class="server-info">
<view class="server-title"> <view class="server-title">
{{ order.title }}
{{ shop.title }}
<!-- <view class="coupon">领券立减</view> --> <!-- <view class="coupon">领券立减</view> -->
</view> </view>
<view class="current-price"> <view class="current-price">
价格<text class="unit"></text>{{ order.price }}
价格<text class="unit"></text>{{ shop.price }}
</view> </view>
<view class="sales-volume" style="margin-top: 5px;"> <view class="sales-volume" style="margin-top: 5px;">
<view class="desc">产品材质{{ order.material }}</view>
<view class="desc">产品材质{{ shop.material }}</view>
</view> </view>
<view class="sales-volume" style="margin-top: 5px;"> <view class="sales-volume" style="margin-top: 5px;">
<view class="desc">产品数量{{ order.num }}</view>
<view class="desc">产品数量{{ shop.num }}</view>
</view> </view>
</view> </view>
@ -132,6 +134,14 @@
订单信息 订单信息
</view> </view>
</view> </view>
<view class="min_tips">
<view class="">
总金额
</view>
<view class="">
{{ order.price }}
</view>
</view>
<view class="min_tips"> <view class="min_tips">
<view class=""> <view class="">
订单编号 订单编号
@ -153,22 +163,25 @@
<!-- 下单须知 --> <!-- 下单须知 -->
<view class="line"> <view class="line">
<view class="t min_tips">
<!-- <view class="t min_tips">
<view class=""> <view class="">
下单须知 下单须知
</view> </view>
</view> </view>
<view class="min_tips" style="line-height: 40rpx;"> <view class="min_tips" style="line-height: 40rpx;">
{{ order.projectExplain }} {{ order.projectExplain }}
</view>
<view class="btns">
</view> -->
<!-- <view class="btns">
<view @click="clickService" class="btn"> <view @click="clickService" class="btn">
联系客服 联系客服
</view> </view>
</view>
</view> -->
</view> </view>
</view> </view>
<kefu></kefu>
<!-- 联系客服弹框 --> <!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" /> <customerServicePopup ref="customerServicePopup" />
</view> </view>
@ -255,11 +268,11 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 40rpx;
font-size: 32rpx;
image { image {
width: 100rpx;
height: 100rpx;
width: 80rpx;
height: 80rpx;
margin-right: 20rpx; margin-right: 20rpx;
} }
} }


+ 1
- 1
pages_order/order/pictureOrder.vue View File

@ -163,7 +163,7 @@
uni.hideLoading(); uni.hideLoading();
this.isUploading = false; this.isUploading = false;
if (res.code === 0) {
if (res.code == 200) {
// //
uni.showToast({ uni.showToast({
title: '下单成功', title: '下单成功',


+ 1
- 1
pages_order/order/voiceOrder.vue View File

@ -418,7 +418,7 @@
uni.hideLoading(); uni.hideLoading();
this.isUploading = false; this.isUploading = false;
if (res.code === 200) {
if (res.code == 200) {
// //
uni.showToast({ uni.showToast({
title: '下单成功', title: '下单成功',


+ 17
- 3
pages_order/product/productDetail.vue View File

@ -60,7 +60,7 @@
</view> </view>
<!-- 分享和租赁按钮 --> <!-- 分享和租赁按钮 -->
<submit @submit="submit" />
<submit @submit="submit" @addCart="addCart"/>
<!-- 选择规格 --> <!-- 选择规格 -->
<!-- <submitUnitSelect ref="submitUnitSelect" /> --> <!-- <submitUnitSelect ref="submitUnitSelect" /> -->
@ -89,12 +89,13 @@
productDetail: { productDetail: {
image: 'https://cdn.uviewui.com/uview/swiper/swiper3.png,https://cdn.uviewui.com/uview/swiper/swiper2.png', image: 'https://cdn.uviewui.com/uview/swiper/swiper3.png,https://cdn.uviewui.com/uview/swiper/swiper2.png',
content: '', content: '',
}
},
id : 0,
} }
}, },
onLoad(args) { onLoad(args) {
console.log(args);
if(args.id) { if(args.id) {
this.id = args.id
this.getProductDetail(args.id) this.getProductDetail(args.id)
} }
}, },
@ -109,6 +110,19 @@
} }
}) })
}, },
addCart(){
this.$api('addCart', {
shopId : this.id,
num : 1,
}).then(res => {
if(res.code == 200){
uni.showToast({
title: '加入成功',
icon: 'none'
})
}
})
},
// //
share() { share() {
var that = this var that = this


+ 2
- 2
pages_order/product/productList.vue View File

@ -51,12 +51,12 @@
}, },
methods: { methods: {
handleSearch(value){ handleSearch(value){
this.queryParams.name = this.keyword
this.queryParams.title = this.keyword
this.getData() this.getData()
}, },
searchChange(){ searchChange(){
if(!this.keyword){ if(!this.keyword){
this.queryParams.name = this.keyword
this.queryParams.title = this.keyword
this.getData() this.getData()
} }
}, },


+ 1
- 1
uni_modules/uv-number-box/components/uv-number-box/props.js View File

@ -81,7 +81,7 @@ export default {
// 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致 // 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
buttonSize: { buttonSize: {
type: [String, Number], type: [String, Number],
default: 30
default: 50
}, },
// 输入框和按钮的背景颜色 // 输入框和按钮的背景颜色
bgColor: { bgColor: {


Loading…
Cancel
Save