Browse Source

1、购买选择规格属性点不了

2、购物车列表点击管理 点击收藏功能去掉
3、下单点击积分抵扣没反应
4、待收货 列表查看物流点击没反应,详情查看物流可以点
5、添加地址选择地区无效
6、个人中心我的余额点进去点击账单记录一直正在加载中,点击下全部就出来了,应该你没带默认参数
8、订单点击评价没反应
9、小程序订单核销没上 你那边先根据路径判断隐藏下
10、我的推广,里面样式有问题,点击海报里面空白
11、分类点击 会分类Tab页分类一级比一级低
12、拼团详情客服功能隐藏去掉,其他地方有客服功能的都去掉
master
Gao xiaosong 5 years ago
parent
commit
728deeaa35
  1. 2
      assets/css/style.css
  2. 2
      assets/css/style.css.map
  3. 2
      assets/css/style.less
  4. 15
      components/OrderGoods.vue
  5. 24
      components/ProductWindow.vue
  6. 7
      pages/activity/DargainDetails/index.vue
  7. 3
      pages/activity/GoodsBargain/index.vue
  8. 4
      pages/activity/GroupDetails/index.vue
  9. 4
      pages/activity/SeckillDetails/index.vue
  10. 37
      pages/order/MyOrder/index.vue
  11. 115
      pages/order/OrderDetails/index.vue
  12. 3
      pages/order/OrderSubmission/index.vue
  13. 4
      pages/shop/GoodsClass/index.vue
  14. 97
      pages/shop/GoodsCon/index.vue
  15. 2
      pages/shop/ShoppingCart/index.vue
  16. 2
      pages/user/User/index.vue
  17. 13
      pages/user/address/AddAddress/index.vue
  18. 27
      pages/user/promotion/Poster/index.vue
  19. 15
      store/index.js
  20. 24
      utils/index.js
  21. 27
      utils/request.js

2
assets/css/style.css

File diff suppressed because one or more lines are too long

2
assets/css/style.css.map

File diff suppressed because one or more lines are too long

2
assets/css/style.less

@ -4494,7 +4494,7 @@ flex: 0 2.4*100rpx;
transform: rotate(180deg); transform: rotate(180deg);
} }
.bargain .bargainGang .title .pictrue img, .bargain .bargainGang .title .pictrue image,
.bargain .goodsDetails .title .pictrue image{ .bargain .goodsDetails .title .pictrue image{
width: 100%; width: 100%;
height: 100%; height: 100%;

15
components/OrderGoods.vue

@ -16,11 +16,7 @@
v-if="cart.productInfo.attrInfo" v-if="cart.productInfo.attrInfo"
>{{ cart.productInfo.attrInfo.suk }}</view> >{{ cart.productInfo.attrInfo.suk }}</view>
<view class="money font-color-red">{{ cart.truePrice }}</view> <view class="money font-color-red">{{ cart.truePrice }}</view>
<view <view class="evaluate" v-if="evaluate == 3" @click="routerGo(cart)">评价</view>
class="evaluate"
v-if="evaluate == 3"
@click="routerGo(cart)"
>评价</view>
</view> </view>
</view> </view>
</view> </view>
@ -41,9 +37,12 @@ export default {
}, },
mounted: function() {}, mounted: function() {},
methods: { methods: {
routerGo(item) { routerGo(cart) {
this.$yrouter.push({ path: '/pages/shop/GoodsEvaluate/index',query:{id:cart.unique} }); this.$yrouter.push({
}, path: "/pages/shop/GoodsEvaluate/index",
query: { id: cart.unique }
});
}
} }
}; };
</script> </script>

24
components/ProductWindow.vue

