|
@@ -1,6 +1,8 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
+ <view class="page-title" />
|
|
|
<!-- 轮播图 -->
|
|
|
+
|
|
|
<view class="banner_box">
|
|
|
<view class="banner_list" v-if="bannerList.length">
|
|
|
<swiper class="banner_swiper" :autoplay="true">
|
|
@@ -10,6 +12,21 @@
|
|
|
</swiper>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="icon-list">
|
|
|
+ <icon-list mode="row8" :icons="icons" :gap="0" />
|
|
|
+ </view>
|
|
|
+ <view class="notice-list">
|
|
|
+ <notice-list :noticeList="[{ text: '开邻智数新版本发布啦~' }, { text: '更多新功能敬请期待~' }]" gap="18" />
|
|
|
+ </view>
|
|
|
+ <view class="header-title">
|
|
|
+ <components-header title="专区导航" />
|
|
|
+ </view>
|
|
|
+ <view class="banner-list">
|
|
|
+ <banner-list :images="banners" mode="grid" :gap="16" />
|
|
|
+ </view>
|
|
|
+ <view class="header-title">
|
|
|
+ <components-header title="推荐商品" />
|
|
|
+ </view>
|
|
|
<view class="product_box">
|
|
|
<view class="to_bottom" v-if="!productList.length"> -----还没有产品啦-----</view>
|
|
|
<!-- 产品列表 -->
|
|
@@ -47,7 +64,7 @@
|
|
|
</view>
|
|
|
<view class="to_bottom" v-if="isLast" style="display: flex; justify-content: center">
|
|
|
-----
|
|
|
- <view :style="!productList.length && toSelectedCity ? 'font-weight:bold;font-size:36rpx' : ''">{{ !productList.length && toSelectedCity ? "请点击左上角选择你的城市" : "到底啦" }}</view> -----
|
|
|
+ <view :style="!productList.length && toSelectedCity ? 'font-weight:bold;font-size:36rpx' : ''">{{ !productList.length && toSelectedCity ? '请点击左上角选择你的城市' : '到底啦' }}</view> -----
|
|
|
</view>
|
|
|
<uni-popup ref="addFollow" type="center" class="center_popup">
|
|
|
<FollowPopup :closePopup="closePopup" />
|
|
@@ -56,9 +73,29 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
|
|
|
+import FollowPopup from '@/components/FollowPopup/FollowPopup.vue';
|
|
|
+import IconList from '@/components/IconList';
|
|
|
+import NoticeList from '@/components/Notice';
|
|
|
+import BannerList from '@/components/Banner';
|
|
|
+import ComponentsHeader from '@/components/ComponentsHeader';
|
|
|
+const Icons = [
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d3fed51fa2.ng', text: '全品', urlMap: { internal_url: '/pages/product/list' } },
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d3ffdea775.ng', text: '医保价', urlMap: { internal_url: '/pages/wait/index?id=1' } },
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d400fd5932.ng', text: '行业资讯', urlMap: { internal_url: '/pages/wait/index?id=2' } },
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d401d6a885.ng', text: '直播', urlMap: { internal_url: '/pages/wait/index?id=3' } },
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d402ddaeb6.ng', text: '促销活动', urlMap: { internal_url: '/pages/wait/index?id=4' } },
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d404366cf8.ng', text: '拼团包邮', urlMap: { internal_url: '/pages/wait/index?id=5' } },
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d404c65d9f.ng', text: '积分商城', urlMap: { internal_url: '/pages/score/index' } },
|
|
|
+ { image: 'https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/c/1/s/92/up/20250521/682d40561a23b.ng', text: '领卷中心', urlMap: { internal_url: '/pages/coupon/index' } },
|
|
|
+];
|
|
|
+const Banners = [
|
|
|
+ { image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/index/active.png', text: '区域活动', urlMap: { internal_url: '/pages/wait/index?id=8' } },
|
|
|
+ { image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/index/b2b.png', text: 'B2B专供', urlMap: { internal_url: '/pages/wait/index?id=9' } },
|
|
|
+ { image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/index/exp.png', text: '近效期', urlMap: { internal_url: '/pages/wait/index?id=10' } },
|
|
|
+ { image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/index/heath.png', text: '大健康', urlMap: { internal_url: '/pages/wait/index?id=11' } },
|
|
|
+];
|
|
|
export default {
|
|
|
- components: { FollowPopup },
|
|
|
+ components: { FollowPopup, IconList, NoticeList, BannerList, ComponentsHeader },
|
|
|
data() {
|
|
|
return {
|
|
|
// 轮播图
|
|
@@ -67,7 +104,7 @@ export default {
|
|
|
productList: [],
|
|
|
// 请求参数
|
|
|
requestParam: {
|
|
|
- name: "",
|
|
|
+ name: '',
|
|
|
page: 1,
|
|
|
},
|
|
|
// 是否最后一页
|
|
@@ -77,11 +114,13 @@ export default {
|
|
|
// 是否显示价格
|
|
|
isShowPrice: false,
|
|
|
// 城市名称
|
|
|
- cityName: "选城市",
|
|
|
+ cityName: '选城市',
|
|
|
// 选择城市
|
|
|
toSelectedCity: false,
|
|
|
// 是否是管理员
|
|
|
isManager: false,
|
|
|
+ icons: Icons,
|
|
|
+ banners: Banners,
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -89,7 +128,7 @@ export default {
|
|
|
//分享按钮
|
|
|
uni.showShareMenu({
|
|
|
withShareTicket: true,
|
|
|
- menus: ["shareAppMessage", "shareTimeline"],
|
|
|
+ menus: ['shareAppMessage', 'shareTimeline'],
|
|
|
});
|
|
|
// #endif
|
|
|
},
|
|
@@ -98,13 +137,13 @@ export default {
|
|
|
let shareList = getApp().globalData.shareList;
|
|
|
// 获取分享信息
|
|
|
let shareObj = {
|
|
|
- title: "999智控终端平台\n药优惠 得积分 兑豪礼",
|
|
|
- path: "/pages/index/index",
|
|
|
- imageUrl: "",
|
|
|
+ title: '999智控终端平台\n药优惠 得积分 兑豪礼',
|
|
|
+ path: '/pages/index/index',
|
|
|
+ imageUrl: '',
|
|
|
};
|
|
|
// 循环列表
|
|
|
for (let i in shareList) {
|
|
|
- if (shareList[i].pages == "pages/index/index") {
|
|
|
+ if (shareList[i].pages == 'pages/index/index') {
|
|
|
shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
|
|
|
shareObj.title = shareList[i].title ? `999智控终端平台\n${shareList[i].title}` : shareObj.title;
|
|
|
shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
|
|
@@ -119,7 +158,7 @@ export default {
|
|
|
// 城市名
|
|
|
this.cityName = this.$checkAccess.getCity();
|
|
|
// 选城市
|
|
|
- (this.cityName = this.cityName ? this.cityName : "选城市"),
|
|
|
+ (this.cityName = this.cityName ? this.cityName : '选城市'),
|
|
|
// 登录并且未选择城市,才可以选择城市
|
|
|
(this.toSelectedCity = !this.$checkAccess.getCity() ? true : false);
|
|
|
// 数据
|
|
@@ -127,12 +166,12 @@ export default {
|
|
|
//未选城市先弹窗提醒选择城市
|
|
|
if (!this.$checkAccess.getCity() && this.$checkAccess.checkLogin()) {
|
|
|
uni.showModal({
|
|
|
- title: "",
|
|
|
- content: "请先选择城市",
|
|
|
+ title: '',
|
|
|
+ content: '请先选择城市',
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/user/info",
|
|
|
+ url: '/pages/user/info',
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -142,28 +181,28 @@ export default {
|
|
|
//如果已选城市且没有添加客服每天弹窗一次
|
|
|
if (this.$checkAccess.getCity() && this.$checkAccess.getFollowQrcode()) {
|
|
|
// 获取弹出时间
|
|
|
- let followPopupTime = uni.getStorageSync("followPopupTime");
|
|
|
+ let followPopupTime = uni.getStorageSync('followPopupTime');
|
|
|
// 现在的时候
|
|
|
let nowTime = new Date().getTime();
|
|
|
// 时间戳
|
|
|
followPopupTime = followPopupTime ? followPopupTime : 0;
|
|
|
// 弹出结果
|
|
|
if (followPopupTime <= 0 || followPopupTime - nowTime > 86400000) {
|
|
|
- this.$refs.addFollow.open("center");
|
|
|
- uni.setStorageSync("followPopupTime", nowTime);
|
|
|
+ this.$refs.addFollow.open('center');
|
|
|
+ uni.setStorageSync('followPopupTime', nowTime);
|
|
|
}
|
|
|
}
|
|
|
this.isManager = this.$checkAccess.isManager();
|
|
|
// 没有数据的话,或者请求中,不允许刷新
|
|
|
if (this.isReqing) return;
|
|
|
// 获取列表
|
|
|
- this.$http.request("/api/banner/get_list").then((re) => {
|
|
|
- if (re.code === "success") {
|
|
|
+ this.$http.request('/api/banner/get_list').then((re) => {
|
|
|
+ if (re.code === 'success') {
|
|
|
this.bannerList = re.data;
|
|
|
}
|
|
|
});
|
|
|
// 请求参数
|
|
|
- this.requestParam.name = "";
|
|
|
+ this.requestParam.name = '';
|
|
|
// 请求参数
|
|
|
this.requestParam.page = 1;
|
|
|
// 是否是最后一页
|
|
@@ -171,17 +210,17 @@ export default {
|
|
|
// 设置请求中
|
|
|
this.isReqing = true;
|
|
|
// 请求
|
|
|
- this.$http.request("api/product/get_list", this.requestParam).then((re) => {
|
|
|
+ this.$http.request('api/product/get_list', this.requestParam).then((re) => {
|
|
|
// 设置非请求中
|
|
|
this.isReqing = false;
|
|
|
// 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
- // 如果是最后一页
|
|
|
+ if (re.code == 'success') {
|
|
|
+ // 如果是最后一页
|
|
|
if (re.data.last_page <= this.requestParam.page) this.isLast = true;
|
|
|
- // 赋值
|
|
|
+ // 赋值
|
|
|
this.productList = re.data.data;
|
|
|
- // 获取下一页
|
|
|
- this.getMore(re);
|
|
|
+ // 获取下一页
|
|
|
+ this.getMore(re);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -195,17 +234,17 @@ export default {
|
|
|
// 设置请求中
|
|
|
this.isReqing = true;
|
|
|
// 请求列表
|
|
|
- this.$http.request("api/product/get_list", this.requestParam).then((re) => {
|
|
|
+ this.$http.request('api/product/get_list', this.requestParam).then((re) => {
|
|
|
// 设置非请求中
|
|
|
this.isReqing = false;
|
|
|
// 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
- // 如果是最后一页
|
|
|
+ if (re.code == 'success') {
|
|
|
+ // 如果是最后一页
|
|
|
if (re.data.last_page <= this.requestParam.page) this.isLast = true;
|
|
|
- // 赋值
|
|
|
+ // 赋值
|
|
|
this.productList = re.data.data;
|
|
|
- // 获取下一页
|
|
|
- this.getMore(re);
|
|
|
+ // 获取下一页
|
|
|
+ this.getMore(re);
|
|
|
}
|
|
|
});
|
|
|
uni.stopPullDownRefresh();
|
|
@@ -222,11 +261,11 @@ export default {
|
|
|
// 设置请求中
|
|
|
this.isReqing = true;
|
|
|
// 请求列表
|
|
|
- this.$http.request("api/product/get_list", this.requestParam).then((re) => {
|
|
|
+ this.$http.request('api/product/get_list', this.requestParam).then((re) => {
|
|
|
// 设置非请求中
|
|
|
this.isReqing = false;
|
|
|
// 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
+ if (re.code == 'success') {
|
|
|
// 最后一页
|
|
|
if (re.data.last_page <= this.requestParam.page) this.isLast = true;
|
|
|
// 追加数据
|
|
@@ -235,28 +274,28 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
- // 请求加载下一页
|
|
|
- getMore(callback){
|
|
|
- // 首页不足10个,并且下一页存在大于当前页
|
|
|
- if( this.productList.length < 10 && callback.data.last_page > this.requestParam.page ){
|
|
|
- // 最后一页不再请求
|
|
|
- if (this.isLast) return;
|
|
|
- // 增加一页
|
|
|
- this.requestParam.page = this.requestParam.page + 1;
|
|
|
- // 请求列表
|
|
|
- this.$http.request("api/product/get_list", this.requestParam).then((re) => {
|
|
|
- // 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
- // 最后一页
|
|
|
- if (re.data.last_page <= this.requestParam.page) this.isLast = true;
|
|
|
- // 追加数据
|
|
|
- this.productList.push(...re.data.data);
|
|
|
- // 获取下一页
|
|
|
- this.getMore(re);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
+ // 请求加载下一页
|
|
|
+ getMore(callback) {
|
|
|
+ // 首页不足10个,并且下一页存在大于当前页
|
|
|
+ if (this.productList.length < 10 && callback.data.last_page > this.requestParam.page) {
|
|
|
+ // 最后一页不再请求
|
|
|
+ if (this.isLast) return;
|
|
|
+ // 增加一页
|
|
|
+ this.requestParam.page = this.requestParam.page + 1;
|
|
|
+ // 请求列表
|
|
|
+ this.$http.request('api/product/get_list', this.requestParam).then((re) => {
|
|
|
+ // 成功结果
|
|
|
+ if (re.code == 'success') {
|
|
|
+ // 最后一页
|
|
|
+ if (re.data.last_page <= this.requestParam.page) this.isLast = true;
|
|
|
+ // 追加数据
|
|
|
+ this.productList.push(...re.data.data);
|
|
|
+ // 获取下一页
|
|
|
+ this.getMore(re);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
searchChange(e) {
|
|
|
// 如果没有搜索词
|
|
|
if (!this.requestParam.name) {
|
|
@@ -273,11 +312,11 @@ export default {
|
|
|
// 设置请求中
|
|
|
this.isReqing = true;
|
|
|
// 请求列表
|
|
|
- this.$http.request("api/product/get_list", this.requestParam).then((re) => {
|
|
|
+ this.$http.request('api/product/get_list', this.requestParam).then((re) => {
|
|
|
// 设置非请求中
|
|
|
this.isReqing = false;
|
|
|
// 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
+ if (re.code == 'success') {
|
|
|
this.productList = re.data.data;
|
|
|
if (re.data.data.length && re.data.last_page >= this.requestParam.page) this.isLast = true;
|
|
|
}
|
|
@@ -285,14 +324,14 @@ export default {
|
|
|
},
|
|
|
toDetail(item) {
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/product/index?product_id=" + item.id,
|
|
|
+ url: '/pages/product/index?product_id=' + item.id,
|
|
|
});
|
|
|
},
|
|
|
navLottery(url) {
|
|
|
// 没有路径,不跳转
|
|
|
if (!url) return;
|
|
|
// 判断是不是小程序链接
|
|
|
- if (url.includes("http")) {
|
|
|
+ if (url.includes('http')) {
|
|
|
// 转码
|
|
|
let link_url = encodeURIComponent(url);
|
|
|
// 跳转到webview
|
|
@@ -310,7 +349,7 @@ export default {
|
|
|
this.$refs.addFollow.close();
|
|
|
//存key以及时间
|
|
|
uni.setStorage({
|
|
|
- key: "followPopupTime",
|
|
|
+ key: 'followPopupTime',
|
|
|
data: new Date().getTime(),
|
|
|
});
|
|
|
},
|
|
@@ -319,6 +358,16 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
+.page-title {
|
|
|
+ //渐变加透明;
|
|
|
+ // background: linear-gradient(to bottom, rgba(245, 52, 29, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 588rpx;
|
|
|
+ z-index: -1;
|
|
|
+}
|
|
|
.search_fixed {
|
|
|
top: var(--window-top);
|
|
|
left: 0rpx;
|
|
@@ -397,9 +446,11 @@ export default {
|
|
|
height: 382rpx;
|
|
|
line-height: 382rpx;
|
|
|
text-align: center;
|
|
|
+ border-radius: 8px;
|
|
|
.image {
|
|
|
width: 680rpx;
|
|
|
height: 382rpx;
|
|
|
+ border-radius: 8px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -407,7 +458,7 @@ export default {
|
|
|
.product_box {
|
|
|
display: block;
|
|
|
overflow: hidden;
|
|
|
- margin: 20rpx auto;
|
|
|
+ margin: -20rpx auto 20rpx;
|
|
|
padding: 0rpx 35rpx;
|
|
|
.product_list {
|
|
|
display: block;
|
|
@@ -481,4 +532,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.icon-list {
|
|
|
+ margin-top: 24rpx;
|
|
|
+ padding: 0 35rpx;
|
|
|
+}
|
|
|
+.notice-list {
|
|
|
+ margin-top: 24rpx;
|
|
|
+}
|
|
|
+.header-title {
|
|
|
+ padding: 0 35rpx;
|
|
|
+}
|
|
|
</style>
|