Commit d8ec07d8 by songbingqi

完成部分开发

parent 78e599c7
......@@ -50,6 +50,7 @@ export default {
this.globalData.navHeight = this.globalData.navigationBarHeight + this.globalData.statusBarHeight
// #endif
Store.commit('setSystemBar', this.globalData)
},
onShow: function () {
},
......
<template>
<view class="overlay">
<view class="overlay" v-show="show">
<view class="main" :style="{'width':width+'rpx'}">
<view class="top" >
<view class="title">标题</view>
<view class="content">内容</view>
<view class="title">{{title}}</view>
<view class="content">{{content}}</view>
</view>
<view class="bottom">
<view class="close">取消</view>
<view class="submit">确定</view>
<view class="close" @click="close">取消</view>
<view class="submit" @click="ok">确定</view>
</view>
</view>
</view>
......@@ -15,17 +15,42 @@
<script>
export default {
props:{
width:{
props: {
show: {
type:Boolean,
default() {
return false
}
},
width: {
type:Number,
default(){
default() {
return 614
}
},
title: {
type:String,
default() {
return '标题'
}
},
content: {
type: String,
default() {
return '内容'
}
},
},
data() {
return {
}
},
methods: {
close() {
this.$emit('close')
},
ok() {
this.$emit('ok')
}
}
}
......@@ -38,14 +63,15 @@
width: 100%;
z-index: 999;
.top {
background: white;
padding: 60rpx 100rpx 0rpx 98rpx;
box-sizing: border-box;
.main {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background: white;
.top {
padding: 60rpx 100rpx 0rpx 98rpx;
.title {
text-align: center;
......@@ -55,18 +81,47 @@
color: #333333;
}
.content {
margin-top: 38.77rpx;
margin-bottom: 55rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 44rpx;
}
}
.bottom {
display: flex;
border-top: 2rpx solid #ECECEC;
.close {
text-align: center;
width: 100%;
height: 106rpx;
line-height: 106rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
border-right: 2px solid #ECECEC;
}
.submit {
text-align: center;
width: 100%;
height: 106rpx;
line-height: 106rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="page-body">
<scroll-view class="nav-left" :style="[heightStyle]" :class="[shopCarFlag?'shopCarcss':'' ]" scroll-y :scroll-top="scrollLeftTop" scroll-with-animation>
<scroll-view class="nav-left" :style="[heightStyle]" :class="[shopCarFlag||shopState===0?'shopCarcss':'' ]" scroll-y :scroll-top="scrollLeftTop" scroll-with-animation>
<view class="nav-left-item" v-for="item in classifyData" @click="categoryClickMain(item.id)" :key="item.id"
:class="item.id == categoryId ? 'active' : ''">
<!-- <view class="imgbox"><image :style="{'height':'100%','width':'100%'}" :src="'../../static/imgs/image_50_50.png'"/></view> -->
......@@ -8,7 +8,7 @@
<!-- <view :class="item.id == categoryId ? 'active-line' : ''"></view> -->
</view>
</scroll-view>
<scroll-view class="nav-right" :style="[heightStyle]" :class="[shopCarFlag?'shopCarcss':'' ]" scroll-y :scroll-top="scrollTop" @scroll="scroll" @touchstart="openScroll"
<scroll-view class="nav-right" :style="[heightStyle]" :class="[shopCarFlag||shopState===0?'shopCarcss':'' ]" scroll-y :scroll-top="scrollTop" @scroll="scroll" @touchstart="openScroll"
scroll-with-animation>
<view v-for="(category,index) in classifyData" :id="category.id" :key="category.id" class="box" :style="[goodBottom]">
<view :style="loads" class="right-title">{{ category.name }}</view>
......@@ -31,7 +31,7 @@
<view class="discount"><text class="moneyLog"></text>{{ Utils.isInteger(getSku(item).discount) }}</view>
<view class="price" v-if="getSku(item).price!=getSku(item).discount"><text class="num">{{ Utils.isInteger(getSku(item).price) }}</text></view>
</view>
<view class="addbox">
<view class="addbox" v-if="shopState!==0">
<image v-if="getSku(item).state==1" @click.stop="getallNum(item, category)" class="add" :src="'../../static/imgs/jiahao.png'" />
<!-- <u-icon class="add" name="plus-circle-fill" color="#0050F6" @click.stop="getallNum(item, category)" size="22"></u-icon> -->
<div v-if="getSku(item).state!=1" style="color: #858585;font-size: 20rpx;margin-top:16rpx">已售罄</div>
......@@ -51,7 +51,7 @@ import Utils from '@/utils/utils'
import Order from '@/request/order'
export default {
name: 'menuAssembly',
props:['buied'],
props:['buied','shopState'],
data() {
return {
heightStyle: {
......@@ -196,10 +196,14 @@ export default {
icon: 'none',
})
}else{
if(this.shopState!==0){
const {data} = await Order.checkSku({skuId:item.skus[0].skuId})
const {goods} = data.data
console.log(goods)
uni.setStorageSync('goodsInfo', JSON.stringify({ ...goods, category }));
} else {
uni.setStorageSync('goodsInfo', JSON.stringify({ ...item, category }));
}
uni.navigateTo({ url: '/menuSubPackage/pages/goodsDetail/goodsDetail' })
}
......
......@@ -73,15 +73,18 @@
</view>
</view>
<view class="end-right goSubmmit" @click="saveReserve" v-if="userms">
付款
结算
</view>
<!-- <view v-if="!userms" class="end-right goSubmmit" style="border-radius: 0;" open-type="getPhoneNumber" @getphonenumber="saveReserve">
</view> -->
<button v-if="!userms" class="end-right goSubmmit" style="border-radius: 0;" open-type="getPhoneNumber"
@getphonenumber="saveReserve">付款
@getphonenumber="saveReserve">结算
</button>
</view>
<view class="shopClose" v-if="shopState===0" :style="{'bottom':shopCar+'rpx'}">
<view class="content">门店已休息</view>
</view>
<show-toast ref="toast"/>
</view>
</template>
......@@ -92,6 +95,7 @@ import Menu from '@/request/menu';
import User from '@/request/user';
import Utils from '@/utils/utils'
export default {
props:['shopState'],
data() {
return {
showShopCar: false,//是否弹出购物车列表
......@@ -585,4 +589,26 @@ export default {
height: 100%;
}
}
.shopClose {
width: 100%;
height: 100rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #F0F0F0 100%);
position: fixed;
left: 0;
display: flex;
z-index: 10072;
align-items: center;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
text-align: center;
line-height: 100rpx;
.content {
width: 100%;
text-align: center;
}
}
</style>
......@@ -63,16 +63,16 @@
</view>
<view v-if="size > 0" class="good-select-cont">
<view>
<a class="good-select-btn1" @click="getallNum()" v-if="userms">
<a :class="shopState===0?'good-select-btn1-close':'good-select-btn1'" @click="getallNum()" v-if="userms">
立即购买
</a>
<button v-if="!userms" class="good-select-btn1" style="border-radius: 0;" open-type="getPhoneNumber"
<button v-if="!userms" :class="shopState===0?'good-select-btn1-close':'good-select-btn1'" style="border-radius: 0;" open-type="getPhoneNumber"
@getphonenumber="getallNum">
立即购买
</button>
</view>
<span class="good-select-btn2" @click="shoppingCart" type="default">加入购物袋</span>
<span :class="shopState===0?'good-select-btn2-close':'good-select-btn2'" @click="shoppingCart" type="default">加入购物袋</span>
</view>
</view>
</view>
......@@ -103,11 +103,13 @@ export default {
topBarHeight:0,
BottomSafeHeight:0,
Utils,
shopState:0,
}
},
onShow() {
uni.removeStorageSync('goodsList');
this.BottomSafeHeight = uni.getStorageSync('BottomSafeHeight')
this.shopState = Number(JSON.parse(uni.getStorageSync("shopInfo")).state)
},
mounted(){
// 获取胶囊坐标位置
......@@ -285,6 +287,9 @@ export default {
}
},
async shoppingCart() {
if(this.shopState===0){
return
}
if(this.checkNum('addShop')){
const { goods } = this;
const { data } = await Order.checkSku({skuId:goods.skuId})
......@@ -312,6 +317,9 @@ export default {
this.loginByPhoneNumber(e);
return
}
if(this.shopState===0){
return
}
const { goods } = this;
const { data } = await Order.checkSku({skuId:goods.skuId})
const {state,goods:newgoods} = data.data
......@@ -353,7 +361,7 @@ export default {
}
},
UseIt(ruleId) {
return this.available.indexOf(ruleId) == -1
return this.available.indexOf(ruleId) == -1&&this.shopState!==0
}
},
computed: {
......@@ -629,6 +637,20 @@ button[disabled]:not([type]) {
background: #FFFFFF;
}
.good-select-btn1-close {
width: 328rpx;
height: 104rpx;
border: 2rpx solid #999999;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
border-radius: 2px;
line-height: 104rpx;
text-align: center;
background: #FFFFFF;
}
.good-select-btn2 {
width: 328rpx;
height: 104rpx;
......@@ -641,6 +663,18 @@ button[disabled]:not([type]) {
color: #fff;
}
.good-select-btn2-close {
width: 328rpx;
height: 104rpx;
border-radius: 2px;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
background: #999999;
line-height: 104rpx;
text-align: center;
color: #fff;
}
.set_size {
display: flex;
width: 150rpx;
......
......@@ -2,7 +2,7 @@
<view>
<view class="page">
<view class="avatarBox">
<image class="avatar" src="../../../static/touxiang.png"/>
<image class="avatar" :src="userInfo.avatarUrl"/>
</view>
<view class="infoBox">
<view class="infoItem name">
......@@ -29,7 +29,7 @@
<view class="label">生日</view>
<view class="input">
<view class="birthdayBox">
<view class="text">{{userInfo.birthday}}</view>
<view class="text">{{birthdayComuted}}</view>
<view class="btn" @click="changeBirthday">修改</view>
</view>
</view>
......@@ -43,11 +43,22 @@
<u-datetime-picker
:show="timerShow"
v-model="value1"
:maxDate="(new Date()).valueOf()"
:minDate="-631094400"
@close="timerShow = false"
@confirm="choseTime"
v-model="userInfo.birthday"
mode="date"
></u-datetime-picker>
<Modal class="modal"/>
<Modal
class="modal"
title="确认更换生日日期?"
content="生日只可修改一次,是否想要修改?"
:show="birthdayModalShow"
@close="birthdayModalShow = false"
@ok="openTimer"
/>
</view>
</template>
......@@ -55,15 +66,27 @@
import Modal from '@/components/Modal/index.vue'
export default {
components: { Modal },
computed:{
birthdayComuted(){
const {birthday} = this.userInfo
const date = new Date(birthday)
const years = date.getFullYear()
const month = date.getMonth()+1
const days = date.getDate()
return years+'.'+month+'.'+days
}
},
data() {
return {
timerShow: false,
birthdayModalShow:false,
value1: Number(new Date()),
userInfo: {
avatarUrl:'../../../static/touxiang.png',
name:'脸脸',
phone:'152****8932',
sex:0,
birthday:'1996.5.29'
birthday:1658679810130
},
sexList:[
{
......@@ -77,28 +100,26 @@ export default {
]
}
},
mounted(){
// wx.showModal({
// title:'提示',
// content: "是否允许获取微信昵称和头像?",
// success:()=>{
// wx.getUserProfile({
// desc:'用于完善用户资料',
// success:(res)=>{
// console.log(res)
// }
// })
// }
// })
onLoad(option) {
const {info} = option
const {avatarUrl,gender,nickName} = JSON.parse(decodeURIComponent(info))
this.userInfo.avatarUrl = avatarUrl
this.userInfo.sex = gender
this.userInfo.name = nickName
const phoneNumber = uni.getStorageSync('phoneNumber')
this.userInfo.phone = phoneNumber.substr(0,3) + "****" + phoneNumber.substr(7)
},
methods:{
choseTime(e) {
this.userInfo.birthday = e.value
this.timerShow = false
},
openTimer() {
this.birthdayModalShow = false
this.timerShow = true
},
changeBirthday(){
wx.getUserProfile({
desc:'用于完善用户资料',
success:(res)=>{
console.log(res)
}
})
this.birthdayModalShow = true
},
selectedSex(val){
console.log(val)
......
......@@ -17,6 +17,7 @@
<a type="primary" @click="PayNow" v-if="orderInfo.state == 1" class="btn">立即支付</a>
<a type="primary" @click="toRefund" v-if="orderInfo.state == 2" class="btn_cancel">申请退款</a>
<a type="primary" @click="oneMoreOrder(orderInfo)" v-if="orderInfo.state != 1" class="btn">再来一单</a>
<a type="primary" @click="refundInfo" v-if="checkStatus(orderInfo.state,[12,13,14,15])" class="btn_cancel">退款详情</a>
</div>
</div>
<div class="order_flow" v-if="qrShow">
......@@ -131,6 +132,19 @@ export default {
}
},
methods: {
refundInfo() {
const { id } = this.orderInfo
uni.setStorageSync('orderId', id);
let url = '/orderSubPackage/pages/refundInfo/index'
uni.navigateTo({ url })
},
checkStatus(status,list){
if(list.includes(Number(status))){
return true
}else{
return false
}
},
getPx(rpx) {
// console.log((rpx * (wx.getSystemInfoSync().windowWidth / 750)));
// console.log(wx.getSystemInfoSync().windowWidth);
......
......@@ -61,6 +61,12 @@
<span>微信支付</span>
</div>
</div>
<div class="TermsOfAgreement" v-if="!TermsStatus">
<div @click="clickAgreeTerms" :class="agreeTerms?'checked':'nochecked'"></div>
<div class="content">
已阅读并同意<span @click="goTerms(1)">《用户协议》</span><span @click="goTerms(2)">《隐私权政策》</span><span @click="goTerms(3)">《支付协议》</span>
</div>
</div>
<div style="height:150rpx"></div>
<div class="footer" :style="{'padding-bottom':BottomSafeHeight+'px'}">
<div class="total">
......@@ -96,6 +102,7 @@ export default {
})
}
this.BottomSafeHeight = uni.getStorageSync('BottomSafeHeight')
this.TermsStatus = uni.getStorageSync('TermsStatus') || false
},
onLoad(option) {
if(!this.userms){
......@@ -162,7 +169,9 @@ export default {
duration: '',
loginInfo: '',
BottomSafeHeight:0,
Utils
Utils,
agreeTerms:true,
TermsStatus:true
}
},
computed: {
......@@ -203,6 +212,15 @@ export default {
}
},
methods: {
// 勾选隐私协议
clickAgreeTerms(){
this.agreeTerms = !this.agreeTerms
},
// 跳转隐私协议页面
goTerms(type) {
uni.navigateTo({url:'/orderSubPackage/pages/terms/index?type='+type})
},
itemReduction(discount, price, num) {
return ((price - discount) * num).toFixed(2)
},
......@@ -216,6 +234,12 @@ export default {
}
},
messageAndSave() {
if(!this.TermsStatus&&!this.agreeTerms){
this.showToast({ title: "请同意下方协议条款" });
return
}else{
if(this.agreeTerms)uni.setStorageSync('TermsStatus',true)
}
wx.requestSubscribeMessage({
// 'Oq_zfRWRXijvXenRmfD2PARgpvdYlbkjR4laxKmBqb0'
tmplIds: ['1uErx-15S-3vuopXSvvsxCeM_Jd-1iZC-nXzd2yW3QU', 'Q4HDwBEvpTXpwtZktqWm4SZOTEuQK1x48xjqjD2GqyM', 'Fu_CPIXa0cnJ4EDdVKqFQ3qqKJccMqt2oorI5mfNq74'],
......@@ -249,10 +273,12 @@ export default {
let res = await Utils.AssemblyOrder(this.shopData, this.totalPrice, this.totalNum, this.buyType, list);
if (res) {
// 发起订单
// if(this.agreeTerms)uni.setStorageSync('TermsStatus',true)
let orderInfo = await Menu.saveReserve(res);
if (orderInfo && orderInfo.data.code == 200) {
await Menu.requestPayment(orderInfo.data.data, res, this.buyType);
}
}
},
goCouponSelect() {
......@@ -570,6 +596,39 @@ export default {
}
}
.TermsOfAgreement {
display: flex;
align-items: center;
justify-content: flex-start;
margin-top: 31rpx;
margin-left: 32rpx;
.content {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 34rpx;
span {
color: #0050F6;
}
}
.checked {
width: 24rpx;
height: 24rpx;
background: url('../../../static/imgs/duigouxuanzhong.png') center center no-repeat;
background-size:100% 100%;
margin-right: 8rpx;
}
.nochecked {
width: 24rpx;
height: 24rpx;
background: url('../../../static/imgs/weixuanzhong.png') center center no-repeat;
background-size:100% 100%;
margin-right: 8rpx;
}
}
.footer {
height: 100rpx;
background: #fff;
......
<template>
<view>
<view class="topBar" :style="{'padding-top':systemBarHeight.statusBarHeight+'px','height':systemBarHeight.navigationBarHeight+'px'}">
<u-icon @click="goBackOrder" name="close" color="#000000" size="20"></u-icon>
<view class="tabTitle" :style="{'line-height':systemBarHeight.navigationBarHeight+'px'}">{{type===1?'用户协议':type===2?'隐私权政策':'支付协议'}}</view>
</view>
<view class="content" :style="{'margin-top':(systemBarHeight.statusBarHeight+systemBarHeight.navigationBarHeight+getPx(32))+'px'}" v-if="type===1">
<view class="title">HOOLOO咖啡用户协议</view>
</view>
<view class="content" :style="{'margin-top':(systemBarHeight.statusBarHeight+systemBarHeight.navigationBarHeight+getPx(32))+'px'}" v-else-if="type===2">
<view class="title">HOOLOO咖啡隐私权限协议</view>
</view>
<view class="content" :style="{'margin-top':(systemBarHeight.statusBarHeight+systemBarHeight.navigationBarHeight+getPx(32))+'px'}" v-else-if="type===2">
<view class="title">HOOLOO咖啡支付协议</view>
</view>
</view>
</template>
<script>
export default {
computed: {
systemBarHeight(){
return this.$store.state.user.systemBarHeight
}
},
data() {
return {
type:1
}
},
methods: {
getPx(rpx) {
// console.log((rpx * (wx.getSystemInfoSync().windowWidth / 750)));
// console.log(wx.getSystemInfoSync().windowWidth);
return rpx * (wx.getSystemInfoSync().windowWidth / 750);
},
goBackOrder() {
uni.navigateBack()
}
},
onLoad(option) {
this.type = option.type
}
}
</script>
<style scoped lang="scss">
.topBar{
top: 0;
position: fixed;
width: 100%;
background: #f5f5f9;
display: flex;
justify-content: flex-start;
align-items: center;
z-index: 9999;
padding-left: 34rpx;
// .arrow-left {
// margin-left: 20rpx;
// }
.tabTitle{
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
text-align: center;
width: 79%;
color: #333333
}
}
.content {
.title {
font-weight: bold;
font-size: 30rpx;
text-align: center;
}
}
</style>
\ No newline at end of file
......@@ -79,6 +79,14 @@
"navigationBarTitleText": "退款详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/terms/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
]
},
......
......@@ -48,7 +48,7 @@
<view class="barCode-dis">点击二维码取单</view>
</view>
</view>
<MenuAssembly ref="MenuAssembly" @getallNum="getallNum" :buied="buied"/>
<MenuAssembly ref="MenuAssembly" @getallNum="getallNum" :buied="buied" :shopState="shopInfo.state"/>
<!-- <u-picker @cancel="show = false" :show="show" :immediateChange="true" ref="uPicker" :columns="columns"
@confirm="confirm" keyName="name" @change="changeHandler"></u-picker> -->
<AreaPicker ref="AreaPicker" />
......@@ -57,7 +57,7 @@
style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" />
<show-toast ref="toast"/>
<taBar select="0"></taBar>
<ShopCar ref="shopbar" />
<ShopCar ref="shopbar" :shopState="shopInfo.state">
</view>
</template>
<script>
......
......@@ -139,7 +139,21 @@ export default {
}
page == 'order' && uni.switchTab({ url: '/pages/order/order' })
page == 'msg' && uni.navigateTo({ url: '/mineSubPackage/pages/msg/index' })
page == 'userInfo' && uni.navigateTo({ url: '/mineSubPackage/pages/userInfo/index' })
if(page == 'userInfo'){
wx.getUserProfile({
desc:'用于完善用户资料',
success:(res)=>{
const {userInfo} = res
const Info = JSON.stringify({
avatarUrl:userInfo.avatarUrl,
gender:userInfo.gender,
nickName:userInfo.nickName
})
// console.log(res)
page == 'userInfo' && uni.navigateTo({ url: '/mineSubPackage/pages/userInfo/index?info='+encodeURIComponent(Info) })
}
})
}
}
}
}
......
......@@ -6,12 +6,17 @@ const user = {
userPhoneInfo: null,
shopInfo: null, //店铺信息
orderId: null, //扫码进入时携带的订单id
systemBarHeight: {} //设备头部高度信息
},
mutations: {
// 保存扫码进入时携带的订单id
setOrderId(state, orderId) {
state.orderId = orderId;
},
// 保存设备tabHeight信息
setSystemBar(state, systemBarHeight) {
state.systemBarHeight = systemBarHeight
},
// 设置是否授权
setAuthorization(state, data) {
state.Authorization = data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment