Browse Source

优化细节

zyh
gaoxs 5 years ago
parent
commit
b4c76df22a
  1. 2
      assets/css/style.css
  2. 2
      assets/css/style.css.map
  3. 2
      assets/css/style.less
  4. 69
      components/CountDown.vue
  5. 12
      pages/activity/BargainRecord/index.vue
  6. 12
      pages/activity/DargainDetails/index.vue
  7. 12
      pages/activity/GoodsSeckill/index.vue
  8. 12
      pages/activity/GroupDetails/index.vue
  9. 74
      pages/activity/GroupRule/index.vue
  10. 12
      pages/activity/SeckillDetails/index.vue
  11. 2
      pages/shop/ShoppingCart/index.vue
  12. 130
      pages/user/User/index.vue
  13. 22
      pages/user/address/AddAddress/index.vue
  14. 2
      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

@ -6990,7 +6990,7 @@ flex: 0 2.4*100rpx;
} }
.product-con .footerRush .bnt { .product-con .footerRush .bnt {
width: 86%; width: 100%;
text-align: center; text-align: center;
line-height: 1*100rpx; line-height: 1*100rpx;
height: 100%; height: 100%;

69
components/CountDown.vue

@ -1,62 +1,57 @@
<template> <template>
<view class="time"> <view class="time">
{{ tipText }} <text v-if="rtipText">{{ rtipText }}</text>
<text class="styleAll" v-if="isDay === true">{{ day }}</text> <text class="styleAll" v-if="risDay === true">{{ rday }}</text>
<!-- <text class="timeTxt">{{ dayText }}</text> --> <text class="timeTxt" v-if="rdayText">{{ rdayText }}</text>
<text class="styleAll">{{ hour }}</text> <text class="styleAll">{{ hour }}</text>
<text class="timeTxt">{{ hourText }}</text> <text class="timeTxt" v-if="rhourText">{{ rhourText }}</text>
<text class="styleAll">{{ minute }}</text> <text class="styleAll">{{ minute }}</text>
<text class="timeTxt">{{ minuteText }}</text> <text class="timeTxt" v-if="rminuteText">{{ rminuteText }}</text>
<text class="styleAll">{{ second }}</text> <text class="styleAll">{{ second }}</text>
<!-- <text class="timeTxt">{{ secondText }}</text> --> <text class="timeTxt" v-if="rsecondText">{{ rsecondText }}</text>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "CountDown", name: "CountDown",
props: { props: [
// //
tipText: { 'tipText',
type: String, 'dayText',
default: "倒计时" 'hourText',
}, 'minuteText',
dayText: { 'secondText',
type: String, 'datatime',
default: "天" 'isDay'
}, ],
hourText: {
type: String,
default: "时"
},
minuteText: {
type: String,
default: "分"
},
secondText: {
type: String,
default: "秒"
},
datatime: {
type: Number,
default: 0
},
isDay: {
type: Boolean,
default: true
}
},
data: function() { data: function() {
return { return {
day: "00", day: "00",
hour: "00", hour: "00",
minute: "00", minute: "00",
second: "00" second: "00",
rtipText: "倒计时",
rdayText: "天",
rhourText: "时",
rminuteText: "分",
rsecondText: "秒",
rdatatime: 0,
risDay: true
}; };
}, },
created: function() { created: function() {
// this.show_time(); // this.show_time();
}, },
mounted: function() { mounted: function() {
console.log(this)
this.rtipText = this.$props.tipText;
this.rdayText = this.$props.dayText;
this.rhourText = this.$props.hourText;
this.rminuteText = this.$props.minuteText;
this.rsecondText = this.$props.secondText;
this.rdatatime = this.$props.datatime;
this.risDay = this.$props.isDay;
console.log(this.rdayText)
this.show_time(); this.show_time();
}, },
methods: { methods: {

12
pages/activity/BargainRecord/index.vue

@ -8,12 +8,12 @@
<view class="text acea-row row-column-around"> <view class="text acea-row row-column-around">
<view class="line1">{{ item.title }}</view> <view class="line1">{{ item.title }}</view>
<count-down <count-down
:is-day="true" :isDay="true"
:tip-text="'倒计时 '" :tipText="'倒计时 '"
:day-text="' 天 '" :dayText="' 天 '"
:hour-text="' 时 '" :hourText="' 时 '"
:minute-text="' 分 '" :minuteText="' 分 '"
:second-text="' 秒'" :secondText="' 秒'"
:datatime="item.datatime" :datatime="item.datatime"
></count-down> ></count-down>
<view class="money font-color-red"> <view class="money font-color-red">

12
pages/activity/DargainDetails/index.vue

@ -14,12 +14,12 @@
</view> </view>
</view> </view>
<count-down <count-down
:is-day="true" :isDay="true"
:tip-text="'倒计时 '" :tipText="'倒计时 '"
:day-text="' 天 '" :dayText="' 天 '"
:hour-text="' 时 '" :hourText="' 时 '"
:minute-text="' 分 '" :minuteText="' 分 '"
:second-text="' 秒'" :secondText="' 秒'"
:datatime="datatime" :datatime="datatime"
></count-down> ></count-down>
</view> </view>

12
pages/activity/GoodsSeckill/index.vue

@ -18,12 +18,12 @@
<view class="countDown font-color-red acea-row row-center-wrapper"> <view class="countDown font-color-red acea-row row-center-wrapper">
<view v-if="item.status === 0" class="activity">活动已结束</view> <view v-if="item.status === 0" class="activity">活动已结束</view>
<count-down <count-down
:is-day="false" :isDay="false"
:tip-text="'距结束仅剩 '" :tipText="'距结束仅剩 '"
:day-text="''" :dayText="false"
:hour-text="' : '" :hourText="' : '"
:minute-text="' : '" :minuteText="' : '"
:second-text="''" :secondText="false"
:datatime="datatime" :datatime="datatime"
v-if="item.status === 1" v-if="item.status === 1"
></count-down> ></count-down>

12
pages/activity/GroupDetails/index.vue

@ -50,12 +50,12 @@
<text>人成团</text> <text>人成团</text>
</view> </view>
<count-down <count-down
:is-day="false" :isDay="false"
:tip-text="'剩余 '" :tipText="'剩余 '"
:day-text="''" :dayText="false"
:hour-text="':'" :hourText="':'"
:minute-text="':'" :minuteText="':'"
:second-text="''" :secondText="false"
:datatime="item.stopTime" :datatime="item.stopTime"
></count-down> ></count-down>
</view> </view>

74
pages/activity/GroupRule/index.vue

@ -20,16 +20,28 @@
<view class="line"></view> <view class="line"></view>
<view class="name acea-row row-center-wrapper"> <view class="name acea-row row-center-wrapper">
<text>剩余</text> <text>剩余</text>
<count-down :is-day="false" :tip-text="''" :day-text="''" :hour-text="' : '" :minute-text="' : '" :second-text="''" <count-down
:datatime="pinkT.stopTime"></count-down> :isDay="false"
:tipText="false"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="pinkT.stopTime"
></count-down>
<text>结束</text> <text>结束</text>
</view> </view>
<view class="line"></view> <view class="line"></view>
</view> </view>
<view class="tips-warp">
<text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text> <text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text>
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}拼团失败</text> <text class="tips" v-else-if="pinkBool === -1">还差{{ count }}拼团失败</text>
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中还差{{ count }}人拼团成功</text> <text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中还差{{ count }}人拼团成功</text>
<view class="list acea-row row-middle" :class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']"> </view>
<view
class="list acea-row row-middle"
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']"
>
<view class="pictrue"> <view class="pictrue">
<image :src="pinkT.avatar" /> <image :src="pinkT.avatar" />
</view> </view>
@ -42,13 +54,29 @@
<image class="img-none" src="@/static/images/vacancy.png" /> <image class="img-none" src="@/static/images/vacancy.png" />
</view> </view>
</view> </view>
<view v-if="(pinkBool === 1 || pinkBool === -1) && count > 9" class="lookAll acea-row row-center-wrapper" @click="lookAll"> <view
v-if="(pinkBool === 1 || pinkBool === -1) && count > 9"
class="lookAll acea-row row-center-wrapper"
@click="lookAll"
>
{{ iShidden ? "收起" : "查看全部" }} {{ iShidden ? "收起" : "查看全部" }}
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text> <text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text>
</view> </view>
<view class="teamBnt bg-color-red" v-if="userBool === 1 && isOk == 0 && pinkBool === 0" @click="goPoster">邀请好友参团</view> <view
<view class="teamBnt bg-color-red" v-else-if="userBool === 0 && pinkBool === 0 && count > 0" @click="pay">我要参团</view> class="teamBnt bg-color-red"
<view class="teamBnt bg-color-red" v-if="pinkBool === 1 || pinkBool === -1" @click="goDetail(storeCombination.id)">再次开团</view> v-if="userBool === 1 && isOk == 0 && pinkBool === 0"
@click="goPoster"
>邀请好友参团</view>
<view
class="teamBnt bg-color-red"
v-else-if="userBool === 0 && pinkBool === 0 && count > 0"
@click="pay"
>我要参团</view>
<view
class="teamBnt bg-color-red"
v-if="pinkBool === 1 || pinkBool === -1"
@click="goDetail(storeCombination.id)"
>再次开团</view>
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1"> <view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
<text class="iconfont icon-guanbi3"></text> <text class="iconfont icon-guanbi3"></text>
<text>取消开团</text> <text>取消开团</text>
@ -61,22 +89,13 @@
</view> </view>
</template> </template>
<script> <script>
import CountDown from "@/components/CountDown"; import CountDown from "@/components/CountDown";
import { import { getCombinationPink, getCombinationRemove } from "@/api/activity";
getCombinationPink, import { postCartAdd } from "@/api/store";
getCombinationRemove import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
} from "@/api/activity";
import {
postCartAdd
} from "@/api/store";
import {
isWeixin,
parseQuery,
handleQrCode
} from "@/utils/index";
const NAME = "GroupRule"; const NAME = "GroupRule";
export default { export default {
name: NAME, name: NAME,
components: { components: {
CountDown CountDown
@ -137,7 +156,7 @@
.catch(err => { .catch(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
}); });
}); });
@ -216,5 +235,12 @@
this.iShidden = !this.iShidden; this.iShidden = !this.iShidden;
} }
} }
}; };
</script> </script>
<style lang="less">
.tips-warp{
text-align: center;
margin-top: 20rpx;
}
</style>

