You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

726 lines
24 KiB

<template>
<view id="page">
<!-- 顶部 -->
<view class="top">
<NavBar ref="nav" navTitle=" " :showIcon="false" :start-change-height="page.startHeight"
:end-change-height="page.endHeight"></NavBar>
<!-- 用户信息 -->
<view class="userinfo" @click="showDiaLog">
<!-- 头像 -->
<image class="head-img" :src="userInfo.photo"></image>
<view class="name-mob" style="flex: 1;">
<!-- 昵称 -->
<text>{{userInfo.nick}}</text>
<!-- 手机 -->
<text style="font-size:14px;">{{userInfo.mobile}}</text>
</view>
<image src="../../static/more_white.png"
style="width: 30px;height: 30px;margin-right: 10px;flex-shrink: 0;" :rotate="0"></image>
</view>
<view style="display: flex;flex-direction: row;align-items: center; width: 100%;
position: absolute;bottom: 8vw; ">
<view style="flex: 1;"></view>
<view style="margin-right: 20px;display: flex;flex-direction: row;align-items: center;"
@click="makePhoneCall()">
<image src="../../static/userService.png" style="width: 25px;height: 25px;margin-right: 5px;">
</image>
<text style="color: #fff;font-size: 16px;">联系我们</text>
</view>
</view>
</view>
<view class="view" style="z-index: 2;">
<!-- 滚动视图 -->
<scroll-view scroll-y="true" class="scroll-view" bindscrolltoupper="upper" bindscrolltolower="lower"
bindscroll="scroll">
<!-- 预约记录 -->
<view class="icon-cow">
<text class="title">预约记录</text>
<view class="group">
<!-- 待提菜 -->
<view class="icon-name" @click="itemClick('待提菜')">
<view class="icon">
<image class="img" src="../../static/img/record-query/waiting_extraction.png"
mode="aspectFill"></image>
<!-- <view v-if="data.count>0" class="count">{{data.count}}</view> -->
</view>
<text class="name">待提取</text>
</view>
<!-- 已提菜 -->
<view class="icon-name" @click="itemClick('已提菜')">
<view class="icon">
<image class="img" src="../../static/img/record-query/extracted.png" mode="aspectFill">
</image>
</view>
<text class="name">已提取</text>
</view>
<view class="icon-name"></view>
<view class="icon-name"></view>
</view>
</view>
<!-- 订单记录 -->
<view class="icon-cow">
<text class="title">订单记录</text>
<view class="group">
<view class="icon-name" @click="itemClick('我的订单')">
<view class="icon">
<image class="img" src="../../static/img/record-query/obligation.png" mode="aspectFill">
</image>
<!-- <view class="count">{{data.count}}</view> -->
</view>
<text class="name">我的订单</text>
</view>
<view class="icon-name" @click="itemClick('已失效')">
<view class="icon">
<image class="img" src="../../static/img/record-query/invalid.png" mode="aspectFill">
</image>
</view>
<text class="name">已失效</text>
</view>
<view class="icon-name"></view>
<view class="icon-name"></view>
</view>
</view>
<!-- 失效菜品 -->
<!-- <view class="icon-cow">
<text class="title">失效菜品</text>
<view class="group">
<view class="icon-name" @click="itemClick('已失效')">
<view class="icon">
<image class="img" src="../../static/img/record-query/invalid.png" mode="aspectFill">
</image>
</view>
<text class="name">已失效</text>
</view>
<view class="icon-name"></view>
<view class="icon-name"></view>
<view class="icon-name"></view>
</view>
</view> -->
<!-- 转赠记录 -->
<view class="icon-cow">
<text class="title">转赠记录</text>
<view class="group">
<!-- 赠与我的 -->
<view class="icon-name" @click="itemClick('赠与我的')">
<view class="icon">
<image class="img" src="../../static/img/record-query/gifted_to_me.png"
mode="aspectFill"></image>
</view>
<text class="name">收到的礼品</text>
</view>
<!-- 我的转赠 -->
<view class="icon-name" @click="itemClick('我的转赠')">
<view class="icon">
<image class="img" src="../../static/img/record-query/my_gift.png" mode="aspectFill">
</image>
</view>
<text class="name">发出的礼品</text>
</view>
<view class="icon-name"></view>
<view class="icon-name"></view>
</view>
</view>
<!-- 推荐有礼 -->
<view style="display: flex;flex-direction: column; border-radius: 10px;background: #fff;
padding: 10px; margin-top: 10px;width: 100%;box-sizing: border-box; visibility: hidden;">
<view style="display: flex;flex-direction: row;justify-content: space-between;width: 100%;">
<view style="display: flex;flex-direction: row;align-items: center;flex: 1;">
<text
style="font-size: 15px;color: #101010;font-weight: 600;font-family: sans-serif;">推荐有礼</text>
<image src="../../static/share_gift.png"
style="margin-left: 5px; width: 20px;height: 20px;"></image>
</view>
<!-- <view style="display: flex;flex-direction: row;align-items: center;" @click="">
<text style="margin-right: 5px;color: #FF9900;font-size: 12px;">马上邀请</text>
<image src="../../static/right_icon.png" style="width: 15px;height: 15px;"></image>
</view> -->
<button open-type="share" style="margin-right: -20px;height: 20px;line-height: 20px;">
<view style="display: flex;flex-direction: row;align-items: center;">
<text style="margin-right: 5px;color: #FF9900;font-size: 12px;">马上邀请</text>
<image src="../../static/right_icon.png" style="width: 15px;height: 15px;"></image>
</view>
</button>
</view>
<text style="font-size: 12px;color: #4B4B4B; margin-top: 8px;"
v-if="recommend.remarks!=''">{{recommend.remarks}}</text>
<view style="display: flex;flex-direction: row;align-items: center; margin-top: 10px;"
v-if="recommend.vos.length>0">
<!-- <image :src="recommend.iconUrl" style="width: 30%;height: 100px; border-radius: 10px;"
mode="aspectFill">
</image> -->
<view
style="display: flex;flex-direction: column; margin-left:10px;width: 90%;box-sizing: border-box;">
<view v-for="(child,pos) in recommend.vos" :key="pos" @click="recommendClick(child)"
style="display: flex;flex-direction: column;width: 100%;box-sizing: border-box;">
<text
style="color: #424242; font-size: 13px;line-height: 25px;">*{{child.remarks}}</text>
</view>
</view>
</view>
</view>
<!-- </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: #333;font-size: 18px;font-weight: 600;font-family: sans-serif;">云菜窖</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>
<script>
export default {
data() {
return {
showModal1: false,
butdisabled: true,
page: {
startHeight: 0,
endHeight: 0
},
data: {
count: "1",
},
userInfo: {
nick: "",
mobile: "绑定手机号",
photo: "../../static/userHead.png"
},
dialogInfo: {
url: "../../static/userHead.png",
name: "",
mobile: ""
},
headImage: "",
recommend: {
vos: []
},
banKInfo: null
}
},
onShow() {
if (typeof this.$mp.page.getTabBar === 'function' && this.$mp.page.getTabBar()) {
this.$mp.page.getTabBar().setData({
selected: 2
})
}
if (getApp().globalData.mobile == '')
this.showModal1 = true
this.getUserInfo()
this.myRecommend()
},
onLoad(options) {
// this.request()
let info = uni.getSystemInfoSync();
this.page.startHeight = info.windowWidth * 0.6
this.page.endHeight = info.windowWidth * 0.8
},
onPageScroll(res) {
// 渐变
this.$refs.nav.defaultColorBgAlpha(res)
},
methods: {
makePhoneCall() {
wx.makePhoneCall({
// phoneNumber: '15632127890',
// phoneNumber: '13011576972',
// phoneNumber: '15511457061',
phoneNumber: '18712905926',
})
},
getUserInfo() {
let _this = this
_this.$api.getUserInfo(getApp().globalData.sid).then((resp) => {
_this.userInfo = {
nick: resp.nick,
mobile: resp.mobile,
photo: resp.photo
}
_this.headImage = resp.data.photo
}).catch(e => {
})
},
myRecommend() {
let _this = this
_this.$api.myRecommend(getApp().globalData.sid).then((resp) => {
console.log("myRecommend>>>", resp)
_this.recommend = resp
}).catch(e => {
})
},
recommendClick(item) {
console.log("recommendClick>>>", item)
// uni.navigateTo({
// url: '/pages/records/recommendRecords'
// })
},
showDiaLog() {
uni.navigateTo({
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)
// var data = res.target.dataset.info
// this.shareCard()
// // ①
// let shareData = JSON.stringify({
// // params: {
// // code: data.code,
// // codeKey: data.codeKey,
// // customerSid: ''
// // },
// // functionName: 'bindCard',
// // url: '/pages/detail/detail_affeection?sid=' + data.sid
// url: '/pages/home/myCellar?shareSid=' + getApp().globalData.sid,
// functionName: 'share'
// })
// // 转码传输
// let value = encodeURIComponent(shareData)
// return {
// title: '汇融农链-云菜窖',
// // ②
// path: '/pages/login/login?data=' + value,
// imageUrl: 'https://nhx.yxtsoft.com/image/share_invite.png', //自定义图片路径,显示图片长宽比是 5:4。
// success: function(res) {
// console.log('aaaa', "分享成功")
// },
// fail: function(res) {
// // 转发失败
// console.log('aaaa', "用户点击了取消")
// }
// }
let _this = this
const promise = new Promise(resolve => {
// 模拟网络请求
setTimeout(() => {
var params = {
customerSid: getApp().globalData.sid
}
_this.$api.recommendNewUsers(params).then((resp) => {
let shareData = JSON.stringify({
// params: {
// code: resp.transferCode,
// codeKey: resp.sid
// },
// functionName: 'bindCard',
// url: '/pages/bind/bind_cloudCard?code=' + resp
// .transferCode + "&codeKey=" + resp.sid
url: '/pages/home/myCellar?shareSid=' + getApp()
.globalData.sid + "&orderSid=" + resp.sid,
functionName: 'share'
})
// 转码传输
let value = encodeURIComponent(shareData)
resolve({
// title: '汇融农链-云菜窖',
// ②
path: '/pages/login/login?data=' + value,
imageUrl: 'https://nhx.yxtsoft.com/image/share_invite.png', //自定义图片路径,显示图片长宽比是 5:4。
})
}).catch(e => {
_this.shortToast('发生错误,请稍后再试.')
return
})
}, 0)
})
return promise
},
shareCard() {
let _this = this
var params = {
customerSid: getApp().globalData.sid
}
_this.$api.recommendNewUsers(params).then((resp) => {
}).catch(e => {})
},
itemClick(type) {
switch (type) {
case "待提菜":
// uni.navigateTo({
// url: '/pages/records/reservationRecords',
// })
uni.navigateTo({
url: '/pages/records/reservationRecords3',
})
break;
case "已提菜":
// uni.navigateTo({
// url: '/pages/records/reservationRecords2',
// })
uni.navigateTo({
url: '/pages/records/reservationRecords4',
})
break;
case "我的订单":
uni.navigateTo({
url: '/pages/records/orderRecords',
})
// uni.navigateTo({
// url:"/pages/records/orderDetail"
// })
break;
case "已失效":
uni.navigateTo({
url: '/pages/records/invalidGoods',
})
break;
case "待付款":
break;
case "已付款":
break;
case "赠与我的":
uni.navigateTo({
url: '/pages/records/transferRecords2',
})
break;
case "我的转赠":
uni.navigateTo({
url: '/pages/records/transferRecords',
})
break;
}
}
}
}
</script>
<style>
#page {
display: flex;
flex-direction: column;
height: 100vh;
background: -webkit-linear-gradient(left, #77E270, #9EECA0);
box-sizing: border-box;
}
/* 顶部 */
.top {
width: 100vw;
/* height: 126.66vw; */
height: 65vw;
/* 加载背景图 */
background-image: url(https://nhx.yxtsoft.com/image/my_bj_new.png);
/* 让背景图基于容器大小伸缩 */
background-size: 100% 100%;
position: relative;
/*父元素位置要设置为相对*/
}
/* 顶部-用户信息 */
.top .userinfo {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 25vw;
margin-left: 8vw;
}
/* 顶部-用户信息-头像 */
.top .userinfo .head-img {
width: 60px;
height: 60px;
border-radius: 50%;
}
/* 顶部-用户信息-名称手机 */
.top .userinfo .name-mob {
display: flex;
flex-direction: column;
margin-left: 10px;
}
/* 顶部-用户信息-名称手机-文本样式 */
.top .userinfo .name-mob text {
font-size: 16px;
color: #fff;
}
/* 视图 */
.view {
box-sizing: border-box;
margin-top: -15px;
background: #F7F7F7;
height: calc(100vh - 45px - 65vw);
;
width: 100%;
border-radius: 15px;
}
/* 滚动视图 */
.scroll-view {
height: 100%;
width: 100%;
padding: 15px;
border-radius: 15px;
box-sizing: border-box;
}
/* 图标显示行 */
.icon-cow {
display: flex;
flex-direction: column;
border-radius: 10px;
background: #fff;
padding: 12px;
margin-bottom: 10px
}
/* 图标显示行-标题 */
.icon-cow .title {
font-size: 15px;
color: #101010;
font-weight: 600;
font-family: sans-serif;
}
/* 图标显示行-图标群 */
.icon-cow .group {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
}
/* 图标显示行-图标群-图标和名称*/
.icon-cow .group .icon-name {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
/* 图标显示行-图标群-图标和名称-图标*/
.icon-cow .group .icon-name .icon {
position: relative;
width: 35px;
height: 35px;
}
/* 图标显示行-图标群-图标和名称-图标-图片*/
.icon-cow .group .icon-name .icon .img {
width: 28px;
height: 28px;
margin-left: 5px;
margin-top: 5px;
}
/* 图标显示行-图标群-图标和名称-图标-数量*/
.icon-cow .group .icon-name .icon .count {
border-radius: 50%;
text-align: center;
background: #f00;
color: #fff;
font-size: 8px;
position: absolute;
top: 2px;
right: 0px;
padding: 2px 5px;
width: auto;
}
/* 图标显示行-图标群-图标和名称-图标名称*/
.icon-cow .group .icon-name .name {
font-size: 13px;
color: #101010;
margin-top: 5px;
}
.sharebtn {
margin-right: -10px;
background: #f0f;
/* font-size: 12px;
color: #fff;
width: 30vw;
border-radius: 20px; */
}
.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: #fff;
color: #fff;
height: 42px;
line-height: 40px;
font-size: 13px;
padding: 0px 15px;
}
button::after {
border: 0;
}
</style>