From 1e2cca44dd7b4cc30f60435d22bc58574f2fd4f0 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期四, 12 九月 2024 10:38:04 +0800
Subject: [PATCH] update 样式等、积分信息、合伙人注册
---
pages/home/components/home-banner-imgs.vue | 51 +-
sub_pages/customer/self/member-center.vue | 130 ++++---
pages/home/home.vue | 330 ++++++++++---------
sub_pages/customer/coupon/coupon-self.vue | 51 ++
pages.json | 3
pages/home/components/home-top-flow.vue | 3
pages/home/components/home-zones.vue | 359 ++++++++++----------
sub_pages/customer/trade/detail.vue | 6
sub_pages/partner/partner-info/partner-info.vue | 2
manifest.json | 2
sub_pages/customer/shop/shop.vue | 2
sub_pages/customer/shopping/confirm.vue | 21 +
sub_pages/customer/coupon/good-self.vue | 11
pages/home/components/home-category.vue | 19 +
14 files changed, 558 insertions(+), 432 deletions(-)
diff --git a/manifest.json b/manifest.json
index 2848179..782394c 100644
--- a/manifest.json
+++ b/manifest.json
@@ -49,7 +49,7 @@
"quickapp" : {},
/* 快应用特有相关 */
"mp-weixin" : {
- "appid" : "wx1441324401626290",
+ "appid" : "wx6d0ecc4e18710458",
"setting" : {
"urlCheck" : false,
"es6" : true,
diff --git a/pages.json b/pages.json
index 498f72e..b15166b 100644
--- a/pages.json
+++ b/pages.json
@@ -483,7 +483,8 @@
{
"path": "self/member-center",
"style": {
- "navigationBarTitleText": "会员中心"
+ "navigationBarTitleText": "会员中心",
+ "enablePullDownRefresh": true
}
}
// #endif
diff --git a/pages/home/components/home-banner-imgs.vue b/pages/home/components/home-banner-imgs.vue
index 11992c2..433408f 100644
--- a/pages/home/components/home-banner-imgs.vue
+++ b/pages/home/components/home-banner-imgs.vue
@@ -38,34 +38,39 @@
list: [],
};
},
- async mounted() {
- const {
- data,
- code
- } = await this.$http.request('get', '/api/pub/advertisement/list', {
+ methods: {
+ async init() {
+ const {
+ data,
+ code
+ } = await this.$http.request('get', '/api/pub/advertisement/list', {
- })
- if (code === 0) {
- this.list = data || []
- for(var item of this.list){
- item.url = item.cover
- try{
- if(item.url){
- var t = JSON.parse(item.url)
- if(Array.isArray(t)){
- item.url = t[0] || ''
- }else{
- item.url = t.url || ''
+ })
+ if (code === 0) {
+ this.list = data || []
+ for (var item of this.list) {
+ item.url = item.cover
+ try {
+ if (item.url) {
+ var t = JSON.parse(item.url)
+ if (Array.isArray(t)) {
+ item.url = t[0] || ''
+ } else {
+ item.url = t.url || ''
+ }
}
+
+ } catch (e) {
+ // console.log('error',e)
}
-
- }catch(e){
- // console.log('error',e)
+ // item.url = item.cover
}
- // item.url = item.cover
+ console.log(this.list)
}
- console.log(this.list)
}
+ },
+ async mounted() {
+ this.init()
}
}
@@ -73,6 +78,7 @@
<style lang="scss">
.home-banner-imgs {
+
// background-color: #fff;
.p1 {
// width: 334rpx;
@@ -92,6 +98,7 @@
// width: 334rpx;
height: 142rpx;
}
+
// .l-1{
// .p1{
// min-height: 308rpx;
diff --git a/pages/home/components/home-category.vue b/pages/home/components/home-category.vue
index 8ddb38c..68d2934 100644
--- a/pages/home/components/home-category.vue
+++ b/pages/home/components/home-category.vue
@@ -37,6 +37,25 @@
},
methods: {
+ init(){
+ this.today = this.$util.toDate(new Date())
+ this.$http.request('get', '/api/customer/flower/category/tree', {}).then(res => {
+ var data = res.data
+ this.list = []
+ var arr = data || []
+ for (let i = 0; i < arr.length && i < 10; i++) {
+ this.list.push({
+ id: arr[i].id,
+ name: arr[i].name,
+ url: arr[i].imageUrl
+ })
+ }
+ })
+ this.$http.request('get', '/api/customer/flower/up/stock', {}).then(res => {
+ var data = res.data
+ this.tj = data || 0
+ })
+ },
toList(item) {
// uni.navigateTo({
// url:'/sub_pages/customer/trade/list?categoryId='+item.id
diff --git a/pages/home/components/home-top-flow.vue b/pages/home/components/home-top-flow.vue
index 7e55261..735d2ce 100644
--- a/pages/home/components/home-top-flow.vue
+++ b/pages/home/components/home-top-flow.vue
@@ -71,6 +71,9 @@
},
methods: {
+ init(){
+ this.refreshList('post')
+ },
fun_GetMore(){
this.getMore('post')
},
diff --git a/pages/home/components/home-zones.vue b/pages/home/components/home-zones.vue
index c375985..e1b2ffe 100644
--- a/pages/home/components/home-zones.vue
+++ b/pages/home/components/home-zones.vue
@@ -1,209 +1,214 @@
<template>
- <view class="home-zones">
- <view class="c" v-for="(item,index) of list" @click.stop="toDetail(item.id)">
- <image class="p1 img100 m-t-12" :lazy-load="true" mode="aspectFill"
- :src="item.bgUrl">
- </image>
- <view class="c-txt-1" v-show="false">
- <view class="title">{{ item.name }}</view>
- <view class="flex">
- <view class="desc">查看详情</view>
- <view class="right m-l-5">
- <uni-icons class="icon" type="right" color="#C3B8A0" size="12"></uni-icons>
- </view>
+ <view class="home-zones">
+ <view class="c" v-for="(item,index) of list" @click.stop="toDetail(item.id)">
+ <image class="p1 img100 m-t-12" :lazy-load="true" mode="aspectFill" :src="item.bgUrl">
+ </image>
+ <view class="c-txt-1" v-show="false">
+ <view class="title">{{ item.name }}</view>
+ <view class="flex">
+ <view class="desc">查看详情</view>
+ <view class="right m-l-5">
+ <uni-icons class="icon" type="right" color="#C3B8A0" size="12"></uni-icons>
+ </view>
- </view>
- </view>
- </view>
- <view class="c" v-if="false">
- <image class="p2 img100 m-t-12" :lazy-load="true" mode="aspectFit"
- src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/52/52deec39e6ff47efb4855cda8766f29e%E8%B7%AF%E5%BE%84%204@2x.png">
- </image>
- <view class="c-txt-1" style="top: 60rpx;">
- <view class="title">特惠专区</view>
- <view class="flex">
- <view class="desc">查看详情</view>
- <view class="right m-l-5">
- <uni-icons class="icon" type="right" color="#C3B8A0" size="12"></uni-icons>
- </view>
+ </view>
+ </view>
+ </view>
+ <view class="c" v-if="false">
+ <image class="p2 img100 m-t-12" :lazy-load="true" mode="aspectFit"
+ src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/52/52deec39e6ff47efb4855cda8766f29e%E8%B7%AF%E5%BE%84%204@2x.png">
+ </image>
+ <view class="c-txt-1" style="top: 60rpx;">
+ <view class="title">特惠专区</view>
+ <view class="flex">
+ <view class="desc">查看详情</view>
+ <view class="right m-l-5">
+ <uni-icons class="icon" type="right" color="#C3B8A0" size="12"></uni-icons>
+ </view>
- </view>
- </view>
- </view>
- <view class="flex m-t-12" v-if="false">
- <view class="flex1 c m-r-5">
- <image class="p3 img100" :lazy-load="true" mode="aspectFit"
- src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/87/8787940a92524d7a9805a9184946cfaf%E4%BD%8D%E5%9B%BE@2x%20(5).png">
- </image>
- <view class="c-txt-2">
- <view class="title">品质专区</view>
- <view class="flex">
- <view class="desc">查看详情</view>
- <view class="right m-l-5">
- <uni-icons class="icon" type="right" color="#ffffff" size="9"></uni-icons>
- </view>
+ </view>
+ </view>
+ </view>
+ <view class="flex m-t-12" v-if="false">
+ <view class="flex1 c m-r-5">
+ <image class="p3 img100" :lazy-load="true" mode="aspectFit"
+ src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/87/8787940a92524d7a9805a9184946cfaf%E4%BD%8D%E5%9B%BE@2x%20(5).png">
+ </image>
+ <view class="c-txt-2">
+ <view class="title">品质专区</view>
+ <view class="flex">
+ <view class="desc">查看详情</view>
+ <view class="right m-l-5">
+ <uni-icons class="icon" type="right" color="#ffffff" size="9"></uni-icons>
+ </view>
- </view>
- </view>
- </view>
- <view class="flex1 c m-l-5">
- <image class="p4 img100" :lazy-load="true" mode="aspectFit"
- src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/0e/0eb0917d31e64c849f250b6e0a825b25%E4%BD%8D%E5%9B%BE@2x%20(6).png">
- </image>
- <view class="c-txt-2 red">
- <view class="title">秒杀专区</view>
- <view class="flex">
- <view class="desc">查看详情</view>
- <view class="right m-l-5">
- <uni-icons class="icon" type="right" color="#ffffff" size="9"></uni-icons>
- </view>
+ </view>
+ </view>
+ </view>
+ <view class="flex1 c m-l-5">
+ <image class="p4 img100" :lazy-load="true" mode="aspectFit"
+ src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/0e/0eb0917d31e64c849f250b6e0a825b25%E4%BD%8D%E5%9B%BE@2x%20(6).png">
+ </image>
+ <view class="c-txt-2 red">
+ <view class="title">秒杀专区</view>
+ <view class="flex">
+ <view class="desc">查看详情</view>
+ <view class="right m-l-5">
+ <uni-icons class="icon" type="right" color="#ffffff" size="9"></uni-icons>
+ </view>
- </view>
- </view>
- </view>
- </view>
- </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
</template>
<script>
-export default {
- data() {
- return {
- list: [],
- };
- },
- methods: {
- toDetail(id) {
- uni.navigateTo({
- url: `/sub_pages/customer/trade/list?zoneId=${id}`
- })
- },
- },
- mounted() {
- console.log('init hone zones')
- this.$http.request('get', '/api/flower/zone/list', {}).then(res => {
- this.list = res.data || []
- })
- },
- onLoad() {
+ export default {
+ data() {
+ return {
+ list: [],
+ };
+ },
+ methods: {
+ toDetail(id) {
+ uni.navigateTo({
+ url: `/sub_pages/customer/trade/list?zoneId=${id}`
+ })
+ },
+ init() {
+ this.list = []
+ this.$http.request('get', '/api/flower/zone/list', {}).then(res => {
+ this.list = res.data || []
+ })
+ }
+ },
+ mounted() {
+ console.log('init hone zones')
+ this.$http.request('get', '/api/flower/zone/list', {}).then(res => {
+ this.list = res.data || []
+ })
+ },
+ onLoad() {
- },
-}
+ },
+ }
</script>
<style lang="scss">
-.home-zones {
- margin-top: 20rpx;
+ .home-zones {
+ margin-top: 20rpx;
- .c {
- position: relative;
+ .c {
+ position: relative;
- .c-txt-1 {
- position: absolute;
- left: 38rpx;
- top: 40rpx;
+ .c-txt-1 {
+ position: absolute;
+ left: 38rpx;
+ top: 40rpx;
- .title {
- font-weight: 600;
- font-size: 36rpx;
- color: #FFFFFF;
- line-height: 50rpx;
- margin-bottom: 8rpx;
- }
+ .title {
+ font-weight: 600;
+ font-size: 36rpx;
+ color: #FFFFFF;
+ line-height: 50rpx;
+ margin-bottom: 8rpx;
+ }
- .desc {
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 40rpx;
- }
+ .desc {
+ font-weight: 400;
+ font-size: 28rpx;
+ color: #FFFFFF;
+ line-height: 40rpx;
+ }
- .right {
- background: #FFFFFF;
- border-radius: 50%;
- width: 28rpx;
- height: 28rpx;
- margin-top: 6rpx;
- position: relative;
+ .right {
+ background: #FFFFFF;
+ border-radius: 50%;
+ width: 28rpx;
+ height: 28rpx;
+ margin-top: 6rpx;
+ position: relative;
- .icon {
- position: absolute;
- top: -10rpx;
- left: 2rpx;
- }
- }
- }
+ .icon {
+ position: absolute;
+ top: -10rpx;
+ left: 2rpx;
+ }
+ }
+ }
- .c-txt-2 {
- position: absolute;
- left: 22rpx;
- top: 50rpx;
+ .c-txt-2 {
+ position: absolute;
+ left: 22rpx;
+ top: 50rpx;
- .title {
- font-weight: 600;
- font-size: 28rpx;
- color: #535FCA;
- line-height: 40rpx;
- margin-bottom: 2rpx;
- }
+ .title {
+ font-weight: 600;
+ font-size: 28rpx;
+ color: #535FCA;
+ line-height: 40rpx;
+ margin-bottom: 2rpx;
+ }
- .desc {
- font-weight: 400;
- font-size: 24rpx;
- color: #535FCA;
- line-height: 34rpx;
- }
+ .desc {
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #535FCA;
+ line-height: 34rpx;
+ }
- .right {
- background: #535FCA;
- border-radius: 50%;
- width: 24rpx;
- height: 24rpx;
- margin-top: 6rpx;
- position: relative;
+ .right {
+ background: #535FCA;
+ border-radius: 50%;
+ width: 24rpx;
+ height: 24rpx;
+ margin-top: 6rpx;
+ position: relative;
- .icon {
- position: absolute;
- top: -14rpx;
- left: 4rpx;
- }
- }
- }
+ .icon {
+ position: absolute;
+ top: -14rpx;
+ left: 4rpx;
+ }
+ }
+ }
- .c-txt-2.red {
- .title {
- color: #892E2E;
- }
+ .c-txt-2.red {
+ .title {
+ color: #892E2E;
+ }
- .desc {
- color: #892E2E;
- }
+ .desc {
+ color: #892E2E;
+ }
- .right {
- background: #892E2E;
- }
- }
- }
+ .right {
+ background: #892E2E;
+ }
+ }
+ }
- .p1 {
- width: 100%;
- height: 176rpx;
- }
+ .p1 {
+ width: 100%;
+ height: 176rpx;
+ }
- .p2 {
- width: 100%;
- height: 176rpx;
+ .p2 {
+ width: 100%;
+ height: 176rpx;
- }
+ }
- .p3 {
- width: 100%;
- height: 176rpx;
- }
+ .p3 {
+ width: 100%;
+ height: 176rpx;
+ }
- .p4 {
- width: 100%;
- height: 176rpx;
- }
-}
+ .p4 {
+ width: 100%;
+ height: 176rpx;
+ }
+ }
</style>
\ No newline at end of file
diff --git a/pages/home/home.vue b/pages/home/home.vue
index ec93edd..5bd64bd 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -61,13 +61,13 @@
<span v-if="!currentNotice||!currentNotice.id"> </span>
</view>
<!-- 当前分类 -->
- <home-category></home-category>
+ <home-category ref="home_category"></home-category>
<!-- 特别的几个公告图片 -->
- <home-banner-imgs></home-banner-imgs>
+ <home-banner-imgs ref="home_banner"></home-banner-imgs>
<!-- 均价情况 -->
<!-- <home-price></home-price> -->
<!-- 几个专区 -->
- <home-zones></home-zones>
+ <home-zones ref="home_zeros"></home-zones>
<!-- 置顶的花列表 -->
<home-top-flow ref="home_top_flow"></home-top-flow>
@@ -76,6 +76,7 @@
<common-footer flg="0"></common-footer>
<uni-popup ref="coupon_home" type="bottom" border-radius="10px 10px 0 0">底部弹出 Popup 自定义圆角</uni-popup>
+
</view>
</template>
@@ -108,7 +109,16 @@
homeZones,
homeTopFlow
},
-
+ onPullDownRefresh() {
+ // 下拉刷新方法
+ this.init()
+ this.$message.showLoading()
+ this.init_children()
+ setTimeout(() => {
+ this.$message.hideLoading()
+ uni.stopPullDownRefresh()
+ }, 2000)
+ },
data() {
return {
search_flow: '',
@@ -198,159 +208,169 @@
}
},
onLoad(options) {
- // if(options.partnerUserId){
- // //需要前往注册了
- // uni.navigateTo({
- // url: '/pages/login/supplier-login'
- // })
- // }
- // console.log('home created')
- //这里进行一次初始化即可
- // this.$http.request('get', '/api/school/area/list', {
-
- // }).then(res => {
- // if (res.code == 0) {
- // this.schools = res.data || []
- // }
- // })
-
- // uni.navigateTo({
- // url: '/sub_pages/customer/trade/detail'
- // })
-
- //获取banner图
- this.$http.request('get', '/api/pub/banner/list', {}).then(res => {
- if (res.code == 0) {
- this.banners = []
-
- var tarr = res.data || []
- if (tarr.length == 0) {
- // tarr.push({
- // url: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/62/62ddac6297104e369aba646be704064dbanner@2x.png'
- // })
- this.banners = tarr
- } else {
- var result = []
- for (var item of tarr) {
- // http://106.14.123.210/files/group1/e8/e1c17f7229514e5da211d8d47b09906b.jpeg
- try {
- if (item.url) {
- var t = JSON.parse(item.url)
- if (Array.isArray(t)) {
- // item.url = t[0] || ''
- for (var url of t) {
- result.push({
- ...item,
- url: url || ''
- })
- }
- } else {
- // item.url = t.url || ''
- result.push({
- ...item,
- url: t.url || ''
- })
- }
- }
-
- } catch (e) {
- // console.log('error',e)
- }
- }
- this.banners = result
- }
- console.log('this.banners', this.banners)
- }
- })
-
- var areaIndex = uni.getStorageSync('areaIndex')
- if (!areaIndex && areaIndex !== 0) {
-
- } else {
- this.areaIndex = areaIndex
- }
- //如果已经登录,加载一下默认地址
- let that = this
- setTimeout(() => {
- if (that.currentInfo.id && !that.address.id) {
- that.$http.request('get', '/api/address/default/detail').then(res => {
- if (res.data) {
- that.$store.commit('setDefaultAddress', {
- ...res.data
- })
-
- }
- })
- }
-
- }, 2000)
- //公告
- var type = ''
- // #ifdef PUB_CUSTOMER
- type = 'customer'
- // #endif
- // #ifdef PUB_SUPPLIER
- type = 'supplier'
- // #endif
- // #ifdef PUB_PARTNER
- type = 'partner'
- // #endif
-
- this.$http.request('get', '/api/pub/announcement/list/' + type, {
- params: {
- size: 5,
- status: 'A'
- }
- }).then(res => {
- if (res.code === 0) {
- // (res.data && res.data.records || [])
- this.noticeList = res.data || []
- console.log('this.noticeList', this.noticeList)
- if (this.noticeList.length > 0) {
- this.currentNotice = this.noticeList[0]
- if (this.currentNotice.title && this.currentNotice.title.length >= 30) {
- this.scrollable = true
- } else {
- this.scrollable = false
- }
- let that = this
- if (this.noticeList.length >= 1) {
- setInterval(() => {
- console.log('interval,1')
- that.currentNoticeIndex += 1
- that.currentNoticeIndex %= that.noticeList.length
- that.currentNotice = that.noticeList[that.currentNoticeIndex]
- that.scrollable = false
- that.$nextTick(() => {
- if (that.currentNotice.title && that.currentNotice.title
- .length >= 30) {
- that.scrollable = true
- } else {
- that.scrollable = false
- }
- })
-
- }, 8000)
- }
-
- }
- }
- })
-
- // let tmp = this
- // //首页优惠券
- // this.$http.request('get', '/api/v2/coupon/app' + `/home/list`).then(res => {
- // if (res.code == 0) {
- // var list = res.data || []
- // var dto = list.length >= 1 ? list[0] : undefined
- // if (dto) {
- // // 显示弹窗图片
- // tmp.$refs.coupon_home.open()
- // }
- // }
- // })
+ this.init()
},
methods: {
+ init_children() {
+ this.$refs.home_top_flow && this.$refs.home_top_flow.init && this.$refs.home_top_flow.init()
+ this.$refs.home_category && this.$refs.home_category.init && this.$refs.home_category.init()
+ this.$refs.home_banner && this.$refs.home_banner.init && this.$refs.home_banner.init()
+ this.$refs.home_zeros && this.$refs.home_zeros.init && this.$refs.home_zeros.init()
+ },
+ init() {
+ // if(options.partnerUserId){
+ // //需要前往注册了
+ // uni.navigateTo({
+ // url: '/pages/login/supplier-login'
+ // })
+ // }
+ // console.log('home created')
+ //这里进行一次初始化即可
+ // this.$http.request('get', '/api/school/area/list', {
+
+ // }).then(res => {
+ // if (res.code == 0) {
+ // this.schools = res.data || []
+ // }
+ // })
+
+ // uni.navigateTo({
+ // url: '/sub_pages/customer/trade/detail'
+ // })
+
+ //获取banner图
+ this.$http.request('get', '/api/pub/banner/list', {}).then(res => {
+ if (res.code == 0) {
+ this.banners = []
+
+ var tarr = res.data || []
+ if (tarr.length == 0) {
+ // tarr.push({
+ // url: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/62/62ddac6297104e369aba646be704064dbanner@2x.png'
+ // })
+ this.banners = tarr
+ } else {
+ var result = []
+ for (var item of tarr) {
+ // http://106.14.123.210/files/group1/e8/e1c17f7229514e5da211d8d47b09906b.jpeg
+ try {
+ if (item.url) {
+ var t = JSON.parse(item.url)
+ if (Array.isArray(t)) {
+ // item.url = t[0] || ''
+ for (var url of t) {
+ result.push({
+ ...item,
+ url: url || ''
+ })
+ }
+ } else {
+ // item.url = t.url || ''
+ result.push({
+ ...item,
+ url: t.url || ''
+ })
+ }
+ }
+
+ } catch (e) {
+ // console.log('error',e)
+ }
+ }
+ this.banners = result
+ }
+ console.log('this.banners', this.banners)
+ }
+ })
+
+ var areaIndex = uni.getStorageSync('areaIndex')
+ if (!areaIndex && areaIndex !== 0) {
+
+ } else {
+ this.areaIndex = areaIndex
+ }
+ //如果已经登录,加载一下默认地址
+ let that = this
+ setTimeout(() => {
+ if (that.currentInfo.id && !that.address.id) {
+ that.$http.request('get', '/api/address/default/detail').then(res => {
+ if (res.data) {
+ that.$store.commit('setDefaultAddress', {
+ ...res.data
+ })
+
+ }
+ })
+ }
+
+ }, 2000)
+ //公告
+ var type = ''
+ // #ifdef PUB_CUSTOMER
+ type = 'customer'
+ // #endif
+ // #ifdef PUB_SUPPLIER
+ type = 'supplier'
+ // #endif
+ // #ifdef PUB_PARTNER
+ type = 'partner'
+ // #endif
+
+ this.$http.request('get', '/api/pub/announcement/list/' + type, {
+ params: {
+ size: 5,
+ status: 'A'
+ }
+ }).then(res => {
+ if (res.code === 0) {
+ // (res.data && res.data.records || [])
+ this.noticeList = res.data || []
+ console.log('this.noticeList', this.noticeList)
+ if (this.noticeList.length > 0) {
+ this.currentNotice = this.noticeList[0]
+ if (this.currentNotice.title && this.currentNotice.title.length >= 30) {
+ this.scrollable = true
+ } else {
+ this.scrollable = false
+ }
+ let that = this
+ if (this.noticeList.length >= 1) {
+ setInterval(() => {
+ console.log('interval,1')
+ that.currentNoticeIndex += 1
+ that.currentNoticeIndex %= that.noticeList.length
+ that.currentNotice = that.noticeList[that.currentNoticeIndex]
+ that.scrollable = false
+ that.$nextTick(() => {
+ if (that.currentNotice.title && that.currentNotice.title
+ .length >= 30) {
+ that.scrollable = true
+ } else {
+ that.scrollable = false
+ }
+ })
+
+ }, 8000)
+ }
+
+ }
+ }
+ })
+
+ // let tmp = this
+ // //首页优惠券
+ // this.$http.request('get', '/api/v2/coupon/app' + `/home/list`).then(res => {
+ // if (res.code == 0) {
+ // var list = res.data || []
+ // var dto = list.length >= 1 ? list[0] : undefined
+ // if (dto) {
+ // // 显示弹窗图片
+ // tmp.$refs.coupon_home.open()
+ // }
+ // }
+ // })
+ },
+
clickBanner(item) {
if (item.id) {
uni.navigateTo({
diff --git a/sub_pages/customer/coupon/coupon-self.vue b/sub_pages/customer/coupon/coupon-self.vue
index 23a6e2b..cb9f53c 100644
--- a/sub_pages/customer/coupon/coupon-self.vue
+++ b/sub_pages/customer/coupon/coupon-self.vue
@@ -9,7 +9,7 @@
<no-data v-if="!list||list.length==0" style="width: 100%;"></no-data>
<view v-for="(item,index) of list" :key="index" class="coupont-item" :class="[query.status]"
- @click="selectCoupon(item)">
+ @click.stop="selectCoupon(item)">
<view class="flex container img100">
<view class="info-price">
<view class="price1">
@@ -18,9 +18,15 @@
<view class="price2">{{item.minOrderAmount?(`满¥${item.minOrderAmount}可用`):'无门槛'}}</view>
</view>
<view class="info flex1">
- <view class="title">
+ <view class="title flex">
{{item.couponName||'-'}}
- <radio :checked="cache_coupon.id===item.id" v-if="source==='shopping'" class="select-coupon"></radio>
+ <!-- <radio :checked="cache_coupon.id===item.id"
+ v-if="source==='shopping'"
+ class="select-coupon"></radio> -->
+ <view :style="{ 'margin-right': '20rpx'}" v-if="source==='shopping'"
+ class="component-radio m-l-a" :class="[cache_coupon.id===item.id?'cur':'']">
+
+ </view>
</view>
<view class="time">
@@ -71,13 +77,17 @@
status: 'unused'
},
list: [],
- source: ''
+ source: '',
+ paymoney: -1
}
},
async onLoad(options) {
if (options.source) {
this.source = options.source || ''
+ }
+ if (options.paymoney) {
+ this.paymoney = parseFloat(options.paymoney).toFixed(2)
}
if (this.source === 'shopping') {
//只展示可用的
@@ -98,6 +108,39 @@
methods: {
async selectCoupon(item) {
if (this.source == 'shopping') {
+ if (this.cache_coupon.id === item.id) {
+ await this.$message.confirm('是否取消使用此优惠券')
+ await this.$store.dispatch('cache_coupon_select', {})
+ uni.navigateBack()
+ return
+ }
+ console.log('paymoney',this.paymoney)
+ if (this.paymoney >= 0) {
+ //判断是否可以选择使用
+ if (item.couponDiscountType === 'zero') {
+ // if (this.cache_coupon.couponDiscountValue > this.paymoney) {
+ // this.$message.showToast('订单价格小于优惠券优惠额度')
+ // return
+ // }
+ } else if (item.minOrderAmount && item.minOrderAmount > 0) {
+ // if (this.cache_coupon.minOrderAmount > this.paymoney) {
+ // this.$message.showToast('订单价格')
+ // return
+ // }
+ if (this.paymoney < item.minOrderAmount) {
+ this.$message.showToast('订单价格不满足使用条件')
+ this.$nextTick(()=>{
+ this.$forceUpdate()
+ })
+ return
+ }
+ } else {
+ // if (this.cache_coupon.couponDiscountValue > this.paymoney) {
+ // this.$message.showToast('订单价格小于优惠券优惠额度')
+ // return
+ // }
+ }
+ }
await this.$store.dispatch('cache_coupon_select', item)
uni.navigateBack()
}
diff --git a/sub_pages/customer/coupon/good-self.vue b/sub_pages/customer/coupon/good-self.vue
index 1318fb2..e336979 100644
--- a/sub_pages/customer/coupon/good-self.vue
+++ b/sub_pages/customer/coupon/good-self.vue
@@ -15,9 +15,14 @@
<image :lazy-load="true" :src="item.cover" class="cover" mode="scaleToFill"></image>
</view>
<view class="info flex1">
- <view class="title">
+ <view class="title flex">
{{item.name||''}}
- <radio :checked="isIngood(item)" @click.stop="updateSelectGood(item)" v-if="source==='shopping'" class="select-coupon"></radio>
+ <!-- <radio :checked="isIngood(item)" @click.stop="updateSelectGood(item)" v-if="source==='shopping'" class="select-coupon"></radio> -->
+
+ <view :style="{ 'margin-right': '20rpx'}" @click.stop="updateSelectGood(item)"
+ class="component-radio m-l-a" :class="[isIngood(item)?'cur':'']" v-if="source==='shopping'">
+
+ </view>
</view>
<view class="time word-e">
@@ -37,7 +42,7 @@
</view>
</view>
<view style="min-height: 140rpx;" v-if="source=='shopping'"></view>
- <view class="bottom-button" @click="backpage()" v-if="source=='shopping'">返回订单结算</view>
+ <view class="bottom-button" @click="backpage()" v-if="source=='shopping'">确定选择</view>
<!-- <view class="bottom-button" @click="toGoodAll">前往兑换</view> -->
</view>
diff --git a/sub_pages/customer/self/member-center.vue b/sub_pages/customer/self/member-center.vue
index 38305bd..999f936 100644
--- a/sub_pages/customer/self/member-center.vue
+++ b/sub_pages/customer/self/member-center.vue
@@ -68,75 +68,84 @@
<script>
import banner3d from '@/components/banner3d/banner3d'
export default {
+ async onPullDownRefresh() {
+ await this.$store.dispatch('getCurrentInfo')
+ uni.stopPullDownRefresh()
+ },
methods: {
},
- onLoad() {
- if (this.currentInfo.customerDTO && this.currentInfo.customerDTO.userGrowthRecord && this.currentInfo
- .customerDTO.userGrowthRecord.currentMemberLevel) {
- // userGrowthRecord: {currentMemberLevel: "普通会员", currentGrowthValue: 6919,…}
- // currentGrowthValue: 6919
- // currentMemberLevel: "普通会员"
- // targetMemberInfos: [{targetMemberLevel: "金卡会员", targetStartPoint: 15001, targetGap: 8082, targetDiscountAmount: 0.4},…]
- // 0: {targetMemberLevel: "金卡会员", targetStartPoint: 15001, targetGap: 8082, targetDiscountAmount: 0.4}
- // targetDiscountAmount: 0.4
- // targetGap: 8082
- // targetMemberLevel: "金卡会员"
- // targetStartPoint: 15001
- // 1: {targetMemberLevel: "钻石会员", targetStartPoint: 10001, targetGap: 3082, targetDiscountAmount: 0.5}
- // targetDiscountAmount: 0.5
- // targetGap: 3082
- // targetMemberLevel: "钻石会员"
- // targetStartPoint: 10001
- //计算下一个等级的差距
- let name = this.currentInfo.customerDTO.userGrowthRecord.currentMemberLevel
+ async onLoad() {
+ await this.$store.dispatch('getCurrentInfo')
+ this.$nextTick(() => {
+ if (this.currentInfo.customerDTO && this.currentInfo.customerDTO.userGrowthRecord && this
+ .currentInfo
+ .customerDTO.userGrowthRecord.currentMemberLevel) {
+ // userGrowthRecord: {currentMemberLevel: "普通会员", currentGrowthValue: 6919,…}
+ // currentGrowthValue: 6919
+ // currentMemberLevel: "普通会员"
+ // targetMemberInfos: [{targetMemberLevel: "金卡会员", targetStartPoint: 15001, targetGap: 8082, targetDiscountAmount: 0.4},…]
+ // 0: {targetMemberLevel: "金卡会员", targetStartPoint: 15001, targetGap: 8082, targetDiscountAmount: 0.4}
+ // targetDiscountAmount: 0.4
+ // targetGap: 8082
+ // targetMemberLevel: "金卡会员"
+ // targetStartPoint: 15001
+ // 1: {targetMemberLevel: "钻石会员", targetStartPoint: 10001, targetGap: 3082, targetDiscountAmount: 0.5}
+ // targetDiscountAmount: 0.5
+ // targetGap: 3082
+ // targetMemberLevel: "钻石会员"
+ // targetStartPoint: 10001
+ //计算下一个等级的差距
+ let name = this.currentInfo.customerDTO.userGrowthRecord.currentMemberLevel
- for (var tmp of this.bannerList) {
- tmp.point = {
- current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0
- }
- tmp.currentMsg = ''
- if (tmp.title === name) {
- //说明是当前等级,其他待定
- tmp.currentMsg = '当前等级'
- }
- }
- if (this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
- var t = -1
for (var tmp of this.bannerList) {
- t += 1
- for (var k of this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
- if (tmp.title === k.targetMemberLevel) {
- console.log('eq', k, tmp)
- tmp.point = {
- current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0,
- end: k.targetStartPoint || 0,
+ tmp.point = {
+ current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0
+ }
+ tmp.currentMsg = ''
+ if (tmp.title === name) {
+ //说明是当前等级,其他待定
+ tmp.currentMsg = '当前等级'
+ }
+ }
+ if (this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
+ var t = -1
+ for (var tmp of this.bannerList) {
+ t += 1
+ for (var k of this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
+ if (tmp.title === k.targetMemberLevel) {
+ console.log('eq', k, tmp)
+ tmp.point = {
+ current: this.currentInfo.customerDTO.userGrowthRecord
+ .currentGrowthValue || 0,
+ end: k.targetStartPoint || 0,
+ }
}
}
}
}
- }
- this.init = true
- this.$nextTick(() => {
- // var name = this.currentInfo.customerDTO.userGrowthRecord.currentMemberLevel
- var index = -1
- for (var tmp of this.bannerList) {
- index += 1
- if (tmp.title === name) {
- this.$refs.banner3d.swiperChange({
- mp: {
- detail: {
- current: index
+ this.init = true
+ this.$nextTick(() => {
+ // var name = this.currentInfo.customerDTO.userGrowthRecord.currentMemberLevel
+ var index = -1
+ for (var tmp of this.bannerList) {
+ index += 1
+ if (tmp.title === name) {
+ this.$refs.banner3d.swiperChange({
+ mp: {
+ detail: {
+ current: index
+ }
}
- }
- })
- break
+ })
+ break
+ }
}
- }
- })
+ })
- }
+ }
+ })
},
data() {
return {
@@ -208,18 +217,19 @@
text-align: left;
font-style: normal;
padding: 24rpx;
-
+
.icon {
width: 78rpx;
height: 78rpx;
margin: auto;
display: block;
margin-bottom: 10rpx;
-
+
}
- .desc{
+
+ .desc {
text-align: center;
-
+
}
}
diff --git a/sub_pages/customer/shop/shop.vue b/sub_pages/customer/shop/shop.vue
index 17671c8..f57a236 100644
--- a/sub_pages/customer/shop/shop.vue
+++ b/sub_pages/customer/shop/shop.vue
@@ -38,7 +38,7 @@
<view class="label">获赞</view>
</view>
<view class="form-item">
- <view class="value">{{dto.fans || '*'}}</view>
+ <view class="value">{{dto.fans || '0'}}</view>
<view class="label">粉丝</view>
</view>
<!-- <view class="form-item">
diff --git a/sub_pages/customer/shopping/confirm.vue b/sub_pages/customer/shopping/confirm.vue
index 8be6896..5b1c334 100644
--- a/sub_pages/customer/shopping/confirm.vue
+++ b/sub_pages/customer/shopping/confirm.vue
@@ -25,8 +25,9 @@
if (this.cache_coupon.couponDiscountType === 'zero') {
return this.cache_coupon.couponDiscountValue || 0
} else if (this.cache_coupon.minOrderAmount && this.cache_coupon.minOrderAmount > 0) {
- var total = (( this.dto.totalMemberAmount || this.dto.totalAmount || 0) + (this.dto.packing || 0) + (this.current_transport.fee ||
- 0) || 0)
+ var total = ((this.dto.totalMemberAmount || this.dto.totalAmount || 0) + (this.dto.packing || 0) +
+ (this.current_transport.fee ||
+ 0) || 0)
.toFixed(2)
if (total >= this.cache_coupon.minOrderAmount) {
return this.cache_coupon.couponDiscountValue || 0
@@ -50,6 +51,9 @@
if (this.cache_coupon && this.cache_coupon.id) {
this.dto.couponRecordId = this.cache_coupon.id
this.dto.couponRecordStr = this.cache_coupon.couponName
+ } else if (this.cache_coupon && !this.cache_coupon.id) {
+ this.dto.couponRecordId = ''
+ this.dto.couponRecordStr = ''
}
//兑换券
this.dto.goodsRecordIdListStr = ''
@@ -159,8 +163,16 @@
methods: {
toSelectCoupon() {
//跳转去列表页面进行选择
+ var total = ((this.dto.totalMemberAmount || this.dto.totalAmount || 0) + (this.dto.packing || 0) + (this
+ .current_transport.fee ||
+ 0) || 0)
+ .toFixed(2)
+ // if (total >= this.cache_coupon.minOrderAmount) {
+ // return this.cache_coupon.couponDiscountValue || 0
+ // }
+
uni.navigateTo({
- url: '/sub_pages/customer/coupon/coupon-self?source=shopping'
+ url: `/sub_pages/customer/coupon/coupon-self?source=shopping&paymoney=${total}`
})
},
toSelectGood() {
@@ -343,7 +355,8 @@
</view>
<view class="price">
<view class="m-l-a m-r-0 text-right">
- 共{{ dto.flowers.length }}件,小计<span class="t-red">¥{{ dto.totalMemberAmount || dto.totalAmount || 0 }}</span>
+ 共{{ dto.flowers.length }}件,小计<span
+ class="t-red">¥{{ dto.totalMemberAmount || dto.totalAmount || 0 }}</span>
</view>
</view>
</view>
diff --git a/sub_pages/customer/trade/detail.vue b/sub_pages/customer/trade/detail.vue
index 9643c11..1d52b00 100644
--- a/sub_pages/customer/trade/detail.vue
+++ b/sub_pages/customer/trade/detail.vue
@@ -14,7 +14,7 @@
</view>
</swiper-item>
<swiper-item v-for="(url, index) in dto.bannerList" :key="index">
- <image class="top-img" :lazy-load="true" mode="scaleToFill" @click="previewImg(url)" :src="url">
+ <image class="top-img" :lazy-load="true" mode="aspectFit" @click="previewImg(url)" :src="url">
</image>
<view class="index-tag">
{{index+1+(dto.video&&1)}}/{{(dto.video&&1||0)+(dto.cover&&1||0)+(dto.bannerList&&dto.bannerList.length||0)}}
@@ -23,7 +23,7 @@
<swiper-item>
<image :src="dto.cover" :lazy-load="true" @click="previewImg(dto.cover)" class="top-img"
- mode="scaleToFill">
+ mode="aspectFit">
</image>
<view class="index-tag">
{{(dto.bannerList&&dto.bannerList.length||0)+1+(dto.video&&1||0)}}/{{(dto.video&&1||0)+(dto.cover&&1||0)+(dto.bannerList&&dto.bannerList.length||0)}}
@@ -561,7 +561,7 @@
.swiper-box {
position: relative;
-
+ border-bottom: 1px solid #d3d4d7;
swiper-item {
background-color: #fff;
border-radius: 8rpx;
diff --git a/sub_pages/partner/partner-info/partner-info.vue b/sub_pages/partner/partner-info/partner-info.vue
index 0227bdc..5afc0ed 100644
--- a/sub_pages/partner/partner-info/partner-info.vue
+++ b/sub_pages/partner/partner-info/partner-info.vue
@@ -94,7 +94,7 @@
- <view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit" v-if="dto.status&&dto.status!='P' " >
+ <view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit" v-if="dto.status&&dto.status!='P' || source==='step' " >
{{source==='step'?'下一步':'提交审核'}}
</view>
--
Gitblit v1.9.3