Merge pull request '修改小程序bug' (#100) from dengjie into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/100
This commit is contained in:
odjbin
2023-02-27 02:04:01 +00:00
8 changed files with 127 additions and 85 deletions

View File

@@ -62,7 +62,6 @@
let tags = res.data.data
if (tags) {
for (const item of tags) {
console.log('item.cover', item.cover);
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]

View File

@@ -52,6 +52,7 @@
},
methods: {
handleSureClick() {
if (this.btnDisabled == false) {
let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone
if (!/^1[3456789]\d{9}$/.test(phone)) {
@@ -71,6 +72,8 @@
this.$toast.warn('请完善数据')
}
}).finally(_ => {})
}
},
confirm() {
uni.reLaunch({

View File

@@ -15,11 +15,15 @@
<text v-else>{{item.pub_time}}</text>
</view>
<view style="display: flex;">
<view class="btn" @click="editIdeasAndNeeds(item)">
<view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">
<u-icon name="eye" color="#15CA65" size="20"></u-icon>
<text class="btn_text">查看</text>
</view>
<view class="btn" @click="editIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
<text class="btn_text">修改</text>
</view>
<view class="btn" @click="deleteIdeasAndNeeds(item)">
<view class="btn" @click="deleteIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
<text class="btn_text">删除</text>
</view>
@@ -38,11 +42,15 @@
<text v-else>{{item.pub_time}}</text>
</view>
<view style="display: flex;">
<view class="btn" @click="editIdeasAndNeeds(item)">
<view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">
<u-icon name="eye" color="#15CA65" size="20"></u-icon>
<text class="btn_text">查看</text>
</view>
<view class="btn" @click="editIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
<text class="btn_text">修改</text>
</view>
<view class="btn" @click="deleteIdeasAndNeeds(item)">
<view class="btn" @click="deleteIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
<text class="btn_text">删除</text>
</view>
@@ -95,6 +103,7 @@
getIdeasAndNeeds() {
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
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)
@@ -123,6 +132,20 @@
}
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

View File

@@ -15,7 +15,7 @@
</view>
</view>
</view>
<view v-if="cjsShow" class="no-data">已经到底啦</view>
<view v-if="cjsShow==0" class="no-data">已经到底啦</view>
</view>
</template>
@@ -23,11 +23,11 @@
export default {
data() {
return {
cjsShow: true,
cjsShow: '',
cjsList: [],
imgUrl: '',
pageNum: 1, // 当前页
pageSize: 4, // 每页条数
pageSize: 12, // 每页条数
}
},
onLoad() {
@@ -35,8 +35,11 @@
this.getCertifiedCj()
},
onReachBottom() {
console.log('触底下拉');
if (this.cjsShow !== 0) {
this.pageNum++
this.getCertifiedCj()
}
},
methods: {
// 获取认证厂家列表
@@ -45,7 +48,12 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
// console.log('认证厂家', 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(_ => {})
},

View File

@@ -17,7 +17,7 @@
</view>
</view>
</view>
<view v-if="newsShow" class="no-data">已经到底啦</view>
<view v-if="newsShow==0" class="no-data">已经到底啦</view>
</view>
</template>
@@ -28,11 +28,11 @@
export default {
data() {
return {
newsShow: true,
newsShow: '',
imgUrl: '',
newsList: [],
pageNum: 1, // 当前页
pageSize: 4, // 每页条数
pageSize: 12, // 每页条数
}
},
onLoad() {
@@ -40,8 +40,11 @@
this.getNews()
},
onReachBottom() {
console.log('触底下拉');
if (this.newsShow !== 0) {
this.pageNum++
this.getNews()
}
},
methods: {
getNews() {
@@ -49,10 +52,12 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
// console.log('行业新闻', res.data.data)
console.log('行业新闻', res.data)
let newsData = res.data.data
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str)
this.newsShow = item.length
console.log('this.newsShow', this.newsShow);
}
this.newsList = [...this.newsList, ...newsData]
}).finally(_ => {})

View File

@@ -160,7 +160,7 @@
"navigationBarTitleText": "行内新闻",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
}, {
"path": "certifiedCj/certifiedCj",
@@ -168,7 +168,7 @@
"navigationBarTitleText": "认证厂家",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
}, {
"path": "newsDetail/newsDetail",
@@ -193,7 +193,7 @@
"navigationBarTitleText": "新品发布",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
}

View File

@@ -87,7 +87,7 @@
</view>
</u-form-item> -->
<view style="padding: 30rpx;background-color: #fff;">
<u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm"></u-button>
<u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm" :disabled="btnDisabled"></u-button>
</view>
<view style="padding: 12rpx 30rpx 20rpx 30rpx;background-color: #fff;">
<text
@@ -120,6 +120,7 @@
},
data() {
return {
btnDisabled: false,
claim_r: '',
claim_c: '',
tabsList: [{
@@ -192,6 +193,9 @@
this.$toast.warn(error)
}
}
if (options.view == 11) {
this.btnDisabled = true
}
if (options.index == 0) {
this.tabCurrent = 0
} else if (options.index == 1) {
@@ -350,6 +354,8 @@
})
},
submitForm() {
if (this.btnDisabled == false) {
if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
this.$toast.warn('请输入正确的手机号')
return false
@@ -394,6 +400,7 @@
}).catch(error => {
this.$toast.warn(error)
})
}
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {

View File

@@ -141,7 +141,6 @@
getBanner() {
this.$apiServe.getBanner().then(res => {
let banner = res.data.data
console.log('轮播图', res.data);
if (banner) {
for (const item of banner) {
item.img = this.imgUrl + item.img
@@ -172,9 +171,7 @@
//获取图片url
getImgUrl() {
this.$apiServe.getImgUrl().then(res => {
console.log('图片url', res.data);
res.data.data.img_url = res.data.data.img_url + '/'
console.log('res.data.data.img_url', res.data.data.img_url);
try {
uni.setStorageSync('img_url', res.data.data.img_url);
this.initStart = true