Bladeren bron

Merge branch 'developerX' of http://git.caimei365.com/zhengjinyi/caimei-applets-store into developer

xiebaomin 1 jaar geleden
bovenliggende
commit
0c50f691c8

+ 1 - 1
.hbuilderx/launch.json

@@ -13,4 +13,4 @@
      	"type" : "uniCloud"
      }
     ]
-}
+}

+ 6 - 0
App.vue

@@ -1,5 +1,10 @@
 <script>
+import global from '@/mixins/global.js'
+
+
+
 export default {
+    mixins: [global],
     onLaunch: function() {
         const updateManager = uni.getUpdateManager()
         updateManager.onCheckForUpdate(function(res) {
@@ -18,6 +23,7 @@ export default {
         })
         
         this.$store.dispatch('app/initDevice')
+        this.initSetSystemInfo() // 初始化系统程序
     }
 }
 </script>

+ 1 - 1
main.js

@@ -9,7 +9,7 @@ import store from '@/store/index.js'
 
 Vue.config.productionTip = false
 App.mpType = 'app'
-
+// Vue.prototype.$Static = 'https://static.caimei365.com/app/img/'
 // 使用插件
 Vue.use(uniappApi)
 Vue.use(filters)

+ 1 - 1
manifest.json

@@ -75,4 +75,4 @@
         "enable" : false
     },
     "vueVersion" : "2"
-}
+}

+ 50 - 0
mixins/global.js

@@ -18,6 +18,56 @@ export default {
                 3: `others/image-view?imageUrl=${encodeURIComponent(jumpImage)}`
             }
             this.$router.navigateTo(jumpMap[jumpType])
+        },
+        initSetSystemInfo() {
+            let self = this
+            uni.getSystemInfo({
+                success: function(e) {
+                    let modelmes = e.model
+                    console.log(e)
+                    if (modelmes.search('iPhone 11') !== -1 || modelmes.search('iPhone 11 Pro Max') !==
+                		-1 || modelmes.search('iPhone X') != -1) { //XS,XR,XS MAX均可以适配
+                        self.$store.dispatch('setVariableFun', true)
+                    } else {
+                        self.$store.dispatch('setVariableFun', false)
+                    }
+                    // #ifndef MP
+                    Vue.prototype.StatusBar = e.statusBarHeight
+                    if (e.platform == 'android') {
+                        Vue.prototype.CustomBar = e.statusBarHeight + 50
+                        Vue.prototype.platformClass = true
+                    } else {
+                        Vue.prototype.CustomBar = e.statusBarHeight + 45
+                        Vue.prototype.platformClass = false
+                    };
+                    // #endif
+                    // #ifdef MP-WEIXIN || MP-QQ
+                    console.log(e.platform)
+                    if (e.platform == 'android') {
+                        Vue.prototype.platformClass = 'left'
+                        self.$store.dispatch('setVariableFun', false)
+                    } else {
+                        Vue.prototype.platformClass = 'center'
+                        self.$store.dispatch('setIsIphoneFun', true)
+                    }
+                    Vue.prototype.StatusBar = e.statusBarHeight
+                    Vue.prototype.fontSizeSetting = e.fontSizeSetting
+                    Vue.prototype.screenWidth = e.screenWidth
+                    let capsule = wx.getMenuButtonBoundingClientRect()
+                    Vue.prototype.capsule = capsule
+                    if (capsule) {
+                        Vue.prototype.Custom = capsule
+                        Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight
+                    } else {
+                        Vue.prototype.CustomBar = e.statusBarHeight + 50
+                    }
+                    // #endif		
+                    // #ifdef MP-ALIPAY
+                    Vue.prototype.StatusBar = e.statusBarHeight
+                    Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight
+                    // #endif
+                }
+            })
         }
     }
 }

+ 6 - 0
package-lock.json

@@ -0,0 +1,6 @@
+{
+  "name": "caimei-applets-store",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {}
+}

+ 50 - 1
pages.json

@@ -45,7 +45,17 @@
             "navigationBarTitleText": "登录",
             "enablePullDownRefresh": false
         }
-    }],
+    }
+    // ,{
+    //         "path" : "pages/tabBar/notice/notice",
+    //         "style" :                                                                                    
+    //         {
+    //             "navigationBarTitleText": "消息通知",
+    //             "enablePullDownRefresh": true,
+    //             "navigationStyle": "custom"
+    //         }
+    //     }
+    ],
 
     // 分包加载配置
     "subPackages": [
@@ -259,6 +269,39 @@
                 }
             }]
         }
