Commit ccc34989 by weijiguang

修改bug

parent 075ab1a1
......@@ -18,20 +18,19 @@
<image class="thumbnail" v-else :src="item.pics.thumbnail" />
<view class="info">
<view class="goods-name">{{ item.name }}</view>
<view class="tags">
<view class="tags" v-if="item.tags">
<view class="tag-item" v-for="tag in item.tags" :key="tag">{{ tag }}</view>
</view>
<view class="dis-box">
<view class="dis">{{ item.desc || '' }}</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 class="desc-box">
<view class="desc">{{ item.desc || '' }}</view>
</view>
<view class="mon">
<view class="discount">{{ getPrice(item).discount || item.discount }}</view>
<view class="price"><text class="num">{{ getPrice(item).price || item.price }}</text>
</view>
<view class="discount">{{ getSku(item).discount }}</view>
<view class="price"><text class="num">{{ getSku(item).price }}</text></view>
</view>
</view>
<u-icon v-if="getSku(item).state==1" class="add" name="plus-circle-fill" color="#2979ff" @click.stop="getallNum(item, category)" size="22"></u-icon>
<div v-else style="color: orangered;font-size: 22rpx;">已售罄</div>
</view>
</view>
</scroll-view>
......@@ -54,20 +53,18 @@ export default {
}
},
methods: {
getPrice(data) {
getSku(data) {
const { skus } = data;
if (!skus && skus.length == 0) return;
const sku = data.skus.find(v => v.isDefault == 1 && v.state != 2) || data.skus.find(v => v.isDefault == 0 && v.state != 2);
if (sku) {
return sku
}
return {}
if (!skus && skus.length == 0) return { discount: data.discount, price: data.price};
const sku = data.skus.find(v => v.isDefault == 1 && v.state == 1)
|| data.skus.find(v => v.state == 1)
|| data.skus.find(v => v.isDefault == 1)
|| data.skus[0];
return sku;
},
createList(data) {
this.classifyData = data;
console.log(this.classifyData)
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this);
query.selectAll('.box').boundingClientRect(data => {
......@@ -412,15 +409,14 @@ export default {
flex: 1;
.goods-name {
height: 40rpx;
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
line-height: 40rpx;
}
.tags {
margin-top: -10rpx;
.tag-item {
height: 24rpx;
border-radius: 4rpx;
......@@ -435,7 +431,7 @@ export default {
}
}
.dis-box {
.desc-box {
display: flex;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
......@@ -443,36 +439,25 @@ export default {
color: #666666;
line-height: 40rpx;
.dis {
.desc {
flex: 1;
}
.add-btn {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #006ECF;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 36rpx;
}
}
.mon {
margin-top: -10rpx;
.discount {
display: inline-block;
height: 32rpx;
font-size: 24rpx;
font-family: Arial-BoldMT, Arial;
font-weight: normal;
color: #EB5F17;
line-height: 32rpx;
margin-right: 6rpx;
}
.price {
flex: 1;
display: inline-block;
height: 22rpx;
font-size: 20rpx;
......@@ -485,8 +470,6 @@ export default {
}
}
}
}
.isRecommend {
......
......@@ -38,11 +38,9 @@ export default {
$EventBus.$emit('getMenuList', item);
}
},
}
</script>
<style lang="scss" scoped>
.shop_item {
width: 90%;
......@@ -54,9 +52,6 @@ export default {
box-sizing: border-box;
margin: 30rpx auto;
.header {
display: flex;
align-items: center;
......@@ -92,7 +87,8 @@ export default {
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
width: 188rpx;
width: 150rpx;
min-width: 150rpx;
text-align: center;
height: 40rpx;
line-height: 40rpx;
......
......@@ -52,7 +52,7 @@
<text class="good-select-price-normal">{{ priceTotal.discount }}</text>
<text class="good-select-price-small">{{ priceTotal.price }}</text>
</div>
<div v-if="!size > 0">已售罄</div>
<div v-if="!size > 0" style="color: orangered">已售罄</div>
<div v-else class="set_size">
<u-icon name="minus-circle" @click="reduceGood" color="#2979ff" size="22"></u-icon>
<span>{{ size }}</span>
......
......@@ -85,6 +85,7 @@ export default {
border-radius: 10rpx;
text-align: center;
font-size: 20rpx;
line-height: 46rpx;
color: #fff;
}
}
......
......@@ -97,23 +97,23 @@
"custom": false,
"color": "#000000",
"selectedColor": "#006ECF",
"iconWidth": "32px",
"iconWidth": "22px",
"list": [
{
"iconPath": "/static/imgs/icon-unselect-menu.png",
"selectedIconPath": "/static/imgs/icon-selected-menu.png",
"iconPath": "/static/imgs/caidanweixuanzhong.png",
"selectedIconPath": "/static/imgs/caidanxuanzhong.png",
"pagePath": "pages/menu/menu",
"text": "菜单"
},
{
"iconPath": "/static/imgs/icon-unselect-order.png",
"selectedIconPath": "/static/imgs/icon-selected-order.png",
"iconPath": "/static/imgs/dingdanweixuanzhong.png",
"selectedIconPath": "/static/imgs/dingdanxuanzhong.png",
"pagePath": "pages/order/order",
"text": "订单"
},
{
"iconPath": "/static/imgs/icon-unselect-mine.png",
"selectedIconPath": "/static/imgs/icon-selected-mine.png",
"iconPath": "/static/imgs/wodeweixuanzhong.png",
"selectedIconPath": "/static/imgs/wodexuanzhong.png",
"pagePath": "pages/mine/mine",
"text": "我的"
}
......
......@@ -161,6 +161,7 @@ export default {
getLocation(callback) {
uni.getSetting({
success: (res) => {
// console.log(res.authSetting['scope.userLocation']);
if (!res.authSetting['scope.userLocation']) {
uni.authorize({
scope: 'scope.userLocation',
......@@ -171,6 +172,8 @@ export default {
},
fail: (err) => { //1.2 拒绝授权
wx.exitMiniProgram({ success: (res) => { } })
// console.log("获取位置失败")
uni.showToast({ "title" : "获取位置失败,请打开位置授权", icon : 'error' })
}
})
} else {
......
......@@ -53,7 +53,7 @@
<u-icon name="server-fill" color="#000000" size="16"></u-icon>
<button class="function_item_text" open-type="contact" bindcontact="handleContact"
session-from="sessionFrom">联系客服</button>
<u-icon name="arrow-right" class="function_item_icon" color="#000000" size="16"></u-icon>
<u-icon name="arrow-right" class="function_item_icon" color="#000000" size="12"></u-icon>
</view>
</view>
......@@ -279,6 +279,7 @@ export default {
}
.function_item {
display: flex;
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
......@@ -289,9 +290,11 @@ export default {
margin-top: 20rpx;
.function_item_text {
flex: 1;
margin: 0;
margin-left: 10rpx;
padding: 10rpx;
text-align: left;
line-height: 1;
background-color: #FFFFFF;
font-size: 24rpx;
......
......@@ -46,8 +46,9 @@
<view class="goods_text">
<view class="goods_title">{{ good.goodsName }}×{{ good.num }}</view>
<view class="goods_spce">
<span v-for="rule in jsonParse(good.specRuleDetail)" :key="rule.specId">
{{ rule.ruleName }}/
<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>
......@@ -200,6 +201,7 @@ export default {
background: #006ECF;
border-radius: 10rpx;
text-align: center;
line-height: 46rpx;
font-size: 20rpx;
color: #fff;
}
......
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