商城-购物车

pull/2/head
js199000126 2023-05-24 17:08:06 +08:00
parent a1295f5943
commit 4f1d28feac
10 changed files with 194 additions and 85 deletions

View File

@ -67,7 +67,7 @@ export function setCouponReceive(couponId) {
* @param object data
*/
export function getCoupons(data) {
return request.get('coupons', data, {
return request.get('front/coupons', data, {
noAuth: true
})
}

View File

@ -61,7 +61,7 @@ export function getOrderList(data) {
* @param string unique
*/
export function orderProduct(data) {
return request.post('order/product', data);
return request.post('front/order/product', data);
}
/**
@ -70,7 +70,7 @@ export function orderProduct(data) {
*
*/
export function orderComment(data) {
return request.post('order/comment', data);
return request.post('front/order/comment', data);
}
/**
@ -78,7 +78,7 @@ export function orderComment(data) {
* @param object data
*/
export function orderPay(data) {
return request.post('order/pay', data);
return request.post('front/order/pay', data);
}
/**
@ -105,7 +105,7 @@ export function orderCancel(id) {
*
*/
export function orderDel(uni) {
return request.post('order/del', {
return request.post('front/order/del', {
id: uni
}, {}, 1);
}
@ -124,7 +124,7 @@ export function getOrderDetail(uni) {
*
*/
export function orderAgain(uni) {
return request.post('order/again', {
return request.post('front/order/again', {
orderNo: uni
});
}
@ -135,7 +135,7 @@ export function orderAgain(uni) {
*
*/
export function orderTake(uni) {
return request.post('order/take', {
return request.post('front/order/take', {
id: uni
}, {}, 1);
}
@ -145,7 +145,7 @@ export function orderTake(uni) {
* @returns {*}
*/
export function express(uni) {
return request.get("order/express/" + uni);
return request.get("front/order/express/" + uni);
}
/**
@ -153,7 +153,7 @@ export function express(uni) {
*
*/
export function ordeRefundReason() {
return request.get('order/refund/reason');
return request.get('front/order/refund/reason');
}
/**
@ -161,7 +161,7 @@ export function ordeRefundReason() {
* @param object data
*/
export function orderRefundVerify(data) {
return request.post('order/refund', data);
return request.post('front/order/refund', data);
}
/**
@ -169,7 +169,7 @@ export function orderRefundVerify(data) {
* @param string cartId
*/
export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain) {
return request.post('order/confirm', {
return request.post('front/order/confirm', {
cartIds: cartId,
isNew: isNew,
addAgain: addAgain,
@ -185,7 +185,7 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain
*
*/
export function getCouponsOrderPrice(preOrderNo) {
return request.get(`coupons/order/${preOrderNo}`)
return request.get(`front/coupons/order/${preOrderNo}`)
}
/**
@ -195,7 +195,7 @@ export function getCouponsOrderPrice(preOrderNo) {
*
*/
export function orderCreate(data) {
return request.post('order/create', data);
return request.post('front/order/create', data);
}
/**
@ -205,7 +205,7 @@ export function orderCreate(data) {
* @returns {*}
*/
export function postOrderComputed(data) {
return request.post("order/computed/price", data);
return request.post("front/order/computed/price", data);
}
/**
@ -213,7 +213,7 @@ export function postOrderComputed(data) {
* @param object data
*/
export function qrcodeApi(data) {
return request.post('qrcode/str2base64', data, {}, 1);
return request.post('front/qrcode/str2base64', data, {}, 1);
}
/**
@ -221,7 +221,7 @@ export function qrcodeApi(data) {
* @param object data
*/
export function wechatOrderPay(data) {
return request.post('pay/payment', data);
return request.post('api/front/pay/payment', data);
}
/**
@ -229,7 +229,7 @@ export function wechatOrderPay(data) {
* @param object data
*/
export function wechatQueryPayResult(data) {
return request.get('pay/queryPayResult?orderNo=' + data);
return request.get('front/pay/queryPayResult?orderNo=' + data);
}
/**
@ -237,7 +237,7 @@ export function wechatQueryPayResult(data) {
* @param object data
*/
export function applyRefund(orderId) {
return request.get(`order/apply/refund/${orderId}`);
return request.get(`front/order/apply/refund/${orderId}`);
}
/**
@ -253,5 +253,5 @@ export function preOrderApi(data) {
* @param object preOrderNo
*/
export function loadPreOrderApi(preOrderNo) {
return request.get(`order/load/pre/${preOrderNo}`);
return request.get(`front/order/load/pre/${preOrderNo}`);
}

View File

@ -35,8 +35,9 @@ export function getPreOrder(preOrderType, orderDetails) {
"preOrderType": preOrderType,
"orderDetails": orderDetails
}).then(res => {
// console.log(res.data.columns.preOrderNo,'preOrder')
uni.navigateTo({
url: '/pages/users/order_confirm/index?preOrderNo=' + res.data.preOrderNo
url: '/pages/users/order_confirm/index?preOrderNo=' + res.data.columns.preOrderNo
});
}).catch(err => {
return util.Tips({

View File

@ -1,8 +1,51 @@
{
"name": "yudao-ui-app",
"version": "1.0.0",
"lockfileVersion": 1,
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "yudao-ui-app",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"clipboard": "^2.0.11"
}
},
"node_modules/clipboard": {
"version": "2.0.11",
"resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"dependencies": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"node_modules/delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"node_modules/good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"dependencies": {
"delegate": "^3.1.2"
}
},
"node_modules/select": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
},
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
}
},
"dependencies": {
"clipboard": {
"version": "2.0.11",

View File

@ -574,18 +574,18 @@
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [
// {
// "pagePath": "pages/index/index",
// "iconPath": "static/images/tabbar/nav_icon_shop.png",
// "selectedIconPath": "static/images/1-002.png",
// "text": "商城"
// },
// {
// "pagePath": "pages/goods_cate/goods_cate",
// "iconPath": "static/images/tabbar/nav_icon_sort.png",
// "selectedIconPath": "static/images/2-002.png",
// "text": "分类"
// },
{
"pagePath": "pages/index/index",
"iconPath": "static/images/tabbar/nav_icon_shop.png",
"selectedIconPath": "static/images/1-002.png",
"text": "商城"
},
{
"pagePath": "pages/goods_cate/goods_cate",
"iconPath": "static/images/tabbar/nav_icon_sort.png",
"selectedIconPath": "static/images/2-002.png",
"text": "分类"
},
{
"pagePath": "pages/member_application/index",
"iconPath": "static/images/2-001.png",
@ -599,12 +599,12 @@
"text": "会员申请",
"visible":false
},
// {
// "pagePath": "pages/order_addcart/order_addcart",
// "iconPath": "static/images/tabbar/nav_icon_cart.png",
// "selectedIconPath": "static/images/3-002.png",
// "text": "购物车"
// },
{
"pagePath": "pages/order_addcart/order_addcart",
"iconPath": "static/images/tabbar/nav_icon_cart.png",
"selectedIconPath": "static/images/3-002.png",
"text": "购物车"
},
{
"pagePath": "pages/user/index",
"iconPath": "static/images/tabbar/nav_icon_my.png",

View File

@ -4,14 +4,14 @@
<view class="header_top">
<view class="content">
<view class="left">
<u--image class="image" src="https://cdn.uviewui.com/uview/album/1.jpg" width="160rpx" height="160rpx" shape="circle"></u--image>
<u--image class="image" :src="tenant.logo" width="160rpx" height="160rpx" shape="circle"></u--image>
</view>
<view class="center">
<view class="top" @click="go()"></view>
<view class="top">{{tenant.name}}</view>
<view class="text">
<view class="detail"><u-icon style="display: inline-block;line-height: 28rpx;" name="file-text-fill" color="#fff" size="28rpx"></u-icon>:</view>
<view class="detail"><u-icon style="display: inline-block;line-height: 28rpx;" name="phone" color="#fff" size="28rpx"></u-icon>:023-87330926</view>
<view class="detail"><u-icon style="display: inline-block;line-height: 28rpx;" name="clock" color="#fff" size="28rpx"></u-icon>:8:30-19:00</view>
<view class="detail"><u-icon style="display: inline-block;line-height: 28rpx;" name="file-text-fill" color="#fff" size="28rpx"></u-icon>:{{tenant.introduction}}</view>
<view class="detail"><u-icon style="display: inline-block;line-height: 28rpx;" name="phone" color="#fff" size="28rpx"></u-icon>:{{tenant.serviceMobile}}</view>
<view class="detail"><u-icon style="display: inline-block;line-height: 28rpx;" name="clock" color="#fff" size="28rpx"></u-icon>:{{tenant.serviceTime}}</view>
</view>
</view>
<view class="right">
@ -49,24 +49,33 @@
@change="change"
></u--input>
</view>
<view class="button">
<view class="button" @tap="searchSubmitValue">
搜索
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="item" v-for="i in 4">
<view class="item">
<image src="@/static/images/shop/index_cart.png"></image>
<view class="title">爆款秒杀</view>
<image class="img1" src="@/static/images/shop/shoes.png" mode=""></image>
<image class="img2" src="@/static/images/shop/cloth.png" mode=""></image>
</view>
<view class="item">
<image src="@/static/images/shop/index_cart.png"></image>
<view class="title rank">排行榜</view>
<image class="img1" src="@/static/images/shop/shoes.png" mode=""></image>
<image class="img2" src="@/static/images/shop/cloth.png" mode=""></image>
</view>
</view>
</view>
<view class="container">
<view class="item" v-for="item in productList">
<view class="item" v-for="item in productList" @click="goDetail(item)">
<image :src="item.image" mode=""></image>
<view class="name">{{item.storeName}}</view>
<text>{{item.price}}</text>
<view class="car" @click="addCart(item.id)"></view>
<text><u--text color="#E50202" mode="price" :text="item.price"></u--text></text>
</view>
</view>
<view class="" style="margin-top: 110rpx;">
@ -247,6 +256,7 @@
configApi: {}, //
spikeList: [], //
point: '',
tenant: {},
privacyStatus: false, //
tabsScrollLeft: 0, // tabs
scrollLeft: 0,
@ -306,8 +316,9 @@
// ]);
getUserInfo().then(res => {
this.userInfo = res.data
getTenant(this.userInfo.userId).then(res=>{
console.log(res,'getTenant')
getTenant(153).then(res=>{
this.tenant = res.data
this.text = res.data.notice
})
})
this.getBanners()
@ -324,11 +335,25 @@
})
},
methods: {
change(){
console.log(this.value,'value')
},
//
searchSubmitValue: function() {
if (this.value.length > 0)
uni.navigateTo({
url: '/pages/goods_list/index?searchValue=' + this.value
})
else
return this.$util.Tips({
title: '请填写要搜索的产品信息'
});
},
//
addCart(id){
getSpuDetail(id).then(res => {
console.log(res.data.productAttr[0].id,'1111111111111')
let unique = res.data.productAttr[0].id
console.log(res.data.productValue.默认.id,'1111111111111')
let unique = res.data.productValue.默认.id
postCartAdd({
productId: id,
productAttrUnique: unique,
@ -341,10 +366,11 @@
go(){
console.log(this.productList,'------')
},
// banneruserInfo
getBanners(){
console.log(this.$store.uid,'uid')
// console.log(this.$store.tenantId,'tenantId')
getBanner().then(res=>{
this.bannerList = res.data.list[0]
console.log(this.bannerList,'banner')
@ -845,12 +871,12 @@
}
}
.bottom {
margin-top: 27rpx;
height: 200rpx;
overflow: scroll;
white-space: nowrap;
.item {
position: relative;
display: inline-block;
width: 370rpx;
height: 199rpx;
@ -859,6 +885,42 @@
width: 370rpx;
height: 199rpx;
}
.title {
position: absolute;
left: 22rpx;
top: 22rpx;
width: 116rpx;
height: 34rpx;
line-height: 34rpx;
text-align: center;
background: linear-gradient(0deg, #FF4200 0%, #FFB21D 100%);
border-radius: 8rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.rank {
width: 90rpx;
height: 34rpx;
line-height: 34rpx;
background: linear-gradient(0deg, #F74A7B 0%, #FFAFAF 100%);
border-radius: 8rpx;
}
.img1 {
position: absolute;
left: 17rpx;
top: 81rpx;
width: 166rpx;
height: 71rpx;
}
.img2 {
position: absolute;
top: 22rpx;
right: 25rpx;
width: 138rpx;
height: 132rpx;
}
}
}
}
@ -893,16 +955,18 @@
color: #000000;
}
text {
margin-left: 15rpx;
position: absolute;
right: 20rpx;
bottom: 14rpx;
font-size: 28rpx;
white-space: nowrap;
font-family: PingFang SC;
font-weight: 400;
color: #E50202;
}
.car {
position: absolute;
right: 10rpx;
bottom: 5rpx;
width: 60rpx;
height: 60rpx;
background: url(@/static/images/shop/car.png);

View File

@ -2,7 +2,7 @@
<view class="container">
<u-navbar title="购物车" bgColor="transparent">
<view class="u-nav-slot" slot="left"></view>
<view class="u-nav-slot" slot="right" @click="isManager = !isManager">管理</view>
<view class="u-nav-slot" slot="right" @tap="isManager = !isManager">管理</view>
</u-navbar>
<view class="bg">
<image src="@/static/images/shop/cart_bg.png"></image>
@ -15,10 +15,10 @@
<text class="shopName">{{item.storeName}}</text>
</view>
<view class="content">
<text :class="[reChecked(item)?'checkedIcon':'noCheckIcon']" @click="reelect(item,index)"
<text :class="[reChecked(item)?'checkedIcon':'noCheckIcon']" @tap="reelect(item,index)"
style="margin-left: 26rpx;"></text>
<view class="image">
<image :src="item.image" mode=""></image>
<image :src="item.image" style="border-radius: 10rpx;"></image>
</view>
<view class="detail">
<view class="name">
@ -34,12 +34,12 @@
<!-- <view class="sum">x{{item.cartNum}}</view> -->
<view class="numberBox">
<u-number-box v-model="cartNum" min="0">
<view @click="ChangeCartCountJian(item.id,item.cartNum)" slot="minus" class="minus">
<view @tap="ChangeCartCountJian(item.id,item.cartNum)" slot="minus" class="minus">
<u-icon name="minus" size="12"></u-icon>
</view>
<text slot="input" style="width: 50px;text-align: center;"
class="input">{{item.cartNum}}</text>
<view slot="plus" class="plus" @click="ChangeCartCountJia(item.id,item.cartNum)">
<view slot="plus" class="plus" @tap="ChangeCartCountJia(item.id,item.cartNum)">
<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
</view>
</u-number-box>
@ -52,20 +52,20 @@
</view>
<view class="fixed" v-if="isManager">
<view class="all" @click="allCheck">
<view class="all" @tap="allCheck">
<text :class="[isAllSelect?'checkedIcon':'noCheckIcon']"></text>
<text>全选</text>
</view>
<view class="allPrice">合计 <text>998.00</text> </view>
<view class="closeAll" @click="subOrder">()</view>
<view class="closeAll" @tap="subOrder">()</view>
</view>
<view class="fixed" v-if="!isManager">
<view class="all" @click="allCheck">
<view class="all" @tap="allCheck">
<text :class="[isAllSelect?'checkedIcon':'noCheckIcon']"></text>
<text>全选</text>
</view>
<view class="collect">收藏</view>
<view class="delAll" @click="subDel"></view>
<view class="delAll" @tap="subDel"></view>
</view>
</view>
</template>
@ -265,7 +265,7 @@
},
//
reelect(item, index) {
// console.log(item,'item')
console.log(item,'item哇')
// let reCheck = {
// id: item.id,
// num: item.cartNum+2,

View File

@ -26,7 +26,7 @@
</view>
<view class="content">
<view class="image">
<u--image :showLoading="true" src="https://cdn.uviewui.com/uview/album/1.jpg" width="111rpx"
<u--image :showLoading="true" radius="10rpx" src="https://cdn.uviewui.com/uview/album/1.jpg" width="111rpx"
height="99rpx" @click="click"></u--image>
</view>
<view class="text">
@ -37,7 +37,7 @@
Gucci Blondie小号托特包
</view>
<view class="prices">
918.9
<u--text color="#E50202" mode="price" :text="orderInfo.totalPrice"></u--text>
</view>
</view>
<div class="sum">x1</div>
@ -48,15 +48,15 @@
<view style="height: 1rpx;"></view>
<view class="priceitems">
<text class="itemsleft">商品总价</text>
<text class="itemsright">918.9</text>
<text class="itemsright"><u--text mode="price" :text="orderInfo.proTotalPrice"></u--text></text>
</view>
<view class="priceitems">
<text class="itemsleft">运费</text>
<text class="itemsright">0.00</text>
<text class="itemsright"><u--text mode="price" :text="orderInfo.payPostage"></u--text></text>
</view>
<view class="priceitems">
<text class="itemsleft">待付金额</text>
<text class="itemsright">918.9</text>
<text class="itemsright"><u--text mode="price" :text="orderInfo.totalPrice"></u--text></text>
</view>
</view>
<view class="detail">
@ -96,8 +96,8 @@
</view>
<view class="zf">
<view class="zfNumber">待支付: <text>123</text> </view>
<view class="closeOrder" @click="cancelOrder()"></view>
<view class="orderPay">立即付款</view>
<view class="closeOrder" tap="cancelOrder()">取消订</view>
<view class="orderPay" @tap='pay_open(orderInfo.orderId)'>立即付款</view>
</view>
</view>

View File

@ -111,7 +111,7 @@
<view class='list'>
<view class='payItem acea-row row-middle' :class='active==index ?"on":""'
@tap='payItem(index)' v-for="(item,index) in cartArr" :key='index'
v-if="item.payStatus==1">
>
<view class='name acea-row row-center-wrapper'>
<view class='iconfont animated'
:class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'>
@ -952,6 +952,7 @@
payChannel: that.payChannel
};
console.log(that.system_store.phone,'data')
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice))
return that.$util
.Tips({

View File

@ -23,17 +23,16 @@
</view>
<view class="tabs">
<u-tabs :list="list1" @click="click" lineWidth="60rpx" lineHeight="9rpx"></u-tabs>
<u-tabs :list="list1" @tap="click" lineWidth="60rpx" lineHeight="9rpx"></u-tabs>
</view>
<!-- <view class="item" @click="goOrderDetails(123)">
<!-- <view class="item" @tap="goOrderDetails(123)">
</view> -->
<view class='list' v-if="status='0'">
<!-- <view class='item' v-for="(item,index) in orderList" :key="index"> -->
<view class='item' v-for="(item,index) in orderList" :key="item.id">
<view @click='goOrderDetails(item.orderId)'>
<!-- <view @click='goOrderDetails(item.orderId)'> -->
<view @tap='goOrderDetails(item.orderId)'>
<view class="box"></view>
<view class="top">
<view class="shopName">
@ -45,8 +44,8 @@
</view>
<view class="content">
<view class="image">
<u--image :showLoading="true" src="https://cdn.uviewui.com/uview/album/1.jpg" width="111rpx"
height="99rpx" @click="click"></u--image>
<u--image :showLoading="true" radius="10rpx" src="https://cdn.uviewui.com/uview/album/1.jpg" width="111rpx"
height="99rpx" @tap="click"></u--image>
</view>
<view class="text">
<view class="name">
@ -62,13 +61,14 @@
</view>
</view>
</view>
<view v-if="orderList.length == 0">
<emptyPage title="暂无订单~"></emptyPage>
</view>
</view>
<!-- <view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length>0">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view> -->
<!-- <view v-if="orderList.length == 0">
<emptyPage title="暂无订单~"></emptyPage>
</view> -->
</view>
</template>