diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c93fccd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,47 @@
+# See https://help.github.com/ignore-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+
+# testing
+/coverage
+
+# production
+/build
+/unpackage/dist/dev
+/unpackage/dist/static
+/unpackage/dist/build/mp-alipay/
+/unpackage/dist/build/mp-weixin/
+/unpackage/dist/build/app-plus/
+/unpackage/dist/build/.automator
+/unpackage/cache/
+/unpackage/cache/apk
+/unpackage/release
+/unpackage/res
+/unpackage/resources
+# misc
+.DS_Store
+.cache
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+.tmp*
+.svn
+.tags
+*.sublime-*
+sftp-config.json
+logs
+*.log
+.idea*
+.yo-rc.json
+*.swo
+*.swp
+/deps
+yarn.lock
+dev-stats.json
+.vscode
+.idea
+*.hbuilderx
+.history
diff --git a/api/api.js b/api/api.js
index 8d9e1d0..c70db8b 100644
--- a/api/api.js
+++ b/api/api.js
@@ -144,3 +144,21 @@ const request = ['post', 'put', 'patch'].reduce((request, method) => {
})
export default request
+
+export const upload = (options)=>{
+ const token = cookie.get('accessToken')
+ return new Promise((resolve, reject)=>{
+ uni.showLoading({title:'上传中'})
+ uni.uploadFile({
+ ...options,
+ header:{
+ ...options.headers,
+ Authorization: 'Bearer ' + token.accessToken,
+ },
+ url:options.url?`${VUE_APP_API_URL}${options.url}`:VUE_APP_API_URL+'/member/user/update-avatar',
+ success:(res)=>resolve(res),
+ fail:(err)=>reject(err),
+ complete:()=>uni.hideLoading()
+ })
+ })
+}
diff --git a/api/order.js b/api/order.js
index b94ce92..9f452b4 100644
--- a/api/order.js
+++ b/api/order.js
@@ -149,8 +149,8 @@ export function orderExpress(data) {
export const wechatPay = (data) => api.post(`/order/pay`, data)
/**
- * 检查h5支付
+ * 检查支付
* @param data
* @returns {*}
*/
-export const checkH5Pay = (data) => api.post(`/order/pay/orderQuery`, data)
+export const checkPay = (data) => api.post(`/order/pay/orderQuery`, data)
diff --git a/api/user.js b/api/user.js
index 84c9b24..ea6bb7c 100644
--- a/api/user.js
+++ b/api/user.js
@@ -41,3 +41,4 @@ export function updateMobile(data) {
* @returns {*}
*/
export const updateUserInfo = (data) => api.put(`/member/user/update-nickname?nickname=${ data.nickname }&birthday=${ data.birthday }&sex=${ data.sex }`)
+
diff --git a/components/Header/index.vue b/components/Header/index.vue
index a2878bb..20d8b94 100644
--- a/components/Header/index.vue
+++ b/components/Header/index.vue
@@ -10,6 +10,7 @@ import { computed, defineProps, ref, toRefs, unref, watch } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { useRouter } from "@/hooks/useRouter";
import { createAnimation } from "@/utils/utils";
+import { useScroll } from "@/hooks/useScroll";
const HEADER_HEIGHT = 40 // header高度
@@ -66,10 +67,6 @@ const props = defineProps({
type: String,
default: () => '#fff'
},
- scrollTop: {
- type: Number,
- default: () => 0
- },
propUp: {
type: Boolean,
default: () => true
@@ -94,7 +91,6 @@ const {
textShadow,
bgChangeByScroll,
bgChangeColor,
- scrollTop,
propUp,
showRight,
leftWidth
@@ -146,7 +142,7 @@ function getMenuInfo() {
// scss全局变量
const scssVarStyle = computed(() => {
return {
- '--header-height': `${ HEADER_HEIGHT * 2 }rpx`
+ '--header-height': `${ HEADER_HEIGHT }px`
}
})
@@ -154,7 +150,7 @@ const scssVarStyle = computed(() => {
const systemBarAreaStyle = computed(() => {
return {
width: '100%',
- height: `${ unref(heightInfo).safeAreaInsets.top * 2 }rpx`,
+ height: `${ unref(heightInfo).statusBarHeight * 2 }rpx`,
background: unref(systemBarAreaBg)
}
})
@@ -163,7 +159,7 @@ const systemBarAreaStyle = computed(() => {
const headerAreaStyle = computed(() => {
// 计算margin top
// margin-top (导航条高度 - 胶囊高度) / 2 永远确保胶囊在header中央
- const marginTop = unref(menuInfo).height > 0 ? `-${ ((HEADER_HEIGHT - (unref(menuInfo).height)) / 2) * 2 }rpx` : 0
+ const marginTop = unref(menuInfo).height > 0 ? `-${((HEADER_HEIGHT - unref(menuInfo).height))/2}px` : 0
return {
width: '100%',
background: unref(headerAreaBg),
@@ -202,7 +198,7 @@ const scrollMaskStyle = computed(() => {
// 总高度
const containerHeight = computed(() => {
- return (unref(heightInfo).safeAreaInsets.top + HEADER_HEIGHT) * 2
+ return (unref(heightInfo).statusBarHeight + HEADER_HEIGHT)
})
let animation
@@ -212,6 +208,7 @@ function doCreateAnimation() {
animation = createAnimation(0, scrollEnd, 0, 1)
}
+const {scrollTop} = useScroll();
watch(scrollTop, () => {
if (!bgChangeByScroll.value) return
if (!animation) doCreateAnimation()
@@ -289,7 +286,7 @@ onLoad(() => {
diff --git a/components/Modal/index.vue b/components/Modal/index.vue
index dcb1c53..934d45f 100644
--- a/components/Modal/index.vue
+++ b/components/Modal/index.vue
@@ -126,7 +126,7 @@ defineExpose({show, close})
text-align: center;
height: 80rpx;
line-height: 80rpx;
- border: 1rpx solid #ee6d46;
+ border: 1px solid #ee6d46;
background: #ee6d46;
color: #fff;
}
diff --git a/components/PayPopup/index.vue b/components/PayPopup/index.vue
index 4b87219..58560ed 100644
--- a/components/PayPopup/index.vue
+++ b/components/PayPopup/index.vue
@@ -52,7 +52,7 @@ async function handleSubmit() {
close()
} catch (e) {
console.error(e)
- push({url: '/pages/payStatus/index?type=2'})
+ push({url: '/pages/payStatus/index'},{data:{type:2}})
toast({title: '支付失败了'})
close()
}
diff --git a/components/Popup/index.vue b/components/Popup/index.vue
index d587b36..28d2b92 100644
--- a/components/Popup/index.vue
+++ b/components/Popup/index.vue
@@ -10,7 +10,7 @@ import { nextTick, ref, toRefs } from "vue";
import UniPopup from "@/components/uniComponents/UPopup/uni-popup/uni-popup.vue";
/** some javascript code in here */
-const emit = defineEmits(['open', 'close'])
+const emit = defineEmits(['open', 'close', 'maskClick'])
/**
* @property {String} title 标题
* @property {String} mode 模式
@@ -73,6 +73,10 @@ const handlePopupChange = (e) => {
if (!e.show) emit('close')
}
+const handleMaskClick = (e) => {
+ emit('maskClick')
+}
+
defineExpose({
show,
close
@@ -86,6 +90,7 @@ defineExpose({
:is-mask-click="isMaskClick"
background-color="#fff"
@change="handlePopupChange"
+ @maskClick="handleMaskClick"
class="y-popup"
>
@@ -96,7 +98,7 @@ function toDetail() {
@@ -119,7 +118,6 @@
-
diff --git a/pages/discountCoupon/components/CouponItem.vue b/pages/discountCoupon/components/CouponItem.vue
index 527408f..5e0ddcc 100644
--- a/pages/discountCoupon/components/CouponItem.vue
+++ b/pages/discountCoupon/components/CouponItem.vue
@@ -39,10 +39,8 @@ const getCoupon = async () => {
});
}
-const goToProduct = () => {
- push({
- url: '/pages/goodsList/goodsList'
- })
+const goToProduct = (coupons) => {
+ push({url: '/pages/goodsList/goodsList'},{data: {couponId: coupons.id}})
}
@@ -71,7 +69,7 @@ const goToProduct = () => {
- 去使用
+ 去使用
已使用
@@ -90,8 +88,7 @@ const goToProduct = () => {
scoped
lang="scss"
>
-.coupon-item{
- margin-bottom: 30rpx;
+.coupon-item {
width: 100%;
aspect-ratio: 682/176;
background: url("@/static/background/coupon-bg.png") no-repeat ;
diff --git a/pages/evaluate/evaluate.vue b/pages/evaluate/evaluate.vue
index 462c6a9..175194d 100644
--- a/pages/evaluate/evaluate.vue
+++ b/pages/evaluate/evaluate.vue
@@ -17,6 +17,7 @@
diff --git a/pages/footprint/footprint.vue b/pages/footprint/footprint.vue
index da0d6da..62deec9 100644
--- a/pages/footprint/footprint.vue
+++ b/pages/footprint/footprint.vue
@@ -223,6 +223,7 @@ async function handleUnCollectSingle() {
await unFootprintSingle(toDeleteItem)
await refresh()
await toast({title: '删除成功'})
+ toDeleteItem = undefined
}
/**
diff --git a/pages/goodsCategory/goodsCategory.vue b/pages/goodsCategory/goodsCategory.vue
index 0be4805..2f4a409 100644
--- a/pages/goodsCategory/goodsCategory.vue
+++ b/pages/goodsCategory/goodsCategory.vue
@@ -6,7 +6,7 @@
>
-
-
-
-
-
-
-
+
@@ -44,9 +37,9 @@
- ¥{{ storeAttr.otPrice || storeInfo.otPrice }}
+ ¥{{ storeAttr&&storeAttr.otPrice || storeInfo&&storeInfo.otPrice }}
{{ storeInfo.storeName }}
@@ -115,7 +108,10 @@
-
+
商品评价({{ detailData.replyCount }})
@@ -743,7 +747,9 @@ onPageScroll((e) => {
// ======================= 👇 kahu ===
.row-context {
- margin: 30rpx 0 ;
+ margin: 30rpx 0;
+
+
.label-row {
@include useFlex(space-between, center);
@include usePadding(30, 20);
@@ -775,6 +781,20 @@ onPageScroll((e) => {
.value {
@include useFlex(flex-end, center);
flex-shrink: 0;
+ font-size: 28rpx;
+ color: #333;
+ }
+ }
+}
+
+.swiper {
+ .swiper-item {
+ width: 100%;
+ height: 100%;
+
+ .image {
+ width: inherit;
+ height: inherit;
}
}
}
diff --git a/pages/goodsList/goodsList.vue b/pages/goodsList/goodsList.vue
index 80506ff..6598cdf 100644
--- a/pages/goodsList/goodsList.vue
+++ b/pages/goodsList/goodsList.vue
@@ -76,13 +76,14 @@ import ListLoadLoading from "@/components/ListLoadLoading/index.vue"
import emptyIcon from "@/static/icon/empty/收藏.png"
const {getParams, goBack} = useRouter()
-const {keyword, refresh, sid, dataList, loadend, loading, listEmpty} = usePage(getProductList)
+const {keyword, refresh, sid, couponId, dataList, loadend, loading, listEmpty} = usePage(getProductList)
onLoad((options) => {
const params = getParams(options)
keyword.value = params.keyword || ''
sid.value = params.sid || ''
+ couponId.value = params.couponId || ''
refresh()
})
diff --git a/pages/index/components/Recommend/index.vue b/pages/index/components/Recommend/index.vue
index 282f7de..ebe2505 100644
--- a/pages/index/components/Recommend/index.vue
+++ b/pages/index/components/Recommend/index.vue
@@ -6,83 +6,39 @@
@update: 2023-10-27 14:42
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
- 这里空空如也~
-
-
-
-
-
-
-
-
+
+
+
+
+ 商品推荐
+
+
+ 查看更多
+
+
+
+
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index ce359c4..784f0b6 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -2,7 +2,6 @@
+
+
+
+ 微信快捷登录
+
+
+
-
- 为了给您提供更好的服务 我们需要您的授权哦~
+
+
+
+
+ 阅读并同意
+
+ 《YSHOP商城用户协议》
+
+ 和
+
+ 《YSHOP商城隐私协议》
+
+
+
+
@@ -112,14 +241,54 @@ function toLogin(loginMethod) {
}
}
- .tips-row {
- position: absolute;
- bottom: 5%;
- left: 0;
- width: 100%;
- color: $tips-color;
- font-size: 24rpx;
+}
+
+.agreement-box {
+ @include usePadding(30, 0);
+ position: fixed;
+ bottom: 5%;
+ width: 100%;
+ font-size: 24rpx;
+ color: $tips-color;
+ transition: all .3s;
+
+
+ .agreement-text {
text-align: center;
+
+ .color {
+ color: $primary-color;
+ }
+ }
+
+ :deep(.uv-checkbox ) {
+ width: 100%;
+ align-items: flex-start;
+
+ .uv-checkbox__icon-wrap {
+ }
+ }
+}
+
+.error-animation {
+ animation: error-text 0.8s 1;
+}
+
+@keyframes error-text {
+ 0% {
+ transform: translateX(0);
+ }
+ 5%, 25%, 45%, 65%, 85% {
+ transform: translateX(-10rpx);
+ }
+ 10%, 30%, 50%, 70%, 90% {
+ transform: translateX(10rpx);
+ }
+ 15%, 35%, 55%, 75%, 95% {
+ transform: translateX(20rpx);
+ }
+ 20%, 40%, 60%, 80%, 100% {
+ transform: translateX(-20rpx);
}
}
diff --git a/pages/login/index.data.js b/pages/login/index.data.js
index 7079548..a832616 100644
--- a/pages/login/index.data.js
+++ b/pages/login/index.data.js
@@ -13,12 +13,7 @@ import phone from '@/static/icon/login/phone.png'
* @type {[{icon: *, label: string},{icon: *, label: string}]}
*/
export const loginMethods = [
- {
- type: 0,
- label: '微信快捷登录',
- icon: wechat,
- classNames: []
- },
+
{
type: 1,
label: '手机号快捷登录',
diff --git a/pages/orderInfo/orderInfo.vue b/pages/orderInfo/orderInfo.vue
index 5b567b5..1f4f971 100644
--- a/pages/orderInfo/orderInfo.vue
+++ b/pages/orderInfo/orderInfo.vue
@@ -4,7 +4,7 @@
:fixed="false"
title="订单详情"
left-arrow
- @leftClick="goList"
+ @leftClick="goBack"
/>
-
-
-
+
{
重新支付
+
+
diff --git a/pages/refund/refund.vue b/pages/refund/refund.vue
index 79b13f7..1cec0f8 100644
--- a/pages/refund/refund.vue
+++ b/pages/refund/refund.vue
@@ -230,15 +230,17 @@ const handleOrderInfo = async (option) => {
let price = 0
let productParamList = []
-
+ let productAttrUnique = []
goodsList.value.forEach(item => {
price += item.cartInfo.truePrice * item.cartInfo.cartNum
productParamList.push({
- productId: item.productId
+ productId: item.productId,
+ productAttrUnique: item.cartInfo.productAttrUnique
})
})
- totalPrice.value = price
+
+ totalPrice.value = price.toFixed(2)
data.value.orderId = res[0].orderId
data.value.serviceType = refundType.value
data.value.productParamList = productParamList
@@ -281,9 +283,10 @@ const handleApplyForAfterSales = async () => {
title: '申请成功,请等待审核'
})
push({url: '/pages/refundInfo/refundInfo'}, {
+ type:'redirectTo',
data: {
id: res,
- }
+ },
})
}
diff --git a/pages/refundInfo/refundInfo.vue b/pages/refundInfo/refundInfo.vue
index a62fbb7..dc38994 100644
--- a/pages/refundInfo/refundInfo.vue
+++ b/pages/refundInfo/refundInfo.vue
@@ -115,6 +115,7 @@
model
:purchase="item.cartNum"
:data="item.productInfo"
+ :price="item.truePrice"
v-for="(item, index) in orderInfoData.cartInfo"
>
@@ -133,7 +134,7 @@
总计:
- ¥{{ orderInfoData.refundAmount }}
+ ¥{{ orderInfoData.payPrice.toFixed(2) }}
@@ -160,7 +161,7 @@
服务类型
- {{ orderInfoData.serviceType }}
+ {{ orderInfoData.serviceType===0?'仅退款':'退货退款' }}
{
success: async (res) => {
if (res.confirm) {
await afterSalesOrderDelete({
- id: orderInfoData.value.id,
- orderCode: orderInfoData.value.orderCode
+ id: orderId.value,
+ orderCode: orderInfoData.value.orderId
})
uni.showToast({
title: '已删除',
diff --git a/pages/selectRefundGood/selectRefundGood.vue b/pages/selectRefundGood/selectRefundGood.vue
index 0ef414a..a82cf61 100644
--- a/pages/selectRefundGood/selectRefundGood.vue
+++ b/pages/selectRefundGood/selectRefundGood.vue
@@ -20,21 +20,43 @@
-
-
+
+
+
+
+
+
+
+
+ {{ item.cartInfo.productInfo &&item.cartInfo.productInfo.attrInfo && item.cartInfo.productInfo.attrInfo.sku }}
+
+
+
+
+
+
+
+ ¥{{item.cartInfo.truePrice }}
+
+
+
+
+
+
@@ -87,6 +109,7 @@ import { ref, watch } from 'vue'
import { applyForAfterSalesInfo } from '@/api/order'
import { onLoad } from '@dcloudio/uni-app'
import { useRouter } from "@/hooks/useRouter";
+import Goods from "@/components/goodsComponents/Goods.vue";
const {getParams, push, goBack} = useRouter()
const goodsList = ref([])
@@ -118,7 +141,7 @@ watch(goodsSelect, (goodsSelect) => {
price += item.cartInfo.truePrice * item.cartInfo.cartNum
})
- totalPrice.value = price
+ totalPrice.value = price.toFixed(2)
})
const handleOrderInfo = async (option) => {
@@ -140,7 +163,8 @@ const toRefund = (type) => {
goods: goodsSelect.value.toString(),
orderId: orderId.value,
id: id.value
- }
+ },
+ type:'redirectTo'
})
}
@@ -205,4 +229,95 @@ onLoad((options) => {
background: $white-color;
}
}
+
+.goods-row{
+ @include useFlex(space-between,center);
+ @include usePadding(20,10);
+ width: 100%;
+ .goods-col{
+ width: 90%;
+ }
+}
+
+// 商品SKU 数量等操作条
+.goods-options {
+ width: 100%;
+
+ .sku-row {
+ margin-bottom: 30rpx;
+
+ .sku-info {
+ @include usePadding(10, 4);
+ border: 1rpx solid #ccc;
+ border-radius: 5rpx;
+ font-size: 24rpx;
+ transition: all .3s;
+ max-width: 100%;
+
+
+ .info {
+ width: 100%;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ }
+
+ &:active {
+ scale: 1.1;
+ }
+
+ .icon {
+ margin-left: 15rpx;
+ }
+ }
+ }
+
+ .price-row {
+ width: 100%;
+
+ .price-box {
+ font-size: 30rpx;
+ color:$primary-color;
+
+ .old-price {
+ font-size: 20rpx;
+ color: $tips-color;
+ text-decoration: line-through;
+ margin-left: 10rpx;
+ }
+ }
+
+ .cart-num {
+ font-size: 24rpx;
+
+ .input {
+ width: 120rpx;
+
+
+ input {
+ width: 100%;
+ text-align: center;
+ color: #333;
+ }
+ }
+
+ .button {
+ font-size: 32rpx;
+ width: 34rpx;
+ aspect-ratio: 1/1;
+ border-radius: 5rpx;
+ border: 2rpx solid #cccccc;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ transition: all .3s;
+
+ &:active {
+ scale: 1.2;
+ }
+ }
+ }
+ }
+}
diff --git a/pages/shoppingCart/shoppingCart.vue b/pages/shoppingCart/shoppingCart.vue
index 0cd26ff..22b13ae 100644
--- a/pages/shoppingCart/shoppingCart.vue
+++ b/pages/shoppingCart/shoppingCart.vue
@@ -2,7 +2,6 @@
-
-
+
+
+
+
+
{
modalRef.value?.close()
goodsAttrSelectRef.value?.close()
})
-const scrollTop = ref(0)
-onPageScroll((e) => {
- scrollTop.value = e.scrollTop
-})
+useScroll()