Commit c0cb8258 by 宋冰琦

修改 我的订单页面 样式

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