Compare commits

...

6 Commits

@ -89,4 +89,46 @@ page {
word-break: break-all; word-break: break-all;
overflow: hidden; overflow: hidden;
} }
@keyframes warn {
0% {
transform: scale(.5);
opacity: 1
}
30% {
opacity: .7
}
to {
transform: scale(2.5);
opacity: 0
}
}
.warn-state {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
vertical-align: middle
}
.warn-status-processing {
position: relative
}
.warn-status-processing:after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
background: inherit;
content: "";
animation: warn 1.2s ease-in-out infinite
}
</style> </style>

@ -8,6 +8,7 @@ export default {
url: "/shop/shopGoods/goodsList", url: "/shop/shopGoods/goodsList",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -16,6 +17,16 @@ export default {
url: "/shop/shopGoods/goodsEditAttribute", url: "/shop/shopGoods/goodsEditAttribute",
method: "POST", method: "POST",
data, data,
type: "mall",
});
},
goodsDel(data) {
return request({
url: "/shop/shopGoods/goodsDel",
method: "POST",
data,
type: "mall",
}); });
}, },
@ -25,6 +36,15 @@ export default {
url: "/shop/shopClassify/list", url: "/shop/shopClassify/list",
method: "POST", method: "POST",
data, data,
type: "mall",
});
},
Slist(data) {
return request({
url: "/admin/classify/list",
method: "POST",
data,
type: "mall",
}); });
}, },
@ -33,6 +53,7 @@ export default {
url: "/shop/shopClassify/createItem", url: "/shop/shopClassify/createItem",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -43,6 +64,7 @@ export default {
url: "/shop/freightRules/list", url: "/shop/freightRules/list",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -51,6 +73,7 @@ export default {
url: "/shop/shopGoods/goodsItem", url: "/shop/shopGoods/goodsItem",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -59,6 +82,7 @@ export default {
url: "/shop/shopGoods/goodsEdit", url: "/shop/shopGoods/goodsEdit",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },

@ -9,6 +9,7 @@ export default {
url: "/shop/dataCount/oneLine", url: "/shop/dataCount/oneLine",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
orderProfit(data) { orderProfit(data) {
@ -16,6 +17,7 @@ export default {
url: "/shop/dataCount/orderProfit", url: "/shop/dataCount/orderProfit",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
orderGood(data) { orderGood(data) {
@ -23,24 +25,27 @@ export default {
url: "/shop/dataCount/orderGood", url: "/shop/dataCount/orderGood",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
}, },
getStoreSetting(data) { getShopSetting(data) {
return request({ return request({
url: "/shop/store/getStoreSetting", url: "/shop/shop/item",
method: "POST", method: "POST",
data, data,
type: "mall",
}) })
}, },
setStoreSetting(data) { setStoreSetting(data) {
return request({ return request({
url: "/shop/store/setStoreSetting", url: "/shop/shop/edit",
method: "POST", method: "POST",
data, data,
type: "mall",
}) })
} }

@ -8,6 +8,7 @@ export default {
url: "/shop/order/orderList", url: "/shop/order/orderList",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -16,6 +17,7 @@ export default {
url: "/shop/order/orderSend", url: "/shop/order/orderSend",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -24,6 +26,7 @@ export default {
url: "/admin/order/GetExpressList", url: "/admin/order/GetExpressList",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -32,6 +35,7 @@ export default {
url: "/shop/order/printOrder", url: "/shop/order/printOrder",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -40,6 +44,7 @@ export default {
url: "/shop/order/updateNotes", url: "/shop/order/updateNotes",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -49,6 +54,7 @@ export default {
url: "/shop/shop/checkLog", url: "/shop/shop/checkLog",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -57,6 +63,7 @@ export default {
url: "/shop/order/confirmCancel", url: "/shop/order/confirmCancel",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -66,6 +73,7 @@ export default {
url: "/shop/after_sale/index", url: "/shop/after_sale/index",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -75,6 +83,7 @@ export default {
url: "/shop/after_sale/update", url: "/shop/after_sale/update",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -83,6 +92,7 @@ export default {
url: "/shop/after_sale/show", url: "/shop/after_sale/show",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -91,6 +101,7 @@ export default {
url: "/client/common/express", url: "/client/common/express",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
enums(data) { enums(data) {
@ -98,9 +109,30 @@ export default {
url: "/client/after_sale/enums", url: "/client/after_sale/enums",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
}, },
OrderInpersonPayment: {
orderList(data) {
return request({
url: "/shop/OrderInpersonPayment/orderList",
method: "POST",
data,
type: "mall",
});
},
GetQrItem(data) {
return request({
url: "/shop/OrderInpersonPayment/GetQrItem",
method: "POST",
data,
type: "mall",
});
},
}
}; };

@ -0,0 +1,70 @@
import {
request
} from "@/utils/request";
export default {
orderList(data) {
return request({
url: "/shop/orderPickUp/orderList",
method: "POST",
data,
type: "mall",
});
},
orderSend(data) {
return request({
url: "/shop/orderPickUp/orderSend",
method: "POST",
data,
type: "mall",
});
},
GetExpressList(data) {
return request({
url: "/admin/orderPickUp/GetExpressList",
method: "POST",
data,
type: "mall",
});
},
printOrder(data) {
return request({
url: "/shop/orderPickUp/printOrder",
method: "POST",
data,
type: "mall",
});
},
updateNotes(data) {
return request({
url: "/shop/orderPickUp/updateNotes",
method: "POST",
data,
type: "mall",
});
},
// 核销记录
checkLog(data) {
return request({
url: "/shop/shop/checkLog",
method: "POST",
data,
type: "mall",
});
},
confirmCancel(data) {
return request({
url: "/shop/orderPickUp/confirmCancel",
method: "POST",
data,
type: "mall",
});
},
};

@ -9,6 +9,7 @@ export default {
url: "/shop/shop/List", url: "/shop/shop/List",
method: "POST", method: "POST",
data, data,
type: "mall",
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/shop/shop/edit", url: "/shop/shop/edit",
method: "POST", method: "POST",
data, data,
type: "mall",
}) })
}, },
@ -25,6 +27,7 @@ export default {
url: "/shop/shop/editStatus", url: "/shop/shop/editStatus",
method: "POST", method: "POST",
data, data,
type: "mall",
}) })
}, },
@ -33,6 +36,7 @@ export default {
url: "/shop/shop/synchronousGoods", url: "/shop/shop/synchronousGoods",
method: "POST", method: "POST",
data, data,
type: "mall",
}) })
}, },

@ -1,51 +0,0 @@
import {
request
} from "@/utils/request";
export default {
userList(data) {
return request({
url: "/shop/user/userList",
method: "GET",
data,
})
},
userItem(data) {
return request({
url: "/shop/user/userItem",
method: "GET",
data,
})
},
getLog(data) {
return request({
url: "/shop/user/getLog",
method: "GET",
data,
})
},
changeInformation(data) {
return request({
url: "/shop/user/changeInformation",
method: "GET",
data,
})
},
UpdateLevel(data) {
return request({
url: "/shop/user/UpdateLevel",
method: "GET",
data,
})
},
};

@ -9,6 +9,7 @@ export default {
url: "/shop/UserMembers/LevelShow", url: "/shop/UserMembers/LevelShow",
method: "GET", method: "GET",
data, data,
type: "mall",
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/shop/UserMembers/LevelSave", url: "/shop/UserMembers/LevelSave",
method: "GET", method: "GET",
data, data,
type: "mall",
}) })
}, },
@ -25,6 +27,7 @@ export default {
url: "/shop/UserMembers/SetList", url: "/shop/UserMembers/SetList",
method: "GET", method: "GET",
data, data,
type: "mall",
}) })
}, },
@ -33,6 +36,7 @@ export default {
url: "/shop/UserMembers/SetSave", url: "/shop/UserMembers/SetSave",
method: "GET", method: "GET",
data, data,
type: "mall",
}) })
}, },
@ -41,6 +45,7 @@ export default {
url: "/shop/UserMembers/DiscountList", url: "/shop/UserMembers/DiscountList",
method: "GET", method: "GET",
data, data,
type: "mall",
}) })
}, },
@ -49,6 +54,7 @@ export default {
url: "/shop/UserMembers/CreateDiscount", url: "/shop/UserMembers/CreateDiscount",
method: "POST", method: "POST",
data, data,
type: "mall",
}) })
}, },

@ -28,5 +28,13 @@ export default {
}, },
loginShop(data) {
return request({
url: "/admin/system/loginShop",
method: "GET",
data,
})
},
}; };

@ -0,0 +1,41 @@
import {
request
} from "@/utils/request";
export default {
List(data) {
return request({
url: "/admin/Coupon/List",
method: "GET",
data,
type: 'store'
});
},
GetItem(data) {
return request({
url: "/admin/Coupon/GetItem",
method: "GET",
data,
type: 'store'
});
},
Create(data) {
return request({
url: "/admin/Coupon/Create",
method: "POST",
data,
type: 'store'
});
},
UserGetList(data) {
return request({
url: "/admin/Coupon/UserGetList",
method: "POST",
data,
type: 'store'
});
},
};

@ -0,0 +1,91 @@
import {
request
} from "@/utils/request";
export default {
SalesDiscounts: {
List(data) {
return request({
url: "/admin/SalesDiscounts/List",
method: "GET",
data,
type: 'store'
});
},
GetItem(data) {
return request({
url: "/admin/SalesDiscounts/GetItem",
method: "GET",
data,
type: 'store'
});
},
Create(data) {
return request({
url: "/admin/SalesDiscounts/Create",
method: "POST",
data,
type: 'store'
});
},
},
SalesFullDiscounts: {
List(data) {
return request({
url: "/admin/SalesFullDiscounts/List",
method: "GET",
data,
type: 'store'
});
},
GetItem(data) {
return request({
url: "/admin/SalesFullDiscounts/GetItem",
method: "GET",
data,
type: 'store'
});
},
Create(data) {
return request({
url: "/admin/SalesFullDiscounts/Create",
method: "POST",
data,
type: 'store'
});
},
},
SalesFullSetRedution: {
List(data) {
return request({
url: "/admin/SalesFullSetRedution/List",
method: "GET",
data,
type: 'store'
});
},
GetItem(data) {
return request({
url: "/admin/SalesFullSetRedution/GetItem",
method: "GET",
data,
type: 'store'
});
},
Create(data) {
return request({
url: "/admin/SalesFullSetRedution/Create",
method: "POST",
data,
type: 'store'
});
},
}
};

