Commit 9f34c73e by wjw

ww-订单评价

parent 89b09175
......@@ -9,7 +9,10 @@ Page({
scoreProductText: '0.0',
scoreEnvironment: 0, // 环境分数
scoreEnvironmentText: '0.0',
content: '', // 评价内容,
imgUrls: [], // 评价图片
orderInfo: {
orderId: '02aaa9a62d5645c59109218c27d2174a',
name: '精灵鸟理想国年卡',
price: '1680.00',
quantity: 4,
......@@ -18,16 +21,16 @@ Page({
id: 0,
imgUrl: ''
},
// {
// id: 1,
// imgUrl: ''
// },
// {
// id: 2,
// imgUrl: ''
// }
{
id: 1,
imgUrl: ''
},
{
id: 2,
imgUrl: ''
}
]
}
},
},
/**
......@@ -37,6 +40,7 @@ Page({
* @returns
*/
onChangeScore: function (event) {
// type 1: 服务评价 2: 产品评价 3: 环境评价
const { index, type } = event.currentTarget.dataset
console.log(index, type)
let { scoreServe, scoreProduct, scoreEnvironment } = this.data
......@@ -67,6 +71,62 @@ Page({
* @returns
*/
eventInputDone: function (event) {
// console.log(event.detail.value)
let content = event.detail.value
this.setData({
content
})
},
/**
* 新增评价图片
* @function
* @param
* @returns
*/
eventImageAdd: function (event) {
console.log(event.detail.all[0])
let imgUrl = event.detail.all[0].url
let imgUrls = []
imgUrls.push(imgUrl)
this.setData({
imgUrls
})
},
/**
* 移除评价图片
* @function
* @param
* @returns
*/
eventImageRemove: function (event) {
console.log(event.detail.all)
},
/**
* 提交订单
* @function
* @param
* @returns
*/
onSubmitCommennt: function () {
console.log('submit')
let funcFile = this.data.imgUrls[0]
wx.uploadFile({
url: App.globalData.baseUrl + '/api/v1/common/upload',
filePath: funcFile,
name: 'file',
header: {
'Content-Type': 'multipart/form-data',
'token': App.globalData.token
},
success: (res) => {
console.log(res)
}
})
// let formData = {}
// formData.orderId = this.data.orderInfo.orderId
// formData.imgUrls = '',
// formData.serviceEvaluation = this.data.scoreServe
// formData.productEvaluation = this.data.scoreProduct
// formData.environmentalEvaluation = this.data.scoreEnvironment
// formData.content = this.data.content
}
})
\ No newline at end of file
......@@ -83,7 +83,7 @@
<view class="order-comment">
<l-textarea placeholder="您的评价与建议,会让园区做的更好" placeholder-style="color: #C2C7CF" maxlength="200" l-class="l-textarea" border="{{false}}" bind:linblur="eventInputDone" />
<view class="order-picker">
<l-image-picker l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed" custom="{{true}}">
<l-image-picker l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed" custom="{{true}}" bind:linchange="eventImageAdd" bind:linremove="eventImageRemove">
<view class="col con-c align-c">
<image class="icon-img"></image>
<text>添加图片</text>
......@@ -93,7 +93,7 @@
</view>
</view>
<view class="footer-wrapper">
<view class="comment-btn">
<view class="comment-btn" bindtap="onSubmitCommennt">
<text>提交评价</text>
</view>
</view>
......
......@@ -148,8 +148,8 @@
},
{
"id": 11,
"name": "pages/play/movie-detail/movie-detail",
"pathName": "pages/play/movie-detail/movie-detail",
"name": "pages/play/movie/movie",
"pathName": "pages/play/movie/movie",
"query": "",
"scene": null
},
......@@ -159,6 +159,13 @@
"pathName": "pages/play/home/home",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/play/service-detail/service-detail",
"pathName": "pages/play/service-detail/service-detail",
"query": "",
"scene": null
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment