Compare commits
4 Commits
2a69930eaa
...
d8eb80efd9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8eb80efd9 | ||
|
|
59c72ced9b | ||
|
|
ec51286a1e | ||
|
|
b70b3a40df |
@ -17,4 +17,6 @@ export const apiArr = {
|
|||||||
tempParkingOrderQuery: '/api/v2/wechat/smart-parking/temp-parking/trade_query', // 临时车缴费订单交易查询
|
tempParkingOrderQuery: '/api/v2/wechat/smart-parking/temp-parking/trade_query', // 临时车缴费订单交易查询
|
||||||
|
|
||||||
parkList: '/api/v2/wechat/smart-parking/parking/list', // 停车场列表
|
parkList: '/api/v2/wechat/smart-parking/parking/list', // 停车场列表
|
||||||
|
|
||||||
|
deleteCar: '/api/v2/wechat/smart-parking/car/del', // 删除车辆
|
||||||
}
|
}
|
||||||
@ -73,18 +73,15 @@ export default {
|
|||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
const params = {
|
const params = {
|
||||||
user_id: uni.getStorageSync('userId'),
|
car_id: item.id
|
||||||
car_id: item.car_id
|
|
||||||
}
|
}
|
||||||
request(apiArr.deleteCar, "POST", params).then((res) => {
|
request(apiArr.deleteCar, "POST", params).then((res) => {
|
||||||
if (res.code == 200) {
|
uni.showToast({
|
||||||
uni.showToast({
|
title: '删除成功',
|
||||||
title: '删除成功',
|
icon: 'success',
|
||||||
icon: 'success',
|
duration: 2000
|
||||||
duration: 2000
|
});
|
||||||
});
|
this.getCarList();
|
||||||
this.getCarList();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -333,6 +333,15 @@ image {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shadowBox1Item_btn{
|
||||||
|
width: 150rpx;
|
||||||
|
height: 170rpx;
|
||||||
|
opacity:0;
|
||||||
|
position: absolute;
|
||||||
|
left: 100rpx;
|
||||||
|
top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.shadowBox1Item {
|
.shadowBox1Item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -203,6 +203,7 @@
|
|||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<view class="shadow" @click.stop="changeShadow" v-if="boxshadow1">
|
<view class="shadow" @click.stop="changeShadow" v-if="boxshadow1">
|
||||||
<view class="shadowBox1">
|
<view class="shadowBox1">
|
||||||
|
<button class="shadowBox1Item_btn" open-type="share" bindtap="onShareButtonClick"/>
|
||||||
<view class="shadowBox1Item" @click="shareFriend">
|
<view class="shadowBox1Item" @click="shareFriend">
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
|
||||||
mode="aspectFill"></image>
|
mode="aspectFill"></image>
|
||||||
@ -221,15 +222,18 @@
|
|||||||
<view class="shadowBox_img">
|
<view class="shadowBox_img">
|
||||||
<view class="boxshadow_tit">今日商品推荐</view>
|
<view class="boxshadow_tit">今日商品推荐</view>
|
||||||
<view class="boxshadow_img">
|
<view class="boxshadow_img">
|
||||||
<image
|
<image v-if="currentGG && currentGG.commodity_pic && currentGG.commodity_pic.length > 0"
|
||||||
|
:src="picUrl + currentGG.commodity_pic[0]">
|
||||||
|
</image>
|
||||||
|
<image v-else
|
||||||
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png">
|
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="shadowBoxInfo">
|
<view class="shadowBoxInfo">
|
||||||
<view class="shadowboxInfo_left">二维码</view>
|
<image class="shadowboxInfo_left" :src="qrcodePath || 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/qrcode_placeholder.png'" mode="aspectFill"></image>
|
||||||
<view class="shadowboxInfo_right">
|
<view class="shadowboxInfo_right">
|
||||||
<view class="shadowboxInfo_right_1">正鲜生</view>
|
<view class="shadowboxInfo_right_1">{{ currentGG && currentGG.goods_name ? currentGG.goods_name : '' }}</view>
|
||||||
<view class="shadowboxInfo_right_2">
|
<view class="shadowboxInfo_right_2">
|
||||||
长按识别小程序 <br />
|
长按识别小程序 <br />
|
||||||
数量有限马上抢购
|
数量有限马上抢购
|
||||||
@ -237,7 +241,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="shadowBox_btn" @click.stop="saveImg">保存海报</view>
|
<view class="shadowBox_btn" @click.stop="saveImg(picUrl + currentGG.commodity_pic[0])">保存海报</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -317,34 +321,36 @@ import {
|
|||||||
} from "../../../utils";
|
} from "../../../utils";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
picUrl,
|
picUrl,
|
||||||
top: "",
|
top: "",
|
||||||
localHeight: "",
|
localHeight: "",
|
||||||
carNum: "",
|
carNum: "",
|
||||||
prevCarNum: "",
|
prevCarNum: "",
|
||||||
currentNum: "0", //当前商品的数量
|
currentNum: "0", //当前商品的数量
|
||||||
type: "error",
|
type: "error",
|
||||||
boxshadow1: false,
|
boxshadow1: false,
|
||||||
boxshadow2: false,
|
boxshadow2: false,
|
||||||
id: "184",
|
id: "184",
|
||||||
info: "",
|
info: "",
|
||||||
currentIndex: "1", //当前轮播图
|
currentIndex: "1", //当前轮播图
|
||||||
|
|
||||||
currentGG: "", //当前选中规格
|
currentGG: "", //当前选中规格
|
||||||
currentGGIndex: "", //当前规格index
|
currentGGIndex: "", //当前规格index
|
||||||
|
|
||||||
carOrderList: [],
|
carOrderList: [],
|
||||||
// 新增评论数据
|
// 新增评论数据
|
||||||
showReviewPopup: false,
|
showReviewPopup: false,
|
||||||
comments: [],
|
comments: [],
|
||||||
show: false,
|
show: false,
|
||||||
showSize: false,
|
showSize: false,
|
||||||
|
|
||||||
changeImg: "",
|
changeImg: "",
|
||||||
changeName: "",
|
changeName: "",
|
||||||
changePrice: "",
|
changePrice: "",
|
||||||
};
|
selectedGoods: null, // 保存传入的商品规格信息
|
||||||
|
qrcodePath: null, // 存储当前页面的二维码路径
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeIndex(e) {
|
changeIndex(e) {
|
||||||
@ -390,11 +396,11 @@ export default {
|
|||||||
this.boxshadow2 = true;
|
this.boxshadow2 = true;
|
||||||
},
|
},
|
||||||
// 保存海报
|
// 保存海报
|
||||||
saveImg() {
|
saveImg(picUrl) {
|
||||||
this.boxshadow2 = false;
|
this.boxshadow2 = false;
|
||||||
// 微信小程序保存图片
|
// 微信小程序保存图片
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png",
|
url: picUrl,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
uni.saveImageToPhotosAlbum({
|
uni.saveImageToPhotosAlbum({
|
||||||
@ -454,10 +460,21 @@ export default {
|
|||||||
}
|
}
|
||||||
this.info = res;
|
this.info = res;
|
||||||
console.log("this.info", this.info.commodity_goods_info_list);
|
console.log("this.info", this.info.commodity_goods_info_list);
|
||||||
// {{info.commodity_goods_info_list[currentGGIndex].cart_count.count}}
|
|
||||||
this.currentGG = res.commodity_goods_info_list[0];
|
// 检查是否有传入的选中商品信息,如果有则设置为默认选中
|
||||||
|
let selectedIndex = 0;
|
||||||
|
if (this.selectedGoods) {
|
||||||
|
for (let i = 0; i < res.commodity_goods_info_list.length; i++) {
|
||||||
|
if (res.commodity_goods_info_list[i].id === this.selectedGoods.id) {
|
||||||
|
selectedIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currentGG = res.commodity_goods_info_list[selectedIndex];
|
||||||
console.log("this.currentGG", this.currentGG);
|
console.log("this.currentGG", this.currentGG);
|
||||||
this.currentGGIndex = 0;
|
this.currentGGIndex = selectedIndex;
|
||||||
|
|
||||||
this.changeImg = picUrl + this.currentGG.commodity_pic[0]
|
this.changeImg = picUrl + this.currentGG.commodity_pic[0]
|
||||||
this.changeName = this.currentGG.goods_alias
|
this.changeName = this.currentGG.goods_alias
|
||||||
@ -480,7 +497,6 @@ export default {
|
|||||||
|
|
||||||
// 切换规格
|
// 切换规格
|
||||||
changeGG(item, index) {
|
changeGG(item, index) {
|
||||||
console.log("🚀 ~ changeGG ~ item:", item);
|
|
||||||
this.currentGG = item;
|
this.currentGG = item;
|
||||||
this.currentGGIndex = index;
|
this.currentGGIndex = index;
|
||||||
if (this.currentGG.cart_count) {
|
if (this.currentGG.cart_count) {
|
||||||
@ -622,15 +638,15 @@ export default {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},onLoad(options) {
|
||||||
onLoad(options) {
|
|
||||||
console.log(JSON.parse(decodeURIComponent(options.item)));
|
|
||||||
const itemObj = JSON.parse(decodeURIComponent(options.item));
|
const itemObj = JSON.parse(decodeURIComponent(options.item));
|
||||||
const meun = menuButtonInfo();
|
const meun = menuButtonInfo();
|
||||||
this.top = meun.top;
|
this.top = meun.top;
|
||||||
this.localHeight = meun.height;
|
this.localHeight = meun.height;
|
||||||
|
|
||||||
this.id = itemObj.id;
|
|
||||||
|
this.id = itemObj.commodity_id ? itemObj.commodity_id : itemObj.id;
|
||||||
|
this.selectedGoods = itemObj; // 保存传入的完整商品信息
|
||||||
},
|
},
|
||||||
onReachBottom() { },
|
onReachBottom() { },
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|||||||
@ -135,14 +135,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="gg" @click="chooseGG(items)" v-if="
|
<view class="gg" @click="chooseGG(item,items)" v-if="
|
||||||
items.commodity_goods_info_list.length > 1 && !items.isShow
|
items.commodity_goods_info_list.length > 1 && !items.isShow
|
||||||
">
|
">
|
||||||
选择规格
|
选择规格
|
||||||
<u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon>
|
<u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="gg" @click="chooseGG(items)" v-if="
|
<view class="gg" @click="chooseGG(item,items)" v-if="
|
||||||
items.commodity_goods_info_list.length > 1 && items.isShow
|
items.commodity_goods_info_list.length > 1 && items.isShow
|
||||||
">
|
">
|
||||||
收起
|
收起
|
||||||
@ -152,7 +152,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="GGList" v-if="items.isShow">
|
<view class="GGList" v-if="items.isShow">
|
||||||
<view class="GGItem" v-for="ite in items.commodity_goods_info_list" :key="ite.id" @click="goods(items)">
|
<view class="GGItem" v-for="ite in items.commodity_goods_info_list" :key="ite.id" @click="goods(ite,items)">
|
||||||
<view class="GGItem_Image">
|
<view class="GGItem_Image">
|
||||||
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
|
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
|
||||||
<image :src="picUrl + ite.commodity_pic" mode="aspectFill"></image>
|
<image :src="picUrl + ite.commodity_pic" mode="aspectFill"></image>
|
||||||
@ -338,17 +338,22 @@ export default {
|
|||||||
this.topShow = !this.topShow;
|
this.topShow = !this.topShow;
|
||||||
},
|
},
|
||||||
// 选择商品规格
|
// 选择商品规格
|
||||||
chooseGG(targetItems) {
|
chooseGG(item,targetItems) {
|
||||||
// 遍历tagList找到目标对象(排除"全部"选项,从索引1开始)
|
// 根据两个参数的id判断点击的数据
|
||||||
for (let i = 1; i < this.tagList.length; i++) {
|
if (item && targetItems && item.id) {
|
||||||
const tagItem = this.tagList[i];
|
for (let i = 1; i < this.tagList.length; i++) {
|
||||||
const infoIndex = tagItem.commodity_info_list.findIndex(item => item.id === targetItems.id);
|
const tagItem = this.tagList[i];
|
||||||
if (infoIndex > -1) {
|
// 先根据item.id找到对应的tagItem
|
||||||
// 直接修改数据源中的对象,确保响应式
|
if (tagItem.id === item.id) {
|
||||||
const currentItem = tagItem.commodity_info_list[infoIndex];
|
const infoIndex = tagItem.commodity_info_list.findIndex(infoItem => infoItem.id === targetItems.id);
|
||||||
this.$set(currentItem, 'isShow', !currentItem.isShow);
|
if (infoIndex > -1) {
|
||||||
console.log("修改后数据源中的isShow:", currentItem.isShow);
|
// 直接修改数据源中的对象,确保响应式
|
||||||
break;
|
const currentItem = tagItem.commodity_info_list[infoIndex];
|
||||||
|
this.$set(currentItem, 'isShow', !currentItem.isShow);
|
||||||
|
console.log("修改后数据源中的isShow:", currentItem.isShow);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -357,9 +362,8 @@ export default {
|
|||||||
NavgateTo("../search/index");
|
NavgateTo("../search/index");
|
||||||
},
|
},
|
||||||
//商品详情页
|
//商品详情页
|
||||||
goods(e) {
|
goods(ite,items) {
|
||||||
NavgateTo(`../goods/index?item=${JSON.stringify(e)}`);
|
NavgateTo(`../goods/index?item=${JSON.stringify(ite)}`);
|
||||||
// NavgateTo("../goods/index");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 购物车
|
// 购物车
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user