修复支付未设置密码时关闭支付前需要输入密码未立即生效问题,修复会员页面周期福利弹窗显示问题
This commit is contained in:
BIN
components/xb-swiper-preview/images/icon-back.png
Normal file
BIN
components/xb-swiper-preview/images/icon-back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
385
components/xb-swiper-preview/index.vue
Normal file
385
components/xb-swiper-preview/index.vue
Normal file
@@ -0,0 +1,385 @@
|
|||||||
|
<template>
|
||||||
|
<view class="swiper-content" v-if="visable">
|
||||||
|
<view class="hander-top p-lr-32 w-s flex-j-sb--a-ct">
|
||||||
|
<view class="icon-back-wrap" @click="onBack">
|
||||||
|
<image class="icon-back" src="./images/icon-back.png" mode="widthFix" />
|
||||||
|
</view>
|
||||||
|
<view class="count">{{ currentImg + 1 }} / {{ imgs.length }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<swiper
|
||||||
|
class="swiper-img"
|
||||||
|
:current="currentImg"
|
||||||
|
:duration="300"
|
||||||
|
@change="changeSwiper"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
class="swiper-item"
|
||||||
|
v-for="(item, index) in imgs"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<view class="img-page">
|
||||||
|
<movable-area scale-area>
|
||||||
|
<movable-view
|
||||||
|
direction="all"
|
||||||
|
scale="true"
|
||||||
|
scale-min="1"
|
||||||
|
scale-max="4"
|
||||||
|
@click.stop="onBack"
|
||||||
|
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
@click.stop="()=>{}"
|
||||||
|
class="max-img"
|
||||||
|
:src="item"
|
||||||
|
:lazy-load="true"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
</movable-view>
|
||||||
|
</movable-area>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view class="item-bottom" v-if="false">
|
||||||
|
<scroll-view
|
||||||
|
class="scroll-view_H"
|
||||||
|
:scroll-x="true"
|
||||||
|
:scroll-into-view="scrollTopIndex"
|
||||||
|
:scroll-with-animation="true"
|
||||||
|
scroll-left="20"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="img-page-box scroll-view-item_H"
|
||||||
|
:class="currentImg == index ? 'img-page-checked' : ''"
|
||||||
|
v-for="(item, index) in imgs"
|
||||||
|
:key="index"
|
||||||
|
:id="`scrollToIndex${index}`"
|
||||||
|
@click.stop="toImg(index)"
|
||||||
|
>
|
||||||
|
<image class="img" :src="item" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="pop" v-if="isPop">
|
||||||
|
<view class="item" @click.stop="share()">分享图片</view>
|
||||||
|
<!-- #ifndef H5 -->
|
||||||
|
<view class="item" @click.stop="saveImg(false)">保存图片</view>
|
||||||
|
<view class="item" @click.stop="saveImg(true)">保存全部图片</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
imgs: {
|
||||||
|
type: [],
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
visable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emits: ['update:visable'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
currentImg: 0,
|
||||||
|
isPop: false,
|
||||||
|
scrollTopIndex: "",
|
||||||
|
|
||||||
|
isScale: false,
|
||||||
|
isCollect: false,
|
||||||
|
isLike: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
// let { imgs, current } = options;
|
||||||
|
// this.imgs = JSON.parse(imgs);
|
||||||
|
// this.currentImg = current;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeSwiper(e) {
|
||||||
|
this.currentImg = e.detail.current;
|
||||||
|
console.log("e", e);
|
||||||
|
|
||||||
|
this.scrollTopIndex = `scrollToIndex${e.detail.current}`;
|
||||||
|
},
|
||||||
|
toImg(index) {
|
||||||
|
this.currentImg = index;
|
||||||
|
},
|
||||||
|
onBack() {
|
||||||
|
this.$emit('update:visable', false);
|
||||||
|
},
|
||||||
|
share() {
|
||||||
|
uni.downloadFile({
|
||||||
|
// 下面一行时拼接预览PDF的地址!!!
|
||||||
|
url: this.imgs[this.currentImg],
|
||||||
|
success: function (res) {
|
||||||
|
var filePath = res.tempFilePath;
|
||||||
|
if (!filePath) return;
|
||||||
|
uni.openDocument({
|
||||||
|
filePath: filePath,
|
||||||
|
success: function (res) {
|
||||||
|
console.log(res);
|
||||||
|
console.log("打开文档成功");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveImg(isAll = false) {
|
||||||
|
const that = this;
|
||||||
|
if (!isAll) {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: this.imgs[this.currentImg],
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: res.tempFilePath,
|
||||||
|
success: function () {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "保存成功",
|
||||||
|
});
|
||||||
|
that.isPop = false;
|
||||||
|
},
|
||||||
|
fail: function () {},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.imgs.forEach((item) => {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: item,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: res.tempFilePath,
|
||||||
|
success: function () {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "保存全部成功",
|
||||||
|
});
|
||||||
|
that.isPop = false;
|
||||||
|
},
|
||||||
|
fail: function () {},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.swiper-content {
|
||||||
|
width: 100vw;
|
||||||
|
top: 0;
|
||||||
|
height: 100vh;
|
||||||
|
position: fixed;
|
||||||
|
background: #000;
|
||||||
|
z-index: 99999;
|
||||||
|
}
|
||||||
|
movable-view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
movable-area {
|
||||||
|
position: fixed;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
transform: scale();
|
||||||
|
}
|
||||||
|
|
||||||
|
movable-view image {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni-image > img {
|
||||||
|
z-index: -1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hander-top {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1000;
|
||||||
|
top: 48rpx;
|
||||||
|
left: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.icon-back-wrap {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
.icon-back {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.count {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 8rpx 24rpx;
|
||||||
|
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: rgba(0, 0, 0, 0.4);
|
||||||
|
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-img {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
background-color: #000;
|
||||||
|
|
||||||
|
.swiper-item {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
.img-page {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
.max-img {
|
||||||
|
// width: 100%;
|
||||||
|
// height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.handle-wrap {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 100;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 0;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 32rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
image {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-bottom {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 9999;
|
||||||
|
bottom: 110rpx;
|
||||||
|
left: 0rpx;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
width: 100vw;
|
||||||
|
|
||||||
|
// height: 200rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
transition: ease-in-out 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-list-page {
|
||||||
|
min-height: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-Y {
|
||||||
|
height: 300rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-view_H {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-right: 32rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-view-item_H {
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
margin-right: 10rpx;
|
||||||
|
|
||||||
|
transition: ease-in 0.1s;
|
||||||
|
transform: scale(0.8);
|
||||||
|
|
||||||
|
border-radius: 11rpx;
|
||||||
|
background: #c2c2c2;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
width: 160rpx;
|
||||||
|
height: 272rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-page-checked {
|
||||||
|
transform: translateY(-28rpx) scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 999999;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
width: 500rpx;
|
||||||
|
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
height: 100rpx;
|
||||||
|
padding: 0 50rpx;
|
||||||
|
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
line-height: 100rpx;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -413,7 +413,7 @@ import { onShow, onBackPress } from "@dcloudio/uni-app";
|
|||||||
import { onHide } from "@dcloudio/uni-app";
|
import { onHide } from "@dcloudio/uni-app";
|
||||||
// 输入支付密码
|
// 输入支付密码
|
||||||
const ispws = ref(false);
|
const ispws = ref(false);
|
||||||
const userInfo = uni.cache.get("userInfo");
|
let userInfo = uni.cache.get("userInfo");
|
||||||
|
|
||||||
// 会员信息
|
// 会员信息
|
||||||
const orderVIP = ref(uni.cache.get("orderVIP"));
|
const orderVIP = ref(uni.cache.get("orderVIP"));
|
||||||
@@ -891,8 +891,10 @@ const goToPay = async (payParams) => {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 余额支付
|
// 余额支付
|
||||||
if (payParams.payType == "accountPay") {
|
if (payParams.payType == "accountPay") {
|
||||||
|
console.log("orderVIP.value", orderVIP.value);
|
||||||
if (orderVIP.value.payPwd == "" &&userInfo.usePayPwd) {
|
if (orderVIP.value.payPwd == "" &&userInfo.usePayPwd) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
@@ -1032,6 +1034,7 @@ function closeSocket() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
userInfo = uni.cache.get("userInfo");
|
||||||
if (cartsSocket) {
|
if (cartsSocket) {
|
||||||
cartsSocket.connect();
|
cartsSocket.connect();
|
||||||
}
|
}
|
||||||
|
|||||||
251
pages/product/components/goods-modal.vue
Normal file
251
pages/product/components/goods-modal.vue
Normal file
@@ -0,0 +1,251 @@
|
|||||||
|
<template>
|
||||||
|
<up-popup :show="visible" :round="20" mode="bottom" @close="close">
|
||||||
|
<view class="shop_sku">
|
||||||
|
<scroll-view scroll-y style="max-height: 60vh; width: 100%">
|
||||||
|
<view class="positionabsolute">
|
||||||
|
<up-icon
|
||||||
|
name="close-circle"
|
||||||
|
@click="close"
|
||||||
|
color="#000"
|
||||||
|
size="25"
|
||||||
|
></up-icon>
|
||||||
|
</view>
|
||||||
|
<up-swiper :list="specifications.item.images" height="250"></up-swiper>
|
||||||
|
<view class="shop_sku_name">{{ specifications.item.name }}</view>
|
||||||
|
<view class="shop_sku_description">
|
||||||
|
{{
|
||||||
|
specifications.item.shortTitle ? specifications.item.shortTitle : ""
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
<view v-if="specifications.item.type != 'package'">
|
||||||
|
<view
|
||||||
|
class="shop_sku_box"
|
||||||
|
v-for="(specOptions, specType) in specifications.item
|
||||||
|
.selectSpecInfo"
|
||||||
|
:key="specType"
|
||||||
|
>
|
||||||
|
<view class="shop_sku_box_name">
|
||||||
|
{{ specType }}
|
||||||
|
</view>
|
||||||
|
<view class="flex-start">
|
||||||
|
<view
|
||||||
|
class="shop_sku_box_item"
|
||||||
|
v-for="option in specOptions"
|
||||||
|
:key="option"
|
||||||
|
@click="selectSpec(specType, option)"
|
||||||
|
:class="{
|
||||||
|
shop_sku_box_item_selected: isSelected(option),
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ option }}
|
||||||
|
<view
|
||||||
|
class="shop_sku_box_item_tip"
|
||||||
|
v-if="
|
||||||
|
specifications.item.result &&
|
||||||
|
specifications.item.result.isSoldStock == 1 &&
|
||||||
|
selectedSpecs[specType] === option
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<view>售罄</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="shop_sku_box_item_tip"
|
||||||
|
v-if="
|
||||||
|
specifications.item.result == 'kong' &&
|
||||||
|
canSubmit == false &&
|
||||||
|
selectedSpecs[specType] === option
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<view>已下架</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 套餐 -->
|
||||||
|
<view v-else>
|
||||||
|
<view class="shop_sku_box">
|
||||||
|
<view
|
||||||
|
v-for="(setmenu, setmenuindex) in specifications.item.groupSnap"
|
||||||
|
:key="setmenuindex"
|
||||||
|
>
|
||||||
|
<view class="shop_sku_box_name"
|
||||||
|
>{{ setmenu.title }} {{ setmenu.count }} 选{{
|
||||||
|
setmenu.number
|
||||||
|
}}</view
|
||||||
|
>
|
||||||
|
<view class="flex-start">
|
||||||
|
<view
|
||||||
|
class="shop_sku_box_item"
|
||||||
|
v-for="(option, goodsid) in setmenu.goods"
|
||||||
|
:key="goodsid"
|
||||||
|
@click="goodsidClick(setmenuindex, option, goodsid)"
|
||||||
|
:class="{
|
||||||
|
shop_sku_box_item_selected: isOptionSelected(
|
||||||
|
setmenuindex,
|
||||||
|
option
|
||||||
|
),
|
||||||
|
}"
|
||||||
|
:disabled="
|
||||||
|
isMaxSelected(setmenuindex) &&
|
||||||
|
!isOptionSelected(setmenuindex, option)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ option.proName }}
|
||||||
|
<text v-if="option.unitName">/{{ option.unitName }}</text>
|
||||||
|
<view
|
||||||
|
class="shop_sku_box_item_tip"
|
||||||
|
v-if="specifications.item.isSoldStock == 1"
|
||||||
|
>
|
||||||
|
<view>售罄</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="shop_bottom">
|
||||||
|
<view class="flex-between">
|
||||||
|
<view
|
||||||
|
class="price"
|
||||||
|
v-if="
|
||||||
|
specifications.item.type != 'package' &&
|
||||||
|
specifications.item.result
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<text class="i">¥</text>
|
||||||
|
<view class="num">
|
||||||
|
<GoodsPrice
|
||||||
|
:limitDiscount="limitTimeDiscountRes"
|
||||||
|
:cart="specifications.item.result"
|
||||||
|
:shopUserInfo="shopUserInfo"
|
||||||
|
:shopInfo="shopInfo"
|
||||||
|
></GoodsPrice>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<text class="num" v-if="false">
|
||||||
|
{{
|
||||||
|
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
|
||||||
|
? specifications.item.result.memberPrice ||
|
||||||
|
specifications.item.result.salePrice
|
||||||
|
: specifications.item.result.salePrice
|
||||||
|
}}
|
||||||
|
</text>
|
||||||
|
<text class="i" v-if="specifications.item.unitName"
|
||||||
|
>/{{ specifications.item.unitName }}</text
|
||||||
|
>
|
||||||
|
<text v-if="specifications.item.result.suitNum > 1"
|
||||||
|
>「{{ specifications.item.result.suitNum
|
||||||
|
}}{{ specifications.item.result.unitName }}起点」</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="price" v-else>
|
||||||
|
<text class="i">¥</text>
|
||||||
|
<view class="num">
|
||||||
|
<GoodsPrice
|
||||||
|
:limitDiscount="limitTimeDiscountRes"
|
||||||
|
:cart="specifications.item"
|
||||||
|
:shopUserInfo="shopUserInfo"
|
||||||
|
:shopInfo="shopInfo"
|
||||||
|
></GoodsPrice>
|
||||||
|
</view>
|
||||||
|
<text class="num" v-if="false">
|
||||||
|
{{
|
||||||
|
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
|
||||||
|
? specifications.item.memberPrice ||
|
||||||
|
specifications.item.salePrice
|
||||||
|
: specifications.item.salePrice
|
||||||
|
}}
|
||||||
|
</text>
|
||||||
|
<text class="i" v-if="specifications.item.unitName"
|
||||||
|
>/{{ specifications.item.unitName }}</text
|
||||||
|
>
|
||||||
|
<text v-if="specifications.item.suitNum > 1"
|
||||||
|
>「{{ specifications.item.suitNum
|
||||||
|
}}{{ specifications.item.unitName }}起点」</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view
|
||||||
|
class="operation-wrap"
|
||||||
|
v-if="specifications.item.type != 'package'"
|
||||||
|
>
|
||||||
|
<view class="btn">
|
||||||
|
<up-icon
|
||||||
|
name="minus-circle-fill"
|
||||||
|
color="#E9AB7A"
|
||||||
|
size="25"
|
||||||
|
v-if="shopCartNumber > 0"
|
||||||
|
></up-icon>
|
||||||
|
<view class="btnClick" @click="shopCart('-')"></view>
|
||||||
|
</view>
|
||||||
|
<text class="num">{{ shopCartNumber }}</text>
|
||||||
|
<view class="btn">
|
||||||
|
<up-icon
|
||||||
|
name="plus-circle-fill"
|
||||||
|
color="#E9AB7A"
|
||||||
|
size="25"
|
||||||
|
></up-icon>
|
||||||
|
<view class="btnClick" @click="shopCart('+')"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="shop_skuselect flex-start" v-if="selectedSpecsStr">
|
||||||
|
<view class="shop_skuselectname">{{ selectedSpecsStr }}</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="specifications.item.type == 'package'"
|
||||||
|
class="addShopping"
|
||||||
|
:class="shopCartNumber > 0 && allConditionsSatisfied ? 'active' : ''"
|
||||||
|
@click="submitSelection()"
|
||||||
|
>
|
||||||
|
{{ skuBtnText }}
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
v-else
|
||||||
|
class="addShopping"
|
||||||
|
:class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
|
||||||
|
@click="submitSelection()"
|
||||||
|
>
|
||||||
|
{{ skuBtnText }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-popup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
const props = defineProps({
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
specifications: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {
|
||||||
|
item: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const visible = defineModel({
|
||||||
|
default: false,
|
||||||
|
});
|
||||||
|
function close() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
const selectedSpecs = ref({});
|
||||||
|
function isSelected(option) {
|
||||||
|
return selectedSpecs.value[specType] === option;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.box {
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -65,6 +65,7 @@
|
|||||||
>限时折扣</view
|
>限时折扣</view
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
|
@click.stop="getImgs(item)"
|
||||||
class="panelfiveitemimage"
|
class="panelfiveitemimage"
|
||||||
:src="item.coverImg"
|
:src="item.coverImg"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
@@ -318,6 +319,7 @@
|
|||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
class="goodsImg"
|
class="goodsImg"
|
||||||
|
@click.stop="getImgs(item1)"
|
||||||
v-if="item1.coverImg != null"
|
v-if="item1.coverImg != null"
|
||||||
:lazy-load="true"
|
:lazy-load="true"
|
||||||
@load="imageLoaded(item1, index, index1)"
|
@load="imageLoaded(item1, index, index1)"
|
||||||
@@ -335,6 +337,7 @@
|
|||||||
v-else
|
v-else
|
||||||
:lazy-load="true"
|
:lazy-load="true"
|
||||||
></image>
|
></image>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
class="vifgoodsImg"
|
class="vifgoodsImg"
|
||||||
v-if="
|
v-if="
|
||||||
@@ -595,10 +598,24 @@
|
|||||||
</view>
|
</view>
|
||||||
<up-swiper
|
<up-swiper
|
||||||
:list="specifications.item.images"
|
:list="specifications.item.images"
|
||||||
|
@change="swiperChange"
|
||||||
|
:current="swiperCurrent"
|
||||||
|
radius="6px"
|
||||||
height="250"
|
height="250"
|
||||||
></up-swiper>
|
@click="
|
||||||
|
prveImgs(
|
||||||
|
specifications.item.images,
|
||||||
|
specifications.item.images[swiperCurrent]
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<!-- <template v-slot:default="{item}">
|
||||||
|
<image :src=item></image>
|
||||||
|
</templte> -->
|
||||||
|
</up-swiper>
|
||||||
|
|
||||||
<view class="shop_sku_name">{{ specifications.item.name }}</view>
|
<view class="shop_sku_name">{{ specifications.item.name }}</view>
|
||||||
<view class="shop_sku_description">
|
<view class="shop_sku_description" v-if="isSkuGoods">
|
||||||
{{
|
{{
|
||||||
specifications.item.shortTitle
|
specifications.item.shortTitle
|
||||||
? specifications.item.shortTitle
|
? specifications.item.shortTitle
|
||||||
@@ -622,8 +639,7 @@
|
|||||||
:key="option"
|
:key="option"
|
||||||
@click="selectSpec(specType, option)"
|
@click="selectSpec(specType, option)"
|
||||||
:class="{
|
:class="{
|
||||||
shop_sku_box_item_selected:
|
shop_sku_box_item_selected: isSkuSelected(specType, option),
|
||||||
selectedSpecs[specType] === option,
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ option }}
|
{{ option }}
|
||||||
@@ -783,24 +799,35 @@
|
|||||||
<view class="shop_skuselect flex-start" v-if="selectedSpecsStr">
|
<view class="shop_skuselect flex-start" v-if="selectedSpecsStr">
|
||||||
<view class="shop_skuselectname">{{ selectedSpecsStr }}</view>
|
<view class="shop_skuselectname">{{ selectedSpecsStr }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<template v-if="isSkuGoods">
|
||||||
v-if="specifications.item.type == 'package'"
|
<view
|
||||||
class="addShopping"
|
v-if="specifications.item.type == 'package'"
|
||||||
:class="
|
class="addShopping"
|
||||||
shopCartNumber > 0 && allConditionsSatisfied ? 'active' : ''
|
:class="
|
||||||
"
|
shopCartNumber > 0 && allConditionsSatisfied ? 'active' : ''
|
||||||
@click="submitSelection()"
|
"
|
||||||
>
|
@click="submitSelection()"
|
||||||
{{ skuBtnText }}
|
>
|
||||||
</view>
|
{{ skuBtnText }}
|
||||||
<view
|
</view>
|
||||||
v-else
|
<view
|
||||||
class="addShopping"
|
v-else
|
||||||
:class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
|
class="addShopping"
|
||||||
@click="submitSelection()"
|
:class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
|
||||||
>
|
@click="submitSelection()"
|
||||||
{{ skuBtnText }}
|
>
|
||||||
</view>
|
{{ skuBtnText }}
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view
|
||||||
|
class="addShopping"
|
||||||
|
:class="shopCartNumber > 0 ? 'active' : ''"
|
||||||
|
@click="submitSelection()"
|
||||||
|
>
|
||||||
|
{{ skuBtnText }}
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
@@ -818,10 +845,17 @@
|
|||||||
v-if="isDataLoaded"
|
v-if="isDataLoaded"
|
||||||
@onBuyClick="onBuyClick"
|
@onBuyClick="onBuyClick"
|
||||||
></recommendGoodsModal>
|
></recommendGoodsModal>
|
||||||
|
<goodsModal></goodsModal>
|
||||||
|
<xbSwiperPreview
|
||||||
|
:visable="showPrveImg"
|
||||||
|
:imgs="prveImgsList"
|
||||||
|
@update:visable="showPrveImg = $event"
|
||||||
|
></xbSwiperPreview>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import xbSwiperPreview from "@/components/xb-swiper-preview/index.vue";
|
||||||
//价格计算辅助函数
|
//价格计算辅助函数
|
||||||
import * as orderUtils from "@/utils/order-utils.js";
|
import * as orderUtils from "@/utils/order-utils.js";
|
||||||
import BigNumber from "bignumber.js";
|
import BigNumber from "bignumber.js";
|
||||||
@@ -854,6 +888,7 @@ import {
|
|||||||
//导航栏
|
//导航栏
|
||||||
import Nav from "@/components/CustomNavbar.vue";
|
import Nav from "@/components/CustomNavbar.vue";
|
||||||
import shopindex from "./components/shopindex.vue";
|
import shopindex from "./components/shopindex.vue";
|
||||||
|
import goodsModal from "./components/goods-modal.vue";
|
||||||
import shoppingCartes from "./components/shoppingCartes.vue";
|
import shoppingCartes from "./components/shoppingCartes.vue";
|
||||||
import confirmorder from "./components/confirmorder.vue";
|
import confirmorder from "./components/confirmorder.vue";
|
||||||
import Loading from "@/components/Loading.vue";
|
import Loading from "@/components/Loading.vue";
|
||||||
@@ -956,6 +991,11 @@ Object.assign(shopInfo, uni.cache.get("shopInfo"));
|
|||||||
const shopTable = uni.cache.get("shopTable");
|
const shopTable = uni.cache.get("shopTable");
|
||||||
const distance = uni.cache.get("distance"); //距离
|
const distance = uni.cache.get("distance"); //距离
|
||||||
|
|
||||||
|
const swiperCurrent = ref(0);
|
||||||
|
function swiperChange(e) {
|
||||||
|
swiperCurrent.value = e.current;
|
||||||
|
}
|
||||||
|
|
||||||
//店铺详情
|
//店铺详情
|
||||||
const showShopInfoRef = ref(null);
|
const showShopInfoRef = ref(null);
|
||||||
|
|
||||||
@@ -1136,6 +1176,10 @@ const allSpecsSelected = computed(() => {
|
|||||||
return specKeys.every((key) => selectedSpecs.value[key]);
|
return specKeys.every((key) => selectedSpecs.value[key]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function isSkuSelected(specType, option) {
|
||||||
|
return selectedSpecs.value[specType] === option;
|
||||||
|
}
|
||||||
|
|
||||||
// 处理规格选择的方法
|
// 处理规格选择的方法
|
||||||
const selectSpec = async (specType, option) => {
|
const selectSpec = async (specType, option) => {
|
||||||
// 规格清零
|
// 规格清零
|
||||||
@@ -1260,13 +1304,24 @@ const selectedSpecsStr = computed(() => {
|
|||||||
//添加购物车数量
|
//添加购物车数量
|
||||||
const shopCartNumber = ref(0);
|
const shopCartNumber = ref(0);
|
||||||
|
|
||||||
// 多规格 套餐添加数量
|
// 多规格 套餐 单规格添加数量
|
||||||
const shopCart = async (i) => {
|
const shopCart = async (i) => {
|
||||||
if (i == "-" && shopCartNumber.value >= 0) {
|
if (i == "-" && shopCartNumber.value >= 0) {
|
||||||
shopCartNumber.value = 0;
|
shopCartNumber.value = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let res = await shoppingcart();
|
let res = await shoppingcart();
|
||||||
|
// if (!isSkuGoods.value) {
|
||||||
|
// console.log("specifications.item", specifications.item);
|
||||||
|
// if (i == "-") {
|
||||||
|
// shopCartNumber.value--;
|
||||||
|
// } else {
|
||||||
|
// shopCartNumber.value++;
|
||||||
|
// }
|
||||||
|
// specifications.item.cartNumber = shopCartNumber.value;
|
||||||
|
// singleclick(specifications.item, i);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
if (i == "-") {
|
if (i == "-") {
|
||||||
if (!res && shopCartNumber.value == specifications.item.suitNum) {
|
if (!res && shopCartNumber.value == specifications.item.suitNum) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -1386,11 +1441,14 @@ const shoppingcart = async () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
res = await matchingProduct(selectedGroupSnap.value);
|
res = await matchingProduct(selectedGroupSnap.value);
|
||||||
} else {
|
} else if (specifications.item.type == "sku") {
|
||||||
if (!canSubmit.value) {
|
if (!canSubmit.value) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
res = await matchingProduct(specifications.item.result);
|
res = await matchingProduct(specifications.item.result);
|
||||||
|
} else {
|
||||||
|
// 单规格
|
||||||
|
res = await matchingProduct(specifications.item);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
@@ -1414,12 +1472,12 @@ const submitSelection = async () => {
|
|||||||
if (shopCartNumber.value <= 0) {
|
if (shopCartNumber.value <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let res = await shoppingcart();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(specifications.item.type == "package" && allConditionsSatisfied.value) ||
|
(specifications.item.type == "package" && allConditionsSatisfied.value) ||
|
||||||
(specifications.item.type == "sku" && canSubmit.value)
|
(specifications.item.type == "sku" && canSubmit.value)
|
||||||
) {
|
) {
|
||||||
let res = await shoppingcart();
|
|
||||||
|
|
||||||
// 是否是套餐 有就传
|
// 是否是套餐 有就传
|
||||||
if (specifications.item.type == "package") {
|
if (specifications.item.type == "package") {
|
||||||
// 需求更改:所所有商品套餐都是add,没有修改
|
// 需求更改:所所有商品套餐都是add,没有修改
|
||||||
@@ -1427,7 +1485,7 @@ const submitSelection = async () => {
|
|||||||
} else {
|
} else {
|
||||||
selectedGroupSnap.value = [];
|
selectedGroupSnap.value = [];
|
||||||
}
|
}
|
||||||
console.log('specifications.item', specifications.item);
|
console.log("specifications.item", specifications.item);
|
||||||
websocketsendMessage({
|
websocketsendMessage({
|
||||||
id: res ? res.cartListId : "",
|
id: res ? res.cartListId : "",
|
||||||
type: "shopping",
|
type: "shopping",
|
||||||
@@ -1451,25 +1509,84 @@ const submitSelection = async () => {
|
|||||||
selectedGroupSnap.value = [];
|
selectedGroupSnap.value = [];
|
||||||
showShopsku.value = false;
|
showShopsku.value = false;
|
||||||
} else {
|
} else {
|
||||||
|
websocketsendMessage({
|
||||||
|
id: res ? res.cartListId : "",
|
||||||
|
type: "shopping",
|
||||||
|
suitNum: specifications.productListitem.suitNum,
|
||||||
|
table_code: uni.cache.get("tableCode"),
|
||||||
|
shop_id: uni.cache.get("shopId"),
|
||||||
|
operate_type: res ? "edit" : "add",
|
||||||
|
product_id: specifications.product_id,
|
||||||
|
sku_id: specifications.sku_id,
|
||||||
|
number: res
|
||||||
|
? await calculateValue(res.cartNumber, "+", shopCartNumber.value)
|
||||||
|
: shopCartNumber.value,
|
||||||
|
memberPrice: specifications.item.memberPrice,
|
||||||
|
is_print: 1,
|
||||||
|
product_type: specifications.item.type,
|
||||||
|
is_time_discount: specifications.item.is_time_discount,
|
||||||
|
});
|
||||||
|
showShopsku.value = false;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//获取多规格数据
|
//返回是否是多规格商品
|
||||||
const clickspecifications = async (item, index, indexs, type) => {
|
function returnIsSkuGoods(item) {
|
||||||
console.log(item);
|
|
||||||
// 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
|
||||||
if (
|
if (
|
||||||
item.isSoldStock == 1 ||
|
|
||||||
(item.isSaleTime == 0 && !item.isSaleTimeshow) ||
|
|
||||||
item.type == "single" ||
|
item.type == "single" ||
|
||||||
item.type == "weight" ||
|
item.type == "weight" ||
|
||||||
(item.type == "package" && item.groupType == "0")
|
(item.type == "package" && item.groupType == "0")
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 数量清零
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const isSkuGoods = computed(() => {
|
||||||
|
return returnIsSkuGoods(specifications.item);
|
||||||
|
});
|
||||||
|
|
||||||
|
//预览图
|
||||||
|
const showPrveImg = ref(false);
|
||||||
|
const prveImgsList = ref([]);
|
||||||
|
function prveImgs(images) {
|
||||||
|
prveImgsList.value = images;
|
||||||
|
showPrveImg.value = true;
|
||||||
|
return;
|
||||||
|
uni.previewImage({
|
||||||
|
urls: images,
|
||||||
|
current: swiperCurrent.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getImgs(item) {
|
||||||
|
let res = await APIminiAppinfo(item.id);
|
||||||
|
prveImgs(res.images);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取多规格数据
|
||||||
|
const clickspecifications = async (item, index, indexs, type) => {
|
||||||
|
console.log(item);
|
||||||
|
// 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
||||||
|
// if (
|
||||||
|
// item.isSoldStock == 1 ||
|
||||||
|
// (item.isSaleTime == 0 && !item.isSaleTimeshow) ||
|
||||||
|
// item.type == "single" ||
|
||||||
|
// item.type == "weight" ||
|
||||||
|
// (item.type == "package" && item.groupType == "0")
|
||||||
|
// ) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (item.isSoldStock == 1 || (item.isSaleTime == 0 && !item.isSaleTimeshow)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
shopCartNumber.value = 0;
|
shopCartNumber.value = 0;
|
||||||
|
|
||||||
|
// 数量清零
|
||||||
// 初始化
|
// 初始化
|
||||||
let data = {
|
let data = {
|
||||||
item: item,
|
item: item,
|
||||||
@@ -1485,12 +1602,23 @@ const clickspecifications = async (item, index, indexs, type) => {
|
|||||||
// skuBtnText.value = '请选择规格'
|
// skuBtnText.value = '请选择规格'
|
||||||
// single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
// single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
||||||
let res = await APIminiAppinfo(item.id);
|
let res = await APIminiAppinfo(item.id);
|
||||||
specifications.item = {...res,is_time_discount:item.is_time_discount};
|
|
||||||
|
console.log("res", res);
|
||||||
|
console.log("item", item);
|
||||||
|
specifications.item = {
|
||||||
|
...res,
|
||||||
|
...item,
|
||||||
|
product_id: res.id,
|
||||||
|
sku_id: item.skuId,
|
||||||
|
};
|
||||||
if (specifications.item.type == "package") {
|
if (specifications.item.type == "package") {
|
||||||
selectedOptions.value = [];
|
selectedOptions.value = [];
|
||||||
specifications.product_id = res.id;
|
specifications.product_id = res.id;
|
||||||
specifications.sku_id = item.skuId;
|
specifications.sku_id = item.skuId;
|
||||||
shopCartNumber.value = 1;
|
shopCartNumber.value = 1;
|
||||||
|
} else {
|
||||||
|
specifications.product_id = res.id || specifications.item.product_id;
|
||||||
|
specifications.sku_id = item.skuId || specifications.item.sku_id;
|
||||||
}
|
}
|
||||||
// 购物车是否有商品
|
// 购物车是否有商品
|
||||||
specifications.type = res.type;
|
specifications.type = res.type;
|
||||||
@@ -1548,6 +1676,7 @@ const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
|||||||
|
|
||||||
// 单规格
|
// 单规格
|
||||||
const singleclick = async (item, i) => {
|
const singleclick = async (item, i) => {
|
||||||
|
console.log("单规格商品点击事件:", item, i);
|
||||||
if (!isProductAvailable(item.days, item.startTime, item.endTime)) {
|
if (!isProductAvailable(item.days, item.startTime, item.endTime)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "不在可售时间内",
|
title: "不在可售时间内",
|
||||||
@@ -1962,7 +2091,11 @@ const totalPrices = computed(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (limitTimeDiscountRes.value && limitTimeDiscountRes.value.id && item.is_time_discount==1) {
|
if (
|
||||||
|
limitTimeDiscountRes.value &&
|
||||||
|
limitTimeDiscountRes.value.id &&
|
||||||
|
item.is_time_discount == 1
|
||||||
|
) {
|
||||||
//限时折扣
|
//限时折扣
|
||||||
const price = orderUtils.returnPrice({
|
const price = orderUtils.returnPrice({
|
||||||
goods: item,
|
goods: item,
|
||||||
@@ -1974,7 +2107,10 @@ const totalPrices = computed(() => {
|
|||||||
return total + parseFloat(price) * parseFloat(item.cartNumber);
|
return total + parseFloat(price) * parseFloat(item.cartNumber);
|
||||||
}
|
}
|
||||||
// 是否启用会员价 0否1是
|
// 是否启用会员价 0否1是
|
||||||
if (shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1) {
|
if (
|
||||||
|
shopUserInfo.value.isVip == 1 &&
|
||||||
|
shopUserInfo.value.isMemberPrice == 1
|
||||||
|
) {
|
||||||
// memberPrice会员价
|
// memberPrice会员价
|
||||||
return (
|
return (
|
||||||
total +
|
total +
|
||||||
@@ -2221,12 +2357,12 @@ onShow(async () => {
|
|||||||
onHide(() => {
|
onHide(() => {
|
||||||
console.log("product index onHide");
|
console.log("product index onHide");
|
||||||
useSocket.closeSocket();
|
useSocket.closeSocket();
|
||||||
useSocket.setOnMessage(()=>{});
|
useSocket.setOnMessage(() => {});
|
||||||
});
|
});
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
console.log("product index onUnload");
|
console.log("product index onUnload");
|
||||||
useSocket.closeSocket();
|
useSocket.closeSocket();
|
||||||
useSocket.setOnMessage(()=>{});
|
useSocket.setOnMessage(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@@ -2237,6 +2373,7 @@ onMounted(async () => {
|
|||||||
const currentPage = pages[pages.length - 1];
|
const currentPage = pages[pages.length - 1];
|
||||||
// 获取页面参数
|
// 获取页面参数
|
||||||
const options = currentPage.options;
|
const options = currentPage.options;
|
||||||
|
console.log("onMounted", options);
|
||||||
let res = await APIhistoryOrder({
|
let res = await APIhistoryOrder({
|
||||||
tableCode: uni.cache.get("tableCode"),
|
tableCode: uni.cache.get("tableCode"),
|
||||||
});
|
});
|
||||||
@@ -2882,7 +3019,7 @@ function toHistory() {
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-bottom: 250rpx;
|
padding-bottom: 200rpx;
|
||||||
|
|
||||||
.positionabsolute {
|
.positionabsolute {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="u-p-30">
|
<view class="u-p-30">
|
||||||
<birthdayGift></birthdayGift>
|
<xb-swiper-preview></xb-swiper-preview>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import birthdayGift from "@/components/birthday-modal.vue";
|
import xbSwiperPreview from '@/components/xb-swiper-preview/index.vue'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1,338 +1,373 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="Box">
|
<view class="Box">
|
||||||
<view class="box_box">
|
<view class="box_box">
|
||||||
<!-- <view class="box_item flex-between">
|
<!-- <view class="box_item flex-between">
|
||||||
<text class="top_box_one_text">当前账号</text>
|
<text class="top_box_one_text">当前账号</text>
|
||||||
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
|
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
|
||||||
<button v-if="!form.mobile" class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
<button v-if="!form.mobile" class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||||
<view class="text">获取手机号</view>
|
<view class="text">获取手机号</view>
|
||||||
</button>
|
</button>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="u-p-r-40">
|
<view class="u-p-r-40">
|
||||||
<view class="color-333 font-16 font-700">密码支付</view>
|
<view class="color-333 font-16 font-700">密码支付</view>
|
||||||
<view class="font-12 color-999 u-m-t-4">关闭时,使用余额支付将会直接扣除,不再进行确认</view>
|
<view class="font-12 color-999 u-m-t-4"
|
||||||
</view>
|
>关闭时,使用余额支付将会直接扣除,不再进行确认</view
|
||||||
<up-switch v-model="form.usePayPwd" active-color="#FFD158" :inactive-value="0" @change="usePayPwdChange"
|
>
|
||||||
:active-value="1"></up-switch>
|
</view>
|
||||||
</view>
|
<up-switch
|
||||||
<view class="color-333 font-16 font-700" style="margin-top: 60rpx;">密码支付</view>
|
v-model="form.usePayPwd"
|
||||||
<view class="box_item flex-between">
|
active-color="#FFD158"
|
||||||
<text class="top_box_one_text">当前账号</text>
|
:inactive-value="0"
|
||||||
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" :disabled="false" />
|
@change="usePayPwdChange"
|
||||||
<view class="top_box_one_texts">
|
:active-value="1"
|
||||||
<view v-if="datalist.showText == true" class="yzm" @click="CodeRegister">{{ datalist.Recapture }}
|
></up-switch>
|
||||||
</view>
|
</view>
|
||||||
<view v-else style="color: #ccc; background-color: #f9f9f9; border-radius:16px; padding: 10rpx;">
|
<view class="color-333 font-16 font-700" style="margin-top: 60rpx"
|
||||||
{{ datalist.second }}s重新发送
|
>密码支付</view
|
||||||
</view>
|
>
|
||||||
</view>
|
<view class="box_item flex-between">
|
||||||
</view>
|
<text class="top_box_one_text">当前账号</text>
|
||||||
<view class="box_item flex-between" style="position:relative;">
|
<input
|
||||||
<text class="top_box_one_text"></text>
|
type="number"
|
||||||
<input type="number" v-model="form.checkCode" placeholder="请输入验证码"
|
v-model="form.mobile"
|
||||||
style="padding-right: 140rpx;color: #333" />
|
placeholder="请输入手机号"
|
||||||
|
maxlength="11"
|
||||||
</view>
|
:disabled="false"
|
||||||
<view class="box_item flex-between">
|
/>
|
||||||
<text class="top_box_one_text">新密码</text>
|
<view class="top_box_one_texts">
|
||||||
<input type="number" v-model="form.password" placeholder="请输入6位数字交易密码" maxlength="6"
|
<view
|
||||||
:password="!passwords" />
|
v-if="datalist.showText == true"
|
||||||
</view>
|
class="yzm"
|
||||||
<view class="box_item flex-between">
|
@click="CodeRegister"
|
||||||
<text class="top_box_one_text">确认密码</text>
|
>{{ datalist.Recapture }}
|
||||||
<input type="number" v-model="form.payPassword" placeholder="请再次输入密码" maxlength="6"
|
</view>
|
||||||
:password="!payPasswords" />
|
<view
|
||||||
</view>
|
v-else
|
||||||
|
style="
|
||||||
</view>
|
color: #ccc;
|
||||||
<view class="flex-colum">
|
background-color: #f9f9f9;
|
||||||
<view class="Box_bottom active"
|
border-radius: 16px;
|
||||||
@click="userInfosavePayPassword">重置密码</view>
|
padding: 10rpx;
|
||||||
</view>
|
"
|
||||||
</view>
|
>
|
||||||
|
{{ datalist.second }}s重新发送
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="box_item flex-between" style="position: relative">
|
||||||
|
<text class="top_box_one_text"></text>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
v-model="form.checkCode"
|
||||||
|
placeholder="请输入验证码"
|
||||||
|
style="padding-right: 140rpx; color: #333"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="box_item flex-between">
|
||||||
|
<text class="top_box_one_text">新密码</text>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
v-model="form.password"
|
||||||
|
placeholder="请输入6位数字交易密码"
|
||||||
|
maxlength="6"
|
||||||
|
:password="!passwords"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="box_item flex-between">
|
||||||
|
<text class="top_box_one_text">确认密码</text>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
v-model="form.payPassword"
|
||||||
|
placeholder="请再次输入密码"
|
||||||
|
maxlength="6"
|
||||||
|
:password="!payPasswords"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-colum">
|
||||||
|
<view class="Box_bottom active" @click="userInfosavePayPassword"
|
||||||
|
>重置密码</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { reactive, onMounted } from "vue";
|
||||||
reactive,
|
|
||||||
onMounted
|
|
||||||
} from 'vue';
|
|
||||||
|
|
||||||
import {
|
import { APIuserpwd, APIusercode } from "@/common/api/api.js";
|
||||||
APIuserpwd,
|
import { APIshopUserInfo } from "@/common/api/member.js";
|
||||||
APIusercode
|
|
||||||
} from '@/common/api/api.js'
|
|
||||||
import {
|
|
||||||
APIshopUserInfo
|
|
||||||
} from '@/common/api/member.js'
|
|
||||||
|
|
||||||
import {
|
import { productStore } from "@/stores/user.js";
|
||||||
productStore
|
import { APIuser } from "@/common/api/api.js";
|
||||||
} from '@/stores/user.js';
|
const storeuser = productStore();
|
||||||
import {APIuser} from '@/common/api/api.js'
|
const shopUserInfo = reactive({
|
||||||
const storeuser = productStore();
|
shopInfo: uni.cache.get("orderVIP"),
|
||||||
const shopUserInfo = reactive({
|
shopId: "",
|
||||||
shopInfo: uni.cache.get('orderVIP'),
|
});
|
||||||
shopId: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
const userInfo=uni.cache.get('userInfo')
|
|
||||||
|
|
||||||
const form = reactive({
|
const userInfo = uni.cache.get("userInfo");
|
||||||
mobile: uni.cache.get('orderVIP').phone,
|
|
||||||
password: '',
|
|
||||||
payPassword: '',
|
|
||||||
checkCode: '',
|
|
||||||
usePayPwd: userInfo.usePayPwd
|
|
||||||
})
|
|
||||||
|
|
||||||
const datalist = reactive({
|
const form = reactive({
|
||||||
isPwd: "",
|
mobile: uni.cache.get("orderVIP").phone,
|
||||||
passwords: false,
|
password: "",
|
||||||
payPasswords: false,
|
payPassword: "",
|
||||||
// 注册定时器 初始值
|
checkCode: "",
|
||||||
second: 60,
|
usePayPwd: userInfo.usePayPwd,
|
||||||
showText: true,
|
});
|
||||||
Recapture: '获取验证码',
|
|
||||||
})
|
|
||||||
|
|
||||||
const CodeRegister = async () => {
|
const datalist = reactive({
|
||||||
console.log('CodeRegister');
|
isPwd: "",
|
||||||
const res = await APIusercode({
|
passwords: false,
|
||||||
// post 手机验证码
|
payPasswords: false,
|
||||||
phone: form.mobile
|
// 注册定时器 初始值
|
||||||
});
|
second: 60,
|
||||||
if (res) {
|
showText: true,
|
||||||
uni.showToast({
|
Recapture: "获取验证码",
|
||||||
title: '验证码获取成功',
|
});
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
// 定时器
|
|
||||||
datalist.showText = false;
|
|
||||||
datalist.Recapture = '重新获取';
|
|
||||||
var interval = setInterval(() => {
|
|
||||||
let times = --datalist.second;
|
|
||||||
datalist.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(() => {
|
|
||||||
clearInterval(interval);
|
|
||||||
datalist.second = 60;
|
|
||||||
datalist.showText = true;
|
|
||||||
}, 60000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
const CodeRegister = async () => {
|
||||||
* 获取手机号
|
console.log("CodeRegister");
|
||||||
* @param {Object} d
|
const res = await APIusercode({
|
||||||
*/
|
// post 手机验证码
|
||||||
const getPhone = async (d) => {
|
phone: form.mobile,
|
||||||
if (d.detail.iv) {
|
});
|
||||||
uni.login({
|
if (res) {
|
||||||
provider: 'weixin',
|
uni.showToast({
|
||||||
success: async (data) => {
|
title: "验证码获取成功",
|
||||||
console.log(data)
|
icon: "none",
|
||||||
let res = await this.api.userwxlogins({
|
});
|
||||||
code: data.code,
|
// 定时器
|
||||||
encryptedData: d.detail.encryptedData,
|
datalist.showText = false;
|
||||||
iv: d.detail.iv,
|
datalist.Recapture = "重新获取";
|
||||||
})
|
var interval = setInterval(() => {
|
||||||
// form.mobile = res ? (res.slice(0, 3) + '****' + res.slice(7)) : '';
|
let times = --datalist.second;
|
||||||
form.mobile = res
|
datalist.second = times < 10 ? "0" + times : times; //小于10秒补 0
|
||||||
}
|
}, 1000);
|
||||||
})
|
setTimeout(() => {
|
||||||
}
|
clearInterval(interval);
|
||||||
}
|
datalist.second = 60;
|
||||||
const loginwxuserInfo = async () => {
|
datalist.showText = true;
|
||||||
let res = await this.api.loginwxuserInfo({
|
}, 60000);
|
||||||
userId: uni.cache.get('userInfo').id
|
}
|
||||||
})
|
};
|
||||||
if (res.code == 0) {
|
|
||||||
uni.cache.set('userInfo', res.data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const userInfosavePayPassword = async () => {
|
/**
|
||||||
if (form.mobile.length != 11) {
|
* 获取手机号
|
||||||
uni.showToast({
|
* @param {Object} d
|
||||||
title: '手机号必须是11位',
|
*/
|
||||||
icon: 'none'
|
const getPhone = async (d) => {
|
||||||
});
|
if (d.detail.iv) {
|
||||||
return false;
|
uni.login({
|
||||||
}
|
provider: "weixin",
|
||||||
if (form.password == null || form.password == '') {
|
success: async (data) => {
|
||||||
uni.showToast({
|
console.log(data);
|
||||||
title: '请输入密码',
|
let res = await this.api.userwxlogins({
|
||||||
icon: 'none'
|
code: data.code,
|
||||||
});
|
encryptedData: d.detail.encryptedData,
|
||||||
return false;
|
iv: d.detail.iv,
|
||||||
}
|
});
|
||||||
if (form.payPassword == null || form.payPassword == '') {
|
// form.mobile = res ? (res.slice(0, 3) + '****' + res.slice(7)) : '';
|
||||||
uni.showToast({
|
form.mobile = res;
|
||||||
title: '请输入确认密码',
|
},
|
||||||
icon: 'none'
|
});
|
||||||
});
|
}
|
||||||
return false;
|
};
|
||||||
}
|
const loginwxuserInfo = async () => {
|
||||||
if (form.password.length != 6 || form.payPassword.length != 6) {
|
let res = await this.api.loginwxuserInfo({
|
||||||
uni.showToast({
|
userId: uni.cache.get("userInfo").id,
|
||||||
title: '密码必须是6位',
|
});
|
||||||
icon: 'none'
|
if (res.code == 0) {
|
||||||
});
|
uni.cache.set("userInfo", res.data);
|
||||||
return false;
|
}
|
||||||
}
|
};
|
||||||
if (form.payPassword != form.password) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '密码和确认密码不一致',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (form.checkCode == null || form.checkCode == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入验证码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
let res = await APIuserpwd({
|
const userInfosavePayPassword = async () => {
|
||||||
checkPayPwd: form.payPassword,
|
if (form.mobile.length != 11) {
|
||||||
payPwd: form.password,
|
uni.showToast({
|
||||||
code: form.checkCode,
|
title: "手机号必须是11位",
|
||||||
usePayPwd:form.usePayPwd
|
icon: "none",
|
||||||
})
|
});
|
||||||
// * 获取会员信息
|
return false;
|
||||||
await storeuser.actionsproductqueryProduct()
|
}
|
||||||
if (res) {
|
if (form.password == null || form.password == "") {
|
||||||
uni.navigateBack()
|
uni.showToast({
|
||||||
}
|
title: "请输入密码",
|
||||||
}
|
icon: "none",
|
||||||
|
});
|
||||||
async function usePayPwdChange(){
|
return false;
|
||||||
uni.showLoading()
|
}
|
||||||
await APIuserpwd({
|
if (form.payPassword == null || form.payPassword == "") {
|
||||||
usePayPwd:form.usePayPwd
|
uni.showToast({
|
||||||
})
|
title: "请输入确认密码",
|
||||||
uni.showToast({
|
icon: "none",
|
||||||
title:'修改成功'
|
});
|
||||||
})
|
return false;
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
if (form.password.length != 6 || form.payPassword.length != 6) {
|
||||||
APIuser().then(res=>{
|
uni.showToast({
|
||||||
uni.cache.set('userInfo', res);
|
title: "密码必须是6位",
|
||||||
form.usePayPwd=res.usePayPwd
|
icon: "none",
|
||||||
})
|
});
|
||||||
})
|
return false;
|
||||||
|
}
|
||||||
|
if (form.payPassword != form.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "密码和确认密码不一致",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (form.checkCode == null || form.checkCode == "") {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入验证码",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = await APIuserpwd({
|
||||||
|
checkPayPwd: form.payPassword,
|
||||||
|
payPwd: form.password,
|
||||||
|
code: form.checkCode,
|
||||||
|
usePayPwd: form.usePayPwd,
|
||||||
|
});
|
||||||
|
// * 获取会员信息
|
||||||
|
await storeuser.actionsproductqueryProduct();
|
||||||
|
if (res) {
|
||||||
|
const userInfo = uni.cache.get("userInfo");
|
||||||
|
const orderVIP = uni.cache.get("orderVIP");
|
||||||
|
uni.cache.set("userInfo", { ...userInfo, usePayPwd: form.usePayPwd });
|
||||||
|
uni.cache.set("orderVIP", { ...orderVIP, payPwd: 'abcd' });
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
async function usePayPwdChange() {
|
||||||
|
uni.showLoading();
|
||||||
|
const res = await APIuserpwd({
|
||||||
|
usePayPwd: form.usePayPwd,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
const userInfo = uni.cache.get("userInfo");
|
||||||
|
uni.cache.set("userInfo", { ...userInfo, usePayPwd: form.usePayPwd });
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: "修改成功",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
APIuser().then((res) => {
|
||||||
|
uni.cache.set("userInfo", res);
|
||||||
|
form.usePayPwd = res.usePayPwd;
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.Box {
|
||||||
.Box {
|
padding: 80rpx 28rpx 28rpx;
|
||||||
padding: 80rpx 28rpx 28rpx;
|
|
||||||
|
|
||||||
.box_one {
|
.box_one {
|
||||||
margin-top: 26rpx;
|
margin-top: 26rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box_box {
|
.box_box {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
.box_item {
|
.box_item {
|
||||||
// border-bottom: 1rpx solid #E5E5E5;
|
// border-bottom: 1rpx solid #E5E5E5;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.top_box_one_text {
|
.top_box_one_text {
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
padding: 26rpx 0;
|
padding: 26rpx 0;
|
||||||
width: 75%;
|
width: 75%;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.top_box_one_texts {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #5082fd;
|
||||||
|
z-index: 100;
|
||||||
|
.yzm {
|
||||||
|
padding: 8rpx 20rpx;
|
||||||
|
background: #ffd158;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #5f2e0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.top_box_one_texts {
|
.box_item:nth-child(1) {
|
||||||
position: absolute;
|
border-bottom: none;
|
||||||
right: 0;
|
border-top: 1rpx solid #e5e5e5;
|
||||||
margin: auto;
|
|
||||||
font-size: 24rpx;
|
|
||||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #5082fd;
|
|
||||||
z-index: 100;
|
|
||||||
.yzm {
|
|
||||||
padding: 8rpx 20rpx;
|
|
||||||
background: #FFD158;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #5F2E0F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_item:nth-child(1) {
|
input {
|
||||||
border-bottom: none;
|
border-bottom: 1rpx solid #e5e5e5;
|
||||||
border-top: 1rpx solid #E5E5E5;
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input {
|
.flex-colum {
|
||||||
border-bottom: 1rpx solid #E5E5E5;
|
width: 100%;
|
||||||
color: #333;
|
margin-top: 56rpx;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.Box_bottom {
|
||||||
|
width: 100%;
|
||||||
|
height: 96rpx;
|
||||||
|
line-height: 96rpx;
|
||||||
|
background-color: #ffd158;
|
||||||
|
border-radius: 48rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.flex-colum {
|
.getPhone {
|
||||||
width: 100%;
|
line-height: initial;
|
||||||
margin-top: 56rpx;
|
background-color: none;
|
||||||
|
border: 2rpx solid #e3ad7f;
|
||||||
.Box_bottom {
|
color: #e3ad7f;
|
||||||
width: 100%;
|
font-size: 28rpx;
|
||||||
height: 96rpx;
|
padding: 5rpx 10rpx;
|
||||||
line-height: 96rpx;
|
position: absolute;
|
||||||
background-color: #FFD158;
|
right: 10rpx;
|
||||||
border-radius: 48rpx;
|
z-index: 2;
|
||||||
font-size: 36rpx;
|
}
|
||||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
}
|
||||||
font-weight: 500;
|
.Box .box_box .box_item uni-input {
|
||||||
color: #333;
|
border-bottom: 1rpx solid #e5e5e5;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.Box .box_box .box_item input {
|
||||||
|
border-bottom: 1rpx solid #e5e5e5;
|
||||||
}
|
}
|
||||||
|
:deep(.Box .box_box .box_item uni-input) {
|
||||||
.getPhone {
|
border-bottom: 1rpx solid #e5e5e5;
|
||||||
line-height: initial;
|
}
|
||||||
background-color: none;
|
|
||||||
border: 2rpx solid #E3AD7F;
|
|
||||||
color: #E3AD7F;
|
|
||||||
font-size: 28rpx;
|
|
||||||
padding: 5rpx 10rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: 10rpx;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.Box .box_box .box_item uni-input{
|
|
||||||
border-bottom: 1rpx solid #E5E5E5;
|
|
||||||
}
|
|
||||||
.Box .box_box .box_item input{
|
|
||||||
border-bottom: 1rpx solid #E5E5E5;
|
|
||||||
}
|
|
||||||
:deep(.Box .box_box .box_item uni-input){
|
|
||||||
border-bottom: 1rpx solid #E5E5E5;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -182,8 +182,9 @@
|
|||||||
}
|
}
|
||||||
if (name == '周期福利') {
|
if (name == '周期福利') {
|
||||||
model.title = '周期福利'
|
model.title = '周期福利'
|
||||||
|
let couponLen=memberLevel.value.cycleRewardCouponList?memberLevel.value.cycleRewardCouponList.length:0
|
||||||
modelContent.value =
|
modelContent.value =
|
||||||
`每${memberLevel.value.cycleUnit}赠送${memberLevel.value.cycleRewardPoints}积分,${memberLevel.value.cycleRewardCouponList.length}张优惠券`
|
`每${memberLevel.value.cycleUnit}赠送${memberLevel.value.cycleRewardPoints}积分${couponLen?(','+couponLen+'张优惠券'):''}`
|
||||||
}
|
}
|
||||||
if (name == '会员说明') {
|
if (name == '会员说明') {
|
||||||
model.title = '会员说明'
|
model.title = '会员说明'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<view class="lv">{{ memberLevel ? memberLevel.name : '' }}</view>
|
<view class="lv">{{ memberLevel ? memberLevel.name : '' }}</view>
|
||||||
<view class="time" v-if="shopUserInfo.openType == 'PAY'">
|
<view class="time" v-if="shopUserInfo.openType == 'PAY'">
|
||||||
<text>{{ memberLevel ? dayjs(memberLevel.endTime).format('YYYY-MM-DD') : '' }}到期</text>
|
<text>{{ memberLevel ? dayjs(memberLevel.endTime).format('YYYY-MM-DD') : '' }}到期</text>
|
||||||
<text style="margin-left: 8px;">{{ memberLevel ? memberLevel.memberName : '' }}</text>
|
<text style="margin-left: 8px;">{{ memberLevel ? memberLevel.memberCircleName : '' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="rule u-m-t-40 u-flex u-flex-between u-flex-y-center">
|
<view class="rule u-m-t-40 u-flex u-flex-between u-flex-y-center">
|
||||||
<text class="color-one">
|
<text class="color-one">
|
||||||
@@ -235,6 +235,27 @@
|
|||||||
const res = await vipApi.config({
|
const res = await vipApi.config({
|
||||||
shopId: shopId
|
shopId: shopId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const res1 = await vipApi.detail({
|
||||||
|
shopId: shopId
|
||||||
|
});
|
||||||
|
if (res1) {
|
||||||
|
memberLevel.value = {
|
||||||
|
...res1.memberLevel,
|
||||||
|
endTime: res1.endTime,
|
||||||
|
memberName: res1.memberName,
|
||||||
|
experience: res1.experience,
|
||||||
|
nextExperienceValue: res1.nextExperienceValue,
|
||||||
|
memberCircleName:res1.memberCircleName,
|
||||||
|
memberCircleReward:res1.memberCircleReward,
|
||||||
|
};
|
||||||
|
const total = res1.experience * 1 + res1.nextExperienceValue * 1;
|
||||||
|
const percent = ((res1.experience * 1) / total) * 100;
|
||||||
|
if (total <= 0 || res1.experience * 1 <= 0) {
|
||||||
|
expProgress.value = 100;
|
||||||
|
}
|
||||||
|
expProgress.value = percent;
|
||||||
|
}
|
||||||
if (res) {
|
if (res) {
|
||||||
res.memberLevel.cycleRewardCouponList = res.memberLevel.cycleRewardCouponList || []
|
res.memberLevel.cycleRewardCouponList = res.memberLevel.cycleRewardCouponList || []
|
||||||
res.memberLevel = res.memberLevel || {}
|
res.memberLevel = res.memberLevel || {}
|
||||||
@@ -254,7 +275,7 @@
|
|||||||
return true
|
return true
|
||||||
}).map((v) => {
|
}).map((v) => {
|
||||||
if (v.name == '赠送成长值' && res.memberLevel) {
|
if (v.name == '赠送成长值' && res.memberLevel) {
|
||||||
v.desc = `赠送${res.memberLevel.experienceValue}成长值`
|
v.desc = `赠送${memberLevel.value.memberCircleReward}成长值`
|
||||||
}
|
}
|
||||||
if (v.name == '优惠券') {
|
if (v.name == '优惠券') {
|
||||||
if (res.memberLevel.cycleRewardCouponList.length) {
|
if (res.memberLevel.cycleRewardCouponList.length) {
|
||||||
@@ -301,24 +322,6 @@
|
|||||||
menus.value = tiaojian_menus;
|
menus.value = tiaojian_menus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const res1 = await vipApi.detail({
|
|
||||||
shopId: shopId
|
|
||||||
});
|
|
||||||
if (res1) {
|
|
||||||
memberLevel.value = {
|
|
||||||
...res1.memberLevel,
|
|
||||||
endTime: res1.endTime,
|
|
||||||
memberName: res1.memberName,
|
|
||||||
experience: res1.experience,
|
|
||||||
nextExperienceValue: res1.nextExperienceValue
|
|
||||||
};
|
|
||||||
const total = res1.experience * 1 + res1.nextExperienceValue * 1;
|
|
||||||
const percent = ((res1.experience * 1) / total) * 100;
|
|
||||||
if (total <= 0 || res1.experience * 1 <= 0) {
|
|
||||||
expProgress.value = 100;
|
|
||||||
}
|
|
||||||
expProgress.value = percent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const nextName = computed(() => {
|
const nextName = computed(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user