Browse Source

1111111

master
guoxing 1 year ago
parent
commit
10e42047e6
  1. 19
      App.vue
  2. 2
      pages/good/reservation.vue
  3. 89
      pages/home/cloudCard2.vue
  4. 126
      pages/home/myCellar.vue
  5. 122
      pages/home/myHome.vue
  6. 2
      pages/login/login.vue
  7. 44
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue

19
App.vue

@ -8,6 +8,7 @@
wxSilentLoginURL: config.baseUrl + "/lpkcustomer/wxSilentLogin",
sid: "",
token: "",
mobile: "",
isNewUser: "", // 0 1
isPurchase: "", // 1 0
navInfo: {
@ -15,16 +16,16 @@
}
},
onLaunch: function() {
wx.hideTabBar()
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
//
console.log(res.hasUpdate);
});
updateManager.onUpdateReady(function(res) {
uni.showModal({
title: '更新提示',
@ -36,16 +37,16 @@
}
}
});
});
updateManager.onUpdateFailed(function(res) {
//
});
this.globalData.navInfo = navParams()
// let _this = this;
// wx.login({
// success: function(res) {

2
pages/good/reservation.vue

@ -155,7 +155,7 @@
<view style="display: flex;flex-direction: row;align-items: center;">
<text style="font-size: 12px;color: #FF5006;">剩余</text>
<text style="font-size: 12px;color: #FF5006;">存量</text>
<text
style="font-size: 14px;color: #FF5006;">{{item.goodsNumber}}{{item.unitName}}</text>
</view>

89
pages/home/cloudCard2.vue

