Commit ccc34989 by weijiguang

修改bug

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