Feat(时令尝鲜):接口对接
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="page-content">-->
|
||||
<!-- <view class="title">历史搜索</view>-->
|
||||
<!-- </view>-->
|
||||
|
||||
<view class="page-content" v-if="keywords.length">
|
||||
<view class="title">热门搜索</view>
|
||||
<view class="list acea-row">
|
||||
@@ -62,12 +66,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
.good-search {
|
||||
min-height: 100vh;
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
.good-search {
|
||||
|
||||
.header {
|
||||
padding: 40rpx 32rpx 32rpx;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- 原模块 -->
|
||||
<view class="change-section bg-white" v-if="from===''">
|
||||
<view class="introduce bold">{{ storeInfo.storeName }}</view>
|
||||
<view class="subInfo" v-if="storeInfo.storeInfo">{{ storeInfo.storeInfo }}</view>
|
||||
<rich-text class="subInfo" :nodes="storeInfo.storeInfo" v-if="storeInfo.storeInfo"/>
|
||||
<view class="share acea-row row-between row-middle" style="flex-wrap: nowrap;">
|
||||
<view class="money font-color-lightred acea-row ai-end">
|
||||
<text class="num">¥{{ attr.productSelect.price }}</text>
|
||||
|
||||
@@ -32,23 +32,33 @@
|
||||
</view>
|
||||
<view class="textarea">
|
||||
<textarea placeholder="商品满足你的期待么?说说你的想法,分享给想买的他们吧~" v-model="expect"></textarea>
|
||||
<view class="list acea-row row-middle">
|
||||
<view
|
||||
class="pictrue"
|
||||
v-for="(item, uploadPicturesIndex) in uploadPictures"
|
||||
:key="uploadPicturesIndex"
|
||||
>
|
||||
<image :src="item"/>
|
||||
<text
|
||||
class="iconfont icon-guanbi1 font-color-red"
|
||||
@click="uploadPictures.splice(uploadPicturesIndex, 1)"
|
||||
></text>
|
||||
</view>
|
||||
<view class="pictrue uploadBnt acea-row row-center-wrapper row-column" @tap="chooseImage">
|
||||
<text class="iconfont icon-icon25201"></text>
|
||||
<view>上传图片</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-upload
|
||||
:fileList="uploadPictures"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
name="uploadPictures"
|
||||
multiple
|
||||
:maxCount="9"
|
||||
></u-upload>
|
||||
<!-- <view class="list acea-row row-middle">-->
|
||||
<!-- <view-->
|
||||
<!-- class="pictrue"-->
|
||||
<!-- v-for="(item, uploadPicturesIndex) in uploadPictures"-->
|
||||
<!-- :key="uploadPicturesIndex"-->
|
||||
<!-- >-->
|
||||
<!-- <image :src="item"/>-->
|
||||
<!-- <text-->
|
||||
<!-- class="iconfont icon-guanbi1 font-color-red"-->
|
||||
<!-- @click="uploadPictures.splice(uploadPicturesIndex, 1)"-->
|
||||
<!-- ></text>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="pictrue uploadBnt acea-row row-center-wrapper row-column" @tap="chooseImage">-->
|
||||
<!-- <text class="iconfont icon-icon25201"></text>-->
|
||||
<!-- <view>上传图片</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
|
||||
</view>
|
||||
<view class="evaluateBnt bg-color-red" @click="submit">立即评价</view>
|
||||
</view>
|
||||
@@ -61,7 +71,7 @@
|
||||
</style>
|
||||
<script>
|
||||
import {postOrderComment, postOrderProduct} from "@/api/store";
|
||||
import {chooseImage, trim} from "@/utils";
|
||||
import {trim, uploadImage} from "@/utils";
|
||||
import {required} from "@/utils/validate";
|
||||
import {validatorDefaultCatch} from "@/utils/dialog";
|
||||
|
||||
@@ -124,10 +134,26 @@ export default {
|
||||
stars: function (indexn, indexw) {
|
||||
this.scoreList[indexw].index = indexn;
|
||||
},
|
||||
chooseImage() {
|
||||
chooseImage(img => {
|
||||
this.uploadPictures.push(img);
|
||||
});
|
||||
// chooseImage() {
|
||||
// chooseImage(img => {
|
||||
// this.uploadPictures.push(img);
|
||||
// });
|
||||
// },
|
||||
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`${event.name}`].splice(event.index, 1)
|
||||
},
|
||||
|
||||
afterRead(event) {
|
||||
let that = this;
|
||||
if (event.file.length > 0) {
|
||||
event.file.map(item => {
|
||||
uploadImage(item.url, img => {
|
||||
that.uploadPictures.push({url: img})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
async submit() {
|
||||
const expect = trim(this.expect),
|
||||
@@ -154,11 +180,14 @@ export default {
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
|
||||
let temp = this.uploadPictures.map(item => item.url)
|
||||
let pics = temp.join(",")
|
||||
postOrderComment({
|
||||
productScore: product_score,
|
||||
serviceScore: service_score,
|
||||
unique: this.unique,
|
||||
pics: this.uploadPictures.join(","),
|
||||
pics,
|
||||
comment: expect
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user