@ -96,6 +96,9 @@
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;">
@ -303,7 +306,36 @@
</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;
">
<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: #999;">(云菜窖)</text>
</view>
<view style="display: flex;margin-top: 10px;margin-left: 20px; margin-right: 20px;">
<text style="color: #999;text-indent:2em;">小程序需要获取您的手机号方便与您联系</text>
</view>
<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="button2" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">同意</button>
</view>
</view>
</view>
</view>
@ -316,6 +348,7 @@
imgList: [],
notData: false,
showModal: false,
showModal1: false,
showModal2: false,
newPerGiftList: [
@ -382,6 +415,10 @@
if (getApp().globalData.isPurchase == '1')
this.showModal = true
if (getApp().globalData.mobile == '')
this.showModal1 = true
},
onLoad(options) {
@ -450,6 +487,9 @@
colseDialog() {
this.showModal = false
},
colseDialog1() {
this.showModal1 = false
},
colseDialog2() {
this.showModal2 = false
},
@ -839,12 +879,46 @@
imageUrl: '/static/logo_icon.png', // PNGJPG
};
},
getPhoneNumber(e) {
let _this = this
console.log(e.detail.code)
_this.$api.getPhone({
userSid: getApp().globalData.sid,
code: e.detail.code
}).then((resp) => {
_this.showModal1 = false
getApp().globalData.mobile = resp
}).catch(e => {
console.log(e);
})
},
}
}
</script>
<style>
.button1 {
background: #fff;
color: #666;
flex: 1;
border-radius: 0px;
border-bottom-left-radius: 20px;
border: 1px solid #eee;
}
.button2 {
background: #fff;
color: #FF9900;
border-radius: 0px;
border-bottom-right-radius: 20px;
flex: 1;
border: 1px solid #eee;
}
button {
background: #FF9900;
color: #fff;
@ -905,6 +979,21 @@
justify-content: center;
align-items: center;
}
.modalDlg4 {
/* 设置超出滚动 */
overflow: auto;
position: fixed;
z-index: 100000;
display: flex;
width: 100%;
height: 100%;
top: 0;
left: 0;
flex-direction: column;
justify-content: center;
align-items: center;
}
.device-list {
box-sizing: border-box;

126
pages/home/myCellar.vue

@ -86,15 +86,19 @@
v-if="item.type=='2'">企业菜!</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between; margin-top: 15px;
<text :style="{color:(item.state == '1' ? '#999' : '#E36443')}"
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: 10px;
margin-right: 15px;">
<view style="display: flex;flex-direction: row;align-items: center;">
<text style="font-size: 12px;color: #666;">存量</text>
<text
<text :style="{color:(item.state == '1' ? '#999' : '#FF5006')}"
style="font-size: 14px;color: #FF5006;">{{item.goodsNumber}}{{item.unitName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<view style="display: flex;flex-direction: row;align-items: center;"
:class="item.state=='0'?'oragin':'gray'" >
<image src="../../static/jian_icon.png" mode="aspectFill"
style="width: 20px;height: 20px;" @click.stop="jian(item)"></image>
@ -307,6 +311,40 @@
</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;
">
<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: #999;">(云菜窖)</text>
</view>
<view style="display: flex;margin-top: 10px;margin-left: 20px; margin-right: 20px;">
<text style="color: #999;text-indent:2em;">小程序需要获取您的手机号方便与您联系</text>
</view>
<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="button2" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">同意</button>
</view>
</view>
</view>
</view>
</template>
@ -320,6 +358,7 @@
butdisabled: true,
transferNotData: true,
notData: false,
showModal1: false,
showModal3: false,
showModal4: false,
scrollHeight: "",
@ -385,6 +424,11 @@
}
console.log("mobile>>>", getApp().globalData.mobile);
if (getApp().globalData.mobile == '')
this.showModal1 = true
this.request()
this.getNotice()
this.page.count = 0
@ -524,19 +568,29 @@
})
},
jian(item) {
if (Number(item.count) > 0) {
item.count = Number(item.count) - 1
this.addGoods(item)
if (item.state == '0') {
if (Number(item.count) > 0) {
item.count = Number(item.count) - 1
this.addGoods(item)
}
this.getcount()
} else {
this.shortToast('商品已过提货日期')
}
this.getcount()
},
jia(item) {
if (item.count < item.goodsNumber)
item.count = Number(item.count) + 1
this.getcount()
this.addGoods(item)
if (item.state == '0') {
if (item.count < item.goodsNumber)
item.count = Number(item.count) + 1
this.getcount()
this.addGoods(item)
} else {
this.shortToast('商品已过提货日期')
}
},
getcount() {
@ -621,7 +675,9 @@
}
},
colseDialog1() {
this.showModal1 = false
},
colseDialog3() {
this.showModal3 = false
},
@ -697,6 +753,19 @@
return promise
},
getPhoneNumber(e) {
let _this = this
console.log(e.detail.code)
_this.$api.getPhone({
userSid: getApp().globalData.sid,
code: e.detail.code
}).then((resp) => {
_this.showModal1 = false
getApp().globalData.mobile = resp
}).catch(e => {
console.log(e);
})
},
}
@ -704,6 +773,18 @@
</script>
<style>
.gray {
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
transition: filter 0.2s;
}
.oragin {}
.swiper-box {
margin-top: -55px;
height: 50rpx;
@ -726,6 +807,25 @@
}
.button1 {
background: #fff;
color: #666;
flex: 1;
border-radius: 0px;
border-bottom-left-radius: 20px;
border: 1px solid #eee;
}
.button2 {
background: #fff;
color: #FF9900;
border-radius: 0px;
border-bottom-right-radius: 20px;
flex: 1;
border: 1px solid #eee;
}
button {
background: #FF9900;
color: #fff;

122
pages/home/myHome.vue

@ -164,6 +164,39 @@
<!-- </loading-state> -->
</scroll-view>
</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;
">
<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: #999;">(云菜窖)</text>
</view>
<view style="display: flex;margin-top: 10px;margin-left: 20px; margin-right: 20px;">
<text style="color: #999;text-indent:2em;">小程序需要获取您的手机号方便与您联系</text>
</view>
<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="button2" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">同意</button>
</view>
</view>
</view>
</view>
</template>
@ -171,6 +204,7 @@
export default {
data() {
return {
showModal1: false,
butdisabled: true,
page: {
startHeight: 0,
@ -203,6 +237,11 @@
})
}
if (getApp().globalData.mobile == '')
this.showModal1 = true
this.getUserInfo()
this.myRecommend()
},
@ -266,6 +305,23 @@
url: '/pages/me/base_info'
})
},
colseDialog1() {
this.showModal1 = false
},
getPhoneNumber(e) {
let _this = this
console.log(e.detail.code)
_this.$api.getPhone({
userSid: getApp().globalData.sid,
code: e.detail.code
}).then((resp) => {
_this.showModal1 = false
getApp().globalData.mobile = resp
}).catch(e => {
console.log(e);
})
},
onShareAppMessage: function(res) {
// console.log("res", res)
// console.log("data", res.target.dataset)
@ -426,6 +482,7 @@
background: -webkit-linear-gradient(left, #FEA65F, #FB9440);
box-sizing: border-box;
}
/* 顶部 */
.top {
@ -576,4 +633,69 @@
.sharebtn::after {
border: none;
}
/* 弹窗样式 */
.model {
position: absolute;
width: 100%;
height: 100%;
background: #000;
z-index: 100000;
opacity: 0.7;
top: 0;
left: 0;
}
.modalDlg4 {
/* 设置超出滚动 */
overflow: auto;
position: fixed;
z-index: 100000;
display: flex;
width: 100%;
height: 100%;
top: 0;
left: 0;
flex-direction: column;
justify-content: center;
align-items: center;
}
.button1 {
background: #fff;
color: #666;
flex: 1;
border-radius: 0px;
border-bottom-left-radius: 20px;
border: 1px solid #eee;
}
.button2 {
background: #fff;
color: #FF9900;
border-radius: 0px;
border-bottom-right-radius: 20px;
flex: 1;
border: 1px solid #eee;
}
button {
background: #FF9900;
color: #fff;
margin-top: 20px;
height: 40px;
width: 100%;
line-height: 40px;
text-align: center;
border-radius: 20px;
}
button::after {
border: 0;
}
</style>

2
pages/login/login.vue

@ -81,9 +81,11 @@
getApp().globalData.token = res.data.data.token
getApp().globalData.isNewUser = res.data.data.isNewUser
getApp().globalData.isPurchase = res.data.data.isPurchase
getApp().globalData.mobile = res.data.data.mobile
uni.setStorageSync("satoken", res.data.data.token)
console.log("人员sid", res.data.data.sid);
console.log("token", res.data.data.token);
console.log("mobile", res.data.data.mobile);
console.log("middleware>>>>>>>>>>>>", _this.middleware);

44
uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue

@ -59,7 +59,8 @@
<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar"
:selected="selected" :checkHover="range" @change="choiceDate" @handleMouse="handleMouse" :disabledDate="disabledDate">
:selected="selected" :checkHover="range" @change="choiceDate" @handleMouse="handleMouse"
:disabledDate="disabledDate">
</calendar-item>
</view>
</view>
@ -347,10 +348,12 @@
},
computed: {
timepickerStartTime() {
console.log("timepickerStartTime", this.calendar);
const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate
return activeDate === this.startDate ? this.selectableTimes.start : ''
},
timepickerEndTime() {
console.log("timepickerEndTime", this.calendar);
const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate
return activeDate === this.endDate ? this.selectableTimes.end : ''
},
@ -565,9 +568,31 @@
* @param {Object} name
*/
setEmit(name) {
console.log("setEmit ", name)
console.log("calendar ", this.calendar)
console.log("cale ", this.cale)
console.log("this.calendar ", this.calendar)
console.log("getFullYear ", new Date().getFullYear())
console.log("getMonth", new Date().getMonth() + 1)
console.log("getDate", new Date().getDate())
var nowDate = new Date()
var time = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
day: nowDate.getDate()
}
var applyDate = time.year + '-' + (time.month >= 10 ? time.month : '0' + time.month) + '-' + (time.day >=
10 ? time.day : '0' + time.day)
console.log("applyDate", applyDate)
if (!this.range) {
if (!this.calendar.fullDate) {
this.calendar = this.cale.getInfo(new Date())
this.calendar.fullDate = applyDate
// this.calendar = this.cale.getInfo(applyDate)
// console.log("calendar222 ", this.calendar)
this.tempSingleDate = this.calendar.fullDate
}
if (this.hasTime && !this.time) {
@ -597,12 +622,12 @@
* @param {Object} weeks
*/
choiceDate(weeks) {
if (weeks.disable)
return
if(this.disabledDate.includes(weeks.fullDate)){
if (weeks.disable)
return
if (this.disabledDate.includes(weeks.fullDate)) {
return
}
this.calendar = weeks
this.calendar.userChecked = true
//
@ -637,12 +662,13 @@
* @param {Object} date
*/
setDate(date) {
console.log("this.weeks88 ", date)
console.log("this.date ", date)
this.cale.setDate(date)
console.log("this.weeks88 ", this.cale)
console.log("this.cale ", this.cale)
this.weeks = this.cale.weeks
console.log("this.weeks88 ", this.weeks)
console.log("this.weeks ", this.weeks)
this.nowDate = this.cale.getInfo(date)
console.log("this.nowDate ", this.nowDate)
}
}
}

Loading…
Cancel
Save