+        // , {
+        //     "root": "pages/notice/",
+        //     "pages": [
+        //         {
+        //         	"path": "club/notice-order",
+        //         	"style": {
+        //         		"navigationBarTitleText": "交易物流",
+        //         		"enablePullDownRefresh": true
+        //         	}
+        //         },
+        //         {
+        //         	"path": "club/notice-users",
+        //         	"style": {
+        //         		"navigationBarTitleText": "账户通知",
+        //         		"enablePullDownRefresh": true
+        //         	}
+        //         },
+        //         {
+        //         	"path": "club/notice-server",
+        //         	"style": {
+        //         		"navigationBarTitleText": "服务通知",
+        //         		"enablePullDownRefresh": true
+        //         	}
+        //         },
+        //         {
+        //         	"path": "club/notice-coupon",
+        //         	"style": {
+        //         		"navigationBarTitleText": "优惠促销",
+        //         		"enablePullDownRefresh": true
+        //         	}
+        //         }
+        //     ]
+        // }
     ],
 
     // 全局主题配置
@@ -288,6 +331,12 @@
                 "selectedIconPath": "static/tabBar/icon-category-active@2x.png",
                 "text": "分类"
             },
+            // {
+            // 	"pagePath": "pages/tabBar/notice/notice",
+            // 	"iconPath": "static/tabBar/notice.png",
+            // 	"selectedIconPath": "static/tabBar/notice_active.png",
+            // 	"text": "消息"
+            // },
             {
                 "pagePath": "pages/tabBar/cart/cart",
                 "iconPath": "static/tabBar/icon-cart@2x.png",

+ 98 - 0
pages/notice/club/components/notice-cell.vue

@@ -0,0 +1,98 @@
+<template name="notice-cell">
+	<!-- 通知消息 -->
+	<view>
+		<!-- 交易物流通知 -->
+		<template v-if="cellType === 1">
+			<view class="tui-notice-cell">
+				<view class="tui-cell-top">
+					<view class="cell-title"> {{ cell.orderMessageType | noticeOrderFilters }} </view>
+					<view class="cell-time"> {{ cell.time }} </view>
+				</view>
+				<view class="tui-cell-content"> 
+					<view class="cell-image">
+						<img :src="cell.mainImage" alt="">
+					</view>
+					<view class="cell-content">
+						{{ noticeOrderText(cell)}}
+					</view>
+				</view> 
+				<view class="tui-cell-bot"> 
+					<view class="tui-cell-btn" v-if="cell.orderMessageType===1">立即支付</view>
+					<view class="tui-cell-btn" v-else-if="cell.orderMessageType===5">查看物流</view>
+					<view class="tui-cell-btn" v-else>查看订单</view>
+				</view>
+			</view>
+		</template>
+		<!-- 机构账户通知 -->
+		<template v-if="cellType === 2">
+			<view class="tui-notice-cell clearfix">
+				<view class="tui-cell-top">
+					<view class="cell-title"> {{ cell.accountType | noticeUsersFilters }} </view>
+					<view class="cell-time"> {{ cell.time }} </view>
+				</view>
+				<view class="tui-cell-content"> 
+					{{ noticeUsersText(cell)}}
+				</view> 
+			</view>
+		</template>
+		<!-- 机构服务通知 -->
+		<template v-if="cellType === 3">
+			<view class="tui-notice-cell clearfix">
+				<view class="tui-cell-top">
+					<view class="cell-title"> {{ cell.messageType | noticeUsersFilters }} </view>
+					<view class="cell-time"> {{ cell.time }} </view>
+				</view>
+				<view class="tui-cell-content"> 
+					{{ noticeUsersText(cell)}}
+				</view> 
+			</view>
+		</template>
+		<!-- 机构优惠促销通知 -->
+		<template v-if="cellType === 4">
+			<view class="tui-notice-cell clearfix">
+				<view class="tui-cell-top">
+					<view class="cell-title"> {{ cell.couponMessageType | noticeCouponFilters }} </view>
+					<view class="cell-time"> {{ cell.time }} </view>
+				</view>
+				<view class="tui-cell-content"> 
+					{{ noticeCouponText(cell)}}
+				</view> 
+			</view>
+		</template>
+	</view>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex'
+import noticeMixins from '../mixins/notice_mixins.js'
+export default {
+	mixins: [noticeMixins],
+	name: 'notice-cell',
+	props: {
+		cellType:{
+			type:Number
+		},
+		cell: {
+			type: Object
+		}
+	},
+	data() {
+		return {
+			
+		}
+	},
+	created() {
+		
+	},
+	methods: {
+		
+	}
+}
+</script>
+
+<style lang="scss">
+.tui-cell-btn {
+    border-color: #FF457B !important;
+    color: #FF457B !important;
+}
+</style>

+ 161 - 0
pages/notice/club/mixins/notice_mixins.js

@@ -0,0 +1,161 @@
+// 机构通知消息 
+const noticeMixins = {
+    filters: {
+        noticeOrderFilters(value) { 
+            // 交易物流状态显示 1.下单成功通知  2.订单支付完成 3.退款/货成功通知 4.订单取消通知 5.订单发货通知 6.自动收货通知
+            const map = {
+                1: '下单成功通知',
+                2: '订单支付完成',
+                3: '退款/货成功通知',
+                4: '订单取消通知',
+                5: '订单发货通知',
+                6: '自动收货通知'
+            }
+            return map[value]
+        },
+        noticeUsersFilters(value) { 
+            // 账户通知状态 1.注册成功通知 2.购买超级会员成功 3.超级会员到期提醒 4.超级会员到期提醒 5.升级资质机构成功 6.升级资质机构失败 7.成为机构运营人员通知
+            const map = {
+                1: '注册成功通知',
+                2: '购买超级会员成功',
+                3: '超级会员到期提醒',
+                4: '系统赠送超级会员',
+                5: '升级资质机构成功',
+                6: '升级资质机构失败',
+                7: '成为机构运营人员通知'
+            }
+            return map[value]
+        },
+        noticeCouponFilters(value) { 
+            // 优惠券通知状态  1.优惠券待领取通知 2.优惠券过期通知
+            const map = {
+                1: '优惠券待领取通知',
+                2: '优惠券过期通知',
+                3: '优惠券待领取通知'
+            }
+            return map[value]
+        }
+    },
+    methods: {
+        getUserAuthClubMessageList() {
+            this.UserService.getUserAuthClubMessageList(this.listQuery)
+                .then(response => {
+                    let data = response.data
+                    this.hasNextPage = response.data.hasNextPage
+                    if (data.list && data.list.length > 0) {
+                        this.isEmpty = false
+                        this.list = [...data.list]
+                        this.pullFlag = false
+                        setTimeout(() => {
+                            this.pullFlag = true
+                        }, 500)
+                        if (this.hasNextPage) {
+                            this.pullUpOn = false
+                            this.nomoreText = '上拉显示更多'
+                        } else {
+                            if (this.list.length < 5) {
+                                this.pullUpOn = true
+                                this.loadding = false
+                            } else {
+                                this.pullUpOn = false
+                                this.loadding = false
+                                this.nomoreText = '到底了~'
+                            }
+                        }
+                    } else {
+                        this.isEmpty = true
+                    }
+                    this.skeletonShow = false
+                })
+                .catch(error => {
+                    this.$util.msg(error.msg, 2000)
+                })
+        },
+        getReachBottomData() {
+            this.pullUpOn = false
+            this.loadding = false
+            //上拉加载
+            this.listQuery.pageNum += 1
+            this.UserService.getUserAuthClubMessageList(this.listQuery)
+                .then(response => {
+                    let data = response.data
+                    if (data.list && data.list.length > 0) {
+                        this.hasNextPage = data.hasNextPage
+                        this.list = this.list.concat(data.list)
+                        this.pullFlag = false // 防上拉暴滑
+                        setTimeout(() => {
+                            this.pullFlag = true
+                        }, 500)
+                        if (this.hasNextPage) {
+                            this.pullUpOn = false
+                            this.nomoreText = '上拉显示更多'
+                        } else {
+                            this.pullUpOn = false
+                            this.loadding = false
+                            this.nomoreText = '到底了~'
+                        }
+                    }
+                })
+                .catch(error => {
+                    this.$util.msg(error.msg, 2000)
+                })
+        },
+        deleteBtn(id,index) {
+            // 删除通知消息
+            this.UserService.authDeleteMessage({ id: id })
+                .then(response => {
+                    let _this = this
+                    uni.vibrateShort({
+                        success: function() {
+                            _this.listQuery.pageNum = 1
+                            _this.getUserAuthClubMessageList()
+                            // _this.list.splice(index, 1) 
+                        }
+                    })
+                })
+                .catch(error => {
+                    console.log('error=>', error.msg)
+                })
+        },
+        noticeOrderText(cell) { // 交易物流通知文案
+            const map = {
+                1: '您已成功下单!',
+                2: '您的订单已支付完成,将立即安排发货!',
+                3: `您的订单已${cell.refundType === 1 ? '部分退' : '全部退'}款/货成功!退款金额¥${cell.content},到账时间可能存在延迟,具体以支付方通知为准。`,
+                4: `${cell.content}`,
+                5: '您的订单已发货,请您留意物流变化!',
+                6: '您的订单因超时已被系统自动确认收货!'
+            }
+            return map[cell.orderMessageType]
+        },
+        noticeUsersText(cell) { // 账户通知文案
+            const map = {
+                1: '欢迎成为采美机构用户,祝您开启愉快的采购之旅。',
+                2: `您已成功购买${cell.content}采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,快去看看吧 >>>`,
+                3: `您的超级会员服务将于${cell.content}到期,到期后将无法享受专属会员权益,赶快去续费吧 >>>`,
+                4: `您已获得采美平台赠送的${cell.content}超级会员,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,快去看看吧 >>>`,
+                5: '恭喜您成功升级为资质机构用户!现在可以查看更多商品的信息啦,采美平台也将为您提供更多专业服务。',
+                6: '您的账号升级资质机构失败!赶快去修改资料重新提交吧 >>>',
+                7: `恭喜您(微信昵称:${cell.content})成功成为机构运营人员,祝您开启愉快的采购之旅。`
+            }
+            return map[cell.accountType]
+        },
+        noticeCouponText(cell) { // 优惠促销通知文案
+            const copunMap = {
+                0: `采美平台送您${cell.couponFee}元优惠券,众多大牌正品等着您,赶快去领取下单吧 >>>`,
+                1: `采美平台${cell.content}类商品大优惠,特送您${cell.couponFee}元优惠券,赶快去领取下单吧 >>>`,
+                2: `为了答谢您对采美平台的支持,采美送您${cell.couponFee}元优惠券,赶快去领取下单吧 >>>`,
+                3: `【${cell.content}】赠送您${cell.couponFee}元的店铺专属优惠券,众多火爆商品等您来!赶快去领取下单吧 >>>`,
+                4: `恭喜成功注册采美平台,现赠送您${cell.couponFee}元新用户优惠券,赶快去领取下单吧 >>>`,
+            }
+            const map = {
+                1: copunMap[cell.couponType],
+                2: `您有${cell.couponFee}元优惠券将于${cell.content}过期,赶快去查看使用吧 >>>`,
+                3: `您有${cell.couponFee}元优惠券尚未领取,优惠券将于${cell.content}后下架,赶快去领取下单吧 >>>`,
+            }
+            return map[cell.couponMessageType]
+        }
+    }
+}
+
+export default noticeMixins

+ 19 - 0
pages/notice/club/notice-coupon.vue

@@ -0,0 +1,19 @@
+<template>
+    <view>
+        优惠促销
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                
+            };
+        }
+    }
+</script>
+
+<style lang="scss">
+
+</style>

