Browse Source

上传

master
前端-胡立永 7 months ago
parent
commit
299819413f
7 changed files with 139 additions and 46 deletions
  1. +9
    -1
      api/api.js
  2. +1
    -1
      config.js
  3. +5
    -5
      pages/index/order.vue
  4. +51
    -1
      pages_order/components/product/submitUnitSelect.vue
  5. +22
    -24
      pages_order/order/orderDetail.vue
  6. BIN
      pages_order/static/order/copy.png
  7. +51
    -14
      utils/utils.js

+ 9
- 1
api/api.js View File

@ -228,7 +228,15 @@ const config = {
// showLoading : true,
auth: true,
},
// 商品租赁下单
orderPay: {
url: '/order/pay',
method: 'POST',
showLoading : true,
limit: 500,
auth: true,
},
}


+ 1
- 1
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'prod'
const type = 'dev'
// 环境配置


+ 5
- 5
pages/index/order.vue View File

@ -25,7 +25,7 @@
<text>{{ tabs[item.type + 1].name }}</text>
</view>
<view class="status">
<text> {{item.state_dictText}}</text>
<text> {{item.status_dictText}}</text>
</view>
</view>
@ -40,7 +40,7 @@
客户姓名{{item.userName}}
</view>
<view class="text-hidden-1">
产品规格{{item.unit}}
产品规格{{item.sku}}
</view>
<view class="text-hidden-1">
租赁地址{{item.userAddress}}
@ -57,10 +57,10 @@
<view class="pay">
<!-- 水洗店不展示 -->
<view class="price"
<!-- <view class="price"
v-if="!userShop && item.type != 0 && item.type != 1">
总金额<text class="num">{{ item.orderPay }}</text>
</view>
</view> -->
<view
v-if="item.washPay && item.type == 1">
水洗费用{{ item.washPay }}
@ -76,7 +76,7 @@
<!-- 水洗店不展示 -->
<view class="price"
v-if="!userShop && item.type != 0 && item.type == 1">
v-if="!userShop && item.type == 1 && item.orderPay">
总金额<text class="num">{{ item.orderPay }}</text>
</view>
<view class="b1">


+ 51
- 1
pages_order/components/product/submitUnitSelect.vue View File

@ -79,7 +79,8 @@
@click="addCart">
加入租赁车
</view>
<view class="r">
<view class="r"
@click="orderPay">
{{ submiitTitle }}
</view>
</view>
@ -175,6 +176,55 @@
}
})
},
orderPay(){
let data = {
id : this.detail.id,//id
skuId : this.unit.id,//id
addressId : this.address.id,//id
sku : this.unit.title,//
num : this.num,
}
if(this.$utils.verificationAll(data, {
skuId : '请选择规格',
addressId : '请选择地址',
})){
return
}
this.$api('orderPay', data, res => {
if(res.code == 200){
uni.redirectTo({
url: '/pages/index/order'
})
// uni.requestPayment({
// provider: 'wxpay', //
// timeStamp: res.result.timeStamp, //
// nonceStr: res.result.nonceStr, //
// package: res.result.packageValue,
// signType: res.result.signType, //
// paySign: res.result.paySign, //
// success: function (res) {
// console.log('',res);
// uni.redirectTo({
// url: '/pages/index/order'
// })
// },
// fail: function (err) {
// console.log('',err);
// uni.showToast({
// icon:'none',
// title:""
// })
// }
// });
}
})
},
}
}
</script>


+ 22
- 24
pages_order/order/orderDetail.vue View File

@ -43,7 +43,7 @@
style="display: flex;">
<view style="width: 8rpx;height: 30rpx;
background: #FD5100;border-radius: 6rpx;" />
<view class="head-title">服务项目</view>
<view class="head-title">{{ typeText[order.type].name }}</view>
</view>
<view class="flex">
@ -60,12 +60,13 @@
<!-- <view class="coupon">领券立减</view> -->
</view>
<view class="current-price">
<view class="current-price"
v-if="order.orderPay">
<text class="unit"></text>{{order.orderPay}}
</view>
<view class="sales-volume" style="margin-top: 5px;">
<view class="desc">规格{{order.unit}}</view>
<view class="desc">规格{{order.sku}}</view>
</view>
<view class="time-coupon">
@ -116,11 +117,11 @@
<view class="line address">
<view class="address-top">
<!-- <view class="">
服务地址
</view> -->
<view class="">
收货地址
</view>
<view class="copy">
<image @click="copy(order.userName + ' ' + order.userPhone + ' ' + order.userAddress)" src="/static/order/copy.png"></image>
<image @click="$utils.copyText(order.userName + ' ' + order.userPhone + ' ' + order.userAddress)" src="../static/order/copy.png"></image>
</view>
</view>
<view class="addressDetail">
@ -235,25 +236,22 @@
'开始清洗',
'服务完成',
],
msgShop : {
money : 99.99,
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
projectExplain : '1.xxxxxxxxxx xxxxxxxxxx。2.xxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxxxxxxxxxx。3.。',
},
msgOrder : {
money : 99.99,
address : '广东省广州市越秀区城南故事C3栋2802',
name : '李**',
phone : '150*****091',
unit : '120*40*75【桌子尺寸】',
state_dictText : '已完成',
price : 199.99,
id : '020644568964457',
createTime : '2024-01-18 15:39',
projectName : '桌布租赁'
},
order : {},
orderId : 0,
typeText: [
{
name: '租赁押金'
},
{
name: '水洗租赁'
},
{
name: '破损换货'
},
{
name: '退货退款'
}
],
}
},
onLoad(agrs) {


BIN
pages_order/static/order/copy.png View File

Before After
Width: 32  |  Height: 32  |  Size: 961 B

+ 51
- 14
utils/utils.js View File

@ -36,33 +36,56 @@ function generateLightRandomColor() {
function verificationAll(data, msg){
let Msgs = {
default : msg || '表单数据未填写'
}
if(typeof msg == 'object'){
Msgs = {
default : '表单数据未填写',
...msg,
}
if (!msg){
console.log(msg);
return false
}
if (!data){
uni.showToast({
title: Msgs.default,
title: '表单数据未填写',
icon: "none"
})
return true
}
for (let key in data) {
if (!data[key] || data[key] === "") {
for (let key in msg) {
if (!data[key]) {
uni.showToast({
title: (Msgs[key] || Msgs.default),
title: msg[key],
icon: "none"
})
return true
}
}
// let Msgs = {
// default : msg || '表单数据未填写'
// }
// if(typeof msg == 'object'){
// Msgs = {
// default : '表单数据未填写',
// ...msg,
// }
// }
// if (!data){
// uni.showToast({
// title: Msgs.default,
// icon: "none"
// })
// return true
// }
// for (let key in data) {
// if (!data[key] || data[key] === "") {
// uni.showToast({
// title: (Msgs[key] || Msgs.default),
// icon: "none"
// })
// return true
// }
// }
return false
}
@ -108,6 +131,19 @@ export function deepMergeObject(a, b){
return mergeObject(data, b)
}
//复制内容
export function copyText(content) {
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'none'
})
}
})
}
function params(url){
if(typeof url == 'object'){
return url
@ -149,4 +185,5 @@ export default {
navigateTo,
navigateBack,
redirectTo,
copyText
}

Loading…
Cancel
Save