Commit 075ab1a1 by weijiguang

修改bug

parent 4c23005f
......@@ -23,7 +23,8 @@
</view>
<view class="dis-box">
<view class="dis">{{ item.desc || '' }}</view>
<view class="add-btn" @click.stop="getallNum(item, category)">+</view>
<!-- <view class="add-btn" @click.stop="getallNum(item, category)">+</view> -->
<u-icon name="plus-circle-fill" color="#2979ff" @click.stop="getallNum(item, category)" size="22"></u-icon>
</view>
<view class="mon">
<view class="discount">{{ getPrice(item).discount || item.discount }}</view>
......
......@@ -43,9 +43,11 @@
</view>
</view>
<view class="detail-right">
<text class="subtract" @click="reduce(item, index)">-</text>
<!-- <text class="subtract" @click="reduce(item, index)">-</text> -->
<u-icon class="subtract" name="minus-circle" @click="reduce(item, index)" color="#2979ff" size="22"></u-icon>
<text class="num">{{ item.num }}</text>
<text @click="add(item)" class="add">+</text>
<!-- <text @click="add(item)" class="add">+</text> -->
<u-icon class="add" name="plus-circle-fill" color="#2979ff" @click="add(item)" size="22"></u-icon>
</view>
</view>
</view>
......@@ -71,8 +73,6 @@
@getphonenumber="saveReserve">
付款
</button>
</view>
</view>
</template>
......@@ -329,27 +329,33 @@ export default {
}
.detail-right {
text {
width: 40rpx;
line-height: 40rpx;
text-align: center;
display: inline-block;
margin-right: 10rpx;
display: flex;
// text {
// width: 40rpx;
// line-height: 40rpx;
// text-align: center;
// display: inline-block;
// margin-right: 10rpx;
// color: #000000;
// }
// .subtract {
// float: left;
// position: relative;
// }
.num {
// float: left;
// position: relative;
margin-left: 15rpx;
margin-right: 15rpx;
color: #000000;
// font-size: 28rpx;
font-weight: bold;
}
.add {
color: #FFFFFF;
border-radius: 40rpx;
margin-right: 20rpx;
background: #006ECF;
}
.subtract {
border: 1rpx solid #006ECF;
border-radius: 40rpx;
color: #006ECF;
}
// .add {
// float: left;
// position: relative;
// }
}
}
}
......
......@@ -54,8 +54,7 @@
</div>
<div v-if="!size > 0">已售罄</div>
<div v-else class="set_size">
<u-icon name="minus-circle" @click="reduceGood" color="#2979ff" size="22">
</u-icon>
<u-icon name="minus-circle" @click="reduceGood" color="#2979ff" size="22"></u-icon>
<span>{{ size }}</span>
<u-icon name="plus-circle-fill" color="#2979ff" @click="addGood" size="22"></u-icon>
</div>
......
<template>
<scroll-view class="msg" scroll-y>
<view class="empty" v-show="empty == true">
<image class="empty_icon" src="/static/imgs/none_content.png"></image>
<view class="empty_text">---暂无消息,去品尝杯咖啡吧---</view>
<button class="empty_button" @click="goHome">去品尝</button>
</view>
<view class="msg_item" v-for="item in list" @click="toRead(item)" :key="item.id">
<view class="msg_item_title_time">
<view v-if="item.isRead == 1" class="sign"></view>
......@@ -16,6 +21,7 @@ import Mine from '@/request/mine'
export default {
data() {
return {
empty: false,
list: []
}
},
......@@ -27,6 +33,11 @@ export default {
async getList() {
const { data } = await Mine.getMsg();
this.list = data.rows
if(this.list && this.list.length>0) {
this.empty = false;
} else {
this.empty = true;
}
},
async toRead(item) {
const { id } = item
......@@ -34,6 +45,9 @@ export default {
if (res) {
this.getList()
}
},
goHome() {
uni.switchTab({ url: '/pages/menu/menu' });
}
}
......@@ -41,6 +55,40 @@ export default {
</script>
<style lang="scss" scoped>
.empty {
position: fixed;
/* 居中对齐begin */
left: 50%;
/* 兼容老版本的方法 */
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
margin-top: 200rpx;
.empty_icon {
width: 325rpx;
height: 296rpx;
}
.empty_text {
font-size: 20rpx;
margin-top: 10rpx;
font-family: ArialMT;
color: #666666;
text-align: center;
}
.empty_button {
width: 128rpx;
height: 46rpx;
margin-top: 10rpx;
background: #006ECF;
border-radius: 10rpx;
text-align: center;
font-size: 20rpx;
color: #fff;
}
}
.msg_item {
width: 100%;
height: 116rpx;
......
......@@ -120,11 +120,13 @@ export default {
User.getLocation((location) => {
uni.removeStorageSync('shopCarInfo');
$EventBus.$emit('updateCar');
this.buyType = 'A';
// this.buyType = '1';
let id = decodeURIComponent(q).split('?')[1].split('=')[1];
Menu.getScreenShopCar(id, location).then(res => {
const data = JSON.parse(res.data.data);
console.log(data);
this.shopData = data.shop;
this.buyType = data.screenNo;
this.goods = data.goods.map(item => {
const data = { ...item, skuId: item.sku.skuId, flag: true }
Utils.getallNum(data)
......
{
"name": "user",
"lockfileVersion": 2,
"requires": true,
"lockfileVersion": 1,
"packages": {
"": {
"dependencies": {
"uview-ui": "^2.0.31"
}
},
"node_modules/uview-ui": {
"version": "2.0.31",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz",
"integrity": "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
},
"dependencies": {
"uview-ui": {
"version": "2.0.31",
......
<template>
<view class="pages">
<view v-show="false">{{userms}}</view>
<view class="empty" v-show="userms && empty == true">
<image class="empty_icon" src="/static/imgs/none_content.png"></image>
<view class="empty_text">---您还未下单,下单品尝一下吧---</view>
<button class="empty_button" @click="goHome">去品尝</button>
</view>
<view class="empty" v-show="!userms">
<image class="empty_icon" src="/static/imgs/none_content.png"></image>
<view class="empty_text">---您还未登录,请先登录---</view>
<button class="empty_button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">去登录</button>
</view>
<view class="orders">
<view class="order_item" v-for="item in list" :key="item.id" @click="openInfo(item)">
<view class="order_header">
......@@ -65,12 +76,14 @@
import order from '@/request/order'
import Menu from '@/request/menu';
import Utils from '@/utils/utils'
import User from '@/request/user'
import { $EventBus } from "@/utils/EventBus";
export default {
name: 'order',
data() {
return {
empty: false,
list: []
}
},
......@@ -105,7 +118,12 @@ export default {
if (!this.userms) return
const { data } = await order.getMyOrder();
if (data) {
this.list = data.rows
this.list = data.rows;
if(this.list && this.list.length>0) {
this.empty = false;
} else {
this.empty = true;
}
} else {
uni.showToast({ title: '请登录!', icon: 'error' })
}
......@@ -119,11 +137,21 @@ export default {
}
}
},
goHome() {
uni.switchTab({ url: '/pages/menu/menu' });
},
// 手机号授权登录
getPhoneNumber(e) {
if (e.detail.errMsg == 'getPhoneNumber:ok') {
User.getPhoneNumber(e, this.getList);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
uni.showToast({ title: '已拒绝手机号授权', icon: 'error' })
}
},
openInfo(data) {
uni.setStorageSync('orderInfo', data);
let url = '/orderSubPackage/pages/orderInfo/index'
uni.navigateTo({ url })
},
jsonParse(json) {
const data = json || {}
......@@ -144,6 +172,39 @@ export default {
</script>
<style lang="scss" scoped>
.empty {
position: fixed;
/* 居中对齐begin */
left: 50%;
/* 兼容老版本的方法 */
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
margin-top: 200rpx;
.empty_icon {
width: 325rpx;
height: 296rpx;
}
.empty_text {
font-size: 20rpx;
margin-top: 10rpx;
font-family: ArialMT;
color: #666666;
text-align: center;
}
.empty_button {
width: 128rpx;
height: 46rpx;
margin-top: 10rpx;
background: #006ECF;
border-radius: 10rpx;
text-align: center;
font-size: 20rpx;
color: #fff;
}
}
.orders {
padding: 1rpx;
......
......@@ -45,7 +45,7 @@ export default {
return err;
});
},
uniLogin(res) {
uniLogin(res, callback) {
uni.login({
provider: 'weixin',
success: function (data) {
......@@ -66,6 +66,8 @@ export default {
uni.setStorage({ key: 'userInfo', data: data });
Store.commit('setUserInfo', data);
Store.commit('setAuthorization', token);
if(callback)
callback();
}
})
.catch((err) => {
......@@ -85,11 +87,11 @@ export default {
});
},
// 手机号授权登录
getPhoneNumber(res) {
getPhoneNumber(res, callback) {
uni.setStorage({ key: 'userPhoneInfo', data: res });
Store.commit('setUserPhoneInfo', res);
uni.setStorage({ key: 'phoneInfo', data: res });
this.uniLogin(res.detail);
this.uniLogin(res.detail, callback);
},
setAllow(allow) {
uni.$u.http
......
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