This commit is contained in:
zmj 2024-05-07 15:11:40 +08:00
parent dba2e14336
commit ae9c7d2c80
6 changed files with 377 additions and 322 deletions

View File

@ -11,9 +11,9 @@
<view class="list-li-top"> <view class="list-li-top">
<view class=""> <view class="">
<text>{{item.mer_name}}</text> <text>{{item.mer_name}}</text>
<text v-if="index==0" <text v-if="index==0&&item.distance"
style="background-color: #38BE41;color: white;font-size: 18rpx;margin-left: 24rpx;padding: 0 5rpx;">距离最近</text> style="background-color: #38BE41;color: white;font-size: 18rpx;margin-left: 24rpx;padding: 0 5rpx;">距离最近</text>
<text class="distance">步行{{item.distance}}</text> <text v-if="item.distance" class="distance">步行{{item.distance}}</text>
</view> </view>
</view> </view>
<view class=""> <view class="">

View File

@ -1,8 +1,149 @@
<template> <template>
<view class="content">
<view class="card" v-for="item in 10">
<view class="head">
<text>PF171504442988969633</text>
<text style="color: #989898;">2023-04-25</text>
</view>
<view class="card-content">
<view class="card-content-l" style="width: 152rpx;height: 152rpx;">
<image style="width: 152rpx;height: 152rpx;" src="../../static/logo.png" mode=""></image>
<view class="status">
未报价
</view>
</view>
<view class="card-content-r">
<view class="title ellipsis">
正宗新疆哈密瓜网纹瓜
</view>
<view class="need">
需求量 100
</view>
<view class="ipt">
<up-input placeholderStyle='fontSize:24rpx' placeholder="点击数入报价数量" v-model="value1"
style="margin-right: 10rpx;background-color:#F6F6F6;border: none;"></up-input>
<up-input placeholderStyle='fontSize:24rpx' style="background-color: #F6F6F6;border: none;"
placeholder="点击数入产品报价" v-model="value2"></up-input>
</view>
</view>
<view class="status-png">
<image :src="errPng" style="width: 108rpx; height: 84rpx;"></image>
</view>
</view>
<view class="card-footer">
共100斤&nbsp; &nbsp;合计:<text style="font-size: 28rpx;color: #FC452F;font-weight: 700;">500.00</text>
</view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view>
<view class="submit-btn">
<up-button shape='circle' color='#20B128' text="提交"></up-button>
</view>
</view>
</template> </template>
<script> <script setup>
import {
ref,
reactive
} from "vue"
const value1 = ref('')
const value2 = ref('')
// url
const successPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/739c3202405071458553459.png')
const errPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/04c2c202405071501462462.png')
// url
</script> </script>
<style> <style lang="scss">
.content {
padding: 20rpx;
padding-bottom: 150rpx;
.card {
width: 710rpx;
margin: 0 auto;
padding: 20rpx;
box-sizing: border-box;
background-color: white;
.head {
font-size: 28rpx;
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
}
.card-content {
display: flex;
position: relative;
.card-content-l {
margin-right: 20rpx;
position: relative;
.status {
width: 152rpx;
height: 40rpx;
background-color: rgba(0, 0, 0, .3);
text-align: center;
color: white;
font-size: 24rpx;
line-height: 40rpx;
position: absolute;
bottom: 0;
}
}
.card-content-r {
display: flex;
flex-direction: column;
justify-content: space-between;
.title {
font-size: 30rpx;
width: 500rpx;
}
.need {
color: #777777;
font-size: 24rpx;
}
.ipt {
display: flex;
height: 56rpx;
}
}
.status-png {
position: absolute;
right: 20rpx;
}
}
.card-footer {
margin-top: 30rpx;
text-align: right;
font-size: 28rpx;
color: #060606;
}
}
.submit-btn {
position: fixed;
bottom: 50rpx;
width: 710rpx;
margin: 0 auto;
}
}
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style> </style>

View File

@ -5,7 +5,7 @@
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword" <up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword"
@custom="searchKeyword"></up-search> @custom="searchKeyword"></up-search>
<view class=""> <view class="">
<view class="" style="display: flex;justify-content: space-around;margin-top: 24rpx;"> <view class="" style="display: flex;justify-content: space-around;margin-top: 24rpx;color:#777777">
<view :class="{act: tabIndex==1}" @click="tabIndex=1"> <view :class="{act: tabIndex==1}" @click="tabIndex=1">
订单列表 订单列表
</view> </view>
@ -22,17 +22,26 @@
<view class="card-head"> <view class="card-head">
<text>PF171504442988969633</text> <text>PF171504442988969633</text>
<text style="color:#20B128 ;">待报价</text> <text style="color:#20B128 ;">待报价</text>
<text style="color:#FC452F ;">已成交</text>
<text style="color:#777777 ;">未成交</text>
</view> </view>
<view class="card-content"> <view style="padding-right: 20rpx;">
<image v-for="(item,index) in 10" style="width: 152rpx;height: 152rpx;margin-right: 20rpx;" <view class="card-content">
src="../../static/logo.png" mode=""> <image v-for="(item,index) in 10" style="width: 152rpx;height: 152rpx;margin-right: 20rpx;"
</image> src="../../static/logo.png" mode="">
</image>
</view>
</view> </view>
<view class="total"> <view class="total">
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;color: #777777;"
@click="navgo('/pageQuota/quotation/detail')">
共4件 <up-icon name="arrow-right"></up-icon> 共4件 <up-icon name="arrow-right"></up-icon>
</view> </view>
</view> </view>
<view class="card-foot" v-if='false'>
温馨提示请于2024年05月20日前发货
</view>
</view> </view>
</view> </view>
@ -44,6 +53,13 @@
reactive reactive
} from "vue" } from "vue"
const navgo = (url) => {
uni.navigateTo({
url
})
}
// //
const keyword = ref('') const keyword = ref('')
const searchKeyword = () => { const searchKeyword = () => {
@ -88,17 +104,18 @@
margin: 20rpx auto; margin: 20rpx auto;
background-color: white; background-color: white;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx; border-radius: 16rpx 16rpx 0 0;
border-radius: 16rpx;
position: relative; position: relative;
.card-head { .card-head {
padding: 20rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.card-content { .card-content {
padding: 20rpx;
overflow-x: auto; overflow-x: auto;
white-space: nowrap; white-space: nowrap;
padding-right: 152rpx; padding-right: 152rpx;
@ -108,14 +125,24 @@
width: 152rpx; width: 152rpx;
height: 160rpx; height: 160rpx;
position: absolute; position: absolute;
border: 1px dashed black; // border: 1px dashed black;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
top: 60rpx; top: 100rpx;
right: 20rpx; right: 20rpx;
background-color: white; background-color: white;
} }
.card-foot {
background-color: #FFF1EC;
color: #FC452F;
text-indent: 2em;
font-size: 24rpx;
height: 74rpx;
line-height: 74rpx;
}
} }
} }
</style> </style>

View File

@ -44,88 +44,103 @@
], ],
"subPackages": [{ "subPackages": [{
"root": "pagesOrder", "root": "pagesOrder",
"pages": [{ "pages": [{
"path": "order/order", "path": "order/order",
"style": { "style": {
"navigationBarTitleText": "我的订单", "navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false "enablePullDownRefresh": false
}
},
{
"path": "detail/detail",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "addressList/addressList",
"style": {
"navigationBarTitleText": "地址管理",
"enablePullDownRefresh": false
}
},
{
"path": "addressEdit/addressEdit",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "settle/settle",
"style": {
"navigationBarTitleText": "确认订单",
"enablePullDownRefresh": false
}
} }
}, ]
{ },
"path": "detail/detail", {
"style": { "root": "pageQuota",
"navigationBarTitleText": "", "pages": [{
"enablePullDownRefresh": false "path": "quotation/index",
"style": {
"navigationBarTitleText": "报价单",
"enablePullDownRefresh": false
}
},
{
"path": "quotation/detail",
"style": {
"navigationBarTitleText": "报价明细",
"enablePullDownRefresh": false
}
} }
},
{
"path": "addressList/addressList",
"style": {
"navigationBarTitleText": "地址管理",
"enablePullDownRefresh": false
}
},
{
"path": "addressEdit/addressEdit",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "settle/settle",
"style": {
"navigationBarTitleText": "确认订单",
"enablePullDownRefresh": false
}
}
]
}, {
"root": "pageQuota",
"pages": [{
"path": "quotation/index",
"style": {
"navigationBarTitleText": "报价单",
"enablePullDownRefresh": false,
}
}
] ]
}], }
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#fff",
"backgroundColor": "#fff"
},
// "tabBar": {
// "color": "#999999",
// "selectedColor": "#20b128",
// "borderStyle": "white",
// "backgroundColor": "#FFFFFF",
// "list": [{
// "pagePath": "pages/index/index",
// "text": "首页",
// "iconPath": "static/tab/a.png",
// "selectedIconPath": "static/tab/aa.png"
// },
// {
// "pagePath": "pages/cart/cart",
// "text": "购物车",
// "iconPath": "static/tab/b.png",
// "selectedIconPath": "static/tab/ba.png"
// },
// { ]
// "pagePath": "pages/my/my", },
// "text": "我的",
// "iconPath": "static/tab/c.png",
// "selectedIconPath": "static/tab/ca.png"
// }
// ]
// }, ],
"uniIdRouter": {}
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#fff",
"backgroundColor": "#fff"
},
// "tabBar": {
// "color": "#999999",
// "selectedColor": "#20b128",
// "borderStyle": "white",
// "backgroundColor": "#FFFFFF",
// "list": [{
// "pagePath": "pages/index/index",
// "text": "首页",
// "iconPath": "static/tab/a.png",
// "selectedIconPath": "static/tab/aa.png"
// },
// {
// "pagePath": "pages/cart/cart",
// "text": "购物车",
// "iconPath": "static/tab/b.png",
// "selectedIconPath": "static/tab/ba.png"
// },
// {
// "pagePath": "pages/my/my",
// "text": "我的",
// "iconPath": "static/tab/c.png",
// "selectedIconPath": "static/tab/ca.png"
// }
// ]
// },
"uniIdRouter": {}
} }