+ 277 - 0
pages/notice/club/notice-order.vue

@@ -0,0 +1,277 @@
+<template>
+	<view class="container cart clearfix">
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="5"
+		></tui-skeleton>
+		<view class="container-main" v-else>
+			<view class="clearfix">
+				<!-- 空白页 -->
+				<view class="empty-container" v-if="isEmpty">
+					<image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
+					<text class="error-text">暂无任何消息~</text>
+				</view>
+				<!-- 列表 -->
+				<view
+					class="tui-notice"
+					v-else
+					v-for="(cell, index) in list"
+					:key="index"
+					@click.stop="handleOrderClick(cell)"
+				>
+					<tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
+						<template v-slot:content>
+							<notice-cell :cellType="1" :cell="cell"></notice-cell>
+						</template>
+						<template v-slot:button>
+							<view class="tui-custom-btn_box">
+								<view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
+									<image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
+								</view>
+							</view>
+						</template>
+					</tui-swipe-action>
+				</view>
+				<!--加载loadding-->
+				<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+				<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+				<!--加载loadding-->
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { mapState, mapMutations } from 'vuex'
+import noticeMixins from './mixins/notice_mixins.js'
+import noticeCell from './components/notice-cell.vue'
+export default {
+	mixins: [noticeMixins],
+	components: {
+		noticeCell
+	},
+	data() {
+		return {
+			skeletonShow: true,
+			listQuery: {
+				messageType: 0,
+				pageNum: 1,
+				pageSize: 10
+			},
+			list: [{
+                orderMessageType: 1,
+                time: '2022-01-10',
+                mainImage: '',
+                
+            }],
+			isEmpty: false,
+			loadding: true,
+			pullUpOn: true,
+			pullFlag: true,
+			hasNextPage: false,
+			nomoreText: '上拉显示更多'
+		}
+	},
+	onLoad(option) {
+        console.log(option)
+		this.initData(option)
+	},
+	methods: {
+		async initData(option) {
+			// const userInfo = await uni.getStorage()
+			// this.listQuery.messageType = option.messageType
+            // console.log(userInfo)
+			// this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
+			// this.getUserAuthClubMessageList()
+            this.skeletonShow = false
+		},
+		handleOrderClick(cell) {
+			if (cell.orderMessageType === 1) {
+				if (this.isOnliyPay(cell)) {
+					let payLinkMap = {
+						0: `/pages/user/order/order-pay-list?orderId=${cell.orderId}`,
+						1: `/pages/user/order/order-payunder?orderId=${cell.orderId}`
+					}
+					let linkJumpMap = { 1: payLinkMap[cell.onlinePayFlag] }
+					uni.navigateTo({
+					    url: linkJumpMap[cell.orderMessageType]
+					})
+				} else {
+					this.$util.msg('订单已完成支付', 2000)
+				}
+			} else {
+				let linkJumpMap = {
+					2: `/pages/user/order/order-details?orderId=${cell.orderId}`,
+					3: `/pages/user/order/order-details?orderId=${cell.orderId}`,
+					4: `/pages/user/order/order-details?orderId=${cell.orderId}`,
+					5: `/pages/user/order/order-logistics?orderId=${cell.orderId}`,
+					6: `/pages/user/order/order-details?orderId=${cell.orderId}`
+				}
+				uni.navigateTo({
+				    url: linkJumpMap[cell.orderMessageType]
+				})
+			}
+		},
+		isOnliyPay(cell){
+			let onliyPay = false
+			let statusVal = [11, 12, 13, 21, 22, 23, 111]
+			statusVal.forEach(value => {
+				if (cell.status === value) {
+					onliyPay = true
+				}
+			})
+			return onliyPay
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getReachBottomData()
+		} else {
+            console.log(111)
+        }
+	},
+	onPullDownRefresh() {
+		//下拉刷新
+		this.listQuery.pageNum = 1
+		// this.getUserAuthClubMessageList()
+		uni.stopPullDownRefresh()
+	},
+	onShow() {
+        this.skeletonShow = false
+        console.log(this.isEmpty)
+    }
+}
+</script>
+
+<style lang="scss">
+page {
+	background-color: #f7f7f7;
+}
+.container-main {
+	width: 100%;
+	box-sizing: border-box;
+	padding: 24rpx 0;
+    .empty-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        height: 60vh;
+    }
+	.empty_notice {
+		width: 290rpx;
+		height: 230rpx;
+	}
+    .error-text{
+        color: #999999;
+        font-size: 26rpx;
+    }
+}
+.tui-notice {
+	margin-bottom: 24rpx;
+}
+.tui-notice-cell {
+	width: 702rpx;
+	height: auto;
+	background-color: #ffffff;
+	border-radius: 16rpx;
+	box-sizing: border-box;
+	padding: 16rpx 24rpx;
+	margin: 0 auto;
+	.tui-cell-top {
+		width: 100%;
+		height: 88rpx;
+		line-height: 88rpx;
+		.cell-title {
+			font-size: 32rpx;
+			color: #333333;
+			float: left;
+			font-weight: bold;
+		}
+		.cell-time {
+			font-size: 24rpx;
+			color: #999999;
+			float: right;
+		}
+	}
+	.tui-cell-content {
+		width: 100%;
+		height: 160rpx;
+		box-sizing: border-box;
+		padding: 16rpx;
+		border-radius: 8rpx;
+		background-color: #f7f7f7;
+		.cell-image {
+			width: 128rpx;
+			height: 128rpx;
+			border-radius: 8rpx;
+			float: left;
+			image {
+				width: 128rpx;
+				height: 128rpx;
+				display: block;
+				border-radius: 8rpx;
+			}
+		}
+		.cell-content {
+			width: 490rpx;
+			height: 100%;
+			box-sizing: border-box;
+			padding: 0 20rpx;
+			line-height: 40rpx;
+			font-size: 28rpx;
+			color: #666666;
+			text-align: justify;
+			float: left;
+		}
+	}
+	.tui-cell-bot {
+		width: 100%;
+		height: 80rpx;
+		box-sizing: border-box;
+		padding: 16rpx 0 0 0;
+		.tui-cell-btn {
+			width: 160rpx;
+			height: 64rpx;
+			border-radius: 35rpx;
+			box-sizing: border-box;
+			border: 1px solid #999999;
+			text-align: center;
+			line-height: 64rpx;
+			font-size: 26rpx;
+			color: #333333;
+			float: right;
+			margin-left: 24rpx;
+		}
+	}
+}
+.tui-custom-btn_box {
+	width: 80px;
+	height: 100%;
+	box-sizing: border-box;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	background-color: #f7f7f7;
+}
+
+.tui-custom-btn {
+	width: 56rpx;
+	height: 56rpx;
+	border-radius: 50%;
+	background-color: #f94b4b;
+	color: #ffffff;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	flex-shrink: 0;
+    .deleteImage{
+        width: 56rpx;
+        height: 56rpx;
+    }
+}
+</style>