@ -65,13 +65,8 @@ export default {
data: function() { data: function() {
return {}; return {};
}, },
watch: {
attr:function(ne){
console.log(ne)
}
},
mounted: function() { mounted: function() {
console.log(this.attr) console.log(this.attr);
}, },
methods: { methods: {
closeAttr: function() { closeAttr: function() {
@ -84,16 +79,23 @@ export default {
this.$emit("changeFun", { action: "ChangeCartNum", value: 1 }); this.$emit("changeFun", { action: "ChangeCartNum", value: 1 });
}, },
tapAttr: function(indexw, indexn) { tapAttr: function(indexw, indexn) {
//
// H5attrH5
// props
// this.attr.productAttr[res.indexw].index = res.indexn;
let that = this; let that = this;
console.log(that.attr.productAttr);
console.log(that.attr.productAttr[indexw], indexw, indexn);
that.attr.productAttr[indexw].index = indexn;
let value = that let value = that
.getCheckedValue() .getCheckedValue()
.sort() .sort()
.join(","); .join(",");
console.log(value); that.$emit("changeFun", {
that.$emit("changeFun", { action: "ChangeAttr", value: value }); action: "ChangeAttr",
value: {
value,
indexw,
indexn
}
});
}, },
// //
getCheckedValue: function() { getCheckedValue: function() {

7
pages/activity/DargainDetails/index.vue

@ -84,9 +84,9 @@
<image src="@/static/images/left.png" /> <image src="@/static/images/left.png" />
</view> </view>
<view class="titleCon">砍价帮</view> <view class="titleCon">砍价帮</view>
<view class="pictrue on"> <!-- <view class="pictrue on">
<image src="@/static/images/left.png" /> <image src="@/static/images/left.png" />
</view> </view> -->
</view> </view>
<view class="list"> <view class="list">
<view <view
@ -507,6 +507,9 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.bargain{
background: #00c17b;
}
.bargainBnts { .bargainBnts {
display: flex; display: flex;
align-items: center; align-items: center;

3
pages/activity/GoodsBargain/index.vue

@ -78,4 +78,7 @@ export default {
</script> </script>
<style > <style >
page{
background: #00c17b;
}
</style> </style>

4
pages/activity/GroupDetails/index.vue

@ -107,10 +107,10 @@
</view> </view>
<view style="height:100rpx;"></view> <view style="height:100rpx;"></view>
<view class="footer-group acea-row row-between-wrapper"> <view class="footer-group acea-row row-between-wrapper">
<view class="customerSer acea-row row-center-wrapper row-column"> <!-- <view class="customerSer acea-row row-center-wrapper row-column">
<view class="iconfont icon-kefu"></view> <view class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</view> </view> -->
<view class="bnt bg-color-violet" @click="openAlone">单独购买</view> <view class="bnt bg-color-violet" @click="openAlone">单独购买</view>
<view class="bnt bg-color-red" @click="openTeam">立即开团</view> <view class="bnt bg-color-red" @click="openTeam">立即开团</view>
</view> </view>

4
pages/activity/SeckillDetails/index.vue

@ -39,13 +39,13 @@
</view> </view>
<view style="height:100rpx;"></view> <view style="height:100rpx;"></view>
<view class="footerRush acea-row row-between-wrapper"> <view class="footerRush acea-row row-between-wrapper">
<view <!-- <view
class="customerSer acea-row row-center-wrapper row-column" class="customerSer acea-row row-center-wrapper row-column"
@click="routerGo()" @click="routerGo()"
> >
<view class="iconfont icon-kefu"></view> <view class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</view> </view> -->
<view class="bnt bg-color-red" @click="tapBuy">立即购买</view> <view class="bnt bg-color-red" @click="tapBuy">立即购买</view>
</view> </view>
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow> <ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>

37
pages/order/MyOrder/index.vue

@ -107,31 +107,18 @@
</view> </view>
<view class="totalPrice"> <view class="totalPrice">
{{ order.cartInfo.length || 0 }}件商品总金额 {{ order.cartInfo.length || 0 }}件商品总金额
<text <text class="money font-color-red">{{ order.payPrice }}</text>
class="money font-color-red"
>{{ order.payPrice }}</text>
</view> </view>
<view class="bottom acea-row row-right row-middle"> <view class="bottom acea-row row-right row-middle">
<template v-if="order._status._type == 0"> <template v-if="order._status._type == 0">
<view class="bnt cancelBnt" @click="cancelOrder(order)">取消订单</view> <view class="bnt cancelBnt" @click="cancelOrder(order)">取消订单</view>
<view <view class="bnt bg-color-red" @click="goOrderDetails(order)">立即付款</view>
class="bnt bg-color-red"
@click="goOrderDetails(order)"
>立即付款</view>
</template> </template>
<template v-if="order._status._type == 1 || order._status._type == 9"> <template v-if="order._status._type == 1 || order._status._type == 9">
<view <view class="bnt bg-color-red" @click="goOrderDetails(order)">查看详情</view>
class="bnt bg-color-red"
@click="goOrderDetails(order)"
>查看详情</view>
</template> </template>
<template v-if="order._status._type == 2"> <template v-if="order._status._type == 2">
<view <view class="bnt default" @click="goLogistics(order)">查看物流</view>
class="bnt default"
@click="
$yrouter.push({ path: '/pages/order/Logistics/index',query:{id:order.orderId}})
"
>查看物流</view>
<view class="bnt bg-color-red" @click="takeOrder(order)">确认收货</view> <view class="bnt bg-color-red" @click="takeOrder(order)">确认收货</view>
</template> </template>
<template v-if="order._status._type == 3"> <template v-if="order._status._type == 3">
@ -144,16 +131,10 @@
<!--&gt;--> <!--&gt;-->
<!--查看物流--> <!--查看物流-->
<!--</view>--> <!--</view>-->
<view <view class="bnt bg-color-red" @click="goOrderDetails(order)">去评价</view>
class="bnt bg-color-red"
@click="goOrderDetails(order)"
>去评价</view>
</template> </template>
<template v-if="order._status._type === 4"> <template v-if="order._status._type === 4">
<view <view class="bnt bg-color-red" @click="goOrderDetails(order)">查看订单</view>
class="bnt bg-color-red"
@click="goOrderDetails(order)"
>查看订单</view>
</template> </template>
</view> </view>
</view> </view>
@ -231,6 +212,12 @@ export default {
type() {} type() {}
}, },
methods: { methods: {
goLogistics(order) {
this.$yrouter.push({
path: "/pages/order/Logistics/index",
query: { id: order.orderId }
});
},
goOrderDetails(order) { goOrderDetails(order) {
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/order/OrderDetails/index", path: "/pages/order/OrderDetails/index",

115
pages/order/OrderDetails/index.vue

@ -20,51 +20,75 @@
<view :class="{ on: status.type === 4 }">已完成</view> <view :class="{ on: status.type === 4 }">已完成</view>
</view> </view>
<view class="progress acea-row row-between-wrapper"> <view class="progress acea-row row-between-wrapper">
<view class="iconfont" :class="[ <view
class="iconfont"
:class="[
status.type === 0 || status.type === 9 status.type === 0 || status.type === 9
? 'icon-webicon318' ? 'icon-webicon318'
: 'icon-yuandianxiao', : 'icon-yuandianxiao',
status.type >= 0 ? 'font-color-red' : '' status.type >= 0 ? 'font-color-red' : ''
]"></view> ]"
></view>
<view class="line" :class="{ 'bg-color-red': status.type > 0 && status.type != 9 }"></view> <view class="line" :class="{ 'bg-color-red': status.type > 0 && status.type != 9 }"></view>
<view class="iconfont" :class="[ <view
class="iconfont"
:class="[
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao', status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
status.type >= 1 && status.type != 6 && status.type != 9 status.type >= 1 && status.type != 6 && status.type != 9
? 'font-color-red' ? 'font-color-red'
: '' : ''
]"></view> ]"
<view class="line" :class="{ ></view>
<view
class="line"
:class="{
'bg-color-red': 'bg-color-red':
status.type > 1 && status.type != 6 && status.type != 9 status.type > 1 && status.type != 6 && status.type != 9
}" }"
v-if="orderInfo.shipping_type === 1"></view> v-if="orderInfo.shipping_type === 1"
<view class="iconfont" :class="[ ></view>
<view
class="iconfont"
:class="[
status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao', status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao',
status.type >= 2 && status.type != 6 && status.type != 9 status.type >= 2 && status.type != 6 && status.type != 9
? 'font-color-red' ? 'font-color-red'
: '' : ''
]" ]"
v-if="orderInfo.shippingType === 1"></view> v-if="orderInfo.shippingType === 1"
<view class="line" :class="{ ></view>
<view
class="line"
:class="{
'bg-color-red': 'bg-color-red':
status.type > 2 && status.type != 6 && status.type != 9 status.type > 2 && status.type != 6 && status.type != 9
}"></view> }"
<view class="iconfont" :class="[ ></view>
<view
class="iconfont"
:class="[
status.type === 3 ? 'icon-webicon318' : 'icon-yuandianxiao', status.type === 3 ? 'icon-webicon318' : 'icon-yuandianxiao',
status.type >= 3 && status.type != 6 && status.type != 9 status.type >= 3 && status.type != 6 && status.type != 9
? 'font-color-red' ? 'font-color-red'
: '' : ''
]"></view> ]"
<view class="line" :class="{ ></view>
<view
class="line"
:class="{
'bg-color-red': 'bg-color-red':
status.type > 3 && status.type != 6 && status.type != 9 status.type > 3 && status.type != 6 && status.type != 9
}"></view> }"
<view class="iconfont" :class="[ ></view>
<view
class="iconfont"
:class="[
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao', status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
status.type >= 4 && status.type != 6 && status.type != 9 status.type >= 4 && status.type != 6 && status.type != 9
? 'font-color-red' ? 'font-color-red'
: '' : ''
]"></view> ]"
></view>
</view> </view>
</view> </view>
<!--<view--> <!--<view-->
@ -246,21 +270,30 @@
<view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请退款</view> <view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请退款</view>
</template> </template>
<template v-if="status.type == 2"> <template v-if="status.type == 2">
<view class="bnt default" @click=" <view
class="bnt default"
@click="
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }}) $yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
">查看物流</view> "
>查看物流</view>
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view> <view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
</template> </template>
<template v-if="status.type == 3 && orderInfo.deliveryType == 'express'"> <template v-if="status.type == 3 && orderInfo.deliveryType == 'express'">
<view class="bnt default" @click=" <view
class="bnt default"
@click="
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }}) $yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
">查看物流</view> "
>查看物流</view>
</template> </template>
<template v-if="status.type == 4"> <template v-if="status.type == 4">
<view class="bnt cancel" @click="delOrder">删除订单</view> <view class="bnt cancel" @click="delOrder">删除订单</view>
<view class="bnt default" @click=" <view
class="bnt default"
@click="
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }}) $yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
">查看物流</view> "
>查看物流</view>
</template> </template>
<template v-if="status.type == 6"> <template v-if="status.type == 6">
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view> <view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
@ -268,7 +301,13 @@
</view> </view>
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment> <Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
<view class="geoPage" v-if="mapShow"> <view class="geoPage" v-if="mapShow">
<iframe width="100%" height="100%" frameborder="0" scrolling="no" :src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"></iframe> <iframe
width="100%"
height="100%"
frameborder="0"
scrolling="no"
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"
></iframe>
</view> </view>
</view> </view>
</template> </template>
@ -429,18 +468,11 @@
</style> </style>
<script> <script>
import OrderGoods from "@/components/OrderGoods"; import OrderGoods from "@/components/OrderGoods";
import { import { orderDetail } from "@/api/order";
orderDetail
} from "@/api/order";
import Payment from "@/components/Payment"; import Payment from "@/components/Payment";
import DataFormat from "@/components/DataFormat"; import DataFormat from "@/components/DataFormat";
import { import { isWeixin, copyClipboard } from "@/utils";
isWeixin, import { mapGetters } from "vuex";
copyClipboard
} from "@/utils";
import {
mapGetters
} from "vuex";
import { import {
cancelOrderHandle, cancelOrderHandle,
takeOrderHandle, takeOrderHandle,
@ -508,10 +540,10 @@
if (!this.mapKey) if (!this.mapKey)
uni.showToast({ uni.showToast({
title: "暂无法使用查看地图,请配置您的腾讯地图key", title: "暂无法使用查看地图,请配置您的腾讯地图key",
icon: 'none', icon: "none",
duration: 2000 duration: 2000
}); });
return return;
this.mapShow = true; this.mapShow = true;
} }
}, },
@ -519,7 +551,8 @@
const history = this.app.history, const history = this.app.history,
last = history[history.length - 1] || {}; last = history[history.length - 1] || {};
if (last.name === "MyOrder") return this.$yrouter.back(); if (last.name === "MyOrder") return this.$yrouter.back();
else return this.$yrouter.replace({ else
return this.$yrouter.replace({
path: "/order/list/" path: "/order/list/"
}); });
}, },
@ -559,9 +592,9 @@
delivery_type = orderInfo.deliveryType, delivery_type = orderInfo.deliveryType,
seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0, seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0,
bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0, bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0,
combination_id = orderInfo.combinationId ? combination_id = orderInfo.combinationId
parseInt(orderInfo.combinationId) : ? parseInt(orderInfo.combinationId)
0; : 0;
status = { status = {
type: type, type: type,
class_status: 0 class_status: 0
@ -592,10 +625,10 @@
if (!id) { if (!id) {
uni.showToast({ uni.showToast({
title: "订单不存在", title: "订单不存在",
icon: 'none', icon: "none",
duration: 2000 duration: 2000
}); });
return return;
} }
orderDetail(id) orderDetail(id)
.then(res => { .then(res => {

3
pages/order/OrderSubmission/index.vue

@ -58,7 +58,7 @@
当前积分 当前积分
<text class="num font-color-red">{{ userInfo.integral || 0 }}</text> <text class="num font-color-red">{{ userInfo.integral || 0 }}</text>
</text> </text>
<checkbox value :checked="useIntegral ? true : false"></checkbox> <checkbox value="true" :checked="useIntegral ? true : false"></checkbox>
</label> </label>
</checkbox-group> </checkbox-group>
</view> </view>
@ -345,6 +345,7 @@
}, },
changeUseIntegral: function(e) { changeUseIntegral: function(e) {
// this.computedPrice(); // this.computedPrice();
console.log(e)
this.useIntegral = e.mp.detail.value[0]; this.useIntegral = e.mp.detail.value[0];
}, },
computedPrice() { computedPrice() {

4
pages/shop/GoodsClass/index.vue

@ -20,8 +20,8 @@
</view> </view>
</view> </view>
<view class="conter"> <view class="conter">
<view class="listw" v-for="(item, eq) in category" :key="eq"> <view v-for="(item, eq) in category" :key="eq">
<view v-if="eq === navActive"> <view class="listw" v-if="eq === navActive">
<view class="title acea-row row-center-wrapper" ref="title"> <view class="title acea-row row-center-wrapper" ref="title">
<view class="line"></view> <view class="line"></view>
<view class="name">{{ item.cateName }}</view> <view class="name">{{ item.cateName }}</view>

97
pages/shop/GoodsCon/index.vue

@ -6,8 +6,15 @@
<view class="money font-color-red"> <view class="money font-color-red">
<text></text> <text></text>
<text class="num">{{ storeInfo.price }}</text> <text class="num">{{ storeInfo.price }}</text>
<text class="vip-money" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">{{ storeInfo.vipPrice }}</text> <text
<image src="@/static/images/vip.png" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" /> class="vip-money"
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
>{{ storeInfo.vipPrice }}</text>
<image
src="@/static/images/vip.png"
class="image"
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
/>
</view> </view>
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view> <view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
</view> </view>
@ -20,7 +27,11 @@
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length"> <view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
<text class="hide line1 acea-row"> <text class="hide line1 acea-row">
<text>优惠券</text> <text>优惠券</text>
<text class="activity" v-for="(item, couponListEq) in couponList" :key="couponListEq">{{ item.use_min_price }}{{ item.coupon_price }}</text> <text
class="activity"
v-for="(item, couponListEq) in couponList"
:key="couponListEq"
>{{ item.use_min_price }}{{ item.coupon_price }}</text>
</text> </text>
<view class="iconfont icon-jiantou"></view> <view class="iconfont icon-jiantou"></view>
</view> </view>
@ -99,7 +110,11 @@
<view class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view> <view class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
<text>收藏</text> <text>收藏</text>
</view> </view>
<view @click="goShoppingCart()" class="item animated" :class="animated === true ? 'bounceIn' : ''"> <view
@click="goShoppingCart()"
class="item animated"
:class="animated === true ? 'bounceIn' : ''"
>
<view class="iconfont icon-gouwuche1"> <view class="iconfont icon-gouwuche1">
<text class="num bg-color-red" v-if="CartCount > 0">{{CartCount}}</text> <text class="num bg-color-red" v-if="CartCount > 0">{{CartCount}}</text>
</view> </view>
@ -116,7 +131,11 @@
</view> </view>
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop> <CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow> <ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus" :posterData="posterData"></StorePoster> <StorePoster
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo> <ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''"> <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<view class="item" v-if="weixinStatus === true" @click="setShareInfoStatus"> <view class="item" v-if="weixinStatus === true" @click="setShareInfoStatus">
@ -130,7 +149,13 @@
</view> </view>
<view class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></view> <view class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></view>
<view class="geoPage" v-if="mapShow"> <view class="geoPage" v-if="mapShow">
<iframe width="100%" height="100%" frameborder="0" scrolling="no" :src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey"></iframe> <iframe
width="100%"
height="100%"
frameborder="0"
scrolling="no"
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey"
></iframe>
</view> </view>
</view> </view>
</template> </template>
@ -156,18 +181,10 @@
getCollectDel, getCollectDel,
getUserInfo getUserInfo
} from "@/api/user"; } from "@/api/user";
import { import { isWeixin, PosterCanvas, handleQrCode } from "@/utils";
isWeixin,
PosterCanvas,
handleQrCode
} from "@/utils";
// import { wechatEvevt } from "@/libs/wechat"; // import { wechatEvevt } from "@/libs/wechat";
import { import { imageBase64 } from "@/api/public";
imageBase64 import { mapGetters } from "vuex";
} from "@/api/public";
import {
mapGetters
} from "vuex";
export default { export default {
name: "GoodsCon", name: "GoodsCon",
@ -237,7 +254,7 @@
}, },
computed: mapGetters(["isLogin"]), computed: mapGetters(["isLogin"]),
mounted: function() { mounted: function() {
console.log(this) console.log(this);
let url = handleQrCode(); let url = handleQrCode();
console.log(url); console.log(url);
if (url && url.productId) { if (url && url.productId) {
@ -305,11 +322,11 @@
// //
productCon: function() { productCon: function() {
let that = this; let that = this;
let form = {} let form = {};
if (this.$deviceType == 'app') { if (this.$deviceType == "app") {
form.form = 'app' form.form = "app";
} }
console.log(form, 2222) console.log(form, 2222);
getProductDetail(that.id, form) getProductDetail(that.id, form)
.then(res => { .then(res => {
that.$set(that, "storeInfo", res.data.storeInfo); that.$set(that, "storeInfo", res.data.storeInfo);
@ -485,27 +502,15 @@
}, },
// //
ChangeAttr: function(res) { ChangeAttr: function(res) {
let productSelectValue = this.productValue[res]; let productSelect = this.productValue[res.value];
if (productSelectValue) { if (productSelect) {
let productSelect = { this.attr.productAttr[res.indexw].index = res.indexn;
...this.attr.productSelect, this.$set(this.attr.productSelect, "image", productSelect.image);
image: productSelectValue.image, this.$set(this.attr.productSelect, "price", productSelect.price);
price: productSelectValue.price, this.$set(this.attr.productSelect, "stock", productSelect.stock);
stock: productSelectValue.stock, this.$set(this.attr.productSelect, "unique", productSelect.unique);
unique: productSelectValue.unique, this.$set(this.attr.productSelect, "cart_num", 1);
cart_num: 1 this.$set(this, "attrValue", res.value);
};
let attr = {
...this.attr,
productSelect
};
this.attr = attr;
// this.$set(this.attr.productSelect, "image", productSelect.image);
// this.$set(this.attr.productSelect, "price", productSelect.price);
// this.$set(this.attr.productSelect, "stock", productSelect.stock);
// this.$set(this.attr.productSelect, "unique", productSelect.unique);
// this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", res);
this.$set(this, "attrTxt", "已选择"); this.$set(this, "attrTxt", "已选择");
} else { } else {
this.$set(this.attr.productSelect, "image", this.storeInfo.image); this.$set(this.attr.productSelect, "image", this.storeInfo.image);
@ -569,8 +574,10 @@
productId: that.id, productId: that.id,
cartNum: that.attr.productSelect.cart_num, cartNum: that.attr.productSelect.cart_num,
new: news, new: news,
uniqueId: that.attr.productSelect !== undefined ? uniqueId:
that.attr.productSelect.unique : "" that.attr.productSelect !== undefined
? that.attr.productSelect.unique
: ""
}; };
postCartAdd(q) postCartAdd(q)
.then(function(res) { .then(function(res) {

2
pages/shop/ShoppingCart/index.vue

@ -130,7 +130,7 @@
<view class="placeOrder bg-color-red" @click="placeOrder">立即下单</view> <view class="placeOrder bg-color-red" @click="placeOrder">立即下单</view>
</view> </view>
<view class="button acea-row row-middle" v-else> <view class="button acea-row row-middle" v-else>
<view class="bnt cart-color" @click="collectAll">收藏</view> <!-- <view class="bnt cart-color" @click="collectAll">收藏</view> -->
<view class="bnt" @click="delgoods">删除</view> <view class="bnt" @click="delgoods">删除</view>
</view> </view>
</view> </view>

2
pages/user/User/index.vue

@ -96,7 +96,7 @@
</view> </view>
<view class="serviceList acea-row row-middle"> <view class="serviceList acea-row row-middle">
<template v-for="(item, MyMenusIndex) in MyMenus"> <template v-for="(item, MyMenusIndex) in MyMenus">
<view class="item" :key="MyMenusIndex" @click="goPages(MyMenusIndex)" v-if="item.url"> <view class="item" :key="MyMenusIndex" @click="goPages(MyMenusIndex)" v-if="item.url&&item.id!='230'">
<view class="pictrue"> <view class="pictrue">
<image :src="item.pic" /> <image :src="item.pic" />
</view> </view>

13
pages/user/address/AddAddress/index.vue

@ -12,7 +12,7 @@
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="name">所在地区</view> <view class="name">所在地区</view>
<view class="picker acea-row row-between-wrapper select-value form-control" > <view class="picker acea-row row-between-wrapper select-value form-control" >
<view class="address"> <view class="address" @tap="openAddres2">
<!-- <picker <!-- <picker
@columnchange="addRessColumnchange" @columnchange="addRessColumnchange"
@change="changeAddress" @change="changeAddress"
@ -23,7 +23,7 @@
<text class="uni-input" v-if="model2">{{model2}}</text> <text class="uni-input" v-if="model2">{{model2}}</text>
<text class="uni-input" v-else>请选择地区</text> <text class="uni-input" v-else>请选择地区</text>
</picker>--> </picker>-->
<text class="uni-input" @tap="openAddres2" >{{model2||'请选择'}}</text> <text class="uni-input" >{{model2||'请选择'}}</text>
<simple-address <simple-address
ref="simpleAddress" ref="simpleAddress"
:pickerValueDefault="cityPickerValueDefault" :pickerValueDefault="cityPickerValueDefault"
@ -226,3 +226,12 @@ if(this.address.province){
} }
}; };
</script> </script>
<style lang="less">
.address{
text{
width: 100%;
display: block;
}
}
</style>

27
pages/user/promotion/Poster/index.vue

@ -4,7 +4,12 @@
<swiper indicatorDots="true"> <swiper indicatorDots="true">
<block v-for="(item, infoIndex) in info" :key="infoIndex"> <block v-for="(item, infoIndex) in info" :key="infoIndex">
<swiper-item> <swiper-item>
<image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress /> <image
class="slide-image"
:src="item.wap_poster"
mode="widthFix"
show-menu-by-longpress
/>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
@ -14,9 +19,7 @@
</template> </template>
<script> <script>
// import { swiper, swiperSlide } from "vue-awesome-swiper"; // import { swiper, swiperSlide } from "vue-awesome-swiper";
import { import { getSpreadImg } from "@/api/user";
getSpreadImg
} from "@/api/user";
export default { export default {
name: "Poster", name: "Poster",
@ -61,9 +64,9 @@
methods: { methods: {
getIndex: function() { getIndex: function() {
let that = this; let that = this;
let form = {} let form = {};
if (this.$deviceType == 'app') { if (this.$deviceType == "app") {
form.form = 'app' form.form = "app";
} }
getSpreadImg(form).then( getSpreadImg(form).then(
res => { res => {
@ -72,7 +75,7 @@
err => { err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg, title: err.msg || err.response.data.msg,
icon: 'none', icon: "none",
duration: 2000 duration: 2000
}); });
} }
@ -86,7 +89,8 @@
if (!wx.saveImageToPhotosAlbum) { if (!wx.saveImageToPhotosAlbum) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。" content:
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
}); });
that.openDialogVisible = true; that.openDialogVisible = true;
@ -133,7 +137,10 @@
}; };
</script> </script>
<style scoped lang="less"> <style lang="less">
page {
height: 100%;
}
.distribution-posters { .distribution-posters {
height: 100%; height: 100%;
} }

15
store/index.js

@ -4,7 +4,7 @@ import Vuex from "vuex";
Vue.use(Vuex); Vue.use(Vuex);
const debug = process.env.NODE_ENV !== "production"; const debug = process.env.NODE_ENV !== "production";
import store from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
import { import {
getUserInfo getUserInfo
} from "@/api/user"; } from "@/api/user";
@ -18,8 +18,9 @@ const vuexStore = new Vuex.Store({
isAuthorizationPage: false, isAuthorizationPage: false,
// 是否授权 // 是否授权
isAuthorization: false, isAuthorization: false,
token: store.get(LOGIN_KEY) || null, // 不建议从这里取 token,但是删除掉会影响其他的页面
userInfo: store.get('userInfo'), token: cookie.get(LOGIN_KEY) || null,
userInfo: cookie.get('userInfo'),
$deviceType: null, $deviceType: null,
}, },
mutations: { mutations: {
@ -46,12 +47,12 @@ const vuexStore = new Vuex.Store({
}, },
LOGIN(state, token, expires_time) { LOGIN(state, token, expires_time) {
state.token = token; state.token = token;
store.set(LOGIN_KEY, token, expires_time); cookie.set(LOGIN_KEY, token, expires_time);
}, },
LOGOUT(state) { LOGOUT(state) {
state.token = null; state.token = null;
state.userInfo = null state.userInfo = null
store.clearAll() cookie.clearAll()
}, },
BACKGROUND_COLOR(state, color) { BACKGROUND_COLOR(state, color) {
state.color = color; state.color = color;
@ -99,9 +100,9 @@ const vuexStore = new Vuex.Store({
}, user) { }, user) {
commit("UPDATE_USERINFO", user); commit("UPDATE_USERINFO", user);
if (user) { if (user) {
store.set('userInfo', user) cookie.set('userInfo', user)
} else { } else {
store.set('userInfo', null) cookie.set('userInfo', null)
} }
}, },
changeAuthorizationPage({ changeAuthorizationPage({

24
utils/index.js

@ -218,7 +218,7 @@ export const login = (option) => {
console.log('登录成功4') console.log('登录成功4')
store.commit("LOGIN", data.token, dayjs(data.expires_time)); store.commit("LOGIN", data.token, dayjs(data.expires_time));
console.log('登录成功5') console.log('登录成功5')
console.log(store)
handleGetUserInfo() handleGetUserInfo()
}).catch(error => { }).catch(error => {
@ -259,6 +259,7 @@ export const login = (option) => {
} }
export const handleGetUserInfo = () => { export const handleGetUserInfo = () => {
console.log('登录后请求用户信息')
getUser().then(res => { getUser().then(res => {
console.log(res.data, '登录后的样式') console.log(res.data, '登录后的样式')
store.dispatch('setUserInfo', res.data) store.dispatch('setUserInfo', res.data)
@ -341,9 +342,25 @@ export function parseRoute($mp) {
} }
} }
export function auth() {
/**
* 如何判断权限?
* 用户如果登录了系统会留下两个东西一个是token一个是userInfo
* token存在会过期的问题如果长时间没有打开小程序会导致登录失效出现打开一个页面瞬间跳转到授权页面的问题
* 解决办法保存token的时候加上过期时间每次请求都取一下缓存里的token
* userInfo只是用来限时用户信息作用并不是很大
* ps只需要判断 token 是否存在即可
*/
console.log(cookie.get('login_status'), 'token')
if (cookie.get('login_status')) {
return true
}
return false
}
export const handleLoginStatus = (location, complete, fail, success) => { export const handleLoginStatus = (location, complete, fail, success) => {
console.log(location, '开始健全') console.log(location, '开始检验权限')
// 不登录可访问的页面 // 不登录可访问的页面
let page = [{ let page = [{
path: '/pages/Loading/index', path: '/pages/Loading/index',
@ -374,8 +391,7 @@ export const handleLoginStatus = (location, complete, fail, success) => {
path = location.path path = location.path
} }
console.log(store.getters.userInfo, '用户信息') if (!auth()) {
if (!store.getters.token) {
page.map((item) => { page.map((item) => {
console.log(item.path == path) console.log(item.path == path)
if (item.path == path) { if (item.path == path) {

27
utils/request.js

@ -2,6 +2,7 @@ import Fly from "flyio/dist/npm/wx";
import $store from "../store"; import $store from "../store";
import toLogin from "@/libs/login"; import toLogin from "@/libs/login";
import { VUE_APP_API_URL } from "@/config"; import { VUE_APP_API_URL } from "@/config";
import cookie from "@/utils/store/cookie";
const fly = new Fly() const fly = new Fly()
@ -28,28 +29,38 @@ fly.interceptors.response.use(
const defaultOpt = { login: true }; const defaultOpt = { login: true };
function baseRequest(options) { function baseRequest(options) {
const token = $store.state.token;
const headers = options.headers || {}; // 从缓存中获取 token 防止 token 失效后还会继续请求的情况
if (options.login) { const token = cookie.get('login_status');
headers["Authorization"] = "Bearer " + token;
// 合并传参过来的 headers
// 如果接口需要登录,携带 token 去请求
options.headers = {
...options.headers,
Authorization: options.login ? "Bearer " + token : null
} }
options.headers = headers; // 如果需要登录才可访问的接口没有拿到 token 视为登录失效
if (options.login && !token) { if (options.login === true && !token) {
// 跳转到登录或授权页面
toLogin(); toLogin();
// 提示错误信息
return Promise.reject({ msg: "未登录", toLogin: true }); return Promise.reject({ msg: "未登录", toLogin: true });
} }
// 结构请求需要的参数
const { url, params, data, login, ...option } = options const { url, params, data, login, ...option } = options
// 发起请求
return fly.request(url, params || data, { return fly.request(url, params || data, {
...option ...option
}).then(res => { }).then(res => {
console.log(res) console.log(res)
// console.log(url,params,data, ...option) // console.log(url,params,data, ...option)
const data = res.data || {}; const data = res.data || {};
if (res.status !== 200) if (res.status !== 200) {
return Promise.reject({ msg: "请求失败", res, data }); return Promise.reject({ msg: "请求失败", res, data });
}
if ([410000, 410001, 410002].indexOf(data.status) !== -1) { if ([410000, 410001, 410002].indexOf(data.status) !== -1) {
toLogin(); toLogin();
return Promise.reject({ msg: res.data.msg, res, data, toLogin: true }); return Promise.reject({ msg: res.data.msg, res, data, toLogin: true });

Loading…
Cancel
Save