View File

@ -5,6 +5,28 @@
<up-cell title="请添加自提点" :isLink="true" :border="false" @click="shopListShow=true"></up-cell> <up-cell title="请添加自提点" :isLink="true" :border="false" @click="shopListShow=true"></up-cell>
</up-cell-group> </up-cell-group>
</view> --> </view> -->
<view class="m-card m-address">
<view class="address-info">
<view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;">
<up-icon name="map"></up-icon>
<text style="margin: 0 10rpx;">自提点</text>
</view>
<view v-if="shopInfo.mer_id">
<view>{{shopInfo.mer_name}}</view>
<view>
<text>{{shopInfo.service_phone}}</text>
<text
style="color: #20b128;margin-left: 10rpx;font-size: 22rpx;">{{shopInfo.distance}}</text>
</view>
</view>
</view>
</view>
<view class="address-btn">
<view style="width: 80px;"><up-button @click="shopListShow=true" size="small" shape="circle"
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
</view>
</view>
<view v-if="!addressInfo.address_id" class="m-card row"> <view v-if="!addressInfo.address_id" class="m-card row">
<up-cell-group> <up-cell-group>
<up-cell title="我的地址" :isLink="true" :border="false" @click="openAddress()"></up-cell> <up-cell title="我的地址" :isLink="true" :border="false" @click="openAddress()"></up-cell>
@ -26,38 +48,6 @@
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view> color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
</view> </view>
</view> </view>
<view class="m-card m-address">
<view class="address-info">
<view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;">
<up-icon name="map"></up-icon>
<text style="margin: 0 10rpx;">提货人</text>
</view>
<view v-if="shopInfo.mer_id">
<view> <text>姓名</text> {{shopInfo.service_phone}}</view>
</view>
</view>
<view class="top" style="align-items: flex-start;margin-top: 20rpx;">
<view style="color: #333;display: flex;align-items: center;">
<up-icon name="map"></up-icon>
<text style="margin: 0 10rpx;">自提点</text>
</view>
<view v-if="shopInfo.mer_id">
<view>{{shopInfo.mer_name}}</view>
<view>
<text>自提点具体地址</text>
<!-- <text
style="color: #20b128;margin-left: 10rpx;font-size: 22rpx;">{{shopInfo.distance}}</text> -->
</view>
</view>
</view>
</view>
<view class="address-btn">
<view style="width: 80px;"><up-button @click="shopListShow=true" size="small" shape="circle"
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
</view>
</view>
<view class="m-card m-good" v-for="(item,index) in cartList" :key="index"> <view class="m-card m-good" v-for="(item,index) in cartList" :key="index">
<view class="image"> <view class="image">
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image> <up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
@ -108,7 +98,6 @@
<up-textarea style="background-color: #F6F6F6;" v-model="formData.remark" placeholder="暂无备注内容" <up-textarea style="background-color: #F6F6F6;" v-model="formData.remark" placeholder="暂无备注内容"
:height="100"></up-textarea> :height="100"></up-textarea>
</view> --> </view> -->
<<<<<<< HEAD
<view style="width: 100%;height: 200rpx;"></view> <view style="width: 100%;height: 200rpx;"></view>
<view class="fiexd-btn-box"> <view class="fiexd-btn-box">
<view class="tips"> <view class="tips">
@ -123,28 +112,9 @@
</view> </view>
</view> </view>
<view style="width: 200rpx;"> <view style="width: 200rpx;">
<up-button color="#20B128" shape="circle" @click="submitOrder">提交订单</up-button> <up-button color="#20B128" shape="circle" @click="submitOrder" :throttleTime="1000">提交订单</up-button>
</view> </view>
</view> </view>
=======
<view style="width: 100%;height: 200rpx;"></view>
<view class="fiexd-btn-box">
<view class="tips">
<view style="margin-right: 20rpx;"> {{ cartList.length }} </view>
<view class="all">
<text style="color: #000;">合计: </text>
<text></text>
<block v-if="orderInfo.total">
<text style="font-size: 32rpx;font-weight: bold;">{{c_price(orderInfo.total, 0)}}</text>
<text>.{{c_price(orderInfo.total, 1)}}</text>
</block>
</view>
</view>
<view style="width: 200rpx;">
<up-button color="#20B128" shape="circle" @click="submitOrder" :throttleTime="1000">提交订单</up-button>
</view>
</view>
>>>>>>> b6496db8bd748ff7488207e5479f7e6a6d79cbcb
<addressPopup v-if="addressList.length>0" :show="showAddress" :list="addressList" @close="showAddress=false" <addressPopup v-if="addressList.length>0" :show="showAddress" :list="addressList" @close="showAddress=false"
@change="changeAddress" /> @change="changeAddress" />
@ -185,7 +155,6 @@
remark: "" remark: ""
}) })
<<<<<<< HEAD
const isAddress = ref(false); const isAddress = ref(false);
const toastAddressShow = ref(false); const toastAddressShow = ref(false);
@ -253,7 +222,6 @@
uni.$u.toast('定位失败, 请手动选择提货点!') uni.$u.toast('定位失败, 请手动选择提货点!')
}, },
complete: (res) => { complete: (res) => {
console.log("===", res);
myAddressInfo.value.long = res.longitude || ""; myAddressInfo.value.long = res.longitude || "";
myAddressInfo.value.lat = res.latitude || ""; myAddressInfo.value.lat = res.latitude || "";
getMerchantList(); getMerchantList();
@ -282,167 +250,73 @@
isAddress.value = true; isAddress.value = true;
submitOrder(); submitOrder();
} }
=======
// //
const addressList = ref([]); const submitOrder = () => {
const getAddressList = ()=>{ if (!isAddress.value) return toastAddressShow.value = true;
addressListsApi().then(res=>{ createOrder();
addressList.value = res.data.lists; }
addressList.value.forEach(item=>{ //
if(item.is_default) { const cartList = ref([]);
addressInfo.value = item; const orderInfo = ref({});
isAddress.value = true; const checkOrder = () => {
} checkOrderApi({
}) cart_id: cartStore.cartList
if(!isAddress.value && addressList.value.length>0){ }).then(res => {
addressInfo.value = addressList.value[0]; cartList.value = res.data.cart_list;
isAddress.value = true; orderInfo.value = res.data.order;
} })
}) }
} const createOrder = () => {
// createOrderApi({
const showAddress = ref(false); cart_id: cartStore.cartList,
const addressInfo = ref({}); address_id: addressInfo.value.address_id,
const changeAddress = (e) => { mer_id: shopInfo.value.mer_id,
addressInfo.value = e; pay_type: 1
showAddress.value = false; }).then(res => {
isAddress.value = true; if (!res.data?.nonceStr) return uni.$u.toast('支付失败!');
} uni.requestPayment({
const openAddress = ()=>{ provider: 'wxpay',
if(addressList.length>0) showAddress.value=true; timeStamp: res.data.timeStamp,
else uni.navigateTo({ nonceStr: res.data.nonceStr,
url: '/pagesOrder/addressEdit/addressEdit' package: res.data.package,
}) signType: res.data.signType,
} paySign: res.data.paySign,
success: (e) => {
if (e.errMsg == 'requestPayment:ok') {
uni.showModal({
title: '订单支付成功',
confirmText: '查看订单',
cancelText: '继续购买',
success: (e) => {
if (e.confirm) uni.navigateTo({
url: '/pagesOrder/order/order'
})
else uni.navigateBack();
}
})
} else uni.$u.toast('支付失败')
},
fail: (e) => {
uni.$u.toast('用户取消支付')
}
})
}).catch(err => {
uni.$u.toast('网络错误')
})
}
// const c_price = (price, index = 0) => {
const shopListShow = ref(false); price = price + '';
const merchantList = ref([]); return price.split('.')[index] || (index ? '00' : '0');
const myAddressInfo = ref({ }
long: "",
lat: ""
})
const shopInfo = ref({
mer_id: ''
});
const getMerchantList = (mer_name=null)=>{
merchantListApi({
...myAddressInfo.value,
mer_name: mer_name ? mer_name : ''
}).then(res=>{
merchantList.value = res.data.lists;
if(mer_name===null && myAddressInfo.value.long && merchantList.value.length>0 && !shopInfo.value.mer_id) {
shopInfo.value = merchantList.value[0];
}
})
}
getMerchantList('');
//
const LoadAddress = ()=>{
uni.getLocation({
success: (res) => {
},
fail: (err) => {
uni.$u.toast('定位失败, 请手动选择提货点!')
},
complete: (res) => {
myAddressInfo.value.long = res.longitude || "";
myAddressInfo.value.lat = res.latitude || "";
getMerchantList();
}
})
}
LoadAddress();
const changeShop = (e)=>{
shopInfo.value = e;
shopListShow.value = false;
}
const searchShop = (e)=>{
getMerchantList(e)
}
// onLoad(options => {
const addAddress = () => { checkOrder();
toastAddressShow.value = false; })
nextTick(()=>{ onShow(() => {
showAddress.value = true; getAddressList();
}) })
}
//
const goPay = ()=>{
toastAddressShow.value = false;
isAddress.value = true;
submitOrder();
}
>>>>>>> b6496db8bd748ff7488207e5479f7e6a6d79cbcb
//
const submitOrder = () => {
if (!isAddress.value) return toastAddressShow.value = true;
createOrder();
}
//
const cartList = ref([]);
const orderInfo = ref({});
const checkOrder = ()=>{
checkOrderApi({
cart_id: cartStore.cartList
}).then(res=>{
cartList.value = res.data.cart_list;
orderInfo.value = res.data.order;
})
}
const createOrder = ()=>{
createOrderApi({
cart_id: cartStore.cartList,
address_id: addressInfo.value.address_id,
mer_id: shopInfo.value.mer_id,
pay_type: 1
}).then(res=>{
if(!res.data?.nonceStr) return uni.$u.toast('支付失败!');
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: (e) => {
if(e.errMsg == 'requestPayment:ok'){
uni.showModal({
title: '订单支付成功',
confirmText: '查看订单',
cancelText: '继续购买',
success: (e) => {
if(e.confirm) uni.navigateTo({
url: '/pagesOrder/order/order'
})
else uni.navigateBack();
}
})
}else uni.$u.toast('支付失败')
},
fail: (e) => {
uni.$u.toast('用户取消支付')
}
})
}).catch(err=>{
uni.$u.toast('网络错误')
})
}
const c_price = (price, index=0)=>{
price = price + '';
return price.split('.')[index] || (index ? '00' : '0');
}
onLoad(options=>{
checkOrder();
})
onShow(()=>{
getAddressList();
})
</script> </script>
<style lang="scss"> <style lang="scss">
@ -470,12 +344,10 @@
.top { .top {
display: flex; display: flex;
font-size: 28rpx; font-size: 28rpx;
margin-bottom: 10;
.t-name { .t-name {
color: #444; color: #444;
margin: 0 10rpx; margin: 0 10rpx;
margin-right: 40rpx;
} }
} }

View File

@ -23,19 +23,19 @@ const useUserStore = defineStore("user", () => {
uni.setStorageSync('token', data) uni.setStorageSync('token', data)
} }
// #ifdef H5 // #ifdef H5
token.value = "f9421a985006bf3f73bbaff6193da353" token.value = "31f74a72e2d05673ec14d2a6408718ef"
userInfo.value = { userInfo.value = {
avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png", avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png",
id: 9, id: 9,
is_disable: 0, is_disable: 0,
is_new_user: 1, is_new_user: 1,
mobile: "19330904744", mobile: "19330904744",
nickname: "用户1714964250", nickname: "用户1714964250",
supplier: null, supplier: null,
token: "f9421a985006bf3f73bbaff6193da353" token: "31f74a72e2d05673ec14d2a6408718ef"
} }
// #endif // #endif
return { return {
userInfo, userInfo,