+ 19 - 0
pages/notice/club/notice-server.vue

@@ -0,0 +1,19 @@
+<template>
+    <view>
+        服务通知
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                
+            };
+        }
+    }
+</script>
+
+<style lang="scss">
+
+</style>

+ 19 - 0
pages/notice/club/notice-users.vue

@@ -0,0 +1,19 @@
+<template>
+    <view>
+        账户通知
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                
+            };
+        }
+    }
+</script>
+
+<style lang="scss">
+
+</style>

+ 243 - 0
pages/tabBar/notice/notice.vue

@@ -0,0 +1,243 @@
+<template>
+    <view class="notice clearfix" :style="{ paddingTop: CustomBar + 'px' }">
+        <tui-skeleton
+        	v-if="skeletonShow"
+        	backgroundColor="#fafafa"
+        	borderRadius="10rpx"
+        	:isLoading="true"
+        	:loadingType="5"
+        ></tui-skeleton>
+        <view v-else>
+            <view class="navbar-wrap" :style="{ height: CustomBar + 'px', paddingTop: StatusBar + 'px' }">
+            	<view
+            		class="navbar-text"
+            		:style="{ lineHeight: CustomBar - StatusBar + 'px;', fontSize: fontSizeSetting + 'px;' }"
+            	>
+            		消息 <image class="iconfont icon-qingli" @click="clearNews" src="@/static/tabBar/clean_notice.png"></image>
+            	</view>
+            </view>
+            <view class="container-notice">
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-order?messageType=1')">
+                	<view class="notice-cell-icon">
+                		<image class="icon-image" src="@/static/tabBar/play_notice.png" mode=""></image>
+                	</view>
+                	<view class="notice-cell-text"> 交易物流 <text class="cell-text">官方</text> </view>
+                	<view class="notice-cell-badge" v-if="tradeCount > 0">
+                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                			{{ tradeCount | BadgeType }}
+                		</text>
+                	</view>
+                </view>
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-users?messageType=2')">
+                	<view class="notice-cell-icon">
+                		<image class="icon-image" src="@/static/tabBar/user_notice.png" mode=""></image>
+                	</view>
+                	<view class="notice-cell-text"> 账户通知 <text class="cell-text">官方</text> </view>
+                	<view class="notice-cell-badge" v-if="accountCount > 0">
+                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                			{{ accountCount | BadgeType }}
+                		</text>
+                	</view>
+               </view>
+               <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-server?messageType=3')">
+                	<view class="notice-cell-icon">
+                		<image class="icon-image" src="@/static/tabBar/server_notice.png" mode=""></image>
+                	</view>
+                	<view class="notice-cell-text"> 服务通知 <text class="cell-text">官方</text> </view>
+                	<view class="notice-cell-badge" v-if="notificationCount > 0">
+                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                			{{ notificationCount | BadgeType }}
+                		</text>
+                	</view>
+                </view>
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-coupon?messageType=4')">
+                	<view class="notice-cell-icon">
+                		<image class="icon-image" src="@/static/tabBar/preferential_notice.png" mode=""></image>
+                	</view>
+                	<view class="notice-cell-text"> 优惠促销 <text class="cell-text">官方</text> </view>
+                	<view class="notice-cell-badge" v-if="promotionCount > 0">
+                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                			{{ promotionCount | BadgeType }}
+                		</text>
+                	</view>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+    import { mapGetters, mapMutations } from 'vuex'
+    export default {
+        data() {
+            return {
+                skeletonShow: true,
+                // CustomBar: this.CustomBar,
+                // StatusBar: this.StatusBar,
+                // fontSizeSetting: this.fontSizeSetting,
+                CustomBar: '',
+                StatusBar: '',
+                fontSizeSetting: '',
+                StaticUrl: '',
+                clubId: 0,
+                allCount:0,
+                tradeCount: 0,
+                accountCount: 0,
+                notificationCount: 0,
+                promotionCount: 0
+            }
+        },
+        filters: {
+            BadgeType: (val) => (val && val >= 99 ? '99+' : val), // 红点的提示信息
+        },
+        computed: {
+            ...mapGetters(['hasLogin'])
+        },
+        watch: {},
+        onPullDownRefresh() {
+            uni.stopPullDownRefresh()
+        },
+        onShow() {
+            console.log(this.hasLogin)
+            if (this.hasLogin) {
+            	this.initData()
+            } else {
+            	this.initLogin()
+            }
+        },
+        methods: {
+            initLogin() {
+                console.log(111)
+                uni.redirectTo({ url: '/pages/authorize/login-custom' })
+            },
+            initData() {
+                this.skeletonShow = false
+                this.getSystomInfo()
+            },
+            getSystomInfo() {
+                uni.getSystemInfo({
+                    success: (e) => {
+                        if (e.platform == 'android') {
+                            this.CustomBar = e.statusBarHeight + 50
+                        } else {
+                            this.CustomBar = e.statusBarHeight + 45
+                        };
+                        this.StatusBar = e.statusBarHeight
+                        this.fontSizeSetting = e.fontSizeSetting
+                    }
+                })
+            },
+            navigateTo(url) {
+                uni.navigateTo({
+                    url: url,
+                })
+            },
+        },
+    }
+</script>
+
+<style lang="scss">
+.navbar-wrap {
+	position: fixed;
+	width: 100%;
+	top: 0;
+	z-index: 100000;
+	box-sizing: border-box;
+	background: #ffffff;
+	.navbar-text {
+		font-size: 30rpx;
+		color: #000000;
+		font-weight: 500;
+		text-align: center;
+		.iconfont {
+			display: inline-block;
+			width: 48rpx;
+			height: 48rpx;
+			border-radius: 50%;
+			background-color: #f5f5f5;
+			text-align: center;
+			line-height: 48rpx;
+			color: #666666;
+			font-size: 30rpx;
+			margin-left: 20rpx;
+		}
+	}
+}
+.container-notice {
+	width: 100%;
+	height: auto;
+	box-sizing: border-box;
+	padding: 0 24rpx;
+	padding-top: 20rpx;
+	.notice-cell {
+		width: 100%;
+		height: 130rpx;
+		box-sizing: border-box;
+		padding: 19rpx 0;
+		border-bottom: 1px solid #e1e1e1;
+		.notice-cell-icon {
+			width: 92rpx;
+			height: 92rpx;
+			float: left;
+			.icon-image {
+				width: 92rpx;
+				height: 92rpx;
+				display: block;
+			}
+		}
+		.notice-cell-text {
+			width: 400rpx;
+			height: 100%;
+			line-height: 92rpx;
+			font-size: 34rpx;
+			text-align: left;
+			margin-left: 24rpx;
+			float: left;
+			.cell-text {
+				display: inline-block;
+				height: 32rpx;
+				padding: 0 11rpx;
+				line-height: 32rpx;
+				border-radius: 20rpx;
+				text-align: center;
+				border: 1px solid #e15616;
+				font-size: 24rpx;
+				color: #e15616;
+				margin-left: 10rpx;
+			}
+		}
+		.notice-cell-badge {
+			width: 92rpx;
+			height: 92rpx;
+			float: right;
+			box-sizing: border-box;
+			padding: 25rpx 15rpx;
+			text-align: right;
+		}
+	}
+}
+.uni-badge--small {
+	-webkit-transform: scale(0.8);
+	-ms-transform: scale(0.8);
+	transform: scale(0.8);
+	-webkit-transform-origin: center center;
+	-ms-transform-origin: center center;
+	transform-origin: center center;
+}
+.uni-badge {
+	font-family: 'Helvetica Neue', Helvetica, sans-serif;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+	font-size: 12px;
+	line-height: 1;
+	display: inline-block;
+	padding: 3px 6px;
+	color: #333;
+	border-radius: 100px;
+	background-color: #f1f1f1;
+}
+.uni-badge-error {
+	color: #fff;
+	background-color: #ff2a2a;
+}
+</style>

