Commit c0cb8258 by 宋冰琦

修改 我的订单页面 样式

parent 304eb752
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
background: #4C4C4C; background: #4C4C4C;
max-width: 266rpx; max-width: 266rpx;
position: fixed; position: fixed;
z-index: 10023; z-index: 999999;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
<view class="addbox"> <view class="addbox">
<image v-if="getSku(item).state==1" @click.stop="getallNum(item, category)" class="add" :src="'../../static/imgs/jiahao.png'" /> <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="#003AE9" @click.stop="getallNum(item, category)" size="22"></u-icon> --> <!-- <u-icon class="add" name="plus-circle-fill" color="#003AE9" @click.stop="getallNum(item, category)" size="22"></u-icon> -->
<div v-if="getSku(item).state!=1" style="color: #858585;font-size: 20rpx;">已售罄</div>
</view> </view>
</view> </view>
</view> </view>
<div v-if="getSku(item).state!=1" class="sellNull" style="color: orangered;font-size: 22rpx;">已售罄</div>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
@getphonenumber="saveReserve"> @getphonenumber="saveReserve">
</button> </button>
</view> </view>
<show-toast ref="toast"/>
</view> </view>
</template> </template>
...@@ -137,7 +138,7 @@ export default { ...@@ -137,7 +138,7 @@ export default {
//跳转到结算 //跳转到结算
saveReserve(e) { saveReserve(e) {
if(this.totalPrice < 0 || this.totalNum <= 0) { if(this.totalPrice < 0 || this.totalNum <= 0) {
uni.showToast({ title: '请选择商品', icon: 'error' }) this.showToast({ title: '请选择商品', icon: 'error' })
return; return;
} }
let Authorization = uni.getStorageSync('Authorization'); let Authorization = uni.getStorageSync('Authorization');
...@@ -159,7 +160,7 @@ export default { ...@@ -159,7 +160,7 @@ export default {
e.loginInfo = this.loginInfo e.loginInfo = this.loginInfo
User.getPhoneNumber(e); User.getPhoneNumber(e);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
uni.showToast({ title: '已拒绝手机号授权', icon: 'error' }) this.showToast({ title: '已拒绝手机号授权', icon: 'error' })
} }
}, },
change(e) { }, change(e) { },
...@@ -206,8 +207,9 @@ export default { ...@@ -206,8 +207,9 @@ export default {
s += Number(val.num); s += Number(val.num);
}, 0); }, 0);
let countOfOrder = uni.getStorageSync('countOfOrder'); let countOfOrder = uni.getStorageSync('countOfOrder');
console.log(s , countOfOrder)
if (s >= countOfOrder) { if (s >= countOfOrder) {
uni.showToast({ this.showToast({
title: '最多可一次购买'+countOfOrder+'杯', title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none' icon: 'none'
}); });
......
...@@ -31,10 +31,6 @@ Vue.prototype.loginByPhoneNumber = (e) => { ...@@ -31,10 +31,6 @@ Vue.prototype.loginByPhoneNumber = (e) => {
} }
}; };
Vue.prototype.$toast = (e) => {
console.log(Vuex)
}
Vue.config.productionTip = false; Vue.config.productionTip = false;
App.mpType = 'app'; App.mpType = 'app';
...@@ -42,6 +38,7 @@ const app = new Vue({ ...@@ -42,6 +38,7 @@ const app = new Vue({
...App, ...App,
store, store,
}); });
export default app
app.$mount(); app.$mount();
require('./request/index')(app); require('./request/index')(app);
// #endif // #endif
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
</view> </view>
</view> </view>
</view> </view>
<show-toast ref="toast"/>
</view> </view>
</template> </template>
...@@ -209,7 +210,7 @@ export default { ...@@ -209,7 +210,7 @@ export default {
} }
const [sku] = skus.filter(item => item.skuId == selectedSku); const [sku] = skus.filter(item => item.skuId == selectedSku);
if (!sku || skus.state == 2) { if (!sku || skus.state == 2) {
uni.showToast({ title: '本商品已经售罄', icon: 'none' }); this.showToast({ title: '本商品已经售罄', icon: 'none' });
callback && callback() callback && callback()
} else { } else {
const { category, ...goods } = this.goodInfo; const { category, ...goods } = this.goodInfo;
...@@ -228,7 +229,7 @@ export default { ...@@ -228,7 +229,7 @@ export default {
if (this.size < countOfOrder) { if (this.size < countOfOrder) {
this.size = this.size + 1; this.size = this.size + 1;
} else { } else {
uni.showToast({ this.showToast({
title: '最多可一次购买'+countOfOrder+'杯', title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none', icon: 'none',
}); });
...@@ -265,7 +266,7 @@ export default { ...@@ -265,7 +266,7 @@ export default {
e.loginInfo = this.loginInfo e.loginInfo = this.loginInfo
User.getPhoneNumber(e); User.getPhoneNumber(e);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
uni.showToast({ title: '已拒绝手机号授权', icon: 'error' }) this.showToast({ title: '已拒绝手机号授权', icon: 'error' })
} }
}, },
UseIt(ruleId) { UseIt(ruleId) {
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
<view v-if="userms" class="payment" @click="messageAndSave"></view> <view v-if="userms" class="payment" @click="messageAndSave"></view>
<button v-if="!userms" class="payment" style="border-radius: 0;" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"></button> <button v-if="!userms" class="payment" style="border-radius: 0;" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"></button>
</div> </div>
<show-toast ref="toast"/>
</view> </view>
</template> </template>
...@@ -212,7 +213,7 @@ export default { ...@@ -212,7 +213,7 @@ export default {
e.loginInfo = this.loginInfo e.loginInfo = this.loginInfo
User.getPhoneNumber(e); User.getPhoneNumber(e);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
uni.showToast({ title: '已拒绝手机号授权', icon: 'error' }) this.showToast({ title: '已拒绝手机号授权', icon: 'error' })
} }
}, },
messageAndSave() { messageAndSave() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{ {
"path": "pages/order/order", "path": "pages/order/order",
"style": { "style": {
"navigationBarTitleText": "订单", "navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
"custom": false, "custom": false,
"color": "#999999", "color": "#999999",
"selectedColor": "#003AE9", "selectedColor": "#003AE9",
"iconWidth": "32rpx", "iconWidth": "30rpx",
"borderStyle":"white", "borderStyle":"white",
"list": [ "list": [
{ {
......
...@@ -18,22 +18,30 @@ ...@@ -18,22 +18,30 @@
<h3 class="order_adrass">{{ item.shop.name }}</h3> <h3 class="order_adrass">{{ item.shop.name }}</h3>
<text class="order_time">{{ item.createdAt }}</text> <text class="order_time">{{ item.createdAt }}</text>
</view> </view>
<view class="order_status">{{ getStateText(item.state) }}></view> <view class="order_status">
<text>{{ getStateText(item.state) }}</text>
<image class="xiaojiantou" src="@/static/imgs/xiaojiantou.png"/>
</view>
</view> </view>
<div class="order_content"> <div class="order_content">
<view> <view class="order_content_box1">
<view class="goods_item" v-for="good in item.orderDetails" :key="good.id"> <view class="goods_item" v-for="good in item.orderDetails" :key="good.id">
<image class="goods_img" v-if="jsonParse(good.goods.pics).thumbnailApplet" <image class="goods_img" v-if="jsonParse(good.goods.pics).thumbnailApplet"
:src="jsonParse(good.goods.pics).thumbnailApplet"></image> :src="jsonParse(good.goods.pics).thumbnailApplet"></image>
<image v-else class="goods_img" :src="jsonParse(good.goods.pics).thumbnail"></image> <image v-else class="goods_img" :src="jsonParse(good.goods.pics).thumbnail"></image>
<view class="goods_text"> <view class="goods_text">
<view class="goods_title">{{ good.goodsName }}×{{ good.num }}</view> <view class="goods_title">{{ good.goodsName }}</view>
<view class="goods_spce"> <view class="goods_spce">
<span v-for="(rule, index) in jsonParse(good.specRuleDetail)" :key="rule.specId"> <view>
{{ rule.ruleName }} <span v-for="(rule, index) in jsonParse(good.specRuleDetail)" :key="rule.specId">
<span v-if="index!=jsonParse(good.specRuleDetail).length-1">/</span> {{ rule.ruleName }}
</span> <span v-if="index!=jsonParse(good.specRuleDetail).length-1">/</span>
</span>
</view>
<view>
×{{ good.num }}
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -45,14 +53,14 @@ ...@@ -45,14 +53,14 @@
</div> </div>
<view class="order_footer"> <view class="order_footer">
<view class="total"> <view class="total">
{{ orderDetailsSize(item.orderDetails) }}件商品 合计<text class="price">{{ item.amount }}</text> {{ orderDetailsSize(item.orderDetails) }}件商品 合计<text class="price">{{ item.amount }}</text>
</view> </view>
<a class="btn" @click.stop="PayNow(item)" v-if="item.state == 1" type="primary">立刻支付</a> <a class="btn" @click.stop="PayNow(item)" v-if="item.state == 1" type="primary">立刻支付</a>
<a class="btn" v-else @click.stop="oneMoreOrder(item)" type="primary">再来一单</a> <a class="btn" v-else @click.stop="oneMoreOrder(item)" type="primary">再来一单</a>
</view> </view>
</view> </view>
</view> </view>
<show-toast ref="toast"/>
</view> </view>
</template> </template>
...@@ -133,7 +141,7 @@ export default { ...@@ -133,7 +141,7 @@ export default {
}) })
const { data } = await order.moreOrder({ orderId: id, shopId }); const { data } = await order.moreOrder({ orderId: id, shopId });
if(!data || !data.data){ if(!data || !data.data){
uni.showToast({ title: "该订单中的商品已经售罄了" }); this.showToast({ title: "该订单中的商品已经售罄了" });
return; return;
} }
...@@ -146,7 +154,7 @@ export default { ...@@ -146,7 +154,7 @@ export default {
} }
}); });
if(!list || list.length<=0) { if(!list || list.length<=0) {
uni.showToast({ title: "该订单中的商品已经售罄了", icon: 'error' }); this.showToast({ title: "该订单中的商品已经售罄了", icon: 'error' });
return; return;
} }
list.forEach(nextData => { list.forEach(nextData => {
...@@ -165,7 +173,7 @@ export default { ...@@ -165,7 +173,7 @@ export default {
this.empty = true; this.empty = true;
} }
} else { } else {
uni.showToast({ title: '请登录!', icon: 'error' }) this.showToast({ title: '请登录!', icon: 'error' })
} }
}, },
async PayNow({ id }) { async PayNow({ id }) {
...@@ -186,7 +194,7 @@ export default { ...@@ -186,7 +194,7 @@ export default {
e.loginInfo = this.loginInfo e.loginInfo = this.loginInfo
User.getPhoneNumber(e, this.getList); User.getPhoneNumber(e, this.getList);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
uni.showToast({ title: '已拒绝手机号授权', icon: 'error' }) this.showToast({ title: '已拒绝手机号授权', icon: 'error' })
} }
}, },
openInfo(data) { openInfo(data) {
...@@ -252,12 +260,10 @@ export default { ...@@ -252,12 +260,10 @@ export default {
.order_item { .order_item {
width: 686rpx; width: 686rpx;
min-height: 370rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; margin: 30rpx auto 0;
margin: 15rpx auto 0;
box-sizing: border-box; box-sizing: border-box;
padding: 28rpx 32rpx; padding: 25rpx 32rpx;
.order_header { .order_header {
display: flex; display: flex;
...@@ -267,31 +273,41 @@ export default { ...@@ -267,31 +273,41 @@ export default {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #000000; color: #333333;
} }
.order_time { .order_time {
font-size: 20rpx; font-size: 24rpx;
font-family: ArialMT; font-family: ArialMT;
color: #666666; color: #999999;
} }
.order_status { .order_status {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 500; font-weight: 400;
color: #000000; color: #999999;
margin-top: 10rpx; display: flex;
align-items: baseline;
justify-content: flex-start;
.xiaojiantou {
width: 12rpx;
height: 16rpx;
margin-left: 5rpx;
}
} }
} }
.order_content { .order_content {
margin-top: 38rpx; margin-top: 42rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.order_content_box1{
flex: 1;
}
.qr_code { .qr_code {
font-size: 16rpx; font-size: 16rpx;
...@@ -300,43 +316,54 @@ export default { ...@@ -300,43 +316,54 @@ export default {
color: #666666; color: #666666;
line-height: 22rpx; line-height: 22rpx;
text-align: center; text-align: center;
margin-right: 15rpx; margin-right: 10rpx;
margin-top: 30rpx; margin-left: 39rpx;
.qr_code_img { .qr_code_img {
width: 76rpx; width: 76rpx;
height: 76rpx; height: 76rpx;
} }
.qr_text {
margin-top:10rpx;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
}
} }
.goods_item { .goods_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 10rpx;
.goods_img { .goods_img {
height: 80rpx; height: 96rpx;
width: 80rpx; width: 96rpx;
background-color: #eee; background-color: #eee;
} }
.goods_text { .goods_text {
margin-left: 38rpx; margin-left: 22rpx;
flex: 1;
.goods_title { .goods_title {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600; font-weight: 400;
color: #000000; color: #666666;
} }
.goods_spce { .goods_spce {
margin-top: 2rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #666666; color: #999999;
margin-top: 6rpx; display: flex;
justify-content: space-between;
align-items: center;
} }
} }
...@@ -348,29 +375,33 @@ export default { ...@@ -348,29 +375,33 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 50rpx; margin-top: 28rpx;
.total { .total {
font-size: 24rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
.price { .price {
color: #FF5200; font-size: 28rpx;
font-weight: 700 font-family: Futura-Medium, Futura;
font-weight: 500;
color: #666666;
letter-spacing: 1rpx;
} }
} }
.btn { .btn {
width: 144rpx; width: 167rpx;
height: 48rpx; height: 64rpx;
line-height: 48rpx; line-height: 64rpx;
background: #006ECF; font-family: PingFangSC-Regular, PingFang SC;
border-radius: 6rpx; background: #003AE9;
font-size: 24rpx; font-size: 24rpx;
margin: 0; margin: 0;
color: #fff; color: #fff;
font-weight: 400;
text-align: center; text-align: center;
} }
} }
......
import { $EventBus } from '@/utils/EventBus'; import { $EventBus } from '@/utils/EventBus';
import context from '../../main.js'
export default { export default {
// 获取菜单列表 // 获取菜单列表
getMenuList(id) { getMenuList(id) {
...@@ -12,7 +13,7 @@ export default { ...@@ -12,7 +13,7 @@ export default {
return res; return res;
}) })
.catch((err) => { .catch((err) => {
uni.showToast({ title: '服务器错误', icon: 'none' }); context.showToast({ title: '服务器错误', icon: 'none' });
}); });
}, },
// 获取点单屏幕的订单信息 // 获取点单屏幕的订单信息
...@@ -26,7 +27,7 @@ export default { ...@@ -26,7 +27,7 @@ export default {
return res; return res;
}) })
.catch((err) => { .catch((err) => {
uni.showToast({ context.showToast({
title: '服务器错误', title: '服务器错误',
icon: 'none', icon: 'none',
}); });
...@@ -64,7 +65,8 @@ export default { ...@@ -64,7 +65,8 @@ export default {
// 业务逻辑。。。 // 业务逻辑。。。
}, },
fail: function (err) { fail: function (err) {
uni.showToast({ console.log(context)
context.showToast({
title: '支付失败', title: '支付失败',
icon: 'error', icon: 'error',
}); });
......
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