Compare commits

...

6 Commits

12 changed files with 678 additions and 107 deletions

View File

@ -649,7 +649,7 @@ export default {
addCar() {
let that = this;
this.info.commodity_goods_info_list[this.currentGGIndex].cart_count = {
count: this.info.commodity_goods_info_list[this.currentGGIndex].min_order_quantity,
count: 1,
};
// this.info.commodity_goods_info_list.forEach((item) => {
// console.log(item.cart_count);
@ -659,7 +659,7 @@ export default {
// });
// });
let countVal = this.info.commodity_goods_info_list[this.currentGGIndex].min_order_quantity
let countVal = 1
const params = {
goods_id_and_count: [
@ -670,10 +670,10 @@ export default {
price: this.changePrice
},
],
group_buy_id: this.info.commodity_goods_info_list[this.currentGGIndex].group_buy_activity_id,
adver_id: this.itemObj.adver_id,
}
request(apiArr.updateCar, "POST", params).then((res) => {
that.getShopCar();
// that.getShopCar();
that.getShopCarList();
});
},
@ -693,7 +693,7 @@ export default {
count: newCount,
},
],
group_buy_id: this.info.commodity_goods_info_list[this.currentGGIndex].group_buy_activity_id,
adver_id: this.itemObj.adver_id,
};
request(apiArr.updateCar, "POST", params).then((res) => {

View File

@ -0,0 +1,307 @@
page {
background-color: #F6F6FA;
}
.container {
display: flex;
flex-direction: column;
min-height: calc(100vh - 120rpx);
width: 100%;
}
.searchBox {
display: flex;
align-items: center;
padding: 0 20rpx;
/* margin-top: 35rpx; */
justify-content: space-between;
background-color: #fff;
}
.searchBox_add {
display: flex;
align-items: center;
font-weight: 400;
font-size: 30rpx;
color: #000000;
}
.searchBox_add image {
width: 30rpx;
height: 30rpx;
margin-right: 16rpx;
}
.myRealEstate {
font-weight: 700;
padding-top: 36rpx;
font-weight: normal;
font-size: 36rpx;
color: #222222;
text-align: center;
background-color: #fff;
padding-bottom: 27rpx;
}
.myRealEstate .btn {
width: 600rpx;
height: 90rpx;
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: normal;
font-size: 36rpx;
color: #FFFFFF;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 30rpx;
}
.nearby {
padding: 0 20rpx;
margin-top: 20rpx;
background-color: #fff;
padding-top: 20rpx;
box-sizing: border-box;
flex: 1;
}
.nearbyTit {
display: flex;
justify-content: space-between;
}
.nearbyTit_left {
font-size: 36rpx;
color: #222222;
font-weight: 700;
}
.nearbyTit_right {
font-size: 26rpx;
color: #999999;
display: flex;
align-items: center;
}
.nearbyTit_right image {
width: 30rpx;
height: 30rpx;
}
.empty {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: normal;
font-size: 28rpx;
color: #999999;
margin-top: 110rpx;
width: 100%;
}
.empty image {
width: 366rpx;
height: 226rpx;
margin-bottom: 27rpx;
}
.communityItem {
border-bottom: 1rpx solid #EBEBEB;
margin-top: 32rpx;
}
.communityItem_msg {
font-size: 26rpx;
color: #999999;
margin-top: 20rpx;
padding-bottom: 30rpx;
}
.communityItem_Box {
display: flex;
}
.communityItem_Box_left {
width: 180rpx;
overflow: hidden;
height: 180rpx;
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-right: 20rpx;
}
.communityItem_Box_left image {
width: 100%;
height: 100%;
}
.communityItem_Box_right {
flex: 1;
}
.communityItem_Box_right_tit {
font-size: 32rpx;
color: #222222;
margin-bottom: 8rpx;
}
.communityItem_Box_right_com {
font-size: 26rpx;
color: #555555;
margin-top: 8rpx;
height: 72rpx;
line-height: 36rpx;
-webkit-line-clamp: 2;
/* 限制显示 2 行 */
-webkit-box-orient: vertical;
/* 垂直排列 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
display: -webkit-box;
}
.communityItem_Box_right_msg {
margin-top: 14rpx;
}
.communityItem_Box_right_msg_right {
width: 140rpx;
height: 40rpx;
background: #FF370B;
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-size: 26rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
.communityItem_Box_right_msg {
display: flex;
align-items: center;
justify-content: space-between;
}
.communityItem_Box_right_msg_left {
display: flex;
align-items: center;
}
.communityItem_Box_right_msg_left1 {
width: 110rpx;
height: 40rpx;
background: rgba(255, 81, 42, 0.1);
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #555555;
margin-right: 20rpx;
}
.communityItem_Box_right_msg_left1 image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.communityItem_Box_right_msg_left2 {
width: 110rpx;
height: 40rpx;
background: #FFF2DA;
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #555555;
}
.communityItem_Box_right_msg_left2 image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.myRealEstateEmpty {
display: flex;
}
.myRealEstates {
width: 710rpx;
height: 200rpx;
margin: 0 auto;
position: relative;
}
.myRealEstates image {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
z-index: 1;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.name {
font-size: 50rpx;
color: #FFFFFF;
text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.6);
text-align: center;
position: relative;
z-index: 2;
padding-top: 24rpx;
}
.Visitor {
font-weight: normal;
font-size: 24rpx;
color: #FFFFFF;
width: 380rpx;
display: flex;
align-items: center;
justify-content: center;
height: 52rpx;
margin: 0 auto;
margin-top: 30rpx;
position: relative;
z-index: 2;
background: rgba(0, 0, 0, 0.3);
border-radius: 10rpx 10rpx 10rpx 10rpx;
}
.Tit {
font-size: 40rpx;
color: #222222;
text-align: center;
margin-top: 20rpx;
margin-bottom: 5rpx;
}
.subTit {
font-size: 24rpx;
color: #999999;
text-align: center;
margin-bottom: 30rpx;
}
.Con{
padding: 0 20rpx;
box-sizing: border-box;
line-height: 1.8;
}

View File

@ -0,0 +1,83 @@
<template>
<view class="container">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add">
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
</view>
</view>
<view class="Tit">{{ Info.title }}</view>
<!-- <view class="subTit" v-if="Info.author || Info.publish_time">{{ Info.author }} {{ Info.publish_time }}</view>
<view class="subTit" v-else>
<text>发布时间{{ new Date().toLocaleDateString() }}</text>
</view> -->
<view class="Con">
<rich-text :nodes="Info.content"></rich-text>
</view>
</view>
</template>
<script>
import {
picUrl,
uniqueByField,
menuButtonInfo
} from '../../../utils';
//
import dataJson from '../index/data.json';
export default {
data() {
return {
top: "",
localHeight: "",
id: "",
Info: {},
defaultNoticeList: dataJson.defaultNoticeList
}
},
onLoad(options) {
const meun = menuButtonInfo();
this.top = meun.top;
// this.top = meun.height + meun.top;
this.localHeight = meun.height;
this.id = options.id;
this.getInfo();
},
methods: {
//
getInfo() {
console.log("🚀 ~ getInfo ~ this.defaultNoticeList:", this.defaultNoticeList)
// ID
const detailData = this.defaultNoticeList.find(item => item.id === Number(this.id));
console.log("🚀 ~ getInfo ~ detailData:", detailData)
if (detailData) {
//
const info = { ...detailData };
// HTML<br>rich-text
if (info.content) {
info.content = info.content.replace(/\n/g, '<br>');
}
this.Info = info;
}
},
back() {
uni.navigateBack({
delta: 1
});
},
},
}
</script>
<style>
@import url("./index.css");
</style>

View File

@ -17,10 +17,48 @@
"category_name": "报事报修"
}
],
"defaultInfoList": {
"1": "11",
"2": "22",
"3": "33",
"4": "44"
}
"defaultInfoList": [
{
"id": 1,
"title": "物业介绍",
"pic": "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Group_3677.png"
},
{
"id": 2,
"title": "物业缴费",
"pic": "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Group_3680.png"
},
{
"id": 3,
"title": "物业公积金",
"pic": "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Group_3679.png"
},
{
"id": 4,
"title": "报事报修",
"pic": "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Group_3678.png"
}
],
"defaultNoticeList": [
{
"id": 1,
"title": "物业介绍",
"content": "您好!\n &nbsp;&nbsp;&nbsp;&nbsp;物业服务中心是小区专属服务团队,核心服务包括:物业费收缴、公共区域清洁维护、设施设备(电梯/水电/绿化)检修、秩序安全管理,及应急事件响应、活动组织等日常事务。\n &nbsp;&nbsp;&nbsp;&nbsp;我们始终以\"用心服务、共建美好\"为宗旨,欢迎大家监督并提出改进建议。感谢您的理解与配合,让我们携手维护舒心的园区环境!"
},
{
"id": 2,
"title": "物业缴费",
"content": "各位业主:\n &nbsp;&nbsp;&nbsp;&nbsp;为简化缴费流程,提升服务效率,物业已上线\"线上+线下\"一体化缴费功能,支持物业费、车位费、公共能耗费等各类费用便捷缴纳,具体使用说明如下:\n一、线上缴费推荐\n &nbsp;&nbsp;&nbsp;&nbsp;1. 小程序端操作:打开物业专属小程序,进入\"我的-物业缴费\"页面,系统将自动展示您需缴纳的费用账单(含费用类型、金额、缴费周期等明细);确认账单无误后,选择微信支付,点击\"确认缴费\"即可完成。\n &nbsp;&nbsp;&nbsp;&nbsp;2. 账单查询:在缴费页面点击\"缴费记录\",可查看缴费明细(含缴费时间、金额、凭证号)。\n二、线下缴费备用\n若您偏好线下办理可前往物业前台通过现金、银行卡、移动支付微信/支付宝扫码)完成缴费。"
},
{
"id": 3,
"title": "物业公积金",
"content": "各位业主:\n &nbsp;&nbsp;&nbsp;&nbsp;上线\"物业公积金\"功能,其核心规则与使用方式如下,覆盖所有房产通用场景:\n一、物业公积金的获取方式\n &nbsp;&nbsp;&nbsp;&nbsp;通过周边合作门店消费,即可获得物业公积金;\n二、跨房产通用一份公积金多房产可用\n &nbsp;&nbsp;&nbsp;&nbsp;您的个人物业公积金不绑定单一房产可通用至您已加入的所有房产。例如您的个人公积金既可抵扣A小区的物业费也可抵扣您加入的B小区的水电费、C小区的燃气费无需额外转移或申请。\n三、查询与透明化\n &nbsp;&nbsp;&nbsp;&nbsp;在物业平台\"我的-物业公积金\"页面,可实时查看:个人公积金余额、所属房产的总额、抵扣记录(含抵扣房产、金额、个人扣除份额),确保每笔使用清晰可溯。"
},
{
"id": 4,
"title": "报事报修",
"content": "各位业主:\n &nbsp;&nbsp;&nbsp;&nbsp;小程序\"报事报修\"功能,覆盖全物业类型通用场景,操作简单、响应高效,具体介绍如下:\n一、报修流程\n1、进入功能打开物业小程序点击\"报事报修\"图标,选择报修页面;\n2、填写信息选择\"详细地址\"、\"报修类型\"(水电故障/家电维修/公共设施损坏等),补充问题描述(如\"厨房水龙头漏水\"\"办公室空调不制冷\"),可上传现场照片(便于维修人员预判问题);\n3、提交确认核对信息后点击\"提交报修\",系统自动生成报修单号,同步推送至物业维修部。\n二、报修范围室内水电、家电、门窗、厨卫设施维修等\n三、进度追踪\n1、实时查进度在\"我的报修\"页面,可查看报修单状态,维修人员接单后会主动联系确认上门时间;\n2、紧急情况如水管爆裂、断电可先拨打物业24小时热线再补填在线报修单确保问题快速解决"
}
]
}

View File

@ -44,7 +44,7 @@
</u-grid>
</view>
<!-- <view class="tabs" v-if="defaultCategoryList.length > 0">
<view class="tabs" v-if="defaultCategoryList.length > 0">
<view v-for="(item, index) in defaultCategoryList" :key="index"
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }}
@ -52,16 +52,16 @@
</view>
<view class="newsList" v-if="defaultCategoryList.length > 0">
<view class="newsItem" v-for="item in defaultInfoList" @click="detail(item)" :key="item.id">
<view class="newsItem" v-for="item in defaultInfoList" @click="defaultDetail(item)" :key="item.id">
<view class="newsItem_left">
<view class="newsItem_left_tit">{{ item.title }}</view>
<view class="newsItem_left_sub">{{ item.author }}</view>
</view>
<view class="newsItem_right">
<image :src="item.list_image" mode="aspectFill" />
<image :src="item.pic" mode="aspectFill" />
</view>
</view>
</view> -->
</view>
</view>
<view v-else>
@ -116,6 +116,13 @@
</view>
</view>
<view class="tabs" v-else>
<view v-for="(item, index) in defaultCategoryList" :key="index"
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }}
</view>
</view>
<view class="newsList" v-if="categoryList.length > 0">
<view class="newsItem" v-for="item in infoList" @click="detail(item)" :key="item.id">
<view class="newsItem_left">
@ -128,6 +135,18 @@
</view>
</view>
<view class="newsList" v-else>
<view class="newsItem" v-for="item in defaultInfoList" @click="defaultDetail(item)" :key="item.id">
<view class="newsItem_left">
<view class="newsItem_left_tit">{{ item.title }}</view>
<view class="newsItem_left_sub">{{ item.author }}</view>
</view>
<view class="newsItem_right">
<image :src="item.pic" mode="aspectFill" />
</view>
</view>
</view>
<view class="tips">{{ loadMoreText }}</view>
<view class="bigAds" v-if="ads1Show">
@ -265,10 +284,12 @@ export default {
isShowBill: false,
houseVal: "",
// JSON
defaultCategoryList: dataJson.defaultCategoryList,
defaultInfoList: dataJson.defaultInfoList,
// defaultInfoList
originalDefaultInfoList: null
};
},
async onLoad(options) {
@ -342,6 +363,18 @@ export default {
this.getfunctionNum();
this.getAdvertising();
this.getCategoryList();
//
setTimeout(() => {
if (this.categoryList.length === 0 && this.defaultCategoryList.length > 0) {
this.selectedTab = 0;
if (!this.originalDefaultInfoList) {
this.originalDefaultInfoList = JSON.parse(JSON.stringify(dataJson.defaultInfoList));
}
//
this.defaultInfoList = this.originalDefaultInfoList.filter(info => info.id === this.defaultCategoryList[0].id);
}
}, 100);
},
//
@ -409,7 +442,7 @@ export default {
if (targetItem.front_end_display == 1) {
uni.removeStorageSync("changeCommData");
}
}else{
} else {
uni.removeStorageSync("changeCommData");
}
@ -694,11 +727,23 @@ export default {
},
async selectTab(index, item) {
// 使
if (this.categoryList.length === 0) {
this.selectedTab = index;
if (!this.originalDefaultInfoList) {
this.originalDefaultInfoList = JSON.parse(JSON.stringify(dataJson.defaultInfoList));
}
// ID
this.defaultInfoList = this.originalDefaultInfoList.filter(info => info.id === item.id);
return;
}
//
const isTabChange = this.selectedTab !== index;
if (isTabChange) {
this.page_num = 1;
this.infoList = [];
// this.loadMoreText = "1030";
}
this.selectedTab = index;
@ -756,6 +801,11 @@ export default {
console.log(e);
NavgateTo("../noticeDesc/index?id=" + e.id);
},
defaultDetail(e) {
console.log(e);
NavgateTo("../defaultNotice/index?id=" + e.id);
},
},
};
</script>

View File

@ -161,23 +161,24 @@ export default {
console.log('省份没变,查市跟区', this.cityList)
let newDist = this.cityList[sq];
console.log('新的市信息', newDist);
if (this.xsq.ad_code !== newDist.ad_code) {
console.log('新市区跟旧市区不一')
if (!this.xsq || this.xsq.ad_code !== newDist.ad_code) {
console.log('新市区跟旧市区不一')
this.xsq = newDist;
this.confirmCity = newDist;
this.getDistList(newDist, x);
} else {
console.log('新市区跟旧市区一');
console.log('新市区跟旧市区一');
this.confirmDist = this.defaultDist[x]
}
return
}
const res = await request(apiArr.getArea, 'POST', { parent_ad_code: this.confirmProv1.ad_code }, { silent: false });
this.cityList = res.rows;
let newDist;
this.defaultCity = res.rows;
this.confirmCity = res.rows[0]; //
this.getDistList(newDist, x);
this.xsq = res.rows[0]; // xsq
this.getDistList(this.xsq, x);
},
// /
async getDistList(xsq, x) {
@ -293,16 +294,18 @@ export default {
bindChange(e) {
console.log('[1231331], e', e);
const { value } = e.detail;
// // /
let newCrty = this.provList[value[0]];
console.log('新的省份信息', newCrty);
console.log('旧的省信息', this.confirmProv1);
//
if (newCrty.ad_code === this.confirmProv1.ad_code) {
console.log('省份信息没变');
this.sf = false;
} else {
this.sf = true;
}
console.log('this.cityListthis.cityList', this.cityList);
this.confirmProv1 = newCrty
this.getCityList(value[1], value[2])

View File

@ -54,6 +54,10 @@
margin-right: 10rpx;
}
.addressItem_footer_left2 {
display: flex;
}
.addressItem_footer_right {
display: flex;
align-items: center;

View File

@ -3,27 +3,29 @@
<view class="hasAddress">
<view class="addressList">
<view class="addressItem" v-for="item, index in list" :key="index" :class="{ 'addressItem_def': index == 0 }">
<view class="addressItem" v-for="item, index in list" :key="index"
:class="{ 'addressItem_def': index == 0 }" @click="selectAddress(item)">
<view class="addressItem_top">
{{item.name}} {{item.phone}} <view v-if="item.is_default === 1" class="is_def">默认</view>
{{ item.name }} {{ item.phone }} <view v-if="item.is_default === 1" class="is_def">默认</view>
</view>
<view class="addressItem_mid">{{item.address}}{{ item.house_number }}</view>
<view class="addressItem_mid">{{ item.address }}{{ item.house_number }}</view>
<view class="addressItem_footer">
<view class="addressItem_footer_left">
<view v-if="item.is_default !== 1" @click="headerSettingDefault(item.id)">
<image src="http://192.168.0.172:5500/7.15/shop_checked1.png"></image>
<view v-if="item.is_default !== 1" @click.stop="headerSettingDefault(item.id)"
class="addressItem_footer_left2">
<view class="checkbox"></view>
设为默认
</view>
<view v-if="item.is_default === 1">
<image src="http://192.168.0.172:5500/7.15/shop_checked2.png"></image>
<view v-if="item.is_default === 1" class="addressItem_footer_left2">
<view class="checkbox checkbox-checked"></view>
已默认
</view>
</view>
<view class="addressItem_footer_right">
<view class="btn1" @click="deleteItem(item.id )">删除</view>
<view class="btn2" @click="editItem(item)">修改</view>
<view class="btn1" @click.stop="deleteItem(item.id)">删除</view>
<view class="btn2" @click.stop="editItem(item)">修改</view>
</view>
</view>
</view>
@ -61,7 +63,7 @@ export default {
}
},
methods: {
addAddress(){
addAddress() {
NavgateTo("../addAddress/index")
},
@ -71,7 +73,7 @@ export default {
async headerSettingDefault(id) {
const res = await request(apiArr.settingDefaultAddress, 'POST', { id }, { silent: true, nested: true });
if(res.code === 1){
if (res.code === 1) {
uni.showToast({
title: '设置成功',
icon: 'success',
@ -81,7 +83,7 @@ export default {
}
},
deleteItem(id){
deleteItem(id) {
const _this = this;
uni.showModal({
title: '提示',
@ -103,6 +105,14 @@ export default {
});
},
//
selectAddress(item) {
//
uni.setStorageSync('selectedAddress', item);
//
uni.navigateBack();
},
async init() {
const res = await request(apiArr.addAddressList, 'POST', {});
this.list = res.address_list;
@ -125,4 +135,32 @@ export default {
<style>
@import url("./index.css");
/* 多选框样式 */
.checkbox {
width: 32rpx;
height: 32rpx;
border: 2rpx solid #D1D1D1;
border-radius: 6rpx;
margin-right: 10rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #FFFFFF;
}
.checkbox-checked {
border-color: #FF370B;
background-color: #FF370B;
}
.checkbox-checked::after {
content: "";
display: block;
width: 16rpx;
height: 8rpx;
border-left: 2rpx solid #FFFFFF;
border-bottom: 2rpx solid #FFFFFF;
transform: rotate(-45deg);
}
</style>

View File

@ -107,10 +107,12 @@
</view>
<view class="review-time">{{ comment.create_time }}</view>
</view>
<view class="user-purchase">已购 {{ comment.goods_name.goods_name }}{{ comment.goods_name.goods_spec }}</view>
<view class="user-purchase">已购 {{ comment.goods_name.goods_name }}{{ comment.goods_name.goods_spec
}}</view>
<view class="review-content">{{ comment.user_review }}</view>
<view class="review-images" v-if="comment.review_image.length > 0">
<image :src="img" class="review-img" v-for="(img, idx) in comment.review_image" :key="idx"></image>
<image :src="img" class="review-img" v-for="(img, idx) in comment.review_image" :key="idx">
</image>
</view>
</view>
</view>
@ -203,7 +205,7 @@
<!-- 分享 -->
<view class="shadow" @click.stop="changeShadow" v-if="boxshadow1">
<view class="shadowBox1">
<button class="shadowBox1Item_btn" open-type="share" bindtap="onShareButtonClick"/>
<button class="shadowBox1Item_btn" open-type="share" bindtap="onShareButtonClick" />
<view class="shadowBox1Item" @click="shareFriend">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
@ -231,9 +233,12 @@
</view>
<view class="line"></view>
<view class="shadowBoxInfo">
<image class="shadowboxInfo_left" :src="qrcodePath || 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/qrcode_placeholder.png'" mode="aspectFill"></image>
<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_1">{{ currentGG && currentGG.goods_name ? currentGG.goods_name : '' }}</view>
<view class="shadowboxInfo_right_1">{{ currentGG && currentGG.goods_name ?
currentGG.goods_name : '' }}</view>
<view class="shadowboxInfo_right_2">
长按识别小程序 <br />
数量有限马上抢购
@ -271,7 +276,8 @@
</view>
<view class="review-time">{{ comment.create_time }}</view>
</view>
<view class="user-purchase">已购 {{ comment.goods_name.goods_name }}{{ comment.goods_name.goods_spec }}</view>
<view class="user-purchase">已购 {{ comment.goods_name.goods_name }}{{
comment.goods_name.goods_spec }}</view>
<view class="review-content">{{ comment.user_review }}</view>
<view class="review-images" v-if="comment.review_image.length > 0">
<image :src="img" class="review-img" v-for="(img, idx) in comment.review_image" :key="idx">
@ -303,7 +309,8 @@
</view>
<view class="itemSizeBox" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@click="changeGG(item, index)">
<text class="itemSize" :class="index == currentGGIndex ? 'itemSize_active' : ''">{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}</text>
<text class="itemSize" :class="index == currentGGIndex ? 'itemSize_active' : ''">{{ item.goods_name }}
{{ item.goods_spec }} / {{ item.goods_unit }}</text>
</view>
</u-popup>
</view>
@ -321,36 +328,36 @@ import {
} from "../../../utils";
export default {
data() {
return {
picUrl,
top: "",
localHeight: "",
carNum: "",
prevCarNum: "",
currentNum: "0", //
type: "error",
boxshadow1: false,
boxshadow2: false,
id: "184",
info: "",
currentIndex: "1", //
return {
picUrl,
top: "",
localHeight: "",
carNum: "",
prevCarNum: "",
currentNum: "0", //
type: "error",
boxshadow1: false,
boxshadow2: false,
id: "184",
info: "",
currentIndex: "1", //
currentGG: "", //
currentGGIndex: "", //index
currentGG: "", //
currentGGIndex: "", //index
carOrderList: [],
//
showReviewPopup: false,
comments: [],
show: false,
showSize: false,
carOrderList: [],
//
showReviewPopup: false,
comments: [],
show: false,
showSize: false,
changeImg: "",
changeName: "",
changePrice: "",
selectedGoods: null, //
qrcodePath: null, //
};
changeImg: "",
changeName: "",
changePrice: "",
selectedGoods: null, //
qrcodePath: null, //
};
},
methods: {
changeIndex(e) {
@ -460,7 +467,7 @@ export default {
}
this.info = res;
console.log("this.info", this.info.commodity_goods_info_list);
//
let selectedIndex = 0;
if (this.selectedGoods) {
@ -471,7 +478,7 @@ export default {
}
}
}
this.currentGG = res.commodity_goods_info_list[selectedIndex];
console.log("this.currentGG", this.currentGG);
this.currentGGIndex = selectedIndex;
@ -533,11 +540,11 @@ export default {
let that = this;
//
const currentGoods = this.info.commodity_goods_info_list[this.currentGGIndex];
//
const currentQuantity = currentGoods.cart_count ? currentGoods.cart_count.count : 0;
const stockQuantity = currentGoods.stock_quantity || 0;
//
if (currentQuantity >= stockQuantity) {
uni.showToast({
@ -547,23 +554,22 @@ export default {
});
return;
}
//
let goods_id_and_count = [];
this.info.commodity_goods_info_list[this.currentGGIndex].cart_count = {
count: currentQuantity + 1,
};
this.info.commodity_goods_info_list.forEach((item) => {
goods_id_and_count.push({
goods_id: item.id,
count: item.cart_count ? item.cart_count.count : 0,
});
});
const params = {
goods_id_and_count: [
{
goods_id: this.info.commodity_goods_info_list[this.currentGGIndex].id,
count: this.info.commodity_goods_info_list[this.currentGGIndex].cart_count.count,
},
],
};
// update
request(apiArr.updateCar, "POST", {
goods_id_and_count,
}).then((res) => {
request(apiArr.updateCar, "POST", params).then((res) => {
that.getShopCar();
that.getShopCarList();
});
@ -638,7 +644,7 @@ export default {
}));
});
}
},onLoad(options) {
}, onLoad(options) {
const itemObj = JSON.parse(decodeURIComponent(options.item));
const meun = menuButtonInfo();
this.top = meun.top;

View File

@ -192,7 +192,16 @@ export default {
this.carList = JSON.parse(options.shopCarList)
},
onShow() {
this.getUserAddress()
//
const selectedAddress = uni.getStorageSync('selectedAddress');
if (selectedAddress && Object.keys(selectedAddress).length > 0) {
this.defAddress = selectedAddress;
//
uni.removeStorageSync('selectedAddress');
} else {
//
this.getUserAddress();
}
this.getGoodsList()
},
onUnload() {

View File

@ -78,7 +78,7 @@
{{ getPriceRange(item.commodity_goods_info_list) }}
</view>
<view class="CateInfo_Item_Money_right" v-if="!(item.commodity_goods_info_list.length > 1)">
<u-number-box :min="0" v-model="item.commodity_goods_info_list[0].quantity"
<u-number-box :value="item.commodity_goods_info_list[0].quantity || 0" :min="0"
@change="(value) => handleQuantityChange(value, item)">
<view slot="minus" class="minus">
<u-icon name="minus" size="20"></u-icon>
@ -128,7 +128,7 @@
<span></span>{{ ite.sales_price }}
</view>
<view class="GGItem_Con_Msg_right">
<u-number-box v-model="ite.quantity" :min="0"
<u-number-box :value="ite.quantity || 0" :min="0"
@change="(value) => handleQuantityChange(value, ite)">
<view slot="minus" class="minus">
<u-icon name="minus" size="20"></u-icon>
@ -293,25 +293,49 @@ export default {
},
//
handleQuantityChange(val, item) {
//
// valvalue
const quantity = typeof val === 'object' && val !== null && 'value' in val ? val.value : val;
//
let currentQuantity = 0;
let stockQuantity = 0;
let goodsToUpdate = null;
// items.commodity_goods_info_list[0].quantity
if (item.commodity_goods_info_list && item.commodity_goods_info_list.length) {
if (
item.commodity_goods_info_list &&
item.commodity_goods_info_list.length
) {
this.goodsId = item.commodity_goods_info_list[0].id;
// 使$set
this.$set(item.commodity_goods_info_list[0], 'quantity', quantity);
currentQuantity = item.commodity_goods_info_list[0].quantity || 0;
stockQuantity = item.commodity_goods_info_list[0].stock_quantity || 0;
goodsToUpdate = item.commodity_goods_info_list[0];
}
// ite.quantity
else {
this.goodsId = item.id;
// 使$set
this.$set(item, 'quantity', quantity);
currentQuantity = item.quantity || 0;
stockQuantity = item.stock_quantity || 0;
goodsToUpdate = item;
}
//
if (quantity > stockQuantity) {
uni.showToast({
title: "库存不足",
icon: 'none'
});
// UI
this.$nextTick(() => {
this.$set(goodsToUpdate, 'quantity', Math.min(currentQuantity, stockQuantity));
});
return;
}
// 使$set
this.$set(goodsToUpdate, 'quantity', quantity);
const params = {
user_id: uni.getStorageSync('userId'),
user_id: uni.getStorageSync("userId"),
goods_id_and_count: [
{
goods_id: this.goodsId,
@ -319,24 +343,26 @@ export default {
},
],
};
request(apiArr.updateCar, 'POST', params).then((res) => {
//
request(apiArr.updateCar, "POST", params).then((res) => {
console.log(res);
//
//
this.getShopCarList();
// goodsDetail
// goodsDetail
setTimeout(() => {
//
this.syncGoodsQuantities();
}, 100);
uni.showToast({
title: '操作成功!',
title: "操作成功!",
success() { },
});
});
},
//
syncGoodsQuantities() {
//

View File

@ -251,6 +251,13 @@
"navigationStyle": "custom"
}
},
{
"path": "defaultNotice/index",
"style": {
"navigationBarTitleText": "公告详情",
"navigationStyle": "custom"
}
},
{
"path": "applyOwer/index",
"style": {