This commit is contained in:
parent
7c36041677
commit
ecc4df957b
|
@ -1,8 +1,8 @@
|
||||||
let BASE_URL
|
let BASE_URL
|
||||||
import store from "@/store/user.js"
|
import store from "@/store/user.js"
|
||||||
// 环境
|
// 环境
|
||||||
let env = "dev"
|
// let env = "dev"
|
||||||
// let env = "prod"
|
let env = "prod"
|
||||||
|
|
||||||
switch(env){
|
switch(env){
|
||||||
case 'prod': BASE_URL = 'https://ceshi-erp.lihaink.cn';break;
|
case 'prod': BASE_URL = 'https://ceshi-erp.lihaink.cn';break;
|
||||||
|
|
17
pages.json
17
pages.json
|
@ -9,20 +9,19 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
|
||||||
"path": "pages/index/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "购物",
|
|
||||||
"disableScroll": true,
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/login/login",
|
"path": "pages/login/login",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "登录",
|
"navigationBarTitleText": "登录",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/index/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "购物",
|
||||||
|
"disableScroll": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -75,15 +75,23 @@
|
||||||
const isAgree = ref(false); //是否同意协议
|
const isAgree = ref(false); //是否同意协议
|
||||||
|
|
||||||
const weixinLogin = () => {
|
const weixinLogin = () => {
|
||||||
if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议')
|
if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议');
|
||||||
|
uni.showLoading({
|
||||||
|
title: '登录中'
|
||||||
|
})
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
userLoginWeixinApi({
|
userLoginWeixinApi({
|
||||||
code: res.code
|
code: res.code
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
console.log(res);
|
userStore.setUserInfo(res.data);
|
||||||
|
userStore.setToken(res.data.token);
|
||||||
|
uni.hideLoading();
|
||||||
|
if(!res.data.supplier) uni.reLaunch({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
else uni.$u.toast('功能开发中')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
<image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp"
|
<image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp"
|
||||||
mode="widthFix"></image>
|
mode="widthFix"></image>
|
||||||
<view class="u-card">
|
<view class="u-card">
|
||||||
<up-avatar src="" size="80"></up-avatar>
|
<up-avatar :src="userInfo.avatar" size="80"></up-avatar>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="u-phone">151****6699</view>
|
<view class="u-phone">{{userInfo.nickname}}</view>
|
||||||
<view class="u-id">ID: 6655</view>
|
<view class="u-id">ID: {{userInfo.id}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -56,6 +56,11 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
import useUserStore from "@/store/user";
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
const userInfo = userStore.userInfo;
|
||||||
|
|
||||||
const navTo = (type=0) => {
|
const navTo = (type=0) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
@ -37,51 +37,57 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
import modal from "@/components/modal.vue";
|
import modal from "@/components/modal.vue";
|
||||||
import { addressListsApi, addressEditApi, addressDeleteApi } from "@/api/user.js";
|
import { addressListsApi, addressEditApi, addressDeleteApi } from "@/api/user.js";
|
||||||
import { onShow } from "@dcloudio/uni-app";
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
|
|
||||||
const navTo = (url)=>{
|
const navTo = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url
|
url: url
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
const deleteInfo = ref({});
|
const deleteInfo = ref({});
|
||||||
const showDelete = (item)=>{
|
const showDelete = (item) => {
|
||||||
|
if(addressList.value.length<=1) return uni.$u.toast('最后一个地址无法删除!');
|
||||||
deleteInfo.value = item;
|
deleteInfo.value = item;
|
||||||
show.value = true;
|
show.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateDefault = (item)=>{
|
const updateDefault = (item) => {
|
||||||
addressEditApi({
|
addressEditApi({
|
||||||
...item,
|
...item,
|
||||||
is_default: !item.is_default
|
is_default: !item.is_default
|
||||||
|
}).then(res => {
|
||||||
|
getAddressLists()
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
const deleteAddress = ()=>{
|
}
|
||||||
|
|
||||||
|
const deleteAddress = () => {
|
||||||
addressDeleteApi({
|
addressDeleteApi({
|
||||||
address_id: deleteInfo.value.address_id
|
address_id: deleteInfo.value.address_id
|
||||||
|
}).then(res => {
|
||||||
|
getAddressLists();
|
||||||
})
|
})
|
||||||
show.value = false;
|
show.value = false;
|
||||||
}
|
|
||||||
|
|
||||||
const addressList = ref([]);
|
}
|
||||||
const getAddressLists = ()=>{
|
|
||||||
addressListsApi().then(res=>{
|
const addressList = ref([]);
|
||||||
|
const getAddressLists = () => {
|
||||||
|
addressListsApi().then(res => {
|
||||||
addressList.value = res.data.lists;
|
addressList.value = res.data.lists;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onShow(()=>{
|
onShow(() => {
|
||||||
getAddressLists();
|
getAddressLists();
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -119,10 +125,11 @@ onShow(()=>{
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|
||||||
.left{
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
margin-right: 6rpx;
|
margin-right: 6rpx;
|
||||||
|
@ -147,20 +154,26 @@ onShow(()=>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.bottom-fixed{
|
|
||||||
|
.bottom-fixed {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
height: 120rpx;
|
height: 120rpx;
|
||||||
height: calc(constant(safe-area-inset-bottom) + 120rpx); /* 适用于iOS设备 */
|
height: calc(constant(safe-area-inset-bottom) + 120rpx);
|
||||||
height: calc(env(safe-area-inset-bottom) + 120rpx); /* 适用于Android设备 */
|
/* 适用于iOS设备 */
|
||||||
|
height: calc(env(safe-area-inset-bottom) + 120rpx);
|
||||||
|
/* 适用于Android设备 */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 20rpx); /* 适用于iOS设备 */
|
padding-bottom: calc(constant(safe-area-inset-bottom) + 20rpx);
|
||||||
padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx); /* 适用于Android设备 */
|
/* 适用于iOS设备 */
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
|
||||||
|
/* 适用于Android设备 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes disappear {
|
@keyframes disappear {
|
||||||
to {
|
to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
|
@ -2,88 +2,109 @@
|
||||||
<view class="shop-item">
|
<view class="shop-item">
|
||||||
<view class="item-title" @click="navTo">
|
<view class="item-title" @click="navTo">
|
||||||
<view>{{datas.number}}</view>
|
<view>{{datas.number}}</view>
|
||||||
<view>待付款</view>
|
<view v-if="datas.paid==0">
|
||||||
|
<text>待付款</text>
|
||||||
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<text v-if="datas.status==0">待发货</text>
|
||||||
|
<text v-if="datas.status==1">待收货</text>
|
||||||
|
<text v-if="datas.status==2||datas.status==3">已完成</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-body" @click="navTo">
|
<view class="item-body" @click="navTo">
|
||||||
<view class="body-content">
|
<view class="body-content">
|
||||||
|
<view style="display: flex;flex: 1;flex-shrink: 0;">
|
||||||
<view v-for="(item,index) in datas.goods_list" :key="index">
|
<view v-for="(item,index) in datas.goods_list" :key="index">
|
||||||
<image class="image" :src="item.imgs"></image>
|
<image class="image" :src="item.imgs"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="all">共5件商品, 总金额 <text>¥{{datas.total}}</text> </view>
|
<view
|
||||||
|
style="display: flex;flex-direction: column;align-items: center;justify-content: center;width: 100rpx;">
|
||||||
|
<up-icon name="arrow-right-double" color="#20B128"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="type==1" class="item-btn">
|
</view>
|
||||||
|
<view class="all">共 {{datas.goods_count}} 件商品, 总金额 <text>¥{{datas.total}}</text> </view>
|
||||||
|
</view>
|
||||||
|
<view v-if="datas.paid=0" class="item-btn">
|
||||||
<view style="width: 80px;"><up-button size="small" plain color="#989898" shape="circle">取消订单</up-button></view>
|
<view style="width: 80px;"><up-button size="small" plain color="#989898" shape="circle">取消订单</up-button></view>
|
||||||
<view style="width: 80px;"><up-button size="small" plain color="#20B128" shape="circle">立即支付</up-button></view>
|
<view style="width: 80px;"><up-button size="small" plain color="#20B128" shape="circle">立即支付</up-button></view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="type==2||type==0" class="item-btn">
|
<view v-else class="item-btn">
|
||||||
<view style="width: 80px;"><up-button size="small" plain color="#989898" shape="circle">申请售后</up-button></view>
|
<!-- <view style="width: 80px;"><up-button size="small" plain color="#989898" shape="circle">申请售后</up-button></view> -->
|
||||||
<view style="width: 80px;"><up-button size="small" plain color="#20B128" shape="circle">确认收货</up-button></view>
|
<view v-if="datas.status==1" style="width: 80px;"><up-button size="small" plain color="#20B128"
|
||||||
<view style="width: 80px;"><up-button size="small" plain color="#20B128" shape="circle">再次购买</up-button></view>
|
shape="circle">确认收货</up-button></view>
|
||||||
|
<view v-if="datas.status==2||datas.status==3" style="width: 80px;"><up-button size="small" plain color="#20B128"
|
||||||
|
shape="circle">再次购买</up-button></view>
|
||||||
|
<view @click="navTo" style="width: 80px;"><up-button size="small" plain color="#20B128"
|
||||||
|
shape="circle">查看详情</up-button></view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="type==3" class="item-close">
|
<!-- <view v-if="type==3" class="item-close">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view class="type">退款申请中</view>
|
<view class="type">退款申请中</view>
|
||||||
<view>等待商家处理</view>
|
<view>等待商家处理</view>
|
||||||
</view>
|
</view>
|
||||||
<up-icon name="arrow-right"></up-icon>
|
<up-icon name="arrow-right"></up-icon>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const props = defineProps({
|
// 订单状态(0:待发货;1:待收货;2:已完成;3:已完成)
|
||||||
type:{
|
const props = defineProps({
|
||||||
|
type: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
datas:{
|
datas: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: ()=>{}
|
default: () => {}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
const navTo = ()=>{
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pagesOrder/detail/detail?type=0&id=${props.datas.id}`
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const navTo = () => {
|
||||||
}
|
uni.navigateTo({
|
||||||
|
url: `/pagesOrder/detail/detail?type=${props.datas.paid}&id=${props.datas.id}`
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.shop-item {
|
||||||
.shop-item{
|
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 14rpx;
|
border-radius: 14rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.item-title{
|
|
||||||
|
.item-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.item-body{
|
|
||||||
|
.item-body {
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
.body-content{
|
|
||||||
|
.body-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
color: #989898;
|
color: #989898;
|
||||||
|
|
||||||
|
.image {
|
||||||
.image{
|
width: 160rpx;
|
||||||
width: 120rpx;
|
height: 160rpx;
|
||||||
height: 120rpx;
|
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
}
|
}
|
||||||
.title{
|
|
||||||
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
.tips{
|
|
||||||
|
.tips {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
@ -91,23 +112,28 @@ const navTo = ()=>{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.all{
|
|
||||||
|
.all {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
text{
|
|
||||||
|
text {
|
||||||
color: #F55726;
|
color: #F55726;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item-btn{
|
|
||||||
|
.item-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
view{
|
|
||||||
|
view {
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item-close{
|
|
||||||
|
.item-close {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -115,9 +141,10 @@ const navTo = ()=>{
|
||||||
padding: 15rpx;
|
padding: 15rpx;
|
||||||
border-radius: 14rpx;
|
border-radius: 14rpx;
|
||||||
|
|
||||||
.title{
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
.type{
|
|
||||||
|
.type {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
const tablist = ref([
|
const tablist = ref([
|
||||||
{ name: '全部' },
|
{ name: '全部' },
|
||||||
{ name: '待付款' },
|
{ name: '待付款' },
|
||||||
|
{ name: '待发货' },
|
||||||
{ name: '待收货' },
|
{ name: '待收货' },
|
||||||
// { name: '退款/售后' },
|
// { name: '退款/售后' },
|
||||||
]);
|
]);
|
||||||
|
@ -61,10 +62,13 @@
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
|
[],
|
||||||
])
|
])
|
||||||
const getOrderList = (type=0)=>{
|
const getOrderList = (type=0, status='', paid=1)=>{
|
||||||
orderListApi({
|
orderListApi({
|
||||||
...where.value
|
...where.value,
|
||||||
|
status: status,
|
||||||
|
paid: paid
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
orderList.value[type] = res.data.lists;
|
orderList.value[type] = res.data.lists;
|
||||||
})
|
})
|
||||||
|
@ -75,7 +79,10 @@
|
||||||
tabsActive.value = +options.type;
|
tabsActive.value = +options.type;
|
||||||
swiperCurrent.value = +options.type;
|
swiperCurrent.value = +options.type;
|
||||||
}
|
}
|
||||||
getOrderList();
|
getOrderList(0);
|
||||||
|
getOrderList(1, '', 0);
|
||||||
|
getOrderList(2, 0);
|
||||||
|
getOrderList(3, 1);
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
:customStyle="{color:'#666666'}">修改</up-button></view>
|
:customStyle="{color:'#666666'}">修改</up-button></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="!isAddress" 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="showAddress=true"></up-cell>
|
<up-cell title="我的地址" :isLink="true" :border="false" @click="openAddress()"></up-cell>
|
||||||
</up-cell-group>
|
</up-cell-group>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="m-card m-address">
|
<view v-else class="m-card m-address">
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad } from "@dcloudio/uni-app"
|
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||||
import { nextTick, ref } from "vue"
|
import { nextTick, ref } from "vue"
|
||||||
import addressPopup from "@/components/addressPopup.vue";
|
import addressPopup from "@/components/addressPopup.vue";
|
||||||
import shopListPopupVue from "@/components/shopListPopup.vue";
|
import shopListPopupVue from "@/components/shopListPopup.vue";
|
||||||
|
@ -169,6 +169,12 @@
|
||||||
isAddress.value = true;
|
isAddress.value = true;
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
const openAddress = ()=>{
|
||||||
|
if(addressList.length>0) showAddress.value=true;
|
||||||
|
else uni.navigateTo({
|
||||||
|
url: '/pagesOrder/addressEdit/addressEdit'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 提货点相关
|
// 提货点相关
|
||||||
const shopListShow = ref(false);
|
const shopListShow = ref(false);
|
||||||
|
@ -275,6 +281,8 @@
|
||||||
|
|
||||||
onLoad(options=>{
|
onLoad(options=>{
|
||||||
checkOrder();
|
checkOrder();
|
||||||
|
})
|
||||||
|
onShow(()=>{
|
||||||
getAddressList();
|
getAddressList();
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -15,8 +15,9 @@ const useUserStore = defineStore("user", () => {
|
||||||
|
|
||||||
userInfo.value = {
|
userInfo.value = {
|
||||||
"nickname": "哈哈",
|
"nickname": "哈哈",
|
||||||
|
"id": 1,
|
||||||
"mobile": "17685151643",
|
"mobile": "17685151643",
|
||||||
"avatar": "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/avatar.png",
|
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/tFJnfhVKlAlIecticsOhjAu8CHa6ibZacWrcHHkiahu7f0dQlWYgwu1b0TPLSLlO1xCTa6KN1krqg3XSIo3vq6uCQ/132",
|
||||||
"token": "a8670fe7f1014c0f5125f6ca0c3b9cb3"
|
"token": "a8670fe7f1014c0f5125f6ca0c3b9cb3"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@ const useUserStore = defineStore("user", () => {
|
||||||
}
|
}
|
||||||
token.value = "a8670fe7f1014c0f5125f6ca0c3b9cb3"
|
token.value = "a8670fe7f1014c0f5125f6ca0c3b9cb3"
|
||||||
|
|
||||||
return { userInfo, setToken, token, setToken }
|
return { userInfo, setUserInfo, token, setToken }
|
||||||
})
|
})
|
||||||
|
|
||||||
export default useUserStore;
|
export default useUserStore;
|
|
@ -118,8 +118,8 @@ require("./uni_modules/uview-plus/libs/config/props/upload.js");
|
||||||
require("./uni_modules/uview-plus/libs/config/zIndex.js");
|
require("./uni_modules/uview-plus/libs/config/zIndex.js");
|
||||||
require("./uni_modules/uview-plus/libs/function/platform.js");
|
require("./uni_modules/uview-plus/libs/function/platform.js");
|
||||||
if (!Math) {
|
if (!Math) {
|
||||||
"./pages/index/index.js";
|
|
||||||
"./pages/login/login.js";
|
"./pages/login/login.js";
|
||||||
|
"./pages/index/index.js";
|
||||||
"./pages/cart/cart.js";
|
"./pages/cart/cart.js";
|
||||||
"./pages/my/my.js";
|
"./pages/my/my.js";
|
||||||
"./pagesOrder/order/order.js";
|
"./pagesOrder/order/order.js";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/index/index",
|
|
||||||
"pages/login/login",
|
"pages/login/login",
|
||||||
|
"pages/index/index",
|
||||||
"pages/cart/cart",
|
"pages/cart/cart",
|
||||||
"pages/my/my"
|
"pages/my/my"
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
const _imports_0$1 = "/static/tab/ba.png";
|
const _imports_1$1 = "/static/icon/n-check.png";
|
||||||
const _imports_1$1 = "/static/tab/ca.png";
|
const _imports_0$1 = "/static/icon/check.png";
|
||||||
|
const _imports_0 = "/static/tab/ba.png";
|
||||||
|
const _imports_1 = "/static/tab/ca.png";
|
||||||
const _imports_2 = "/static/icon/cart.png";
|
const _imports_2 = "/static/icon/cart.png";
|
||||||
const _imports_1 = "/static/icon/n-check.png";
|
|
||||||
const _imports_0 = "/static/icon/check.png";
|
|
||||||
exports._imports_0 = _imports_0$1;
|
exports._imports_0 = _imports_0$1;
|
||||||
exports._imports_0$1 = _imports_0;
|
exports._imports_0$1 = _imports_0;
|
||||||
exports._imports_1 = _imports_1$1;
|
exports._imports_1 = _imports_1$1;
|
||||||
|
|
|
@ -72,9 +72,9 @@ const _sfc_main = {
|
||||||
f: common_vendor.t(item.detail),
|
f: common_vendor.t(item.detail),
|
||||||
g: addressType.value == index
|
g: addressType.value == index
|
||||||
}, addressType.value == index ? {
|
}, addressType.value == index ? {
|
||||||
h: common_assets._imports_0$1
|
h: common_assets._imports_0
|
||||||
} : {
|
} : {
|
||||||
i: common_assets._imports_1$1
|
i: common_assets._imports_1
|
||||||
}, {
|
}, {
|
||||||
j: index,
|
j: index,
|
||||||
k: common_vendor.o(($event) => addressType.value = index, index)
|
k: common_vendor.o(($event) => addressType.value = index, index)
|
||||||
|
|
|
@ -180,9 +180,9 @@ const _sfc_main = {
|
||||||
return common_vendor.e({
|
return common_vendor.e({
|
||||||
a: !item.check
|
a: !item.check
|
||||||
}, !item.check ? {
|
}, !item.check ? {
|
||||||
b: common_assets._imports_1$1
|
b: common_assets._imports_1
|
||||||
} : {
|
} : {
|
||||||
c: common_assets._imports_0$1
|
c: common_assets._imports_0
|
||||||
}, {
|
}, {
|
||||||
d: common_vendor.o(($event) => checkItem(item, !item.check), index),
|
d: common_vendor.o(($event) => checkItem(item, !item.check), index),
|
||||||
e: item.imgs,
|
e: item.imgs,
|
||||||
|
@ -228,9 +228,9 @@ const _sfc_main = {
|
||||||
o: common_vendor.o(animationfinish),
|
o: common_vendor.o(animationfinish),
|
||||||
p: common_vendor.unref(checkAll) != cartInfo.value.count
|
p: common_vendor.unref(checkAll) != cartInfo.value.count
|
||||||
}, common_vendor.unref(checkAll) != cartInfo.value.count ? {
|
}, common_vendor.unref(checkAll) != cartInfo.value.count ? {
|
||||||
q: common_assets._imports_1$1
|
q: common_assets._imports_1
|
||||||
} : {
|
} : {
|
||||||
r: common_assets._imports_0$1
|
r: common_assets._imports_0
|
||||||
}, {
|
}, {
|
||||||
s: common_vendor.unref(checkAll)
|
s: common_vendor.unref(checkAll)
|
||||||
}, common_vendor.unref(checkAll) ? {
|
}, common_vendor.unref(checkAll) ? {
|
||||||
|
|
|
@ -218,9 +218,9 @@ const _sfc_main = {
|
||||||
showAction: false,
|
showAction: false,
|
||||||
modelValue: keyword.value
|
modelValue: keyword.value
|
||||||
}),
|
}),
|
||||||
e: common_assets._imports_0,
|
e: common_assets._imports_0$1,
|
||||||
f: common_vendor.o(($event) => navTo("/pages/cart/cart")),
|
f: common_vendor.o(($event) => navTo("/pages/cart/cart")),
|
||||||
g: common_assets._imports_1,
|
g: common_assets._imports_1$1,
|
||||||
h: common_vendor.o(($event) => navTo("/pages/my/my")),
|
h: common_vendor.o(($event) => navTo("/pages/my/my")),
|
||||||
i: common_vendor.f(goodClassList.value, (item, index, i0) => {
|
i: common_vendor.f(goodClassList.value, (item, index, i0) => {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -26,19 +26,30 @@ if (!Math) {
|
||||||
const _sfc_main = {
|
const _sfc_main = {
|
||||||
__name: "login",
|
__name: "login",
|
||||||
setup(__props) {
|
setup(__props) {
|
||||||
store_user.useUserStore();
|
const userStore = store_user.useUserStore();
|
||||||
const showWeixin = common_vendor.ref(true);
|
const showWeixin = common_vendor.ref(true);
|
||||||
const isAgree = common_vendor.ref(false);
|
const isAgree = common_vendor.ref(false);
|
||||||
const weixinLogin = () => {
|
const weixinLogin = () => {
|
||||||
if (!isAgree.value)
|
if (!isAgree.value)
|
||||||
return common_vendor.index.$u.toast("请先阅读并同意协议");
|
return common_vendor.index.$u.toast("请先阅读并同意协议");
|
||||||
|
common_vendor.index.showLoading({
|
||||||
|
title: "登录中"
|
||||||
|
});
|
||||||
common_vendor.index.login({
|
common_vendor.index.login({
|
||||||
provider: "weixin",
|
provider: "weixin",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
api_user.userLoginWeixinApi({
|
api_user.userLoginWeixinApi({
|
||||||
code: res.code
|
code: res.code
|
||||||
}).then((res2) => {
|
}).then((res2) => {
|
||||||
console.log(res2);
|
userStore.setUserInfo(res2.data);
|
||||||
|
userStore.setToken(res2.data.token);
|
||||||
|
common_vendor.index.hideLoading();
|
||||||
|
if (!res2.data.supplier)
|
||||||
|
common_vendor.index.reLaunch({
|
||||||
|
url: "/pages/index/index"
|
||||||
|
});
|
||||||
|
else
|
||||||
|
common_vendor.index.$u.toast("功能开发中");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
@ -176,10 +187,10 @@ const _sfc_main = {
|
||||||
w: !isAgree.value
|
w: !isAgree.value
|
||||||
}, !isAgree.value ? {
|
}, !isAgree.value ? {
|
||||||
x: common_vendor.o(($event) => isAgree.value = true),
|
x: common_vendor.o(($event) => isAgree.value = true),
|
||||||
y: common_assets._imports_1$1
|
y: common_assets._imports_1
|
||||||
} : {
|
} : {
|
||||||
z: common_vendor.o(($event) => isAgree.value = false),
|
z: common_vendor.o(($event) => isAgree.value = false),
|
||||||
A: common_assets._imports_0$1
|
A: common_assets._imports_0
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
const common_vendor = require("../../common/vendor.js");
|
const common_vendor = require("../../common/vendor.js");
|
||||||
|
const store_user = require("../../store/user.js");
|
||||||
if (!Array) {
|
if (!Array) {
|
||||||
const _easycom_up_navbar2 = common_vendor.resolveComponent("up-navbar");
|
const _easycom_up_navbar2 = common_vendor.resolveComponent("up-navbar");
|
||||||
const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
|
const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
|
||||||
|
@ -17,6 +18,8 @@ if (!Math) {
|
||||||
const _sfc_main = {
|
const _sfc_main = {
|
||||||
__name: "my",
|
__name: "my",
|
||||||
setup(__props) {
|
setup(__props) {
|
||||||
|
const userStore = store_user.useUserStore();
|
||||||
|
const userInfo = userStore.userInfo;
|
||||||
const navTo = (type = 0) => {
|
const navTo = (type = 0) => {
|
||||||
common_vendor.index.navigateTo({
|
common_vendor.index.navigateTo({
|
||||||
url: `/pagesOrder/order/order?type=${type}`
|
url: `/pagesOrder/order/order?type=${type}`
|
||||||
|
@ -30,26 +33,28 @@ const _sfc_main = {
|
||||||
autoBack: true
|
autoBack: true
|
||||||
}),
|
}),
|
||||||
b: common_vendor.p({
|
b: common_vendor.p({
|
||||||
src: "",
|
src: common_vendor.unref(userInfo).avatar,
|
||||||
size: "80"
|
size: "80"
|
||||||
}),
|
}),
|
||||||
c: common_vendor.o(($event) => navTo(1)),
|
c: common_vendor.t(common_vendor.unref(userInfo).nickname),
|
||||||
d: common_vendor.o(($event) => navTo(2)),
|
d: common_vendor.t(common_vendor.unref(userInfo).id),
|
||||||
e: common_vendor.o(($event) => navTo()),
|
e: common_vendor.o(($event) => navTo(1)),
|
||||||
f: common_vendor.p({
|
f: common_vendor.o(($event) => navTo(2)),
|
||||||
|
g: common_vendor.o(($event) => navTo()),
|
||||||
|
h: common_vendor.p({
|
||||||
title: "我的地址",
|
title: "我的地址",
|
||||||
isLink: true,
|
isLink: true,
|
||||||
url: "/pagesOrder/addressList/addressList"
|
url: "/pagesOrder/addressList/addressList"
|
||||||
}),
|
}),
|
||||||
g: common_vendor.p({
|
i: common_vendor.p({
|
||||||
title: "意见反馈",
|
title: "意见反馈",
|
||||||
isLink: true
|
isLink: true
|
||||||
}),
|
}),
|
||||||
h: common_vendor.p({
|
j: common_vendor.p({
|
||||||
title: "关于我们",
|
title: "关于我们",
|
||||||
isLink: true
|
isLink: true
|
||||||
}),
|
}),
|
||||||
i: common_vendor.p({
|
k: common_vendor.p({
|
||||||
title: "退出登录",
|
title: "退出登录",
|
||||||
isLink: true,
|
isLink: true,
|
||||||
url: "/pages/login/login"
|
url: "/pages/login/login"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<view><up-navbar wx:if="{{a}}" u-i="39cfeb26-0" bind:__l="__l" u-p="{{a}}"></up-navbar><view class="user-info"><image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp" mode="widthFix"></image><view class="u-card"><up-avatar wx:if="{{b}}" u-i="39cfeb26-1" bind:__l="__l" u-p="{{b}}"></up-avatar><view class="content"><view class="u-phone">151****6699</view><view class="u-id">ID: 6655</view></view></view></view><view class="order-info-box"><view class="order-info"><view class="info-head">我的订单</view><view class="info-list"><view class="list-item" bindtap="{{c}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/f335a202404261401535608.png"></image><view class="">待付款</view></view><view class="list-item" bindtap="{{d}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/45241202404261403353935.png"></image><view class="">待收货</view></view><view class="list-item" bindtap="{{e}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/abdcd202404261406199643.png"></image><view class="">全部订单</view></view></view></view></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-2" bind:__l="__l"><up-cell wx:if="{{f}}" u-i="39cfeb26-3,39cfeb26-2" bind:__l="__l" u-p="{{f}}"></up-cell></up-cell-group></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-4" bind:__l="__l"><up-cell wx:if="{{g}}" u-i="39cfeb26-5,39cfeb26-4" bind:__l="__l" u-p="{{g}}"></up-cell><up-cell wx:if="{{h}}" u-i="39cfeb26-6,39cfeb26-4" bind:__l="__l" u-p="{{h}}"></up-cell><up-cell wx:if="{{i}}" u-i="39cfeb26-7,39cfeb26-4" bind:__l="__l" u-p="{{i}}"></up-cell></up-cell-group></view></view>
|
<view><up-navbar wx:if="{{a}}" u-i="39cfeb26-0" bind:__l="__l" u-p="{{a}}"></up-navbar><view class="user-info"><image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp" mode="widthFix"></image><view class="u-card"><up-avatar wx:if="{{b}}" u-i="39cfeb26-1" bind:__l="__l" u-p="{{b}}"></up-avatar><view class="content"><view class="u-phone">{{c}}</view><view class="u-id">ID: {{d}}</view></view></view></view><view class="order-info-box"><view class="order-info"><view class="info-head">我的订单</view><view class="info-list"><view class="list-item" bindtap="{{e}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/f335a202404261401535608.png"></image><view class="">待付款</view></view><view class="list-item" bindtap="{{f}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/45241202404261403353935.png"></image><view class="">待收货</view></view><view class="list-item" bindtap="{{g}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/abdcd202404261406199643.png"></image><view class="">全部订单</view></view></view></view></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-2" bind:__l="__l"><up-cell wx:if="{{h}}" u-i="39cfeb26-3,39cfeb26-2" bind:__l="__l" u-p="{{h}}"></up-cell></up-cell-group></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-4" bind:__l="__l"><up-cell wx:if="{{i}}" u-i="39cfeb26-5,39cfeb26-4" bind:__l="__l" u-p="{{i}}"></up-cell><up-cell wx:if="{{j}}" u-i="39cfeb26-6,39cfeb26-4" bind:__l="__l" u-p="{{j}}"></up-cell><up-cell wx:if="{{k}}" u-i="39cfeb26-7,39cfeb26-4" bind:__l="__l" u-p="{{k}}"></up-cell></up-cell-group></view></view>
|
|
@ -27,6 +27,8 @@ const _sfc_main = {
|
||||||
const show = common_vendor.ref(false);
|
const show = common_vendor.ref(false);
|
||||||
const deleteInfo = common_vendor.ref({});
|
const deleteInfo = common_vendor.ref({});
|
||||||
const showDelete = (item) => {
|
const showDelete = (item) => {
|
||||||
|
if (addressList.value.length <= 1)
|
||||||
|
return common_vendor.index.$u.toast("最后一个地址无法删除!");
|
||||||
deleteInfo.value = item;
|
deleteInfo.value = item;
|
||||||
show.value = true;
|
show.value = true;
|
||||||
};
|
};
|
||||||
|
@ -34,11 +36,15 @@ const _sfc_main = {
|
||||||
api_user.addressEditApi({
|
api_user.addressEditApi({
|
||||||
...item,
|
...item,
|
||||||
is_default: !item.is_default
|
is_default: !item.is_default
|
||||||
|
}).then((res) => {
|
||||||
|
getAddressLists();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const deleteAddress = () => {
|
const deleteAddress = () => {
|
||||||
api_user.addressDeleteApi({
|
api_user.addressDeleteApi({
|
||||||
address_id: deleteInfo.value.address_id
|
address_id: deleteInfo.value.address_id
|
||||||
|
}).then((res) => {
|
||||||
|
getAddressLists();
|
||||||
});
|
});
|
||||||
show.value = false;
|
show.value = false;
|
||||||
};
|
};
|
||||||
|
@ -60,9 +66,9 @@ const _sfc_main = {
|
||||||
c: common_vendor.t(item.detail),
|
c: common_vendor.t(item.detail),
|
||||||
d: item.is_default
|
d: item.is_default
|
||||||
}, item.is_default ? {
|
}, item.is_default ? {
|
||||||
e: common_assets._imports_0$1
|
e: common_assets._imports_0
|
||||||
} : {
|
} : {
|
||||||
f: common_assets._imports_1$1
|
f: common_assets._imports_1
|
||||||
}, {
|
}, {
|
||||||
g: common_vendor.o(($event) => updateDefault(item), index),
|
g: common_vendor.o(($event) => updateDefault(item), index),
|
||||||
h: "5e66515e-0-" + i0,
|
h: "5e66515e-0-" + i0,
|
||||||
|
|
|
@ -72,9 +72,9 @@ const _sfc_main = {
|
||||||
a: common_vendor.t(item.name),
|
a: common_vendor.t(item.name),
|
||||||
b: cancelType.value == item.value
|
b: cancelType.value == item.value
|
||||||
}, cancelType.value == item.value ? {
|
}, cancelType.value == item.value ? {
|
||||||
c: common_assets._imports_0$1
|
c: common_assets._imports_0
|
||||||
} : {
|
} : {
|
||||||
d: common_assets._imports_1$1
|
d: common_assets._imports_1
|
||||||
}, {
|
}, {
|
||||||
e: item.value,
|
e: item.value,
|
||||||
f: common_vendor.o(($event) => cancelType.value = item.value, item.value)
|
f: common_vendor.o(($event) => cancelType.value = item.value, item.value)
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
const common_vendor = require("../../../common/vendor.js");
|
const common_vendor = require("../../../common/vendor.js");
|
||||||
if (!Array) {
|
if (!Array) {
|
||||||
const _easycom_up_button2 = common_vendor.resolveComponent("up-button");
|
|
||||||
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
||||||
(_easycom_up_button2 + _easycom_up_icon2)();
|
const _easycom_up_button2 = common_vendor.resolveComponent("up-button");
|
||||||
|
(_easycom_up_icon2 + _easycom_up_button2)();
|
||||||
}
|
}
|
||||||
const _easycom_up_button = () => "../../../uni_modules/uview-plus/components/u-button/u-button.js";
|
|
||||||
const _easycom_up_icon = () => "../../../uni_modules/uview-plus/components/u-icon/u-icon.js";
|
const _easycom_up_icon = () => "../../../uni_modules/uview-plus/components/u-icon/u-icon.js";
|
||||||
|
const _easycom_up_button = () => "../../../uni_modules/uview-plus/components/u-button/u-button.js";
|
||||||
if (!Math) {
|
if (!Math) {
|
||||||
(_easycom_up_button + _easycom_up_icon)();
|
(_easycom_up_icon + _easycom_up_button)();
|
||||||
}
|
}
|
||||||
const _sfc_main = {
|
const _sfc_main = {
|
||||||
__name: "good",
|
__name: "good",
|
||||||
|
@ -27,63 +27,75 @@ const _sfc_main = {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
const navTo = () => {
|
const navTo = () => {
|
||||||
common_vendor.index.navigateTo({
|
common_vendor.index.navigateTo({
|
||||||
url: `/pagesOrder/detail/detail?type=0&id=${props.datas.id}`
|
url: `/pagesOrder/detail/detail?type=${props.datas.paid}&id=${props.datas.id}`
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return common_vendor.e({
|
return common_vendor.e({
|
||||||
a: common_vendor.t(__props.datas.number),
|
a: common_vendor.t(__props.datas.number),
|
||||||
b: common_vendor.o(navTo),
|
b: __props.datas.paid == 0
|
||||||
c: common_vendor.f(__props.datas.goods_list, (item, index, i0) => {
|
}, __props.datas.paid == 0 ? {} : common_vendor.e({
|
||||||
|
c: __props.datas.status == 0
|
||||||
|
}, __props.datas.status == 0 ? {} : {}, {
|
||||||
|
d: __props.datas.status == 1
|
||||||
|
}, __props.datas.status == 1 ? {} : {}, {
|
||||||
|
e: __props.datas.status == 2 || __props.datas.status == 3
|
||||||
|
}, __props.datas.status == 2 || __props.datas.status == 3 ? {} : {}), {
|
||||||
|
f: common_vendor.o(navTo),
|
||||||
|
g: common_vendor.f(__props.datas.goods_list, (item, index, i0) => {
|
||||||
return {
|
return {
|
||||||
a: item.imgs,
|
a: item.imgs,
|
||||||
b: index
|
b: index
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
d: common_vendor.t(__props.datas.total),
|
|
||||||
e: common_vendor.o(navTo),
|
|
||||||
f: __props.type == 1
|
|
||||||
}, __props.type == 1 ? {
|
|
||||||
g: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
plain: true,
|
|
||||||
color: "#989898",
|
|
||||||
shape: "circle"
|
|
||||||
}),
|
|
||||||
h: common_vendor.p({
|
h: common_vendor.p({
|
||||||
size: "small",
|
name: "arrow-right-double",
|
||||||
plain: true,
|
color: "#20B128"
|
||||||
color: "#20B128",
|
}),
|
||||||
shape: "circle"
|
i: common_vendor.t(__props.datas.goods_count),
|
||||||
})
|
j: common_vendor.t(__props.datas.total),
|
||||||
} : {}, {
|
k: common_vendor.o(navTo),
|
||||||
i: __props.type == 2 || __props.type == 0
|
l: __props.datas.paid = 0
|
||||||
}, __props.type == 2 || __props.type == 0 ? {
|
}, (__props.datas.paid = 0) ? {
|
||||||
j: common_vendor.p({
|
m: common_vendor.p({
|
||||||
size: "small",
|
size: "small",
|
||||||
plain: true,
|
plain: true,
|
||||||
color: "#989898",
|
color: "#989898",
|
||||||
shape: "circle"
|
shape: "circle"
|
||||||
}),
|
}),
|
||||||
k: common_vendor.p({
|
n: common_vendor.p({
|
||||||
size: "small",
|
size: "small",
|
||||||
plain: true,
|
plain: true,
|
||||||
color: "#20B128",
|
color: "#20B128",
|
||||||
shape: "circle"
|
shape: "circle"
|
||||||
}),
|
})
|
||||||
l: common_vendor.p({
|
} : common_vendor.e({
|
||||||
|
o: __props.datas.status == 1
|
||||||
|
}, __props.datas.status == 1 ? {
|
||||||
|
p: common_vendor.p({
|
||||||
size: "small",
|
size: "small",
|
||||||
plain: true,
|
plain: true,
|
||||||
color: "#20B128",
|
color: "#20B128",
|
||||||
shape: "circle"
|
shape: "circle"
|
||||||
})
|
})
|
||||||
} : {}, {
|
} : {}, {
|
||||||
m: __props.type == 3
|
q: __props.datas.status == 2 || __props.datas.status == 3
|
||||||
}, __props.type == 3 ? {
|
}, __props.datas.status == 2 || __props.datas.status == 3 ? {
|
||||||
n: common_vendor.p({
|
r: common_vendor.p({
|
||||||
name: "arrow-right"
|
size: "small",
|
||||||
|
plain: true,
|
||||||
|
color: "#20B128",
|
||||||
|
shape: "circle"
|
||||||
})
|
})
|
||||||
} : {});
|
} : {}, {
|
||||||
|
s: common_vendor.p({
|
||||||
|
size: "small",
|
||||||
|
plain: true,
|
||||||
|
color: "#20B128",
|
||||||
|
shape: "circle"
|
||||||
|
}),
|
||||||
|
t: common_vendor.o(navTo)
|
||||||
|
}));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"component": true,
|
"component": true,
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"up-button": "../../../uni_modules/uview-plus/components/u-button/u-button",
|
"up-icon": "../../../uni_modules/uview-plus/components/u-icon/u-icon",
|
||||||
"up-icon": "../../../uni_modules/uview-plus/components/u-icon/u-icon"
|
"up-button": "../../../uni_modules/uview-plus/components/u-button/u-button"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1 +1 @@
|
||||||
<view class="shop-item"><view class="item-title" bindtap="{{b}}"><view>{{a}}</view><view>待付款</view></view><view class="item-body" bindtap="{{e}}"><view class="body-content"><view wx:for="{{c}}" wx:for-item="item" wx:key="b"><image class="image" src="{{item.a}}"></image></view></view><view class="all">共5件商品, 总金额 <text>¥{{d}}</text></view></view><view wx:if="{{f}}" class="item-btn"><view style="width:80px"><up-button wx:if="{{g}}" u-s="{{['d']}}" u-i="e1c5d592-0" bind:__l="__l" u-p="{{g}}">取消订单</up-button></view><view style="width:80px"><up-button wx:if="{{h}}" u-s="{{['d']}}" u-i="e1c5d592-1" bind:__l="__l" u-p="{{h}}">立即支付</up-button></view></view><view wx:if="{{i}}" class="item-btn"><view style="width:80px"><up-button wx:if="{{j}}" u-s="{{['d']}}" u-i="e1c5d592-2" bind:__l="__l" u-p="{{j}}">申请售后</up-button></view><view style="width:80px"><up-button wx:if="{{k}}" u-s="{{['d']}}" u-i="e1c5d592-3" bind:__l="__l" u-p="{{k}}">确认收货</up-button></view><view style="width:80px"><up-button wx:if="{{l}}" u-s="{{['d']}}" u-i="e1c5d592-4" bind:__l="__l" u-p="{{l}}">再次购买</up-button></view></view><view wx:if="{{m}}" class="item-close"><view class="title"><view class="type">退款申请中</view><view>等待商家处理</view></view><up-icon wx:if="{{n}}" u-i="e1c5d592-5" bind:__l="__l" u-p="{{n}}"></up-icon></view></view>
|
<view class="shop-item"><view class="item-title" bindtap="{{f}}"><view>{{a}}</view><view wx:if="{{b}}"><text>待付款</text></view><view wx:else><text wx:if="{{c}}">待发货</text><text wx:if="{{d}}">待收货</text><text wx:if="{{e}}">已完成</text></view></view><view class="item-body" bindtap="{{k}}"><view class="body-content"><view style="display:flex;flex:1;flex-shrink:0"><view wx:for="{{g}}" wx:for-item="item" wx:key="b"><image class="image" src="{{item.a}}"></image></view></view><view style="display:flex;flex-direction:column;align-items:center;justify-content:center;width:100rpx"><up-icon wx:if="{{h}}" u-i="e1c5d592-0" bind:__l="__l" u-p="{{h}}"></up-icon></view></view><view class="all">共 {{i}} 件商品, 总金额 <text>¥{{j}}</text></view></view><view wx:if="{{l}}" class="item-btn"><view style="width:80px"><up-button wx:if="{{m}}" u-s="{{['d']}}" u-i="e1c5d592-1" bind:__l="__l" u-p="{{m}}">取消订单</up-button></view><view style="width:80px"><up-button wx:if="{{n}}" u-s="{{['d']}}" u-i="e1c5d592-2" bind:__l="__l" u-p="{{n}}">立即支付</up-button></view></view><view wx:else class="item-btn"><view wx:if="{{o}}" style="width:80px"><up-button wx:if="{{p}}" u-s="{{['d']}}" u-i="e1c5d592-3" bind:__l="__l" u-p="{{p}}">确认收货</up-button></view><view wx:if="{{q}}" style="width:80px"><up-button wx:if="{{r}}" u-s="{{['d']}}" u-i="e1c5d592-4" bind:__l="__l" u-p="{{r}}">再次购买</up-button></view><view bindtap="{{t}}" style="width:80px"><up-button wx:if="{{s}}" u-s="{{['d']}}" u-i="e1c5d592-5" bind:__l="__l" u-p="{{s}}">查看详情</up-button></view></view></view>
|
|
@ -40,12 +40,14 @@
|
||||||
}
|
}
|
||||||
.shop-item .item-body .body-content {
|
.shop-item .item-body .body-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
color: #989898;
|
color: #989898;
|
||||||
}
|
}
|
||||||
.shop-item .item-body .body-content .image {
|
.shop-item .item-body .body-content .image {
|
||||||
width: 120rpx;
|
width: 160rpx;
|
||||||
height: 120rpx;
|
height: 160rpx;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
}
|
}
|
||||||
.shop-item .item-body .body-content .title {
|
.shop-item .item-body .body-content .title {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -30,6 +30,7 @@ const _sfc_main = {
|
||||||
const tablist = common_vendor.ref([
|
const tablist = common_vendor.ref([
|
||||||
{ name: "全部" },
|
{ name: "全部" },
|
||||||
{ name: "待付款" },
|
{ name: "待付款" },
|
||||||
|
{ name: "待发货" },
|
||||||
{ name: "待收货" }
|
{ name: "待收货" }
|
||||||
// { name: '退款/售后' },
|
// { name: '退款/售后' },
|
||||||
]);
|
]);
|
||||||
|
@ -43,13 +44,16 @@ const _sfc_main = {
|
||||||
page_size: 25
|
page_size: 25
|
||||||
});
|
});
|
||||||
const orderList = common_vendor.ref([
|
const orderList = common_vendor.ref([
|
||||||
|
[],
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
[]
|
[]
|
||||||
]);
|
]);
|
||||||
const getOrderList = (type = 0) => {
|
const getOrderList = (type = 0, status = "", paid = 1) => {
|
||||||
api_order.orderListApi({
|
api_order.orderListApi({
|
||||||
...where.value
|
...where.value,
|
||||||
|
status,
|
||||||
|
paid
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
orderList.value[type] = res.data.lists;
|
orderList.value[type] = res.data.lists;
|
||||||
});
|
});
|
||||||
|
@ -59,7 +63,10 @@ const _sfc_main = {
|
||||||
tabsActive.value = +options.type;
|
tabsActive.value = +options.type;
|
||||||
swiperCurrent.value = +options.type;
|
swiperCurrent.value = +options.type;
|
||||||
}
|
}
|
||||||
getOrderList();
|
getOrderList(0);
|
||||||
|
getOrderList(1, "", 0);
|
||||||
|
getOrderList(2, 0);
|
||||||
|
getOrderList(3, 1);
|
||||||
});
|
});
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "3.4.2",
|
"libVersion": "3.4.2",
|
||||||
"appid": "wxce2948c50d808b66",
|
"appid": "wxdee751952c8c2027",
|
||||||
"projectname": "purchase-let",
|
"projectname": "purchase-let",
|
||||||
"condition": {
|
"condition": {
|
||||||
"search": {
|
"search": {
|
||||||
|
|
|
@ -2,10 +2,15 @@
|
||||||
const common_vendor = require("../common/vendor.js");
|
const common_vendor = require("../common/vendor.js");
|
||||||
const useUserStore = common_vendor.defineStore("user", () => {
|
const useUserStore = common_vendor.defineStore("user", () => {
|
||||||
const userInfo = common_vendor.ref(common_vendor.index.getStorageSync("userInfo") || {});
|
const userInfo = common_vendor.ref(common_vendor.index.getStorageSync("userInfo") || {});
|
||||||
|
const setUserInfo = (data) => {
|
||||||
|
userInfo.value = data;
|
||||||
|
common_vendor.index.setStorageSync("userInfo", data);
|
||||||
|
};
|
||||||
userInfo.value = {
|
userInfo.value = {
|
||||||
"nickname": "哈哈",
|
"nickname": "哈哈",
|
||||||
|
"id": 1,
|
||||||
"mobile": "17685151643",
|
"mobile": "17685151643",
|
||||||
"avatar": "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/avatar.png",
|
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/tFJnfhVKlAlIecticsOhjAu8CHa6ibZacWrcHHkiahu7f0dQlWYgwu1b0TPLSLlO1xCTa6KN1krqg3XSIo3vq6uCQ/132",
|
||||||
"token": "a8670fe7f1014c0f5125f6ca0c3b9cb3"
|
"token": "a8670fe7f1014c0f5125f6ca0c3b9cb3"
|
||||||
};
|
};
|
||||||
const token = common_vendor.ref(common_vendor.index.getStorageSync("token") || "");
|
const token = common_vendor.ref(common_vendor.index.getStorageSync("token") || "");
|
||||||
|
@ -14,6 +19,6 @@ const useUserStore = common_vendor.defineStore("user", () => {
|
||||||
common_vendor.index.setStorageSync("token", data);
|
common_vendor.index.setStorageSync("token", data);
|
||||||
};
|
};
|
||||||
token.value = "a8670fe7f1014c0f5125f6ca0c3b9cb3";
|
token.value = "a8670fe7f1014c0f5125f6ca0c3b9cb3";
|
||||||
return { userInfo, setToken, token, setToken };
|
return { userInfo, setUserInfo, token, setToken };
|
||||||
});
|
});
|
||||||
exports.useUserStore = useUserStore;
|
exports.useUserStore = useUserStore;
|
||||||
|
|
|
@ -42,7 +42,7 @@ function baseRequest(url, method, data, {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if (res.data.code == 0) {
|
} else if (res.data.code == 0) {
|
||||||
reslove(res.data);
|
reject(res.data);
|
||||||
} else if (res.data.code == 1) {
|
} else if (res.data.code == 1) {
|
||||||
reslove(res.data);
|
reslove(res.data);
|
||||||
} else if (res.data.code == 200) {
|
} else if (res.data.code == 200) {
|
||||||
|
|
Loading…
Reference in New Issue