+ 44 - 0
project.config.json

@@ -0,0 +1,44 @@
+{
+  "appid": "wx290030e37cfbff71",
+  "compileType": "miniprogram",
+  "libVersion": "2.31.0",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "coverView": true,
+    "es6": true,
+    "postcss": true,
+    "lazyloadPlaceholderEnable": false,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "autoAudits": false,
+    "uglifyFileName": false,
+    "uploadWithSourceMap": true,
+    "enhance": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true,
+    "useStaticServer": true,
+    "showES6CompileOption": false,
+    "checkInvalidKey": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "disableUseStrict": false,
+    "useCompilerPlugins": false,
+    "minifyWXML": true
+  },
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  },
+  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "simulatorPluginLibVersion": {}
+}

+ 7 - 0
project.private.config.json

@@ -0,0 +1,7 @@
+{
+  "projectname": "caimei-applets-store",
+  "setting": {
+    "compileHotReLoad": true
+  },
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
+}

BIN
static/tabBar/clean_notice.png


BIN
static/tabBar/delete_notice.png


BIN
static/tabBar/emtry_notice.png


BIN
static/tabBar/notice.png


BIN
static/tabBar/notice_active.png


BIN
static/tabBar/play_notice.png


BIN
static/tabBar/preferential_notice.png