12
pages/activity/SeckillDetails/index.vue

@ -11,12 +11,12 @@
<view class="times"> <view class="times">
<view>距秒杀结束仅剩</view> <view>距秒杀结束仅剩</view>
<count-down <count-down
:is-day="false" :isDay="false"
:tip-text="''" :tipText="false"
:day-text="''" :dayText="false"
:hour-text="' : '" :hourText="' : '"
:minute-text="' : '" :minuteText="' : '"
:second-text="''" :secondText="false"
:datatime="datatime" :datatime="datatime"
></count-down> ></count-down>
</view> </view>

2
pages/shop/ShoppingCart/index.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="shoppingCart"> <view class="shoppingCart">
<view class v-if="userInfo.uid"> <view v-if="$store.getters.token||userInfo.uid">
<view class="labelNav acea-row row-around row-middle"> <view class="labelNav acea-row row-around row-middle">
<view class="item"> <view class="item">
<text class="iconfont icon-xuanzhong"></text> <text class="iconfont icon-xuanzhong"></text>

130
pages/user/User/index.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="user"> <view class="user">
<view v-if="userInfo.uid"> <view v-if="$store.getters.token||userInfo.uid">
<view class="header bg-color-red acea-row row-between-wrapper"> <view class="header bg-color-red acea-row row-between-wrapper">
<view class="picTxt acea-row row-between-wrapper"> <view class="picTxt acea-row row-between-wrapper">
<view class="pictrue"> <view class="pictrue">
@ -18,7 +18,12 @@
<text>ID{{ userInfo.uid || 0}}</text> <text>ID{{ userInfo.uid || 0}}</text>
<text class="iconfont icon-bianji1"></text> <text class="iconfont icon-bianji1"></text>
</view> </view>
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else> <button
open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"
class="binding"
v-else
>
<text>绑定手机号</text> <text>绑定手机号</text>
</button> </button>
</view> </view>
@ -31,7 +36,11 @@
<text>我的余额</text> <text>我的余额</text>
<text class="num">{{ userInfo.nowMoney || 0 }}</text> <text class="num">{{ userInfo.nowMoney || 0 }}</text>
</view> </view>
<view @click="goUserPromotion()" class="item" v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"> <view
@click="goUserPromotion()"
class="item"
v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"
>
<text>当前佣金</text> <text>当前佣金</text>
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text> <text class="num">{{ userInfo.brokeragePrice || 0 }}</text>
</view> </view>
@ -56,35 +65,50 @@
<view @click="goMyOrder(0)" class="item"> <view @click="goMyOrder(0)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dfk.png" /> <image src="@/static/images/dfk.png" />
<text class="order-status-num" v-if="userInfo.orderStatusNum.unpaidCount > 0">{{ userInfo.orderStatusNum.unpaidCount }}</text> <text
class="order-status-num"
v-if="userInfo.orderStatusNum.unpaidCount > 0"
>{{ userInfo.orderStatusNum.unpaidCount }}</text>
</view> </view>
<view>待付款</view> <view>待付款</view>
</view> </view>
<view @click="goMyOrder(1)" class="item"> <view @click="goMyOrder(1)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dfh.png" /> <image src="@/static/images/dfh.png" />
<text class="order-status-num" v-if="userInfo.orderStatusNum.unshippedCount > 0">{{ userInfo.orderStatusNum.unshippedCount }}</text> <text
class="order-status-num"
v-if="userInfo.orderStatusNum.unshippedCount > 0"
>{{ userInfo.orderStatusNum.unshippedCount }}</text>
</view> </view>
<view>待发货</view> <view>待发货</view>
</view> </view>
<view @click="goMyOrder(2)" class="item"> <view @click="goMyOrder(2)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dsh.png" /> <image src="@/static/images/dsh.png" />
<text class="order-status-num" v-if="userInfo.orderStatusNum.receivedCount > 0">{{ userInfo.orderStatusNum.receivedCount }}</text> <text
class="order-status-num"
v-if="userInfo.orderStatusNum.receivedCount > 0"
>{{ userInfo.orderStatusNum.receivedCount }}</text>
</view> </view>
<text>待收货</text> <text>待收货</text>
</view> </view>
<view @click="goMyOrder(3)" class="item"> <view @click="goMyOrder(3)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dpj.png" /> <image src="@/static/images/dpj.png" />
<text class="order-status-num" v-if="userInfo.orderStatusNum.evaluatedCount > 0">{{ userInfo.orderStatusNum.evaluatedCount }}</text> <text
class="order-status-num"
v-if="userInfo.orderStatusNum.evaluatedCount > 0"
>{{ userInfo.orderStatusNum.evaluatedCount }}</text>
</view> </view>
<text>待评价</text> <text>待评价</text>
</view> </view>
<view @click="goReturnList()" class="item"> <view @click="goReturnList()" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/sh.png" /> <image src="@/static/images/sh.png" />
<text class="order-status-num" v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text> <text
class="order-status-num"
v-if="userInfo.orderStatusNum.refundCount > 0"
>{{ userInfo.orderStatusNum.refundCount }}</text>
</view> </view>
<text>售后/退款</text> <text>售后/退款</text>
</view> </view>
@ -96,7 +120,12 @@
</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&&item.id!='230'"> <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>
@ -132,30 +161,21 @@
v-on:changeswitch="changeswitch" v-on:changeswitch="changeswitch"
:switchActive="switchActive" :switchActive="switchActive"
:login_type="userInfo.login_type" :login_type="userInfo.login_type"
></SwitchWindow> --> ></SwitchWindow>-->
</view> </view>
<Authorization v-if="!$store.getters.token" /> <Authorization v-if="!$store.getters.token" />
</view> </view>
</template> </template>
<script> <script>
import { import { getUser, getMenuUser, bindingPhone } from "@/api/user";
getUser, import { isWeixin, VUE_APP_RESOURCES_URL } from "@/utils";
getMenuUser, import SwitchWindow from "@/components/SwitchWindow";
bindingPhone import Authorization from "@/pages/authorization/index";
} from "@/api/user"; import { mapGetters } from "vuex";
import {
isWeixin,
VUE_APP_RESOURCES_URL
} from "@/utils";
import SwitchWindow from "@/components/SwitchWindow";
import Authorization from "@/pages/authorization/index";
import {
mapGetters
} from "vuex";
const NAME = "User"; const NAME = "User";
export default { export default {
name: NAME, name: NAME,
components: { components: {
SwitchWindow, SwitchWindow,
@ -304,7 +324,7 @@
} }
}, },
onShow() { onShow() {
console.log(this.$store.getters.token) console.log(this.$store.getters.token);
console.log(this.userInfo); console.log(this.userInfo);
if (this.$store.getters.token) { if (this.$store.getters.token) {
this.User(); this.User();
@ -312,53 +332,53 @@
this.isWeixin = isWeixin(); this.isWeixin = isWeixin();
} }
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
.footer-line-height { .footer-line-height {
height: 1*100rpx; height: 1 * 100rpx;
} }
.order-status-num { .order-status-num {
min-width: 0.33*100rpx; min-width: 0.33 * 100rpx;
background-color: #fff; background-color: #fff;
color: #00c17b; color: #00c17b;
border-radius: 15px; border-radius: 15px;
position: absolute; position: absolute;
right: -0.14*100rpx; right: -0.14 * 100rpx;
top: -0.15*100rpx; top: -0.15 * 100rpx;
font-size: 0.2*100rpx; font-size: 0.2 * 100rpx;
padding: 0 0.08*100rpx; padding: 0 0.08 * 100rpx;
border: 1px solid #00c17b; border: 1px solid #00c17b;
} }
.pictrue { .pictrue {
position: relative; position: relative;
} }
.switch-h5 { .switch-h5 {
margin-left: 0.2*100rpx; margin-left: 0.2 * 100rpx;
} }
.binding { .binding {
margin-top: 0.1*100rpx; margin-top: 0.1 * 100rpx;
display: inline-block; display: inline-block;
padding: 0.05*100rpx 0.2*100rpx; padding: 0.05 * 100rpx 0.2 * 100rpx;
background-color: #ca1f10; background-color: #ca1f10;
border-radius: 50px; border-radius: 50px;
font-size: 0.22*100rpx; font-size: 0.22 * 100rpx;
line-height: 1.5; line-height: 1.5;
border: 1px solid #e8695e; border: 1px solid #e8695e;
color: #ffffff; color: #ffffff;
} }
.by{ .by {
text-align:center; text-align: center;
margin-top: 30rpx margin-top: 30rpx;
} }
.by-text{ .by-text {
text-align:center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
} }
</style> </style>

22
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" @tap="openAddres2"> <view class="address" @tap="openAddres">
<!-- <picker <!-- <picker
@columnchange="addRessColumnchange" @columnchange="addRessColumnchange"
@change="changeAddress" @change="changeAddress"
@ -102,13 +102,10 @@ export default {
}, },
methods: { methods: {
openAddres() { openAddres() {
this.cityPickerValueDefault = [0, 0, 1];
this.$refs.simpleAddress.open();
},
openAddres2() {
// label // label
if (this.address.province) { if (this.address.province) {
// city // city
try {
let str = "市"; let str = "市";
let city = this.address.city; let city = this.address.city;
if (this.address.province.indexOf(str) != -1) { if (this.address.province.indexOf(str) != -1) {
@ -118,8 +115,8 @@ export default {
[this.address.province, city, this.address.district], [this.address.province, city, this.address.district],
"label" "label"
); );
console.log(index);
this.cityPickerValueDefault = index.index; this.cityPickerValueDefault = index.index;
} catch (error) {}
} }
this.$refs.simpleAddress.open(); this.$refs.simpleAddress.open();
@ -130,19 +127,12 @@ export default {
// this.cityPickerValueDefault = index.index; // this.cityPickerValueDefault = index.index;
// this.$refs.simpleAddress.open(); // this.$refs.simpleAddress.open();
}, },
openAddres3() {
// value
var index = this.$refs.simpleAddress.queryIndex(
[13, 1302, 130203],
"value"
);
console.log(index);
this.cityPickerValueDefault = index.index;
this.$refs.simpleAddress.open();
},
onConfirm(e) { onConfirm(e) {
this.pickerText = JSON.stringify(e); this.pickerText = JSON.stringify(e);
this.model2 = e.label; this.model2 = e.label;
this.address.province = e.labelArr[0] || "";
this.address.city = e.labelArr[1] || "";
this.address.district = e.labelArr[2] || "";
console.log(this.pickerText); console.log(this.pickerText);
}, },
getUserAddress: function() { getUserAddress: function() {

2
utils/request.js

@ -37,7 +37,7 @@ function baseRequest(options) {
// 如果接口需要登录,携带 token 去请求 // 如果接口需要登录,携带 token 去请求
options.headers = { options.headers = {
...options.headers, ...options.headers,
Authorization: options.login ? "Bearer " + token : null Authorization: "Bearer " + token
} }
// 如果需要登录才可访问的接口没有拿到 token 视为登录失效 // 如果需要登录才可访问的接口没有拿到 token 视为登录失效

Loading…
Cancel
Save