|
|
@ -18,6 +18,7 @@ |
|
|
|
:maxlength="200" |
|
|
|
autoHeight |
|
|
|
count |
|
|
|
style="min-height: 400rpx;" |
|
|
|
placeholder="说点什么吧"></uv-textarea> |
|
|
|
</view> |
|
|
|
|
|
|
@ -25,7 +26,7 @@ |
|
|
|
<view class="images box"> |
|
|
|
<uv-upload |
|
|
|
:fileList="fileList" |
|
|
|
:maxCount="4" |
|
|
|
:maxCount="imageMax" |
|
|
|
multiple |
|
|
|
width="150rpx" |
|
|
|
height="150rpx" |
|
|
@ -41,7 +42,7 @@ |
|
|
|
<view class="tagList"> |
|
|
|
<view |
|
|
|
:class="{act : t.id == form.classId}" |
|
|
|
@click="clickCategory(item, i)" |
|
|
|
@click="clickCategory(t, i)" |
|
|
|
v-for="(t, i) in category" |
|
|
|
:key="i"> |
|
|
|
{{ t.title }} |
|
|
@ -49,6 +50,25 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="category"> |
|
|
|
<view class="title"> |
|
|
|
选择地区 |
|
|
|
</view> |
|
|
|
<view class="tagList"> |
|
|
|
<view |
|
|
|
:class="{act : t.name == form.address}" |
|
|
|
@click="clickAddress(t, i)" |
|
|
|
v-for="(t, i) in cityList" |
|
|
|
:key="i"> |
|
|
|
{{ t.name }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="title-input box"> |
|
|
|
<input type="text" placeholder="手机号码(选填)" v-model="form.phone"/> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="upTop" |
|
|
|
> |
|
|
|
<view class="title"> |
|
|
@ -119,17 +139,22 @@ |
|
|
|
form : { |
|
|
|
title : '', |
|
|
|
classId : 0, |
|
|
|
address : '', |
|
|
|
}, |
|
|
|
id : 0, |
|
|
|
fileList : [], |
|
|
|
imageMax : 9, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed : { |
|
|
|
...mapState(['city', 'category']), |
|
|
|
...mapState(['cityList', 'category']), |
|
|
|
}, |
|
|
|
onLoad(args) { |
|
|
|
this.id = args.id |
|
|
|
this.form.classId = this.category[0].id |
|
|
|
this.form.address = this.cityList[0].name |
|
|
|
this.imageMax = args.imageMax || 9 |
|
|
|
this.getDateil() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.$store.commit('getCategory') |
|
|
@ -138,6 +163,9 @@ |
|
|
|
clickCategory(item, index){ |
|
|
|
this.form.classId = item.id |
|
|
|
}, |
|
|
|
clickAddress(item, index){ |
|
|
|
this.form.address = item.name |
|
|
|
}, |
|
|
|
getDateil(){ |
|
|
|
if(!this.id){ |
|
|
|
return |
|
|
@ -145,10 +173,23 @@ |
|
|
|
|
|
|
|
let self = this |
|
|
|
|
|
|
|
this.$api('indexGetTrendsDetail', { |
|
|
|
this.$api('getPostDetail', { |
|
|
|
id : this.id |
|
|
|
}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
self.form.id = res.result.id |
|
|
|
self.form.title = res.result.title |
|
|
|
self.form.address = res.result.address || self.form.address |
|
|
|
self.form.classId = res.result.classId || self.form.classId |
|
|
|
|
|
|
|
if(res.result.image){ |
|
|
|
res.result.image.split(',') |
|
|
|
.forEach(url => { |
|
|
|
self.fileList.push({ |
|
|
|
url |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -166,58 +207,58 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 发起支付 |
|
|
|
payOrder(){ |
|
|
|
let self = this |
|
|
|
// // 发起支付 |
|
|
|
// payOrder(){ |
|
|
|
// let self = this |
|
|
|
|
|
|
|
let data = { |
|
|
|
// ...this.form, |
|
|
|
content : this.form.content, |
|
|
|
topId : this.form.topId, |
|
|
|
title : this.form.title, |
|
|
|
isCard : 'Y', |
|
|
|
state : 0, |
|
|
|
image : this.fileList.map((item) => item.url).join(","), |
|
|
|
isTop : this.form.topId ? 'Y' : 'N', |
|
|
|
} |
|
|
|
// let data = { |
|
|
|
// // ...this.form, |
|
|
|
// content : this.form.content, |
|
|
|
// topId : this.form.topId, |
|
|
|
// title : this.form.title, |
|
|
|
// isCard : 'Y', |
|
|
|
// state : 0, |
|
|
|
// image : this.fileList.map((item) => item.url).join(","), |
|
|
|
// isTop : this.form.topId ? 'Y' : 'N', |
|
|
|
// } |
|
|
|
|
|
|
|
if(this.id){ |
|
|
|
data.id = this.id |
|
|
|
} |
|
|
|
// if(this.id){ |
|
|
|
// data.id = this.id |
|
|
|
// } |
|
|
|
|
|
|
|
this.$api('infoReleaseTrends', data, |
|
|
|
res => { |
|
|
|
if(res.code == 200){ |
|
|
|
if(self.form.topId && !this.id){ |
|
|
|
uni.requestPayment({ |
|
|
|
provider: 'wxpay', // 服务提提供商 |
|
|
|
timeStamp: res.result.timeStamp, // 时间戳 |
|
|
|
nonceStr: res.result.nonceStr, // 随机字符串 |
|
|
|
package: res.result.packageValue, |
|
|
|
signType: res.result.signType, // 签名算法 |
|
|
|
paySign: res.result.paySign, // 签名 |
|
|
|
success: function (res) { |
|
|
|
console.log('支付成功',res); |
|
|
|
self.$refs.confirmationPopupUpload.open() |
|
|
|
// self.$refs.confirmationPopup.close() |
|
|
|
}, |
|
|
|
fail: function (err) { |
|
|
|
console.log('支付失败',err); |
|
|
|
self.$refs.confirmationPopup.close() |
|
|
|
uni.showToast({ |
|
|
|
icon:'none', |
|
|
|
title:"支付失败" |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
self.$refs.confirmationPopupUpload.open() |
|
|
|
} |
|
|
|
// this.$api('infoReleaseTrends', data, |
|
|
|
// res => { |
|
|
|
// if(res.code == 200){ |
|
|
|
// if(self.form.topId && !this.id){ |
|
|
|
// uni.requestPayment({ |
|
|
|
// provider: 'wxpay', // 服务提提供商 |
|
|
|
// timeStamp: res.result.timeStamp, // 时间戳 |
|
|
|
// nonceStr: res.result.nonceStr, // 随机字符串 |
|
|
|
// package: res.result.packageValue, |
|
|
|
// signType: res.result.signType, // 签名算法 |
|
|
|
// paySign: res.result.paySign, // 签名 |
|
|
|
// success: function (res) { |
|
|
|
// console.log('支付成功',res); |
|
|
|
// self.$refs.confirmationPopupUpload.open() |
|
|
|
// // self.$refs.confirmationPopup.close() |
|
|
|
// }, |
|
|
|
// fail: function (err) { |
|
|
|
// console.log('支付失败',err); |
|
|
|
// self.$refs.confirmationPopup.close() |
|
|
|
// uni.showToast({ |
|
|
|
// icon:'none', |
|
|
|
// title:"支付失败" |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// }else{ |
|
|
|
// self.$refs.confirmationPopupUpload.open() |
|
|
|
// } |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
}, |
|
|
|
// }, |
|
|
|
|
|
|
|
// 提交 |
|
|
|
submit(){ |
|
|
@ -282,6 +323,9 @@ |
|
|
|
} |
|
|
|
.content-input{ |
|
|
|
min-height: 400rpx; |
|
|
|
/deep/ .uv-textarea{ |
|
|
|
min-height: 400rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
.upTop{ |
|
|
|
.title{ |
|
|
|