BIN
static/tabBar/server_notice.png


BIN
static/tabBar/user_notice.png


+ 4 - 1
store/getters.js

@@ -13,7 +13,10 @@ const getters = {
     usedNum: state => state.coupon.usedNum,
     couponAlertType: state => state.coupon.couponAlertType,
     couponNoticeFlag: state => state.coupon.couponNoticeFlag,
-    kindCount: state => state.cart.kindCount
+    kindCount: state => state.cart.kindCount,
+    isIphoneX: state => state.app.isIphoneX,
+    isIphone: state => state.app.isIphone,
+    hasLogin: state => state.user.hasLogin,
 }
 
 export default getters

+ 16 - 2
store/modules/app.js

@@ -1,7 +1,9 @@
 const state = {
 	model: '',
 	safeArea: true,
-	systemInfo: {}
+    isIphoneX: '',
+	systemInfo: {},
+    isIphone: true,
 }
 
 const mutations = {
@@ -16,6 +18,12 @@ const mutations = {
 		console.log('safeArea', safeArea)
 		state.safeArea = safeArea
 	},
+    SET_CHANGE_VAR: (state, isIphoneX) => {
+        state.isIphoneX = isIphoneX
+    },
+    SET_IS_IPHONE: (state, isIphone) => {
+        state.isIphone = isIphone
+    },
 }
 
 const actions = {
@@ -28,7 +36,13 @@ const actions = {
 		if (reg.test(model) || model.indexOf('iphone') === -1) {
 			commit('SET_SAFE_AREA', false)
 		}
-	}
+	},
+    setVariableFun: function(context, vData) {
+        context.commit('SET_CHANGE_VAR', vData)
+    },
+    setIsIphoneFun: function(context, vData) {
+        context.commit('SET_IS_IPHONE', vData)
+    },
 }
 
 export default {

+ 13 - 1
store/modules/user.js

@@ -14,6 +14,7 @@ function initUserState() {
         userIdentity: -1, // 用户类型
         inviteUserId: '', // 分享者用户ID
         accessToken: '', // token
+        hasLogin: false, // 用户是否登录
     }
     const userInfo = getStorage('USER_INFO')
     if (userInfo) {
@@ -32,6 +33,7 @@ console.log(state)
 
 const mutations = {
     SET_USER_INFO: (state, userInfo) => {
+        state.hasLogin = true
         objAssign(state, userInfo)
     },
     SET_INVITE_USER_ID: (state, id) => {
@@ -39,7 +41,10 @@ const mutations = {
     },
     SET_ACCESS_TOKEN: (state, token) => {
         state.accessToken = token
-    }
+    },
+    SET_LOGINOUT: (state, logout) => {
+        state.hasLogin = logout
+    },
 }
 
 const actions = {
@@ -52,8 +57,11 @@ const actions = {
             commit('SET_USER_INFO', data)
             setStorage('USER_INFO', data)
             dispatch('getAccessToken') // 获取token
+            commit('SET_LOGINOUT', true)
         } catch (e) {
+            commit('SET_LOGINOUT', false)
             console.log(e)
+            
         }
     },
     // 手机号注册登录
@@ -63,7 +71,9 @@ const actions = {
             const data = JSON.parse(res.data)
             commit('SET_USER_INFO', data)
             setStorage('USER_INFO', data)
+            commit('SET_LOGINOUT', true)
         } catch (e) {
+            commit('SET_LOGINOUT', false)
             console.log(e)
         }
     },
@@ -73,7 +83,9 @@ const actions = {
             const res = await getAccessToken()
             commit('SET_ACCESS_TOKEN', res.data)
             setStorage('ACCESS_TOKEN', res.data)
+            commit('SET_LOGINOUT', true)
         } catch (e) {
+            commit('SET_LOGINOUT', false)
             console.log(e)
         }
     }