@ -8,6 +8,7 @@ export default {
url: "/admin/goods/goodsList", url: "/admin/goods/goodsList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -16,6 +17,16 @@ export default {
url: "/admin/goods/goodsEditAttribute", url: "/admin/goods/goodsEditAttribute",
method: "POST", method: "POST",
data, data,
type: 'store'
});
},
goodsDel(data) {
return request({
url: "/admin/goods/goodsDel",
method: "POST",
data,
type: 'store'
}); });
}, },
@ -25,6 +36,7 @@ export default {
url: "/admin/classify/list", url: "/admin/classify/list",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -33,6 +45,7 @@ export default {
url: "/admin/classify/createItem", url: "/admin/classify/createItem",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -43,6 +56,7 @@ export default {
url: "/admin/freightRules/list", url: "/admin/freightRules/list",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -51,6 +65,7 @@ export default {
url: "/admin/goods/goodsItem", url: "/admin/goods/goodsItem",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -59,6 +74,7 @@ export default {
url: "/admin/goods/goodsEdit", url: "/admin/goods/goodsEdit",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },

@ -9,6 +9,7 @@ export default {
url: "/admin/dataCount/oneLine", url: "/admin/dataCount/oneLine",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
orderProfit(data) { orderProfit(data) {
@ -16,6 +17,7 @@ export default {
url: "/admin/dataCount/orderProfit", url: "/admin/dataCount/orderProfit",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
orderGood(data) { orderGood(data) {
@ -23,6 +25,7 @@ export default {
url: "/admin/dataCount/orderGood", url: "/admin/dataCount/orderGood",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -33,6 +36,7 @@ export default {
url: "/admin/store/getStoreSetting", url: "/admin/store/getStoreSetting",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -41,6 +45,7 @@ export default {
url: "/admin/store/setStoreSetting", url: "/admin/store/setStoreSetting",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
} }

@ -8,6 +8,7 @@ export default {
url: "/admin/order/orderList", url: "/admin/order/orderList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -16,6 +17,7 @@ export default {
url: "/admin/order/orderSend", url: "/admin/order/orderSend",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -24,6 +26,7 @@ export default {
url: "/admin/order/GetExpressList", url: "/admin/order/GetExpressList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -32,6 +35,7 @@ export default {
url: "/admin/order/printOrder", url: "/admin/order/printOrder",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -40,6 +44,7 @@ export default {
url: "/admin/order/updateNotes", url: "/admin/order/updateNotes",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -49,6 +54,7 @@ export default {
url: "/admin/shop/checkLog", url: "/admin/shop/checkLog",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -57,6 +63,7 @@ export default {
url: "/admin/order/confirmCancel", url: "/admin/order/confirmCancel",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -66,6 +73,7 @@ export default {
url: "/admin/after_sale/index", url: "/admin/after_sale/index",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -75,6 +83,7 @@ export default {
url: "/admin/after_sale/update", url: "/admin/after_sale/update",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -83,6 +92,7 @@ export default {
url: "/admin/after_sale/show", url: "/admin/after_sale/show",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -91,6 +101,7 @@ export default {
url: "/client/common/express", url: "/client/common/express",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
enums(data) { enums(data) {
@ -98,6 +109,7 @@ export default {
url: "/client/after_sale/enums", url: "/client/after_sale/enums",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -110,6 +122,7 @@ export default {
url: "/admin/OrderInpersonPayment/orderList", url: "/admin/OrderInpersonPayment/orderList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -118,6 +131,7 @@ export default {
url: "/admin/OrderInpersonPayment/GetQrItem", url: "/admin/OrderInpersonPayment/GetQrItem",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
} }

@ -0,0 +1,52 @@
import {
request
} from "@/utils/request";
export default {
List(data) {
return request({
url: "/admin/recharge/List",
method: "GET",
data,
type: 'store'
});
},
save(data) {
return request({
url: "/admin/recharge/save",
method: "GET",
data,
type: 'store'
});
},
recharge_list(data) {
return request({
url: "/admin/recharge/recharge_list",
method: "GET",
data,
type: 'store'
});
},
rechargeSet: {
list(data) {
return request({
url: "/admin/rechargeSet/list",
method: "GET",
data,
type: 'store'
});
},
save(data) {
return request({
url: "/admin/rechargeSet/save",
method: "GET",
data,
type: 'store'
});
},
}
};

@ -9,6 +9,7 @@ export default {
url: "/admin/shop/List", url: "/admin/shop/List",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/admin/shop/edit", url: "/admin/shop/edit",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -25,6 +27,7 @@ export default {
url: "/admin/shop/editStatus", url: "/admin/shop/editStatus",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -33,6 +36,7 @@ export default {
url: "/admin/shop/synchronousGoods", url: "/admin/shop/synchronousGoods",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },

@ -9,6 +9,7 @@ export default {
url: "/admin/user/userList", url: "/admin/user/userList",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/admin/user/userItem", url: "/admin/user/userItem",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -26,6 +28,7 @@ export default {
url: "/admin/user/getLog", url: "/admin/user/getLog",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -34,6 +37,7 @@ export default {
url: "/admin/user/changeInformation", url: "/admin/user/changeInformation",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -42,6 +46,7 @@ export default {
url: "/admin/user/UpdateLevel", url: "/admin/user/UpdateLevel",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },

@ -9,6 +9,7 @@ export default {
url: "/admin/UserMembers/LevelShow", url: "/admin/UserMembers/LevelShow",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/admin/UserMembers/LevelSave", url: "/admin/UserMembers/LevelSave",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -25,6 +27,7 @@ export default {
url: "/admin/UserMembers/SetList", url: "/admin/UserMembers/SetList",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -33,6 +36,7 @@ export default {
url: "/admin/UserMembers/SetSave", url: "/admin/UserMembers/SetSave",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -41,6 +45,7 @@ export default {
url: "/admin/UserMembers/DiscountList", url: "/admin/UserMembers/DiscountList",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -49,6 +54,7 @@ export default {
url: "/admin/UserMembers/CreateDiscount", url: "/admin/UserMembers/CreateDiscount",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },

@ -110,6 +110,9 @@ const open = (O) => {
} }
if (props.modelValue) { if (props.modelValue) {
console.clear(props.modelValue);
console.log(props.modelValue);
if (Array.isArray(props.modelValue)) { if (Array.isArray(props.modelValue)) {
LArr.value = JSON.parse(JSON.stringify(props.modelValue)) LArr.value = JSON.parse(JSON.stringify(props.modelValue))
} else { } else {

@ -5,7 +5,7 @@
<scroll-view scroll-y="true" class="scroll-Y" :style="{ height: props.height }" @scrolltolower="lower"> <scroll-view scroll-y="true" class="scroll-Y" :style="{ height: props.height }" @scrolltolower="lower">
<slot :list="list"></slot> <slot :list="list"></slot>
<view v-show="firstLoading" v-if="list.length == 0"> <view v-show="firstLoading" v-if="list && list.length == 0">
<wd-status-tip image="search" tip="暂无数据 ~" /> <wd-status-tip image="search" tip="暂无数据 ~" />
</view> </view>
</scroll-view> </scroll-view>
@ -56,6 +56,10 @@ const props = defineProps({
height: { height: {
type: String, type: String,
default: "100vh" default: "100vh"
},
noPageSize: {
type: Boolean,
default: false
} }
}); });
@ -86,14 +90,23 @@ const getData = async () => {
...props.params ...props.params
}); });
if (res.data.rows.length) { if (props.noPageSize) {
query.value.pageSize = res.data.pageSize; if (res.data?.length) {
total.value = res.data.total; list.value = res.data
list.value = [...list.value, ...res.data.rows]; } else {
toast.success('全部加载完了');
}
} else { } else {
toast.success('全部加载完了'); if (res.data.rows.length) {
query.value.pageSize = res.data.pageSize;
total.value = res.data.total;
list.value = [...list.value, ...res.data.rows];
} else {
toast.success('全部加载完了');
}
} }
loading.value = false; loading.value = false;
firstLoading.value = true; firstLoading.value = true;
}; };
@ -111,15 +124,29 @@ const upData = async (upParams = {}) => {
query.value.page = 1; query.value.page = 1;
query.value.pageSize = 20; query.value.pageSize = 20;
list.value = []
const res = await props.apiObj({ const res = await props.apiObj({
...query.value, ...query.value,
...props.params, ...props.params,
...upParams ...upParams
}); });
query.value.pageSize = res.data.pageSize; if (props.noPageSize) {
total.value = res.data.total; if (res.data?.length) {
list.value = res.data.rows; list.value = res.data
} else {
toast.success('全部加载完了');
}
} else {
if (res.data.rows.length) {
query.value.pageSize = res.data.pageSize;
total.value = res.data.total;
list.value = res.data.rows;
} else {
toast.success('全部加载完了');
}
}
loading.value = false; loading.value = false;
}; };

@ -1,10 +1,12 @@
<template> <template>
<view class="myTabbar"> <view class="myTabbar">
<wd-tabbar custom-class="mb-3" fixed safeAreaInsetBottom placeholder v-model="tab" shape="round"> <wd-tabbar custom-class="mb-3" fixed safeAreaInsetBottom placeholder v-model="tab" shape="round">
<wd-tabbar-item @click="utils.toUrl('/store/index/index')" name="home" title="首页" icon="home"></wd-tabbar-item> <wd-tabbar-item @click="utils.toUrl('/mall/index/index')" name="home" title="首页" icon="home"></wd-tabbar-item>
<wd-tabbar-item v-if="is_store" @click="utils.toUrl('/store/index/index')" name="商城" title="返回商城"
icon="rollback"></wd-tabbar-item>
<!-- <wd-tabbar-item name="cart" title="分类" icon="cart"></wd-tabbar-item> --> <!-- <wd-tabbar-item name="cart" title="分类" icon="cart"></wd-tabbar-item> -->
<wd-tabbar-item name="user" @click="utils.toUrl('/store/user/list')" title="用户管理" icon="user"></wd-tabbar-item> <!-- <wd-tabbar-item name="user" @click="utils.toUrl('/store/user/list')" title="用户管理" icon="user"></wd-tabbar-item> -->
<wd-tabbar-item @click="utils.toUrl('/store/shop/list')" name="shop" title="门店管理" icon="detection"></wd-tabbar-item> <!-- <wd-tabbar-item @click="utils.toUrl('/store/shop/list')" name="shop" title="门店管理" icon="detection"></wd-tabbar-item> -->
<!-- <wd-tabbar-item name="user" title="我的" icon="user"></wd-tabbar-item> --> <!-- <wd-tabbar-item name="user" title="我的" icon="user"></wd-tabbar-item> -->
</wd-tabbar> </wd-tabbar>
</view> </view>
@ -20,6 +22,8 @@ const props = defineProps({
} }
}) })
const is_store = uni.getStorageSync("store_info");
const tab = props.tab const tab = props.tab
</script> </script>

@ -36,6 +36,26 @@
<view class="h-2 bg-gray-100"></view> <view class="h-2 bg-gray-100"></view>
<view class="p-3 rounded mb-2">
<div class="name mb-2 text-xs">商城分类</div>
<view class="bg-white px-3 py-1 rounded">
<wd-checkbox-group v-model="model.classify_list">
<view class="flex overflow-auto flex-wrap">
<div class="grid grid-cols-3">
<wd-checkbox style="width: 100%;" shape="button" v-for="cat of classifySList"
:modelValue="JSON.stringify(cat.parentIds)">
{{ cat.name }}
</wd-checkbox>
</div>
</view>
</wd-checkbox-group>
</view>
</view>
<view class="h-2 bg-gray-100"></view>
<view class=" p-3 rounded mb-2"> <view class=" p-3 rounded mb-2">
<div class="name mb-2 text-xs">商品分类</div> <div class="name mb-2 text-xs">商品分类</div>
<view class="bg-white px-3 py-1 rounded"> <view class="bg-white px-3 py-1 rounded">
@ -200,6 +220,7 @@ const beforeRemove = ({ file, resolve, index }) => {
/** @type {Ref<Model>} */ /** @type {Ref<Model>} */
const model = ref({ const model = ref({
classify_list: [], //
shop_classify_list: [], // shop_classify_list: [], //
name: "", // name: "", //
keywords: "", // keywords: "", //
@ -276,6 +297,9 @@ onLoad(async (e) => {
model.value.freight_id = 99999999; model.value.freight_id = 99999999;
} }
model.value.shop_classify_list = model.value.shop_classify_list?.map(item => JSON.stringify(item)); model.value.shop_classify_list = model.value.shop_classify_list?.map(item => JSON.stringify(item));
model.value.classify_list = model.value.classify_list?.map(item => JSON.stringify(item));
model.value.classify_list = model.value.classify_list || []
if (res.data.use_sku == 0) { if (res.data.use_sku == 0) {
skuDefault.value = res.data.goods_sku; skuDefault.value = res.data.goods_sku;
@ -371,8 +395,9 @@ const saveGoods = async () => {
})); }));
const shop_classify_list = model.value.shop_classify_list.map(item => JSON.parse(item)); const shop_classify_list = model.value.shop_classify_list.map(item => JSON.parse(item));
const classify_list = model.value.classify_list.map(item => JSON.parse(item));
const res = await goods.goodsEdit({ ...model.value, pic_list, freight_id, shop_classify_list }); const res = await goods.goodsEdit({ ...model.value, pic_list, freight_id, shop_classify_list, classify_list });
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
@ -424,6 +449,46 @@ const getClassify = () => {
getClassify(); getClassify();
/** @type {Ref<Array<Object>>} */
const classifySList = ref([]);
/**
* 获取商品分类
* @returns {void}
*/
const getSClassify = () => {
/**
* 递归展平商品分类
* @param {Array<GoodsItem>} categories - 商品分类数组
* @param {Array<number>} [parentIds=[]] - 父级分类ID数组
* @returns {Array<Object>} - 展平后的商品分类数组
*/
function flattenCategories(categories, parentIds = []) {
let flatCategories = [];
for (const category of categories) {
const categoryWithParents = {
...category,
parentIds: [...parentIds, category.id],
};
flatCategories.push(categoryWithParents);
if (category.children && category.children.length > 0) {
flatCategories = flatCategories.concat(flattenCategories(category.children, [...parentIds, category.id]));
}
}
return flatCategories;
}
goods.classify.Slist().then(res => {
classifySList.value = flattenCategories(res.data);
});
};
getSClassify();
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>

@ -48,7 +48,9 @@
style="margin-right: 8px;">下架</wd-button> style="margin-right: 8px;">下架</wd-button>
<wd-button @click="changeS(item)" v-if="item.status !== 1" size="small" <wd-button @click="changeS(item)" v-if="item.status !== 1" size="small"
style="margin-right: 8px;">上架</wd-button> style="margin-right: 8px;">上架</wd-button>
<wd-button @click="utils.toUrl('/mall/goods/edit?id=' + item.id)" size="small">编辑</wd-button> <wd-button style="margin-right: 8px;" @click="utils.toUrl('/mall/goods/edit?id=' + item.id)"
size="small">编辑</wd-button>
<wd-button type="error" @click="delGoods(item)" size="small">删除</wd-button>
</view> </view>
</template> </template>
</wd-card> </wd-card>
@ -65,6 +67,7 @@
</div> </div>
<wd-toast /> <wd-toast />
<wd-message-box></wd-message-box>
</view> </view>
</template> </template>
@ -74,6 +77,8 @@ import { useToast } from '@/uni_modules/wot-design-uni'
import yList from "/components/yList/index.vue" import yList from "/components/yList/index.vue"
import goods from '@/api/mall/goods.js' import goods from '@/api/mall/goods.js'
import utils from '@/utils/utils.js' import utils from '@/utils/utils.js'
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useApi } from "@/hooks/useApi.js"
import { import {
onLoad, onLoad,
@ -81,6 +86,7 @@ import {
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
const toast = useToast() const toast = useToast()
const message = useMessage();
const classify_id = ref(0) const classify_id = ref(0)
@ -149,6 +155,31 @@ const changeS = (row) => {
}) })
} }
const delGoods = (row) => {
message
.confirm({
title: '删除商品',
})
.then(async (resp) => {
const { fetchData } = await useApi(goods.goodsDel)
fetchData({
id: row.id,
}).then(res => {
if (res.code == 0) {
toast.success('操作成功')
search({ value: params.value.keywords })
} else {
toast.error('出错了')
}
})
})
.catch((error) => {
console.log(error);
});
}
const classifyList = ref([]) const classifyList = ref([])
const getClassify = () => { const getClassify = () => {
goods.classify.list().then(res => { goods.classify.list().then(res => {

@ -3,7 +3,7 @@
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="w-full"> <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="user_info?.info?.name || '商城首页'"> <wd-navbar fixed safeAreaInsetTop :leftText="mall_info?.info?.name + ' [ 门店 ]' || '门店首页'">
<template #right> <template #right>
<wd-icon @click="utils.toUrl('/mall/setup/index')" name="setting" size="22px"></wd-icon> <wd-icon @click="utils.toUrl('/mall/setup/index')" name="setting" size="22px"></wd-icon>
</template> </template>
@ -49,6 +49,31 @@
</view> </view>
</view> </view>
<view @click="utils.toUrl('/mall/pickUp/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">自提订单</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="gift opacity-80" class="opacity-80" size="42px"></wd-icon>
</div>
</view>
</view>
<view @click="utils.toUrl('/mall/inpersonPay/index')"
class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">当面付订单</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="gift opacity-80" class="opacity-80" size="42px"></wd-icon>
</div>
</view>
</view>
<!-- <view @click="utils.toUrl('/mall/check/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <!-- <view @click="utils.toUrl('/mall/check/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">核销记录</view> <view class="font-bold">核销记录</view>
@ -61,9 +86,6 @@
</view> </view>
</view> --> </view> -->
<!-- <view @click="utils.toUrl('/mall/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <!-- <view @click="utils.toUrl('/mall/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">订单管理</view> <view class="font-bold">订单管理</view>
@ -76,14 +98,11 @@
</view> </view>
</view> --> </view> -->
</view> </view>
<view style="transition: 1s;" class="w-full h-full bg-white pt-4 rounded-tr-3xl rounded-tl-3xl shadow-lg oh"> <view style="transition: 1s;" class="w-full h-full bg-white pt-4 rounded-tr-3xl rounded-tl-3xl shadow-lg oh">
<view class="order mb-2"> <view class="order mb-2">
<wd-grid v-show="oneLine.ok"> <wd-grid v-show="oneLine.ok">
<wd-grid-item @click="utils.toUrl('/mall/user/list')" icon="round" :text="`用户 (${oneLine.user_count})`" />
<wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round" :text="`商品 (${oneLine.goods_count})`" /> <wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round" :text="`商品 (${oneLine.goods_count})`" />
<wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round" <wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round"
:text="`售罄 (${oneLine.empty_stock_count})`" /> :text="`售罄 (${oneLine.empty_stock_count})`" />
@ -112,14 +131,6 @@
<text>{{ orderProfit.series[0].data[index] }}</text> <text>{{ orderProfit.series[0].data[index] }}</text>
</div> </div>
<div @click="utils.toUrl('/mall/afterSale/index')"
class="item rounded-1xl bg-slate-50 p-2 flex justify-between" style="font-size: 24rpx;">
售后订单
<text></text>
</div>
</div> </div>
<bar :barData="orderProfit"></bar> <bar :barData="orderProfit"></bar>
@ -176,7 +187,7 @@ const loading = ref(false);
/** /**
* 从本地存储中获取用户信息 * 从本地存储中获取用户信息
*/ */
const user_info = uni.getStorageSync("user_info"); const mall_info = uni.getStorageSync("mall_info");
/** /**
* @type {Ref<Object>} * @type {Ref<Object>}

@ -0,0 +1,289 @@
<template>
<view class="content">
<view class=" bg-white sticky top-0 z-50">
<div class="flex items-center">
<view class="flex-1">
<wd-search @search="search" @clear="search({ value: '' })" v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
<div v-if="getQrItem.img_url" class="mr-2">
<wd-button @click="showImg = true" size="small">付款码</wd-button>
</div>
</div>
<wd-tabs @change="(e) => {
params.status = (e.index == 3 ? 5 : e.index);
search({ value: params.keywords })
}" v-model="params.status">
<wd-tab v-for="item in status" :key="item" :title="`${item.content}`"></wd-tab>
</wd-tabs>
</view>
<view class="goodsBox p-2">
<yList ref="yListRef" :apiObj="order.OrderInpersonPayment.orderList"
:params="{ ...params, status: params.status - 1 }">
<template #default="{ list }">
<view>
<view v-for="item of list" class="goods">
<wd-card type="rectangle">
<template #title>
<view class="title">
<view>
<span class="mr-2">用户{{ item?.user?.nickname }}</span>
</view>
<view @click="utils.copy(item.order_no, '已复制单号')" class="title-tip">
<span style="font-size: 24rpx;margin-left: 8px;">单号{{ item.order_no }}</span>
</view>
</view>
</template>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>原价<text class="text-red-600"> {{ item.total_price || 0 }}</text></view>
<view>支付金额<text class="text-red-600"> {{ item.pay_price || 0 }}</text></view>
<view>
支付方式
<text class="text-black">
{{ [
"", "支付宝", "微信", "余额", "货到付款", "先就餐后支付"
][item.pay_type] }}
</text>
</view>
</view>
<template #footer>
<!-- <view class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;">
<view>
售后状态:
</view>
</view> -->
<view class="flex justify-between items-center">
<!-- <view class="font-bold">实付: {{ item.pay_price }} </view> -->
<view>
支付状态<wd-button :round="false" size="small"
:type="['warning', 'success', 'warning', 'success', 'info'][item.status]">
<div>{{ ["未支付", "已支付", "已取消"][item.status] || "已取消" }}</div>
</wd-button>
</view>
<view class="flex-1 flex justify-end">
<!-- <view v-if="item.apply_cancel === 1" class="mr-2">
<wd-button type="error" @click="orderApproval(item)" size="small">退款</wd-button>
</view>
<view class="mr-2">
<wd-button @click="printing(item)" size="small">小票打印</wd-button>
</view>
<view class="mr-2">
<wd-button @click="orderNotes(item)" size="small">备注</wd-button>
</view>
<view v-if="item.status == 1" class="">
<wd-button @click="shipments(item)" size="small">发货</wd-button>
</view> -->
</view>
</view>
</template>
</wd-card>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
<wd-curtain v-if="getQrItem.img_url" :value="showImg" :src="getQrItem.img_url" :to="'/store/inpersonPay/index'"
@close="showImg = false" close-position="top" width="280"></wd-curtain>
</view>
</template>
<script setup>
import utils from '@/utils/utils.js';
import order from '@/api/mall/order.js';
import yList from "/components/yList/index.vue";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni';
import { ref } from 'vue';
const message = useMessage('wd-message-box-slot');
const message1 = useMessage();
const toast = useToast();
const showImg = ref(false)
let afterType = 1
/**
* 处理订单备注操作
* @param {Object} row - 行数据
*/
const orderNotes = (row, text) => {
message1
.prompt({
title: text,
inputValue: row.refund_amount
})
.then((resp) => {
order.after_sale.update({
id: row.id,
status: 5,
refund_amount: resp.value,
refund_type: afterType,
shop_description: 1,
}).then(res => {
if (res.code == 0) {
toast.success('操作成功');
row.status = 5;
} else {
toast.error('操作失败');
}
});
})
.catch((error) => {
console.log(error);
});
};
const classify_id = ref(0);
const params = ref({
keywords: "",
status: "",
type: 'order_no'
});
const yListRef = ref(null);
const search = ({ value }) => {
yListRef.value.upData({
keywords: value,
classify_id: classify_id.value,
status: params.value.status - 1
});
};
const searchType = ref('订单编号');
const popover = ref(false);
const status = ref([
{ content: '全部' },
{ content: '未支付' },
{ content: '已支付' },
{ content: '已取消' },
]);
const menu = ref([
{ content: '订单编号' },
{ content: '商品名称' },
{ content: '手机号' },
{ content: '会员昵称' },
{ content: '收货人' },
]);
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
if (item.content == '订单编号') {
params.value.type = "order_no";
}
if (item.content == '商品名称') {
params.value.type = "goods_name";
}
if (item.content == '手机号') {
params.value.type = "receiver_phone";
}
if (item.content == '会员昵称') {
params.value.type = "nickname";
}
if (item.content == '收货人') {
params.value.type = "receiver_name";
}
}
const getQrItem = ref({});
/**
* 获取物流公司列表
*/
const getGetQrItem = () => {
order.OrderInpersonPayment.GetQrItem().then(res => {
getQrItem.value = res.data
});
};
//
getGetQrItem();
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 10px;
font-size: 22rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.goodsBox {
.content,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.content {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
}
</style>

@ -82,7 +82,7 @@
</view> </view>
</template> </template>
<view v-for="subItem of item.details" style="height: 60px;" class="content mb-4"> <view v-for="subItem of item.details" class="content mb-4">
<image :src="subItem.goods_pic" width="40" height="40" alt="joy" <image :src="subItem.goods_pic" width="40" height="40" alt="joy"
style="border-radius: 4px; margin-right: 12px;width: 60px;height: 60px;min-width: 60px;" /> style="border-radius: 4px; margin-right: 12px;width: 60px;height: 60px;min-width: 60px;" />
<view> <view>

@ -0,0 +1,511 @@
<template>
<view class="content">
<wd-message-box></wd-message-box>
<wd-message-box selector="wd-message-box-slot" use-slot>
<view>
<wd-form :model="shipmentsModel">
<wd-cell-group border>
<view class="mb-4">
<wd-radio-group v-model="shipmentsModel.send_type" shape="button" @change="change">
<!-- <wd-radio :value="1">快递发货</wd-radio> -->
<wd-radio :value="2">无需物流</wd-radio>
</wd-radio-group>
</view>
<view class="mb-4 overflow-hidden bg-white border-gray-100 border-solid border-[8px] p-3 rounded"
v-if="shipmentsModel.send_type == 1">
<view class="mb-2">
<wd-radio-group shape="button" v-model="shipmentsModel.delivery_company">
<view class="flex overflow-auto">
<wd-radio v-for="item of expressList" :value="item.value">{{ item.label }}</wd-radio>
</view>
</wd-radio-group>
</view>
<wd-input label-width="100px" clearable v-model="shipmentsModel.delivery_no" placeholder="快递单号">
</wd-input>
</view>
</wd-cell-group>
</wd-form>
</view>
</wd-message-box>
<view class=" bg-white sticky top-0 z-50">
<div class="flex items-center">
<view class="flex-1">
<wd-search @search="search" @clear="search({ value: '' })" v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
<!-- <div class="mr-2">
<wd-button @click="utils.toUrl('/store/afterSale/index')" size="small">售后订单</wd-button>
</div> -->
</div>
<wd-tabs @change="(e) => {
params.status = e.index;
search({ value: params.keywords })
}" v-model="params.status">
<wd-tab v-for="item in status" :key="item" :title="`${item.content}`"></wd-tab>
</wd-tabs>
</view>
<view class="goodsBox p-2">
<yList ref="yListRef" :apiObj="order.orderList" :params="{ ...params, status: params.status - 1 }">
<template #default="{ list }">
<view>
<view v-for="item of list" class="goods">
<wd-card type="rectangle">
<template #title>
<view class="title">
<view>
<span class="mr-2" v-if="item.shop">{{ item.shop.name }}</span>
<span class="mr-2" v-else></span>
<span class="font-bold">({{ status[item.status + 1].content }})</span>
</view>
<view @click="utils.copy(item.order_no, '已复制单号')" class="title-tip">
<span style="font-size: 24rpx;margin-left: 8px;">单号{{ item.order_no }}</span>
</view>
</view>
</template>
<view v-for="subItem of item.details" class="content mb-4">
<image :src="subItem.goods_pic" width="40" height="40" alt="joy"
style="border-radius: 4px; margin-right: 12px;width: 60px;height: 60px;min-width: 60px;" />
<view>
<view class="line2" style="color: rgba(0,0,0,0.85); font-size: 16px;">{{ subItem.goods_name }}</view>
<!-- <view class="font-bold" style="color: rgb(255, 0, 0); font-size: 16px;">{{ subItem.price }}
</view> -->
<view class="font-bold" style="font-size: 22rpx;">小计: {{ subItem.price }} <text
style="color: rgb(255, 0, 0); font-size: 24rpx;">({{
subItem.num }}) </text></view>
<div class="goods_sky" style="font-size: 22rpx;">
<span v-for="(sku, _index) of subItem.goods_sku_json" :key="_index">
{{ sku.group_name }}{{ sku.name }}</span>
</div>
</view>
</view>
<view class="bg-gray-50 p-2">
<view class="text-[12px]" v-if="item.user">
<view class="mb-1">
下单用户{{ item.user.nickname }}
<text class="font-bold">
( 会员ID{{ item.user.id }} )
</text>
<view class="bg-gray-100 my-2 p-2 relative">
<view>收货人{{ item.receiver_name }} &nbsp; 电话{{ item.receiver_phone }}</view>
<view v-if="item.delivery_address">{{ item.delivery_address }} {{
item.delivery_address_detail }}</view>
<view
@click="utils.copy(`收货人:${item.receiver_name} 电话:${item.receiver_phone} 收货地址:${item.delivery_address}`, '已复制快递信息')"
class="absolute right-2 top-2">
<wd-icon name="file-copy" size="14px"></wd-icon>
</view>
</view>
</view>
<view class="flex items-center" v-if='[0, 1, 2][item.delivery_type]'>配送方式:
<wd-tag class="ml-2" :type="['', 'success', 'primary'][item.delivery_type]">
{{ ["", "快递配送", "到店自提"][item.delivery_type] }}
</wd-tag>
<view class="ml-2" v-if="item.delivery_type == 1">
<wd-tag type="warning">
运费: {{ item.delivery_money }}
</wd-tag>
</view>
</view>
</view>
</view>
<template #footer>
<view class="bg-gray-50 p-2 flex justify-between" style="font-size: 22rpx;">
<view>应付: {{ (Number(item.total_price) + Number(item.delivery_money)).toFixed(2) }} </view>
<view>余额支付: {{ item.pay_balance }} </view>
<view v-if="((Number(item.total_price) + Number(item.delivery_money)) -
item.pay_price) > 0">优惠: {{ ((Number(item.total_price) + Number(item.delivery_money)) -
item.pay_price).toFixed(2) }} </view>
</view>
<view class="h-2 opacity-0 text-white">占位</view>
<view class="flex justify-between items-center">
<view class="font-bold">实付: {{ item.pay_price }} </view>
<view class="flex-1 flex justify-end">
<view v-if="item.apply_cancel === 1" class="mr-2">
<wd-button type="error" @click="orderApproval(item)" size="small">退款</wd-button>
</view>
<!-- <view class="mr-2">
<wd-button @click="printing(item)" size="small">小票打印</wd-button>
</view> -->
<view class="mr-2">
<wd-button @click="orderNotes(item)" size="small">备注</wd-button>
</view>
<view v-if="item.status == 1" class="">
<wd-button @click="shipments(item)" size="small">发货</wd-button>
</view>
</view>
</view>
</template>
</wd-card>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
</view>
</template>
<script setup>
import utils from '@/utils/utils.js';
import order from '@/api/mall/orderPickUp.js';
import yList from "/components/yList/index.vue";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni';
import { ref, nextTick } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
const message = useMessage('wd-message-box-slot');
const message1 = useMessage();
const toast = useToast();
const classify_id = ref(0);
const params = ref({
keywords: "",
status: 0,
type: 'order_no'
});
const yListRef = ref(null);
const search = ({ value }) => {
yListRef.value.upData({
keywords: value,
classify_id: classify_id.value,
status: params.value.status - 1
});
};
onLoad(({ s } = {}) => {
if (s) {
params.value.status = Number(s)
}
})
const searchType = ref('订单编号');
const popover = ref(false);
const status = ref([
{ content: '全部' },
{ content: '未付款' },
{ content: '待发货' },
{ content: '已发货' },
{ content: '已完成' },
{ content: '已取消' },
{ content: '待处理' },
{ content: '回收站' }
]);
const menu = ref([
{ content: '订单编号' },
{ content: '商品名称' },
{ content: '手机号' },
{ content: '会员昵称' },
{ content: '收货人' },
]);
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
if (item.content == '订单编号') {
params.value.type = "order_no";
}
if (item.content == '商品名称') {
params.value.type = "goods_name";
}
if (item.content == '手机号') {
params.value.type = "receiver_phone";
}
if (item.content == '会员昵称') {
params.value.type = "nickname";
}
if (item.content == '收货人') {
params.value.type = "receiver_name";
}
}
/**
* 更改状态
* @param {Object} row - 行数据
*/
const changeS = (row) => {
//
// goods.goodsEditAttribute({
// id: item.id,
// value: [1, 0][item.status],
// type: "status"
// }).then(res => {
// if (res.code == 0) {
// toast.success('')
// item.status = [1, 0][item.status]
// } else {
// showNotify({ type: 'error', message: '' })
// }
// })
};
const expressList = ref([]);
// /**
// *
// */
// const getExpressList = () => {
// order.GetExpressList().then(res => {
// expressList.value = Object.entries(res.data).reduce((express, item) => {
// express.push({ label: item[1], value: item[0] });
// return express;
// }, []);
// });
// };
// //
// getExpressList();
const shipmentsModel = ref({
send_type: 2,
delivery_company: ""
});
/**
* 处理发货操作
* @param {Object} row - 行数据
*/
const shipments = (row) => {
message
.confirm({
title: '订单发货',
})
.then((resp) => {
if (shipmentsModel.value.send_type == 2) {
order.orderSend({
id: row.id,
send_type: "2"
});
row.status = 2;
toast.success('操作成功');
setTimeout(() => {
shipmentsModel.value = {
send_type: 2,
delivery_company: ""
};
}, 300);
}
if (shipmentsModel.value.send_type == 1) {
if (shipmentsModel.value.delivery_company && shipmentsModel.value.delivery_no) {
order.orderSend({
id: row.id,
send_type: "1",
delivery_company: shipmentsModel.value.delivery_company,
delivery_no: shipmentsModel.value.delivery_no,
});
row.status = 2;
row.success('操作成功');
setTimeout(() => {
shipmentsModel.value = {
send_type: 2,
delivery_company: ""
};
}, 300);
} else {
toast.error('发货失败,请完善选择填写');
shipments(row);
}
}
})
.catch((error) => {
console.log(error);
setTimeout(() => {
shipmentsModel.value = {
send_type: 2,
delivery_company: ""
};
}, 300);
});
};
/**
* 处理打印小票操作
* @param {Object} row - 行数据
*/
const printing = (row) => {
message1
.confirm({
title: '打印小票',
})
.then((resp) => {
order.printOrder({
id: row.id,
send_type: "2"
}).then(res => {
if (res.code == 0) {
toast.success('调用成功');
} else {
toast.error('调用失败');
}
});
})
.catch((error) => {
console.log(error);
});
};
/**
* 处理订单备注操作
* @param {Object} row - 行数据
*/
const orderNotes = (row) => {
message1
.prompt({
title: '订单备注',
})
.then((resp) => {
order.updateNotes({
id: row.id,
notes: resp.value
}).then(res => {
if (res.code == 0) {
toast.success('操作成功');
} else {
toast.error('操作失败');
}
});
})
.catch((error) => {
console.log(error);
});
};
/**
* 处理退款审批操作
* @param {Object} row - 行数据
*/
const orderApproval = (row) => {
message1
.confirm({
title: '退款审批',
confirmButtonText: "同意",
cancelButtonText: "拒绝",
})
.then((resp) => {
order.confirmCancel({
id: row.id,
apply_cancel_notes: "同意",
handle_status: 1
}).then(res => {
if (res.code == 0) {
toast.success('操作成功');
row.apply_cancel = 0;
} else {
toast.error('操作失败');
}
});
})
.catch((error) => {
if (error.action == 'cancel') {
order.confirmCancel({
id: row.id,
apply_cancel_notes: "拒绝",
handle_status: 0
}).then(res => {
if (res.code == 0) {
toast.success('操作成功');
row.apply_cancel = 0;
} else {
toast.error('操作失败');
}
});
}
});
};
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 16px;
font-size: 24rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.goodsBox {
.content,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.content {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
}
</style>

@ -0,0 +1,229 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form ref="form" :model="shopData" :rules="formRules">
<!-- 基础信息 -->
<wd-cell-group title="基础信息" border>
<wd-input label="商城名称" label-width="100px" v-model="shopData.name" />
<!-- 商城LOGO -->
<wd-cell-group class="flex py-2 w-full" title="商城LOGO">
<view class="ml-3">
<yUpload v-model="shopData.logo_url" :size="1"></yUpload>
</view>
</wd-cell-group>
<!-- 门头照图片 -->
<wd-cell-group class="flex py-2 w-full" title="门头照图片">
<view class="ml-3">
<yUpload v-model="shopData.shop_url" :size="1"></yUpload>
</view>
</wd-cell-group>
<!-- <wd-input label="联系人" label-width="100px" v-model="shopData.contact" /> -->
<wd-input label="联系方式" label-width="100px" v-model="shopData.mobile" />
<!-- 其他基础信息字段可以根据需要添加 -->
</wd-cell-group>
<!-- 地址信息 -->
<wd-cell-group class="flex py-2 w-full" title="所在地区">
<view class="ml-3">
<!-- 省市区选择器 -->
<uni-data-picker placeholder="请选择省市区" popup-title="" :localdata="addrList" :map="{
text: 'name',
value: 'id',
}" v-model="shopData.district" @change="select">
</uni-data-picker>
</view>
</wd-cell-group>
<wd-input label="详细地址" label-width="100px" v-model="shopData.detail" use-suffix-slot>
</wd-input>
<!-- 其他信息 -->
<wd-cell-group title="其他信息" border>
<!-- 云喇叭通知表单项 -->
<wd-form-item label="云喇叭通知:" prop="zhangyou_device_name">
<wd-input v-model="shopData.zhangyou_device_name" placeholder="请输入设备编号" clearable />
<div style="color: #666;font-size: 12px;">
掌优4G云喇叭编号
</div>
</wd-form-item>
<wd-form-item label="抖音门店ID" prop="zhangyou_device_name">
<wd-input v-model="shopData.douyin_shop_id" placeholder="请输入抖音门店ID" clearable />
</wd-form-item>
<wd-form-item label="支付宝门店ID" prop="zhangyou_device_name">
<wd-input v-model="shopData.ali_shop_id" placeholder="请输入支付宝门店ID" clearable />
</wd-form-item>
</wd-cell-group>
<view class="p-3 bg-white rounded mb-2">
<div class="name mb-2 text-xs">非营业时间下单</div>
<view class="bg-white px-3 py-2 rounded flex items-center">
<wd-switch v-model="shopData.is_opening" :active-value="1" :inactive-value="0" />
</view>
</view>
<view class="p-3 bg-white rounded mb-2">
<div class="name mb-2 text-xs">状态</div>
<view class="bg-white px-3 py-2 rounded flex items-center">
<wd-switch v-model="shopData.status" :active-value="1" :inactive-value="0" />
</view>
</view>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import { ref } from 'vue';
import yUpload from "@/components/yUpload/index.vue";
import uniDataPicker from "@/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue";
import system from '@/api/modules/system.js';
import index from '@/api/mall/index.js';
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import shop from '@/api/store/shop.js';
/**
* 从本地存储中获取用户信息
*/
const user_info = uni.getStorageSync("user_info");
export default {
components: {
yUpload, uniDataPicker, kevyloading
},
data() {
return {
utils,
user_info,
//
shopData: {
name: '',
logo_url: '',
mobile: '',
district: null,
latlngCurrent: '',
pay_time: '',
confirm_time: '',
sale_time: '',
pay_type: [],
delivery_type: [],
after_sale_name: '',
after_sale_phone: '',
after_sale_address: '',
ali_express_app_code: '',
zhangyou_device_name: '',
},
shippingOptions: [
{ label: "邮寄", value: 1 },
{ label: "自提", value: 2 },
],
//
formRules: {
name: [{ required: true, message: "请输入门店名称", trigger: "blur" }],
//
},
//
addrList: [
//
],
loading: false
};
},
onLoad(e) {
this.getDistrict();
this.getShopSetting();
},
methods: {
/**
* 获取省市区数据
*/
async getDistrict() {
const res = await system.getDistrict();
this.addrList = res.data;
},
/**
* 获取门店设置
*/
async getShopSetting() {
this.loading = true;
const res = await index.getShopSetting();
if (res.data.id) {
this.shopData = res.data;
}
this.loading = false;
},
/**
* 处理省市区选择变化
* @param {Object} value - 选择的值
*/
areaChange(value) {
//
},
/**
* 处理省市区选择
* @param {Object} detail - 选择器详细信息
*/
select({ detail }) {
if (detail.value.length) {
const [province_id, city_id, district_id] = detail.value.map(
(el) => el.value
);
this.shopData.province_id = province_id;
this.shopData.city_id = city_id;
this.shopData.district_id = district_id;
this.shopData.district = [province_id, city_id, district_id];
}
},
/**
* 处理表单提交
*/
async handleSubmit() {
//
const res = await shop.edit({
...this.shopData
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
uni.navigateBack()
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -29,6 +29,18 @@
} }
} }
}, },
{
"path": "function/index",
"style": {
"navigationBarTitleText": "应用中心",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{ {
"path": "goods/index", "path": "goods/index",
"style": { "style": {
@ -65,6 +77,162 @@
} }
} }
}, },
{
"path": "coupon/index",
"style": {
"navigationBarTitleText": "优惠券列表",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "coupon/edit",
"style": {
"navigationBarTitleText": "优惠券编辑",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "coupon/userCoupon",
"style": {
"navigationBarTitleText": "领取记录",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "discount/discount/index",
"style": {
"navigationBarTitleText": "限时折扣",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "discount/discount/edit",
"style": {
"navigationBarTitleText": "限时折扣",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "discount/full_discount/index",
"style": {
"navigationBarTitleText": "梯度折扣",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "discount/full_discount/edit",
"style": {
"navigationBarTitleText": "梯度折扣",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "discount/full_set_redution/index",
"style": {
"navigationBarTitleText": "满额立减",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "discount/full_set_redution/edit",
"style": {
"navigationBarTitleText": "满额立减",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "recharge/index",
"style": {
"navigationBarTitleText": "充值管理",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "recharge/edit",
"style": {
"navigationBarTitleText": "充值方案",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "recharge/userRecharge",
"style": {
"navigationBarTitleText": "充值记录",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "recharge/setUp",
"style": {
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{ {
"path": "inpersonPay/index", "path": "inpersonPay/index",
"style": { "style": {
@ -161,6 +329,18 @@
} }
} }
}, },
{
"path": "shop/to",
"style": {
"navigationBarTitleText": "门店登录",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{ {
"path": "user/list", "path": "user/list",
"style": { "style": {
@ -333,6 +513,42 @@
"gestureBack": "YES" "gestureBack": "YES"
} }
} }
},
{
"path": "setup/index",
"style": {
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "pickUp/index",
"style": {
"navigationBarTitleText": "自提订单",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "inpersonPay/index",
"style": {
"navigationBarTitleText": "当面付订单",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
} }
] ]
} }

@ -19,6 +19,7 @@ import { ref } from 'vue'
import user from '@/api/modules/user.js' import user from '@/api/modules/user.js'
import utils from '@/utils/utils.js' import utils from '@/utils/utils.js'
import md5 from 'js-md5'; import md5 from 'js-md5';
uni.clearStorage(); //
const model = ref({ const model = ref({
username: "", username: "",
@ -52,6 +53,7 @@ function handleSubmit() {
if (res.code == 0) { if (res.code == 0) {
uni.setStorageSync("token", res.data.access_token); uni.setStorageSync("token", res.data.access_token);
uni.setStorageSync("user_info", res.data.user_info); uni.setStorageSync("user_info", res.data.user_info);
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "登录成功", title: "登录成功",
@ -59,7 +61,10 @@ function handleSubmit() {
if (res.data.user_info.type == 1) { if (res.data.user_info.type == 1) {
utils.toUrl("/store/index/index", "redirectTo") utils.toUrl("/store/index/index", "redirectTo")
uni.setStorageSync("store_info", res.data.user_info);
} else if (res.data.user_info.type == 3) { } else if (res.data.user_info.type == 3) {
uni.setStorageSync("mall_token", res.data.access_token);
uni.setStorageSync("mall_info", res.data.user_info);
utils.toUrl("/mall/index/index", "redirectTo") utils.toUrl("/mall/index/index", "redirectTo")
} else { } else {
uni.showToast({ uni.showToast({

@ -3,7 +3,9 @@
<wd-tabbar custom-class="mb-3" fixed safeAreaInsetBottom placeholder v-model="tab" shape="round"> <wd-tabbar custom-class="mb-3" fixed safeAreaInsetBottom placeholder v-model="tab" shape="round">
<wd-tabbar-item @click="utils.toUrl('/store/index/index')" name="home" title="首页" icon="home"></wd-tabbar-item> <wd-tabbar-item @click="utils.toUrl('/store/index/index')" name="home" title="首页" icon="home"></wd-tabbar-item>
<!-- <wd-tabbar-item name="cart" title="分类" icon="cart"></wd-tabbar-item> --> <!-- <wd-tabbar-item name="cart" title="分类" icon="cart"></wd-tabbar-item> -->
<wd-tabbar-item name="user" @click="utils.toUrl('/store/user/list')" title="用户管理" icon="user"></wd-tabbar-item> <wd-tabbar-item name="function" @click="utils.toUrl('/store/function/index')" title="应用中心"
icon="layers"></wd-tabbar-item>
<!-- <wd-tabbar-item name="user" @click="utils.toUrl('/store/user/list')" title="用户管理" icon="user"></wd-tabbar-item> -->
<wd-tabbar-item @click="utils.toUrl('/store/shop/list')" name="shop" title="门店管理" icon="detection"></wd-tabbar-item> <wd-tabbar-item @click="utils.toUrl('/store/shop/list')" name="shop" title="门店管理" icon="detection"></wd-tabbar-item>
<!-- <wd-tabbar-item name="user" title="我的" icon="user"></wd-tabbar-item> --> <!-- <wd-tabbar-item name="user" title="我的" icon="user"></wd-tabbar-item> -->
</wd-tabbar> </wd-tabbar>

@ -0,0 +1,277 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form ref="form" :model="formData" :rules="formRules">
<!-- 基础信息 -->
<wd-cell-group title="基本信息" border>
<wd-input label="券名称" v-model="formData.name" />
<wd-input label="优惠券金额" v-model="formData.price" />
<wd-input label="满减金额" v-model="formData.full_price" />
<!-- 其他基本信息字段可以根据需要添加 -->
</wd-cell-group>
<wd-cell-group title="领取类型">
<div class="bg-white rounded p-2">
<wd-radio-group v-model="formData.send_type" shape="button" @change="change">
<wd-radio :value="0">领取后过期</wd-radio>
<wd-radio :value="1">定时过期</wd-radio>
</wd-radio-group>
</div>
<wd-input v-if="formData.send_type == 0" label="过期时间" v-model="formData.day" />
<div v-if="formData.send_type == 1" label="过期时间" style="display: flex;flex-direction: column;">
<wd-datetime-picker v-model="formData.start_time" label="开始时间" />
<wd-datetime-picker v-model="formData.end_time" label="结束时间" />
</div>
</wd-cell-group>
<!-- 是否启用 -->
<wd-cell-group title="领取中心显示" border>
<view class="p-4">
<wd-switch v-model="formData.is_show" :active-value="1" :inactive-value="0"></wd-switch>
</view>
</wd-cell-group>
<!-- 是否启用 -->
<wd-cell-group title="优惠券类型" border>
<view class="p-4">
<div class="mb-4">
<wd-radio-group v-model="formData.coupon_type" shape="button">
<wd-radio :value="1">商品</wd-radio>
<wd-radio :value="2">分类</wd-radio>
<wd-radio :value="3">当面付</wd-radio>
</wd-radio-group>
</div>
<view v-if="formData.coupon_type == 1">
<wd-form-item label="选择商品">
<yGoods v-model="formData.coupon_deatil" :size="1"></yGoods>
</wd-form-item>
</view>
<view v-if="formData.coupon_type == 2">
<wd-select-picker type="checkbox" label="选择分类" v-model="formData.cats"
:columns="classifyList"></wd-select-picker>
</view>
</view>
</wd-cell-group>
<wd-cell-group title="优惠券数量" border>
<view class="p-4">
<wd-input-number v-model="formData.stock" min="0" />
</view>
</wd-cell-group>
<wd-cell-group title="领取限制" border>
<view class="p-4">
<div class="mb-4">
<wd-radio-group v-model="formData.limit_type" shape="button">
<wd-radio :value="1">不限</wd-radio>
<wd-radio :value="2">每天一次</wd-radio>
<wd-radio :value="3">每人一次</wd-radio>
</wd-radio-group>
</div>
</view>
</wd-cell-group>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import yUpload from "@/components/yUpload/index.vue";
import uniDataPicker from "@/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import coupon from '@/api/store/coupon.js';
import yGoods from "@/components/yGoods/index.vue";
import goods from '@/api/store/goods.js'
/**
* 从本地存储中获取用户信息
*/
const user_info = uni.getStorageSync("user_info");
export default {
components: {
yUpload, uniDataPicker, kevyloading, yGoods
},
data() {
return {
utils,
user_info,
//
formData: {
"name": "", //
"price": "", //
"full_price": "", //
"send_type": "", //
"day": "", //
"start_time": null,
"end_time": null,
"is_show": 1, //
"coupon_type": 1, //
"limit_type": 1, //
"stock": 0, //
"coupon_deatil": [],
"cats": []
},
//
formRules: {
//
},
//
addrList: [
//
],
classifyList: [],
loading: false
};
},
async onLoad(e) {
// this.getDistrict();
if (e.id) {
await this.getClassify()
this.GetItem(e.id);
}
// this.formData = JSON.parse(e.edit)
},
methods: {
async getClassify() {
goods.classify.list().then(res => {
this.classifyList = res.data.map(item => {
return {
label: item.name,
value: item.id,
}
})
})
},
/**
* 获取门店设置
*/
async GetItem(id) {
this.loading = true;
const res = await coupon.GetItem({ id });
if (res.data.id) {
this.formData = JSON.parse(JSON.stringify(res.data));
this.formData.start_time = this.formData.start_time ? new Date(this.formData.start_time * 1000) : new Date()
this.formData.end_time = new Date(this.formData.end_time * 1000)
this.formData.cats = this.formData.cats || []
this.formData.coupon_deatil = []
if (this.formData.coupon_type == 1) {
this.formData.coupon_deatil = res.data.coupon_deatil
}
if (this.formData.coupon_type == 2) {
this.formData.cats = res.data.coupon_deatil?.map(item => item.id) || []
setTimeout(() => {
this.formData.cats = res.data.coupon_deatil?.map(item => item.id) || []
}, 321);
}
}
this.loading = false;
},
/**
* 处理省市区选择变化
* @param {Object} value - 选择的值
*/
areaChange(value) {
//
},
/**
* 处理省市区选择
* @param {Object} detail - 选择器详细信息
*/
select({ detail }) {
if (detail.value.length) {
const [province_id, city_id, district_id] = detail.value.map(
(el) => el.value
);
this.formData.province_id = province_id;
this.formData.city_id = city_id;
this.formData.district_id = district_id;
this.formData.district = [province_id, city_id, district_id];
}
},
/**
* 处理表单提交
*/
async handleSubmit() {
console.log(this.formData);
try {
let mix_id_list = []
if (this.formData.coupon_type == 1) {
mix_id_list = this.formData.coupon_deatil?.map(item => [item.id]) || []
}
if (this.formData.coupon_type == 2) {
mix_id_list = this.formData.cats?.map(item => [item]) || []
}
//
const res = await coupon.Create({
...this.formData,
start_time: this.formData.send_type == 1 ? utils.dateFormat(this.formData.start_time) : utils.dateFormat(new Date()),
end_time: this.formData.send_type == 1 ? utils.dateFormat(this.formData.end_time) : utils.dateFormat(new Date()),
mix_id_list: mix_id_list
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
uni.navigateBack()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
} catch (error) {
console.log(error);
setTimeout(() => {
uni.showToast({
title: '请检查表单!',
icon: 'none'
});
}, 100);
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -0,0 +1,302 @@
<template>
<view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<!-- <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="coupon_info?.info?.name || '商城首页'">
<template #right>
<wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon>
</template>
</wd-navbar>
</view> -->
<view class=" bg-white sticky top-0 z-50 flex items-center">
<view class="flex-1">
<wd-search @search="search({ value: params.keywords })" @clear="search({ value: params.keywords = '' })"
v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/coupon/edit')" size="small">新增券</wd-button>
</view>
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/coupon/userCoupon')" size="small">领取记录</wd-button>
</view>
</view>
<!-- <view class="flex-1 bg-white pb-2">
<div class="rounded-md overflow-hidden">
<wd-tabs @change="search">
<wd-tab :title="`全部`" :name="null"></wd-tab>
<wd-tab :title="`领取后过期`" :name="0"></wd-tab>
<wd-tab :title="`定时过期`" :name="1"></wd-tab>
</wd-tabs>
</div>
</view> -->
<view class="grid p-2">
<yList height="91vh" ref="yListRef" :apiObj="coupon.List" :params="{ ...params }">
<template #default="{ list: couponList }">
<view class="flex flex-col">
<view v-for="coupon of couponList" class="overflow-hidden relative">
<wd-swipe-action class="rounded-xl overflow-hidden mb-3 ">
<view class="couponCart relative bg-red-700">
<view class="w-[76%] bg-red-600 absolute top-0 bottom-0 left-0" style="z-index: 0;"></view>
<view class="relative px-4 py-4" style="z-index: 1;">
<view
class="rounded-r-xl font-bold absolute top-0 left-0 px-2 pr-4 py-1 text-[12px] bg-neutral-900 text-orange-500 z-30">
ID: {{ coupon.id }}
</view>
<view
class="rounded-xl font-bold absolute top-0 left-8 px-2 pr-4 py-1 pl-8 text-[12px] bg-neutral-800 text-orange-500 z-20">
{{ ["优惠券", "商品可用", "分类可用", "当面付"][coupon.coupon_type] }}
</view>
<view v-if="coupon.stock > 0"
class="rounded-xl font-bold absolute top-0 left-24 px-2 py-1 pl-8 text-[12px] bg-neutral-700 text-orange-400 z-10">
剩余 {{ coupon.stock }}
</view>
<view v-else
class="rounded-xl font-bold absolute top-0 left-24 px-2 py-1 pl-8 text-[12px] bg-neutral-700 text-white z-10">
已领完
</view>
<view class="flex">
<view class="mt-4 mr-6">
<!-- <view class="price text-[16px] text-orange-300">
</view> -->
<view class="leading-4 mt-1">
<view class="price text-[12px] text-orange-300">
{{ coupon.name }}
</view>
<view class="price text-white text-[12px]">
<div class="day" v-if="coupon.send_type == 1">
有效时间 {{ formatOfTime(coupon.start_time) }} - {{ formatOfTime(coupon.end_time) }}
</div>
<div v-else>--</div>
</view>
<view class="price text-white text-[12px]">
过期时间{{ coupon.day }}
</view>
<div class="flex flex-col">
<view class="price text-white text-[12px] mr-4">
券金额 {{ coupon.price }}
</view>
<view class="price text-white text-[12px]">
满减金额 {{ coupon.full_price }}
</view>
</div>
</view>
</view>
</view>
<view class="mt-4 text-white flex items-center justify-center absolute top-0 right-0">
<view class="bg-red-600 px-4 py-2 font-bold text-[13px] rounded-l-full " :round="false"
size="small">
<span v-if="coupon.limit_type == 1"></span>
<span v-if="coupon.limit_type == 2"></span>
<span v-if="coupon.limit_type == 3"></span>
</view>
</view>
</view>
</view>
<template #right>
<view class="flex h-full ">
<view
class="px-4 text-nowrap h-full bg-red-700 text-white text-black flex items-center justify-center">
<view @click="utils.toUrl('/store/coupon/edit?id=' + coupon.id)" style="writing-mode: vertical-rl;
text-orientation: upright;">
编辑
</view>
</view>
</view>
</template>
</wd-swipe-action>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
<wd-message-box></wd-message-box>
</view>
</template>
<script setup>
import { ref, nextTick } from 'vue';
import utils from '@/utils/utils.js';
import coupon from '@/api/store/coupon.js';
import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni'
import yList from "/components/yList/index.vue";
import {
onShow,
} from "@dcloudio/uni-app";
const yListRef = ref(null);
const searchType = ref('券名');
const popover = ref(false);
const search = ({ value } = {}) => {
if (searchType.value == '券名') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '券金额') {
yListRef.value.upData({
price: params.value.keywords
});
} else {
yListRef.value.upData({});
}
};
const menu = ref([
{ content: '券名' },
{ content: '券金额' },
]);
const params = ref({
name: null,
price: null,
send_type: null
});
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
search(params.value.keywords)
}
/**
* @type {Ref<boolean>}
* 控制页面加载状态的 Ref
*/
const loading = ref(false);
const formatOfTime = (theTimeStamp) => {
const date = new Date(theTimeStamp * 1000); //
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}`;
}
//
onShow(() => {
nextTick(() => {
search({ value: params.value.keywords = '' })
})
// search('')
// getcouponList();
})
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 16px;
font-size: 24rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.couponBox,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.couponBox {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
</style>

@ -0,0 +1,211 @@
<template>
<view class="content">
<view class=" bg-white sticky top-0 z-50">
<div class="flex items-center">
<view class="flex-1">
<wd-search @search="search" @clear="search({ value: '' })" v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
</div>
<wd-tabs @change="(e) => {
params.coupon_type = e.index
search({ value: params.keywords })
}" v-model="params.coupon_type">
<wd-tab v-for="item in status" :key="item" :title="`${item.content}`"></wd-tab>
</wd-tabs>
</view>
<view class="goodsBox p-2">
<yList ref="yListRef" :apiObj="couponApi.UserGetList" :params="{ ...params }">
<template #default="{ list }">
<view>
<view v-for="item of list" class="goods">
<wd-card type="rectangle">
<template #title>
<view class="title">
<view>
<span class="mr-2">用户{{ item?.user_info?.nickname }}</span>
</view>
<view class="title-tip">
<span style="font-size: 24rpx;margin-left: 8px;">券ID{{ item.coupon?.id }}</span>
</view>
</view>
</template>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view><text class="text-black">{{ item.coupon?.name || 0 }}</text></view>
</view>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>满减金额<text class="text-red-600"> {{ item.coupon?.full_price || 0 }}</text></view>
<view>优惠金额<text class="text-red-600"> {{ item.coupon?.price || 0 }}</text></view>
</view>
<template #footer>
<!-- <view class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;">
<view>
售后状态:
</view>
</view> -->
<view class="flex justify-between items-center">
<!-- <view class="font-bold">实付: {{ item.pay_price }} </view> -->
<view>
<wd-button :round="false" size="small"
:type="['warning', 'success', 'warning', 'success', 'info'][item.coupon.coupon_type]">
<div>{{ ["优惠券", "商品", "分类", "当面付"][item.coupon.coupon_type] }} · 可用</div>
</wd-button>
</view>
<view class="flex-1 flex justify-end">
<!-- <view v-if="item.apply_cancel === 1" class="mr-2">
<wd-button type="error" @click="orderApproval(item)" size="small">退款</wd-button>
</view>
<view class="mr-2">
<wd-button @click="printing(item)" size="small">小票打印</wd-button>
</view>
<view class="mr-2">
<wd-button @click="orderNotes(item)" size="small">备注</wd-button>
</view>
<view v-if="item.status == 1" class="">
<wd-button @click="shipments(item)" size="small">发货</wd-button>
</view> -->
</view>
</view>
</template>
</wd-card>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
</view>
</template>
<script setup>
import utils from '@/utils/utils.js';
import couponApi from '@/api/store/coupon.js';
import yList from "/components/yList/index.vue";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni';
import { ref } from 'vue';
const message = useMessage('wd-message-box-slot');
const toast = useToast();
const params = ref({
keywords: "",
coupon_type: 0,
});
const yListRef = ref(null);
const search = ({ value }) => {
yListRef.value.upData({
keywords: value,
coupon_type: params.value.coupon_type
});
};
const searchType = ref('券名');
const popover = ref(false);
const status = ref([
{ content: '全部' },
{ content: '商品' },
{ content: '分类' },
{ content: '当面付' },
]);
const menu = ref([
{ content: '券名' },
{ content: '券金额' },
]);
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
if (searchType.value == '券名') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '券金额') {
yListRef.value.upData({
price: params.value.keywords
});
} else {
yListRef.value.upData({});
}
}
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 10px;
font-size: 22rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.goodsBox {
.content,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.content {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
}
</style>

@ -0,0 +1,186 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form v-if="!loading" :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm" label-width="100px">
<wd-form-item label="折扣名称" prop="name">
<wd-input placeholder="请输入折扣名称" v-model="dataForm.name" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-cell-group class="flex py-2 w-full" title="活动背景">
<view class="ml-3">
<yUpload v-model="dataForm.bg_pic" :size="1"></yUpload>
</view>
</wd-cell-group>
<wd-form-item label="活动背景颜色" prop="name">
<wd-input placeholder="请输入十六进制颜色" v-model="dataForm.bg_color" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="折扣比例" prop="discount">
<wd-input type="number" placeholder="请输入折扣比例" step="1" v-model.number="dataForm.discount" clearable
style="width: 100%"></wd-input>
<div style="color: #666;font-size: 12px;">
如商品单价100折扣比例40 (4)仅需付40元
</div>
</wd-form-item>
<wd-form-item label="选择商品">
<yGoods v-model="dataForm.deatil" :size="1"></yGoods>
</wd-form-item>
<div style="display: flex;flex-direction: column;">
<wd-datetime-picker v-model="dataForm.start_time" label="开始时间" />
<wd-datetime-picker v-model="dataForm.end_time" label="结束时间" />
</div>
<!-- 是否启用 -->
<wd-form-item label="是否启用:" prop="status">
<wd-switch v-model="dataForm.status" :active-value="1" :inactive-value="0"></wd-switch>
</wd-form-item>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import { ref } from 'vue';
import yGoods from "@/components/yGoods/index.vue";
import uniDataPicker from "@/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import userMembers from '@/api/store/userMembers.js';
import { useApi } from "@/hooks/useApi.js"
import discountApi from '@/api/store/discount.js';
import yUpload from "@/components/yUpload/index.vue";
console.log(yGoods);
/**
* 从本地存储中获取用户信息
*/
const user_info = uni.getStorageSync("user_info");
export default {
components: {
yGoods, uniDataPicker, kevyloading, yUpload
},
data() {
return {
utils,
user_info,
//
dataForm: {
"id": 0,
},
columns: [],
loading: false
};
},
onLoad(e) {
if (e.id) {
this.getData(e.id)
// this.dataForm = JSON.parse(e.edit)
// this.dataForm.start_time = new Date(this.dataForm.start_time * 1000)
// this.dataForm.end_time = new Date(this.dataForm.end_time * 1000)
// console.log(this.dataForm);
} else {
this.dataForm.start_time = new Date()
this.dataForm.end_time = new Date()
}
for (let index = 1; index <= 100; index++) {
this.columns.push(index)
}
},
methods: {
async getData(id) {
const { fetchData } = await useApi(discountApi.SalesDiscounts.GetItem)
fetchData({ id }).then(res => {
console.log(res);
this.dataForm = res.data
this.dataForm.deatil = res.data.deatil.filter(item => item)
this.dataForm.start_time = new Date(res.data.start_time * 1000)
this.dataForm.end_time = new Date(res.data.end_time * 1000)
})
},
/**
* 处理省市区选择变化
* @param {Object} value - 选择的值
*/
areaChange(value) {
//
},
/**
* 处理省市区选择
* @param {Object} detail - 选择器详细信息
*/
select({ detail }) {
if (detail.value.length) {
const [province_id, city_id, district_id] = detail.value.map(
(el) => el.value
);
this.datadataForm.province_id = province_id;
this.datadataForm.city_id = city_id;
this.datadataForm.district_id = district_id;
this.datadataForm.district = [province_id, city_id, district_id];
}
},
/**
* 处理表单提交
*/
async handleSubmit() {
console.log(this.dataForm.deatil.map(item => [item.id]));
//
const res = await discountApi.SalesDiscounts.Create({
...this.dataForm,
start_time: utils.dateFormat(this.dataForm.start_time),
end_time: utils.dateFormat(this.dataForm.end_time),
mix_id_list: this.dataForm.deatil.map(item => [item.id])
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
uni.navigateBack()
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -0,0 +1,247 @@
<template>
<view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<!-- <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="coupon_info?.info?.name || '商城首页'">
<template #right>
<wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon>
</template>
</wd-navbar>
</view> -->
<view class=" bg-white sticky top-0 z-50 flex items-center">
<view class="flex-1">
<wd-search @search="search" @clear="search" v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/discount/discount/edit')" size="small">新增折扣</wd-button>
</view>
<!-- <view class="mr-2">
<wd-button @click="utils.toUrl('/store/coupon/userCoupon')" size="small">领取记录</wd-button>
</view> -->
</view>
<!-- <view class="flex-1 bg-white pb-2">
<div class="rounded-md overflow-hidden">
<wd-tabs @change="search">
<wd-tab :title="`全部`" :name="null"></wd-tab>
<wd-tab :title="`领取后过期`" :name="0"></wd-tab>
<wd-tab :title="`定时过期`" :name="1"></wd-tab>
</wd-tabs>
</div>
</view> -->
<view class="grid p-2">
<yList height="91vh" ref="yListRef" :apiObj="discountApi.SalesDiscounts.List" :params="{ ...params }">
<template #default="{ list }">
<view>
<view v-for="item of list" class="goods">
<wd-card type="rectangle">
<template #title>
<view class="title">
<view>
<span class="mr-2">ID{{ item?.id }}</span>
</view>
<!-- <view @click="utils.copy(item.order_no, '已复制单号')" class="title-tip">
<span style="font-size: 24rpx;margin-left: 8px;">单号{{ item.order_no }}</span>
</view> -->
</view>
</template>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>折扣名称<text class="text-black">{{ item.name }}</text></view>
<view>折扣<text class="text-black">{{ item.discount || 0 }}</text></view>
</view>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>
时间
<wd-tag type="primary">{{ utils.dateFormat(item.start_time * 1000) }}</wd-tag> - <wd-tag>{{
utils.dateFormat(item.end_time * 1000) }}</wd-tag>
</view>
</view>
<template #footer>
<!-- <view class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;">
<view>
售后状态:
</view>
</view> -->
<view class="flex justify-between items-center">
<!-- <view class="font-bold">实付: {{ item.pay_price }} </view> -->
<view>
<wd-button :round="false" size="small"
:type="['warning', 'success', 'warning', 'success', 'info'][item.status]">
<div>{{ ["关闭", "开启", "已取消"][item.status] }}</div>
</wd-button>
</view>
<view class="flex-1 flex justify-end">
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/discount/discount/edit?id=' + item.id)"
size="small">编辑</wd-button>
</view>
<!-- <view v-if="item.apply_cancel === 1" class="mr-2">
<wd-button type="error" @click="orderApproval(item)" size="small">退款</wd-button>
</view>
<view class="mr-2">
<wd-button @click="printing(item)" size="small">小票打印</wd-button>
</view>
<view class="mr-2">
<wd-button @click="orderNotes(item)" size="small">备注</wd-button>
</view>
<view v-if="item.status == 1" class="">
<wd-button @click="shipments(item)" size="small">发货</wd-button>
</view> -->
</view>
</view>
</template>
</wd-card>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
<wd-message-box></wd-message-box>
</view>
</template>
<script setup>
import { ref, nextTick } from 'vue';
import utils from '@/utils/utils.js';
import discountApi from '@/api/store/discount.js';
import kevyloading from "@/components/kevy-loading/kevy-loading";
import yList from "/components/yList/index.vue";
import {
onShow,
} from "@dcloudio/uni-app";
const yListRef = ref(null);
const searchType = ref('折扣名称');
const popover = ref(false);
const search = () => {
if (searchType.value == '折扣名称') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '折扣') {
yListRef.value.upData({
discount: params.value.keywords
});
}
};
const menu = ref([
{ content: '折扣名称' },
{ content: '折扣' },
]);
const params = ref({
name: null,
price: null,
send_type: null
});
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
search(params.value.keywords)
}
/**
* @type {Ref<boolean>}
* 控制页面加载状态的 Ref
*/
const loading = ref(false);
//
onShow(() => {
search?.()
// search('')
// getcouponList();
})
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 16px;
font-size: 24rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.couponBox,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.couponBox {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
</style>

@ -0,0 +1,136 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form v-if="!loading" :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm" label-width="100px">
<wd-form-item label="折扣名称" prop="name">
<wd-input placeholder="请输入折扣名称" v-model="dataForm.name" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="满减数量" prop="full_discount">
<wd-input type="number" placeholder="请输入折扣比例" step="1" v-model.number="dataForm.full_discount" clearable
style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="折扣比例" prop="discount">
<wd-input type="number" placeholder="请输入折扣比例" step="1" v-model.number="dataForm.discount" clearable
style="width: 100%"></wd-input>
<div style="color: #666;font-size: 12px;">
如商品单价100折扣比例40 (4)仅需付40元
</div>
</wd-form-item>
<!-- 是否启用 -->
<wd-form-item label="是否启用:" prop="status">
<wd-switch v-model="dataForm.status" :active-value="1" :inactive-value="0"></wd-switch>
</wd-form-item>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import yGoods from "@/components/yGoods/index.vue";
import uniDataPicker from "@/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import { useApi } from "@/hooks/useApi.js"
import discountApi from '@/api/store/discount.js';
import yUpload from "@/components/yUpload/index.vue";
console.log(yGoods);
/**
* 从本地存储中获取用户信息
*/
const user_info = uni.getStorageSync("user_info");
export default {
components: {
yGoods, uniDataPicker, kevyloading, yUpload
},
data() {
return {
utils,
user_info,
//
dataForm: {
"id": 0,
},
columns: [],
loading: false
};
},
onLoad(e) {
if (e.id) {
this.getData(e.id)
// this.dataForm = JSON.parse(e.edit)
// this.dataForm.start_time = new Date(this.dataForm.start_time * 1000)
// this.dataForm.end_time = new Date(this.dataForm.end_time * 1000)
// console.log(this.dataForm);
} else {
}
for (let index = 1; index <= 100; index++) {
this.columns.push(index)
}
},
methods: {
async getData(id) {
const { fetchData } = await useApi(discountApi.SalesFullDiscounts.GetItem)
fetchData({ id }).then(res => {
this.dataForm = res.data
})
},
/**
* 处理省市区选择变化
* @param {Object} value - 选择的值
*/
areaChange(value) {
//
},
/**
* 处理表单提交
*/
async handleSubmit() {
//
const res = await discountApi.SalesFullDiscounts.Create({
...this.dataForm,
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
uni.navigateBack()
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -0,0 +1,237 @@
<template>
<view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<!-- <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="coupon_info?.info?.name || '商城首页'">
<template #right>
<wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon>
</template>
</wd-navbar>
</view> -->
<view class=" bg-white sticky top-0 z-50 flex items-center">
<view class="flex-1">
<wd-search @search="search" @clear="search" v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/discount/full_discount/edit')" size="small">新增折扣</wd-button>
</view>
<!-- <view class="mr-2">
<wd-button @click="utils.toUrl('/store/coupon/userCoupon')" size="small">领取记录</wd-button>
</view> -->
</view>
<!-- <view class="flex-1 bg-white pb-2">
<div class="rounded-md overflow-hidden">
<wd-tabs @change="search">
<wd-tab :title="`全部`" :name="null"></wd-tab>
<wd-tab :title="`领取后过期`" :name="0"></wd-tab>
<wd-tab :title="`定时过期`" :name="1"></wd-tab>
</wd-tabs>
</div>
</view> -->
<view class="grid p-2">
<yList height="91vh" ref="yListRef" :apiObj="fullDiscountApi.SalesFullDiscounts.List" :params="{ ...params }">
<template #default="{ list }">
<view>
<view v-for="item of list" class="goods">
<wd-card type="rectangle">
<template #title>
<view class="title">
<view>
<span class="mr-2">ID{{ item?.id }}</span>
</view>
<!-- <view @click="utils.copy(item.order_no, '已复制单号')" class="title-tip">
<span style="font-size: 24rpx;margin-left: 8px;">单号{{ item.order_no }}</span>
</view> -->
</view>
</template>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>折扣名称<text class="text-black">{{ item.name }}</text></view>
<view>折扣<text class="text-black">{{ item.fullDiscount || 0 }}</text></view>
</view>
<template #footer>
<!-- <view class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;">
<view>
售后状态:
</view>
</view> -->
<view class="flex justify-between items-center">
<!-- <view class="font-bold">实付: {{ item.pay_price }} </view> -->
<view>
<wd-button :round="false" size="small"
:type="['warning', 'success', 'warning', 'success', 'info'][item.status]">
<div>{{ ["关闭", "开启", "已取消"][item.status] }}</div>
</wd-button>
</view>
<view class="flex-1 flex justify-end">
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/discount/full_discount/edit?id=' + item.id)"
size="small">编辑</wd-button>
</view>
<!-- <view v-if="item.apply_cancel === 1" class="mr-2">
<wd-button type="error" @click="orderApproval(item)" size="small">退款</wd-button>
</view>
<view class="mr-2">
<wd-button @click="printing(item)" size="small">小票打印</wd-button>
</view>
<view class="mr-2">
<wd-button @click="orderNotes(item)" size="small">备注</wd-button>
</view>
<view v-if="item.status == 1" class="">
<wd-button @click="shipments(item)" size="small">发货</wd-button>
</view> -->
</view>
</view>
</template>
</wd-card>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
<wd-message-box></wd-message-box>
</view>
</template>
<script setup>
import { ref, nextTick } from 'vue';
import utils from '@/utils/utils.js';
import fullDiscountApi from '@/api/store/discount.js';
import kevyloading from "@/components/kevy-loading/kevy-loading";
import yList from "/components/yList/index.vue";
import {
onShow,
} from "@dcloudio/uni-app";
const yListRef = ref(null);
const searchType = ref('折扣名称');
const popover = ref(false);
const search = () => {
if (searchType.value == '折扣名称') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '折扣') {
yListRef.value.upData({
fullDiscount: params.value.keywords
});
}
};
const menu = ref([
{ content: '折扣名称' },
{ content: '折扣' },
]);
const params = ref({
name: null,
price: null,
send_type: null
});
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
search(params.value.keywords)
}
/**
* @type {Ref<boolean>}
* 控制页面加载状态的 Ref
*/
const loading = ref(false);
//
onShow(() => {
search?.()
// search('')
// getcouponList();
})
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 16px;
font-size: 24rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.couponBox,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.couponBox {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
</style>

@ -0,0 +1,193 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form v-if="!loading" :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm" label-width="100px">
<wd-form-item label="折扣名称" prop="name">
<wd-input placeholder="请输入折扣名称" v-model="dataForm.name" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-cell-group class="flex py-2 w-full" title="活动背景">
<view class="ml-3">
<yUpload v-model="dataForm.bg_pic" :size="1"></yUpload>
</view>
</wd-cell-group>
<wd-form-item label="活动背景颜色" prop="name">
<wd-input placeholder="请输入十六进制颜色" v-model="dataForm.bg_color" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="满减金额" prop="name">
<wd-input placeholder="请输入" v-model="dataForm.full_price" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="折扣比例" prop="discount">
<wd-input type="number" placeholder="请输入折扣比例" step="1" v-model.number="dataForm.discount" clearable
style="width: 100%"></wd-input>
<div style="color: #666;font-size: 12px;">
如商品单价100折扣比例40 (4)仅需付40元
</div>
</wd-form-item>
<wd-form-item label="选择商品">
<yGoods v-model="dataForm.deatil" :size="1"></yGoods>
</wd-form-item>
<div style="display: flex;flex-direction: column;">
<wd-datetime-picker v-model="dataForm.start_time" label="开始时间" />
<wd-datetime-picker v-model="dataForm.end_time" label="结束时间" />
</div>
<!-- 是否启用 -->
<wd-form-item label="是否启用:" prop="status">
<wd-switch v-model="dataForm.status" :active-value="1" :inactive-value="0"></wd-switch>
</wd-form-item>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import { ref } from 'vue';
import yGoods from "@/components/yGoods/index.vue";
import uniDataPicker from "@/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import userMembers from '@/api/store/userMembers.js';
import { useApi } from "@/hooks/useApi.js"
import discountApi from '@/api/store/discount.js';
import yUpload from "@/components/yUpload/index.vue";
console.log(yGoods);
/**
* 从本地存储中获取用户信息
*/
const user_info = uni.getStorageSync("user_info");
export default {
components: {
yGoods, uniDataPicker, kevyloading, yUpload
},
data() {
return {
utils,
user_info,
//
dataForm: {
"id": 0,
},
columns: [],
loading: false
};
},
onLoad(e) {
if (e.id) {
this.getData(e.id)
// this.dataForm = JSON.parse(e.edit)
// this.dataForm.start_time = new Date(this.dataForm.start_time * 1000)
// this.dataForm.end_time = new Date(this.dataForm.end_time * 1000)
// console.log(this.dataForm);
} else {
this.dataForm.start_time = new Date()
this.dataForm.end_time = new Date()
}
for (let index = 1; index <= 100; index++) {
this.columns.push(index)
}
},
methods: {
async getData(id) {
const { fetchData } = await useApi(discountApi.SalesFullSetRedution.GetItem)
fetchData({ id }).then(res => {
console.log(res);
this.dataForm = res.data
this.dataForm.deatil = res.data.deatil.filter(item => item)
this.dataForm.start_time = new Date(res.data.start_time * 1000)
this.dataForm.end_time = new Date(res.data.end_time * 1000)
})
},
/**
* 处理省市区选择变化
* @param {Object} value - 选择的值
*/
areaChange(value) {
//
},
/**
* 处理省市区选择
* @param {Object} detail - 选择器详细信息
*/
select({ detail }) {
if (detail.value.length) {
const [province_id, city_id, district_id] = detail.value.map(
(el) => el.value
);
this.datadataForm.province_id = province_id;
this.datadataForm.city_id = city_id;
this.datadataForm.district_id = district_id;
this.datadataForm.district = [province_id, city_id, district_id];
}
},
/**
* 处理表单提交
*/
async handleSubmit() {
console.log(this.dataForm.deatil.map(item => [item.id]));
//
const res = await discountApi.SalesFullSetRedution.Create({
...this.dataForm,
start_time: utils.dateFormat(this.dataForm.start_time),
end_time: utils.dateFormat(this.dataForm.end_time),
mix_id_list: this.dataForm.deatil.map(item => [item.id])
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
uni.navigateBack()
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -0,0 +1,247 @@
<template>
<view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<!-- <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="coupon_info?.info?.name || '商城首页'">
<template #right>
<wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon>
</template>
</wd-navbar>
</view> -->
<view class=" bg-white sticky top-0 z-50 flex items-center">
<view class="flex-1">
<wd-search @search="search" @clear="search" v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/discount/full_set_redution/edit')" size="small">新增折扣</wd-button>
</view>
<!-- <view class="mr-2">
<wd-button @click="utils.toUrl('/store/coupon/userCoupon')" size="small">领取记录</wd-button>
</view> -->
</view>
<!-- <view class="flex-1 bg-white pb-2">
<div class="rounded-md overflow-hidden">
<wd-tabs @change="search">
<wd-tab :title="`全部`" :name="null"></wd-tab>
<wd-tab :title="`领取后过期`" :name="0"></wd-tab>
<wd-tab :title="`定时过期`" :name="1"></wd-tab>
</wd-tabs>
</div>
</view> -->
<view class="grid p-2">
<yList height="91vh" ref="yListRef" :apiObj="discountApi.SalesFullSetRedution.List" :params="{ ...params }">
<template #default="{ list }">
<view>
<view v-for="item of list" class="goods">
<wd-card type="rectangle">
<template #title>
<view class="title">
<view>
<span class="mr-2">ID{{ item?.id }}</span>
</view>
<!-- <view @click="utils.copy(item.order_no, '已复制单号')" class="title-tip">
<span style="font-size: 24rpx;margin-left: 8px;">单号{{ item.order_no }}</span>
</view> -->
</view>
</template>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>折扣名称<text class="text-black">{{ item.name }}</text></view>
<view>满减金额<text class="text-black">{{ item.full_price || 0 }}</text></view>
<view>折扣<text class="text-black">{{ item.discount || 0 }}</text></view>
</view>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>
时间
<wd-tag type="primary">{{ utils.dateFormat(item.start_time * 1000) }}</wd-tag> - <wd-tag>{{
utils.dateFormat(item.end_time * 1000) }}</wd-tag>
</view>
</view>
<template #footer>
<!-- <view class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;">
<view>
售后状态:
</view>
</view> -->
<view class="flex justify-between items-center">
<!-- <view class="font-bold">实付: {{ item.pay_price }} </view> -->
<view>
<wd-button :round="false" size="small"
:type="['warning', 'success', 'warning', 'success', 'info'][item.status]">
<div>{{ ["关闭", "开启", "已取消"][item.status] }}</div>
</wd-button>
</view>
<view class="flex-1 flex justify-end">
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/discount/full_set_redution/edit?id=' + item.id)"
size="small">编辑</wd-button>
</view>
<!-- <view v-if="item.apply_cancel === 1" class="mr-2">
<wd-button type="error" @click="orderApproval(item)" size="small">退款</wd-button>
</view>
<view class="mr-2">
<wd-button @click="printing(item)" size="small">小票打印</wd-button>
</view>
<view class="mr-2">
<wd-button @click="orderNotes(item)" size="small">备注</wd-button>
</view>
<view v-if="item.status == 1" class="">
<wd-button @click="shipments(item)" size="small">发货</wd-button>
</view> -->
</view>
</view>
</template>
</wd-card>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
<wd-message-box></wd-message-box>
</view>
</template>
<script setup>
import { ref, nextTick } from 'vue';
import utils from '@/utils/utils.js';
import discountApi from '@/api/store/discount.js';
import kevyloading from "@/components/kevy-loading/kevy-loading";
import yList from "/components/yList/index.vue";
import {
onShow,
} from "@dcloudio/uni-app";
const yListRef = ref(null);
const searchType = ref('折扣名称');
const popover = ref(false);
const search = () => {
if (searchType.value == '折扣名称') {
yListRef.value?.upData({
name: params.value.keywords,
});
} else if (searchType.value == '折扣') {
yListRef.value?.upData({
discount: params.value.keywords
});
}
};
const menu = ref([
{ content: '折扣名称' },
{ content: '折扣' },
]);
const params = ref({
name: null,
price: null,
send_type: null
});
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
search(params.value.keywords)
}
/**
* @type {Ref<boolean>}
* 控制页面加载状态的 Ref
*/
const loading = ref(false);
//
onShow(() => {
search?.()
// search('')
// getcouponList();
})
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 16px;
font-size: 24rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.couponBox,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.couponBox {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
</style>

@ -0,0 +1,187 @@
<template>
<view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="px-2 my-2">
<div class="relative flex flex-col rounded-md bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-emerald-400"></span>
基础功能
</div>
</div>
<view class="grid grid-cols-3 gap-3">
<div @click="utils.toUrl('/store/cat/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品分类
</div>
<div @click="utils.toUrl('/store/goods/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品管理
</div>
</view>
</div>
</view>
<view class="px-2 my-2">
<div class="relative flex flex-col rounded-md bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-yellow-600"></span>
订单管理
</div>
</div>
<view class="grid grid-cols-3 gap-3">
<div @click="utils.toUrl('/store/order/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
普通订单
</div>
<div @click="utils.toUrl('/store/afterSale/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
售后订单
</div>
<div @click="utils.toUrl('/store/inpersonPay/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
当面付订单
</div>
</view>
</div>
</view>
<view class="px-2 my-2">
<div class="relative flex flex-col rounded-md bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-stone-800"></span>
折扣管理
</div>
</div>
<view class="grid grid-cols-2 gap-3">
<div @click="utils.toUrl('/store/discount/discount/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
限时折扣
</div>
<div @click="utils.toUrl('/store/discount/full_discount/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
梯度折扣
</div>
<div @click="utils.toUrl('/store/discount/full_set_redution/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
满额立减
</div>
<!-- <div class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
套餐优惠
</div> -->
</view>
</div>
</view>
<view class="px-2 my-2">
<div class="relative flex flex-col rounded-md bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-violet-700"></span>
更多功能
</div>
</div>
<view class="grid grid-cols-2 gap-3">
<div @click="utils.toUrl('/store/coupon/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
优惠券
</div>
<div @click="utils.toUrl('/store/check/list')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
核销记录
</div>
<div @click="utils.toUrl('/store/user/list')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
会员管理
</div>
<div @click="utils.toUrl('/store/user/memberList')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
会员等级
</div>
</view>
</div>
</view>
<view class="bg-transparent h-[80px]"></view>
<view class="fixed left-2 right-2 bottom-4 z-50">
<myTabbar tab="function"></myTabbar>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import utils from '@/utils/utils.js';
import index from '@/api/store/index.js';
import myTabbar from "../components/myTabbar/index.vue";
import bar from "../components/bar/bar.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
/**
* @type {Ref<boolean>}
* 控制页面加载状态的 Ref
*/
const loading = ref(false);
/**
* 从本地存储中获取用户信息
*/
const store_info = uni.getStorageSync("store_info");
</script>
<style lang="scss" scoped>
.content {}
</style>

@ -19,7 +19,7 @@
</view> </view>
<div class="goodsBox p-2"> <div class="goodsBox p-2">
<yList height="78vh" ref="yListRef" :apiObj="goods.list" :params="{ ...params, classify_id }"> <yList height="78vh" ref="yListRef" :apiObj="goodsApi.list" :params="{ ...params, classify_id }">
<template #default="{ list }"> <template #default="{ list }">
<div> <div>
<div v-for="item of list" class="goods"> <div v-for="item of list" class="goods">
@ -48,7 +48,9 @@
style="margin-right: 8px;">下架</wd-button> style="margin-right: 8px;">下架</wd-button>
<wd-button @click="changeS(item)" v-if="item.status !== 1" size="small" <wd-button @click="changeS(item)" v-if="item.status !== 1" size="small"
style="margin-right: 8px;">上架</wd-button> style="margin-right: 8px;">上架</wd-button>
<wd-button @click="utils.toUrl('/store/goods/edit?id=' + item.id)" size="small">编辑</wd-button> <wd-button style="margin-right: 8px;" @click="utils.toUrl('/store/goods/edit?id=' + item.id)"
size="small">编辑</wd-button>
<wd-button type="error" @click="delGoods(item)" size="small">删除</wd-button>
</view> </view>
</template> </template>
</wd-card> </wd-card>
@ -65,6 +67,7 @@
</div> </div>
<wd-toast /> <wd-toast />
<wd-message-box></wd-message-box>
</view> </view>
</template> </template>
@ -72,8 +75,11 @@
import { ref } from 'vue' import { ref } from 'vue'
import { useToast } from '@/uni_modules/wot-design-uni' import { useToast } from '@/uni_modules/wot-design-uni'
import yList from "/components/yList/index.vue" import yList from "/components/yList/index.vue"
import goods from '@/api/store/goods.js' import goodsApi from '@/api/store/goods.js'
import utils from '@/utils/utils.js' import utils from '@/utils/utils.js'
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useApi } from "@/hooks/useApi.js"
const message = useMessage();
import { import {
onLoad, onLoad,
@ -132,8 +138,10 @@ function changeSearchType({ item, index }) {
}) })
} }
const changeS = (row) => { const changeS = async (row) => {
goods.goodsEditAttribute({ const { fetchData } = await useApi(goodsApi.goodsEditAttribute)
fetchData({
id: row.id, id: row.id,
value: [1, 0][row.status], value: [1, 0][row.status],
type: "status" type: "status"
@ -143,15 +151,41 @@ const changeS = (row) => {
toast.success('操作成功') toast.success('操作成功')
row.status = [1, 0][row.status] row.status = [1, 0][row.status]
} else { } else {
showNotify({ type: 'error', message: '出错了' }) toast.error('出错了')
} }
}) })
} }
const delGoods = (row) => {
message
.confirm({
title: '删除商品',
})
.then(async (resp) => {
const { fetchData } = await useApi(goodsApi.goodsDel)
fetchData({
id: row.id,
}).then(res => {
if (res.code == 0) {
toast.success('操作成功')
search({ value: params.value.keywords })
} else {
toast.error('出错了')
}
})
})
.catch((error) => {
console.log(error);
});
}
const classifyList = ref([]) const classifyList = ref([])
const getClassify = () => { const getClassify = () => {
goods.classify.list().then(res => { goodsApi.classify.list().then(res => {
classifyList.value = res.data classifyList.value = res.data
classifyList.value.unshift({ classifyList.value.unshift({
id: 0, id: 0,

@ -3,10 +3,20 @@
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="w-full"> <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="user_info?.info?.name || '商城首页'"> <wd-navbar fixed safeAreaInsetTop>
<template #right> <template #right>
<wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon> <wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon>
</template> </template>
<template #left>
<view class="flex items-center">
{{ store_info?.info?.name + ' [ 商城 ]' || '商城首页' }}
</view>
</template>
</wd-navbar> </wd-navbar>
</view> </view>
@ -14,7 +24,7 @@
<view @click="utils.toUrl('/store/user/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <view @click="utils.toUrl('/store/user/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">用户管理</view> <view class="font-bold">会员管理</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view> <view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end"> <view class="flex justify-end">
@ -24,31 +34,6 @@
</view> </view>
</view> </view>
<!-- <view @click="utils.toUrl('/store/user/memberList')"
class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">等级管理</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="layers opacity-80" class="opacity-80" size="42px"></wd-icon>
</div>
</view>
</view> -->
<view @click="utils.toUrl('/store/cat/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">分类管理</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="chat opacity-80" class="opacity-80" size="42px"></wd-icon>
</div>
</view>
</view>
<view @click="utils.toUrl('/store/goods/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <view @click="utils.toUrl('/store/goods/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">商品管理</view> <view class="font-bold">商品管理</view>
@ -61,18 +46,6 @@
</view> </view>
</view> </view>
<view @click="utils.toUrl('/store/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">订单管理</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="gift opacity-80" class="opacity-80" size="42px"></wd-icon>
</div>
</view>
</view>
<view @click="utils.toUrl('/store/check/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <view @click="utils.toUrl('/store/check/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">核销记录</view> <view class="font-bold">核销记录</view>
@ -80,45 +53,14 @@
<view class="flex justify-end"> <view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5"> <div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="phone" class="opacity-80" size="42px"></wd-icon> <wd-icon name="lenovo opacity-80" class="opacity-80" size="42px"></wd-icon>
</div>
</view>
</view>
<view @click="utils.toUrl('/store/inpersonPay/index')"
class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">当面付订单</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="phone" class="opacity-80" size="42px"></wd-icon>
</div> </div>
</view> </view>
</view> </view>
<!-- <view @click="utils.toUrl('/store/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">订单管理</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="gift opacity-80" size="42px"></wd-icon>
</div>
</view>
</view> -->
</view> </view>
<view style="transition: 1s;" class="w-full h-full bg-white pt-4 rounded-tr-3xl rounded-tl-3xl shadow-lg oh"> <view style="transition: 1s;" class="w-full h-full bg-white pt-2 rounded-tr-2xl rounded-tl-2xl shadow-lg oh">
<view class="order mb-2"> <view class="order mb-2">
<wd-grid v-show="oneLine.ok"> <wd-grid v-show="oneLine.ok">
<wd-grid-item @click="utils.toUrl('/store/user/list')" icon="round" :text="`用户 (${oneLine.user_count})`" /> <wd-grid-item @click="utils.toUrl('/store/user/list')" icon="round" :text="`用户 (${oneLine.user_count})`" />
@ -214,7 +156,7 @@ const loading = ref(false);
/** /**
* 从本地存储中获取用户信息 * 从本地存储中获取用户信息
*/ */
const user_info = uni.getStorageSync("user_info"); const store_info = uni.getStorageSync("store_info");
/** /**
* @type {Ref<Object>} * @type {Ref<Object>}

@ -82,7 +82,7 @@
</view> </view>
</template> </template>
<view v-for="subItem of item.details" style="height: 60px;" class="content mb-4"> <view v-for="subItem of item.details" class="content mb-4">
<image :src="subItem.goods_pic" width="40" height="40" alt="joy" <image :src="subItem.goods_pic" width="40" height="40" alt="joy"
style="border-radius: 4px; margin-right: 12px;width: 60px;height: 60px;min-width: 60px;" /> style="border-radius: 4px; margin-right: 12px;width: 60px;height: 60px;min-width: 60px;" />
<view> <view>

@ -0,0 +1,121 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form ref="form" :model="formData" :rules="formRules">
<!-- 基础信息 -->
<wd-cell-group title="充值方案" border>
<wd-input label="充值名称" v-model="formData.name" />
<wd-cell-group title="支付金额" border>
<view class="p-4">
<wd-input-number v-model="formData.money" min="0" />
</view>
</wd-cell-group>
<wd-cell-group title="赠送金额" border>
<view class="p-4">
<wd-input-number v-model="formData.gift_money" min="0" />
</view>
</wd-cell-group>
</wd-cell-group>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import rechargeApi from '@/api/store/recharge.js'
export default {
components: {
kevyloading
},
data() {
return {
utils,
//
formData: {
"name": "", //
"money": "", //
"gift_money": "", //
},
//
formRules: {
//
},
//
addrList: [
//
],
classifyList: [],
loading: false
};
},
async onLoad(e) {
// this.getDistrict();
if (e.edit) {
this.formData = JSON.parse(e.edit)
}
// this.formData = JSON.parse(e.edit)
},
methods: {
/**
* 处理表单提交
*/
async handleSubmit() {
console.log(this.formData);
try {
//
const res = await rechargeApi.save({
...this.formData,
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
uni.navigateBack()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
} catch (error) {
console.log(error);
setTimeout(() => {
uni.showToast({
title: '请检查表单!',
icon: 'none'
});
}, 100);
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -0,0 +1,252 @@
<template>
<view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="justify-center sticky top-0 z-50 grid items-center py-3 w-full gap-3 grid-cols-3">
<view @click="utils.toUrl('/store/recharge/edit')"
class="text-white rounded-r-3xl p-4 px-3 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to left, #b5b5b5 0%, rgb(110, 114, 125) 100%);">
<view class="font-bold"> 添加充值方案 </view>
</view>
<view @click="utils.toUrl('/store/recharge/userRecharge')"
class="text-white rounded-3xl p-4 shadow-lg overflow-hidden text-center"
style="background-image: linear-gradient(to top, #b5b5b5 0%, rgb(110, 114, 125) 100%);">
<view class="font-bold"> 充值记录 </view>
</view>
<view @click="utils.toUrl('/store/recharge/setUp')"
class="text-center text-white rounded-l-3xl p-4 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #b5b5b5 0%, rgb(110, 114, 125) 100%);">
<view class="font-bold"> 设置 </view>
</view>
</view>
<!-- <view class="flex-1 bg-white pb-2">
<div class="rounded-md overflow-hidden">
<wd-tabs @change="search">
<wd-tab :title="`全部`" :name="null"></wd-tab>
<wd-tab :title="`领取后过期`" :name="0"></wd-tab>
<wd-tab :title="`定时过期`" :name="1"></wd-tab>
</wd-tabs>
</div>
</view> -->
<view class="grid p-2">
<yList height="91vh" ref="yListRef" noPageSize :apiObj="recharge.List" :params="{ ...params }">
<template #default="{ list: rechargeList }">
<view class="flex flex-col">
<view v-for="recharge of rechargeList" class="overflow-hidden relative">
<wd-swipe-action class="rounded-xl overflow-hidden mb-3 ">
<view class="rechargeCart relative"
style="background-image: linear-gradient(to bottom, #b5b5b5 0%, rgb(110, 114, 125) 100%);">
<view class="relative px-4 py-4" style="z-index: 1;">
<view
class="rounded-r-xl font-bold absolute top-0 left-0 px-3 py-1 text-[12px] bg-neutral-900 text-orange-500 z-30">
ID: {{ recharge.id }}
</view>
<view class="flex">
<view class="mt-4 mr-6">
<!-- <view class="price text-[16px] text-orange-300">
</view> -->
<view class="leading-4 mt-1">
<view class="price mb-1 text-[14px] text-orange-300">
{{ recharge.name }}
</view>
<div class="flex flex-col">
<view class="price text-white text-[12px] mr-4">
支付金额 {{ recharge.money }}
</view>
<view class="price text-white text-[12px]">
赠送金额 {{ recharge.gift_money }}
</view>
</div>
</view>
</view>
</view>
</view>
</view>
<template #right>
<view class="flex h-full ">
<view class="px-4 text-nowrap h-full bg-stone-700 text-white flex items-center justify-center">
<view @click="utils.toUrl('/store/recharge/edit?edit=' + JSON.stringify(recharge))" style="writing-mode: vertical-rl;
text-orientation: upright;">
编辑
</view>
</view>
<view class="px-4 text-nowrap h-full bg-stone-800 text-white flex items-center justify-center">
<view @click="utils.toUrl('/store/recharge/edit?id=' + recharge.id)" style="writing-mode: vertical-rl;
text-orientation: upright;">
删除
</view>
</view>
</view>
</template>
</wd-swipe-action>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
<wd-message-box></wd-message-box>
</view>
</template>
<script setup>
import { ref, nextTick } from 'vue';
import utils from '@/utils/utils.js';
import recharge from '@/api/store/recharge.js';
import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni'
import yList from "/components/yList/index.vue";
import {
onShow,
} from "@dcloudio/uni-app";
const yListRef = ref(null);
const searchType = ref('券名');
const popover = ref(false);
const search = ({ value } = {}) => {
if (searchType.value == '券名') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '券金额') {
yListRef.value.upData({
price: params.value.keywords
});
} else {
yListRef.value.upData({});
}
};
const menu = ref([
{ content: '券名' },
{ content: '券金额' },
]);
const params = ref({
name: null,
price: null,
send_type: null
});
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
search(params.value.keywords)
}
/**
* @type {Ref<boolean>}
* 控制页面加载状态的 Ref
*/
const loading = ref(false);
const formatOfTime = (theTimeStamp) => {
const date = new Date(theTimeStamp * 1000); //
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}`;
}
//
onShow(() => {
nextTick(() => {
search({ value: params.value.keywords = '' })
})
// search('')
// getrechargeList();
})
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 16px;
font-size: 24rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.rechargeBox,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.rechargeBox {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
</style>

@ -0,0 +1,137 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form ref="form" :model="formData" :rules="formRules">
<view class="p-3 bg-white rounded mb-2">
<div class="name mb-2 text-xs">开启自定义金额</div>
<view class="bg-white px-3 py-2 rounded flex items-center">
<wd-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
</view>
</view>
<div class="mb-2">
<!-- 广告图片 -->
<wd-cell-group class="flex py-2 w-full" title="广告图片">
<view class="ml-3">
<yUpload v-model="formData.adv_img" :size="1"></yUpload>
</view>
</wd-cell-group>
<!-- 充值说明图标 -->
<wd-cell-group class="flex py-2 w-full" title="充值说明图标">
<view class="ml-3">
<yUpload v-model="formData.icon" :size="1"></yUpload>
</view>
</wd-cell-group>
</div>
<!-- 基础信息 -->
<wd-cell-group title="基础信息" border>
<wd-input label="充值说明" v-model="formData.tip" />
</wd-cell-group>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import rechargeApi from '@/api/store/recharge.js'
import yUpload from "@/components/yUpload/index.vue";
export default {
components: {
kevyloading, yUpload
},
data() {
return {
utils,
//
formData: {
"adv_url": "", //
},
//
formRules: {
//
},
//
addrList: [
//
],
classifyList: [],
loading: false
};
},
async onLoad(e) {
this.getData();
if (e.edit) {
this.formData = JSON.parse(e.edit)
}
},
methods: {
async getData() {
const res = await rechargeApi.rechargeSet.list({
...this.formData,
});
this.formData = res.data || {}
},
/**
* 处理表单提交
*/
async handleSubmit() {
console.log(this.formData);
try {
//
const res = await rechargeApi.rechargeSet.save({
...this.formData,
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
// uni.navigateBack()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
} catch (error) {
console.log(error);
setTimeout(() => {
uni.showToast({
title: '请检查表单!',
icon: 'none'
});
}, 100);
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -0,0 +1,162 @@
<template>
<view class="content">
<view class="goodsBox p-2">
<yList ref="yListRef" :apiObj="rechargeApi.recharge_list" :params="{ ...params }">
<template #default="{ list }">
<view>
<view v-for="item of list" class="goods">
<wd-card type="rectangle">
<template #title>
<view class="title">
<view>
<view>ID<text class="text-black">{{ item.id || 0 }}</text></view>
</view>
<view class="title-tip">
<span style="font-size: 24rpx;margin-left: 8px;">订单号{{ item.order_no }}</span>
</view>
</view>
</template>
<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
<view>充值用户<text class="text-black">{{ item?.user?.nickname }}</text></view>
<view>充值时间<text class="text-black">{{ item?.create_time }}</text></view>
</view>
<template #footer>
<!-- <view class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;">
<view>
售后状态:
</view>
</view> -->
<view class="flex w-full">
<view class="bg-gray-50 p-2 mb-2 flex flex-1 justify-between" style="font-size: 22rpx;">
<view>支付金额<text class="text-red-600"> {{ item.pay_price || 0 }}</text></view>
<view>赠送金额<text class="text-red-600"> {{ item.gift_money || 0 }}</text></view>
</view>
</view>
</template>
</wd-card>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
</view>
</template>
<script setup>
import rechargeApi from '@/api/store/recharge.js';
import yList from "/components/yList/index.vue";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni';
import { ref } from 'vue';
const params = ref({
keywords: "",
coupon_type: 0,
});
const yListRef = ref(null);
const search = ({ value }) => {
yListRef.value.upData({
keywords: value,
coupon_type: params.value.coupon_type
});
};
const searchType = ref('券名');
const popover = ref(false);
const status = ref([
{ content: '全部' },
{ content: '商品' },
{ content: '分类' },
{ content: '当面付' },
]);
const menu = ref([
{ content: '券名' },
{ content: '券金额' },
]);
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
if (searchType.value == '券名') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '券金额') {
yListRef.value.upData({
price: params.value.keywords
});
} else {
yListRef.value.upData({});
}
}
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 10px;
font-size: 22rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.goodsBox {
.content,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.content {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
}
</style>

@ -3,7 +3,7 @@
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="w-full mb-12"> <view class="w-full mb-12">
<wd-navbar fixed safeAreaInsetTop :leftText="user_info?.info?.name || '商城设置'"> <wd-navbar fixed safeAreaInsetTop :leftText="store_info?.info?.name || '商城设置'">
<template #right> <template #right>
<view @click="utils.loginOut()"> <view @click="utils.loginOut()">
退出登录 退出登录
@ -150,7 +150,7 @@ import utils from '@/utils/utils.js'
/** /**
* 从本地存储中获取用户信息 * 从本地存储中获取用户信息
*/ */
const user_info = uni.getStorageSync("user_info"); const store_info = uni.getStorageSync("store_info");
export default { export default {
components: { components: {
@ -159,7 +159,7 @@ export default {
data() { data() {
return { return {
utils, utils,
user_info, store_info,
// //
storeData: { storeData: {
name: '', name: '',

@ -1,13 +1,6 @@
<template> <template>
<view class="content"> <view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<!-- <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="user_info?.info?.name || '商城首页'">
<template #right>
<wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon>
</template>
</wd-navbar>
</view> -->
<div class="grid p-2"> <div class="grid p-2">
<div v-for="shop of shopList" class="rounded-md overflow-hidden"> <div v-for="shop of shopList" class="rounded-md overflow-hidden">
@ -38,7 +31,12 @@
<wd-button @click="changeS(shop)" v-if="shop.status !== 1" size="small" plain style="margin-right: 8px;"> <wd-button @click="changeS(shop)" v-if="shop.status !== 1" size="small" plain style="margin-right: 8px;">
开启</wd-button> 开启</wd-button>
<wd-button @click="utils.toUrl('/store/shop/edit?edit=' + JSON.stringify(shop))" size="small" <wd-button @click="utils.toUrl('/store/shop/edit?edit=' + JSON.stringify(shop))" size="small"
style="margin-right: 0px;">编辑</wd-button> style="margin-right: 8px;">编辑</wd-button>
<!-- /store/shop/to -->
<wd-button @click="utils.toUrl('/store/shop/to?shop=' + JSON.stringify(shop))" size="small"
style="margin-right: 0px;">管理</wd-button>
<!-- <wd-button @click="tableLogin(shop.id)" size="small" style="margin-right: 0px;">管理</wd-button> -->
</view> </view>
</view> </view>
@ -63,6 +61,7 @@
import { ref } from 'vue'; import { ref } from 'vue';
import utils from '@/utils/utils.js'; import utils from '@/utils/utils.js';
import shop from '@/api/store/shop.js'; import shop from '@/api/store/shop.js';
import system from '@/api/modules/system.js';
import myTabbar from "../components/myTabbar/index.vue"; import myTabbar from "../components/myTabbar/index.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading"; import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni'; import { useMessage } from '@/uni_modules/wot-design-uni';
@ -106,7 +105,6 @@ const changeS = async (row) => {
}) })
} }
}) })
} }
const syncGoods = (row) => { const syncGoods = (row) => {
@ -132,7 +130,6 @@ const syncGoods = (row) => {
}); });
}; };
/** /**
* 获取数据的函数 * 获取数据的函数
*/ */
@ -145,6 +142,33 @@ const getShopList = () => {
}); });
}; };
const tableLogin = async (id) => {
console.log(system);
try {
const res = await system.loginShop({
shop_id: id
});
if (res.code === 0) {
uni.setStorageSync("mall_token", res.data.access_token);
uni.setStorageSync("mall_info", res.data.user_info);
// uni.showToast({
// icon: "none",
// title: "",
// });
utils.toUrl("/mall/index/index")
} {
uni.showToast({
title: menu.message,
icon: "none"
});
return false;
}
} catch (error) {
return false;
}
}
// //
onShow(() => { onShow(() => {
getShopList(); getShopList();

@ -0,0 +1,121 @@
<template>
<view class="content flex items-center justify-center">
<div class="logo flex flex-col animate-twinkle">
<view class="rounded-3xl overflow-hidden">
<wd-img :width="100" :height="100" :src="shop.logo_url" />
</view>
<text class="flex p-2 text-center justify-center">
{{ shop.name }}
</text>
</div>
<wd-toast />
<wd-message-box></wd-message-box>
</view>
</template>
<script setup>
import { ref } from 'vue';
import utils from '@/utils/utils.js';
import system from '@/api/modules/system.js';
import myTabbar from "../components/myTabbar/index.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni'
import { useApi } from "@/hooks/useApi.js"
const toast = useToast()
const message1 = useMessage();
import {
onShow, onLoad
} from "@dcloudio/uni-app";
const shop = ref({})
onLoad((opt) => {
const tableLogin = async (id) => {
try {
const res = await system.loginShop({
shop_id: id
});
if (res.code === 0) {
uni.setStorageSync("mall_token", res.data.access_token);
uni.setStorageSync("mall_info", res.data.user_info);
// uni.showToast({
// icon: "none",
// title: "",
// });
utils.toUrl("/mall/index/index", 'redirectTo')
} {
uni.showToast({
title: menu.message,
icon: "none"
});
return false;
}
} catch (error) {
return false;
}
}
shop.value = JSON.parse(opt.shop)
setTimeout(() => {
tableLogin(shop.value.id)
}, 1000);
})
//
onShow(() => {
// getShopList();
})
</script>
<style lang="scss" scoped>
.shopBox,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.shopBox {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
@keyframes twinkling {
0% {
opacity: 1;
}
50% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}
.animate-twinkle {
animation: twinkling 1s infinite;
}
</style>

@ -25,7 +25,8 @@
v {{ userInfo.user_merge.member_level }} v {{ userInfo.user_merge.member_level }}
</wd-tag> </wd-tag>
<wd-button type="warning" @click="showLv = true" size="small" style="margin-left: 10px;">修改等级</wd-button> <wd-button v-if="userInfo.user_merge" type="warning" @click="showLv = true" size="small"
style="margin-left: 10px;">修改等级</wd-button>
</view> </view>
<view style="color: rgba(0,0,0,0.25); font-size: 12px;"> <view style="color: rgba(0,0,0,0.25); font-size: 12px;">

@ -20,7 +20,7 @@
</wd-form-item> </wd-form-item>
<wd-form-item label="等级名称" prop="name"> <wd-form-item label="等级名称" prop="name">
<wd-input v-model="dataForm.name" placeholder="请输入分类名称"></wd-input> <wd-input v-model="dataForm.name" placeholder="请输入等级名称"></wd-input>
</wd-form-item> </wd-form-item>
<wd-form-item label="升级条件" prop="money"> <wd-form-item label="升级条件" prop="money">
<wd-input placeholder="请输入内容" v-model.number="dataForm.money" use-prefix-slot use-suffix-slot> <wd-input placeholder="请输入内容" v-model.number="dataForm.money" use-prefix-slot use-suffix-slot>

@ -31,7 +31,7 @@
<div class="grid p-2"> <div class="grid p-2">
<yList height="86vh" ref="yListRef" :apiObj="user.userList" :params="{ ...params }"> <yList height="91vh" ref="yListRef" :apiObj="user.userList" :params="{ ...params }">
<template #default="{ list: userList }"> <template #default="{ list: userList }">
<div v-for="user of userList" class="rounded-md overflow-hidden"> <div v-for="user of userList" class="rounded-md overflow-hidden">
<wd-card class="rounded-md overflow-hidden" type="rectangle"> <wd-card class="rounded-md overflow-hidden" type="rectangle">
@ -95,10 +95,10 @@
</div> </div>
<view class="h-[64px]"></view> <!-- <view class="h-[64px]"></view>
<view class="fixed left-2 right-2 bottom-4 z-50"> <view class="fixed left-2 right-2 bottom-4 z-50">
<myTabbar tab="user"></myTabbar> <myTabbar tab="user"></myTabbar>
</view> </view> -->
<wd-toast /> <wd-toast />
<wd-message-box></wd-message-box> <wd-message-box></wd-message-box>

@ -21,32 +21,32 @@ $uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d; $uni-color-error: #dd524d;
/* 文字基本颜色 */ /* 文字基本颜色 */
$uni-text-color:#333;// $uni-text-color: #333; //
$uni-text-color-inverse:#fff;// $uni-text-color-inverse: #fff; //
$uni-text-color-grey:#999;// $uni-text-color-grey: #999; //
$uni-text-color-placeholder: #808080; $uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0; $uni-text-color-disable: #c0c0c0;
/* 背景颜色 */ /* 背景颜色 */
$uni-bg-color:#ffffff; $uni-bg-color: #ffffff;
$uni-bg-color-grey:#f8f8f8; $uni-bg-color-grey: #f8f8f8;
$uni-bg-color-hover:#f1f1f1;// $uni-bg-color-hover: #f1f1f1; //
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);// $uni-bg-color-mask: rgba(0, 0, 0, 0.4); //
/* 边框颜色 */ /* 边框颜色 */
$uni-border-color:#c8c7cc; $uni-border-color: #c8c7cc;
/* 尺寸变量 */ /* 尺寸变量 */
/* 文字尺寸 */ /* 文字尺寸 */
$uni-font-size-sm:12px; $uni-font-size-sm: 12px;
$uni-font-size-base:14px; $uni-font-size-base: 14px;
$uni-font-size-lg:16px; $uni-font-size-lg: 16px;
/* 图片尺寸 */ /* 图片尺寸 */
$uni-img-size-sm:20px; $uni-img-size-sm: 20px;
$uni-img-size-base:26px; $uni-img-size-base: 26px;
$uni-img-size-lg:40px; $uni-img-size-lg: 40px;
/* Border Radius */ /* Border Radius */
$uni-border-radius-sm: 2px; $uni-border-radius-sm: 2px;
@ -69,8 +69,8 @@ $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */ /* 文章场景相关 */
$uni-color-title: #2C405A; // $uni-color-title: #2C405A; //
$uni-font-size-title:20px; $uni-font-size-title: 20px;
$uni-color-subtitle: #555555; // $uni-color-subtitle: #555555; //
$uni-font-size-subtitle:26px; $uni-font-size-subtitle: 26px;
$uni-color-paragraph: #3F536E; // $uni-color-paragraph: #3F536E; //
$uni-font-size-paragraph:15px; $uni-font-size-paragraph: 15px;

@ -1,18 +1,33 @@
## 0.2.112024-01-09 ## 0.2.132024-01-12
### [0.2.11](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.10...v0.2.11) (2024-01-09) ### [0.2.13](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.12...v0.2.13) (2024-01-12)
### Bug Fixes | Bug 修复 ### Bug Fixes | Bug 修复
* 修复 Overlay 类型声明错误的问题 ([930e59a](https://github.com/Moonofweisheng/wot-design-uni/commit/930e59a9b09aee535ec4c316e44ed3c0e31be628)) * 修复演示文档刷新后指向localhost的问题 ([4cd8b16](https://github.com/Moonofweisheng/wot-design-uni/commit/4cd8b16bdf5ea8e93cff85396025844e9ebd031c))
# 更新日志
### Documentation | 文档 ### [0.2.13](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.12...v0.2.13) (2024-01-12)
* 提供托管在Giteee上的文档网站 ([6d62e9e](https://github.com/Moonofweisheng/wot-design-uni/commit/6d62e9e7ddda0bd9f51f2ad9e2893f1ed3709c63))
# 更新日志 ### 🐛 Bug Fixes | Bug 修复
* 🐛 修复演示文档刷新后指向localhost的问题 ([4cd8b16](https://github.com/Moonofweisheng/wot-design-uni/commit/4cd8b16bdf5ea8e93cff85396025844e9ebd031c))
### [0.2.12](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.11...v0.2.12) (2024-01-11)
### 🐛 Bug Fixes | Bug 修复
* 🐛 修复 Tabbar 错误地抛出提示信息的问题 ([1c89ed0](https://github.com/Moonofweisheng/wot-design-uni/commit/1c89ed0a7158e79556e83c6aeb89bd1e93e4ea0d))
### ✏️ Documentation | 文档
* ✏️ 增加 Circle 组件使用插槽的示例 ([6341594](https://github.com/Moonofweisheng/wot-design-uni/commit/6341594295732dac951c465d95537f36addbbf9c))
* ✏️ 增加展示gitee的star徽标 ([1abf962](https://github.com/Moonofweisheng/wot-design-uni/commit/1abf962e37e27c1c1688bed2026c66022e63ce9b))
### [0.2.11](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.10...v0.2.11) (2024-01-09) ### [0.2.11](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.10...v0.2.11) (2024-01-09)

@ -51,8 +51,6 @@ interface Props {
customClass?: string customClass?: string
// style // style
customStyle?: string customStyle?: string
//
rate?: number | string
// px // px
size?: number size?: number
// //
@ -80,16 +78,12 @@ const props = withDefaults(defineProps<Props>(), {
customClass: '', customClass: '',
// style // style
customStyle: '', customStyle: '',
//
rate: 100,
// px // px
size: 100, size: 100,
// //
color: '#4d80f0', color: '#4d80f0',
// //
layerColor: '#EBEEF5', layerColor: '#EBEEF5',
//
fill: '#ffffff',
// rate/s // rate/s
speed: 50, speed: 50,
// px // px

@ -24,7 +24,7 @@ export default {
} }
</script> </script>
<script lang="ts" setup> <script lang="ts" setup>
import { type CSSProperties, computed, onMounted } from 'vue' import { type CSSProperties, computed } from 'vue'
import { isDef, objToStyle } from '../common/util' import { isDef, objToStyle } from '../common/util'
import { useParent } from '../composables/useParent' import { useParent } from '../composables/useParent'
import { TABBAR_KEY } from '../wd-tabbar/types' import { TABBAR_KEY } from '../wd-tabbar/types'
@ -99,32 +99,6 @@ const active = computed(() => {
} }
}) })
onMounted(() => {
init()
})
/**
* 初始化将组件信息注入父组件
*/
function init() {
if (tabbar && tabbar.children && isDef(props.name)) {
const repeat = checkRepeat(tabbar.children, props.name, 'name')
if (repeat > -1) {
console.error('[wot-design] warning(wd-tabbar-item): name attribute cannot be defined repeatedly')
}
}
}
/**
* 检查是否存在重复name属性
* @param {Array} currentList
* @param {String} checkValue 比较的重复值
* @param {String} key 键名
*/
function checkRepeat(currentList: any[], checkValue: string | number, key: string): number {
return currentList.findIndex((item) => item[key] === checkValue)
}
/** /**
* 点击tabbar选项 * 点击tabbar选项
*/ */

@ -2,7 +2,7 @@
"id": "wot-design-uni", "id": "wot-design-uni",
"name": "wot-design-uni", "name": "wot-design-uni",
"displayName": "wot-design-uni 基于vue3+Typescript的高颜值组件库", "displayName": "wot-design-uni 基于vue3+Typescript的高颜值组件库",
"version": "0.2.11", "version": "0.2.13",
"description": "一个基于Vue3+TS开发的uni-app组件库提供60+高质量组件,支持暗黑模式和自定义主题。", "description": "一个基于Vue3+TS开发的uni-app组件库提供60+高质量组件,支持暗黑模式和自定义主题。",
"keywords": [ "keywords": [
"wot-design-uni", "wot-design-uni",
@ -34,7 +34,7 @@
"data": "插件不采集任何数据", "data": "插件不采集任何数据",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/wot-design-uni" "npmurl": "https://gitee.com/wot-design-uni/wot-design-uni"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [], "dependencies": [],

@ -3,7 +3,7 @@
</p> </p>
<h1 align="center">Wot Design Uni</h1> <h1 align="center">Wot Design Uni</h1>
<p align="center">📱 一个参照<a href="https://ftf.jd.com/wot-design/">Wot-design</a>,基于 Vue3 打造的uni-app组件库</p> <p align="center">📱 一个参照<a href="https://ftf.jd.com/wot-design/">wot-design</a>,基于 Vue3 打造的uni-app组件库</p>
<p align="center"> <p align="center">
@ -11,6 +11,11 @@
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/Moonofweisheng/wot-design-uni?logo=github&color=%234d80f0&link=https%3A%2F%2Fgithub.com%2FMoonofweisheng%2Fwot-design-uni"> <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/Moonofweisheng/wot-design-uni?logo=github&color=%234d80f0&link=https%3A%2F%2Fgithub.com%2FMoonofweisheng%2Fwot-design-uni">
</a> </a>
<a href='https://gitee.com/wot-design-uni/wot-design-uni/stargazers'>
<img src='https://gitee.com/wot-design-uni/wot-design-uni/badge/star.svg?theme=gray' alt='star'>
</a>
<a href="https://www.npmjs.com/package/wot-design-uni"> <a href="https://www.npmjs.com/package/wot-design-uni">
<img alt="npm" src="https://img.shields.io/npm/v/wot-design-uni?logo=npm&color=%234d80f0&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fwot-design-uni"> <img alt="npm" src="https://img.shields.io/npm/v/wot-design-uni?logo=npm&color=%234d80f0&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fwot-design-uni">
</a> </a>

@ -14,8 +14,15 @@ const env = {
*/ */
export function request(options) { export function request(options) {
options.header = {
Authorization: `Bearer ${uni.getStorageSync("token")}`, if (options.type == 'mall') {
options.header = {
Authorization: `Bearer ${uni.getStorageSync("mall_token")}`,
}
} else {
options.header = {
Authorization: `Bearer ${uni.getStorageSync("token")}`,
}
} }
options.noclient ? (options.url = env.host + options.url) : (options.url = env.host + "" + options.url); options.noclient ? (options.url = env.host + options.url) : (options.url = env.host + "" + options.url);
@ -24,7 +31,6 @@ export function request(options) {
uni.request({ uni.request({
url: options.url, url: options.url,
timeout: env.NETWORK_TIME_OUT, timeout: env.NETWORK_TIME_OUT,
// data: { ...options.data, store_id: env.store_id, mini_id: env.mini_id, origin: getOrigin() },
data: { ...options.data, ...env, }, data: { ...options.data, ...env, },
header: options.header, header: options.header,
method: options.method, method: options.method,

@ -125,8 +125,7 @@ export default {
const [curRoute, curRouteParam] = this.getRouterInfo() const [curRoute, curRouteParam] = this.getRouterInfo()
uni.setStorageSync("backPage", "/" + curRoute + curRouteParam) uni.setStorageSync("backPage", "/" + curRoute + curRouteParam)
uni.removeStorageSync("token"); uni.clearStorage();
uni.removeStorageSync("user_info");
this.toUrl("/pages/login/index", "redirectTo"); this.toUrl("/pages/login/index", "redirectTo");
}, },

Loading…
Cancel
Save