This commit is contained in:
2024-03-01 17:47:44 +08:00
parent 2eb92c14f9
commit 73a486c2c6
12 changed files with 307 additions and 148 deletions

View File

@@ -75,14 +75,15 @@
<view style="display: flex;flex-direction: row;align-items: center;width: 100%; ">
<image :src="item.iconUrl"
style="width: 90px;height: 90px; border-radius: 10px; " mode="aspectFill"
@click="itemClick(item.goodsSid)"></image>
style="width: 90px;height: 90px; border-radius: 10px; " mode="aspectFill">
</image>
<view
style="display: flex;flex-direction: column;flex: 1; padding-bottom: 15px; margin-left: 10px;"
:style="{'border-bottom':(index == goods.length-1 ? 'none' : '1px #EFEFEF solid')}">
<text style="font-size: 13px;color: #000;">{{item.name}}</text>
<text style="font-size: 13px;color: #000;"
@click="itemClick(item.goodsSid)">{{item.name}}</text>
<text
style="font-size: 10px;color: #999;margin-top: 5px;">{{item.remark}}</text>
@@ -96,28 +97,32 @@
font-size: 10px;color: #EE752F; margin-left: 10px; margin-right: 10px; ">{{item.weight}}{{item.specificationUnit}}/{{item.unitName}}</text>
</view>
<text
style="font-size: 10px;color: #E36443;margin-top: 8px;">提货截止日{{item.periodValidity}}</text>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between; margin-top: 15px;
margin-right: 15px;">
<text
style="font-size: 14px;color: #FF5006;">{{item.mefenPrice}}</text>
style="font-size: 14px;color: #FF5006;">{{item.mefenPrice}}</text>
<view style="display: flex;flex-direction: row;align-items: center;">
<view v-if="!item.showCart"
style="display: flex;flex-direction: row;align-items: center;">
<image src="../../static/jian_icon.png" mode="aspectFill"
style="width: 20px;height: 20px;" @click.stop="jian(item)">
</image>
<text
style="font-size: 14px;margin-left: 8px;margin-right: 8px;">{{item.goodsNumber}}</text>
<text v-if="!item.showCart"
style="font-size: 14px;padding:5px; margin-left: 8px;margin-right: 8px;"
@click.stop="numberClick(item)">{{item.goodsNumber}}</text>
<image src="../../static/jia_icon.png" mode="aspectFill"
style="width: 20px;height: 20px;" @click.stop="jia(item)">
</image>
</view>
</view>
</view>
@@ -161,7 +166,7 @@
style="color: #888;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;">
{{data.brandVos[selectIndex2].qssl}}斤起订</view>
<view style="display: flex;flex-direction: row;align-items: center;"
<!-- <view style="display: flex;flex-direction: row;align-items: center;"
@click="showPop2()">
<text
style="color: #6190D8;font-size: 13px;height: 10px;line-height: 10px;margin-top: 5px;text-decoration:underline;font-style:oblique;">
@@ -169,7 +174,7 @@
<text
style="color: #6190D8;font-size: 13px;height: 10px;line-height: 10px;margin-top: 5px;margin-left: 2px;">
>></text>
</view>
</view> -->
</view>
</view>
@@ -306,17 +311,38 @@
</view>
<!-- 获取手机号弹框 -->
<!-- 输入数量 -->
<view class="model" catchtouchmove='preventTouchMove' v-if='showModal1' @click="colseDialog1()"></view>
<view class="modalDlg4" catchtouchmove='preventTouchMove' v-if='showModal1'>
<view
style="display: flex;flex-direction: column;background: #fff; width: 80%; border-radius: 20px;box-sizing: border-box;">
<input type="number" placeholder="请输入数量" v-model="goodsItem.goodsNumber"
style="margin: 20px;border: 1px #bbb solid; padding: 5px;line-height: 30px;height: 30px;border-radius: 6px;" />
<view
style="flex-shrink: 0;display: flex;flex-direction: row;align-items: center;justify-content: center;">
<button class="button1" @click="colseDialog1()">取消</button>
<button class="button2" @click="inCart()">确定</button>
</view>
</view>
</view>
<!-- 获取手机号弹框 -->
<view class="model" catchtouchmove='preventTouchMove' v-if='showModal4' @click="colseDialog4()"></view>
<view class="modalDlg4" catchtouchmove='preventTouchMove' v-if='showModal4'>
<view style="display: flex;flex-direction: column;background: #fff; width: 80%; border-radius: 20px;
">
<view
style="display: flex;flex-direction: column;align-items: center;justify-content: center;width: 100%;margin-top: 20px;">
<image src="../../static/logo_icon.png" style="width: 10vw;height: 10vw;" mode="scaleToFill">
</image>
<text style="margin-top: 5px;color: #333;font-size: 18px;font-weight: 600;font-family: sans-serif;">云菜窖</text>
<text
style="margin-top: 5px;color: #333;font-size: 18px;font-weight: 600;font-family: sans-serif;">云菜窖</text>
</view>
@@ -327,7 +353,7 @@
<view
style="flex-shrink: 0;display: flex;flex-direction: row;align-items: center;justify-content: center;margin-top: 20px;">
<button class="button1" @click="colseDialog1()">拒绝</button>
<button class="button1" @click="colseDialog4()">拒绝</button>
<button class="button2" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">同意</button>
</view>
@@ -337,6 +363,7 @@
</view>
</view>
</template>
@@ -349,6 +376,10 @@
notData: false,
showModal: false,
showModal1: false,
showModal4: false,
goodsItem: {
goodsNumber: "",
},
showModal2: false,
newPerGiftList: [
@@ -415,9 +446,8 @@
if (getApp().globalData.isPurchase == '1')
this.showModal = true
if (getApp().globalData.mobile == '')
this.showModal1 = true
this.showModal4 = true
},
@@ -493,6 +523,9 @@
colseDialog2() {
this.showModal2 = false
},
colseDialog4(){
this.showModal4 = false
},
getBannerList() {
let _this = this
_this.$api.bannerList().then((resp) => {
@@ -605,35 +638,36 @@
jian(item) {
const that = this
console.log("item》》》》", item)
if (Number(item.goodsNumber) == 1) {
// if (Number(item.goodsNumber) == 1) {
wx.showModal({
content: '确定不要了吗',
cancelText: "再想想",
confirmText: "删除",
confirmColor: "#FF9900",
success(res) {
if (res.confirm) {
console.log('用户点击确定')
item.goodsNumber = 0
item.subtotal = 0
// wx.showModal({
// content: '确定不要了吗',
// cancelText: "再想想",
// confirmText: "删除",
// confirmColor: "#FF9900",
// success(res) {
// if (res.confirm) {
// console.log('用户点击确定')
// item.goodsNumber = 0
// item.subtotal = 0
that.upDateShoppCart(item)
} else if (res.cancel) {
// that.upDateShoppCart(item)
// } else if (res.cancel) {
}
}
})
} else {
if (Number(item.goodsNumber) > 0) {
item.goodsNumber = Number(item.goodsNumber) - 1
}
// }
// }
// })
// } else {
if (Number(item.goodsNumber) > 0) {
item.goodsNumber = Number(item.goodsNumber) - 1
item.subtotal = Number(item.goodsNumber) * Number(item.mefenPrice)
that.upDateShoppCart(item)
}
// }
},
jia(item) {
@@ -642,6 +676,34 @@
this.upDateShoppCart(item)
},
numberClick(item) {
this.showModal1 = true
this.goodsItem = {
goodsSid: item.goodsSid,
goodsName: item.name,
goodsNumber: item.goodsNumber,
affiliation: this.data.brandVos[this.selectIndex2].id,
price: item.mefenPrice,
weight: item.weight,
customerSid: getApp().globalData.sid
}
},
inCart() {
let _this = this
// console.log("inCart",_this.goodsItem);
_this.$api.addShoppingCart(_this.goodsItem).then((resp) => {
_this.getgoods()
this.goodsItem = {}
this.showModal1 = false
}).catch(e => {
_this.getgoods()
this.goodsItem = {}
this.showModal1 = false
})
},
getallPrice() {
@@ -886,22 +948,21 @@
userSid: getApp().globalData.sid,
code: e.detail.code
}).then((resp) => {
_this.showModal1 = false
_this.showModal4 = false
getApp().globalData.mobile = resp
}).catch(e => {
console.log(e);
})
},
}
}
</script>
<style>
.button1 {
background: #fff;
color: #666;
flex: 1;
@@ -909,7 +970,7 @@
border-bottom-left-radius: 20px;
border: 1px solid #eee;
}
.button2 {
background: #fff;
color: #FF9900;
@@ -918,7 +979,7 @@
flex: 1;
border: 1px solid #eee;
}
button {
background: #FF9900;
color: #fff;
@@ -979,7 +1040,7 @@
justify-content: center;
align-items: center;
}
.modalDlg4 {
/* 设置超出滚动 */
overflow: auto;

View File

@@ -66,7 +66,7 @@
position: absolute;border-radius: 20px;color: #fff;">已失效</text>
<image :src="item.iconUrl"
style="width: 90px;height: 90px; border-radius: 10px;z-index: 100;"
mode="aspectFill" @click="itemClick(item.goodsSid)"></image>
mode="aspectFill"></image>
</view>
@@ -75,7 +75,8 @@
style="display: flex;flex-direction: column;flex: 1; padding-bottom: 15px; margin-left: 10px;"
:style="{'border-bottom':(index == goods.length-1 ? 'none' : '1px #EFEFEF solid')}">
<text style="font-size: 14px;color: #000;font-weight: 600;">{{item.name}}</text>
<text style="font-size: 14px;color: #000;font-weight: 600;"
@click="itemClick(item.goodsSid)">{{item.name}}</text>
<text
style="font-size: 10px;color: #999;margin-top: 5px;">{{item.remark}}</text>
@@ -364,7 +365,7 @@
<!-- 恢复预约提货弹框 -->
<view class="model" catchtouchmove='preventTouchMove' v-if='showModal2' ></view>
<!-- <view class="model" catchtouchmove='preventTouchMove' v-if='showModal2' ></view>
<view class="modalDlg2" catchtouchmove='preventTouchMove' v-if='showModal2'>
<view style="display: flex;flex-direction: column;justify-content: center;align-items: center;
@@ -381,7 +382,7 @@
</view>
</view>
</view> -->
@@ -468,11 +469,12 @@
}
console.log("mobile>>>", getApp().globalData.mobile);
if (getApp().globalData.mobile == '')
this.showModal1 = true
console.log("mobile>>>", getApp().globalData.mobile);
this.request()
this.getNotice()
this.page.count = 0
@@ -491,7 +493,7 @@
this.shareGift()
this.showPop()
},
filters: {
/**
@@ -527,25 +529,25 @@
},
},
methods: {
showPop() {
let timeOut = setInterval(() => {
if (this.countdown == 1) {
this.showModal2 = false
this.confirmText = "确定"
this.countdown = 5
clearInterval(timeOut)
} else {
this.countdown = this.countdown - 1;
this.confirmText = "我知道了" + "" + this.countdown + "s"
}
}, 1000)
},
getNotice() {
let _this = this
this.$api.getNotices().then((resp) => {

View File

@@ -44,7 +44,7 @@
mode="aspectFill"></image>
<!-- <view v-if="data.count>0" class="count">{{data.count}}</view> -->
</view>
<text class="name">待提</text>
<text class="name">待提</text>
</view>
<!-- 已提菜 -->
<view class="icon-name" @click="itemClick('已提菜')">
@@ -52,7 +52,7 @@
<image class="img" src="../../static/img/record-query/extracted.png" mode="aspectFill">
</image>
</view>
<text class="name">已提</text>
<text class="name">已提</text>
</view>
<view class="icon-name"></view>
<view class="icon-name"></view>
@@ -93,7 +93,7 @@
<image class="img" src="../../static/img/record-query/gifted_to_me.png"
mode="aspectFill"></image>
</view>
<text class="name">赠与我的</text>
<text class="name">收到的礼品</text>
</view>
<!-- 我的转赠 -->
<view class="icon-name" @click="itemClick('我的转赠')">
@@ -101,7 +101,7 @@
<image class="img" src="../../static/img/record-query/my_gift.png" mode="aspectFill">
</image>
</view>
<text class="name">我的转赠</text>
<text class="name">发出的礼品</text>
</view>
<view class="icon-name"></view>
<view class="icon-name"></view>