diff --git a/components/certifiedCj/certifiedCj.vue b/components/certifiedCj/certifiedCj.vue
index 6adf96e..d2df719 100644
--- a/components/certifiedCj/certifiedCj.vue
+++ b/components/certifiedCj/certifiedCj.vue
@@ -27,13 +27,16 @@
}
},
created() {
- this.getCertifiedCj()
this.imgUrl = uni.getStorageSync('img_url')
+ this.getCertifiedCj()
},
methods: {
// 获取认证厂家列表
getCertifiedCj() {
- this.$apiServe.getCertifiedCj().then(res => {
+ this.$apiServe.getCertifiedCj({
+ pageSize: 2,
+ pageNum: 1
+ }).then(res => {
// console.log('认证厂家', res.data.data)
this.cjsList = res.data.data
}).finally(_ => {})
diff --git a/components/myAvatar/myAvatar.vue b/components/myAvatar/myAvatar.vue
index 3e488e0..46926b9 100644
--- a/components/myAvatar/myAvatar.vue
+++ b/components/myAvatar/myAvatar.vue
@@ -4,20 +4,20 @@
-
+
-
+
- {{nickname}}
+ {{nickname}}
-
+
@@ -38,13 +38,14 @@
},
data() {
return {
- member: false,
+ member: '',
showEdit: true,
avatar: '',
nickname: '用户',
normal: '/static/my/wo_icon_pthy.png',
VIP: '/static/my/wo_icon_vip.png',
isLoad: true,
+ timoutText: 1
};
},
created() {
@@ -66,40 +67,39 @@
//获取头像昵称和普通会员和VIP会员
getUser() {
this.$apiServe.getUser().then(res => {
- console.log('个人信息==', res.data);
- if (res.data.msg == "登录超时,请重新登录") {
- if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
- this.$toast.warn('登录失败请重试')
- this.isLoad = false
- // uni.navigateTo({
- // url: '../../pages/my/login/login'
- // })
- return
- }
+ // if (res.data.msg === "登录超时,请重新登录") {
+ // this.isLoad = false
+ // }
+ if (res.data.code === -1) {
+ this.isLoad = false
}
var data = res.data.data
- this.avatar = data.avatar
- this.nickname = data.nickname
- this.member = data.member
+ console.log('data个人信息', data);
+ if (data) {
+ this.avatar = uni.getStorageSync('img_url') + data.avatar
+ this.nickname = data.nickname
+ this.member = data.member
+ uni.setStorageSync('user_id', data.user_id)
+ uni.setStorageSync('member', data.member)
+ uni.setStorageSync('agreement', data.agreement)
+ uni.setStorageSync('com_name', data.com_name)
+ uni.setStorageSync('com_mobile', data.com_mobile)
+ }
}).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
- // uni.navigateTo({
- // url: '../../pages/my/login/login'
- // })
return
}
this.isLoad = true
- this.$refs.myavatar.getUser()
+ this.getUser()
},
failToLoad() {
- // uni.navigateBack({
- // url: '/pages/my/my'
- // })
- this.$toast.warn('登录失败请重试')
+ uni.navigateBack({
+ url: '/pages/index/index'
+ })
}
}
}
diff --git a/components/myForm/myForm.vue b/components/myForm/myForm.vue
index 9525f90..4550eb0 100644
--- a/components/myForm/myForm.vue
+++ b/components/myForm/myForm.vue
@@ -3,11 +3,11 @@
+ placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled">
+ placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled">
@@ -19,6 +19,7 @@
name: "myForm",
data() {
return {
+ disabled: false,
model: {
userInfo: {
name: '',
@@ -27,12 +28,20 @@
},
};
},
+ options: {
+ styleIsolation: 'shared', // 解除样式隔离
+ },
created() {
-
+ // if (uni.getStorageSync('com_mobile') && uni.getStorageSync('com_name')) {
+ // this.model.userInfo.name = uni.getStorageSync('com_name')
+ // this.model.userInfo.phone = uni.getStorageSync('com_mobile')
+ // }
}
}
-
diff --git a/components/news/news.vue b/components/news/news.vue
index f7b78c9..3766bb7 100644
--- a/components/news/news.vue
+++ b/components/news/news.vue
@@ -32,19 +32,25 @@
}
},
created() {
- this.getNews()
this.imgUrl = uni.getStorageSync('img_url')
+ this.getNews()
},
methods: {
getNews() {
- this.$apiServe.getNews().then(res => {
- // console.log('行业新闻', res.data.data)
+ this.$apiServe.getNews({
+ pageSize: 3,
+ pageNum: 1
+ }).then(res => {
let newsData = res.data.data
- for (const item of newsData) {
- item.pub_time_str = dateFormat(item.pub_time_str)
+ console.log('新闻', newsData);
+ if (newsData) {
+ for (const item of newsData) {
+ item.pub_time_str = dateFormat(item.pub_time_str)
+ }
+ // newsData = newsData.slice(0, 3)
+ this.newsList = newsData
}
- newsData = newsData.slice(0, 3)
- this.newsList = newsData
+
}).finally(_ => {})
},
// 跳转到新闻详情页
diff --git a/components/productsBtn/productsBtn.vue b/components/productsBtn/productsBtn.vue
index 4a37ac8..a320e44 100644
--- a/components/productsBtn/productsBtn.vue
+++ b/components/productsBtn/productsBtn.vue
@@ -2,23 +2,23 @@
-
+
-
+
{{item.cate_name}}
-
+
{{item.name}}
- {{item.desc}}
+ {{item.title}}
暂无更多浏览记录
-
@@ -57,9 +56,7 @@
imgUrl: '',
tagsArray: [],
productList: [],
- // showM: false,
- content: '您确定移除吗?',
- productList: []
+ content: '您确定移除吗?'
}
},
props: {
@@ -69,22 +66,26 @@
styleIsolation: 'shared', // 解除样式隔离
},
created() {
- this.getHistoryOrCollection()
this.imgUrl = uni.getStorageSync('img_url')
+ this.getHistoryOrCollection()
},
methods: {
//获取历史记录
getHistoryOrCollection() {
this.$apiServe.getHistoryOrCollection(this.type).then(res => {
let data = res.data.data
- for (const item of data) {
- let tag = item.tags
- this.tagsArray = tag.split(',')
- item.tags = this.tagsArray[0]
- item.create_time = dateFormatHistory(item.create_time)
+ console.log('浏览记录或收藏', res.data);
+ if (data) {
+ for (const item of data) {
+ let tag = item.tags
+ if (tag) {
+ this.tagsArray = tag.split(',')
+ item.tags = this.tagsArray[0]
+ }
+ item.create_time = dateFormatHistory(item.create_time)
+ }
+ this.productList = data
}
- console.log('获取历史记录', data);
- this.productList = data
}).finally(_ => {
})
@@ -132,7 +133,7 @@
//点击图片跳转到详情页
toDetailPage(item) {
uni.navigateTo({
- url: '/pages/detail/productsDetail/productsDetail?id=' + item.id
+ url: '/pages/detail/productsDetail/productsDetail?id=' + item.product_id
})
}
}
diff --git a/components/productsByThumb/productsByThumb.vue b/components/productsByThumb/productsByThumb.vue
index 5d92239..55a323a 100644
--- a/components/productsByThumb/productsByThumb.vue
+++ b/components/productsByThumb/productsByThumb.vue
@@ -11,7 +11,7 @@
{{item.cate_name}}
-
+
{{item.name}}
@@ -53,8 +53,8 @@
// this.sortType = 2
// }
// })
- this.getProductsByThumb()
this.imgUrl = uni.getStorageSync('img_url')
+ this.getProductsByThumb()
},
methods: {
//获取按点赞量排列的产品列表
@@ -64,6 +64,7 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
+ console.log('产品列表2', res.data);
let tags = res.data.data
for (const item of tags) {
let tag = item.tags
diff --git a/components/productsByTime/productsByTime.vue b/components/productsByTime/productsByTime.vue
index 827eaea..4f66a44 100644
--- a/components/productsByTime/productsByTime.vue
+++ b/components/productsByTime/productsByTime.vue
@@ -11,7 +11,7 @@
{{item.cate_name}}
-
+
{{item.name}}
@@ -38,7 +38,7 @@
export default {
data() {
return {
- imgUrl: '',
+ imgUrl: null,
tagsArray: [],
productList: [],
pageNum: 1, // 当前页
@@ -47,15 +47,8 @@
}
},
created() {
- // uni.$on("getCurrent", data => {
- // if (data == 0) {
- // this.sortType = 1
- // } else if (data == 1) {
- // this.sortType = 2
- // }
- // })
- this.getProductsByTime()
this.imgUrl = uni.getStorageSync('img_url')
+ this.getProductsByTime()
},
methods: {
//获取按上架时间排列的产品列表
@@ -65,17 +58,21 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
+ console.log('产品列表1', res.data);
let tags = res.data.data
- for (const item of tags) {
- let tag = item.tags
- this.tagsArray = tag.split(',')
- item.tags = this.tagsArray[0]
+ if (tags) {
+ for (const item of tags) {
+ let tag = item.tags
+ this.tagsArray = tag.split(',')
+ item.tags = this.tagsArray[0]
+ }
+ this.$emit("getTimeLength", tags.length);
+ // 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
+ this.productList = [...this.productList, ...res.data.data]
+ //这用于上架时间和点赞量的数据切换
+ // this.productList = res.data.data
}
- this.$emit("getTimeLength", tags.length);
- // 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
- this.productList = [...this.productList, ...res.data.data]
- //这用于上架时间和点赞量的数据切换
- // this.productList = res.data.data
+
}).finally(_ => {
})
diff --git a/components/uni-searchbar.vue b/components/uni-searchbar.vue
index 825dcd8..96b2100 100644
--- a/components/uni-searchbar.vue
+++ b/components/uni-searchbar.vue
@@ -7,18 +7,14 @@
-
-
+
+
- 搜索优质商品
+ 搜索优质商品
搜索
@@ -65,10 +61,10 @@
},
methods: {
goSearch(value) {
- if(!this.queryParamF && value) {
+ if (!this.queryParamF && value) {
this.queryParamF = value
}
- if(this.readOnly) {
+ if (this.readOnly) {
this.$emit('navigate')
return
}
@@ -94,12 +90,14 @@
margin: 10rpx 10rpx;
display: flex;
align-items: center;
+
.top-left {
width: calc(100% - 200rpx);
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
+
.search-input {
display: flex;
border: 2rpx solid #fff;
@@ -107,6 +105,7 @@
border-radius: 50rpx;
height: 100%;
margin-left: 10rpx;
+
.search-btn {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
diff --git a/manifest.json b/manifest.json
index d6a5f62..be8d37c 100644
--- a/manifest.json
+++ b/manifest.json
@@ -17,7 +17,9 @@
"delay": 0
},
/* 模块配置 */
- "modules": {},
+ "modules": {
+ "Share": {}
+ },
/* 应用发布信息 */
"distribute": {
/* android打包配置 */
@@ -43,7 +45,14 @@
/* ios打包配置 */
"ios": {},
/* SDK配置 */
- "sdkConfigs": {}
+ "sdkConfigs": {
+ "share": {
+ "weixin": {
+ "appid": "wx8da30ba464a770ba",
+ "UniversalLinks": ""
+ }
+ }
+ }
}
},
/* 快应用特有相关 */
diff --git a/package-lock.json b/package-lock.json
index 138868d..e307ef7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2,25 +2,11 @@
"name": "pupil",
"lockfileVersion": 2,
"requires": true,
- "packages": {
- "": {
- "dependencies": {
- "uview-ui": "^2.0.35"
- }
- },
- "node_modules/uview-ui": {
- "version": "2.0.36",
- "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.36.tgz",
- "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==",
- "engines": {
- "HBuilderX": "^3.1.0"
- }
- }
- },
+ "lockfileVersion": 1,
"dependencies": {
"uview-ui": {
"version": "2.0.36",
- "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.36.tgz",
+ "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
"integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA=="
}
}
diff --git a/package.json b/package.json
index 888cf7d..49fd105 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
"dependencies": {
- "uview-ui": "^2.0.35"
+ "uview-ui": "^2.0.36"
}
}
diff --git a/packageMy/bindCompany/bindCompany.vue b/packageMy/bindCompany/bindCompany.vue
index c74d996..ca58d82 100644
--- a/packageMy/bindCompany/bindCompany.vue
+++ b/packageMy/bindCompany/bindCompany.vue
@@ -21,29 +21,32 @@
}
},
methods: {
- handleSureClick() {
- let name = this.$refs.nameAndphone.model.userInfo.name
- let phone = this.$refs.nameAndphone.model.userInfo.phone
- this.$apiServe.bindComponyAndUpdate({
- uid: 1,
- type: 1,
- companyName: name,
- companyPhone: phone
- }).then(res => {
- console.log('绑定公司', res.data);
- if (res.data.code == 20003) {
- this.showM = true
- } else if (res.data.code == 20005) {
- this.$toast.warn('请完善数据')
- }
- }).finally(_ => {})
- },
- confirm() {
- this.showM = false
- // uni.switchTab({
- // url: '/pages/my/my'
- // })
- }
+ // handleSureClick() {
+ // let name = this.$refs.nameAndphone.model.userInfo.name
+ // let phone = this.$refs.nameAndphone.model.userInfo.phone
+ // if (!/^1[3456789]\d{9}$/.test(phone)) {
+ // this.$toast.warn('请输入正确的手机号')
+ // return false
+ // }
+ // // this.$apiServe.bindComponyAndUpdate({
+ // // uid: 1,
+ // // type: 1,
+ // // companyName: name,
+ // // companyPhone: phone
+ // // }).then(res => {
+ // // console.log('绑定公司', res.data);
+ // // if (res.data.code == 20003) {
+ // // this.showM = true
+ // // } else if (res.data.code == 20005) {
+ // // this.$toast.warn('请完善数据')
+ // // }
+ // // }).finally(_ => {})
+ // },
+ // confirm() {
+ // uni.reLaunch({
+ // url: '/pages/my/my'
+ // })
+ // }
}
}
diff --git a/packageMy/changeAvatar/changeAvatar.vue b/packageMy/changeAvatar/changeAvatar.vue
index f22e39a..f02d440 100644
--- a/packageMy/changeAvatar/changeAvatar.vue
+++ b/packageMy/changeAvatar/changeAvatar.vue
@@ -3,7 +3,6 @@
-
@@ -40,17 +39,20 @@
//获取头像昵称
getUser() {
this.$apiServe.getUser().then(res => {
- console.log('头像昵称', res.data);
var data = res.data.data
- this.avatar = data.avatar
- this.model.userInfo.name = data.nickname
+ console.log('头像昵称', res);
+ if (data) {
+ this.avatar = uni.getStorageSync('img_url') + data.avatar
+ this.avatarUrl = '/' + data.avatar
+ this.model.userInfo.name = data.nickname
+ }
}).finally(_ => {})
},
updatePromise(filePath) {
return new Promise((resolve, reject) => {
const token = uni.getStorageSync('loginToken')
const a = uni.uploadFile({
- url: apiService.uploadImgUrl + '/upload/image/',
+ url: apiService.uploadImgUrl,
filePath: filePath,
name: 'file',
header: {
@@ -58,10 +60,7 @@
'Authorization': token
},
success: (res) => {
- console.log('上传头像', JSON.parse(res.data));
- // setTimeout(() => {
resolve(JSON.parse(res.data).data.url)
- // }, 1000)
}
});
})
@@ -78,7 +77,6 @@
const result = this.updatePromise(res.tempFilePaths[0]) //上传图片
result.then(value => {
this.avatarUrl = '/' + value
- console.log(this.avatarUrl);
})
}
}
diff --git a/packageMy/memberCenter/memberCenter.vue b/packageMy/memberCenter/memberCenter.vue
index 34ee662..23687d4 100644
--- a/packageMy/memberCenter/memberCenter.vue
+++ b/packageMy/memberCenter/memberCenter.vue
@@ -3,13 +3,14 @@
-
+
{{commitment}}
-
+
+
@@ -23,43 +24,79 @@
name: '',
phone: '',
showM: false,
+ btnText: '升级VIP',
+ btnDisabled: false,
//部分产品无权限访问,需升级VIP
needAsk: '',
//会员中心的用户名旁边不显示edit图标
show: false,
content: `请保持手机畅通
客服会及时联系您`,
- commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
+ commitment: ''
}
},
onLoad(option) {
- console.log('ask', option.ask);
+ if (uni.getStorageSync('member') == 2) {
+ this.btnText = '升级VIP'
+ } else if (uni.getStorageSync('member') == 3) {
+ this.btnText = '升级vip,正在审核中'
+ this.btnDisabled = true
+ } else if (uni.getStorageSync('member') == 4) {
+ this.btnText = '升级VIP'
+ this.btnDisabled = true
+ }
+ this.commitment = uni.getStorageSync('agreement')
if (option.ask == 1) {
this.needAsk = option.ask
}
+ if (uni.getStorageSync('com_name') && uni.getStorageSync('com_mobile')) {
+ if (uni.getStorageSync('member') == 3 || uni.getStorageSync('member') == 4) {
+ this.$refs.nameAndphone.model.userInfo.name = uni.getStorageSync('com_name')
+ this.$refs.nameAndphone.model.userInfo.phone = uni.getStorageSync('com_mobile')
+ this.$refs.nameAndphone.disabled = true
+ }
+ }
},
methods: {
handleSureClick() {
- let name = this.$refs.nameAndphone.model.userInfo.name
- let phone = this.$refs.nameAndphone.model.userInfo.phone
- this.$apiServe.bindComponyAndUpdate({
- uid: 1,
- type: 2,
- companyName: name,
- companyPhone: phone
- }).then(res => {
- console.log('升级VIP', res.data);
- if (res.data.code == 20003) {
- this.showM = true
- } else if (res.data.code == 20005) {
- this.$toast.warn('请完善数据')
+ if (this.btnDisabled == false) {
+ let name = this.$refs.nameAndphone.model.userInfo.name
+ let phone = this.$refs.nameAndphone.model.userInfo.phone
+ console.log('name', name);
+ console.log('phone', phone);
+
+ if (!/^1[3456789]\d{9}$/.test(phone)) {
+ this.$toast.warn('请输入正确的手机号')
+ return false
}
- }).finally(_ => {})
+ if (name == '') {
+ this.$toast.warn('请完善数据')
+ return false
+ }
+ if (name && phone) {
+ console.log('数据已完善');
+ this.$apiServe.bindComponyAndUpdate({
+ uid: uni.getStorageSync('user_id'),
+ type: 2,
+ companyName: name,
+ companyPhone: phone
+ }).then(res => {
+ console.log('升级VIP', res.data);
+ if (res.data.code == 20003) {
+ this.showM = true
+ } else if (res.data.code == 20005) {
+ this.$toast.warn('请完善数据')
+ }
+ }).finally(_ => {})
+ }
+ }
},
confirm() {
- this.showM = false
+ uni.reLaunch({
+ url: '/pages/my/my'
+ })
if (this.needAsk == 1) {
- uni.switchTab({
+ uni.reLaunch({
url: '/pages/index/index'
})
}
diff --git a/packageMy/myRelease/myRelease.vue b/packageMy/myRelease/myRelease.vue
index 55949ca..9818231 100644
--- a/packageMy/myRelease/myRelease.vue
+++ b/packageMy/myRelease/myRelease.vue
@@ -11,14 +11,19 @@
- {{item.pub_time}}
+ {{item.update_time}}
+ {{item.update_time}}
-
+
+
+ 查看
+
+
修改
-
+
删除
@@ -32,14 +37,20 @@
{{item.pname}}
- {{item.pub_time}}
+
+ {{item.update_time}}
+ {{item.update_time}}
-
+
+
+ 查看
+
+
修改
-
+
删除
@@ -74,27 +85,28 @@
name: '创意发布'
}],
needsList: [],
- ideasList: []
+ ideasList: [],
+ updateIndex: ''
}
},
onLoad(options) {
- console.log(options)
- if(options && options.index) {
- console.log(options)
+ if (options && options.index) {
options.index = options.index - 1
+ this.updateIndex = options.index
this.tabChange(options)
return
}
this.getIdeasAndNeeds()
},
methods: {
- //获取创意发布
+ //获取创意发布或需求发布
getIdeasAndNeeds() {
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
- console.log('获取创意发布&需求发布', res.data.data);
let data = res.data.data
+ console.log('创意需求发布数据', res.data);
for (const item of data) {
item.pub_time = dateFormatXwDetail(item.pub_time)
+ item.update_time = dateFormatXwDetail(item.update_time)
const imagesList = item.images && item.images.length > 0 ? item.images.split(';') : []
item.images = imagesList.map(item1 => {
item1 = uni.getStorageSync('img_url') + '/' + item1
@@ -113,7 +125,6 @@
//切换需求发布和创意发布
tabChange(data) {
this.tabCurrent = data.index
- // console.log('data.index', data.index);
if (data.index == 0) {
this.type = 1
} else if (data.index == 1) {
@@ -121,17 +132,32 @@
}
this.getIdeasAndNeeds()
},
+ //查看需求发布或创意发布
+ viewIdeasOrNeeds(item) {
+ const tabCurrent = this.tabCurrent
+ uni.removeStorage({ //删除Storage
+ key: 'update_item',
+ success: () => {
+ uni.setStorageSync('update_item', item);
+ uni.reLaunch({
+ url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' +
+ tabCurrent + '&view=' + 11
+ })
+ }
+ })
+ },
//修改我的需求
editIdeasAndNeeds(item) {
- const tabCurrent = this .tabCurrent
- uni.removeStorage({ //删除Storage
- key:'update_item',
- success: () => {
- uni.setStorageSync('update_item', item);
- uni.reLaunch({
- url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' + tabCurrent
- })
- }
+ const tabCurrent = this.tabCurrent
+ uni.removeStorage({ //删除Storage
+ key: 'update_item',
+ success: () => {
+ uni.setStorageSync('update_item', item);
+ uni.reLaunch({
+ url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' +
+ tabCurrent
+ })
+ }
})
},
//二次确认删除我的需求或创意
@@ -143,7 +169,6 @@
success: function(res) {
if (res.confirm) {
that.$apiServe.deleteIdeasAndNeeds(item.id).then(res => {
- // console.log('删除发布', res);
if (res.data.code == 1) {
that.$toast.warn('删除成功')
}
diff --git a/packageReport/certifiedCj/certifiedCj.vue b/packageReport/certifiedCj/certifiedCj.vue
index da2df04..8acf369 100644
--- a/packageReport/certifiedCj/certifiedCj.vue
+++ b/packageReport/certifiedCj/certifiedCj.vue
@@ -1,7 +1,21 @@
-
- 已经到底啦!
+
+
+
+
+
+ {{item.name}}
+
+
+
+ {{item.tag}}
+
+
+
+ 已经到底啦!
@@ -9,11 +23,46 @@
export default {
data() {
return {
- cjsShow: true
+ cjsShow: '',
+ cjsList: [],
+ imgUrl: '',
+ pageNum: 1, // 当前页
+ pageSize: 12, // 每页条数
+ }
+ },
+ onLoad() {
+ this.imgUrl = uni.getStorageSync('img_url')
+ this.getCertifiedCj()
+ },
+ onReachBottom() {
+ console.log('触底下拉');
+ if (this.cjsShow !== 0) {
+ this.pageNum++
+ this.getCertifiedCj()
}
},
methods: {
- // this.cjsShow = this.list.length === 0 ? true : false
+ // 获取认证厂家列表
+ getCertifiedCj() {
+ this.$apiServe.getCertifiedCj({
+ pageSize: this.pageSize,
+ pageNum: this.pageNum
+ }).then(res => {
+ console.log('认证厂家', res)
+ let cjsData = res.data.data
+ for (const item of cjsData) {
+ this.cjsShow = item.length
+ console.log('this.cjsShow', this.cjsShow);
+ }
+ this.cjsList = [...this.cjsList, ...res.data.data]
+ }).finally(_ => {})
+ },
+ // 跳转到认证厂家详情页
+ clickCj(item) {
+ uni.navigateTo({
+ url: '../certifiedCjDetail/certifiedCjDetail?id=' + item.id
+ })
+ }
}
}
diff --git a/packageReport/certifiedCjDetail/certifiedCjDetail.vue b/packageReport/certifiedCjDetail/certifiedCjDetail.vue
index 2e26956..aa07e3f 100644
--- a/packageReport/certifiedCjDetail/certifiedCjDetail.vue
+++ b/packageReport/certifiedCjDetail/certifiedCjDetail.vue
@@ -21,10 +21,17 @@
-